Tech Tip: Typing Variables using Compiler Directives
PRODUCT: 4D | VERSION: | PLATFORM:
Published On: June 18, 1999
Type the following code and execute it. You will find that the variable $0 remains undefined. How is this possible?
` Project Method: Method1
C_STRING(255;$0)
$0:="4D."
The variable $0 is a reserved variable that can only be used for returning information to another method. Since I haven't called this method from another method, there is nothing to return and therefore $0 remains undefined. If you were to call Method1 from another method as shown below, you would find $0 functioning as you would expect.
` Project Method: Method2
C_STRING(255;vtName)
vtName:=Method1
You could also have a one line method such as:
` Project Method: Method3
Method1