Passing TEXT/BYTE values as parameter
BYTE
or TEXT
data types define large data object
(LOB) handlers internally implemented as "locators".
When you pass a BYTE
or TEXT
to a function, the locator is
pushed on the stack and popped to the receiving BYTE
or TEXT
variable in the function. The actual LOB data is not copied, only the locator is passed by
value.
Important: Since the information of the locator structure is copied (like the file name
specified with a
LOCATE IN FILE
instruction). If you modify the locator storage information inside the function with a
LOCATE
instruction, the locator in the caller will become invalid. Therefore, only
read and write the actual data of BYTE
and TEXT
parameters in
functions, do not modify the storage.