Difference between revisions of "VARPTR"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
m
Line 13: Line 13:
  
  
''See also:'' [[BSAVE]], [[BLOAD]], [[SADD]]
+
''See also:'' [[BSAVE]], [[BLOAD]], [[SADD]], [[VARPTR$]], [[VARSEG]], [[POKE]], [[PEEK]]
  
  

Revision as of 01:52, 7 October 2009

The VARPTR function returns an INTEGER value that is the offset part of the variable or array memory address within it's segment.


Syntax: offset% = VARPTR(variable_name[(reference_index%)])


  • If variablename is not defined before VARPTR or VARSEG is called, the variable is created and it's address is returned.
  • Reference index is used to set the offset address of an array index, not necessarily the lowest index.
  • When a string variable, VARPTR returns the offset address location 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, VARPTR$, VARSEG, POKE, PEEK




Navigation:

Go to Keyword Reference - Alphabetical

Go to Keyword Reference - By usage