Examples
The examples below illustrate the use of 4GL names and expressions.
In the following example, "nextframe" is understood as a literal because no colon precedes it and because the callframe parameter is always a 4GL name.
callframe nextframe ;
You can use a quoted string in a 4GL name; the quotation marks do not affect the interpretation of the statement; the next statement has the same effect as the first statement.
callframe 'nextframe' ;
The name "frametocall" in the example below is the name of a field on a form; thus, this is a field assignment. Neither side is a 4GL name. The word "nextframe" is an expression (a string literal) and therefore must be quoted. Without quotes, 4GL expects to substitute a value from a field or variable named 'nextframe.'
frametocall := 'nextframe';
In the following example, "Lastframe" is a field or variable containing a valid frame name. These are field assignments with substitution intended. Either is correct because the right-hand side is always considered an expression.
frametocall := lastframe ;
frametocall := :lastframe ;
The following example uses a 4GL name to allow substitution of a value from the specified field. The colon is required; otherwise the string is interpreted as a literal, as in the first example above.
callframe :frametocall ;
In this statement, "frametocall" is a field name. Its value is "nextframe," the name of a frame in the application. Because it is not prefixed with a colon, callframe attempts to call a frame named "frametocall," generating an error.
callframe frametocall ; /* error */
Last modified date: 08/14/2024