This will evaluate the contents of a value set by the “Set Value” or “File Actions” commands. The script commands that you place between this statement, and an “...End If” statement are only executed if the test returns true.
- In the “value name” field, enter the name of the value to evaluation. Do not enclose it in square brackets.
- In the “comparison type” field, select a comparison type.
- In the “compare to” field, enter a constant or the name of a value in square brackets.
Example: File Actions: Get File Size “c:\windows\win.ini”
Set Value: SaveSize, [FileSize]
Start Program: c:\install\setup.exe, wait for program end
File Actions: Get File Size “c:\windows\win.ini”
If Value: SaveSize <> [FileSize]
Display Message: “WIN.INI was changed”
...End If
Reserved names:
- [FILESIZE] – The result of the last File Action “Get File Size” script command.
- [FILEDATE] – The result of the last File Action “Get File Date” script command in yyyymmdd format.
- [FILETIME] – The result of the last File Action “Get File Time” script command in hhmmss format.
- [FILEEXISTS] – The result of the last File Action “File Exists” script command, with 0 representing False, and 1 representing True.
- [FOCUS] – The title of the window that currently has focus.
- [TODAY] – Today’s date in the standard Windows short date format. For alternate formats, use [MM-DD-YY], [YY-MM-DD], or [DD-MM-YY] (the year 2000 will show as 00). [YESTERDAY] returns yesterday’s date in the standard Windows short date format.
- [DATE] – Today’s date in yyyymmdd format.
- [NOW] – The current time in standard Windows short time format.
- [TIME] – The current time in hhmmss format.
- [CLIPBOARD] – The text contents of the clipboard.
- [EXITCODE] – The exit code returned by a program started from within a script, where “wait for program to end” was selected.
- [RESPONSE] – The button number pressed by the user in response to a “Display Message” script action using the standard Windows message box. See the “Display Message” script action.
- [= equation] – The simple equation or standard Clarion function will be evaluated. Example: “[= Exitcode*-1] error code on [= FORMAT(TODAY(),@D1-)]”. Consult CLARION.HLP for further information.
Note: If either side of a comparison contains a number greater than or less than 0, the comparison is done as a number. This ensures that a comparison such as 100>99 returns true. A string comparison would have returned false.
If the variable name contains a number (pound) sign (“#”), the comparison is done as a number. This allows you to force a numeric comparison, even if both sides are non-numeric or zero.
Comparisons using FILEEXISTS, FILESIZE, FILEDATE, FILETIME, TIME, and DATE in the “value name” field are always numeric.