13.07.2015 Views

Turbo Basic

Turbo Basic

Turbo Basic

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

VARSEG functionFunctionSyntaxRemarksSee AlsoExampleVARSEG returns the segment address of a variable.y = VARSEG(variable)variable is any numeric or string variable or element of an array.Because of <strong>Turbo</strong> <strong>Basic</strong>'s expanded memory model. VARSEG isrequired along with VARPTR to fully define the address of avariable.VARSEG returns a numeric value in the range 0 to 65,535. UseVARSEG in conjunction with VARPTR to get the address of a variable,so that a CALL can tell an assembly language routine wherethe argument it should process is located in memory.<strong>Turbo</strong> <strong>Basic</strong> programs put all nonarray variables in a single segmentthat can be up t064K in length. Therefore, using VARSEG onall the nonarray variables in a given program always returns thesame value. In fact, this segment value is the default for statementsthat rely on DEF SEC (for example, PEEK, POKE).VARPTR, B% = 55DEF SEG = VARSEG(B%)Address% = VARPTR(B%)PRINT PEEK(Address%)END 'end the program370<strong>Turbo</strong> <strong>Basic</strong> Owner's Handbook

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

Saved successfully!

Ooh no, something went wrong!