Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 8091 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

CASE does not exist as a SCRIPT step. The only conditional scripting control is the IF/ELSE steps.

Posted

Indeed you can, Nick!

The Case ( ) function, used within a Set Field command will in some instances provide for a much more compact script sytax - where, for example, the following sequence:

If ["IsEmpty(EventDate)"]

Set Field ["WhenHappens.txt", " "Unknown" "]

Else

If ["EventDate" < Status(CurrentDate)"]

Set Field ["WhenHappens.txt", " "Already Over" "]

Else

If ["EventDate" = Status(CurrentDate)"]

Set Field ["WhenHappens.txt", " "Today!" "]

Else

If ["EventDate" > Status(CurrentDate)"]

Set Field ["WhenHappens.txt", " "Not Yet..." "]

EndIf

EnfIf

EndIf

EndIf


Can be achieved rather more neatly with a single step, using the following:

Set Field ["WhenHappens.txt", "Case(IsEmpty(EventDate), "Unknown", 

EventDate" < Status(CurrentDate), "Already Over",

EventDate" = Status(CurrentDate), "Today!", "Not Yet..." "]


There are many uses for this technique.

This topic is 8091 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.