1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-01 13:50:36 +00:00

Updates help files [ci-skip]

This commit is contained in:
Fellippe Heitor 2021-02-15 22:13:07 -03:00
parent 565bfe6e63
commit 6879dc0e79
41 changed files with 172 additions and 77 deletions

30
internal/help/$ERROR.txt Normal file
View file

@ -0,0 +1,30 @@
The [[$ERROR]] metacommand triggers a compilation error.
{{PageSyntax}}
: [[$ERROR]] MESSAGE
{{PageDescription}}
* The Metacommand does '''not''' require a comment or REM before it.
* MESSAGE is any text. Quotation marks are not required.
* When QB64 tries to compile an $ERROR metacommand a compilation error is triggered and MESSAGE is shown to the user. This is useful in [[$IF]] blocks.
===Details===
* If there is a particular situation where you know your program will not work properly, you can prevent the user compiling and give them a helpful error message instead by checking for the condition with [[$IF]].
* An [[$ERROR]] directive not inside an [[$IF]] (or [[$ELSEIF]]) block is useless because the program will never compile.
{{PageExamples}}
{{CodeStart}} '' ''
{{Cl|$IF}} VERSION < 2.1 OR WINDOWS = 0 THEN
{{Cl|$ERROR}} Requires Windows QB64 version 2.1 or above
{{Cl|$END IF}}
{{CodeEnd}}
''Output'': Compilation check failed: REQUIRES WINDOWS QB64 VERSION 2.1 OR ABOVE on line 2 (assuming your version of QB64 doesn't meet those requirements).
{{PageSeeAlso}}
* [[Metacommand]]
* [[$IF]]
{{PageNavigation}}

View file

@ -10,7 +10,7 @@ The [[BEEP]] statement produces a beep sound through the sound card.
* '''QB64''' produces the actual "beep" sound through the PC's sound card, to emulate QBasic's beeping through the [https://en.wikipedia.org/wiki/PC_speaker PC speaker].
==QBasic/QuickBASIC==
{{PageQBasic}}
* Older programs may attempt to produce a BEEP by printing [[CHR$]](7) to the screen. This is no longer supported in QB64 after '''version 1.000'''.
** You may have to replace instances of PRINT CHR$(7) in older programs to the [[BEEP]] statement to maintain the legacy functionality.

View file

@ -1,6 +1,6 @@
[[BLOAD]] loads a binary graphics file created by [[BSAVE]] to an array.
==Legacy support==
{{PageLegacySupport}}
* '''QB64 can load larger arrays directly from binary files using [[PUT]] # and [[GET]] # without BLOAD. For that reason, BLOAD isn't recommended practice anymore and is supported to maintain compatibility with legacy code.'''

View file

@ -1,8 +1,8 @@
[[BSAVE]] saves the contents of an image array to a [[BINARY]] file.
==Legacy support==
* '''QB64 can save larger arrays directly to binary files using [[PUT]] # and [[GET]] # without BSAVE. For that reason, BSAVE isn't recommended practice anymore and is supported to maintain compatibility with legacy code.
{{PageLegacySupport}}
* QB64 can save larger arrays directly to binary files using [[PUT]] # and [[GET]] # without [[BSAVE]]. For that reason, use of [[BSAVE]] is no longer recommended practice but is supported to maintain compatibility with legacy code.
{{PageSyntax}}
@ -65,16 +65,16 @@
{{Cl|GET (graphics statement)|GET}}(0, 0)-{{Cl|STEP}}(10, 10), Graphic%() 'get image to array
{{Cl|FOR...NEXT|FOR}} i% = 1000 {{Cl|TO}} 0 {{Cl|STEP}} -1 'reverse read array for size needed
{{Cl|IF...THEN|IF}} Graphic%(i%) <> 0 {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR...NEXT|FOR}} 'find image color not black
{{Cl|IF...THEN|IF}} Graphic%(i%) <> 0 {{Cl|THEN}} {{Cl|EXIT FOR}} 'find image color not black
{{Cl|NEXT}}
size% = i% + 4 'size plus 2 integers(4 bytes) for dimensions
{{Cl|REDIM}} {{Cl|_PRESERVE}} Graphic%(size%) 'resize existing array in QB64 only!
{{Cl|OPEN}} "example2.BIN" {{Cl|FOR...NEXT|FOR}} {{Cl|BINARY}} {{Cl|AS}} #1 ' {{Cl|PUT}} to a file
{{Cl|OPEN}} "example2.BIN" {{Cl|FOR (file statement)|FOR}} {{Cl|BINARY}} {{Cl|AS}} #1 ' {{Cl|PUT}} to a file
{{Cl|PUT}} #1, , Graphic%()
{{Cl|CLOSE}}
{{Cl|OPEN}} "example2.BIN" {{Cl|FOR...NEXT|FOR}} {{Cl|BINARY}} {{Cl|AS}} #2 'GET array and {{Cl|PUT}} to screen
{{Cl|OPEN}} "example2.BIN" {{Cl|FOR (file statement)|FOR}} {{Cl|BINARY}} {{Cl|AS}} #2 'GET array and {{Cl|PUT}} to screen
{{Cl|DIM}} CopyBin%({{Cl|LOF}}(2) \ 2) 'create new array sized by half of file size
{{Cl|GET}} #2, , CopyBin%()
{{Cl|PUT (graphics statement)|PUT}}(100, 100), CopyBin%(), {{Cl|PSET}}

View file

@ -5,7 +5,7 @@
: [[CALL ABSOLUTE]]([{{Parameter|argumentList}},] {{Parameter|integerOffset}})
==Legacy support==
{{PageLegacySupport}}
* [[CALL ABSOLUTE]] is implemented to support older code and is not recommended practice. To handle mouse input, the '''use [[_MOUSEINPUT]] and related functions'''.

View file

@ -1,7 +1,7 @@
[[CHAIN]] is used to change seamlessly from one module to another one in a program.
==Legacy support==
{{PageLegacySupport}}
* The multi-modular technique goes back to when QBasic and QuickBASIC had module size constraints. In QB64 [[CHAIN]] has been implemented so that that older code can still be compiled, though '''it is advisable to use single modules for a single project (not counting [[$INCLUDE]] libraries), for ease of sharing and also because the module size constraints no longer exist.'''

View file

@ -1,6 +1,6 @@
[[COMMON]] shares common variable values with other linked or [[CHAIN]]ed modules.
==Legacy support==
{{PageLegacySupport}}
* The multi-modular technique goes back to when QBasic and QuickBASIC had module size constraints. In QB64 [[COMMON]] has been implemented so that that older code can still be compiled, though '''it is advisable to use single modules for a single project (not counting [[$INCLUDE]] libraries), for ease of sharing and also because the module size constraints no longer exist.'''

View file

@ -1,7 +1,7 @@
The [[DEFDBL]] statement defines all variables with names starting with the specified letter (or letter range) AS [[DOUBLE]] variables instead of the [[SINGLE]] type default.
==Legacy support==
{{PageLegacySupport}}
* '''DEF''' statements ([[DEFDBL]], [[DEFSNG]], [[DEFLNG]], [[DEFINT]], [[DEFSTR]]) were used when storage space was a concern in older computers, as their usage could save up typing. Instead of {{InlineCode}}'''DIM a AS DOUBLE, a2 AS DOUBLE, a3 AS DOUBLE'''{{InlineCodeEnd}}, simply having {{InlineCode}}'''DEFDBL A'''{{InlineCodeEnd}} in the code before using variables starting with letter '''A''' would do the same job.
* '''For clarity, it is recommended to declare variables with meaningful names'''.
@ -18,7 +18,7 @@ The [[DEFDBL]] statement defines all variables with names starting with the spec
* '''Warning: QBasic keyword names cannot be used as numerical variable names with or without the type suffix.'''
==QBasic/QuickBASIC==
{{PageQBasic}}
* QBasic's IDE would add DEF statements before any [[SUB]] or [[FUNCTION]]. QB64 (like QBasic) will change all variable types in subsequent sub-procedures to that default variable type without giving a [[ERROR Codes|"Parameter Type Mismatch"]] warning or adding DEF statement to subsequent procedures. If you do not want that to occur, either remove that DEF statement or add the proper DEF type statements to subsequent procedures. May also affect [[$INCLUDE]] procedures.

View file

@ -1,7 +1,7 @@
The [[DEFINT]] statement defines all variables with names starting with the specified letter (or letter range) AS [[INTEGER]] variables instead of the [[SINGLE]] type default.
==Legacy support==
{{PageLegacySupport}}
* '''DEF''' statements ([[DEFDBL]], [[DEFSNG]], [[DEFLNG]], [[DEFINT]], [[DEFSTR]]) were used when storage space was a concern in older computers, as their usage could save up typing. Instead of {{InlineCode}}'''DIM a AS INTEGER, a2 AS INTEGER, a3 AS INTEGER'''{{InlineCodeEnd}}, simply having {{InlineCode}}'''DEFINT A'''{{InlineCodeEnd}} in the code before using variables starting with letter '''A''' would do the same job.
* '''For clarity, it is recommended to declare variables with meaningful names'''.
@ -19,7 +19,7 @@ The [[DEFINT]] statement defines all variables with names starting with the spec
* '''Warning: QBasic keyword names cannot be used as numerical variable names with or without the type suffix.'''
==QBasic/QuickBASIC==
{{PageQBasic}}
* QBasic's IDE would add DEF statements before any [[SUB]] or [[FUNCTION]]. QB64 (like QBasic) will change all variable types in subsequent sub-procedures to that default variable type without giving a [[ERROR Codes|"Parameter Type Mismatch"]] warning or adding DEF statement to subsequent procedures. If you do not want that to occur, either remove that DEF statement or add the proper DEF type statements to subsequent procedures. May also affect [[$INCLUDE]] procedures.

View file

@ -1,7 +1,7 @@
The [[DEFLNG]] statement defines all variables with names starting with the specified letter (or letter range) AS [[LONG]] variables instead of the [[SINGLE]] type default.
==Legacy support==
{{PageLegacySupport}}
* '''DEF''' statements ([[DEFDBL]], [[DEFSNG]], [[DEFLNG]], [[DEFINT]], [[DEFSTR]]) were used when storage space was a concern in older computers, as their usage could save up typing. Instead of {{InlineCode}}'''DIM a AS LONG, a2 AS LONG, a3 AS LONG'''{{InlineCodeEnd}}, simply having {{InlineCode}}'''DEFLNG A'''{{InlineCodeEnd}} in the code before using variables starting with letter '''A''' would do the same job.
* '''For clarity, it is recommended to declare variables with meaningful names'''.
@ -19,7 +19,7 @@ The [[DEFLNG]] statement defines all variables with names starting with the spec
* '''Warning: QBasic keyword names cannot be used as numerical variable names with or without the type suffix.'''
==QBasic/QuickBASIC==
{{PageQBasic}}
* QBasic's IDE would add DEF statements before any [[SUB]] or [[FUNCTION]]. QB64 (like QBasic) will change all variable types in subsequent sub-procedures to that default variable type without giving a [[ERROR Codes|"Parameter Type Mismatch"]] warning or adding DEF statement to subsequent procedures. If you do not want that to occur, either remove that DEF statement or add the proper DEF type statements to subsequent procedures. May also affect [[$INCLUDE]] procedures.

View file

@ -1,7 +1,7 @@
The [[DEFSNG]] statement defines all variables with names starting with the specified letter (or letter range) AS [[SINGLE]] variables.
==Legacy support==
{{PageLegacySupport}}
* '''DEF''' statements ([[DEFDBL]], [[DEFSNG]], [[DEFLNG]], [[DEFINT]], [[DEFSTR]]) were used when storage space was a concern in older computers, as their usage could save up typing. Instead of {{InlineCode}}'''DIM a AS SINGLE, a2 AS SINGLE, a3 AS SINGLE'''{{InlineCodeEnd}}, simply having {{InlineCode}}'''DEFSNG A'''{{InlineCodeEnd}} in the code before using variables starting with letter '''A''' would do the same job.
* '''For clarity, it is recommended to declare variables with meaningful names'''.
@ -19,7 +19,7 @@ The [[DEFSNG]] statement defines all variables with names starting with the spec
* '''Warning: QBasic keyword names cannot be used as numerical variable names with or without the type suffix.'''
==QBasic/QuickBASIC==
{{PageQBasic}}
* QBasic's IDE would add DEF statements before any [[SUB]] or [[FUNCTION]]. QB64 (like QBasic) will change all variable types in subsequent sub-procedures to that default variable type without giving a [[ERROR Codes|"Parameter Type Mismatch"]] warning or adding DEF statement to subsequent procedures. If you do not want that to occur, either remove that DEF statement or add the proper DEF type statements to subsequent procedures. May also affect [[$INCLUDE]] procedures.

View file

@ -1,7 +1,7 @@
The [[DEFSTR]] statement defines all variables with names starting with the specified letter (or letter range) AS [[STRING]] variables instead of the [[SINGLE]] type default.
==Legacy support==
{{PageLegacySupport}}
* '''DEF''' statements ([[DEFDBL]], [[DEFSNG]], [[DEFLNG]], [[DEFINT]], [[DEFSTR]]) were used when storage space was a concern in older computers, as their usage could save up typing. Instead of {{InlineCode}}'''DIM a AS STRING, a2 AS STRING, a3 AS STRING'''{{InlineCodeEnd}}, simply having {{InlineCode}}'''DEFSTR A'''{{InlineCodeEnd}} in the code before using variables starting with letter '''A''' would do the same job.
* '''For clarity, it is recommended to declare variables with meaningful names'''.
@ -18,7 +18,7 @@ The [[DEFSTR]] statement defines all variables with names starting with the spec
* '''Warning: QBasic keyword names can only be used as string variable names when they are followed by the string type suffix ($).'''
==QBasic/QuickBASIC==
{{PageQBasic}}
* QBasic's IDE would add DEF statements before any [[SUB]] or [[FUNCTION]]. QB64 (like QBasic) will change all variable types in subsequent sub-procedures to that default variable type without giving a [[ERROR Codes|"Parameter Type Mismatch"]] warning or adding DEF statement to subsequent procedures. If you do not want that to occur, either remove that DEF statement or add the proper DEF type statements to subsequent procedures. May also affect [[$INCLUDE]] procedures.

View file

@ -1,7 +1,7 @@
[[DEF SEG]] is used to define the area in memory to access QB64's emulated conventional memory.
==Legacy support==
{{PageLegacySupport}}
* '''QB64 implements memory access using [[_MEM]] and related functions. For that reason, [[DEF SEG]] isn't recommended practice anymore and is supported to maintain compatibility with legacy code.'''

View file

@ -16,7 +16,7 @@
* '''Warning: QBasic keyword names cannot be used as numerical variable names with or without the type suffix.'''
==QBasic/QuickBASIC==
{{PageQBasic}}
* Results of mathematical calculations may be approximate or slow in QuickBASIC 4.5.

View file

@ -15,7 +15,7 @@ The [[FILES]] statement is used to print a list of files in the current director
* FILES lists can make the screen roll up. Try using SHELL "DIR" with the /P option. [http://www.computerhope.com/dirhlp.htm DIR command].
==QBasic/QuickBASIC==
{{PageQBasic}}
* Illegal filename characters in QBasic included '''* ? , > < ; : " | \ / + [ ]''' and more than one dot extension in [http://www.computerhope.com/issues/ch000209.htm DOS].

View file

@ -24,7 +24,7 @@ A [[FUNCTION]] block statement is used to create a function procedure to return
* The IDE can create the FUNCTION and END FUNCTION lines for you. Use the ''New FUNCTION...'' option in the Edit Menu. A box will come up for you to enter a name for the FUNCTION. Enter all code between the FUNCTION and [[END FUNCTION]] lines.
==QBasic/QuickBASIC==
{{PageQBasic}}
* Once a FUNCTION was created and used, the QBasic IDE would DECLARE it when the file was saved. '''QB64 doesn't need these declarations.'''
* QBasic's IDE could place a [[DEFINT]], [[DEFSNG]], [[DEFLNG]], [[DEFDBL]] or [[DEFSTR]] statement before the FUNCTION line if it is used in the main module. It may even be the wrong variable type needed.
* QBasic allowed programmers to add DATA fields anywhere because the IDE separated the main code from other procedures.

View file

@ -1,6 +1,6 @@
The [[GET (graphics statement)|GET]] statement is used in graphics to store a box area image of the screen into an [[INTEGER]] array.
==Legacy support==
{{PageLegacySupport}}
* '''QB64 can manipulate parts of an image using [[_PUTIMAGE]]. For that reason, GET isn't recommended practice anymore and is supported to maintain compatibility with legacy code.'''
@ -30,7 +30,7 @@ The [[GET (graphics statement)|GET]] statement is used in graphics to store a bo
* '''[[PUT]] and [[GET]] file statements can also write and read image array data using [[BINARY]] files instead of using [[BSAVE]] or [[BLOAD]].'''
==QBasic/QuickBASIC==
{{PageQBasic}}
* SCREEN 12 could only GET 1/3 of a full SCREEN 12 image. Rows would increment 160 each GET. '''QB64''' can save entire screen at once.

View file

@ -11,7 +11,7 @@
* GOSUB and GOTO can be used '''within''' [[SUB]] or [[FUNCTION]] procedures, but cannot refer to a label located outside the procedure.
==QBasic/QuickBASIC==
{{PageQBasic}}
* Too many GOSUBs without a [[RETURN]] can eventually cause "Out of Stack Errors" in QBasic as each GOSUB uses memory to store the location to return to. Each [[RETURN]] frees the memory of the GOSUB it returns to.

View file

@ -0,0 +1,66 @@
[[LONG]] [[HEX$|Hexadecimal]] values can be used to set a [[_PALETTECOLOR]] instead of using [[_RGB32]] or [[_RGBA32]] values.
* Hexadecimal digits can be represented as any number or letter up to F: '''0 1 2 3 4 5 6 7 8 9 A B C D E F'''
* [[_BYTE|Byte]] values up to 255 can represented by two hexadecimal digits such as 1C, 23, FA, etc.
* The [[HEX$|hex]] value for bright white(attribute 15) is &HFFFFFFFF or:
::: [[_ALPHA|Alpha]] = FF (255), Red = FF (255), Green = FF (255), Blue = FF (255)
* [[_RGB]] will return an alpha value of 255 for fully opaque 32 bit colors only. Values range from &HFF000000 to &HFFFFFFFF.
* [[_RGB32]] will return an alpha value of 255 for fully opaque colors only. Values range from &HFF000000 to &HFFFFFFFF.
* [[_RGBA]] can set the transparency so hexadecimal values range from &H000000 (zero alpha) to &HFFFFFFFF (full alpha).
* [[_RGBA32]] can set the transparency so hexadecimal values range from &H000000 (zero alpha) to &HFFFFFFFF (full alpha).
* So expanding on the principle above allows us to easily make up our own hex color values:
:: _PALETTECOLOR 1, '''&HFFFF0000''' 'COLOR 1 is full red
:: _PALETTECOLOR 2, '''&HFFFF00FF''' 'COLOR 2 is purple
:: _PALETTECOLOR 3, '''&HFFFFFF00''' 'COLOR 3 is brown
:Where '''FF''' is the fully opaque [[_ALPHA]] and the 3 hex color values can range from '''00''' to '''FF''' (0 to 255) each.
''Example:'' Converting the color port RGB intensity palette values 0 to 63 to 32 bit hexadecimal [[STRING|string]] values.
{{CodeStart}}
{{Cl|SCREEN}} 12
{{Cl|DIM}} hex32$(15)
alpha$ = "FF" 'solid alpha colors only
{{Cl|OUT}} {{Cl|&H}}3C8, 0: {{Cl|OUT}} {{Cl|&H}}3C9, 0: {{Cl|OUT}} {{Cl|&H}}3C9, 0: {{Cl|OUT}} {{Cl|&H}}3C9, 20 'set black background to dark blue
{{Cl|FOR...NEXT|FOR}} attribute = 0 {{Cl|TO}} 15
{{Cl|OUT}} {{Cl|&H}}3C7, attribute 'set color attribute to read
red$ = {{Cl|HEX$}}({{Cl|INP}}({{Cl|&H}}3C9) * 4) 'convert port setting to 32 bit values
grn$ = {{Cl|HEX$}}({{Cl|INP}}({{Cl|&H}}3C9) * 4)
blu$ = {{Cl|HEX$}}({{Cl|INP}}({{Cl|&H}}3C9) * 4)
{{Cl|IF...THEN|IF}} {{Cl|LEN}}(red$) = 1 {{Cl|THEN}} red$ = "0" + red$ 'necessary for low or zero color intensities
{{Cl|IF...THEN|IF}} {{Cl|LEN}}(grn$) = 1 {{Cl|THEN}} grn$ = "0" + grn$
{{Cl|IF...THEN|IF}} {{Cl|LEN}}(blu$) = 1 {{Cl|THEN}} blu$ = "0" + blu$
hex32$(attribute) = "{{Cl|&H}}" + alpha$ + red$ + grn$ + blu$
{{Cl|NEXT}}
{{Cl|PRINT}} "COLOR 0 = " + hex32$(0)
{{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 15
{{Cl|_PALETTECOLOR}} i, {{Cl|VAL}}(hex32$(i))
{{Cl|COLOR}} i
{{Cl|PRINT}} "COLOR" + {{Cl|STR$}}(i) + " = " + hex32$(i) 'returns closest attribute
{{Cl|NEXT}} '' ''
{{CodeEnd}}{{small|Code by Ted Weissgerber}}
:''Explanation:'' [[VAL]] is used to convert the [[HEX$|hexadecimal]] [[STRING|string]] values to valid 32 bit color values for [[_PALETTECOLOR]].
:: No VAL conversion is necessary if the [[LONG]] [[&H]] hexadecimal values are entered into the program directly by the programmer.
''See also:''
* [[_PALETTECOLOR]]
* [[_RGB32]], [[_RGBA32]]
* [[_RGB]], [[_RGBA]] {{text|(when used in 32 bit only)}}
* [[COLOR]], [[SCREEN]], [[POINT]]
* [http://www.w3schools.com/html/html_colornames.asp HTML Color Table HEX Values and Names]
{{PageNavigation}}

View file

@ -16,7 +16,7 @@ The [[INPUT$]] function is used to receive data from the user's keyboard, an ope
* Use [[_DEST]] [[_CONSOLE]] before INPUT$ is used to receive input from a [[$CONSOLE|console]] window.
==QBasic/QuickBASIC==
{{PageQBasic}}
* {{Parameter|numberOfBytes%}} could not exceed 32767 in [[BINARY]] files or a QBasic error would occur.
* Ctrl + Break would not interrupt the QBasic program until there was a full INPUT$ key entry. In '''QB64''' Ctrl + Break will immediately exit a running program.

View file

@ -21,7 +21,7 @@ The [[INSTR]] function searches for the first occurence of a search [[STRING]] w
* In a loop, INSTR can search an entire file for occurences of certain words. See the [[MID$ (statement)|MID$]] statement example.
==QBasic/QuickBASIC==
{{PageQBasic}}
* The {{Parameter|start%}} position had to be at least 1 or greater when used or there will be an [[ERROR Codes|Illegal function call]] error. In '''QB64''', a {{Parameter|start%}} value of 0 or negative is interpreted as 1 and doesn't generate an error.

View file

@ -1,7 +1,7 @@
The [[INTERRUPT]] statement is an assembly routine for accessing computer information registers.
==Legacy support==
{{PageLegacySupport}}
* Registers are emulated in '''QB64''' to allow older programs to be compiled. To enable mouse input in your programs, the recommended practice is to use [[_MOUSEINPUT]] and related functions.
@ -14,7 +14,7 @@ The [[INTERRUPT]] statement is an assembly routine for accessing computer inform
* {{Parameter|inRegs}} are the values placed into the call and {{Parameter|outRegs}} are the register return values.
==QBasic/QuickBASIC==
{{PageQBasic}}
* Available in QuickBASIC versions 4 and up and required an external library to be loaded. <!-- Command line: QB.EXE /L in QB4.5 --> '''QB64''' emulates the statement without an external library.
* {{Parameter|intNum}} is the interrupt reference vector table address. For historic reference, see: [http://www.ctyme.com/intr/cat.htm Ralf Brown's Interrupt List]
* The [[TYPE]] definition below will work for both [[INTERRUPT]] and INTERRUPTX statement calls

View file

@ -1,7 +1,7 @@
The [[INTERRUPTX]] statement is an assembly routine for accessing computer information registers.
==Legacy support==
{{PageLegacySupport}}
* Registers are emulated in '''QB64''' to allow older programs to be compiled. To enable mouse input in your programs, the recommended practice is to use [[_MOUSEINPUT]] and related functions.
@ -14,7 +14,7 @@ The [[INTERRUPTX]] statement is an assembly routine for accessing computer infor
* {{Parameter|inRegs}} are the values placed into the call and {{Parameter|outRegs}} are the register return values.
==QBasic/QuickBASIC==
{{PageQBasic}}
* Available in QuickBASIC versions 4 and up and required an external library to be loaded. <!-- Command line: QB.EXE /L in QB4.5 --> '''QB64''' emulates the statement without an external library.
* {{Parameter|intNum}} is the interrupt reference vector table address. For historic reference, see: [http://www.ctyme.com/intr/cat.htm Ralf Brown's Interrupt List]
* The [[TYPE]] definition below will work for both [[INTERRUPT]] and INTERRUPTX statement calls

View file

@ -193,7 +193,7 @@ __NOTOC__
<div id = "uI">_I</div>
* [[$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.}}
* [[_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.}}
* [[_INFLATE$]] (function) {{text|decompresses a string}}
* [[_INSTRREV]] (function) {{text|allows searching for a substring inside another string, but unlike [[INSTR]] it returns the last occurrence instead of the first one.}}

View file

@ -25,7 +25,7 @@ The keywords listed here are not supported in QB64. QB64 is meant to be compatib
* SIGNAL
* TIME$ (statement) (reading the current [[TIME$]] is supported)
* TRON, TROFF
* '''[[WIDTH]] [[LPRINT]]''' combined statement is not supported.
* [[WIDTH]] [[LPRINT]] combined statement is not supported.
==Keywords Not Supported in Linux or MAC OSX versions==

View file

@ -18,7 +18,7 @@ The [[LOCK]] statement restricts access to parts of a file by other programs or
* [[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Keyword not supported in Linux or macOS versions]]
==QBasic/QuickBASIC==
{{PageQBasic}}
* Required DOS '''SHARED.EXE''' to be run for QBasic to use networking access modes. No longer required.

View file

@ -18,7 +18,7 @@ The [[MID$]] function returns a portion of a [[STRING|string]].
* In '''QB64''', [[ASC]] string byte position reads are about '''5 times faster''' than MID$ when parsing strings. See ''Example 2'' below.
==QBasic/QuickBASIC==
{{PageQBasic}}
* In QBasic the {{Parameter|startPosition%}} could not be zero (0) or an [[ERROR Codes|Illegal function call error]] would occur.

View file

@ -12,7 +12,7 @@
* '''Note:''' [[SELECT CASE]] provides a much more convenient way of doing this task.
==QBasic/QuickBASIC==
{{PageQBasic}}
* In QuickBASIC 4.5 the list could contain a maximum of 60 line numbers or labels, while '''QB64''' has no limit.

View file

@ -11,7 +11,7 @@
* '''Note:''' [[SELECT CASE]] provides a much more convenient way of doing this task.
==QBasic/QuickBASIC==
{{PageQBasic}}
* In QuickBASIC 4.5 the list could contain a maximum of 60 line numbers or labels, while '''QB64''' has no limit.

View file

@ -12,7 +12,7 @@ The [[ON STRIG(n)]] statement is an event procedure that directs program flow up
* The statement sends the procedure to a line number, line label or [[SUB]] procedure when a button event occurs.
==QBasic/QuickBASIC==
{{PageQBasic}}
* In QBasic, value of ''n'' could only be a number from 0 to 3 only as it could only monitor 2 joystick buttons and 2 joysticks.

View file

@ -34,7 +34,7 @@
::::* Some [[DAC]] color attribute intensities cannot be changed using OUT.
==QBasic/QuickBASIC==
{{PageQBasic}}
* In DOS, OUT accesses memory and hardware directly, unlike [[POKE]], and could cause PC damage.

View file

@ -16,7 +16,7 @@ The [[PALETTE]] statement can swap color settings, set colors to default or set
* QB64 implements the [[_PALETTECOLOR]] statement to provide extended palette functionality.
==QBasic/QuickBASIC==
{{PageQBasic}}
* Screens 0, 7 and 9 ([[DAC]]) colors could not be changed using the first syntax, but the program could use [[OUT]] to change intensity settings of attributes 1 thru 5.

View file

@ -14,7 +14,7 @@ The [[PCOPY]] statement copies one source screen page to a destination page in m
* The '''QB64''' [[_DISPLAY]] statement can also be used to stop screen flicker without page flipping or [[CLS]] and '''is the recommended practice'''.
==QBasic/QuickBASIC==
{{PageQBasic}}
* {{Parameter|sourcePage%}} and {{Parameter|destinationPage%}} numbers are limited by the SCREEN mode used. In '''QB64''', the same limits don't apply.

View file

@ -22,7 +22,7 @@ The [[SHELL]] statement allows a program to run external programs or command lin
*'''NOTE: Use [[CHDIR]] instead of CD as SHELL commands cannot affect the current program path.'''
==QBasic/QuickBASIC==
{{PageQBasic}}
* '''QBasic BAS files could be run like compiled programs without returning to the IDE when [[SYSTEM]] was used to [[END|end]] them.'''
* A user would invoke it with {{InlineCode}}SHELL "QB.EXE /L /RUN program.BAS"{{InlineCodeEnd}}

View file

@ -1,4 +1,4 @@
The {{KW|SYSTEM}} statement immediately closes a program and returns control to the operating system.
The [[SYSTEM]] statement immediately closes a program and returns control to the operating system.
{{PageSyntax}}
@ -16,7 +16,7 @@ The {{KW|SYSTEM}} statement immediately closes a program and returns control to
==QBasic or QuickBASIC==
{{PageQBasic}}
* '''QBasic BAS files can be run like compiled programs without returning to the IDE when [[SYSTEM]] is used to [[END|end]] them!'''
* If a program BAS module is run from the IDE, stopped by Ctrl-Break or an error occurs the QB program will exit to the IDE.
* To run a QuickBASIC program without the IDE use the following DOS command line: {{text|QB.EXE /L /RUN filename.BAS|green}}

View file

@ -1,12 +1,11 @@
A '''TIMER''' statement enables, turns off or stops timer event trapping. QBasic only uses the base timer, but '''QB64''' can run many.
A [[TIMER]] statement enables, turns off or stops timer event trapping. QBasic only uses the base timer, but '''QB64''' can run many.
QB {{PageSyntax}}
{{PageSyntax}}
QB
:::TIMER {ON|STOP|OFF}
QB64 {{PageSyntax}}
QB64
:::TIMER(''number%'') {ON|STOP|OFF|FREE}
@ -15,12 +14,14 @@ QB64 {{PageSyntax}}
* TIMER ON enables event trapping of an [[ON TIMER (n)]] statement. While enabled, a check is made after every code statement to see if the specified time has elapsed and the ON TIMER [[GOSUB]] (or [[SUB]] in QB64) procedure is executed.
* TIMER STOP disables timer event trapping. When an event occurs while stopped, it is remembered. If timer events are turned back on later, any remembered events are immediately executed.
* TIMER OFF turns timer event trapping completely off and no subsequent events are remembered.
* TIMER(n) '''FREE''' clears a specific timer event when it is no longer needed. '''The base TIMER or TIMER(0) cannot be freed!'''
{{PageDescription}}
<center>'''QB64 only'''</center>
* Get a TIMER number from [[_FREETIMER]] ONLY except when the base timer(no number or 0) is used. Use specific variables or an array to hold each event number value for later reference.
* If the TIMER number is omitted or 0, the TIMER used is the base timer.
* Specific TIMER events can be enabled, suspended, turned off or freed using [[TIMER (statement)|TIMER(n)]] ON, STOP, OFF or FREE.
* TIMER(n) '''FREE''' clears a specific timer event when it is no longer needed. '''The base TIMER or TIMER(0) cannot be freed!'''
<center>'''QB64 Timing Alternatives'''</center>
@ -29,31 +30,29 @@ QB64 {{PageSyntax}}
* [[_LIMIT]] can slow down loops to a specified number of frames per second. This can also alleviate a program's CPU usage.
{{PageExamples}}
''Example:'' How to update the time while [[PRINT|printing]] at the same time in a program.
{{CodeStart}} '' ''
TIMER ON ' enable timer event trapping
LOCATE 4, 2 ' set the starting PRINT position
{{Cl|ON TIMER(n)|ON TIMER}}(10) GOSUB Clock ' set procedure execution repeat time
DO WHILE INKEY$ = "": PRINT "A"; : SLEEP 6: LOOP
TIMER OFF
{{Cl|SYSTEM}}
{{Cl|TIMER}} ON ' enable timer event trapping
{{Cl|LOCATE}} 4, 2 ' set the starting PRINT position
{{Cl|ON TIMER(n)|ON TIMER}}(10) {{Cl|GOSUB}} Clock ' set procedure execution repeat time
{{Cl|DO}} {{Cl|WHILE}} {{Cl|INKEY$}} = "": {{Cl|PRINT}} "A"; : {{Cl|SLEEP}} 6: {{Cl|LOOP}}
{{Cl|TIMER}} OFF
{{Cl|SYSTEM}}
Clock:
row = {{Cl|CSRLIN}} ' Save current print cursor row.
col = {{Cl|POS|POS(0)}} ' Save current print cursor column.
LOCATE 2, 37: PRINT {{Cl|TIME$}}; ' print current time at top of screen.
LOCATE row, col ' return to last print cursor position
{{Cl|RETURN}} '' ''
Clock:
row = {{Cl|CSRLIN}} ' Save current print cursor row.
col = {{Cl|POS|POS(0)}} ' Save current print cursor column.
{{Cl|LOCATE}} 2, 37: {{Cl|PRINT}} {{Cl|TIME$}}; ' print current time at top of screen.
{{Cl|LOCATE}} row, col ' return to last print cursor position
{{Cl|RETURN}} '' ''
{{CodeEnd}}
: NOTE: SLEEP will be interrupted in QBasic.
''See also:''
{{PageSeeAlso}}
* [[ON TIMER(n)]], [[TIMER]](function)
* [[_DELAY]], [[_LIMIT]]
{{PageNavigation}}

View file

@ -1,5 +1,5 @@
{{DISPLAYTITLE:_CLIPBOARD$}}
The [[_CLIPBOARD$]] function returns the current Operating System's clipboard contents as a [[STRING]].
The [[_CLIPBOARD$]] function returns the current operating system's clipboard contents as a [[STRING]].
{{PageSyntax}}
@ -19,7 +19,7 @@ The [[_CLIPBOARD$]] function returns the current Operating System's clipboard co
{{Cl|PRINT}} "Start Program2 to read your text entries! Empty entry quits!"
{{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "Entry program started!" 'set clipboard initially
DO
{{Cl|DO}}
{{Cl|LINE INPUT}} "Enter some text to send to other program: ", text$
{{Cl|IF...THEN|IF}} text$ = "" {{Cl|THEN}} {{Cl|EXIT DO}}
{{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = text$
@ -31,11 +31,11 @@ DO
{{CodeStart}}
{{Cl|PRINT}} "Enter text in Program1 and this program will read it. Esc key quits!"
DO: {{Cl|_LIMIT}} 100
{{Cl|DO}}: {{Cl|_LIMIT}} 100
text$ = {{Cl|_CLIPBOARD$}} 'function returns clipboard contents
{{Cl|IF...THEN|IF}} {{Cl|LEN}}(text$) {{Cl|THEN}}
{{Cl|PRINT}} text$
{{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "" 'clear clipboard after a read
{{Cl|PRINT}} text$
{{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "" 'clear clipboard after a read
{{Cl|END IF}}
{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27)

View file

@ -1,5 +1,5 @@
{{DISPLAYTITLE:_CLIPBOARD$ (statement)}}
The [[_CLIPBOARD$ (statement)|_CLIPBOARD$]] statement copies the [[STRING]] value into the system clipboard.
The [[_CLIPBOARD$ (statement)|_CLIPBOARD$]] statement copies the specified [[STRING]] value into the operating system's clipboard.
{{PageSyntax}}

View file

@ -13,7 +13,7 @@ The [[_MOUSEX]] function returns the current horizontal (column) mouse cursor po
* [[_MOUSEINPUT]] must be used to detect any changes in the mouse position and is '''required''' for any coordinate returns.
==QBasic/QuickBASIC==
{{PageQBasic}}
* In [[SCREEN]] 0, QBasic's [[ABSOLUTE]] returned graphic coordinates. QB64 mouse functions return the text coordinates.

View file

@ -13,7 +13,7 @@ The [[_MOUSEY]] function returns the current vertical (row) mouse cursor positio
* [[_MOUSEINPUT]] must be used to detect any changes in the mouse position and is '''required''' for any coordinate returns.
==QBasic/QuickBASIC==
{{PageQBasic}}
* In [[SCREEN]] 0, QBasic's [[ABSOLUTE]] returned graphic coordinates. QB64 mouse functions return the text coordinates.

View file

@ -14,7 +14,7 @@ The [[_RGBA32]] function returns the 32-bit ''RGBA'' color value with the specif
* {{Parameter|blue&}} specifies the blue component intensity from 0 to 255.
* {{Parameter|alpha&}} specifies the [[_ALPHA|''alpha'']] component transparency value from 0 (fully transparent) to 255 (opaque).
* Alpha or intensity values outside of the valid range of 0 to 255 are clipped.
* Returns [[LONG]] 32-bit hexadecimal values from '''&H00{{text|00|red}}{{text|00|green}}{{text|00|blue}}''' to '''&HFF{{text|FF|red}}{{text|FF|green}}{{text|FF|blue}}''' with varying [[_ALPHA]] transparency.
* Returns [[LONG]] 32-bit hexadecimal values from '''&H00000000''' to '''&HFFFFFFFF''' with varying [[_ALPHA]] transparency.
* When [[LONG]] values are [[PUT]] to file, the ARGB values become BGRA. Use [[LEFT$]]([[MKL$]]({{Parameter|color32value~&}}), 3) to place 3 colors.
* '''NOTE: Default 32-bit backgrounds are clear black or [[_RGBA]](0, 0, 0, 0). Use [[CLS]] to make the black opaque.'''