mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-07-06 01:10:23 +00:00
Updates help files.
This commit is contained in:
parent
87114ffc38
commit
443cbb39a3
|
@ -14,9 +14,15 @@
|
||||||
* $IF is the start of a precompiler code block which includes or excludes sections of code from being compiled.
|
* $IF is the start of a precompiler code block which includes or excludes sections of code from being compiled.
|
||||||
* There is no single line $IF statement. $IF must be in a valid $IF THEN...$END IF block to work properly.
|
* There is no single line $IF statement. $IF must be in a valid $IF THEN...$END IF block to work properly.
|
||||||
* Like all other metacommands, you can not use more than one metacommand per line. '''Use of : to separate statements in a single line is not allowed.'''
|
* Like all other metacommands, you can not use more than one metacommand per line. '''Use of : to separate statements in a single line is not allowed.'''
|
||||||
* Variable names can contain numbers, letters, and periods -- in any order.
|
* Variable names can contain numbers, letters and periods, in any order.
|
||||||
* Expressions can contain one set of leading and/or trailing quotes; and any number of numbers, letters, and periods, in any order.
|
* Expressions can contain one set of leading and/or trailing quotes; and any number of numbers, letters and periods, in any order.
|
||||||
* The precompiler comes with some preset values which can be used to help determine which code blocks to include/exclude. These are: '''WIN''' or '''WINDOWS''' if the user is running QB64 in a Windows environment. '''LINUX''' if the user is running QB64 in a Linux environment. '''MAC''' or '''MACOSX''' if the user is running QB64 in a macOS environment. '''32BIT''' if the user is running a 32-bit version of QB64. '''64BIT''' if the user is running a 64-bit version of QB64.
|
* The precompiler comes with some preset values which can be used to help determine which code blocks to include/exclude. These are:
|
||||||
|
** '''WIN''' or '''WINDOWS''' if the user is running QB64 in a Windows environment.
|
||||||
|
** '''LINUX''' if the user is running QB64 in a Linux environment.
|
||||||
|
** '''MAC''' or '''MACOSX''' if the user is running QB64 in a macOS environment.
|
||||||
|
** '''32BIT''' if the user is running a 32-bit version of QB64.
|
||||||
|
** '''64BIT''' if the user is running a 64-bit version of QB64.
|
||||||
|
** '''VERSION''', which is set to the version of the QB64 compiler. This is a number and can be ordered, see example below.
|
||||||
* [[$END IF]] denotes the end of a valid precompiler $IF block.
|
* [[$END IF]] denotes the end of a valid precompiler $IF block.
|
||||||
* [[$ELSEIF]] must follow a valid $IF or $ELSEIF statement.
|
* [[$ELSEIF]] must follow a valid $IF or $ELSEIF statement.
|
||||||
* If [[$ELSE]] is used, it must be used as the last conditional check before $END IF. $ELSEIF cannot come after $ELSE.
|
* If [[$ELSE]] is used, it must be used as the last conditional check before $END IF. $ELSEIF cannot come after $ELSE.
|
||||||
|
@ -58,8 +64,19 @@ The [[$LET]] and $IF statements let the programmer control the code that actuall
|
||||||
''Explanation:'' For the above, the CONST slash is defined by the automatic internal flags which returns what operating system is being used at compile time. On a Windows PC, the Slash will be the backslash; for any other OS it will be the forward slash.
|
''Explanation:'' For the above, the CONST slash is defined by the automatic internal flags which returns what operating system is being used at compile time. On a Windows PC, the Slash will be the backslash; for any other OS it will be the forward slash.
|
||||||
|
|
||||||
|
|
||||||
|
''Example 3:''
|
||||||
|
{{CodeStart}} '' ''
|
||||||
|
{{Cl|$IF}} VERSION < 1.5 THEN
|
||||||
|
{{Cl|$ERROR}} Requires QB64 version 1.5 or greater
|
||||||
|
{{Cl|$END IF}}
|
||||||
|
{{CodeEnd}}
|
||||||
|
|
||||||
|
''Explanation:'' VERSION is a predefined variable that holds the QB64 compiler version. If we know our program needs features only available above a certain version, we can check for that and give the user a helpful error message instead of a confusing error elsewhere in the program.
|
||||||
|
|
||||||
|
|
||||||
{{PageSeeAlso}}
|
{{PageSeeAlso}}
|
||||||
* [[$LET]]
|
* [[$LET]]
|
||||||
|
* [[$ERROR]]
|
||||||
* [[Metacommand]]s
|
* [[Metacommand]]s
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -142,6 +142,7 @@ __NOTOC__
|
||||||
* [[$ELSE]] (Pre-Compiler [[Metacommand]]) {{text|used in conjunction with $IF for the precompiler.}}
|
* [[$ELSE]] (Pre-Compiler [[Metacommand]]) {{text|used in conjunction with $IF for the precompiler.}}
|
||||||
* [[$ELSEIF]] (Pre-Compiler [[Metacommand]]) {{text|used in conjunction with $IF for the precompiler.}}
|
* [[$ELSEIF]] (Pre-Compiler [[Metacommand]]) {{text|used in conjunction with $IF for the precompiler.}}
|
||||||
* [[$END IF]] (Pre-Compiler [[Metacommand]]) {{text|used in conjunction with $IF for the precompiler.}}
|
* [[$END IF]] (Pre-Compiler [[Metacommand]]) {{text|used in conjunction with $IF for the precompiler.}}
|
||||||
|
* [[$ERROR]] (Pre-Compiler [[Metacommand]]) {{text|used to trigger compiler errors.}}
|
||||||
* [[_ERRORLINE]] (function) {{text|returns the source code line number that caused the most recent runtime error.}}
|
* [[_ERRORLINE]] (function) {{text|returns the source code line number that caused the most recent runtime error.}}
|
||||||
* [[_ERRORMESSAGE$]] (function) {{text|returns a human-readable message describing the most recent runtime error.}}
|
* [[_ERRORMESSAGE$]] (function) {{text|returns a human-readable message describing the most recent runtime error.}}
|
||||||
* [[$EXEICON]] (Pre-Compiler [[Metacommand]]) {{text|used with a .ICO icon file name to embed the image into the QB64 executable.}}
|
* [[$EXEICON]] (Pre-Compiler [[Metacommand]]) {{text|used with a .ICO icon file name to embed the image into the QB64 executable.}}
|
||||||
|
|
|
@ -657,6 +657,7 @@ The following table describes the error codes that are reported by the '''QB64''
|
||||||
|
|
||||||
* [[$CHECKING]]:OFF/ON {{text|(QB64 only) turns event and error checking ON and OFF. ON (default) can only be used after it is OFF.}}
|
* [[$CHECKING]]:OFF/ON {{text|(QB64 only) turns event and error checking ON and OFF. ON (default) can only be used after it is OFF.}}
|
||||||
* [[$CONSOLE]] {{text|creates a console window throughout the program.}}
|
* [[$CONSOLE]] {{text|creates a console window throughout the program.}}
|
||||||
|
* [[$ERROR]] (Pre-Compiler [[Metacommand]]) {{text|used to trigger compiler errors.}}
|
||||||
* [[$SCREENHIDE]] {{text|hides the program window throughout the program until [[$SCREENSHOW]] is used.}}
|
* [[$SCREENHIDE]] {{text|hides the program window throughout the program until [[$SCREENSHOW]] is used.}}
|
||||||
* [[$SCREENSHOW]] {{text|displays the main program window throughout the program only after [[$SCREENHIDE]] or [[_SCREENHIDE]] has been used.}}
|
* [[$SCREENSHOW]] {{text|displays the main program window throughout the program only after [[$SCREENHIDE]] or [[_SCREENHIDE]] has been used.}}
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,8 @@
|
||||||
|
|
||||||
:[[$IF]]...[[$END IF]] 'precompiler directive
|
:[[$IF]]...[[$END IF]] 'precompiler directive
|
||||||
|
|
||||||
|
: [[$ERROR]] MESSAGE 'trigger a compilation error, useful inside $IF blocks
|
||||||
|
|
||||||
|
|
||||||
===Description===
|
===Description===
|
||||||
* [[$INCLUDE]] can be used at the beginning or at the end of program SUB procedures.
|
* [[$INCLUDE]] can be used at the beginning or at the end of program SUB procedures.
|
||||||
|
@ -44,6 +46,7 @@
|
||||||
* [[$RESIZE]]:ON allows a user to resize the program window. OFF is default.
|
* [[$RESIZE]]:ON allows a user to resize the program window. OFF is default.
|
||||||
* [[$SCREENHIDE]] hides the QB64 program window throughout the program until [[$SCREENSHOW]] is used.
|
* [[$SCREENHIDE]] hides the QB64 program window throughout the program until [[$SCREENSHOW]] is used.
|
||||||
* [[$IF]]...[[$END IF]] allows selective inclusion of code in the final program.
|
* [[$IF]]...[[$END IF]] allows selective inclusion of code in the final program.
|
||||||
|
* [[$ERROR]] MESSAGE causes a compilation error whenever QB64 attempts to compile it, displaying MESSAGE to the user. This is useful if inside a $IF block, as the error can be conditional.
|
||||||
* '''Do not comment out with ' or [[REM]] QB64-specific metacommands.'''
|
* '''Do not comment out with ' or [[REM]] QB64-specific metacommands.'''
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -28,22 +28,23 @@ END TYPE
|
||||||
:: ''name'''''.TYPE''' is the type (represented as bits combined to form a value) AS [[_OFFSET]]:
|
:: ''name'''''.TYPE''' is the type (represented as bits combined to form a value) AS [[_OFFSET]]:
|
||||||
|
|
||||||
==.TYPE values ==
|
==.TYPE values ==
|
||||||
:::* 0 = UDT ([[TYPE|user defined type]]) or memory created by [[_MEMNEW]]
|
:::* [bit 0] 1* byte types (_BYTE)
|
||||||
:::* 1 = 1 bit ELEMENT.SIZE=1 *Only used along with specific types (currently integers or floats)
|
:::* [bit 1] 2* byte types (INTEGER)
|
||||||
:::* 2 = 2 bit. ELEMENT.SIZE=2 *
|
:::* [bit 2] 4* byte types (LONG or SINGLE)
|
||||||
:::* 4 = 4 bit. ELEMENT.SIZE=4 *
|
:::* [bit 3] 8* byte types (DOUBLE or _INTEGER64)
|
||||||
:::* 8 = 8 bit. ELEMENT.SIZE=8 *
|
:::* [bit 4] 16* byte types (reserved for future use)
|
||||||
:::* 16 = 16 bit. ELEMENT.SIZE=16 *
|
:::* [bit 5] 32* byte types (_FLOAT)
|
||||||
:::* 32 = 32 bit. ELEMENT.SIZE=32 *
|
:::* [bit 6] 64* byte types (reserved for future use)
|
||||||
:::* 64 = 64 bit. ELEMENT.SIZE=64 *
|
:::* [bit 7] 128 = integer types (_BYTE, INTEGER, LONG, _INTEGER64) (added to *)
|
||||||
:::* 128 = 128 bit. ELEMENT.SIZE=128 *
|
:::* [bit 8] 256 = floating point types (SINGLE, DOUBLE, _FLOAT) (added to *)
|
||||||
:::* 256 = 256 bit. ELEMENT.SIZE=256 *
|
:::* [bit 9] 512 = STRING types (fixed length or variable length)
|
||||||
:::* 512(+ bit*) = integer types only(ie. whole numbers)
|
:::* [bit 10] 1024 = _UNSIGNED types (added to *+128)
|
||||||
:::* 1024(+ bit*) = floating point types only(ie. numbers that can have a decimal point)
|
:::* [bit 11] 2048 = pixel data usually from _MEMIMAGE (added to 1+128+1024 for 256 color screens, or 2+128+1024 for text screens, or 4+128+1024 for 32-bit color screens)
|
||||||
:::* 2048 = [[STRING]] type only
|
:::* [bit 12] 4096 = _MEM TYPE structure (NOT added to 32768)
|
||||||
:::* 4096(+ 512 + bit*) = [[_UNSIGNED]] integer type only
|
:::* [bit 13] 8192 = _OFFSET type (added to 4+128+[1024] or 8+128+[1024] or future_size+128+[1024])
|
||||||
:::* 8192 = [[_MEM]] type only
|
:::* [bit 14] 16384 = data created/defined by _MEMNEW(size) or _MEMNEW(offset,size)
|
||||||
:::* 16384(+ 512 + bit*)= [[_OFFSET]] type only
|
:::* [bit 15] 32768 = a custom, user defined type (ie. created with TYPE name ... END TYPE)
|
||||||
|
:::* [bit 16] 65536 = an array of data (added to other type values defining the array's data type)
|
||||||
''Note: If a future integer, float or other type doesn't have a size that is 1,2,4,8,16,32,64,128 or 256 it won't have a size-bit set.''
|
''Note: If a future integer, float or other type doesn't have a size that is 1,2,4,8,16,32,64,128 or 256 it won't have a size-bit set.''
|
||||||
|
|
||||||
* '''Note: [[_OFFSET]] values cannot be cast to other variable [[Variable Types|type]]s reliably. _MEM is a reserved custom variable [[Variable Types|type]].'''
|
* '''Note: [[_OFFSET]] values cannot be cast to other variable [[Variable Types|type]]s reliably. _MEM is a reserved custom variable [[Variable Types|type]].'''
|
||||||
|
|
|
@ -87,6 +87,7 @@ _ECHO,_ECHO
|
||||||
$ELSE,$ELSE
|
$ELSE,$ELSE
|
||||||
$ELSEIF,$ELSEIF
|
$ELSEIF,$ELSEIF
|
||||||
$END,$END IF
|
$END,$END IF
|
||||||
|
$ERROR,$ERROR
|
||||||
_ERRORLINE,_ERRORLINE
|
_ERRORLINE,_ERRORLINE
|
||||||
_ERRORMESSAGE$,_ERRORMESSAGE$
|
_ERRORMESSAGE$,_ERRORMESSAGE$
|
||||||
$EXEICON,$EXEICON
|
$EXEICON,$EXEICON
|
||||||
|
|
Loading…
Reference in a new issue