1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-06-29 11:40:38 +00:00

Updates help files. [ci-skip]

This commit is contained in:
FellippeHeitor 2021-01-04 15:45:32 -03:00
parent ff28f4cead
commit 78a0020b5c
116 changed files with 763 additions and 555 deletions

View file

@ -10,6 +10,7 @@
* [[$COLOR]]:0 adds [[CONST|constants]] for colors 0-15. The actual constant names can be found in the file '''source/utilities/color0.bi'''.
* [[$COLOR]]:32 adds [[CONST|constants]] for 32-bit colors, similar to HTML color names. The actual constant names can be found in the file '''source/utilities/color32.bi'''.
* [[$COLOR]] is a shorthand to manually using [[$INCLUDE]] pointing to the files listed above.
* Not compatible with [[$NOPREFIX]].
{{PageExamples}}

View file

@ -9,6 +9,7 @@ The [[$NOPREFIX]] metacommand allows all QB64 functions and statements to be use
* QB64-specific keywords are by default prefixed with an underscore, in order to differentiate them from legacy keywords inherited from QBasic/QuickBASIC 4.5.
* The convention exists in order to allow older code to be loaded and compiled in QB64 without naming conflicts with existing variables or constants.
* If you are writing new code with QB64, and not importing code from QBasic/QuickBASIC 4.5, [[$NOPREFIX]] allows you to reduce typing by not having to use underscores in modern keywords.
* '''SUB _GL''' still must be prefixed.
* When [[$NOPREFIX]] is used, QB64 keywords can be used both with or without the leading underscore, so that both [[_DISPLAY]] and [[_DISPLAY|DISPLAY]] are valid in the same program, for example.
* [[$NOPREFIX]] must be the first line in a program.

View file

@ -0,0 +1,102 @@
Bitwise operators are much like the regular mathematics operators (+, * etc.) but are defined in terms of the individual bits of their operands. The full list of bitwise operators, with a brief summary of its operation:
* '''AND''': True if both inputs are true
* '''OR''': True if one or both inputs are true
* '''NOT''': Invert all bits
* '''XOR''': True if exactly one input is true
* '''IMP''': True if both inputs are the same
* '''EQV''': True unless first input is true and second is false
== Syntax ==
With the exception of NOT, all the bitwise operators take two operands:
::: ''result'' = ''value1'' '''AND''' ''value2''
NOT goes before the value it operates on:
::: ''result'' = '''NOT''' ''value1''
If ''value1'' or ''value2'' are non-integer numeric types, they are rounded to the nearest integer.
== Details ==
Bitwise operators work by comparing the corresponding bits in each of the input values to generate a single bit in the output value. The operators differ in how they do the comparison. The table below shows the output bit for each pair of input bits:
{| class="wikitable"
!colspan="2"|'''Operands'''
!colspan="6"|'''Operations'''
|-
!A !! B !! A AND B !! A OR B !! NOT A !! A XOR B !! A IMP B !! A EQV B
|-
|0 || 0 || 0 || 0 || 1 || 0 || 1 || 1
|-
|0 || 1 || 0 || 1 || 1 || 1 || 1 || 0
|-
|1 || 0 || 0 || 1 || 0 || 1 || 0 || 0
|-
|1 || 1 || 1 || 1 || 0 || 0 || 1 || 1
|}
Again, note that the NOT operator only has one operand. It is shown in the same table for convenience.
If one input has more bits than the other (say, an INTEGER vs a LONG) the shorter will be considered to have 0's in the missing bit positions if it is positive, or 1's if it is negative. This scheme comes about because of the [[wikipedia:Two's_complement|Two's Complement]] system for representing negative numbers. As a general rule, there should not be any surprises.
=== Use as logical operators ===
QB64 does not have AND/OR/NOT operators dedicated to operating on the overall truth of values. A numeric value is defined to be ''false'' if it is equal to 0, and ''true'' for any other value, though -1 is the standard ''true'' value, returned by the <, <= etc. operators. One can use the bitwise operators mostly like regular logical operators, but with caution. For instance, 3 is a true value, so as a logical operator NOT 3 would be 0 (false). Because it is in fact a bitwise operator, it evaluates to -4.
== Examples ==
Use '''AND''' to mask certain bits in a value. In this example, the 1's in the mask (y&) specify which bits in (x&) we are interested in, forcing all others to 0.
<source lang="qbasic">
x& = VAL("&B101010") 'Arbitrary collection of bits
y& = VAL("&B001100") 'A bit mask
PRINT "Input 1: "; BIN$(x&, 6) '6 indicates we want 6 bits of output
PRINT "Input 2: "; BIN$(y&, 6)
PRINT "Output: "; BIN$(x& AND y&, 6)
'Converts the number n& to a string of binary digits, digits& long (padding or truncating as necessary).
FUNCTION BIN$ (n&, digits&)
FOR i& = digits& - 1 TO 0 STEP -1
IF (n& AND 2 ^ i&) THEN B$ = B$ + "1" ELSE B$ = B$ + "0"
NEXT
BIN$ = B$
END FUNCTION
</source>
Output:
<pre>Input 1: 101010
Input 2: 001100
Output: 001000</pre>
Use '''OR''' to combine bit flags into a single value. The presence of a flag can then be tested by using the flag as a mask with '''AND''':
<source lang="qbasic">
'The trick here is to give each flag a value corresponding to a different bit being 1
FLAG_A& = VAL("&B0001")
FLAG_B& = VAL("&B0010")
FLAG_C& = VAL("&B0100")
FLAG_D& = VAL("&B1000")
flags& = FLAG_A& OR FLAG_C& 'Set flags A, C
'Use each flag as a bitmask to test for its presence:
IF flags& AND FLAG_A& THEN PRINT "Flag A is set"
IF flags& AND FLAG_B& THEN PRINT "Flag B is set"
IF flags& AND FLAG_C& THEN PRINT "Flag C is set"
IF flags& AND FLAG_D& THEN PRINT "Flag D is set"
</source>
Output:
<pre>Flag A is set
Flag C is set</pre>
Use '''XOR''' to toggle a bit flag (that is, change its state to the opposite of what it was). This example is the same as the '''OR''' example above, but with one extra line added. This time we enable flags A & C, then toggle flags A & B. This will disable flag A and enable B.
<source lang="qbasic">
'The trick here is to give each flag a value corresponding to a different bit being 1
FLAG_A& = VAL("&B0001")
FLAG_B& = VAL("&B0010")
FLAG_C& = VAL("&B0100")
FLAG_D& = VAL("&B1000")
flags& = FLAG_A& OR FLAG_C& 'Set flags A, C
flags& = flags& XOR FLAG_A& XOR FLAG_B& 'Toggle flags A, B
'Use each flag as a bitmask to test for its presence:
IF flags& AND FLAG_A& THEN PRINT "Flag A is set"
IF flags& AND FLAG_B& THEN PRINT "Flag B is set"
IF flags& AND FLAG_C& THEN PRINT "Flag C is set"
IF flags& AND FLAG_D& THEN PRINT "Flag D is set"
</source>
Output:
<pre>Flag B is set
Flag C is set</pre>
{{PageNavigation}}

View file

@ -17,7 +17,7 @@
==QBasic/QuickBASIC==
* PDS or Quickbasic 7 up could use [[BYVAL]] to pass variables by values instead of reference.
* QuickBASIC 4.5 could use [[BYVAL]] only for procedures created in Assembly or another language.
* QBasic required [[CALL ABSOLUTE]] only. It did not have to be [[DECLARE]]d.
* QBasic required [[CALL ABSOLUTE]] only. It did not have to be DECLAREd.
{{PageExamples}}
@ -58,7 +58,7 @@ Hello World!
{{PageSeeAlso}}
* [[SUB]], [[FUNCTION]]
* [[DECLARE]], [[DECLARE (non-BASIC statement)]]
* DECLARE, [[DECLARE (non-BASIC statement)]]
{{PageNavigation}}

View file

@ -9,6 +9,7 @@ The [[COLOR]] statement is used to change the foreground and background colors f
* [[SCREEN]] mode 10 has only 3 white foreground attributes including flashing.
* To change the {{Parameter|background&}} color only, use a comma and the desired color. Ex: [[COLOR]] , {{Parameter|background&}}
* Graphic drawing statements like [[PSET]], [[PRESET]], [[LINE]], etc, also use the colors set by the [[COLOR]] statement if no color is passed when they are called.
* The [[$COLOR]] metacommand adds named color constants for both text and 32-bit modes.
==Screen Mode Attributes==
@ -206,6 +207,7 @@ text$ = "HelloWorld"
{{Cl|COLOR}} 7
{{Cl|PRINT}} "Color 7 is gray"
K$ = {{Cl|INPUT$}}(1)
{{Cl|_PALETTECOLOR}} 7, {{Cl|&H}}FFDAA520 ' FF alpha makes the color translucent
{{Cl|PRINT}} "Color 7 is now Goldenrod in {{Cl|SCREEN}} 0! '' ''
{{CodeEnd}}
@ -218,6 +220,7 @@ K$ = {{Cl|INPUT$}}(1)
{{PageSeeAlso}}
* [[$COLOR]] (metacommand)
* [[_RGB]], [[_RGBA]], [[_RGB32]], [[RGBA32]].
* [[_RED]], [[_GREEN]], [[_BLUE]]
* [[_RED32]], [[_GREEN32]], [[_BLUE32]]

View file

@ -74,7 +74,7 @@ x = 1 'x is a {{Cl|SINGLE}} variable
: ''Explanation:'' The [[SINGLE]] variable can be differentiated from the [[LONG]] x variable by using suffixes like x! or x& in later code.
''Example 7:'' The following code will create a "Name already in use" '''[[IDE|status error]]''' in QB64 when the variable types are the same.
''Example 7:'' The following code will create a "Name already in use" '''status error''' in QB64 when the variable types are the same.
{{CodeStart}} '' ''
x = 1 'x is a {{Cl|SINGLE}} variable
{{Cl|PRINT}} x

View file

