4D v13.4Constants |
||
|
4D v13.4
Constants
Constants
A constant is an expression that has a fixed value. There are two types of constants: predefined constants that you select by name, and literal constants for which you type the actual value. 4D provides a set of predefined constants. These constants are grouped by themes in the Explorer Window: To use a predefined constant in a Method editor window:
Predefined constant names can contain up to 31 characters. Predefined constants appeared underlined by default within the Method Editor and Debugger windows: In the window shown here, On Load, for example, is a predefined constant. Literal Constants can be of four data types:
A string constant is enclosed in double, straight quotation marks ("…"). Here are some examples of string constants: "Add Records" An empty string is specified by two quotation marks with nothing between them (""). A numeric constant is written as a real number. Here are some examples of numeric constants: 27 Negative numbers are specified with the minus sign(–). For example: –27 A date constant is enclosed by exclamation marks (!…!). In the US English version of 4D, a date is ordered month/day/year, with a slash (/) setting off each part. Here are some examples of date constants that you can enter in the Method editor: !1/1/76! Note: A two-digit year is assumed to be in the 1900’s. Unless this default setting has been changed using the SET DEFAULT CENTURY command. A null date is specified by !00/00/00! Tip: The Method Editor includes a shortcut for entering a null date. To type a null date, enter the exclamation (!) character and press Enter. A time constant is enclosed by question marks (?...?). In the US English version of 4D, a time constant is ordered hour:minute:second, with a colon (:) setting off each part. Times are specified in 24-hour format. Here are some examples of time constants: ?00:00:00? ` midnight A null time is specified by ?00:00:00? Tip: The Method Editor includes a shortcut for entering a null time. To type a null time, enter the question mark (?) character and press Enter. |
PROPERTIES
Product: 4D SEE ALSO
Control Flow |