Difference between revisions of "VARSEG"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
m
Line 1: Line 1:
 
The '''VARSEG''' function returns an [[INTEGER]] value that is the segment part of a variable or array memory address.  
 
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)])
 
:::''Syntax:'' [[DEF SEG]] = VARSEG(variable_name[(start_index)])
 
  
  
Line 15: Line 13:
  
  
''See also:'' [[BSAVE]], [[BLOAD]], [[SADD]], [[DEF SEG]], [[VARPTR]], [[VARPTR$]], [[POKE]], [[PEEK]]
+
''See also:''  
 +
 
 +
* [[BSAVE]], [[BLOAD]]  
 +
 
 +
* [[SADD]], [[DEF SEG]]  
  
 +
* [[VARPTR]], [[VARPTR$]]
  
 +
* [[POKE]], [[PEEK]]
  
==Navigation:==
 
  
[[Keyword_Reference_-_Alphabetical|Go to Keyword Reference - Alphabetical]]
 
  
[[Keyword Reference - By usage|Go to Keyword Reference - By usage]]
+
{{PageNavigation}}

Revision as of 11:08, 15 October 2010

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:




Navigation:
Keyword Reference - Alphabetical
Keyword Reference - By Usage
Main Wiki Page