mirror of
https://github.com/QB64Official/qb64.git
synced 2024-09-16 03:54:01 +00:00
b586eafd3b
LINE INPUT will now use the faster method if passed a file handle that has been opened FOR BINARY. As such, the _BLINEINPUT command has been removed. qb64.bas now takes advantage of this for reading from '$include files, at least in Include Manager 1. Some tweaking of internal/source/main.txt was required to get things into a sane state, so I'm holing off changing the compiler any further so the auto-builder can make sure everything's smoothed over. Note: Everything should still compile as normal; I'm just being overcautious.
24 lines
No EOL
1.2 KiB
Text
24 lines
No EOL
1.2 KiB
Text
The '''VARPTR''' function returns an [[INTEGER]] value that is the offset part of the variable or array memory address within it's segment.
|
|
|
|
|
|
{{PageSyntax}}
|
|
:: 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!
|
|
* Integer array sizes are limited to 32767 elements when using [[VARPTR]] in QB and '''QB64'''!. Create a larger array using [[_BYTE]]. Example: [[DIM]] [[SHARED]] Memory (65535) AS [[_UNSIGNED]] [[_BYTE]]
|
|
* '''Warning: DEF SEG, VARSEG , VARPTR, PEEK or POKE access QB64's emulated 16 bit conventional memory block!'''
|
|
: '''It is highly recommended that QB64's [[_MEM]] memory system be used to avoid running out of memory.'''
|
|
|
|
|
|
''See also:''
|
|
* [[BSAVE]], [[BLOAD]]
|
|
* [[SADD]], [[DEF SEG]]
|
|
* [[VARPTR$]], [[VARSEG]],
|
|
* [[POKE]], [[PEEK]]
|
|
|
|
|
|
{{PageNavigation}} |