@ -117,9 +117,9 @@ Q$ = {{Cl|CHR$}}(34) '=== Write URL Shortcut file info.
''See also:''
* [[ENVIRON]] (statement)
* [[_DEVICES]], [[_DEVICE$]]
* [[_LASTBUTTON]], [[_OS$]]
* [[ENVIRON]] {{text|(statement)}}
* [[Windows Environment]]
* [[Windows Libraries#Windows User|Windows User Paths Library]]

View file

@ -1,7 +1,4 @@
'''This page is maintained for historic purposes. The keyword is [[Keywords_currently_not_supported_by_QB64|not supported in QB64]]. Reading values is supported with [[ENVIRON$]].
----
The [[ENVIRON]] statement is used in DOS/Windows to temporarily set or change an environmental string value.
The [[ENVIRON]] statement is used to temporarily set or change an environmental string value.
{{PageSyntax}}
@ -9,14 +6,12 @@ The [[ENVIRON]] statement is used in DOS/Windows to temporarily set or change an
{{PageDescription}}
* [[Keywords_currently_not_supported_by_QB64|Not supported in QB64.]]
* The {{Parameter|stringExpression$}} must include the environmental parameter ID and the setting:
** Using an '''=''' sign: [[ENVIRON]] "parameterID=setting"
** Using a space: [[ENVIRON]] "parameterID setting"
* If the parameter ID did not previously exist in the environmental string table, it is appended to the end of the table.
* If a parameter ID did exist, it is deleted and the new value is appended to end of the list.
* DOS discards any changes when your program ends so the program must set them when run.
* '''WARNING:''' The amount of space in a environmental table is limited and may create memory errors.
* Any changes made at runtime are discarded when your program ends.
{{PageSeeAlso}}

View file

@ -1,6 +1,6 @@
<center>'''QB64 Compiler Errors''': To troubleshoot compiler errors try this: [[QB64_FAQ#Q:_How_can_I_find_what_caused_a_Compiler_error.3F|recompile scripts]]</center>
<center>'''Please report any Operating System or Compiler errors or failures you cannot fix [http://www.qb64.net/forum/index.php?board=3.0 HERE!]'''</center>
<center>'''Please report any Operating System or Compiler errors or failures you cannot fix [https://github.com/QB64Team/qb64/issues here.]'''</center>
<center>'''It's a good idea to exclude "QB64.exe" from any real-time anti-virus scanning to prevent IDE Module Errors!'''</center>
@ -10,147 +10,147 @@ The following table describes the error codes that are reported by the '''QB64''
{| border="1" cellpadding="2"
|-
! colspan="6"|QB/64 Error Codes
! colspan="6" |QB/64 Error Codes
|-
! Code || Description || Common cause/Resolution || QB64 Differences
!Code||Description||Common cause/Resolution||QB64 Differences
|-
| 1 || [[NEXT]] without [[FOR]] || Missing loop end or look for a missing [[END IF]] or [[END SELECT]] statement. || none
|1||[[NEXT]] without [[FOR]]||Missing loop end or look for a missing [[END IF]] or [[END SELECT]] statement.||none
|-
| 2 || Syntax error || Mistyped keyword statements or puctuation errors can create syntax errors. || none
|2||Syntax error||Mistyped keyword statements or puctuation errors can create syntax errors.||none
|-
| 3 || [[RETURN]] without [[GOSUB]] || Place sub-procedure line label after program [[END]] or [[EXIT]] in a [[SUB]]-procedure.|| none
|3||[[RETURN]] without [[GOSUB]]||Place sub-procedure line label after program [[END]] or [[EXIT]] in a [[SUB]]-procedure.||none
|-
| 4 || Out of DATA || A [[READ]] has read past the end of [[DATA]]. Use [[RESTORE]] to reset to data start. . || none
|4||Out of DATA||A [[READ]] has read past the end of [[DATA]]. Use [[RESTORE]] to reset to data start. .||none
|-
| 5 || Illegal function call || A parameter passed does not match the function type or exceeds certain function limitations. See [[Illegal Function]]. || none
|5||Illegal function call||A parameter passed does not match the function type or exceeds certain function limitations. See [[Illegal Function]].||none
|-
| 6 || Overflow || A numerical value has exceeded the limitations of a [[Variable Types|variable type]]. || none
|6||Overflow||A numerical value has exceeded the limitations of a [[Variable Types|variable type]].||none
|-
| 7 || Out of memory || A module has exceeded the 64K memory limitation of QB. Try breaking the code up to smaller modules.|| no limit
|7||Out of memory||A module has exceeded the 64K memory limitation of QB. Try breaking the code up to smaller modules.||no limit
|-
| 8 || Label not defined || [[GOTO]] or [[GOSUB]] tries to branch to a label that doesn't exist. || none
|8||Label not defined||[[GOTO]] or [[GOSUB]] tries to branch to a label that doesn't exist.||none
|-
| 9 || Subscript out of range || An [[Arrays|array's]] [[UBOUND|upper]] or [[LBOUND|lower]] [[DIM|dimensioned]] boundary has been exceeded. || none
|9||Subscript out of range||An [[Arrays|array's]] [[UBOUND|upper]] or [[LBOUND|lower]] [[DIM|dimensioned]] boundary has been exceeded.||none
|-
| 10 || Duplicate definition || You can't define a variable twice with [[DIM]], the first time a variable is used it is also defined. || none
|10||Duplicate definition||You can't define a variable twice with [[DIM]], the first time a variable is used it is also defined.||none
|-
| 11 || Division by zero || You cannot divide any value by zero! Even using [[MOD]]. || none
|11||Division by zero||You cannot divide any value by zero! Even using [[MOD]].||none
|-
| 12 || Illegal in direct mode || A statement (like [[DIM]]) in the Immediate window wasn't allowed. || N/A
|12||Illegal in direct mode||A statement (like [[DIM]]) in the Immediate window wasn't allowed.||N/A
|-
| 13 || Type mismatch || A [[SUB]] or [[FUNCTION]] parameter does not match the procedure Declaration. || none
|13||Type mismatch||A [[SUB]] or [[FUNCTION]] parameter does not match the procedure Declaration.||none
|-
| 14 || Out of [[STRING|string]] space || A module has exceeded the 32767 text character limit. Use SUB print procedures. || no limit.
|14||Out of [[STRING|string]] space||A module has exceeded the 32767 text character limit. Use SUB print procedures.||no limit.
|-
| 16 || String formula too complex. || A string formula was too long or [[INPUT]] statement requested more than 15 strings || N/A
|16||String formula too complex.||A string formula was too long or [[INPUT]] statement requested more than 15 strings||N/A
|-
| 17 || Cannot continue. || The program while debugging has changed in a way that it cannot continue. || no debug
|17||Cannot continue.||The program while debugging has changed in a way that it cannot continue.||no debug
|-
| 18 || Function not defined. || The function used by the program must be defined. Did you include the .bi file while using a library? || none
|18||Function not defined.||The function used by the program must be defined. Did you include the .bi file while using a library?||none
|-
| 19 || No [[RESUME]]. || Use [[RESUME]] at the end of the [[ON ERROR]] [[GOTO]] routine, not [[RETURN]]. || none
|19||No [[RESUME]].||Use [[RESUME]] at the end of the [[ON ERROR]] [[GOTO]] routine, not [[RETURN]].||none
|-
| 20 || RESUME without error. || [[RESUME]] can only be used in an error handler called by [[ON ERROR]] [[GOTO]]. || none
|20||RESUME without error.||[[RESUME]] can only be used in an error handler called by [[ON ERROR]] [[GOTO]].||none
|-
| 24 || Device timeout. || Use DS0 (DSzero)in the [[OPEN COM]] statement to avoid modem timeouts. || none
|24||Device timeout.||Use DS0 (DSzero)in the [[OPEN COM]] statement to avoid modem timeouts.||none
|-
| 25 || Device fault. || Device not connected or does not exist. || none
|25||Device fault.||Device not connected or does not exist.||none
|-
| 26 || [[FOR]] without [[NEXT]]. || Missing loop end or look for a missing [[END IF]] or [[END SELECT]] statement. || none
|26||[[FOR]] without [[NEXT]].||Missing loop end or look for a missing [[END IF]] or [[END SELECT]] statement.||none
|-
| 27 || Out of paper || A printer paper error when using [[LPRINT]]. || none
|27||Out of paper||A printer paper error when using [[LPRINT]].||none
|-
| 29 || [[WHILE]] without [[WEND]]. || [[WEND]] must end a [[WHILE]] loop. Otherwise look for missing [[END IF]] or [[END SELECT]] || none
|29||[[WHILE]] without [[WEND]].||[[WEND]] must end a [[WHILE]] loop. Otherwise look for missing [[END IF]] or [[END SELECT]]||none
|-
| 30 || [[WEND]] without [[WHILE]] || Missing loop end or look for a missing [[END IF]] or [[END SELECT]] statement. || none
|30||[[WEND]] without [[WHILE]]||Missing loop end or look for a missing [[END IF]] or [[END SELECT]] statement.||none
|-
| 33 || Duplicate label || Line numbers or labels cannot be used twice in a procedure. || none
|33||Duplicate label||Line numbers or labels cannot be used twice in a procedure.||none
|-
| 35 || Subprogram not defined. || Often occurs when the Quickbasic Library is not used with [[CALL ABSOLUTE]] or [[INTERRUPT]] or a [[SUB]] or [[FUNCTION]] procedure has not been created for a [[CALL]]. || none
|35||Subprogram not defined.||Often occurs when the Quickbasic Library is not used with [[CALL ABSOLUTE]] or [[INTERRUPT]] or a [[SUB]] or [[FUNCTION]] procedure has not been created for a [[CALL]].||none
|-
| 37 || Argument-count mismatch || The number of sub-procedure [[parameters]] do not match the call. || none
|37||Argument-count mismatch||The number of sub-procedure [[parameters]] do not match the call.||none
|-
| 38 || Array not defined || [[Arrays]] using more than 10 elements must be [[DIM|DIMensioned]]. || none
|38||Array not defined||[[Arrays]] using more than 10 elements must be [[DIM|DIMensioned]].||none
|-
| 40 || Variable required. || [[LEN]] cannot read literal numerical values. A [[GET]] or [[PUT]] statement must specify a variable when reading or writing a file opened in [[BINARY]] mode. || none
|40||Variable required.||[[LEN]] cannot read literal numerical values. A [[GET]] or [[PUT]] statement must specify a variable when reading or writing a file opened in [[BINARY]] mode.||none
|-
| 50 || [[FIELD]] overflow. || A [[FIELD]] statement tried to allocate more bytes than were specified for the record length of a random access file. || none
|50||[[FIELD]] overflow.||A [[FIELD]] statement tried to allocate more bytes than were specified for the record length of a random access file.||none
|-
| 51 || Internal error. || An internal malfunction occured in QuickBASIC or QB64. || none
|51||Internal error.||An internal malfunction occured in QuickBASIC or QB64.||none
|-
| 52 || Bad file name or number. || The filename must follow the rules for filenames in the OS and use filenumbers from 1 and 255. Use [[FREEFILE]] to avoid duplicate [[OPEN]] file numbers. || none
|52||Bad file name or number.||The filename must follow the rules for filenames in the OS and use filenumbers from 1 and 255. Use [[FREEFILE]] to avoid duplicate [[OPEN]] file numbers.||none
|-
| 53 || File not found. || File not in current directory or path. Use [[_FILEEXISTS]] to verify file names. || none
|53||File not found.||File not in current directory or path. Use [[_FILEEXISTS]] to verify file names.||none
|-
| 54 || Bad file mode. || File access mode does not match a current [[OPEN]] file procedure. || none
|54||Bad file mode.||File access mode does not match a current [[OPEN]] file procedure.||none
|-
| 55 || File already open. || [[CLOSE]] a file to open it in a different mode. || none
|55||File already open.||[[CLOSE]] a file to open it in a different mode.||none
|-
| 56 || FIELD statement active. || '''WRITEME''' || N/A
|56||FIELD statement active.||'''WRITEME'''||N/A
|-
| 57 || Device I/O error. || '''WRITEME''' || N/A
|57||Device I/O error.||'''WRITEME'''||N/A
|-
| 58 || File already exists. || The filename specified in the [[NAME]] statement was identical to a file that already exists. || none
|58||File already exists.||The filename specified in the [[NAME]] statement was identical to a file that already exists.||none
|-
| 59 || Bad record length. || Record length exceeds 32767 bytes or is 0 || none
|59||Bad record length.||Record length exceeds 32767 bytes or is 0||none
|-
| 61 || Disk full. || The amount of data to write to the disk was more than the free space available, remove some files you don't need and try again. || none
|61||Disk full.||The amount of data to write to the disk was more than the free space available, remove some files you don't need and try again.||none
|-
| 62 || Input past end of file. || Check for the end of file with [[EOF]] when reading from a file. || none
|62||Input past end of file.||Check for the end of file with [[EOF]] when reading from a file.||none
|-
| 63 || Bad record number. || [[GET]] read exceeds number of records in a [[RANDOM]] file. || none
|63||Bad record number.||[[GET]] read exceeds number of records in a [[RANDOM]] file.||none
|-
| 64 || Bad file name || File name contains illegal characters or exceeds 12 characters. || none
|64||Bad file name||File name contains illegal characters or exceeds 12 characters.||none
|-
| 67 || Too many files || Over 15 files are open in Qbasic. || none
|67||Too many files||Over 15 files are open in Qbasic.||none
|-
| 68 || Device unavailable. || Device does not exist, busy or not connected. || none
|68||Device unavailable.||Device does not exist, busy or not connected.||none
|-
| 69 || Communication-buffer overflow. || '''WRITEME''' || N/A
|69||Communication-buffer overflow.||'''WRITEME'''||N/A
|-
| 70 || Permission denied || A file or port is in use on a network, blocked, read only or locked. || none
|70||Permission denied||A file or port is in use on a network, blocked, read only or locked.||none
|-
| 71 || Disk not ready. || Disk is busy or has no media. || none
|71||Disk not ready.||Disk is busy or has no media.||none
|-
| 72 || Disk-media error. || Improper media format or bad data. || none
|72||Disk-media error.||Improper media format or bad data.||none
|-
| 73 || Feature unavailable. || Based on the DOS version available. || none
|73||Feature unavailable.||Based on the DOS version available.||none
|-
| 74 || Rename across disks. || '''WRITEME''' || N/A
|74||Rename across disks.||'''WRITEME'''||N/A
|-
| 75 || Path/File access error. || File or path cannot be accessed. || none
|75||Path/File access error.||File or path cannot be accessed.||none
|-
| 76 || Path not found. || Path is not access-able or does not exist. Use [[_DIREXISTS]] to check paths.|| none
|76||Path not found.||Path is not access-able or does not exist. Use [[_DIREXISTS]] to check paths.||none
|-
| 97 || (no error message) || Can be used to trigger an error trap event with [[ERROR]] 97, nothing else will cause this error, so create your own errors for [[ON ERROR]]. || none
|97||(no error message)||Can be used to trigger an error trap event with [[ERROR]] 97, nothing else will cause this error, so create your own errors for [[ON ERROR]].||none
|-
|}
<center>'''N/A means Not Available or Not Applicable to QB64.'''</center>
{| border="1" cellpadding="2"
! colspan="6"|QB64 Error Codes
! colspan="6" |QB64 Error Codes
|-
! Code || Description || Common cause/resolution || QB Differences
!Code||Description||Common cause/resolution||QB Differences
|-
| 258 || Invalid handle || Zero or bad handle values cannot be used by the QB64 procedure creating the error. || N/A
|258||Invalid handle||Zero or bad handle values cannot be used by the QB64 procedure creating the error.||N/A
|}
==Other Errors==
* '''Syntax errors''': '''QB64''' will display most statement syntax and parameter errors in the Status area below the editing area in the [[IDE]]. It may also show missing brackets or other syntax punctuation required. Check the keyword's [[Syntax Notation Conventions|syntax]] when necessary!
*'''Syntax errors''': '''QB64''' will display most statement syntax and parameter errors in the Status area below the editing area in the IDE. It may also show missing brackets or other syntax punctuation required. Check the keyword's syntax when necessary!
* '''CPU Memory errors''' can be created when QB64 loads too many images at one time using [[_LOADIMAGE]] or [[_NEWIMAGE]] without freeing them. Use [[_FREEIMAGE]] to free unused handles. Also may be caused by continually running loops.
*'''CPU Memory errors''' can be created when QB64 loads too many images at one time using [[_LOADIMAGE]] or [[_NEWIMAGE]] without freeing them. Use [[_FREEIMAGE]] to free unused handles. Also may be caused by continually running loops.
* '''Parameter Type Mismatch''': Qbasic's IDE may add DEF statements before any [[SUB]] or [[FUNCTION]]. '''QB64'''(like QB) 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 the proper 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!
*'''Parameter Type Mismatch''': Qbasic's IDE may add DEF statements before any [[SUB]] or [[FUNCTION]]. '''QB64'''(like QB) 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 the proper 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!
==See also==
* [[ERROR]] (simulates error), [[ERR]] ('''QB''' error code number), [[ERL]] (closest line number when line numbers are used)
* [[ON ERROR]] (calls error handing routine using [[GOTO]] only), [[_ERRORLINE]] (actual '''QB64''' text code line)
*[[ERROR]] (simulates error), [[ERR]] ('''QB''' error code number), [[ERL]] (closest line number when line numbers are used)
*[[ON ERROR]] (calls error handing routine using [[GOTO]] only), [[_ERRORLINE]] (actual '''QB64''' text code line)
{{PageNavigation}}

View file

@ -2,7 +2,7 @@ The [[EXIT]] statement is used to exit certain QBasic procedures.
{{PageSyntax}}
: [[EXIT]] {DO|WHILE|FOR|SUB|FUNCTION}
: [[EXIT]] {DO|WHILE|FOR|SUB|FUNCTION|SELECT|CASE}
{{PageDescription}}
@ -12,12 +12,18 @@ The [[EXIT]] statement is used to exit certain QBasic procedures.
** [[EXIT]] FOR exits a [[FOR...NEXT]] counter loop.
** [[EXIT]] SUB exits a [[SUB]] procedure before it ends. Use before any [[GOSUB]] procedures using [[RETURN]].
** [[EXIT]] FUNCTION exits a [[FUNCTION]] procedure before it ends. The value passed by the function's name should be defined.
<!-- ** [[EXIT]] DEF exits a [[DEF FN]] function procedure before it ends. The value passed by the function's name should be defined. -->
** [[EXIT]] SELECT exits a [[SELECT CASE]] block.
** [[EXIT]] CASE does the same as EXIT SELECT unless when used in a '''SELECT EVERYCASE''' block; in such case, execution proceeds to the next CASE evaluation.
* EXIT statements normally use an [[IF...THEN]] statement to evaluate a program condition that would require the EXIT.
* To exit a program and allow the last program screen to be displayed with the message "Press any key to continue...", use [[END]].
* To exit the program immediately, use [[SYSTEM]].
== Availability ==
* '''EXIT SELECT/CASE''' available with v1.5.
* All other variants available in all versions of QB64.
{{PageSeeAlso}}
* [[_EXIT (function)]]
* [[END]], [[SYSTEM]]

View file

@ -19,13 +19,13 @@ A [[FUNCTION]] block statement is used to create a function procedure to return
* All [[$DYNAMIC|dynamic]] variable values return to 0 or null strings when the procedure is exited except when a variable or the entire function is [[STATIC]]. This can save program memory as all [[$DYNAMIC|dynamic]] memory used in a FUNCTION is released on procedure exit.
* FUNCTION procedure code can use [[GOSUB]] and [[GOTO]] line numbers or labels inside of the procedure when necessary.
* For early function exits use [[EXIT]] [[FUNCTION]] before [[END FUNCTION]] and [[GOSUB]] procedures using [[RETURN]].
* '''QB64 ignores all procedural [[DECLARE]] statements.''' Define all ''parameter'' [[Data types|types]] in the FUNCTION procedure.
* '''QB64 ignores all procedural DECLARE statements.''' Define all ''parameter'' [[Data types|types]] in the FUNCTION procedure.
* '''Images are not deallocated when the [[SUB]] or [[FUNCTION]] they are created in ends. Free them with [[_FREEIMAGE]].'''
* 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.
* 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==
* Once a FUNCTION was created and used, the QBasic IDE would [[DECLARE]] it when the file was saved. '''QB64 doesn't need these declarations.'''
* 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.
@ -75,7 +75,6 @@ IntegerArray& = ImageBufferSize&(wide&, deep&, mode%) \ 2 ' retu
{{PageSeeAlso}}
* [[SUB]], [[SCREEN (statement)]]
* [[DEF FN]]
* [[EXIT]] (statement), [[END]]
* [[_EXIT (function)]]

View file

@ -41,11 +41,10 @@
{{PageSeeAlso}}
* [[PUT (TCP/IP statement)]], [[INPUT (TCP/IP statement)]]
* [[PUT (TCP/IP statement)]]
* [[_OPENCLIENT]], [[_OPENHOST]]
* [[_OPENCONNECTION]], [[GET|GET #]]
* [[IP Configuration]]
* [https://curl.haxx.se/ cURL], [[WGET]] (HTTP and FTP file transfer)
* [https://curl.haxx.se/ cURL] (HTTP and FTP file transfer)
{{PageNavigation}}

View file

@ -10,7 +10,7 @@ The [[GOTO]] statement sends the procedure to a line label or a line number in t
{{PageDescription}}
* ''lineNumber'' or ''lineLabel'' must already exist or an [[IDE]] status error will be displayed until it is created.
* ''lineNumber'' or ''lineLabel'' must already exist or an IDE status error will be displayed until it is created.
* Can be used in [[SUB]] or [[FUNCTION]] procedures using their own line labels or numbers.
* The frequent use of GOTO statements can become confusing when trying to follow the code and it could also cause endless loops.
* [[GOTO]] is an easy trap for new programmers. Use loops instead when possible.

View file

@ -31,7 +31,7 @@
* The '''QB64''' IDE will indicate an error in the IF statement line until END IF closes the statement block.
* Use [[colon]]s to execute multiple statements in a single-line IF statement.
* An '''[[underscore]]''' can be used anywhere after the code on a single-line to continue it to the next line in '''QB64'''.
* '''NOTE:''' [[STRING]] values can only be evaluated in an IF statement if a value is compared to a literal or [[CHR$]] string value. '''QB64 may not compile literal IF string statements or indicate an [[IDE]] coding error.''' Use [[LEN]] or [[ASC]] to compare strings numerically.
* '''NOTE:''' [[STRING]] values can only be evaluated in an IF statement if a value is compared to a literal or [[CHR$]] string value. '''QB64 may not compile literal IF string statements or indicate an IDE coding error.''' Use [[LEN]] or [[ASC]] to compare strings numerically.

View file

@ -6,7 +6,7 @@ The [[IMP]] logical operator converts the result of two comparative values and r
{{PageDescription}}
* Returns a different result from [[AND]], [[OR]] or [[XOR]].
* Returns a different result from [[AND]], [[OR]] or [[XOR]] - see truth table below.
* Evaluates if {{Parameter|firstValue}} '''''imp'''lies'' {{Parameter|secondValue}}.
**If {{Parameter|firstValue}} is true then {{Parameter|secondValue}} must also be true.
**So if {{Parameter|firstValue}} is true, and {{Parameter|secondValue}} false, then the condition is false, otherwise it is true (see table below).

View file

@ -12,7 +12,7 @@ The [[INKEY$]] function returns user input as [[ASCII]] [[STRING]] character(s)
* INKEY$ can also be used to clear a [[SLEEP]] key press or the keyboard buffer in a loop.
* Assign the INKEY$ return to a string variable to save the key entry.
* <span style="font-family: Courier New, monospace, Courier; background: #dddddd">[[LOCATE]] , , 1</span> displays the INKEY$ cursor. Use <span style="font-family: Courier New, monospace, Courier; background: #dddddd">LOCATE , , 0</span> to turn it off.
* Use [[_DEST]] [[_CONSOLE]] before reading INKEY$ to receive input from a [[$CONSOLE|console]] window.
* To receive input from a [[$CONSOLE]] window, use [[_CINP]].
* Returns can be evaluated as certain [[ASCII]] characters or codes.
{{WhiteStart}}' '''ASCII Keyboard Codes'''
'

View file

@ -80,7 +80,7 @@ y$ = "I'm fine."
* [[INPUT (file mode)]], [[LINE INPUT (file statement)|LINE INPUT #]], [[INPUT$]] {{text|(file input)}}
* [[INPUT]], [[LINE INPUT]], [[INPUT$]] {{text|(keyboard input)}}
* [[PRINT (file statement)|PRINT #]], [[PRINT USING (file statement)|PRINT #, USING]]
* [[GET|GET #]], [[INPUT (TCP/IP statement)]]
* [[GET|GET #]]
{{PageNavigation}}

View file

@ -33,7 +33,8 @@
<center>GO TO: [[Keyboard_scancodes#INP_Scan_Codes|Scan Codes]],
[[Keyboard_scancodes#ON_KEY_Events|ON KEY]], [[Keyboard_scancodes#KEYHIT_and_KEYDOWN_Codes|_KEYHIT]], [[Keyboard_scancodes#DEVICES_Button|_DEVICES]], [[Keyboard_scancodes#Windows_Virtual_Codes|Windows Virtual]]</center>
==INP Scan Codes==
==INP and _CINP Scan Codes==
* [[_CINP]] can be used in [[$CONSOLE]] Windows to read individual key presses.
* [[INP]]([[&H]]60) returns multiple [[INTEGER]] press and release codes as keys are used. Use: '''{{text|code% <nowiki>=</nowiki> INP(96)|green}}'''
* To clear the keyboard buffer, use the [[INKEY$]] function before or after the [[INP]] read to avoid buffer overflows and beeps.
* Keys are assigned only one code irregardless of case or Lock mode with release codes being the press code + 128.
@ -188,8 +189,6 @@
''Example 1:'' An [[INP]] Function that retrieves multiple scancodes (allows 2 players and diagonal moves). Function includes it's own array.
{{CodeStart}} '' ''
{{Cl|DECLARE}} {{Cl|FUNCTION}} ScanKey%(code%) '{{Cl|NOT}} required in QB64
{{Cl|CLS}}
x = 40: px = x
y = 20: py = y

View file

@ -17,8 +17,6 @@ __NOTOC__
<p style="text-align: center">For comments or suggestions about this WIKI goto the [http://www.qb64.org/forum/index.php QB64 Forum].</p>
<center>'''[[Known QB64 Issues]]'''</center>
<center> '''If code examples only display partial code, use the browser Refresh button'''</center>
<center>[[Main Page|Main Page with Appendix and Tutorials]]</center>
@ -244,6 +242,7 @@ __NOTOC__
* [[_MEMIMAGE]] (function) {{text|returns a [[_MEM]] block referring to a designated image handle's memory}}
* [[_MEMNEW]] (function) {{text|allocates new memory with a designated SIZE and returns a [[_MEM]] block referring to it.}}
* [[_MEMPUT]] (statement) {{text|places a designated value into a designated memory block OFFSET}}
* [[_MEMSOUND]] (function) {{text|returns a [[_MEM]] block referring to a designated sound handle's memory}}
* [[_SCREENMOVE|_MIDDLE]] (_SCREENMOVE parameter) {{text|centers the program window on the desktop in any screen resolution.}}
* [[_MK$]] (function) {{text|converts a numerical value to a designated [[ASCII]] [[STRING]] value.}}
* [[_MOUSEBUTTON]] (function) {{text|returns the status of a designated mouse button.}}
@ -279,7 +278,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 _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.}}
* [[_OS$]] (function) {{text|returns the QB64 compiler version in which the program was compiled as [WINDOWS], [LINUX] or [MACOSX] and [32BIT] or [64BIT].}}
@ -500,11 +500,10 @@ __NOTOC__
* [[DATA]] (statement) {{text|creates a line of fixed program information separated by commas.}}
* [[DATE$]] (function) {{text|returns the present Operating System date [[STRING|string]] formatted as mm-dd-yyyy.}}
* [[DATE$ (statement)]] {{text|sets the date of the Operating System using a mm-dd-yyyy [[STRING|string]] format.}}
* [[DECLARE]] (BASIC statement) {{text|declares a [[SUB]] or [[FUNCTION]] procedure at the start of a program. Not required in QB64.}}
* DECLARE (BASIC statement) {{text|declares a [[SUB]] or [[FUNCTION]] procedure at the start of a program. Not required in QB64.}}
* [[DECLARE (non-BASIC statement)]] {{text|declares non-basic [[SUB]] or [[FUNCTION]] procedures. Not implemented in QB64.}}
* [[DECLARE LIBRARY|DECLARE LIBRARY (QB64 statement block)]] {{text|declares a C++, SDL or Operating System [[SUB]] or [[FUNCTION]] to be used.}}
* [[DECLARE DYNAMIC LIBRARY|DECLARE DYNAMIC LIBRARY (QB64 statement)]] {{text|declares DYNAMIC, CUSTOMTYPE or STATIC library(DLL) [[SUB]] or [[FUNCTION]].}}
* [[DEF FN]] (statement) {{text|defines a function procedure in the main program that cannot be used recursively.}}
* [[DEF SEG]] (statement) {{text|defines a segment in memory to be accessed by a memory procedure.}}
* [[DEFDBL]] (statement) {{text|defines a set of undefined variable name starting letters as [[DOUBLE]] type numerical values.}}
* [[DEFINT]] (statement) {{text|defines a set of undefined variable name starting letters as [[INTEGER]] type numerical values.}}
@ -527,7 +526,7 @@ __NOTOC__
* [[ELSEIF]] ([[IF...THEN]] statement) {{text|is used with [[THEN]] to set alternate conditional evaluations.}}
* [[END]] (statement) {{text|sets the end of a program, sub-procedure, statement block, [[DECLARE LIBRARY]] or [[TYPE]] definition.}}
* [[IF...THEN|END IF]] (statement) {{text|[[END]]s an IF...THEN conditional block statement using more than one line of code.}}
* [[ENVIRON]] (statement) {{text|temporarily sets or changes an environmental string value.}}
* [[ENVIRON]] (statement) {{text|temporarily sets an environmental key/pair value.}}
* [[ENVIRON$]] (function) {{text|returns a specified string setting or numerical position as an environmental [[STRING]] value.}}
* [[EOF]] (file function) {{text|returns -1 when a file [[INPUT (file statement)|INPUT]] or [[GET]] has reached the end of a file.}}
* [[EQV]] (logic operator) {{text|is used to compare two numerical values bitwise.}}
@ -537,7 +536,7 @@ __NOTOC__
* [[ERL]] (error function) {{text|returns the closest line number before an error occurred if line numbers are used.}}
* [[ERR]] (function) {{text|returns the [[ERROR Codes|ERROR code]] when a program error occurs.}}
* [[ERROR]] (statement) {{text|sets a specific [[ERROR Codes|ERROR code]] to be simulated.}}
* [[EXIT]] (statement) {{text|immediately exits a program [[FOR...NEXT]], [[DO...LOOP]], [[SUB]], [[FUNCTION]] or [[DEF FN]] procedure.}}
* [[EXIT]] (statement) {{text|immediately exits a program [[FOR...NEXT]], [[DO...LOOP]], [[SUB]] or [[FUNCTION]] procedure.}}
* [[EXP]] (function) {{text|returns the value of e to the exponential power specified.}}
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
@ -589,7 +588,6 @@ __NOTOC__
* [[INPUT]] (statement) {{text|a user input that returns a value to one or more specified variable(s).}}
* [[INPUT (file mode)]] {{text|[[OPEN]] statement that only allows an existing file to be read using [[INPUT (file statement)]] or [[INPUT$]].}}
* [[INPUT (file statement)]] {{text|reads a file sequentially using the variable types designated.}}
* [[INPUT (TCP/IP statement)|INPUT (QB64 TCP/IP statement)]] {{text|reads a port connection sequencially using the variable types designated.}}
* [[INPUT$]] (function) {{text|returns a designated number of [[STRING|string]] bytes from the keyboard entry or a file number.}}
* [[INSTR]] (function) {{text|returns the position in a text [[STRING|string]] where a character sequence match starts.}}
* [[INT]] (function) {{text|rounds a numerical value to an [[INTEGER]] value by removing the decimal point fraction.}}
@ -713,7 +711,6 @@ __NOTOC__
* [[PRESET]] (statement) {{text|sets a pixel coordinate to the background color unless one is specified.}}
* [[PRINT]] (statement) {{text|prints text [[STRING|strings]] or numerical values to the [[SCREEN]].}}
* [[PRINT (file statement)]] {{text|prints text [[STRING|strings]] or numerical values to a file.}}
* [[PRINT (TCP/IP statement)|PRINT (QB64 TCP/IP statement)]] {{text|sends text [[STRING|strings]] to a connection handle.}}
* [[PRINT USING]] (statement) {{text|prints a template formatted [[STRING|string]] to the [[SCREEN]].}}
* [[PRINT USING (file statement)]] {{text|prints a template formatted [[STRING|string]] to a file.}}
* [[PSET]] (statement) {{text|sets a pixel coordinate to the current color unless a color is designated.}}
@ -762,7 +759,7 @@ __NOTOC__
* [[SHELL]] (statement) {{text|sends [[STRING]] commands to the command line. SHELL calls will not affect the current path.}}
* [[SHELL (function)|SHELL (QB64 function)]] {{text|executes an external command or calls another program. Returns codes sent by [[END]] or [[SYSTEM]].}}
* [[SIGNAL]] (OS 2 event)
* [[SIN]] (function) {{text|returns the sine of a [[radians|radian]] angle.}}
* [[SIN]] (function) {{text|returns the sine of a radian angle.}}
* [[SINGLE]] (! numerical type) {{text|4 byte floating decimal point values up to 7 decimal places.}}
* [[SLEEP]] (statement) {{text|pauses the program for a designated number of seconds or until a key is pressed.}}
* [[SOUND]] (statement) {{text|creates a sound of a specified frequency and duration.}}
@ -793,12 +790,9 @@ __NOTOC__
* [[TAN]] (function) {{text|returns the ratio of [[SIN]]e to [[COS]]ine or tangent value of an angle measured in radians.}}
* [[THEN]] ([[IF...THEN]] keyword) {{text|must be used in a one line [[IF...THEN]] program flow statement.}}
* [[TIME$]] (function) {{text|returns the present time setting of the Operating System as a format hh:mm:ss [[STRING]].}}
* [[TIME$ (statement)]] {{text|sets the OS time using the hh:mm:ss [[STRING]] format.}}
* [[TIMER]] (function) {{text|returns the number of seconds since midnight as a [[SINGLE]] value.}}
* [[TIMER (statement)]] {{text|events based on the designated time interval and timer number.}}
* [[TO]] {{text|indicates a range of numerical values or an assignment of one value to another.}}
* [[TROFF]] (statement)
* [[TRON]] (statement)
* [[TYPE]] (definition) {{text|defines a variable type or file record that can include any [[STRING]] or numerical types.}}
@ -856,12 +850,16 @@ __NOTOC__
<!-- (referenced by QB64 IDE HELP)
-->
<div id = "glA">_glA</div>
==OpenGL specific keywords:==
<center>'''All QB64 OpenGL keywords must use the underscore _gl prefix with the alphabetically listed function names.'''</center>
<center>Use [[$NOPREFIX]] to enable these to be used without the leading underscore.</center>
* Important: See [[SUB _GL]]
----
<div id = "glA">_glA</div>
* [[_glAccum]] (statement) {{text|OpenGL command}}
* [[_glAlphaFunc]] (statement) {{text|OpenGL command}}
* [[_glAreTexturesResident]] (statement) {{text|OpenGL command}}
@ -1354,9 +1352,7 @@ __NOTOC__
[[Keyword Reference - By usage|Go to keywords by Usage]]
[[Main_Page#Appendix:|Main Page with Appendix and Tutorials]]
[[IDE|How to use the QB64 IDE and Compiler]]
[[Main_Page#Appendix:|Main Page with Appendix and Tutorials]]
'''Got a question about something?'''

View file

@ -13,7 +13,7 @@
[[Keywords currently not supported by QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Keywords Not Supported in Linux or MAC versions]]
== [[Arrays]] and Data Storage: ==
== [[Arrays]] and Data Storage ==
<center>'''Arrays'''</center>
* [[_DEFINE]] (statement) {{text|defines a range of untyped variable names according to their first character as a datatype.}}
@ -42,7 +42,7 @@
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
== [[COLOR|Colors]] and Transparency: ==
== [[COLOR|Colors]] and Transparency ==
* [[_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.}}
@ -94,13 +94,13 @@
* [[_SCREENHIDE]] {{text|hides the main program window in a section of code until [[_SCREENSHOW]] is used.}}
* [[$SCREENSHOW]] (QB64 [[Metacommand]]) {{text|displays the main program window throughout the program after [[$SCREENHIDE]] has been used.}}
* [[_SCREENSHOW]] {{text|displays the main program window in a section of code after [[_SCREENHIDE]] has been used.}}
* [[SHELL (function)|SHELL (QB64 function)]] {{text|executes a [[DOS]] command or calls another program. Returns codes sent by [[END]] or [[SYSTEM]].}}
* [[_SHELLHIDE]] (function) {{text|hides a [[DOS]] command or call to another program. Returns codes sent by [[END]] or [[SYSTEM]].}}
* [[SHELL (function)|SHELL (QB64 function)]] {{text|executes a DOS command or calls another program. Returns codes sent by [[END]] or [[SYSTEM]].}}
* [[_SHELLHIDE]] (function) {{text|hides a DOS command or call to another program. Returns codes sent by [[END]] or [[SYSTEM]].}}
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
== Conditional Operations: ==
== Conditional Operations ==
* [[AND (boolean)]] {{text|returns True if all of the arguments are True.}}
@ -112,12 +112,12 @@
{{Template:RelationalOperationsTable}}
<center>See also: [[#Logical Bitwise Operations:|Logical Operations:]] and [[Relational Operations]]</center>
<center>See also: [[#Logical Bitwise Operations|Logical Operations]] and [[Relational Operations]]</center>
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
== Definitions and Variable Types: ==
== Definitions and Variable Types ==
* [[_BIT]] {` numerical [[TYPE|type]]) {{text|values of 0 (bit off) or -1 (bit on). [[_UNSIGNED|Unsigned]] of 0 or 1.}}
* [[_BYTE]] {%% numerical [[TYPE|type]]) {{text|values from -128 to 127 (one byte or 8 [[_BIT]]s). [[_UNSIGNED|Unsigned]] from 0 to 255.}}
@ -166,27 +166,27 @@
* [[_DONTWAIT]] (SHELL action) {{text|allows the program to continue without waiting for the other program to close.}}
* [[_FILEEXISTS]] (function) {{text|returns -1 if the file name [[STRING|string]] parameter exists. Zero if it does not.}}
* [[_FINISHDROP]] (statement) {{text| resets [[_TOTALDROPPEDFILES]] and clears the [[_DROPPEDFILE]] list of items (files/folders).}}
* [[_HIDE]] (SHELL action) {{text|hides the [[DOS]] screen output during a shell.}}
* [[_HIDE]] (SHELL action) {{text|hides the DOS screen output during a shell.}}
* [[_LASTBUTTON]] (function) {{text|returns the number of buttons available on a specified number device listed by [[DEVICE$]].}}
* [[_OS$]] (function) {{text| returns the QB64 compiler version in which the program was compiled as [WINDOWS], [LINUX] or [MACOSX] and [32BIT] or [64BIT].}}
* [[_SCREENCLICK]] {{text|simulates clicking the mouse at a position on the screen to get focus.}}
* [[_SCREENIMAGE]] {{text|captures the current desktop screen image.}}
* [[_SCREENPRINT]] {{text|simulates keyboard entries on the desktop.}}
* [[_SHELLHIDE]] (function) {{text|executes a [[DOS]] command or calls another program. Returns codes sent by [[END]] or [[SYSTEM]].}}
* [[_SHELLHIDE]] (function) {{text|executes a DOS command or calls another program. Returns codes sent by [[END]] or [[SYSTEM]].}}
* [[_STARTDIR$]] (function) {{text|returns the user's program calling path as a [[STRING]].}}
* [[_TOTALDROPPEDFILES]] (function) {{text| returns the number of items (files or folders) dropped in a program's window after [[_ACCEPTFILEDROP]] is enabled.}}
* [[CHDIR]] (statement) {{text|changes the program path to a new path.}}
* [[COMMAND$]] (function) {{text|returns command line parameters sent when a program is started.}}
* [[ENVIRON]] (statement) {{text|sets the environmental settings of the computer. NOT IMPLEMENTED!}}
* [[ENVIRON]] (statement) {{text|temporarily sets an environmental key/pair value.}}
* [[ENVIRON$]] (function) {{text|returns the environmental settings of the computer.}}
* [[FILES]] (statement) {{text|displays a specified list of files.}}
* [[MKDIR]] (statement) {{text|creates a new directory folder in the designated path.}}
* [[NAME]] (statement) {{text|renames a file.}}
* [[RMDIR]] (statement) {{text|removes an empty directory folder from the specified path.}}
* [[SHELL]] (statement) {{text|performs a command line operation in [[DOS]].}}
* [[SHELL (function)|SHELL (QB64 function)]] {{text|executes a [[DOS]] command or calls another program. Returns codes sent by [[END]] or [[SYSTEM]].}}
* [[SHELL]] (statement) {{text|performs a command line operation in DOS.}}
* [[SHELL (function)|SHELL (QB64 function)]] {{text|executes a DOS command or calls another program. Returns codes sent by [[END]] or [[SYSTEM]].}}
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
@ -326,14 +326,12 @@ The following table describes the error codes that are reported by the '''QB64''
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
== Error Trapping: ==
== 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.}}
* [[_ERRORLINE]] (function) {{text|returns the actual text code line where a program error occurred.}}
* [[ERDEV]] (function) {{text|returns an error code from the last device to create an error. NOT IMPLEMENTED!}}
* [[ERDEV$]] (function) {{text|returns the string name of the last device to declare an error. NOT IMPLEMENTED!}}
* [[ERR]] (function) {{text|returns the error code number of the last error to occur.}}
* [[ERROR]] (statement) {{text|simulates a program error based on the error code number used.}}
* [[ERL]] (function) {{text|returns the closest line number before an error occurred if the program uses them.}}
@ -346,7 +344,7 @@ The following table describes the error codes that are reported by the '''QB64''
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
==Event Trapping:==
== Event Trapping ==
* [[_AUTODISPLAY]] (statement) {{text|enables the automatic display of the screen image changes previously disabled by [[_DISPLAY]].}}
* [[_DELAY]] (statement) {{text|suspends program execution for a [[SINGLE]] value of seconds down to milliseconds.}}
@ -371,7 +369,7 @@ The following table describes the error codes that are reported by the '''QB64''
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
== File Input and Output: ==
== File Input and Output ==
* [[_DIREXISTS]] (function) {{text|returns -1 if the directory folder name [[STRING|string]] parameter exists. Zero if it does not.}}
* [[_FILEEXISTS]] (function) {{text|returns -1 if the file name [[STRING|string]] parameter exists. Zero if it does not.}}
@ -391,14 +389,14 @@ The following table describes the error codes that are reported by the '''QB64''
* [[INPUT (file mode)]] {{text|only [[OPEN]]s existing sequential files for program INPUT.}}
* [[INPUT (file statement)]] {{text|reads sequential file data that was created using PRINT # or WRITE #. }}
* [[INPUT$]] (function) {{text|reads a specific number of bytes from random or binary files.}}
* [[IOCTL]] (statement) {{text|sends a message to an open IOCTL compatible device. NOT IMPLEMENTED!}}
* [[IOCTL$]] (function) {{text|receives messages from an open device. NOT IMPLEMENTED!}}
* [[KILL]] (statement) {{text|deletes a specified file without asking for verification. Remove empty folders with [[RMDIR]].}}
* [[LINE INPUT (file statement)]] {{text|reads an entire text row of printed sequential file data.}}
* [[LOC]] (function) {{text|finds the current file location or size of a [[COM]] port receive buffer.}}
* [[LOCK]] (statement) {{text|prevents access to a file.}}
* [[LOF]] (file function) {{text|returns the size of a file in bytes.}}
* [[MKDIR]] (statement) {{text|creates a new folder in the designated path.}}
* [[MKDIR]] (statement) {{
4000
text|creates a new folder in the designated path.}}
* [[NAME]] (statement) {{text|renames a file [[AS]] a new file name.}}
* [[OPEN]] (file I/O statement) {{text|opens a specified file FOR an access mode with a set reference number.}}
* [[OUTPUT]] (file mode) {{text|opens or creates a new file that holds no data.}}
@ -416,7 +414,7 @@ The following table describes the error codes that are reported by the '''QB64''
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
== Fonts: ==
== Fonts ==
* [[_FONT (function)]] {{text|creates a new alphablended font handle from a designated image handle}}
* [[_FONT]] (statement) {{text|sets the current [[_LOADFONT]] function font handle to be used by [[PRINT]] or [[_PRINTSTRING]].}}
@ -439,7 +437,7 @@ The following table describes the error codes that are reported by the '''QB64''
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
== Game Controller Input (Joystick): ==
== Game Controller Input (Joystick) ==
* [[_AXIS]] (function) {{text|returns a [[SINGLE]] value between -1 and 1 indicating the maximum distance from device axis center 0.}}
* [[_BUTTON]] (function) {{text|returns -1 when a device button is pressed and 0 when button is released.}}
* [[_BUTTONCHANGE]] (function) {{text|returns -1 when a device button has been pressed and 1 when released. Zero indicates no change.}}
@ -460,7 +458,7 @@ The following table describes the error codes that are reported by the '''QB64''
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
==Graphic Commands==
== Graphic Commands ==
* [[_COPYIMAGE]] (function) {{text|can copy a software surface to a hardware accelerated surface handle using mode 33.}}
* [[_DISPLAY]] (statement) {{text|renders surfaces visible in the [[_DISPLAYORDER]] previously set in the QB64 program.}}
@ -523,7 +521,7 @@ The following table describes the error codes that are reported by the '''QB64''
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
== Keyboard Input: ==
== Keyboard Input ==
* [[_CONTROLCHR]] (statement) {{text|[[OFF]] allows the control characters to be used as text characters. [[ON]](default) can use them as commands.}}
* [[_CONTROLCHR (function)]] {{text| returns the current state of _CONTROLCHR as 1 when OFF and 0 when ON.}}
* [[_EXIT (function)]] {{text|prevents a program user exit and indicates if a user has clicked the close X window button or CTRL + BREAK.}}
@ -549,7 +547,7 @@ The following table describes the error codes that are reported by the '''QB64''
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
==[[Libraries]]:==
== [[Libraries]] ==
* [[_OFFSET (function)]] {{text|returns the memory offset of a variable when used with [[DECLARE DYNAMIC LIBRARY]] only.}}
* [[_OFFSET]](variable type) {{text|can be used store the value of an offset in memory when using [[DECLARE DYNAMIC LIBRARY]] only.}}
@ -570,7 +568,7 @@ The following table describes the error codes that are reported by the '''QB64''
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
== Logical Bitwise Operations: ==
== Logical Bitwise Operations ==
* [[AND]] (operator) {{text|the bit is set when both bits are set.}}
* [[EQV]] (operator) {{text|the bit is set when both are set or both are not set.}}
@ -585,7 +583,7 @@ The following table describes the error codes that are reported by the '''QB64''
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
== Mathematical Functions and Operations: ==
== Mathematical Functions and Operations ==
* [[_ROUND]] (function) {{text|rounds to the closest EVEN [[INTEGER]], [[LONG]] or [[_INTEGER64]] numerical value.}}
@ -604,13 +602,13 @@ The following table describes the error codes that are reported by the '''QB64''
* [[CDBL]] (function) {{text|closest double rounding function}}
* [[CINT]] (function) {{text|closest integer rounding function}}
* [[CLNG]] (function) {{text|closest long integer rounding function}}
* [[COS]] (function) {{text|cosine of a [[radians|radian]] angle}}
* [[COS]] (function) {{text|cosine of a radian angle}}
* [[CSNG]] (function) {{text|closest single rounding function}}
* [[EXP]] (function) {{text|returns the value of e to the power of the parameter used.}}
* [[FIX]] (function) {{text|rounds positive or negative values to integer values closer to 0}}
* [[INT]] (function) {{text|rounds to lower integer value}}
* [[LOG]] (function) {{text|natural logarithm of a specified numerical value.}}
* [[SIN]] (function) {{text|sine of a [[radians|radian]] angle.}}
* [[SIN]] (function) {{text|sine of a radian angle.}}
* [[SQR]] (function) {{text|square root of a positive number.}}
* [[TAN]] (function) {{text|returns the ratio of [[SIN]]e to [[COS]]ine or tangent value of an angle measured in radians.}}
@ -619,7 +617,7 @@ The following table describes the error codes that are reported by the '''QB64''
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
== Memory Handling and Clipboard: ==
== Memory Handling and Clipboard ==
* [[_CLIPBOARD$ (function)]] {{text|returns the current [[STRING]] contents of the system Clipboard.}}
* [[_CLIPBOARD$ (statement)]] {{text|sets and overwrites the [[STRING]] contents of the current system Clipboard.}}
@ -635,17 +633,16 @@ The following table describes the error codes that are reported by the '''QB64''
* [[_MEMIMAGE]] (function) {{text|returns a [[_MEM]] block referring to a designated image handle's memory}}
* [[_MEMNEW]] (function) {{text|allocates new memory with a designated SIZE and returns a [[_MEM]] block referring to it.}}
* [[_MEMPUT]] (statement) {{text|places a designated value into a designated memory [[_OFFSET]]}}
* [[_MEMSOUND]] (function) {{text|returns a [[_MEM]] block referring to a designated sound handle's memory}}
* [[_OFFSET (function)]] {{text|returns the memory offset of a variable when used with [[DECLARE LIBRARY]] or [[_MEM]] only.}}
* [[_OFFSET]](%& numerical type) {{text|can be used store the value of an offset in memory when using [[DECLARE LIBRARY]] or [[_MEM]] only.}}
<center>'''Functions and statements using QB64's emulated 16 bit memory'''</center>
* [[DEF SEG]] (statement) {{text|defines the segment address in memory.}}
* [[FRE]] (function) {{text|returns the amount of Memory available in bytes to running programs. NOT IMPLEMENTED!}}
* [[PEEK]] (function) {{text|returns the value that is contained at a certain memory address offset.}}
* [[POKE]] (statement) {{text|sets the value of a specified memory address offset.}}
* [[SADD]] (function) {{text|returns the address of a STRING variable as an offset from the current data segment.}}
* [[SETMEM]] (function) {{text|is used to increase, decrease or return the current "far heap" byte size. NOT IMPLEMENTED!}}
* [[VARPTR]] (function) {{text|returns an [[INTEGER]] value that is the offset pointer of the memory address within it's [[segment]].}}
* [[VARPTR$]] (function) {{text|returns a STRING representation of a variable's memory address value}}
* [[VARSEG]] (function) {{text|returns an [[INTEGER]] value that is the [[segment]] part of a variable or array memory address.}}
@ -672,7 +669,7 @@ The following table describes the error codes that are reported by the '''QB64''
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
== Mouse Input: ==
== Mouse Input ==
* [[_AXIS]] (function) {{text|returns a [[SINGLE]] value between -1 and 1 indicating the maximum distances from device center 0.}}
* [[_BUTTON]] (function) {{text|returns -1 when a device button is pressed and 0 when button is released. 2 is the mouse center or scroll button}}
* [[_BUTTONCHANGE]] (function) {{text|returns -1 when a device button has been pressed and 1 when released. Zero indicates no change.}}
@ -704,7 +701,7 @@ The following table describes the error codes that are reported by the '''QB64''
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
== Numerical Manipulation and Conversion: ==
== Numerical Manipulation and Conversion ==
* [[&B]] [[Binary]] {{text|base number prefix used in QB64 to represent [[_BIT]]s on as 1 or off as 0.}}
* [[_CV]] (function) {{text|used to convert [[_MK$]] [[ASCII]] [[STRING|string]] values to specified numerical value types.}}
@ -744,22 +741,18 @@ The following table describes the error codes that are reported by the '''QB64''
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
== Port Input and Output (COM and LPT): ==
== Port Input and Output (COM and LPT) ==
* [[COM(n)]] (statement) {{text|used in an OPEN COM statement to open "COM1" or "COM2".}}
* [[GET]] (file I/O statement) {{text|reads port data data by byte or record positions.}}
* [[INP]] (function) {{text|returns a value from port hardware address. NOT IMPLEMENTED for port access! }}
* [[LOC]] (function) {{text|finds the current file location or size of a [[COM]] port receive buffer.}}
* [[ON COM(n)]] (event statement) {{text|branches to a line number or label when there is a value in the serial port specified.}}
* [[OPEN COM]] (statement) {{text|opens a computer serial COMmunications port.}}
* [[OUT]] (statement) {{text|sends values to register or port hardware addresses. Use with care! NOT IMPLEMENTED for port access!}}
* [[OUT]] (statement) {{text|sends values to register or port hardware addresses (emulated - limited access).}}
* [[PRINT (file statement)]] {{text|writes text and numerical data to a port transmit buffer.}}
@ -771,7 +764,7 @@ The following table describes the error codes that are reported by the '''QB64''
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
==Print formatting==
== Print formatting ==
* [[LPRINT USING]] (statement) {{text|prints template formatted [[STRING]] text to an LPT or USB printer page.}}
* [[PRINT USING]] (statement) {{text|prints template formatted [[STRING]] text to the screen.}}
@ -783,7 +776,7 @@ The following table describes the error codes that are reported by the '''QB64''
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
==Printer Output (LPT and USB):==
== Printer Output (LPT and USB) ==
* [[_PRINTIMAGE]] (statement) {{text|prints an image stretched to the size of the paper setting of an LPT or USB printer.}}
@ -798,7 +791,7 @@ The following table describes the error codes that are reported by the '''QB64''
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
== Program Flow and Loops: ==
== Program Flow and Loops ==
* [[_CONTINUE]] (statement) {{text|skips the remaining lines in a control block (DO/LOOP, FOR/NEXT or WHILE/WEND)}}
* [[_DEST]] (statement) {{text|sets the current write image or page. All graphics will go to this image.}}
* [[_DEST (function)]] {{text|returns the current write destination image or page.}}
@ -824,7 +817,9 @@ The following table describes the error codes that are reported by the '''QB64''
* [[GOTO]] (statement) {{text|sends the program to a designated line number or label.}}
* [[IF...THEN]] (statement) {{text|a conditional flow statement or block of statements.}}
* [[LOOP]] {{text|end of a DO...LOOP procedure that repeats code until or while a condition is true.}}
* [[RESUME]] (error statement) {{text|an error statement that can return the program to the NEXT code line or a specific line number.}}
* [[RESUME]] (error statement) {{text|an error statement that can return the program to the NEXT code line or a specific line
4000
number.}}
* [[RETURN]] (statement) {{text|a sub-procedure statement that returns the program to the code immediately after the procedure call.}}
* [[RUN]] (statement) {{text|clears and restarts the program currently in memory or executes another specified program.}}
* [[SELECT CASE]] (statement) {{text|determines the program flow by comparing the value of a variable to specific values.}}
@ -871,7 +866,7 @@ The following table describes the error codes that are reported by the '''QB64''
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
== String Text Manipulation and Conversion: ==
== String Text Manipulation and Conversion ==
* [[_CLIPBOARD$]] (function) {{text|returns the current [[STRING]] contents of the system Clipboard.}}
* [[_CLIPBOARD$ (statement)]] {{text|sets the [[STRING]] contents of the current system Clipboard.}}
@ -911,13 +906,13 @@ The following table describes the error codes that are reported by the '''QB64''
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
== Sub procedures and Functions==
== Sub procedures and Functions ==
<center>'''Qbasic and QB64'''</center>
* [[CALL]] (statement) {{text|sends code execution to a [[SUB]] procedure in a program. Parameter brackets are required when used.}}
* [[CALL ABSOLUTE|CALL ABSOLUTE]] (statement) {{text|used to access Interrupts on the computer or execute assembly type procedures.}}
* [[CHAIN]] (statement) {{text|changes seamlessly from one program module to another.}}
* [[DECLARE]] (BASIC statement) {{text|used to tell that a SUB or FUNCTION is created to be used in the program. NOT USED by QB64!}}
* DECLARE (BASIC statement) {{text|used to tell that a SUB or FUNCTION is created to be used in the program. NOT USED by QB64!}}
* [[END]] (statement) {{text|ends a [[SUB]] or [[FUNCTION]] procedure.}}
* [[EXIT]] (statement) {{text|exits a [[SUB]] or [[FUNCTION]] procedure early.}}
* [[FUNCTION]] (statement) {{text|a procedure that holds ONE return value in the function's name which is a variable type. }}
@ -933,7 +928,7 @@ The following table describes the error codes that are reported by the '''QB64''
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
== TCP/IP Networking and Email: ==
== TCP/IP Networking and Email ==
<center>'''All Statements and Functions Compile in QB64 Only!'''</center>
@ -952,20 +947,15 @@ The following table describes the error codes that are reported by the '''QB64''
* [[GET (TCP/IP statement)]] {{text|reads unformatted(raw) data from an opened connection using the connection handle.}}
* [[INPUT (TCP/IP statement)]] {{text|reads a formatted message from an opened connection using the connection handle.}}
* [[PUT (TCP/IP statement)]] {{text|sends unformatted(raw) data to an open connection using a user's handle.}}
* [[PRINT (TCP/IP statement)]] {{text|sends formatted message to an open connection handle.}}
<center>See also: [[TCP/IP Message Format]], [[IP Configuration]], [[Downloading Files]] and [[WGET]]</center>
<center>See also: [[Downloading Files]]</center>
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
== Text on Screen: ==
== Text on Screen ==
* [[_CONTROLCHR]] {{text|[[OFF]] allows [[ASCII]] characters 0 to 31 to be used as text characters. [[ON]](default) resets to default usage.}}
* [[_FONT (function)]] {{text|creates a new alphablended font handle from a designated image handle}}
* [[_FONT]] (statement) {{text|sets the current [[_LOADFONT]] function font handle to be used by [[PRINT]] or [[_PRINTSTRING]].}}
@ -1001,7 +991,7 @@ The following table describes the error codes that are reported by the '''QB64''
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
== Time, Date and Timing: ==
== Time, Date and Timing ==
* [[_AUTODISPLAY]] (statement) {{text|enables the automatic display of the screen image changes previously disabled by [[_DISPLAY]].}}
* [[_DELAY]] (statement) {{text|suspends program execution for a [[SINGLE]] value of seconds down to milliseconds.}}
@ -1030,7 +1020,7 @@ The following table describes the error codes that are reported by the '''QB64''
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
== Window and Desktop: ==
== Window and Desktop ==
<center>'''All Statements and Functions except [[SCREEN]] Compile in QB64 Only!'''</center>
@ -1065,9 +1055,9 @@ The following table describes the error codes that are reported by the '''QB64''
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
==QB64 Programming Symbols:==
== QB64 Programming Symbols ==
<center>'''QB64 and QB Symbols:'''</center>
<center>'''QB64 and QB Symbols'''</center>
<center>''[Note: All symbols below can also be used inside of literal quoted strings except for quotation marks.]''</center>
@ -1132,7 +1122,7 @@ The following table describes the error codes that are reported by the '''QB64''
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
==QB64 Programming References:==
== QB64 Programming References ==
<center>'''WIKI Pages'''
@ -1142,9 +1132,7 @@ The following table describes the error codes that are reported by the '''QB64''
[[Keyword Reference - Alphabetical|Go to Alphabetical keywords]]
[[Main_Page#Appendix:|Main Page with Appendix and Tutorials]]
[[IDE|How to use the QB64 IDE and Compiler]]
[[Main_Page#Appendix:|Main Page with Appendix and Tutorials]]
'''Got a question about something?'''

View file

@ -0,0 +1,73 @@
The keywords listed here are not supported in QB64. QB64 is meant to be compatible with '''QB 4.5 or lower''' versions. '''PDS (7.1) is not supported'''. Older code that uses these keywords won't generate errors, as these are ignored by the compiler.
{| align="right"
| __TOC__
|}
* [[ALIAS]] (supported in [[DECLARE LIBRARY]] only)
* [[ANY]]
* [[BYVAL]] (supported in [[DECLARE LIBRARY]] only)
* CALLS
* CDECL
* DATE$ (statement) (reading the current [[DATE$]] is supported)
* DECLARE (non-BASIC statement)
* DEF FN, EXIT DEF, END DEF
* ERDEV, ERDEV$
* FILEATTR
* FRE
* IOCTL, IOCTL$
* [[OPEN]] with devices like '''LPT, CON, KBRD''', and other devices is not supported. [[LPRINT]] and [[OPEN COM]] are supported.
* ON PEN, PEN (statement), PEN (function)
* ON PLAY(n), PLAY(n) ON/OFF/STOP. ([[PLAY]] music is supported.)
* ON UEVENT
* SETMEM
* SIGNAL
* TIME$ (statement) (reading the current [[TIME$]] is supported)
* TRON, TROFF
* '''[[WIDTH]] [[LPRINT]]''' combined statement is not supported.
==Keywords Not Supported in Linux or MAC OSX versions==
The commands listed here contain platform-specific calls and may be implemented in the future in Linux and macOS. These commands currently result in stub calls which do nothing.
NOTE: The IDE does not support the opening or retrieval of more than one program at a time, but multiple instances of the IDE can be used simultaneously.
Some OS Specific window/desktop calls:
* [[_ACCEPTFILEDROP]], [[_TOTALDROPPEDFILES]], [[_DROPPEDFILE]], [[_FINISHDROP]]
* [[_SCREENPRINT]]
* [[_SCREENCLICK]]
* [[_SCREENMOVE]] (available in macOS, not available in Linux)
* [[_CLIPBOARDIMAGE]], [[_CLIPBOARDIMAGE (function)]]
* [[_WINDOWHASFOCUS]] (available in Linux, not available in macOS)
* [[_WINDOWHANDLE]]
* [[_CAPSLOCK]], [[_NUMLOCK]], [[_SCROLLLOCK]] (statements and functions)
Modular: QB64 has no limit on file size so BAS file modules can be combined.
* [[CHAIN]]
* [[RUN]]
Mouse related:
* [[_MOUSEWHEEL]] (available in Linux, not available in macOS)
Printing:
* [[LPRINT]]
* [[_PRINTIMAGE]]
Port access:
* [[OPEN COM]]
File locking:
* [[LOCK]]
* [[UNLOCK]]
<p style="text-align: center">([[#toc|Return to Table of Contents]])</p>
==Reference==
* [[QB64 FAQ|Go to Frequently Asked Questions about QB64]]
{{PageNavigation}}

View file

@ -15,7 +15,7 @@ The [[LEN]] function returns the number of bytes used by a variable value and th
** [[_FLOAT]] variable types return 32 bytes.
** [[_OFFSET]] and [[_MEM]] variable types return varying byte sizes.
** ''Note:'' [[_BIT]] variable types and bit multiples '''cannot be measured in bytes'''.
* '''LEN cannot return lengths of literal numerical values and will create a "variable required" status error in the [[IDE]].'''
* '''LEN cannot return lengths of literal numerical values and will create a "variable required" status error in the IDE.'''
* '''LEN =''' can be used with a user defined [[TYPE]] variable to determine the number of bytes used in [[RANDOM]] file records:
:::: {{InlineCode}}[[OPEN]] file$ FOR [[RANDOM]] AS #n LEN <nowiki>=</nowiki> LEN(recordTypeVariable){{InlineCodeEnd}}'''
:* If a LEN = statement is not used, [[RANDOM]] default record length is 128 or sequencial is 512 up to a maximum of 32767 bytes.

View file

@ -20,6 +20,7 @@ The [[LOCATE]] statement locates the screen text row and column positions for a
* If only the ''row'' parameter is given, then the column position remains the same. '''Neither ''row'' or ''column'' parameter can be 0.'''
* When [[PRINT]]ing on the bottom 2 ''rows'', use a [[semicolon]] after the PRINT expression to avoid a screen roll.
* If the {{Parameter|cursorStart%}} line is given, the {{Parameter|cursorStop%}} line must also be given. A wider range between them produces a taller cursor.
* If you use LOCATE beyond the current number of rows in text mode, QB64 will try to adapt the screen instead of tossing an error.
{{PageExamples}}

View file

@ -37,12 +37,11 @@
Error 7 on program file line 3
Error handled...ending program
{{OutputEnd}}
:''Explanation:'' The ON ERROR statement is normally placed at the beginning of the main module code. Errhandle is the line label sub referred to in the statement. The handler prints the error code and attempts to use the next line of code using [[RESUME]] NEXT which is only used in error handling procedures. [[_ERRORLINE]] returns the program file's actual text line count found in the [[IDE]].
:''Explanation:'' The ON ERROR statement is normally placed at the beginning of the main module code. Errhandle is the line label sub referred to in the statement. The handler prints the error code and attempts to use the next line of code using [[RESUME]] NEXT which is only used in error handling procedures. [[_ERRORLINE]] returns the program file's actual text line count found in the IDE.
''Example 2:'' Using an error handler in a [[SUB]] procedure.
{{CodeStart}} '' ''
{{Cl|DECLARE}} {{Cl|SUB}} s ()
s
{{Cl|END}}

View file

@ -152,7 +152,7 @@ It was overwritten with this and deleted.
* [[CLOSE]], [[LOF]], [[EOF]], [[LOC]]
* [[SEEK (statement)]], [[SEEK]]
* [[OPEN COM]], [[LEN]], [[RESET]]
* [[FILEATTR]], [[FIELD]], [[TYPE]]
* [[FIELD]], [[TYPE]]
* [[_FILEEXISTS]], [[_DIREXISTS]]
* [[_OPENCLIENT]], [[_OPENHOST]], [[_OPENCONNECTION]] {{text|(TCP/IP)}}
* [[_SNDOPEN]], [[_LOADIMAGE]]

View file

@ -25,7 +25,7 @@ The [[OPEN COM]] statement is used to access a computer's serial port COM.
{{PageDescription}}
* '''If any optional CD, CS, DS or OP timeouts occur the OPEN will fail or port access will stop. Try 0 to ignore.'''
* '''QB64''' can open any [[COM(n)|COM''n'']] port number. QBasic could only open COM1 or COM2, but 3 and 4 could be swapped.
* '''QB64''' can open any COM''n'' port number from 1 to 9.
* See Windows System '''Device Manager''' for COM port numbers and port addresses &H3F8, &H2F8, &H3E8 and &H2E8.
* Four commas are required after the Speed, Parity, Bits, and Stopbit, even if none of the Options are used.
* Other [[OPEN]] ''options'' are optional and in any order separated by commas within the OPEN command [[STRING|string]].(See list below)
@ -38,13 +38,6 @@ The [[OPEN COM]] statement is used to access a computer's serial port COM.
* [[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Keyword Not Supported in Linux or MAC versions]]
==QBasic/QuickBASIC==
*[[INPUT (file mode)|INPUT]] mode can use [[INPUT (file statement)|INPUT #]] or [[INPUT$]]. [[OUTPUT]] mode can use [[PRINT (file statement)|PRINT #]] or [[PRINT USING (file statement)|PRINT #, USING]].
*[[RANDOM]] or [[BINARY|BIN]] modes can use [[INPUT (file statement)|INPUT #]], [[INPUT$]], [[PRINT (file statement)|PRINT #]], [[GET]] or [[PUT]]. BIN cannot set a buffer size.
* Note: If random use [[LEN]] = to set size of random buffer(default LEN = 128). Use multiples of 128 for larger buffers.
* NOTE: NT or XP computers need a program like [http://www.beyondlogic.org/porttalk/porttalk.htm PortTalk] to access COM or other ports with QBasic. Not required for '''QB64'''.
{{PageExamples}}
''Example 1:'' Checking to see if a COM port exists. If the port does not exist QBasic will cause a Windows access error.
{{CodeStart}} '' ''

View file

@ -12,12 +12,12 @@
{{PageErrors}}
* If used, [[OPTION _EXPLICIT]] must be the very first statement in your program. No other statements can precede it (except for comment lines started with an [[Apostrophe|apostrophe]] or [[REM]]).
* If used, [[OPTION _EXPLICIT]] must be the very first statement in your program. No other statements can precede it (except for [[$NOPREFIX]] or comment lines started with an [[Apostrophe|apostrophe]] or [[REM]]).
* Do not use [[OPTION _EXPLICIT]] in [[$INCLUDE]]d modules.
{{PageExamples}}
''Example:'' Avoiding simple typos with [[OPTION _EXPLICIT]] results shown in the QB64 [[IDE]] Status area.
''Example:'' Avoiding simple typos with [[OPTION _EXPLICIT]] results shown in the QB64 IDE Status area.
{{CodeStart}}{{Cl|OPTION _EXPLICIT}}
{{Cl|DIM}} myVariable {{Cl|AS}} {{Cl|INTEGER}}
@ -27,45 +27,15 @@ myVariable = 5
{{Cl|PRINT}} myVariabe
{{CodeEnd}}
<center>QB64 IDE Status:</center>
{{CodeStart}}{{text|██|blue}} '''QB64''' _ {{xbox| X }}{{CodeEnd}}
{{TextStart}}  '''File   Edit   View   Search   Run   Options Help''' {{TextEnd}}
{{CodeStart}}┌────────────────────────────────────█{{title|Untitled}}█─────────────────────────────────────────────┐
│OPTION _EXPLICIT {{title|↑|black}}
│ {{text|█|black}}
│DIM myVariable AS INTEGER ▒
│ ▒
│myVariable = 5 ▒
│ ▒
│PRINT myVariabe_ ▒
│ ▒
│ ▒
│ ▒
│ ▒
│ ▒
│ ▒
│ ▒
│ ▒
│ ▒
│ ▒
│ ▒
│ ▒
│ {{title|↓|black}}
{{title|←|black}}{{text|█|black}}▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒{{title|→|black}}│
────────────────────────────────────── Status ──────────────┤{{text|{{Cl|Quick Search Bar|Find[ }} {{Cl|Quick Search list|↕]}}|aqua}}├─┤
│Variable 'myVariabe' (SINGLE) not defined on line 7 │
│ {{title|↑|black}}
│ ▒
│ ▒
│ {{title|↓|black}}
{{CodeEnd}}
{{BlueStart}} '''7:17'''{{BlueEnd}}
''QB64 IDE Status will show:''
'''Variable 'myVariabe' (SINGLE) not defined on line 4'''
{{PageSeeAlso}}
* [[OPTION _EXPLICITARRAY]]
* [[DIM]], [[REDIM]]
* [[SHARED]]
* [[STATIC]]
* [[STATIC]]
{{PageNavigation}}

View file

@ -0,0 +1,39 @@
{{DISPLAYTITLE:OPTION _EXPLICITARRAY}}
[[OPTION _EXPLICITARRAY]] instructs the compiler to require arrays be declared with [[DIM]], [[REDIM]] or equivalent.
{{PageSyntax}}
: [[OPTION _EXPLICITARRAY]]
{{PageDescription}}
* Normally statements like {{InlineCode}}x(2) = 3{{InlineCodeEnd}} will implicitly create an array x(). [[OPTION _EXPLICITARRAY]] requires a preceding declaration for the array, helping to catch mistyped array and function names.
* Unlike [[OPTION _EXPLICIT]], simple variables can still be used without a declaration. Example: {{InlineCode}}i = 1{{InlineCodeEnd}}
{{PageErrors}}
* If used, [[OPTION _EXPLICITARRAY]] must be the very first statement in your program. No other statements can precede it (except for [[$NOPREFIX]] or comment lines started with an [[Apostrophe|apostrophe]] or [[REM]]).
* Do not use [[OPTION _EXPLICITARRAY]] in [[$INCLUDE]]d modules.
{{PageExamples}}
''Example:'' Avoiding simple typos with [[OPTION _EXPLICITARRAY]] results shown in the QB64 IDE Status area.
{{CodeStart}}{{Cl|OPTION _EXPLICITARRAY}}
x = 1 'This is fine, it's not an array so not affected
{{Cl|DIM}} z(5)
z(2) = 3 'All good here, we've explicitly DIMmed our array
y(2) = 3 'This now generates an error
{{CodeEnd}}
''QB64 IDE Status will show:''
'''Array 'y' (SINGLE) not defined on line 7'''
{{PageSeeAlso}}
* [[OPTION _EXPLICIT]]
* [[DIM]], [[REDIM]]
* [[SHARED]]
* [[STATIC]]
{{PageNavigation}}

View file

@ -9,11 +9,7 @@ The [[PAINT]] statement is used to fill a delimited area in a graphic screen mod
* Can use the [[STEP]] keyword for relative coordinate placements. See example 1 below.
* {{Parameter|fillColor}} is an [[INTEGER]] or [[LONG]] 32-bit value to paint the inside of an object. Colors are limited to the [[SCREEN]] mode used.
* Optional [[INTEGER]] or [[LONG]] 32-bit {{Parameter|borderColor%}} is the color of the border of the shape to be filled when this is different from the fill color.
==QBasic/QuickBASIC==
* {{Parameter|fillColor}} could be a string made up of a sequence of [[CHR$]] values, each representing a tiling pattern to fill the shape.
* While this is not implemented in QB64, a string value is still accepted, though it won't produce any results.
* {{Parameter|fillColor}} can be a string made up of a sequence of [[CHR$]] values, each representing a tiling pattern to fill the shape. See Example 3 below.
{{PageDescription}}
@ -76,7 +72,6 @@ drw$ = "C15S20R9D4R6U3R3D3R7U5H3U2R9D3G2D6F1D3F5L10D1G1L4H2L7G2L3H2L3U8L2U5R1BF4
: ''Explanation:'' If the [[DRAW]] string is fully closed, the end values should each be 0. In the example, the proper result should be 4, 4 as there is a BF4 offset for PAINT which cannot be on a border. The result is 4, 5 because the shape is not completely closed.
<!-- Example hidden, as this technique cannot be used with QB64
''Example 3:'' Tiling using PAINT to create a red brick pattern inside a yellow border:
{{CodeStart}}
{{Cl|DIM}} Row$(1 {{Cl|TO}} 8)
@ -97,7 +92,49 @@ drw$ = "C15S20R9D4R6U3R3D3R7U5H3U2R9D3G2D6F1D3F5L10D1G1L4H2L7G2L3H2L3U8L2U5R1BF4
{{Cl|PAINT}} (320, 240), Tile$, 14 'paints brick tiles within yellow border
{{CodeEnd}}
--!>
''Example 4:'' Generating a tiling pattern for PAINT from [[DATA]] statements:
{{CodeStart}}
ptndata:
{{Cl|DATA}} "c4444444"
{{Cl|DATA}} "c4444444"
{{Cl|DATA}} "cccccccc"
{{Cl|DATA}} "444c4444"
{{Cl|DATA}} "444c4444"
{{Cl|DATA}} "444c4444"
{{Cl|DATA}} "cccccccc"
{{Cl|DATA}} "c4444444"
{{Cl|DATA}} ---
{{Cl|RESTORE}} ptndata: ptn$ = loadpattern$
{{Cl|SCREEN}} 7
{{Cl|DRAW}} "c15l15f10g10r30g10f10l50u80r100m160,100"
{{Cl|PAINT}} (160, 90), ptn$, 15
{{Cl|FUNCTION}} loadpattern$
{{Cl|DIM}} quad(0 TO 3) {{Cl|AS}} {{Cl|INTEGER}}
res$ = ""
{{Cl|DO}}
{{Cl|READ}} row$
{{Cl|IF}} {{Cl|LEFT$}}(row$, 3) = "---" {{Cl|THEN}} {{Cl|EXIT}} {{Cl|DO}}
{{Cl|FOR}} x = 0 {{Cl|TO}} 7
pixel = {{Cl|VAL}}("&h" + {{Cl|MID$}}(row$, x + 1, 1))
{{Cl|FOR}} bit = 0 {{Cl|TO}} 3
{{Cl|IF}} pixel {{Cl|AND}} 2 ^ bit {{Cl|THEN}}
quad(bit) = quad(bit) {{Cl|OR}} (2 ^ (7 - x))
{{Cl|END}} {{Cl|IF}}
{{Cl|NEXT}}
{{Cl|NEXT}}
{{Cl|FOR}} i = 0 {{Cl|TO}} 3
res$ = res$ + {{Cl|CHR$}}(quad(i))
quad(i) = 0
{{Cl|NEXT}}
{{Cl|LOOP}}
loadpattern$ = res$
{{Cl|END}} {{Cl|FUNCTION}}
{{CodeEnd}}
:: ''Code provided by collaborator https://github.com/NEONTEC75''
{{PageSeeAlso}}

View file

@ -11,7 +11,7 @@
:*'''<''' - Down one octave (cannot be below zero). Example: '''{{text|PLAY "<<"|green}}''' 'goes down two octaves.
:*'''>''' - Up one octave (cannot be above 6). Example: '''{{text|PLAY ">>"|green}}''' ' goes up two octaves.
:*'''A''', '''B''', '''C''', '''D''', '''E''', '''F''' or '''G''' are the notes in the current octave. Can use the following suffixes:
::*'''+''' or '''#''' for a sharp note. Example: '''{{text|PLAY "C#"}green}}'''
::*'''+''' or '''#''' for a sharp note. Example: '''{{text|PLAY "C#"|green}}'''
::*'''-''' for a flat note. Example: '''{{text|PLAY "C-"|green}}'''
:*'''N'''n - Plays a note n by number(n can be between 0 to 84 in the 7 octaves, where 0 is a rest). Example: '''{{text|PLAY "N42"|green}}'''
:*'''L'''n - Sets length of a note (n can be 1 to 64 where 1 is a whole note and 4 is a quarter of a note etc.). Example: '''{{text|PLAY "L4"|green}}'''
@ -322,11 +322,10 @@ x$ = x$ + " ml << b- 1, >d 1, "
x$ = x$ + " f1 ,mn>f.d8dc l1 ml f, c, <a ,f"</nowiki>
{{Cl|PRINT}} x$;
{{Cl|PLAY}} x '' ''
{{CodeEnd}}{{small|Code by Johnny B}}
{{CodeEnd}}{{small|Code by Luke}}
''See also:'''
* [[PLAY(n)]], [[ON PLAY(n)]]
* [[SOUND]], [[DRAW]]
* [[_SNDRAW]] (play frequency waves)
* [[_SNDOPEN]] (play sound files)

View file

@ -67,7 +67,7 @@ K$ = {{Cl|INPUT$}}(1) 'press a key
{{PageSeeAlso}}
* [[SPC]], [[SPACE$]], [[TAB]]
* [[PRINT USING (file statement)|PRINT #, USING]]
* [[PRINT]], [[PRINT (TCP/IP statement)]]
* [[PRINT]]
* [[WRITE (file statement)|WRITE #]], [[INPUT (file statement)|INPUT #]]
* [[LINE INPUT (file statement)|LINE INPUT #]]
* [[OPEN]], [[LPRINT]], [[WRITE]]

View file

@ -13,7 +13,7 @@ The '''PUT #''' TCP/IP statement sends unformatted(raw) data to an open connect
<center>'''Communicating using unformatted/raw streamed data:'''</center>
* Benefit: Communicate with any TCP/IP compatible protocol (eg. FTP, HTTP, web-pages, etc)
* Disadvantage: Streamed data has no 'message length' as such, just a continuous bunch of bytes all in a row. Some messages get fragmented and parts of messages can (and often do) arrive at different times.
* The position parameter(between the commas) is not used in TCP/IP statements as all data is streamed consecutively.
* The position parameter (between the commas) is not used in TCP/IP statements as all data is streamed consecutively.
<center>'''Your program MUST cater for these situations manually.'''</center>
{{WhiteStart}}''Example: string variable b$'s length is adjusted to the number of bytes read.''
@ -31,9 +31,8 @@ The '''PUT #''' TCP/IP statement sends unformatted(raw) data to an open connect
''See also:''
* [[GET (TCP/IP statement)]], [[PRINT (TCP/IP statement)]], [[INPUT (TCP/IP statement)]], [[PUT|PUT #]]
* [[GET (TCP/IP statement)]], [[PUT|PUT #]]
* [[_OPENCLIENT]], [[_OPENHOST]], [[_OPENCONNECTION]]
* [[IP Configuration]]
{{PageNavigation}}

View file

@ -12,7 +12,7 @@
* Parenthesis can be used in calculations to determine the order in which math operations are performed when the normal order would not work correctly. Normal operation order is: '''1)''' exponential, '''2)''' multiplication or division '''3)''' addition or subtraction.
* Parenthesis can also denote the array index or the dimension size(s) in a [[DIM]] statement.
* Instead of [[BYVAL]], use extra parenthesis around sub-procedure call parameters to pass them by value instead of by reference.
* Extra pairs of brackets have no effect on the code! If one is missing the [[IDE]] should tell you.
* Extra pairs of brackets have no effect on the code! If one is missing the IDE should tell you.
''Example:'' Using too many brackets does not harm the code execution as long as they are paired up.
@ -26,7 +26,7 @@ nmb$ = {{Cl|LTRIM$}}((({{Cl|RTRIM$}}(nmb$)))) 'extra bracket pairs do not affec
''See also:''
* [[DIM]], [[DECLARE]]
* [[DIM]], DECLARE
* [[SUB]], [[FUNCTION]]
* [[Arrays]]

View file

@ -1,5 +1,5 @@
{| align="center"
| __TOC__
|__TOC__
|}
@ -11,7 +11,7 @@ As with everything else, this list will be updated to correspond to new progress
==Q: What is QB64?==
A: '''QB64''' is a BASIC compatible Editor and C++ emitter that creates working Executable files from Qbasic BAS files that can be run on 32 or 64 bit PC's using '''Windows''' (XP to 10), '''Linux''' or '''macOS'''. The goal is to be 100% compatible with QuickBasic 4.5 plus add hundreds of new abilities such as program icons and custom sized windows and a great retro [[IDE|Editor]] with builtin help.
A: '''QB64''' is a BASIC compatible Editor and C++ emitter that creates working Executable files from Qbasic BAS files that can be run on 32 or 64 bit PC's using '''Windows''' (XP to 10), '''Linux''' or '''macOS'''. The goal is to be 100% compatible with QuickBasic 4.5 plus add hundreds of new abilities such as program icons and custom sized windows and a great retro Editor with builtin help.
The '''new keywords''' add some '''new features''' such as playing '''music or sound''' files and instant access to '''32 bit graphics''' file images. Also '''TCP/IP''' internet communication is available to '''download''' files, '''email''' messages over the web or play '''internet games'''. '''DLL Libraries''' can add more programming options and QB64 can access all of the new USB gaming '''controllers''' and '''printers'''.
@ -63,14 +63,16 @@ The modern statements are designed to go along with the BASIC philosophy and exp
A: QB64 supports the following Operating Systems:
<center>'''Windows NT (XP), Windows Vista, Windows 7, 8 or 10:'''</center>
:'''1)''' Download the appropriate package according to your system from [http://www.qb64.org QB64.org]
:'''2)''' Unpack the contents to any location on your computer. Avoid unpacking to Program Files or other system folders that may require administrative privileges. QB64 need to have full write permissions to its own folder.
:* Executable programs are portable between like systems by copying the stand-alone executable file.
:'''1)''' Download the appropriate package according to your system from [http://www.qb64.org QB64.org]
:'''2)''' Unpack the contents to any location on your computer. Avoid unpacking to Program Files or other system folders that may require administrative privileges. QB64 needs to have full write permissions to its own folder.
:*Executable programs are portable between like systems by copying the stand-alone executable file.
----
<center>'''Most distributions of Linux, both 32 and 64 bit'''</center>
:'''1)''' Download the appropriate package according to your system from [http://www.qb64.org QB64.org]
:'''2)''' After extracting the downloaded package, run the installation batch/script called ''./setup_lnx.sh'' in the main ''qb64'' folder to setup QB64.
:'''3)''' Most dependencies should be automatically downloaded by the setup script, but these are the ones you should look for if compilation fails: OpenGL developement libraries, ALSA development libraries, GNU C++ Compiler (g++)
@ -84,15 +86,16 @@ A: QB64 supports the following Operating Systems:
----
<center>'''macOS'''</center>
:'''1)''' You must install Apple's '''Xcode command line tools''' for C++ compilation from their website. The simplest way to do so is opening a terminal window and typing the following command: '''xcode-select --install''' (more info here: [http://developer.apple.com/technologies/tools/xcode.html Xcode download])
:     (you won't be using the Xcode interface, QB64 just needs to have access to the C++ compiler and libraries it installs)
:    (you won't be using the Xcode interface, QB64 just needs to have access to the C++ compiler and libraries it installs)
:'''3)''' Download the appropriate package according to your system from [http://www.qb64.org QB64.org]
:     Extract the downloaded package and run ''./setup_osx.command'', found within the QB64 folder to install the QB64 compiler.
:    Extract the downloaded package and run ''./setup_osx.command'', found within the QB64 folder to install the QB64 compiler.
<center>'''After installation you should run '''./qb64''' or '''./qb64_start_osx.command''' to run qb64.'''</center>
:* Executable programs are portable between macOS systems by copying the executable file.
:* To help launch executables without a console, a file called ''programname_start.command'' is created along with the program.
:*Executable programs are portable between macOS systems by copying the executable file.
:*To help launch executables without a console, a file called ''programname_start.command'' is created along with the program.
<center>'''Note: Some QB64 keywords and procedures are not available for macOS.'''</center>
@ -106,9 +109,9 @@ A: QB64 supports the following Operating Systems:
==Q: Why won't QB64 work on my computer?==
QB64 currently supports Windows versions from XP to the latest version. Most Linux and macOS versions are also supported.
: '''Don't move QB64 executable out of the QB64 folder. The various sub-folders hold the C++ compiler files and libraries.'''
:'''Don't move QB64 executable out of the QB64 folder. The various sub-folders hold the C++ compiler files and libraries.'''
: '''QB64 does not change any settings on your machine. All required files are in the QB64 folder.'''
:'''QB64 does not change any settings on your machine. All required files are in the QB64 folder.'''
<p style="text-align: center">([[#toc|Return to FAQ topics]])</p>
@ -123,13 +126,13 @@ See: [[Keywords currently not supported by QB64]]
You should be careful with '''CPU usage'''. QB64 is a lot faster than QBasic was and it does not have many of the size limitations that confined QBasic programming abilities. Having said that, '''care must be taken to assure that programs do not hog resources.''' To do that, use speed limits when possible to keep the resources used to a minimum. Also, '''Monitor Task Manager''' when your programs are running, as it can tell you how much or system resources are being used in different parts of a program. The following keywords can lower the impact of your programs on those resources by releasing them to other programs:
:::::* [[_LIMIT]]: Limits the loops per second in any loop and thus lowers the overall CPU usage.
:::::*[[_LIMIT]]: Limits the loops per second in any loop and thus lowers the overall CPU usage.
:::::* [[_DELAY]]: Pauses a procedure and releases unused resources for other programs.
:::::*[[_DELAY]]: Pauses a procedure and releases unused resources for other programs.
:::::* [[SLEEP]]: Stops or delays program procedures and shares resources.
:::::*[[SLEEP]]: Stops or delays program procedures and shares resources.
:::::* [[INPUT]] and [[INPUT$]] stop program procedures until an entry or key press is given.
:::::*[[INPUT]] and [[INPUT$]] stop program procedures until an entry or key press is given.
QB64 can be fast when you need it to be, but take the time to consider the impact of your program on other programs as people seldom have only one program running and the OS has tasks it must do too.
@ -139,7 +142,7 @@ QB64 can be fast when you need it to be, but take the time to consider the impac
==Q: How do I update the information in QB64's help system?==
A: The help provided in the QB64 IDE Help System fetches the pages from this wiki. Use the '''Update current page''' in the [[IDE]] Help menu selection to update a page. Use the '''Update all pages''' choice to update them all, but this may take longer.
A: The help provided in the QB64 IDE Help System fetches the pages from this wiki. Use the '''Update current page''' in the IDE Help menu selection to update a page. Use the '''Update all pages''' choice to update them all, but this may take longer.
==Q: Can I use the same libraries with QB64 that I used with QB 4.5?==
@ -172,15 +175,15 @@ A: Programs compiled by QB64 (version 1.000 and up) are stand-alone so no extern
A: Yes! No other program files besides the BAS file are required. Use the following command to compile a program without running it:
* '''QB64 -c yourfile.BAS'''
* '''QB64 -x yourfile.BAS''' ''(compiles using the console only)''
* '''QB64 -c yourfile.BAS -o destination_path\destination executable_name.exe''' ''(compiles the .BAS file and outputs the executable to a separate folder)''
*'''QB64 -c yourfile.BAS'''
*'''QB64 -x yourfile.BAS''' ''(compiles using the console only)''
*'''QB64 -c yourfile.BAS -o destination_path\destination executable_name.exe''' ''(compiles the .BAS file and outputs the executable to a separate folder)''
<p style="text-align: center">([[#toc|Return to FAQ topics]])</p>
==Q: How do I link modules or include SUB procedures in QB64? ==
==Q: How do I link modules or include SUB procedures in QB64?==
A: QB64 allows you to [[$INCLUDE]] code or BAS modules into one module when it is compiled. Text .BI files containing SUB or FUNCTION code or entire BAS modules can be included in one module that will be compiled.
@ -194,13 +197,13 @@ See: [[$INCLUDE]]
==Q: Some screens look small. Can I enlarge them or make them fullscreen?==
* You can use the [[_FULLSCREEN]] statement to make your programs run fullscreen.
* [[$RESIZE]] can be added to a program so you can track window resize events.
* You can also create custom sized screens with page flipping and up to 32 bit colors using [[_NEWIMAGE]].
* Page flipping is available in most screens and the new [[_DISPLAY]] feature allows the images to be displayed when YOU desire.
* Picture or image files such as BMP, PNG, JPEG and GIF are EASY to load using [[_LOADIMAGE]].
* Once images are loaded, all you have to do is use the image handle with any of the new statements and functions.
* [[_PUTIMAGE]] GETs and PUTs images fast in ONE call. It can even stretch or compress the image sizes.
*You can use the [[_FULLSCREEN]] statement to make your programs run fullscreen.
*[[$RESIZE]] can be added to a program so you can track window resize events.
*You can also create custom sized screens with page flipping and up to 32 bit colors using [[_NEWIMAGE]].
*Page flipping is available in most screens and the new [[_DISPLAY]] feature allows the images to be displayed when YOU desire.
*Picture or image files such as BMP, PNG, JPEG and GIF are EASY to load using [[_LOADIMAGE]].
*Once images are loaded, all you have to do is use the image handle with any of the new statements and functions.
*[[_PUTIMAGE]] GETs and PUTs images fast in ONE call. It can even stretch or compress the image sizes.
<p style="text-align: center">([[#toc|Return to FAQ topics]])</p>
@ -214,20 +217,20 @@ A: Yes, they are emulated to use the soundcard.
Capabilities include:
# Multiple sound tracks
# Volume and speaker control
# Background music
#Multiple sound tracks
#Volume and speaker control
#Background music
'''Get started with [[_SNDOPEN|music]]:
'''Get started with [[_SNDOPEN|music]]:'''
: [[_SNDCLOSE]] (statement), [[_SNDCOPY]] (function), [[_SNDGETPOS]] (function), [[_SNDLEN]] (function), [[_SNDLIMIT]] (statement)
:[[_SNDCLOSE]] (statement), [[_SNDCOPY]] (function), [[_SNDGETPOS]] (function), [[_SNDLEN]] (function), [[_SNDLIMIT]] (statement)
: [[_SNDLOOP]] (statement), [[_SNDOPEN]] (function), [[_SNDPAUSE]] (statement), [[_SNDPAUSED]] (function), [[_SNDPLAY]] (statement)
:[[_SNDLOOP]] (statement), [[_SNDOPEN]] (function), [[_SNDPAUSE]] (statement), [[_SNDPAUSED]] (function), [[_SNDPLAY]] (statement)
: [[_SNDPLAYCOPY]] (statement), [[_SNDPLAYFILE]] (statement), [[_SNDPLAYING]] (function), [[_SNDSETPOS]] (statement)
:[[_SNDPLAYCOPY]] (statement), [[_SNDPLAYFILE]] (statement), [[_SNDPLAYING]] (function), [[_SNDSETPOS]] (statement)
: [[_SNDRAW]] (statement), [[_SNDSTOP]] (statement), [[_SNDVOL]] (statement)
:[[_SNDRAW]] (statement), [[_SNDSTOP]] (statement), [[_SNDVOL]] (statement)
<p style="text-align: center">([[#toc|Return to FAQ topics]])</p>
@ -246,7 +249,6 @@ A: Because there is no '''QB64''' interpreter. All C code has to be compiled bef
==Q: Does it work on Windows 98 or any OS older than Windows 2000?==
A: No, it doesn't. QB64 is made to run on new systems (Windows XP and up, Linux and macOS).
enter>
==Q: Does QB64 support CURRENCY values from PDS or VB programs?==
@ -264,12 +266,9 @@ A: Not directly, but [[_FLOAT]] currency values up to 4 decimal places can be mu
==Q: Do you provide changelogs?==
We do. Check below:
We do.
* [[Version .9 changelog]]
* [[Version 1.000 changelog]]
* [[Version 1.1 changelog]]
* For more recent changelogs, check [http://www.qb64.org QB64.org]
*For all recent changelogs, check [http://www.qb64.org QB64.org]
<p style="text-align: center">([[#toc|Return to FAQ topics]])</p>

View file

@ -6,7 +6,7 @@
:: OPEN Filename$ FOR RANDOM AS #1 [LEN = ''recordlength%'']
* RANDOM is the Default mode if no mode is given in the OPEN statement.
* RANDOM is the Default mode if no mode is given in the [[OPEN]] statement.
* It creates the file if the legal file name given does NOT exist.
* As a RANDOM file, it can read or write any record using [[GET]] and/or [[PUT]] statements.
* ''Recordlength%'' is determined by getting the LEN of a [[TYPE]] variable or a [[FIELD]] statement.

View file

@ -17,7 +17,7 @@ The '''READ''' statement reads values from a [[DATA]] field and assigns them to
* Use the [[RESTORE]] statement to reread DATA statements from the start, with or without a line label as required.
* [[ACCESS]] READ can be used in an [[OPEN]] statement to limit file access to read only, preserving file data.
* '''WARNING! Do not place DATA fields after [[SUB]] or [[FUNCTION]] procedures! QB64 will FAIL to compile properly!'''
: Qbasic allowed programmers to add DATA fields anywhere because the [[IDE]] separated the main code from other procedures.
: Qbasic allowed programmers to add DATA fields anywhere because the IDE separated the main code from other procedures.
''Example 1:'' Placing data into an array.

View file

@ -12,7 +12,7 @@ The '''RESTORE''' statement is used to reset the DATA pointer to the beginning o
* Use RESTORE to avoid an [[ERROR Codes|"Out of Data" error]] when reading a data field!
* See the [[DATA]] statement for [[STRING]] data value specifications.
* '''Do not place [[DATA]] fields after [[SUB]] or [[FUNCTION]] procedures! QB64 will FAIL to [[RESTORE]] properly!'''
: Qbasic allowed programmers to add DATA fields anywhere because the [[IDE]] separated the main code from other procedures.
: Qbasic allowed programmers to add DATA fields anywhere because the IDE separated the main code from other procedures.
''Example:'' Restoring a labeled DATA field to avoid going past the end of DATA.

View file

@ -17,20 +17,13 @@ The multi-modular technique goes back to when QBasic and QuickBASIC had module s
''Usage:''
* The starting [[line number]] MUST be one used in the main module code! Even with [[SUB]] or [[FUNCTION]] references.
* The starting [[line number]] MUST be one used in the main module code, even if RUN is called from within a SUB or FUNCTION.
* If no line number is given the currently loaded program runs from the first executable line.
* In '''QB64''' RUN can open any kind of executable program and provide case sensitive program specific parameters.
* RUN does not return to the calling procedure if the program called is not a Qbasic procedure!
* RUN closes all open files and closes the invoking program module before the called program starts. (Cannot use Basica's R)
* If you do NOT want opened files to be closed use [[CHAIN]] instead.
* RUN should reset the [[RANDOMIZE]] sequence to the starting [[RND]] function value.(Not in QB64)
* Note: Qbasic also allowed /RUN in a command line call to run a BAS file with the interpreter. QB64 cannot run BAS files!
* '''Note: RUN causes a stack leak in QB64 if it is called from within a [[SUB]] or [[FUNCTION]]. Avoid when possible!'''
* '''NOTE: [[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions |Not available in Linux or Mac operating systems.]]'''
''QBasic/QuickBASIC:''
* In Qbasic '''/RUN''' can also be used to run a program module in a command line. Example: QB.EXE /L /RUN Module1.BAS
** Recommended practice to run external programs is to use [[SHELL]].
* RUN closes all open files and closes the invoking program module before the called program starts.
* RUN resets the [[RANDOMIZE]] sequence to the starting [[RND]] function value.
* '''Note: Calling RUN repeatedly may cause a stack leak in QB64 if it is called from within a [[SUB]] or [[FUNCTION]]. Avoid when possible.'''
''Example 1:'' Shows how RUN can reference multiple line numbers in the main module code. No line number executes first code line.
@ -61,30 +54,6 @@ Do you want to quit?(Y/N)_
{{OutputEnd}}
''Example 2:'' Compile both programs below with QB64. ProgramA [[RUN]]s ProgramB with a parameter passed following the filename:
{{CodeStart}} ' ================ ProgramA.BAS ===================
{{Cl|LOCATE}} 12, 36: {{Cl|PRINT}} "ProgramA"
{{Cl|LOCATE}} 23, 25: {{Cl|PRINT}} "Press any key to run ProgramB"
K$ = {{Cl|INPUT$}}(1)
{{Cl|RUN}} "ProgramB FS" 'pass FS parameter to ProgramB in QB64 ONLY
{{Cl|END}} '' ''
{{CodeEnd}}
: ''ProgramB'' checks for fullscreen parameter pass in QB64 and goes full screen.
{{CodeStart}} ' ================ ProgramB.BAS ===================
{{Cl|LOCATE}} 12, 36: {{Cl|PRINT}} "ProgramB"
parameter$ = {{Cl|UCASE$}}({{Cl|COMMAND$}})
{{Cl|LOCATE}} 20, 33: {{Cl|PRINT}} "Parameter = " + parameter$
{{Cl|IF...THEN|IF}} {{Cl|LEFT$}}(parameter$, 2) = "FS" {{Cl|THEN}} {{Cl|_FULLSCREEN}} 'parameter changes to full screen
{{Cl|END}} '' ''
{{CodeEnd}}
{{OutputStart}} Parameter = FS.EXE
{{OutputEnd}}
: '''Note:''' The above RUN procedure will NOT work in Qbasic! Qbasic cannot pass [[COMMAND$]] parameters with RUN!
''See also:''
* [[CHAIN]], [[SHELL]]
* [[COMMAND$]]

View file

@ -7,7 +7,7 @@ The [[SHELL]] statement allows a program to run external programs or command lin
{{PageDescription}}
* If the ''[[DOS]]Command$'' [[STRING]] parameter isn't used, the "command console" is opened.
* If the ''DOSCommand$'' [[STRING]] parameter isn't used, the "command console" is opened and execution is halted until the user closes it manually.
* If [[_DONTWAIT]] is used, the '''QB64''' program doesn't wait for the SHELLed program/command to end.
* When the [[_HIDE]] action is used, the [[CONSOLE|console]] window is hidden and screen info can be "redirected" (using redirection characters like >) to a file (recommended).
* Commands are external commands, according to the user's operating system, passed as [[STRING|strings]] enclosed in quotes or string variables.
@ -23,7 +23,7 @@ The [[SHELL]] statement allows a program to run external programs or command lin
==QBasic/QuickBASIC==
* '''QBasic BAS files could be run like compiled programs without returning to the [[IDE]] when [[SYSTEM]] was used to [[END|end]] them.'''
* '''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}}
@ -146,11 +146,6 @@ PathExist% = 0
===Extra reference===
* [[DOS]], [[Batch Files]], [[VB Script]]
* [[WGET]] {{text|(HTTP and FTP file transfer)}}
* [http://www.computerhope.com/msdos.htm MSDOS commands], [[DOS#DIR|DIR]]
* [http://www.pixelbeat.org/cmdline.html Linux Commands]
* [http://ss64.com/osx/ Mac OSX commands]
* [[Windows_Libraries#File_Dialog_Boxes|Windows Open and Save Dialog Boxes]]
* [[C_Libraries#Console_Window|C Console Library]]
* [[Windows Printer Settings]]

View file

@ -1,4 +1,4 @@
The '''SHELL''' function displays the console and returns the [[INTEGER]] code value sent by [[END]] or [[SYSTEM]] when a program exits.
The '''SHELL''' function displays the console and returns the [[INTEGER]] code value sent when the external program exits.
{{PageSyntax}}
@ -6,11 +6,12 @@ The '''SHELL''' function displays the console and returns the [[INTEGER]] code v
{{Parameters}}
* The literal or variable [[STRING]] ''command'' parameter can be any valid [[DOS]] command or call to another program.
* The literal or variable [[STRING]] ''command'' parameter can be any valid external command or call to another program.
''Usage:''
* A SHELL to a QB64 EXE program with an exit return code parameter after [[END]] or [[SYSTEM]] will return that code value.
* The return_code is usually 0 when the external program ends with no errors.
* The console window may appear when using the SHELL function. The [[_SHELLHIDE]] function will hide the console from view.

View file

@ -6,7 +6,7 @@ The '''STOP''' statement is used to stop program execution when troubleshooting
* STOP used in the Qbasic IDE does not close any files or go to the operating system. It returns to the IDE.
* In the QB64 compiler, STOP closes the program window and returns to the [[IDE]] when the code is compiled from there.
* In the QB64 compiler, STOP closes the program window and returns to the IDE when the code is compiled from there.
* STOP is ONLY used for debugging purposes and should not be used to exit programs!
* STOP can also be used to suspend an event trap in the following statements: [[KEY(n)]], [[ON COM (n)|COM(n)]], [[PEN]], [[PLAY]], [[STRIG(n)]], [[TIMER]], [[UEVENT]]. The trap can be turned back on with [[ON]] and returns any trap events since '''STOP''' was used.

View file

@ -10,7 +10,7 @@ A '''SUB''' procedure is a procedure within a program that can calculate and ret
{{Parameters}}
* Parameters passed after the procedure call must match the variable types in he SUB parameters in order.
* Parameters passed after the procedure call must match the variable types in the SUB parameters in order.
* If there are no ''parameter''s passed or they are [[SHARED]] the parameters and parenthesis are not required in the procedure.
* Parameter [[Variable]] names in the procedure do not have to match the names used in the [[CALL]], just the value types.
@ -24,21 +24,10 @@ A '''SUB''' procedure is a procedure within a program that can calculate and ret
* SUB procedures can save program memory as all memory used in a SUB is released on procedure exit except for [[STATIC]] values.
* [[_DEFINE]] can be used to define all new or old QB64 variable [[TYPE]] definitions instead of DEF***.
* [[$INCLUDE]] text library files with needed SUB and [[FUNCTION]] procedures can be included in programs after all sub-procedures.
* '''QB64 ignores all procedural [[DECLARE]] statements!''' Define all ''parameter'' [[TYPE]]s in the SUB procedure.
* '''QB64 ignores all procedural DECLARE statements!''' Define all ''parameter'' [[TYPE]]s in the SUB procedure.
* '''Images are not deallocated when the [[SUB]] or [[FUNCTION]] they are created in ends. Free them with [[_FREEIMAGE]].'''
<center>'''Qbasic'''</center>
* The [[IDE]] can create the SUB and [[END SUB]] lines for you. Use the Make SUB option in the Edit Menu. A box will come up for you to enter a name for the SUB. Enter the procedure code between the SUB and [[END SUB]] lines created.
* '''Qbasic SUB procedures could not have [[ON]] events, [[DATA]], [[TYPE]] or [[ON ERROR]] statements inside of them.'''
* Procedure code can use [[GOSUB]] and [[GOTO]] linenumbers and linelabels inside of the procedure only.
* The Qbasic [[IDE]] will [[DECLARE]] a SUB at the top of the module code after it has been [[CALL|referenced]] and the BAS file is saved.
* '''Only [[DEFINT]], [[DEFSNG]], [[DEFLNG]] or [[DEFDBL]] default variable [[TYPE|type]] declarations are allowed before the SUB block.'''
* Qbasic's [[IDE]] may place a [[DEFINT]], [[DEFSNG]], [[DEFLNG]], [[DEFDBL]] or [[DEFSTR]] statement before the SUB line if it is used in the main module. It may even be the wrong variable type needed. It can be removed or changed if necessary.
* An uncalled SUB will not be [[DECLARE]]d in Qbasic if it is not used.
* Qbasic allowed programmers to add DATA fields anywhere because the [[IDE]] separated the main code from other sub-procedures.
''Example 1:'' Text [[PRINT]] screen centering using [[PEEK]] to find the SCREEN mode width. Call and SUB procedure code:
{{CodeStart}} '' ''
{{Cl|DEFINT}} A-Z

View file

@ -17,9 +17,9 @@ The {{KW|SYSTEM}} statement immediately closes a program and returns control to
''Qbasic or QuickBasic:''
* '''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}}
* '''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}}
{{PageSeeAlso}}

View file

@ -1,10 +1,10 @@
The '''TIMER''' function returns the number of seconds past the previous midnite down to an accuracy of 1/18th of a second.
QB {{PageSyntax|}}
== QB Syntax ==
::: seconds! = TIMER
'''QB64''' {{PageSyntax}}
== QB64 Syntax ==
::: seconds# = TIMER[(''accuracy!'')]

View file

@ -1,15 +1,12 @@
The {{KW|WIDTH}} statement changes the text dimensions of certain {{KW|SCREEN (statement)|SCREEN}} modes.
''SCREEN'' {{PageSyntax}}
== ''SCREEN'' Syntax ==
::: '''WIDTH''' ['''{{Parameter|columns%}}'''][''', {{Parameter|rows%}}''']
''File'' {{PageSyntax}}
== ''File'' Syntax ==
::: '''WIDTH''' {'''''file_number''''' | '''''device'''''}, '''''columnwidth%'''''
''LPRINT'' {{PageSyntax}} (not supported in QB64):
::: '''WIDTH LPRINT ''columnwidth%'''''
{{Parameters}}
* When parameters are not specified, columns defaults to 80 with 25 (30 in [[SCREEN]] 11 or 12) rows.
@ -23,15 +20,11 @@ The {{KW|WIDTH}} statement changes the text dimensions of certain {{KW|SCREEN (s
:* SCREEN 10 can use 80 columns and 25 or 43 rows. Default is WIDTH 80, 25 fullscreen.
:* SCREEN 11 and 12 can use 80 columns and 30 or 60 rows. Default is WIDTH 80, 30 fullscreen.
* '''QB64''' can alter all [[SCREEN]] mode widths and heights which may also affect text or [[_FONT]] block sizes.
* If a [[$CONSOLE]] window is active and you set [[_DEST]] [[_CONSOLE]], WIDTH will affect the console output window size (Windows only).
* '''Note:''' WIDTH changes may change screen color settings in QBasic. Use [[PALETTE]] to reset to default colors.
*'''[[Keywords currently not supported by QB64|WIDTH LPRINT is not supported in QB64.]]'''
''Qbasic or QuickBasic:''
* Devices opened with an [[OPEN]] statement include LPT1 and CONS in Qbasic ONLY.
* Only the column width(default 80) can be specified in the file or [[LPRINT]] syntax.
{{PageSeeAlso}}
* [[SCREEN]], [[COLOR]], [[OUT]]
* [[_PRINTWIDTH]] {{text|(function)}}

View file

@ -24,14 +24,13 @@ The location of the graphics cursor (used to calculate relative positions for ST
== Examples ==
Demonstrate a circle's radius only matching the scaling in the horizontal direction by comparing against a box:
<source lang="qbasic">
{{CodeStart}}
SCREEN _NEWIMAGE(640, 480, 32) 'Not a square image
WINDOW SCREEN (0, 0)-(10, 10) 'SCREEN keeps the axis direction the same
LINE (4, 4)-(6, 6), _RGB32(255, 0, 0), BF 'Red square centred on (5, 5); will be stretched into a rectangle
CIRCLE (5, 5), 1, _RGB32(0, 255, 0) 'Green circle at (5, 5) with radius 1
</source>
Output:
[[File:WINDOW example circle vs square.png|thumb|center]]
{{CodeEnd}}
== See also ==
* [[PMAP]]

View file

@ -12,7 +12,7 @@ The [[_ALLOWFULLSCREEN]] statement allows setting the behavior of the ALT+ENTER
* [[_ALLOWFULLSCREEN]] only affects the behavior of ALT+ENTER. The [[_FULLSCREEN]] statement is not bound by [[_ALLOWFULLSCREEN]]'s settings so all modes can be accessed programmatically.
* To limit just the mode but allow both _SMOOTH + _OFF antialiasing modes, pass just the first parameter: ''Example:'' [[_ALLOWFULLSCREEN]] _SQUAREPIXELS
* To allow multiple modes with _SMOOTH or _OFF as default, pass just the second parameter. ''Example:'' [[_ALLOWFULLSCREEN]] , _SMOOTH
* And possible permutation of the parameters is allowed.
* Any possible permutation of the parameters is allowed.
* With [[_ALLOWFULLSCREEN]] _OFF you can trap Alt+Enter manually in your program and reassign it. See example 2 below.

View file

@ -11,34 +11,9 @@ The [[_CONNECTED]] function returns the status of a TCP/IP connection handle.
* Returns -1 if still connected or 0 if connection has ended/failed.
* Do not rely solely on this function to check for ending communication.
* Use "time-out" checking as well and [[CLOSE]] any suspect connections.
* If this function indicates the handle is not connected, any unread messages can still be read using [[INPUT (TCP/IP statement)|INPUT #]] or [[GET (TCP/IP statement)|GET #]].
* If this function indicates the handle is not connected, any unread messages can still be read using [[GET (TCP/IP statement)|GET #]].
* Even if this function indicates the handle is not connected, it is important to [[CLOSE]] the connection anyway or important resources cannot be reallocated.
{{PageExamples}}
''Snippet:'' Updating the [[_OPENHOST|_OPENHOST chat program example]] to manage the Users array when users are no longer connected.
{{TextStart}} '' ''
{{Cb|FOR...NEXT|FOR}} i = 1 {{Cb|TO}} numclients ' distribute incoming messages to all clients
{{Cb|IF...THEN|IF}} Users(i) {{Cb|THEN}} ' check for non-existing handle values(rare)
{{Cb|INPUT (TCP/IP statement)|INPUT #}}Users(i), message$
{{Cb|IF...THEN|IF}} message$ <> "" {{Cb|THEN}}
{{Cb|FOR...NEXT|FOR}} p = 1 {{Cl|TO}} numclients
{{Cb|IF...THEN|IF}} Users(p) {{Cb|THEN}} {{Cb|PRINT (TCP/IP statement)|PRINT #}}Users(p), message$
{{Cb|NEXT}} p
{{Cb|END IF}}
{{Cb|IF...THEN|IF}} {{Cb|_CONNECTED}}(Users(i)) {{Cl|IF...THEN|THEN}}
n = n + 1 ' new consecutive connected index
Users(n) = Users(i) ' assign handle value to consecutive index
{{Cb|ELSE}} : {{Cb|CLOSE}} #(Users(i)): Users(i) = 0 ' close and clear index
{{Cb|END IF}} ' if connected
{{Cb|END IF}} ' array handle exist
{{Cb|NEXT}} i
numclients = n: n = 0 '' ''
{{CodeEnd}}
:The connection routine is added to the [[_OPENHOST|chat program's]] message distribution code to update the User array and close bad connections. The value of the n index does not change for non-existing handles or lost connections, so it will always either match the numclients value or be less. This overwrites lost connection handles. Setting handles to 0 clears upper array indices. After the FOR loop has gone through all of the client users, the number of clients is updated to the value of n and n is reset to 0.
{{PageSeeAlso}}
* [[_OPENCONNECTION]]
* [[_OPENHOST]]

View file

@ -11,7 +11,7 @@ The [[_CONTROLCHR]] statement can be used to turn OFF control character attribut
::For example: '''{{text|PRINT CHR$(13)|green}}''' 'will not move the cursor to the next line and '''{{text|PRINT CHR$(9)|green}}''' 'will not tab.
* The default [[ON]] statement allows [[ASCII#Control_Characters|Control Characters]] to be used as control commands where some will not print or will format prints.
* '''Note:''' File prints may be affected also when using Carriage Return or Line Feed/Form Feed formatting.
* The QB64 [[IDE]] may allow Alt + number pad character entries, but they must be inside of [[STRING]] values. Otherwise the [[IDE]] may not recognize them.
* The QB64 IDE may allow Alt + number pad character entries, but they must be inside of [[STRING]] values. Otherwise the IDE may not recognize them.
{{PageExamples}}

View file

@ -16,7 +16,7 @@ The [[_DISPLAYORDER]] statement defines the order to render software, hardware a
* The default on program start is: _DISPLAYORDER _SOFTWARE, _HARDWARE, _GLRENDER, _HARDWARE1
* Any content or combination order is allowed, except listing the same content twice consecutively.
* Simply using [[_DISPLAYORDER]] _HARDWARE will render hardware surfaces only.
* Use an [[underscore]] to continue a code line on a new text row in the [[IDE]].
* Use an [[underscore]] to continue a code line on a new text row in the IDE.
* After _DISPLAYORDER has been used, it must be used to make any changes, even to default.

View file

@ -9,7 +9,7 @@ The [[_ERRORLINE]] function returns the source code line number that caused the
{{PageDescription}}
* Used in program error troubleshooting.
* Does not require that the program use line numbers as it counts the actual lines of code.
* The code line can be found using the QB64 [[IDE]] (Use the shortcut '''Ctrl+G''' to go to a specific line) or any other text editor such as Notepad.
* The code line can be found using the QB64 IDE (Use the shortcut '''Ctrl+G''' to go to a specific line) or any other text editor such as Notepad.
{{PageExamples}}

View file

@ -127,6 +127,7 @@ ClearFont:
{{PageSeeAlso}}
* [[_FULLSCREEN (function)]]
* [[_ALLOWFULLSCREEN]]
* [[_FONT]], [[SCREEN]]
* [[_SCREENIMAGE]]
* [[_SCREENMOVE]], [[_SCREENX]], [[_SCREENY]]

View file

@ -101,6 +101,7 @@ f& = currentf&
{{PageSeeAlso}}
* [[_FULLSCREEN]] (statement)
* [[_ALLOWFULLSCREEN]]
* [[_SCREENMOVE]], [[_SCREENX]], [[_SCREENY]]

48
internal/help/_GL.txt Normal file
View file

@ -0,0 +1,48 @@
{{DISPLAYTITLE:_GL}}
In order to use OpenGL drawing commands, you must do so from inside a [[SUB]] procedure called '''_GL''', which enables the commands to be rendered.
{{PageSyntax}}
:[[SUB]] _GL
:: ''REM Your OpenGL code here
: [[END]] [[SUB]]
{{PageDescription}}
* OpenGL commands are valid outside of '''SUB _GL''', as long as the sub procedure exists in your code.
* Attempting to use OpenGL commands without having '''SUB _GL''' in a program will result in a '''Syntax error''', even if the syntax is valid.
* SUB '''_GL''' cannot be invoked manually. The code inside it will be called automatically at approximately 60 frames per second.
* Using [[INPUT]] inside SUB '''_GL''' will crash your program.
* If your program needs to perform any operations before SUB _GL must be run, it is recommended to use a shared variable as a flag to allow SUB _GL's contents to be run. See example below.
==Example==
{{CodeStart}} '' ''
{{Cl|DIM}} allowGL {{Cl|AS}} {{Cl|_BYTE}}
'perform startup routines like loading assets
allowGL = -1 'sets allowGL to true so SUB _GL can run
{{Cl|DO}}
{{Cl|_LIMIT}} 1 'runs the main loop at 1 cycle per second
'notice how the main loop doesn't do anything, as SUB _GL will be running
'continuously.
{{Cl|LOOP}}
{{Cl|SUB}} {{Cl|_GL}}
{{Cl|IF}} NOT allowGL {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}} 'used to bypass running the code below until
' startup routines are done in the main module
'OpenGL code starts here
'The code in this area will be run automatically at ~60fps
{{Cl|END}} {{Cl|SUB}} '' ''
{{CodeEnd}}
{{PageSeeAlso}}
* [[http://www.qb64.org/wiki/Keyword_Reference_-_Alphabetical#glA List of OpenGL commands]] ''All commands in the list are valid. For those without a wiki page, usage follows OpenGL standards.''
* [[SUB]]
{{PageNavigation}}

View file

@ -123,7 +123,7 @@ Icon2BMP = count ' return the number of icons available in the icon
{{PageSeeAlso}}
* [[_TITLE]]
* [[_LOADIMAGE]]
* [[$EXEICON]], [[Embedding Icons in EXE|Manually Embedding Icons in .EXE]] {{text|(for versions of QB64 prior to 1.000)}}
* [[$EXEICON]]
* [[Creating Icon Bitmaps]] {{text|(member-contributed program)}}
* [[Bitmaps]], [[Icons and Cursors]]
* [[Resource_Table_extraction#Extract_Icon|Icon Extraction]]

View file

@ -3,11 +3,13 @@ The [[_INFLATE$]] function decompresses a [[STRING|string]] compressed by the [[
{{PageSyntax}}
:{{Parameter|result$}} = [[_INFLATE$]]({{Parameter|stringToDecompress$}})
:{{Parameter|result$}} = [[_INFLATE$]]({{Parameter|stringToDecompress$[, originalSize&]}})
{{PageDescription}}
* {{Parameter|result$}} will contain the original version of {{Parameter|stringToDecompress$}}.
* Optional parameter {{Parameter|originalSize&}} can be used if the original size of the uncompressed data is known beforehand, which makes the decompression routine run more efficiently.
** If unspecified, decompression still works as expected, but may use more steps and need to allocate more memory internally.
==Availability==

View file

@ -13,6 +13,8 @@ The [[_KEYHIT]] function returns [[ASCII]] one and two byte, OpenGL Virtual Key
:* 65536-&H40000000: [[_KEYDOWN|QB64-specific Virtual Key codes]] (designated with + for 100000 on keyboard below)
:* '''Negative''' [[LONG]] values returned indicate that a key was released or a lock function key has been turned off.
* '''Note: _KEYHIT can only return one value at a time so use the [[_KEYDOWN]] keyhit value to find key combinations.'''
* To receive input from a [[$CONSOLE]] window, use [[_CINP]].
{{WhiteStart}}' '''_KEYHIT Keyboard Codes'''
'
''''Esc F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Sys ScL Pause'''
@ -106,7 +108,7 @@ unifont = {{Cl|_LOADFONT}}("cyberbit.ttf", 24, "UNICODE")
{{PageSeeAlso}}
* [[_KEYDOWN]] {{text|(virtual key codes)}}
* [[_KEYDOWN]], [[_CINP]]
* [[_MAPUNICODE]], [[_MAPUNICODE (function)]]
* [[INKEY$]], [[ASCII]] {{text|(code table)}},
* [[Unicode]], [[Code Pages]] {{text|(by region)}}

View file

@ -3,7 +3,7 @@ The [[_LIMIT]] statement sets the loop repeat rate of a program to so many per s
{{PageSyntax}}
: [[_LIMIT]] ({{Parameter|framesPerSecond!}})
: [[_LIMIT]] {{Parameter|framesPerSecond!}}
* The {{Parameter|framesPerSecond!}} [[SINGLE]] parameter value adjusts the loops per second of a program loop. '''Do not use negative values.'''

View file

@ -1,64 +1,49 @@
{{DISPLAYTITLE:_LOADIMAGE}}
The [[_LOADIMAGE]] function loads an image into memory and returns valid [[LONG]] image handle values that are less than -1.
{{PageSyntax}}
: {{Parameter|handle&}} = [[_LOADIMAGE]]({{Parameter|filename$}}[, {{Parameter|mode%}}])
:{{Parameter|handle&}} = [[_LOADIMAGE]]({{Parameter|filename$}}[, {{Parameter|mode%}}])
{{Parameters}}
* {{Parameter|filename$}} is literal or variable [[STRING]] file name value.
* Optional {{Parameter|mode%}} [[INTEGER]] values can be:
** 256 = 8-bit (256-color, ''QB64 versions prior to 1.000'')
** 32 = 32-bit
** 33 = hardware image
*{{Parameter|filename$}} is literal or variable [[STRING]] file name value.
*Optional {{Parameter|mode%}} [[INTEGER]] values can be:
**32 = 32-bit
**33 = hardware image
{{PageDescription}}
* Various common image file formats supported, like BMP, JPG, PNG, etc. A path can also be given.
* The {{Parameter|mode%}} can designate 256 (8-bit - versions prior to 1.000), 32-bit color or 33 ('''version 1.000 and up'''). Omit to use the current graphic screen settings.
* Mode 33 images are '''hardware''' accelerated and are created using [[_LOADIMAGE]] or [[_COPYIMAGE]] ('''version 1.000 and up''').
* Loaded images can be read invisibly using [[POINT]]. Image coordinates start at 0 up to the [[_WIDTH (function)|_WIDTH]] - 1 and [[_HEIGHT]] - 1.
* Images can be made into a program [[SCREEN (statement)|SCREEN]] or page adopting the size and palette settings or placed using [[_PUTIMAGE]].
* Returns -1 as an invalid handle if it can't load the image. Valid [[LONG]] handle returns are less than -1 ({{Parameter|handle&}} < -1).
* Valid images only need to be loaded once. The handle can be used repeatedly until freed.
* '''Images are not deallocated when the [[SUB]] or [[FUNCTION]] they are created in ends. Free them with [[_FREEIMAGE]].'''
*Various common image file formats supported, like BMP, JPG, PNG, etc. A path can also be given.
*The {{Parameter|mode%}} can designate 32-bit color or 33 ('''version 1.000 and up'''). Omit to use the current graphic screen settings.
*Mode 33 images are '''hardware''' accelerated and are created using [[_LOADIMAGE]] or [[_COPYIMAGE]] ('''version 1.000 and up''').
*Loaded images can be read invisibly using [[POINT]]. Image coordinates start at 0 up to the [[_WIDTH (function)|_WIDTH]] - 1 and [[_HEIGHT]] - 1.
*Images can be made into a program [[SCREEN (statement)|SCREEN]] or page adopting the size and palette settings or placed using [[_PUTIMAGE]].
*Returns -1 as an invalid handle if it can't load the image. Valid [[LONG]] handle returns are less than -1 ({{Parameter|handle&}} < -1).
*Valid images only need to be loaded once. The handle can be used repeatedly until freed.
*'''Images are not deallocated when the [[SUB]] or [[FUNCTION]] they are created in ends. Free them with [[_FREEIMAGE]].'''
{{PageErrors}}
* Some picture file images may not load when a {{Parameter|mode%}} value is designated. Try loading it without a {{Parameter|mode%}} designation.
* '''It is important to free unused or discarded images with [[_FREEIMAGE]] to prevent CPU memory overflow errors.'''
* '''In text-only [[SCREEN]] 0, {{Parameter|mode%}} 32 must be specified.''' When loading an [[_ICON]] image use 32 for the {{Parameter|mode%}} too.
*Some picture file images may not load when a {{Parameter|mode%}} value is designated. Try loading it without a {{Parameter|mode%}} designation.
*'''It is important to free unused or discarded images with [[_FREEIMAGE]] to prevent CPU memory overflow errors.'''
*'''In text-only [[SCREEN]] 0, {{Parameter|mode%}} 32 must be specified.''' When loading an [[_ICON]] image use 32 for the {{Parameter|mode%}} too.
{{PageExamples}}
''Example 1:'' Already in SCREEN 13 and want computer to match the 32-bit jpg/etc.
colors to the current palette:
{{CodeStart}} '' ''
{{Cl|SCREEN (statement)|SCREEN}} 13
i& = {{Cl|_LOADIMAGE}}("mypic.jpg")
{{Cl|_PUTIMAGE}}, i& '' ''
{{CodeEnd}}
''Example 2:'' Already in SCREEN 13 but want to load an 8-bit image and adopt its
palette as the current palette:
{{CodeStart}} '' ''
{{Cl|SCREEN (statement)|SCREEN}} 13
i& = {{Cl|_LOADIMAGE}}("mypic256col.bmp", 256)
{{Cl|_COPYPALETTE}} i&, 0
{{Cl|_PUTIMAGE}}, i& '' ''
{{CodeEnd}}
''Example 3:'' Want to display an image in 32-bit color using its resolution as a program screen:
''Example 1:'' To display an image in 32-bit color using its resolution as a program screen:
{{CodeStart}} '' ''
i& = {{Cl|_LOADIMAGE}}("mypic.jpg", 32)
{{Cl|SCREEN (statement)|SCREEN}} i& '' ''
{{CodeEnd}}
''Example 4:'' [[DRAW]]ing and rotating an image 360 degrees using Turn Angle. [[POINT]] is used to read the invisible image source.
''Example 2:'' [[DRAW]]ing and rotating an image 360 degrees using Turn Angle. [[POINT]] is used to read the invisible image source.
{{CodeStart}}
{{Cl|SCREEN (statement)|SCREEN}} {{Cl|_NEWIMAGE}}(800, 600, 32)
img& = {{Cl|_LOADIMAGE}}("QB64.PNG") 'load the image file to be drawn
@ -83,24 +68,27 @@ DO
{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} > "" '' ''
{{CodeEnd}}
{{small|Code by Ted Weissgerber}}
:''NOTE:'' The ''QB64.PNG'' file picturing the QB64 bee can saved from the top of the [http://www.qb64.net/forum/index.php QB64 forum]. Speed varies with image size.
===More examples===
* [[SAVEIMAGE]] (QB64 Image to Bitmap SUB by Galleon)
* [[Program ScreenShots]] (Member-contributed program for legacy screen modes)
* [[ThirtyTwoBit SUB]] (QB64 Image area to bitmap)
*[[SAVEIMAGE]] (QB64 Image to Bitmap SUB by Galleon)
*[[Program ScreenShots]] (Member-contributed program for legacy screen modes)
*[[ThirtyTwoBit SUB]] (QB64 Image area to bitmap)
{{PageSeeAlso}}
* [[_FREEIMAGE]], [[_ICON]]
* [[_PUTIMAGE]], [[_MAPTRIANGLE]]
* [[_NEWIMAGE]], [[_COPYIMAGE]]
* [[_PRINTIMAGE]] (printer)
* [[_PALETTECOLOR (function)]], [[_COPYPALETTE]], [[_ICON]]
* [[SCREEN (statement)]]
* [[Hardware images]]
* [[Bitmaps]], [[Icons and Cursors]], [[GIF Images]]
*[[_FREEIMAGE]], [[_ICON]]
*[[_PUTIMAGE]], [[_MAPTRIANGLE]]
*[[_NEWIMAGE]], [[_COPYIMAGE]]
*[[_PRINTIMAGE]] (printer)
*[[_PALETTECOLOR (function)]], [[_COPYPALETTE]], [[_ICON]]
*[[SCREEN (statement)]]
*[[Hardware images]]
*[[Bitmaps]], [[Icons and Cursors]], [[GIF Images]]
{{PageNavigation}}

View file

@ -76,8 +76,6 @@ sinr! = {{Cl|SIN}}(-Rotation / 57.2957795131): cosr! = {{Cl|COS}}(-Rotation / 57
{{CodeStart}} '' ''
' Copyright (C) 2011 by Andrew L. Ayers
{{Cl|DECLARE}} {{Cl|SUB}} DrawHline (fromx%, tox%, yy%, col%)
{{Cl|DECLARE}} {{Cl|SUB}} DrawTriangle (x1%, y1%, x2%, y2%, x3%, y3%, col%)
{{Cl|DIM}} OBJECT(9, 9, 4, 2) {{Cl|AS}} {{Cl|LONG}}
' OBJECTS DEFINED {{Cl|AS}} FOLLOWS:
@ -365,8 +363,6 @@ DO
{{CodeStart}} '' ''
' Copyright (C) 2011 by Andrew L. Ayers
{{Cl|DECLARE}} {{Cl|SUB}} DrawHline (fromx%, tox%, yy%, col%)
{{Cl|DECLARE}} {{Cl|SUB}} DrawTriangle (x1%, y1%, x2%, y2%, x3%, y3%, col%)
{{Cl|DIM}} OBJECT(9, 9, 4, 2) {{Cl|AS}} {{Cl|LONG}}
' OBJECTS DEFINED {{Cl|AS}} FOLLOWS:

View file

@ -12,23 +12,22 @@ The [[_MEM]] variable type can be used when working with memory blocks. It has n
{{WhiteStart}}TYPE memory_type
OFFSET AS _OFFSET 'start location of block(changes with byte position)
SIZE AS _OFFSET 'size of block remaining at offset(changes with position)
TYPE AS LONG 'type description of variable used(never changes)
TYPE AS _OFFSET 'type description of variable used(never changes)
ELEMENTSIZE AS _OFFSET 'byte size of values inside the block(never changes)
IMAGE AS LONG 'the image handle used when _MEMIMAGE(handle) is used
SOUND AS LONG 'the sound handle used when _MEMSOUND(handle) is used
END TYPE
{{text|The above [[TYPE]] is for clarification purposes only. It '''doesn't need''' to be pasted in a program to use _MEM.|red}}
{{text|''IMPORTANT NOTE: As of Build 20170802/57 onward, mem.TYPE has been changed to be an _OFFSET, just as mem.SIZE and mem.ELEMENTSIZE.''|red}}
{{WhiteEnd}}
===Usage===
* The _MEM type contains the following '''read-only''' elements where ''name'' is the _MEM variable name:
:: ''name'''''.OFFSET''' is the current start position in the memory block AS [[_OFFSET]]. Add bytes to change position.
:: ''name'''''.SIZE''' is the remaining size of the block at current position in bytes AS [[_OFFSET]]
:: ''name'''''.TYPE''' is the type (represented as bits combined to form a value) AS [[LONG]]:
:: ''name'''''.TYPE''' is the type (represented as bits combined to form a value) AS [[_OFFSET]]:
==.TYPE values (version 1.000 and up)==
==.TYPE values ==
:::* 0 = UDT ([[TYPE|user defined type]]) or memory created by [[_MEMNEW]]
:::* 1 = 1 bit ELEMENT.SIZE=1 *Only used along with specific types (currently integers or floats)
:::* 2 = 2 bit. ELEMENT.SIZE=2 *
@ -47,14 +46,6 @@ END TYPE
:::* 16384(+ 512 + bit*)= [[_OFFSET]] type only
''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.''
===Versions prior to 1.000===
:::* 1 = Integer types such as [[_BYTE]], [[INTEGER]], [[LONG]], [[_INTEGER64]] or [[_OFFSET]]
:::* 2 = [[_UNSIGNED]] variable types. Value must be added to the variable type value.(2 cannot be used by itself)
:::* 3 = ALL [[_UNSIGNED]] [[INTEGER]] type values.(add 1 + 2)
:::* 4 = Floating point types such as [[SINGLE]], [[DOUBLE]] or [[_FLOAT]]
:::* 8 = [[STRING]]
:::* 0 = unknown(eg. created with [[_MEMNEW]]) or [[TYPE|user-defined-types]]
* '''Note: [[_OFFSET]] values cannot be cast to other variable [[type]]s reliably. _MEM is a reserved custom variable [[type]].'''
* '''[[_MEM (function)|_MEM]] cannot reference variable length [[STRING]] variable values. String values must be designated as a fixed-[[LEN|length]] string.'''
@ -105,7 +96,7 @@ x1$ = {{Cl|_MEMGET (function)|_MEMGET}}(m, m.OFFSET, {{Cl|STRING}} * 5) 'get at
HELLO
5448320 6400 1
{{OutputEnd}}
: ''Explanation:'' When a numerical [[_BYTE]] value is converted to a [[STRING]], each byte is converted to an [[ASCII]] character. The QB64 [[IDE]] will capitalize _MEM dot values.
: ''Explanation:'' When a numerical [[_BYTE]] value is converted to a [[STRING]], each byte is converted to an [[ASCII]] character. The QB64 IDE will capitalize _MEM dot values.
{{WhiteStart}} m.SIZE = 320 * 200 = 6400 bytes
m.ELEMENTSIZE = 1 byte
{{WhiteEnd}}
@ -145,6 +136,7 @@ END FUNCTION
* [[_MEM (function)]]
* [[_MEMELEMENT]], [[_MEMCOPY]]
* [[_MEMIMAGE]], [[_MEMNEW]]
* [[_MEMSOUND]]
* [[_MEMGET]], [[_MEMPUT]]
* [[_MEMFILL]], [[_MEMFREE]]

View file

@ -0,0 +1,88 @@
{{DISPLAYTITLE:_MEMSOUND}}
The [[_MEMSOUND]] function returns a [[_MEM]] value referring to a sound's raw data in memory using a designated sound handle created by the [[_SNDOPEN]] function.
{{PageSyntax}}
: {{Parameter|imageBlock}} = [[_MEMSOUND]][({{Parameter|soundHandle&}}, {{Parameter|channel%}})]
{{Parameters}}
* The {{Parameter|imageBlock}} [[_MEM]] type variable holds the read-only elements .OFFSET, .SIZE, .ELEMENTSIZE, and .SOUND.
** .ELEMENTSIZE will contain the number of bytes-per-sample the audio contains. Usually returns 2 (16-bit audio).
** .SOUND will contain the same handle value as returned by the [[_SNDOPEN]] function.
* The second parameter {{Parameter| channel%}} must be 1 (left channel/mono) or 2 (right channel, for stereo files).
{{PageDescription}}
* Use the function to access raw sound data in memory for direct access.
* Sound handle values and the memory used must still be freed using [[_SNDCLOSE]] when no longer required.
* If .SIZE returns 0, that means the data could not be accessed. It may happen if you try to access the right channel in a mono file, for example.
==Availability==
* Version 1.5 and up.
{{PageExamples}}
''Example 1:'' Checking that a sound file is stereo.
{{CodeStart}} '' ''
song& = {{Cl|_SNDOPEN}}("song.wav") 'replace song.wav with a sound file you have
{{Cl|IF}} song& = 0 {{Cl|THEN}} {{Cl|PRINT}} "Load failed.": {{Cl|END}}
{{Cl|DIM}} leftchannel {{Cl|AS}} {{Cl|_MEM}}, rightchannel {{Cl|AS}} {{Cl|_MEM}}
leftchannel = {{Cl|_MEMSOUND}}(song&, 1)
rightchannel = {{Cl|_MEMSOUND}}(song&, 2)
{{Cl|IF}} rightchannel.SIZE > 0 {{Cl|THEN}} {{Cl|PRINT}} "This file is STEREO"
{{Cl|IF}} rightchannel.SIZE = 0 {{Cl|AND}} leftchannel.SIZE > 0 {{Cl|THEN}}
{{Cl|PRINT}} "This file is MONO"
{{Cl|ELSEIF}} rightchannel.SIZE = 0 {{Cl|AND}} leftchannel.SIZE = 0 {{Cl|THEN}}
{{Cl|PRINT}} "An error occurred."
{{Cl|END IF}}
{{Cl|_SNDCLOSE}} song& 'closing the sound releases the mem blocks '' ''
{{CodeEnd}}
''Example 2:'' Plotting a sound's waves.
{{CodeStart}} '' ''
{{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(800, 327, 32)
song& = {{Cl|_SNDOPEN}}("drums.ogg") 'replace drums.ogg with a sound file you have
{{Cl|IF}} song& = 0 {{Cl|THEN}} {{Cl|PRINT}} "Load failed.": {{Cl|END}}
{{Cl|DIM}} leftchannel {{Cl|AS}} {{Cl|_MEM}}
leftchannel = {{Cl|_MEMSOUND}}(song&, 1)
{{Cl|IF}} leftchannel.SIZE = 0 {{Cl|THEN}}
{{Cl|PRINT}} "An error occurred."
{{Cl|END}}
{{Cl|END IF}}
{{Cl|DIM}} i {{Cl|AS}} {{Cl|_OFFSET}}
i = 0
{{Cl|DO}}
{{Cl|_MEMGET}} leftchannel, leftchannel.OFFSET + i, a% 'get sound data
{{Cl|LOCATE}} 1, 1: {{Cl|PRINT}} i; "/"; leftchannel.SIZE
{{Cl|LINE}} (x, {{Cl|_HEIGHT}} / 2)-{{Cl|STEP}}(0, a% / 100), {{Cl|_RGB32}}(0, 111, 0) 'plot wave
x = x + 1
{{Cl|IF}} x > {{Cl|_WIDTH}} {{Cl|THEN}}
x = 0
{{Cl|LINE}} (0, 0)-({{Cl|_WIDTH}}, {{Cl|_HEIGHT}}), {{Cl|_RGB32}}(0, 120), BF 'fade out screen
{{Cl|END}} {{Cl|IF}}
i = i + 2
{{Cl|IF}} i + 2 > leftchannel.SIZE {{Cl|THEN}} {{Cl|EXIT}} {{Cl|DO}}
{{Cl|_LIMIT}} 500
{{Cl|LOOP}}
{{Cl|_SNDCLOSE}} song& 'closing the sound releases the mem blocks '' ''
{{CodeEnd}}
{{PageSeeAlso}}
* [[_MEM]], [[_MEMIMAGE]]
* [[_MEMNEW]]
* [[_MEMGET]], [[_MEMPUT]]
* [[_MEMFREE]]
* [[$CHECKING]]
{{PageNavigation}}

View file

@ -3,7 +3,7 @@ The [[_MOUSEMOVEMENTX]] function returns the relative horizontal position of the
{{PageSyntax}}
: ''horizontalMove'' = [[_MOUSEMOVEMENTY]]
: ''horizontalMove'' = [[_MOUSEMOVEMENTX]]
* Returns the relative horizontal cursor pixel position compared to the previous cursor position. Negative values are moves to the left.

View file

@ -31,9 +31,10 @@ client = {{Cl|_OPENCLIENT}}("TCP/IP:7319:localhost")
''Example 2:'' Using a "raw" Download function to download the QB64 bee image and displays it.
{{CodeStart}}
'' ''
{{Cl|IF...THEN|IF}} Download("www.qb64.net/qb64.png", "qb64logo.png", 10) {{Cl|THEN}} ' timelimit = 10 seconds
'replace the fake image address below with a real image address you want to download
{{Cl|IF...THEN|IF}} Download("www.qb64.org/qb64.png", "qb64logo.png", 10) {{Cl|THEN}} ' timelimit = 10 seconds
{{Cl|SCREEN}} {{Cl|_LOADIMAGE}}("qb64logo.png",32)
{{Cl|ELSE}}: {{Cl|PRINT}} "Couldn't download QB64 logo."
{{Cl|ELSE}}: {{Cl|PRINT}} "Couldn't download image."
{{Cl|END IF}}
{{Cl|SLEEP}}
{{Cl|SYSTEM}}
@ -89,8 +90,6 @@ t! = {{Cl|TIMER}} ' start time
* [[_OPENHOST]], [[_OPENCONNECTION]]
* [[_CONNECTED]], [[_CONNECTIONADDRESS$]]
* [[Email Demo]], [[Inter-Program Data Sharing Demo]]
* [[Computer File Sharing Demo]]
* [[IP Configuration]], [[WGET]] {{text|(HTTP and FTP file transfer)}}
* [[Downloading Files]]

View file

@ -13,33 +13,7 @@ The [[_OPENCONNECTION]] function opens a connection from a client that the host
* [[CLOSE]] #{{Parameter|connectHandle}} closes the connection. Failed connections({{Parameter|connectHandle}} = 0) do not need to be closed.
* As a '''Host''' you can check for new clients (users). Each will have a unique connection handle.
* Creates an [[ERROR Codes|Illegal Function Call]] error if called with a string argument of the wrong syntax.
* Handle values can be used as the open number by [[INPUT (TCP/IP statement)|INPUT #]] or [[GET (TCP/IP statement)|GET #]] read statements and [[PUT (TCP/IP statement)|PUT #]] or [[PRINT (TCP/IP statement)|PRINT #]] write statements.
{{PageExamples}}
''Example:'' Using the [[_OPENCONNECTION]] new client return with [[INPUT (TCP/IP statement)|INPUT]] # or [[GET (TCP/IP statement)|GET]] # message or data reads.
{{CodeStart}}
host = {{Cl|_OPENHOST}}("TCP/IP:8080")
{{Cl|DO}}
newclient = {{Cl|_OPENCONNECTION}}(host) ' monitor host connection
{{Cl|IF...THEN|IF}} newclient {{Cl|THEN}}
{{Cl|SLEEP}} 1 ' wait one second for data to arrive
{{Cl|INPUT (TCP/IP statement)|INPUT}} #newclient, a
{{Cl|PRINT}} a
{{Cl|CLOSE}} #newclient ' close after each read
{{Cl|ELSE}} : {{Cl|_DELAY}} .05 ' share resources with other programs (20 loops per second)
{{Cl|END IF}}
{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" ' any keypress quits
{{Cl|CLOSE}} #host
{{Cl|SYSTEM}}
{{CodeEnd}}
''Explanation:'' The function finds new clients and waits one second to read a message or other data. If a message or data was sent, it displays it on the screen and closes the connection.
'''Note: When sending data, the client should wait about 3 seconds before closing their connection!'''
* Handle values can be used as the open number by [[GET (TCP/IP statement)|GET #]] read statement and [[PUT (TCP/IP statement)|PUT #]] write statement.
{{PageSeeAlso}}

View file

@ -75,7 +75,7 @@ col% = ({{Cl|POS}}(0) - 1) * {{Cl|_PRINTWIDTH}}("W") 'finds current page text or
{{Cl|END SUB}} '' ''
{{CodeEnd}}
{{small|Code by Ted Weissgerber}}
: ''Explanation:'' The procedure above creates a larger version of a SCREEN 13 window by stretching it with [[_PUTIMAGE]]. It cannot stretch PRINTed text so [[_PRINTSTRING]] must be used instead. [[LOCATE]] sets the PRINT cursor position for [[CSRLIN]] and [[POS]](0) to read. The SUB then converts the coordinates to graphical ones. Then '''change''' [[PRINT]] to PRINTS using the [[IDE]] '''Search Menu'''.
: ''Explanation:'' The procedure above creates a larger version of a SCREEN 13 window by stretching it with [[_PUTIMAGE]]. It cannot stretch PRINTed text so [[_PRINTSTRING]] must be used instead. [[LOCATE]] sets the PRINT cursor position for [[CSRLIN]] and [[POS]](0) to read. The SUB then converts the coordinates to graphical ones. Then '''change''' [[PRINT]] to PRINTS using the IDE '''Search Menu'''.
<center>[https://www.dropbox.com/s/tcdik1ajegbeiz4/HOWIE.zip?dl=0 Download of Example 2 Bitmap images]</center>

View file

@ -8,7 +8,7 @@ The [[_RGBA32]] function returns the 32-bit ''RGBA'' color value with the specif
{{PageDescription}}
* The value returned is a 32-bit [[_UNSIGNED]] [[LONG]] color value.
* '''Return variable types must be [[LONG]] or resulting color may lose the [[_BLUE]] value.'''
* '''Return variable types must be [[_UNSIGNED]] [[LONG]] or resulting color may lose the [[_BLUE]] value.'''
* {{Parameter|red&}} specifies the red component intensity from 0 to 255.
* {{Parameter|green&}} specifies the green component intensity from 0 to 255.
* {{Parameter|blue&}} specifies the blue component intensity from 0 to 255.

View file

@ -16,7 +16,7 @@ The [[_SCREENMOVE]] statement positions the program window on the desktop using
* Use [[_DESKTOPWIDTH]] and [[_DESKTOPHEIGHT]] to find the current desktop resolution to place the program's window.
* On dual monitors a negative {{Parameter|column&}} position or a value greater than the main screen width can be used to position a window in another monitor.
* '''A small delay may be necessary when a program first starts up to properly orient the screen on the desktop properly.''' See [[_SCREENEXISTS]].
* '''[[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Keyword not supported in Linux or MAC versions]]'''
* '''[[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Keyword not supported in Linux versions]]'''
{{PageExamples}}

View file

@ -1,5 +1,5 @@
{{DISPLAYTITLE:_SHELLHIDE}}
The [[_SHELLHIDE]] function hides the console window and returns any [[INTEGER]] code sent by [[END]] or [[SYSTEM]] when a program exits.
The [[_SHELLHIDE]] function hides the console window and returns any [[INTEGER]] code sent when a program exits.
{{PageSyntax}}
@ -7,12 +7,12 @@ The [[_SHELLHIDE]] function hides the console window and returns any [[INTEGER]]
{{Parameters}}
* The literal or variable [[STRING]] {{Parameter|externalCommand$}} parameter can be any external [[DOS|command line]] or call to another program.
* The literal or variable [[STRING]] {{Parameter|externalCommand$}} parameter can be any external command or call to another program.
{{PageDescription}}
* QB64 can return codes sent by program modules when a specified code is added after [[END]] or [[SYSTEM]].
* The code can be used to verify that a previous SHELL command was executed.
* A QB64 program can return codes specified after [[END]] or [[SYSTEM]] calls.
* The {{Parameter|returnCode%}} is usually 0 when the external program ends with no errors.
{{PageExamples}}

View file

@ -10,9 +10,11 @@ The [[_SNDOPEN]] function loads a sound file into memory and returns a [[LONG]]
* Returns a [[LONG]] {{Parameter|soundHandle&}} value to the sound file in memory. '''A zero value means the sound could not be loaded.'''
* The literal or variable [[STRING]] sound {{Parameter|fileName$}} can be '''WAV, OGG or MP3''' file types.
* '''Always check the handle value returned is greater than zero before attempting to play the sound.'''
** Make sure the variable is set to 0 before using _SNDOPEN.
* The handle can be used by most of the _SND sound playing functions and statements in QB64 except [[_SNDPLAYFILE]] which plays a sound file directly from the disk and does not use a handle value.
* Handles can be closed with [[_SNDCLOSE]] when the sound is no longer necessary.
* If a WAV sound file won't play, try it using the Windows [[Windows_Libraries#Play_WAV_Sounds|Play WAV sounds library]] to check it or convert the sound file to OGG.
* The raw audio data can be accessed with [[_MEMSOUND]].
{{PageExamples}}
@ -105,6 +107,7 @@ LOOP
* [[_SNDBAL]], [[_SNDLEN]], [[_SNDVOL]]
* [[_SNDPLAYFILE]] {{text|(plays a named sound file directly and closes)}}
* [[_SNDRAW]], [[_SNDRATE]], [[_SNDRAWLEN]] {{text|(raw sounds without files)}}
* [[_MEMSOUND]]
{{PageNavigation}}

View file

@ -16,7 +16,7 @@ The [[_TRIM$]] function removes both leading and trailing space characters from
{{PageExamples}}
''Example: Demonstrating how _TRIM$(text$) can replace LTRIM$(RTRIM$(text$)):
{{CodeStart}}
text$ = SPACE$(10) + "some text" + SPACE$(10)
text$ = {{Cl|SPACE$}}(10) + "some text" + {{Cl|SPACE$}}(10)
{{Cl|PRINT}} "[" + text$ + "]" '' ''
{{Cl|PRINT}} "[" + {{Cl|RTRIM$}}(text$) + "]" '' ''
{{Cl|PRINT}} "[" + {{Cl|LTRIM$}}(text$) + "]" '' ''

View file

@ -78,7 +78,7 @@ i~% = 70000
{{PageSeeAlso}}
* [[DECLARE]], [[SUB]], [[FUNCTION]]
* DECLARE, [[SUB]], [[FUNCTION]]
* [[DIM]], [[_DEFINE]]
* [[DEFSTR]], [[DEFLNG]], [[DEFINT]], [[DEFSNG]], [[DEFDBL]]
* [[INTEGER]], [[LONG]], [[_INTEGER64]]

View file

@ -3,11 +3,11 @@ The [[_WINDOWHANDLE]] function returns the window handle assigned to the current
{{PageSyntax}}
: {{Parameter|hwnd~&}} = [[_WINDOWHANDLE]]
: {{Parameter|hwnd&&}} = [[_WINDOWHANDLE]]
{{PageDescription}}
* The result is an [[_UNSIGNED]] [[LONG]] number assigned by Windows to your running program.
* The result is an [[_INTEGER64]] number assigned by Windows to your running program.
* Use it to make [[Windows Libraries|API calls]] that require a window handle to be passed.
* [[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Not available in Linux or macOS]].

View file

@ -8,7 +8,7 @@ The [[_WINDOWHASFOCUS]] function returns true (-1) if the current program's wind
{{PageDescription}}
* The function returns true (-1) if the current program is the topmost window on the user's desktop and has focus. If the current program is running behind another window, the function returns false (0).
* [[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Not available in Linux or macOS]].
* [[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Not available in macOS]].
==Availability==
@ -16,7 +16,7 @@ The [[_WINDOWHASFOCUS]] function returns true (-1) if the current program's wind
{{PageExamples}}
''Example:'' Detecting if the current program has focus. Windows-only.
''Example:'' Detecting if the current program has focus. Windows and Linux-only.
{{CodeStart}} '' ''
DO
{{Cl|IF}} {{Cl|_WINDOWHASFOCUS}} THEN

View file

@ -50,7 +50,7 @@ The {{KW|_GL_TEXTURE_2D_MULTISAMPLE}} and {{KW|_GL_TEXTURE_2D_MULTISAMPLE_ARRAY}
{{PageSeeAlso}}
{{KW|_GL}}
[[_GL|SUB _GL]]
{{KW|_glActiveTexture}}, {{KW|_glDeleteTextures}}, {{KW|_glGenTextures}}, {{KW|_glGetTexParameter}}, {{KW|_glIsTexture}}, {{KW|_glTexParameter}}

View file

@ -27,7 +27,7 @@ The type of the {{Parameter|red}}, {{Parameter|green}}, {{Parameter|blue}}, and
{{PageSeeAlso}}
{{KW|_GL}}
[[_GL|SUB _GL]]
{{KW|_glClear}}

View file

@ -27,7 +27,7 @@ The type of the {{Parameter|depth}} parameter was changed from GLclampf to GLflo
{{PageSeeAlso}}
{{KW|_GL}}
[[_GL|SUB _GL]]
{{KW|_glClear}}

View file

@ -25,7 +25,7 @@
{{PageSeeAlso}}
{{KW|_GL}}
[[_GL|SUB _GL]]
{{KW|_glClear}}

View file

@ -33,7 +33,7 @@ Changes to individual bits of components cannot be controlled. Rather, changes a
{{PageSeeAlso}}
{{KW|_GL}}
[[_GL|SUB _GL]]
{{KW|_glClear}}, {{KW|_glClearBuffer}}, {{KW|_glDepthMask}}, {{KW|_glStencilMask}}

View file

@ -70,7 +70,7 @@ An image with 0 width indicates a NULL texture.
{{PageSeeAlso}}
{{KW|_GL}}
[[_GL|SUB _GL]]
{{KW|_glActiveTexture}}, {{KW|_glBindTexture}}, {{KW|_glBindFramebuffer}}, {{KW|_glCopyTexImage2D}}, {{KW|_glCopyImageSubData}}, {{KW|_glCopyTexSubImage1D}}, {{KW|_glCopyTexSubImage2D}}, {{KW|_glReadBuffer}}

View file

@ -69,7 +69,7 @@ An image with height or width of 0 indicates a NULL texture.
{{PageSeeAlso}}
{{KW|_GL}}
[[_GL|SUB _GL]]
{{KW|_glActiveTexture}}, {{KW|_glBindTexture}}, {{KW|_glBindFramebuffer}}, {{KW|_glCopyTexImage1D}}, {{KW|_glCopyImageSubData}}, {{KW|_glCopyTexSubImage1D}}, {{KW|_glCopyTexSubImage2D}}, {{KW|_glReadBuffer}}

View file

@ -58,7 +58,7 @@ The {{KW|_glPixelStore}} mode affects texture images.
{{PageSeeAlso}}
{{KW|_GL}}
[[_GL|SUB _GL]]
{{KW|_glActiveTexture}}, {{KW|_glBindTexture}}, {{KW|_glBindFramebuffer}}, {{KW|_glCopyImageSubData}}, {{KW|_glCopyTexSubImage2D}}, {{KW|_glCopyTexSubImage3D}}, {{KW|_glCopyTexImage1D}}, {{KW|_glReadBuffer}}

View file

@ -66,7 +66,7 @@ No change is made to the ''internalformat'', ''width'', ''height'', or ''border'
{{PageSeeAlso}}
{{KW|_GL}}
[[_GL|SUB _GL]]
{{KW|_glActiveTexture}}, {{KW|_glBindTexture}}, {{KW|_glBindFramebuffer}}, {{KW|_glCopyImageSubData}}, {{KW|_glCopyTexSubImage1D}}, {{KW|_glCopyTexSubImage3D}}, {{KW|_glCopyTexImage2D}}, {{KW|_glReadBuffer}}

View file

@ -37,7 +37,7 @@ If {{Parameter|mode}} is {{KW|_GL_FRONT_AND_BACK}}, no facets are drawn, but oth
{{PageSeeAlso}}
{{KW|_GL}}
[[_GL|SUB _GL]]
{{KW|_glEnable|(GL_CULL_FACE)}}, {{KW|_glFrontFace}}

View file

@ -33,7 +33,7 @@
{{PageSeeAlso}}
{{KW|_GL}}
[[_GL|SUB _GL]]
{{KW|_glBindTexture}}, {{KW|_glGenTextures}}, {{KW|_glIsTexture}}

View file

@ -55,7 +55,7 @@ Even if the depth buffer exists and the depth mask is non-zero, the depth buffer
{{PageSeeAlso}}
{{KW|_GL}}
[[_GL|SUB _GL]]
{{KW|_glEnable|(GL_DEPTH_TEST)}}, {{KW|_glDepthRange}}, {{KW|_glPolygonOffset}}

View file

@ -28,7 +28,7 @@ Even if the depth buffer exists and the depth mask is non-zero, the depth buffer
{{PageSeeAlso}}
{{KW|_GL}}
[[_GL|SUB _GL]]
{{KW|_glColorMask}}, {{KW|_glClearBuffer}}, {{KW|_glDepthFunc}}, {{KW|_glDepthRange}}, {{KW|_glStencilMask}}

View file

@ -35,7 +35,7 @@ The type of the {{Parameter|nearVal}} and {{Parameter|farVal}} parameters was ch
{{PageSeeAlso}}
{{KW|_GL}}
[[_GL|SUB _GL]]
{{KW|_glDepthFunc}}, {{KW|_glDepthRangeArray}}, {{KW|_glDepthRangeIndexed}}, {{KW|_glPolygonOffset}}, {{KW|_glViewport}}

View file

@ -42,7 +42,7 @@ Vertex attributes that are modified by '''_glDrawArrays''' have an unspecified v
{{PageSeeAlso}}
{{KW|_GL}}
[[_GL|SUB _GL]]
{{KW|_glBindVertexArray}}, {{KW|_glDrawArraysIndirect}}, {{KW|_glDrawArraysInstanced}}, {{KW|_glDrawArraysInstancedBaseInstance}}, {{KW|_glMultiDrawArrays}}, {{KW|_glMultiDrawArraysIndirect}}

View file

@ -54,7 +54,7 @@ Monoscopic contexts include only ''left'' buffers, and stereoscopic contexts inc
{{PageSeeAlso}}
{{KW|_GL}}
[[_GL|SUB _GL]]
{{KW|_glBindFramebuffer}}, {{KW|_glBlendFunc}}, {{KW|_glColorMask}}, {{KW|_glDrawBuffers}}, {{KW|_glLogicOp}}

View file

@ -44,7 +44,7 @@ Vertex attributes that are modified by '''_glDrawElements''' have an unspecified
{{PageSeeAlso}}
{{KW|_GL}}
[[_GL|SUB _GL]]
{{KW|_glBindVertexArray}}, {{KW|_glDrawArrays}}, {{KW|_glDrawElementsBaseVertex}}, {{KW|_glDrawElementsIndirect}}, {{KW|_glDrawElementsInstanced}}, {{KW|_glDrawElementsInstancedBaseInstance}}, {{KW|_glDrawElementsInstancedBaseVertex}}, {{KW|_glDrawElementsInstancedBaseVertexBaseInstance}}, {{KW|_glDrawRangeElements}}, {{KW|_glDrawRangeElementsBaseVertex}}, {{KW|_glMultiDrawElements}}, {{KW|_glMultiDrawElementsBaseVertex}}, {{KW|_glMultiDrawElementsIndirect}}

View file

@ -131,7 +131,7 @@ In general, passing an indexed capability to '''_glEnable''' or '''_glDisable'''
{{PageSeeAlso}}
{{KW|_GL}}
[[_GL|SUB _GL]]
{{KW|_glActiveTexture}}, {{KW|_glBlendFunc}}, {{KW|_glCullFace}}, {{KW|_glDepthFunc}}, {{KW|_glDepthRange}}, {{KW|_glGet}}, {{KW|_glIsEnabled}}, {{KW|_glLineWidth}}, {{KW|_glLogicOp}}, {{KW|_glPointSize}}, {{KW|_glPolygonMode}}, {{KW|_glPolygonOffset}}, {{KW|_glSampleCoverage}}, {{KW|_glScissor}}, {{KW|_glStencilFunc}}, {{KW|_glStencilOp}}, {{KW|_glTexImage1D}}, {{KW|_glTexImage2D}}, {{KW|_glTexImage3D}}

View file

@ -20,7 +20,7 @@
{{PageSeeAlso}}
{{KW|_GL}}
[[_GL|SUB _GL]]
{{KW|_glFlush}}, {{KW|_glFenceSync}}, {{KW|_glWaitSync}}, {{KW|_glClientWaitSync}}

View file

@ -22,7 +22,7 @@ Because any GL program might be executed over a network, or on an accelerator th
{{PageSeeAlso}}
{{KW|_GL}}
[[_GL|SUB _GL]]
{{KW|_glFinish}}

View file

@ -30,7 +30,7 @@ The projection of a polygon to window coordinates is said to have clockwise wind
{{PageSeeAlso}}
{{KW|_GL}}
[[_GL|SUB _GL]]
{{KW|_glCullFace}}

View file

@ -34,7 +34,7 @@ Texture names returned by a call to '''_glGenTextures''' are not returned by sub
{{PageSeeAlso}}
{{KW|_GL}}
[[_GL|SUB _GL]]
{{KW|_glBindTexture}}, {{KW|_glDeleteTextures}}, {{KW|_glIsTexture}}

View file

@ -73,7 +73,7 @@ If an error is generated, no change is made to the contents of {{Parameter|img}}
{{PageSeeAlso}}
{{KW|_GL}}
[[_GL|SUB _GL]]
{{KW|_glActiveTexture}}, {{KW|_glBindTexture}}, {{KW|_glPixelStore}}, {{KW|_glReadPixels}}, {{KW|_glTexSubImage1D}}, {{KW|_glTexSubImage2D}}, {{KW|_glTexSubImage3D}}

View file

@ -122,7 +122,7 @@ If an error is generated, '''_glIsEnabled''' and '''_glIsEnabledi''' return {{KW
{{PageSeeAlso}}
{{KW|_GL}}
[[_GL|SUB _GL]]
{{KW|_glEnable}}, {{KW|_glDisable}}, {{KW|_glGet}}

View file

@ -20,7 +20,7 @@ A name returned by {{KW|_glGenTextures}}, but not yet associated with a texture
{{PageSeeAlso}}
{{KW|_GL}}
[[_GL|SUB _GL]]
{{KW|_glBindTexture}}, {{KW|_glDeleteTextures}}, {{KW|_glGenTextures}}

View file

@ -51,7 +51,7 @@ In OpenGL 1.2, the tokens {{KW|_GL_LINE_WIDTH_RANGE}} and {{KW|_GL_LINE_WIDTH_GR
{{PageSeeAlso}}
{{KW|_GL}}
[[_GL|SUB _GL]]
{{KW|_glEnable}}

Some files were not shown because too many files have changed in this diff Show more