VARSEG

From QB64 Wiki
Revision as of 01:56, 7 October 2009 by 90.231.62.232 (talk)
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!


See also: BSAVE, BLOAD, SADD, DEF SEG, VARPTR, VARPTR$, POKE, PEEK


Navigation:

Go to Keyword Reference - Alphabetical

Go to Keyword Reference - By usage