Jump to navigation Jump to search
The VARSEG function returns an INTEGER value that is the segment part of a variable or array memory address.
- Syntax: DEF SEG = VARSEG(variable_name[(start_index)])
- If variablename is not defined before VARPTR or VARSEG is called, the variable is created and its address is returned.
- The start index is the lowest index of an array variable when used.
- When a string variable, VARSEG returns the segment location address of the first byte of the string.
- Because many Qbasic statements change the locations of variables in memory, use the values returned by VARPTR and VARSEG immediately after the functions are used!