LOCATE

 

LOCATE statement specifies the location where the values for the variables of large data types are stored. It is the initialization method used for the variables of the large data types.

 

 

Element

Description

Variable List

A list of variables of large data types (TEXT or BYTE)

Title

A character expression returning a valid file name and optional path

 

LOCATE statement is used to specify the location where you want to store the values for the of the TEXT or BYTE variables. These values can be stored in the memory or in a file. The values stored in the memory can be accessed faster. However, if your program exceeds the storage space allocated for it in the memory, a part of the value of large data type will be stored in a file. The variables of the large data types can be used in a 4GL program in the following way:

  1. Declare a variable of the large data type with the help of the DEFINE statement

  2. Use the LOCATE statement to specify the storage location for this variable. The LOCATE statement must be used within the scope of reference of the variable.

 

LOCATE statement must follow any DEFINE statement that declares a variable of the large data type. If the variable is local, the LOCATE statement must occur within the same program block. If you try to use a variable of the large data type which has not been initialized with the help of the LOCATE statement, an error will occur.