Difference between revisions of "VARSEG"

From QB64 Wiki
Jump to navigation Jump to search
Line 15: Line 15:
  
  
''See also:'' [[BSAVE]], [[BLOAD]], [[SADD]], [[VARPTR]], [[VARPTR$]], [[POKE]], [[PEEK]]
+
''See also:'' [[BSAVE]], [[BLOAD]], [[SADD]], [[DEF SEG]], [[VARPTR]], [[VARPTR$]], [[POKE]], [[PEEK]]
  
  

Revision as of 01:56, 7 October 2009

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