1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-20 22:05:15 +00:00
qb64/internal/help/$STATIC.txt
Luke Ceddia b586eafd3b Integrated _BLINEINPUT into regular LINE INPUT for BINARY files
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.
2014-07-27 00:06:17 +10:00

35 lines
1.2 KiB
Plaintext

The '''$STATIC''' Metacommand allows the creation of STATIC(un-changeable) arrays.
{{PageSyntax}}
::: REM '''$STATIC'''
* Qbasic [[Metacommand]]s require a REM or apostrophy (') before them and are normally placed at the start of the main module.
* Static arrays cannot be resized. If a variable is used to size any array, it becomes [[$DYNAMIC]].
* A [[REDIM]] statement has no effect on [[$STATIC]] arrays except perhaps a [[ERROR Codes|duplicate definition error]] at the [[REDIM]] code.
* The array's type cannot be changed once [[DIM]] and a literal value sets the dimensions and element size.
* [[$STATIC]] defined program [[arrays]] cannot be [[REDIM|re-sized]] or use [[_PRESERVE]].
''Example:'' When a variable is used, the array can be resized despite $STATIC. The array becomes [[$DYNAMIC]].
{{CodeStart}} '' ''
'{{Cl|$STATIC}}
{{Cl|INPUT}} "Enter array size: ", size
{{Cl|DIM}} array(size) 'using an actual number instead of the variable will create an error!
{{Cl|REDIM}} array(2 * size)
{{Cl|PRINT}} {{Cl|UBOUND}}(array) '' ''
{{CodeEnd}}
: ''Note:'' [[DIM]] using a literal numerical size will create a Duplicate definition error.
''See also:''
* [[$DYNAMIC]], [[STATIC]]
* [[Arrays]], [[Metacommand]]
{{PageNavigation}}