The return value of the process currently run can be assigned. The return value is stored and the process continues to run
// By default, return "" if the sought value is not found
RETURN = ""
// Open the data file
// Find the record
HReadSeek(AFile, SoughtItem, SoughtValue)
// Retrieve the item if the record was found
IF HFound() = True THEN
RETURN = AFile.Item
// Close the data file again
Value to return.
- There is no need to use the RETURN keyword at the end of the process: the stored value is automatically returned.
- The return value can be assigned several times: the stored value always corresponds to the last assigned value.
- To read the stored value again, use the RETURN keyword:
PROCEDURE MyProcedure(): int
RETURN = 1
Trace("Returned value:" + RETURN)
- To exit the process before the end of the code and return the stored value, use the RETURN keyword.
- To exit the process before the end of the code and return a value different from the stored value, use the standard syntax: