17.07.2013 Views

GWBASIC User's Manual

GWBASIC User's Manual

GWBASIC User's Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

GW-BASIC <strong>User's</strong> Guide<br />

VARPTR$ Function<br />

Purpose:<br />

To return a character form of the offset of a variable in memory.<br />

Syntax:<br />

VARPTR$(variable)<br />

Comments:<br />

variable is the name of a variable that exists in the program.<br />

Note<br />

Assign all simple variables before calling VARPTR$ for an array element, because the array<br />

addresses change when a new simple variable is assigned.<br />

VARPTR$ returns a three-byte string of the following form:<br />

| Byte 0 | Byte 1 | Byte 2 |<br />

Byte 0 contains one of the following variable types:<br />

2 integer<br />

3 string<br />

4 single-precision<br />

8 double precision<br />

Byte 1 contains the 8086 address format, and is the least significant byte.<br />

Byte 2 contains the 8086 address format, and is the most significant byte.<br />

Examples:<br />

100 X = USR(VARPTR$(Y))<br />

file:///C|/Documents%20and%20Settings/Lorenzo/Desktop/GW%20Basic/VARPTRS.html28/03/2004 21.29.51

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!