1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-01 09:10:37 +00:00

Adds _LIMIT to Update Help dialog. Updates help files.

This commit is contained in:
Fellippe Heitor 2021-02-06 18:51:34 -03:00
parent 249d0549eb
commit 765472a34d
18 changed files with 123 additions and 153 deletions

View file

@ -10,7 +10,7 @@ The [[$CONSOLE]] [[Metacommand]] creates a console window that can be used throu
* [[_DEST]] [[_CONSOLE]] may be used to send screen output to the console window.
* [[_SCREENHIDE]] and [[_SCREENSHOW]] can be used to hide or show the main program window.
* [[_DELAY]] or [[SLEEP]] can be used to allow the console window to be set in front of the main program window.
* '''QB64 [[Metacommand]]s are not commented out with ' or REM, differently from Qbasic metacommands'''
* '''QB64 [[Metacommand]]s are not commented out with ' or REM, differently from QBasic metacommands'''
* Change the title of the [[$CONSOLE]] windows created using [[_CONSOLETITLE]]
* '''Note:''' Text can be copied partially or totally from console screens in Windows by highlighting and using the title bar menu.
:: To copy console text output, right click the title bar and select ''Edit'' for ''Mark'' to highlight and repeat to ''Copy''

View file

@ -1,4 +1,4 @@
The [[$DYNAMIC]] [[Metacommand|metacommand]] allows the creation of dynamic (changeable) arrays.
The [[$DYNAMIC]] [[Metacommand|metacommand]] allows the creation of dynamic (resizable) arrays.
{{PageSyntax}}
@ -6,7 +6,7 @@ The [[$DYNAMIC]] [[Metacommand|metacommand]] allows the creation of dynamic (cha
{{PageDescription}}
* QBasic [[Metacommand|metacommands]] require [[REM]] or [[Apostrophe|apostrophe]] (') before them and are always placed at the start of the main module.
* QBasic [[Metacommand|metacommands]] require [[REM]] or [[Apostrophe|apostrophe]] (') before them and are normally placed at the start of the main module.
* Dynamic arrays can be resized using [[REDIM]]. The array's type cannot be changed.
* All data in the array will be lost when [[REDIM]]ensioned except when [[_PRESERVE]] is used.
* [[REDIM]] [[_PRESERVE]] can preserve and may move the previous array data when the array boundaries change.

View file

@ -1,18 +1,19 @@
The '''$STATIC''' Metacommand allows the creation of STATIC(un-changeable) arrays.
The '''$STATIC''' [[Metacommand|metacommand]] allows the creation of static (unresizable) arrays.
{{PageSyntax}}
::: REM '''$STATIC'''
:{[[REM]] | ' } '''$STATIC'''
* Qbasic [[Metacommand]]s require a REM or apostrophy (') before them and are normally placed at the start of the main module.
{{PageDescription}}
* 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.
* A [[REDIM]] statement has no effect on [[$STATIC]] arrays except perhaps a [[ERROR Codes|duplicate definition error]] at the [[REDIM]] statement.
* 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]].
{{PageExamples}}
''Example:'' When a variable is used, the array can be resized despite $STATIC. The array becomes [[$DYNAMIC]].
{{CodeStart}} '' ''
'{{Cl|$STATIC}}
@ -27,7 +28,7 @@ The '''$STATIC''' Metacommand allows the creation of STATIC(un-changeable) array
: ''Note:'' [[DIM]] using a literal numerical size will create a Duplicate definition error.
''See also:''
{{PageSeeAlso}}
* [[$DYNAMIC]], [[STATIC]]
* [[Arrays]], [[Metacommand]]

View file

@ -1,5 +1,5 @@
{{DISPLAYTITLE:$VIRTUALKEYBOARD}}
[DEPRACATED] The [[$VIRTUALKEYBOARD]] [[Metacommand|metacommand]] turns the virtual keyboard ON or OFF.
[DEPRECATED] The [[$VIRTUALKEYBOARD]] [[Metacommand|metacommand]] turns the virtual keyboard ON or OFF.
{{PageSyntax}}
@ -8,7 +8,7 @@
{{PageDescription}}
* Places a virtual keyboard on screen, which can be used in touch-enabled devices like Windows tablets.
* Depracated.
* Deprecated.
{{PageExamples}}

View file

@ -10,16 +10,16 @@ The '''/''' mathematical operator performs decimal point division on a numerical
{{PageDescription}}
* Number value can be any literal or variable numerical type.
* '''Divisor (second value) must not be a value of 0 to .5'''. This will create a [[ERROR Codes|"Division by zero" error!]] due to [[CINT]] rounding.
* Return values can be any literal or variable numerical type, but [[SINGLE]] or [[DOUBLE]] type decimal point returns are likely.
* Values returned may be expressed using exponential or [[scientific notation]] using '''E''' for SINGLE or '''D''' for DOUBLE precision.
* Use the [[\|\ integer division]] operator to guarantee [[INTEGER]] or [[LONG]] return values.
* Division and multiplication operations are performed before addition and subtraction in Qbasic's order of operations.
* Division and multiplication operations are performed before addition and subtraction in QBasic's order of operations.
''See also:''
{{PageSeeAlso}}
* [[MOD|MOD (remainder division operator)]]
* [[\|\ (integer division operator)]]
* [[*|* (multiplication operator)]]
* [[INT]], [[CINT]], [[FIX]], [[_ROUND]]
* [[Mathematical Operations]]

View file

@ -1,9 +1,9 @@
The '''-''' mathematical operator performs subtraction on two numerical values or [[negation|negates]] a single value.
{{PageSyntax}}
''Syntax:'' return_value = number1 - number2
return_value = number1 - number2
{{PageDescription}}
@ -11,17 +11,14 @@ The '''-''' mathematical operator performs subtraction on two numerical values o
* Numbers used can be any literal or variable numerical value type.
* Subtracting a negative value will actually perform addition with the other value.
* Subtracting a negative or [[negation|negated]] value will make the return value more positive.
* Addition and subtraction are the last operations performed in Qbasic's normal order of operations.
* Addition and subtraction are the last operations performed in QBasic's normal order of operations.
* Subtraction cannot be performed on [[STRING]] values.
{{PageSeeAlso}}
''See also:''
[[+|+ positive]] (addition operator)
[[Mathematical Operations]]
* [[+|+ positive]] (addition operator)
* [[Mathematical Operations]]
{{PageNavigation}}

View file

@ -17,7 +17,8 @@ The '''\''' mathematical operator performs [[INTEGER]] division on a numerical v
* Division and multiplication operations are performed before addition and subtraction in Qbasic's order of operations.
''Example:'' Displays how floating decimal point values are rounded to the closest even [[INTEGER|integer]] value.
{{PageExamples}}
Displays how floating decimal point values are rounded to the closest even [[INTEGER|integer]] value.
{{CodeStart}} '' ''
{{Cl|PRINT}} 0.5 \ 1
{{Cl|PRINT}} 1.5 \ 1
@ -35,7 +36,7 @@ The '''\''' mathematical operator performs [[INTEGER]] division on a numerical v
{{OutputEnd}}
''See also:''
{{PageSeeAlso}}
* [[MOD|MOD (remainder division operator)]]
* [[/|/ (normal division operator)]]
* [[INT]], [[CINT]], [[FIX]], [[_ROUND]]

View file

@ -1,5 +1,13 @@
Although QB64 has [[_BYTE]] and [[_BIT]] variable types, there may be times that you just want to know which bits are on of off in the byte value or convert the value to a [[Binary]] number.
Although QB64 has [[_BYTE]] and [[_BIT]] variable types, there may be times that you just want to know which bits are on or off in the byte value or convert the value to a [[Binary]] number.
The tutorial below shows you how to do things manually, for instructional purposes. Bear in mind, though, that QB64 has the following suite of commands aimed at working with bits:
:: [[_SETBIT]]
:: [[_READBIT]]
:: [[_TOGGLEBIT]]
:: [[_RESETBIT]]
:: [[_SHR]], [[_SHL]]
== Doing it yourself ==
Bits are numbered from 0 to 7 and normally are read from the most significant bit(MSB = 7) to the least significant bit(LSB = 0).
@ -60,7 +68,6 @@ DO
''See also:''
* [[Binary]]
* [[_SHL]], [[_SHR]]
* [[_BIT]], [[&B]]
* [[_BYTE]]

View file

@ -67,12 +67,12 @@ Strings have a property called ''length'', which is the number of characters cur
===Variable-length strings===
Variable length strings are undefined length string variables. Fixed length strings MUST be defined in a program before they are used. Undefined strings can be up to 32767 characters in Qbasic.
Variable length strings are undefined length string variables. Fixed length strings MUST be defined in a program before they are used. Undefined strings can be up to 32767 characters in Qbasic.
{{CodeStart}}
message$ = "Hello"
message$ = message$ + " world!" 'add to string variables using string concatenation only!
message$ = message$ + " world!" 'add to string variables using string concatenation only!
PRINT message$
{{CodeEnd}}
{{OutputStart}}
@ -96,63 +96,7 @@ Fixed length strings must be defined in a {{KW|DIM}} statement, {{KW|SUB}} or {{
==Data type limits==
The following table lists the numerical and string data types, their type suffix symbol, and the range of the values they can represent:
'''Numerical types'''
{| class="wikitable"
! Type Name !! Type suffix symbol !! Minimum value !! Maximum value !! Size in Bytes
|-
| _BIT || ` || -1 || 0 || 1/8
|-
| _BIT * n || `n || -128 || 127 || n/8
|-
| _UNSIGNED _BIT || ~` || 0 || 1 || 1/8
|-
| _BYTE || %% || -128 || 127 || 1
|-
| _UNSIGNED _BYTE || ~%% || 0 || 255 || 1
|-
| INTEGER || % || -32,768 || 32,767 || 2
|-
| _UNSIGNED INTEGER || ~% || 0 || 65,535 || 2
|-
| LONG || & || -2,147,483,648 || 2,147,483,647 || 4
|-
| _UNSIGNED LONG || ~& || 0 || 4,294,967,295 || 4
|-
| _INTEGER64 || && || -9,223,372,036,854,775,808 || 9,223,372,036,854,775,807 || 8
|-
| _UNSIGNED _INTEGER64 || ~&& || 0 || 18,446,744,073,709,551,615 || 8
|-
| SINGLE || ! or none || -2.802597E-45 || +3.402823E+38 || 4
|-
| DOUBLE || # || -4.490656458412465E-324 || +1.797693134862310E+308 || 8
|-
| _FLOAT || ## || -1.18E-4932 || +1.18E+4932 || 32(10 used)
|-
| _OFFSET || %& || -9,223,372,036,854,775,808 || 9,223,372,036,854,775,807 || Use LEN
|-
| _UNSIGNED _OFFSET || ~%& || 0 || 18,446,744,073,709,551,615 || Use LEN
|-
| _MEM || none || combined memory variable type || N/A || Use LEN
|}
:''Note: For the floating-point numeric types [[SINGLE]] (default when not assigned), [[DOUBLE]] and [[_FLOAT]], the minimum values represent the smallest values closest to zero, while the maximum values represent the largest values closest to (+/-)infinity. OFFSET dot values are used as a part of the [[_MEM]] variable type in QB64 to return or set the position in memory.''
'''String text type'''
{| class="wikitable"
! Type Name !! Type suffix symbol !! Minimum length !! Maximum length !! Size in Bytes
|-
| STRING || $ || 0 || 2,147,483,647 || Use LEN
|-
| STRING * n || $n || 1 || 2,147,483,647 || n
|}
''Note: For the fixed-length string type [[STRING|STRING * ''n'']], where ''n'' is an integer length value from 1 (one) to 2,147,483,647.
{{DataTypeTable}}
==References==

View file

@ -1,4 +1,4 @@
The '''$''' is used to denote Qbasic [[Metacommand]]s or as a [[STRING]] variable type suffix.
The '''$''' is used to denote QBasic [[Metacommand]]s or as a [[STRING]] variable type suffix.
@ -7,7 +7,7 @@ The '''$''' is used to denote Qbasic [[Metacommand]]s or as a [[STRING]] variabl
* [[$STATIC]] denotes that all arrays can only be dimensioned once using [[DIM]].
* [[$DYNAMIC]] denotes that all arrays can be redimensioned using [[REDIM]] ONLY.
* [[$INCLUDE]] includes a BI file or Qbasic Library in a program. The file name requires a comment before and after the name.
* [[$INCLUDE]] includes a BI file or QBasic Library in a program. The file name requires a comment before and after the name.
* The [[STRING|string]] variable suffix MUST be used if the variable is not dimensioned in a DIM statement. The statement can also set a fixed string [[LEN|length]].

View file

@ -40,7 +40,7 @@ __NOTOC__
* [[_ASIN]] (function) {{text|Returns the principal value of the arc sine of x, expressed in radians.}}
* [[_ASINH]] (function) {{text|Returns the arc hyperbolic sine of x, expressed in radians.}}
* [[_ASSERT]] (statement) {{text|Performs debug tests.}}
* [[$ASSERTS]] (metacommand) {{text|Enables the [[_ASSERT]] macro}}
* [[$ASSERTS]] ([[metacommand]]) {{text|Enables the [[_ASSERT]] macro}}
* [[_ATAN2]] (function) {{text|Returns the principal value of the [[ATN|arc tangent]] of y/x, expressed in radians.}}
* [[_ATANH]] (function) {{text|Returns the arc hyperbolic tangent of x, expressed in radians.}}
* [[_AUTODISPLAY]] (statement) {{text|enables the automatic display of the screen image changes previously disabled by [[_DISPLAY]].}}
@ -71,7 +71,7 @@ __NOTOC__
<div id = "uC">_C</div>
* [[_CAPSLOCK (function)]] {{text|returns -1 when Caps Lock is on}}
* [[_CAPSLOCK]] (statement) {{text|sets Caps Lock key state}}
* [[$CHECKING]] (QB64 C++ [[Metacommand]]) {{text|turns event error checking OFF or ON.}}
* [[$CHECKING]] ([[metacommand]]) {{text|turns event error checking OFF or ON.}}
* [[_CEIL]] (function) {{text|Rounds x upward, returning the smallest integral value that is not less than x.}}
* [[_CINP]] (function) {{text|Returns a key code from $CONSOLE input}}
* [[_CLEARCOLOR (function)]] {{text|returns the current transparent color of an image.}}
@ -81,11 +81,11 @@ __NOTOC__
* [[_CLIPBOARD$ (statement)]] {{text|sets and overwrites the [[STRING]] value in the operating system's clipboard.}}
* [[_CLIPBOARDIMAGE (function)]] {{text|pastes an image from the clipboard into a new QB64 image in memory.}}
* [[_CLIPBOARDIMAGE]] {{text|(statement) copies a valid QB64 image to the clipboard.}}
* [[$COLOR]] (metacommand) {{text|includes named color constants in a program}}
* [[$COLOR]] ([[metacommand]]) {{text|includes named color constants in a program}}
* [[_COMMANDCOUNT]] (function) {{text|returns the number of arguments passed to the compiled program from the command line.}}
* [[_CONNECTED]] (function) {{text|returns the status of a TCP/IP connection handle.}}
* [[_CONNECTIONADDRESS$]] (TCP/IP function) {{text|returns a connected user's STRING IP address value using the handle.}}
* [[$CONSOLE]] (QB64 [[Metacommand]]) {{text|creates a console window that can be used throughout a program.}}
* [[$CONSOLE]] ([[metacommand]]) {{text|creates a console window that can be used throughout a program.}}
* [[_CONSOLE]] (statement) {{text|used to turn a console window OFF or ON or to designate [[_DEST]] _CONSOLE for output.}}
* [[_CONSOLEINPUT]] (function) {{text|fetches input data from a [[$CONSOLE]] window to be read later (both mouse and keyboard)}}
* [[_CONSOLETITLE]] (statement) {{text|creates the title of the console window using a literal or variable [[STRING|string]].}}
@ -139,13 +139,13 @@ __NOTOC__
<div id = "uE">_E</div>
* [[_ECHO]] (statement) {{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.}}
* [[$END IF]] (Pre-Compiler [[Metacommand]]) {{text|used in conjunction with $IF for the precompiler.}}
* [[$ERROR]] (Pre-Compiler [[Metacommand]]) {{text|used to trigger compiler errors.}}
* [[$ELSE]] (precompiler [[metacommand]]) {{text|used in conjunction with $IF for the precompiler.}}
* [[$ELSEIF]] (precompiler [[metacommand]]) {{text|used in conjunction with $IF for the precompiler.}}
* [[$END IF]] (precompiler [[metacommand]]) {{text|used in conjunction with $IF for the precompiler.}}
* [[$ERROR]] (precompiler [[metacommand]]) {{text|used to trigger compiler errors.}}
* [[_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.}}
* [[$EXEICON]] (Pre-Compiler [[Metacommand]]) {{text|used with a .ICO icon file name to embed the image into the QB64 executable.}}
* [[$EXEICON]] (precompiler [[metacommand]]) {{text|used with a .ICO icon file name to embed the image into the QB64 executable.}}
* [[_EXIT (function)]] {{text|prevents a user exit and indicates if a user has clicked the close X window button or CTRL + BREAK.}}
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
@ -191,7 +191,7 @@ __NOTOC__
<div id = "uI">_I</div>
* [[$IF]] (Pre-Compiler [[Metacommand]]) {{text|used to set an IF condition for the precompiler.}}
* [[$IF]] (precompiler [[metacommand]]) {{text|used to set an IF condition for the precompiler.}}
* [[_ICON]] (statement) {{text|designates a [[_LOADIMAGE]] image file handle to be used as the program's icon or loads the embedded icon (see [[$EXEICON]]).}}
* [[_INCLERRORFILE$]] {function) {{text|returns the name of the original source code $INCLUDE module that caused the most recent error.}}
* [[_INCLERRORLINE]] (function) {{text|returns the line number in an included file that caused the most recent error.}}
@ -215,7 +215,7 @@ __NOTOC__
<div id = "uL">_L</div>
* [[$LET]] (Pre-Compiler [[Metacommand]]) {{text|used to set a flag variable for the precompiler.}}
* [[$LET]] (precompiler [[metacommand]]) {{text|used to set a flag variable for the precompiler.}}
* [[_LASTAXIS]] (function) {{text|returns the number of axis available on a specified number device listed by [[_DEVICE$]].}}
* [[_LASTBUTTON]] (function) {{text|returns the number of buttons available on a specified number device listed by [[DEVICE$]].}}
* [[_LASTWHEEL]] (function) {{text|returns the number of scroll wheels available on a specified number device listed by [[_DEVICE$]].}}
@ -264,7 +264,7 @@ __NOTOC__
<div id = "uN">_N</div>
* [[_NEWIMAGE]] (function) {{text|creates a designated size program [[SCREEN]] or page image and returns a handle value.}}
* [[$NOPREFIX]] (metacommand) {{text|allows QB64-specific keywords to be used without the underscore prefix.}}
* [[$NOPREFIX]] ([[metacommand]]) {{text|allows QB64-specific keywords to be used without the underscore prefix.}}
* [[_NUMLOCK (function)]] {{text|returns -1 when Num Lock is on}}
* [[_NUMLOCK]] (statement) {{text|sets Num Lock key state}}
@ -279,8 +279,8 @@ __NOTOC__
* [[_OPENCLIENT]] (TCP/IP function) {{text|connects to a Host on the Internet as a Client and returns the Client status handle.}}
* [[_OPENCONNECTION]] (TCP/IP function) {{text|open's a connection from a client that the host has detected and returns a status handle.}}
* [[_OPENHOST]] (TCP/IP function) {{text|opens a Host and returns a Host status handle.}}
* [[OPTION _EXPLICIT]] (Pre-compiler directive) {{text|instructs the compiler to require variable declaration with [[DIM]] or an equivalent statement.}}
* [[OPTION _EXPLICITARRAY]] (Pre-compiler directive) {{text|instructs the compiler to require array declaration with [[DIM]] or an equivalent statement.}}
* [[OPTION _EXPLICIT]] (precompiler directive) {{text|instructs the compiler to require variable declaration with [[DIM]] or an equivalent statement.}}
* [[OPTION _EXPLICITARRAY]] (precompiler directive) {{text|instructs the compiler to require array declaration with [[DIM]] or an equivalent statement.}}
* [[_OS$]] (function) {{text|returns the QB64 compiler version in which the program was compiled as [WINDOWS], [LINUX] or [MACOSX] and [32BIT] or [64BIT].}}
@ -312,7 +312,7 @@ __NOTOC__
* [[_RED32]] (function) {{text|returns the red component intensity of a 32-bit color value.}}
* [[_READBIT]] (function) {{text|returns the state of the specified bit of an integer variable.}}
* [[_RESETBIT]] (function) {{text|is used to set the specified bit of an integer variable to 0.}}
* [[$RESIZE]] ([[Metacommand]]) {{text|used with ON allows a user to resize the program window where OFF does not.}}
* [[$RESIZE]] ([[metacommand]]) {{text|used with ON allows a user to resize the program window where OFF does not.}}
* [[_RESIZE]] (statement) {{text|sets resizing of the window ON or OFF and sets the method as _STRETCH or _SMOOTH.}}
* [[_RESIZE (function)]] {{text|returns -1 when a program user wants to resize the program screen.}}
* [[_RESIZEHEIGHT]] (function) {{text|returns the requested new user screen height when [[$RESIZE]]:ON allows it.}}
@ -333,14 +333,14 @@ __NOTOC__
* [[Mathematical_Operations#Derived_Mathematical_Functions|_SECH]] (function) {{text|Returns the hyperbolic secant. http://mathworld.wolfram.com/HyperbolicSecant.html}}
* [[_SCREENCLICK]] (statement) {{text|simulates clicking on a point on the desktop screen with the left mouse button.}}
* [[_SCREENEXISTS]] (function) {{text|returns a -1 value once a screen has been created.}}
* [[$SCREENHIDE]] ([QB64 [Metacommand]]) {{text|hides the program window from view.}}
* [[$SCREENHIDE]] ([[metacommand]]) {{text|hides the program window from view.}}
* [[_SCREENHIDE]] (statement) {{text|hides the program window from view.}}
* [[_SCREENICON (function)]] {{text|returns -1 or 0 to indicate if the window has been minimized to an icon on the taskbar.}}
* [[_SCREENICON]] (statement) {{text|minimizes the program window to an icon on the taskbar.}}
* [[_SCREENIMAGE]] (function) {{text|creates an image of the current desktop and returns an image handle.}}
* [[_SCREENMOVE]] (statement) {{text|positions program window on the desktop using designated coordinates or the _MIDDLE option.}}
* [[_SCREENPRINT]] (statement) {{text|simulates typing text into a Windows program using the keyboard.}}
* [[$SCREENSHOW]] (QB64 [[Metacommand]]) {{text|displays that program window after it was hidden by [[$SCREENHIDE]].}}
* [[$SCREENSHOW]] ([[metacommand]]) {{text|displays that program window after it was hidden by [[$SCREENHIDE]].}}
* [[_SCREENSHOW]] (statement) {{text|displays the program window after it has been hidden by [[_SCREENHIDE]].}}
* [[_SCREENX]] (function) {{text|returns the program window's upper left corner horizontal position on the desktop.}}
* [[_SCREENY]] (function) {{text|returns the program window's upper left corner vertical position on the desktop.}}
@ -409,8 +409,8 @@ __NOTOC__
<div id = "uV">_V</div>
* [[$VERSIONINFO]] ([[Metacommand]]) {{text|adds metadata to Windows only binaries for identification purposes across the OS.}}
* [[$VIRTUALKEYBOARD]] ([[Metacommand]] - Deprecated) {{text|turns the virtual keyboard ON or OFF for use in touch-enabled devices}}
* [[$VERSIONINFO]] ([[metacommand]]) {{text|adds metadata to Windows only binaries for identification purposes across the OS.}}
* [[$VIRTUALKEYBOARD]] ([[metacommand]] - Deprecated) {{text|turns the virtual keyboard ON or OFF for use in touch-enabled devices}}
----
@ -509,7 +509,7 @@ __NOTOC__
* [[DO...LOOP]] (statement) {{text|sets a recursive procedure loop that can be ignored or exited using conditional arguments.}}
* [[DOUBLE]] (numerical type #) {{text|8 byte value limited to values up to 15 decimal places.}}
* [[DRAW]] (statement) {{text|uses a special [[STRING|string]] format that draws graphical lines in specific directions.}}
* [[$DYNAMIC]] ([[Metacommand]]) {{text|used at the start of a program to set all program arrays as changeable in size using [[REDIM]].}}
* [[$DYNAMIC]] ([[metacommand]]) {{text|used at the start of a program to set all program arrays as changeable in size using [[REDIM]].}}
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
@ -573,7 +573,7 @@ __NOTOC__
<div id = "I">I</div>
* [[IF...THEN]] (statement) {{text|a conditional block statement used control program flow.}}
* [[IMP]] (logic operator) {{text|is used to compare two numerical values bitwise.}}
* [[$INCLUDE]] ([[Metacommand]]) {{text|designates a text code library file to include with the program.}}
* [[$INCLUDE]] ([[metacommand]]) {{text|designates a text code library file to include with the program.}}
* [[INKEY$]] (function) [[ASCII]] {{text|returns a [[STRING|string]] value entry from the keyboard.}}
* [[INP]] (function) {{text|returns a numerical value from a specified port register address. See [[Keyboard scancodes]]}}
* [[INPUT]] (statement) {{text|a user input that returns a value to one or more specified variable(s).}}
@ -747,7 +747,7 @@ __NOTOC__
* [[SPC]] (function) {{text|moves the text cursor a number of spaces on the [[SCREEN]].}}
* [[SQR]] (function) {{text|returns the square root of a non-negative number.}}
* [[STATIC]] (statement) {{text|creates a [[SUB]] or [[FUNCTION]] variable that retains its value.}}
* [[$STATIC]] ([[Metacommand]]) {{text|used at the start of a program to set all program arrays as unchangeable in size using [[DIM]].}}
* [[$STATIC]] ([[metacommand]]) {{text|used at the start of a program to set all program arrays as unchangeable in size using [[DIM]].}}
* [[STEP]] (keyword) {{text|move relatively from one graphic position or change the counting increment in a [[FOR...NEXT]] loop.}}
* [[STICK]] (function) {{text|returns the present joystick position.}}
* [[STOP]] (statement) {{text|stops a program when troubleshooting or stops an [[ON]] event.}}
@ -1269,10 +1269,10 @@ __NOTOC__
:'''Program Code Markers'''
* [[Apostrophe|' Apostrophe]] ignores a line of code or program comment and MUST be used before a [[Metacommand]]. Same as using [[REM]].
* [[Apostrophe|' Apostrophe]] ignores a line of code or program comment and MUST be used before a [[metacommand]]. Same as using [[REM]].
* [[Comma|, Comma]] is used to separate [[DATA]], [[SUB]] or [[FUNCTION]] parameter variables.
* [[Colon|: Colon]]s can be used to separate two procedure statements on one code line.
* [[Dollar_Sign|$ Dollar sign]] prefix denotes a QBasic [[Metacommand]].
* [[Dollar_Sign|$ Dollar sign]] prefix denotes a QBasic [[metacommand]].
* [[Parenthesis|( ) Parenthesis]] enclose a math or conditional procedure order, [[SUB]] or [[FUNCTION]] parameters or to pass by value.
* [[+|+ Plus]] [[concatenation]] operator MUST be used to combine literal string values in a variable definition.
* [[Quotation mark|" Quotation mark]] designates the ends of a literal [[STRING]] value. Use [[CHR$]](34) to insert quotes in a text [[STRING]].

View file

@ -24,6 +24,8 @@
* [[ERASE]] (array statement) {{text|clears a [[STATIC|static]] array of all values and totally removes a [[$DYNAMIC|dynamic]] array.}}
* [[LBOUND]] (array function) {{text|returns the lowest valid index (lower boundary) of an [[arrays|array]].}}
* [[OPTION BASE]] (statement) {{text|sets the default starting index of an array to 0 or 1.}}
* [[OPTION _EXPLICIT]] (precompiler directive) {{text|instructs the compiler to require variable declaration with [[DIM]] or an equivalent statement.}}
* [[OPTION _EXPLICITARRAY]] (precompiler directive) {{text|instructs the compiler to require array declaration with [[DIM]] or an equivalent statement.}}
* [[REDIM]] (statement) {{text|re-dimensions the number of elements in a [[$DYNAMIC|dynamic]](resizeable) [[arrays|array]] and defines the type.}}
* [[SHARED]] (statement) {{text|designates variable values that can be shared with sub-procedures without using parameters.}}
* [[STATIC]] (statement) {{text|defines a variable or list of variables that will retain their values after the sub-procedure is exited.}}
@ -44,6 +46,9 @@
== [[COLOR|Colors]] and Transparency ==
* [[$COLOR]] (Metacommand) {{text|adds named color constants in a program.}}
* [[_ALPHA]] (function) {{text|returns the alpha channel transparency level of a color value used on a screen page or image.}}
* [[_ALPHA32]] (function) {{text|function returns the alpha channel level of a 32 bit color value only.}}
* [[_BACKGROUNDCOLOR]] (function) {{text|returns the current background color.}}
@ -140,6 +145,8 @@
* [[INTEGER]] {% numerical [[TYPE|type]]) {{text|a two byte variable type with values from -32768 to 32767. [[_UNSIGNED|Unsigned]] to 65535.}}
* [[LONG]] {& numerical [[TYPE|type]]) {{text|Integer values can be from -2147483648 to 2147483647. [[_UNSIGNED]] values to 4294967295.}}
* [[OPTION BASE]] (statement) {{text|sets the default starting index of an [[arrays|array]] to 0 or 1.}}
* [[OPTION _EXPLICIT]] (precompiler directive) {{text|instructs the compiler to require variable declaration with [[DIM]] or an equivalent statement.}}
* [[OPTION _EXPLICITARRAY]] (precompiler directive) {{text|instructs the compiler to require array declaration with [[DIM]] or an equivalent statement.}}
* [[REDIM]] {{text|defines and sizes a [[$DYNAMIC|dynamic]](changeable) array and can define the type of value returned.}}
* [[SHARED]] (statement) {{text|designates variable values that can be shared with sub-procedures without using [[SUB]] parameters.}}
* [[SINGLE]] (! numerical [[TYPE|type]]) {{text|a 4 byte floating decimal variable type with numerical values up to 7 decimal places.}}
@ -329,10 +336,11 @@ The following table describes the error codes that are reported by the '''QB64''
== Error Trapping ==
* [[_ASSERT]] (statement) {{text|Performs debug tests.}}
* [[$ASSERTS]] (metacommand) {{text|Enables the [[_ASSERT]] macro}}* [[$CHECKING]] ([[Metacommand]]) {{text|turns off or on error event checking and strips error code from compiled programs.}}
* [[_ASSERT]] (statement) {{text|performs debug tests.}}
* [[$ASSERTS]] ([[Metacommand]]) {{text|enables the [[_ASSERT]] macro.}}
* [[$CHECKING]] ([[Metacommand]]) {{text|turns off or on error event checking and strips error code from compiled programs.}}
* [[_ERRORLINE]] (function) {{text|returns the actual text code line where a program error occurred.}}
* [[_INCLERRORFILE$]] {function) {{text|returns the name of the original source code $INCLUDE module that caused the most recent error.}}
* [[_INCLERRORFILE$]] (function) {{text|returns the name of the original source code $INCLUDE module that caused the most recent error.}}
* [[_INCLERRORLINE]] (function) {{text|returns the line number in an included file that caused the most recent error.}}
* [[_ERRORMESSAGE$]] (function) {{text|returns a human-readable message describing the most recent runtime error.}}
* [[ERR]] (function) {{text|returns the error code number of the last error to occur.}}
@ -653,18 +661,28 @@ The following table describes the error codes that are reported by the '''QB64''
== Metacommands ==
:Metacommands are commands that affect a program globally after they are in used. Error checking can be turned [[OFF]] or [[ON]].
<center>'''QB64 [[Metacommand]]s do NOT allow commenting or [[REM]]!'''</center>
<center>'''QB64 [[Metacommand]]s DO NOT allow commenting or [[REM]]!'''</center>
* [[$CHECKING]]:OFF/ON {{text|(QB64 only) turns event and error checking ON and OFF. ON (default) can only be used after it is OFF.}}
* [[$ASSERTS]] {{text|enables the [[_ASSERT]] macro.}}
* [[$CHECKING]] {{text|turns event and error checking ON and OFF. ON (default) can only be used after it is OFF.}}
* [[$COLOR]] {{text|includes named color constants in a 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.}}
* [[$ERROR]] {{text|used to trigger compiler errors.}}
* [[$EXEICON]] {{text|embeds a designated icon file into the compiled EXE file. (Windows ONLY)}}
* [[$IF]]...[[$ELSEIF]]...[[$ELSE]]...[[$END IF]] {{text|used to set an IF condition for the precompiler.}}
* [[$LET]] {{text|used to set a flag variable for the precompiler.}}
* [[$NOPREFIX]] {{text|allows all QB64 functions and statements to be used without the leading underscore (_).}}
* [[$RESIZE]] {{text|determines if a program window can be resized by the user.}}
* [[$SCREENHIDE]] {{text|hides the main 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.}}
* [[$VERSIONINFO]] {{text|adds metadata to Windows only binaries for identification purposes across the OS.}}
* [[$VIRTUALKEYBOARD]] {{text|turns the virtual keyboard ON or OFF for use in touch-enabled devices. (DEPRECATED)}}
<center>'''Qbasic [[Metacommand]]s do not require commenting or [[REM]] in QB64!'''</center>
<center>'''QBasic [[Metacommand]]s DO require commenting or [[REM]] in QB64!'''</center>
* '[[$DYNAMIC]] {{text|defines that all arrays are dynamic or changeable in size using [[DIM]] or [[REDIM]].}}
* '[[$INCLUDE]]: 'filename$' {{text|includes a text library file with procedures to be used in a program. Comment both sides of file name also.}}
* '[[$INCLUDE]] {{text|includes a text library file with procedures to be used in a program. Comment both sides of file name also.}}
* '[[$STATIC]] {{text|defines that all arrays are static or unchangeable in size using [[DIM]].}}

View file

@ -41,15 +41,15 @@ Most of the BASIC math operators are ones that require no introduction. The addi
{| class="wikitable"
! Symbol !! Procedure Type !! Example Usage !! Operation Order
|-
| + || Addition || c = a + b || Last
| [[+]] || Addition || c = a + b || Last
|-
| - || Subtraction || c = a - b || Last
| [[-]] || Subtraction || c = a - b || Last
|-
| - || Negation || c = -a || Last
| [[-]] || Negation || c = -a || Last
|-
| * || Multiplication || c = a * b || Second
| [[*]] || Multiplication || c = a * b || Second
|-
| / || Division || c = a / b || Second
| [[/]] || Division || c = a / b || Second
|}
@ -59,9 +59,9 @@ BASIC can also use two other operators for '''[[INTEGER]] division'''. Integer d
{| class="wikitable"
! Symbol !!Procedure Type !!Example Usage !!Operation Order
|-
| \ || Integer division || c = a \ b || Second
| [[\]] || Integer division || c = a \ b || Second
|-
| MOD || Remainder division || c = a MOD b || Second
| [[MOD]] || Remainder division || c = a MOD b || Second
|}
@ -74,9 +74,9 @@ There is also an operator for '''exponential''' calculations. The exponential op
{| class="wikitable"
! Symbol !!Procedure !!Example Usage !!Operation Order
|-
| ^ || Exponent || c = a ^ (1 / 2) || First
| [[^]] || Exponent || c = a ^ (1 / 2) || First
|-
| SQR || Square Root || c = SQR(a ^ 2 + b ^ 2) || First
| [[SQR]] || Square Root || c = SQR(a ^ 2 + b ^ 2) || First
|}
@ -107,23 +107,23 @@ Sometimes a calculation may need BASIC to do them in another order or the calcul
{| class="wikitable"
! Function !! Description
|-
| ABS(n) || returns the absolute (positive) value of n: ABS(-5) = 5
| [[ABS]](n) || returns the absolute (positive) value of n: ABS(-5) = 5
|-
| ATN(angle*) || returns the arctangent of an angle in radians: pi = 4 * ATN(1)
| [[ATN]](angle*) || returns the arctangent of an angle in radians: pi = 4 * ATN(1)
|-
| COS(angle*) || returns the cosine of an angle in radians. (horizontal component)
| [[COS]](angle*) || returns the cosine of an angle in radians. (horizontal component)
|-
| EXP(n) || returns e ^ x, (n <= 88.02969): e = EXP(1) ' (e = 2.718281828459045)
| [[EXP]](n) || returns e ^ x, (n <= 88.02969): e = EXP(1) ' (e = 2.718281828459045)
|-
| LOG(n) || returns the base e natural logarithm of n. (n > 0)
| [[LOG]](n) || returns the base e natural logarithm of n. (n > 0)
|-
| SGN(n) || returns -1 if n < 0, 0 if n = 0, 1 if n > 0: SGN(-5) = -1
| [[SGN]](n) || returns -1 if n < 0, 0 if n = 0, 1 if n > 0: SGN(-5) = -1
|-
| SIN(angle*) || returns the sine of an angle in radians. (vertical component)
| [[SIN]](angle*) || returns the sine of an angle in radians. (vertical component)
|-
| SQR(n) || returns the square root of a number. (n >= 0)
| [[SQR]](n) || returns the square root of a number. (n >= 0)
|-
| TAN(angle*) || returns the tangent of an angle in radians
| [[TAN]](angle*) || returns the tangent of an angle in radians
|}
<center> '''* angles measured in radians'''</center>
@ -319,19 +319,19 @@ Relational Operations are used to compare values in a Conditional [[IF...THEN]],
{| class="wikitable"
! Name !! Description
|-
|INT(n) || rounds down to lower Integer value whether positive or negative
|[[INT]](n) || rounds down to lower Integer value whether positive or negative
|-
|FIX(n) || rounds positive values lower and negative to a less negative Integer value
|[[FIX]](n) || rounds positive values lower and negative to a less negative Integer value
|-
|CINT(n) ||rounds to closest Integer. Rounds up for decimal point values over one half.
|[[CINT]](n) ||rounds to closest Integer. Rounds up for decimal point values over one half.
|-
| CLNG(n) || rounds Integer or Long values to closest value like CINT.(values over 32767)
|[[CLNG]](n) || rounds Integer or Long values to closest value like CINT.(values over 32767)
|-
| CSNG(n) || rounds Single values to closest last decimal point value.
|[[CSNG]](n) || rounds Single values to closest last decimal point value.
|-
| CDBL(n) || rounds Double values to closest last decimal point value.
|[[CDBL]](n) || rounds Double values to closest last decimal point value.
|-
| _ROUND || rounds to closest numerical integer value.
|[[_ROUND]](n) || rounds to closest numerical integer value.
|}
===Note===

View file

@ -1,7 +1,7 @@
'''Metacommands''' are program wide commands that start with $.
==Legacy metacommands (Qbasic/QuickBASIC)==
==Legacy metacommands (QBasic/QuickBASIC)==
===Syntax===
:REM [[$INCLUDE]]: '[[QB.BI]]' 'loads a reference file or library
@ -10,12 +10,12 @@
:REM [[$STATIC]] 'arrays cannot be resized once dimensioned
===Description===
* Qbasic Metacommands are normally used at the program start and are in effect throughout the program.
* Qbasic Metacommands are always prefixed with $ and MUST be commented with an apostrophe or [[REM]].
* QBasic Metacommands are normally used at the program start and are in effect throughout the program.
* QBasic Metacommands are always prefixed with $ and MUST be commented with an apostrophe or [[REM]].
* [[$INCLUDE]] is always followed by a colon and the full text code file name is commented on both sides.
* [[$DYNAMIC]] allows larger arrays that are changeable in size at runtime.
* [[$STATIC]] makes all arrays unchangeable in size.
* '''Qbasic metacommands should have their own program line because they are commented.'''
* '''QBasic metacommands should have their own program line because they are commented.'''
==QB64 metacommands==

View file

@ -3,6 +3,7 @@ The {{KW|STATIC}} keyword is used in declaration statements to control where var
{{PageSyntax}}
:{{KW|STATIC}} {{Parameter|variableName}}[()] [{{KW|AS}} {{Parameter|dataType}}][, ...]
:{{KW|STATIC}} [{{KW|AS}} {{Parameter|dataType}}] {{Parameter|variableName}}[()][, ...]
{{PageSyntax}}
:{[[SUB]]|[[FUNCTION]]} {{Parameter|procedureName}} [({{Parameter|parameterList}})] STATIC
@ -14,7 +15,7 @@ The {{KW|STATIC}} keyword is used in declaration statements to control where var
:* {{Parameter|variableName}} may include a type suffix or use [[AS]] to specify a type other than the default [[SINGLE]] type.
:* Arrays with static storage are declared by specifying empty parenthesis following the array name. See [[Arrays]]
* STATIC can be used after the name of a [[SUB]] or [[FUNCTION]] in the procedure to force all variables to retain their values.
* '''Recursive procedures may be required to be STATIC to avoid a Stack Overflow! QB64 programs may just close!'''
* '''Recursive procedures may be required to be STATIC to avoid a Stack Overflow error. QB64 programs may just close.'''
* [[$STATIC]] defined program [[arrays]] cannot be [[REDIM|re-sized]] or use [[_PRESERVE]].

View file

@ -10,7 +10,7 @@ An '''underscore''' can be used at the end of a line of code to continue a code
* The underscore can be anywhere after the code on that line to continue the code to the next line in QB64.
* Multiple underscores can be used for the same line of code in QB64 only.
* Underscores can be used in the middle of variable, sub procedure or [[CONST|constant]] names.
* '''The underscore is NOT compatible with Qbasic! The Qbasic IDE will remove or move code with leading underscores!'''
* '''The underscore is NOT compatible with QBasic! The QBasic IDE will remove or move code with leading underscores!'''
* In [[PRINT USING]] an underscore can precede a formatting character to display that character as text in a template [[STRING]].

View file

@ -1,5 +1,5 @@
{{DISPLAYTITLE:_INCLERRORLINE}}
The [[_INCLERRORFILE$]] function returns the line number in an [[$INCLUDE]] file that caused the most recent error.
The [[_INCLERRORLINE]] function returns the line number in an [[$INCLUDE]] file that caused the most recent error.

View file

@ -13794,6 +13794,7 @@ SUB ideupdatehelpbox
FullMessage$(1) = "All pages updated."
FullMessage$(2) = ""
idetxt(o(ButtonID).txt) = "#Close"
_LIMIT 20
END SELECT
'-------- end of update routine ------------------------------