diff --git a/internal/help/$CHECKING.txt b/internal/help/$CHECKING.txt index f764b222e..0fbbaa317 100644 --- a/internal/help/$CHECKING.txt +++ b/internal/help/$CHECKING.txt @@ -9,11 +9,11 @@ The [[$CHECKING]] metacommand turns C++ event checking ON or OFF. * The OFF action turns event checking off and should '''only be used when running stable, errorless code.''' * The default [[$CHECKING]]:ON action is only required when checking has been turned OFF previously. * When [[$CHECKING]]:OFF is used, all error code and the reporting code is removed from the EXE program. -* '''Warning: Turning OFF error checking could create a General Protection Fault. +* '''Warning: Turning OFF error checking could create a General Protection Fault (or segfault). Use only with 100% stable sections of code.''' ===Details=== * After every QB64 command is translated to C++, the compiler adds special code sections to check for [[ON TIMER (n)]] events and errors that may have occured in the last function call. Disabling error checking with the [[$CHECKING]]:OFF directive prevents the compiler from adding the extra code sections. -* Setting [[$CHECKING]]:OFF is only designed for 100% stable, error-less sections of code, where every CPU cycle saved counts, such as in a software 3D texture mapper, for example. +* Setting [[$CHECKING]]:OFF is only designed for 100% stable, errorless sections of code, where every CPU cycle saved counts, such as in a software 3D texture mapper, for example. {{PageSeeAlso}} @@ -23,4 +23,4 @@ The [[$CHECKING]] metacommand turns C++ event checking ON or OFF. * [[ERROR Codes]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/$CONSOLE.txt b/internal/help/$CONSOLE.txt index 8e4ba7023..1a451410d 100644 --- a/internal/help/$CONSOLE.txt +++ b/internal/help/$CONSOLE.txt @@ -27,7 +27,7 @@ The [[$CONSOLE]] [[Metacommand]] creates a console window that can be used throu {{Cl|_CONSOLE}} ON {{Cl|_DEST}} {{Cl|_CONSOLE}} -{{Cl|PRINT}} "Close this console window or click main window and press a key!" '' '' +{{Cl|PRINT}} "Close this console window or click main window and press a key!" '' '' {{CodeEnd}} @@ -38,17 +38,17 @@ The [[$CONSOLE]] [[Metacommand]] creates a console window that can be used throu c&& = -1: d& = -1: e% = -1: f%% = -1 hx$ = {{Cl|HEX$}}(f%%) -{{Cl|PRINT}} "Max hex {{Cl|_BYTE}} = "; hx$; " with"; {{Cl|LEN}}(hx$); "digits ="; {{Cl|VAL}}("{{Cl|&H}}" + hx$) +{{Cl|PRINT}} "Max hex {{Cl|_BYTE}} = "; hx$; " with"; {{Cl|LEN}}(hx$); "digits ="; {{Cl|VAL}}("{{Cl|&H}}" + hx$) hx$ = {{Cl|HEX$}}(e%) -{{Cl|PRINT}} "Max hex {{Cl|INTEGER}} = "; hx$; " with"; {{Cl|LEN}}(hx$); "digits ="; {{Cl|VAL}}("{{Cl|&H}}" + hx$) +{{Cl|PRINT}} "Max hex {{Cl|INTEGER}} = "; hx$; " with"; {{Cl|LEN}}(hx$); "digits ="; {{Cl|VAL}}("{{Cl|&H}}" + hx$) hx$ = {{Cl|HEX$}}(d&) -{{Cl|PRINT}} "Max hex {{Cl|LONG}} = "; hx$; " with"; {{Cl|LEN}}(hx$); "digits ="; {{Cl|VAL}}("{{Cl|&H}}" + hx$) +{{Cl|PRINT}} "Max hex {{Cl|LONG}} = "; hx$; " with"; {{Cl|LEN}}(hx$); "digits ="; {{Cl|VAL}}("{{Cl|&H}}" + hx$) hx$ = {{Cl|HEX$}}(c&&) -{{Cl|PRINT}} "Max hex {{Cl|_INTEGER64}} = "; hx$; " with"; {{Cl|LEN}}(hx$); "digits ="; {{Cl|VAL}}("{{Cl|&H}}" + hx$) +{{Cl|PRINT}} "Max hex {{Cl|_INTEGER64}} = "; hx$; " with"; {{Cl|LEN}}(hx$); "digits ="; {{Cl|VAL}}("{{Cl|&H}}" + hx$) hx$ = {{Cl|HEX$}}(9223372036854775807) -{{Cl|PRINT}} "Max {{Cl|_INTEGER64}} value = "; hx$; " with"; {{Cl|LEN}}(hx$); "digits" +{{Cl|PRINT}} "Max {{Cl|_INTEGER64}} value = "; hx$; " with"; {{Cl|LEN}}(hx$); "digits" hx$ = {{Cl|HEX$}}(-9223372036854775808) -{{Cl|PRINT}} "Min {{Cl|_INTEGER64}} value = "; hx$; " with"; {{Cl|LEN}}(hx$); "digits" '' '' +{{Cl|PRINT}} "Min {{Cl|_INTEGER64}} value = "; hx$; " with"; {{Cl|LEN}}(hx$); "digits" '' '' {{CodeEnd}} {{OutputStart}}Max hex _BYTE = FF with 2 digits = 255 Max hex INTEGER = FFFF with 4 digits = 65535 @@ -57,7 +57,7 @@ Max hex _INTEGER64 = FFFFFFFFFFFFFFFF with 16 digits =-1 Max _INTEGER64 value = 7FFFFFFFFFFFFFFF with 16 digits Min _INTEGER64 value = 8000000000000000 with 16 digits {{OutputEnd}} -: ''Console:'' Right click and select ''Edit'' > ''Select All'' (mouse highlight after) then hit Enter or select ''Edit'' > ''Copy'' to the [[_CLIPBOARD$ (function)|clipboard]]. +: ''Console:'' Right click and select ''Edit'' > ''Select All'' (mouse highlight after) then hit Enter or select ''Edit'' > ''Copy'' to the [[_CLIPBOARD$ (function)|clipboard]]. {{TextStart}}Max hex _BYTE = FF with 2 digits = 255 Max hex INTEGER = FFFF with 4 digits = 65535 Max hex LONG = FFFFFFFF with 8 digits = 4294967295 @@ -73,4 +73,4 @@ Max hex _INTEGER64 = FFFFFFFFFFFFFFFF with 16 digits =-1 * [[C_Libraries#Console_Window|C Console Library]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/$DYNAMIC.txt b/internal/help/$DYNAMIC.txt index ba3b2256e..0a790b97f 100644 --- a/internal/help/$DYNAMIC.txt +++ b/internal/help/$DYNAMIC.txt @@ -43,4 +43,4 @@ The [[$DYNAMIC]] [[Metacommand|metacommand]] allows the creation of dynamic (cha * [[Arrays]], [[Metacommand]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/$ELSE.txt b/internal/help/$ELSE.txt index a24e3a42b..cc2bd5368 100644 --- a/internal/help/$ELSE.txt +++ b/internal/help/$ELSE.txt @@ -1 +1 @@ -#REDIRECT [[$IF]] \ No newline at end of file +#REDIRECT [[$IF]] diff --git a/internal/help/$ELSEIF.txt b/internal/help/$ELSEIF.txt index a24e3a42b..cc2bd5368 100644 --- a/internal/help/$ELSEIF.txt +++ b/internal/help/$ELSEIF.txt @@ -1 +1 @@ -#REDIRECT [[$IF]] \ No newline at end of file +#REDIRECT [[$IF]] diff --git a/internal/help/$END_IF.txt b/internal/help/$END_IF.txt index a24e3a42b..cc2bd5368 100644 --- a/internal/help/$END_IF.txt +++ b/internal/help/$END_IF.txt @@ -1 +1 @@ -#REDIRECT [[$IF]] \ No newline at end of file +#REDIRECT [[$IF]] diff --git a/internal/help/$IF.txt b/internal/help/$IF.txt index baca220db..2ec6e40aa 100644 --- a/internal/help/$IF.txt +++ b/internal/help/$IF.txt @@ -34,7 +34,7 @@ {{Cl|$END IF}} {{Cl|COLOR}} Red -{{Cl|PRINT}} "Hello World" +{{Cl|PRINT}} "Hello World" {{CodeEnd}} ''Explanation:'' The same CONST is defined twice inside the program. Normally, defining a CONST more than once generates an error, but the $IF condition here is choosing which CONST will be inside the final program. @@ -47,12 +47,12 @@ The [[$LET]] and $IF statements let the programmer control the code that actuall ''Example 2:'' {{CodeStart}} '' '' {{Cl|$IF}} WIN THEN - {{Cl|CONST}} Slash = "\" + {{Cl|CONST}} Slash = "\" {{Cl|$ELSE}} - {{Cl|CONST}} Slash = "/" + {{Cl|CONST}} Slash = "/" {{Cl|$END IF}} -{{Cl|PRINT}} "The proper slash for your operating system is "; Slash +{{Cl|PRINT}} "The proper slash for your operating system is "; Slash {{CodeEnd}} ''Explanation:'' For the above, the CONST slash is defined by the automatic internal flags which returns what operating system is being used at compile time. On a Windows PC, the Slash will be the backslash; for any other OS it will be the forward slash. @@ -63,4 +63,4 @@ The [[$LET]] and $IF statements let the programmer control the code that actuall * [[Metacommand]]s -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/$INCLUDE.txt b/internal/help/$INCLUDE.txt index 08f77fb8c..c499a8a8a 100644 --- a/internal/help/$INCLUDE.txt +++ b/internal/help/$INCLUDE.txt @@ -39,4 +39,4 @@ * [[Metacommand]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/$LET.txt b/internal/help/$LET.txt index 014023e5b..29d478783 100644 --- a/internal/help/$LET.txt +++ b/internal/help/$LET.txt @@ -7,9 +7,9 @@ {{PageDescription}} * Unlike [[LET]], [[$LET]] is not optional. -* $LET a = 12 sets a precompiler variable "a" to the value of 12. This variable is only valid for the precompiler itself and does nothing to affect the values of any variable/constant which might also be called "a" in the program. +* $LET a = 12 sets a precompiler variable "a" to the value of 12. This variable is only valid for the precompiler itself and does nothing to affect the values of any variable/constant which might also be called "a" in the program. * Variable names can contain numbers, letters, and periods in any order. [[$LET]] '''3.2 = TRUE''' is a perfectly valid variable and expression. -* Expressions can contain one set of leading and/or trailing quotes; and any number of numbers, letters, and periods, in any order. [[$LET]] '''3.2 = "TRUE"''' is also perfectly valid, but [[$LET]] '''3.2 = ""TRUE""''' will error because of the double quotes. +* Expressions can contain one set of leading and/or trailing quotes; and any number of numbers, letters, and periods, in any order. [[$LET]] '''3.2 = "TRUE"''' is also perfectly valid, but [[$LET]] '''3.2 = ""TRUE""''' will error because of the double quotes. {{PageExamples}} @@ -24,4 +24,4 @@ * [[Cavemen]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/$RESIZE.txt b/internal/help/$RESIZE.txt index 4a2159aac..402ce497f 100644 --- a/internal/help/$RESIZE.txt +++ b/internal/help/$RESIZE.txt @@ -82,10 +82,10 @@ DO ' *** Remove ({{Cl|TIMER (statement)|FREE}}) the original {{Cl|SCREEN}} image. {{Cl|_FREEIMAGE}} CurrentScreen - ' *** Create a new "original" {{Cl|SCREEN}} image. + ' *** Create a new "original" {{Cl|SCREEN}} image. CurrentScreen = {{Cl|_NEWIMAGE}}({{Cl|_RESIZEWIDTH}}, {{Cl|_RESIZEHEIGHT}}, 32) - ' *** Set the {{Cl|SCREEN}} to the new "original" image, releasing the copied {{Cl|SCREEN}} image. + ' *** Set the {{Cl|SCREEN}} to the new "original" image, releasing the copied {{Cl|SCREEN}} image. {{Cl|SCREEN}} CurrentScreen ' {{Cl|DRAW}} PREVIOUS {{Cl|SCREEN}} ON THE NEW ONE @@ -111,4 +111,4 @@ DO * [[_RESIZEWIDTH]], [[_RESIZEHEIGHT]] {{text|(functions return the requested dimensions)}} -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/$SCREENHIDE.txt b/internal/help/$SCREENHIDE.txt index 89b319e3b..bc78a2577 100644 --- a/internal/help/$SCREENHIDE.txt +++ b/internal/help/$SCREENHIDE.txt @@ -14,16 +14,16 @@ The [[$SCREENHIDE]] [[Metacommand|metacommand]] can be used to hide the main pro ''Example:'' Hiding a program when displaying a message box in Windows. {{CodeStart}} '' '' {{Cl|$SCREENHIDE}} -{{Cl|DECLARE DYNAMIC LIBRARY}} "user32" +{{Cl|DECLARE DYNAMIC LIBRARY}} "user32" {{Cl|FUNCTION}} MessageBoxA& ({{Cl|BYVAL}} hWnd%&, {{Cl|BYVAL}} lpText%&, {{Cl|BYVAL}} lpCaption%&, {{Cl|BYVAL}} uType~&) {{Cl|DECLARE LIBRARY|END DECLARE}} -{{Cl|DECLARE DYNAMIC LIBRARY}} "kernel32" +{{Cl|DECLARE DYNAMIC LIBRARY}} "kernel32" {{Cl|SUB}} ExitProcess ({{Cl|BYVAL}} uExitCode~&) {{Cl|DECLARE LIBRARY|END DECLARE}} {{Cl|DIM}} s0 {{Cl|AS}} {{Cl|STRING}} {{Cl|DIM}} s1 {{Cl|AS}} {{Cl|STRING}} -s0 = "Text" + {{Cl|CHR$}}(0) -s1 = "Caption" + {{Cl|CHR$}}(0) +s0 = "Text" + {{Cl|CHR$}}(0) +s1 = "Caption" + {{Cl|CHR$}}(0) ExitProcess MessageBoxA(0, {{Cl|_OFFSET (function)|_OFFSET}}(s0), {{Cl|_OFFSET(function)|_OFFSET}}(s1), 0) {{CodeEnd}}{{small|Code by Michael Calkins}} @@ -34,4 +34,4 @@ ExitProcess MessageBoxA(0, {{Cl|_OFFSET (function)|_OFFSET}}(s0), {{Cl|_OFFSET(f * [[_CONSOLE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/$SCREENSHOW.txt b/internal/help/$SCREENSHOW.txt index 8adf448cb..d203b9624 100644 --- a/internal/help/$SCREENSHOW.txt +++ b/internal/help/$SCREENSHOW.txt @@ -18,4 +18,4 @@ The [[$SCREENSHOW]] [[Metacommand|metacommand]] can be used to display the main * [[_CONSOLE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/$STATIC.txt b/internal/help/$STATIC.txt index 9c558e4e2..2da99dc82 100644 --- a/internal/help/$STATIC.txt +++ b/internal/help/$STATIC.txt @@ -17,7 +17,7 @@ The '''$STATIC''' Metacommand allows the creation of STATIC(un-changeable) array {{CodeStart}} '' '' '{{Cl|$STATIC}} -{{Cl|INPUT}} "Enter array size: ", size +{{Cl|INPUT}} "Enter array size: ", size {{Cl|DIM}} array(size) 'using an actual number instead of the variable will create an error! {{Cl|REDIM}} array(2 * size) @@ -32,4 +32,4 @@ The '''$STATIC''' Metacommand allows the creation of STATIC(un-changeable) array * [[Arrays]], [[Metacommand]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/$VIRTUALKEYBOARD.txt b/internal/help/$VIRTUALKEYBOARD.txt index 3bf065a54..f516b06dc 100644 --- a/internal/help/$VIRTUALKEYBOARD.txt +++ b/internal/help/$VIRTUALKEYBOARD.txt @@ -1,5 +1,5 @@ {{DISPLAYTITLE:$VIRTUALKEYBOARD}} -The [[$VIRTUALKEYBOARD]] [[Metacommand|metacommand]] turns the virtual keyboard ON or OFF. +[DEPRACATED] The [[$VIRTUALKEYBOARD]] [[Metacommand|metacommand]] turns the virtual keyboard ON or OFF. {{PageSyntax}} @@ -8,6 +8,7 @@ The [[$VIRTUALKEYBOARD]] [[Metacommand|metacommand]] turns the virtual keyboard {{PageDescription}} * Places a virtual keyboard on screen, which can be used in touch-enabled devices like Windows tablets. +* Depracated. {{PageExamples}} @@ -22,4 +23,4 @@ The [[$VIRTUALKEYBOARD]] [[Metacommand|metacommand]] turns the virtual keyboard * [[Metacommand]]s -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/%26B.txt b/internal/help/%26B.txt index fcc105a34..7d09b0a73 100644 --- a/internal/help/%26B.txt +++ b/internal/help/%26B.txt @@ -7,28 +7,28 @@ The '''&B''' prefix denotes that an integer value is expressed in a binary b * The base 2 numbering system uses binary digit values of 1 or 0, or bits on or bits off in computer register switches or memory. * Leading zero values '''can''' be omitted as they add nothing to the byte return value. -* Eight binary digits would represent a one byte value ranging from 0 to 255. Four digit values("nibbles") range from 0 to 15. -* Decimal values returned can be any '''signed''' [[INTEGER]], [[LONG]] integer, or [[_INTEGER64]] value so use those type of variables when converting directly as shown in the Syntax. The program [[ERROR Codes|"overflow"]] error limits are listed as: +* Eight binary digits would represent a one byte value ranging from 0 to 255. Four digit values("nibbles") range from 0 to 15. +* Decimal values returned can be any '''signed''' [[INTEGER]], [[LONG]] integer, or [[_INTEGER64]] value so use those type of variables when converting directly as shown in the Syntax. The program [[ERROR Codes|"overflow"]] error limits are listed as: ** [[INTEGER]]: 16 binary digits or a decimal value range from -32,768 to 32,767 ** [[LONG]]: 32 binary digits or a decimal value range from -2,147,483,648 to 2,147,483,647 ** [[_INTEGER64]]: 64 binary digits or decimal values from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. * [[LONG]] values can be returned by appending the & or ~%([[_UNSIGNED]] [[INTEGER]]) symbols after the binary number. -* [[VAL]] can '''NOT''' be used to convert "&B" prefixed string values to decimal! You will have to make your own conversion function. +* [[VAL]] can be used to convert "&B" prefixed string values to decimal. -<center>'''[[_BIT|BITS]]'''</center> +<center>'''[[_BIT|BITS]]'''</center> * The '''MSB''' is the most significant(largest) bit value and '''LSB''' is the least significant bit of a binary or register memory address value. The order in which the bits are read determines the binary or decimal byte value. There are two common ways to read a byte: -:* '''"Big-endian"''': MSB is the first bit encountered, decreasing to the LSB as the last bit by position, memory address or time. -:* '''"Little-endian"''': LSB is the first bit encountered, increasing to the MSB as the last bit by position, memory address or time. +:* '''"Big-endian"''': MSB is the first bit encountered, decreasing to the LSB as the last bit by position, memory address or time. +:* '''"Little-endian"''': LSB is the first bit encountered, increasing to the MSB as the last bit by position, memory address or time. {{WhiteStart}} '''Offset or Position: 0 1 2 3 4 5 6 7 Example: 11110000''' ---------------------------------- -------- '''Big-Endian Bit On Value:''' 128 64 32 16 8 4 2 1 240 '''Little-Endian Bit On Value:''' 1 2 4 8 16 32 64 128 15 {{WhiteEnd}} -::The big-endian method compares exponents of 2 <sup>7</sup> down to 2 <sup>0</sup> while the little-endian method does the opposite. +::The big-endian method compares exponents of 2 <sup>7</sup> down to 2 <sup>0</sup> while the little-endian method does the opposite. -<center>'''[[_BYTE|BYTES]]'''</center> +<center>'''[[_BYTE|BYTES]]'''</center> * [[INTEGER]] values consist of 2 bytes called the '''HI''' and '''LO''' bytes. Anytime that the number of binary digits is a multiple of 16 (2bytes, 4 bytes, etc.) and the HI byte's MSB is on(1), the value returned will be negative. Even with [[SINGLE]] or [[DOUBLE]] values! {{WhiteStart}} '''16 BIT INTEGER OR REGISTER''' '''AH (High Byte Bits) AL (Low Byte Bits)''' @@ -60,7 +60,7 @@ The '''&B''' prefix denotes that an integer value is expressed in a binary b 12 1100 C 14 13 1101 D 15 14 1110 E 16 - 15 ------------- 1111 <--- Match ---> F ---------------- 17 -- max 2 + 15 ------------- 1111 <--- Match ---> F ---------------- 17 -- max 2 16 10000 10 20 When the Decimal value is 15, the other 2 base systems are all maxed out! @@ -93,9 +93,9 @@ The '''&B''' prefix denotes that an integer value is expressed in a binary b {{Cl|FUNCTION}} BIN$ (n%) max% = 8 * {{Cl|LEN}}(n%) ': MSB% = 1 'uncomment for 16 (32 or 64) bit returns {{Cl|FOR...NEXT|FOR}} i = max% - 1 {{Cl|TO}} 0 {{Cl|STEP}} -1 'read as big-endian MSB to LSB - {{Cl|IF...THEN|IF}} (n% {{Cl|AND (boolean)|AND}} 2 ^ i) {{Cl|THEN}} MSB% = 1: B$ = B$ + "1" {{Cl|ELSE}} {{Cl|IF...THEN|IF}} MSB% {{Cl|THEN}} B$ = B$ + "0" + {{Cl|IF...THEN|IF}} (n% {{Cl|AND (boolean)|AND}} 2 ^ i) {{Cl|THEN}} MSB% = 1: B$ = B$ + "1" {{Cl|ELSE}} {{Cl|IF...THEN|IF}} MSB% {{Cl|THEN}} B$ = B$ + "0" {{Cl|NEXT}} -{{Cl|IF...THEN|IF}} B$ = "" {{Cl|THEN}} BIN$ = "0" {{Cl|ELSE}} BIN$ = B$ 'check for empty string +{{Cl|IF...THEN|IF}} B$ = "" {{Cl|THEN}} BIN$ = "0" {{Cl|ELSE}} BIN$ = B$ 'check for empty string {{Cl|END FUNCTION}} '' '' {{CodeEnd}} {{small|Code by Ted Weissgerber}} @@ -105,7 +105,7 @@ The '''&B''' prefix denotes that an integer value is expressed in a binary b 1000000000000000 1111111111111111 {{OutputEnd}} -''Note:'' The The MSB% flag allows zeroes to be added. Uncomment the MSB% = 1 statement for returns with leading zero's. +''Note:'' The The MSB% flag allows zeroes to be added. Uncomment the MSB% = 1 statement for returns with leading zeroes. ''Example 2:'' QB64 converts the binary values from the example above to [[INTEGER]] decimal values automatically. @@ -128,10 +128,11 @@ d = &B1111111111111111 '& 'or ~% : ''Note:'' The [[LONG]] values returned are the same as the values you can get using [[_UNSIGNED]] [[INTEGER]] (~%). -''See also:'' +{{PageSeeAlso}} * [[_BIT]], [[_BYTE]] +* [[_SHL]], [[_SHR]] * [[OCT$]], [[&O]] {{text|(octal)}} * [[HEX$]], [[&H]] {{text|(hexadecimal)}} -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/%26H.txt b/internal/help/%26H.txt index 1304403f8..e363b885b 100644 --- a/internal/help/%26H.txt +++ b/internal/help/%26H.txt @@ -7,7 +7,7 @@ The '''&H''' prefix denotes that an integer value is expressed in a Hexadeci * The base 16 numbering system uses hexadecimal digit values of 0 to F. A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15. * Leading zero values can be omitted just like in decimal values as they add nothing to the return value. -* Decimal values returned can be any '''signed''' [[INTEGER]], [[LONG]] integer, or [[_INTEGER64]] value so use those type of variables when converting directly as shown above in the Syntax. The program [[ERROR Codes|"overflow"]] error limits are listed as: +* Decimal values returned can be any '''signed''' [[INTEGER]], [[LONG]] integer, or [[_INTEGER64]] value so use those type of variables when converting directly as shown above in the Syntax. The program [[ERROR Codes|"overflow"]] error limits are listed as: ::* [[_BYTE]]: 2 hex digits or a decimal value range from -128 to 127. [[_UNSIGNED]]: 0 to 255. ::* [[INTEGER]]: 4 hex digits or a decimal value range from -32,768 to 32,767. [[_UNSIGNED]]: 0 to 65535. ::* [[LONG]]: 8 hex digits or a decimal value range from -2,147,483,648 to 2,147,483,647. [[_UNSIGNED]]: 0 to 4294967295. @@ -18,24 +18,24 @@ The '''&H''' prefix denotes that an integer value is expressed in a Hexadeci * [[LONG]] 32 bit [[_RGB]] values can be made using hexadecimal values from '''&HFF{{text|00|red}}{{text|00|green}}{{text|00|blue}}''' to '''&HFF{{text|FF|red}}{{text|FF|green}}{{text|FF|blue}}''' with full [[_ALPHA]] only. * [[LONG]] 32 bit [[_RGBA]] values can be made using hexadecimal values from '''&H00{{text|00|red}}{{text|00|green}}{{text|00|blue}}''' to '''&HFF{{text|FF|red}}{{text|FF|green}}{{text|FF|blue}}''' with any [[_ALPHA]]. * Hexadecimal '''0x''' is often used to prefix [[HEX$]] port addresses in documentation. Replace 0x with [[&H]] in QB64 or QBasic. -* To convert hex strings returned from [[HEX$]] with [[VAL]] you need to prefix the string with &H (for example; if the string is "FF" you should do VAL("&HFF") or VAL("&H" + hexvalue$). +* To convert hex strings returned from [[HEX$]] with [[VAL]] you need to prefix the string with &H (for example; if the string is "FF" you should do VAL("&HFF") or VAL("&H" + hexvalue$). ''Example 1:'' The maximum octal values of decimal value -1 in each numerical type are: {{CodeStart}} '' '' c&& = -1: d& = -1: e% = -1: f%% = -1 hx$ = {{Cl|HEX$}}(f%%) -{{Cl|PRINT}} "Max hex {{Cl|_BYTE}} = "; hx$; " with"; {{Cl|LEN}}(hx$); "digits ="; {{Cl|VAL}}("{{Cl|&H}}" + hx$) +{{Cl|PRINT}} "Max hex {{Cl|_BYTE}} = "; hx$; " with"; {{Cl|LEN}}(hx$); "digits ="; {{Cl|VAL}}("{{Cl|&H}}" + hx$) hx$ = {{Cl|HEX$}}(e%) -{{Cl|PRINT}} "Max hex {{Cl|INTEGER}} = "; hx$; " with"; {{Cl|LEN}}(hx$); "digits ="; {{Cl|VAL}}("{{Cl|&H}}" + hx$) +{{Cl|PRINT}} "Max hex {{Cl|INTEGER}} = "; hx$; " with"; {{Cl|LEN}}(hx$); "digits ="; {{Cl|VAL}}("{{Cl|&H}}" + hx$) hx$ = {{Cl|HEX$}}(d&) -{{Cl|PRINT}} "Max hex {{Cl|LONG}} = "; hx$; " with"; {{Cl|LEN}}(hx$); "digits ="; {{Cl|VAL}}("{{Cl|&H}}" + hx$) +{{Cl|PRINT}} "Max hex {{Cl|LONG}} = "; hx$; " with"; {{Cl|LEN}}(hx$); "digits ="; {{Cl|VAL}}("{{Cl|&H}}" + hx$) hx$ = {{Cl|HEX$}}(c&&) -{{Cl|PRINT}} "Max hex {{Cl|_INTEGER64}} = "; hx$; " with"; {{Cl|LEN}}(hx$); "digits ="; {{Cl|VAL}}("{{Cl|&H}}" + hx$) +{{Cl|PRINT}} "Max hex {{Cl|_INTEGER64}} = "; hx$; " with"; {{Cl|LEN}}(hx$); "digits ="; {{Cl|VAL}}("{{Cl|&H}}" + hx$) hx$ = {{Cl|HEX$}}(9223372036854775807) -{{Cl|PRINT}} "Max {{Cl|_INTEGER64}} value = "; hx$; " with"; {{Cl|LEN}}(hx$); "digits" +{{Cl|PRINT}} "Max {{Cl|_INTEGER64}} value = "; hx$; " with"; {{Cl|LEN}}(hx$); "digits" hx$ = {{Cl|HEX$}}(-9223372036854775808) -{{Cl|PRINT}} "Min {{Cl|_INTEGER64}} value = "; hx$; " with"; {{Cl|LEN}}(hx$); "digits" '' '' +{{Cl|PRINT}} "Min {{Cl|_INTEGER64}} value = "; hx$; " with"; {{Cl|LEN}}(hx$); "digits" '' '' {{CodeEnd}} {{OutputStart}}Max hex _BYTE = FF with 2 digits = 255 Max hex INTEGER = FFFF with 4 digits = 65535 @@ -52,30 +52,30 @@ FUNCTION BIN$ (n&) h$ = {{Cl|HEX$}}(n&) 'get hexadecimal string value FOR i = 1 TO {{Cl|LEN}}(h$) 'scan the HEX$ digits SELECT CASE {{Cl|MID$}}(h$, i, 1) 'read each HEX$ digit - CASE "0": b$ = b$ + "0000" - CASE "1": b$ = b$ + "0001" - CASE "2": b$ = b$ + "0010" - CASE "3": b$ = b$ + "0011" - CASE "4": b$ = b$ + "0100" - CASE "5": b$ = b$ + "0101" - CASE "6": b$ = b$ + "0110" - CASE "7": b$ = b$ + "0111" - CASE "8": b$ = b$ + "1000" - CASE "9": b$ = b$ + "1001" - CASE "A": b$ = b$ + "1010" - CASE "B": b$ = b$ + "1011" - CASE "C": b$ = b$ + "1100" - CASE "D": b$ = b$ + "1101" - CASE "E": b$ = b$ + "1110" - CASE "F": b$ = b$ + "1111" + CASE "0": b$ = b$ + "0000" + CASE "1": b$ = b$ + "0001" + CASE "2": b$ = b$ + "0010" + CASE "3": b$ = b$ + "0011" + CASE "4": b$ = b$ + "0100" + CASE "5": b$ = b$ + "0101" + CASE "6": b$ = b$ + "0110" + CASE "7": b$ = b$ + "0111" + CASE "8": b$ = b$ + "1000" + CASE "9": b$ = b$ + "1001" + CASE "A": b$ = b$ + "1010" + CASE "B": b$ = b$ + "1011" + CASE "C": b$ = b$ + "1100" + CASE "D": b$ = b$ + "1101" + CASE "E": b$ = b$ + "1110" + CASE "F": b$ = b$ + "1111" END SELECT NEXT i - b$ = {{Cl|RIGHT$}}(b$, LEN(b$) - {{Cl|INSTR}}(b$, "1") + 1) 'eliminate leading zeroes - IF {{Cl|VAL}}(b$) THEN BIN$ = b$ ELSE BIN$ = "0" 'return zero if n& = 0 + b$ = {{Cl|RIGHT$}}(b$, LEN(b$) - {{Cl|INSTR}}(b$, "1") + 1) 'eliminate leading zeroes + IF {{Cl|VAL}}(b$) THEN BIN$ = b$ ELSE BIN$ = "0" 'return zero if n& = 0 END FUNCTION '' '' {{CodeEnd}} {{small|Code by CodeGuy}} -:''Explanation:'' Hexadecimal digits can be any value up to 15 which also corresponds to all four bits on in binary. The function above just adds every four bit binary string value together to return the binary value. After they are concatenated, the leading bit on is found by [[INSTR]] and everything from that point is kept removing the leading "0"'s. +:''Explanation:'' Hexadecimal digits can be any value up to 15 which also corresponds to all four bits on in binary. The function above just adds every four bit binary string value together to return the binary value. After they are concatenated, the leading bit on is found by [[INSTR]] and everything from that point is kept removing the leading "0"'s. ''See also:'' @@ -84,4 +84,4 @@ END FUNCTION '' '' * [[Base Comparisons]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/%26O.txt b/internal/help/%26O.txt index 970795587..d3fe2809b 100644 --- a/internal/help/%26O.txt +++ b/internal/help/%26O.txt @@ -6,7 +6,7 @@ The '''&O''' prefix denotes that a integer value is expressed in an Octal ba * The base eight numbering system only uses octal digit values of 0 to 7. * Leading zero values '''can''' be omitted as they add nothing to the return value. -* Decimal values returned can be any '''signed''' [[INTEGER]], [[LONG]] integer, or [[_INTEGER64]] value so use those type of variables when converting directly as shown above. The program [[ERROR Codes|"overflow"]] error limits are listed as: +* Decimal values returned can be any '''signed''' [[INTEGER]], [[LONG]] integer, or [[_INTEGER64]] value so use those type of variables when converting directly as shown above. The program [[ERROR Codes|"overflow"]] error limits are listed as: :: * [[INTEGER]]: 6 octal digits or a decimal value range from -32,768 to 32,767 :: * [[LONG]]: 11 octal digits or a decimal value range from -2,147,483,648 to 2,147,483,647 :: * [[_INTEGER64]]: 22 octal digits or decimal values from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. @@ -17,13 +17,13 @@ The '''&O''' prefix denotes that a integer value is expressed in an Octal ba {{CodeStart}} c&& = -1: d& = -1: e% = -1: f%% = -1 oc$ = {{Cl|OCT$}}(f%%) -{{Cl|PRINT}} "Max octal {{Cl|_BYTE}} = "; oc$; " with"; {{Cl|LEN}}(oc$); "digits ="; {{Cl|VAL}}("{{Cl|&O}}" + oc$) +{{Cl|PRINT}} "Max octal {{Cl|_BYTE}} = "; oc$; " with"; {{Cl|LEN}}(oc$); "digits ="; {{Cl|VAL}}("{{Cl|&O}}" + oc$) oc$ = {{Cl|OCT$}}(e%) -{{Cl|PRINT}} "Max octal {{Cl|INTEGER}} = "; oc$; " with"; {{Cl|LEN}}(oc$); "digits ="; {{Cl|VAL}}("{{Cl|&O}}" + oc$) +{{Cl|PRINT}} "Max octal {{Cl|INTEGER}} = "; oc$; " with"; {{Cl|LEN}}(oc$); "digits ="; {{Cl|VAL}}("{{Cl|&O}}" + oc$) oc$ = {{Cl|OCT$}}(d&) -{{Cl|PRINT}} "Max octal {{Cl|LONG}} = "; oc$; " with"; {{Cl|LEN}}(oc$); "digits ="; {{Cl|VAL}}("{{Cl|&O}}" + oc$) +{{Cl|PRINT}} "Max octal {{Cl|LONG}} = "; oc$; " with"; {{Cl|LEN}}(oc$); "digits ="; {{Cl|VAL}}("{{Cl|&O}}" + oc$) oc$ = {{Cl|OCT$}}(c&&) -{{Cl|PRINT}} "Max octal {{Cl|_INTEGER64}} = "; oc$; " with"; {{Cl|LEN}}(oc$); "digits ="; {{Cl|VAL}}("{{Cl|&O}}" + oc$) '' '' +{{Cl|PRINT}} "Max octal {{Cl|_INTEGER64}} = "; oc$; " with"; {{Cl|LEN}}(oc$); "digits ="; {{Cl|VAL}}("{{Cl|&O}}" + oc$) '' '' {{CodeEnd}} {{OutputStart}}Max octal _BYTE = 377 with 3 digits = 255 Max octal INTEGER = 177777 with 6 digits = 65535 @@ -38,4 +38,4 @@ Max octal _INTEGER64 = 1777777777777777777777 with 22 digits =-1 * [[Base Comparisons]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/%2F.txt b/internal/help/%2F.txt index 7a4357d8c..31af7dcb0 100644 --- a/internal/help/%2F.txt +++ b/internal/help/%2F.txt @@ -10,7 +10,7 @@ The '''/''' mathematical operator performs decimal point division on a numerical {{PageDescription}} * Number value can be any literal or variable numerical type. -* '''Divisor (second value) must not be a value of 0 to .5'''. This will create a [[ERROR Codes|"Division by zero" error!]] due to [[CINT]] rounding. +* '''Divisor (second value) must not be a value of 0 to .5'''. This will create a [[ERROR Codes|"Division by zero" error!]] due to [[CINT]] rounding. * Return values can be any literal or variable numerical type, but [[SINGLE]] or [[DOUBLE]] type decimal point returns are likely. * Values returned may be expressed using exponential or [[scientific notation]] using '''E''' for SINGLE or '''D''' for DOUBLE precision. * Use the [[\|\ integer division]] operator to guarantee [[INTEGER]] or [[LONG]] return values. @@ -24,4 +24,4 @@ The '''/''' mathematical operator performs decimal point division on a numerical * [[Mathematical Operations]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/-.txt b/internal/help/-.txt index 5f3453049..f7062c554 100644 --- a/internal/help/-.txt +++ b/internal/help/-.txt @@ -24,4 +24,4 @@ The '''-''' mathematical operator performs subtraction on two numerical values o -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/ABS.txt b/internal/help/ABS.txt index 33b197137..cce9749aa 100644 --- a/internal/help/ABS.txt +++ b/internal/help/ABS.txt @@ -34,4 +34,4 @@ c = {{Cl|ABS}}(c) * [[Mathematical Operations]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/ACCESS.txt b/internal/help/ACCESS.txt index 227671a16..c971c5545 100644 --- a/internal/help/ACCESS.txt +++ b/internal/help/ACCESS.txt @@ -4,7 +4,7 @@ The [[ACCESS]] clause is used in an [[OPEN]] statement when working over a netwo {{PageSyntax}} -:OPEN "file.dat" FOR APPEND ['''ACCESS {READ|WRITE}'''] AS #1 +:OPEN "file.dat" FOR APPEND ['''ACCESS {READ|WRITE}'''] AS #1 {{PageDescription}} * Valid Options: @@ -15,7 +15,7 @@ The [[ACCESS]] clause is used in an [[OPEN]] statement when working over a netwo ===Limitations=== -*If another process already has access to a specified file, program access is denied for that file OPEN access. A "Permission Denied" error 70 will be returned. A network program must be able to handle a denial of access error. +*If another process already has access to a specified file, program access is denied for that file OPEN access. A "Permission Denied" error 70 will be returned. A network program must be able to handle a denial of access error. {{PageSeeAlso}} @@ -24,4 +24,4 @@ The [[ACCESS]] clause is used in an [[OPEN]] statement when working over a netwo * [[ON ERROR]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/ALIAS.txt b/internal/help/ALIAS.txt index f1428927b..25594ab10 100644 --- a/internal/help/ALIAS.txt +++ b/internal/help/ALIAS.txt @@ -31,7 +31,7 @@ The [[ALIAS]] clause in a [[DECLARE LIBRARY]] statement block tells the program {{Cl|DECLARE LIBRARY|END DECLARE}} {{Cl|DO}} {{Cl|UNTIL}} {{Cl|_SCREENEXISTS}}: {{Cl|LOOP}} -{{Cl|PRINT}} "Hit a key..." +{{Cl|PRINT}} "Hit a key..." {{Cl|SLEEP}} MouseMove 1, 1 @@ -46,4 +46,4 @@ MouseMove 1, 1 * [[DECLARE (non-BASIC statement)]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/AND.txt b/internal/help/AND.txt index 99b6040c4..a432ca75c 100644 --- a/internal/help/AND.txt +++ b/internal/help/AND.txt @@ -50,12 +50,12 @@ The logical [[AND]] numerical operator compares two values in respect of their b {{CodeStart}} DO - {{Cl|INPUT}} "Enter Integer value from -32768 to 32767 (Enter quits): ", INTvalue& - IF INTvalue& < -32768 OR INTvalue& > 32767 OR INTval& = 0 THEN {{Cl|EXIT DO}} + {{Cl|INPUT}} "Enter Integer value from -32768 to 32767 (Enter quits): ", INTvalue& + IF INTvalue& < -32768 OR INTvalue& > 32767 OR INTval& = 0 THEN {{Cl|EXIT DO}} {{Cl|FOR...NEXT|FOR}} exponent = 15 {{Cl|TO}} 0 {{Cl|STEP}} -1 - {{Cl|IF...THEN|IF}} (INTvalue& {{Cl|AND}} 2 ^ exponent) {{Cl|THEN}} {{Cl|PRINT}} "1"; {{Cl|ELSE}} {{Cl|PRINT}} "0"; + {{Cl|IF...THEN|IF}} (INTvalue& {{Cl|AND}} 2 ^ exponent) {{Cl|THEN}} {{Cl|PRINT}} "1"; {{Cl|ELSE}} {{Cl|PRINT}} "0"; {{Cl|NEXT}} - PRINT " " + PRINT " " LOOP UNTIL INTvalue& = 0 'zero entry quits {{CodeEnd}} @@ -73,4 +73,4 @@ The logical [[AND]] numerical operator compares two values in respect of their b * [[Binary]], [[Boolean]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/AND_(boolean).txt b/internal/help/AND_(boolean).txt index 14fbf0098..8f989968c 100644 --- a/internal/help/AND_(boolean).txt +++ b/internal/help/AND_(boolean).txt @@ -25,7 +25,7 @@ The [[AND (boolean)|AND]] conditonal operator is used to include another evaluat a% = 100 b% = 50 -{{Cl|IF...THEN|IF}} a% > b% {{Cl|AND (boolean)|AND}} a% < 200 {{Cl|THEN}} {{Cl|PRINT}} "True" +{{Cl|IF...THEN|IF}} a% > b% {{Cl|AND (boolean)|AND}} a% < 200 {{Cl|THEN}} {{Cl|PRINT}} "True" {{CodeEnd}} {{OutputStart}} @@ -42,10 +42,10 @@ c% = 25 d% = 50 e% = 100 -{{Cl|IF...THEN|IF}} (a% > b% {{Cl|AND (boolean)|AND}} b% > c%) {{Cl|AND (boolean)|AND}} (c% < d% {{Cl|AND (boolean)|AND}} d% < e%) {{Cl|THEN}} -{{Cl|PRINT}} "True" +{{Cl|IF...THEN|IF}} (a% > b% {{Cl|AND (boolean)|AND}} b% > c%) {{Cl|AND (boolean)|AND}} (c% < d% {{Cl|AND (boolean)|AND}} d% < e%) {{Cl|THEN}} +{{Cl|PRINT}} "True" {{Cl|ELSE}} -{{Cl|PRINT}} "False" +{{Cl|PRINT}} "False" {{Cl|END IF}} '' '' {{CodeEnd}} {{OutputStart}} @@ -60,4 +60,4 @@ True * [[IF...THEN]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/ANY.txt b/internal/help/ANY.txt index df71d8b76..9b8cb3c18 100644 --- a/internal/help/ANY.txt +++ b/internal/help/ANY.txt @@ -22,4 +22,4 @@ ANY disables type checking for a variable used in a [[SUB]] or [[FUNCTION]] decl * [[DECLARE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/APPEND.txt b/internal/help/APPEND.txt index 13c4b074d..a07f1e4b2 100644 --- a/internal/help/APPEND.txt +++ b/internal/help/APPEND.txt @@ -17,4 +17,4 @@ [[OUTPUT]], [[RANDOM]], [[INPUT (file mode)]], [[BINARY]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/AS.txt b/internal/help/AS.txt index 5960c201d..9610aeae6 100644 --- a/internal/help/AS.txt +++ b/internal/help/AS.txt @@ -30,4 +30,4 @@ The [[AS]] keyword defines a variable data [[type]]. * [[Variable Types]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/ASC.txt b/internal/help/ASC.txt index e0bbd3fb5..234ffe248 100644 --- a/internal/help/ASC.txt +++ b/internal/help/ASC.txt @@ -10,7 +10,7 @@ The [[ASC]] function returns the [[ASCII]] code number of a certain [[STRING]] t * If the optional {{Parameter|position%}} parameter is omitted, ASC will return the [[ASCII]] code of the first [[STRING]] character. * [[ASCII]] code [[INTEGER]] or [[_UNSIGNED]] [[_BYTE]] values returned range from 0 to 255. * ASC returns 0 when reading [[ASCII]] 2 byte codes returned by [[INKEY$]] when the arrow, function, Home/Page keys are used. -** Use QB64's {{Parameter|position%}} parameter to read the second byte if necessary. {{Text|IF ASC(key$) <nowiki>=</nowiki> 0 THEN byte2 <nowiki>=</nowiki> ASC(key$, 2)|green}} +** Use QB64's {{Parameter|position%}} parameter to read the second byte if necessary. {{Text|IF ASC(key$) <nowiki>=</nowiki> 0 THEN byte2 <nowiki>=</nowiki> ASC(key$, 2)|green}} * In '''QB64''' ASC string byte position reads are about '''5 times faster''' than [[MID$]] when parsing strings. See [[MID$]] ''Example 2''. @@ -29,10 +29,10 @@ The [[ASC]] function returns the [[ASCII]] code number of a certain [[STRING]] t '''' Tab Q W E R T Y U I O P [{ ]} \| Del End PDn 7Hme 8/▲ 9PU + ''' ' 9 81 87 69 82 84 89 85 73 79 80 123 125 124 +83 +79 +81 +71 +72 +73 43 ''' 113 119 101 114 116 121 117 105 111 112 91 93 92 55 56 57 '' -'''' CapL A S D F G H J K L ;: '" Enter 4/◄- 5 6/-► +'''' CapL A S D F G H J K L ;: '" Enter 4/◄- 5 6/-► ' - 65 83 68 70 71 72 74 75 76 58 34 13 +75 +76 +77 '''E''' ''' 97 115 100 102 103 104 106 107 108 59 39 52 53 54 '' '''n''' -'''' Shift Z X C V B N M ,< .> /? Shift ▲ 1End 2/▼ 3PD t''' +'''' Shift Z X C V B N M ,< .> /? Shift ▲ 1End 2/▼ 3PD t''' ' * 90 88 67 86 66 78 77 60 62 63 * +72 +79 +80 +81 '''e''' ''' 122 120 99 118 98 110 109 44 46 47 49 50 51 '' '''r''' '''' Ctrl Win Alt Spacebar Alt Win Menu Ctrl ◄- ▼ -► 0Ins .Del ''' @@ -44,56 +44,56 @@ The [[ASC]] function returns the [[ASCII]] code number of a certain [[STRING]] t {{WhiteEnd}} -<center>'''[[ASCII#Two_Byte_Codes|Two Byte Ctrl, Alt and Shift + Function key combinations]]'''</center> +<center>'''[[ASCII#Two_Byte_Codes|Two Byte Ctrl, Alt and Shift + Function key combinations]]'''</center> -{{WhiteStart}} '''Two Byte Characters    Key                 CHR$(0) + "?" ''' +{{WhiteStart}} '''Two Byte Characters    Key                 CHR$(0) + "?" ''' CHR$(0) + CHR$(16-50) [Alt] + letter - CHR$(0) + CHR$(59) [F1] ";" - CHR$(0) + CHR$(60) [F2] "<" - CHR$(0) + CHR$(61) [F3] "=" - CHR$(0) + CHR$(62) [F4] ">" - CHR$(0) + CHR$(63) [F5] "?" - CHR$(0) + CHR$(64) [F6] "@" - CHR$(0) + CHR$(65) [F7] "A" - CHR$(0) + CHR$(66) [F8] "B" - CHR$(0) + CHR$(67) [F9] "C" - CHR$(0) + CHR$(68) [F10] "D" - CHR$(0) + CHR$(71) [Home] "G" - CHR$(0) + CHR$(72) [↑] Arrow "H" - CHR$(0) + CHR$(73) [Page Up] "I" - CHR$(0) + CHR$(75) [←] Arrow "K" - CHR$(0) + CHR$(76) [5 NumberPad] "L" (NumLock off in QB64) - CHR$(0) + CHR$(77) [→] Arrow "M" - CHR$(0) + CHR$(79) [End] "O" - CHR$(0) + CHR$(80) [↓] Arrow "P" - CHR$(0) + CHR$(81) [Page Down] "Q" - CHR$(0) + CHR$(82) [Insert] "R" - CHR$(0) + CHR$(83) [Delete] "S" + CHR$(0) + CHR$(59) [F1] ";" + CHR$(0) + CHR$(60) [F2] "<" + CHR$(0) + CHR$(61) [F3] "=" + CHR$(0) + CHR$(62) [F4] ">" + CHR$(0) + CHR$(63) [F5] "?" + CHR$(0) + CHR$(64) [F6] "@" + CHR$(0) + CHR$(65) [F7] "A" + CHR$(0) + CHR$(66) [F8] "B" + CHR$(0) + CHR$(67) [F9] "C" + CHR$(0) + CHR$(68) [F10] "D" + CHR$(0) + CHR$(71) [Home] "G" + CHR$(0) + CHR$(72) [↑] Arrow "H" + CHR$(0) + CHR$(73) [Page Up] "I" + CHR$(0) + CHR$(75) [←] Arrow "K" + CHR$(0) + CHR$(76) [5 NumberPad] "L" (NumLock off in QB64) + CHR$(0) + CHR$(77) [→] Arrow "M" + CHR$(0) + CHR$(79) [End] "O" + CHR$(0) + CHR$(80) [↓] Arrow "P" + CHR$(0) + CHR$(81) [Page Down] "Q" + CHR$(0) + CHR$(82) [Insert] "R" + CHR$(0) + CHR$(83) [Delete] "S" CHR$(0) + CHR$(84-93) [Shift] + F1-10 CHR$(0) + CHR$(94-103) [Ctrl] + F1-10 CHR$(0) + CHR$(104-113) [Alt] + F1-10 CHR$(0) + CHR$(114-119) [Ctrl] + keypad CHR$(0) + CHR$(120-129) [Alt] + number - CHR$(0) + CHR$(130 or 131) [Alt] + _/- or +/= "é" or "â" - CHR$(0) + CHR$(133) [F11] "à" - CHR$(0) + CHR$(134) [F12] "å" - CHR$(0) + CHR$(135) [Shift] + [F11] "ç" - CHR$(0) + CHR$(136) [Shift] + [F12] "ê" - CHR$(0) + CHR$(137) [Ctrl] + [F11] "ë" - CHR$(0) + CHR$(138) [Ctrl] + [F12] "è" - CHR$(0) + CHR$(139) [Alt] + [F11] "ï" - CHR$(0) + CHR$(140) [Alt] + [F12] "î" + CHR$(0) + CHR$(130 or 131) [Alt] + _/- or +/= "é" or "â" + CHR$(0) + CHR$(133) [F11] "à" + CHR$(0) + CHR$(134) [F12] "å" + CHR$(0) + CHR$(135) [Shift] + [F11] "ç" + CHR$(0) + CHR$(136) [Shift] + [F12] "ê" + CHR$(0) + CHR$(137) [Ctrl] + [F11] "ë" + CHR$(0) + CHR$(138) [Ctrl] + [F12] "è" + CHR$(0) + CHR$(139) [Alt] + [F11] "ï" + CHR$(0) + CHR$(140) [Alt] + [F12] "î" {{WhiteEnd}} -:In '''QB64''', [[CVI]] can be used to get the [[_KEYDOWN]] 2-byte code value. Example: IF _KEYDOWN([[CVI]]([[CHR$]](0) + "P")) THEN +:In '''QB64''', [[CVI]] can be used to get the [[_KEYDOWN]] 2-byte code value. Example: IF _KEYDOWN([[CVI]]([[CHR$]](0) + "P")) THEN {{PageExamples}} ''Example 1:'' How ASC can be used to find any ASCII code in a string of characters using QB64. {{CodeStart}} '' '' - {{Cl|PRINT}} ASC("A") - {{Cl|PRINT}} ASC("Be a rockstar") - {{Cl|PRINT}} ASC("QB64 is not only COMPATIBLE, it can find any part of the string!", 18) '' '' + {{Cl|PRINT}} ASC("A") + {{Cl|PRINT}} ASC("Be a rockstar") + {{Cl|PRINT}} ASC("QB64 is not only COMPATIBLE, it can find any part of the string!", 18) '' '' {{CodeEnd}} ''Returns:'' @@ -103,26 +103,26 @@ The [[ASC]] function returns the [[ASCII]] code number of a certain [[STRING]] t 67 {{OutputEnd}} -''Explanation:'' The ASCII code for "A" is 65 and the ASCII code for "B" is 66, ASCII code for "C" is 67 and the "C" is at position 18 in the string. +''Explanation:'' The ASCII code for "A" is 65 and the ASCII code for "B" is 66, ASCII code for "C" is 67 and the "C" is at position 18 in the string. -::''Note:'' The ASCII code for "A" and "a" are different by the value of 32, "A" + 32 is "a", 65("A") + 32 = 97("a"). +::''Note:'' The ASCII code for "A" and "a" are different by the value of 32, "A" + 32 is "a", 65("A") + 32 = 97("a"). ''Example 2:'' Reading the ASCII and two byte code combinations with ASC in '''QB64'''. {{CodeStart}} '' '' Q$ = {{Cl|CHR$}}(34) ' quote character -{{Cl|COLOR}} 10: {{Cl|LOCATE}} 5, 22: {{Cl|PRINT}} "Press some keys or combinations!" -{{Cl|COLOR}} 13: {{Cl|LOCATE}} 23, 30: {{Cl|PRINT}} "Escape key Quits" +{{Cl|COLOR}} 10: {{Cl|LOCATE}} 5, 22: {{Cl|PRINT}} "Press some keys or combinations!" +{{Cl|COLOR}} 13: {{Cl|LOCATE}} 23, 30: {{Cl|PRINT}} "Escape key Quits" DO - DO: {{Cl|SLEEP}}: key$ = {{Cl|INKEY$}}: {{Cl|LOOP}} {{Cl|UNTIL}} key$ <> "" ' prevent ASC empty string read error + DO: {{Cl|SLEEP}}: key$ = {{Cl|INKEY$}}: {{Cl|LOOP}} {{Cl|UNTIL}} key$ <> "" ' prevent ASC empty string read error code% = {{Cl|ASC}}(key$): {{Cl|COLOR}} 11: {{Cl|LOCATE}} 10, 10 {{Cl|IF...THEN|IF}} code% {{Cl|THEN}} ' ASC returns any value greater than 0 - {{Cl|PRINT}} "{{Cl|CHR$}}(" + {{Cl|LTRIM$}}({{Cl|STR$}}(code%)) + ")" + {{Cl|SPACE$}}(13): - {{Cl|IF...THEN|IF}} code% > 8 {{Cl|AND (boolean)|AND}} code% < 14 {{Cl|THEN}} code% = 32 ' unprintable control codes + {{Cl|PRINT}} "{{Cl|CHR$}}(" + {{Cl|LTRIM$}}({{Cl|STR$}}(code%)) + ")" + {{Cl|SPACE$}}(13): + {{Cl|IF...THEN|IF}} code% > 8 {{Cl|AND (boolean)|AND}} code% < 14 {{Cl|THEN}} code% = 32 ' unprintable control codes {{Cl|COLOR}} 14: {{Cl|LOCATE}} 10, 50: {{Cl|PRINT}} {{Cl|CHR$}}(code%) + {{Cl|SPACE$}}(13) - {{Cl|ELSE}}: {{Cl|PRINT}} "{{Cl|CHR$}}(0) + {{Cl|CHR$}}(" + {{Cl|LTRIM$}}({{Cl|STR$}}({{Cl|ASC}}(key$, 2))) + ")" - {{Cl|COLOR}} 14: {{Cl|LOCATE}} 10, 50: {{Cl|PRINT}} "{{Cl|CHR$}}(0) + " + Q$ + {{Cl|CHR$}}({{Cl|ASC}}(key$, 2)) + Q$ + {{Cl|ELSE}}: {{Cl|PRINT}} "{{Cl|CHR$}}(0) + {{Cl|CHR$}}(" + {{Cl|LTRIM$}}({{Cl|STR$}}({{Cl|ASC}}(key$, 2))) + ")" + {{Cl|COLOR}} 14: {{Cl|LOCATE}} 10, 50: {{Cl|PRINT}} "{{Cl|CHR$}}(0) + " + Q$ + {{Cl|CHR$}}({{Cl|ASC}}(key$, 2)) + Q$ {{Cl|END IF}} {{Cl|LOOP}} {{Cl|UNTIL}} code% = 27 '' ' @@ -136,12 +136,12 @@ DO DO: {{Cl|SLEEP}} ' requires a keypress to run loop once K$ = {{Cl|{{Cl|INKEY$}}}} code = {{Cl|ASC}}(K$) - {{Cl|IF...THEN|IF}} code >= 48 {{Cl|AND (boolean)|AND}} code <= 57 {{Cl|THEN}} entry$ = entry$ + {{Cl|{{Cl|CHR$}}}}(code) ' numbers only + {{Cl|IF...THEN|IF}} code >= 48 {{Cl|AND (boolean)|AND}} code <= 57 {{Cl|THEN}} entry$ = entry$ + {{Cl|{{Cl|CHR$}}}}(code) ' numbers only {{Cl|IF...THEN|IF}} code = 46 {{Cl|AND (boolean)|AND}} flag = 0 {{Cl|THEN}} entry$ = entry$ + K$: flag = 1: mark = {{Cl|LEN}}(entry$) ' decimal point {{Cl|END IF}} L = {{Cl|{{Cl|LEN}}}}(entry$) ' check entry length for possible backspace - {{Cl|IF...THEN|IF}} code = 8 {{Cl|AND (boolean)|AND}} L > 0 {{Cl|THEN}} ' backspace pressed and entry has a length + {{Cl|IF...THEN|IF}} code = 8 {{Cl|AND (boolean)|AND}} L > 0 {{Cl|THEN}} ' backspace pressed and entry has a length entry$ = {{Cl|{{Cl|MID$}}}}(entry$, 1, L - 1) ' remove one character from entry$ {{Cl|IF...THEN|IF}} L - 1 < mark {{Cl|THEN}} flag = 0 ' allow another decimal point if removed. {{Cl|LOCATE}} 10, {{Cl|POS}}(0) - 1: {{Cl|PRINT}} {{Cl|{{Cl|SPACE$}}}}(1); ' remove character from screen @@ -163,4 +163,4 @@ DO * [[Scancodes]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/ASC_(statement).txt b/internal/help/ASC_(statement).txt index a65afb4d4..e893a9594 100644 --- a/internal/help/ASC_(statement).txt +++ b/internal/help/ASC_(statement).txt @@ -6,7 +6,7 @@ The [[ASC (statement)|ASC]] statement allows a '''QB64''' program to change a ch {{PageDescription}} -* The {{Parameter|stringExpression$}} variable's value must have been previously defined and cannot be an empty string (""). +* The {{Parameter|stringExpression$}} variable's value must have been previously defined and cannot be an empty string (""). * {{Parameter|position%}} is optional. If no position is used, the leftmost character at position 1 is assumed. * {{Parameter|position%}} cannot be zero or greater than the string's [[LEN|length]] or an [[ERROR Codes|Illegal function error]] will occur. * The [[ASCII]] replacement {{Parameter|code%}} value can be any [[INTEGER]] value from 0 to 255. @@ -16,15 +16,15 @@ The [[ASC (statement)|ASC]] statement allows a '''QB64''' program to change a ch {{PageExamples}} ''Example:'' Demonstrates how to change existing text characters one letter at a time. {{CodeStart}} - a$ = "YZC" - {{Cl|ASC (statement)|ASC}}(a$) = 65 ' CHR$(65) = "A" - {{Cl|ASC (statement)|ASC}}(a$, 2) = 66 ' CHR$(66) = "B" + a$ = "YZC" + {{Cl|ASC (statement)|ASC}}(a$) = 65 ' CHR$(65) = "A" + {{Cl|ASC (statement)|ASC}}(a$, 2) = 66 ' CHR$(66) = "B" {{Cl|PRINT}} a$ 'ABC - {{Cl|ASC (statement)|ASC}}(a$, 2) = 0 ' CHR$(0) = " " + {{Cl|ASC (statement)|ASC}}(a$, 2) = 0 ' CHR$(0) = " " {{Cl|PRINT}} a$ - {{Cl|ASC (statement)|ASC}}(a$, 2) = {{Cl|ASC}}("S") ' get code value from ASC function + {{Cl|ASC (statement)|ASC}}(a$, 2) = {{Cl|ASC}}("S") ' get code value from ASC function {{Cl|PRINT}} a$ {{CodeEnd}} @@ -42,4 +42,4 @@ The [[ASC (statement)|ASC]] statement allows a '''QB64''' program to change a ch * [[INKEY$]], [[ASCII]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/ATN.txt b/internal/help/ATN.txt index 181e9f18d..546a17289 100644 --- a/internal/help/ATN.txt +++ b/internal/help/ATN.txt @@ -7,12 +7,12 @@ The [[ATN]] or arctangent function returns the angle in radians of a numerical [ {{Parameters}} * The return is the {{Parameter|tangent!}}'s angle in '''radians'''. -* {{Parameter|tangent!}} [[SINGLE]] or [[DOUBLE]] values are used by the function. EX:'''{{text|Pi <nowiki>=</nowiki> 4 * ATN(1)|green}}''' +* {{Parameter|tangent!}} [[SINGLE]] or [[DOUBLE]] values are used by the function. EX:'''{{text|Pi <nowiki>=</nowiki> 4 * ATN(1)|green}}''' {{PageDescription}} * To convert from radians to degrees, multiply radians * (180 / &pi;). -* The ''tangent'' value would be equal to the tangent value of an angle. Ex: '''{{text|[[TAN]](ATN(1)) <nowiki>=</nowiki> 1|green}}''' +* The ''tangent'' value would be equal to the tangent value of an angle. Ex: '''{{text|[[TAN]](ATN(1)) <nowiki>=</nowiki> 1|green}}''' * The function return value is between -&pi; / 2 and &pi; / 2. @@ -51,21 +51,21 @@ DO {{Cl|_DISPLAY}} {{Cl|_LIMIT}} 200 {{Cl|CLS}} -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" {{Cl|END}} {{Cl|FUNCTION}} getangle# (x1#, y1#, x2#, y2#) 'returns 0-359.99... {{Cl|IF...THEN|IF}} y2# = y1# {{Cl|THEN}} {{Cl|IF...THEN|IF}} x1# = x2# {{Cl|THEN}} {{Cl|EXIT FUNCTION}} - {{Cl|IF...THEN|IF}} x2# > x1# {{Cl|THEN}} getangle# = 90 {{Cl|ELSE}} getangle# = 270 + {{Cl|IF...THEN|IF}} x2# > x1# {{Cl|THEN}} getangle# = 90 {{Cl|ELSE}} getangle# = 270 {{Cl|EXIT FUNCTION}} {{Cl|END IF}} {{Cl|IF...THEN|IF}} x2# = x1# {{Cl|THEN}} - {{Cl|IF...THEN|IF}} y2# > y1# {{Cl|THEN}} getangle# = 180 + {{Cl|IF...THEN|IF}} y2# > y1# {{Cl|THEN}} getangle# = 180 {{Cl|EXIT FUNCTION}} {{Cl|END IF}} {{Cl|IF...THEN|IF}} y2# < y1# {{Cl|THEN}} - {{Cl|IF...THEN|IF}} x2# > x1# {{Cl|THEN}} + {{Cl|IF...THEN|IF}} x2# > x1# {{Cl|THEN}} getangle# = {{Cl|ATN}}((x2# - x1#) / (y2# - y1#)) * -57.2957795131 {{Cl|ELSE}} getangle# = {{Cl|ATN}}((x2# - x1#) / (y2# - y1#)) * -57.2957795131 + 360 @@ -85,4 +85,4 @@ DO * [[Mathematical_Operations#Derived_Mathematical_Functions|Derived Mathematical Functions]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/Apostrophe.txt b/internal/help/Apostrophe.txt index c25473204..851a2f5eb 100644 --- a/internal/help/Apostrophe.txt +++ b/internal/help/Apostrophe.txt @@ -2,14 +2,14 @@ The '''apostrophe''' is used to tell the compiler to ignore a statement or progr {{PageDescription}} * Allows programmer comments or temporary code removal. -* [[REM]] can also be used to "comment out" a line. +* [[REM]] can also be used to "comment out" a line. * QBasic [[Metacommand|metacommand]]s must be commented either with an apostrophe or [[REM]]. * [[$INCLUDE]] requires an apostrophe before and after the included file name. {{PageExamples}} {{CodeStart}} -COLOR 11: PRINT "Print this...." ' PRINT "Don't print this program comment!" +COLOR 11: PRINT "Print this...." ' PRINT "Don't print this program comment!" {{CodeEnd}} {{OutputStart}} @@ -22,4 +22,4 @@ COLOR 11: PRINT "Print this...." ' PRINT "Don't print this progra * [[REM]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/BEEP.txt b/internal/help/BEEP.txt index c15df5d74..049cc7ec1 100644 --- a/internal/help/BEEP.txt +++ b/internal/help/BEEP.txt @@ -7,7 +7,7 @@ The [[BEEP]] statement produces a beep sound through the sound card. {{PageDescription}} * [[BEEP]] can be placed anywhere to alert the user that there is something to do or an error has occurred. -* '''QB64''' produces the actual "beep" sound through the PC's sound card, to emulate QBasic's beeping through the [https://en.wikipedia.org/wiki/PC_speaker PC speaker]. +* '''QB64''' produces the actual "beep" sound through the PC's sound card, to emulate QBasic's beeping through the [https://en.wikipedia.org/wiki/PC_speaker PC speaker]. ==QBasic/QuickBASIC== @@ -21,4 +21,4 @@ The [[BEEP]] statement produces a beep sound through the sound card. * [[_SNDRAW]] {{text|(play frequency waves)}} -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/BINARY.txt b/internal/help/BINARY.txt index 76d579c57..42b26bbfd 100644 --- a/internal/help/BINARY.txt +++ b/internal/help/BINARY.txt @@ -26,16 +26,16 @@ int64 = 12345678 {{Cl|PRINT}} int64 -{{Cl|OPEN}} "temp64.tmp" {{Cl|FOR...NEXT|FOR}} {{Cl|BINARY}} {{Cl|AS}} #1 +{{Cl|OPEN}} "temp64.tmp" {{Cl|FOR...NEXT|FOR}} {{Cl|BINARY}} {{Cl|AS}} #1 {{Cl|PUT}} #1, , int64 'the file size will be 8 bytes {{Cl|CLOSE}} -{{Cl|PRINT}} "Press a key to read the file!" +{{Cl|PRINT}} "Press a key to read the file!" K$ = {{Cl|INPUT$}}(1) -{{Cl|OPEN}} "temp64.tmp" {{Cl|FOR...NEXT|FOR}} {{Cl|BINARY}} {{Cl|AS}} #1 +{{Cl|OPEN}} "temp64.tmp" {{Cl|FOR...NEXT|FOR}} {{Cl|BINARY}} {{Cl|AS}} #1 {{Cl|GET}} #1, , byte8 'GET the value as a string -{{Cl|PRINT}} "text string: "; byte8 'show that string is in {{Cl|_MK$}} format +{{Cl|PRINT}} "text string: "; byte8 'show that string is in {{Cl|_MK$}} format {{Cl|PRINT}} {{Cl|_CV}}({{Cl|_INTEGER64}}, byte8) 'convert to numerical value {{Cl|CLOSE}} '' '' @@ -48,11 +48,11 @@ K$ = {{Cl|INPUT$}}(1) {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(1000, 600, 256) {{Cl|_SCREENMOVE}} {{Cl|_SCREENMOVE|_MIDDLE}} {{Cl|DIM}} value AS {{Cl|INTEGER}} 'value type can be changed -{{Cl|LINE INPUT}} ; "Enter a {{Cl|BINARY}} filename to open: ", file$ -{{Cl|PRINT}} " Press S to restart!" +{{Cl|LINE INPUT}} ; "Enter a {{Cl|BINARY}} filename to open: ", file$ +{{Cl|PRINT}} " Press S to restart!" {{Cl|IF...THEN|IF}} {{Cl|LEN}}(file$) {{Cl|THEN}} {{Cl|OPEN}} file$ {{Cl|FOR...NEXT|FOR}} {{Cl|BINARY}} {{Cl|AS}} #1 {{Cl|ELSE}} {{Cl|END}} -{{Cl|IF...THEN|IF}} {{Cl|LOF}}(1) = 0 {{Cl|THEN}} {{Cl|PRINT}} "Empty file!": {{Cl|END}} +{{Cl|IF...THEN|IF}} {{Cl|LOF}}(1) = 0 {{Cl|THEN}} {{Cl|PRINT}} "Empty file!": {{Cl|END}} DO {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 16 x = x + 1 @@ -60,13 +60,13 @@ DO {{Cl|IF...THEN|IF}} {{Cl|EOF}}(1) {{Cl|THEN}} {{Cl|EXIT DO}} {{Cl|PRINT}} value; {{Cl|NEXT}} - {{Cl|PRINT}} {{Cl|CHR$}}(27); x; "@"; row + {{Cl|PRINT}} {{Cl|CHR$}}(27); x; "@"; row K$ = {{Cl|INPUT$}}(1) - {{Cl|IF...THEN|IF}} {{Cl|UCASE$}}(K$) = "S" {{Cl|THEN}} {{Cl|CLS}}: x = 0: row = 0: {{Cl|PRINT}} "Restarted!": {{Cl|SEEK}} 1, 1 + {{Cl|IF...THEN|IF}} {{Cl|UCASE$}}(K$) = "S" {{Cl|THEN}} {{Cl|CLS}}: x = 0: row = 0: {{Cl|PRINT}} "Restarted!": {{Cl|SEEK}} 1, 1 {{Cl|IF...THEN|IF}} x = 256 {{Cl|THEN}} x = 0: row = row + 1: {{Cl|PRINT}} {{Cl|LOOP}} {{Cl|UNTIL}} K$ = {{Cl|CHR$}}(27) {{Cl|CLOSE}} #1 -{{Cl|PRINT}} "Press Escape to exit!" +{{Cl|PRINT}} "Press Escape to exit!" DO: {{Cl|_LIMIT}} 100 {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) {{Cl|SYSTEM}} '' '' @@ -81,4 +81,4 @@ DO: {{Cl|_LIMIT}} 100 * [[Bitmaps]], [[Binary]] (numbers) -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/BLOAD.txt b/internal/help/BLOAD.txt index a096c3cac..85808829a 100644 --- a/internal/help/BLOAD.txt +++ b/internal/help/BLOAD.txt @@ -52,4 +52,4 @@ * [[Text Using Graphics]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/BSAVE.txt b/internal/help/BSAVE.txt index 241493714..74a7a925a 100644 --- a/internal/help/BSAVE.txt +++ b/internal/help/BSAVE.txt @@ -55,7 +55,7 @@ ''Example 3:'' Using [[PUT]] and [[GET]] to write and read array data from a file without using BSAVE or [[BLOAD]]: {{CodeStart}} -{{Cl|KILL}} "example2.BIN" 'removes old image file! +{{Cl|KILL}} "example2.BIN" 'removes old image file! {{Cl|SCREEN}} 13 {{Cl|OPTION BASE}} 0 @@ -65,16 +65,16 @@ {{Cl|GET (graphics statement)|GET}}(0, 0)-{{Cl|STEP}}(10, 10), Graphic%() 'get image to array {{Cl|FOR...NEXT|FOR}} i% = 1000 {{Cl|TO}} 0 {{Cl|STEP}} -1 'reverse read array for size needed - {{Cl|IF...THEN|IF}} Graphic%(i%) <> 0 {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR...NEXT|FOR}} 'find image color not black + {{Cl|IF...THEN|IF}} Graphic%(i%) <> 0 {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR...NEXT|FOR}} 'find image color not black {{Cl|NEXT}} size% = i% + 4 'size plus 2 integers(4 bytes) for dimensions {{Cl|REDIM}} {{Cl|_PRESERVE}} Graphic%(size%) 'resize existing array in QB64 only! -{{Cl|OPEN}} "example2.BIN" {{Cl|FOR...NEXT|FOR}} {{Cl|BINARY}} {{Cl|AS}} #1 ' {{Cl|PUT}} to a file +{{Cl|OPEN}} "example2.BIN" {{Cl|FOR...NEXT|FOR}} {{Cl|BINARY}} {{Cl|AS}} #1 ' {{Cl|PUT}} to a file {{Cl|PUT}} #1, , Graphic%() {{Cl|CLOSE}} -{{Cl|OPEN}} "example2.BIN" {{Cl|FOR...NEXT|FOR}} {{Cl|BINARY}} {{Cl|AS}} #2 'GET array and {{Cl|PUT}} to screen +{{Cl|OPEN}} "example2.BIN" {{Cl|FOR...NEXT|FOR}} {{Cl|BINARY}} {{Cl|AS}} #2 'GET array and {{Cl|PUT}} to screen {{Cl|DIM}} CopyBin%({{Cl|LOF}}(2) \ 2) 'create new array sized by half of file size {{Cl|GET}} #2, , CopyBin%() {{Cl|PUT (graphics statement)|PUT}}(100, 100), CopyBin%(), {{Cl|PSET}} @@ -85,11 +85,11 @@ K$ = {{Cl|INPUT$}}(1) 'Press any key {{Cl|FOR...NEXT|FOR}} i = 0 {{Cl|TO}} 20 'read all 3 arrays {{Cl|PRINT}} Graphic%(i); CopyBin%(i) {{Cl|NEXT}} -{{Cl|PRINT}} "Array:"; size%, "File:"; fsize% +{{Cl|PRINT}} "Array:"; size%, "File:"; fsize% {{CodeEnd}}{{small|Code by Ted Weissgerber}} : ''Explanation:'' A 10 by 10 pixel box is saved to an array using the [[GET (graphics statement)]] and written to a BINARY file using [[PUT]] #1. Then [[GET]] #1 places the file contents into another INTEGER array and places it on the screen with the [[PUT (graphics statement)]]. -: The array contents: 88 is the width in the GET array for [[SCREEN]] 13 which needs divided by 8 in that mode only. The area is actually 11 X 11. The array size needed can be found by looping backwards through the array until a color value is found. '''{{text|IF array(i) <> 0 THEN EXIT FOR|green}}''' (66 integers) or by dividing the created BINARY file size in half (134 bytes) when known to be array sized already. +: The array contents: 88 is the width in the GET array for [[SCREEN]] 13 which needs divided by 8 in that mode only. The area is actually 11 X 11. The array size needed can be found by looping backwards through the array until a color value is found. '''{{text|IF array(i) <> 0 THEN EXIT FOR|green}}''' (66 integers) or by dividing the created BINARY file size in half (134 bytes) when known to be array sized already. {{PageSeeAlso}} @@ -101,4 +101,4 @@ K$ = {{Cl|INPUT$}}(1) 'Press any key * [[Text Using Graphics]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/BYVAL.txt b/internal/help/BYVAL.txt index d828836d4..0471db197 100644 --- a/internal/help/BYVAL.txt +++ b/internal/help/BYVAL.txt @@ -26,24 +26,24 @@ The [[BYVAL]] statement is used to pass a numerical parameter's value with proce {{PageExamples}} ''Example 1:'' BYVAL is used to preserve the values sent to an external procedure so they remain the same after they are used: {{CodeStart}} '' '' -{{Cl|DECLARE LIBRARY}} "SDL" +{{Cl|DECLARE LIBRARY}} "SDL" {{Cl|SUB}} MouseMove {{Cl|ALIAS}} SDL_WarpMouse ({{Cl|BYVAL}} xoffset&, {{Cl|BYVAL}} yoffset&) {{Cl|DECLARE LIBRARY|END DECLARE}} {{CodeEnd}} : ''Note:'' The DLL call above uses the SDL library, which was included with QB64 up to version 0.954. Won't work with '''version 1.000 and up'''. -''Example 2:'' Passing parameters "by value" using [[parenthesis|brackets]] when calling a [[SUB]] or [[FUNCTION]] in QBasic or QB64. +''Example 2:'' Passing parameters "by value" using [[parenthesis|brackets]] when calling a [[SUB]] or [[FUNCTION]] in QBasic or QB64. {{CodeStart}} '' '' {{Cl|CALL}} MySUB (a%, (b%), (c%)) 'CALL SUB b and c stay 0 after sub MySUB a%, b%, (c%) 'call SUB again without CALL only c stays 0 after sub -{{Cl|PRINT}} "After procedures: "; a%, b%, c% +{{Cl|PRINT}} "After procedures: "; a%, b%, c% {{Cl|SUB}} MySUB (a%, b%, c%) a% = a% + 1: b% = b% + 1: c% = c% + 1 -{{Cl|PRINT}} "Inside procedure: "; a%, b%, c% +{{Cl|PRINT}} "Inside procedure: "; a%, b%, c% {{Cl|END SUB}} '' '' {{CodeEnd}} {{OutputStart}} @@ -62,4 +62,4 @@ After procedures: 2 1 0 * [[Libraries#C++_Variable_Types|C++ Variable Types]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/CALL.txt b/internal/help/CALL.txt index d2e45fa61..b9d9f0b3c 100644 --- a/internal/help/CALL.txt +++ b/internal/help/CALL.txt @@ -35,7 +35,7 @@ helloworld a 'a passed to c parameter w/o CALL {{Cl|END}} {{Cl|SUB}} helloworld (c) 'SUB parameter variables are always inside of brackets in SUB code -{{Cl|PRINT}} "Hello World!" +{{Cl|PRINT}} "Hello World!" {{Cl|PRINT}} a, b, c a = a + 1 'a is a SUB value of 0 when printed which may increase inside SUB only b = b + 1 'b is a shared value which can increase anywhere @@ -61,4 +61,4 @@ Hello World! * [[DECLARE]], [[DECLARE (non-BASIC statement)]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/CALLS.txt b/internal/help/CALLS.txt index 15e854908..d7de2c22a 100644 --- a/internal/help/CALLS.txt +++ b/internal/help/CALLS.txt @@ -21,4 +21,4 @@ *[[CALL]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/CALL_ABSOLUTE.txt b/internal/help/CALL_ABSOLUTE.txt index 6fdfc2a6e..ecb2016bb 100644 --- a/internal/help/CALL_ABSOLUTE.txt +++ b/internal/help/CALL_ABSOLUTE.txt @@ -23,4 +23,4 @@ * [[_MOUSEINPUT]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/CASE.txt b/internal/help/CASE.txt index c6c807264..d9e199693 100644 --- a/internal/help/CASE.txt +++ b/internal/help/CASE.txt @@ -16,7 +16,7 @@ ** [[CASE]] value ** [[CASE]] value1 [[TO]] value2 ** [[CASE]] value1, value2, value3 -** [[CASE IS]] value1 > value2 +** [[CASE IS]] value1 > value2 ** [[CASE ELSE]] * The first time a [[CASE]] value matches the compared variable's value, that [[CASE]] code is executed and [[SELECT CASE]] is exited, unless '''EVERYCASE''' is used. @@ -24,14 +24,14 @@ {{CodeStart}} a = 100 {{Cl|SELECT CASE}} a - {{Cl|CASE}} 1, 3, 5, 7, 9: {{Cl|PRINT}} "Odd values under 10 will be shown." - {{Cl|CASE}} 10: {{Cl|PRINT}} "10 will be shown." - {{Cl|CASE}} 50: {{Cl|PRINT}} "50 will be shown." - {{Cl|CASE}} 100: {{Cl|PRINT}} "This will be shown. (a is 100)" - {{Cl|PRINT}} "(and this)" - {{Cl|CASE}} 150: {{Cl|PRINT}} "150 will be shown." - {{Cl|CASE IS}} < 150: {{Cl|PRINT}} "Less than 150 will be shown. (a which is 100 is under 150)" - {{Cl|CASE}} 50 {{Cl|TO}} 150: {{Cl|PRINT}} "50 to 150 will be shown. (a which is 100 is between 50 TO 150)" + {{Cl|CASE}} 1, 3, 5, 7, 9: {{Cl|PRINT}} "Odd values under 10 will be shown." + {{Cl|CASE}} 10: {{Cl|PRINT}} "10 will be shown." + {{Cl|CASE}} 50: {{Cl|PRINT}} "50 will be shown." + {{Cl|CASE}} 100: {{Cl|PRINT}} "This will be shown. (a is 100)" + {{Cl|PRINT}} "(and this)" + {{Cl|CASE}} 150: {{Cl|PRINT}} "150 will be shown." + {{Cl|CASE IS}} < 150: {{Cl|PRINT}} "Less than 150 will be shown. (a which is 100 is under 150)" + {{Cl|CASE}} 50 {{Cl|TO}} 150: {{Cl|PRINT}} "50 to 150 will be shown. (a which is 100 is between 50 TO 150)" {{Cl|END SELECT}} {{CodeEnd}} @@ -50,10 +50,10 @@ a = 100 :* A [[CASE]] can list several values separated by commas for the same program option to be executed. -:* [[CASE IS]] is used when we need to compare the value to a conditional expression range such as a value is "=" equal to, "<" less than, ">" greater than, "<>" not equal to or [[NOT]] a value. +:* [[CASE IS]] is used when we need to compare the value to a conditional expression range such as a value is "=" equal to, "<" less than, ">" greater than, "<>" not equal to or [[NOT]] a value. :* A [[CASE]] range can be specified (in the example; 50 [[TO]] 150) if needed. -<center>''Note:'' A [[SELECT CASE]] block has to end with [[END SELECT]].</center> +<center>''Note:'' A [[SELECT CASE]] block has to end with [[END SELECT]].</center> {{PageSeeAlso}} @@ -62,4 +62,4 @@ a = 100 * [[IF...THEN]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/CASE_ELSE.txt b/internal/help/CASE_ELSE.txt index 103e32ca6..d7226dfc6 100644 --- a/internal/help/CASE_ELSE.txt +++ b/internal/help/CASE_ELSE.txt @@ -5,7 +5,7 @@ {{PageDescription}} * [[CASE ELSE]] should be listed at the bottom of the case list as it will supersede any case statements after it. -* Use it as a "safety net" or as an alternative for all values not covered in the [[CASE]] statements. +* Use it as a "safety net" or as an alternative for all values not covered in the [[CASE]] statements. {{PageExamples}} @@ -14,11 +14,11 @@ a = 100 {{Cl|SELECT CASE}} a -{{Cl|CASE}} {{Cl|IS}} < 99: {{Cl|PRINT}} "a is < 99" -{{Cl|CASE}} 99: {{Cl|PRINT}} "a is 99" -{{Cl|CASE}} {{Cl|IS}} > 100: {{Cl|PRINT}} "a is > 100" +{{Cl|CASE}} {{Cl|IS}} < 99: {{Cl|PRINT}} "a is < 99" +{{Cl|CASE}} 99: {{Cl|PRINT}} "a is 99" +{{Cl|CASE}} {{Cl|IS}} > 100: {{Cl|PRINT}} "a is > 100" {{Cl|CASE ELSE}} -{{Cl|PRINT}} "a is 100" +{{Cl|PRINT}} "a is 100" {{Cl|END SELECT}} {{CodeEnd}} @@ -35,10 +35,10 @@ a is 100 a = 100 {{Cl|SELECT CASE}} a -{{Cl|CASE}} 10: {{Cl|PRINT}} "a is 10" -{{Cl|CASE}} 20: {{Cl|PRINT}} "a is 20" -{{Cl|CASE}} 30: {{Cl|PRINT}} "a is 30" -{{Cl|CASE ELSE}}: {{Cl|PRINT}} "a is something other than 10, 20 and 30" +{{Cl|CASE}} 10: {{Cl|PRINT}} "a is 10" +{{Cl|CASE}} 20: {{Cl|PRINT}} "a is 20" +{{Cl|CASE}} 30: {{Cl|PRINT}} "a is 30" +{{Cl|CASE ELSE}}: {{Cl|PRINT}} "a is something other than 10, 20 and 30" {{Cl|END SELECT}} {{CodeEnd}} @@ -59,4 +59,4 @@ a is something other than 10, 20 and 30 *[[IF...THEN]], [[ELSE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/CASE_IS.txt b/internal/help/CASE_IS.txt index 3439adae3..1cac8d544 100644 --- a/internal/help/CASE_IS.txt +++ b/internal/help/CASE_IS.txt @@ -4,16 +4,16 @@ {{PageSyntax}} -: [[CASE IS]] '''{=|<|>|<=|>=|<>|[[NOT]]} {{Parameter|expression}}''' +: [[CASE IS]] '''{=|<|>|<=|>=|<>|[[NOT]]} {{Parameter|expression}}''' {{PageDescription}} * [[AND (boolean)|AND]] can be used to add extra conditions to a [[CASE IS]] statement evaluation. * [[OR (boolean)|OR]] can be used to add alternate conditions to a [[CASE IS]] statement evaluation. * Parenthesis are allowed in [[CASE IS]] statements to clarify an evaluation. -* [[CASE IS]] > 100 uses the greater than expression. +* [[CASE IS]] > 100 uses the greater than expression. * [[CASE IS]] <= 100 uses the less than or equal to expression. -* [[CASE IS]] <> 100 uses the not equal to expression(same as [[NOT]] 100). +* [[CASE IS]] <> 100 uses the not equal to expression(same as [[NOT]] 100). {{Template:RelationalTable}} @@ -24,4 +24,4 @@ * [[SELECT CASE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/CDBL.txt b/internal/help/CDBL.txt index 8cf8e7903..2d99c19d1 100644 --- a/internal/help/CDBL.txt +++ b/internal/help/CDBL.txt @@ -31,4 +31,4 @@ * [[CSNG]], [[_ROUND]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/CDECL.txt b/internal/help/CDECL.txt index 800a24bc4..59e74df72 100644 --- a/internal/help/CDECL.txt +++ b/internal/help/CDECL.txt @@ -8,7 +8,7 @@ {{PageSyntax}} -: [[DECLARE]] {[[SUB]]|[[FUNCTION]]} name ['''CDECL'''] [ [[ALIAS]] "aliasname"] [([parameterlist])] +: [[DECLARE]] {[[SUB]]|[[FUNCTION]]} name ['''CDECL'''] [ [[ALIAS]] "aliasname"] [([parameterlist])] *'''[[Keywords currently not supported by QB64|Not supported in QB64.]]''' @@ -20,4 +20,4 @@ *[[DECLARE (non-BASIC statement)]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/CHAIN.txt b/internal/help/CHAIN.txt index 6cdf4601b..bd69fea8a 100644 --- a/internal/help/CHAIN.txt +++ b/internal/help/CHAIN.txt @@ -30,10 +30,10 @@ {{PageExamples}} ''Example:'' CHAIN looks for same file type extension as program module (BAS or EXE). {{CodeStart}} '' '' - {{Cl|CHAIN}} "Level1" '' '' + {{Cl|CHAIN}} "Level1" '' '' {{CodeEnd}} -''Explanation:'' The file referred to is "Level1.BAS" if the program module using the call is a BAS file. If the program was compiled, it would look for "Level1.EXE". +''Explanation:'' The file referred to is "Level1.BAS" if the program module using the call is a BAS file. If the program was compiled, it would look for "Level1.EXE". {{PageSeeAlso}} @@ -43,4 +43,4 @@ * [[LINKed or Merged Modules]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/CHDIR.txt b/internal/help/CHDIR.txt index dc7f5db46..f398a721a 100644 --- a/internal/help/CHDIR.txt +++ b/internal/help/CHDIR.txt @@ -8,23 +8,23 @@ The [[CHDIR]] statement changes the program's location from one working director {{PageDescription}} * {{Parameter|path$}} is the new directory path the program will work in. * {{Parameter|path$}} can be an absolute path (starting from the root folder) or relative path (starting from the current program location). -* If {{Parameter|path$}} specifies a non-existing path, a [[ERROR Codes|"Path not found"]] error will occur. -* '''A QB64 [[SHELL]] statement cannot use "CD " or "CHDIR " + path$ to change directories.''' +* If {{Parameter|path$}} specifies a non-existing path, a [[ERROR Codes|"Path not found"]] error will occur. +* '''A QB64 [[SHELL]] statement cannot use "CD " or "CHDIR " + path$ to change directories.''' {{PageExamples}} ''Example 1:'' The following code is Windows-specific: {{CodeStart}} '' '' -{{Cl|CHDIR}} "C:\" 'change to the root drive C (absolute path) -{{Cl|CHDIR}} "DOCUME~1" 'change to "C:\Documents and Settings" from root drive (relative path) -{{Cl|CHDIR}} "..\" 'change back to previous folder one up '' '' +{{Cl|CHDIR}} "C:\" 'change to the root drive C (absolute path) +{{Cl|CHDIR}} "DOCUME~1" 'change to "C:\Documents and Settings" from root drive (relative path) +{{Cl|CHDIR}} "..\" 'change back to previous folder one up '' '' {{CodeEnd}} :''Details:'' '''QB64''' can use long or short (8.3 notation) file and path names. ''Example 2:'' Using the Windows API to find the current program's name and root path. The PATH$ is a shared function value. {{CodeStart}} '' '' -{{Cl|_TITLE}} "My program" +{{Cl|_TITLE}} "My program" {{Cl|PRINT}} TITLE$ {{Cl|PRINT}} PATH$ @@ -40,13 +40,13 @@ Result = GetModuleFileNameA(0, FileName$, {{Cl|LEN}}(FileName$)) '0 designates PATH$ = {{Cl|LEFT$}}(FileName$, Result) start = 1 DO - posit = {{Cl|INSTR}}(start, PATH$, "\") + posit = {{Cl|INSTR}}(start, PATH$, "\") {{Cl|IF...THEN|IF}} posit {{Cl|THEN}} last = posit start = posit + 1 {{Cl|LOOP}} {{Cl|UNTIL}} posit = 0 TITLE$ = {{Cl|MID$}}(PATH$, last + 1) PATH$ = {{Cl|LEFT$}}(PATH$, last) -{{Cl|ELSE}} TITLE$ = "": PATH$ = "" +{{Cl|ELSE}} TITLE$ = "": PATH$ = "" {{Cl|END IF}} {{Cl|END FUNCTION}} '' '' {{CodeEnd}} @@ -60,4 +60,4 @@ Result = GetModuleFileNameA(0, FileName$, {{Cl|LEN}}(FileName$)) '0 designates * [[$CONSOLE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/CHR$.txt b/internal/help/CHR$.txt index c50606aa1..c3b73254b 100644 --- a/internal/help/CHR$.txt +++ b/internal/help/CHR$.txt @@ -19,7 +19,7 @@ The [[CHR$]] function returns the character associated with a certain [[ASCII|ch {{OutputStart}}Aa Bb {{OutputEnd}} -:Explanation: 65 is the ASCII code for "A" and 65 + 32 is the ASCII code for "a". 66 is the ASCII code for "B" and 66 + 32 is the ASCII code for "b" +:Explanation: 65 is the ASCII code for "A" and 65 + 32 is the ASCII code for "a". 66 is the ASCII code for "B" and 66 + 32 is the ASCII code for "b" ''Example 2:'' To cut down on typing CHR$(???) all day, define often used characters as variables such as Q$ = CHR$(34) as shown. @@ -28,11 +28,11 @@ Bb {{Cl|DIM}} Q AS {{Cl|STRING}} * 1 'define as one byte string(get rid of $ type suffix too) Q = {{Cl|CHR$}}(34) 'Q will now represent the elusive quotation mark in a string -PRINT "This text uses "; Q; "quotation marks"; Q; " that could have caused a syntax error!" +PRINT "This text uses "; Q; "quotation marks"; Q; " that could have caused a syntax error!" {{CodeEnd}} {{OutputStart}} -This text uses "quotation marks" that could have caused a syntax error! +This text uses "quotation marks" that could have caused a syntax error! {{OutputEnd}} @@ -40,11 +40,11 @@ This text uses "quotation marks" that could have caused a syntax error {{CodeStart}}{{Cl|OPEN}} FileName$ {{Cl|FOR}} {{Cl|INPUT (file mode)|INPUT}} {{Cl|AS}} #1 ' FileName to be encrypted {{Cl|IF...THEN|IF}} {{Cl|LOF}}(1) <= 32000 {{Cl|THEN}} Text$ = {{Cl|INPUT$}}({{Cl|LOF}}(1), 1) ' get Text as one string {{Cl|CLOSE}} #1 -Send$ = "" ' clear value +Send$ = "" ' clear value {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} {{Cl|LEN}}(Text$) Letter$ = {{Cl|MID$}}(Text$, i, 1) ' get each character in the text Code = {{Cl|ASC}}(Letter$) - {{Cl|IF...THEN|IF}} (Code > 64 {{Cl|AND (boolean)|AND}} Code < 91) {{Cl|OR (boolean)|OR}} (Code > 96 {{Cl|AND (boolean)|AND}} Code < 123) {{Cl|THEN}} + {{Cl|IF...THEN|IF}} (Code > 64 {{Cl|AND (boolean)|AND}} Code < 91) {{Cl|OR (boolean)|OR}} (Code > 96 {{Cl|AND (boolean)|AND}} Code < 123) {{Cl|THEN}} Letter$ = {{Cl|CHR$}}(Code + 130) ' change letter's ASCII character by 130 {{Cl|END IF}} Send$ = Send$ + Letter$ ' reassemble string with just letters encrypted @@ -60,11 +60,11 @@ Send$ = "" ' clear value {{CodeStart}}{{Cl|OPEN}} FileName$ {{Cl|FOR}} {{Cl|INPUT (file mode)|INPUT}} {{Cl|AS}} #1 ' FileName to be decrypted Text$ = {{Cl|INPUT$}}({{Cl|LOF}}(1), 1) ' open Text as one string {{Cl|CLOSE}} #1 -Send$ = "" +Send$ = "" {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} {{Cl|LEN}}(Text$) Letter$ = {{Cl|MID$}}(Text$, i, 1) Code = {{Cl|ASC}}(Letter$) - {{Cl|IF...THEN|IF}} (Code > 194 {{Cl|AND (boolean)|AND}} Code < 221) {{Cl|OR (boolean)|OR}} (Code > 226 {{Cl|AND (boolean)|AND}} Code < 253) {{Cl|THEN}} + {{Cl|IF...THEN|IF}} (Code > 194 {{Cl|AND (boolean)|AND}} Code < 221) {{Cl|OR (boolean)|OR}} (Code > 226 {{Cl|AND (boolean)|AND}} Code < 253) {{Cl|THEN}} Letter$ = {{Cl|CHR$}}(Code - 130) ' change back to a Letter character {{Cl|END IF}} Send$ = Send$ + Letter$ ' reassemble string as normal letters @@ -83,4 +83,4 @@ Send$ = "" * [[ASCII|ASCII character codes]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/CINT.txt b/internal/help/CINT.txt index 0769c9ab1..21f96cc1b 100644 --- a/internal/help/CINT.txt +++ b/internal/help/CINT.txt @@ -17,7 +17,7 @@ The [[CINT]] function rounds decimal point numbers up or down to the nearest [[I {{PageExamples}} -''Example:'' Shows how CINT rounds values up or down as in "bankers' rounding". +''Example:'' Shows how CINT rounds values up or down as in "bankers' rounding". {{CodeStart}} '' '' a% = {{Cl|CINT}}(1.49): b% = {{Cl|CINT}}(1.50): c = 11.5 {{Cl|COLOR}} c: {{Cl|PRINT}} a%, b%, c '' '' @@ -32,4 +32,4 @@ a% = {{Cl|CINT}}(1.49): b% = {{Cl|CINT}}(1.50): c = 11.5 * [[INT]], [[FIX]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/CIRCLE.txt b/internal/help/CIRCLE.txt index c8aeffee5..39fd17e93 100644 --- a/internal/help/CIRCLE.txt +++ b/internal/help/CIRCLE.txt @@ -37,7 +37,7 @@ DO x& = {{Cl|_MOUSEX}} y& = {{Cl|_MOUSEY}} xy& = ((x& - cx&) ^ 2) + ((y& - cy&) ^ 2) 'Pythagorean theorem - {{Cl|IF...THEN|IF}} r& ^ 2 >= xy& {{Cl|THEN}} {{Cl|CIRCLE}} (cx&, cy&), r&, 10 {{Cl|ELSE}} {{Cl|CIRCLE}} (cx&, cy&), r&, 12 + {{Cl|IF...THEN|IF}} r& ^ 2 >= xy& {{Cl|THEN}} {{Cl|CIRCLE}} (cx&, cy&), r&, 10 {{Cl|ELSE}} {{Cl|CIRCLE}} (cx&, cy&), r&, 12 {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) 'escape key exit '' '' {{CodeEnd}} : ''Explanation:'' The square of the circle radius will be greater than or equal to the sum of the square of the mouse coordinates minus the center position when the pointer is inside of the circle. In this example the circle color will change from red to green. @@ -65,10 +65,10 @@ clockcount% = 15 'A counter to keep track of the radians {{Cl|CLS}} {{Cl|LOCATE}} 1, 1 {{Cl|COLOR}} 14, 0 -{{Cl|PRINT}} "Ritchie's Clock" +{{Cl|PRINT}} "Ritchie's Clock" {{Cl|COLOR}} 9, 0 -{{Cl|PRINT}} "Uses {{Cl|CIRCLE}} to" -{{Cl|PRINT}} "draw hands!" +{{Cl|PRINT}} "Uses {{Cl|CIRCLE}} to" +{{Cl|PRINT}} "draw hands!" {{Cl|COLOR}} 8, 0 {{Cl|CIRCLE}} (160, 100), 110, 8 'circle with radius of 110 and dark gray {{Cl|CIRCLE}} (160, 100), 102, 8 'circle with radius of 102 and dark gray @@ -88,14 +88,14 @@ minutes% = {{Cl|INT}}({{Cl|VAL}}({{Cl|MID$}}({{Cl|TIME$}}, 4, 2))) 'extract minu {{Cl|IF...THEN|IF}} minutes% = 0 {{Cl|THEN}} minutes% = 60 'array counts 1 to 60 not 0 to 59 previousminute% = minutes% 'hold current minute for later use hours% = {{Cl|INT}}({{Cl|VAL}}({{Cl|LEFT$}}({{Cl|TIME$}}, 2))) 'extract hour from {{Cl|TIME$}} -{{Cl|IF...THEN|IF}} hours% >= 12 {{Cl|THEN}} hours% = hours% - 12 'convert from military time +{{Cl|IF...THEN|IF}} hours% >= 12 {{Cl|THEN}} hours% = hours% - 12 'convert from military time {{Cl|IF...THEN|IF}} hours% = 0 {{Cl|THEN}} hours% = 12 'count from 1 to 12 not 0 to 11 previoushour% = hours% 'hold current hour for later use '* '* Start of main program loop '* {{Cl|DO}} - {{Cl|IF...THEN|IF}} seconds% <> previoussecond% {{Cl|THEN}} 'has a second elapsed? + {{Cl|IF...THEN|IF}} seconds% <> previoussecond% {{Cl|THEN}} 'has a second elapsed? {{Cl|LOCATE}} 22, 17 'print the time on the screen at {{Cl|PRINT}} {{Cl|TIME$}}; 'position 22, 17 '* Since a second has elapsed we need to erase the old second hand @@ -104,7 +104,7 @@ previoushour% = hours% 'hold current hour for later use {{Cl|CIRCLE}} (160, 100), 100, 0, -clock(previoussecond%), clock(previoussecond%) {{Cl|CIRCLE}} (160, 100), 100, 15, -clock(seconds%), clock(seconds%) previoussecond% = seconds% 'hold current second for later use - {{Cl|IF...THEN|IF}} minutes% <> previousminute% {{Cl|THEN}} 'has a minute elapsed? + {{Cl|IF...THEN|IF}} minutes% <> previousminute% {{Cl|THEN}} 'has a minute elapsed? '* Since a minute has elapsed we need to erase the old hour hand position {{Cl|CIRCLE}} (160, 100), 90, 0, -clock(previousminute%), clock(previousminute%) previousminute% = minutes% 'hold current minute for later use @@ -113,7 +113,7 @@ previoushour% = hours% 'hold current hour for later use '* Draw the current minute hand position '* {{Cl|CIRCLE}} (160, 100), 90, 14, -clock(minutes%), clock(minutes%) - {{Cl|IF...THEN|IF}} hours% <> previoushour% {{Cl|THEN}} 'has an hour elapsed? + {{Cl|IF...THEN|IF}} hours% <> previoushour% {{Cl|THEN}} 'has an hour elapsed? '* Since an hour has elapsed we need to erase the old hour hand position {{Cl|CIRCLE}} (160, 100), 75, 0, -clock(previoushour% * 5), clock(previoushour% * 5) previoushour% = hours% 'hold current hour for later use @@ -128,9 +128,9 @@ previoushour% = hours% 'hold current hour for later use minutes% = {{Cl|VAL}}({{Cl|MID$}}({{Cl|TIME$}}, 4, 2)) {{Cl|IF...THEN|IF}} minutes% = 0 {{Cl|THEN}} minutes% = 60 hours% = {{Cl|VAL}}({{Cl|LEFT$}}({{Cl|TIME$}}, 2)) - {{Cl|IF...THEN|IF}} hours% >= 12 {{Cl|THEN}} hours% = hours% - 12 + {{Cl|IF...THEN|IF}} hours% >= 12 {{Cl|THEN}} hours% = hours% - 12 {{Cl|IF...THEN|IF}} hours% = 0 {{Cl|THEN}} hours% = 12 -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" 'stop program if user presses a key '' '' +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" 'stop program if user presses a key '' '' {{CodeEnd}} {{small|code by Terry Ritchie}} @@ -142,4 +142,4 @@ previoushour% = hours% 'hold current hour for later use * [[SCREEN]], [[SCREEN (function)]] * [[Alternative circle routine]] {{text|(member-contributed program)}} -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/CLEAR.txt b/internal/help/CLEAR.txt index 05e363d1e..966abf1b6 100644 --- a/internal/help/CLEAR.txt +++ b/internal/help/CLEAR.txt @@ -7,7 +7,7 @@ The [[CLEAR]] statement clears all variable and array element values in a progra {{PageDescription}} * All parameters are optional and ignored by '''QB64'''. -* Normally used to clear all program variable and [[Arrays|array]] values where numerical values become zero and string values become empty (""). +* Normally used to clear all program variable and [[Arrays|array]] values where numerical values become zero and string values become empty (""). * It does not clear [[CONST|constant]] values. * Closes all opened files. * [[$DYNAMIC]] or [[REDIM]] arrays will need to be [[REDIM|redimensioned]] or an [[ERROR Codes|error]] will occur when referenced because they are removed. @@ -26,7 +26,7 @@ array(5) = 23 {{Cl|PRINT}} array(5) '' '' {{CodeEnd}} -:''Note:'' If you change DIM to REDIM a "Subscript out of range" error will occur because a [[$DYNAMIC]] array is removed by CLEAR. +:''Note:'' If you change DIM to REDIM a "Subscript out of range" error will occur because a [[$DYNAMIC]] array is removed by CLEAR. {{PageSeeAlso}} @@ -35,4 +35,4 @@ array(5) = 23 * [[Arrays]], [[&B|_BIT arrays]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/CLNG.txt b/internal/help/CLNG.txt index 33ab770a2..c282943bd 100644 --- a/internal/help/CLNG.txt +++ b/internal/help/CLNG.txt @@ -33,4 +33,4 @@ The [[CLNG]] function rounds decimal point numbers up or down to the nearest [[L * [[_ROUND]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/CLOSE.txt b/internal/help/CLOSE.txt index 994d1f931..88fbaf3d5 100644 --- a/internal/help/CLOSE.txt +++ b/internal/help/CLOSE.txt @@ -26,4 +26,4 @@ * [[_SNDCLOSE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/CLS.txt b/internal/help/CLS.txt index 57aebe6da..850e48ba1 100644 --- a/internal/help/CLS.txt +++ b/internal/help/CLS.txt @@ -30,7 +30,7 @@ The [[CLS]] statement clears the [[_DEST|current write page]]. {{Cl|SCREEN}} 12 {{Cl|CLS}} , 15 {{Cl|_PRINTMODE }} _KEEPBACKGROUND 'keeps the text background visible -{{Cl|COLOR}} 0: {{Cl|PRINT}} "This is black text on a white background!" +{{Cl|COLOR}} 0: {{Cl|PRINT}} "This is black text on a white background!" K$ = {{Cl|INPUT$}}(1 {{CodeEnd}} :''Explanation:'' [[_PRINTMODE]] can be used with [[PRINT]] or [[_PRINTSTRING]] to make the text or the text background transparent. @@ -40,7 +40,7 @@ K$ = {{Cl|INPUT$}}(1 {{CodeStart}} '' '' {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, 32) {{Cl|CLS}} , {{Cl|_RGB}}(0, 255, 0) -i = {{Cl|_LOADIMAGE}}('''"qb64_trans.png"''') 'see note below examples to get the image +i = {{Cl|_LOADIMAGE}}('''"qb64_trans.png"''') 'see note below examples to get the image {{Cl|_PUTIMAGE}} (0, 0), i 'places image at upper left corner of window w/o stretching it '' '' {{CodeEnd}} '' '' @@ -56,4 +56,4 @@ i = {{Cl|_LOADIMAGE}}('''"qb64_trans.png"''') 'see note below examples * [[_CLEARCOLOR]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/COLOR.txt b/internal/help/COLOR.txt index 06acc20a9..891dea6ed 100644 --- a/internal/help/COLOR.txt +++ b/internal/help/COLOR.txt @@ -36,15 +36,15 @@ The [[COLOR]] statement is used to change the foreground and background colors f * Colors can be mixed by using [[_BLEND]] (default) in 32-bit screen modes. [[_DONTBLEND]] disables blending. * '''NOTE: Default 32-bit backgrounds are clear black or [[_RGBA]](0, 0, 0, 0). Use [[CLS]] to make the black opaque.''' -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ==RGB Palette Intensities== RGB intensity values can be converted to hexadecimal values to create the [[LONG]] [[_PALETTECOLOR]] value in non-32-bit screens: {{CodeStart}} '' '' {{Cl|SCREEN}} 12 -alpha$ = "FF" 'solid alpha colors only +alpha$ = "FF" 'solid alpha colors only {{Cl|OUT}} {{Cl|&H}}3C8, 0: {{Cl|OUT}} {{Cl|&H}}3C9, 0: {{Cl|OUT}} {{Cl|&H}}3C9, 0: {{Cl|OUT}} {{Cl|&H}}3C9, 20 'set black background to dark blue -{{Cl|PRINT}} "Attribute = Hex value Red Green Blue " +{{Cl|PRINT}} "Attribute = Hex value Red Green Blue " {{Cl|PRINT}} {{Cl|COLOR}} 7 {{Cl|FOR...NEXT|FOR}} attribute = 0 {{Cl|TO}} 15 @@ -52,35 +52,35 @@ alpha$ = "FF" 'solid alpha colors only red$ = {{Cl|HEX$}}({{Cl|INP}}({{Cl|&H}}3C9) * 4) 'convert port setting to 32 bit values grn$ = {{Cl|HEX$}}({{Cl|INP}}({{Cl|&H}}3C9) * 4) blu$ = {{Cl|HEX$}}({{Cl|INP}}({{Cl|&H}}3C9) * 4) - {{Cl|IF...THEN|IF}} {{Cl|LEN}}(red$) = 1 {{Cl|THEN}} red$ = "0" + red$ '2 hex digits required - {{Cl|IF...THEN|IF}} {{Cl|LEN}}(grn$) = 1 {{Cl|THEN}} grn$ = "0" + grn$ 'for low or zero hex values - {{Cl|IF...THEN|IF}} {{Cl|LEN}}(blu$) = 1 {{Cl|THEN}} blu$ = "0" + blu$ - hex32$ = "{{Cl|&H}}" + alpha$ + red$ + grn$ + blu$ + {{Cl|IF...THEN|IF}} {{Cl|LEN}}(red$) = 1 {{Cl|THEN}} red$ = "0" + red$ '2 hex digits required + {{Cl|IF...THEN|IF}} {{Cl|LEN}}(grn$) = 1 {{Cl|THEN}} grn$ = "0" + grn$ 'for low or zero hex values + {{Cl|IF...THEN|IF}} {{Cl|LEN}}(blu$) = 1 {{Cl|THEN}} blu$ = "0" + blu$ + hex32$ = "{{Cl|&H}}" + alpha$ + red$ + grn$ + blu$ {{Cl|_PALETTECOLOR}} attribute, {{Cl|VAL}}(hex32$) 'VAL converts hex string to a LONG 32 bit value {{Cl|IF...THEN|IF}} attribute {{Cl|THEN}} {{Cl|COLOR}} attribute 'exclude black color print - {{Cl|PRINT}} "{{Cl|COLOR}}" + {{Cl|STR$}}(attribute) + " = " + hex32$, red$, grn$, blu$ 'returns closest attribute + {{Cl|PRINT}} "{{Cl|COLOR}}" + {{Cl|STR$}}(attribute) + " = " + hex32$, red$, grn$, blu$ 'returns closest attribute {{Cl|NEXT}} '' '' {{CodeEnd}} {{OutputStart}}Attribute Hex value Red Green Blue -{{text|COLOR 0 <nowiki>=</nowiki> &HFF000050 00 00 50|#A8A8A8}} -{{text|COLOR 1 <nowiki>=</nowiki> &HFF0000A8 00 00 A8|#0050A8}} -{{text|COLOR 2 <nowiki>=</nowiki> &HFF00A800 00 A8 00|#00A800}} -{{text|COLOR 3 <nowiki>=</nowiki> &HFF00A8A8 00 A8 A8|#00A8A8}} -{{text|COLOR 4 <nowiki>=</nowiki> &HFFA80000 A8 00 00|#A80000}} -{{text|COLOR 5 <nowiki>=</nowiki> &HFFA800A8 A8 00 A8|#A800A8}} -{{text|COLOR 6 <nowiki>=</nowiki> &HFFA85400 A8 54 00|#A85400}} -{{text|COLOR 7 <nowiki>=</nowiki> &HFFA8A8A8 A8 A8 A8|#A8A8A8}} -{{text|COLOR 8 <nowiki>=</nowiki> &HFF545454 54 54 54|#545454}} -{{text|COLOR 9 <nowiki>=</nowiki> &HFF5454FC 54 54 FC|#5454FC}} -{{text|COLOR 10 <nowiki>=</nowiki> &HFF54FC54 54 FC 54|#54FC54}} -{{text|COLOR 11 <nowiki>=</nowiki> &HFF5454FC 54 FC FC|#54FCFC}} -{{text|COLOR 12 <nowiki>=</nowiki> &HFFFC5454 FC 54 54|#FC5454}} -{{text|COLOR 13 <nowiki>=</nowiki> &HFFFC54FC FC 54 FC|#FC54FC}} -{{text|COLOR 14 <nowiki>=</nowiki> &HFFFCFC54 FC FC 54|#FCFC54}} -{{text|COLOR 15 <nowiki>=</nowiki> &HFFFCFCFC FC FC FC|#FCFCFC}} +{{text|COLOR 0 <nowiki>=</nowiki> &HFF000050 00 00 50|#A8A8A8}} +{{text|COLOR 1 <nowiki>=</nowiki> &HFF0000A8 00 00 A8|#0050A8}} +{{text|COLOR 2 <nowiki>=</nowiki> &HFF00A800 00 A8 00|#00A800}} +{{text|COLOR 3 <nowiki>=</nowiki> &HFF00A8A8 00 A8 A8|#00A8A8}} +{{text|COLOR 4 <nowiki>=</nowiki> &HFFA80000 A8 00 00|#A80000}} +{{text|COLOR 5 <nowiki>=</nowiki> &HFFA800A8 A8 00 A8|#A800A8}} +{{text|COLOR 6 <nowiki>=</nowiki> &HFFA85400 A8 54 00|#A85400}} +{{text|COLOR 7 <nowiki>=</nowiki> &HFFA8A8A8 A8 A8 A8|#A8A8A8}} +{{text|COLOR 8 <nowiki>=</nowiki> &HFF545454 54 54 54|#545454}} +{{text|COLOR 9 <nowiki>=</nowiki> &HFF5454FC 54 54 FC|#5454FC}} +{{text|COLOR 10 <nowiki>=</nowiki> &HFF54FC54 54 FC 54|#54FC54}} +{{text|COLOR 11 <nowiki>=</nowiki> &HFF5454FC 54 FC FC|#54FCFC}} +{{text|COLOR 12 <nowiki>=</nowiki> &HFFFC5454 FC 54 54|#FC5454}} +{{text|COLOR 13 <nowiki>=</nowiki> &HFFFC54FC FC 54 FC|#FC54FC}} +{{text|COLOR 14 <nowiki>=</nowiki> &HFFFCFC54 FC FC 54|#FCFC54}} +{{text|COLOR 15 <nowiki>=</nowiki> &HFFFCFCFC FC FC FC|#FCFCFC}} {{OutputEnd}} -:''Explanation:'' The RGB intensity values are multiplied by 4 to get the [[_RGB]] intensity values as [[HEX$|hexadecimal]] values. The individual 2 digit [[HEX$]] intensity values can be added to "&HFF" to make up the 32-bit hexadecimal string value necessary for [[VAL]] to return to [[_PALETTECOLOR]]. The statement is only included in the example to show how that can be done with any 32-bit color value. +:''Explanation:'' The RGB intensity values are multiplied by 4 to get the [[_RGB]] intensity values as [[HEX$|hexadecimal]] values. The individual 2 digit [[HEX$]] intensity values can be added to "&HFF" to make up the 32-bit hexadecimal string value necessary for [[VAL]] to return to [[_PALETTECOLOR]]. The statement is only included in the example to show how that can be done with any 32-bit color value. :'''Note:''' Black has a blue hex value of 50 due to the [[OUT]] background color setting which makes it dark blue. @@ -89,7 +89,7 @@ alpha$ = "FF" 'solid alpha colors only * The same can be achieved using [[_PALETTECOLOR]] ('''recommended practice'''). :'''{{text|OUT &H3C7, attribute|green}}''' 'Set port to read RGB settings with: -:'''{{text|color_intensity <nowiki>=</nowiki> INP(&H3C9)|green}}''' 'reads present intensity setting +:'''{{text|color_intensity <nowiki>=</nowiki> INP(&H3C9)|green}}''' 'reads present intensity setting :'''{{text|OUT &H3C8, attribute|green}}''' 'Set port to write RGB settings with: :'''{{text|OUT &H3C9, color_intensity|green}}''' 'writes new intensity setting @@ -98,7 +98,7 @@ alpha$ = "FF" 'solid alpha colors only * Color port setting of red, green and blue intensities can be done in ascending order. * Color port attribute intensity values range from 0 to 63 (1/4 of the 32-bit values) in QBasic's legacy 4 and 8 bit screen modes. -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> {{PageExamples}} @@ -134,7 +134,7 @@ alpha$ = "FF" 'solid alpha colors only ''Example 3:'' Printing in fullscreen SCREEN 0 mode with a color background under the text only. {{CodeStart}} '' '' {{Cl|SCREEN}} 0: {{Cl|_FULLSCREEN}} ' used for fullscreen instead of window -{{Cl|COLOR}} 30, 6: {{Cl|LOCATE}} 12, 4: {{Cl|PRINT}} "Hello!" '' '' +{{Cl|COLOR}} 30, 6: {{Cl|LOCATE}} 12, 4: {{Cl|PRINT}} "Hello!" '' '' {{CodeEnd}} :''Result:'' Hello! is printed in flashing high intensity yellow with brown background behind text only when in Qbasic [[_FULLSCREEN|fullscreen]]. @@ -143,7 +143,7 @@ alpha$ = "FF" 'solid alpha colors only {{CodeStart}} '' '' {{Cl|SCREEN}} 0: {{Cl|_FULLSCREEN}} {{Cl|COLOR}} , 7: {{Cl|CLS}} -{{Cl|COLOR}} 9: {{Cl|PRINT}} "Hello" '' '' +{{Cl|COLOR}} 9: {{Cl|PRINT}} "Hello" '' '' {{CodeEnd}} {{TextStart}}{{text|Hello|blue}}{{TextEnd}} :''Result:'' The blue word Hello is printed to a totally grey background in [[_FULLSCREEN|fullscreen]]. @@ -152,16 +152,16 @@ alpha$ = "FF" 'solid alpha colors only ''Example 5:'' Using a different foreground color for each letter: {{CodeStart}} '' '' {{Cl|SCREEN}} 0 -{{Cl|COLOR}} 1: {{Cl|PRINT}} "H"; -{{Cl|COLOR}} 3: {{Cl|PRINT}} "E"; -{{Cl|COLOR}} 4: {{Cl|PRINT}} "L"; -{{Cl|COLOR}} 5: {{Cl|PRINT}} "L"; -{{Cl|COLOR}} 6: {{Cl|PRINT}} "O" -{{Cl|COLOR}} 9: {{Cl|PRINT}} "W"; -{{Cl|COLOR}} 11: {{Cl|PRINT}} "O"; -{{Cl|COLOR}} 12: {{Cl|PRINT}} "R"; -{{Cl|COLOR}} 13: {{Cl|PRINT}} "L"; -{{Cl|COLOR}} 14: {{Cl|PRINT}} "D" '' '' +{{Cl|COLOR}} 1: {{Cl|PRINT}} "H"; +{{Cl|COLOR}} 3: {{Cl|PRINT}} "E"; +{{Cl|COLOR}} 4: {{Cl|PRINT}} "L"; +{{Cl|COLOR}} 5: {{Cl|PRINT}} "L"; +{{Cl|COLOR}} 6: {{Cl|PRINT}} "O" +{{Cl|COLOR}} 9: {{Cl|PRINT}} "W"; +{{Cl|COLOR}} 11: {{Cl|PRINT}} "O"; +{{Cl|COLOR}} 12: {{Cl|PRINT}} "R"; +{{Cl|COLOR}} 13: {{Cl|PRINT}} "L"; +{{Cl|COLOR}} 14: {{Cl|PRINT}} "D" '' '' {{CodeEnd}} {{OutputStart}} @@ -173,10 +173,10 @@ alpha$ = "FF" 'solid alpha colors only ''Example 6:'' Doing the same as Example 5 but in only a few lines: {{CodeStart}} '' '' {{Cl|SCREEN (statement)|SCREEN}} 0 -text$ = "HelloWorld" +text$ = "HelloWorld" {{Cl|FOR...NEXT|FOR}} textpos = 1 {{Cl|TO}} {{Cl|LEN}}(text$) {{Cl|COLOR}} textpos - {{Cl|IF...THEN|IF}} textpos <> 5 {{Cl|THEN}} {{Cl|PRINT}} {{Cl|MID$}}(text$, textpos, 1); + {{Cl|IF...THEN|IF}} textpos <> 5 {{Cl|THEN}} {{Cl|PRINT}} {{Cl|MID$}}(text$, textpos, 1); {{Cl|IF...THEN|IF}} textpos = 5 {{Cl|THEN}} {{Cl|PRINT}} {{Cl|MID$}}(text$, textpos, 1) 'start print on next row {{Cl|NEXT}} @@ -193,7 +193,7 @@ text$ = "HelloWorld" {{Cl|_PALETTECOLOR}} 0, _RGB32(255, 255, 255) 'change color 0 intensity {{Cl|_PALETTECOLOR}} 8, _RGB32(0, 0, 0) 'change color 8 intensity -{{Cl|COLOR}} 8: {{Cl|PRINT}} "Black on bright white!" '' '' +{{Cl|COLOR}} 8: {{Cl|PRINT}} "Black on bright white!" '' '' {{CodeEnd}} {{WhiteStart}}'''{{text|Black on bright white!|#000000}}''' {{WhiteEnd}} @@ -202,19 +202,21 @@ text$ = "HelloWorld" ''Example 8:'' Changing light gray text in [[SCREEN]] 0 to a 32 bit custom color using a [[LONG]] HTML hexadecimal value: -{{CodeStart}} '' '' +{{CodeStart +2b54 +}} '' '' {{Cl|COLOR}} 7 -{{Cl|PRINT}} "Color 7 is gray" +{{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! '' '' +{{Cl|PRINT}} "Color 7 is now Goldenrod in {{Cl|SCREEN}} 0! '' '' {{CodeEnd}} {{OutputStart}} {{text|Color 7 is gray|#A8A8A8}} {{text|Color 7 is now Goldenrod in SCREEN 0!|#DAA520}} {{OutputEnd}} : ''Explanation:'' [[_RGB32]] could be used to make custom 32 bit colors or HTML values could be used after &HFF for solid colors. -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> {{PageSeeAlso}} @@ -233,4 +235,4 @@ K$ = {{Cl|INPUT$}}(1) * [http://www.w3schools.com/html/html_colornames.asp Hexadecimal Color Values] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/COMMAND$.txt b/internal/help/COMMAND$.txt index dab07ba2a..b565800c5 100644 --- a/internal/help/COMMAND$.txt +++ b/internal/help/COMMAND$.txt @@ -15,20 +15,20 @@ The '''COMMAND$''' function returns the command line argument(s) passed when a p {{PageExamples}} ''Example 1:'' Compile both programs. ProgramA [[RUN]]s ProgramB with a parameter passed following the filename: {{CodeStart}} -{{Cl|LOCATE}} 12, 36: {{Cl|PRINT}} "ProgramA" +{{Cl|LOCATE}} 12, 36: {{Cl|PRINT}} "ProgramA" -{{Cl|LOCATE}} 23, 25: {{Cl|PRINT}} "Press any key to run ProgramB" +{{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 or QB4.5 +{{Cl|RUN}} "ProgramB FS" 'pass FS parameter to ProgramB in QB64 or QB4.5 {{Cl|SYSTEM}} {{CodeEnd}} : ''ProgramB'' checks for fullscreen parameter pass in QB64 and goes full screen. {{CodeStart}} '' '' -{{Cl|LOCATE}} 17, 36: {{Cl|PRINT}} "ProgramB" +{{Cl|LOCATE}} 17, 36: {{Cl|PRINT}} "ProgramB" parameter$ = {{Cl|UCASE$}}({{Cl|COMMAND$}}) 'UCASE$ is needed in QB64 only, as QB4.5 will always return upper case -{{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|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}} @@ -50,14 +50,14 @@ parameter$ = {{Cl|UCASE$}}({{Cl|COMMAND$}}) 'UCASE$ is needed in QB64 only, as Q {{OutputStart}}-1 a data file {{OutputEnd}} -: ''Explanation: If we start ''ThisProgram.exe'' with the command line '''ThisProgram -l "a data file"''', COMMAND$ will return a single string of "-1 a data file" which might be hard to process and interpret properly, but COMMAND$(1) would return "-l" and COMMAND$(2) would return the quoted "a data file" option as separate entries for easier parsing and processing. +: ''Explanation: If we start ''ThisProgram.exe'' with the command line '''ThisProgram -l "a data file"''', COMMAND$ will return a single string of "-1 a data file" which might be hard to process and interpret properly, but COMMAND$(1) would return "-l" and COMMAND$(2) would return the quoted "a data file" option as separate entries for easier parsing and processing. ''Example 3:'' As part of the command array syntax, you can also just read the array to see how many commands were sent (or simply check [[_COMMANDCOUNT]]): {{CodeStart}}DO count = count + 1 cmd$ = {{Cl|COMMAND$}}(count) - {{Cl|IF...THEN|IF}} cmd$ = "" {{Cl|THEN}} {{Cl|EXIT DO}} 'read until an empty return + {{Cl|IF...THEN|IF}} cmd$ = "" {{Cl|THEN}} {{Cl|EXIT DO}} 'read until an empty return {{Cl|PRINT}} cmd$ 'or process commands sent {{Cl|LOOP}} '' '' count = count - 1 'save the number of parameters sent to this program when run @@ -70,4 +70,4 @@ count = count - 1 'save the number of parameters sent to this program when run * [[_COMMANDCOUNT]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/COMMON.txt b/internal/help/COMMON.txt index f47d13f54..e0868ce66 100644 --- a/internal/help/COMMON.txt +++ b/internal/help/COMMON.txt @@ -22,4 +22,4 @@ * [[DIM]], [[REDIM]], [[SHARED]] * [[DEFSTR]], [[DEFLNG]], [[DEFINT]], [[DEFSNG]], [[DEFDBL]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/CONST.txt b/internal/help/CONST.txt index 3692ea83e..c7b1bad97 100644 --- a/internal/help/CONST.txt +++ b/internal/help/CONST.txt @@ -29,11 +29,11 @@ The [[CONST]] statement globally defines one or more named numeric or string val {{Cl|CONST}} PI = 3.141593 ' Declare some string constants: -{{Cl|CONST}} circumferenceText = "The circumference of the circle is" -{{Cl|CONST}} areaText = "The area of the circle is" +{{Cl|CONST}} circumferenceText = "The circumference of the circle is" +{{Cl|CONST}} areaText = "The area of the circle is" {{Cl|DO...LOOP|DO}} - {{Cl|INPUT}} "Enter the radius of a circle or zero to quit"; radius + {{Cl|INPUT}} "Enter the radius of a circle or zero to quit"; radius {{Cl|IF...THEN|IF}} radius = 0 {{Cl|IF...THEN|THEN}} {{Cl|END}} {{Cl|PRINT}} circumferenceText; 2 * PI * radius {{Cl|PRINT}} areaText; PI * radius * radius ' radius squared @@ -58,7 +58,7 @@ Enter the radius of a circle or zero to quit? ''0'' {{Cl|CONST}} Red = _RGB32(255,0,0) {{Cl|COLOR}} Red -{{Cl|PRINT}} "Hello World" +{{Cl|PRINT}} "Hello World" {{CodeEnd}} {{PageSeeAlso}} @@ -68,4 +68,4 @@ Enter the radius of a circle or zero to quit? ''0'' * [http://doc.pcsoft.fr/en-US/?6510001 Windows 32 API constant values] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/COS.txt b/internal/help/COS.txt index 05212f301..c8100aec8 100644 --- a/internal/help/COS.txt +++ b/internal/help/COS.txt @@ -21,20 +21,20 @@ The [[COS]] function returns the horizontal component or the cosine of an angle {{CodeStart}} '' '' {{Cl|SCREEN}} 12 PI = 4 * {{Cl|ATN}}(1) -{{Cl|PRINT}} "PI = 4 * {{Cl|ATN}}(1) ="; PI -{{Cl|PRINT}} "COS(PI) = "; {{Cl|COS}}(PI) -{{Cl|PRINT}} "SIN(PI) = "; {{Cl|SIN}}(PI) +{{Cl|PRINT}} "PI = 4 * {{Cl|ATN}}(1) ="; PI +{{Cl|PRINT}} "COS(PI) = "; {{Cl|COS}}(PI) +{{Cl|PRINT}} "SIN(PI) = "; {{Cl|SIN}}(PI) {{Cl|DO...LOOP|DO}} {{Cl|PRINT}} - {{Cl|INPUT}} "Enter the degree angle (0 quits): ", DEGREES% + {{Cl|INPUT}} "Enter the degree angle (0 quits): ", DEGREES% RADIANS = DEGREES% * PI / 180 - {{Cl|PRINT}} "RADIANS = DEGREES% * PI / 180 = "; RADIANS - {{Cl|PRINT}} "X = COS(RADIANS) = "; {{Cl|COS}}(RADIANS) - {{Cl|PRINT}} "Y = SIN(RADIANS) = "; {{Cl|SIN}}(RADIANS) + {{Cl|PRINT}} "RADIANS = DEGREES% * PI / 180 = "; RADIANS + {{Cl|PRINT}} "X = COS(RADIANS) = "; {{Cl|COS}}(RADIANS) + {{Cl|PRINT}} "Y = SIN(RADIANS) = "; {{Cl|SIN}}(RADIANS) {{Cl|CIRCLE}} (400, 240), 2, 12 {{Cl|LINE}} (400, 240)-(400 + (50 * {{Cl|SIN}}(RADIANS)), 240 + (50 * {{Cl|COS}}(RADIANS))), 11 DEGREES% = RADIANS * 180 / PI - {{Cl|PRINT}} "DEGREES% = RADIANS * 180 / PI ="; DEGREES% + {{Cl|PRINT}} "DEGREES% = RADIANS * 180 / PI ="; DEGREES% {{Cl|LOOP}} {{Cl|UNTIL}} DEGREES% = 0 '' '' {{CodeEnd}} {{OutputStart}} @@ -103,4 +103,4 @@ DEGREES% = RADIANS * 180 / PI = 45 *[[Mathematical_Operations#Derived_Mathematical_Functions|Derived Mathematical Functions]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/CSNG.txt b/internal/help/CSNG.txt index 94004eb2f..213be0db8 100644 --- a/internal/help/CSNG.txt +++ b/internal/help/CSNG.txt @@ -29,4 +29,4 @@ * [[_ROUND]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/CSRLIN.txt b/internal/help/CSRLIN.txt index 5809f5774..910050e30 100644 --- a/internal/help/CSRLIN.txt +++ b/internal/help/CSRLIN.txt @@ -17,12 +17,12 @@ The [[CSRLIN]] function returns the current text row position of the [[PRINT]] c {{PageExamples}} ''Example:'' A semicolon stops the print cursor immediately after the print. {{CodeStart}} '' '' - LOCATE 5, 5: PRINT "HELLO "; + LOCATE 5, 5: PRINT "HELLO "; Y = {{Cl|CSRLIN}} 'save the row X = {{Cl|POS}}(0) 'save the column - LOCATE 10, 10: PRINT "WORLD" + LOCATE 10, 10: PRINT "WORLD" LOCATE Y, X 'restore saved position - PRINT "GOODBYE" '' '' + PRINT "GOODBYE" '' '' {{CodeEnd}} {{OutputStart}} @@ -39,7 +39,7 @@ The [[CSRLIN]] function returns the current text row position of the [[PRINT]] c {{OutputEnd}} -:''Explanation:'' "HELLO " is printed and the semicolon stops the cursor immediately after the text. The [[CSRLIN]] variable records the current print cursor's text row in Y. The [[POS]] function records the current print cursor's text column in X. The second [[PRINT]] statement displays the comment "WORLD" on the 10th line of the screen. The last [[LOCATE]] statement restores the position of the cursor to the original line and column immediately after the first print. +:''Explanation:'' "HELLO " is printed and the semicolon stops the cursor immediately after the text. The [[CSRLIN]] variable records the current print cursor's text row in Y. The [[POS]] function records the current print cursor's text column in X. The second [[PRINT]] statement displays the comment "WORLD" on the 10th line of the screen. The last [[LOCATE]] statement restores the position of the cursor to the original line and column immediately after the first print. {{PageSeeAlso}} @@ -47,4 +47,4 @@ The [[CSRLIN]] function returns the current text row position of the [[PRINT]] c * [[_PRINTSTRING]] (graphic print) -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/CVD.txt b/internal/help/CVD.txt index 992b544c5..cd87986f1 100644 --- a/internal/help/CVD.txt +++ b/internal/help/CVD.txt @@ -25,10 +25,10 @@ Y# = {{Cl|CVD}}(N$) '' '' ''Example 2:'' Showcases the reduced space to store an encoded number. {{CodeStart}} a# = 77000.24523213 -{{Cl|PRINT}} "Value of a#:"; a# +{{Cl|PRINT}} "Value of a#:"; a# b$ = {{Cl|MKD$}}(a#) -{{Cl|PRINT}} "Value of a# encoded using MKD$: "; b$ -{{Cl|PRINT}} "The string above, decoded using CVD:"; {{Cl|CVD}}(b$) +{{Cl|PRINT}} "Value of a# encoded using MKD$: "; b$ +{{Cl|PRINT}} "The string above, decoded using CVD:"; {{Cl|CVD}}(b$) {{CodeEnd}} {{OutputStart}} Value of a#: 77000.24523213 @@ -47,4 +47,4 @@ The string above, decoded using CVD: 77000.24523213 * [[_CV]], [[_MK$]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/CVDMBF.txt b/internal/help/CVDMBF.txt index 19e712572..981f826cd 100644 --- a/internal/help/CVDMBF.txt +++ b/internal/help/CVDMBF.txt @@ -15,10 +15,10 @@ The [[CVDMBF]] function decodes an 8-byte [[STRING]] generated by [[MKDMBF$]] (o ''Example 1:'' Showcases the reduced space to store an encoded number. {{CodeStart}} a# = 77000.24523213 -{{Cl|PRINT}} "Value of a#:"; a# +{{Cl|PRINT}} "Value of a#:"; a# b$ = {{Cl|MKDMBF$}}(a#) -{{Cl|PRINT}} "Value of a# encoded using MKDMBF$: "; b$ -{{Cl|PRINT}} "The string above, decoded using CVDMBF:"; {{Cl|CVDMBF}}(b$) +{{Cl|PRINT}} "Value of a# encoded using MKDMBF$: "; b$ +{{Cl|PRINT}} "The string above, decoded using CVDMBF:"; {{Cl|CVDMBF}}(b$) {{CodeEnd}} {{OutputStart}} Value of a#: 77000.24523213 @@ -36,4 +36,4 @@ The string above, decoded using CVDMBF: 77000.24523213 * [[_CV]], [[_MK$]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/CVI.txt b/internal/help/CVI.txt index e9cac43b8..52b86b7e1 100644 --- a/internal/help/CVI.txt +++ b/internal/help/CVI.txt @@ -29,31 +29,31 @@ Y = {{Cl|CVI}}(N$) '' '' {{Cl|DIM}} Q {{Cl|AS}} {{Cl|STRING}} * 1 Q = {{Cl|CHR$}}(34) ' create Print using templates to align the values returned -tmp1$ = "1st character code = ### * 1 = ### " -tmp2$ = "2nd character code = ### * 256 = ##### " -tmp3$ = " & " -tmp4$ = " CVI Total = ##### " +tmp1$ = "1st character code = ### * 1 = ### " +tmp2$ = "2nd character code = ### * 256 = ##### " +tmp3$ = " & " +tmp4$ = " CVI Total = ##### " {{Cl|DO...LOOP|DO}} - {{Cl|COLOR}} 14: {{Cl|LOCATE}} 13, 20: {{Cl|INPUT}} "Enter an Integer from 1 to 32767(0 quits): ", number% + {{Cl|COLOR}} 14: {{Cl|LOCATE}} 13, 20: {{Cl|INPUT}} "Enter an Integer from 1 to 32767(0 quits): ", number% {{Cl|IF...THEN|IF}} number% < 1 {{Cl|THEN}} {{Cl|EXIT DO}} {{Cl|CLS}} ASCII$ = {{Cl|MKI$}}(number%) ' create the 2 byte character string {{Cl|COLOR}} 11 - {{Cl|_PRINTSTRING}} (152, 240), "{{Cl|MKI$}} creates 2 byte ASCII string: " + Q + ASCII$ + Q ' displays character(s) + {{Cl|_PRINTSTRING}} (152, 240), "{{Cl|MKI$}} creates 2 byte ASCII string: " + Q + ASCII$ + Q ' displays character(s) asc1% = {{Cl|ASC}}(ASCII$) ' find the ASCII code values of each character asc2% = {{Cl|ASC}}(ASCII$, 2) ' '''QB64''' allows ASC to read specific characters in a string {{Cl|LOCATE}} 18, 20: {{Cl|PRINT USING}} tmp1$; asc1%; asc1% {{Cl|LOCATE}} 19, 20: {{Cl|PRINT USING}} tmp2$; asc2%; asc2% * 256 - {{Cl|LOCATE}} 20, 20: {{Cl|PRINT USING}} tmp3$; "-----" + {{Cl|LOCATE}} 20, 20: {{Cl|PRINT USING}} tmp3$; "-----" {{Cl|LOCATE}} 21, 20: {{Cl|PRINT USING}} tmp4$; asc1% + (256 * asc2%) {{Cl|LOOP}} {{Cl|SYSTEM}} '' '' {{CodeEnd}} {{small|Code by Ted Weissgerber}} -:''Explanation:'' All [[ASCII]] characters can be displayed using [[_PRINTSTRING]] . The routine gets the [[ASCII]] code, which is the actual value needed by [[CVI]]. The first byte code is always between 0 and 255. The second byte can return 0 thru 127 and CVI multiplies that value by 256. This proves that you cannot just feed a string number value to [[CVI]] and get the result desired. ("90" gets decoded to 12345). +:''Explanation:'' All [[ASCII]] characters can be displayed using [[_PRINTSTRING]] . The routine gets the [[ASCII]] code, which is the actual value needed by [[CVI]]. The first byte code is always between 0 and 255. The second byte can return 0 thru 127 and CVI multiplies that value by 256. This proves that you cannot just feed a string number value to [[CVI]] and get the result desired. ("90" gets decoded to 12345). {{PageSeeAlso}} @@ -62,4 +62,4 @@ tmp4$ = " CVI Total = ##### " * [[_CV]], [[_MK$]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/CVL.txt b/internal/help/CVL.txt index 790b3f58b..93570f9f9 100644 --- a/internal/help/CVL.txt +++ b/internal/help/CVL.txt @@ -39,4 +39,4 @@ Y& = {{Cl|CVL}}(N$) '' '' * [[_CV]], [[_MK$]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/CVS.txt b/internal/help/CVS.txt index 6c493a8c6..eb92a480c 100644 --- a/internal/help/CVS.txt +++ b/internal/help/CVS.txt @@ -15,10 +15,10 @@ The [[CVS]] function decodes a 4-byte [[STRING]] generated by [[MKS$]] (or read ''Example 1:'' Showcases the reduced space to store an encoded number. {{CodeStart}} a! = 700.2213 -{{Cl|PRINT}} "Value of a!:"; a! +{{Cl|PRINT}} "Value of a!:"; a! b$ = {{Cl|MKDMBF$}}(a!) -{{Cl|PRINT}} "Value of a# encoded using MKS$: "; b$ -{{Cl|PRINT}} "The string above, decoded using CVS:"; {{Cl|CVS}}(b$) +{{Cl|PRINT}} "Value of a# encoded using MKS$: "; b$ +{{Cl|PRINT}} "The string above, decoded using CVS:"; {{Cl|CVS}}(b$) {{CodeEnd}} {{OutputStart}} Value of a!: 700.2213 @@ -34,4 +34,4 @@ The string above, decoded using CVS: 700.2213 * [[_CV]], [[_MK$]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/CVSMBF.txt b/internal/help/CVSMBF.txt index 5ac039c51..58711f7b4 100644 --- a/internal/help/CVSMBF.txt +++ b/internal/help/CVSMBF.txt @@ -15,10 +15,10 @@ The [[CVDMBF]] function decodes a 4-byte [[STRING]] generated by [[MKSMBF$]] (or ''Example 1:'' Showcases the reduced space to store an encoded number. {{CodeStart}} a! = 700.2213 -{{Cl|PRINT}} "Value of a!:"; a! +{{Cl|PRINT}} "Value of a!:"; a! b$ = {{Cl|MKSMBF$}}(a!) -{{Cl|PRINT}} "Value of a! encoded using MKSMBF$: "; b$ -{{Cl|PRINT}} "The string above, decoded using CVSMBF:"; {{Cl|CVDMBF}}(b$) +{{Cl|PRINT}} "Value of a! encoded using MKSMBF$: "; b$ +{{Cl|PRINT}} "The string above, decoded using CVSMBF:"; {{Cl|CVDMBF}}(b$) {{CodeEnd}} {{OutputStart}} Value of a!: 700.2213 @@ -34,4 +34,4 @@ The string above, decoded using CVSMBF: 700.2213 * [[_CV]], [[_MK$]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/Colon.txt b/internal/help/Colon.txt index 0d4eb4c99..8e5dcda5f 100644 --- a/internal/help/Colon.txt +++ b/internal/help/Colon.txt @@ -1,7 +1,7 @@ A '''colon''' can be used to separate two unrelated procedure statements on the same line. -''Usage:'' COLOR 10: PRINT "Hello "; : COLOR 12: PRINT "World" +''Usage:'' COLOR 10: PRINT "Hello "; : COLOR 12: PRINT "World" {{OutputStart}} {{text|Hello |limegreen}}{{text|World|red}} @@ -19,4 +19,4 @@ A '''colon''' can be used to separate two unrelated procedure statements on the * [[Comma]], [[Semicolon]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/DATA.txt b/internal/help/DATA.txt index d189b8875..6dc6cd064 100644 --- a/internal/help/DATA.txt +++ b/internal/help/DATA.txt @@ -17,7 +17,7 @@ The [[DATA]] statement creates a line of fixed program information separated by * [[STRING]] DATA values with end spaces, QBasic keywords and values that include the comma character must be enclosed in quotation marks. * DATA fields can only be created by the programmer and cannot be changed by a user or lost. * Comments after a data line require a colon before the comment. -* If a [[READ]] statement attempts to read past the last data value, an [[ERROR Codes|"Out of Data" error]] will occur. Use end of data markers when necessary. +* If a [[READ]] statement attempts to read past the last data value, an [[ERROR Codes|"Out of Data" error]] will occur. Use end of data markers when necessary. * '''[[DATA]] fields can be placed after [[SUB]] or [[FUNCTION]] procedures, but line labels are not allowed.''' @@ -41,7 +41,7 @@ Database1: {{Cl|DATA}} 2, 0, 0, 2, 2, 0, 2, 2, 2 : ' DATA line comments require a colon Database2: -{{Cl|DATA}} "Hello, ", "world! ", Goodbye, work! '' '' +{{Cl|DATA}} "Hello, ", "world! ", Goodbye, work! '' '' {{CodeEnd}} {{OutputStart}}Hello world! Goodbyework! 1 0 0 1 1 0 1 1 1 2 0 0 2 2 0 2 2 2 @@ -78,4 +78,4 @@ mydata2: * [[SUB]], [[FUNCTION]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/DATE$.txt b/internal/help/DATE$.txt index 6aa0a7c99..3a09420d8 100644 --- a/internal/help/DATE$.txt +++ b/internal/help/DATE$.txt @@ -1,4 +1,4 @@ -The [[DATE$]] function returns the current computer date as a string in the format "mm-dd-yyyy". +The [[DATE$]] function returns the current computer date as a string in the format "mm-dd-yyyy". {{PageSyntax}} @@ -6,7 +6,7 @@ The [[DATE$]] function returns the current computer date as a string in the form {{PageDescription}} -* Returns the current computer date in the format "mm-dd-yyyy" (e.g., "12-25-2009"). +* Returns the current computer date in the format "mm-dd-yyyy" (e.g., "12-25-2009"). {{PageExamples}} @@ -18,20 +18,20 @@ day$ = {{Cl|MID$}}({{Cl|DATE$}}, 4, 2): D = {{Cl|VAL}}(day$) day$ = {{Cl|STR$}}(D) ' eliminate any leading zeros year$ = {{Cl|RIGHT$}}({{Cl|DATE$}}, 4): Y = {{Cl|VAL}}(year$) {{Cl|SELECT CASE}} M - {{Cl|CASE}} 1: Moon$ = "January" - {{Cl|CASE}} 2: Moon$ = "February" - {{Cl|CASE}} 3: Moon$ = "March" - {{Cl|CASE}} 4: Moon$ = "April" - {{Cl|CASE}} 5: Moon$ = "May" - {{Cl|CASE}} 6: Moon$ = "June" - {{Cl|CASE}} 7: Moon$ = "July" - {{Cl|CASE}} 8: Moon$ = "August" - {{Cl|CASE}} 9: Moon$ = "September" - {{Cl|CASE}} 10: Moon$ = "October" - {{Cl|CASE}} 11: Moon$ = "November" - {{Cl|CASE}} 12: Moon$ = "December" + {{Cl|CASE}} 1: Moon$ = "January" + {{Cl|CASE}} 2: Moon$ = "February" + {{Cl|CASE}} 3: Moon$ = "March" + {{Cl|CASE}} 4: Moon$ = "April" + {{Cl|CASE}} 5: Moon$ = "May" + {{Cl|CASE}} 6: Moon$ = "June" + {{Cl|CASE}} 7: Moon$ = "July" + {{Cl|CASE}} 8: Moon$ = "August" + {{Cl|CASE}} 9: Moon$ = "September" + {{Cl|CASE}} 10: Moon$ = "October" + {{Cl|CASE}} 11: Moon$ = "November" + {{Cl|CASE}} 12: Moon$ = "December" {{Cl|END SELECT}} -{{Cl|PRINT}} "Today is " + WeekDay$(M, D, Y) + ", " + Moon$ + day$ + ", " + year$ + {{Cl|SPACE$}}(10) +{{Cl|PRINT}} "Today is " + WeekDay$(M, D, Y) + ", " + Moon$ + day$ + ", " + year$ + {{Cl|SPACE$}}(10) {{Cl|DEFINT}} A-Z {{Cl|FUNCTION}} WeekDay$ (M, D, Y) @@ -43,13 +43,13 @@ S3 = 26 * (M + 1) \ 10 'days in months WkDay = (S1 + S2 + S3 + D) {{Cl|MOD}} 7 'weekday total remainder {{Cl|IF}} WkDay < 0 {{Cl|THEN}} WkDay = WkDay + 7 'Adjust negative results to 0 to 6 {{Cl|SELECT CASE}} WkDay - {{Cl|CASE}} 0: day$ = "Sunday" - {{Cl|CASE}} 1: day$ = "Monday" - {{Cl|CASE}} 2: day$ = "Tuesday" - {{Cl|CASE}} 3: day$ = "Wednesday" - {{Cl|CASE}} 4: day$ = "Thursday" - {{Cl|CASE}} 5: day$ = "Friday" - {{Cl|CASE}} 6: day$ = "Saturday" + {{Cl|CASE}} 0: day$ = "Sunday" + {{Cl|CASE}} 1: day$ = "Monday" + {{Cl|CASE}} 2: day$ = "Tuesday" + {{Cl|CASE}} 3: day$ = "Wednesday" + {{Cl|CASE}} 4: day$ = "Thursday" + {{Cl|CASE}} 5: day$ = "Friday" + {{Cl|CASE}} 6: day$ = "Saturday" {{Cl|END SELECT}} WeekDay$ = day$ {{Cl|END FUNCTION}} '' '' @@ -67,4 +67,4 @@ Today is Wednesday, June 2, 2010 -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/DATE$_(statement).txt b/internal/help/DATE$_(statement).txt index 620b87373..5bd86bb06 100644 --- a/internal/help/DATE$_(statement).txt +++ b/internal/help/DATE$_(statement).txt @@ -14,7 +14,7 @@ The [[DATE$]] statement sets the current computer date to another [[STRING]] val ::::mm/dd/yyyy * String expression or variable must contain the month, day and 4 digit year to be changed (10 valid characters). -* If value is not a valid formatted string, a "Type Mismatch" error results. The previous DATE$ value will be retained. +* If value is not a valid formatted string, a "Type Mismatch" error results. The previous DATE$ value will be retained. * The current date (as assigned when the operating system was initialized) can be saved to restore later with the [[DATE$]] function. *The DATE$ function returns a 10-character string in the form ''mm-dd-yyyy''. ''mm'' is the month (01 to 12), ''dd'' is the day (01 to 31), and ''yyyy'' is the four digit year. * '''Note: Some systems may not allow the DATE to be reset or require Administrator privileges.''' Try a batch file or [[SHELL]]. @@ -26,9 +26,9 @@ The [[DATE$]] statement sets the current computer date to another [[STRING]] val {{CodeStart}} today$ = {{Cl|DATE$}} ' function saves current computer date value PRINT today$ ' verify actual date - {{Cl|DATE$ (statement)|DATE$}} = "12-25-2000" ' literal statement changes date + {{Cl|DATE$ (statement)|DATE$}} = "12-25-2000" ' literal statement changes date PRINT {{Cl|DATE$}} ' verify new date setting - {{Cl|SHELL}} "CMD /C " + programfile$ 'run old program + {{Cl|SHELL}} "CMD /C " + programfile$ 'run old program K$ = {{Cl|INPUT$}}(1) ' press a key DATE$ = today$ ' statement resets computer to original date later in program PRINT {{Cl|DATE$}} ' verify present setting @@ -46,4 +46,4 @@ The [[DATE$]] statement sets the current computer date to another [[STRING]] val [[DATE$]], [[TIME$]], [[TIME$ (statement)]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/DECLARE.txt b/internal/help/DECLARE.txt index e70c70900..12e928958 100644 --- a/internal/help/DECLARE.txt +++ b/internal/help/DECLARE.txt @@ -28,4 +28,4 @@ The '''DECLARE''' statement is used to tell Qbasic that a [[SUB]] or [[FUNCTION] * [[DECLARE LIBRARY]] (QB64 ONLY) -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/DECLARE_(non-BASIC_statement).txt b/internal/help/DECLARE_(non-BASIC_statement).txt index fb697add5..6a593c111 100644 --- a/internal/help/DECLARE_(non-BASIC_statement).txt +++ b/internal/help/DECLARE_(non-BASIC_statement).txt @@ -8,7 +8,7 @@ Declares calling sequences for external procedures written in other languages. {{PageSyntax}} -: [[DECLARE]] {[[SUB]]|[[FUNCTION]]} name [ [[CDECL]] ] [ [[ALIAS]] "aliasname"] [([parameterlist, ...])] +: [[DECLARE]] {[[SUB]]|[[FUNCTION]]} name [ [[CDECL]] ] [ [[ALIAS]] "aliasname"] [([parameterlist, ...])] * [[CDECL]] indicates that the procedure uses the C language argument order. @@ -25,4 +25,4 @@ Declares calling sequences for external procedures written in other languages. -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/DECLARE_DYNAMIC_LIBRARY.txt b/internal/help/DECLARE_DYNAMIC_LIBRARY.txt index 8f524cd11..0430a3ed8 100644 --- a/internal/help/DECLARE_DYNAMIC_LIBRARY.txt +++ b/internal/help/DECLARE_DYNAMIC_LIBRARY.txt @@ -2,7 +2,7 @@ {{PageSyntax}} -: DECLARE [DYNAMIC|CUSTOMTYPE|STATIC] LIBRARY [''"DLL_Library_file"'', "other_library..."] +: DECLARE [DYNAMIC|CUSTOMTYPE|STATIC] LIBRARY [''"DLL_Library_file"'', "other_library..."] : {SUB|FUNCTION} [''procedure_name'' ALIAS] ''library_procedure'' (BYVAL ''parameter(s)'',...) ::. ::. 'other Library sub-procedures for named ''DLL'' @@ -35,10 +35,10 @@ {{PageExamples}} ''Example 1:'' This example plays Midi files using the ''playmidi32.dll'' documented here: [http://libertybasicuniversity.com/lbnews/nl110/midi3.htm Liberty Basic University].                         Download the following DLL file to your main QB64 folder: [http://www.qb64.net/playmidi32.dll PlayMidi32.dll] {{CodeStart}} '' '' -{{Cl|DECLARE DYNAMIC LIBRARY}} "playmidi32" +{{Cl|DECLARE DYNAMIC LIBRARY}} "playmidi32" {{Cl|FUNCTION}} PlayMIDI& (filename {{Cl|AS}} {{Cl|STRING}}) {{Cl|DECLARE LIBRARY|END DECLARE}} -result = PlayMIDI(".\samples\qb64\original\ps2battl.mid" + {{Cl|CHR$}}(0)) +result = PlayMIDI(".\samples\qb64\original\ps2battl.mid" + {{Cl|CHR$}}(0)) {{Cl|PRINT}} result {{CodeEnd}} : '''Note:''' Filename needs to be [[CHR$]](0) terminated. QB64 [[STRING]]s are passed to external libraries as pointers to first character. @@ -57,14 +57,14 @@ result = PlayMIDI(".\samples\qb64\original\ps2battl.mid" + {{Cl|CHR$}} FileName$ = {{Cl|SPACE$}}(512) Result = GetModuleFileNameA(0, FileName$, {{Cl|LEN}}(FileName$)) -{{Cl|IF...THEN|IF}} Result {{Cl|THEN}} {{Cl|PRINT}} "CURRENT PROGRAM (ASCII): "; {{Cl|LEFT$}}(FileName$, Result) +{{Cl|IF...THEN|IF}} Result {{Cl|THEN}} {{Cl|PRINT}} "CURRENT PROGRAM (ASCII): "; {{Cl|LEFT$}}(FileName$, Result) 'load a unicode font -f = {{Cl|_LOADFONT}}("cyberbit.ttf", 24, "UNICODE") +f = {{Cl|_LOADFONT}}("cyberbit.ttf", 24, "UNICODE") {{Cl|_FONT}} f Result = GetModuleFileNameW(0, FileName$, {{Cl|LEN}}(FileName$) \ 2) {{Cl|LOCATE}} 2, 1 -{{Cl|PRINT}} QuickCP437toUTF32$("CURRENT PROGRAM (UTF): ") + QuickUTF16toUTF32$({{Cl|LEFT$}}(FileName$, Result * 2)) +{{Cl|PRINT}} QuickCP437toUTF32$("CURRENT PROGRAM (UTF): ") + QuickUTF16toUTF32$({{Cl|LEFT$}}(FileName$, Result * 2)) {{Cl|_FONT}} 16 'restore CP437 font {{Cl|FUNCTION}} QuickCP437toUTF32$ (a$) @@ -85,11 +85,11 @@ QuickUTF16toUTF32$ = b$ {{Cl|END FUNCTION}} '' '' {{CodeEnd}} {{small|Code by Galleon}} -: '''Note:''' SUB procedures using CUSTOMTYPE LIBRARY API procedures inside may error. Try DYNAMIC with "KERNEL32". +: '''Note:''' SUB procedures using CUSTOMTYPE LIBRARY API procedures inside may error. Try DYNAMIC with "KERNEL32". -<center>'''QB64 version 1.000 and up produce standalone executables. External DLL files must be distributed with your program.'''</center> -<center>'''Note: QB64 versions prior to 1.000 require all default DLL files to either be with the program or in the C:\WINDOWS\SYSTEM32 folder.'''</center> +<center>'''QB64 version 1.000 and up produce standalone executables. External DLL files must be distributed with your program.'''</center> +<center>'''Note: QB64 versions prior to 1.000 require all default DLL files to either be with the program or in the C:\WINDOWS\SYSTEM32 folder.'''</center> ''See also:'' @@ -101,4 +101,4 @@ QuickUTF16toUTF32$ = b$ * [[Port Access Libraries]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/DECLARE_LIBRARY.txt b/internal/help/DECLARE_LIBRARY.txt index 3026cc6d4..6a7578b3f 100644 --- a/internal/help/DECLARE_LIBRARY.txt +++ b/internal/help/DECLARE_LIBRARY.txt @@ -2,7 +2,7 @@ The '''DECLARE LIBRARY''' declaration allows the use of external library [[SUB]] {{PageSyntax}} -: '''DECLARE''' [DYNAMIC|CUSTOMTYPE|STATIC] '''LIBRARY''' [{''"Library_filename"''|''"Headerfile"''}] +: '''DECLARE''' [DYNAMIC|CUSTOMTYPE|STATIC] '''LIBRARY''' [{''"Library_filename"''|''"Headerfile"''}] : {[[SUB]]|[[FUNCTION]]} [''procedure_name'' {{KW|ALIAS}}] ''library_procedure'' ([{{KW|BYVAL}}] ''parameter {{KW|AS}}'', ...) ::. ::. 'other SUBs or Functions as required @@ -60,7 +60,7 @@ SDL_WarpMouse x, y 'call SDL library procedure {{small|Code by Galleon}} :''Explanation:'' The SDL Library is included and loaded with QB64 versions prior to 1.000, so these procedures are directly available for use. -<center>'''Using [[ALIAS]] to create a program SUB or FUNCTION''' using '''QB64 SDL ONLY'''</center> +<center>'''Using [[ALIAS]] to create a program SUB or FUNCTION''' using '''QB64 SDL ONLY'''</center> {{CodeStart}} '' '' {{Cl|SCREEN}} 12 {{Cl|DECLARE LIBRARY}} @@ -77,18 +77,18 @@ MouseMove 200, 200 '' '' ''Example 2:'' Don't know if a C function is defined by C++ or QB64? Try using empty quotes. {{CodeStart}} '' '' -{{Cl|DECLARE LIBRARY}} "" +{{Cl|DECLARE LIBRARY}} "" {{Cl|FUNCTION}} addone& ({{Cl|BYVAL}} value&) {{Cl|END}} DECLARE '' '' {{CodeEnd}} -:''Explanation:'' The C function 'addone' exists in a library QB64 already links to, but it hasn't been defined as a C function or a QB64 function. By using "" we are telling QB64 the function exists in a library which is already linked to and that it must define the C function before calling it, as well as allowing QB64 code to call it. Trying the above code without the "" will fail. +:''Explanation:'' The C function 'addone' exists in a library QB64 already links to, but it hasn't been defined as a C function or a QB64 function. By using "" we are telling QB64 the function exists in a library which is already linked to and that it must define the C function before calling it, as well as allowing QB64 code to call it. Trying the above code without the "" will fail. : '''Note: What libraries are or aren't automatically used in the linking process is not formally defined, nor is it guaranteed to stay that way in future versions of QB64.''' ''Example 3:'' For this next example, download the file 'add.lib' and place it in you QB64 folder: http://www.qb64.net/add.lib {{CodeStart}} '' '' -{{Cl|DECLARE LIBRARY}} "add" +{{Cl|DECLARE LIBRARY}} "add" {{Cl|FUNCTION}} addtwo& ({{Cl|BYVAL}} value&) {{Cl|END}} DECLARE PRINT addtwo(1) '' '' @@ -99,26 +99,26 @@ PRINT addtwo(1) '' '' ''Example 4:'' NTport is a commercial library hosted at http://www.zealsoftstudio.com/ntport/, but it does provide an evaluation version (it has a 3 second wait pop-up window) which we will use here. You don't need to download NTport, just download the following 3 files and put them in your QB64 folder: -<center>[http://www.qb64.net/ntport/ntport.lib NTport.lib]            [http://www.qb64.net/ntport/ntport.h NTport.h]               [http://www.qb64.net/ntport/ntport.dll Ntport.dll]</center> +<center>[http://www.qb64.net/ntport/ntport.lib NTport.lib]            [http://www.qb64.net/ntport/ntport.h NTport.h]               [http://www.qb64.net/ntport/ntport.dll Ntport.dll]</center> :'''IMPORTANT:''' The DLL is loaded automatically by the static library, we are not linking directly to the DLL, we are '''static linking''' (NOT directly or dynamically linking). This is an important concept to understand! {{CodeStart}} -DECLARE LIBRARY "ntport" +DECLARE LIBRARY "ntport" FUNCTION GetLPTPortAddress% (BYVAL PortNo%) END DECLARE -PRINT "&H" + HEX$(GetLPTPortAddress%(1)) +PRINT "&H" + HEX$(GetLPTPortAddress%(1)) {{CodeEnd}} -:''Explanation:'' DECLARE LIBRARY also searches for C header files with a '''.h''' extension. So in this case it is using the header '''ntport.h''' and linking with '''ntport.lib''' just by specifying "NTPORT". The C function definitions are stored in '''ntport.h''' so even if our QB64 functions don't exactly match (eg. LONG instead of INTEGER) it will still work. +:''Explanation:'' DECLARE LIBRARY also searches for C header files with a '''.h''' extension. So in this case it is using the header '''ntport.h''' and linking with '''ntport.lib''' just by specifying "NTPORT". The C function definitions are stored in '''ntport.h''' so even if our QB64 functions don't exactly match (eg. LONG instead of INTEGER) it will still work. :If you look inside ''''ntport.h'''' you'll find the following line containing the C function definition of the command we used: {{TextStart}} WORD WINAPI GetLPTPortAddress(WORD PortNo); {{TextEnd}} -<center>Galleon's '''OpenGL''' Library with demo program download: http://www.qb64.net/gl_package.zip</center> +<center>Galleon's '''OpenGL''' Library with demo program download: http://www.qb64.net/gl_package.zip</center> -<center>'''QB64 version 1.000 and up produce standalone executables. External DLL files must be distributed with your program.'''</center> -<center>'''Note: QB64 versions prior to 1.000 require all default DLL files to either be with the program or in the C:\WINDOWS\SYSTEM32 folder.'''</center> +<center>'''QB64 version 1.000 and up produce standalone executables. External DLL files must be distributed with your program.'''</center> +<center>'''Note: QB64 versions prior to 1.000 require all default DLL files to either be with the program or in the C:\WINDOWS\SYSTEM32 folder.'''</center> ''See also:'' @@ -133,4 +133,4 @@ PRINT "&H" + HEX$(GetLPTPortAddress%(1)) * [http://www.qb64.net/forum/index.php?topic=11810.msg102081#msg102081 DECLARE LIBRARY and C++ Variable Types] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/DEFDBL.txt b/internal/help/DEFDBL.txt index 118e870a8..8a9808da9 100644 --- a/internal/help/DEFDBL.txt +++ b/internal/help/DEFDBL.txt @@ -19,7 +19,7 @@ The [[DEFDBL]] statement defines all variables with names starting with the spec ==QBasic/QuickBASIC== -* QBasic's IDE would add DEF statements before any [[SUB]] or [[FUNCTION]]. QB64 (like QBasic) will change all variable types in subsequent sub-procedures to that default variable type without giving a [[ERROR Codes|"Parameter Type Mismatch"]] warning or adding DEF statement to subsequent procedures. If you do not want that to occur, either remove that DEF statement or add the proper DEF type statements to subsequent procedures. May also affect [[$INCLUDE]] procedures. +* QBasic's IDE would add DEF statements before any [[SUB]] or [[FUNCTION]]. QB64 (like QBasic) will change all variable types in subsequent sub-procedures to that default variable type without giving a [[ERROR Codes|"Parameter Type Mismatch"]] warning or adding DEF statement to subsequent procedures. If you do not want that to occur, either remove that DEF statement or add the proper DEF type statements to subsequent procedures. May also affect [[$INCLUDE]] procedures. {{PageExamples}} @@ -37,4 +37,4 @@ The [[DEFDBL]] statement defines all variables with names starting with the spec * [[_DEFINE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/DEFINT.txt b/internal/help/DEFINT.txt index 4540d1e21..45b7c6045 100644 --- a/internal/help/DEFINT.txt +++ b/internal/help/DEFINT.txt @@ -20,7 +20,7 @@ The [[DEFINT]] statement defines all variables with names starting with the spec ==QBasic/QuickBASIC== -* QBasic's IDE would add DEF statements before any [[SUB]] or [[FUNCTION]]. QB64 (like QBasic) will change all variable types in subsequent sub-procedures to that default variable type without giving a [[ERROR Codes|"Parameter Type Mismatch"]] warning or adding DEF statement to subsequent procedures. If you do not want that to occur, either remove that DEF statement or add the proper DEF type statements to subsequent procedures. May also affect [[$INCLUDE]] procedures. +* QBasic's IDE would add DEF statements before any [[SUB]] or [[FUNCTION]]. QB64 (like QBasic) will change all variable types in subsequent sub-procedures to that default variable type without giving a [[ERROR Codes|"Parameter Type Mismatch"]] warning or adding DEF statement to subsequent procedures. If you do not want that to occur, either remove that DEF statement or add the proper DEF type statements to subsequent procedures. May also affect [[$INCLUDE]] procedures. {{PageExamples}} @@ -38,4 +38,4 @@ The [[DEFINT]] statement defines all variables with names starting with the spec * [[_DEFINE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/DEFLNG.txt b/internal/help/DEFLNG.txt index b5b2f814e..b3bd40ee3 100644 --- a/internal/help/DEFLNG.txt +++ b/internal/help/DEFLNG.txt @@ -20,7 +20,7 @@ The [[DEFLNG]] statement defines all variables with names starting with the spec ==QBasic/QuickBASIC== -* QBasic's IDE would add DEF statements before any [[SUB]] or [[FUNCTION]]. QB64 (like QBasic) will change all variable types in subsequent sub-procedures to that default variable type without giving a [[ERROR Codes|"Parameter Type Mismatch"]] warning or adding DEF statement to subsequent procedures. If you do not want that to occur, either remove that DEF statement or add the proper DEF type statements to subsequent procedures. May also affect [[$INCLUDE]] procedures. +* QBasic's IDE would add DEF statements before any [[SUB]] or [[FUNCTION]]. QB64 (like QBasic) will change all variable types in subsequent sub-procedures to that default variable type without giving a [[ERROR Codes|"Parameter Type Mismatch"]] warning or adding DEF statement to subsequent procedures. If you do not want that to occur, either remove that DEF statement or add the proper DEF type statements to subsequent procedures. May also affect [[$INCLUDE]] procedures. {{PageExamples}} @@ -38,4 +38,4 @@ The [[DEFLNG]] statement defines all variables with names starting with the spec * [[_DEFINE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/DEFSNG.txt b/internal/help/DEFSNG.txt index 555f55be0..75cc91ac1 100644 --- a/internal/help/DEFSNG.txt +++ b/internal/help/DEFSNG.txt @@ -20,7 +20,7 @@ The [[DEFSNG]] statement defines all variables with names starting with the spec ==QBasic/QuickBASIC== -* QBasic's IDE would add DEF statements before any [[SUB]] or [[FUNCTION]]. QB64 (like QBasic) will change all variable types in subsequent sub-procedures to that default variable type without giving a [[ERROR Codes|"Parameter Type Mismatch"]] warning or adding DEF statement to subsequent procedures. If you do not want that to occur, either remove that DEF statement or add the proper DEF type statements to subsequent procedures. May also affect [[$INCLUDE]] procedures. +* QBasic's IDE would add DEF statements before any [[SUB]] or [[FUNCTION]]. QB64 (like QBasic) will change all variable types in subsequent sub-procedures to that default variable type without giving a [[ERROR Codes|"Parameter Type Mismatch"]] warning or adding DEF statement to subsequent procedures. If you do not want that to occur, either remove that DEF statement or add the proper DEF type statements to subsequent procedures. May also affect [[$INCLUDE]] procedures. {{PageExamples}} @@ -38,4 +38,4 @@ The [[DEFSNG]] statement defines all variables with names starting with the spec * [[_DEFINE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/DEFSTR.txt b/internal/help/DEFSTR.txt index d0c1f94b6..24cbc17fb 100644 --- a/internal/help/DEFSTR.txt +++ b/internal/help/DEFSTR.txt @@ -19,7 +19,7 @@ The [[DEFSTR]] statement defines all variables with names starting with the spec ==QBasic/QuickBASIC== -* QBasic's IDE would add DEF statements before any [[SUB]] or [[FUNCTION]]. QB64 (like QBasic) will change all variable types in subsequent sub-procedures to that default variable type without giving a [[ERROR Codes|"Parameter Type Mismatch"]] warning or adding DEF statement to subsequent procedures. If you do not want that to occur, either remove that DEF statement or add the proper DEF type statements to subsequent procedures. May also affect [[$INCLUDE]] procedures. +* QBasic's IDE would add DEF statements before any [[SUB]] or [[FUNCTION]]. QB64 (like QBasic) will change all variable types in subsequent sub-procedures to that default variable type without giving a [[ERROR Codes|"Parameter Type Mismatch"]] warning or adding DEF statement to subsequent procedures. If you do not want that to occur, either remove that DEF statement or add the proper DEF type statements to subsequent procedures. May also affect [[$INCLUDE]] procedures. {{PageExamples}} @@ -37,4 +37,4 @@ The [[DEFSTR]] statement defines all variables with names starting with the spec * [[_DEFINE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/DEF_FN.txt b/internal/help/DEF_FN.txt index c99efa378..9778bcdc1 100644 --- a/internal/help/DEF_FN.txt +++ b/internal/help/DEF_FN.txt @@ -81,4 +81,4 @@ The '''DEF FN''' statement defines a non-recursive function in the main module t * [[_DEFINE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/DEF_SEG.txt b/internal/help/DEF_SEG.txt index e0e3c4553..3e2f74f4e 100644 --- a/internal/help/DEF_SEG.txt +++ b/internal/help/DEF_SEG.txt @@ -21,7 +21,7 @@ {{PageExamples}} ''Example:'' In a Qbasic(ONLY) file delete, '''SEG''' forces the parameter to be passed as a far pointer. {{CodeStart}} '' '' -{{Cl|CONST}} file = "trashme.tmp" 'example temporary file name to delete +{{Cl|CONST}} file = "trashme.tmp" 'example temporary file name to delete {{Cl|DEFINT}} A-Z {{Cl|DIM}} filename {{Cl|AS}} {{Cl|STRING}} {{Cl|DIM}} result {{Cl|AS}} {{Cl|LONG}} @@ -32,19 +32,19 @@ {{Cl|CLS}} -t = "5589E51E8B560C8EDA8B5E0A8B5702B441CD218B56088EDA8B5E06720B6631C0" -t = t + "6689071F5DCA0800660D0000FFFFEBF0" +t = "5589E51E8B560C8EDA8B5E0A8B5702B441CD218B56088EDA8B5E06720B6631C0" +t = t + "6689071F5DCA0800660D0000FFFFEBF0" {{Cl|FOR...NEXT|FOR}} i = 0 {{Cl|TO}} codelen - 1 -{{Cl|MID$}}(code, i + 1, 1) = {{Cl|CHR$}}({{Cl|VAL}}("&h" + {{Cl|MID$}}(t, i + i + 1, 2))) +{{Cl|MID$}}(code, i + 1, 1) = {{Cl|CHR$}}({{Cl|VAL}}("&h" + {{Cl|MID$}}(t, i + i + 1, 2))) {{Cl|NEXT}} {{Cl|OPEN}} file {{Cl|FOR...NEXT|FOR}} {{Cl|APPEND}} {{Cl|AS}} 1 'create temporary file -{{Cl|PRINT (file statement)|PRINT}} #1, "I am doomed! :-(" +{{Cl|PRINT (file statement)|PRINT}} #1, "I am doomed! :-(" {{Cl|CLOSE}} -{{Cl|PRINT}} "now you see it:" -{{Cl|SHELL}} "dir " + file +{{Cl|PRINT}} "now you see it:" +{{Cl|SHELL}} "dir " + file K$ = {{Cl|INPUT$}}(1) filename = file + {{Cl|CHR$}}(0) 'create zero string name for DOS @@ -52,15 +52,15 @@ filename = file + {{Cl|CHR$}}(0) 'create zero string name for DOS {{Cl|CALL}} absolute('''SEG''' filename, '''SEG''' result, {{Cl|VARPTR}}(code)) {{Cl|IF...THEN|IF}} result {{Cl|THEN}} 'check results -{{Cl|PRINT}} "oops. error: 0x"; {{Cl|HEX$}}(result {{Cl|AND (boolean)|AND}} {{Cl|&H}}FFFF&) +{{Cl|PRINT}} "oops. error: 0x"; {{Cl|HEX$}}(result {{Cl|AND (boolean)|AND}} {{Cl|&H}}FFFF&) {{Cl|ELSE}} -{{Cl|PRINT}} "now you don't:" +{{Cl|PRINT}} "now you don't:" {{Cl|END IF}} -{{Cl|SHELL}} "dir " + file +{{Cl|SHELL}} "dir " + file {{Cl|END}} '' '' {{CodeEnd}} {{small|Code by Michael Calkins as Public Domain(2011)}} ---> +--> ''See also:'' * [[DEF SEG = 0]] @@ -69,4 +69,4 @@ filename = file + {{Cl|CHR$}}(0) 'create zero string name for DOS * [[BSAVE]], [[BLOAD]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/DIM.txt b/internal/help/DIM.txt index 7e1072d5b..6a404f883 100644 --- a/internal/help/DIM.txt +++ b/internal/help/DIM.txt @@ -34,7 +34,7 @@ The [[DIM]] statement is used to declare a variable or a list of variables as a * [[$DYNAMIC|Dynamic]] arrays MUST be [[REDIM]]ensioned if [[ERASE]] or [[CLEAR]] are used, as the arrays are completely removed. * All numerical variable types '''except''' {{KW|SINGLE}}, {{KW|DOUBLE}} and {{KW|_FLOAT}} can be dimensioned as [[_UNSIGNED]] (suffix ~) or positive only. * '''NOTE:''' Many QBasic keyword variable names can be used with a [[STRING]] suffix ($). You cannot use them without the suffix, use a numerical suffix or use ''DIM, [[REDIM]], [[_DEFINE]], [[BYVAL]] or [[TYPE]] variable [[AS]]'' statements. '''Although possible, it's recommended to avoid using reserved names.''' -* '''Warning: Do not use negative array upper bound index values, or OS access or "Out of Memory" [[ERROR Codes|errors]] will occur.''' +* '''Warning: Do not use negative array upper bound index values, or OS access or "Out of Memory" [[ERROR Codes|errors]] will occur.''' {{PageExamples}} @@ -64,7 +64,7 @@ The [[DIM]] statement is used to declare a variable or a list of variables as a {{CodeEnd}} -''Example 6:'' QB64 is more flexible than QBasic when it comes to "Duplicate Definition" errors. The following code does not error: +''Example 6:'' QB64 is more flexible than QBasic when it comes to "Duplicate Definition" errors. The following code does not error: {{CodeStart}} '' '' x = 1 'x is a {{Cl|SINGLE}} variable {{Cl|PRINT}} x @@ -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" '''[[IDE|status error]]''' in QB64 when the variable types are the same. {{CodeStart}} '' '' x = 1 'x is a {{Cl|SINGLE}} variable {{Cl|PRINT}} x @@ -94,4 +94,4 @@ x = 1 'x is a {{Cl|SINGLE}} variable * [[OPTION _EXPLICIT]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/DIR$.txt b/internal/help/DIR$.txt index 6fc694ff1..edc2f217d 100644 --- a/internal/help/DIR$.txt +++ b/internal/help/DIR$.txt @@ -3,11 +3,11 @@ The [[_DIR$]] function returns common paths in '''Windows''' only such as My Doc {{PageSyntax}} -: {{Parameter|d$}} = [[_DIR$]]("{{Parameter|folderspecification}}") +: {{Parameter|d$}} = [[_DIR$]]("{{Parameter|folderspecification}}") {{Parameters}} -* ''folderspecification'' may be "desktop", "download", "documents", "music", "video", "pictures", "appdata", "program data", "local data". +* ''folderspecification'' may be "desktop", "download", "documents", "music", "video", "pictures", "appdata", "program data", "local data". * Some variation is accepted for the folder specification: :: MY DOCUMENTS, TEXT, DOCUMENT, DOCUMENTS, DOWNLOAD, DOWNLOADS :: MY MUSIC, MUSIC, AUDIO, SOUND, SOUNDS @@ -19,19 +19,19 @@ The [[_DIR$]] function returns common paths in '''Windows''' only such as My Doc {{PageDescription}} * The path returned ends with a backslash (Windows). * A nonexistent folder specification usually defaults to the Desktop folder path. -* In Linux and macOS the function always returns '''"./"''' +* In Linux and macOS the function always returns '''"./"''' {{PageExamples}} Example: Displaying default paths in Windows only. -{{CodeStart}}{{Cl|PRINT}} "DESKTOP=" + _DIR$("desktop") -{{Cl|PRINT}} "DOWNLOADS=" + {{Cl|_DIR$}}("download") -{{Cl|PRINT}} "DOCUMENTS=" + {{Cl|_DIR$}}("my documents") -{{Cl|PRINT}} "PICTURES=" + {{Cl|_DIR$}}("pictures") -{{Cl|PRINT}} "MUSIC=" + {{Cl|_DIR$}}("music") -{{Cl|PRINT}} "VIDEO=" + {{Cl|_DIR$}}("video") -{{Cl|PRINT}} "APPLICATION DATA=" + {{Cl|_DIR$}}("data") -{{Cl|PRINT}} "LOCAL APPLICATION DATA=" + {{Cl|_DIR$}}("local application data" +{{CodeStart}}{{Cl|PRINT}} "DESKTOP=" + _DIR$("desktop") +{{Cl|PRINT}} "DOWNLOADS=" + {{Cl|_DIR$}}("download") +{{Cl|PRINT}} "DOCUMENTS=" + {{Cl|_DIR$}}("my documents") +{{Cl|PRINT}} "PICTURES=" + {{Cl|_DIR$}}("pictures") +{{Cl|PRINT}} "MUSIC=" + {{Cl|_DIR$}}("music") +{{Cl|PRINT}} "VIDEO=" + {{Cl|_DIR$}}("video") +{{Cl|PRINT}} "APPLICATION DATA=" + {{Cl|_DIR$}}("data") +{{Cl|PRINT}} "LOCAL APPLICATION DATA=" + {{Cl|_DIR$}}("local application data" {{CodeEnd}} {{OutputStart}}DESKTOP=C:\Documents and Settings\Administrator\Desktop\ DOWNLOADS=C:\Documents and Settings\Administrator\Downloads\ @@ -49,4 +49,4 @@ LOCAL APPLICATION DATA=C:\Documents and Settings\Administrator\Local Settings\Ap * [[_STARTDIR$]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/DO...LOOP.txt b/internal/help/DO...LOOP.txt index e94747aaf..df6e4d86b 100644 --- a/internal/help/DO...LOOP.txt +++ b/internal/help/DO...LOOP.txt @@ -36,9 +36,9 @@ ''Example 1:'' Using WHILE to clear the keyboard buffer. {{CodeStart}} -DO WHILE {{Cl|INKEY$}} <> "": LOOP ' checks evaluation before running loop code +DO WHILE {{Cl|INKEY$}} <> "": LOOP ' checks evaluation before running loop code -DO: LOOP WHILE INKEY$ <> "" ' checks evaluation after one run of loop code +DO: LOOP WHILE INKEY$ <> "" ' checks evaluation after one run of loop code {{CodeEnd}} @@ -46,9 +46,9 @@ DO: LOOP WHILE INKEY$ <> "" ' checks evaluation after one run of ''Example 2:'' Using UNTIL to clear the keyboard buffer. {{CodeStart}} -DO UNTIL {{Cl|INKEY$}} = "": LOOP ' checks evaluation before running loop code +DO UNTIL {{Cl|INKEY$}} = "": LOOP ' checks evaluation before running loop code -DO: LOOP UNTIL {{Cl|INKEY$}} = "" ' checks evaluation after one run of loop code +DO: LOOP UNTIL {{Cl|INKEY$}} = "" ' checks evaluation after one run of loop code {{CodeEnd}} @@ -57,7 +57,7 @@ DO: LOOP UNTIL {{Cl|INKEY$}} = "" ' checks evaluation after one run of :SUB reads header contents of a [[BSAVE]] file that may include embedded RGB color settings before the image. {{CodeStart}} '' '' {{Cl|DEFINT}} A-Z -{{Cl|INPUT}} "Enter a BSAVE file name to read the file for screen mode:"', filenm$ +{{Cl|INPUT}} "Enter a BSAVE file name to read the file for screen mode:"', filenm$ CheckScreen filenm$ {{Cl|END}} @@ -73,33 +73,33 @@ CheckScreen filenm$ {{Cl|GET}} #1, , Bsv '1 check for small 2 character GET #1, , Header '2 - 7 rest of file header - IF Bsv <> {{Cl|CHR$}}(253) THEN ' small 2 character denotes a {{Cl|BSAVE}} file - COLOR 12: LOCATE 15, 33: PRINT "Not a BSAVE file!": SLEEP 3: {{Cl|EXIT}} SUB + IF Bsv <> {{Cl|CHR$}}(253) THEN ' small 2 character denotes a {{Cl|BSAVE}} file + COLOR 12: LOCATE 15, 33: PRINT "Not a BSAVE file!": SLEEP 3: {{Cl|EXIT}} SUB END IF GET #1, , widN '8 no color info bmp sizes - GET #1, , depN '9 " " " + GET #1, , depN '9 " " " DO - IF widN > 63 OR depN > 63 THEN {{Cl|EXIT DO}} ' width and depth already found + IF widN > 63 OR depN > 63 THEN {{Cl|EXIT DO}} ' width and depth already found FOR i = 10 TO 55 'check for Screen 12 embedded colors GET #1, , RGB tot12& = tot12& + RGB 'PRINT i; RGB; : SOUND 300, 1 'test sound slows loop in QB - IF RGB > 63 OR RGB < 0 THEN {{Cl|EXIT DO}} + IF RGB > 63 OR RGB < 0 THEN {{Cl|EXIT DO}} IF i = 55 AND tot12& = 0 THEN {{Cl|EXIT DO}} NEXT GET #1, , wid12 '56 GET #1, , dep12 '57 - IF wid12 > 63 OR dep12 > 63 THEN {{Cl|EXIT DO}} + IF wid12 > 63 OR dep12 > 63 THEN {{Cl|EXIT DO}} FOR i = 58 TO 775 'check for Screen 13 embedded colors GET #1, , RGB tot13& = tot13& + RGB 'PRINT i; RGB; : SOUND 300, 1 'test - IF RGB > 63 OR RGB < 0 THEN {{Cl|EXIT DO}} + IF RGB > 63 OR RGB < 0 THEN {{Cl|EXIT DO}} IF i = 775 AND tot13& = 0 THEN {{Cl|EXIT DO}} NEXT GET #1, , wid13 '776 @@ -110,24 +110,24 @@ CLOSE #1 COLOR 14: LOCATE 10, 25 {{Cl|SELECT CASE}} i {{Cl|CASE IS}} < 56: - IF widN > 640 THEN + IF widN > 640 THEN Scr = 13: MaxColors = 0 - PRINT "Default Screen 13:"; widN \ 8; "X"; depN + PRINT "Default Screen 13:"; widN \ 8; "X"; depN ELSE LOCATE 10, 15 - PRINT "Screen 12 ("; widN; "X"; depN; ") OR 13 ("; widN \ 8; "X"; depN; ")" + PRINT "Screen 12 ("; widN; "X"; depN; ") OR 13 ("; widN \ 8; "X"; depN; ")" DO: SOUND 600, 4 COLOR 13: LOCATE 12, 23 'ask if no data found. Prevents ERROR opening in wrong mode - {{Cl|INPUT}} "Enter a Screen mode 12 or 13 : ", Scrn$ + {{Cl|INPUT}} "Enter a Screen mode 12 or 13 : ", Scrn$ Scr = VAL(Scrn$) LOOP UNTIL Scr = 12 OR Scr = 13 END IF IF Scr = 12 THEN MaxColors = 0: PWidth = widN: PDepth = depN IF Scr = 13 THEN MaxColors = 0: PWidth = widN \ 8: PDepth = depN {{Cl|CASE}} 56 TO 775 - PRINT "Custom Screen 12:"; wid12; "X"; dep12 + PRINT "Custom Screen 12:"; wid12; "X"; dep12 Scr = 12: MaxColors = 16: PWidth = wid12: PDepth = dep12 - {{Cl|CASE}} 776: PRINT "Custom Screen 13:"; wid13 \ 8; "X"; dep13 + {{Cl|CASE}} 776: PRINT "Custom Screen 13:"; wid13 \ 8; "X"; dep13 Scr = 13: MaxColors = 256: PWidth = wid13 \ 8: PDepth = dep13 {{Cl|END SELECT}} @@ -147,4 +147,4 @@ COLOR 14: LOCATE 10, 25 * [[FOR...NEXT]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/DOUBLE.txt b/internal/help/DOUBLE.txt index 03ff8b521..66012f3c8 100644 --- a/internal/help/DOUBLE.txt +++ b/internal/help/DOUBLE.txt @@ -28,4 +28,4 @@ * [[Variable Types]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/DRAW.txt b/internal/help/DRAW.txt index bda185388..0e8e698a6 100644 --- a/internal/help/DRAW.txt +++ b/internal/help/DRAW.txt @@ -13,28 +13,28 @@ The [[DRAW]] statement uses a [[STRING]] expression to draw lines on the screen. * Draw strings use letters followed by the number of pixels to move, an angle, coordinate or a color value. * Draw strings are flexible with spacing. '''Spacing is not required.''' [[DRAW]] will look for a number value after a valid letter. * DRAW statements are not case sensitive. -** "'''B'''" (blind) before a line move designates that the line move will be hidden. Use to offset from a "P" or [[PAINT]] border. -** "'''C''' n" designates the color attribute or [[_RGB]] [[STR$|string]] numerical color value to be used in the draw statement immediately after. -** "'''M''' x, y" can move to another coordinate area of the screen. When a + or - sign is used before a coordinate, it is a relative coordinate move similar to using the [[STEP]] graphics keyword. DRAW "M+=" + [[VARPTR$]](variable%) -** "'''N'''" before a line move designates that the graphic cursor will return to the starting position after the line is drawn. -** "'''P''' f [, b]" is used to [[PAINT|paint]] enclosed objects. f denotes the fill color and b the border color, if needed. -** "'''S''' n" changes the pixel move size of the lines. Default is 4 (1 pixel) minimum. "S8" would double the pixel line moves. -** "'''X'''" + [[VARPTR$]](value) can draw another substring. +** "'''B'''" (blind) before a line move designates that the line move will be hidden. Use to offset from a "P" or [[PAINT]] border. +** "'''C''' n" designates the color attribute or [[_RGB]] [[STR$|string]] numerical color value to be used in the draw statement immediately after. +** "'''M''' x, y" can move to another coordinate area of the screen. When a + or - sign is used before a coordinate, it is a relative coordinate move similar to using the [[STEP]] graphics keyword. DRAW "M+=" + [[VARPTR$]](variable%) +** "'''N'''" before a line move designates that the graphic cursor will return to the starting position after the line is drawn. +** "'''P''' f [, b]" is used to [[PAINT|paint]] enclosed objects. f denotes the fill color and b the border color, if needed. +** "'''S''' n" changes the pixel move size of the lines. Default is 4 (1 pixel) minimum. "S8" would double the pixel line moves. +** "'''X'''" + [[VARPTR$]](value) can draw another substring. * Certain letter designations create line moves on the SCREEN. Each move is followed by the number of pixels: -** "'''D''' n" draws a line vertically DOWN n pixels. -** "'''E''' n" draws a diagonal / line going UP and RIGHT n pixels each direction. -** "'''F''' n" draws a diagonal \ line going DOWN and RIGHT n pixels each direction. -** "'''G''' n" draws a diagonal / LINE going DOWN and LEFT n pixels each direction. -** "'''H''' n" draws a diagonal \ LINE going UP and LEFT n pixels each direction. -** "'''L''' n" draws a line horizontally LEFT n pixels. -** "'''R''' n" draws a line horizontally RIGHT n pixels. -** "'''U''' n" draws a line vertically UP n pixels. +** "'''D''' n" draws a line vertically DOWN n pixels. +** "'''E''' n" draws a diagonal / line going UP and RIGHT n pixels each direction. +** "'''F''' n" draws a diagonal \ line going DOWN and RIGHT n pixels each direction. +** "'''G''' n" draws a diagonal / LINE going DOWN and LEFT n pixels each direction. +** "'''H''' n" draws a diagonal \ LINE going UP and LEFT n pixels each direction. +** "'''L''' n" draws a line horizontally LEFT n pixels. +** "'''R''' n" draws a line horizontally RIGHT n pixels. +** "'''U''' n" draws a line vertically UP n pixels. * Angles are used to rotate all subsequent draw moves. -** "'''A''' n" can use values of 1 to 3 to rotate up to 3 90 degree(270) angles. -** '''TA''' n" can use any n angle from -360 to 0 to 360 to rotate a DRAW (Turn Angle). "TA0" resets to normal. -** When [[VARPTR$]] is used, DRAW functions such as '''TA''' angles use an equal sign: "TA=" + VARPTR$(angle%) +** "'''A''' n" can use values of 1 to 3 to rotate up to 3 90 degree(270) angles. +** '''TA''' n" can use any n angle from -360 to 0 to 360 to rotate a DRAW (Turn Angle). "TA0" resets to normal. +** When [[VARPTR$]] is used, DRAW functions such as '''TA''' angles use an equal sign: "TA=" + VARPTR$(angle%) * The graphic cursor is set to the center of the program window on program start for [[STEP]] relative coordinates. * '''DRAW can be used in any graphic screen mode, but cannot be used in the default screen mode 0 as it is text only.''' @@ -44,7 +44,7 @@ The [[DRAW]] statement uses a [[STRING]] expression to draw lines on the screen. {{CodeStart}} '' '' SCREEN 12 - octagon$ = "C12 R10 F10 D10 G10 L10 H10 U10 E10" 'create a DRAW string value + octagon$ = "C12 R10 F10 D10 G10 L10 H10 U10 E10" 'create a DRAW string value {{Cl|SCREEN (statement)|SCREEN}} 12 FOR i% = 1 TO 11 {{Cl|PSET}} (i% * 50, 100), 15 @@ -56,19 +56,19 @@ The [[DRAW]] statement uses a [[STRING]] expression to draw lines on the screen. ''Explanation:'' Once a DRAW string variable is created, it can be used to draw a shape throughout the program at any time. -''Example 2:'' Creating an analog clock's hour markers using "TA=" + [[VARPTR$]](angle). +''Example 2:'' Creating an analog clock's hour markers using "TA=" + [[VARPTR$]](angle). {{CodeStart}} '' '' SCREEN 12 FOR angle = 0 TO 360 {{Cl|STEP}} 30 ' 360/12 hour circles = 30 degrees apart PSET (175, 250), 6 ' stay at center point of clock - {{Cl|DRAW}} "TA=" + {{Cl|VARPTR$}}(angle) + "BU100" ' move invisibly to set next circle's center point + {{Cl|DRAW}} "TA=" + {{Cl|VARPTR$}}(angle) + "BU100" ' move invisibly to set next circle's center point {{Cl|CIRCLE}} {{Cl|STEP}}(0, 0), 5, 12 ' circle placed at end of blind line - {{Cl|DRAW}} "P9, 12" ' paint inside of circle + {{Cl|DRAW}} "P9, 12" ' paint inside of circle {{Cl|SLEEP}} 1 ' slowed for demo only NEXT '' '' {{CodeEnd}} -''Explanation:'' To place 12 circles in a circle each move is 30 degrees. PSET sets the center of the circular path every loop. TA moves counter-clockwise with positive degree angles. Once TA sets the angle a blind Up move is at that angle. The hour circles use the end point of the blind line as centers using the STEP relative coordinates of 0. After the circles are drawn, a draw "P" string paints the circle centers. DRAW paint strings use the last coordinate position also. +''Explanation:'' To place 12 circles in a circle each move is 30 degrees. PSET sets the center of the circular path every loop. TA moves counter-clockwise with positive degree angles. Once TA sets the angle a blind Up move is at that angle. The hour circles use the end point of the blind line as centers using the STEP relative coordinates of 0. After the circles are drawn, a draw "P" string paints the circle centers. DRAW paint strings use the last coordinate position also. ''Example 3:'' Creating a moving second hand for the clock above (SCREEN 12). (See [[TIME$]] example 1) @@ -77,11 +77,11 @@ The [[DRAW]] statement uses a [[STRING]] expression to draw lines on the screen. DO: sec$ = {{Cl|RIGHT$}}({{Cl|TIME$}}, 2) ' get actual seconds from TIME$ function degree$ = {{Cl|STR$}}({{Cl|VAL}}(sec$) * -6) ' 60 second moves. TA uses negative angles for clockwise moves {{Cl|PSET}} (175, 250), 9 ' stay at clock center - DRAW "TA" + degree$ + "U90" ' up becomes TA directional line - DO: LOOP UNTIL RIGHT$(TIME$, 2) <> sec$ ' wait for a new second value - IF INKEY$ <> "" THEN {{Cl|EXIT DO}} ' any key exit + DRAW "TA" + degree$ + "U90" ' up becomes TA directional line + DO: LOOP UNTIL RIGHT$(TIME$, 2) <> sec$ ' wait for a new second value + IF INKEY$ <> "" THEN {{Cl|EXIT DO}} ' any key exit PSET (175, 250), 0 ' set at clock center to erase line - DRAW "TA" + degree$ + "U90" ' erases old second hand line using color 0 from PSET + DRAW "TA" + degree$ + "U90" ' erases old second hand line using color 0 from PSET LOOP {{CodeEnd}} @@ -92,43 +92,43 @@ The [[DRAW]] statement uses a [[STRING]] expression to draw lines on the screen. {{CodeStart}} {{Cl|SCREEN}} 12 DO - {{Cl|LOCATE}} 1, 1: {{Cl|INPUT}} "Enter a number 0 to 9: ", num + {{Cl|LOCATE}} 1, 1: {{Cl|INPUT}} "Enter a number 0 to 9: ", num {{Cl|CLS}} {{Cl|SELECT CASE}} num {{Cl|CASE}} 0, 2, 3, 5 {{Cl|TO}} 9: {{Cl|PSET}} (20, 20), 12 - {{Cl|DRAW}} "E2R30F2G2L30H2BR5P12,12" 'top horiz + {{Cl|DRAW}} "E2R30F2G2L30H2BR5P12,12" 'top horiz {{Cl|END SELECT}} {{Cl|SELECT CASE}} num {{Cl|CASE}} 0, 4 {{Cl|TO}} 6, 8, 9: {{Cl|PSET}} (20, 20), 12 - {{Cl|DRAW}} "F2D30G2H2U30E2BD5P12,12" 'left top vert + {{Cl|DRAW}} "F2D30G2H2U30E2BD5P12,12" 'left top vert {{Cl|END SELECT}} {{Cl|SELECT CASE}} num {{Cl|CASE}} 0, 2, 6, 8: {{Cl|PSET}} (20, 54), 12 - {{Cl|DRAW}} "F2D30G2H2U30E2BD5P12, 12" 'left bot vert + {{Cl|DRAW}} "F2D30G2H2U30E2BD5P12, 12" 'left bot vert {{Cl|END SELECT}} {{Cl|SELECT CASE}} num {{Cl|CASE}} 2 {{Cl|TO}} 6, 8, 9: {{Cl|PSET}} (20, 54), 12 - {{Cl|DRAW}} "E2R30F2G2L30H2BR5P12, 12" 'middle horiz + {{Cl|DRAW}} "E2R30F2G2L30H2BR5P12, 12" 'middle horiz {{Cl|END SELECT}} {{Cl|SELECT CASE}} num {{Cl|CASE}} 0 {{Cl|TO}} 4, 7 {{Cl|TO}} 9: {{Cl|PSET}} (54, 20), 12 - {{Cl|DRAW}} "F2D30G2H2U30E2BD5P12,12" 'top right vert + {{Cl|DRAW}} "F2D30G2H2U30E2BD5P12,12" 'top right vert {{Cl|END SELECT}} {{Cl|SELECT CASE}} num {{Cl|CASE}} 0, 1, 3 {{Cl|TO}} 9: {{Cl|PSET}} (54, 54), 12 - {{Cl|DRAW}} "F2D30G2H2U30E2BD5P12,12" 'bottom right vert + {{Cl|DRAW}} "F2D30G2H2U30E2BD5P12,12" 'bottom right vert {{Cl|END SELECT}} {{Cl|SELECT CASE}} num {{Cl|CASE}} 0, 2, 3, 5, 6, 8: {{Cl|PSET}} (20, 88), 12 - {{Cl|DRAW}} "E2R30F2G2L30H2BR5P12,12" 'bottom horiz + {{Cl|DRAW}} "E2R30F2G2L30H2BR5P12,12" 'bottom horiz {{Cl|END SELECT}} -{{Cl|LOOP}} {{Cl|UNTIL}} num > 9 '' '' +{{Cl|LOOP}} {{Cl|UNTIL}} num > 9 '' '' {{CodeEnd}} {{small|Code by Ted Weissgerber}} :''Explanation:'' The DRAW strings can be used more than once with different [[PSET]] positions to create more digits. @@ -151,7 +151,7 @@ k = {{Cl|_RGB}}(80, 255, 80) {{Cl|FOR...NEXT|FOR}} repeat = 1 {{Cl|TO}} 16 {{Cl|FOR...NEXT|FOR}} p = 0 {{Cl|TO}} 359 c = c + 1: d = c / 14 - {{Cl|DRAW}} "c" + {{Cl|STR$}}(k) + " ta" + {{Cl|STR$}}(p) + " bu " + {{Cl|STR$}}(d) + "l7 u7 r7 d7 bd " + {{Cl|STR$}}(d) + {{Cl|DRAW}} "c" + {{Cl|STR$}}(k) + " ta" + {{Cl|STR$}}(p) + " bu " + {{Cl|STR$}}(d) + "l7 u7 r7 d7 bd " + {{Cl|STR$}}(d) {{Cl|NEXT}} p {{Cl|NEXT}} repeat {{CodeEnd}} @@ -165,4 +165,4 @@ k = {{Cl|_RGB}}(80, 255, 80) * [[TIME$]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/Dollar_Sign.txt b/internal/help/Dollar_Sign.txt index 5235135cf..87b2121a9 100644 --- a/internal/help/Dollar_Sign.txt +++ b/internal/help/Dollar_Sign.txt @@ -17,4 +17,4 @@ The '''$''' is used to denote Qbasic [[Metacommand]]s or as a [[STRING]] variabl * [[Metacommand]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/ELSE.txt b/internal/help/ELSE.txt index 40bd5f49f..7eba6ed4a 100644 --- a/internal/help/ELSE.txt +++ b/internal/help/ELSE.txt @@ -30,7 +30,7 @@ ''Example 1:'' One line IF statement {{CodeStart}} -IF x = 100 THEN PRINT "100" ELSE PRINT "Not 100" +IF x = 100 THEN PRINT "100" ELSE PRINT "Not 100" {{CodeEnd}} @@ -38,8 +38,8 @@ IF x = 100 THEN PRINT "100" ELSE PRINT "Not 100" {{CodeStart}} IF x = 100 THEN ' code executed MUST be on next statement line! - PRINT "100" -ELSE PRINT "Not 100" + PRINT "100" +ELSE PRINT "Not 100" END IF {{CodeEnd}} @@ -59,4 +59,4 @@ IF a = 3 THEN a = 5 ELSE a = 3 * [[IF...THEN]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/ELSEIF.txt b/internal/help/ELSEIF.txt index 0be71858b..b2f773921 100644 --- a/internal/help/ELSEIF.txt +++ b/internal/help/ELSEIF.txt @@ -29,7 +29,7 @@ ''Example 1:'' IF statement using ELSE IF in one statement line. {{CodeStart}} -IF x = 100 THEN COLOR 10: PRINT x ELSE IF x > 100 THEN COLOR 12: PRINT x ELSE PRINT "< 100" +IF x = 100 THEN COLOR 10: PRINT x ELSE IF x > 100 THEN COLOR 12: PRINT x ELSE PRINT "< 100" {{CodeEnd}} @@ -39,8 +39,8 @@ IF x = 100 THEN COLOR 10: PRINT x ELSE IF x > 100 THEN COLOR 12: PRINT x ELSE IF x = 100 THEN ' must place ANY code on next line! COLOR 10: PRINT x -ELSEIF x > 100 THEN COLOR 12: PRINT x -ELSE : PRINT "< 100" +ELSEIF x > 100 THEN COLOR 12: PRINT x +ELSE : PRINT "< 100" END IF {{CodeEnd}} @@ -52,4 +52,4 @@ END IF *[[IF...THEN]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/END.txt b/internal/help/END.txt index 7970b6236..2de6be5eb 100644 --- a/internal/help/END.txt +++ b/internal/help/END.txt @@ -13,8 +13,8 @@ The [[END]] statement terminates a program without an immediate exit or ends a p {{PageDescription}} * In '''QB64''', [[END]] can be followed by a code that can be read by another module using the [[SHELL (function)|_SHELL]] or [[_SHELLHIDE]] function (known as [https://blogs.msdn.microsoft.com/oldnewthing/20080926-00/?p=20743 '''errorlevel''']) -* When END is used to end a program, there is a pause and the message "Press any key to continue..." is displayed at the bottom of the program's window. -* If the program does not use END or [[SYSTEM]], the program will still end with a pause and display "Press any key to continue...". +* When END is used to end a program, there is a pause and the message "Press any key to continue..." is displayed at the bottom of the program's window. +* If the program does not use END or [[SYSTEM]], the program will still end with a pause and display "Press any key to continue...". * In '''QB64''', [[SYSTEM]] will end the program immediately and close the window. * The '''QB64''' [[_EXIT (function)]] can block a user's Ctrl + Break key presses and clicks on the window's close button (X button) until the program is ready to close. @@ -23,9 +23,9 @@ The [[END]] statement terminates a program without an immediate exit or ends a p ''Example:'' In QB64 you won't return to the IDE unless you are using it to run or edit the program module. {{CodeStart}} '' '' -{{Cl|PRINT}} "Hello world!" +{{Cl|PRINT}} "Hello world!" {{Cl|END}} -{{Cl|PRINT}} "Hello no one!" '' '' +{{Cl|PRINT}} "Hello no one!" '' '' {{CodeEnd}} ''Returns:'' @@ -38,8 +38,8 @@ Hello world! Press any key to continue... {{OutputEnd}} -:''Explanation:''"Hello no one!" isn't returned because the program ended with the END statement no matter what is after that. -:The message "Press any key to continue..." is displayed after the program ends, both in QBasic and in '''QB64'''. +:''Explanation:''"Hello no one!" isn't returned because the program ended with the END statement no matter what is after that. +:The message "Press any key to continue..." is displayed after the program ends, both in QBasic and in '''QB64'''. @@ -49,4 +49,4 @@ Press any key to continue... * [[EXIT]] (statement), [[_EXIT (function)]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/ENVIRON$.txt b/internal/help/ENVIRON$.txt index 0a25d03ec..041a6e022 100644 --- a/internal/help/ENVIRON$.txt +++ b/internal/help/ENVIRON$.txt @@ -9,21 +9,21 @@ The [[ENVIRON$]] function returns a [[STRING]] environmental value from '''Windo * The function can use an [[INTEGER]] {{Parameter|listIndex%}} value or [[STRING]] {{Parameter|systemID$}} parameter. * {{Parameter|listIndex%}} refers to the number order of the environmental list. Returns are not in any particular numerical order. * {{Parameter|systemID$}} is the specific [[STRING]] parameter requested. Returns only the specified environmental [[STRING]] setting: -** "BLASTER" = current Sound Blaster settings if installed. -** "COMPUTERNAME" or "USERDOMAIN" = OEM PC serial number or the computer name assigned by owner. -** "HOMEDRIVE" or "SystemDrive" = Windows root drive, normally C: on single partition drives. -** "HOMEPATH" = current user's Administrator or the single user's "OWNER" folder path. -** "OS" = Windows Operating System version. Often WindowsNT in modern computers. -** "PATH" = full path setting that Windows uses to look for file extensions in PATHEXT below. -** "PATHEXT = Windows extensions used: COM, EXE, BAT, CMD, VBS, VBE, JS, JSE, WSF, WSH, MSC -** "PROCESSOR_ARCHITECTURE" = x86 for 32 or 64 bit. -** "PROGRAMFILES" = path to ''Program files'' folder, normally "C:\PROGRAM FILES" -** "PROMPT" = normally "$P$G" on Windows NT. -** "SYSTEMROOT" or "windir" = path to the Windows folder including the drive letter like "C:\WINDOWS" -** "TEMP" or "TMP" = path to TEMP folder. "C:\TEMP" or the user specific temp folder on later versions. -** "USERNAME" = current Administrator name or "OWNER". +** "BLASTER" = current Sound Blaster settings if installed. +** "COMPUTERNAME" or "USERDOMAIN" = OEM PC serial number or the computer name assigned by owner. +** "HOMEDRIVE" or "SystemDrive" = Windows root drive, normally C: on single partition drives. +** "HOMEPATH" = current user's Administrator or the single user's "OWNER" folder path. +** "OS" = Windows Operating System version. Often WindowsNT in modern computers. +** "PATH" = full path setting that Windows uses to look for file extensions in PATHEXT below. +** "PATHEXT = Windows extensions used: COM, EXE, BAT, CMD, VBS, VBE, JS, JSE, WSF, WSH, MSC +** "PROCESSOR_ARCHITECTURE" = x86 for 32 or 64 bit. +** "PROGRAMFILES" = path to ''Program files'' folder, normally "C:\PROGRAM FILES" +** "PROMPT" = normally "$P$G" on Windows NT. +** "SYSTEMROOT" or "windir" = path to the Windows folder including the drive letter like "C:\WINDOWS" +** "TEMP" or "TMP" = path to TEMP folder. "C:\TEMP" or the user specific temp folder on later versions. +** "USERNAME" = current Administrator name or "OWNER". : ''Note:'' There are other possible system settings that are not listed or never used on older versions. Run ''Example 1'' below for a complete list in your system. -<!-- Sentence removed for being unclear/needs revision: * The OS in Win 9X or ME can be found in the "PROMPT" parameter ID. Returns are limited in Win 9X and ME. --> +<!-- Sentence removed for being unclear/needs revision: * The OS in Win 9X or ME can be found in the "PROMPT" parameter ID. Returns are limited in Win 9X and ME. --> * ''Note:'' '''QB64''' may not return the same environment list as QBasic or SET did in DOS. @@ -35,8 +35,8 @@ The [[ENVIRON$]] function returns a [[STRING]] environmental value from '''Windo i = i + 1 setting$ = {{Cl|ENVIRON$}}(i) ' get a setting from the list {{Cl|PRINT}} setting$ - {{Cl|IF...THEN|IF}} i {{Cl|MOD}} 20 = 0 {{Cl|THEN}} {{Cl|PRINT}} "Press a key": {{Cl|SLEEP}}: {{Cl|CLS}} -{{Cl|LOOP}} {{Cl|UNTIL}} setting$ = "" + {{Cl|IF...THEN|IF}} i {{Cl|MOD}} 20 = 0 {{Cl|THEN}} {{Cl|PRINT}} "Press a key": {{Cl|SLEEP}}: {{Cl|CLS}} +{{Cl|LOOP}} {{Cl|UNTIL}} setting$ = "" {{CodeEnd}} {{OutputStart}} ALLUSERSPROFILE=C:\ProgramData @@ -70,8 +70,8 @@ USERPROFILE=C:\Users\Ted {{CodeStart}} '=== Enter the EXE file and ICON or BMP image for the shortcut. -Program$ = "QB64.EXE" '<<<<<<<<<< Enter the '''exact''' program name for shortcut -ICON$ = "QB64ICON.BMP" '<<<<<<<<<< Enter icon or bitmap to use from program's folder +Program$ = "QB64.EXE" '<<<<<<<<<< Enter the '''exact''' program name for shortcut +ICON$ = "QB64ICON.BMP" '<<<<<<<<<< Enter icon or bitmap to use from program's folder DeskTopShortcut Program$, ICON$ @@ -79,23 +79,23 @@ DeskTopShortcut Program$, ICON$ {{Cl|SUB}} DeskTopShortcut (Program$, ICON$) f = {{Cl|FREEFILE}} -{{Cl|SHELL}} {{Cl|_HIDE}} "CD > PRGMDIR.INF" 'get the current program path -{{Cl|OPEN}} "PRGMDIR.INF" {{Cl|FOR (file statement)|FOR}} {{Cl|INPUT (file mode)|INPUT}} {{Cl|AS}} #f +{{Cl|SHELL}} {{Cl|_HIDE}} "CD > PRGMDIR.INF" 'get the current program path +{{Cl|OPEN}} "PRGMDIR.INF" {{Cl|FOR (file statement)|FOR}} {{Cl|INPUT (file mode)|INPUT}} {{Cl|AS}} #f {{Cl|LINE INPUT (file statement)|LINE INPUT}} #f, PATH$ {{Cl|CLOSE}} #f -{{Cl|KILL}} "PRGMDIR.INF" -PATH$ = PATH$ + "\": FILE$ = PATH + Program$ +{{Cl|KILL}} "PRGMDIR.INF" +PATH$ = PATH$ + "\": FILE$ = PATH + Program$ PRINT PATH$ 'DEMO print -A$ = {{Cl|ENVIRON$}}("HOMEDRIVE") '=== Get Current User setting from Environment. -B$ = {{Cl|ENVIRON$}}("HOMEPATH") +A$ = {{Cl|ENVIRON$}}("HOMEDRIVE") '=== Get Current User setting from Environment. +B$ = {{Cl|ENVIRON$}}("HOMEPATH") C$ = A$ + B$ 'shortcut to user's desktop if found -{{Cl|IF...THEN|IF}} C$ = "" {{Cl|THEN}} C$ = {{Cl|ENVIRON$}}("ALLUSERSPROFILE") 'try desktop for all users +{{Cl|IF...THEN|IF}} C$ = "" {{Cl|THEN}} C$ = {{Cl|ENVIRON$}}("ALLUSERSPROFILE") 'try desktop for all users PRINT C$ 'DEMO print -URLFILE$ = {{Cl|MID$}}(Program$, 1, {{Cl|INSTR}}(Program$, ".")) + "URL" 'change EXE to URL +URLFILE$ = {{Cl|MID$}}(Program$, 1, {{Cl|INSTR}}(Program$, ".")) + "URL" 'change EXE to URL -{{Cl|IF...THEN|IF}} C$ > "" {{Cl|THEN}} - SHORTCUT$ = C$ + "\Desktop\" + URLFILE$ 'create filename for the desktop +{{Cl|IF...THEN|IF}} C$ > "" {{Cl|THEN}} + SHORTCUT$ = C$ + "\Desktop\" + URLFILE$ 'create filename for the desktop {{Cl|ELSE}} SHORTCUT$ = PATH$ + URLFILE$ 'if all else fails put in program folder {{Cl|END IF}} PRINT SHORTCUT 'DEMO print @@ -103,11 +103,11 @@ PRINT SHORTCUT 'DEMO print {{Cl|IF...THEN|IF}} {{Cl|LOF}}(f) {{Cl|THEN}} {{Cl|CLOSE}} #f: {{Cl|EXIT SUB}} '=== if filesize is NOT Zero don't overwrite! Q$ = {{Cl|CHR$}}(34) '=== Write URL Shortcut file info. -{{Cl|PRINT (file statement)|PRINT}} #f, "[InternetShortcut]" 'URL type -{{Cl|PRINT (file statement)|PRINT}} #f, "URL=" + Q$ + "file://" + FILE$ + Q$ 'URL program file -{{Cl|PRINT (file statement)|PRINT}} #f, "WorkingDirectory=" + Q$ + PATH$ + Q$ 'Working path -{{Cl|PRINT (file statement)|PRINT}} #f, "IconIndex = " + Q$ + "0" + Q$ '0 is first index -{{Cl|PRINT (file statement)|PRINT}} #f, "IconFile = " + Q$ + PATH$ + ICON$ + Q$ 'Icon path in working folder +{{Cl|PRINT (file statement)|PRINT}} #f, "[InternetShortcut]" 'URL type +{{Cl|PRINT (file statement)|PRINT}} #f, "URL=" + Q$ + "file://" + FILE$ + Q$ 'URL program file +{{Cl|PRINT (file statement)|PRINT}} #f, "WorkingDirectory=" + Q$ + PATH$ + Q$ 'Working path +{{Cl|PRINT (file statement)|PRINT}} #f, "IconIndex = " + Q$ + "0" + Q$ '0 is first index +{{Cl|PRINT (file statement)|PRINT}} #f, "IconFile = " + Q$ + PATH$ + ICON$ + Q$ 'Icon path in working folder {{Cl|CLOSE}} #f {{Cl|END SUB}} '' '' {{CodeEnd}} @@ -124,4 +124,4 @@ Q$ = {{Cl|CHR$}}(34) '=== Write URL Shortcut file info. * [[Windows Libraries#Windows User|Windows User Paths Library]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/ENVIRON.txt b/internal/help/ENVIRON.txt index 4c65e256c..77ec87a53 100644 --- a/internal/help/ENVIRON.txt +++ b/internal/help/ENVIRON.txt @@ -11,8 +11,8 @@ 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" +** 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. @@ -24,4 +24,4 @@ The [[ENVIRON]] statement is used in DOS/Windows to temporarily set or change an * [[Windows Environment]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/EOF.txt b/internal/help/EOF.txt index 167576dfc..e1f9673fb 100644 --- a/internal/help/EOF.txt +++ b/internal/help/EOF.txt @@ -9,7 +9,7 @@ The [[EOF]] function indicates that the end of a file has been reached. * {{Parameter|fileNumber&}} is the number of the file being read. '''#''' is not required. * Returns 0 until the end of a file. This avoids a file read error. * Returns -1 (true) at the end of the file. -<!-- confusing statement; further details are required: * [[CHR$]](26) can be used to denote the end of a file. --> +<!-- confusing statement; further details are required: * [[CHR$]](26) can be used to denote the end of a file. --> * '''Note that [[GET]] can return invalid data at the end of a file.''' Read [[EOF]] after a GET operation to see if the end of the file has been reached and discard last read. @@ -21,4 +21,4 @@ The [[EOF]] function indicates that the end of a file has been reached. * [[GET]], [[PUT]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/EQV.txt b/internal/help/EQV.txt index 0b457eed7..13cce0c7a 100644 --- a/internal/help/EQV.txt +++ b/internal/help/EQV.txt @@ -18,4 +18,4 @@ The [[EQV]] operator returns a value based on the ''equivalence'' of two conditi * [[Boolean]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/ERASE.txt b/internal/help/ERASE.txt index 415b40f63..fe407fc78 100644 --- a/internal/help/ERASE.txt +++ b/internal/help/ERASE.txt @@ -6,7 +6,7 @@ The [[ERASE]] statement is used to clear all data from an array. [[$STATIC]] [[A {{PageDescription}} -* All string array elements become null strings ("") and all numerical array elements become 0. +* All string array elements become null strings ("") and all numerical array elements become 0. * Multiple arrays can be erased using commas between the array names. * [[$DYNAMIC|Dynamic]] arrays must be [[REDIM]]ensioned if they are referenced after erased. * Dimension subprocedure arrays as [[STATIC]] to use [[ERASE]] and not have to REDIM. @@ -21,4 +21,4 @@ The [[ERASE]] statement is used to clear all data from an array. [[$STATIC]] [[A * [[Arrays]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/ERDEV$.txt b/internal/help/ERDEV$.txt index 2822b4955..c309fef93 100644 --- a/internal/help/ERDEV$.txt +++ b/internal/help/ERDEV$.txt @@ -19,4 +19,4 @@ * [[ERROR]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/ERDEV.txt b/internal/help/ERDEV.txt index 19929734b..494485a68 100644 --- a/internal/help/ERDEV.txt +++ b/internal/help/ERDEV.txt @@ -17,4 +17,4 @@ -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/ERL.txt b/internal/help/ERL.txt index f94e8ee97..53b86b290 100644 --- a/internal/help/ERL.txt +++ b/internal/help/ERL.txt @@ -40,4 +40,4 @@ errorfix: * [[ERROR Codes]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/ERR.txt b/internal/help/ERR.txt index 45ed7f8e3..ff49706ba 100644 --- a/internal/help/ERR.txt +++ b/internal/help/ERR.txt @@ -11,7 +11,7 @@ The [[ERR]] function returns the last QBasic error code number. {{PageExamples}} -''Example:'' Simulating an error to test a program error handler that looks for a "Subscript out of range" error. +''Example:'' Simulating an error to test a program error handler that looks for a "Subscript out of range" error. {{CodeStart}} '' '' {{Cl|ON ERROR}} {{Cl|GOTO}} handler @@ -25,7 +25,7 @@ handler: {{Cl|PRINT}} {{Cl|ERR}}, {{Cl|_ERRORLINE}} {{Cl|BEEP}} {{Cl|IF...THEN|IF}} {{Cl|ERR}} = 9 {{Cl|THEN}} - {{Cl|PRINT}} "The program has encountered an error and needs to close! Press a key!" + {{Cl|PRINT}} "The program has encountered an error and needs to close! Press a key!" K$ = {{Cl|INPUT$}}(1) {{Cl|SYSTEM}} {{Cl|END IF}} @@ -41,4 +41,4 @@ handler: * [[ERROR Codes]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/ERROR.txt b/internal/help/ERROR.txt index 9d33eba26..6a9f74728 100644 --- a/internal/help/ERROR.txt +++ b/internal/help/ERROR.txt @@ -38,4 +38,4 @@ handler: *[[ERROR Codes]] (list) -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/EXIT.txt b/internal/help/EXIT.txt index ba370a207..2eb7c3860 100644 --- a/internal/help/EXIT.txt +++ b/internal/help/EXIT.txt @@ -12,9 +12,9 @@ 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]] DEF exits a [[DEF FN]] function procedure before it ends. The value passed by the function's name should be defined. --> * 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 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]]. @@ -24,4 +24,4 @@ The [[EXIT]] statement is used to exit certain QBasic procedures. * [[STOP]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/EXP.txt b/internal/help/EXP.txt index b8f6df041..0bf95cb6f 100644 --- a/internal/help/EXP.txt +++ b/internal/help/EXP.txt @@ -7,11 +7,11 @@ The [[EXP]] math function calculates the exponential function ('''e''' raised to {{PageDescription}} * '''e''' is defined as the base of natural logarithms or as the limit of (1 + 1 / n) ^ n, as n goes to infinity. -* The {{Parameter|numericExpression}} must be less than or equal to '''88.02969''' or an [[ERROR Codes|"overflow" error]] will occur. +* The {{Parameter|numericExpression}} must be less than or equal to '''88.02969''' or an [[ERROR Codes|"overflow" error]] will occur. * Value returned is '''e''' to the exponent parameter ('''e = 2.718282''' approximately). * Values returned are [[SINGLE]] by default but will return [[DOUBLE]] precision if the {{Parameter|result}} is a variable of type [[DOUBLE]]. * Positive exponent values indicate the number of times to multiply '''e''' by itself. -* Negative exponent values indicate the number of times to divide by '''e'''. Example: <span style="font-family: Courier New, monospace, Courier; background: #dddddd">e<sup>-3</sup> = 1 / e<sup>3</sup> = 1 / (e * e * e)</span> +* Negative exponent values indicate the number of times to divide by '''e'''. Example: <span style="font-family: Courier New, monospace, Courier; background: #dddddd">e<sup>-3</sup> = 1 / e<sup>3</sup> = 1 / (e * e * e)</span> {{PageSeeAlso}} @@ -20,4 +20,4 @@ The [[EXP]] math function calculates the exponential function ('''e''' raised to *[http://qb64.net/wiki/index.php?title=Mathematical_Operations#Derived_Mathematical_Functions Derived Trigonometric Functions] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/Equal.txt b/internal/help/Equal.txt index b45385d46..542453fa3 100644 --- a/internal/help/Equal.txt +++ b/internal/help/Equal.txt @@ -1,7 +1,7 @@ The '''=''' condition symbol denotes that a value must equal another value for the condition to be True. -''Example usage:'' IF x [[=]] 320 THEN PRINT "Center of screen" +''Example usage:'' IF x [[=]] 320 THEN PRINT "Center of screen" * Statements will evaluate as True or -1 when two values are equal or False or 0 when not equal. @@ -11,10 +11,10 @@ The '''=''' condition symbol denotes that a value must equal another value for t ''See also:'' -* [[Not_Equal|<>]] -* [[Greater_Than|>]] +* [[Not_Equal|<>]] +* [[Greater_Than|>]] * [[Less_Than|<]] * [[Relational Operations]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/FIELD.txt b/internal/help/FIELD.txt index e71644a69..14ad01d75 100644 --- a/internal/help/FIELD.txt +++ b/internal/help/FIELD.txt @@ -7,11 +7,11 @@ The [[FIELD]] statement creates a [[STRING]] type definition for a [[RANDOM|rand {{PageDescription}} * {{Parameter|fileNumber%}} is a file number used in the [[OPEN]] statement or a value from the [[FREEFILE]] function. -* Combined size of the {{Parameter|fieldWidth%}} parameters '''must not exceed the [[LEN]] = recordsize in the [[RANDOM]] [[OPEN]] statement''' or a [[ERROR Codes|"FIELD overflow" error]] will occur. +* Combined size of the {{Parameter|fieldWidth%}} parameters '''must not exceed the [[LEN]] = recordsize in the [[RANDOM]] [[OPEN]] statement''' or a [[ERROR Codes|"FIELD overflow" error]] will occur. * Variables are limited to [[STRING]] types. Use [[TYPE]] instead of FIELD if you want to use numerical values. * Once a [[FIELD]] is defined in a statement, [[GET]] can read and [[PUT]] can write data without placeholders or variables. * [[LSET]], [[RSET]], [[PRINT (file statement)|PRINT #]], [[PRINT USING (file statement)|PRINT # USING]], and [[WRITE (file statement)|WRITE #]] can be used to place characters in the file buffer before a [[PUT]]. -* All field definitions for a file are removed when the file is [[CLOSE|closed]] or [[RESET]] and all strings are set to null (""). +* All field definitions for a file are removed when the file is [[CLOSE|closed]] or [[RESET]] and all strings are set to null (""). * '''Do not re-assign a field defined variable value or use it in an [[INPUT]] statement if you want the variable to remain a field'''. @@ -28,12 +28,12 @@ The [[FIELD]] statement creates a [[STRING]] type definition for a [[RANDOM|rand {{Cl|DIM}} Client {{Cl|AS}} ClientType RecordLEN = {{Cl|LEN}}(Client) 'find the size of each TYPE record -{{Cl|OPEN}} "ADDRESS.DAT" {{Cl|FOR (file statement)|FOR}} {{Cl|RANDOM}} {{Cl|AS}} #1 {{Cl|LEN}} = RecordLEN +{{Cl|OPEN}} "ADDRESS.DAT" {{Cl|FOR (file statement)|FOR}} {{Cl|RANDOM}} {{Cl|AS}} #1 {{Cl|LEN}} = RecordLEN {{Cl|RESTORE}} ClientData 'restore to start of DATA record = 0 {{Cl|DO}} {{Cl|READ}} CName$, Address$, City$, State$, Zip$ 'read DATA - {{Cl|IF}} CName$ = "END" {{Cl|THEN}} {{Cl|EXIT DO}} + {{Cl|IF}} CName$ = "END" {{Cl|THEN}} {{Cl|EXIT DO}} record = record + 1 'increment record number Client.CName = CName$ Client.Address = Address$ @@ -46,12 +46,12 @@ record = 0 {{Cl|END}} ClientData: - {{Cl|DATA}} "Bob White","104 Birdland Rd.","Bellview","PA","15236" - {{Cl|DATA}} "Ward Cleaver","123 W. Beaver St.","Beaver","PA","15255" - {{Cl|DATA}} "Elmer Fudd","45 Wabbit St.","Bethel Park","PA","15022" - {{Cl|DATA}} "Wyley Coyote","33 Roadrunner Ave.","Clairton","PA","15122" - {{Cl|DATA}} "Jim Morrison","19 Doorway Dr.","Belleview","PA","15236" - {{Cl|DATA}} "END",0,0,0,0 '' '' + {{Cl|DATA}} "Bob White","104 Birdland Rd.","Bellview","PA","15236" + {{Cl|DATA}} "Ward Cleaver","123 W. Beaver St.","Beaver","PA","15255" + {{Cl|DATA}} "Elmer Fudd","45 Wabbit St.","Bethel Park","PA","15022" + {{Cl|DATA}} "Wyley Coyote","33 Roadrunner Ave.","Clairton","PA","15122" + {{Cl|DATA}} "Jim Morrison","19 Doorway Dr.","Belleview","PA","15236" + {{Cl|DATA}} "END",0,0,0,0 '' '' {{CodeEnd}} '' '' Demo using the FIELD statement to read the file: @@ -59,7 +59,7 @@ Demo using the FIELD statement to read the file: {{Cl|CONST}} NM = 30, AD = 30, CT = 15, ST = 2, ZC = 5 ' Define field and record lengths with constants. {{Cl|CONST}} RLEN = NM + AD + CY + ST + ZC ' -{{Cl|OPEN}} "ADDRESS.DAT" {{Cl|FOR (file statement)|FOR}} {{Cl|RANDOM}} {{Cl|AS}} #1 {{Cl|LEN}} = RLEN +{{Cl|OPEN}} "ADDRESS.DAT" {{Cl|FOR (file statement)|FOR}} {{Cl|RANDOM}} {{Cl|AS}} #1 {{Cl|LEN}} = RLEN {{Cl|FIELD}} #1, NM {{Cl|AS}} CName$, AD {{Cl|AS}} Address$, CY {{Cl|AS}} City$, ST {{Cl|AS}} State$, ZC {{Cl|AS}} Zip$ {{Cl|FIELD}} #1, RLEN {{Cl|AS}} Clist$ 'define entire record @@ -67,7 +67,7 @@ Demo using the FIELD statement to read the file: 'Read file for zip codes from 15230 to 15239 . {{Cl|DO}} {{Cl|WHILE}} {{Cl|NOT}} {{Cl|EOF}}(1) ZipCheck$ = Zip$ 'read zip codes - {{Cl|IF}} (ZipCheck$ >= "15230" {{Cl|AND (boolean)|AND}} ZipCheck$ <= "15239") {{Cl|THEN}} + {{Cl|IF}} (ZipCheck$ >= "15230" {{Cl|AND (boolean)|AND}} ZipCheck$ <= "15239") {{Cl|THEN}} Info$ = Clist$ {{Cl|PRINT}} {{Cl|LEFT$}}(Info$, 30) 'read name string {{Cl|PRINT}} {{Cl|MID$}}(Info$, 31, 30) 'read address string @@ -87,4 +87,4 @@ Demo using the FIELD statement to read the file: * [[LSET]], [[RSET]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/FILEATTR.txt b/internal/help/FILEATTR.txt index 0e2f52d23..8fe47d375 100644 --- a/internal/help/FILEATTR.txt +++ b/internal/help/FILEATTR.txt @@ -14,7 +14,7 @@ The [[FILEATTR]] function returns a file's current file mode or DOS handle. * {{Parameter|fileNumber%}} is the number assigned in the file's [[OPEN]] statement. * {{Parameter|mode%}} specifies the type of information to return, which may have the following values ** {{Parameter|mode%}} = 1: returns the open mode with the following return values: -::{| border="2" cellpadding="1" +::{| border="2" cellpadding="1" ! Return || Open Mode |- |  1 ||  [[INPUT]] @@ -34,4 +34,4 @@ The [[FILEATTR]] function returns a file's current file mode or DOS handle. * [[OPEN]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/FILES.txt b/internal/help/FILES.txt index 23481c62e..2e2b409df 100644 --- a/internal/help/FILES.txt +++ b/internal/help/FILES.txt @@ -10,30 +10,30 @@ The [[FILES]] statement is used to print a list of files in the current director * {{Parameter|fileSpec$}} can use the * and ? wildcard specifications: ** '''*''' denotes one or more wildcard characters in a filename or path specification as any legal file name character(s). ** '''?''' denotes one wildcard letter in a filename or path specification as any legal filename character. -* If {{Parameter|fileSpec$}} is omitted, it is assumed to be '''"*.*"''' (all files and folders in the current directory). -* Illegal filename characters in '''QB64''' include * > < : " | \ / with any amount of dot extensions being allowed in Windows. -* FILES lists can make the screen roll up. Try using SHELL "DIR" with the /P option. [http://www.computerhope.com/dirhlp.htm DIR command]. +* If {{Parameter|fileSpec$}} is omitted, it is assumed to be '''"*.*"''' (all files and folders in the current directory). +* Illegal filename characters in '''QB64''' include * > < : " | \ / with any amount of dot extensions being allowed in Windows. +* FILES lists can make the screen roll up. Try using SHELL "DIR" with the /P option. [http://www.computerhope.com/dirhlp.htm DIR command]. ==QBasic/QuickBASIC== -* Illegal filename characters in QBasic included '''* ? , > < ; : " | \ / + [ ]''' and more than one dot extension in [http://www.computerhope.com/issues/ch000209.htm DOS]. +* Illegal filename characters in QBasic included '''* ? , > < ; : " | \ / + [ ]''' and more than one dot extension in [http://www.computerhope.com/issues/ch000209.htm DOS]. {{PageExamples}} ''Example 1:'' Finding a list of all BAS files in the current folder. -{{CodeStart}}{{Cl|FILES}} "*.BAS" +{{CodeStart}}{{Cl|FILES}} "*.BAS" {{CodeEnd}} -<!-- broken link: <center>'''[http://i301.photobucket.com/albums/nn53/burger2227/FILESss.jpg Screenshot shows only the end of a long list of files]'''</center> --> +<!-- broken link: <center>'''[http://i301.photobucket.com/albums/nn53/burger2227/FILESss.jpg Screenshot shows only the end of a long list of files]'''</center> --> <!-- function obsoleted by _FILEEXISTS; function doesn't use the FILES statement and is not relevant in this context; may be moved to an exclusive page if desired; {{Parameter|Example 2:'' A function that verifies that a file exists if it is not empty. Note: This function will delete empty files. {{CodeStart}} '' '' -{{Cl|INPUT}} "Enter a file name: ", file$ +{{Cl|INPUT}} "Enter a file name: ", file$ {{Cl|IF}} Exist%(file$) {{Cl|THEN}} {{Cl|OPEN}} file$ {{Cl|FOR (file statement)|FOR}} {{Cl|INPUT (file mode)|INPUT}} {{Cl|AS}} #1: found% = -1 'function call demo {{Cl|CLOSE}} #1 -{{Cl|IF}} found% THEN {{Cl|PRINT}} "File exists!" {{Cl|ELSE}} {{Cl|PRINT}} "File not found!" +{{Cl|IF}} found% THEN {{Cl|PRINT}} "File exists!" {{Cl|ELSE}} {{Cl|PRINT}} "File not found!" {{Cl|END}} {{Cl|FUNCTION}} Exist% (filename$) @@ -43,20 +43,20 @@ f% = {{Cl|FREEFILE}} {{Cl|CLOSE}} #f% {{Cl|END FUNCTION}} '' '' {{CodeEnd}}{{small|Code by Ted Weissgerber}}}} ---> +--> ==Alternative file list solutions== ''Alternative 1:'' The DIR$ function adapted from PDS (7.1) returns a filename or a list when more than one exist. The file spec can use a path and/or wildcards. {{CodeStart}} '' '' {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 2 {{Cl|PRINT}} - {{Cl|LINE INPUT}} "Enter a file spec: ", spec$ + {{Cl|LINE INPUT}} "Enter a file spec: ", spec$ file$ = DIR$(spec$) 'use a file spec ONCE to find the last file name listed {{Cl|PRINT}} DIRCount%, file$, 'function can return the file count using {{Cl|SHARED}} variable - {{Cl|IF...THEN|IF}} DIRCount% > 1 {{Cl|THEN}} + {{Cl|IF...THEN|IF}} DIRCount% > 1 {{Cl|THEN}} DO K$ = {{Cl|INPUT$}}(1) - file$ = DIR$("") 'use an empty string parameter to return a list of files! + file$ = DIR$("") 'use an empty string parameter to return a list of files! {{Cl|PRINT}} file$, {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|LEN}}(file$) = 0 'file list ends with an empty string {{Cl|END IF}} @@ -65,13 +65,13 @@ f% = {{Cl|FREEFILE}} {{Cl|END}} {{Cl|FUNCTION}} DIR$ (spec$) -{{Cl|CONST}} TmpFile$ = "DIR$INF0.INF", ListMAX% = 500 'change maximum to suit your needs +{{Cl|CONST}} TmpFile$ = "DIR$INF0.INF", ListMAX% = 500 'change maximum to suit your needs {{Cl|SHARED}} DIRCount% 'returns file count if desired {{Cl|STATIC}} Ready%, Index%, DirList$() {{Cl|IF...THEN|IF}} {{Cl|NOT}} Ready% {{Cl|THEN}} {{Cl|REDIM}} DirList$(ListMAX%): Ready% = -1 '{{Cl|DIM}} array first use -{{Cl|IF...THEN|IF}} spec$ > "" {{Cl|THEN}} 'get file names when a spec is given - {{Cl|SHELL}} {{Cl|_HIDE}} "DIR " + spec$ + " /b > " + TmpFile$ - Index% = 0: DirList$(Index%) = "": ff% = {{Cl|FREEFILE}} +{{Cl|IF...THEN|IF}} spec$ > "" {{Cl|THEN}} 'get file names when a spec is given + {{Cl|SHELL}} {{Cl|_HIDE}} "DIR " + spec$ + " /b > " + TmpFile$ + Index% = 0: DirList$(Index%) = "": ff% = {{Cl|FREEFILE}} {{Cl|OPEN}} TmpFile$ {{Cl|FOR...NEXT|FOR}} {{Cl|APPEND}} {{Cl|AS}} #ff% size& = {{Cl|LOF}}(ff%) {{Cl|CLOSE}} #ff% @@ -84,19 +84,19 @@ f% = {{Cl|FREEFILE}} DIRCount% = Index% '{{Cl|SHARED}} variable can return the file count {{Cl|CLOSE}} #ff% {{Cl|KILL}} TmpFile$ -{{Cl|ELSE}} {{Cl|IF...THEN|IF}} Index% > 0 {{Cl|THEN}} Index% = Index% - 1 'no spec sends next file name +{{Cl|ELSE}} {{Cl|IF...THEN|IF}} Index% > 0 {{Cl|THEN}} Index% = Index% - 1 'no spec sends next file name {{Cl|END IF}} DIR$ = DirList$(Index%) {{Cl|END FUNCTION}} '' '' {{CodeEnd}} {{small|Code by Ted Weissgerber}} -:''Explanation:'' The function will verify that a file exists (even if it is empty) by returning its name, or it returns an empty string if no file exists. It can return a list of file names by using an empty string parameter("") after sending a wildcard spec to get the first file name. The number of file names found is returned by using the SHARED variable, '''DIRCount%'''. Unlike the PDS DIR$ function, '''it must use an empty string parameter as QB64 doesn't support optional parameters.''' The function does not delete empty files. +:''Explanation:'' The function will verify that a file exists (even if it is empty) by returning its name, or it returns an empty string if no file exists. It can return a list of file names by using an empty string parameter("") after sending a wildcard spec to get the first file name. The number of file names found is returned by using the SHARED variable, '''DIRCount%'''. Unlike the PDS DIR$ function, '''it must use an empty string parameter as QB64 doesn't support optional parameters.''' The function does not delete empty files. ''Alternative 2:'' -* The member-contributed [[FILELIST$]] function uses the mouse and does not affect your program screens. It can verify that a file name exists or display a list of long and short file names to choose from. It also avoids program errors when a file name does not exist. <!-- broken link: [http://i301.photobucket.com/albums/nn53/burger2227/FILE-ss2.jpg FILELIST$ function screenshot] --> +* The member-contributed [[FILELIST$]] function uses the mouse and does not affect your program screens. It can verify that a file name exists or display a list of long and short file names to choose from. It also avoids program errors when a file name does not exist. <!-- broken link: [http://i301.photobucket.com/albums/nn53/burger2227/FILE-ss2.jpg FILELIST$ function screenshot] --> -<!-- The referenced library is not present in this link anymore ''See Library:'' File Exist C++ Function that does not create a temp file. [http://qb64.net/wiki/index.php?title=C_Libraries#File_Exist FileExist Function] --> +<!-- The referenced library is not present in this link anymore ''See Library:'' File Exist C++ Function that does not create a temp file. [http://qb64.net/wiki/index.php?title=C_Libraries#File_Exist FileExist Function] --> {{PageSeeAlso}} * [[SHELL]], [[SCREEN (function)]] {{text|(See Example 3)}} @@ -110,4 +110,4 @@ DIR$ = DirList$(Index%) * [[$CONSOLE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/FIX.txt b/internal/help/FIX.txt index e5a70da5e..4818940ad 100644 --- a/internal/help/FIX.txt +++ b/internal/help/FIX.txt @@ -56,4 +56,4 @@ The [[FIX]] function rounds a numerical value to the next whole number closest t * [[/|Normal division]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/FOR...NEXT.txt b/internal/help/FOR...NEXT.txt index b03e34ebd..2dae8c475 100644 --- a/internal/help/FOR...NEXT.txt +++ b/internal/help/FOR...NEXT.txt @@ -37,7 +37,7 @@ FOR i = 10 TO 0 {{Cl|STEP}} -2 totaleven% = i + totaleven% PRINT totaleven%; NEXT -PRINT "After loop, i ="; i '' '' +PRINT "After loop, i ="; i '' '' {{CodeEnd}} {{OutputStart}}10 18 24 28 30 30 After loop, i = -2 {{OutputEnd}} @@ -46,13 +46,13 @@ PRINT "After loop, i ="; i '' '' ''Example 2:'' How an entire FOR loop block is ignored when the start and stop limits do not match the default or [[STEP]] increment. {{CodeStart}} '' '' -{{Cl|PRINT}} "hi" +{{Cl|PRINT}} "hi" {{Cl|FOR...NEXT|FOR}} i = 10 {{Cl|TO}} 1 'requires a negative {{Cl|STEP}} value - {{Cl|PRINT}} "lo" + {{Cl|PRINT}} "lo" {{Cl|NEXT}} -{{Cl|PRINT}} "bye" +{{Cl|PRINT}} "bye" {{CodeEnd}} {{OutputStart}}hi bye {{OutputEnd}} @@ -60,7 +60,7 @@ bye {{OutputEnd}} <!-- removed redundant example as Example 2 above shows exactly the same technique ''See Example:'' -* [http://qb64.net/wiki/index.php?title=Controller_Devices#Example Example that shows how ignoring bad FOR loops can work to a program's advantage without errors.] --> +* [http://qb64.net/wiki/index.php?title=Controller_Devices#Example Example that shows how ignoring bad FOR loops can work to a program's advantage without errors.] --> {{PageSeeAlso}} @@ -68,4 +68,4 @@ bye {{OutputEnd}} * [[DO...LOOP]], [[WHILE...WEND]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/FOR_(file_statement).txt b/internal/help/FOR_(file_statement).txt index bb5a5f750..0ed1a3411 100644 --- a/internal/help/FOR_(file_statement).txt +++ b/internal/help/FOR_(file_statement).txt @@ -23,21 +23,21 @@ {{Cl|CLS}} -{{Cl|OPEN}} "test.tst" {{Cl|FOR (file statement)|FOR}} {{Cl|OUTPUT}} {{Cl|AS}} #1 -{{Cl|PRINT (file statement)|PRINT}} #1, "If test.tst didn't exist:" -{{Cl|PRINT (file statement)|PRINT}} #1, "A new file was created named test.tst and then deleted." -{{Cl|PRINT (file statement)|PRINT}} #1, "If test.tst did exist:" -{{Cl|PRINT (file statement)|PRINT}} #1, "It was overwritten with this and deleted." +{{Cl|OPEN}} "test.tst" {{Cl|FOR (file statement)|FOR}} {{Cl|OUTPUT}} {{Cl|AS}} #1 +{{Cl|PRINT (file statement)|PRINT}} #1, "If test.tst didn't exist:" +{{Cl|PRINT (file statement)|PRINT}} #1, "A new file was created named test.tst and then deleted." +{{Cl|PRINT (file statement)|PRINT}} #1, "If test.tst did exist:" +{{Cl|PRINT (file statement)|PRINT}} #1, "It was overwritten with this and deleted." {{Cl|CLOSE}} #1 -{{Cl|OPEN}} "test.tst" {{Cl|FOR (file statement)|FOR}} {{Cl|INPUT (file mode)|INPUT}} {{Cl|AS}} #1 +{{Cl|OPEN}} "test.tst" {{Cl|FOR (file statement)|FOR}} {{Cl|INPUT (file mode)|INPUT}} {{Cl|AS}} #1 {{Cl|DO}} {{Cl|UNTIL}} {{Cl|EOF}}(1) {{Cl|INPUT (file statement)|INPUT}} #1, a$ {{Cl|PRINT}} a$ {{Cl|LOOP}} {{Cl|CLOSE}} #1 -{{Cl|KILL}} "test.tst" +{{Cl|KILL}} "test.tst" {{Cl|END}} @@ -55,4 +55,4 @@ It was overwritten with this and deleted. * [[OPEN]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/FRE.txt b/internal/help/FRE.txt index 1cbf9f0d7..ad2435ae9 100644 --- a/internal/help/FRE.txt +++ b/internal/help/FRE.txt @@ -22,11 +22,11 @@ The [[FRE]] function returns the amount of memory available in bytes to running {{PageExamples}} {{CodeStart}} '' '' ' {{Cl|$DYNAMIC}} -PRINT "Sizes in bytes before dimensioning arrays: "; {{Cl|FRE}}(""), {{Cl|FRE}}(0), {{Cl|FRE}}(-1), {{Cl|FRE}}(-2) +PRINT "Sizes in bytes before dimensioning arrays: "; {{Cl|FRE}}(""), {{Cl|FRE}}(0), {{Cl|FRE}}(-1), {{Cl|FRE}}(-2) {{Cl|DIM}} Array(100, 100), Text$(5000) -PRINT "Sizes in bytes after dimensioning arrays: "; {{Cl|FRE}}(""), {{Cl|FRE}}(0), {{Cl|FRE}}(-1), {{Cl|FRE}} (-2) '' '' +PRINT "Sizes in bytes after dimensioning arrays: "; {{Cl|FRE}}(""), {{Cl|FRE}}(0), {{Cl|FRE}}(-1), {{Cl|FRE}} (-2) '' '' {{CodeEnd}} ''Notes:'' Sizes returned may vary by computer used. FRE(-2) must be used in a running program. -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/FREEFILE.txt b/internal/help/FREEFILE.txt index c1cff4745..2a84dcf66 100644 --- a/internal/help/FREEFILE.txt +++ b/internal/help/FREEFILE.txt @@ -11,11 +11,11 @@ The [[FREEFILE]] function returns a [[LONG]] value that is an unused file access * File numbers [[CLOSE]]d are made available to [[FREEFILE]] for reuse immediately. * [[FREEFILE]] returns are normally sequential starting with 1. Only file numbers in use will not be returned. * [[OPEN]] each file number after each [[FREEFILE]] return or the values returned may be the same. -<!-- redundant * [[OPEN COM]] statements cannot use any number assigned to files already OPEN. --> +<!-- redundant * [[OPEN COM]] statements cannot use any number assigned to files already OPEN. --> {{PageSeeAlso}} * [[GET]], [[PUT]], [[CLOSE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/FUNCTION.txt b/internal/help/FUNCTION.txt index 764f6ece6..194b0fee9 100644 --- a/internal/help/FUNCTION.txt +++ b/internal/help/FUNCTION.txt @@ -33,13 +33,13 @@ A [[FUNCTION]] block statement is used to create a function procedure to return {{PageExamples}} ''Example 1:'' A simple function that returns the current path. Place [[FUNCTION]] or [[SUB]] procedures after the program [[END]]. {{CodeStart}} '' '' -{{Cl|PRINT}} "Current path = "; PATH$ +{{Cl|PRINT}} "Current path = "; PATH$ {{Cl|END}} {{Cl|FUNCTION}} PATH$ f% = {{Cl|FREEFILE}} - file$ = "D0Spath.inf" 'file name uses a zero to prevent an overwrite of existing file name - {{Cl|SHELL}} {{Cl|_HIDE}} "CD > " + file$ 'send screen information to a created text file + file$ = "D0Spath.inf" 'file name uses a zero to prevent an overwrite of existing file name + {{Cl|SHELL}} {{Cl|_HIDE}} "CD > " + file$ 'send screen information to a created text file {{Cl|OPEN}} file$ {{Cl|FOR (file statement)|FOR}} {{Cl|INPUT (file mode)|INPUT}} {{Cl|AS}} #f% 'file should exist with one line of text {{Cl|LINE INPUT (file statement)|LINE INPUT}} #f%, PATH$ 'read file path text to function name {{Cl|CLOSE}} #f% @@ -50,9 +50,9 @@ A [[FUNCTION]] block statement is used to create a function procedure to return ''Example 2:'' Returns a [[LONG]] array byte size required for a certain sized graphics screen pixel area [[GET (graphics statement)|GET]]. {{CodeStart}} '' '' -{{Cl|INPUT}} "Enter a screen mode: ", mode% -{{Cl|INPUT}} "Enter image width: ", wide& -{{Cl|INPUT}} "Enter image depth: ", deep& +{{Cl|INPUT}} "Enter a screen mode: ", mode% +{{Cl|INPUT}} "Enter image width: ", wide& +{{Cl|INPUT}} "Enter image depth: ", deep& IntegerArray& = ImageBufferSize&(wide&, deep&, mode%) \ 2 ' returns size of an {{Cl|INTEGER}} array. {{Cl|PRINT}} IntegerArray& {{Cl|END}} @@ -80,4 +80,4 @@ IntegerArray& = ImageBufferSize&(wide&, deep&, mode%) \ 2 ' retu * [[_EXIT (function)]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/GET.txt b/internal/help/GET.txt index 5c4774a54..de7b66b9a 100644 --- a/internal/help/GET.txt +++ b/internal/help/GET.txt @@ -10,7 +10,7 @@ The [[GET #]] statement reads data from a file or port device by bytes or record * The [[INTEGER]] or [[LONG]] byte {{Parameter|position}} in a [[BINARY]] file or the record {{Parameter|position}} in a [[RANDOM]] file '''must be greater than zero'''. * The {{Parameter|position}} can be omitted if the GET operations are consecutive based on the {{Parameter|targetVariable}} [[TYPE]] byte size. * The {{Parameter|targetVariable}} [[Data types|type]] or [[FIELD]] ''variable'' size determines the byte size and the next {{Parameter|position}} in the file. -* The first byte position in a file is 1. <!-- giving the previous information is enough: This may require adding one to an offset value when documentation uses that position as 0. --> +* The first byte position in a file is 1. <!-- giving the previous information is enough: This may require adding one to an offset value when documentation uses that position as 0. --> * GET does not require a byte or record {{Parameter|position}} or {{Parameter|targetVariable}} (or comma) when using a [[FIELD]] statement. * '''QB64''' can [[PUT]] the entire contents of an array to a file and later GET those contents to a {{Parameter|targetArray()}} (include brackets). * '''GET may ignore the end of a file and return bad data. If the [[EOF]] function returns -1 after a GET operation, it indicates that the data has ended.''' @@ -32,12 +32,12 @@ The [[GET #]] statement reads data from a file or port device by bytes or record {{Cl|DIM}} record {{Cl|AS}} variabletype {{Cl|DIM}} newrec {{Cl|AS}} variabletype -file$ = "testrand.inf" '<<<< filename may overwrite existing file +file$ = "testrand.inf" '<<<< filename may overwrite existing file number% = 1 '<<<<<<<<<< record number to write cannot be zero RecordLEN% = {{Cl|LEN}}(record) -{{Cl|PRINT}} RecordLEN%; "bytes" +{{Cl|PRINT}} RecordLEN%; "bytes" record.x = 255 -record.y = "Hello world!" +record.y = "Hello world!" record.z = 65535 {{Cl|PRINT}} record.x, record.y, record.z @@ -47,7 +47,7 @@ record.z = 65535 {{Cl|OPEN}} file$ {{Cl|FOR...NEXT|FOR}} {{Cl|RANDOM}} {{Cl|AS}} #2 {{Cl|LEN}} = RecordLEN% NumRecords% = {{Cl|LOF}}(2) \ RecordLEN% -PRINT NumRecords%; "records" +PRINT NumRecords%; "records" {{Cl|GET}} #2, NumRecords% , newrec 'GET last record available {{Cl|CLOSE}} #2 @@ -73,7 +73,7 @@ PRINT NumRecords%; "records" {{Cl|NEXT}} showme 'display array contents -{{Cl|OPEN}} "BINFILE.BIN" {{Cl|FOR...NEXT|FOR}} {{Cl|BINARY}} {{Cl|AS}} #1 +{{Cl|OPEN}} "BINFILE.BIN" {{Cl|FOR...NEXT|FOR}} {{Cl|BINARY}} {{Cl|AS}} #1 {{Cl|PUT}} #1, , array() @@ -81,7 +81,7 @@ showme 'display array contents showme {{Cl|CLOSE}} #1 -{{Cl|OPEN}} "BINFILE.BIN" {{Cl|FOR...NEXT|FOR}} {{Cl|BINARY}} {{Cl|AS}} #2 +{{Cl|OPEN}} "BINFILE.BIN" {{Cl|FOR...NEXT|FOR}} {{Cl|BINARY}} {{Cl|AS}} #2 {{Cl|GET}} #2, , array() {{Cl|CLOSE}} #2 showme 'display array after transfer from file @@ -92,7 +92,7 @@ showme 'display array after transfer from file {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 100 {{Cl|PRINT}} array(i); {{Cl|NEXT}} -{{Cl|PRINT}} "done" +{{Cl|PRINT}} "done" {{Cl|END SUB}} '' '' {{CodeEnd}} : ''Note:'' Use empty brackets in QB64 when using [[GET]] to create an array or [[PUT]] to create a [[BINARY]] data file. @@ -105,4 +105,4 @@ showme 'display array after transfer from file * [[LEN]], [[LOF]], [[EOF]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/GET_(TCP%2FIP_statement).txt b/internal/help/GET_(TCP%2FIP_statement).txt index a637a1883..be66ee4c8 100644 --- a/internal/help/GET_(TCP%2FIP_statement).txt +++ b/internal/help/GET_(TCP%2FIP_statement).txt @@ -48,4 +48,4 @@ * [https://curl.haxx.se/ cURL], [[WGET]] (HTTP and FTP file transfer) -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/GET_(graphics_statement).txt b/internal/help/GET_(graphics_statement).txt index c699cd20d..08c1ada0d 100644 --- a/internal/help/GET_(graphics_statement).txt +++ b/internal/help/GET_(graphics_statement).txt @@ -41,13 +41,13 @@ The [[GET (graphics statement)|GET]] statement is used in graphics to store a bo {{Cl|DIM}} BG(300), Box(300), SC(127) ' BG holds background images. Box holds the Box image. {{Cl|SCREEN (statement)|SCREEN}} 13 ' graphic coordinate minimums are 0 to 319 column or 199 row maximums. ' set up screen background - {{Cl|COLOR}} 4: {{Cl|LOCATE}} 10, 5: {{Cl|PRINT}} "Multikey Keyboard input routine" - {{Cl|COLOR}} 10: {{Cl|LOCATE}} 12, 4: {{Cl|PRINT}} "Use the arrow keys to move the box." - {{Cl|LOCATE}} 13, 4: {{Cl|PRINT}} "Note that you can press two or more" - {{Cl|LOCATE}} 14, 4: {{Cl|PRINT}} "keys at once for diagonal movement!" - {{Cl|COLOR}} 14: {{Cl|LOCATE}} 16, 4: {{Cl|PRINT}} " Also demonstrates how {{Cl|GET (graphics statement)|GET}} and PUT " - {{Cl|LOCATE}} 17, 4: {{Cl|PRINT}} "are used to preserve the background." - {{Cl|COLOR}} 11: {{Cl|LOCATE}} 20, 11: {{Cl|PRINT}} "Press [Esc] to quit" + {{Cl|COLOR}} 4: {{Cl|LOCATE}} 10, 5: {{Cl|PRINT}} "Multikey Keyboard input routine" + {{Cl|COLOR}} 10: {{Cl|LOCATE}} 12, 4: {{Cl|PRINT}} "Use the arrow keys to move the box." + {{Cl|LOCATE}} 13, 4: {{Cl|PRINT}} "Note that you can press two or more" + {{Cl|LOCATE}} 14, 4: {{Cl|PRINT}} "keys at once for diagonal movement!" + {{Cl|COLOR}} 14: {{Cl|LOCATE}} 16, 4: {{Cl|PRINT}} " Also demonstrates how {{Cl|GET (graphics statement)|GET}} and PUT " + {{Cl|LOCATE}} 17, 4: {{Cl|PRINT}} "are used to preserve the background." + {{Cl|COLOR}} 11: {{Cl|LOCATE}} 20, 11: {{Cl|PRINT}} "Press [Esc] to quit" x = 150: y = 50: PX = x: PY = y ' actual box starting position {{Cl|GET (graphics statement)|GET}} (x, y)-(x + 15, y + 15), BG ' {{Cl|GET (graphics statement)|GET}} original BG at start box position @@ -60,14 +60,14 @@ The [[GET (graphics statement)|GET]] statement is used in graphics to store a bo a$ = {{Cl|INKEY$}} ' So the keyboard buffer won't get full code% = {{Cl|INP}}({{Cl|&H}}60) ' Get keyboard scan code from port 96 {{Cl|IF...THEN|IF}} code% < 128 {{Cl|THEN}} SC(code%) = 1 {{Cl|ELSE}} SC(code% - 128) = 0 'true/false values to array - {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|TIMER}} > t!' loop until one tick has passed + {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|TIMER}} > t!' loop until one tick has passed PX = x: PY = y ' previous coordinates {{Cl|IF...THEN|IF}} SC(75) = 1 {{Cl|THEN}} x = x - 5: {{Cl|IF...THEN|IF}} x < 0 {{Cl|THEN}} x = 0 - {{Cl|IF...THEN|IF}} SC(77) = 1 {{Cl|THEN}} x = x + 5: {{Cl|IF...THEN|IF}} x > 304 {{Cl|THEN}} x = 304 + {{Cl|IF...THEN|IF}} SC(77) = 1 {{Cl|THEN}} x = x + 5: {{Cl|IF...THEN|IF}} x > 304 {{Cl|THEN}} x = 304 {{Cl|IF...THEN|IF}} SC(72) = 1 {{Cl|THEN}} y = y - 5: {{Cl|IF...THEN|IF}} y < 0 {{Cl|THEN}} y = 0 - {{Cl|IF...THEN|IF}} SC(80) = 1 {{Cl|THEN}} y = y + 5: {{Cl|IF...THEN|IF}} y > 184 {{Cl|THEN}} y = 184 - {{Cl|IF...THEN|IF}} x <> PX {{Cl|OR (boolean)|OR}} y <> PY {{Cl|THEN}} ' look for a changed coordinate value + {{Cl|IF...THEN|IF}} SC(80) = 1 {{Cl|THEN}} y = y + 5: {{Cl|IF...THEN|IF}} y > 184 {{Cl|THEN}} y = 184 + {{Cl|IF...THEN|IF}} x <> PX {{Cl|OR (boolean)|OR}} y <> PY {{Cl|THEN}} ' look for a changed coordinate value {{Cl|WAIT}} 936, 8: {{Cl|PUT (graphics statement)|PUT}}(PX, PY), BG, {{Cl|PSET}} ' replace previous BG first {{Cl|GET (graphics statement)|GET}} (x, y)-(x + 15, y + 15), BG ' {{Cl|GET (graphics statement)|GET}} BG at new position before box is set {{Cl|PUT (graphics statement)|PUT}}(x, y), Box, {{Cl|PSET}} ' PUT box image at new position @@ -106,4 +106,4 @@ a& = {{Cl|_NEWIMAGE}}(800, 600, 13) 'larger surface a& emulates scre * [[Bitmaps]], [[GET and PUT Demo]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/GOSUB.txt b/internal/help/GOSUB.txt index 84b533724..2645a8724 100644 --- a/internal/help/GOSUB.txt +++ b/internal/help/GOSUB.txt @@ -7,24 +7,24 @@ {{PageDescription}} * Use [[RETURN]] in a sub procedure to return to the next line of code after the original [[GOSUB]] call. [[END]] or [[SYSTEM]] can also be used to end program. -<!-- needs clarification: * A procedure loop may be used to return automatically instead of using return. --> +<!-- needs clarification: * A procedure loop may be used to return automatically instead of using return. --> * GOSUB and GOTO can be used '''within''' [[SUB]] or [[FUNCTION]] procedures, but cannot refer to a label located outside the procedure. ==QBasic/QuickBASIC== -* Too many GOSUBs without a [[RETURN]] can eventually cause "Out of Stack Errors" in QBasic as each GOSUB uses memory to store the location to return to. Each [[RETURN]] frees the memory of the GOSUB it returns to. +* Too many GOSUBs without a [[RETURN]] can eventually cause "Out of Stack Errors" in QBasic as each GOSUB uses memory to store the location to return to. Each [[RETURN]] frees the memory of the GOSUB it returns to. {{PageExamples}} ''Example:'' Simple usage of GOSUB {{CodeStart}} -{{Cl|PRINT}} "1. It goes to the subroutine." +{{Cl|PRINT}} "1. It goes to the subroutine." {{Cl|GOSUB}} subroutine -{{Cl|PRINT}} "3. And it returns." +{{Cl|PRINT}} "3. And it returns." {{Cl|END}} subroutine: -{{Cl|PRINT}} "2. It is at the subroutine." +{{Cl|PRINT}} "2. It is at the subroutine." {{Cl|RETURN}} {{CodeEnd}} @@ -43,17 +43,17 @@ subroutine: start: a = a + 1 -{{Cl|IF...THEN|IF}} a = 1 {{Cl|THEN}} {{Cl|GOSUB}} here: {{Cl|PRINT}} "It returned to IF a = 1": {{Cl|END}} -{{Cl|IF...THEN|IF}} a = 2 {{Cl|THEN}} {{Cl|GOSUB}} there: {{Cl|PRINT}} "It returned to IF a = 2": {{Cl|RETURN}} +{{Cl|IF...THEN|IF}} a = 1 {{Cl|THEN}} {{Cl|GOSUB}} here: {{Cl|PRINT}} "It returned to IF a = 1": {{Cl|END}} +{{Cl|IF...THEN|IF}} a = 2 {{Cl|THEN}} {{Cl|GOSUB}} there: {{Cl|PRINT}} "It returned to IF a = 2": {{Cl|RETURN}} here: -{{Cl|PRINT}} "It went here." +{{Cl|PRINT}} "It went here." {{Cl|GOTO}} start there: -{{Cl|PRINT}} "It went there." +{{Cl|PRINT}} "It went there." {{Cl|RETURN}} {{CodeEnd}} {{small|Code by Cyperium}} @@ -63,7 +63,7 @@ It went there. It returned to IF a = 2 It returned to IF a = 1 {{OutputEnd}} -''Explanation:'' When a = 1 it uses GOSUB to go to "here:", then it uses GOTO to go back to "start:". a is increased by one so when a = 2 it uses GOSUB to go to "there:", and uses RETURN to go the last GOSUB (which is on the IF a = 2 line), it then encounters another RETURN which makes it return to the first GOSUB call we used on the IF a = 1 line. +''Explanation:'' When a = 1 it uses GOSUB to go to "here:", then it uses GOTO to go back to "start:". a is increased by one so when a = 2 it uses GOSUB to go to "there:", and uses RETURN to go the last GOSUB (which is on the IF a = 2 line), it then encounters another RETURN which makes it return to the first GOSUB call we used on the IF a = 1 line. {{PageSeeAlso}} @@ -74,4 +74,4 @@ It returned to IF a = 1 * [[Line number]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/GOTO.txt b/internal/help/GOTO.txt index 0c01522a9..27efd842b 100644 --- a/internal/help/GOTO.txt +++ b/internal/help/GOTO.txt @@ -19,11 +19,11 @@ The [[GOTO]] statement sends the procedure to a line label or a line number in t {{PageExamples}} ''Example:'' {{CodeStart}} '' '' -1 {{Cl|PRINT}} "first line": {{Cl|GOTO}} gohere -2 {{Cl|PRINT}} "second line": {{Cl|GOTO}} 3 +1 {{Cl|PRINT}} "first line": {{Cl|GOTO}} gohere +2 {{Cl|PRINT}} "second line": {{Cl|GOTO}} 3 gohere: -{{Cl|PRINT}} "third line" +{{Cl|PRINT}} "third line" {{Cl|GOTO}} 2 3 {{Cl|END}} '' '' @@ -34,7 +34,7 @@ third line second line {{OutputEnd}} -:''Explanation:'' After it prints "first line" it goes to the line label "gohere" where it prints "third line", then it goes to the line that is numbered "2" and prints "second line" and goes to line number 3 and an [[END]] statement which ends the program. +:''Explanation:'' After it prints "first line" it goes to the line label "gohere" where it prints "third line", then it goes to the line that is numbered "2" and prints "second line" and goes to line number 3 and an [[END]] statement which ends the program. {{PageSeeAlso}} @@ -45,4 +45,4 @@ second line * [[Line number|Line numbers and labels]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/Greater_Than.txt b/internal/help/Greater_Than.txt index c9b1788a9..e64326056 100644 --- a/internal/help/Greater_Than.txt +++ b/internal/help/Greater_Than.txt @@ -1,19 +1,19 @@ -The '''>''' condition symbol denotes that a value must be greater than another value for the condition to be True. +The '''>''' condition symbol denotes that a value must be greater than another value for the condition to be True. -''Example usage:'' IF x [[Greater_Than|>]] 320 THEN PRINT "Right of screen" +''Example usage:'' IF x [[Greater_Than|>]] 320 THEN PRINT "Right of screen" * Statements will evaluate as True or -1 when the first value is greater or False or 0 when equal or the first value is less. -* More than one > symbol in a numerical statement will create a [[Boolean]] evaluation of the ensuing numerical value. +* More than one > symbol in a numerical statement will create a [[Boolean]] evaluation of the ensuing numerical value. ''See also:'' * [[Equal|=]] -* [[Not_Equal|<>]] +* [[Not_Equal|<>]] * [[Less_Than|<]] * [[Relational Operations]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/Greater_Than_Or_Equal.txt b/internal/help/Greater_Than_Or_Equal.txt index cea5a2fef..58fd7458e 100644 --- a/internal/help/Greater_Than_Or_Equal.txt +++ b/internal/help/Greater_Than_Or_Equal.txt @@ -1,15 +1,15 @@ -The '''>=''' condition symbol denotes that a value must be greater than or equal to another value for the condition to be True. +The '''>=''' condition symbol denotes that a value must be greater than or equal to another value for the condition to be True. -''Example usage:'' IF x [[Greater_Than|>]] 320 THEN PRINT "Right or center of screen" +''Example usage:'' IF x [[Greater_Than|>]] 320 THEN PRINT "Right or center of screen" ''See also:'' * [[Equal|=]] -* [[Not_Equal|<>]] +* [[Not_Equal|<>]] * [[Less_Than_Or_Equal|<=]] * [[Relational Operations]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/HEX$.txt b/internal/help/HEX$.txt index 5dc9f9394..0efa38027 100644 --- a/internal/help/HEX$.txt +++ b/internal/help/HEX$.txt @@ -8,16 +8,16 @@ The [[HEX$]] function returns the base 16 hexadecimal representation of an [[INT {{PageDescription}} * The function returns the string hexadecimal (base-16) representation of {{Parameter|decimalNumber}}. * The function does not return a leading sign space so [[LTRIM$]] is not necessary. -<!-- Confusing hack hidden: * Can be used in place of [[STR$]] to trim both sides of positive decimal values 0 to 9 only.}} --> -* [[VAL]] can convert the string value back to a decimal value by prefixing the string return with "&H": {{InlineCode}}dec = VAL("&H" + hexvar$){{InlineCodeEnd}}. +<!-- Confusing hack hidden: * Can be used in place of [[STR$]] to trim both sides of positive decimal values 0 to 9 only.}} --> +* [[VAL]] can convert the string value back to a decimal value by prefixing the string return with "&H": {{InlineCode}}dec = VAL("&H" + hexvar$){{InlineCodeEnd}}. {{PageExamples}} ''Example 1:'' Comparing decimal, hexadecimal and octal string values 0 to 15. {{CodeStart}} '' '' -LOCATE 2, 20: PRINT " Decimal | Hexadecimal | Octal " -LOCATE 3, 20: PRINT "-----------+-------------+--------" - template$ = " \ \ | \\ | \\ " +LOCATE 2, 20: PRINT " Decimal | Hexadecimal | Octal " +LOCATE 3, 20: PRINT "-----------+-------------+--------" + template$ = " \ \ | \\ | \\ " FOR n% = 0 TO 15 LOCATE 4 + n%, 20: {{Cl|PRINT USING}} template$; {{Cl|STR$}}(n%); {{Cl|HEX$}}(n%); {{Cl|OCT$}}(n%) @@ -49,8 +49,8 @@ NEXT n% '' '' ''Example 2:'' Converting hex value to decimal. {{CodeStart}} h$ = {{Cl|HEX$}}(255) -{{Cl|PRINT}} "Hex: "; h$ -{{Cl|PRINT}} "Converting Hex value to Decimal:"; {{Cl|VAL}}("&H" + h$) +{{Cl|PRINT}} "Hex: "; h$ +{{Cl|PRINT}} "Converting Hex value to Decimal:"; {{Cl|VAL}}("&H" + h$) {{CodeEnd}} {{OutputStart}} @@ -66,4 +66,4 @@ Converting Hex value to Decimal: 255 * [[HEX$ 32 Bit Values]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/IF...THEN.txt b/internal/help/IF...THEN.txt index 9b4f29639..f6233c76f 100644 --- a/internal/help/IF...THEN.txt +++ b/internal/help/IF...THEN.txt @@ -38,10 +38,10 @@ {{Template:RelationalTable}} -<center> When evaluating a number value, no IF value > 0 operation is necessary for values not 0. Use: IF value THEN </center> +<center> When evaluating a number value, no IF value > 0 operation is necessary for values not 0. Use: IF value THEN </center> -<center>'''Boolean Conditional Operators:'''</center> +<center>'''Boolean Conditional Operators:'''</center> :::::* [[AND (boolean)]] can be used to add extra conditions to a boolean statement evaluation. @@ -49,28 +49,28 @@ :::::* Parenthesis are allowed inside of boolean statements to clarify an evaluation. -<center>'''Mathematical Logical operators:'''</center> -<center>* Truth table of the 6 BASIC Logical Operators:</center> +<center>'''Mathematical Logical operators:'''</center> +<center>* Truth table of the 6 BASIC Logical Operators:</center> {{Template:LogicalTruthTable}} -<center>* '''Note that Basic returns -1 for True and 0 for False.'''</center> +<center>* '''Note that Basic returns -1 for True and 0 for False.'''</center> {{PageExamples}} ''Example 1:'' In a one line IF statement, only [[REM]] can be used to comment out the action without an [[END IF]] error: {{CodeStart}} '' '' -{{Cl|INPUT}} "Enter a number over or under 100: ", x -{{Cl|IF...THEN|IF}} x > 100 {{Cl|THEN}} {{Cl|PRINT}} x -{{Cl|IF...THEN|IF}} x > 100 {{Cl|THEN}} {{Cl|REM}} {{Cl|PRINT}} x '' ' +{{Cl|INPUT}} "Enter a number over or under 100: ", x +{{Cl|IF...THEN|IF}} x > 100 {{Cl|THEN}} {{Cl|PRINT}} x +{{Cl|IF...THEN|IF}} x > 100 {{Cl|THEN}} {{Cl|REM}} {{Cl|PRINT}} x '' ' {{CodeEnd}} ''Example 2:'' IF statement blocks require that the IF THEN and END IF statements be separate from the code executed. {{CodeStart}} '' '' -{{Cl|INPUT}} "Enter a number over or under 100: ", x -{{Cl|IF...THEN|IF}} x > 100 {{Cl|THEN}} +{{Cl|INPUT}} "Enter a number over or under 100: ", x +{{Cl|IF...THEN|IF}} x > 100 {{Cl|THEN}} y = 200 {{Cl|PRINT}} y {{Cl|PRINT}} x @@ -80,38 +80,38 @@ ''Example 3:'' True or False evaluation of a numerical value executes only when the value is not 0. '''Cannot evaluate [[STRING]] values.''' {{CodeStart}} '' '' -{{Cl|INPUT}} "Enter a number or just hit Enter: ", x +{{Cl|INPUT}} "Enter a number or just hit Enter: ", x {{Cl|IF...THEN|IF}} x {{Cl|THEN}} {{Cl|PRINT}} x '' '' {{CodeEnd}} -:Example will only print if a numerical value is True (positive or negative). (Equivalent to: IF x > 0 OR x < 0 THEN evaluation) +:Example will only print if a numerical value is True (positive or negative). (Equivalent to: IF x > 0 OR x < 0 THEN evaluation) ''Example 4:'' Multiple evaluations using parenthesis to determine the order. {{CodeStart}} '' '' -{{Cl|INPUT}} "Enter a number over or under 100 or 50: ", value -{{Cl|IF...THEN|IF}} (value% > 100 {{Cl|AND (boolean)|AND}} value% < 200) {{Cl|OR (boolean)|OR}} value% = 50 {{Cl|THEN}} {{Cl|PRINT}} "OK" '' '' +{{Cl|INPUT}} "Enter a number over or under 100 or 50: ", value +{{Cl|IF...THEN|IF}} (value% > 100 {{Cl|AND (boolean)|AND}} value% < 200) {{Cl|OR (boolean)|OR}} value% = 50 {{Cl|THEN}} {{Cl|PRINT}} "OK" '' '' {{CodeEnd}} ''Example 5:'' Using multiple IF options in a one line statement. {{CodeStart}} '' '' -{{Cl|INPUT}} "Enter a number over or under 200: ", x -{{Cl|IF...THEN|IF}} x > 200 {{Cl|THEN}} {{Cl|PRINT}} "High" {{Cl|{{Cl|ELSEIF}}}} x < 0 {{Cl|THEN}} {{Cl|PRINT}} "Low" {{Cl|{{Cl|ELSE}}}} {{Cl|PRINT}} "OK" +{{Cl|INPUT}} "Enter a number over or under 200: ", x +{{Cl|IF...THEN|IF}} x > 200 {{Cl|THEN}} {{Cl|PRINT}} "High" {{Cl|{{Cl|ELSEIF}}}} x < 0 {{Cl|THEN}} {{Cl|PRINT}} "Low" {{Cl|{{Cl|ELSE}}}} {{Cl|PRINT}} "OK" '' '' {{CodeEnd}} ''Example 6:'' [[STRING]] values can be compared using greater than, less than, not equal to or equal to operators only. {{CodeStart}} '' '' -PRINT "Press a letter key: "; +PRINT "Press a letter key: "; Key$ = {{Cl|INPUT$}}(1) PRINT Key$ -IF Key$ >= {{Cl|CHR$}}(65) AND Key$ <= {{Cl|CHR$}}(90) THEN PRINT "A to Z" +IF Key$ >= {{Cl|CHR$}}(65) AND Key$ <= {{Cl|CHR$}}(90) THEN PRINT "A to Z" {{CodeEnd}} : ''Explanation:'' Long [[STRING]] expression values are compared by their cumulative [[ASCII]] code values. -<center>'''QBasic decimal point value comparison errors'''</center> +<center>'''QBasic decimal point value comparison errors'''</center> * Floating decimal point numerical values may not be compared as exactly the same value. QB64 will compare them the same. :''Example:'' QBasic would print ''unequal'' in the IF comparison code below even though it is exactly the same value printed. {{CodeStart}} '' '' @@ -119,7 +119,7 @@ x# = 5 / 10 y# = 6 / 10 z# = x# + y# {{Cl|PRINT}} x#, y#, z# -{{Cl|IF...THEN|IF}} x# + y# = z# {{Cl|THEN}} {{Cl|PRINT}} "equal" {{Cl|ELSE}} {{Cl|PRINT}} "unequal" '' '' +{{Cl|IF...THEN|IF}} x# + y# = z# {{Cl|THEN}} {{Cl|PRINT}} "equal" {{Cl|ELSE}} {{Cl|PRINT}} "unequal" '' '' {{CodeEnd}} : Note: QB64 will make the calculation correctly and print ''equal''. Change older program code that relies on the error accordingly. @@ -132,4 +132,4 @@ z# = x# + y# * [[Boolean]] {{text|(numerical comparisons return a true or false value)}} -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/IMP.txt b/internal/help/IMP.txt index f7c7248c7..23c23b1bf 100644 --- a/internal/help/IMP.txt +++ b/internal/help/IMP.txt @@ -20,4 +20,4 @@ The [[IMP]] logical operator converts the result of two comparative values and r * [[Boolean]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/INKEY$.txt b/internal/help/INKEY$.txt index 3b4684f1a..e01ac431d 100644 --- a/internal/help/INKEY$.txt +++ b/internal/help/INKEY$.txt @@ -7,11 +7,11 @@ The [[INKEY$]] function returns user input as [[ASCII]] [[STRING]] character(s) {{PageDescription}} * Returns [[ASCII]] character string values in upper or lower cases. See: [[UCASE$]] and [[LCASE$]] -* Returns "" if no key has been pressed since the last keyboard read. +* Returns "" if no key has been pressed since the last keyboard read. * Some control keys cannot be read by INKEY$ or will return 2 byte [[ASCII]] codes. * 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. +* <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. * Returns can be evaluated as certain [[ASCII]] characters or codes. {{WhiteStart}}' '''ASCII Keyboard Codes''' @@ -24,10 +24,10 @@ The [[INKEY$]] function returns user input as [[ASCII]] [[STRING]] character(s) '''' Tab Q W E R T Y U I O P [{ ]} \| Del End PDn 7Hme 8/▲ 9PU + ''' ' 9 81 87 69 82 84 89 85 73 79 80 123 125 124 +83 +79 +81 +71 +72 +73 43 ''' 113 119 101 114 116 121 117 105 111 112 91 93 92 55 56 57 '' -'''' CapL A S D F G H J K L ;: '" Enter 4/◄- 5 6/-► +'''' CapL A S D F G H J K L ;: '" Enter 4/◄- 5 6/-► ' - 65 83 68 70 71 72 74 75 76 58 34 13 +75 +76 +77 '''E''' ''' 97 115 100 102 103 104 106 107 108 59 39 52 53 54 '' '''n''' -'''' Shift Z X C V B N M ,< .> /? Shift ▲ 1End 2/▼ 3PD t''' +'''' Shift Z X C V B N M ,< .> /? Shift ▲ 1End 2/▼ 3PD t''' ' * 90 88 67 86 66 78 77 60 62 63 * +72 +79 +80 +81 '''e''' ''' 122 120 99 118 98 110 109 44 46 47 49 50 51 '' '''r''' '''' Ctrl Win Alt Spacebar Alt Win Menu Ctrl ◄- ▼ -► 0Ins .Del ''' @@ -40,58 +40,58 @@ The [[INKEY$]] function returns user input as [[ASCII]] [[STRING]] character(s) ==Two Byte Combinations== * INKEY$ 2 byte combinations always begin with [[CHR$]](0). [[ASC]] will always read the first byte code as zero. -* Read the second byte code using: '''{{text|code2 <nowiki>=</nowiki> ASC(press$, 2)|green}}''' +* Read the second byte code using: '''{{text|code2 <nowiki>=</nowiki> ASC(press$, 2)|green}}''' -<center>'''[[ASCII#Two_Byte_Codes|Two Byte Ctrl, Alt and Shift + Function key combinations]]'''</center> +<center>'''[[ASCII#Two_Byte_Codes|Two Byte Ctrl, Alt and Shift + Function key combinations]]'''</center> -{{WhiteStart}} '''Two Byte Characters    Key                 CHR$(0) + "?" ''' +{{WhiteStart}} '''Two Byte Characters    Key                 CHR$(0) + "?" ''' CHR$(0) + CHR$(16-50) [Alt] + letter - CHR$(0) + CHR$(59) [F1] ";" - CHR$(0) + CHR$(60) [F2] "<" - CHR$(0) + CHR$(61) [F3] "=" - CHR$(0) + CHR$(62) [F4] ">" - CHR$(0) + CHR$(63) [F5] "?" - CHR$(0) + CHR$(64) [F6] "@" - CHR$(0) + CHR$(65) [F7] "A" - CHR$(0) + CHR$(66) [F8] "B" - CHR$(0) + CHR$(67) [F9] "C" - CHR$(0) + CHR$(68) [F10] "D" - CHR$(0) + CHR$(71) [Home] "G" - CHR$(0) + CHR$(72) [↑] Arrow "H" - CHR$(0) + CHR$(73) [Page Up] "I" - CHR$(0) + CHR$(75) [←] Arrow "K" - CHR$(0) + CHR$(76) [5 NumberPad] "L" (NumLock off in QB64) - CHR$(0) + CHR$(77) [→] Arrow "M" - CHR$(0) + CHR$(79) [End] "O" - CHR$(0) + CHR$(80) [↓] Arrow "P" - CHR$(0) + CHR$(81) [Page Down] "Q" - CHR$(0) + CHR$(82) [Insert] "R" - CHR$(0) + CHR$(83) [Delete] "S" + CHR$(0) + CHR$(59) [F1] ";" + CHR$(0) + CHR$(60) [F2] "<" + CHR$(0) + CHR$(61) [F3] "=" + CHR$(0) + CHR$(62) [F4] ">" + CHR$(0) + CHR$(63) [F5] "?" + CHR$(0) + CHR$(64) [F6] "@" + CHR$(0) + CHR$(65) [F7] "A" + CHR$(0) + CHR$(66) [F8] "B" + CHR$(0) + CHR$(67) [F9] "C" + CHR$(0) + CHR$(68) [F10] "D" + CHR$(0) + CHR$(71) [Home] "G" + CHR$(0) + CHR$(72) [↑] Arrow "H" + CHR$(0) + CHR$(73) [Page Up] "I" + CHR$(0) + CHR$(75) [←] Arrow "K" + CHR$(0) + CHR$(76) [5 NumberPad] "L" (NumLock off in QB64) + CHR$(0) + CHR$(77) [→] Arrow "M" + CHR$(0) + CHR$(79) [End] "O" + CHR$(0) + CHR$(80) [↓] Arrow "P" + CHR$(0) + CHR$(81) [Page Down] "Q" + CHR$(0) + CHR$(82) [Insert] "R" + CHR$(0) + CHR$(83) [Delete] "S" CHR$(0) + CHR$(84-93) [Shift] + F1-10 CHR$(0) + CHR$(94-103) [Ctrl] + F1-10 CHR$(0) + CHR$(104-113) [Alt] + F1-10 CHR$(0) + CHR$(114-119) [Ctrl] + keypad CHR$(0) + CHR$(120-129) [Alt] + number - CHR$(0) + CHR$(130 or 131) [Alt] + _/- or +/= "é" or "â" - CHR$(0) + CHR$(133) [F11] "à" - CHR$(0) + CHR$(134) [F12] "å" - CHR$(0) + CHR$(135) [Shift] + [F11] "ç" - CHR$(0) + CHR$(136) [Shift] + [F12] "ê" - CHR$(0) + CHR$(137) [Ctrl] + [F11] "ë" - CHR$(0) + CHR$(138) [Ctrl] + [F12] "è" - CHR$(0) + CHR$(139) [Alt] + [F11] "ï" - CHR$(0) + CHR$(140) [Alt] + [F12] "î" + CHR$(0) + CHR$(130 or 131) [Alt] + _/- or +/= "é" or "â" + CHR$(0) + CHR$(133) [F11] "à" + CHR$(0) + CHR$(134) [F12] "å" + CHR$(0) + CHR$(135) [Shift] + [F11] "ç" + CHR$(0) + CHR$(136) [Shift] + [F12] "ê" + CHR$(0) + CHR$(137) [Ctrl] + [F11] "ë" + CHR$(0) + CHR$(138) [Ctrl] + [F12] "è" + CHR$(0) + CHR$(139) [Alt] + [F11] "ï" + CHR$(0) + CHR$(140) [Alt] + [F12] "î" {{WhiteEnd}} -:In '''QB64''', [[CVI]] can be used to get the [[_KEYDOWN]] 2-byte code value. Example: '''{{text|status <nowiki>=</nowiki> _KEYDOWN(CVI(CHR$(0) + "P"))|green}}''' +:In '''QB64''', [[CVI]] can be used to get the [[_KEYDOWN]] 2-byte code value. Example: '''{{text|status <nowiki>=</nowiki> _KEYDOWN(CVI(CHR$(0) + "P"))|green}}''' {{PageExamples}} ''Example 1:'' Clearing the keyboard buffer after [[SLEEP]] delays for later [[INPUT]]. -{{CodeStart}}{{Cl|PRINT}} "Press any keyboard typing key to end SLEEP" +{{CodeStart}}{{Cl|PRINT}} "Press any keyboard typing key to end SLEEP" {{Cl|SLEEP}} -{{Cl|DO}}: K$ = {{Cl|INKEY$}}: {{Cl|PRINT}} K$: {{Cl|LOOP}} {{Cl|UNTIL}} K$ = "" '' '' +{{Cl|DO}}: K$ = {{Cl|INKEY$}}: {{Cl|PRINT}} K$: {{Cl|LOOP}} {{Cl|UNTIL}} K$ = "" '' '' {{CodeEnd}} :''Explanation:'' [[SLEEP]] key presses will be kept in the keyboard buffer and may be added into an [[INPUT]] later. :See also: [[_KEYCLEAR]] @@ -100,39 +100,39 @@ The [[INKEY$]] function returns user input as [[ASCII]] [[STRING]] character(s) ''Example 2:'' Entering a Ctrl + letter keypress combination will print [[ASCII]] Control characters 1 to 26. . {{CodeStart}}DO K$ = {{Cl|INKEY$}} - {{Cl|IF...THEN|IF}} K$ <> "" {{Cl|THEN}} {{Cl|PRINT}} K$; " "; + {{Cl|IF...THEN|IF}} K$ <> "" {{Cl|THEN}} {{Cl|PRINT}} K$; " "; {{Cl|LOOP}} {{Cl|UNTIL}} K$ = {{Cl|CHR$}}(27) 'Esc key exit '' '' {{CodeEnd}} : ''Note:'' The above code will print Esc arrow, Backspace symbol, and 2 byte characters led by CHR$(0) in addition to normal keys. -''Example 3:'' Use [[UCASE$]](INKEY$) in a keyboard read loop looking for uppercase "Y" or "N" user inputs to avoid multiple IF statements. +''Example 3:'' Use [[UCASE$]](INKEY$) in a keyboard read loop looking for uppercase "Y" or "N" user inputs to avoid multiple IF statements. {{CodeStart}} '' '' {{Cl|DO...LOOP|DO}} - {{Cl|PRINT}} "Do you want to continue? (Y/N): "; 'semicolon saves position for user entry + {{Cl|PRINT}} "Do you want to continue? (Y/N): "; 'semicolon saves position for user entry {{Cl|DO...LOOP|DO}}: K$ = {{Cl|UCASE$}}({{Cl|INKEY$}}) 'change any user key press to uppercase - {{Cl|LOOP}} {{Cl|UNTIL}} K$ = "Y" {{Cl|OR (boolean)|OR}} K$ = "N" + {{Cl|LOOP}} {{Cl|UNTIL}} K$ = "Y" {{Cl|OR (boolean)|OR}} K$ = "N" {{Cl|PRINT}} K$ 'print valid user entry - {{Cl|IF...THEN|IF}} K$ = "N" {{Cl|THEN}} {{Cl|END}} + {{Cl|IF...THEN|IF}} K$ = "N" {{Cl|THEN}} {{Cl|END}} {{Cl|LOOP}} '' '' {{CodeEnd}} ''Example 4:'' Getting just number values entered by a user in an INKEY$ input loop. {{CodeStart}} '' '' -{{Cl|LOCATE}} 10, 10: {{Cl|PRINT}} "Enter a number value: "; +{{Cl|LOCATE}} 10, 10: {{Cl|PRINT}} "Enter a number value: "; {{Cl|DO}}: {{Cl|SLEEP}} K$ = {{Cl|INKEY$}} - {{Cl|IF}} K$ >= {{Cl|CHR$}}(48) {{Cl|AND (boolean)|AND}} K$ <= {{Cl|CHR$}}(57) {{Cl|THEN}} entry$ = entry$ + K$ ' numbers only + {{Cl|IF}} K$ >= {{Cl|CHR$}}(48) {{Cl|AND (boolean)|AND}} K$ <= {{Cl|CHR$}}(57) {{Cl|THEN}} entry$ = entry$ + K$ ' numbers only L = {{Cl|LEN}}(entry$) ' check entry length for possible backspace {{Cl|IF}} K$ = {{Cl|CHR$}}(46) {{Cl|AND (boolean)|AND}} flag = 0 {{Cl|THEN}} entry$ = entry$ + K$: flag = 1: mark = L ' decimal point - {{Cl|IF}} K$ = {{Cl|CHR$}}(8) {{Cl|AND (boolean)|AND}} L > 0 {{Cl|THEN}} ' backspace pressed and entry has a length + {{Cl|IF}} K$ = {{Cl|CHR$}}(8) {{Cl|AND (boolean)|AND}} L > 0 {{Cl|THEN}} ' backspace pressed and entry has a length entry$ = {{Cl|MID$}}(entry$, 1, L - 1) ' remove one character from entry$ {{Cl|IF}} {{Cl|LEN}}(entry$) < mark {{Cl|THEN}} flag = 0 ' allow decimal point entry if other was removed. {{Cl|LOCATE}} {{Cl|CSRLIN}}, {{Cl|POS}}(0) - 1: {{Cl|PRINT}} {{Cl|SPACE$}}(1); ' remove end character from screen {{Cl|END IF}} {{Cl|LOCATE}} 10, 32: {{Cl|PRINT}} entry$; ' display entry to user (semicolon required for correct {{Cl|POS}}) -{{Cl|LOOP}} {{Cl|UNTIL}} K$ = {{Cl|CHR$}}(13) {{Cl|AND (boolean)|AND}} L > 0 'assures something is entered '' '' +{{Cl|LOOP}} {{Cl|UNTIL}} K$ = {{Cl|CHR$}}(13) {{Cl|AND (boolean)|AND}} L > 0 'assures something is entered '' '' {{CodeEnd}} : ''Explanation:'' [[SLEEP]] waits for a keypress. It also allows background programs to share the processor and it leaves the keypress in the buffer for INKEY$. Keyboard string number characters range from [[ASCII]] codes 48 to 57. Any other entry is ignored by the IF statement. A decimal point (code 46) entry is allowed once in the input. The flag value stops further decimal point additions. Backspacing (code 8) is also allowed if the entry has at least one character. The cursor column returned by [[POS]](0) reverts too after the end of the entry when printed each loop. The loop exits when [Enter] (code 13) is pressed and the entry has a length. @@ -140,17 +140,17 @@ The [[INKEY$]] function returns user input as [[ASCII]] [[STRING]] character(s) ''Example 5:'' Using arrow keys to move a text character. A change from a previous position tells program when to PRINT: {{CodeStart}}movey = 1: movex = 1 'text coordinates can never be 0 -at$ = "@" 'text sprite could be almost any ASCII character +at$ = "@" 'text sprite could be almost any ASCII character {{Cl|LOCATE}} movey, movex: {{Cl|PRINT}} at$; DO px = movex: py = movey 'previous positions B$ = {{Cl|INKEY$}} - {{Cl|IF...THEN|IF}} B$ = {{Cl|CHR$}}(0) + {{Cl|CHR$}}(72) {{Cl|AND (boolean)|AND}} movey > 1 {{Cl|THEN}} movey = movey - 1 'rows 1 to 23 only + {{Cl|IF...THEN|IF}} B$ = {{Cl|CHR$}}(0) + {{Cl|CHR$}}(72) {{Cl|AND (boolean)|AND}} movey > 1 {{Cl|THEN}} movey = movey - 1 'rows 1 to 23 only {{Cl|IF...THEN|IF}} B$ = {{Cl|CHR$}}(0) + {{Cl|CHR$}}(80) {{Cl|AND (boolean)|AND}} movey < 23 {{Cl|THEN}} movey = movey + 1 - {{Cl|IF...THEN|IF}} B$ = {{Cl|CHR$}}(0) + {{Cl|CHR$}}(75) {{Cl|AND (boolean)|AND}} movex > 1 {{Cl|THEN}} movex = movex - 1 'columns 1 to 80 only + {{Cl|IF...THEN|IF}} B$ = {{Cl|CHR$}}(0) + {{Cl|CHR$}}(75) {{Cl|AND (boolean)|AND}} movex > 1 {{Cl|THEN}} movex = movex - 1 'columns 1 to 80 only {{Cl|IF...THEN|IF}} B$ = {{Cl|CHR$}}(0) + {{Cl|CHR$}}(77) {{Cl|AND (boolean)|AND}} movex < 80 {{Cl|THEN}} movex = movex + 1 - {{Cl|IF...THEN|IF}} px <> movex {{Cl|OR (boolean)|OR}} py <> movey {{Cl|THEN}} 'only changes when needed + {{Cl|IF...THEN|IF}} px <> movex {{Cl|OR (boolean)|OR}} py <> movey {{Cl|THEN}} 'only changes when needed {{Cl|LOCATE}} py, px: {{Cl|PRINT}} {{Cl|SPACE$}}(1); 'erase old sprite {{Cl|LOCATE}} movey, movex: {{Cl|PRINT}} at$; 'show new position {{Cl|END IF}} @@ -170,24 +170,24 @@ DO x = 0 y = 0 -image = {{Cl|_LOADIMAGE}}("QB64bee.png") 'Here I actually used the QB64 icon +image = {{Cl|_LOADIMAGE}}("QB64bee.png") 'Here I actually used the QB64 icon DO {{Cl|_PUTIMAGE}} (x, y), image DO Keypress = {{Cl|UCASE$}}({{Cl|INKEY$}}) ' ***** The following line detects the arrow keys ***** - {{Cl|IF...THEN|IF}} {{Cl|LEN}}(Keypress) > 1 {{Cl|THEN}} Keypress = {{Cl|RIGHT$}}(Keypress, 1) - {{Cl|LOOP}} {{Cl|UNTIL}} Keypress > "" + {{Cl|IF...THEN|IF}} {{Cl|LEN}}(Keypress) > 1 {{Cl|THEN}} Keypress = {{Cl|RIGHT$}}(Keypress, 1) + {{Cl|LOOP}} {{Cl|UNTIL}} Keypress > "" {{Cl|CLS}} ' blank screen after valid key press to avoid smearing image on page {{Cl|SELECT CASE}} Keypress - {{Cl|CASE}} "W", "H": y = y - 10 'Up - {{Cl|CASE}} "A", "K": x = x - 10 'Left - {{Cl|CASE}} "S", "P": y = y + 10 'Down - {{Cl|CASE}} "D", "M": x = x + 10 'Right - {{Cl|CASE}} "Q", {{Cl|CHR$}}(27): {{Cl|END}} 'Q or Esc Ends prog. + {{Cl|CASE}} "W", "H": y = y - 10 'Up + {{Cl|CASE}} "A", "K": x = x - 10 'Left + {{Cl|CASE}} "S", "P": y = y + 10 'Down + {{Cl|CASE}} "D", "M": x = x + 10 'Right + {{Cl|CASE}} "Q", {{Cl|CHR$}}(27): {{Cl|END}} 'Q or Esc Ends prog. {{Cl|END SELECT}} {{Cl|_PUTIMAGE}} (x, y), image {{Cl|LOOP}} '' '' @@ -198,13 +198,15 @@ DO ''Example 7:'' Creating upper [[ASCII]] characters in a QB program using '''Alt +''' three number keys: {{CodeStart}} DO - A$ = "": {{Cl|WHILE}} A$ = "": A$ = {{Cl|INKEY$}}: {{Cl|WEND}} + A$ = "": {{Cl| +2a79 +WHILE}} A$ = "": A$ = {{Cl|INKEY$}}: {{Cl|WEND}} {{Cl|IF...THEN|IF}} {{Cl|LEN}}(A$) = 2 {{Cl|THEN}} '2 byte INKEY$ return B$ = {{Cl|RIGHT$}}(A$, 1) 'read second byte b% = {{Cl|ASC}}(B$) 'read second byte code - {{Cl|IF...THEN|IF}} b% > 119 {{Cl|AND (boolean)|AND}} b% < 130 {{Cl|THEN}} ' Alt + number codes only + {{Cl|IF...THEN|IF}} b% > 119 {{Cl|AND (boolean)|AND}} b% < 130 {{Cl|THEN}} ' Alt + number codes only C% = b% - 119 ' convert to actual number - {{Cl|IF...THEN|IF}} C% > 9 {{Cl|THEN}} C% = 0 + {{Cl|IF...THEN|IF}} C% > 9 {{Cl|THEN}} C% = 0 num$ = num$ + {{Cl|LTRIM$}}({{Cl|STR$}}(C%)) {{Cl|END IF}} {{Cl|END IF}} @@ -229,4 +231,4 @@ DO * [[Windows_Libraries#Hot_Keys_.28maximize.29|Windows hot keys]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/INP.txt b/internal/help/INP.txt index 7db315949..b073e3dc0 100644 --- a/internal/help/INP.txt +++ b/internal/help/INP.txt @@ -57,23 +57,23 @@ DO: {{Cl|_LIMIT}} 100 'adjust higher for faster {{Cl|IF...THEN|IF}} ScanKey%(72) {{Cl|THEN}} RTpos = RTpos - 1 {{Cl|IF...THEN|IF}} ScanKey%(80) {{Cl|THEN}} RTpos = RTpos + 1 -{{Cl|PRINT}} "Player 1 : "; ponescore; " Player 2 : "; ptwoscore +{{Cl|PRINT}} "Player 1 : "; ponescore; " Player 2 : "; ptwoscore -{{Cl|IF...THEN|IF}} x > xmax - 15 {{Cl|AND (boolean)|AND}} y >= RTpos {{Cl|AND (boolean)|AND}} y <= RTpos + 100 {{Cl|THEN}} +{{Cl|IF...THEN|IF}} x > xmax - 15 {{Cl|AND (boolean)|AND}} y >= RTpos {{Cl|AND (boolean)|AND}} y <= RTpos + 100 {{Cl|THEN}} dx = -1 -{{Cl|ELSEIF}} x > xmax {{Cl|THEN}} +{{Cl|ELSEIF}} x > xmax {{Cl|THEN}} ponescore = ponescore + 1 {{Cl|GOSUB}} begin {{Cl|END IF}} -{{Cl|IF...THEN|IF}} x < xmin + 15 {{Cl|AND (boolean)|AND}} y >= LTpos {{Cl|AND (boolean)|AND}} y <= LTpos + 100 {{Cl|THEN}} +{{Cl|IF...THEN|IF}} x < xmin + 15 {{Cl|AND (boolean)|AND}} y >= LTpos {{Cl|AND (boolean)|AND}} y <= LTpos + 100 {{Cl|THEN}} dx = 1 {{Cl|ELSEIF}} x < xmin {{Cl|THEN}} ptwoscore = ptwoscore + 1 {{Cl|GOSUB}} begin {{Cl|END IF}} -{{Cl|IF...THEN|IF}} y > ymax - 5 {{Cl|THEN}} dy = -1 +{{Cl|IF...THEN|IF}} y > ymax - 5 {{Cl|THEN}} dy = -1 {{Cl|IF...THEN|IF}} y < ymin + 5 {{Cl|THEN}} dy = 1 ' Display the sprite elsewhere on the screen @@ -110,8 +110,11 @@ ScanKey% = keyflags%(scancode%) * [[INKEY$]], [[_KEYHIT]], [[_KEYDOWN]] * [[Bitmaps]], [[Scancodes]] {{text|(keyboard)}} * [[Port Access Libraries]] {{text|(COM or LPT registers)}} + + +===External Links=== * [http://en.wikipedia.org/wiki/Input/output_base_address#Common_I.2FO_base_address_device_assignments_in_IBM_PC_compatible_computers PC I/O base address device assignments] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/INPUT$.txt b/internal/help/INPUT$.txt index a32a76a0d..80aea89fc 100644 --- a/internal/help/INPUT$.txt +++ b/internal/help/INPUT$.txt @@ -33,7 +33,7 @@ PRINT year$ 'display the text entry '' '' ''Example 2:'' Reading bytes from a text file for an 80 wide screen mode. {{CodeStart}} '' '' {{Cl|LOCATE}} 5, 5, 1 'locate and display cursor -{{Cl|OPEN}} "Diary.txt" FOR {{Cl|INPUT (file mode)|INPUT}} AS #1 'open existing text file +{{Cl|OPEN}} "Diary.txt" FOR {{Cl|INPUT (file mode)|INPUT}} AS #1 'open existing text file text$ = {{Cl|INPUT$}}(70, 1) {{Cl|LOCATE}} 5, 6, 0: PRINT text$ 'print text and turn cursor off '' '' {{CodeEnd}} @@ -41,7 +41,7 @@ text$ = {{Cl|INPUT$}}(70, 1) ''Example 3:'' Getting the entire text file data as one string value. {{CodeStart}} '' '' -{{Cl|OPEN}} "Diary.txt FOR {{Cl|BINARY}} AS #1 'open an existing file up to 32767 bytes +{{Cl|OPEN}} "Diary.txt FOR {{Cl|BINARY}} AS #1 'open an existing file up to 32767 bytes IF {{Cl|LOF}}(1) <= 32767 THEN Text$ = {{Cl|INPUT$}}(LOF(1), 1) {{Cl|CLOSE}} #1 '' '' {{CodeEnd}} @@ -55,4 +55,4 @@ IF {{Cl|LOF}}(1) <= 32767 THEN Text$ = {{Cl|INPUT$}}(LOF(1), 1) * [[LOCATE]] {{text|(cursor on/off)}} -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/INPUT.txt b/internal/help/INPUT.txt index 7cf8e2d90..81fb7abc9 100644 --- a/internal/help/INPUT.txt +++ b/internal/help/INPUT.txt @@ -2,13 +2,13 @@ The [[INPUT]] statement requests a [[STRING]] or numerical keyboard entry from t {{PageSyntax}} -: [[INPUT]] [;] "[Question or statement text]"{,|;} {{Parameter|variable}}[, ...] +: [[INPUT]] [;] "[Question or statement text]"{,|;} {{Parameter|variable}}[, ...] : [[INPUT]] ; {{Parameter|variable}}[, ...] {{Parameters}} * A [[semicolon]] after the [[INPUT]] keyword keeps the entry on the same row after enter is pressed and prevents the screen contents from rolling up. -* The optional prompt "Question or statement text" must be a literal predefined [[STRING|string]]. '''The prompt cannot use a variable.''' +* The optional prompt "Question or statement text" must be a literal predefined [[STRING|string]]. '''The prompt cannot use a variable.''' * [[Quotation mark]]s are required except when a semicolon follows [[INPUT]]. A question mark will appear before the cursor. * A [[semicolon]] immediately after the text statement will display a question mark with a space after it. Use a [[comma]] for input statements. @@ -17,17 +17,17 @@ The [[INPUT]] statement requests a [[STRING]] or numerical keyboard entry from t * '''QB64''' does not return ''Redo from start'' errors like QBasic did, as user input is limited to the scope of the variable [[Data types|type]] used. * Text entries (with a [[STRING]] variable]] can receive any characters, including numerical. '''QB64 will ignore commas in single variable text entries.''' * The [[Data types|type]] of the {{Parameter|variable}} used to store user input determines the valid numerical range for value entries in QB64, with non-numerical characters limited to D, E, [[&H]], [[&O]] or [[&B]]. -** For example, if you use an [[INTEGER]] variable, as in {{InlineCode}}INPUT "Initial value: ", myValue%{{InlineCodeEnd}}, the valid range is -32768 to 32767. +** For example, if you use an [[INTEGER]] variable, as in {{InlineCode}}INPUT "Initial value: ", myValue%{{InlineCodeEnd}}, the valid range is -32768 to 32767. ** [[INTEGER]], [[LONG]], and [[_INTEGER64]] entries will ignore decimal points entered and will use all numbers. * INPUT can be used to get more than one {{Parameter|variable}} value from the user. Do so by separating input variables with commas in the code. ** The program must inform the user that more than one variable is requested, in order to enter each value separated with a comma at runtime. ** [[STRING|String]] and numerical variables can both be used in multiple entry requests separated by commas. ** '''QB64''' allows comma separated entries to be skipped by the user without generating an error. * '''Use [[LINE INPUT]] for text input entries that may contain commas such as address or name entries.''' -* The user must press enter for the INPUT procedure to end. <!-- redundant: Multiple entries can be skipped. --> +* The user must press enter for the INPUT procedure to end. <!-- redundant: Multiple entries can be skipped. --> * [[INPUT]] accepts the [[scientific notation]] letters D or E in [[SINGLE]] or [[DOUBLE]] numerical values. * Numerical values starting with [[&H]], [[&O]] and [[&B]] can also be entered. -<!-- not valid for QB64, not worth mentioning then denying: * INPUT removes all leading or trailing spaces in a string value entry. '''QB64 does NOT remove those spaces!''' --> +<!-- not valid for QB64, not worth mentioning then denying: * INPUT removes all leading or trailing spaces in a string value entry. '''QB64 does NOT remove those spaces!''' --> * The statement halts a program until enter is pressed, which may not be desired in programs using mouse input (see [[INKEY$]] loops). * Use [[_DEST]] [[_CONSOLE]] before INPUT statements to receive input from a [[$CONSOLE|console]] window. @@ -35,9 +35,9 @@ The [[INPUT]] statement requests a [[STRING]] or numerical keyboard entry from t {{PageExamples}} ''Example 1:'' Using a variable in an input text message using PRINT. INPUT prompts cannot use variables. {{CodeStart}} '' '' -{{Cl|INPUT}} "Enter your name: ", name$ -{{Cl|PRINT}} name$ + " please enter your age: ";: {{Cl|INPUT}} "", age% 'empty string with comma -{{Cl|PRINT}} name$ + " how much do you weigh"; : {{Cl|INPUT}} weight% 'no text adds ? '' '' +{{Cl|INPUT}} "Enter your name: ", name$ +{{Cl|PRINT}} name$ + " please enter your age: ";: {{Cl|INPUT}} "", age% 'empty string with comma +{{Cl|PRINT}} name$ + " how much do you weigh"; : {{Cl|INPUT}} weight% 'no text adds ? '' '' {{CodeEnd}} :''Explanation:'' Use an empty string with a comma to eliminate the question mark that would appear without the string. @@ -45,9 +45,9 @@ The [[INPUT]] statement requests a [[STRING]] or numerical keyboard entry from t ''Example 2:'' How QB64 avoids a ''Redo from start'' multiple entry error. Use commas between values. {{CodeStart}} '' '' {{Cl|DO}} '' '' - {{Cl|INPUT}} "What is your name, age, and sex(M/F)"; name$, age%, sex$ + {{Cl|INPUT}} "What is your name, age, and sex(M/F)"; name$, age%, sex$ {{Cl|LOOP}} {{Cl|UNTIL}} age% 'loop until age is not 0 -{{Cl|IF}} age% >= 21 {{Cl|THEN}} {{Cl|PRINT}} "You can drink beer!" {{Cl|ELSE}} {{Cl|PRINT}} "You cannot drink beer yet!" +{{Cl|IF}} age% >= 21 {{Cl|THEN}} {{Cl|PRINT}} "You can drink beer!" {{Cl|ELSE}} {{Cl|PRINT}} "You cannot drink beer yet!" {{Cl|END}} '' '' {{CodeEnd}} {{OutputStart}} @@ -62,12 +62,12 @@ You can drink beer! {{Cl|SCREEN}} 12 {{Cl|COLOR}} 14: {{Cl|LOCATE}} 29, 2 ' place cursor at beginning of prompt line -{{Cl|PRINT}} "Enter a name to search for... "; 'print prompt on screen with input to follow -{{Cl|COLOR}} 15: {{Cl|INPUT}} {{text|;|red}} "", name$ ' get search name from user +{{Cl|PRINT}} "Enter a name to search for... "; 'print prompt on screen with input to follow +{{Cl|COLOR}} 15: {{Cl|INPUT}} {{text|;|red}} "", name$ ' get search name from user {{Cl|LOCATE}} 29, 2: {{Cl|PRINT}} {{Cl|SPC}}(78); ' erase previous prompt n$ = {{Cl|UCASE$}}(name$) ' convert search name to upper case {{Cl|COLOR}} 14' change foreground color to yellow -{{Cl|LOCATE}} 29, 2: {{Cl|PRINT}} "Searching..."; 'print message +{{Cl|LOCATE}} 29, 2: {{Cl|PRINT}} "Searching..."; 'print message {{Cl|SLEEP}} {{CodeEnd}} {{OutputStart}}{{text|Enter a name to search for...|#FFFF00}} █ @@ -83,4 +83,4 @@ n$ = {{Cl|UCASE$}}(name$) ' convert search name to upper case * [[Scancodes]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/INPUT_(TCP%2FIP_statement).txt b/internal/help/INPUT_(TCP%2FIP_statement).txt index 619161a8d..b403e3867 100644 --- a/internal/help/INPUT_(TCP%2FIP_statement).txt +++ b/internal/help/INPUT_(TCP%2FIP_statement).txt @@ -28,7 +28,7 @@ {{CodeStart}} '' '' {{Cl|PRINT (TCP/IP statement)|PRINT}} #c, a$ ' sends the string value a$ (size is calculated by an INPUT) - PRINT #c, x% ' if x was equal to 5, this would send " 5 " (without the quotation marks) + PRINT #c, x% ' if x was equal to 5, this would send " 5 " (without the quotation marks) '''INPUT #'''o, a$ ' reads the next available message (if arrived) or sets a$'s length to 0 '' '' {{CodeEnd}} :''Explanation:'' INPUT #o,x% 'effectively reads the next message, performs the VAL function upon it and stores the result in x%. If any part of this process doesn't work then EOF(o) will return -1. @@ -49,7 +49,7 @@ t! = TIMER + 3 'wait 3 seconds DO '''INPUT #'''myhost, aa%, bb#, cc$ 'when all variables are filled, EOF(myhost) returns 0 - IF TIMER > t! THEN EXIT DO ' 3 second timeout + IF TIMER > t! THEN EXIT DO ' 3 second timeout LOOP WHILE {{Cl|EOF}}(myhost) '' '' {{CodeEnd}} :''Explanation:'' Note that communications must be set up in advance for the host and user to know that more than one piece of data is available! Data timing also may affect those communications. Data could be missed using [[GET (TCP/IP statement)]] or [[PUT (TCP/IP statement)]]s as data lengths are unknown. @@ -65,4 +65,4 @@ * [[TCP/IP Message Format]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/INPUT_(file_mode).txt b/internal/help/INPUT_(file_mode).txt index 47a22de03..583542a90 100644 --- a/internal/help/INPUT_(file_mode).txt +++ b/internal/help/INPUT_(file_mode).txt @@ -21,7 +21,7 @@ The '''INPUT''' file mode in an [[OPEN]] statement opens an existing file for [[ {{CodeStart}} '' '' DIM Fdata$(100) - INPUT "Enter data file name: ", datafile$ + INPUT "Enter data file name: ", datafile$ IF _FILEEXISTS(datafile$) THEN D% = {{Cl|FREEFILE}}: count = 0 {{Cl|OPEN}} datafile$ FOR {{Cl|INPUT (file mode)|INPUT}} AS #D% @@ -31,7 +31,7 @@ The '''INPUT''' file mode in an [[OPEN]] statement opens an existing file for [[ IF count = 100 THEN {{Cl|EXIT}} DO ' don't exceed {{Cl|Arrays|array}} size! LOOP {{Cl|CLOSE}} #D% - ELSE : PRINT "File not found!" + ELSE : PRINT "File not found!" END IF {{CodeEnd}} : ''Explanation:'' The [[_FILEEXISTS]] function is used before {{InlineCode}}OPEN datafile$ FOR INPUT AS #D%{{InlineCodeEnd}}, which would generate an error in case the file didn't exist. @@ -45,4 +45,4 @@ The '''INPUT''' file mode in an [[OPEN]] statement opens an existing file for [[ * [[_FILEEXISTS]], [[_DIREXISTS]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/INPUT_(file_statement).txt b/internal/help/INPUT_(file_statement).txt index b842ee8bd..d7aa812db 100644 --- a/internal/help/INPUT_(file_statement).txt +++ b/internal/help/INPUT_(file_statement).txt @@ -25,14 +25,14 @@ The [[INPUT #]] file or port statement reads sequential data using one variable {{PageExamples}} ''Example 1:'' Writes new data to a text file sequentially and reads it back to the program screen. {{CodeStart}} '' '' -filename$ = "testfile.dat" -x = 1: y = 2: z$ = "Three" +filename$ = "testfile.dat" +x = 1: y = 2: z$ = "Three" {{Cl|OPEN}} filename$ {{Cl|FOR...NEXT|FOR}} {{Cl|OUTPUT}} {{Cl|AS}} #1 'opens and clears an existing file or creates new empty file {{Cl|WRITE (file statement)|WRITE}} #1, x, y, z$ {{Cl|CLOSE}} #1 -{{Cl|PRINT}} "File created with data. Press a key!" +{{Cl|PRINT}} "File created with data. Press a key!" K$ = {{Cl|INPUT$}}(1) 'press a key {{Cl|OPEN}} filename$ {{Cl|FOR (file statement)|FOR}} {{Cl|INPUT (file mode)|INPUT}} {{Cl|AS}} #2 'opens a file to read it @@ -45,24 +45,24 @@ K$ = {{Cl|INPUT$}}(1) 'press a key {{Cl|END}} '' '' {{CodeEnd}} {{OutputStart}} 1 2 Three -1,2,"Three" +1,2,"Three" {{OutputEnd}} : ''Screen output:'' [[PRINT]] string values will not display enclosing quotes. [[WRITE]] screen displays will. -{{TextStart}}1,2,"Three" '' '' {{TextEnd}} +{{TextStart}}1,2,"Three" '' '' {{TextEnd}} : ''File content:'' [[WRITE (file statement)|WRITE]] string values will include quotation marks, but they are not required to read the file value as a string. ''Example 2:'' Commas inside of string values will not affect the INPUT value as those commas are not [[WRITE (file statement)|WRITE]] separators. {{CodeStart}} '' '' -x$ = "Hello, how are you?" -y$ = "I'm fine." +x$ = "Hello, how are you?" +y$ = "I'm fine." -{{Cl|OPEN}} "testinp.dat" {{Cl|FOR...NEXT|FOR}} {{Cl|OUTPUT}} {{Cl|AS}} #1 +{{Cl|OPEN}} "testinp.dat" {{Cl|FOR...NEXT|FOR}} {{Cl|OUTPUT}} {{Cl|AS}} #1 {{Cl|WRITE (file statement)|WRITE}} #1, x$, y$ {{Cl|CLOSE}} #1 -{{Cl|OPEN}} "testinp.dat" {{Cl|FOR (file statement)|FOR}} {{Cl|INPUT (file mode)|INPUT}} {{Cl|AS}} #1 +{{Cl|OPEN}} "testinp.dat" {{Cl|FOR (file statement)|FOR}} {{Cl|INPUT (file mode)|INPUT}} {{Cl|AS}} #1 {{Cl|INPUT (file statement)|INPUT}} #1, a$, b$ {{Cl|CLOSE}} #1 @@ -71,8 +71,8 @@ y$ = "I'm fine." {{Cl|WRITE}} a$, b$ '' '' {{CodeEnd}} {{OutputStart}}Hello, how are you? I'm fine. -"Hello, how are you?","I'm fine."{{OutputEnd}} -{{TextStart}}"Hello, how are you?","I'm fine."{{TextEnd}} +"Hello, how are you?","I'm fine."{{OutputEnd}} +{{TextStart}}"Hello, how are you?","I'm fine."{{TextEnd}} : ''File content:'' Commas inside of strings delimited with quotes will be ignored. [[WRITE (file statement)|WRITE]] will always enclose string values in quotes. @@ -83,4 +83,4 @@ y$ = "I'm fine." * [[GET|GET #]], [[INPUT (TCP/IP statement)]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/INSTR.txt b/internal/help/INSTR.txt index 08c286d7d..dcd4d9e27 100644 --- a/internal/help/INSTR.txt +++ b/internal/help/INSTR.txt @@ -28,14 +28,14 @@ The [[INSTR]] function searches for the first occurence of a search [[STRING]] w {{PageExamples}} ''Example:'' Reading more than one instance of a word in a string using the INSTR return value as the start value plus 1. {{CodeStart}} '' '' -text$ = "The cats and dogs where playing, even though dogs don't like cats." +text$ = "The cats and dogs where playing, even though dogs don't like cats." {{Cl|DO...LOOP|DO}} - findcats% = {{Cl|INSTR}}(findcats% + 1, text$, "cats") ' find another occurance after - {{Cl|IF...THEN|IF}} findcats% {{Cl|THEN}} {{Cl|PRINT}} "There is 'cats' in the string at position:"; findcats% + findcats% = {{Cl|INSTR}}(findcats% + 1, text$, "cats") ' find another occurance after + {{Cl|IF...THEN|IF}} findcats% {{Cl|THEN}} {{Cl|PRINT}} "There is 'cats' in the string at position:"; findcats% {{Cl|LOOP}} {{Cl|UNTIL}} findcats% = 0 -findmonkey% = {{Cl|INSTR}}(text$, "monkeys") ' find any occurance? -PRINT findmonkey%; "'monkeys' were found so it returned:"; findmonkey% '' '' +findmonkey% = {{Cl|INSTR}}(text$, "monkeys") ' find any occurance? +PRINT findmonkey%; "'monkeys' were found so it returned:"; findmonkey% '' '' {{CodeEnd}} {{OutputStart}}There is 'cats' in the string at position: 5 There is 'cats' in the string at position: 62 @@ -51,4 +51,4 @@ There is 'cats' in the string at position: 62 * [[STRING]], [[INTEGER]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/INT.txt b/internal/help/INT.txt index ae4228fe3..22922e96d 100644 --- a/internal/help/INT.txt +++ b/internal/help/INT.txt @@ -33,4 +33,4 @@ PRINT INT(-2.5) * [[_ROUND]], [[_CEIL]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/INTEGER.txt b/internal/help/INTEGER.txt index 3ce973aac..35df7035c 100644 --- a/internal/help/INTEGER.txt +++ b/internal/help/INTEGER.txt @@ -6,9 +6,9 @@ * Integers do not use decimal point values but will round those off to the nearest even whole number. -* QBasic integer values can range from -32768 to 32767 without an "overflow" error. +* QBasic integer values can range from -32768 to 32767 without an "overflow" error. * For larger integer values use the [[LONG]] integer type. -* '''QB64''' [[INTEGER]] values greater than 32767 become negative signed values instead of throwing an "overflow" error, as the top bit designates a negative value. See example 1 below. +* '''QB64''' [[INTEGER]] values greater than 32767 become negative signed values instead of throwing an "overflow" error, as the top bit designates a negative value. See example 1 below. * '''QB64''' [[_UNSIGNED]] integers can range from 0 to 65535. * '''QB64''' _UNSIGNED [[_INTEGER64]] values range from 0 to 18446744073709551615 * Many graphic programs require [[INTEGER]] arrays. @@ -58,4 +58,4 @@ i~% = 70000 * [[\|Integer Division]], [[MOD]] (Integer remainder division) -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/INTERRUPT.txt b/internal/help/INTERRUPT.txt index 183a9f037..1d991b42a 100644 --- a/internal/help/INTERRUPT.txt +++ b/internal/help/INTERRUPT.txt @@ -15,7 +15,7 @@ The [[INTERRUPT]] statement is an assembly routine for accessing computer inform ==QBasic/QuickBASIC== -* Available in QuickBASIC versions 4 and up and required an external library to be loaded. <!-- Command line: QB.EXE /L in QB4.5 --> '''QB64''' emulates the statement without an external library. +* Available in QuickBASIC versions 4 and up and required an external library to be loaded. <!-- Command line: QB.EXE /L in QB4.5 --> '''QB64''' emulates the statement without an external library. * {{Parameter|intNum}} is the interrupt reference vector table address. For historic reference, see: [http://www.ctyme.com/intr/cat.htm Ralf Brown's Interrupt List] * The [[TYPE]] definition below will work for both [[INTERRUPT]] and INTERRUPTX statement calls * INTERRUPT can use all of the below TYPE elements when they are required. @@ -46,4 +46,4 @@ The [[INTERRUPT]] statement is an assembly routine for accessing computer inform * Ethan Winer's free QBasic Book and Programs: [http://www.ethanwiner.com/fullmoon.html WINER.ZIP] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/INTERRUPTX.txt b/internal/help/INTERRUPTX.txt index e14be32a6..428d06a6d 100644 --- a/internal/help/INTERRUPTX.txt +++ b/internal/help/INTERRUPTX.txt @@ -15,7 +15,7 @@ The [[INTERRUPTX]] statement is an assembly routine for accessing computer infor ==QBasic/QuickBASIC== -* Available in QuickBASIC versions 4 and up and required an external library to be loaded. <!-- Command line: QB.EXE /L in QB4.5 --> '''QB64''' emulates the statement without an external library. +* Available in QuickBASIC versions 4 and up and required an external library to be loaded. <!-- Command line: QB.EXE /L in QB4.5 --> '''QB64''' emulates the statement without an external library. * {{Parameter|intNum}} is the interrupt reference vector table address. For historic reference, see: [http://www.ctyme.com/intr/cat.htm Ralf Brown's Interrupt List] * The [[TYPE]] definition below will work for both [[INTERRUPT]] and INTERRUPTX statement calls * INTERRUPT can use all of the below TYPE elements when they are required. @@ -46,4 +46,4 @@ The [[INTERRUPTX]] statement is an assembly routine for accessing computer infor * Ethan Winer's free QBasic Book and Programs: [http://www.ethanwiner.com/fullmoon.html WINER.ZIP] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/IOCTL$.txt b/internal/help/IOCTL$.txt index 6ee7a51da..1812883ed 100644 --- a/internal/help/IOCTL$.txt +++ b/internal/help/IOCTL$.txt @@ -18,4 +18,4 @@ The [[IOCTL$]] function receives messages from an open device, format of the mes * [[IOCTL]] * [[OPEN]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/IOCTL.txt b/internal/help/IOCTL.txt index 13e70dc36..d6284e2d3 100644 --- a/internal/help/IOCTL.txt +++ b/internal/help/IOCTL.txt @@ -23,4 +23,4 @@ The [[IOCTL]] statement sends a message to an open IOCTL compatible device. * [[OPEN]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/KEY(n).txt b/internal/help/KEY(n).txt index 0d5ccba7c..d555fa248 100644 --- a/internal/help/KEY(n).txt +++ b/internal/help/KEY(n).txt @@ -31,15 +31,15 @@ {{Cl|KEY(n)|KEY(12)}} {{Cl|ON}} ' enable event trapping DO -LOOP UNTIL UCASE$(INKEY$) = "Q" ' Idle loop for demo +LOOP UNTIL UCASE$(INKEY$) = "Q" ' Idle loop for demo {{Cl|SYSTEM}} CursorPad: -PRINT "Pressed LEFT key on cursor keypad." +PRINT "Pressed LEFT key on cursor keypad." {{Cl|RETURN}} NumericPad: -PRINT "Pressed LEFT key on numeric keypad." +PRINT "Pressed LEFT key on numeric keypad." RETURN '' '' {{CodeEnd}} @@ -48,14 +48,14 @@ RETURN '' '' {{CodeStart}} '' '' {{Cl|KEY(n)|KEY(5)}} {{Cl|ON}} {{Cl|ON KEY(n)|ON KEY(5)}} {{Cl|GOSUB}} execute -{{Cl|PRINT}} "Press F5 (or ESC) to quit!)" +{{Cl|PRINT}} "Press F5 (or ESC) to quit!)" {{Cl|DO}} {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) ' idle loop {{Cl|SYSTEM}} execute: -PRINT "You pressed the F5 key..." +PRINT "You pressed the F5 key..." {{Cl|SLEEP}} 1 -PRINT "Press any key to continue..." +PRINT "Press any key to continue..." SLEEP '' '' {{CodeEnd}} @@ -66,4 +66,4 @@ SLEEP '' '' * [[Keyboard scancodes]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/KEY_LIST.txt b/internal/help/KEY_LIST.txt index 8e33742b5..8b42fc449 100644 --- a/internal/help/KEY_LIST.txt +++ b/internal/help/KEY_LIST.txt @@ -14,10 +14,10 @@ The [[KEY LIST]] statement lists the soft key strings assigned to each of the fu {{PageExamples}} ''Example 1:'' Displaying the current '''KEY LIST''' string assignments to the Function keys. {{CodeStart}} '' '' -{{Cl|KEY n|KEY}} 1, "Help" -{{Cl|KEY n|KEY}} 5, "Compile" -{{Cl|KEY n|KEY}} 10, "Quit" -{{Cl|PRINT}} "Press any key!" +{{Cl|KEY n|KEY}} 1, "Help" +{{Cl|KEY n|KEY}} 5, "Compile" +{{Cl|KEY n|KEY}} 10, "Quit" +{{Cl|PRINT}} "Press any key!" K$ = {{Cl|INPUT$}}(1) {{Cl|KEY LIST}} {{Cl|END}} '' '' @@ -40,13 +40,13 @@ F12 ''Example 2:'' Displaying the function key assignments for F1 to F10 at the bottom of the screen with '''KEY ON''' and '''KEY OFF'''. {{CodeStart}} '' '' -{{Cl|KEY n|KEY}} 1, "Help" + {{Cl|CHR$}}(13) 'add Return character to complete the input -{{Cl|KEY n|KEY}} 5, "Compile" + {{Cl|CHR$}}(13) -{{Cl|KEY n|KEY}} 10, "Quit" + {{Cl|CHR$}}(13) +{{Cl|KEY n|KEY}} 1, "Help" + {{Cl|CHR$}}(13) 'add Return character to complete the input +{{Cl|KEY n|KEY}} 5, "Compile" + {{Cl|CHR$}}(13) +{{Cl|KEY n|KEY}} 10, "Quit" + {{Cl|CHR$}}(13) '''KEY ON''' DO -{{Cl|INPUT}} "Press F10 to turn display off! ", M$ -LOOP UNTIL M$ = "Quit" +{{Cl|INPUT}} "Press F10 to turn display off! ", M$ +LOOP UNTIL M$ = "Quit" '''KEY OFF''' K$ = {{Cl|INPUT$}}(1) {{Cl|KEY LIST}} @@ -69,7 +69,7 @@ Press F10 to turn display off! Compile 1 {{WBG|Help←}} 2 3 4 5 {{WBG|Compil}} 6 7 8 9 10 {{WBG|Quit←}} {{OutputEnd}} -:''Explanation:'' The [[INPUT]] variable will hold the string value as if it was typed in and entered. "Quit" will KEY OFF bottom display. +:''Explanation:'' The [[INPUT]] variable will hold the string value as if it was typed in and entered. "Quit" will KEY OFF bottom display. {{PageSeeAlso}} @@ -78,4 +78,4 @@ Press F10 to turn display off! Compile * [[_KEYHIT]], [[_KEYDOWN]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/KEY_n.txt b/internal/help/KEY_n.txt index 721663118..658c52833 100644 --- a/internal/help/KEY_n.txt +++ b/internal/help/KEY_n.txt @@ -1,4 +1,4 @@ -The [[KEY n]] statement is used to assign a "soft key" string or a flag and scan code to a function key or display function soft key assignments. +The [[KEY n]] statement is used to assign a "soft key" string or a flag and scan code to a function key or display function soft key assignments. {{PageSyntax}} @@ -9,13 +9,13 @@ The [[KEY n]] statement is used to assign a "soft key" string or a fla ==Function Soft Key Strings (1 to 10, 30 & 31)== -<center>'''Assigning "Softkey" [[STRING]] values to function key press events'''</center> +<center>'''Assigning "Softkey" [[STRING]] values to function key press events'''</center> * n% is the number 1 to 10 (F1 to F10), 30 or 31 (F11 or F12) of the function key to assign the soft key string. -* Instead of using an [[ON KEY(n)]] [[GOSUB]] statement, Function keys F1 to F12 can be assigned a "soft key" string value to return. -* {{InlineCode}}KEY n, text${{InlineCodeEnd}} defines a literal or variable [[STRING]] "soft key" function key return value. +* Instead of using an [[ON KEY(n)]] [[GOSUB]] statement, Function keys F1 to F12 can be assigned a "soft key" string value to return. +* {{InlineCode}}KEY n, text${{InlineCodeEnd}} defines a literal or variable [[STRING]] "soft key" function key return value. -{{WhiteStart}} '''KEY 1, "Help"''' 'returns the string "Help" to [[INPUT]] variable when F1 is pressed{{WhiteEnd}} +{{WhiteStart}} '''KEY 1, "Help"''' 'returns the string "Help" to [[INPUT]] variable when F1 is pressed{{WhiteEnd}} * [[KEY LIST]] displays each of the 12 softkey '''function key''' (F1 to F12) string values going down left side of screen. * [[KEY LIST|KEY {ON|OFF}]] displays or hides the softkey values of function keys F1 to F10 at the bottom of the screen. @@ -30,7 +30,7 @@ The [[KEY n]] statement is used to assign a "soft key" string or a fla ==User Defined Keys (15 to 29)== -<center>'''Assigning user defined keys or combinations with: KEY n, CHR$(keyflag) + CHR$(scancode)'''</center> +<center>'''Assigning user defined keys or combinations with: KEY n, CHR$(keyflag) + CHR$(scancode)'''</center> {{WhiteStart}} '''Function Key Flag Combination Values''' '''0''' = no function key combination flag(single key) @@ -54,9 +54,9 @@ The [[KEY n]] statement is used to assign a "soft key" string or a fla ' 41 2 3 4 5 6 7 8 9 10 11 12 13 14 {{text|82 71 73|blue}} {{text|32|purple}}/69 {{text|53|blue}} 55 74 ' '''Tab Q W E R T Y U I O P [{ ]} \| Delete End PgDn 7/Home 8/▲ 9/PU + ''' ' 15 16 17 18 19 20 21 22 23 24 25 26 27 43 {{text|83 79 81|blue}} 71 {{text|11|red}}/72 73 78 -' '''CapL A S D F G H J K L ;: '" Enter 4/◄- 5 6/-► E''' +' '''CapL A S D F G H J K L ;: '" Enter 4/◄- 5 6/-► E''' ' {{text|64|purple}}/58 30 31 32 33 34 35 36 37 38 39 40 28 {{text|12|red}}/75 76 {{text|13|red}}/77 '''n''' -' '''Shift Z X C V B N M ,< .> /? Shift ▲ 1/End 2/▼ 3/PD t''' +' '''Shift Z X C V B N M ,< .> /? Shift ▲ 1/End 2/▼ 3/PD t''' ' {{text|1|purple}}/42 44 45 46 47 48 49 50 51 52 53 {{text|2|purple}}/54 {{text|72|blue}} 79 {{text|14|red}}/80 81 '''e''' ' '''Ctrl Win Alt Spacebar Alt Win Menu Ctrl ◄- ▼ -► 0/Insert ./Del r''' ' {{text|4|purple}}/29 {{text|91|orange}} {{text|8|purple}}/56 57 {{text|56|blue}} {{text|92 93|orange}} {{text|29 75 80 77|blue}} 82 83 {{text|28|blue}} @@ -68,13 +68,13 @@ The [[KEY n]] statement is used to assign a "soft key" string or a fla {{WhiteEnd}}{{small|NOTE: The above commented table can be copied and pasted directly into the QB64 IDE}} -<center>'''Trapping Ctrl, Alt and Shift key combinations'''</center> +<center>'''Trapping Ctrl, Alt and Shift key combinations'''</center> :Keyboard Flag values can be added to monitor more than one control key. For example, flag combination 12 would flag both the Ctrl and Alt key presses. Since the flag already determines the function key to monitor, you don't necessarily have to use it's scancode. You can look for a key combination such as Ctrl + by using the plus key's scancode which is 13 as shown below: {{WhiteStart}} '''KEY 15, CHR$(4) + CHR$(13)''' 'enabled event when Ctrl and + key are pressed{{WhiteEnd}} -<center>'''Trapping Extended keys (Insert, Home, Page Up, Right Ctrl, R.Alt, and cursor arrow pad)'''</center> +<center>'''Trapping Extended keys (Insert, Home, Page Up, Right Ctrl, R.Alt, and cursor arrow pad)'''</center> * On a 101-key keyboard, you can trap any of the keys on the dedicated cursorpad by assigning the string to any of the keynumber values from 15 to 25 using the 128 keyboard flag. The cursor arrows are not the same as the pre-assigned number pad arrows: {{WhiteStart}} '''KEY n, [[CHR$]](128) + [[CHR$]](scancode) ' where n = 15 to 29. See: [[Scancodes]]''' @@ -86,10 +86,10 @@ The [[KEY n]] statement is used to assign a "soft key" string or a fla KEY 18, CHR$(128) + CHR$(80) 'down arrow cursor pad {{WhiteEnd}} -<center>Use CHR$(0) for the first byte flag for non-function keys. You can substitute a literal [[STRING]] value to trap as shown in Example 2.</center> +<center>Use CHR$(0) for the first byte flag for non-function keys. You can substitute a literal [[STRING]] value to trap as shown in Example 2.</center> -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ==Examples== @@ -97,9 +97,9 @@ The [[KEY n]] statement is used to assign a "soft key" string or a fla ''Example 1:'' Shows a list of all the string assignments to the function keys F1-F12 (Prints help every time F1 is pressed in the input) {{CodeStart}} '' '' -{{Cl|KEY n|KEY}} 1, "Help" +{{Cl|KEY n|KEY}} 1, "Help" {{Cl|KEY LIST}} -INPUT "Press F1 or to quit press ENTER: ", a$ +INPUT "Press F1 or to quit press ENTER: ", a$ {{CodeEnd}} {{OutputStart}} @@ -122,10 +122,10 @@ Press F1 or to quit press ENTER: HelpHelpHelpHelp ''Example 2:'' Trapping the Control + key combination. Use the Control Keyboard flag 4 and + key scancode 13. {{CodeStart}} {{Cl|CLS}} '' '' -{{Cl|KEY n|KEY}} 15, {{Cl|CHR$}}(4) + {{Cl|CHR$}}(13) 'scancode for "=" or "+" key is 13 +{{Cl|KEY n|KEY}} 15, {{Cl|CHR$}}(4) + {{Cl|CHR$}}(13) 'scancode for "=" or "+" key is 13 {{Cl|ON KEY (n)|ON KEY}}(15) {{Cl|GOSUB}} control 'action of user defined key press {{Cl|KEY(n)|KEY}}(15) ON 'turn ON event trapping for key combination -{{Cl|PRINT}} "Press Ctrl and plus key combination, escape quits!" +{{Cl|PRINT}} "Press Ctrl and plus key combination, escape quits!" {{Cl|DO}}: {{Cl|SLEEP}} count = count + 1 {{Cl|PRINT}} count; @@ -133,7 +133,7 @@ count = count + 1 {{Cl|LOOP}} control: 'NUMBER LOCK MUST BE OFF! -{{Cl|PRINT}} "Control and + keys pressed!"; +{{Cl|PRINT}} "Control and + keys pressed!"; {{Cl|RETURN}} '' '' {{CodeEnd}} {{small|Code by Ted Weissgerber}} @@ -161,8 +161,8 @@ DO numL = {{Cl|PEEK}}(1047) {{Cl|AND (boolean)|AND}} 32 '32 if on capL = {{Cl|PEEK}}(1047) {{Cl|AND (boolean)|AND}} 64 '64 on {{Cl|IF...THEN|IF}} numL {{Cl|OR (boolean)|OR}} capL {{Cl|THEN}} - {{Cl|COLOR}} 12: {{Cl|LOCATE}} 13, 50: {{Cl|PRINT}} "Turn Num or Cap Lock OFF!" - {{Cl|ELSE}} : {{Cl|COLOR}} 10: {{Cl|LOCATE}} 13, 50: {{Cl|PRINT}} "Number and Cap Lock OK! " + {{Cl|COLOR}} 12: {{Cl|LOCATE}} 13, 50: {{Cl|PRINT}} "Turn Num or Cap Lock OFF!" + {{Cl|ELSE}} : {{Cl|COLOR}} 10: {{Cl|LOCATE}} 13, 50: {{Cl|PRINT}} "Number and Cap Lock OK! " {{Cl|SLEEP}} ' {{Cl|KEY n|KEY}} or {{Cl|TIMER}} event breaks a sleep {{Cl|END IF}} {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) @@ -173,34 +173,34 @@ DO {{Cl|END}} UpPad: -COLOR 14: LOCATE 11, 26: PRINT " Up cursor pad " +COLOR 14: LOCATE 11, 26: PRINT " Up cursor pad " {{Cl|RETURN}} LPad: -COLOR 14: LOCATE 11, 26: PRINT "Left cursor pad " +COLOR 14: LOCATE 11, 26: PRINT "Left cursor pad " {{Cl|RETURN}} RPad: -COLOR 14: LOCATE 11, 26: PRINT "Right cursor pad" +COLOR 14: LOCATE 11, 26: PRINT "Right cursor pad" {{Cl|RETURN}} DnPad: -COLOR 14: LOCATE 11, 26: PRINT "Down cursor pad " +COLOR 14: LOCATE 11, 26: PRINT "Down cursor pad " {{Cl|RETURN}} UpNum: -COLOR 11: LOCATE 11, 26: PRINT " Up number pad " +COLOR 11: LOCATE 11, 26: PRINT " Up number pad " {{Cl|RETURN}} LNum: -COLOR 11: LOCATE 11, 26: PRINT "Left number pad " +COLOR 11: LOCATE 11, 26: PRINT "Left number pad " {{Cl|RETURN}} RNum: -COLOR 11: LOCATE 11, 26: PRINT "Right number pad" +COLOR 11: LOCATE 11, 26: PRINT "Right number pad" {{Cl|RETURN}} DnNum: -COLOR 11: LOCATE 11, 26: PRINT "Down number pad " +COLOR 11: LOCATE 11, 26: PRINT "Down number pad " {{Cl|RETURN}} '' '' {{CodeEnd}} : ''Explanation:'' The Number Lock or Caps Lock keys ON may hinder extended key reads in Qbasic but not QB64! -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> {{PageSeeAlso}} @@ -210,4 +210,4 @@ COLOR 11: LOCATE 11, 26: PRINT "Down number pad " * [[Keyboard scancodes]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/KILL.txt b/internal/help/KILL.txt index c9cca70ca..5d9796719 100644 --- a/internal/help/KILL.txt +++ b/internal/help/KILL.txt @@ -11,16 +11,16 @@ The [[KILL]] statement deletes a file designated by a [[STRING]] value or variab * {{Parameter|fileSpec$}} can include a path that can be either relative to the program's current location or absolute, from the root drive. * [[KILL]] cannot remove an [[OPEN]] file. The program must [[CLOSE]] it first. -* If the path or file does not exist, a "File not found" or "Path not found" [[ERROR Codes|error]] will result. See [[_FILEEXISTS]]. -* {{InlineCode}}[[SHELL]] "DEL /Q " + fileName${{InlineCodeEnd}} does the same without a prompt or verification for wildcard deletions. -* {{InlineCode}}[[SHELL]] "DEL /P " + fileName${{InlineCodeEnd}} will ask for user verification. +* If the path or file does not exist, a "File not found" or "Path not found" [[ERROR Codes|error]] will result. See [[_FILEEXISTS]]. +* {{InlineCode}}[[SHELL]] "DEL /Q " + fileName${{InlineCodeEnd}} does the same without a prompt or verification for wildcard deletions. +* {{InlineCode}}[[SHELL]] "DEL /P " + fileName${{InlineCodeEnd}} will ask for user verification. * Cannot delete folders or directories. Use [[RMDIR]] to remove empty folders. * '''Warning: files deleted with [[KILL]] will not go to the Recycle Bin and they cannot be restored.''' {{PageExamples}} {{CodeStart}} -KILL "C:\Qbasic\data\2000data.dat" +KILL "C:\Qbasic\data\2000data.dat" {{CodeEnd}} @@ -31,4 +31,4 @@ KILL "C:\Qbasic\data\2000data.dat" * [[DOS]], [[Batch Files]], [[DOS#DEL|DEL]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/Keyword_Reference_-_Alphabetical.txt b/internal/help/Keyword_Reference_-_Alphabetical.txt index f19325c26..26c450765 100644 --- a/internal/help/Keyword_Reference_-_Alphabetical.txt +++ b/internal/help/Keyword_Reference_-_Alphabetical.txt @@ -1,41 +1,39 @@ __NOTOC__ -<div id="toc"><p style="text-align: center"><br> '''Alphabetical QB64 Keyword Listings''' <br><br>     '''QB 64:'''  [[#uA|_A]] [[#uB|_B]] [[#uC|_C]] [[#uD|_D]] [[#uE|_E]] [[#uF|_F]] [[#uG|_G]] [[#uH|_H]] [[#uI|_I]] [[#uK|_K]] [[#uL|_L]] [[#uM|_M]] [[#uN|_N]] [[#uO|_O]] [[#uP|_P]] [[#uR|_R]] [[#uS|_S]] [[#uT|_T]] [[#uU|_U]] [[#uV|_V]] [[#uW|_W]]                <br><br>'''QBasic:'''  [[#A|A]]   [[#B|B]]   [[#C|C]]   [[#D|D]]   [[#E|E]]    [[#F|F]]   [[#G|G]]   [[#H|H]]    [[#I| I]]    [[#K|K]]   [[#L|L]]   [[#M|M]]   [[#N|N]]    [[#O|O]]   [[#P|P]]    [[#R|R]]   [[#S|S]]    [[#T|T]]   [[#U|U]]   [[#V|V]]   [[#W|W]]   [[#X|X]]   <br><br>'''OpenGL:'''   [[#glA|A]]    [[#glB|B]]    [[#glC|C]]    [[#glD|D]]    [[#glE|E]]     [[#glF|F]]    [[#glG|G]]    [[#glH|H]]    [[#glI| I  ]]   [[#glL|L]]    [[#glM|M]]    [[#glN|N]]     [[#glO|O]]    [[#glP|P]]     [[#glR|R]]    [[#glS|S]]     [[#glT|T]]    [[#glV|V]]       <br><br> [[#symbols|Symbols]] '''   -   ''' [[#references|References]]<br><br>[[Full Story|{{small|Menu Created by Cyperium}} ]]</p></div> +<div id="toc"><p style="text-align: center"><br> '''Alphabetical QB64 Keyword Listings''' <br><br>     '''QB 64:'''  [[#uA|_A]] [[#uB|_B]] [[#uC|_C]] [[#uD|_D]] [[#uE|_E]] [[#uF|_F]] [[#uG|_G]] [[#uH|_H]] [[#uI|_I]] [[#uK|_K]] [[#uL|_L]] [[#uM|_M]] [[#uN|_N]] [[#uO|_O]] [[#uP|_P]] [[#uR|_R]] [[#uS|_S]] [[#uT|_T]] [[#uU|_U]] [[#uV|_V]] [[#uW|_W]]                <br><br>'''QBasic:'''  [[#A|A]]   [[#B|B]]   [[#C|C]]   [[#D|D]]   [[#E|E]]    [[#F|F]]   [[#G|G]]   [[#H|H]]    [[#I| I]]    [[#K|K]]   [[#L|L]]   [[#M|M]]   [[#N|N]]    [[#O|O]]   [[#P|P]]    [[#R|R]]   [[#S|S]]    [[#T|T]]   [[#U|U]]   [[#V|V]]   [[#W|W]]   [[#X|X]]   <br><br>'''OpenGL:'''   [[#glA|A]]    [[#glB|B]]    [[#glC|C]]    [[#glD|D]]    [[#glE|E]]     [[#glF|F]]    [[#glG|G]]    [[#glH|H]]    [[#glI| I  ]]   [[#glL|L]]    [[#glM|M]]    [[#glN|N]]     [[#glO|O]]    [[#glP|P]]     [[#glR|R]]    [[#glS|S]]     [[#glT|T]]    [[#glV|V]]       <br><br> [[#symbols|Symbols]] '''   -   ''' [[#references|References]]<br><br>[[Full Story|{{small|Menu Created by Cyperium}} ]]</p></div> -<center>[[QB64 FAQ|Go to Frequently Asked Questions about QB64]]</center> +<center>[[QB64 FAQ|Go to Frequently Asked Questions about QB64]]</center> -<p style="text-align: center">[[Keyword Reference - By usage|Go to keywords by Usage]]</p> +<p style="text-align: center">[[Keyword Reference - By usage|Go to keywords by Usage]]</p> -<p style="text-align: center">Keywords beginning with _underscores are QB64 specific.</p> +<p style="text-align: center">Keywords beginning with _underscores are QB64 specific.</p> -<p style="text-align: center">[[Keywords currently not supported by QB64]]</p> +<p style="text-align: center">[[Keywords currently not supported by QB64]]</p> -<p style="text-align: center">[[Keywords currently not supported by QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Keywords Not Supported in Linux or MAC versions]]</p> +<p style="text-align: center">[[Keywords currently not supported by QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Keywords Not Supported in Linux or MAC versions]]</p> -<p style="text-align: center">Keywords without the underscore at the beginning should work with both QB 4.5 and QB64.</p> +<p style="text-align: center">Keywords without the underscore at the beginning should work with both QB 4.5 and QB64.</p> -<p style="text-align: center"> [https://dl.dropbox.com/u/10291175/QB64OfflineWiki.7z Download the QB64 WIKI for Offline Reference (7 Zip 3.8MB)].</p> +<p style="text-align: center">For comments or suggestions about this WIKI goto the [http://www.qb64.org/forum/index.php QB64 Forum].</p> -<p style="text-align: center"> Offline WIKI Reference contributed by OlDosLover.</p> +<center>'''[[Known QB64 Issues]]'''</center> -<p style="text-align: center">For comments or suggestions about this WIKI goto the [http://www.qb64.net/forum/index.php?board=14.0 QB64 Community Development Forum].</p> +<center> '''If code examples only display partial code, use the browser Refresh button'''</center> -<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> +<center>[[Main Page|Main Page with Appendix and Tutorials]]</center> ==QB64 specific keywords:== -<p style="text-align: center">The underscore prefix is reserved for QB64 _KEYWORDS only.</p> +<p style="text-align: center">The underscore prefix is reserved for QB64 _KEYWORDS only.</p> -<div id = "uA">_A</div> +<div id = "uA">_A</div> +* [[_ACCEPTFILEDROP]] (statement) {{text|turns a program window into a valid drop destination for dragging files from Windows Explorer.}} * [[_ACOS]] (function) {{text|arccosine function returns the angle in radians based on an input [[COS]]ine value range from -1 to 1.}} * [[_ACOSH]] (function) {{text|Returns the nonnegative arc hyperbolic cosine of x, expressed in radians.}} +* [[_ALLOWFULLSCREEN]] (statement) {{text|allows setting the behavior of the ALT+ENTER combo.}} * [[_ALPHA]] (function) {{text|returns the alpha channel transparency level of a color value used on a screen page or image.}} * [[_ALPHA32]] (function) {{text|returns the alpha channel transparency level of a color value used on a 32 bit screen page or image.}} * [[Mathematical_Operations|_ARCCOT]] (function) {{text|is the inverse function of the cotangent. . http://mathworld.wolfram.com/InverseCosecant.html}} @@ -52,7 +50,7 @@ __NOTOC__ ---- -<div id = "uB">_B</div> +<div id = "uB">_B</div> * [[_BACKGROUNDCOLOR]] (function) {{text|returns the current [[SCREEN|screen page]] background color.}} * [[_BIT]] (` numerical type) {{text|can return only signed values of 0 (bit off) and -1 (bit on). Unsigned 0 or 1.}} * [[_BLEND]] (statement) {{text|statement turns on 32 bit alpha blending for the current image or screen mode and is default.}} @@ -65,12 +63,12 @@ __NOTOC__ * [[_BUTTONCHANGE]] (function) {{text|returns -1 when a device button has been pressed and 1 when released. Zero indicates no change.}} * [[_BYTE]] (%% numerical type) {{text|can hold signed values from -128 to 127 (one byte or _BIT * 8). Unsigned from 0 to 255.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "uC">_C</div> +<div id = "uC">_C</div> * [[$CHECKING]] (QB64 C++ [[Metacommand]]) {{text|turns event error checking OFF or ON.}} * [[_CEIL]] (function) {{text|Rounds x upward, returning the smallest integral value that is not less than x.}} * [[_CLEARCOLOR (function)]] {{text|returns the current transparent color of an image.}} @@ -99,12 +97,12 @@ __NOTOC__ * [[_CV]] (function) {{text|converts any [[_MK$]] [[STRING]] value to the designated numerical type value.}} * [[_CWD$]] (function) {{text|returns the current working directory as a [[STRING]] value.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "uD">_D</div> +<div id = "uD">_D</div> * [[_D2G]] (function) {{text|converts degrees to gradient angle values.}} * [[_D2R]] (function) {{text|converts degrees to radian angle values.}} * [[DECLARE LIBRARY|DECLARE LIBRARY (QB64 statement block)]] {{text|declares a C++, SDL or Operating System [[SUB]] or [[FUNCTION]] to be used.}} @@ -127,12 +125,16 @@ __NOTOC__ * [[_DISPLAYORDER]] (statement) {{text|designates the order to render software, hardware and custom-opengl-code.}} * [[_DONTBLEND]] (statement) {{text|statement turns off default [[_BLEND]] 32 bit [[_ALPHA|alpha]] blending for the current image or screen.}} * [[_DONTWAIT]] ([[SHELL]] action) {{text|specifies that the program should not wait until the shelled command/program is finished.}} +* [[_DROPPEDFILE]] (function) {{text| returns the list of items (files or folders) dropped in a program's window after [[_ACCEPTFILEDROP]] is enabled.}} ---- -<div id = "uE">_E</div> +<div id +4000 + = "uE">_E</div> +* [[_ECHO]] (statement) {{text|used in conjunction with $IF for the precompiler.}} * [[$ELSE]] (Pre-Compiler [[Metacommand]]) {{text|used in conjunction with $IF for the precompiler.}} * [[$ELSEIF]] (Pre-Compiler [[Metacommand]]) {{text|used in conjunction with $IF for the precompiler.}} * [[$END IF]] (Pre-Compiler [[Metacommand]]) {{text|used in conjunction with $IF for the precompiler.}} @@ -140,13 +142,14 @@ __NOTOC__ * [[$EXEICON]] (Pre-Compiler [[Metacommand]]) {{text|used with a .ICO icon file name to embed the image into the QB64 executable.}} * [[_EXIT (function)]] {{text|prevents a user exit and indicates if a user has clicked the close X window button or CTRL + BREAK.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "uF">_F</div> +<div id = "uF">_F</div> * [[_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).}} * [[_FLOAT]] (numerical type ##) {{text|offers the maximum floating-point decimal precision available using QB64.}} * [[_FONT]] (statement) {{text|sets the current font handle to be used by PRINT or [[_PRINTSTRING]].}} * [[_FONT (function)]] {{text|creates a new font handle from a designated image handle.}} @@ -161,18 +164,18 @@ __NOTOC__ ---- -<div id = "uG">_G</div> +<div id = "uG">_G</div> * [[_G2D]] (function) {{text|converts gradient to degree angle values.}} * [[_G2R]] (function) {{text|converts gradient to radian angle values.}} * [[_GREEN]] (function) {{text|function returns the palette or the green component intensity of a 32-bit image color.}} * [[_GREEN32]] (function) {{text|returns the green component intensity of a 32-bit color value.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "uH">_H</div> +<div id = "uH">_H</div> * [[_HEIGHT]] (function) {{text|returns the height of a designated image handle.}} * [[_HIDE]] ([[SHELL]] action) {{text| hides the command line display during a shell.}} * [[_HYPOT]] (function) {{text|Returns the hypotenuse of a right-angled triangle whose legs are x and y.}} @@ -181,20 +184,21 @@ __NOTOC__ ---- -<div id = "uI">_I</div> +<div id = "uI">_I</div> * [[$IF]] (Pre-Compiler [[Metacommand]]) {{text|used to set an IF condition for the precompiler.}} * [[_ICON]] (statement) {{text|designates a [[_LOADIMAGE]] image file handle to be used as the program's icon or loads the embedded icon (see [[$EXEICON]]).}} * [[_INCLERRORFILE$]] {function) {{text|returns the name of the original source code $INCLUDE module that caused the most recent error.}} * [[_INCLERRORLINE]] (function) {{text|returns the line number in an included file that caused the most recent error.}} +* [[_INSTRREV]] (function) {{text|allows searching for a substring inside another string, but unlike [[INSTR]] it returns the last occurrence instead of the first one.}} * [[_INTEGER64]] (&& numerical type) {{text|can hold whole numerical values from -9223372036854775808 to 9223372036854775807.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "uK">_K</div> +<div id = "uK">_K</div> *[[_KEYCLEAR]] (function) {{text|clears the keyboard buffers for INKEY$, _KEYHIT, and INP.}} *[[_KEYHIT]] (function) {{text|returns [[ASCII]] one and two byte, SDL Virtual Key and [[Unicode]] keyboard key press codes.}} *[[_KEYDOWN]] (function) {{text|returns whether CTRL, ALT, SHIFT, combinations and other keys are pressed.}} @@ -203,7 +207,7 @@ __NOTOC__ ---- -<div id = "uL">_L</div> +<div id = "uL">_L</div> * [[$LET]] (Pre-Compiler [[Metacommand]]) {{text|used to set a flag variable for the precompiler.}} * [[_LASTAXIS]] (function) {{text|returns the number of axis available on a specified number device listed by [[_DEVICE$]].}} * [[_LASTBUTTON]] (function) {{text|returns the number of buttons available on a specified number device listed by [[DEVICE$]].}} @@ -212,12 +216,12 @@ __NOTOC__ * [[_LOADFONT]] (function) {{text|designates a [[_FONT|font]] TTF file to load and returns a handle value.}} * [[_LOADIMAGE]] (function) {{text|designates an image file to load and returns a handle value.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "uM">_M</div> +<div id = "uM">_M</div> * [[_MAPTRIANGLE]] (statement) {{text|maps a triangular image source area to put on a destination area.}} * [[_MAPUNICODE]] (statement) {{text|maps a [[Unicode]] value to an [[ASCII]] code number.}} * [[_MAPUNICODE (function)]] {{text|returns the [[Unicode]] (UTF32) code point value of a mapped [[ASCII]] character code.}} @@ -243,7 +247,7 @@ __NOTOC__ * [[_MOUSEMOVEMENTY]] (function) {{text|returns the relative vertical position of the mouse cursor compared to the previous position.}} * [[_MOUSEPIPEOPEN]] (function) {{text|creates a pipe handle value for a mouse when using a virtual keyboard.}} * [[_MOUSESHOW]] (statement) {{text|displays the mouse cursor after it has been hidden or can change the cursor shape.}} -* [[_MOUSEWHEEL]] (function) {{text|returns the number of mouse scroll wheel "clicks" since last read.}} +* [[_MOUSEWHEEL]] (function) {{text|returns the number of mouse scroll wheel "clicks" since last read.}} * [[_MOUSEX]] (function) {{text|returns the current horizontal position of the mouse cursor.}} * [[_MOUSEY]] (function) {{text|returns the current vertical position of the mouse cursor.}} @@ -251,15 +255,15 @@ __NOTOC__ ---- -<div id = "uN">_N</div> +<div id = "uN">_N</div> * [[_NEWIMAGE]] (function) {{text|creates a designated size program [[SCREEN]] or page image and returns a handle value.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "uO">_O</div> +<div id = "uO">_O</div> * [[_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.}} * [[_OPENCLIENT]] (TCP/IP function) {{text|connects to a Host on the Internet as a Client and returns the Client status handle.}} @@ -272,7 +276,7 @@ __NOTOC__ ---- -<div id = "uP">_P</div> +<div id = "uP">_P</div> * [[_PALETTECOLOR]] (statement) {{text|sets the color value of a palette entry of an image using 256 colors or less palette modes.}} * [[_PALETTECOLOR (function)]] {{text|return the 32 bit attribute color setting of an image or screen page handle's palette.}} * [[_PI]] (function) {{text|returns the value of '''π''' or parameter multiples for angle or [[CIRCLE|circle]] calculations.}} @@ -285,12 +289,12 @@ __NOTOC__ * [[_PRINTWIDTH]] (function) {{text|returns the pixel width of a text string to be printed using [[_PRINTSTRING]].}} * [[_PUTIMAGE]] (statement) {{text|maps a rectangular image source area to an image destination area.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "uR">_R</div> +<div id = "uR">_R</div> * [[_R2D]] (function) {{text|converts radians to degree angle values.}} * [[_R2G]] (function) {{text|converts radians to gradient angle values.}} * [[_RED]] (function) {{text|function returns the palette or the red component intensity of a 32-bit image color.}} @@ -306,12 +310,12 @@ __NOTOC__ * [[_RGBA32]] (function) {{text|returns the [[LONG]] 32 bit color value in 32 bit screens only with the [[ALPHA]]}} * [[_ROUND]] (function) {{text|rounds to the closest [[INTEGER]], [[LONG]] or [[_INTEGER64]] numerical value.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "uS">_S</div> +<div id = "uS">_S</div> * [[Mathematical_Operations#Derived_Mathematical_Functions|_SEC]] (function) {{text| the mathematical function secant defined by 1/COS. http://mathworld.wolfram.com/Secant.html}} * [[Mathematical_Operations#Derived_Mathematical_Functions|_SECH]] (function) {{text|Returns the hyperbolic secant. http://mathworld.wolfram.com/HyperbolicSecant.html}} * [[_SCREENCLICK]] (statement) {{text|simulates clicking on a point on the desktop screen with the left mouse button.}} @@ -330,6 +334,8 @@ __NOTOC__ * [[_SETALPHA]] (statement) {{text|sets the alpha channel transparency level of some or all of the pixels of an image.}} * [[_SHELLHIDE]] (function) {{text|returns the code sent by a program exit using [[END]] or [[SYSTEM]] followed by an [[INTEGER]] value.}} +* [[_SHL]] (function) {{text|used to shift the bits of a numerical value to the left}} +* [[_SHR]] (function) {{text|used to shift the bits of a numerical value to the right.}} * [[Mathematical_Operations|_SINH]] (function) {{text|Returns the hyperbolic sine of x radians.}} * [[_SNDBAL]] (statement) {{text|attempts to set the balance or 3D position of a sound file.}} * [[_SNDCLOSE]] (statement) {{text|frees and unloads an open sound using the sound handle created by [[_SNDOPEN]].}} @@ -359,22 +365,24 @@ __NOTOC__ * [[_STRCMP]] (function) {{text|compares the relationship between two strings.}} * [[_STRICMP]] (function) {{text|compares the relationship between two strings, without regard for case-sensitivity.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "uT">_T</div> +<div id = "uT">_T</div> * [[Mathematical_Operations|_TANH]] (function) {{text|Returns the hyperbolic tangent of x radians.}} * [[_TITLE]] (statement) {{text|sets the program title [[STRING|string]] value.}} * [[_TITLE$]] (function) {{text|gets the program title [[STRING|string]] value.}} +* [[_TOTALDROPPEDFILES]] (function) {{text| returns the number of items (files or folders) dropped in a program's window after [[_ACCEPTFILEDROP]] is enabled.}} +* [[_TRIM$]] (function) {{text|shorthand to [[LTRIM$]]([[RTRIM$]]("text"))}} ---- -<div id = "uU">_U</div> +<div id = "uU">_U</div> * [[_UNSIGNED]] (numerical type) {{text|expands the positive range of numerical [[INTEGER]], [[LONG]] or [[_INTEGER64]] values returned.}} @@ -382,31 +390,31 @@ __NOTOC__ ---- -<div id = "uV">_V</div> +<div id = "uV">_V</div> * [[$VERSIONINFO]] ([[Metacommand]]) {{text|adds metadata to Windows only binaries for identification purposes across the OS.}} -* [[$VIRTUALKEYBOARD]] ([[Metacommand]]) {{text|turns the virtual keyboard ON or OFF for use in touch-enabled devices}} +* [[$VIRTUALKEYBOARD]] ([[Metacommand]] - Deprecated) {{text|turns the virtual keyboard ON or OFF for use in touch-enabled devices}} ---- -<div id = "uW">_W</div> +<div id = "uW">_W</div> * [[_WHEEL]] (function) {{text|returns -1 when a control device wheel is scrolled up and 1 when scrolled down. Zero indicates no activity.}} * [[_WIDTH (function)]] {{text|returns the width of a [[SCREEN]] or image handle.}} * [[_WINDOWHANDLE]] (function) {{text|returns the window handle assigned to the current program by the OS. Windows-only.}} * [[_WINDOWHASFOCUS]] (function) {{text|returns true (-1) if the current program's window has focus. Windows-only.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> -<center>([[Keyword Reference - Alphabetical#QB64 specific keywords:|Go to Top of QB64 specific keywords]])</center> +<center>([[Keyword Reference - Alphabetical#QB64 specific keywords:|Go to Top of QB64 specific keywords]])</center> ==Original QBasic keywords:== -'''<p style="text-align: center">These QBasic keywords (with a few noted exceptions) will work in all versions of QB64.</p>''' +'''<p style="text-align: center">These QBasic keywords (with a few noted exceptions) will work in all versions of QB64.</p>''' -<div id = "A">A</div> +<div id = "A">A</div> * [[ABS]] (function) {{text|converts any negative numerical value to a positive value.}} * [[CALL ABSOLUTE|ABSOLUTE]] (statement) {{text|is used to access computer interrupt registers.}} * [[ACCESS]] (file statement) {{text|sets the read and write access of a file when opened.}} @@ -423,19 +431,19 @@ __NOTOC__ ---- -<div id = "B">B</div> +<div id = "B">B</div> * [[BEEP]] (statement) {{text|creates an error sound of a fixed duration.}} * [[BINARY]] (file mode) {{text|creates or opens an existing file for [[GET|read]] and [[PUT|write]] byte-wise access.}} * [[BLOAD]] (statement) {{text|transfers the contents of a [[BINARY]] [[BSAVE]] file to a specific [[Arrays|array]].}} * [[BSAVE]] (statement) {{text|transfers the contents of an [[Arrays|array]] to a specified size [[BINARY]] file.}} * [[BYVAL]] (statement) {{text|assigns a numerical variable value by its value, not the name.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "C">C</div> +<div id = "C">C</div> * [[CALL]] (statement) {{text|optional statement that sends the program to a [[SUB]] procedure. Requires parameters be enclosed in brackets(parenthesis).}} * [[CALL ABSOLUTE]] (statement) {{text|is used to access computer interrupt registers.}} * [[CALLS]] (non-BASIC call statement) @@ -467,12 +475,12 @@ __NOTOC__ * [[CVS]] (function) {{text|returns the [[SINGLE]] numerical value of a 4 byte [[MKS$]] [[STRING|string]].}} * [[CVSMBF]] (function) {{text|returns the [[SINGLE]] numerical value of a [[MKSMBF$|Microsoft Binary Format]] [[STRING|string]].}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "D">D</div> +<div id = "D">D</div> * [[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.}} @@ -493,12 +501,12 @@ __NOTOC__ * [[DRAW]] (statement) {{text|uses a special [[STRING|string]] format that draws graphical lines in specific directions.}} * [[$DYNAMIC]] ([[Metacommand]]) {{text|used at the start of a program to set all program arrays as changeable in size using [[REDIM]].}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "E">E</div> +<div id = "E">E</div> * [[ELSE]] ([[IF...THEN]] statement) {{text|is used to direct program flow when no other condition is evaluated as true.}} * [[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.}} @@ -516,12 +524,12 @@ __NOTOC__ * [[EXIT]] (statement) {{text|immediately exits a program [[FOR...NEXT]], [[DO...LOOP]], [[SUB]], [[FUNCTION]] or [[DEF FN]] 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> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "F">F</div> +<div id = "F">F</div> * [[FIELD]] (statement) {{text|defines the variable sizes to be written or read from a file.}} * [[FILEATTR]] (function) {{text|returns the current file access mode.}} * [[FILES]] (statement) {{text|returns a list of files in the current directory path to the [[SCREEN]].}} @@ -537,26 +545,26 @@ __NOTOC__ ---- -<div id = "G">G</div> +<div id = "G">G</div> * [[GET]] (file statement) {{text|reads a file sequencially or at a specific position and returns the value as the variable type used.}} * [[GET (TCP/IP statement)|GET (QB64 TCP/IP statement)]] {{text|reads a connection port to return a value.}} * [[GET (graphics statement)]] {{text|maps an area the current [[SCREEN|screen's]] video information and places it in an [[INTEGER]] [[arrays|array]].}} * [[GOSUB]] (statement) {{text|sends the program to a designated line label procedure in the main program.}} * [[GOTO]] (statement) {{text|sends the program to a designated line number or line label in a procedure.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "H">H</div> +<div id = "H">H</div> * [[HEX$]] (function) {{text|returns the hexadecimal(base 16) [[STRING]] representation of a decimal [[INTEGER]] value.}} ---- -<div id = "I">I</div> +<div id = "I">I</div> * [[IF...THEN]] (statement) {{text|a conditional block statement used control program flow.}} * [[IMP]] (logic operator) {{text|is used to compare two numerical values bitwise.}} * [[$INCLUDE]] ([[Metacommand]]) {{text|designates a text code library file to include with the program.}} @@ -576,23 +584,25 @@ __NOTOC__ * [[IOCTL$]] (function) -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "K">K</div> -* [[KEY n]] (statement) {{text|used with [[ON KEY(n)]] events to assign a "softkey" string to a key or create a user defined key.}} +<div id = "K">K</div> +* [[KEY n]] (statement) {{text|used with [[ON KEY(n)]] +4000 +events to assign a "softkey" string to a key or create a user defined key.}} * [[KEY(n)]] (statement) {{text|used with [[ON KEY(n)]] events to assign, enable, disable or suspend event trapping.}} * [[KEY LIST]] (statement) {{text|lists the 12 Function key soft key string assignments going down left side of screen.}} * [[KILL]] (statement) {{text|deletes the specified file without a warning. Remove empty folders with [[RMDIR]].}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "L">L</div> +<div id = "L">L</div> * [[LBOUND]] (function) {{text|returns the lower boundary of the specified array.}} * [[LCASE$]] (function) {{text|returns the lower case value of a [[STRING]].}} * [[LEFT$]] (function) {{text|returns the specified number of text characters from the left end of a [[STRING]].}} @@ -601,7 +611,7 @@ __NOTOC__ * [[LINE]] (statement) {{text|creates a graphic line or box on the [[SCREEN]].}} * [[LINE INPUT]] (statement) {{text|user input can be any text character including commas and quotes as a [[STRING]] value only.}} * [[LINE INPUT (file statement)]] {{text|returns an entire text file line and returns it as a [[STRING]] value.}} -* [[KEY LIST|LIST]] {{text|displays the current [[ON KEY(n)]] function key (F1 to F10) "soft key" settings.}} +* [[KEY LIST|LIST]] {{text|displays the current [[ON KEY(n)]] function key (F1 to F10) "soft key" settings.}} * [[LOC]] (function) {{text|returns the present file byte position or number of bytes in the [[OPEN COM]] buffer.}} * [[LOCATE]] (statement) {{text|sets the text cursor's row and column position for a [[PRINT]] or [[INPUT]] statement.}} * [[LOCK]] (statement) {{text|restricts access to portions or all of a file by other programs or processes.}} @@ -615,12 +625,12 @@ __NOTOC__ * [[LSET]] (statement) {{text|left justifies the text in a string so that there are no leading spaces.}} * [[LTRIM$]] (function) {{text|returns a [[STRING|string]] value with no leading spaces.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "M">M</div> +<div id = "M">M</div> * [[MID$]] (function) {{text|returns a designated portion of a [[STRING]].}} * [[MID$ (statement)]] {{text|redefines existing characters in a [[STRING]].}} * [[MKD$]] (function) {{text|returns an 8 byte [[ASCII]] [[STRING|string]] representation of a [[DOUBLE]] numerical value.}} @@ -636,17 +646,17 @@ __NOTOC__ ---- -<div id = "N">N</div> +<div id = "N">N</div> * [[NAME]] (statement) {{text|names an existing file name [[AS]] a new file name.}} * [[NEXT]] (statement) {{text|bottom end of a [[FOR...NEXT]] counter loop to returns to the start or a [[RESUME|RESUME NEXT]] error.}} * [[NOT]] (logical operator) {{text|inverts the value of a logic operation or returns True when a [[boolean]] evaluation is False.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "O">O</div> +<div id = "O">O</div> * [[OCT$]] (function) {{text|returns the octal (base 8) [[STRING]] representation of a decimal [[INTEGER]] value.}} * [[OFF]] (event statement) {{text|turns off all [[ON]] event checking.}} * [[ON COM(n)]] (statement) {{text|sets up a COM port event procedure call.}} @@ -657,8 +667,8 @@ __NOTOC__ * [[ON STRIG(n)]] (statement) {{text|sets up a joystick button event procedure call.}} * [[ON TIMER(n)]] (statement) {{text|sets up a timed event procedure call.}} * [[ON UEVENT]] (statement) '''{{text|Not implemented in QB64.}}''' -* [[ON...GOSUB]] (statement) {{text|sets up a numberical event procedure call.}} -* [[ON...GOTO]] (statement) {{text|sets up a numberical event procedure call.}} +* [[ON...GOSUB]] (statement) {{text|sets up a numerical event procedure call.}} +* [[ON...GOTO]] (statement) {{text|sets up a numerical event procedure call.}} * [[OPEN]] (file statement) {{text|opens a file name for an access mode with a specific file number.}} * [[OPEN COM]] (statement) {{text|opens a serial communication port for access at a certain speed and mode.}} * [[OPTION BASE]] (statement) {{text|can set the lower boundary of all arrays to 1.}} @@ -667,12 +677,12 @@ __NOTOC__ * [[OUT]] (statement) {{text|writes numerical data to a specified register port.}} * [[OUTPUT]] (file mode) {{text|creates a new file or clears all data from an existing file to acess the file sequencially.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "P">P</div> +<div id = "P">P</div> * [[PAINT]] (statement) {{text|fills an enclosed area of a graphics [[SCREEN|screen]] with a color until it encounters a specific colored border.}} * [[PALETTE]] (statement) {{text|sets the Red, Green and Blue color attribute intensities using a RGB multiplier calculation.}} * [[PALETTE USING]] (statement) {{text|sets the color intensity settings using a designated [[arrays|array]].}} @@ -697,12 +707,12 @@ __NOTOC__ * [[PUT (TCP/IP statement)|PUT (QB64 TCP/IP statement)]] {{text|sends raw data to a user's connection handle.}} * [[PUT (graphics statement)]] {{text|places pixel data stored in an [[INTEGER]] array to a specified area of the [[SCREEN]].}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "R">R</div> +<div id = "R">R</div> * [[RANDOM]] (file mode) {{text|creates a file or opens an existing file to [[GET|read]] and [[PUT|write]] records of a set byte size.}} * [[RANDOMIZE]] (statement) {{text|sets the random seed value for a specific sequence of random [[RND]] values.}} * [[RANDOMIZE|RANDOMIZE USING (QB64 statement)]] {{text|restarts the designated seed value's random sequence of values from the beginning.}} @@ -720,12 +730,12 @@ __NOTOC__ * [[RTRIM$]] (function) {{text|returns a [[STRING|string]] with all spaces removed from the right end.}} * [[RUN]] (statement) {{text|clears and restarts the program currently in memory or executes another specified program.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "S">S</div> +<div id = "S">S</div> * [[SADD]] (function) {{text|returns the address of a STRING variable as an offset from the current data segment.}} * [[SCREEN (function)]] {{text|can return the [[ASCII]] character code or color of the text at a text designated coordinate.}} * [[SCREEN]] (statement) {{text|sets the display mode and size of the program window.}} @@ -759,12 +769,12 @@ __NOTOC__ * [[SWAP]] (statement) {{text|swaps two [[STRING|string]] or numerical values.}} * [[SYSTEM]] (statement) {{text|ends a program immediately.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "T">T</div> +<div id = "T">T</div> * [[TAB]] (function) {{text|moves a designated number of columns on the [[SCREEN|screen]].}} * [[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.}} @@ -781,19 +791,19 @@ __NOTOC__ ---- -<div id = "U">U</div> +<div id = "U">U</div> * [[UBOUND]] (function) {{text|returns the upper-most index number of a designated [[arrays|array]].}} * [[UCASE$]] (function) {{text|returns an uppercase representation of a specified [[STRING]].}} * [[UEVENT]] (statement) '''{{text|Not implemented in QB64.}}''' * [[UNLOCK]] (statement) {{text|unlocks a designated file or portions of it.}} * [[UNTIL]] (condition) {{text|evaluates a [[DO...LOOP]] condition until it is True.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "V">V</div> +<div id = "V">V</div> * [[VAL]] (function) {{text|returns the numerical value of a [[STRING|string]] number.}} * [[VARPTR]] (function) {{text|returns the [[segment]] pointer address in memory.}} * [[VARPTR$]] (function) {{text|returns the string value of a numerical value in memory.}} @@ -805,9 +815,11 @@ __NOTOC__ ---- -<div id = "W">W</div> +<div id = "W">W</div> * [[WAIT]] (statement) {{text|waits until a vertical retrace is started or a [[SCREEN|screen]] draw ends.}} * [[WEND]] (statement) {{text|the bottom end of a [[WHILE...WEND]] loop.}} + +4000 * [[WHILE]] (condition) {{text|evaluates a [[DO...LOOP]] or [[WHILE...WEND]] condition until it is False.}} * [[WHILE...WEND]] (statement) {{text|sets a recursive procedure loop that can only be exited using the [[WHILE]] conditional argument.}} * [[WIDTH]] (statement) {{text|sets the text column and row sizes in several [[SCREEN]] modes.}} @@ -819,25 +831,25 @@ __NOTOC__ ---- -<div id = "X">X</div> +<div id = "X">X</div> * [[XOR]] (logic operator) {{text|is used to compare two numerical values bitwise.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> -<center>([[Keyword Reference - Alphabetical#Original QBasic keywords:|Go to Top of Original QB keywords]])</center> +<center>([[Keyword Reference - Alphabetical#Original QBasic keywords:|Go to Top of Original QB keywords]])</center> <!-- (referenced by QB64 IDE HELP) ---> +--> ==OpenGL specific keywords:== -<center>'''All QB64 OpenGL keywords must use the underscore _gl prefix with the alphabetically listed function names.'''</center> -<center>'''The following keywords cannot be used in QB64 versions .954 and below.'''</center> +<center>'''All QB64 OpenGL keywords must use the underscore _gl prefix with the alphabetically listed function names.'''</center> +<center>'''The following keywords cannot be used in QB64 versions .954 and below.'''</center> -<div id = "glA">_glA</div> +<div id = "glA">_glA</div> * [[_glAccum]] (statement) {{text|OpenGL command}} * [[_glAlphaFunc]] (statement) {{text|OpenGL command}} * [[_glAreTexturesResident]] (statement) {{text|OpenGL command}} @@ -845,15 +857,15 @@ __NOTOC__ ---- -<div id = "glB">_glB</div> +<div id = "glB">_glB</div> * [[_glBegin]] (statement) {{text|OpenGL command}} * [[_glBindTexture]] (statement) {{text|OpenGL command binds a named texture to a texturing target}} * [[_glBitmap]] (statement) {{text|OpenGL command}} * [[_glBlendFunc]] (statement) {{text|OpenGL command}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "glC">_glC</div> +<div id = "glC">_glC</div> * [[_glCallList]] (statement) {{text|OpenGL command}} * [[_glCallLists]] (statement) {{text|OpenGL command}} * [[_glClear]] (statement) {{text|OpenGL command clears buffers to preset values}} @@ -871,7 +883,7 @@ __NOTOC__ * [[_glColor3fv]] (statement) {{text|OpenGL command}} * [[_glColor3i]] (statement) {{text|OpenGL command}} * [[_glColor3iv]] (statement) {{text|OpenGL command}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> * [[_glColor3s]] (statement) {{text|OpenGL command}} * [[_glColor3sv]] (statement) {{text|OpenGL command}} * [[_glColor3ub]] (statement) {{text|OpenGL command}} @@ -906,9 +918,9 @@ __NOTOC__ * [[_glCopyTexSubImage2D]] (statement) {{text|OpenGL command copiess a two-dimensional texture subimage}} * [[_glCullFace]] (statement) {{text|OpenGL command}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "glD">_glD</div> +<div id = "glD">_glD</div> * [[_glDeleteLists]] (statement) {{text|OpenGL command}} * [[_glDeleteTextures]] (statement) {{text|OpenGL command deletes named textures}} * [[_glDepthFunc]] (statement) {{text|OpenGL command specifies the value used for depth buffer comparisons}} @@ -923,7 +935,7 @@ __NOTOC__ ---- -<div id = "glE">_glE</div> +<div id = "glE">_glE</div> * [[_glEdgeFlag]] (statement) {{text|OpenGL command}} * [[_glEdgeFlagPointer]] (statement) {{text|OpenGL command}} * [[_glEdgeFlagv]] (statement) {{text|OpenGL command}} @@ -944,9 +956,9 @@ __NOTOC__ * [[_glEvalPoint1]] (statement) {{text|OpenGL command}} * [[_glEvalPoint2]] (statement) {{text|OpenGL command}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "glF">_glF</div> +<div id = "glF">_glF</div> * [[_glFeedbackBuffer]] (statement) {{text|OpenGL command}} * [[_glFinish]] (statement) {{text|OpenGL command}} * [[_glFlush]] (statement) {{text|OpenGL command}} @@ -957,9 +969,9 @@ __NOTOC__ * [[_glFrontFace]] (statement) {{text|OpenGL command}} * [[_glFrustum]] (statement) {{text|OpenGL command}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "glG">_glG</div> +<div id = "glG">_glG</div> * [[_glGenLists]] (statement) {{text|OpenGL command}} * [[_glGenTextures]] (statement) {{text|OpenGL command}} * [[_glGetBooleanv]] (statement) {{text|OpenGL command}} @@ -992,14 +1004,14 @@ __NOTOC__ * [[_glGetTexParameterfv]] (statement) {{text|OpenGL command}} * [[_glGetTexParameteriv]] (statement) {{text|OpenGL command}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "glH">_glH</div> +<div id = "glH">_glH</div> * [[_glHint]] (statement) {{text|OpenGL command}} ---- -<div id = "glI">_glI</div> +<div id = "glI">_glI</div> * [[_glIndexMask]] (statement) {{text|OpenGL command}} * [[_glIndexPointer]] (statement) {{text|OpenGL command}} * [[_glIndexd]] (statement) {{text|OpenGL command}} @@ -1018,9 +1030,9 @@ __NOTOC__ * [[_glIsList]] (statement) {{text|OpenGL command}} * [[_glIsTexture]] (statement) {{text|OpenGL command}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "glL">_glL</div> +<div id = "glL">_glL</div> * [[_glLightModelf]] (statement) {{text|OpenGL command}} * [[_glLightModelfv]] (statement) {{text|OpenGL command}} * [[_glLightModeli]] (statement) {{text|OpenGL command}} @@ -1038,9 +1050,9 @@ __NOTOC__ * [[_glLoadName]] (statement) {{text|OpenGL command}} * [[_glLogicOp]] (statement) {{text|OpenGL command}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "glM">_glM</div> +<div id = "glM">_glM</div> * [[_glMap1d]] (statement) {{text|OpenGL command}} * [[_glMap1f]] (statement) {{text|OpenGL command}} * [[_glMap2d]] (statement) {{text|OpenGL command}} @@ -1059,7 +1071,7 @@ __NOTOC__ ---- -<div id = "glN">_glN</div> +<div id = "glN">_glN</div> * [[_glNewList]] (statement) {{text|OpenGL command}} * [[_glNormal3b]] (statement) {{text|OpenGL command}} * [[_glNormal3bv]] (statement) {{text|OpenGL command}} @@ -1073,14 +1085,14 @@ __NOTOC__ * [[_glNormal3sv]] (statement) {{text|OpenGL command}} * [[_glNormalPointer]] (statement) {{text|OpenGL command}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "glO">_glO</div> +<div id = "glO">_glO</div> * [[_glOrtho]] (statement) {{text|OpenGL command}} ---- -<div id = "glP">_glP</div> +<div id = "glP">_glP</div> * [[_glPassThrough]] (statement) {{text|OpenGL command}} * [[_glPixelMapfv]] (statement) {{text|OpenGL command}} * [[_glPixelMapuiv]] (statement) {{text|OpenGL command}} @@ -1104,9 +1116,9 @@ __NOTOC__ * [[_glPushMatrix]] (statement) {{text|OpenGL command}} * [[_glPushName]] (statement) {{text|OpenGL command}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "glR">_glR</div> +<div id = "glR">_glR</div> * [[_glRasterPos2d]] (statement) {{text|OpenGL command}} * [[_glRasterPos2dv]] (statement) {{text|OpenGL command}} * [[_glRasterPos2f]] (statement) {{text|OpenGL command}} @@ -1125,9 +1137,11 @@ __NOTOC__ * [[_glRasterPos3sv]] (statement) {{text|OpenGL command}} * [[_glRasterPos4d]] (statement) {{text|OpenGL command}} * [[_glRasterPos4dv]] (statement) {{text|OpenGL command}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> * [[_glRasterPos4f]] (statement) {{text|OpenGL command}} -* [[_glRasterPos4fv]] (statement) {{text|OpenGL command}} +* [[_glRasterPos4fv] +4000 +] (statement) {{text|OpenGL command}} * [[_glRasterPos4i]] (statement) {{text|OpenGL command}} * [[_glRasterPos4iv]] (statement) {{text|OpenGL command}} * [[_glRasterPos4s]] (statement) {{text|OpenGL command}} @@ -1147,9 +1161,9 @@ __NOTOC__ * [[_glRotated]] (statement) {{text|OpenGL command}} * [[_glRotatef]] (statement) {{text|OpenGL command}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "glS">_glS</div> +<div id = "glS">_glS</div> * [[_glScaled]] (statement) {{text|OpenGL command}} * [[_glScalef]] (statement) {{text|OpenGL command}} * [[_glScissor]] (statement) {{text|OpenGL command}} @@ -1161,7 +1175,7 @@ __NOTOC__ ---- -<div id = "glT">_glT</div> +<div id = "glT">_glT</div> * [[_glTexCoord1d]] (statement) {{text|OpenGL command}} * [[_glTexCoord1dv]] (statement) {{text|OpenGL command}} * [[_glTexCoord1f]] (statement) {{text|OpenGL command}} @@ -1183,7 +1197,7 @@ __NOTOC__ * [[_glTexCoord3f]] (statement) {{text|OpenGL command}} * [[_glTexCoord3fv]] (statement) {{text|OpenGL command}} * [[_glTexCoord3i]] (statement) {{text|OpenGL command}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> * [[_glTexCoord3iv]] (statement) {{text|OpenGL command}} * [[_glTexCoord3s]] (statement) {{text|OpenGL command}} * [[_glTexCoord3sv]] (statement) {{text|OpenGL command}} @@ -1217,9 +1231,9 @@ __NOTOC__ * [[_glTranslated]] (statement) {{text|OpenGL command}} * [[_glTranslatef]] (statement) {{text|OpenGL command}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ---- -<div id = "glV">_glV</div> +<div id = "glV">_glV</div> * [[_glVertex2d]] (statement) {{text|OpenGL command}} * [[_glVertex2dv]] (statement) {{text|OpenGL command}} * [[_glVertex2f]] (statement) {{text|OpenGL command}} @@ -1249,21 +1263,21 @@ __NOTOC__ -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> -<div id = "symbols"></div> +<div id = "symbols"></div> ==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> +<center>''[Note: All symbols below can also be used inside of literal quoted strings except for quotation marks.]''</center> :'''Print, Input or File Formatting''' * [[Semicolon|; Semicolon]] after a [[PRINT]] stops invisible cursor at end of printed value. Can prevent screen rolling. A [[Semicolon]] after the [[INPUT]] prompt text will display a question mark after the text. * [[Comma|, Comma]] after a [[PRINT]] tabs invisible cursor past end of printed value. After the [[INPUT]] prompt text a [[comma]] displays no [[Question mark]]. -* [[Quotation mark|" Quotation mark]] delimits the ends of a literal [[STRING]] value in a [[PRINT]], [[INPUT]] or [[LINE INPUT]] statement. +* [[Quotation mark|" Quotation mark]] delimits the ends of a literal [[STRING]] value in a [[PRINT]], [[INPUT]] or [[LINE INPUT]] statement. * [[Question mark|? Question mark]] is a shortcut substitute for the [[PRINT]] keyword. Will change to PRINT when cursor leaves the code line. @@ -1274,9 +1288,9 @@ __NOTOC__ * [[Dollar_Sign|$ Dollar sign]] prefix denotes a QBasic [[Metacommand]]. * [[Parenthesis|( ) Parenthesis]] enclose a math or conditional procedure order, [[SUB]] or [[FUNCTION]] parameters or to pass by value. * [[+|+ Plus]] [[concatenation]] operator MUST be used to combine literal string values in a variable definition. -* [[Quotation mark|" Quotation mark]] designates the ends of a literal [[STRING]] value. Use [[CHR$]](34) to insert quotes in a text [[STRING]]. +* [[Quotation mark|" Quotation mark]] designates the ends of a literal [[STRING]] value. Use [[CHR$]](34) to insert quotes in a text [[STRING]]. * [[Underscore|_ Underscore]] can be used to continue a line of code to the next program line in '''QB64'''. -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> :'''Variable Name Type Suffixes''' * [[STRING|$ STRING]] text character type: 1 byte @@ -1291,7 +1305,7 @@ __NOTOC__ * [[_BYTE|%% _BYTE]] '''QB64''' [[INTEGER|whole]] numerical type (1 byte) * [[_OFFSET|%& _OFFSET]] '''QB64''' [[INTEGER|whole]] numerical pointer address type (any byte size required) -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> :'''Numerical Base Prefixes''' * [[&B|&B Binary]] Base 2: Digits 0 or 1 ['''QB64'''] @@ -1311,18 +1325,18 @@ __NOTOC__ :'''[[Relational Operations]]''' * [[Equal|=]] Equal to condition -* [[Not_Equal|<>]] Not equal condition -* [[Greater_Than|>]] Greater than condition +* [[Not_Equal|<>]] Not equal condition +* [[Greater_Than|>]] Greater than condition * [[Less_Than|<]] Less than condition -* [[Greater_Than_Or_Equal|>=]] Greater than or equal to condition +* [[Greater_Than_Or_Equal|>=]] Greater than or equal to condition * [[Less_Than_Or_Equal|<=]] Less than or equal to condition -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ==References:== -<div id = "references"></div> +<div id = "references"></div> -<center>'''WIKI Pages''' +<center>'''WIKI Pages''' [[Keyword Reference - Alphabetical#QB64 specific keywords:|Go to QB64 specific keywords]] @@ -1352,7 +1366,7 @@ __NOTOC__ [http://www.petesqbsite.com/forum/ Pete's QBasic Forum] -[http://www.petesqbsite.com/downloads/downloads.shtml Pete's QBasic Downloads]</center> +[http://www.petesqbsite.com/downloads/downloads.shtml Pete's QBasic Downloads]</center> -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> \ No newline at end of file +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> diff --git a/internal/help/Keyword_Reference_-_By_usage.txt b/internal/help/Keyword_Reference_-_By_usage.txt index 9489a6711..cfdf8dda3 100644 --- a/internal/help/Keyword_Reference_-_By_usage.txt +++ b/internal/help/Keyword_Reference_-_By_usage.txt @@ -1,48 +1,40 @@ -{| align="Right" +{| align="Right" | __TOC__ |} -::::[[QB64 FAQ|Go to Frequently Asked Questions about QB64]] +[[QB64 FAQ|Go to Frequently Asked Questions about QB64]] -:::::[[Keyword Reference - Alphabetical|Go to Alphabetical keywords]] +[[Keyword Reference - Alphabetical|Go to Alphabetical keywords]] -::::::'''[[Known QB64 Issues]]''' +'''[[Known QB64 Issues]]''' -::::[[Keywords currently not supported by QB64]] +[[Keywords currently not supported by QB64]] -:::[[Keywords currently not supported by QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Keywords Not Supported in Linux or MAC versions]] +[[Keywords currently not supported by QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Keywords Not Supported in Linux or MAC versions]] -::: '''The underscore prefix is reserved for QB64 _KEYWORDS only. ''' -:: Listed _KEYWORDS and un-commented $[[Metacommand]]s only work when compiled in QB64. +'''The underscore prefix is reserved for QB64 _KEYWORDS only. ''' +Listed _KEYWORDS and un-commented $[[Metacommand]]s only work when compiled in QB64. -:::[https://dl.dropbox.com/u/10291175/QB64OfflineWiki.7z Download the QB64 WIKI for Offline Reference (7 Zip 5MB)]. - -:::: Offline WIKI Reference contributed by OlDosLover +'''If code examples only display partial code, use the browser Refresh button!''' -:'''If code examples only display partial code, use the browser Refresh button!''' +For comments or suggestions about this WIKI goto the Forum: -::For comments or suggestions about this WIKI goto the Forum: +Keywords beginning with an _underscore can only be compiled in QB64. -::::[http://www.qb64.net/forum/index.php?board=14.0 QB64 Community Development Forum]. - - -::Keywords beginning with an _underscore can only be compiled in QB64. - - -::::[[Main Page|Main Page with Appendix and Tutorials]] +[[Main Page|Main Page with Appendix and Tutorials]] == [[Arrays|Array]] and Data Storage: == -<center>'''Arrays in Memory'''</center> +<center>'''Arrays in Memory'''</center> * [[_DEFINE]] (statement) {{text|defines a range of untyped variable names according to their first character as a datatype.}} * [[_PRESERVE]] ([[REDIM]] option) {{text|preserves the existing element values when an array is resized.}} @@ -60,10 +52,10 @@ * [[SWAP]] (statement) {{text|trades the values of two numerical or string values or array elements.}} * [[UBOUND]] (array function) {{text|returns the highest valid index (upper boundary) of an [[arrays|array]].}} -<center>See also: [[Arrays]]</center> +<center>See also: [[Arrays]]</center> -<center>'''Fixed Program DATA'''</center> +<center>'''Fixed Program DATA'''</center> * [[DATA]] (statement) {{text|creates a field of built-in program data values separated by commas.}} * [[READ]] (statement) {{text|reads the DATA from the data field sequentially.}} * [[RESTORE]] (statement) {{text|sets the data pointer to the start of all DATA or a specified DATA field.}} @@ -72,7 +64,7 @@ * '''WARNING! Do not place DATA fields after [[SUB]] or [[FUNCTION]] procedures! QB64 will FAIL to compile properly!''' {{text| Qbasic allowed programmers to add DATA fields anywhere because the [[IDE]] separated the main code from other procedures.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> == [[COLOR|Colors]] and Transparency: == @@ -116,7 +108,7 @@ * [[PSET]] (statement) {{text|sets a pixel coordinate a specified color or uses the current color when not designated.}} * [[SCREEN]] {{text|sets the screen mode of a program which may determine the number of colors available in legacy modes.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ==[[Console Window]]== * [[$CONSOLE]] (QB64 [[Metacommand]]) {{text|creates a console window throughout the program.}} @@ -132,10 +124,10 @@ * [[_SHELLHIDE]] (function) {{text|hides a [[DOS]] command or call to another program. Returns codes sent by [[END]] or [[SYSTEM]].}} -<center>See also: [[Console Window]] and [[C_Libraries#Console_Window|C++ Console window Library]].</center> +<center>See also: [[Console Window]] and [[C_Libraries#Console_Window|C++ Console window Library]].</center> -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> == Conditional Operations: == @@ -149,10 +141,10 @@ {{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> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> == Definitions and Variable Types: == @@ -176,7 +168,9 @@ * [[DEFSTR]] (statement) {{text|defines undefined variable starting letters AS [[STRING]] variables instead of the [[SINGLE]] type default.}} * [[DIM]] {{text|defines a variable or size a [[$STATIC|static]] array and can define the type of value it returns.}} * [[DOUBLE]] {# numerical [[TYPE|type]]) {{text|an 8 byte floating decimal variable type with numerical values up to 15 decimal places.}} -* [[INTEGER]] {% numerical [[TYPE|type]]) {{text|a two byte variable type with values from -32768 to 32767. [[_UNSIGNED|Unsigned]] to 65535.}} +* [[INTEGER]] {% numerical [[TYPE|type]]) {{text|a two byte variable type +4000 + with values from -32768 to 32767. [[_UNSIGNED|Unsigned]] to 65535.}} * [[LONG]] {& numerical [[TYPE|type]]) {{text|Integer values can be from -2147483648 to 2147483647. [[_UNSIGNED]] values to 4294967295.}} * [[OPTION BASE]] (statement) {{text|sets the default starting index of an [[arrays|array]] to 0 or 1.}} * [[REDIM]] {{text|defines and sizes a [[$DYNAMIC|dynamic]](changeable) array and can define the type of value returned.}} @@ -187,9 +181,9 @@ * [[TYPE]] (statement) {{text|defines variable types that can hold more than one variable type value of a fixed byte length.}} -<center>See also: [[Variable Types|QB64 Variable Types]] and [[Libraries#C.2B.2B_Variable_Types|C++ Variable Types]]</center> +<center>See also: [[Variable Types|QB64 Variable Types]] and [[Libraries#C.2B.2B_Variable_Types|C++ Variable Types]]</center> -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> == [[DOS]] and OS Environment: == * [[_DEVICE$]] (function) {{text|returns a [[STRING]] expression listing device names and input types of system input devices.}} @@ -222,17 +216,17 @@ * [[SHELL (function)|SHELL (QB64 function)]] {{text|executes a [[DOS]] command or calls another program. Returns codes sent by [[END]] or [[SYSTEM]].}} -<center>''See also:'' [[Keyword_Reference_-_By_usage#Console_Window|Console Window]] to display [[DOS]] commands.</center> +<center>''See also:'' [[Keyword_Reference_-_By_usage#Console_Window|Console Window]] to display [[DOS]] commands.</center> -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> == Error Codes == The following table describes the error codes that are reported by the '''QB64''' compiler, as well as possible causes and solutions: -{| border="1" cellpadding="2" +{| border="1" cellpadding="2" |- -! colspan="6"|QB/64 Error Codes +! colspan="6"|QB/64 Error Codes |- ! Code || Description || Common cause/Resolution || QB64 Differences |- @@ -347,11 +341,11 @@ The following table describes the error codes that are reported by the '''QB64'' | 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> +<center>'''N/A means Not Available or Not Applicable to QB64.'''</center> -{| border="1" cellpadding="2" -! colspan="6"|QB64 Error Codes +{| border="1" cellpadding="2" +! colspan="6"|QB64 Error Codes |- ! Code || Description || Common cause/resolution || QB Differences |- @@ -359,7 +353,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> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> == Error Trapping: == @@ -380,10 +374,10 @@ The following table describes the error codes that are reported by the '''QB64'' * [[RESUME]] (statement) {{text|error statement sends the program to the [[NEXT]] code line or a designated line number or label .}} -<center>See the [[ERROR Codes|Error Code Table]] reference.</center> +<center>See the [[ERROR Codes|Error Code Table]] reference.</center> -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ==Event Trapping:== @@ -413,7 +407,7 @@ The following table describes the error codes that are reported by the '''QB64'' * [[TIMER (statement)]] {{text|enables, turns off or stops timer event trapping. In QB64 TIMER(n) FREE can free multiple timers. }} * [[WAIT]] (statement) {{text|normally used to delay program display execution during or after vertical retrace periods.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> == File Input and Output: == @@ -430,7 +424,9 @@ The following table describes the error codes that are reported by the '''QB64'' * [[CLOSE]] (statement) {{text|closes a specified file or all open files.}} * [[EOF]] (file function) {{text|returns -1 when the end of a file has been read.}} * [[FIELD]] (statement) {{text|creates a [[STRING]] type definition for a random-access file buffer.}} -* [[FILEATTR]] (function) {{text|can return a file's current file mode or DOS handle number.}} +* [[FILEATTR]] (function) {{text|can return a file's current file mode o +4000 +r DOS handle number.}} * [[FILES]] (statement) {{text|displays a specified list of files.}} * [[FREEFILE]] (file function) {{text|returns a file access number that is currently not in use.}} * [[GET]] (file I/O statement) {{text|reads file data by byte or record positions.}} @@ -460,7 +456,7 @@ The following table describes the error codes that are reported by the '''QB64'' * [[WIDTH]] (statement) {{text|sets the text width of a file.}} * [[WRITE (file statement)]] {{text|writes numerical and string data to a sequential file using comma separators.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> == Fonts and [[Unicode]]: == @@ -491,9 +487,9 @@ The following table describes the error codes that are reported by the '''QB64'' * [[WRITE]] (screen I/O statement) {{text|writes a comma-separated list of values to the screen.}} -<center> See also: [[Unicode]], [[Code Pages|Unicode Code Pages]] or [[ASCII|ASCII Code Table]]</center> +<center> See also: [[Unicode]], [[Code Pages|Unicode Code Pages]] or [[ASCII|ASCII Code Table]]</center> -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> == Game Controller Input (Joystick): == * [[_AXIS]] (function) {{text|returns a [[SINGLE]] value between -1 and 1 indicating the maximum distance from device axis center 0.}} @@ -522,14 +518,14 @@ The following table describes the error codes that are reported by the '''QB64'' * [[STRIG(n)]] (statement) {{text|enables, suspends or disables event trapping of STRIG button return values.}} -<center> See also: [[Windows_Libraries#Game_Pad|Windows Game Pad]] or [[SDL_Libraries#Joystick|SDL Joystick]] Libraries.</center> +<center> See also: [[Windows_Libraries#Game_Pad|Windows Game Pad]] or [[SDL_Libraries#Joystick|SDL Joystick]] Libraries.</center> -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ==Graphic GL Special Commands== -<center>[http://www.qb64.net/wiki/index.php/Keyword_Reference_-_Alphabetical#glA Full list of QB64 _GL prefixed statements and functions] </center> +<center>[http://www.qb64.net/wiki/index.php/Keyword_Reference_-_Alphabetical#glA Full list of QB64 _GL prefixed statements and functions] </center> * [[_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 QB64GL program.}} @@ -539,7 +535,7 @@ The following table describes the error codes that are reported by the '''QB64'' * [[_PUTIMAGE]] (statement) {{text|can place GL surfaces and allows the _SMOOTH action to blend stretched surfaces.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> == Graphics and Imaging: == @@ -589,9 +585,9 @@ The following table describes the error codes that are reported by the '''QB64'' * [[WINDOW]] (statement) {{text|defines the coordinate dimensions of the current graphics viewport.}} -<center>'''See also: [[Bitmaps]], [[Icons and Cursors]], [[SAVEIMAGE]], [[GIF Images]]'''</center> +<center>'''See also: [[Bitmaps]], [[Icons and Cursors]], [[SAVEIMAGE]], [[GIF Images]]'''</center> -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> == Keyboard Input: == * [[_CONTROLCHR]] (statement) {{text|[[OFF]] allows the control characters to be used as text characters. [[ON]](default) can use them as commands.}} @@ -606,7 +602,7 @@ The following table describes the error codes that are reported by the '''QB64'' * [[INPUT]] (statement) {{text|requests a [[STRING]] or numerical keyboard entry from a program user.}} * [[INPUT$]] (function) {{text|used to get a set number of keypress characters or bytes from a file.}} * [[INP]] (function) {{text|returns a scan code value from keyboard register &H60(96) to determine key presses.}} -* [[KEY n]] (event statement) {{text|is used to assign a "softkey" string to a key and/or display them.}} +* [[KEY n]] (event statement) {{text|is used to assign a "softkey" string to a key and/or display them.}} * [[KEY(n)]] (event statement) {{text|assigns, enables, disables or suspends event trapping of a keypress.}} * [[KEY LIST]] (statement) {{text|lists the 12 Function key soft key string assignments going down left side of screen.}} * [[LINE INPUT]] (statement) {{text|requests a [[STRING]] keyboard entry from a program user.}} @@ -617,10 +613,10 @@ The following table describes the error codes that are reported by the '''QB64'' * [[SLEEP]] (statement) {{text|pauses the program for a specified number of seconds or a until a key press.}} -<center>See also: [[Keyboard scancodes]], [[ASCII|ASCII Codes]] references or [[Windows_Libraries#Hot_Keys_.28maximize.29|Hot Keys for Windows]].</center> +<center>See also: [[Keyboard scancodes]], [[ASCII|ASCII Codes]] references or [[Windows_Libraries#Hot_Keys_.28maximize.29|Hot Keys for Windows]].</center> -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ==[[Libraries]]:== @@ -635,13 +631,15 @@ The following table describes the error codes that are reported by the '''QB64'' * [[DECLARE LIBRARY| END DECLARE]] (QB64 Only) {{text|required at the END of the block of Library declarations in QB64.}} -<center>'''QB64 also supports [[$INCLUDE]] text code file Libraries. QB64 does not support QLB Libraries or OBJ files.'''</center> +<center>'''QB64 also supports [[$INCLUDE]] text code file Libr +4000 +aries. QB64 does not support QLB Libraries or OBJ files.'''</center> -<center>See also: [[Libraries#C++_Variable_Types|C++ Variable Types]]</center> +<center>See also: [[Libraries#C++_Variable_Types|C++ Variable Types]]</center> -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> == Logical Bitwise Operations: == @@ -656,7 +654,7 @@ The following table describes the error codes that are reported by the '''QB64'' {{Template:LogicalTruthTable}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> == Mathematical Functions and Operations: == @@ -688,9 +686,9 @@ The following table describes the error codes that are reported by the '''QB64'' * [[TAN]] (function) {{text|returns the ratio of [[SIN]]e to [[COS]]ine or tangent value of an angle measured in radians.}} -<center>See also: [[Mathematical Operations]] and [[#Logical Bitwise Operations:|Logical Operations:]] </center> +<center>See also: [[Mathematical Operations]] and [[#Logical Bitwise Operations:|Logical Operations:]] </center> -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> == Memory Handling and Clipboard: == @@ -712,24 +710,24 @@ The following table describes the error codes that are reported by the '''QB64'' * [[_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> +<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!}} +* [[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.}} -<center>See also: [[Screen Memory]] or [[Using _OFFSET]]</center> +<center>See also: [[Screen Memory]] or [[Using _OFFSET]]</center> -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> == Metacommands == :Metacommands are commands that affect a program globally after they are in used. Error checking can be turned [[OFF]] or [[ON]]. -<center>'''QB64 [[Metacommand]]s do NOT allow commenting or [[REM]]!'''</center> +<center>'''QB64 [[Metacommand]]s do NOT allow commenting or [[REM]]!'''</center> * [[$CHECKING]]:OFF/ON {{text|(QB64 only) turns event and error checking ON and OFF. ON (default) can only be used after it is OFF.}} * [[$CONSOLE]] {{text|creates a console window throughout the program.}} @@ -737,13 +735,13 @@ The following table describes the error codes that are reported by the '''QB64'' * [[$SCREENSHOW]] {{text|displays the main program window throughout the program only after [[$SCREENHIDE]] or [[_SCREENHIDE]] has been used.}} -<center>'''Qbasic [[Metacommand]]s do not require commenting or [[REM]] in QB64!'''</center> +<center>'''Qbasic [[Metacommand]]s do not require commenting or [[REM]] in QB64!'''</center> * '[[$DYNAMIC]] {{text|defines that all arrays are dynamic or changeable in size using [[DIM]] or [[REDIM]].}} * '[[$INCLUDE]]: 'filename$' {{text|includes a text library file with procedures to be used in a program. Comment both sides of file name also.}} * '[[$STATIC]] {{text|defines that all arrays are static or unchangeable in size using [[DIM]].}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> == Mouse Input: == * [[_AXIS]] (function) {{text|returns a [[SINGLE]] value between -1 and 1 indicating the maximum distances from device center 0.}} @@ -773,9 +771,9 @@ The following table describes the error codes that are reported by the '''QB64'' * [[CALL ABSOLUTE|CALL ABSOLUTE]] (statement) {{text|used to access Interrupt vector &H33 to work with the mouse. Functions 0 to 3 implemented.}} * [[INTERRUPT]] (statement) {{text|used to access Interrupt vector &H33 to work with the mouse. Functions 0 to 3 implemented. }} -<center>See also: [http://qb64.net/wiki/index.php?title=SDL_Libraries#Mouse SDL Mouse Library]</center> +<center>See also: [http://qb64.net/wiki/index.php?title=SDL_Libraries#Mouse SDL Mouse Library]</center> -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> == Numerical Manipulation and Conversion: == @@ -816,11 +814,11 @@ The following table describes the error codes that are reported by the '''QB64'' * [[VAL]] (function) {{text|converts number [[STRING|strings]] into numerical values until it runs into a non-numeric character.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> == Port Input and Output (COM and LPT): == -* [[COM(n)]] (statement) {{text|used in an OPEN COM statement to open "COM1" or "COM2".}} +* [[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.}} @@ -840,10 +838,10 @@ The following table describes the error codes that are reported by the '''QB64'' * [[PUT]] (file I/O statement) {{text|writes data into a [[RANDOM]] or [[BINARY]] port by byte or record position.}} -<center>'''See [[Port Access Libraries]] for other ways to access COM and LPT ports.'''.</center> +<center>'''See [[Port Access Libraries]] for other ways to access COM and LPT ports.'''.</center> -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ==Print formatting== @@ -855,7 +853,7 @@ The following table describes the error codes that are reported by the '''QB64'' {{PrintUsing}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ==Printer Output (LPT and USB):== @@ -867,13 +865,15 @@ The following table describes the error codes that are reported by the '''QB64'' * [[LPRINT USING]] (statement) {{text|prints template formatted [[STRING]] text to an LPT or USB printer page.}} -<center>'''QB64 will use the default system printer selected. [[_PRINTIMAGE]] images will be stretched to the paper size setting.'''</center> +<center>'''QB64 will use the default system printer selected. [[_PRINTIMAGE]] images will be stretched to the paper size setting.'''</center> -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> == Program Flow and Loops: == -* [[_CONTINUE]] (statement) {{text|skips the remaining lines in a control block (DO/LOOP, FOR/NEXT or WHILE/WEND)}} +* [[_CONTINUE]] (statement) {{text|skips the remaining lines in a control block (DO/LOOP, FOR/NE +4000 +XT 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.}} * [[_EXIT (function)]] {{text|prevents a user exit and indicates if a user has clicked the close X window button or CTRL + BREAK.}} @@ -890,7 +890,7 @@ The following table describes the error codes that are reported by the '''QB64'' * [[DO...LOOP]] (loop statement) {{text|used in programs to repeat code or return to the start of a procedure.}} * [[ELSE]] (statement) {{text|used in [[IF...THEN]] statements to offer an alternative to other conditional statements.}} * [[ELSEIF]] (statement) {{text|used in [[IF...THEN]] block statements to offer an alternative conditional statement.}} -* [[END]] (statement) {{text|ENDs a conditional block statement, a sub-procedure or ends the program with "Press any key..."}} +* [[END]] (statement) {{text|ENDs a conditional block statement, a sub-procedure or ends the program with "Press any key..."}} * [[END IF]] (IF statement end) {{text|ENDs an IF statement block.}} * [[ERROR]] (error statement) {{text|used to simulate an error in a program.}} * [[EXIT]] (statement) {{text|exits a loop, function or sub-procedure early.}} @@ -912,7 +912,7 @@ The following table describes the error codes that are reported by the '''QB64'' * [[WHILE]] (statement) {{text|continues a DO LOOP procedure while a condition is true.}} * [[WHILE...WEND]] (statement) {{text|a loop procedure that repeats code while a condition is true.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> == Sounds and Music using Sound Card: == @@ -946,7 +946,7 @@ The following table describes the error codes that are reported by the '''QB64'' * [[PLAY]] (music statement) {{text|uses a custom string statement to play musical notes.}} * [[SOUND]] (statement) {{text|creates sounds of a specified frequency for a set duration.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> == String Text Manipulation and Conversion: == @@ -986,11 +986,11 @@ The following table describes the error codes that are reported by the '''QB64'' * [[VAL]] (function) {{text|converts a string number value to a numerical value.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> == Sub procedures and Functions== -<center>'''Qbasic and QB64'''</center> +<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.}} * [[CALLS]] (statement) {{text|transfers control to a procedure written in a different programming language. NOT IMPLEMENTED!}} @@ -1010,11 +1010,11 @@ The following table describes the error codes that are reported by the '''QB64'' * [[STATIC]] (statement) {{text|defines a variable or list of variables that will retain their values after the sub-procedure is exited.}} * [[SUB]] (statement) {{text|procedures are programs within programs that can return multiple calculations.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> == TCP/IP Networking and Email: == -<center>'''All Statements and Functions Compile in QB64 Only!'''</center> +<center>'''All Statements and Functions Compile in QB64 Only!'''</center> * [[_CONNECTED]] (function) {{text|returns the connection status of a TCP/IP connection handle.}} @@ -1039,10 +1039,10 @@ The following table describes the error codes that are reported by the '''QB64'' * [[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: [[TCP/IP Message Format]], [[IP Configuration]], [[Downloading Files]] and [[WGET]]</center> -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> == Text on Screen: == * [[_CONTROLCHR]] {{text|[[OFF]] allows [[ASCII]] characters 0 to 31 to be used as text characters. [[ON]](default) resets to default usage.}} @@ -1067,7 +1067,9 @@ The following table describes the error codes that are reported by the '''QB64'' * [[SCREEN]] (statement) {{text|sets the screen mode of a program. No statement defaults the program to SCREEN 0 text mode.}} * [[SCREEN (function)]] {{text|returns the [[ASCII]] code of a text character or the color attribute at a set text location on the screen.}} * [[SPACE$]] (function) {{text|returns a [[STRING|string]] consisting of a number of space characters.}} -* [[SPC]] (function) {{text|used in [[PRINT]] and [[LPRINT]] statements to print or output a number of space characters.}} +* [[SPC]] ( +4000 +function) {{text|used in [[PRINT]] and [[LPRINT]] statements to print or output a number of space characters.}} * [[STR$]] (function) {{text|returns the [[STRING]] representation of a numerical value.}} * [[STRING$]](function) {{text| returns a [[STRING]] consisting of a single character repeated a set number of times.}} * [[TAB]] (function) {{text|used in [[PRINT]] and [[LPRINT]] statements to move to a specified text column position.}} @@ -1076,9 +1078,9 @@ The following table describes the error codes that are reported by the '''QB64'' * [[WRITE]] (screen I/O statement) {{text|writes a comma-separated list of values to the screen.}} -<center> See also: [[#Fonts and Unicode:|Fonts and Unicode]] or [[ASCII|ASCII Code Table]]</center> +<center> See also: [[#Fonts and Unicode:|Fonts and Unicode]] or [[ASCII|ASCII Code Table]]</center> -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> == Time, Date and Timing: == @@ -1109,11 +1111,11 @@ The following table describes the error codes that are reported by the '''QB64'' * [[WAIT]] (statement) {{text|normally used to delay program display execution during or after vertical retrace periods.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> == Window and Desktop: == -<center>'''All Statements and Functions except [[SCREEN]] Compile in QB64 Only!'''</center> +<center>'''All Statements and Functions except [[SCREEN]] Compile in QB64 Only!'''</center> * [[_FULLSCREEN (function)]] {{text|returns the present full screen mode setting number of the screen window.}} * [[_FULLSCREEN]] (statement) {{text|sets the full screen mode of the screen window. Alt + Enter can do it manually.}} @@ -1142,21 +1144,21 @@ The following table describes the error codes that are reported by the '''QB64'' * [[SCREEN]] {{text|sets the screen mode of a program. No statement defaults the program to SCREEN 0 text mode.}} -<center>''See also:'' [[C_Libraries#Console_Window|Console Window]], [[SDL_Libraries#Window|SDL Frameless Window Library]], [[Windows_Libraries#Hot_Keys_.28maximize.29|Windows Hot Keys]] or [[Windows_Libraries#Focus|Focus on Program]].</center> +<center>''See also:'' [[C_Libraries#Console_Window|Console Window]], [[SDL_Libraries#Window|SDL Frameless Window Library]], [[Windows_Libraries#Hot_Keys_.28maximize.29|Windows Hot Keys]] or [[Windows_Libraries#Focus|Focus on Program]].</center> -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ==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> +<center>''[Note: All symbols below can also be used inside of literal quoted strings except for quotation marks.]''</center> :'''Print, Input or File Formatting''' * [[Semicolon|; Semicolon]] after a [[PRINT]] stops the invisible cursor at end of the printed value. Can prevent screen rolling! * [[Comma|, Comma]] after a [[PRINT]] tabs the invisible cursor past the end of the printed value. -* [[Quotation mark|" Quotation mark]] delimits the ends of a literal [[STRING]] value in a [[PRINT]], [[INPUT]] or [[LINE INPUT]] statement. +* [[Quotation mark|" Quotation mark]] delimits the ends of a literal [[STRING]] value in a [[PRINT]], [[INPUT]] or [[LINE INPUT]] statement. * [[Question mark|? Question mark]] is a shortcut substitute for the [[PRINT]] keyword. Will change to PRINT when cursor leaves the code line. @@ -1167,11 +1169,11 @@ The following table describes the error codes that are reported by the '''QB64'' * [[Dollar_Sign|$ Dollar sign]] prefix denotes a Qbasic [[Metacommand]]. Only '''QB64''''s event [[$CHECKING]] should NOT be commented. * [[Parenthesis|( ) Parenthesis]] enclose a math or conditional procedure order, [[SUB]] or [[FUNCTION]] parameters or to pass by value. * [[+|+ Plus]] [[concatenation]] operator MUST be used to combine literal string values in a variable definition. -* [[Quotation mark|" Quotation mark]] delimits the ends of a literal [[STRING]] value. Use [[CHR$]](34) to insert quotes in a text [[STRING]]. +* [[Quotation mark|" Quotation mark]] delimits the ends of a literal [[STRING]] value. Use [[CHR$]](34) to insert quotes in a text [[STRING]]. * [[REM]] or apostrophe are used to make comments or ignore code or precedes a [[Metacommand]]. * [[Underscore|_ Underscore]] at the end of a code line is used to continue a line of code to the next program line in '''QB64 only'''. -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> :'''Variable Name Type Suffixes''' * [[STRING|$ STRING]] text character type: 1 byte @@ -1186,7 +1188,7 @@ The following table describes the error codes that are reported by the '''QB64'' * [[_BYTE|%% _BYTE]] '''QB64''' [[INTEGER|whole]] numerical type (1 byte) * [[_OFFSET|%& _OFFSET]] '''QB64''' [[INTEGER|whole]] numerical pointer address type (any byte size required) -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> :'''Numerical Base Prefixes''' * [[&B|&B Binary]] base 2 Digits 0 or 1 ['''QB64'''] * [[&O|&O Octal]] base 8 Digits 0 to 7 @@ -1205,17 +1207,17 @@ The following table describes the error codes that are reported by the '''QB64'' :'''[[Relational Operations]]''' * [[Equal|=]] (Equal to condition) -* [[Greater_Than|>]] (Greater than condition) +* [[Greater_Than|>]] (Greater than condition) * [[Less_Than|<]] (Less than condition) -* [[Not_Equal|<>]] (Not equal to condition) -* [[Greater_Than_Or_Equal|>=]] (Greater than or equal to condition) +* [[Not_Equal|<>]] (Not equal to condition) +* [[Greater_Than_Or_Equal|>=]] (Greater than or equal to condition) * [[Less_Than_Or_Equal|<=]] (Less than or equal to condition) -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ==QB64 Programming References:== -<center>'''WIKI Pages''' +<center>'''WIKI Pages''' [[Keyword Reference - Alphabetical#QB64 specific keywords:|Go to QB64 specific keywords]] @@ -1245,7 +1247,7 @@ The following table describes the error codes that are reported by the '''QB64'' [http://www.petesqbsite.com/forum/ Pete's Qbasic Forum] -[http://www.petesqbsite.com/downloads/downloads.shtml Pete's Qbasic Downloads]</center> +[http://www.petesqbsite.com/downloads/downloads.shtml Pete's Qbasic Downloads]</center> -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> \ No newline at end of file +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> diff --git a/internal/help/LBOUND.txt b/internal/help/LBOUND.txt index 552643453..4a6a8e388 100644 --- a/internal/help/LBOUND.txt +++ b/internal/help/LBOUND.txt @@ -7,9 +7,9 @@ The [[LBOUND]] function returns the smallest valid index (lower bound) of an arr {{PageDescription}} * {{Parameter|arrayName}} specifies the name of the array. -* {{Parameter|dimension%}} specifies the dimension number, starting with <code>1</code> for the first dimension. -** If omitted, {{Parameter|dimension%}} is assumed to be <code>1</code>. -** If {{Parameter|dimension%}} is less than <code>1</code> or is greater than the number of dimensions, a [[ERROR Codes|subscript out of range]] error occurs. +* {{Parameter|dimension%}} specifies the dimension number, starting with <code>1</code> for the first dimension. +** If omitted, {{Parameter|dimension%}} is assumed to be <code>1</code>. +** If {{Parameter|dimension%}} is less than <code>1</code> or is greater than the number of dimensions, a [[ERROR Codes|subscript out of range]] error occurs. * [[LBOUND]] and [[UBOUND]] are used to determine the range of valid indexes of an array. @@ -30,4 +30,4 @@ The [[LBOUND]] function returns the smallest valid index (lower bound) of an arr * [[DIM]], [[COMMON]], [[STATIC]], [[SHARED]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/LCASE$.txt b/internal/help/LCASE$.txt index bde05a74a..a3cb07570 100644 --- a/internal/help/LCASE$.txt +++ b/internal/help/LCASE$.txt @@ -12,11 +12,11 @@ The [[LCASE$]] function outputs an all-lowercase version of a [[STRING]]. {{PageExamples}} ''Example:'' The following code guarantees that all user letter entries will be lower case: -{{CodeStart}}{{Cl|PRINT}} "Do you want to continue? (y/n)" +{{CodeStart}}{{Cl|PRINT}} "Do you want to continue? (y/n)" {{Cl|DO...LOOP|DO}} K$ = {{Cl|LCASE$}}({{Cl|INKEY$}}) -{{Cl|DO...LOOP|LOOP}} {{Cl|DO...LOOP|UNTIL}} K$ = "y" {{Cl|OR}} K$ = "n" +{{Cl|DO...LOOP|LOOP}} {{Cl|DO...LOOP|UNTIL}} K$ = "y" {{Cl|OR}} K$ = "n" {{CodeEnd}} @@ -26,4 +26,4 @@ The [[LCASE$]] function outputs an all-lowercase version of a [[STRING]]. * [[INPUT$]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/LEFT$.txt b/internal/help/LEFT$.txt index 458d12ebc..cdd1aa920 100644 --- a/internal/help/LEFT$.txt +++ b/internal/help/LEFT$.txt @@ -19,7 +19,7 @@ The [[LEFT$]] string function returns a number of characters from the left of a {{PageExamples}} ''Example 1:'' Getting the left portion of a string value. {{CodeStart}} '' '' -name$ = "Tom Williams" +name$ = "Tom Williams" First$ = LEFT$(name$, 3) @@ -30,10 +30,10 @@ PRINT First$ '' '' ''Example 2:'' A replace function using LEFT$ and [[RIGHT$]] with [[INSTR]] to insert a different length word into an existing string. {{CodeStart}} '' '' -text$ = "This is my sentence to change my words." +text$ = "This is my sentence to change my words." {{Cl|PRINT}} text$ -oldword$ = "my" -newword$ = "your" +oldword$ = "my" +newword$ = "your" x = Replace(text$, oldword$, newword$) {{Cl|IF...THEN|IF}} x {{Cl|THEN}} {{Cl|PRINT}} text$; x @@ -66,4 +66,4 @@ This is your sentence to change your words.{{OutputEnd}} * [[INSTR]], [[LEN]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/LEN.txt b/internal/help/LEN.txt index 846e7fc7d..75179acd9 100644 --- a/internal/help/LEN.txt +++ b/internal/help/LEN.txt @@ -15,9 +15,9 @@ 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}}''' +:::: {{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. :* [[BINARY]] OPEN statements will ignore LEN = statements. The byte size of a [[GET|read]] or [[PUT|write]] is determined by the [[Variable Types|variable type]]. @@ -25,8 +25,8 @@ The [[LEN]] function returns the number of bytes used by a variable value and th {{PageExamples}} ''Example 1:'' With a string variable the byte size is the same as the number of characters. {{CodeStart}} -LastName$ = "Williams" -PRINT {{Cl|LEN}}(LastName$); "bytes" '' '' +LastName$ = "Williams" +PRINT {{Cl|LEN}}(LastName$); "bytes" '' '' {{CodeEnd}} {{OutputStart}} 8 bytes {{OutputEnd}} @@ -34,7 +34,7 @@ PRINT {{Cl|LEN}}(LastName$); "bytes" '' '' ''Example 2:'' Testing [[INPUT]] for numerical [[STRING]] entries from a user. {{CodeStart}} '' '' -{{Cl|INPUT}} "number: ", num$ +{{Cl|INPUT}} "number: ", num$ value$ = {{Cl|LTRIM$}}({{Cl|STR$}}({{Cl|VAL}}(num$))) L = {{Cl|LEN}}(value$) @@ -47,17 +47,17 @@ L = {{Cl|LEN}}(value$) ''Example 3:'' With numerical value types you MUST use a variable to find the inherent byte length when using LEN. {{CodeStart}} '' '' DIM I AS INTEGER -PRINT "INTEGER ="; LEN(I); "bytes" +PRINT "INTEGER ="; LEN(I); "bytes" DIM L AS LONG -PRINT "LONG ="; LEN(L); "bytes" +PRINT "LONG ="; LEN(L); "bytes" DIM I64 AS _INTEGER64 -PRINT "_INTEGER64 ="; LEN(I64); "bytes" +PRINT "_INTEGER64 ="; LEN(I64); "bytes" DIM S AS SINGLE -PRINT "SINGLE ="; LEN(S); "bytes" +PRINT "SINGLE ="; LEN(S); "bytes" DIM D AS DOUBLE -PRINT "DOUBLE ="; LEN(D); "bytes" +PRINT "DOUBLE ="; LEN(D); "bytes" DIM F AS _FLOAT -PRINT "_FLOAT ="; LEN(F); "bytes" '' '' +PRINT "_FLOAT ="; LEN(F); "bytes" '' '' {{CodeEnd}} {{OutputStart}}INTEGER = 2 bytes LONG = 4 bytes @@ -78,12 +78,12 @@ _FLOAT = 32 bytes {{Cl|DIM}} record {{Cl|AS}} variabletype {{Cl|DIM}} newrec {{Cl|AS}} variabletype -file$ = "testrand.inf" '<<<< filename may overwrite existing file +file$ = "testrand.inf" '<<<< filename may overwrite existing file number% = 1 '<<<<<<<<<< record number to write cannot be zero RecordLEN% = {{Cl|LEN}}(record) -{{Cl|PRINT}} RecordLEN%; "bytes" +{{Cl|PRINT}} RecordLEN%; "bytes" record.x = 255 -record.y = "Hello world!" +record.y = "Hello world!" record.z = 65535 {{Cl|PRINT}} record.x, record.y, record.z @@ -93,7 +93,7 @@ record.z = 65535 {{Cl|OPEN}} file$ {{Cl|FOR...NEXT|FOR}} {{Cl|RANDOM}} {{Cl|AS}} #2 {{Cl|LEN}} = RecordLEN% NumRecords% = {{Cl|LOF}}(2) \ RecordLEN% -PRINT NumRecords%; "records" +PRINT NumRecords%; "records" {{Cl|GET}} #2, NumRecords% , newrec 'GET last record available {{Cl|CLOSE}} #2 @@ -117,4 +117,4 @@ PRINT NumRecords%; "records" * [[Variable Types]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/LET.txt b/internal/help/LET.txt index e32bc1f71..d59b8cc5b 100644 --- a/internal/help/LET.txt +++ b/internal/help/LET.txt @@ -17,4 +17,4 @@ The [[LET]] is a useless statement designed by [[cavemen]] when they started pro * [[Variable]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/LINE.txt b/internal/help/LINE.txt index 7b42db045..3036b6961 100644 --- a/internal/help/LINE.txt +++ b/internal/help/LINE.txt @@ -55,12 +55,12 @@ The [[LINE]] statement is used in graphic [[SCREEN (statement)|SCREEN]] modes to {{Cl|COLOR}} 15:{{Cl|LOCATE}} 10, 5: {{Cl|PRINT}} i%; {{Cl|LINE}} (10, 60)-(300, 60), 0 'erase previous lines {{Cl|LINE}} (10, 60)-(300, 60), 12, , i% - tmp$ = "" + tmp$ = "" {{Cl|FOR...NEXT|FOR}} b% = 15 {{Cl|TO}} 0 {{Cl|STEP}} -1 'create binary text value showing bits on as {{text|█|red}}, off as space {{Cl|IF...THEN|IF}} i% {{Cl|AND}} 2 ^ b% {{Cl|THEN}} tmp$ = tmp$ + {{Cl|CHR$}}(219) {{Cl|ELSE}} tmp$ = tmp$ + {{Cl|SPACE$}}(1) {{Cl|NEXT}} {{Cl|COLOR}} 12:{{Cl|LOCATE}} 10, 20: {{Cl|PRINT}} tmp$; - {{Cl|IF...THEN|IF}} {{Cl|INKEY$}} <> "" {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR...NEXT|FOR}} 'any key exit + {{Cl|IF...THEN|IF}} {{Cl|INKEY$}} <> "" {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR...NEXT|FOR}} 'any key exit {{Cl|_DELAY}} .001 'set delay time as required {{Cl|NEXT}} '' '' {{CodeEnd}} @@ -85,4 +85,4 @@ The [[LINE]] statement is used in graphic [[SCREEN (statement)|SCREEN]] modes to * [[AND]], [[OR]] {{text|(logical operators)}} -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/LINE_INPUT.txt b/internal/help/LINE_INPUT.txt index 90108ca99..c7e8a4aff 100644 --- a/internal/help/LINE_INPUT.txt +++ b/internal/help/LINE_INPUT.txt @@ -2,7 +2,7 @@ The [[LINE INPUT]] statement requests a [[STRING]] keyboard entry from a program {{PageSyntax}} -: [[LINE INPUT]] [;] "[text prompt or question]"{,|;} {{Parameter|stringVariable$}} +: [[LINE INPUT]] [;] "[text prompt or question]"{,|;} {{Parameter|stringVariable$}} : [[LINE INPUT]] ; {{Parameter|stringVariable$}} @@ -28,12 +28,12 @@ The [[LINE INPUT]] statement requests a [[STRING]] keyboard entry from a program {{Cl|SCREEN}} 12 {{Cl|COLOR}} 14: {{Cl|LOCATE}} 29, 2 ' place dursor at beginning of prompt liine -{{Cl|PRINT}} "Enter a name to search for... "; 'print prompt on screen -{{Cl|COLOR}} 15: {{Cl|LINE INPUT}} {{text|;|red}} "", name$ ' get search name from user +{{Cl|PRINT}} "Enter a name to search for... "; 'print prompt on screen +{{Cl|COLOR}} 15: {{Cl|LINE INPUT}} {{text|;|red}} "", name$ ' get search name from user {{Cl|LOCATE}} 29, 2: {{Cl|PRINT}} {{Cl|SPC}}(78); ' erase previous prompt n$ = {{Cl|UCASE$}}(name$) ' convert search name to upper case {{Cl|COLOR}} 14' change foreground color to yellow -{{Cl|LOCATE}} 29, 2: {{Cl|PRINT}} "Searching..."; 'print message +{{Cl|LOCATE}} 29, 2: {{Cl|PRINT}} "Searching..."; 'print message {{Cl|SLEEP}} {{CodeEnd}} {{OutputStart}}{{text|Enter a name to search for...|#FFFF00}} █ @@ -49,4 +49,4 @@ n$ = {{Cl|UCASE$}}(name$) ' convert search name to upper case * [[_KEYHIT]], [[_KEYDOWN]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/LINE_INPUT_(file_statement).txt b/internal/help/LINE_INPUT_(file_statement).txt index 24fe10717..c77568505 100644 --- a/internal/help/LINE_INPUT_(file_statement).txt +++ b/internal/help/LINE_INPUT_(file_statement).txt @@ -21,7 +21,7 @@ The '''LINE INPUT #''' file statement reads an entire line from a text file into {{PageErrors}} -* '''If an "Input past End of file" error occurs, check for CHR$(26) (end of file character) in the files being read.''' +* '''If an "Input past End of file" error occurs, check for CHR$(26) (end of file character) in the files being read.''' * '''Warning: files must exist to be opened in '''INPUT''' mode. Use [[_FILEEXISTS]] to avoid program [[ERROR Codes|errors]].''' @@ -29,9 +29,9 @@ The '''LINE INPUT #''' file statement reads an entire line from a text file into ''Example:'' Finding the number of filenames listed in a file to dimension an array to hold them. {{CodeStart}} '' '' {{Cl|REDIM}} FileArray$(100) 'create {{Cl|$DYNAMIC|dynamic}} array -{{Cl|SHELL}} {{Cl|_HIDE}} "DIR /B *.* > D0S-DATA.INF" -{{Cl|IF...THEN|IF}} {{Cl|_FILEEXISTS}}("D0S-DATA.INF") THEN - {{Cl|OPEN}} "D0S-DATA.INF" FOR {{Cl|INPUT (file mode)|INPUT}} AS #1 +{{Cl|SHELL}} {{Cl|_HIDE}} "DIR /B *.* > D0S-DATA.INF" +{{Cl|IF...THEN|IF}} {{Cl|_FILEEXISTS}}("D0S-DATA.INF") THEN + {{Cl|OPEN}} "D0S-DATA.INF" FOR {{Cl|INPUT (file mode)|INPUT}} AS #1 DO UNTIL {{Cl|EOF}}(1) {{Cl|LINE INPUT}} #1, file$ 'read entire text file line filecount% = filecount% + 1 @@ -51,4 +51,4 @@ The '''LINE INPUT #''' file statement reads an entire line from a text file into * [[FILELIST$]] (member-contributed function replacement for [[FILES]]) -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/LOC.txt b/internal/help/LOC.txt index 08dee0830..3c856dec2 100644 --- a/internal/help/LOC.txt +++ b/internal/help/LOC.txt @@ -14,13 +14,13 @@ The [[LOC]] function returns the status of a serial (COM) port received buffer o {{PageExamples}} ''Example:'' Reading and writing from a COM port opened in Basic. {{CodeStart}} '' '' -{{Cl|OPEN}} "{{Cl|OPEN_COM|COM}}1: 9600,N,8,1,OP0" {{Cl|FOR (file statement)|FOR}} {{Cl|RANDOM}} {{Cl|AS}} #1 {{Cl|LEN}} = 2048 ' random mode = input and output +{{Cl|OPEN}} "{{Cl|OPEN_COM|COM}}1: 9600,N,8,1,OP0" {{Cl|FOR (file statement)|FOR}} {{Cl|RANDOM}} {{Cl|AS}} #1 {{Cl|LEN}} = 2048 ' random mode = input and output {{Cl|DO}}: t$ = {{Cl|INKEY$}} ' get any transmit keypresses from user {{Cl|IF}} {{Cl|LEN}}(t$) {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #1, t$ ' send keyboard byte to transmit buffer bytes% = {{Cl|LOC}}(1) ' bytes in buffer - {{Cl|IF}} bytes% {{Cl|THEN}} ' check receive buffer for data" + {{Cl|IF}} bytes% {{Cl|THEN}} ' check receive buffer for data" r$ = {{Cl|INPUT$}}(bytes%, 1) ' get bytes in the receive buffer - {{Cl|PRINT}} r$; ' print byte strings consecutively to screen" + {{Cl|PRINT}} r$; ' print byte strings consecutively to screen" {{Cl|END IF}} {{Cl|LOOP}} {{Cl|UNTIL}} t$ = {{Cl|CHR$}}(27) 'escape key exit {{Cl|CLOSE}} # '' '' @@ -31,4 +31,4 @@ The [[LOC]] function returns the status of a serial (COM) port received buffer o * [[PRINT]], [[OPEN COM]], [[PRINT (file statement)]] * [[SEEK]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/LOCATE.txt b/internal/help/LOCATE.txt index a6a7251a6..0d67cc0a5 100644 --- a/internal/help/LOCATE.txt +++ b/internal/help/LOCATE.txt @@ -31,16 +31,16 @@ DO {{Cl|LOCATE}} cry, crx, 1, 0, 8 a$ = {{Cl|INKEY$}} {{Cl|SELECT CASE}} a$ - {{Cl|CASE}} {{Cl|CHR$}}(0) + "H": {{Cl|IF...THEN|IF}} cry > 1 {{Cl|THEN}} cry = cry - 1 'up - {{Cl|CASE}} {{Cl|CHR$}}(0) + "P": {{Cl|IF...THEN|IF}} cry < 25 {{Cl|THEN}} cry = cry + 1 'down - {{Cl|CASE}} {{Cl|CHR$}}(0) + "K": {{Cl|IF...THEN|IF}} crx > 1 {{Cl|THEN}} crx = crx - 1 'left - {{Cl|CASE}} {{Cl|CHR$}}(0) + "M": {{Cl|IF...THEN|IF}} crx < 80 {{Cl|THEN}} crx = crx + 1 'right + {{Cl|CASE}} {{Cl|CHR$}}(0) + "H": {{Cl|IF...THEN|IF}} cry > 1 {{Cl|THEN}} cry = cry - 1 'up + {{Cl|CASE}} {{Cl|CHR$}}(0) + "P": {{Cl|IF...THEN|IF}} cry < 25 {{Cl|THEN}} cry = cry + 1 'down + {{Cl|CASE}} {{Cl|CHR$}}(0) + "K": {{Cl|IF...THEN|IF}} crx > 1 {{Cl|THEN}} crx = crx - 1 'left + {{Cl|CASE}} {{Cl|CHR$}}(0) + "M": {{Cl|IF...THEN|IF}} crx < 80 {{Cl|THEN}} crx = crx + 1 'right {{Cl|CASE}} {{Cl|CHR$}}(27): {{Cl|END}} {{Cl|END SELECT}} LOOP '' '' {{CodeEnd}} -: Explanation: The CHR$(0) + "H", "P", "K", "M" represents the cursor arrow keys. start = 0, stop = 8 is the tallest cursor, experiment with the start and stop values for different effects (start = 8, stop = 8 is the default producing a _ cursor). +: Explanation: The CHR$(0) + "H", "P", "K", "M" represents the cursor arrow keys. start = 0, stop = 8 is the tallest cursor, experiment with the start and stop values for different effects (start = 8, stop = 8 is the default producing a _ cursor). @@ -51,4 +51,4 @@ LOOP '' '' * [[WIDTH]], [[INPUT$]], [[INKEY$]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/LOCK.txt b/internal/help/LOCK.txt index 872a7cef5..9e2b005f7 100644 --- a/internal/help/LOCK.txt +++ b/internal/help/LOCK.txt @@ -28,4 +28,4 @@ The [[LOCK]] statement restricts access to parts of a file by other programs or * [[ACCESS]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/LOF.txt b/internal/help/LOF.txt index 9f453f22e..dbf0831e3 100644 --- a/internal/help/LOF.txt +++ b/internal/help/LOF.txt @@ -27,4 +27,4 @@ The [[LOF]] function is used to find the length of an [[OPEN]] file in bytes. * [[LEN]], [[EOF]], [[BINARY]], [[RANDOM]], [[TYPE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/LOG.txt b/internal/help/LOG.txt index 4330ecdbb..64e01cb83 100644 --- a/internal/help/LOG.txt +++ b/internal/help/LOG.txt @@ -6,7 +6,7 @@ The [[LOG]] math function returns the natural logarithm of a specified numerical {{PageDescription}} -* {{Parameter|value}} MUST be greater than 0. [[ERROR Codes|"Illegal function call" error]] occurs if negative or zero values are used. +* {{Parameter|value}} MUST be greater than 0. [[ERROR Codes|"Illegal function call" error]] occurs if negative or zero values are used. * The natural logarithm is the logarithm to the base '''e = 2.718282''' (approximately). * The natural logarithm of ''a'' is defined as the integral from 1 to ''a'' of dx/x. * Returns are default [[SINGLE]] precision unless the value parameter uses [[DOUBLE]] precision. @@ -28,13 +28,13 @@ The [[LOG]] math function returns the natural logarithm of a specified numerical FUNCTION BIN$ (n&) IF n& < 0 THEN EXIT FUNCTION 'positive numbers only! negative error! FOR p% = 0 TO INT({{Cl|LOG}}(n& + .1) / {{Cl|LOG}}(2)) ' added +.1 to get 0 to work - IF n& {{Cl|AND}} 2 ^ p% THEN s$ = "1" + s$ ELSE s$ = "0" + s$ 'find bits on + IF n& {{Cl|AND}} 2 ^ p% THEN s$ = "1" + s$ ELSE s$ = "0" + s$ 'find bits on NEXT p% - IF s$ = "" THEN BIN$ = "&B0" ELSE BIN$ = "&B" + s$ 'check for zero return '' '' + IF s$ = "" THEN BIN$ = "&B0" ELSE BIN$ = "&B" + s$ 'check for zero return '' '' END FUNCTION {{CodeEnd}} -: ''Explanation:'' The LOG of a '''positive''' [[INTEGER]] value is divided by the LOG of 2 to determine the number of binary digits that will be returned. The FOR loop compares the value with the exponents of two and determines if a bit is ON or OFF as "1" or "0". +: ''Explanation:'' The LOG of a '''positive''' [[INTEGER]] value is divided by the LOG of 2 to determine the number of binary digits that will be returned. The FOR loop compares the value with the exponents of two and determines if a bit is ON or OFF as "1" or "0". {{PageSeeAlso}} @@ -42,4 +42,4 @@ END FUNCTION *[http://qb64.net/wiki/index.php?title=Mathematical_Operations#Derived_Mathematical_Functions Derived Trigonometric Functions] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/LONG.txt b/internal/help/LONG.txt index 16800aea6..9821d8d17 100644 --- a/internal/help/LONG.txt +++ b/internal/help/LONG.txt @@ -26,4 +26,4 @@ * [[Variable Types]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/LPOS.txt b/internal/help/LPOS.txt index 98d5685c3..9fffa9022 100644 --- a/internal/help/LPOS.txt +++ b/internal/help/LPOS.txt @@ -17,24 +17,24 @@ The [[LPOS]] function returns the current LPT printer head position. {{PageExamples}} :Prompts the user for team names and the names of players on each team. It then prints the players and their teams on the printer. {{CodeStart}}{{Cl|CLS}} -{{Cl|LPRINT}} "Team Members"; {{Cl|TAB}}(76); "TEAM" : {{Cl|LPRINT}} -{{Cl|INPUT}} "How many teams"; TEAMS -{{Cl|INPUT}} "How many players per team";PPT +{{Cl|LPRINT}} "Team Members"; {{Cl|TAB}}(76); "TEAM" : {{Cl|LPRINT}} +{{Cl|INPUT}} "How many teams"; TEAMS +{{Cl|INPUT}} "How many players per team";PPT {{Cl|PRINT}} {{Cl|FOR}} T = 1 TO TEAMS - {{Cl|INPUT}} "Team name: ", TEAM$ + {{Cl|INPUT}} "Team name: ", TEAM$ {{Cl|FOR}} P = 1 TO PPT - {{Cl|INPUT}} " Enter player name: ", PLAYER$ + {{Cl|INPUT}} " Enter player name: ", PLAYER$ {{Cl|LPRINT}} PLAYER$; {{Cl|IF...THEN|IF}} P < PPT {{Cl|THEN}} - {{Cl|IF...THEN|IF}} {{Cl|LPOS}}(0) > 55 {{Cl|THEN}} ' Print a new line if print head past column 55. + {{Cl|IF...THEN|IF}} {{Cl|LPOS}}(0) > 55 {{Cl|THEN}} ' Print a new line if print head past column 55. {{Cl|LPRINT}} : {{Cl|LPRINT}} {{Cl|SPACE$}}(5); {{Cl|ELSE}} - {{Cl|LPRINT}} ", "; 'Otherwise, print a comma. + {{Cl|LPRINT}} ", "; 'Otherwise, print a comma. {{Cl|END}} IF {{Cl|END}} IF {{Cl|NEXT}} P -{{Cl|LPRINT}} {{Cl|STRING$}}(80 - {{Cl|LPOS}}(0) - {{Cl|LEN}}(TEAM$),"."); TEAM$ +{{Cl|LPRINT}} {{Cl|STRING$}}(80 - {{Cl|LPOS}}(0) - {{Cl|LEN}}(TEAM$),"."); TEAM$ {{Cl|NEXT}} T {{CodeEnd}} @@ -43,4 +43,4 @@ The [[LPOS]] function returns the current LPT printer head position. * [[LPRINT]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/LPRINT.txt b/internal/help/LPRINT.txt index 14a60eb0c..d37f55bdf 100644 --- a/internal/help/LPRINT.txt +++ b/internal/help/LPRINT.txt @@ -23,4 +23,4 @@ The [[LPRINT]] statement sends string text or numerical values to a parallel por * [[Windows Printer Settings]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/LPRINT_USING.txt b/internal/help/LPRINT_USING.txt index d3755d8a1..3b8685392 100644 --- a/internal/help/LPRINT_USING.txt +++ b/internal/help/LPRINT_USING.txt @@ -15,7 +15,7 @@ The [[LPRINT USING]] statement sends formatted data to LPT1, the parallel port p {{PageDescription}} * The ''variable'' list should be listed in the order that they are used in the template from left to right. -* '''If the ''template'' string is omitted or symbols don't match the ''variable(s)'' an "Illegal Function Call" [[ERROR Codes|ERROR]] will occur.''' +* '''If the ''template'' string is omitted or symbols don't match the ''variable(s)'' an "Illegal Function Call" [[ERROR Codes|ERROR]] will occur.''' * No more than 25 # digit places are allowed in a template number or an [[ERROR Codes|error]] will occur. * Can convert numerical exponential or [[scientific notation]] values to normal decimal point values using less digits. * '''NOTE:''' If the numerical value exceeds the template's digit range a % symbol will appear in the leftmost digit area. @@ -30,4 +30,4 @@ The [[LPRINT USING]] statement sends formatted data to LPT1, the parallel port p * [[PRINT]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/LSET.txt b/internal/help/LSET.txt index db6847568..2cc4f1e1e 100644 --- a/internal/help/LSET.txt +++ b/internal/help/LSET.txt @@ -15,11 +15,11 @@ ''Example 1:'' Using LSET with a [[FIELD]] definition. Note: May create an empty (unchanged) file that can be deleted. {{CodeStart}} '' '' -{{Cl|OPEN}} "testfile.dat" FOR {{Cl|RANDOM}} AS #1 {{Cl|LEN}} = 15 +{{Cl|OPEN}} "testfile.dat" FOR {{Cl|RANDOM}} AS #1 {{Cl|LEN}} = 15 {{Cl|FIELD}} 1, 6 {{Cl|AS}} a$, 9 {{Cl|AS}} other$ {{Cl|FIELD}} 1, 2 {{Cl|AS}} b$, 13 {{Cl|AS}} another$ -{{Cl|LSET}} a$ = "1234567890" -{{Cl|LSET}} other$ = "1234567890" +{{Cl|LSET}} a$ = "1234567890" +{{Cl|LSET}} other$ = "1234567890" {{Cl|PRINT}} a$, b$, other$, another$ {{Cl|CLOSE}} #1 @@ -41,12 +41,12 @@ head AS {{Cl|STRING}} * 5 {{Cl|END TYPE}} {{Cl|DIM}} me {{Cl|AS}} ninestring, you {{Cl|AS}} fivestring -me.head = "ACHES NOT" +me.head = "ACHES NOT" {{Cl|CLS}} {{Cl|LSET}} you.head = me.head -{{Cl|PRINT}} "me.head: "; me.head -{{Cl|PRINT}} "you.head: "; you.head +{{Cl|PRINT}} "me.head: "; me.head +{{Cl|PRINT}} "you.head: "; you.head {{CodeEnd}} {{OutputStart}} me.head: ACHES NOT @@ -59,4 +59,4 @@ you.head: ACHES * [[FIELD]], [[TYPE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/LTRIM$.txt b/internal/help/LTRIM$.txt index 556087640..d22833b4b 100644 --- a/internal/help/LTRIM$.txt +++ b/internal/help/LTRIM$.txt @@ -17,7 +17,7 @@ The [[LTRIM$]] function removes leading space characters from a [[STRING]] value {{CodeStart}} value = 12345 number$ = {{Cl|LTRIM$}}({{Cl|STR$}}(value)) 'converting number to string removes right PRINT space -{{Cl|PRINT}} "[" + number$ + "]" '' '' +{{Cl|PRINT}} "[" + number$ + "]" '' '' {{CodeEnd}} {{OutputStart}}[12345] {{OutputEnd}} @@ -25,8 +25,8 @@ number$ = {{Cl|LTRIM$}}({{Cl|STR$}}(value)) 'converting number to string removes ''Example 2:'' Trimming leading spaces from text strings. {{CodeStart}} '' '' -{{Cl|PRINT}} {{Cl|LTRIM$}}("some text") -{{Cl|PRINT}} {{Cl|LTRIM$}}(" some text") '' '' +{{Cl|PRINT}} {{Cl|LTRIM$}}("some text") +{{Cl|PRINT}} {{Cl|LTRIM$}}(" some text") '' '' {{CodeEnd}} {{OutputStart}}some text some text @@ -35,7 +35,7 @@ some text ''Example 3:'' A TRIM$ function to trim spaces off of both ends of a string. {{codeStart}} '' '' -text$ = " Text String " +text$ = " Text String " trimmed$ = TRIM$(text$) {{Cl|PRINT}} {{Cl|CHR$}}(26) + trimmed$ + {{Cl|CHR$}}(27) '' '' @@ -53,4 +53,4 @@ TRIM$ = {{Cl|LTRIM$}}({{Cl|RTRIM$}}(text$)) * [[HEX$]], [[MID$]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/Less_Than.txt b/internal/help/Less_Than.txt index a6ed7946f..2cfb3b63a 100644 --- a/internal/help/Less_Than.txt +++ b/internal/help/Less_Than.txt @@ -1,7 +1,7 @@ The '''<''' condition symbol denotes that a value must be less than another value for the condition to be True. -''Example usage:'' IF x [[Less_Than|<]] 320 THEN PRINT "Left of screen" +''Example usage:'' IF x [[Less_Than|<]] 320 THEN PRINT "Left of screen" * Statements will evaluate as True or -1 when the first value is less or False or 0 when the first value is equal or greater. @@ -11,9 +11,9 @@ The '''<''' condition symbol denotes that a value must be less than another v ''See also:'' * [[Equal|=]] -* [[Not_Equal|<>]] -* [[Greater_Than|>]] +* [[Not_Equal|<>]] +* [[Greater_Than|>]] * [[Relational Operations]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/Less_Than_Or_Equal.txt b/internal/help/Less_Than_Or_Equal.txt index 5793e27ae..a18edec24 100644 --- a/internal/help/Less_Than_Or_Equal.txt +++ b/internal/help/Less_Than_Or_Equal.txt @@ -1,15 +1,15 @@ The '''<=''' condition symbol denotes that a value must be less than or equal to another value for the condition to be True. -''Example usage:'' IF x [[Less_Than_Or_Equal|<=]] 320 THEN PRINT "Left or center of screen" +''Example usage:'' IF x [[Less_Than_Or_Equal|<=]] 320 THEN PRINT "Left or center of screen" ''See also:'' * [[Equal|=]] -* [[Not_Equal|<>]] -* [[Greater_Than_Or_Equal|>=]] +* [[Not_Equal|<>]] +* [[Greater_Than_Or_Equal|>=]] * [[Relational Operations]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/MID$.txt b/internal/help/MID$.txt index bdca9a7ea..ce666cdcd 100644 --- a/internal/help/MID$.txt +++ b/internal/help/MID$.txt @@ -2,7 +2,7 @@ The [[MID$]] function returns a portion of a [[STRING|string]]. {{PageSyntax}} -: {{Parameter|portion$}} = MID$({{Parameter|stringValue$}}, {{Parameter|startPosition%}}[, {{Parameter|bytes%}}]) +: {{Parameter|portion$}} = [[MID$]]({{Parameter|stringValue$}}, {{Parameter|startPosition%}}[, {{Parameter|bytes%}}]) {{Parameters}} @@ -30,7 +30,7 @@ The [[MID$]] function returns a portion of a [[STRING|string]]. hour$ = {{Cl|LEFT$}}({{Cl|TIME$}}, 2) minutes$ = {{Cl|MID$}}({{Cl|TIME$}}, 4, 2) ' skip hours and the colon (first 3 characters) -{{Cl|PRINT}} "hour = "; hour$; ": minutes = "; minutes$ '' '' +{{Cl|PRINT}} "hour = "; hour$; ": minutes = "; minutes$ '' '' {{CodeEnd}} {{OutputStart}}11:23:30 hour = 11: minutes = 23 @@ -39,7 +39,7 @@ hour = 11: minutes = 23 ''Example 2:'' Comparing MID$, the '''QB64''' byte position version of [[ASC]] and [[_MEMGET]] speeds parsing string characters: {{CodeStart}} '' '' -{{Cl|_TITLE}} "String Speed Test" +{{Cl|_TITLE}} "String Speed Test" {{Cl|DEFLNG}} A-Z 'First let's build a string for testing. @@ -85,10 +85,10 @@ t5# = {{Cl|TIMER}} 'results -{{Cl|PRINT USING}} "##.###### seconds for MID$"; t2# - t1# -{{Cl|PRINT USING}} "##.###### seconds for ASC"; t3# - t2# -{{Cl|PRINT USING}} "##.###### seconds for _MEMGET String"; t4# - t3# -{{Cl|PRINT USING}} "##.###### seconds for _MEMGET Byte"; t5# - t4# '' '' +{{Cl|PRINT USING}} "##.###### seconds for MID$"; t2# - t1# +{{Cl|PRINT USING}} "##.###### seconds for ASC"; t3# - t2# +{{Cl|PRINT USING}} "##.###### seconds for _MEMGET String"; t4# - t3# +{{Cl|PRINT USING}} "##.###### seconds for _MEMGET Byte"; t5# - t4# '' '' {{CodeEnd}} {{small|Code by Steve McNeill}} {{OutputStart}}6.593750 seconds for MID$ 1.044922 seconds for ASC @@ -106,4 +106,4 @@ t5# = {{Cl|TIMER}} * [[_MEMPUT]], [[_MEMGET]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/MID$_(statement).txt b/internal/help/MID$_(statement).txt index e9a827212..9a3efd087 100644 --- a/internal/help/MID$_(statement).txt +++ b/internal/help/MID$_(statement).txt @@ -1,29 +1,30 @@ -The '''MID$''' statement substitutes one or more new characters for existing characters of a previously defined [[STRING]]. +The [[MID$]] statement substitutes one or more new characters for existing characters of a previously defined [[STRING]]. {{PageSyntax}} -:: MID$(''basestring$'', ''start_position%''[, ''bytes%'']) = string_to_add$ +: [[MID$]]({{Parameter|baseString$}}, {{Parameter|startPosition%}}[, {{Parameter|bytes%}}]) = {{Parameter|replacementString$}} - -* The ''basestring'' variable [[STRING]] value must exist and be large enough to contain the ''string_to_add''. -* ''Start position'' specifies the string character position to start the overwrite. Cannot be 0 or an [[ERROR Codes|Illegal function call error]] will occur! -* The ''byte length'' or number of characters is optional. Excess statement string characters or byte lenghts are ignored. -* The string value to be placed in the string should be as long as the byte length reserved. -* The length of the original string is NOT changed in any case! Excess characters will not be in the string value returned. +{{PageDescription}} +* The {{Parameter|baseString$}} variable must exist and be large enough to contain the {{Parameter|replacementString$}}. +* {{Parameter|startPosition%}} specifies the string character position to start the overwrite. +* {{Parameter|bytes%}} or number of characters is optional. Excess byte lenghts are ignored. +* The {{Parameter|replacementString$}} should be as long as the byte length reserved. +* The length of the original string is not changed in any case. If {{Parameter|replacementString$}} is longer, it gets clipped. +{{PageExamples}} ''Example:'' Using [[INSTR]] to locate the string positions and a [[MID$ (statement)|MID$]] statement to change the words. {{CodeStart}} - text$ = "The cats and dogs were playing, even though dogs don't like cats." + text$ = "The cats and dogs were playing, even though dogs don't like cats." PRINT text$ start% = 1 ' start cannot be 0 when used in the INSTR function! {{Cl|DO...LOOP|DO}} - position% = {{Cl|INSTR}}(start%, text$, "dog") + position% = {{Cl|INSTR}}(start%, text$, "dog") IF position% THEN ' when position is a value greater than 0 - {{Cl|MID$}}(text$, position%, 3) = "rat" ' changes "dog" to "rat" when found + {{Cl|MID$}}(text$, position%, 3) = "rat" ' changes "dog" to "rat" when found start% = position% + 1 ' advance one position to search rest of string END IF LOOP UNTIL position% = 0 ' no other matches found @@ -35,11 +36,11 @@ The cats and rats were playing, even though rats don't like cats. {{OutputEnd}} -''See also:'' +{{PageSeeAlso}} * [[MID$]] {{text|(function)}} * [[LEFT$]], [[RIGHT$]] * [[INSTR]], [[ASCII]], [[STR$]], [[HEX$]], [[Bitmaps]] (example) * [[MKI$]], [[MKL$]], [[MKS$]], [[MKD$]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/MKD$.txt b/internal/help/MKD$.txt index a1f5ad43d..c4429ec82 100644 --- a/internal/help/MKD$.txt +++ b/internal/help/MKD$.txt @@ -1,19 +1,20 @@ -The '''MKD$''' function converts a [[DOUBLE]] numerical value into an 8 byte [[ASCII]] [[STRING]] value. +The [[MKD$]] function encodes a [[DOUBLE]] numerical value into an 8-byte [[ASCII]] [[STRING]] value. {{PageSyntax}} -:: 8byte_string$ = MKD$(double_value) +: {{Parameter|result$}} = [[MKD$]]({{Parameter|doublePrecisionVariableOrLiteral#}}) -* The double precision number value is converted to eight ASCII characters. To prove this try: PRINT MKD$(12345678). +{{PageDescription}} +* {{Parameter|doublePrecisionVariableOrLiteral#}} is converted to eight ASCII characters. To see this in action, try {{InlineCode}}PRINT MKD$(12345678){{InlineCodeEnd}}. * [[DOUBLE]] values can range up to 15 decimal point digits. Decimal point accuracy depends on whole value places taken. * The string value can be converted back to a DOUBLE numerical value using [[CVD]]. * [[DOUBLE]] numerical variable values [[PUT]] into a [[BINARY]] file are automatically placed as an MKD$ [[ASCII]] string value. -''See also:'' +{{PageSeeAlso}} * [[MKI$]], [[MKS$]], [[MKL$]] -* [[CVI]], [[CVS]], [[CVL]], [[_CV]] +* [[CVD]], [[CVI]], [[CVS]], [[CVL]] +* [[_MK$]], [[_CV]] - -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/MKDIR.txt b/internal/help/MKDIR.txt index 106a8a75b..cfdb2745a 100644 --- a/internal/help/MKDIR.txt +++ b/internal/help/MKDIR.txt @@ -1,25 +1,24 @@ -The '''MKDIR''' statement creates a new directory at a specified path. - +The [[MKDIR]] statement creates a new folder ('''dir'''ectory) at a specified path. {{PageSyntax}} -:: MKDIR pathspec$ +: [[MKDIR]] pathSpec$ -* The path specification is a literal or variable [[STRING]] expression that also specifies the new folder's name. +{{PageDescription}} +* The path specification (pathSpec$) is a literal or variable [[STRING]] expression that also specifies the new folder's name. * If no path is given the directory will become a sub-directory of the present directory where the program is currently running. -* Qbasic folder names are limited to 8 characters(no spaces) and filenames use the 8.3 naming convention. * '''QB64''' can use both long or short path and file names with spaces when required. * The new folder will be created without a user prompt or verification. -* If a path is specified, the path MUST exist or a [[ERROR Codes|"Path not found" error]] will occur. -* [[SHELL]] can use the DOS command "MD " or "MKDIR " + path$ + newfolder$ to do the same thing. +* If a path is specified, the path must exist or a [[ERROR Codes|"Path not found" error]] will occur. See [[_DIREXISTS]]. +* [[SHELL]] can use the DOS command "MD " or "MKDIR " + path$ + newfolder$ to do the same thing. -''See also:'' +{{PageSeeAlso}} * [[SHELL]], [[CHDIR]], [[FILES]] * [[NAME]], [[KILL]], [[RMDIR]] * [[_DIREXISTS]] * [[Windows_Libraries#File_Dialog_Boxes|Windows Open and Save Dialog Boxes]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/MKDMBF$.txt b/internal/help/MKDMBF$.txt index 8b97a6c6a..e3ba0023c 100644 --- a/internal/help/MKDMBF$.txt +++ b/internal/help/MKDMBF$.txt @@ -1,14 +1,18 @@ -'''MKDMBF$''' converts a double-precision IEEE number to a [[STRING|string]] containing a number in Microsoft Binary format. +The [[MKDMBF$]] function encodes a double-precision IEEE number to a string value in the Microsoft Binary format. {{PageSyntax}} -:: MKDMBF$(double-precision-expression) +: {{Parameter|result$}} = [[MKDMBF$]]({{Parameter|doublePrecisionVariableOrLiteral#}}) +{{PageDescription}} +* Encodes [[DOUBLE]] values to [[STRING|string]] values in Microsoft Binary format. +* The resulting string value can be decoded using [[CVDMBF]]. -''See also:'' + +{{PageSeeAlso}} * [[MKSMBF$]] * [[CVDMBF]], [[CVSMBF]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/MKI$.txt b/internal/help/MKI$.txt index bc0b18ce7..5a0faed42 100644 --- a/internal/help/MKI$.txt +++ b/internal/help/MKI$.txt @@ -1,22 +1,24 @@ -The '''MKI$''' function converts a numerical [[INTEGER]] value to a 2 byte [[ASCII]] string value. +The [[MKI$]] function encodes an [[INTEGER]] numerical value into a 2-byte [[ASCII]] [[STRING]] value. {{PageSyntax}} -:: two_byte_string$ = MKI$(Integer_value%) +: {{Parameter|result$}} = [[MKI$]]({{Parameter|integerVariableOrLiteral%}}) -* The Integer number value is converted to two ASCII characters. +{{PageDescription}} +* {{Parameter|integerVariableOrLiteral%}} is converted to two ASCII characters. * [[INTEGER]] values can range from -32768 to 32767. * MKI$ string values can be converted back to numerical INTEGER values using [[CVI]]. * The function takes up less byte space in a file than using the text numerical value when the value is over 2 digits. * When a variable value is used with [[PUT]] a numerical value is converted automatically in [[RANDOM]] and [[BINARY]] files. +{{PageExamples}} ''Example:'' How MKI$ creates a two byte string integer value to save file space. {{CodeStart}} '' '' {{Cl|SCREEN (statement)|SCREEN}} 12 '_PRINTSTRING requires a graphic screen mode DO - {{Cl|COLOR}} 14: {{Cl|LOCATE}} 13, 20: {{Cl|INPUT}} "Enter an Integer from 1 to 32767(0 quits): ", number% + {{Cl|COLOR}} 14: {{Cl|LOCATE}} 13, 20: {{Cl|INPUT}} "Enter an Integer from 1 to 32767(0 quits): ", number% {{Cl|IF...THEN|IF}} number% < 1 {{Cl|THEN}} {{Cl|EXIT DO}} {{Cl|CLS}} A$ = {{Cl|CHR$}}(number% {{Cl|MOD}} 256) 'first digit(0 to 255) @@ -24,10 +26,10 @@ DO MKIvalue$ = A$ + B$ Q$ = {{Cl|CHR$}}(34) - strng$ = "{{Cl|CHR$}}(" + {{Cl|LTRIM$}}({{Cl|STR$}}(number% {{Cl|MOD}} 256)) + ") + {{Cl|CHR$}}(" + {{Cl|LTRIM$}}({{Cl|STR$}}(number% \ 256)) + ")" + strng$ = "{{Cl|CHR$}}(" + {{Cl|LTRIM$}}({{Cl|STR$}}(number% {{Cl|MOD}} 256)) + ") + {{Cl|CHR$}}(" + {{Cl|LTRIM$}}({{Cl|STR$}}(number% \ 256)) + ")" {{Cl|COLOR}} 11 - {{Cl|_PRINTSTRING}} (222, 252), {{Cl|STR$}}(number%) + " = " + strng$ - {{Cl|_PRINTSTRING}} (252, 300), "{{Cl|MKI$}} value = " + Q$ + MKIvalue$ + Q$ 'print ASCII characters + {{Cl|_PRINTSTRING}} (222, 252), {{Cl|STR$}}(number%) + " = " + strng$ + {{Cl|_PRINTSTRING}} (252, 300), "{{Cl|MKI$}} value = " + Q$ + MKIvalue$ + Q$ 'print ASCII characters {{Cl|LOOP}} {{Cl|END}} '' '' {{CodeEnd}} @@ -35,10 +37,10 @@ DO :''Explanation:'' INPUT in QB64 limits integer entries to 32767 maximum. MOD 256 finds the part of a value from 0 to 255 while the second value is the number of times that 256 can go into the value. [[_PRINTSTRING]] can print all of the [[ASCII]] characters. -''See also:'' -* [[MKL$]], [[MKS$]], [[MKD$]] -* [[CVI]], [[CVL]], [[CVS]], [[CVD]] -* [[_CV]], [[_MK$]], [[STRING]] +{{PageSeeAlso}} +* [[MKD$]], [[MKS$]], [[MKL$]] +* [[CVD]], [[CVI]], [[CVS]], [[CVL]] +* [[_MK$]], [[_CV]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/MKL$.txt b/internal/help/MKL$.txt index 23166eb63..1b41aa9f5 100644 --- a/internal/help/MKL$.txt +++ b/internal/help/MKL$.txt @@ -1,28 +1,29 @@ -The '''MKL$''' function converts a numerical value to a [[LONG]] value represented as a 4 byte [[ASCII]] character [[STRING]]. +The [[MKL$]] function encodes a [[LONG]] numerical value into a 4-byte [[ASCII]] [[STRING]] value. {{PageSyntax}} -:: 4byte_string$ = MKL$(long_value&) +: {{Parameter|result$}} = [[MKL$]]({{Parameter|longVariableOrLiteral&}}) -* The long integer number value is converted to four ASCII characters. To prove this try: PRINT MKL$(12345678). -* The numerical data usually uses less bytes than printing the LONG number to a file. -* [[LONG]] Integer values can be from -2147483648 to 2147483647. -* A 10 digit long number can save 6 bytes using MKL$. +{{PageDescription}} +* {{Parameter|longVariableOrLiteral&}} is converted to four ASCII characters. To see this in action, try {{InlineCode}}PRINT MKL$(12345678){{InlineCodeEnd}}. +* The numerical data usually takes up less bytes than printing the [[LONG]] number to a file. +* [[LONG]] integer values can range from -2147483648 to 2147483647. +* Since the representation of a long number can use up to 10 ASCII characters (ten bytes), writing to a file using [[MKL$]] conversion, and then reading back with the [[CVL]] conversion can save up to 6 bytes of storage space. * [[CVL]] can convert the value back to a [[LONG]] numerical value. * [[LONG]] numerical variable values [[PUT]] into a [[BINARY]] file are automatically placed as an MKL$ [[ASCII]] string value. -''See examples:'' +{{PageExamples}} +See examples in: * [[SAVEIMAGE]] * [[SaveIcon32]] -''See also:'' -* [[CVL]], [[CVI]], [[CVS]], [[CVD]] +{{PageSeeAlso}} * [[MKI$]], [[MKS$]], [[MKD$]] -* [[_CV]], [[_MK$]] -* [[Bitmaps]] +* [[CVD]], [[CVI]], [[CVS]], [[CVL]] +* [[_MK$]], [[_CV]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/MKS$.txt b/internal/help/MKS$.txt index ff1f7ed6f..f365e91d4 100644 --- a/internal/help/MKS$.txt +++ b/internal/help/MKS$.txt @@ -1,20 +1,21 @@ -The '''MKS$''' function converts a [[SINGLE]] numerical value to a 4 byte [[ASCII]] string value. +The [[MKS$]] function encodes a [[SINGLE]] numerical value into a 4-byte [[ASCII]] [[STRING]] value. {{PageSyntax}} -:: 4byte_string$ = MKS$(single_value) +: {{Parameter|result$}} = [[MKS$]]({{Parameter|singlePrecisionVariableOrLiteral#}}) -* The single number value is converted to four ASCII characters. To prove this try: PRINT MKS$(1345678). +{{PageDescription}} +* {{Parameter|singlePrecisionVariableOrLiteral#}} is converted to four ASCII characters. To see this in action, try {{InlineCode}}PRINT MKS$(1345678){{InlineCodeEnd}}. * [[SINGLE]] values can range up to 7 decimal point digits. Decimal point accuracy depends on whole value places taken. -* MKS$ string values can be converted back to SINGLE numerical values using the [[CVS]] function. -* [[SINGLE]] numerical variable values [[PUT]] into a [[BINARY]] file are automatically placed as an MKS$ [[ASCII]] string value. +* [[MKS$]] string values can be converted back to SINGLE numerical values using the [[CVS]] function. +* [[SINGLE]] numerical variable values [[PUT]] into a [[BINARY]] file are automatically placed as an [[MKS$]] [[ASCII]] string value. -''See also:'' -* [[MKI$]], [[MKL$]], [[MKD$]] -* [[CVI]], [[CVL]], [[CVD]], [[_CV]] -* [[_MK$]], [[STRING]] +{{PageSeeAlso}} +* [[MKI$]], [[MKD$]], [[MKL$]] +* [[CVD]], [[CVI]], [[CVS]], [[CVL]] +* [[_MK$]], [[_CV]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/MKSMBF$.txt b/internal/help/MKSMBF$.txt index 757a61af4..755cdadad 100644 --- a/internal/help/MKSMBF$.txt +++ b/internal/help/MKSMBF$.txt @@ -1,17 +1,18 @@ -The '''MKSMBF$''' function converts a single-precision IEEE number to a string value in the Microsoft Binary format. +The [[MKSMBF$]] function encodes a single-precision IEEE number to a string value in the Microsoft Binary format. -''Syntax:'' MKDMBF$(single-precision-expression!) +{{PageSyntax}} +: {{Parameter|result$}} = [[MKSMBF$]]({{Parameter|singlePrecisionVariableOrLiteral!}}) -* Converts [[SINGLE]] values to [[STRING|string]] values in Microsoft Binary format. +{{PageDescription}} +* Encodes [[SINGLE]] values to [[STRING|string]] values in Microsoft Binary format. +* The resulting string value can be decoded using [[CVSMBF]]. -''See also:'' - +{{PageSeeAlso}} * [[MKDMBF$]] - * [[CVDMBF]], [[CVSMBF]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/MOD.txt b/internal/help/MOD.txt index d59b435f6..ab7ab54ee 100644 --- a/internal/help/MOD.txt +++ b/internal/help/MOD.txt @@ -1,29 +1,30 @@ -'''MOD''' is mathematical [[INTEGER]] remainder division. Also called Modulo or Modulus, it works as integer remainder division. +The [[MOD]] operator gives the remainder after division of one number by another (sometimes called modulus). {{PageSyntax}} -:: remainder = ''numerator'' '''MOD''' ''divisor'' +: {{Parameter|remainder}} = {{Parameter|numerator}} [[MOD]] {{Parameter|divisor}} {{Parameters}} * Returns the integer division remainder as a whole [[INTEGER]], [[LONG]] or [[_INTEGER64]] value. -* ''numerator'' is the [[INTEGER]] value to divide. -* ''divisor'' is the [[INTEGER]] value to divide by. +* {{Parameter|numerator}} is the [[INTEGER]] value to divide. +* {{Parameter|divisor}} is the [[INTEGER]] value to divide by. -''Usage:'' -* Floating decimal point ''numerator'' and ''divisor'' values are [[CINT]] rounded (e.g. 19 MOD 6.7 returns 5 just like 19 MOD 7 would). -* MOD returns 0 if a number is evenly divisible by Integer division ( [[\]] ) or the number divided is 0. -* '''Divisor (second value) must not be a value of 0 to .5'''. This will create a [[ERROR Codes|"Division by zero" error!]] due to [[CINT]] rounding. -* The result has the same sign as the numerator (e.g. -1 MOD 7 returns -1, not 6). -* Division and multiplication operations are performed before addition and subtraction in Qbasic's order of operations. +{{PageDescription}} +* Floating decimal point ''numerator'' and ''divisor'' values are [[CINT]] rounded (e.g. {{InlineCode}}19 MOD 6.7{{InlineCodeEnd}} returns 5 just like {{InlineCode}}19 MOD 7{{InlineCodeEnd}} would). +* MOD returns 0 if a number is evenly divisible by integer division ( [[\]] ) or the number divided is 0. +* '''{{Parameter|divisor}} (second value) must not be between 0 and .5'''. This will create a [[ERROR Codes|"Division by zero" error]] due to [[CINT]] rounding the value to 0. +* The result has the same sign as the numerator (e.g. {{InlineCode}}-1 MOD 7{{InlineCodeEnd}} returns -1, not 6). +* Division and multiplication operations are performed before addition and subtraction in QBasic's order of operations. +{{PageExamples}} ''Example 1:'' {{CodeStart}} I% = 100 {{Cl|\}} 9 R% = 100 {{Cl|MOD}} 9 - PRINT "Integer division ="; I%, "Remainder ="; R% + PRINT "Integer division ="; I%, "Remainder ="; R% {{CodeEnd}} {{OutputStart}} Integer division = 11 Remainder = 1 '' '' @@ -34,9 +35,9 @@ ''Example 2:'' Comparing normal, integer and remainder division. {{CodeStart}} -tmp1$ = " Normal: ####.# / #### = ##.### " -tmp2$ = " Integer: ####.# \ #### = ### " -tmp3$ = " Remainder: ####.# MOD #### = #### " +tmp1$ = " Normal: ####.# / #### = ##.### " +tmp2$ = " Integer: ####.# \ #### = ### " +tmp3$ = " Remainder: ####.# MOD #### = #### " FOR i = 1 TO 6 SELECT CASE i CASE 1: numerator = 1: divisor = 5 @@ -49,7 +50,7 @@ FOR i = 1 TO 6 LOCATE 5, 20: PRINT USING tmp1$; numerator; divisor; numerator / divisor LOCATE 7, 20: PRINT USING tmp2$; numerator; divisor; numerator \ divisor LOCATE 9, 20: PRINT USING tmp3$; numerator; divisor; numerator MOD divisor -DO: SLEEP: LOOP UNTIL INKEY$ <> "" +DO: SLEEP: LOOP UNTIL INKEY$ <> "" NEXT '' '' {{CodeEnd}} @@ -58,10 +59,10 @@ NEXT '' '' {{CodeStart}} '' '' {{Cl|CLS}} DO - {{Cl|INPUT}} "Enter a base number system 2 to 36: ", b% - {{Cl|IF...THEN|IF}} b% < 2 {{Cl|OR (boolean)|OR}} b% > 36 {{Cl|THEN}} {{Cl|EXIT DO}} - {{Cl|PRINT}} "Enter a positive value to convert: "; - num$ = "" + {{Cl|INPUT}} "Enter a base number system 2 to 36: ", b% + {{Cl|IF...THEN|IF}} b% < 2 {{Cl|OR (boolean)|OR}} b% > 36 {{Cl|THEN}} {{Cl|EXIT DO}} + {{Cl|PRINT}} "Enter a positive value to convert: "; + num$ = "" {{Cl|DO...LOOP|DO}}: K$ = {{Cl|INKEY$}} num$ = num$ + K$ {{Cl|LOCATE}} {{Cl|CSRLIN}}, {{Cl|POS}}(0): {{Cl|PRINT}} K$; @@ -69,18 +70,18 @@ DO n& = {{Cl|VAL}}(num$) {{Cl|IF...THEN|IF}} n& = 0 {{Cl|THEN}} {{Cl|EXIT DO}} Bnum$ = BASEN$(n&, b%) - {{Cl|PRINT}} Bnum$ ', {{Cl|VAL}}("{{Cl|&H}}" + Bnum$) 'tests hexadecimal base 16 only + {{Cl|PRINT}} Bnum$ ', {{Cl|VAL}}("{{Cl|&H}}" + Bnum$) 'tests hexadecimal base 16 only {{Cl|LOOP}} {{Cl|END}} {{Cl|FUNCTION}} BASEN$ (number&, basenum%) -{{Cl|IF...THEN|IF}} basenum% < 2 {{Cl|OR (boolean)|OR}} basenum% > 36 {{Cl|OR (boolean)|OR}} number& = 0 {{Cl|THEN}} {{Cl|EXIT FUNCTION}} +{{Cl|IF...THEN|IF}} basenum% < 2 {{Cl|OR (boolean)|OR}} basenum% > 36 {{Cl|OR (boolean)|OR}} number& = 0 {{Cl|THEN}} {{Cl|EXIT FUNCTION}} num& = number& 'protect value of number! DO remain% = {{Cl|ABS}}(num&) {{Cl|MOD}} basenum% ' remainder is used to create actual digit 0 to Z num& = num& \ basenum% ' move up one exponent of base% with integer division - {{Cl|IF...THEN|IF}} remain% > 9 {{Cl|THEN}} + {{Cl|IF...THEN|IF}} remain% > 9 {{Cl|THEN}} b$ = {{Cl|CHR$}}(65 + (remain% - 10)) 'limited to base 36 {{Cl|ELSE}}: b$ = {{Cl|LTRIM$}}({{Cl|STR$}}(remain%)) ' make remainder a string number {{Cl|END IF}} @@ -92,11 +93,11 @@ BASEN$ = BN$ : ''Note:'' Base numbering systems over base 10(0 - 9) use alphabetical letters to represent digits greater than 9 like [[&H|Hexadecimal]](0 - F). -''See also:'' +{{PageSeeAlso}} * [[/|/ (normal division operator)]] * [[\|\ (integer division operator)]] -* [[INT]], [[CINT]], [[FIX]], [[_ROUND]] +* [[INT]], [[CINT]], [[FIX]], [[_ROUND]], [[_CEIL]] * [[Mathematical Operations]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/Mathematical_Operations.txt b/internal/help/Mathematical_Operations.txt index cf8625eb3..363d854a4 100644 --- a/internal/help/Mathematical_Operations.txt +++ b/internal/help/Mathematical_Operations.txt @@ -1,9 +1,9 @@ -{| align="center" +{| align="center" | __TOC__ |} ==Basic and QB64 Numerical Types== -<center>'''Qbasic Number Types'''</center> +<center>'''Qbasic Number Types'''</center> * [[INTEGER]] ['''%''']: 2 Byte signed whole number values from -32768 to 32767. 0 to 65535 unsigned. (not checked in QB64) * [[LONG]] ['''&''']: 4 byte signed whole number values from -2147483648 to 2147483647. 0 to 4294967295 unsigned. @@ -12,7 +12,7 @@ * To get '''one byte''' values, can use an [[ASCII]] [[STRING]] character to represent values from 0 to 255 as in [[BINARY]] files. -<center>'''QB64 Number Types'''</center> +<center>'''QB64 Number Types'''</center> * [[_BIT]] ['''`''']: 1 bit signed whole number values of 0 or -1 signed or 0 or 1 unsigned. [[_BIT]] * 8 can hold a signed or unsigned [[_BYTE|byte]] value. * [[_BYTE]] ['''%%''']: 1 byte signed whole number values from -128 to 127. Unsigned values from 0 to 255. @@ -21,7 +21,7 @@ * [[_OFFSET]] [%&]: undefined flexable length integer offset values used in [[DECLARE DYNAMIC LIBRARY]] declarations. -<center>'''Signed and Unsigned Integer Values'''</center> +<center>'''Signed and Unsigned Integer Values'''</center> Negative (signed) numerical values can affect calculations when using any of the BASIC operators. SQR cannot use negative values! There may be times that a calculation error is made using those negative values. The SGN function returns the sign of a value as -1 for negative, 0 for zero and 1 for unsigned positive values. ABS always returns an unsigned value. @@ -33,59 +33,59 @@ Negative (signed) numerical values can affect calculations when using any of the [[_UNSIGNED]] integer, byte and bit variable values can use the tilde ~ suffix before the type suffix to define the type. -<center>[[#toc|Return to Top]]</center> +<center>[[#toc|Return to Top]]</center> ==Mathematical Operation Symbols== Most of the BASIC math operators are ones that require no introduction. The addition, subtraction, multplication and division operators are ones commonly used as shown below: -{| align="center" border=1 +{| align="center" border=1 ! Symbol ! Procedure Type ! Example Usage ! Operation Order |- -| align="center" |[[+]] ||  Addition || align="center" | c = a + b  || align="center" | Last +| align="center" |[[+]] ||  Addition || align="center" | c = a + b  || align="center" | Last |- -| align="center" |[[-]] ||  Subtraction  || align="center" | c = a - b || align="center" | Last +| align="center" |[[-]] ||  Subtraction  || align="center" | c = a - b || align="center" | Last |- -| align="center" |[[-]] ||  Negation  || align="center" | c = - a || align="center" | Last +| align="center" |[[-]] ||  Negation  || align="center" | c = - a || align="center" | Last |- -| align="center" |[[*]] ||  Multiplication || align="center" | c = a * b || align="center" | Second +| align="center" |[[*]] ||  Multiplication || align="center" | c = a * b || align="center" | Second |- -| align="center" |[[/]] ||  Division  || align="center" | c = a / b || align="center" | Second +| align="center" |[[/]] ||  Division  || align="center" | c = a / b || align="center" | Second |} BASIC can also use two other operators for '''[[INTEGER]] division'''. Integer division returns only whole number values. [[MOD]] '''remainder division''' returns a value only if an integer division cannot divide a number exactly. Returns 0 if a value is exactly divisible. -{| align="center" border=1 +{| align="center" border=1 !Symbol !Procedure Type !Example Usage !Operation Order |- -| align="center" |[[\]] ||  Integer division || align="center" | c = a \ b || align="center" | Second +| align="center" |[[\]] ||  Integer division || align="center" | c = a \ b || align="center" | Second |- -| align="center" |[[MOD]] ||  Remainder division  || align="center" | c = a MOD b || align="center" | Second +| align="center" |[[MOD]] ||  Remainder division  || align="center" | c = a MOD b || align="center" | Second |} -<center>'''''It is an [[ERROR|error]] to divide by zero or to take the remainder modulo zero.'''''</center> +<center>'''''It is an [[ERROR|error]] to divide by zero or to take the remainder modulo zero.'''''</center> There is also an operator for '''exponential''' calculations. The exponential operator is used to raise a number's value to a designated exponent of itself. In QB the exponential return values are [[DOUBLE]] values. The [[SQR]] function can return a number's Square Root. For other '''exponential roots''' the operator can be used with fractions such as (1 / 3) designating the cube root of a number. -{| align="center" border=1 +{| align="center" border=1 !Symbol !Procedure !Example Usage !Operation Order |- -| align="center" |[[^]] || Exponent || align="center" | c = a [[^]] (1 / 2) || align="center" | First +| align="center" |[[^]] || Exponent || align="center" | c = a [[^]] (1 / 2) || align="center" | First |- -| align="center" | [[SQR]] || Square Root || align="center" | c = [[SQR]](a [[^]] 2 + b [[^]] 2) || align="center" | First +| align="center" | [[SQR]] || Square Root || align="center" | c = [[SQR]](a [[^]] 2 + b [[^]] 2) || align="center" | First |} @@ -94,7 +94,7 @@ There is also an operator for '''exponential''' calculations. The exponential op * Negative exponential values must be enclosed in () brackets in QB64. -<center>[[#toc|Return to Top]]</center> +<center>[[#toc|Return to Top]]</center> ==Basic's Order of Operations== @@ -107,7 +107,7 @@ When a normal calculation is made, BASIC works from left to right, but it does c :::# Addition and Subtraction calculations -<center>'''Using Parenthesis to Define the Operation Order'''</center> +<center>'''Using Parenthesis to Define the Operation Order'''</center> Sometimes a calculation may need BASIC to do them in another order or the calculation will return bad results. BASIC allows the programmer to decide the order of operations by using [[parenthesis]] around parts of the equation. BASIC will do the calculations inside of the [[parenthesis]] brackets first and the others from left to right in the normal operation order. @@ -123,20 +123,20 @@ Sometimes a calculation may need BASIC to do them in another order or the calcul |- | [[COS]](angle*) || returns the cosine of an angle in radians. (horizontal component) |- - | [[EXP]](n) || returns e<sup>x</sup>, '''(n <= 88.02969)''': e = EXP(1) ' (e = 2.718281828459045) + | [[EXP]](n) || returns e<sup>x</sup>, '''(n <= 88.02969)''': e = EXP(1) ' (e = 2.718281828459045) |- - | [[LOG]](n) || returns the base e natural logarithm of n. '''(n > 0)''' + | [[LOG]](n) || returns the base e natural logarithm of n. '''(n > 0)''' |- - | [[SGN]](n) || returns -1 if n < 0, 0 if n = 0, 1 if n > 0: SGN(-5) = -1 + | [[SGN]](n) || returns -1 if n < 0, 0 if n = 0, 1 if n > 0: SGN(-5) = -1 |- | [[SIN]](angle*) || returns the sine of an angle in radians. (vertical component) |- - | [[SQR]](n) || returns the square root of a number. '''(n >= 0)''' + | [[SQR]](n) || returns the square root of a number. '''(n >= 0)''' |- | [[TAN]](angle*) || returns the tangent of an angle in radians |} -<center> '''* angles measured in radians'''</center> +<center> '''* angles measured in radians'''</center> {{TextStart}} '''Degree to Radian Conversion:''' @@ -150,23 +150,23 @@ END FUNCTION '''Logarithm to base n''' FUNCTION LOGN (X, n) -IF n > 0 AND n <> 1 AND X > 0 THEN LOGN = {{Cb|LOG}}(X) / {{Cb|LOG}}(n) ELSE BEEP +IF n > 0 AND n <> 1 AND X > 0 THEN LOGN = {{Cb|LOG}}(X) / {{Cb|LOG}}(n) ELSE BEEP END FUNCTION '' '' FUNCTION LOG10 (X) 'base 10 logarithm -IF X > 0 THEN LOG10 = {{Cb|LOG}}(X) / {{Cb|LOG}}(10) ELSE BEEP +IF X > 0 THEN LOG10 = {{Cb|LOG}}(X) / {{Cb|LOG}}(10) ELSE BEEP END FUNCTION '' '' {{TextEnd}} -<center>'''The numerical value of n in the [[LOG]](n) evaluation must be a positive value.'''</center> +<center>'''The numerical value of n in the [[LOG]](n) evaluation must be a positive value.'''</center> -<center>'''The numerical value of n in the [[EXP]](n) evaluation must be less than or equal to 88.02969.'''</center> +<center>'''The numerical value of n in the [[EXP]](n) evaluation must be less than or equal to 88.02969.'''</center> -<center>'''The numerical value of n in the [[SQR]](n) evaluation ''cannot'' be a negative value.'''</center> +<center>'''The numerical value of n in the [[SQR]](n) evaluation ''cannot'' be a negative value.'''</center> -<center>[[#toc|Return to Top]]</center> +<center>[[#toc|Return to Top]]</center> ==Derived Mathematical Functions== @@ -176,15 +176,15 @@ The following Trigonometric functions can be derived from the '''BASIC Mathemati {{TextStart}}'' '' FUNCTION SEC (x) 'Secant -IF COS(x) <> 0 THEN SEC = 1 / {{Cb|COS}}(x) ELSE BEEP +IF COS(x) <> 0 THEN SEC = 1 / {{Cb|COS}}(x) ELSE BEEP END FUNCTION FUNCTION CSC (x) 'CoSecant -IF SIN(x) <> 0 THEN CSC = 1 / {{Cb|SIN}}(x) ELSE BEEP +IF SIN(x) <> 0 THEN CSC = 1 / {{Cb|SIN}}(x) ELSE BEEP END FUNCTION FUNCTION COT (x) 'CoTangent -IF TAN(x) <> 0 THEN COT = 1 / {{Cb|TAN}}(x) ELSE BEEP +IF TAN(x) <> 0 THEN COT = 1 / {{Cb|TAN}}(x) ELSE BEEP END FUNCTION FUNCTION ARCSIN (x) 'Inverse Sine @@ -216,36 +216,36 @@ IF x <= 88.02969 THEN COSH = (EXP(x) + EXP(-x)) / 2 ELSE BEEP END FUNCTION '' '' FUNCTION TANH (x) ' Hyperbolic Tangent or SINH(x) / COSH(x) -IF 2 * x <= 88.02969 AND EXP(2 * x) + 1 <> 0 THEN +IF 2 * x <= 88.02969 AND EXP(2 * x) + 1 <> 0 THEN TANH = ({{Cb|EXP}}(2 * x) - 1) / ({{Cb|EXP}}(2 * x) + 1) ELSE BEEP END IF END FUNCTION '' '' FUNCTION SECH (x) ' Hyperbolic Secant or (COSH(x)) ^ -1 -IF x <= 88.02969 AND (EXP(x) + EXP(-x)) <> 0 THEN SECH = 2 / ({{Cb|EXP}}(x) + {{Cb|EXP}}(-x)) ELSE BEEP +IF x <= 88.02969 AND (EXP(x) + EXP(-x)) <> 0 THEN SECH = 2 / ({{Cb|EXP}}(x) + {{Cb|EXP}}(-x)) ELSE BEEP END FUNCTION '' '' FUNCTION CSCH (x) ' Hyperbolic CoSecant or (SINH(x)) ^ -1 -IF x <= 88.02969 AND (EXP(x) - EXP(-x)) <> 0 THEN CSCH = 2 / ({{Cb|EXP}}(x) - {{Cb|EXP}}(-x)) ELSE BEEP +IF x <= 88.02969 AND (EXP(x) - EXP(-x)) <> 0 THEN CSCH = 2 / ({{Cb|EXP}}(x) - {{Cb|EXP}}(-x)) ELSE BEEP END FUNCTION '' '' FUNCTION COTH (x) ' Hyperbolic CoTangent or COSH(x) / SINH(x) -IF 2 * x <= 88.02969 AND EXP(2 * x) - 1 <> 0 THEN +IF 2 * x <= 88.02969 AND EXP(2 * x) - 1 <> 0 THEN COTH = ({{Cb|EXP}}(2 * x) + 1) / ({{Cb|EXP}}(2 * x) - 1) ELSE BEEP END IF END FUNCTION '' '' FUNCTION ARCSINH (x) ' Inverse Hyperbolic Sine -IF (x * x) + 1 >= 0 AND x + SQR((x * x) + 1) > 0 THEN +IF (x * x) + 1 >= 0 AND x + SQR((x * x) + 1) > 0 THEN ARCSINH = {{Cb|LOG}}(x + {{Cb|SQR}}(x * x + 1)) ELSE BEEP END IF END FUNCTION '' '' FUNCTION ARCCOSH (x) ' Inverse Hyperbolic CoSine -IF x >= 1 AND x * x - 1 >= 0 AND x + SQR(x * x - 1) > 0 THEN +IF x >= 1 AND x * x - 1 >= 0 AND x + SQR(x * x - 1) > 0 THEN ARCCOSH = {{Cb|LOG}}(x + {{Cb|SQR}}(x * x - 1)) ELSE BEEP END IF @@ -256,18 +256,18 @@ IF x < 1 THEN ARCTANH = {{Cb|LOG}}((1 + x) / (1 - x)) / 2 ELSE BEEP END FUNCTION FUNCTION ARCSECH (x) ' Inverse Hyperbolic Secant -IF x > 0 AND x <= 1 THEN ARCSECH = {{Cb|LOG}}(({{Cb|SGN}}(x) * {{Cb|SQR}}(1 - x * x) + 1) / x) ELSE BEEP +IF x > 0 AND x <= 1 THEN ARCSECH = {{Cb|LOG}}(({{Cb|SGN}}(x) * {{Cb|SQR}}(1 - x * x) + 1) / x) ELSE BEEP END FUNCTION '' '' FUNCTION ARCCSCH (x) ' Inverse Hyperbolic CoSecant -IF x <> 0 AND x * x + 1 >= 0 AND (SGN(x) * SQR(x * x + 1) + 1) / x > 0 THEN +IF x <> 0 AND x * x + 1 >= 0 AND (SGN(x) * SQR(x * x + 1) + 1) / x > 0 THEN ARCCSCH = {{Cb|LOG}}(({{Cb|SGN}}(x) * {{Cb|SQR}}(x * x + 1) + 1) / x) ELSE BEEP END IF END FUNCTION '' '' FUNCTION ARCCOTH (x) ' Inverse Hyperbolic CoTangent -IF x > 1 THEN ARCCOTH = {{Cb|LOG}}((x + 1) / (x - 1)) / 2 ELSE BEEP +IF x > 1 THEN ARCCOTH = {{Cb|LOG}}((x + 1) / (x - 1)) / 2 ELSE BEEP END FUNCTION '' '' {{TextEnd}} {{WhiteStart}} @@ -287,31 +287,33 @@ END FUNCTION '' '' ARCSCH(x) = ARSINH(x) ^ -1 ARCOTH(x) = ARTANH(x) ^ -1 - '''Hyperbolic sine and cosine satisfy the Pythagorean trig. identity:''' + +4000 + '''Hyperbolic sine and cosine satisfy the Pythagorean trig. identity:''' (COSH(x) ^ 2) - (SINH(x) ^ 2) = 1 {{WhiteEnd}} -<center>[http://support.microsoft.com/kb/28249 Microsoft's Derived BASIC Functions (KB 28249)]</center> +<center>[http://support.microsoft.com/kb/28249 Microsoft's Derived BASIC Functions (KB 28249)]</center> -<center>[[#toc|Return to Top]]</center> +<center>[[#toc|Return to Top]]</center> ==Mathematical Logical Operators== The following logical operators compare numerical values using bitwise operations. The two numbers are compared by the number's [[Binary]] bits on and the result of the operation determines the value returned in decimal form. [[NOT]] checks one value and returns the opposite. It returns 0 if a value is not 0 and -1 if it is 0. See [[Binary]] for more on bitwise operations. -<center>'''Truth table of the 6 BASIC Logical Operators'''</center> +<center>'''Truth table of the 6 BASIC Logical Operators'''</center> {{Template:LogicalTruthTable}} -<center>BASIC can accept any + or - value that is not 0 to be True when used in an evaluation.</center> +<center>BASIC can accept any + or - value that is not 0 to be True when used in an evaluation.</center> -<center>[[#toc|Return to Top]]</center> +<center>[[#toc|Return to Top]]</center> ==Relational Operators== Relational Operations are used to compare values in a Conditional [[IF...THEN]], [[SELECT CASE]], [[UNTIL]] or [[WHILE]] statement. @@ -320,11 +322,11 @@ Relational Operations are used to compare values in a Conditional [[IF...THEN]], {{Template:RelationalTable}} -<center>[[#toc|Return to Top]]</center> +<center>[[#toc|Return to Top]]</center> ==Basic's Rounding Functions== -: Rounding is used when the program needs a certain number value or type. There are 4 [[INTEGER]] or [[LONG]] Integer functions and one function each for closest [[SINGLE]] and closest [[DOUBLE]] numerical types. Closest functions use "bankers" rounding which rounds up if the decimal point value is over one half. Variable types should match the return value. +: Rounding is used when the program needs a certain number value or type. There are 4 [[INTEGER]] or [[LONG]] Integer functions and one function each for closest [[SINGLE]] and closest [[DOUBLE]] numerical types. Closest functions use "bankers" rounding which rounds up if the decimal point value is over one half. Variable types should match the return value. {| align=center border=1 ! Name @@ -349,7 +351,7 @@ Relational Operations are used to compare values in a Conditional [[IF...THEN]], ===Note=== * Each of the above functions define the value's type in addition to rounding the values. -<center>[[#toc|Return to Top]]</center> +<center>[[#toc|Return to Top]]</center> ==Base Number Systems== @@ -376,7 +378,7 @@ Relational Operations are used to compare values in a Conditional [[IF...THEN]], 12 1100 C 14 13 1101 D 15 14 1110 E 16 - 15 ------------- 1111 <--- Match ---> F ---------------- 17 -- max 2 + 15 ------------- 1111 <--- Match ---> F ---------------- 17 -- max 2 16 10000 10 20 When the Decimal value is 15, the other 2 base systems are all maxed out! @@ -399,39 +401,39 @@ Relational Operations are used to compare values in a Conditional [[IF...THEN]], {{TextEnd}} -<center>'''[[VAL]] converts [[STRING|string]] numbers to Decimal values.'''</center> +<center>'''[[VAL]] converts [[STRING|string]] numbers to Decimal values.'''</center> * VAL reads the string from left to right and converts numerical string values, - and . to decimal values until it finds a character other than those 3 characters. Commas are not read. * HEXadecimal and OCTal base values can be read with [[&H]] or [[&O]]. -<center>'''The [[OCT$]] [[STRING|string]] function return can be converted to a decimal value using [[VAL]]("&O" + OCT$(n)).'''</center> +<center>'''The [[OCT$]] [[STRING|string]] function return can be converted to a decimal value using [[VAL]]("&O" + OCT$(n)).'''</center> -<center>'''The [[HEX$]] [[STRING|string]] function return can be converted to a decimal value using [[VAL]]("&H" + HEX$(n)).'''</center> +<center>'''The [[HEX$]] [[STRING|string]] function return can be converted to a decimal value using [[VAL]]("&H" + HEX$(n)).'''</center> :[[STR$]] converts numerical values to string characters for [[PRINT]] or variable strings. It also removes the right number PRINT space. -<center>[[#toc|Return to Top]]</center> +<center>[[#toc|Return to Top]]</center> ==Bits and Bytes== -<center>'''[[_BIT|BITS]]'''</center> +<center>'''[[_BIT|BITS]]'''</center> * The '''MSB''' is the most significant(largest) bit value and '''LSB''' is the least significant bit of a binary or register memory address value. The order in which the bits are read determines the binary or decimal byte value. There are two common ways to read a byte: -:* '''"Big-endian"''': MSB is the first bit encountered, decreasing to the LSB as the last bit by position, memory address or time. -:* '''"Little-endian"''': LSB is the first bit encountered, increasing to the MSB as the last bit by position, memory address or time. +:* '''"Big-endian"''': MSB is the first bit encountered, decreasing to the LSB as the last bit by position, memory address or time. +:* '''"Little-endian"''': LSB is the first bit encountered, increasing to the MSB as the last bit by position, memory address or time. {{WhiteStart}} '''Offset or Position: 0 1 2 3 4 5 6 7 Example: 11110000''' ---------------------------------- -------- '''Big-Endian Bit On Value:''' 128 64 32 16 8 4 2 1 240 '''Little-Endian Bit On Value:''' 1 2 4 8 16 32 64 128 15 {{WhiteEnd}} -::The big-endian method compares exponents of 2 <sup>7</sup> down to 2 <sup>0</sup> while the little-endian method does the opposite. +::The big-endian method compares exponents of 2 <sup>7</sup> down to 2 <sup>0</sup> while the little-endian method does the opposite. -<center>'''[[_BYTE|BYTES]]'''</center> +<center>'''[[_BYTE|BYTES]]'''</center> * [[INTEGER]] values consist of 2 bytes called the '''HI''' and '''LO''' bytes. Anytime that the number of binary digits is a multiple of 16 (2bytes, 4 bytes, etc.) and the HI byte's MSB is on(1), the value returned will be negative, even with [[SINGLE]] or [[DOUBLE]] values. {{WhiteStart}} '''16 BIT INTEGER OR REGISTER''' '''AH (High Byte Bits) AL (Low Byte Bits)''' @@ -449,13 +451,13 @@ Relational Operations are used to compare values in a Conditional [[IF...THEN]], {{Cl|DEFINT}} A-Z {{Cl|SCREEN (statement)|SCREEN}} 12 {{Cl|COLOR}} 11: {{Cl|LOCATE}} 10, 2 - {{Cl|PRINT}} " AH (High Register Byte Bits) AL (Low Register Byte Bits)" + {{Cl|PRINT}} " AH (High Register Byte Bits) AL (Low Register Byte Bits)" {{Cl|COLOR}} 14: {{Cl|LOCATE}} 11, 2 - {{Cl|PRINT}} " 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0" + {{Cl|PRINT}} " 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0" {{Cl|COLOR}} 13: {{Cl|LOCATE}} 14, 2 - {{Cl|PRINT}} " {{Cl|&H}}8000 4000 2000 1000 800 400 200 100 80 40 20 10 8 4 2 {{Cl|&H}}1" + {{Cl|PRINT}} " {{Cl|&H}}8000 4000 2000 1000 800 400 200 100 80 40 20 10 8 4 2 {{Cl|&H}}1" {{Cl|COLOR}} 11: {{Cl|LOCATE}} 15, 2 - {{Cl|PRINT}} "-32768 16384 8192 4096 2048 1024 512 256 128 64 32 16 8 4 2 1" + {{Cl|PRINT}} "-32768 16384 8192 4096 2048 1024 512 256 128 64 32 16 8 4 2 1" {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 16 {{Cl|CIRCLE}} (640 - (37 * i), 189), 8, 9 'place bit circles {{Cl|NEXT}} @@ -465,45 +467,45 @@ Relational Operations are used to compare values in a Conditional [[IF...THEN]], {{Cl|FOR...NEXT|FOR}} i = 15 {{Cl|TO}} 0 {{Cl|STEP}} -1 {{Cl|IF}} (Num {{Cl|AND}} 2 ^ i) {{Cl|THEN}} {{Cl|PAINT}} (640 - (37 * (i + 1)), 189), 12, 9 - Bin$ = Bin$ + "1" + Bin$ = Bin$ + "1" {{Cl|ELSE}} {{Cl|PAINT}} (640 - (37 * (i + 1)), 189), 0, 9 - Bin$ = Bin$ + "0" + Bin$ = Bin$ + "0" {{Cl|END IF}} {{Cl|NEXT}} - {{Cl|COLOR}} 10: {{Cl|LOCATE}} 16, 50: {{Cl|PRINT}} "Binary ="; {{Cl|VAL}}(Bin$) - {{Cl|COLOR}} 9: {{Cl|LOCATE}} 16, 10: {{Cl|PRINT}} "Decimal ="; Num;: {{Cl|COLOR}} 13: {{Cl|PRINT}} " Hex = "; Hexa$ - Hexa$ = "": Bin$ = "" + {{Cl|COLOR}} 10: {{Cl|LOCATE}} 16, 50: {{Cl|PRINT}} "Binary ="; {{Cl|VAL}}(Bin$) + {{Cl|COLOR}} 9: {{Cl|LOCATE}} 16, 10: {{Cl|PRINT}} "Decimal ="; Num;: {{Cl|COLOR}} 13: {{Cl|PRINT}} " Hex = "; Hexa$ + Hexa$ = "": Bin$ = "" {{Cl|END IF}} - {{Cl|COLOR}} 14: {{Cl|LOCATE}} 17, 15: {{Cl|INPUT}} "Enter a decimal or HEX({{Cl|&H}}) value (0 Quits): ", frst$ + {{Cl|COLOR}} 14: {{Cl|LOCATE}} 17, 15: {{Cl|INPUT}} "Enter a decimal or HEX({{Cl|&H}}) value (0 Quits): ", frst$ first = {{Cl|VAL}}(frst$) {{Cl|IF}} first {{Cl|THEN}} {{Cl|LOCATE}} 17, 15: {{Cl|PRINT}} {{Cl|SPACE$}}(55) - {{Cl|COLOR}} 13: {{Cl|LOCATE}} 17, 15: {{Cl|INPUT}} "Enter a second value: ", secnd$ + {{Cl|COLOR}} 13: {{Cl|LOCATE}} 17, 15: {{Cl|INPUT}} "Enter a second value: ", secnd$ second = {{Cl|VAL}}(secnd$) {{Cl|LOCATE}} 17, 10: {{Cl|PRINT}} {{Cl|SPACE$}}(69) {{Cl|END IF}} Num = first + second - Hexa$ = "{{Cl|&H}}" + {{Cl|HEX$}}(Num) -{{Cl|LOOP}} {{Cl|UNTIL}} first = 0 {{Cl|OR (boolean)|OR}} Num > 32767 {{Cl|OR (boolean)|OR}} Num < -32767 -{{Cl|COLOR}} 11: {{Cl|LOCATE}} 28, 30: {{Cl|PRINT}} "Press any key to exit!"; + Hexa$ = "{{Cl|&H}}" + {{Cl|HEX$}}(Num) +{{Cl|LOOP}} {{Cl|UNTIL}} first = 0 {{Cl|OR (boolean)|OR}} Num > 32767 {{Cl|OR (boolean)|OR}} Num < -32767 +{{Cl|COLOR}} 11: {{Cl|LOCATE}} 28, 30: {{Cl|PRINT}} "Press any key to exit!"; {{Cl|SLEEP}} {{Cl|SYSTEM}} '' '' {{CodeEnd}} {{small|Code by Ted Weissgerber}} -<center>[[#toc|Return to Top]]</center> +<center>[[#toc|Return to Top]]</center> ==OFFSET== * [[_OFFSET (function)]] returns the memory offset position as a flexible sized value for a designated variable. See [[Using _OFFSET]]. -<center>'''Warning: [[_OFFSET]] values cannot be reassigned to other variable [[TYPE|types]].'''</center> +<center>'''Warning: [[_OFFSET]] values cannot be reassigned to other variable [[TYPE|types]].'''</center> -<center>'''[[_OFFSET]] values can only be used in conjunction with [[_MEM]]ory and [[DECLARE DYNAMIC LIBRARY]] procedures.'''</center> +<center>'''[[_OFFSET]] values can only be used in conjunction with [[_MEM]]ory and [[DECLARE DYNAMIC LIBRARY]] procedures.'''</center> ==References== ''See also:'' @@ -511,4 +513,4 @@ Relational Operations are used to compare values in a Conditional [[IF...THEN]], * [[DIM]], [[_DEFINE]] * [[TYPE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/NAME.txt b/internal/help/NAME.txt index f45126b7d..1d995c37d 100644 --- a/internal/help/NAME.txt +++ b/internal/help/NAME.txt @@ -1,33 +1,31 @@ -The '''NAME''' statement changes the name of a file or directory to a new name. +The [[NAME]] statement changes the name of a file or directory to a new name. {{PageSyntax}} -:: NAME ''old_filename$'' AS ''new_filename$'' +: [[NAME]] {{Parameter|oldFileOrFolderName$}} '''AS''' {{Parameter|newFileOrFolderName$}} {{PageDescription}} -* Filenames are variables or literal [[STRING]]s in quotes. Paths can be included. -* Long filenames can be used in QB64 only! Qbasic requires the DOS 8.3 (folder maximum of 8) naming convention. +* {{Parameter|oldFileOrFolderName$}} and {{Parameter|newFileOrFolderName$}} are variables or literal [[STRING]]s in quotes. Paths can be included. * If the two paths are different, the statement moves the original file to the new path and renames it. * If the path is the same or a path is not included, the original file is just renamed. -* [[SHELL]] can use "REN " + filename$ + " " newname$ in DOS. +* [[SHELL]] can use ''"REN " + filename$ + " " + newname$'' for the same purpose (Windows). * Path or filename [[ERROR Codes|errors]] are possible and should be handled in the program. -* '''CAUTION: There is no prompt to continue or execution verification!''' +* '''Caution: There is no prompt to continue or execution verification.''' {{PageExamples}} - {{CodeStart}} - {{Cl|NAME}} "BIGBAD.TXT" {{Cl|AS}} "BADWOLF.TXT" + {{Cl|NAME}} "BIGBAD.TXT" {{Cl|AS}} "BADWOLF.TXT" {{CodeEnd}} -''See also:'' +{{PageSeeAlso}} * [[SHELL]], [[MKDIR]], [[FILES]] * [[CHDIR]], [[KILL]], [[RMDIR]] * [[DOS]], [[Batch Files]] * [[Windows_Libraries#File_Dialog_Boxes|Windows Open and Save Dialog Boxes]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/NEXT.txt b/internal/help/NEXT.txt index 7b0e4af3e..95afdf2ed 100644 --- a/internal/help/NEXT.txt +++ b/internal/help/NEXT.txt @@ -9,10 +9,10 @@ {{PageDescription}} -* [[NEXT]] is required in a FOR loop or a [[ERROR Codes|"FOR without NEXT" error]] will occur. +* [[NEXT]] is required in a FOR loop or a [[ERROR Codes|"FOR without NEXT" error]] will occur. * The FOR variable name is not required after [[NEXT]]. * [[NEXT]] can be grouped with other NEXTs in nested FOR loops using colons like [[NEXT]]: [[NEXT]] -* [[NEXT]] can also end more than one nested [[FOR...NEXT|FOR]] loop using comma separated variables like [[NEXT]] i, j +* [[NEXT]] can also end more than one nested [[FOR...NEXT|FOR]] loop using comma separated variables like [[NEXT]] j, i * [[NEXT]] increases the FOR loop count, so after the loop is over the counterVariable's value will be stopValue + 1 (or stopValue + increment). * [[NEXT]] is also used with the [[RESUME]] statement. @@ -24,7 +24,7 @@ FOR i = 1 TO 10 PRINT i; NEXT i -PRINT "AFTER the LOOP, NEXT makes the value of i ="; i '' '' +PRINT "AFTER the LOOP, NEXT makes the value of i ="; i '' '' {{CodeEnd}} {{OutputStart}} 1 2 3 4 5 6 7 8 9 10 AFTER the LOOP, NEXT makes the value of i = 11 @@ -38,4 +38,4 @@ PRINT "AFTER the LOOP, NEXT makes the value of i ="; i '' '' * [[RESUME|RESUME NEXT]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/NOT.txt b/internal/help/NOT.txt index bba556eba..d5e8a27f4 100644 --- a/internal/help/NOT.txt +++ b/internal/help/NOT.txt @@ -1,14 +1,15 @@ -'''NOT''' is a [[Boolean]] logical operator that will change a False statement to a True one and vise-versa. +[[NOT]] is a [[Boolean|boolean]] logical operator that will change a false statement to a true one and vice-versa. {{PageSyntax}} -:: True = -1: False = '''NOT''' True +: ''True'' = -1: ''False'' = [[NOT]] True -* In Qbasic, True = -1 and False = 0 in boolean logic and evaluation statements. -* NOT evaluates ONE value and returns the opposite. Yes, NOT 0 = -1 in Basic. +{{PageDescription}} +* In QBasic, True = -1 and False = 0 in boolean logic and evaluation statements. +* [[NOT]] evaluates a value and returns the bitwise opposite, meaning that {{InlineCode}}NOT 0 = -1{{InlineCodeEnd}}. * Often called a negative logic operator, it returns the opposite of a value as true or false. -* Values are changed by their bit values so that each bit is changed to the opposite of on or off. See example 3. +* Values are changed by their bit values so that each bit is changed to the opposite of on or off. See example 3 below. {{Template:RelationalTable}} @@ -17,11 +18,12 @@ {{Template:LogicalTruthTable}} +{{PageExamples}} ''Example 1:'' Alternating between two conditions in a program loop. {{CodeStart}}{{Cl|DO}} switch = {{Cl|NOT}} switch '{{Cl|NOT}} changes value from -1 to 0 and vice-versa {{Cl|LOCATE}} 10, 38 -{{Cl|IF}} switch {{Cl|THEN}} {{Cl|PRINT}} "True!" {{Cl|ELSE}} {{Cl|PRINT}} "False" +{{Cl|IF}} switch {{Cl|THEN}} {{Cl|PRINT}} "True!" {{Cl|ELSE}} {{Cl|PRINT}} "False" {{Cl|SLEEP}} k$ = {{Cl|INKEY$}} {{Cl|LOOP}} {{Cl|UNTIL}} k$ = {{Cl|CHR$}}(27) ' escape key quit @@ -44,7 +46,7 @@ ReadBits -6 {{Cl|SUB}} ReadBits (n {{Cl|AS}} {{Cl|INTEGER}}) 'change type value and i bit reads for other whole type values {{Cl|FOR...NEXT|FOR}} i = 15 {{Cl|TO}} 0 {{Cl|STEP}} -1 'see the 16 bit values - {{Cl|IF...THEN|IF}} n {{Cl|AND (boolean)|AND}} 2 ^ i {{Cl|THEN}} {{Cl|PRINT}} "1"; {{Cl|ELSE}} {{Cl|PRINT}} "0"; + {{Cl|IF...THEN|IF}} n {{Cl|AND (boolean)|AND}} 2 ^ i {{Cl|THEN}} {{Cl|PRINT}} "1"; {{Cl|ELSE}} {{Cl|PRINT}} "0"; {{Cl|NEXT}} {{Cl|PRINT}} {{Cl|END SUB}} '' '' @@ -54,7 +56,7 @@ ReadBits -6 0000000000000101 1111111111111010 {{OutputEnd}} -:''Explanation:'' The bit values of an [[INTEGER]] are 2 [[_BYTE]]s and each bit is an exponent of 2 from 15 to 0 (16 bits). Thus comparing the numerical value with those exponents using [[AND]] reveals the bit values as "1" for bits on or "0" for bits off as text. +:''Explanation:'' The bit values of an [[INTEGER]] are 2 [[_BYTE]]s and each bit is an exponent of 2 from 15 to 0 (16 bits). Thus comparing the numerical value with those exponents using [[AND]] reveals the bit values as "1" for bits on or "0" for bits off as text. : QB64 can use [[&B]] to convert the above [[_BIT]] values back to [[INTEGER]] or [[_BYTE]] values as shown below: {{CodeStart}}'16 bit INTEGER values from -32768 to 32767 @@ -70,11 +72,11 @@ b%% = {{Cl|&B}}11111010 {{CodeEnd}} -''See also:'' +{{PageSeeAlso}} * [[_BIT]], [[&B]], [[_BYTE]] * [[AND]], [[XOR]], [[OR]] * [[Binary]], [[Boolean]] * [[Mathematical Operations]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/Not_Equal.txt b/internal/help/Not_Equal.txt index fa80d5d5a..5c1b9ec0c 100644 --- a/internal/help/Not_Equal.txt +++ b/internal/help/Not_Equal.txt @@ -1,19 +1,19 @@ -The '''<>''' condition symbol denotes that a value must not equal another value for the condition to be True. +The '''<>''' condition symbol denotes that a value must not equal another value for the condition to be True. -''Example usage:'' IF x [[Not_Equal|<>]] 320 THEN PRINT "Not in center of screen" +''Example usage:'' IF x [[Not_Equal|<>]] 320 THEN PRINT "Not in center of screen" * Statements will evaluate as True or -1 when two values are not equal or False or 0 when equal. -* More than one <> symbol in a numerical statement will create a [[Boolean]] evaluation of the ensuing numerical pairs. +* More than one <> symbol in a numerical statement will create a [[Boolean]] evaluation of the ensuing numerical pairs. ''See also:'' * [[Equal|=]] -* [[Greater_Than|>]] +* [[Greater_Than|>]] * [[Less_Than|<]] * [[Relational Operations]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/OCT$.txt b/internal/help/OCT$.txt index a455a680f..4cd5d1d09 100644 --- a/internal/help/OCT$.txt +++ b/internal/help/OCT$.txt @@ -1,32 +1,30 @@ -The {{KW|OCT$}} function returns the base 8 octal representation of an [[INTEGER]], [[LONG]] or [[_INTEGER64]] value as a [[STRING]]. +The [[OCT$]] function returns the base-8 octal representation of an [[INTEGER]], [[LONG]] or [[_INTEGER64]] value as a [[STRING]]. {{PageSyntax}} -:''result$'' = {{KW|OCT$}}({{Parameter|number}}) +: {{Parameter|result$}} = [[OCT$]]({{Parameter|number}}) {{PageDescription}} -* The {{KW|OCT$}} function returns the octal (base-8) representation of {{Parameter|number}}. +* The [[OCT$]] function returns the octal (base-8) representation of {{Parameter|number}}. * {{Parameter|number}} can be any integer value. * No leading space is returned. -* [[VAL]] can convert octal string values to decimal when the "&O" prefix is added. - - -Example:'' Outputs all of the decimal, hexadecimal and octal digits: +* [[VAL]] can convert octal string values to decimal when the "&O" prefix is added. +{{PageExamples}} +''Example:'' Outputs all of the decimal, hexadecimal and octal digits: {{CodeStart}} - -LOCATE 2, 20: PRINT " Decimal | Hexadecimal | Octal " -LOCATE 3, 20: PRINT "---------+-------------+-------" - template$ = " ## | \\ | ## " +LOCATE 2, 20: PRINT " Decimal | Hexadecimal | Octal " +LOCATE 3, 20: PRINT "---------+-------------+-------" + template$ = " ## | \\ | ## " FOR n% = 0 TO 15 LOCATE 4 + n%, 20: {{Cl|PRINT USING}} template$; n%; {{Cl|HEX$}}(n%); VAL({{Cl|OCT$}}(n%)) NEXT n% {{CodeEnd}} -: ''Note:'' The actual Octal value is converted by [[VAL]] directly back to a numerical value by '''not using''' the "&H" prefix. +: ''Note:'' The actual octal value is converted by [[VAL]] directly back to a numerical value by '''not using''' the "&H" prefix. {{OutputStart}} Decimal | Hexadecimal | Octal @@ -56,4 +54,4 @@ NEXT n% * [[Base Comparisons]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/OFF.txt b/internal/help/OFF.txt index b9457c7d9..7836216dc 100644 --- a/internal/help/OFF.txt +++ b/internal/help/OFF.txt @@ -1,17 +1,14 @@ -'''OFF''' is a flag disabling trap for [[KEY(n)]], [[ON COM (n)|COM(n)]], [[PEN]], [[PLAY]], [[STRIG(n)]], [[TIMER]], [[UEVENT]] +[[OFF]] is a flag that disables event-trappping for [[KEY(n)]], [[ON COM (n)|COM(n)]], [[PEN]], [[PLAY]], [[STRIG(n)]], [[TIMER]], [[UEVENT]]. -* OFF can be used to turn off the display of soft-key assignments at the bottom of the screen using [[KEY]]. -* OFF can also be used to disable an event trapping in the following statements: [[KEY(n)]], [[ON COM (n)|COM(n)]], [[PEN]], [[PLAY]], [[STRIG(n)]], [[TIMER]], [[UEVENT]]. The trap can be turned back [[ON]], but does not retain any events since '''OFF''' was used. -* [[$CHECKING]]:'''OFF''' is used to disable c++ error trapping, make sure that your code is flawless before using this metacommand, '''can cause a General Protection Fault''' if there are errors in the code. +{{PageDescription}} +* [[OFF]] can be used to turn off the display of soft-key assignments at the bottom of the screen using [[KEY]]. +* [[OFF]] can also be used to disable an event-trapping in the following statements: [[KEY(n)]], [[ON COM (n)|COM(n)]], [[PEN]], [[PLAY]], [[STRIG(n)]], [[TIMER]], [[UEVENT]]. The trap can be turned back [[ON]], but all events triggered since [[OFF]] was used are lost. +* [[$CHECKING]]:'''OFF''' is used to disable C++ error trapping (used for verified sections of code that require speed). -''See also:'' [[ON]], [[STOP]], [[KEY]], [[KEY(n)]], [[$CHECKING]] +{{PageSeeAlso}} +* [[ON]], [[STOP]], [[KEY]], [[KEY(n)]], [[$CHECKING]] - -==Navigation:== - -[[Keyword_Reference_-_Alphabetical|Go to Keyword Reference - Alphabetical]] - -[[Keyword Reference - By usage|Go to Keyword Reference - By usage]] \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/ON...GOSUB.txt b/internal/help/ON...GOSUB.txt index 908876a36..31d0fd5da 100644 --- a/internal/help/ON...GOSUB.txt +++ b/internal/help/ON...GOSUB.txt @@ -1,35 +1,40 @@ -'''ON...GOSUB''' is a control-flow statement that branches to a line or label in a list depending on a numerical expression. +[[ON...GOSUB]] is a control-flow statement that branches to a line or label in a list depending on a numerical expression. {{PageSyntax}} -:: '''ON''' ''numerical-expression'' '''GOSUB''' ''lineornumber[,lineornumber][,...]'' +: '''ON''' {{Parameter|numericalExpression}} [[GOSUB]] {{Parameter|labelOrNumber}}[,{{Parameter|labelOrNumber}}][,...] -* The ''numerical-expression represents'' the ''line'' or ''label'' that it should branch to, 1 branches to the first line or label, 2 branches to the second, etc. -* In QB 4.5 the list can contain a maximum of 60 line numbers or labels, while QB64 has no limit. -* The procedure must be used after the number value is determined or in a loop to monitor current user events. -* [[RETURN]] returns to the next code statement after the ON...GOSUB statement. [[END]] or [[SYSTEM]] can be used to end program. +{{PageDescription}} +* {{Parameter|numericalExpression}} represents the ''line'' or ''label'' that the program should branch to: 1 branches to the first line or label in the list, 2 branches to the second, etc. +* The procedure must be used after the number value is determined or in a loop to monitor current user events. +* [[RETURN]] returns to the next code statement after the [[ON...GOSUB]] statement. [[END]] or [[SYSTEM]] can be used to end program. * '''Note:''' [[SELECT CASE]] provides a much more convenient way of doing this task. +==QBasic/QuickBASIC== +* In QuickBASIC 4.5 the list could contain a maximum of 60 line numbers or labels, while '''QB64''' has no limit. + + +{{PageExamples}} ''Example:'' {{CodeStart}} '' '' {{Cl|CLS}} a = 2 ''ON'' a '''GOSUB''' hello, hereweare, 143 -{{Cl|PRINT}} "Also notice the RETURN statement that can be used with GOSUB!" +{{Cl|PRINT}} "Also notice the RETURN statement that can be used with GOSUB!" {{Cl|END}} hello: -{{Cl|PRINT}} "Hello, with a = 1 you get to see this!" +{{Cl|PRINT}} "Hello, with a = 1 you get to see this!" {{Cl|END}} hereweare: -{{Cl|PRINT}} "with a = 2 here we are...return to line after ON." +{{Cl|PRINT}} "with a = 2 here we are...return to line after ON." {{Cl|RETURN}} 143 -{{Cl|PRINT}} "Line 143, with a = 3 you get to see this!" +{{Cl|PRINT}} "Line 143, with a = 3 you get to see this!" {{Cl|END}} '' '' {{CodeEnd}} {{OutputStart}} @@ -37,13 +42,13 @@ with a = 2 here we are...return to line after ON. Also notice the RETURN statement that can be used with GOSUB! {{OutputEnd}} -:''Explanation:'' Since a equals to 2 it goes to the second item in the list (hereweare) and branches the program to there. Try changing 'a' to 1 or 3! +:''Explanation:'' Since ''a'' equals to 2 it goes to the second item in the list (''hereweare'') and branches the program to there. Try changing 'a' to 1 or 3. -''See also:'' +{{PageSeeAlso}} * [[ON...GOTO]] * [[GOSUB]], [[GOTO]] * [[SELECT CASE]], [[RETURN]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/ON...GOTO.txt b/internal/help/ON...GOTO.txt index 8265e383d..1b66d3347 100644 --- a/internal/help/ON...GOTO.txt +++ b/internal/help/ON...GOTO.txt @@ -1,15 +1,21 @@ -ON...GOTO is a control-flow statement that branches to a line number or label in a list depending on a numerical expression's value. +[[ON...GOTO]] is a control-flow statement that branches to a line or label in a list depending on a numerical expression. {{PageSyntax}} -:: '''ON''' numerical-expression '''GOTO''' lineornumber[,lineornumber][,...] +: '''ON''' {{Parameter|numericalExpression}} [[GOTO]] {{Parameter|labelOrNumber}}[,{{Parameter|labelOrNumber}}][,...] -* The numerical-expression represents the line or label that it should branch to, 1 branches to the first line or label, 2 branches to the second, etc. -*In QB 4.5 the list can contain a maximum of 60 lines or labels, while there is no limit in QB64. +{{PageDescription}} +* {{Parameter|numericalExpression}} represents the ''line'' or ''label'' that the program should branch to: 1 branches to the first line or label in the list, 2 branches to the second, etc. * The procedure must be used after the number value is determined or in a loop to monitor current user events. +* '''Note:''' [[SELECT CASE]] provides a much more convenient way of doing this task. +==QBasic/QuickBASIC== +* In QuickBASIC 4.5 the list could contain a maximum of 60 line numbers or labels, while '''QB64''' has no limit. + + +{{PageExamples}} ''Example:'' Changing the program flow when a value is not 0. {{CodeStart}} '' '' {{Cl|CLS}} @@ -17,28 +23,27 @@ a = 2 {{Cl|ON...GOTO|ON a GOTO}} hello, hereweare, 143 {{Cl|END}} hello: -{{Cl|PRINT}} "you don't get to see this!" +{{Cl|PRINT}} "you don't get to see this!" {{Cl|END}} hereweare: -PRINT "And here we are..." +PRINT "And here we are..." END 143 -PRINT "you don't get to see this neither..." +PRINT "you don't get to see this neither..." END '' '' {{CodeEnd}} {{OutputStart}} And here we are... {{OutputEnd}} -''Explanation:'' Since a equals 2 it goes to the second item in the list (hereweare) and branches to there. Try changing 'a' to 1 or 3! -<center>''Note:'' [[SELECT CASE]] provides a much more convenient way of doing this task.</center> +''Explanation:'' Since ''a'' equals 2 it goes to the second item in the list (hereweare) and branches to there. Try changing ''a' to 1 or 3. -''See also:'' +{{PageSeeAlso}} * [[ON...GOSUB]] * [[GOTO]] * [[GOSUB]] * [[SELECT CASE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/ON_COM(n).txt b/internal/help/ON_COM(n).txt index b1d57936b..2bcaea949 100644 --- a/internal/help/ON_COM(n).txt +++ b/internal/help/ON_COM(n).txt @@ -1,20 +1,19 @@ -''This page is maintained for historic purposes. The functionality described below has not been implemented in QB64.'' +'''This page is maintained for historic purposes. The keyword is not supported in QB64.''' ---- - -ON COM(n) branches to a line number or label when there is a value in the serial port specified. +[[ON COM(n)]] branches to a line number or label when there is a value in the serial port specified. {{PageSyntax|}} -:{{KW|ON COM(n)}} {{Parameter|GOSUB}} {linenumber|label} +:[[ON COM(n)]] [[GOSUB]] {''linenumber''|''label''} {{PageDescription}} -*'''[[Keywords currently not supported by QB64|Not implemented in QB64!]]''' -* n can be 1 or 2 and is the number of the serial port that is tested. -* If a value exists in the port then the program branches to the linenumber or label specified. +*'''[[Keywords currently not supported by QB64|Not implemented in QB64]]''' +* ''n'' can be 1 or 2 (the number of the serial port that is tested). +* If a value exists in the port then the program branches to the ''linenumber'' or ''label'' specified. * The event handler must first be activated with [[COM|COM(n) ON]] @@ -26,4 +25,4 @@ ON COM(n) branches to a line number or label when there is a value in the serial * [[Windows_Libraries#Windows_Ports|Enumerating Windows Ports]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/ON_ERROR.txt b/internal/help/ON_ERROR.txt index 0dedc90c7..7531fa5d7 100644 --- a/internal/help/ON_ERROR.txt +++ b/internal/help/ON_ERROR.txt @@ -1,34 +1,35 @@ -'''ON ERROR''' is used with [[GOTO]] to designate a way to handle a program error. - +[[ON ERROR]] is used with [[GOTO]] to handle errors in a program. {{PageSyntax}} -:: ON ERROR GOTO {linenumber| linelabel} +: [[ON ERROR]] [[GOTO]] {''lineNumber''|''lineLabel''} -* ON ERROR statements can be in the main module code or in [[SUB]] or [[FUNCTION]] procedures. -* ON ERROR statements take precedence in the order they are encountered. It will also handle any subroutine errors! -* Use a [[GOTO]] line label or line number in the main module assigned to clean up or ignore an error. -* '''ON ERROR GOTO 0''' can be used to ignore an error without an error handling procedure. +{{PageDescription}} +* An ''untreated error'' in a program will cause execution to stop and an error message is displayed to the user, who can choose to continue (ignore the error - which could have unexpected results) or end the program. +* Use [[ON ERROR]] when your program performs operations that are likely to generate errors, like file access operations. +* [[ON ERROR]] statements can be in the main module code or in [[SUB]] or [[FUNCTION]] procedures. +* [[ON ERROR]] statements take precedence in the order they are encountered. It will also handle any subroutine errors. +* '''ON ERROR GOTO 0''' can be used to disable custom [[ON ERROR]] trapping and give default error messages. * A subsequent ON ERROR statement will override the previous one. -* [[GOTO]] is required in the statement. Cannot use [[GOSUB]] ! -* Comment out ON ERROR to find specific error locations. QB64 can return the file line position with [[_ERRORLINE]] -* Note: QB64 does NOT support the PDS(QuickBasic 7) ON ERROR RESUME NEXT statement! - +* [[GOTO]] is required in the statement. Cannot use [[GOSUB]]. +* Comment out [[ON ERROR]] to find specific error locations. QB64 can return the file line position with [[_ERRORLINE]] +* Note: QB64 does not support the PDS (QuickBASIC 7) '''ON ERROR RESUME NEXT''' statement. +{{PageExamples}} ''Example 1:'' Using an error handler that ignores any error. {{CodeStart}} '' '' {{Cl|ON ERROR}} {{Cl|GOTO}} Errhandler ' Main module program error simulation code {{Cl|ERROR}} 7 ' simulate an Out of Memory Error - PRINT "Error handled...ending program" + PRINT "Error handled...ending program" {{Cl|SLEEP}} 4 {{Cl|SYSTEM}} ' end of program code Errhandler: 'error handler sub program line label - PRINT "Error"; {{Cl|ERR}}; "on program file line"; {{Cl|_ERRORLINE}} + PRINT "Error"; {{Cl|ERR}}; "on program file line"; {{Cl|_ERRORLINE}} {{Cl|BEEP}} ' warning beep {{Cl|RESUME}} NEXT ' moves program to code following the error. '' '' {{CodeEnd}} @@ -46,24 +47,25 @@ s {{Cl|END}} hand: -{{Cl|PRINT}} "got error!" +{{Cl|PRINT}} "got error!" {{Cl|RESUME}} {{Cl|NEXT}} {{Cl|SUB}} s {{Cl|ON ERROR}} {{Cl|GOTO}} hand {{Cl|ERROR}} 1 {{Cl|ON ERROR}} {{Cl|GOTO}} 0 -{{Cl|PRINT}} "Done!" +{{Cl|PRINT}} "Done!" {{Cl|END SUB}} '' '' {{CodeEnd}} : ''Explanation:'' The [[GOTO]] procedure must be in the main code area after [[END]] to avoid a [[RESUME]] error later. Use GOTO 0 to clear the ON ERROR set in the sub so that later errors are not handled by it. -''See also:'' +{{PageSeeAlso}} * [[ERR]], [[ERL]], [[RESUME]] -* [[ON...GOTO]], [[_ERRORLINE]] +* [[ON...GOTO]] +* [[_ERRORLINE]], [[_INCLERRORLINE]], [[_INCLERRORFILE$]] * [[ERROR]] {{text|(simulates an error)}} * [[ERROR Codes]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/ON_KEY(n).txt b/internal/help/ON_KEY(n).txt index 350c8a689..fe98dab5b 100644 --- a/internal/help/ON_KEY(n).txt +++ b/internal/help/ON_KEY(n).txt @@ -1,30 +1,32 @@ -The '''ON KEY(n)''' statement defines a line number or label to go to when a specified key is pressed. QB64 can reference a [[SUB]]. +The [[ON KEY(n)]] statement defines a line number or label to go to (or a [[SUB]] to run) when a specified key is pressed. {{PageSyntax}} -:: ON KEY(n) {{{KW|GOSUB}} {''linelabel''|''linenumber''}|{{KW|SUB}}procedure} +: [[ON KEY(n)]] [[GOSUB]] {{Parameter|linelabel}}|{{Parameter|linenumber}} +: [[ON KEY(n)]] [[SUB]]procedure +{{PageDescription}} * Predefined and user defined KEY event number assignments to use with ON KEY(n): {{WhiteStart}} '''1 to 10'''.............Reserved '''F1 to F10''' function keys only. '''11, 12, 13 and 14'''...Reserved '''Up, Left, Right and Down''' numeric keypad arrows only - '''15 to 29'''............'''user-defined keys''' using value: [[CHR$]](keyflag) + [[CHR$]]([[Keyboard scancodes|scancode]]) + '''15 to 29'''............'''user-defined keys''' using value: [[CHR$]](keyflag) + [[CHR$]]([[Keyboard scancodes|scancode]]) '''30 and 31'''...........Reserved '''F11 and F12''' function keys only. {{WhiteEnd}} * See the [[KEY n]] page for user defined key or key combination presses and F function softkey assignments. -* [[GOSUB]] with a ''linelabel'' or ''linenumber'' or a [[SUB]] procedure can be used in '''QB64'''. Don't use [[CALL]]! - +* [[GOSUB]] with a {{Parameter|linelabel}} or {{Parameter|linenumber}} or a [[SUB]] procedure (without the [[CALL]] keyword) can be triggered in '''QB64'''. +{{PageExamples}} ''Example 1:'' Using ON KEY with [[GOSUB]] to execute code. {{CodeStart}} '' '' {{Cl|KEY(n)|KEY(1) ON}} {{Cl|ON KEY(n)|ON KEY}}(1) {{Cl|GOSUB}} trap -{{Cl|PRINT}} "Press F1 to quit!" +{{Cl|PRINT}} "Press F1 to quit!" {{Cl|DO}}:{{Cl|LOOP}} 'never ending loop trap: -{{Cl|PRINT}} "You pressed F1 like I told you to :)" +{{Cl|PRINT}} "You pressed F1 like I told you to :)" {{Cl|END}} {{Cl|RETURN}} '' '' {{CodeEnd}} @@ -40,22 +42,21 @@ trap: {{Cl|NEXT}} {{Cl|KEY n|KEY}} ON 'displays F1 to F10 soft key assignments at bottom of screen -DO - +{{Cl|DO}} {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) {{Cl|END}} {{Cl|SUB}} Funct (num%) {{Cl|CLS}}' clears the screen and refreshes bottom soft key list -{{Cl|PRINT}} "You pressed F"; {{Cl|LTRIM$}}({{Cl|STR$}}(num%)) +{{Cl|PRINT}} "You pressed F"; {{Cl|LTRIM$}}({{Cl|STR$}}(num%)) {{Cl|END SUB}} '' '' {{CodeEnd}} -''See also:'' +{{PageSeeAlso}} * [[KEY(n)]], [[KEY n]] {{text|(soft key)}} * [[ON...GOSUB]], [[Scancodes]] * [[_KEYHIT]], [[_KEYDOWN]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/ON_PEN.txt b/internal/help/ON_PEN.txt index 2718ed9d7..cfd68ae91 100644 --- a/internal/help/ON_PEN.txt +++ b/internal/help/ON_PEN.txt @@ -1,26 +1,24 @@ -''This page is maintained for historic purposes. The keyword is not supported in QB64.'' - +'''This page is maintained for historic purposes. The keyword is not supported in QB64.''' ---- - -'''ON PEN''' enables event handling for the lightpen. +[[ON PEN]] enables event handling for the ''light pen''. {{PageSyntax}} -:: ON PEN GOSUB labelorline +: [[ON PEN]] [[GOSUB]] {{Parameter|lineLabel}} | {{Parameter|lineNumber}} -''Description:'' +{{PageDescription}} *'''[[Keywords currently not supported by QB64|Not supported in QB64.]]''' -* Any activity on the lightpen will cause the program to branch to the specified labelorline. +* Any activity on the lightpen will cause the program to branch to the specified {{Parameter|lineLabel}} or {{Parameter|lineNumber}}. * [[PEN (statement)|PEN]] [[ON]] enables or resumes event trapping. * [[PEN (statement)|PEN]] [[OFF]] disables event trapping and event logging. * [[PEN (statement)|PEN]] [[STOP]] temporarily suspends event trapping. When resumed again by [[PEN (statement)|PEN]] [[ON]]), may report events while suspended. -''See also:'' +{{PageSeeAlso}} * [[PEN]] (function), [[PEN (statement)]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/ON_PLAY(n).txt b/internal/help/ON_PLAY(n).txt index 160331117..5bd73604b 100644 --- a/internal/help/ON_PLAY(n).txt +++ b/internal/help/ON_PLAY(n).txt @@ -1,23 +1,21 @@ -''This page is maintained for historic purposes. The keyword is not supported in QB64.'' - +'''This page is maintained for historic purposes. The keyword is not supported in QB64.''' ---- - -'''ON PLAY (n)''' is a event-trapping statement that specifies the line-number or label to branch to when the background music queue has too few notes. +[[ON PLAY(n)]] is an event-trapping statement that specifies the line-number or label to branch to when the background music queue has too few notes. {{PageSyntax}} -:: ON PLAY (''queuelimit'') [[GOSUB]] {''linelabel'' | ''linenumber''} +: '''ON PLAY''' ({{Parameter|queueLimit}}) [[GOSUB]] {{{Parameter|lineLabel}} | {{Parameter|lineNumber}}} -''Description:'' +{{PageDescription}} *'''[[Keywords currently not supported by QB64|Not supported in QB64.]]''' * You can use PLAY ON, PLAY OFF and PLAY STOP to resume event-trapping, disable it, or stop it (resumes with PLAY ON). -''See also:'' +{{PageSeeAlso}} * [[PLAY]], [[PLAY(n)]], [[ON...GOSUB]] +* [[_SNDRAW]], [[_SNDRAWLEN]] - -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/ON_STRIG(n).txt b/internal/help/ON_STRIG(n).txt index 44df57b56..8f4978ffd 100644 --- a/internal/help/ON_STRIG(n).txt +++ b/internal/help/ON_STRIG(n).txt @@ -1,34 +1,35 @@ -The '''ON STRIG(n)''' statement is an event procedure that directs program flow upon the press of a specified joystick button. +The [[ON STRIG(n)]] statement is an event procedure that directs program flow upon the press of a specified joystick button. {{PageSyntax}} -:: ON STRIG(''button_function'') GOSUB {linenumber|linelabel} +: '''ON STRIG'''({{Parameter|buttonFunction}}) [[GOSUB]] {{{Parameter|lineNumber}}|{{Parameter|lineLabel}}} - -QB64 {{PageSyntax}} - -:: ON STRIG(''button_function''[, ''joystick_number'']) {GOSUB {linelabel|linenumber}|sub-procedure} +: '''ON STRIG'''({{Parameter|buttonFunction}}[, {{Parameter|joystickNumber}}]) {[[GOSUB]] {{{Parameter|lineNumber}}|{{Parameter|lineLabel}}} | [[SUB]]procedure} * In '''QB64''' the value can be any button function number with any number of joysticks. See [[STRIG]] and [[STICK]] for parameters. -* In Qbasic, value of ''n'' can be a number from 0 to 3 only as it can only monitor 2 joystick buttons and 2 joysticks. -* There are two ''button functions'' for each button. The even numbered function is always the event of any press since last read. -* The statement sends the procedure to a line number, [[SUB]] or [[GOSUB]] procedure or line number when a button event occurs. +* There are two {{Parameter|buttonFunction}} for each button. The even numbered function is always the event of any press since last read. +* The statement sends the procedure to a line number, line label or [[SUB]] procedure when a button event occurs. +==QBasic/QuickBASIC== +* In QBasic, value of ''n'' could only be a number from 0 to 3 only as it could only monitor 2 joystick buttons and 2 joysticks. + + +{{PageExamples}} ''Example 1:'' Reading a STRIG event to do something in a [[GOSUB]] procedure. {{CodeStart}} '' '' {{Cl|ON STRIG(n)|ON STRIG}}(0) {{Cl|GOSUB}} 10 {{Cl|STRIG(n)|STRIG}}(0)ON {{Cl|DO...LOOP|DO}} - {{Cl|PRINT}} "."; + {{Cl|PRINT}} "."; {{Cl|_LIMIT}} 30 -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" {{Cl|END}} 10 -a$ = "[STRIG 0 EVENT]" +a$ = "[STRIG 0 EVENT]" {{Cl|FOR...NEXT|FOR}} x = 1 {{Cl|TO}} {{Cl|LEN}}(a$) {{Cl|PRINT}} {{Cl|MID$}}(a$, x, 1); {{Cl|_DELAY}} 0.02 @@ -47,23 +48,26 @@ a$ = "[STRIG 0 EVENT]" {{Cl|STRIG(n)|STRIG}} ON {{Cl|DO...LOOP|DO}} - {{Cl|PRINT}} "."; + {{Cl|PRINT}} "."; {{Cl|_LIMIT}} 30 -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" {{Cl|END}} {{Cl|SUB}} JoyButton (js {{Cl|AS}} {{Cl|LONG}}) -{{Cl|PRINT}} "Joystick #"; js \ 256 + 1; "button #"; (js {{Cl|AND (boolean)|AND}} 255) + 1; "pressed!" +{{Cl|PRINT}} "Joystick #"; js \ 256 + 1; "button #"; (js {{Cl|AND (boolean)|AND}} 255) + 1; "pressed!" {{Cl|END SUB}} '' '' {{CodeEnd}} :''Explanation:'' Up to 256 controllers can be used in QB64 with many buttons to read. -''See also:'' +{{PageSeeAlso}} * [[STRIG ]], [[STICK]] {{text|(functions)}} * [[STRIG(n)]] {{text|(statement)}} * [[_DEVICES]], [[_DEVICE$]], [[_LASTBUTTON]] + + +===External links=== * [http://en.wikipedia.org/wiki/Analog_stick Single and Dual Stick Controllers] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/ON_TIMER(n).txt b/internal/help/ON_TIMER(n).txt index 80827015c..b50094f25 100644 --- a/internal/help/ON_TIMER(n).txt +++ b/internal/help/ON_TIMER(n).txt @@ -1,45 +1,42 @@ -The '''ON TIMER''' statement sets up a timed event to be repeated at specified intervals throughout a program when enabled. +The [[ON_TIMER(n)|ON TIMER]] statement sets up a timed event to be repeated at specified intervals throughout a program when enabled. -''Qbasic'' {{PageSyntax}} -::: ON TIMER(seconds%) GOSUB {linelabel|linenumber} +{{PageSyntax}} +: '''ON TIMER'''({{Parameter|seconds%}}) [[GOSUB]] {{{Parameter|lineLabel}}|{{Parameter|lineNumber}}} +: '''ON TIMER'''([{{Parameter|number%}},] {{Parameter|seconds!}}) { [[SUB]]procedure | [[GOSUB]] {{{Parameter|lineLabel}}|{{Parameter|lineNumber}}} } -''QB64'' {{PageSyntax}} -::: ON TIMER([''number%'',] ''seconds!'') {SubProcedure|GOSUB {''linelabel''|''linenumber''}} +{{PageDescription}} +===Legacy syntax=== +* In the first syntax, the [[INTEGER]] {{Parameter|seconds%}} parameter can be from 1 to 86400 seconds (one day). +* A [[TIMER (statement)|TIMER ON]] statement must follow an '''ON TIMER''' event setup to initiate it. +* [[TIMER (statement)|TIMER STOP]] disables timer events but remembers previous events when enabled again by a [[TIMER (statement)|TIMER ON]] statement, and the recorded events may be executed immediately if a timer event has occurred. +* [[TIMER (statement)|TIMER OFF]] disables timer event trapping. Events will not be remembered in a subsequent [[TIMER (statement)|TIMER ON]] statement. +* '''ON TIMER''' events will interrupt a [[SLEEP]] call and [[RETURN]] to running program procedures. +* Only one TIMER event can be set at a time using this legacy syntax and all TIMER code must be in the main code, as it uses [[GOSUB]]. - -''Description'' -<center> '''QBasic Information''' </center> - -* In Qbasic the [[INTEGER]] ''seconds''' parameter can be from 1 to 86400 seconds(one day). -* A [[TIMER (statement)|TIMER ON]] statement must be made before an ON TIMER event is enabled in QB or QB64. -* [[TIMER (statement)|TIMER STOP]] remembers previous events when enabled by a TIMER ON statement and the ON TIMER statement(s) may be executed immediately if a timer event has occurred. -* [[TIMER (statement)|TIMER OFF]] disables timer event trapping. Events will not be remembered in a subsequent ON TIMER statement. -* ON TIMER events will interrupt a [[SLEEP]] call and [[RETURN]] to running program procedures. -* Qbasic can only use one TIMER event at a time and all TIMER code MUST be in the main code. - - -<center> '''QB64 Specific Information''' </center> -* Can use multiple numbered timer events and [[SINGLE]] floating point second values down to one millisecond(.001). -* '''MUST use the [[_FREETIMER]] function''' to assign free timer numbers. Use specific variables or an array to store the TIMER values. -* If the TIMER number is omitted or ON TIMER(0, seconds!) is used, the TIMER used is the base timer. '''The base TIMER cannot be freed!''' No number reference can also be used to keep QB64 compatible with older Qbasic code. -* [[GOSUB]] or [[SUB]] procedures are allowed to be referenced, however [[CALL]] CANNOT be used. -* '''[[SUB]] parameter values are passed by value and should be [[SHARED]] or literal values!''' -* Specific TIMER events can be turned on, suspended, turned off or freed using [[TIMER (statement)|TIMER(n)]] ON, STOP, OFF or FREE. +===QB64 syntax=== +* '''QB64''' can use multiple numbered timer events and [[SINGLE]] floating point second values down to one millisecond (.001). +* The '''TIMER''' {{Parameter|number%}} must be obtained from the [[_FREETIMER]] function. Store _FREETIMER numbers in a variable or an array to be able to reference them later. +* If the '''TIMER''' number is omitted or {{InlineCode}}'''ON TIMER'''(0, {{Parameter|seconds!}}){{InlineCodeEnd}} is used, then the TIMER used is the ''base TIMER'' (same as in the legacy syntax above). +* [[SUB]] procedures are allowed to be referenced, but [[CALL]] must not be used. +* '''[[SUB]] parameter values are passed by value and should be [[SHARED]] or literal values.''' +* Specific '''TIMER''' events can be turned on, suspended, turned off or freed using [[TIMER (statement)|TIMER(n)]] ON, STOP, OFF or FREE. * Use '''TIMER(n) FREE''' to release a timer event after it has been turned off or is no longer used. +** The ''base TIMER'' cannot be freed. * '''QB64''' allows TIMER statements to also be inside of SUB and FUNCTION procedures. -* Does not currently interrupt [[SLEEP]] or [[_DELAY]] calls. -* [[$CHECKING]]:OFF can disable QB64 event checking. '''Use it ONLY with errorless code that needs every CPU cycle!''' +* '''ON TIMER''' events will interrupt a [[SLEEP]] call and [[RETURN]] to running program procedures. +* [[$CHECKING]]:OFF can disable all QB64 event checking. '''Setting $CHECKING:OFF is only designed for 100% stable, error-less sections of code, where every CPU cycle saved counts.''' -<center>'''QB64 Timing Alternatives'''</center> +==QB64 Timing Alternatives== * The [[TIMER]] function can be used to find timed intervals down to 1 millisecond(.001) accuracy. * The [[_DELAY]] statement can be used to delay program execution for intervals down to milliseconds. * [[_LIMIT]] can slow down loops to a specified number of frames per second. This can also alleviate a program's CPU usage. +{{PageExamples}} ''Example:'' Using a numbered TIMER to check the mouse button press status in '''QB64'''. {{CodeStart}} '' '' {{Cl|DIM}} {{Cl|SHARED}} Button {{Cl|AS}} {{Cl|LONG}} 'share variable value with Sub @@ -51,7 +48,7 @@ t1 = _{{Cl|TIMER (statement)|FREE}}{{Cl|TIMER}} 'get a timer number DO {{Cl|LOCATE}} 1, 1 {{Cl|IF...THEN|IF}} Button {{Cl|THEN}} - {{Cl|PRINT}} "Mouse button"; Button; "is pressed."; + {{Cl|PRINT}} "Mouse button"; Button; "is pressed."; {{Cl|ELSE}} {{Cl|PRINT}} {{Cl|SPACE$}}(70) {{Cl|END IF}} {{Cl|_DISPLAY}} @@ -76,7 +73,7 @@ DO {{PageSeeAlso}} * [[TIMER]], [[_FREETIMER]] * [[TIMER (statement)]], [[_DELAY]], [[_LIMIT]] -* [[$CHECKING]] {{text|(QB64 C++ [[Metacommand]])}} +* [[$CHECKING]] {{text|(QB64 [[Metacommand]])}} -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/ON_UEVENT.txt b/internal/help/ON_UEVENT.txt index 48dde2527..152cf4635 100644 --- a/internal/help/ON_UEVENT.txt +++ b/internal/help/ON_UEVENT.txt @@ -1,21 +1,23 @@ -''This page is maintained for historic purposes. The keyword is not supported in QB64.'' +#REDIRECT [[Keywords currently not supported by QB64]] +'''This page is maintained for historic purposes. The keyword is not supported in QB64.''' ---- - -The '''ON UEVENT''' statement allows a program to use a user defined event procedure. +The [[ON UEVENT]] statement allows a program to use a user defined event procedure. {{PageSyntax}} -:: ON UEVENT GOSUB {linenumber | linelabel} +: [[ON UEVENT]] [[GOSUB]] {{{Parameter|lineNumber}} | {{Parameter|lineLabel}}} -*'''[[Keywords currently not supported by QB64|Not supported in QB64.]] NOTE: UEVENT procedures were only available in QuickBasic or PDS.''' -* Any language(including assembly) compiler that can create interrupt service routines and uses code that can be linked with QuickBasic may be used. -* Linenumber or linelabel argument is the line number or label of a [[GOSUB]] routine. -* Allows your program to go to an event-handling routine when a user-defined event(often a hardware interrupt) occurs. +{{PageDescription}} +*'''[[Keywords currently not supported by QB64|Not supported in QB64.]]''' +* UEVENT procedures were only available in QuickBASIC or PDS. +* Any language(including assembly) compiler that can create interrupt service routines and uses code that can be linked with QuickBASIC may be used. +* {{Parameter|lineNumber}} or {{Parameter|lineLabel}} is the line number or label of a [[GOSUB]] routine. +* Allows your program to go to an event-handling routine when a user-defined event (often a hardware interrupt) occurs. * Once events have been defined with an ON event statement, they act like interrupts. * When [[UEVENT]] ON has been executed, the user-defined event can send the program to a GOSUB routine. * At least two or three code procedures are needed to set up the user-defined event. @@ -24,7 +26,7 @@ The '''ON UEVENT''' statement allows a program to use a user defined event proce :# The second is a routine to insert the address of the service routine into the interrupt vector table.(optional) :# The third is the GOSUB routine your program calls to retrieve the data or do another procedure. -* If the initialization routine "steals" an interrupt used by another service routine, the original address MUST be restored before the program terminates. +* If the initialization routine "steals" an interrupt used by another service routine, the original address MUST be restored before the program terminates. * Steps in creating a user-defined event: @@ -35,33 +37,33 @@ The '''ON UEVENT''' statement allows a program to use a user defined event proce * When the specified interrupt occurs, the execution is transferred to the interrupt service routine. The service routine collects and stores the data the user wants. It then calls '''SetUEvent'''. SetUEvent sets a flag checked by QuickBasic before going to the next code statement(or label if using BC.EXE compiler option /W instead of /V ). When the flag is set, control transfers to the event-handling routine in ON EVENT GOSUB. -* The '''SetUEvent''' procedure is a part of QuickBasic, and is included in compiled programs or when the QuickBasic IDE is run with the /L command-line option. Your interrupt service routine must [[CALL]] SetUEvent. +* The '''SetUEvent''' procedure is a part of QuickBasic, and is included in compiled programs or when the QuickBASIC IDE is run with the /L command-line option. Your interrupt service routine must [[CALL]] SetUEvent. -* If you want to return a value, you must write a procedure for your program to call. (It would usually be called by your event-handling routine.) The function MUST be [[DECLARE]]d! +* If you want to return a value, you must write a procedure for your program to call. (It would usually be called by your event-handling routine.) The function must be [[DECLARE]]d. * Although ON UEVENT GOSUB ties an event-handling routine to a user-defined event, it does not enable the event trap. The [[UEVENT]] statement is used to enable, disable, and suspend user-defined event trapping. -<center>(C) Microsoft Corporation 1988</center> +<center>(C) Microsoft Corporation 1988</center> ''Example:'' A simple user defined event. {{CodeStart}} '' '' {{Cl|ON UEVENT}} {{Cl|GOSUB}} Twenty ' set the procedure to enable {{Cl|UEVENT}} ON ' turn on event handling -{{Cl|INPUT}} "Enter a number: ", entry +{{Cl|INPUT}} "Enter a number: ", entry {{Cl|IF...THEN|IF}} entry = 20 {{Cl|THEN}} {{Cl|CALL}} SetUEvent ' trigger the event {{Cl|END}} Twenty: -{{Cl|PRINT}} "The user entered twenty!" +{{Cl|PRINT}} "The user entered twenty!" {{Cl|RETURN}} ' once an event is handled, return to last program procedure '' '' {{CodeEnd}} -''See also:'' +{{PageSeeAlso}} * [[UEVENT]] * [[ON TIMER(n)]] * [[ON KEY(n)]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/OPEN.txt b/internal/help/OPEN.txt index e44f768a4..e595428cd 100644 --- a/internal/help/OPEN.txt +++ b/internal/help/OPEN.txt @@ -12,7 +12,7 @@ The [[OPEN]] statement is used to open a file or [[OPEN_COM|COM]] serial communi {{Parameters}} * The {{Parameter|fileName$}} is a [[STRING]] variable or literal file name (path optional) in quotes. * FOR mode can be: [[APPEND]] (write to end), [[BINARY]] (read/write), [[INPUT (file mode)|INPUT]] (read), [[OUTPUT]] (write new) or [[RANDOM]] (read/write). -* GW-BASIC's {{Parameter|modeLetter$}} is a [[STRING]] variable or the letter "A", "B", "I", "O" or "R" designating the OPEN modes above. +* GW-BASIC's {{Parameter|modeLetter$}} is a [[STRING]] variable or the letter "A", "B", "I", "O" or "R" designating the OPEN modes above. * {{Parameter|fileNumber&}} can be any '''positive''' [[INTEGER]] or [[LONG]] whole number value or an unused value determined by the [[FREEFILE]] function. * [[LEN]] = or {{Parameter|recordLength}} is optional to denote the RANDOM file record byte length (default = 128) or sequential (default = 512) load buffer. @@ -25,15 +25,15 @@ The [[OPEN]] statement is used to open a file or [[OPEN_COM|COM]] serial communi * If [[LEN]] = is ommitted, sequential file record sizes default to 512 and [[RANDOM]] to 128 bytes in Qbasic. * {{Parameter|fileName$}} can be up to 255 characters with no limit on file name extension length in '''QB64'''. * Once a file or port is opened, it can be used in any program procedure using the assigned file number. -* The '''"SCRN:"''' device is supported in '''version 1.000 and up''' (see Example 3). -* '''Devices such as "KYBD:", "CONS:", "COMn" and "LPTn:" are [[Keywords currently not supported by QB64|not supported in QB64.]]'''. -: '''Note:''' OPEN "LPTn" is not supported by QB64, but may be supported directly by your operating system. +* The '''"SCRN:"''' device is supported in '''version 1.000 and up''' (see Example 3). +* '''Devices such as "KYBD:", "CONS:", "COMn" and "LPTn:" are [[Keywords currently not supported by QB64|not supported in QB64.]]'''. +: '''Note:''' OPEN "LPTn" is not supported by QB64, but may be supported directly by your operating system. * [[OPEN COM]] can also be used for serial port access in '''QB64'''. {{PageErrors}} -* Illegal '''QB64''' Windows filename characters are ''' " * / \ | ? : < > '''. Multiple dots (periods) are allowed. -* Possible OPEN [[ERROR Codes|errors]] include "Bad file name or number", "Bad File Mode", "File Not Found" or "Path Not Found". +* Illegal '''QB64''' Windows filename characters are ''' " * / \ | ? : < > '''. Multiple dots (periods) are allowed. +* Possible OPEN [[ERROR Codes|errors]] include "Bad file name or number", "Bad File Mode", "File Not Found" or "Path Not Found". ** An OPEN file not found error may occur if [[CHR$]](0) to (31) are used in a Windows file name. * '''QB64''' does not have DOS file name limitations. @@ -43,7 +43,7 @@ The [[OPEN]] statement is used to open a file or [[OPEN_COM|COM]] serial communi * [[ACCESS]] clause limits file access to READ, WRITE or READ WRITE on a network. * [[LOCK (access)|LOCK]] clause can specify SHARED or a LOCK READ or LOCK WRITE file lock in an OPEN statement working on a network. * A separate [[LOCK]] statement can lock or [[UNLOCK]] file access on a network using a format that can lock specific records. -* If another process already has access to a specified file, program access is denied for that file OPEN access. A "Permission Denied" error 70 will be returned. A network program must be able to handle a denial of access error. +* If another process already has access to a specified file, program access is denied for that file OPEN access. A "Permission Denied" error 70 will be returned. A network program must be able to handle a denial of access error. ===File Access Modes=== * FOR mode can be: @@ -57,33 +57,33 @@ The [[OPEN]] statement is used to open a file or [[OPEN_COM|COM]] serial communi ====GW-BASIC modes==== * ''Mode letter'' is a variable or literal [[STRING]] letter value as one of the following: -** "A" = '''APPEND'''. -** "B" = '''BINARY'''. -** "I" = '''INPUT'''. -** "O" = '''OUTPUT'''. -** "R" = '''RANDOM'''. +** "A" = '''APPEND'''. +** "B" = '''BINARY'''. +** "I" = '''INPUT'''. +** "O" = '''OUTPUT'''. +** "R" = '''RANDOM'''. {{PageExamples}} ''Example 1:'' Function that displays errors and the number of errors in QBasic filenames. Returns 0 when filename is OK. {{CodeStart}} - file$ = "Hello,~1.mp3" 'example call below - {{Cl|LOCATE}} 20, 30: errors% = CheckName%(file$): {{Cl|COLOR}} 14: {{Cl|PRINT}} " Total Errors ="; errors% + file$ = "Hello,~1.mp3" 'example call below + {{Cl|LOCATE}} 20, 30: errors% = CheckName%(file$): {{Cl|COLOR}} 14: {{Cl|PRINT}} " Total Errors ="; errors% {{Cl|FUNCTION}} CheckName% (Filename$) '{{Cl|NOT}}E: Function also displays filename errors so {{Cl|LOCATE}} on screen before call! {{Cl|DIM}} L {{Cl|AS}} {{Cl|INTEGER}}, DP {{Cl|AS}} {{Cl|INTEGER}}, XL {{Cl|AS}} {{Cl|INTEGER}} - L = {{Cl|LEN}}(Filename$): DP = {{Cl|INSTR}}(Filename$, "."): {{Cl|IF...THEN|IF}} DP {{Cl|THEN}} XL = L - DP 'extension - {{Cl|IF...THEN|IF}} L = 0 {{Cl|OR (boolean)|OR}} L > 12 {{Cl|OR (boolean)|OR}} DP > 9 {{Cl|OR (boolean)|OR}} XL > 3 {{Cl|THEN}} - CheckName% = -1: {{Cl|COLOR}} 12: {{Cl|PRINT}} "Illegal format!"; : {{Cl|EXIT FUNCTION}} + L = {{Cl|LEN}}(Filename$): DP = {{Cl|INSTR}}(Filename$, "."): {{Cl|IF...THEN|IF}} DP {{Cl|THEN}} XL = L - DP 'extension + {{Cl|IF...THEN|IF}} L = 0 {{Cl|OR (boolean)|OR}} L > 12 {{Cl|OR (boolean)|OR}} DP > 9 {{Cl|OR (boolean)|OR}} XL > 3 {{Cl|THEN}} + CheckName% = -1: {{Cl|COLOR}} 12: {{Cl|PRINT}} "Illegal format!"; : {{Cl|EXIT FUNCTION}} {{Cl|END IF}} - {{Cl|FOR...NEXT|FOR}} i% = 1 {{Cl|TO}} L 'check each filename character" + {{Cl|FOR...NEXT|FOR}} i% = 1 {{Cl|TO}} L 'check each filename character" code% = {{Cl|ASC}}({{Cl|MID$}}(Filename$, i%, 1)): {{Cl|COLOR}} 10 ' see ASCII codes {{Cl|SELECT CASE}} code% 'check for errors and highlight in red '{{Cl|CASE}} 34, 42 {{Cl|TO}} 44, 47, 58 {{Cl|TO}} 63, 91 {{Cl|TO}} 93, 124: E% = E% + 1: {{Cl|COLOR}} 12 ' '''QBasic errors''' {{Cl|CASE}} 34, 42, 47, 58, 60, 62, 92, 124: E% = E% + 1: {{Cl|COLOR}} 12 ' '''QB64 errors''' - {{Cl|CASE}} 46: dot% = dot% + 1: {{Cl|IF...THEN|IF}} dot% > 1 {{Cl|THEN}} E% = E% + 1: {{Cl|COLOR}} 12 + {{Cl|CASE}} 46: dot% = dot% + 1: {{Cl|IF...THEN|IF}} dot% > 1 {{Cl|THEN}} E% = E% + 1: {{Cl|COLOR}} 12 {{Cl|END SELECT}} {{Cl|PRINT}} {{Cl|CHR$}}(code%); 'use {{Cl|LOCATE}} before {{Cl|FUNCTION}} call to place print {{Cl|NEXT}} @@ -93,44 +93,44 @@ The [[OPEN]] statement is used to open a file or [[OPEN_COM|COM]] serial communi ''Note: The QBasic character error list is commented out and the function will return invalid filenames under QB64. {{OutputStart}} - {{text|Hello|#54FC54}}{{text|,|red}}{{text|~1.mp3|#54FC54}} {{text|Total Errors|yellow}}<nowiki> = </nowiki>{{text|1|yellow}} + {{text|Hello|#54FC54}}{{text|,|red}}{{text|~1.mp3|#54FC54}} {{text|Total Errors|yellow}}<nowiki> = </nowiki>{{text|1|yellow}} {{OutputEnd}} :''Note:'' The screen output displays filename characters in green except for red comma QBasic error. -''Example 2:'' When '''OPEN "SCRN:" FOR OUTPUT AS #f''' is used, '''PRINT #f''' will print the text to the screen instead of to a file: +''Example 2:'' When '''OPEN "SCRN:" FOR OUTPUT AS #f''' is used, '''PRINT #f''' will print the text to the screen instead of to a file: {{CodeStart}} '' '' f% = {{Cl|FREEFILE}} 'should always be 1 at program start -{{Cl|OPEN}} "SCRN:" {{Cl|FOR...NEXT|FOR}} {{Cl|OUTPUT}} {{Cl|AS}} #f% +{{Cl|OPEN}} "SCRN:" {{Cl|FOR...NEXT|FOR}} {{Cl|OUTPUT}} {{Cl|AS}} #f% g% = {{Cl|FREEFILE}} 'should always be 2 after 1 -{{Cl|OPEN}} "temp.txt" {{Cl|FOR...NEXT|FOR}} {{Cl|OUTPUT}} {{Cl|AS}} #g% +{{Cl|OPEN}} "temp.txt" {{Cl|FOR...NEXT|FOR}} {{Cl|OUTPUT}} {{Cl|AS}} #g% {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 2 - {{Cl|PRINT (file statement)|PRINT}} #i, "Hello World, Screen and File version" + {{Cl|PRINT (file statement)|PRINT}} #i, "Hello World, Screen and File version" NEXT '' '' {{CodeEnd}}{{small|code by Steve McNeill}} -: ''Note:'' Linux or Mac file names can use a path destination such as ".\SCRN:" to use SCRN: as an actual file name. +: ''Note:'' Linux or Mac file names can use a path destination such as ".\SCRN:" to use SCRN: as an actual file name. ''Example 3:'' Showcasing different file modes. {{CodeStart}} {{Cl|CLS}} -{{Cl|OPEN}} "test.tst" {{Cl|FOR (file statement)|FOR}} {{Cl|OUTPUT}} {{Cl|AS}} #1 -{{Cl|PRINT (file statement)|PRINT}} #1, "If test.tst didn't exist:" -{{Cl|PRINT (file statement)|PRINT}} #1, "A new file was created named test.tst and then deleted." -{{Cl|PRINT (file statement)|PRINT}} #1, "If test.tst did exist:" -{{Cl|PRINT (file statement)|PRINT}} #1, "It was overwritten with this and deleted." +{{Cl|OPEN}} "test.tst" {{Cl|FOR (file statement)|FOR}} {{Cl|OUTPUT}} {{Cl|AS}} #1 +{{Cl|PRINT (file statement)|PRINT}} #1, "If test.tst didn't exist:" +{{Cl|PRINT (file statement)|PRINT}} #1, "A new file was created named test.tst and then deleted." +{{Cl|PRINT (file statement)|PRINT}} #1, "If test.tst did exist:" +{{Cl|PRINT (file statement)|PRINT}} #1, "It was overwritten with this and deleted." {{Cl|CLOSE}} #1 -{{Cl|OPEN}} "test.tst" {{Cl|FOR (file statement)|FOR}} {{Cl|INPUT (file mode)|INPUT}} {{Cl|AS}} #1 +{{Cl|OPEN}} "test.tst" {{Cl|FOR (file statement)|FOR}} {{Cl|INPUT (file mode)|INPUT}} {{Cl|AS}} #1 {{Cl|DO}} {{Cl|UNTIL}} {{Cl|EOF}}(1) {{Cl|INPUT (file statement)|INPUT}} #1, a$ {{Cl|PRINT}} a$ {{Cl|LOOP}} {{Cl|CLOSE}} #1 -{{Cl|KILL}} "test.tst" +{{Cl|KILL}} "test.tst" {{Cl|END}} @@ -158,4 +158,4 @@ It was overwritten with this and deleted. * [[_SNDOPEN]], [[_LOADIMAGE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/OPEN_COM.txt b/internal/help/OPEN_COM.txt index a59841669..f3020e312 100644 --- a/internal/help/OPEN_COM.txt +++ b/internal/help/OPEN_COM.txt @@ -1,14 +1,13 @@ -The '''OPEN COM''' statement is used to access a computer's Serial port COM1 or COM2 address using an OPEN statement. - +The [[OPEN COM]] statement is used to access a computer's serial port COM. {{PageSyntax}} -: '''OPEN "COMn:''' ''Speed'', ''Parity'', ''Bits'', ''Stopbit'', [''Options'']" [FOR {[[RANDOM]]|[[BINARY]]|[[OUTPUT]]|[[INPUT (file mode)|INPUT]]}] AS #''P'' [LEN = ''bytesize''] +: '''OPEN''' "COMn: ''Speed'', ''Parity'', ''Bits'', ''Stopbit'', [''Options'']" [FOR {[[RANDOM]]|[[BINARY]]|[[OUTPUT]]|[[INPUT (file mode)|INPUT]]}] AS #''P'' [LEN = {{Parameter|byteSize}}] {{Parameters}} -* ''Speed'' (baud rate): 50, 150, 300, 600, 1200, 1800, 2400, '''9600''' (QB max), 19200 or '''115200''' ('''QB64''' max) maximum. -* ''Parity'': '''N''' (none), E (even), O (odd), S (space) or M (mark). Note: If 8 bits use parity N for numerical data! +* ''Speed'' (baud rate): 50, 150, 300, 600, 1200, 1800, 2400, '''9600''' (QBasic's maximum), 19200 or '''115200''' ('''QB64''''s maximum). +* ''Parity'': '''N''' (none), E (even), O (odd), S (space) or M (mark). Note: If 8 bits, use parity N for numerical data. * ''Bits'' = number of bits/byte: Valid numbers: 5, 6, 7 or '''8''' * ''Stopbit'' = number of stop bits: Valid numbers: '''1''', 1.5 or 2 * Optional COM port ''Options'' (separated by commas): @@ -18,77 +17,78 @@ The '''OPEN COM''' statement is used to access a computer's Serial port COM1 or ::* CD[ms] : Time until timeout of DCD (Carrier Detect) line in. CD0 ignores timeouts. ::* CS[ms] : Time until timeout of CTS (Clear to Send) line in. CS0 ignores timeouts. ::* DS[ms] : Time until timeout of DSR (Data Set Ready) line in. DS0 ignores timeouts. -::* OP[ms] : Time until data lines become active. If timeout then OPEN fails! OP0 ignores timeouts. +::* OP[ms] : Time until data lines become active. If timeout then OPEN fails, OP0 ignores timeouts. ::* RB[b] : Size of receive buffer in bytes when used. Default when not used = 512 bytes ::* TB[b] : Size of transmit buffer in bytes when used. Default when not used = 512 bytes ::* RS : Supress detection of Request to Send (RTS) line. {{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. +* '''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. * 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) * The optional FOR access ''mode'' can be [[OUTPUT]], [[INPUT (file mode)|INPUT]] or [[RANDOM]] (default mode when no FOR statement is used). -* '''Currently, QB64 only supports [[OPEN]] FOR [[RANDOM]] access using the [[GET]]/[[PUT]] commands in [[BINARY|BIN]] mode!''' -* '''Use the BIN option listed below for [[BINARY]] byte mode port access!''' +* '''Currently, QB64 only supports [[OPEN]] FOR [[RANDOM]] access using the [[GET]]/[[PUT]] commands in [[BINARY|BIN]] mode.''' +* '''Use the BIN option listed below for [[BINARY]] byte mode port access.''' * The [[LEN]] statement is also optional. The default record size is 512 bytes when not used. * Use the [[LOC]](portnumber) function to determine that there is data in the receive buffer when the value is greater than 0. -* OPEN AS number can use a [[FREEFILE]] value. Numbers used by files already open '''cannot''' be used by OPEN COM! +* OPEN AS number can use a [[FREEFILE]] value. Numbers used by files already open '''cannot''' be used by OPEN COM. * [[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Keyword Not Supported in Linux or MAC versions]] -<center>'''Qbasic Description NOT Currently supported in QB64!'''</center> +==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! +*[[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 only! +* 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'''. -''Example 1:'' Checking to see if a COM port exists. If the port does not exist Qbasic will cause a Windows access error! +{{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}} '' '' {{Cl|ON ERROR}} {{Cl|GOTO}} Handler FF = {{Cl|FREEFILE}} -comPort$ = "COM1:" 'try a COM port number that does not exist -{{Cl|CONST}} comMode$ = "9600,N,8,1,CS0,DS0" 'Use 0 to avoid timeouts +comPort$ = "COM1:" 'try a COM port number that does not exist +{{Cl|CONST}} comMode$ = "9600,N,8,1,CS0,DS0" 'Use 0 to avoid timeouts {{Cl|OPEN}} comPort$ + comMode$ {{Cl|FOR...NEXT|FOR}} {{Cl|RANDOM}} {{Cl|AS}} FF -{{Cl|IF...THEN|IF}} errnum = 0 {{Cl|THEN}} {{Cl|PRINT}} "COM exists! +{{Cl|IF...THEN|IF}} errnum = 0 {{Cl|THEN}} {{Cl|PRINT}} "COM exists! K$ = {{Cl|INPUT$}}(1) {{Cl|END}} Handler: errnum = {{Cl|ERR}} -{{Cl|PRINT}} "Error:"; errnum +{{Cl|PRINT}} "Error:"; errnum {{Cl|RESUME}} {{Cl|NEXT}} {{CodeEnd}} -: ''Explanation:'' QB64 may create error 68 if COM is not found. Use a zero CD, CS, DS or OP timeout value to avoid COM timeouts! +: ''Explanation:'' QB64 may create error 68 if COM is not found. Use a zero CD, CS, DS or OP timeout value to avoid COM timeouts. ''Example 2:'' Opening a COM port with the BIN, CS0 and DS0 options in '''QB64'''. {{CodeStart}} '' '' {{Cl|DIM}} bytestr {{Cl|AS}} {{Cl|STRING}} * 1 'one byte transfers -{{Cl|INPUT}} "{{Cl|COM}} port number #", port$ 'any COM port number available +{{Cl|INPUT}} "{{Cl|COM}} port number #", port$ 'any COM port number available -{{Cl|OPEN}} "{{Cl|COM}}" + port$ + ":9600,N,8,1,BIN,CS0,DS0" {{Cl|FOR (file statement)|FOR}} {{Cl|RANDOM}} {{Cl|AS}} #1 +{{Cl|OPEN}} "{{Cl|COM}}" + port$ + ":9600,N,8,1,BIN,CS0,DS0" {{Cl|FOR (file statement)|FOR}} {{Cl|RANDOM}} {{Cl|AS}} #1 {{Cl|DO}} 'main loop - 'receive data in buffer when LOC > 0 + 'receive data in buffer when LOC > 0 {{Cl|IF}} {{Cl|LOC}}(1) {{Cl|THEN}} {{Cl|GET}} #1, , bytestr - {{Cl|PRINT}} "[" + bytestr + "]"; + {{Cl|PRINT}} "[" + bytestr + "]"; {{Cl|END IF}} 'transmit (send) k$ = {{Cl|INKEY$}} {{Cl|IF}} {{Cl|LEN}}(k$) = 1 {{Cl|THEN}} k = {{Cl|ASC}}(k$) - {{Cl|IF}} k >= 32 {{Cl|THEN}} 'ignore control key codes - {{Cl|PRINT}} ">" + k$ + "<"; + {{Cl|IF}} k >= 32 {{Cl|THEN}} 'ignore control key codes + {{Cl|PRINT}} ">" + k$ + "<"; bytestr = k$: {{Cl|PUT}} #1, , bytestr {{Cl|END IF}} {{Cl|END IF}} {{Cl|LOOP}} {{Cl|UNTIL}} k$ = {{Cl|CHR$}}(27) -{{Cl|CLOSE}} #1: {{Cl|PRINT}} "Finished!" '' '' +{{Cl|CLOSE}} #1: {{Cl|PRINT}} "Finished!" '' '' {{CodeEnd}} @@ -99,32 +99,32 @@ errnum = {{Cl|ERR}} Byte4 = {{Cl|CHR$}}(254) + {{Cl|CHR$}}(175) + {{Cl|CHR$}}(0) + {{Cl|CHR$}}(3) 'Command code to query all 4 banks of switch input board. -{{Cl|OPEN}} "COM1:115200,N,8,1,BIN,CS0,DS0" {{Cl|FOR...NEXT|FOR}} {{Cl|RANDOM}} {{Cl|AS}} #1 'Open port used to send commands. -{{Cl|OPEN}} "COM2:115200,N,8,1,BIN,CS0,DS0" {{Cl|FOR...NEXT|FOR}} {{Cl|RANDOM}} {{Cl|AS}} #2 'Open port used to receive commands. +{{Cl|OPEN}} "COM1:115200,N,8,1,BIN,CS0,DS0" {{Cl|FOR...NEXT|FOR}} {{Cl|RANDOM}} {{Cl|AS}} #1 'Open port used to send commands. +{{Cl|OPEN}} "COM2:115200,N,8,1,BIN,CS0,DS0" {{Cl|FOR...NEXT|FOR}} {{Cl|RANDOM}} {{Cl|AS}} #2 'Open port used to receive commands. {{Cl|PUT}} #1, , Byte4 'Send the 4 byte command. Start# = {{Cl|TIMER}} -{{Cl|DO...LOOP|DO}} {{Cl|UNTIL}} {{Cl|LOC}}(2) <> 0 'Check if there is data received at com2 - {{Cl|IF...THEN|IF}} {{Cl|TIMER}} - Start# > .5 {{Cl|THEN}} {{Cl|EXIT DO}} 'Exit loop if no data arrives within .5 seconds. +{{Cl|DO...LOOP|DO}} {{Cl|UNTIL}} {{Cl|LOC}}(2) <> 0 'Check if there is data received at com2 + {{Cl|IF...THEN|IF}} {{Cl|TIMER}} - Start# > .5 {{Cl|THEN}} {{Cl|EXIT DO}} 'Exit loop if no data arrives within .5 seconds. {{Cl|LOOP}} {{Cl|IF...THEN|IF}} {{Cl|LOC}}(2) = 0 {{Cl|THEN}} 'If no data was received..... - {{Cl|PRINT}} "No data received from COM port." + {{Cl|PRINT}} "No data received from COM port." {{Cl|END}} {{Cl|END IF}} -{{Cl|PRINT}} "Received from COM2:"; +{{Cl|PRINT}} "Received from COM2:"; {{Cl|DO...LOOP|DO}} {{Cl|UNTIL}} {{Cl|LOC}}(2) = 0 'Read data from COM2 until there is no more data. {{Cl|GET}} #2, , ByteIn {{Cl|PRINT}} {{Cl|ASC}}(ByteIn); {{Cl|LOOP}} {{Cl|END}} '' '' -{{CodeEnd}}{{small|Code courtesy of Hydrofoiler}} +{{CodeEnd}}{{small|Code courtesy of forum member Hydrofoiler}} -''See also:'' +{{PageSeeAlso}} * [[BINARY]], [[RANDOM]] * [[INPUT$]], [[PRINT (file statement)|PRINT #]] * [[LOC]], [[INKEY$]], [[OPEN]] @@ -133,4 +133,4 @@ Start# = {{Cl|TIMER}} * [[Windows_Libraries#Windows_Ports|Enumerating Windows Ports]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/OPTION_BASE.txt b/internal/help/OPTION_BASE.txt index 6759bb5ef..dedd692a2 100644 --- a/internal/help/OPTION_BASE.txt +++ b/internal/help/OPTION_BASE.txt @@ -1,19 +1,19 @@ -The {{KW|OPTION BASE}} statement is used to set the default lower bound of arrays. +The [[OPTION BASE]] statement is used to set the default lower bound of arrays. {{PageSyntax}} -:{{KW|OPTION BASE}} {0|1} +: [[OPTION BASE]] {0|1} {{PageDescription}} * This statement affects array declarations where the lower bound of a dimension is not specified. -* When used, {{KW|OPTION BASE}} must be used before any array declarations ({{KW|DIM}}) to be affected. +* When used, [[OPTION BASE]] must come before any array declarations ([[DIM]]) to be affected. * By default, the lower bound for arrays is zero, and may be changed to one using the statement. * Otherwise, arrays will be dimensioned from element 0 if you DIM just the upper bounds. -* You can also set other array boundaries by using {{KW|TO}} in the DIM such as: DIM array(5 TO 10) -* Note: Neither '''OPTION''' nor '''BASE''' can be used as numerical variable names. +* You can also set other array boundaries by using [[TO]] in the DIM declaration such as {{InlineCode}}DIM array(5 TO 10){{InlineCodeEnd}} +{{PageExamples}} ''Example 1:'' Set the default lower bound for array declarations to one. {{CodeStart}} {{Cl|OPTION BASE}} 1 @@ -43,8 +43,8 @@ The {{KW|OPTION BASE}} statement is used to set the default lower bound of array {{PageSeeAlso}} -* {{KW|Arrays}}, {{KW|LBOUND}}, {{KW|UBOUND}} -* {{KW|DIM}}, {{KW|REDIM}}, {{KW|STATIC}}, {{KW|COMMON}} +* [[Arrays]], [[LBOUND]], [[UBOUND]] +* [[DIM]], [[REDIM]], [[STATIC]], [[COMMON]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/OR.txt b/internal/help/OR.txt index d4fcbbdb0..9f37d2f1d 100644 --- a/internal/help/OR.txt +++ b/internal/help/OR.txt @@ -1,24 +1,27 @@ -The '''OR''' numerical operator returns a comparative bit value of 1 if either value's bit is on. +The [[OR]] numerical operator returns a comparative bit value of 1 if either value's bit is on. {{PageSyntax}} -:: firstvalue '''OR''' secondvalue +: {{Parameter|result}} = firstValue [[OR]] secondValue + +{{PageDescription}} * If both bits are off, it returns 0. * If one or both bits are on then it returns 1. -* OR never turns off a bit and can be used only to turn a bit on. +* [[OR]] never turns off a bit and can be used only to turn a bit on. {{Template:LogicalTruthTable}} +{{PageExamples}} ''Example 1:'' OR always turns bits on! Never off. {{CodeStart}} '' '' a% = 5 ' 101 binary b% = 4 ' 100 binary results% = a% {{Cl|OR}} b% ' still 101 binary using OR - {{Cl|PRINT}} "Results% ="; results% '' '' + {{Cl|PRINT}} "Results% ="; results% '' '' {{CodeEnd}} {{OutputStart}} Results% = 5 @@ -35,11 +38,10 @@ The '''OR''' numerical operator returns a comparative bit value of 1 if either v :''Explanation:'' The third register bit is only turned on if it was off. This ensures that a bit is set. OR could set more bits on with a sum of bit values such as: OUT address%, 7 would turn the first, second and third bits on. 1 + 2 + 4 = 7 - -''See also:'' +{{PageSeeAlso}} * [[AND]], [[XOR]] * [[AND (boolean)]], [[OR (boolean)]] * [[Binary]], [[Boolean]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/OR_(boolean).txt b/internal/help/OR_(boolean).txt index d1ee98b60..269c11f1a 100644 --- a/internal/help/OR_(boolean).txt +++ b/internal/help/OR_(boolean).txt @@ -1,26 +1,26 @@ -The '''OR''' coditional operator adds an alternative in a [[IF...THEN]] or [[Boolean]] statement. +The '''OR''' conditional operator evaluates an expression to true (-1) if any of the arguments is also true. {{PageSyntax}} -:: IF a = 1 '''OR''' a = 2 THEN a = 0 +: [[IF]] {{Parameter|expression1}} '''OR''' {{Parameter|expression2}} THEN {code} -* OR adds an alternative to another conditional evaluation. IF True then the statement evaluation is True. +{{PageDescription}} +* OR adds an alternative to another conditional evaluation. If either element in the evaluation is true then the evaluation is true. * Parenthesis may be used to clarify the order of comparisons in an evaluation. -* [[AND]] and '''OR''' cannot be used to combine command line operations. -* '''A double OR syntax error may be ignored and create a QB64 compiler error!''' * Not to be confused with the [[AND]] and [[OR]] numerical operations. {{Template:RelationalTable}} +{{PageExamples}} ''Example:'' {{CodeStart}} a% = 100 b% = 50 -IF (a% > b% AND a% < 100) OR b% = 50 THEN PRINT "True" +IF (a% > b% AND a% < 100) OR b% = 50 THEN PRINT "True" {{CodeEnd}} {{OutputStart}} True @@ -28,10 +28,10 @@ True : ''Explanation:'' The first evaluation was False, but the OR evaluation made the statement true and the code was executed. -''See also:'' +{{PageSeeAlso}} * [[AND]], [[OR]] {{text|(logical operators)}} * [[AND (boolean)]], [[XOR (boolean)]] * [[IF...THEN]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/OUT.txt b/internal/help/OUT.txt index 31c2b0b3a..1b2960f59 100644 --- a/internal/help/OUT.txt +++ b/internal/help/OUT.txt @@ -1,40 +1,44 @@ -'''OUT''' writes values to register and port hardware addresses. '''QB64 currently has limited access to registers!''' - +[[OUT]] writes values to register and port hardware addresses. {{PageSyntax}} -:: '''OUT''' ''register_address%''''',''' ''value%'' +: [[OUT]] {{Parameter|registerAddress%}}, {{Parameter|value%}} {{Parameters}} -* The ''register address'' is a value expressed as a decimal [[INTEGER]] or [[&H|Hexadecimal]]. -* The [[INTEGER]] ''value'' sent is normally only 0 to 255 per one byte register(8 bit) address. +* {{Parameter|registerAddress%}} is a value expressed as a decimal [[INTEGER]] or [[&H|hexadecimal]]. +* The [[INTEGER]] {{Parameter|value%}} sent is normally only 0 to 255 per byte register (8 bit) address. {{PageDescription}} +* '''QB64 has limited access to registers. VGA memory and registers are emulated.''' * OUT can be used to change color port and a limited number of other port settings in QB64. * Some settings may be set in a specific order to gain access to settings and [[INP]] reads. * [[SCREEN]] modes determine the number of available color palette attributes from 2 to 256 in SCREEN 13. -* Windows NT may block access to Parallel printer and Serial ports! See [[Port Access Libraries]] or other DLL's. -* '''WARNING!''' Be sure that the address is useable. OUT accesses directly unlike [[POKE]] and '''can cause PC damage!''' +* Windows NT may block access to Parallel printer and Serial ports. See [[Port Access Libraries]] or other DLLs. * [[_PALETTECOLOR]] can also be used to set RGB intensity values using [[_RGB32|32 bit color]] values. * OUT can toggle the blinking attribute of SCREEN 0 color 16-31 for legacy code. [[_BLINK]] is the preferred method. (starting with build 20170816/61). -:::::::'''Color Port Palette access using OUT''' +==Color Port Palette access using OUT== -:::::OUT &H3C7, attribute : Set port to read RGB settings for start attribute -:::::[[INP]] &H3C9, color_intensity : Reads RGB color intensity settings in order +:::::{{InlineCode}}OUT &H3C7, attribute{{InlineCodeEnd}} : Set port to read RGB settings for start attribute +:::::{{InlineCode}}[[INP]] &H3C9, colorIntensity{{InlineCodeEnd}} : Reads RGB color intensity settings in order -:::::OUT &H3C8, attribute : Set port to write RGB settings for start attribute -:::::OUT &H3C9, color_intensity : Writes RGB color intensity settings in order +:::::{{InlineCode}}OUT &H3C8, attribute{{InlineCodeEnd}} : Set port to write RGB settings for start attribute +:::::{{InlineCode}}OUT &H3C9, colorIntensity{{InlineCodeEnd}} : Writes RGB color intensity settings in order ::::* Every 3 reads or writes, changes to next color attribute without a set ::::* Color setting is Red, Green and Blue attribute intensities in order. -::::* Color attribute intensity values range from 0 to 63 only. NOT 64! +::::* Color attribute intensity values range from 0 to 63. ::::* Some [[DAC]] color attribute intensities cannot be changed using OUT. +==QBasic/QuickBASIC== +* In DOS, OUT accesses memory and hardware directly, unlike [[POKE]], and could cause PC damage. + + +{{PageExamples}} ''Example 1:'' Reading the default RGB color settings of color attribute 15. {{CodeStart}} '' '' @@ -56,7 +60,7 @@ PRINT red%, green%, blue% '' '' {{Cl|OUT}} &H3C9, 63 'green {{Cl|OUT}} &H3C9, 63 'blue '' '' {{CodeEnd}} -:''Explanation:'' In [[SCREEN]] 0 this is one way to make high intensity background colors. [[COLOR]] ,15 is actually grey(7). +:''Explanation:'' In [[SCREEN]] 0 this is one way to make high intensity background colors. {{InlineCode}}[[COLOR]] ,15{{InlineCodeEnd}} is actually grey (7). ''Example 3:'' Toggling blinking colors in SCREEN beginning with build 20170816/61 @@ -64,7 +68,7 @@ PRINT red%, green%, blue% '' '' {{Cl|OUT}} &H3C0, &H10 'disables blinking and enables high intensity backgrounds (colors 16-31) {{Cl|OUT}} &H3C0, 2 ^ 3 'reenables blinking and disables high intensity backgrounds (colors 16-31) {{CodeEnd}} -: Note: For new code, the recommended practice is to use the new [[_BLINK]] {ON|OFF} statement. +: Note: In QB64, the recommended practice is to use the [[_BLINK]] {ON|OFF} statement. ''Example 4:'' Restoring colors to a bitmap from the Red, Green and Blue [[BSAVE]]d indexed array of color values. @@ -76,11 +80,10 @@ PRINT red%, green%, blue% '' '' {{Cl|NEXT}} {{Cl|PUT (graphics statement)|PUT}}(clm, row), Image(48) PSET '' '' {{CodeEnd}} -:''Explanation:'' The color RGB intensity settings were imported from a file to the Image array using {{KW|BLOAD}}. The color attribute advances to the next one every 3 writes using OUT. The color information was indexed to the start of the array. The image is after the color settings at index 48. Index 48 is the [[GET (graphics statement)|GET]] image width and 49 is the height. +:''Explanation:'' The color RGB intensity settings were imported from a file to the Image array using [[BLOAD]]. The color attribute advances to the next one every 3 writes using OUT. The color information was indexed to the start of the array. The image is after the color settings at index 48. Index 48 is the [[GET (graphics statement)|GET]] image width and 49 is the height. - -''See also:'' +{{PageSeeAlso}} * [[PALETTE]], [[_PALETTECOLOR]] * [[INP]] {{text|(read register)}} * [[PEEK]] {{text|(read memory)}} @@ -89,7 +92,10 @@ PRINT red%, green%, blue% '' '' * [[BSAVE]], [[BLOAD]] * [[_BLINK]], [[_BLINK (function)]] * [[Port Access Libraries]] {{text|(COM or LPT registers)}} + + +===External Links=== * [http://en.wikipedia.org/wiki/Input/output_base_address#Common_I.2FO_base_address_device_assignments_in_IBM_PC_compatible_computers PC I/O base address device assignments] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/OUTPUT.txt b/internal/help/OUTPUT.txt index 601bdae7e..e5294f413 100644 --- a/internal/help/OUTPUT.txt +++ b/internal/help/OUTPUT.txt @@ -1,21 +1,23 @@ -The '''OUTPUT''' file mode is used in an [[OPEN]] statement to send new data to Files or Ports. +#REDIRECT [[OPEN#File_Access_Modes]] +The [[OUTPUT]] file mode is used in an [[OPEN]] statement to send new data to files or ports. {{PageSyntax}} -:: OPEN FileName$ FOR OUTPUT AS #1 +: [[OPEN]] {{Parameter|fileName$}} '''FOR''' [[OUTPUT]] '''AS''' #1 - -* OUTPUT mode erases all previous data in an existing file or clears a port receive buffer! +{{PageDescription}} +* OUTPUT mode erases all previous data in an existing file or clears a port receive buffer. * Creates an empty file if the filename does not exist. Use [[APPEND]] if previous file data is to be preserved. * Mode can use [[PRINT (file statement)|PRINT]], [[WRITE (file statement)|WRITE]] or [[PRINT USING (file statement)|PRINT USING]] to output file data. +{{PageExamples}} ''Example:'' Writes new data to a text file sequentially and reads it back to the program screen. {{CodeStart}} '' '' -filename$ = "testfile.dat" -x = 1: y = 2: z$ = "Three" +filename$ = "testfile.dat" +x = 1: y = 2: z$ = "Three" {{Cl|OPEN}} filename$ {{Cl|FOR...NEXT|FOR}} {{Cl|OUTPUT}} {{Cl|AS}} #1 'opens and clears an existing file or creates new empty file @@ -23,7 +25,7 @@ x = 1: y = 2: z$ = "Three" {{Cl|CLOSE}} #1 -{{Cl|PRINT}} "File created with data. Press a key!" +{{Cl|PRINT}} "File created with data. Press a key!" K$ = {{Cl|INPUT$}}(1) 'press a key @@ -39,11 +41,10 @@ K$ = {{Cl|INPUT$}}(1) 'press a key {{CodeEnd}} -''See also:'' - +{{PageSeeAlso}} * [[APPEND]], [[RANDOM]] * [[INPUT (file mode)]], [[BINARY]] * [[WRITE]], [[INPUT (file statement)]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/PAINT.txt b/internal/help/PAINT.txt index 20be9582a..c6cf3e935 100644 --- a/internal/help/PAINT.txt +++ b/internal/help/PAINT.txt @@ -1,37 +1,30 @@ -The '''PAINT''' statement is used to color enclosed graphic objects with a designated fill color up to a border [[COLOR]]. +The [[PAINT]] statement is used to fill a delimited area in a graphic screen mode with color. -Color {{PageSyntax}} -: '''PAINT''' [{{KW|STEP}}] '''(''column%'', ''row%''), ''fillcolor'''''[, ''bordercolor%''] - -Tiling {{PageSyntax}} -: '''PAINT''' [{{KW|STEP}}] '''(''column%'', ''row%''), ''background$'''''[, ''bordercolor%''] - +{{PageSyntax}} +: [[PAINT]] ['''STEP'''] ({{Parameter|column%}}, {{Parameter|row%}}), {{Parameter|fillColor}}[, {{Parameter|borderColor%}}] {{Parameters}} -* Can use the [[STEP]] keyword for relative coordinate placements. [[STEP]](0, 0) can be used after [[CIRCLE]] to fill it with color. -* Graphic ''column'' and ''row'' [[INTEGER]] pixel coordinates should be inside of a fully enclosed border. -* The ''fillcolor'' can be either a numerical or a [[STRING|string]] value: -:* [[INTEGER]] or [[LONG]] 32 bit ''Fillcolor'' is the color to paint the inside of an object. Colors limited to [[SCREEN]] mode used. -:* A [[STRING]] paint argument has PAINT do "tiling," a process that paints a pattern rather than a solid color. -* Optional [[INTEGER]] or [[LONG]] 32 bit ''border color'' is the color of the enclosed shape's border when different from the fill color. -* Optional ''background'' [[ASCII]] character sets the tiling style. Omitted background Default is CHR$(0). - -::PAINT(x, y), CHR$(arg1) + CHR$(arg2)... + CHR$(argn) - -: Where the [[CHR$]] arguments are numerical values between 0 and 255, represented in binary form across the x column axis. +* 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. -''Usage:'' -* The enclosed border color must be one color value only. The object border should be fully enclosed! -* PAINT coordinates MUST be inside of a closed shape to be colored. Paint will not do anything when placed on the border color. -* If the border color does not enclose the area, PAINT may flood the screen or go beyond the border area. -* If the shape is not totally enclosed, every color except the border color may be painted over. - -* [[DRAW]] shapes can be filled using the string "P ''fillcolor'', ''bordercolor''". Use a "B" blind move to offset from shape's border. +==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. +{{PageDescription}} +* Graphic {{Parameter|column%}} and {{Parameter|row%}} [[INTEGER]] pixel coordinates should be inside of a fully closed "shape", whether it's a rectangle, circle or custom-drawn shape using [[DRAW]]. +* If the coordinates passed to the [[PAINT]] statement are on a pixel that matches the border colors, no filling will occur. +* If the shape's border isn't continuous, the "paint" will "leak". +* If the shape is not totally closed, every color except the border color may be painted over. +* [[DRAW]] shapes can be filled using the string "P {{Parameter|fillColor}}, {{Parameter|borderColor}}". Use a "B" blind move to offset from the shape's border. + + +{{PageExamples}} ''Example 1:'' Painting a [[CIRCLE]] immediately after it is drawn using [[STEP]](0, 0) to paint from the circle's center point. {{CodeStart}} '' '' {{Cl|SCREEN (statement)|SCREEN}} 12 @@ -42,32 +35,32 @@ x = 200: y = 200 :''Results:'' A circle located at x and y with a bright green border filled in dark green. The last coordinate used was the circle's center point and PAINT used it also with the [[STEP]] relative coordinates being zero. -''Example 2:'' Routine to check a [[DRAW]] string to make sure that the drawn shape is fully enclosed so that a PAINT does not bleed. +''Example 2:'' Routine to check a [[DRAW]] string to make sure that the drawn shape is fully closed so that a PAINT does not "leak". {{CodeStart}} '' '' {{Cl|SCREEN}} 12 -drw$ = "C15S20R9D4R6U3R3D3R7U5H3U2R9D3G2D6F1D3F5L10D1G1L4H2L7G2L3H2L3U8L2U5R1BF4" +drw$ = "C15S20R9D4R6U3R3D3R7U5H3U2R9D3G2D6F1D3F5L10D1G1L4H2L7G2L3H2L3U8L2U5R1BF4" {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} {{Cl|LEN}}(drw$) tmp$ = {{Cl|UCASE$}}({{Cl|MID$}}(drw$, i, 1)) check = 1 {{Cl|SELECT CASE}} tmp$ - {{Cl|CASE}} "U": ver = -1: hor = 0 - {{Cl|CASE}} "D": ver = 1: hor = 0 - {{Cl|CASE}} "E": ver = -1: hor = 1 - {{Cl|CASE}} "F": ver = 1: hor = 1 - {{Cl|CASE}} "G": ver = 1: hor = -1 - {{Cl|CASE}} "H": ver = -1: hor = -1 - {{Cl|CASE}} "L": ver = 0: hor = -1 - {{Cl|CASE}} "R": ver = 0: hor = 1 + {{Cl|CASE}} "U": ver = -1: hor = 0 + {{Cl|CASE}} "D": ver = 1: hor = 0 + {{Cl|CASE}} "E": ver = -1: hor = 1 + {{Cl|CASE}} "F": ver = 1: hor = 1 + {{Cl|CASE}} "G": ver = 1: hor = -1 + {{Cl|CASE}} "H": ver = -1: hor = -1 + {{Cl|CASE}} "L": ver = 0: hor = -1 + {{Cl|CASE}} "R": ver = 0: hor = 1 {{Cl|CASE ELSE}}: check = 0 {{Cl|END SELECT}} {{Cl|IF...THEN|IF}} check {{Cl|THEN}} - snum$ = "" + snum$ = "" {{Cl|FOR...NEXT|FOR}} j = i + 1 {{Cl|TO}} i + 4 'set for up to 4 digits and spaces - {{Cl|IF...THEN|IF}} j > {{Cl|LEN}}(drw$) {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR...NEXT|FOR}} + {{Cl|IF...THEN|IF}} j > {{Cl|LEN}}(drw$) {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR...NEXT|FOR}} n$ = {{Cl|MID$}}(drw$, j, 1) num = {{Cl|ASC}}(n$) - {{Cl|IF...THEN|IF}} (num > 47 {{Cl|AND (boolean)|AND}} num < 58) {{Cl|OR (boolean)|OR}} num = 32 {{Cl|THEN}} + {{Cl|IF...THEN|IF}} (num > 47 {{Cl|AND (boolean)|AND}} num < 58) {{Cl|OR (boolean)|OR}} num = 32 {{Cl|THEN}} snum$ = snum$ + n$ {{Cl|ELSE}}: {{Cl|EXIT}} {{Cl|FOR...NEXT|FOR}} {{Cl|END IF}} @@ -80,9 +73,10 @@ drw$ = "C15S20R9D4R6U3R3D3R7U5H3U2R9D3G2D6F1D3F5L10D1G1L4H2L7G2L3H2L3U8L2U5 {{Cl|NEXT}} {{Cl|PSET}} (300, 300): {{Cl|DRAW}} drw$ '' '' {{CodeEnd}} -: ''Explanation:'' If the [[DRAW]] string is enclosed, 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 enclosed. +: ''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) @@ -103,8 +97,7 @@ drw$ = "C15S20R9D4R6U3R3D3R7U5H3U2R9D3G2D6F1D3F5L10D1G1L4H2L7G2L3H2L3U8L2U5 {{Cl|PAINT}} (320, 240), Tile$, 14 'paints brick tiles within yellow border {{CodeEnd}} -<center>'''Tiling currently does not work in QB64!'''</center> - +--!> {{PageSeeAlso}} @@ -113,4 +106,4 @@ drw$ = "C15S20R9D4R6U3R3D3R7U5H3U2R9D3G2D6F1D3F5L10D1G1L4H2L7G2L3H2L3U8L2U5 * [[SCREEN]], [[CHR$]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/PALETTE.txt b/internal/help/PALETTE.txt index 3ac280454..c7e543fee 100644 --- a/internal/help/PALETTE.txt +++ b/internal/help/PALETTE.txt @@ -1,42 +1,45 @@ -The '''PALETTE''' statement can swap color settings, set colors to default or set the Red, Green, Blue color palette. +The [[PALETTE]] statement can swap color settings, set colors to default or set the red, green and blue color components of palette colors. +{{PageSyntax}} -''RGB'' {{PageSyntax}} - -:::PALETTE [''attribute'', ''Red'' + (''Green'' * 256) + (''Blue'' * 65536)] - -''Swap'' {{PageSyntax}} - -:::PALETTE [''set_attribute'', new_attribute] +: [[PALETTE]] [{{Parameter|attribute%}}, ''red%'' + (''green%'' * 256) + (''blue%'' * 65536)] +: [[PALETTE]] [{{Parameter|existingAttribute%}}, {{Parameter|newAttribute%}}] -* ''Red'', ''Green'' and ''Blue'' values can be from 0 to 63. Many color shades possible in non-[[DAC]] color attributes. -* If the Red, Green and Blue color intensity settings are all the same value the color is greyscale. -* Screens 0, 7 and 9 ([[DAC]]) colors cannot be changed by the RGB syntax statement in QBasic! Can use [[OUT]] to change attribute 1 thru 5 intensity settings. -* A swap is often used with [[DAC]] color attributes that cannot change RGB settings. Only the RGB color settings are swapped from original ''set_attribute'' to ''new_attribute''. Screens 0 thru 9 support swaps. Screen 10 up to 8 only. -* PALETTE without any value sets any changed RGB settings back to the Qbasic default color settings including [[DAC]] colors. +{{PageDescription}} +* {{Parameter|red%}}, {{Parameter|green%}} and {{Parameter|blue%}} values can range from 0 to 63. Many color shades are possible in non-[[DAC]] color attributes. +* If the {{Parameter|red%}}, {{Parameter|green%}} and {{Parameter|blue%}} color intensity settings are all the same value the resulting color is a shade of grey. +* A swap is often used with [[DAC]] color attributes that cannot change RGB settings. Only the RGB color settings are swapped from original {{Parameter|existingAttribute%}} to {{Parameter|newAttribute%}}. Screens 0 thru 9 support swaps. Screen 10 supports up to attribute 8 only. +* PALETTE without any value sets any changed RGB settings back to the default color settings, including [[DAC]] colors. * [[PALETTE USING]] can be used when color intensity values are stored in an [[Arrays|array]]. +* QB64 implements the [[_PALETTECOLOR]] statement to provide extended palette functionality. +==QBasic/QuickBASIC== +* Screens 0, 7 and 9 ([[DAC]]) colors could not be changed using the first syntax, but the program could use [[OUT]] to change intensity settings of attributes 1 thru 5. + + +{{PageExamples}} ''Example:'' Displaying all 64 DAC color hues as backgrounds in SCREEN 9 using a PALETTE swap. {{CodeStart}} '' '' {{Cl|SCREEN (statement)|SCREEN}} 9 ' background is default black - {{Cl|LOCATE}} 20, 33: {{Cl|PRINT}} "Press any Key!" + {{Cl|LOCATE}} 20, 33: {{Cl|PRINT}} "Press any Key!" {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 64 a$ = {{Cl|INPUT$}}(1) ' wait for a keypress {{Cl|PALETTE}} 0, i {{Cl|NEXT}} '' '' {{CodeEnd}} -:''Note:'' Other attributes(1 to 15) can be swapped for DAC foreground colors also. +:''Note:'' Other attributes (1 to 15) can also be swapped for DAC foreground colors. -''See also:'' +{{PageSeeAlso}} +* [[_PALETTECOLOR]] * [[PALETTE USING]] * [[COLOR]] * [[OUT]], [[INP]] * [[SCREEN]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/PALETTE_USING.txt b/internal/help/PALETTE_USING.txt index cd223e66b..7bbf0ce50 100644 --- a/internal/help/PALETTE_USING.txt +++ b/internal/help/PALETTE_USING.txt @@ -1,12 +1,14 @@ -The '''PALETTE USING''' statement sets all RGB screen color intensities using values from an [[Arrays|array]]. +The [[PALETTE USING]] statement sets all RGB screen color intensities using values from an [[Arrays|array]]. {{PageSyntax}} -:: PALETTE USING Array%(''start_index%'') +: [[PALETTE USING]] array%({{Parameter|startIndex%}}) -* The [[Arrays|Array]] holds the RGB color value using the color value = red + 256 * green + 65536 * blue. -* The ''start_index'' indicates the index that the statement should start reading. The statement will read all color attributes available in that [[SCREEN (statement)|SCREEN]] mode. The '''number of values required''' in the array is listed below: +{{PageDescription}} +* The [[Arrays|array]] holds the RGB color value using the color value as {{InlineCode}}{{Parameter|red%}} + 256 * {{Parameter|green%}} + 65536 * {{Parameter|blue%}}{{InlineCodeEnd}}. +** Color intensities range from 0 to 63. +* {{Parameter|startIndex%}} indicates the index in the array from which the statement should start reading. The statement will read all color attributes available in that [[SCREEN (statement)|SCREEN]] mode. The '''number of values required''' in the array is listed below: {{WhiteStart}}''' Screen mode Attributes Colors Values''' 0 0 - 15 0 - 63 16 1 0 - 3 0 - 3 4 @@ -20,12 +22,13 @@ The '''PALETTE USING''' statement sets all RGB screen color intensities using va 13 0 - 15 0 - 263,143 256 {{WhiteEnd}} -* A color argument of -1 in the array leaves the attribute unchanged. Other negative numbers are invalid! +* A color argument of -1 in the array leaves the attribute unchanged. Other negative numbers are invalid. -''See also:'' +{{PageSeeAlso}} * [[PALETTE]], [[COLOR]] +* [[_PALETTECOLOR]] * [[SCREEN (statement)]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/PCOPY.txt b/internal/help/PCOPY.txt index 16c5a8b8f..dbd83593f 100644 --- a/internal/help/PCOPY.txt +++ b/internal/help/PCOPY.txt @@ -1,27 +1,30 @@ -The '''PCOPY''' graphics statement copies one source screen page to a destination page in memory. - +The [[PCOPY]] statement copies one source screen page to a destination page in memory. {{PageSyntax}} -:: PCOPY sourcePage%, desitinationPage% +: [[PCOPY]] {{Parameter|sourcePage%}}, {{Parameter|destinationPage%}} - -* Source and destination page numbers are limited by the SCREEN mode used. -* Source page is an image page in video memory. -* Destination page is the video memory location to copy the source image to. +{{PageDescription}} +* {{Parameter|sourcePage%}} is an image page in video memory. +* {{Parameter|destinationPage%}} is the video memory location to copy the source image to. * The working page is set as 0. All drawing occurs there. * The visible page is set as any page number that the SCREEN mode allows. * The [[_DISPLAY (function)]] return can be used a page number reference in '''QB64''' (See Example 1). * The '''QB64''' [[_DISPLAY]] statement can also be used to stop screen flicker without page flipping or [[CLS]] and '''is the recommended practice'''. +==QBasic/QuickBASIC== +* {{Parameter|sourcePage%}} and {{Parameter|destinationPage%}} numbers are limited by the SCREEN mode used. In '''QB64''', the same limits don't apply. + + +{{PageExamples}} ''Example 1:'' Creating a mouse cursor using a page number that '''you create''' in memory without setting up page flipping. {{CodeStart}} {{Cl|SCREEN (statement)|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, 32) 'any graphics mode should work without setting up pages {{Cl|_MOUSEHIDE}} SetupCursor -{{Cl|PRINT}} "Hello World!" +{{Cl|PRINT}} "Hello World!" {{Cl|DO}}: {{Cl|_LIMIT}} 30 {{Cl|DO}} {{Cl|WHILE}} {{Cl|_MOUSEINPUT}}: {{Cl|LOOP}} 'main loop must contain _MOUSEINPUT ' other program code @@ -35,7 +38,7 @@ SetupCursor {{Cl|SUB}} UpdateCursor {{Cl|PCOPY}} {{Cl|_DISPLAY (function)|_DISPLAY}}, 100 'any page number as desination with the _DISPLAY function as source {{Cl|PSET}} ({{Cl|_MOUSEX}}, {{Cl|_MOUSEY}}), {{Cl|_RGB}}(0, 255, 0) -{{Cl|DRAW}} "ND10F10L3F5L4H5L3" +{{Cl|DRAW}} "ND10F10L3F5L4H5L3" {{Cl|_DISPLAY}} 'statement shows image {{Cl|PCOPY}} 100, {{Cl|_DISPLAY (function)|_DISPLAY}} 'function return as destination page {{Cl|END SUB}} '' '' @@ -61,19 +64,19 @@ SetupCursor {{Cl|CIRCLE}}(x(a), y(a)), 5, 15 'all erasing and drawing is done on page 1 x(a) = x(a) + dx(a) y(a) = y(a) + dy(a) - {{Cl|IF...THEN|IF}} x(a) > 320 {{Cl|THEN}} dx(a) = -dx(a): x(a) = x(a) - 1 + {{Cl|IF...THEN|IF}} x(a) > 320 {{Cl|THEN}} dx(a) = -dx(a): x(a) = x(a) - 1 {{Cl|IF...THEN|IF}} x(a) < 0 {{Cl|THEN}} dx(a) = -dx(a): x(a) = x(a) + 1 - {{Cl|IF...THEN|IF}} y(a) > 200 {{Cl|THEN}} dy(a) = -dy(a): y(a) = y(a) - 1 + {{Cl|IF...THEN|IF}} y(a) > 200 {{Cl|THEN}} dy(a) = -dy(a): y(a) = y(a) - 1 {{Cl|IF...THEN|IF}} y(a) < 0 {{Cl|THEN}} dy(a) = -dy(a): y(a) = y(a) + 1 {{Cl|NEXT}} {{Cl|DO...LOOP|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) ' escape exit {{CodeEnd}} -:''Explanation:'' PCOPY reduces the flickering produced by clearing the screen. x(a) = x(a) - 1, etc. is just to be safe that the balls stay within the boundaries. dx(a) = -dx(a), etc. is to keep the actual speed while inverting it (so that the ball "bounces"). The rest should be self-explanatory, but if you are unsure about arrays you might want to look at QB64 Tutorials -> [[Arrays]]. +:''Explanation:'' PCOPY reduces the flickering produced by clearing the screen. x(a) = x(a) - 1, etc. is just to be safe that the balls stay within the boundaries. dx(a) = -dx(a), etc. is to keep the actual speed while inverting it (so that the ball "bounces"). The rest should be self-explanatory, but if you are unsure about arrays you might want to look at QB64 Tutorials -> [[Arrays]]. -''See also:'' +{{PageSeeAlso}} * [[_DISPLAY]] * [[SCREEN (statement)]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/PEEK.txt b/internal/help/PEEK.txt index 7a1caa1ab..5753477d9 100644 --- a/internal/help/PEEK.txt +++ b/internal/help/PEEK.txt @@ -21,28 +21,28 @@ The '''PEEK''' function returns the value that is contained at a certain memory oldvalue = PEEK(1047) ' IMPORTANT! save initial setting to reset later DO: {{Cl|_LIMIT}} 100 port = {{Cl|PEEK}}(1047) - IF port > 0 THEN LOCATE 26, 19: COLOR 11: - PRINT "Turn ALL Locks off to see each key's bit value!" + IF port > 0 THEN LOCATE 26, 19: COLOR 11: + PRINT "Turn ALL Locks off to see each key's bit value!" END IF COLOR 14:LOCATE 2, 25 - PRINT "PEEK(1047) ="; port; "present keyboard port byte value" + PRINT "PEEK(1047) ="; port; "present keyboard port byte value" LOCATE 5, 35 - IF (port {{Cl|AND}} 1) = 1 THEN COLOR 10: PRINT "R SHIFT PRESSED  " ELSE COLOR 12: PRINT "R SHIFT RELEASED" + IF (port {{Cl|AND}} 1) = 1 THEN COLOR 10: PRINT "R SHIFT PRESSED  " ELSE COLOR 12: PRINT "R SHIFT RELEASED" LOCATE 7, 35 - IF (port AND 2) = 2 THEN COLOR 10: PRINT "L SHIFT PRESSED  " ELSE COLOR 12: PRINT "L SHIFT RELEASED" + IF (port AND 2) = 2 THEN COLOR 10: PRINT "L SHIFT PRESSED  " ELSE COLOR 12: PRINT "L SHIFT RELEASED" LOCATE 9, 35 - IF (port AND 4) = 4 THEN COLOR 10: PRINT "CTRL KEY PRESSED " ELSE COLOR 12: PRINT "CTRL KEY RELEASED" + IF (port AND 4) = 4 THEN COLOR 10: PRINT "CTRL KEY PRESSED " ELSE COLOR 12: PRINT "CTRL KEY RELEASED" LOCATE 11, 35 - IF (port AND 8) = 8 THEN COLOR 10: PRINT "ALT KEY PRESSED " ELSE COLOR 12: PRINT "ALT KEY RELEASED" + IF (port AND 8) = 8 THEN COLOR 10: PRINT "ALT KEY PRESSED " ELSE COLOR 12: PRINT "ALT KEY RELEASED" LOCATE 13, 35 - IF (port AND 16) = 16 THEN COLOR 10: PRINT "SCROLL LOCK ON " ELSE COLOR 12: PRINT "SCROLL LOCK OFF" + IF (port AND 16) = 16 THEN COLOR 10: PRINT "SCROLL LOCK ON " ELSE COLOR 12: PRINT "SCROLL LOCK OFF" LOCATE 15, 35 - IF (port AND 32) = 32 THEN COLOR 10: PRINT "NUMBER LOCK ON " ELSE COLOR 12: PRINT "NUMBER LOCK OFF" + IF (port AND 32) = 32 THEN COLOR 10: PRINT "NUMBER LOCK ON " ELSE COLOR 12: PRINT "NUMBER LOCK OFF" LOCATE 17, 35 - IF (port AND 64) = 64 THEN COLOR 10: PRINT "CAPS LOCK ON " ELSE COLOR 12: PRINT "CAPS LOCK OFF" + IF (port AND 64) = 64 THEN COLOR 10: PRINT "CAPS LOCK ON " ELSE COLOR 12: PRINT "CAPS LOCK OFF" LOCATE 19, 35 - IF (port AND 128) = 128 THEN COLOR 10: PRINT "INSERT MODE ON " ELSE COLOR 12: PRINT "INSERT MODE OFF" - COLOR 11: LOCATE 21, 20: PRINT "Press mode keys to change or [ESC] to quit!"; + IF (port AND 128) = 128 THEN COLOR 10: PRINT "INSERT MODE ON " ELSE COLOR 12: PRINT "INSERT MODE OFF" + COLOR 11: LOCATE 21, 20: PRINT "Press mode keys to change or [ESC] to quit!"; LOOP UNTIL {{Cl|INP}}(&H60) = 1 ' escape key exit {{Cl|POKE}} 1047, oldvalue ' IMPORTANT reset to original settings {{Cl|DEF SEG}} '' '' @@ -63,4 +63,4 @@ The '''PEEK''' function returns the value that is contained at a certain memory * [[Screen Memory]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/PEN.txt b/internal/help/PEN.txt index febac8b68..766b98a5b 100644 --- a/internal/help/PEN.txt +++ b/internal/help/PEN.txt @@ -46,4 +46,4 @@ The '''PEN''' function returns requested information about the lightpen device u * [[PEN (statement)]], [[ON PEN]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/PEN_(statement).txt b/internal/help/PEN_(statement).txt index b1f5a1631..8ea9c889f 100644 --- a/internal/help/PEN_(statement).txt +++ b/internal/help/PEN_(statement).txt @@ -22,4 +22,4 @@ The '''PEN''' statement enables/disables or suspends event trapping of the light * [[ON PEN]], [[PEN]] (function) -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/PLAY(n).txt b/internal/help/PLAY(n).txt index efadd46ec..826d4ac99 100644 --- a/internal/help/PLAY(n).txt +++ b/internal/help/PLAY(n).txt @@ -22,4 +22,4 @@ * [[ON PLAY(n)]], [[PLAY]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/PLAY.txt b/internal/help/PLAY.txt index 238a17ff4..8619cf765 100644 --- a/internal/help/PLAY.txt +++ b/internal/help/PLAY.txt @@ -7,22 +7,22 @@ {{Parameters}} * The ''commandstring'' can be any literal or variable [[STRING]] consisting of the following uppercase or lowercase commands: -:*'''O'''n - Sets the current octave (from 0 to 6). Example: '''{{text|PLAY "O3"|green}}''' -:*'''<''' - 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. +:*'''O'''n - Sets the current octave (from 0 to 6). Example: '''{{text|PLAY "O3"|green}}''' +:*'''<''' - 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}}''' -::*'''-''' 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}}''' +::*'''+''' 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}}''' ::*'''MS''' - Each note plays 3/4 of length set by L (staccato) ::*'''MN''' - Each note plays 7/8 of length set by L (normal) ::*'''ML''' - Each note plays full length set by L (legato) -::*'''P'''n - Pause in the duration of n quarternotes (n can be 1 to 64) corresponding to L, Example: '''{{text|PLAY "P32"|green}}''' -::*'''T'''n - Tempo sets number of L4 quarter notes per minute (n can be 32 to 255 where 120 is the default). Example: '''{{text|PLAY "T180"|green}}''' +::*'''P'''n - Pause in the duration of n quarternotes (n can be 1 to 64) corresponding to L, Example: '''{{text|PLAY "P32"|green}}''' +::*'''T'''n - Tempo sets number of L4 quarter notes per minute (n can be 32 to 255 where 120 is the default). Example: '''{{text|PLAY "T180"|green}}''' :::*''' .  '''  - period after a note plays 1½ times the note length determined by L * T. :::*'''.. '''  - two periods plays 1-3/4 times the note length determined by L * T. -:*''',  '''  - '''commas in QB64''' stop play advancement to allow more than one note to be played simultaneously. Example: '''{{text|PLAY "C,E,G,"|green}}''' +:*''',  '''  - '''commas in QB64''' stop play advancement to allow more than one note to be played simultaneously. Example: '''{{text|PLAY "C,E,G,"|green}}''' :*'''V'''n - Volume in '''QB64 only''' can be any volume from 0(none) to 100(full). The default level is 50 when '''n''' is not specified. :*'''MF''' - Play music in the foreground (each note must be completed before another can start). :*'''MB''' - Play music in the background while program code execution continues (QB64 has no note buffer limits). @@ -37,56 +37,56 @@ ''Example 1:'' Plays a sound with the volume and note varying from 0 to 50. Maximum note can only be 84. {{CodeStart}} '' '' -{{Cl|PLAY}} "mll64" +{{Cl|PLAY}} "mll64" {{Cl|DO}} {{Cl|FOR...NEXT|FOR}} x = 1 {{Cl|TO}} 50 - a$ = a$ + "v" + {{Cl|LTRIM$}}({{Cl|STR$}}(x)) + "n" + {{Cl|LTRIM$}}({{Cl|STR$}}(x)) + a$ = a$ + "v" + {{Cl|LTRIM$}}({{Cl|STR$}}(x)) + "n" + {{Cl|LTRIM$}}({{Cl|STR$}}(x)) {{Cl|NEXT}} {{Cl|FOR...NEXT|FOR}} x = 50 {{Cl|TO}} 1 {{Cl|STEP}} -1 - a$ = a$ + "v" + {{Cl|LTRIM$}}({{Cl|STR$}}(x)) + "n" + {{Cl|LTRIM$}}({{Cl|STR$}}(x)) + a$ = a$ + "v" + {{Cl|LTRIM$}}({{Cl|STR$}}(x)) + "n" + {{Cl|LTRIM$}}({{Cl|STR$}}(x)) {{Cl|NEXT}} {{Cl|PLAY}} a$ - a$ = "" -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" -{{Cl|PLAY}} "v10l1c,l4egl2o5c,o4l4eg" '' '' + a$ = "" +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" +{{Cl|PLAY}} "v10l1c,l4egl2o5c,o4l4eg" '' '' {{CodeEnd}} {{small|Code by Galleon}} -''Example 2:'' Plays "Frosty the snowman". The lyric printing is not delayed by PLAY in QB64. +''Example 2:'' Plays "Frosty the snowman". The lyric printing is not delayed by PLAY in QB64. {{CodeStart}} '' '' -CLS : PRINT "Frosty the Snow Man" +CLS : PRINT "Frosty the Snow Man" {{Cl|FOR...NEXT|FOR}} X = 1 {{Cl|TO}} 2 PRINT - IF X = 1 THEN PRINT "Fros-ty the Snow man was a jolly happy soul," - IF X = 2 THEN PRINT "Fros-ty the Snow man knew the sun was hot that day" - {{Cl|PLAY}} "t140o2p4g2e4.f8g4o3c2o2b8o3c8d4c4o2b4a8g2." 'MB removed to print song one line at a time - IF X = 1 THEN PRINT "with a corn cob pipe and a button nose and two eyes made out of coal." - IF X = 2 THEN PRINT "so he said Let's run and we'll have some fun now before I melt away." - {{Cl|PLAY}} "o2b8o3c8d4c4o2b4a8a8g8o3c4o2e8e4g8a8g4f4e4f4g2." - IF X = 1 THEN PRINT "Fros-ty the Snow Man is a fair-y tale, they say," - IF X = 2 THEN PRINT "Down to the vil-lage, with a broom-stick in his hand," - {{Cl|PLAY}} "g2e4.f8g4o3c2o2b8o3c8d4c4o2b4a8g2." - IF X = 1 THEN PRINT "He was made of snow but the chil-dren knew how he come to life one day." - IF X = 2 THEN PRINT "run-ning here and there all a-round the square, say-in' catch me if you can." - {{Cl|PLAY}} "o2b8o3c8d4c4o2b4a8a8g8o3c4o2e8e4g8a8g4f4e4d4c2." - IF X = 1 THEN PRINT "There must have been some magic in that old silk hat they found." - IF X = 2 THEN PRINT "He led them down the streets of town right to the traffic cop." - {{Cl|PLAY}} "c4a4a4o3c4c4o2b4a4g4e4f4a4g4f4e2." - IF X = 1 THEN PRINT "For when they placed it on his head he be-gan to dance a round." - IF X = 2 THEN PRINT "And he on-ly paused a moment when he heard him hol-ler Stop!" - {{Cl|PLAY}} "e8e8d4d4g4g4b4b4o3d4d8o2b8o3d4c4o2b4a4g4p4" - IF X = 1 THEN PRINT "Oh, Fros-ty the Snow Man was a-live as he could be," - IF X = 2 THEN PRINT "For, Fros-ty the Snow Man had to hur-ry on his way" - {{Cl|PLAY}} "g2g2e4.f8g4o3c2o2b8o3c8d4c4o2b4a8g8g2." - IF X = 1 THEN PRINT "and the chil-dren say he could laugh and play just the same as you and me." - IF X = 2 THEN PRINT "but he waved good-bye say-in' Don't you cry, I'll be back a-gain some day." - {{Cl|PLAY}} "o2b8o3c8d4c4o2b4a8a8g8o3c4o2e8e4g8a8g4f4e4d4c2.p4" + IF X = 1 THEN PRINT "Fros-ty the Snow man was a jolly happy soul," + IF X = 2 THEN PRINT "Fros-ty the Snow man knew the sun was hot that day" + {{Cl|PLAY}} "t140o2p4g2e4.f8g4o3c2o2b8o3c8d4c4o2b4a8g2." 'MB removed to print song one line at a time + IF X = 1 THEN PRINT "with a corn cob pipe and a button nose and two eyes made out of coal." + IF X = 2 THEN PRINT "so he said Let's run and we'll have some fun now before I melt away." + {{Cl|PLAY}} "o2b8o3c8d4c4o2b4a8a8g8o3c4o2e8e4g8a8g4f4e4f4g2." + IF X = 1 THEN PRINT "Fros-ty the Snow Man is a fair-y tale, they say," + IF X = 2 THEN PRINT "Down to the vil-lage, with a broom-stick in his hand," + {{Cl|PLAY}} "g2e4.f8g4o3c2o2b8o3c8d4c4o2b4a8g2." + IF X = 1 THEN PRINT "He was made of snow but the chil-dren knew how he come to life one day." + IF X = 2 THEN PRINT "run-ning here and there all a-round the square, say-in' catch me if you can." + {{Cl|PLAY}} "o2b8o3c8d4c4o2b4a8a8g8o3c4o2e8e4g8a8g4f4e4d4c2." + IF X = 1 THEN PRINT "There must have been some magic in that old silk hat they found." + IF X = 2 THEN PRINT "He led them down the streets of town right to the traffic cop." + {{Cl|PLAY}} "c4a4a4o3c4c4o2b4a4g4e4f4a4g4f4e2." + IF X = 1 THEN PRINT "For when they placed it on his head he be-gan to dance a round." + IF X = 2 THEN PRINT "And he on-ly paused a moment when he heard him hol-ler Stop!" + {{Cl|PLAY}} "e8e8d4d4g4g4b4b4o3d4d8o2b8o3d4c4o2b4a4g4p4" + IF X = 1 THEN PRINT "Oh, Fros-ty the Snow Man was a-live as he could be," + IF X = 2 THEN PRINT "For, Fros-ty the Snow Man had to hur-ry on his way" + {{Cl|PLAY}} "g2g2e4.f8g4o3c2o2b8o3c8d4c4o2b4a8g8g2." + IF X = 1 THEN PRINT "and the chil-dren say he could laugh and play just the same as you and me." + IF X = 2 THEN PRINT "but he waved good-bye say-in' Don't you cry, I'll be back a-gain some day." + {{Cl|PLAY}} "o2b8o3c8d4c4o2b4a8a8g8o3c4o2e8e4g8a8g4f4e4d4c2.p4" NEXT X -PRINT : PRINT "Thump-et-y thump thump, thump-et-y thump thump, look at Fros-ty go." -{{Cl|PLAY}} "t180g8g8g4g4g4a8g8g4g4g4a4g4e4g4d1" -PRINT "Thump-et-y thump thump, thump-et-y thump thump, ov-er the hills of snow." -{{Cl|PLAY}} "t180g8g8g4g4g4a8g8g4g4g4g8g8g4a4b4o3c2c4p1" +PRINT : PRINT "Thump-et-y thump thump, thump-et-y thump thump, look at Fros-ty go." +{{Cl|PLAY}} "t180g8g8g4g4g4a8g8g4g4g4a4g4e4g4d1" +PRINT "Thump-et-y thump thump, thump-et-y thump thump, ov-er the hills of snow." +{{Cl|PLAY}} "t180g8g8g4g4g4a8g8g4g4g4g8g8g4a4b4o3c2c4p1" {{Cl|END}}'' '' {{CodeEnd}} {{small|Greg Rismoen 12/09/84}} @@ -98,11 +98,11 @@ PRINT "Thump-et-y thump thump, thump-et-y thump thump, ov-er the hills of s {{Cl|CONST}} maxx = 512 {{Cl|CONST}} maxy = 512 {{Cl|SCREEN (statement)|SCREEN}} {{Cl|_NEWIMAGE}}(maxx, maxy, 32) -{{Cl|_TITLE}} "MusicGrid" +{{Cl|_TITLE}} "MusicGrid" cleargrid {{Cl|DO}} - {{Cl|IF}} {{Cl|TIMER}} - t# > 1 / 8 {{Cl|THEN}} cur = (cur + 1) {{Cl|AND (boolean)|AND}} 15: t# = {{Cl|TIMER}} - {{Cl|IF}} cur <> oldcur {{Cl|THEN}} + {{Cl|IF}} {{Cl|TIMER}} - t# > 1 / 8 {{Cl|THEN}} cur = (cur + 1) {{Cl|AND (boolean)|AND}} 15: t# = {{Cl|TIMER}} + {{Cl|IF}} cur <> oldcur {{Cl|THEN}} figuregrid drawgrid playgrid @@ -110,7 +110,7 @@ cleargrid {{Cl|END IF}} domousestuff in$ = {{Cl|INKEY$}} - {{Cl|IF}} in$ = "C" {{Cl|OR (boolean)|OR}} in$ = "c" {{Cl|THEN}} cleargrid + {{Cl|IF}} in$ = "C" {{Cl|OR (boolean)|OR}} in$ = "c" {{Cl|THEN}} cleargrid {{Cl|LOOP}} {{Cl|UNTIL}} in$ = {{Cl|CHR$}}(27) {{Cl|SUB}} drawgrid @@ -156,13 +156,13 @@ scale2 = maxx \ 16 - 2 {{Cl|END SUB}} {{Cl|SUB}} playgrid -n$ = "L16 " -'scale$ = "O1CO1DO1EO1FO1GO1AO1BO2CO2DO2EO2FO2GO2AO2BO3CO3D" -scale$ = "o1fo1go1ao2co2do2fo2go2ao3co3do3fo3go3ao4co4do4fo" +n$ = "L16 " +'scale$ = "O1CO1DO1EO1FO1GO1AO1BO2CO2DO2EO2FO2GO2AO2BO3CO3D" +scale$ = "o1fo1go1ao2co2do2fo2go2ao3co3do3fo3go3ao4co4do4fo" {{Cl|FOR...NEXT|FOR}} y = 15 {{Cl|TO}} 0 {{Cl|STEP}} -1 {{Cl|IF}} grid(cur, y) = 1 {{Cl|THEN}} note$ = {{Cl|MID$}}(scale$, 1 + (15 - y) * 3, 3) - n$ = n$ + note$ + "," 'comma plays 2 or more column notes simultaneously + n$ = n$ + note$ + "," 'comma plays 2 or more column notes simultaneously {{Cl|END IF}} {{Cl|NEXT}} y n$ = {{Cl|LEFT$}}(n$, {{Cl|LEN}}(n$) - 1) @@ -189,7 +189,7 @@ n$ = {{Cl|LEFT$}}(n$, {{Cl|LEN}}(n$) - 1) {{Cl|SCREEN}} 12 ' the following works in other screen modes, too {{Cl|RANDOMIZE}} {{Cl|TIMER}} -{{Cl|PLAY}} "mb l4cf.l8el4fag.l8fl4gl8agl4f.l8fl4a>cl2dl4dl4c.<l8al4afg.l8fl4gl8agl4f.l8dl4dcl2f>l4dc.<l8al4afg.l8fl4g>dc.<l8al4a>cl2dl4dc.<l8al4afg.l8fl4gl8agl4f.l8dl4dcl1f" +{{Cl|PLAY}} "mb l4cf.l8el4fag.l8fl4gl8agl4f.l8fl4a>cl2dl4dl4c.<l8al4afg.l8fl4gl8agl4f.l8dl4dcl2f>l4dc.<l8al4afg.l8fl4g>dc.<l8al4a>cl2dl4dc.<l8al4afg.l8fl4gl8agl4f.l8dl4dcl1f" {{Cl|DIM}} ccs(1 {{Cl|TO}} 9, 1 {{Cl|TO}} 2) ccs(1, 1) = 415: ccs(1, 2) = 289 @@ -211,19 +211,19 @@ ccs(9, 1) = 2: ccs(9, 2) = 2 row = ccs(p, 1) cl = ccs(p, 2) glocate row, cl - gprint "000000000000000000000000000000000000000000000000000000000000000000000" + gprint "000000000000000000000000000000000000000000000000000000000000000000000" glocate row + 1, cl - gprint "0x00x0xxxx0xxxx0xxxx0x0x000x00x0xxxx0x000x000x0x0xxxx0xxxx0xxxx000x00" + gprint "0x00x0xxxx0xxxx0xxxx0x0x000x00x0xxxx0x000x000x0x0xxxx0xxxx0xxxx000x00" glocate row + 2, cl - gprint "0x00x0x00x0x00x0x00x0x0x000xx0x0x0000x000x000x0x0x0000x00x0x00x000x00" + gprint "0x00x0x00x0x00x0x00x0x0x000xx0x0x0000x000x000x0x0x0000x00x0x00x000x00" glocate row + 3, cl - gprint "0xxxx0xxxx0xxxx0xxxx0x0x000x0xx0xxx00x0x0x000x0x0xxx00xxxx0xxxx000x00" + gprint "0xxxx0xxxx0xxxx0xxxx0x0x000x0xx0xxx00x0x0x000x0x0xxx00xxxx0xxxx000x00" glocate row + 4, cl - gprint "0x00x0x00x0x0000x00000x0000x00x0x0000x0x0x0000x00x0000x00x0x0x0000000" + gprint "0x00x0x00x0x0000x00000x0000x00x0x0000x0x0x0000x00x0000x00x0x0x0000000" glocate row + 5, cl - gprint "0x00x0x00x0x0000x00000x0000x00x0xxxx0xx0xx0000x00xxxx0x00x0x00x000x00" + gprint "0x00x0x00x0x0000x00000x0000x00x0xxxx0xx0xx0000x00xxxx0x00x0x00x000x00" glocate row + 6, cl - gprint "000000000000000000000000000000000000000000000000000000000000000000000" + gprint "000000000000000000000000000000000000000000000000000000000000000000000" {{Cl|NEXT}} p {{Cl|SLEEP}} 1 {{Cl|IF...THEN|IF}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR...NEXT|FOR}} @@ -257,26 +257,28 @@ gposxp = column {{Cl|SHARED}} gscalep {{Cl|SHARED}} gposxp, gposyp {{Cl|SHARED}} gcolorp, gbackcolorp -' # means "use the foreground color here." -' . means "use the background color here." -' _ means "transparent - don't draw this block at all" (you can layer!) -' 0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f means "do color attribute 0 to 15." -' any letter after f: "use the foreground color here." +' # means "use the foreground color here." +' . means "use the background color here." +' _ means "transparent - don't draw this block at all" (you can layer!) +' 0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f means "do color attribute 0 to 15." +' any letter after f: "use the foreground color here." {{Cl|IF...THEN|IF}} gscalep < 1 {{Cl|THEN}} gscalep = 1 pcolorp = gcolorp {{Cl|FOR...NEXT|FOR}} p = 1 {{Cl|TO}} {{Cl|LEN}}(p$): {{Cl|SELECT CASE}} {{Cl|LCASE$}}({{Cl|MID$}}(p$, p, 1)) - {{Cl|CASE}} "#", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" + {{Cl|CASE}} "#", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" pcolorp = gcolorp - {{Cl|CASE}} "." + {{Cl|CASE}} "." pcolorp = gbackcolorp - {{Cl|CASE}} "_" + {{Cl|CASE}} "_" pcolorp = -1 - {{Cl|CASE}} "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" - pcolorp = {{Cl|INSTR}}("0123456789abcdef", {{Cl|LCASE$}}({{Cl|MID$}}(p$, p, 1))) - 1 + {{Cl|CASE}} "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" + pcolorp = {{Cl|INSTR}}("0123456789abcdef", {{Cl|LCASE$}}({{Cl|MID$}}(p$, p, 1))) - 1 {{Cl|END SELECT}} {{Cl|IF...THEN|IF}} {{Cl|NOT}} pcolorp = -1 {{Cl|THEN}} - {{Cl|IF...THEN|IF}} gscalep > 1 {{Cl|THEN}} + { +2b3c +{Cl|IF...THEN|IF}} gscalep > 1 {{Cl|THEN}} {{Cl|LINE}} ((gposxp - 1) * gscalep, (gposyp - 1) * gscalep)-{{Cl|STEP}}(gscalep - 1, gscalep - 1), pcolorp, BF {{Cl|ELSE}}: {{Cl|PSET}} (gposxp, gposyp), pcolorp @@ -293,33 +295,33 @@ glocate gposyp + 1, 1 'gposyp = gposyp + 1 ''Example 5:'' This example uses [[PRINT]] to good effect as string spacing is ignored by PLAY: {{CodeStart}} '' '' {{Cl|WIDTH}} 59, 28 -{{Cl|PRINT}} <nowiki> -x$ = x$ + " o3 l4 t 0120c ml<f1 ,a 1, " -x$ = x$ + " >c 1, mnf .e 8f am l< e1 ,g " -x$ = x$ + " 1, >c 1, mn g. f8 ga 8g 8m l< " -x$ = x$ + " f2.,a2., >c 2. ,m nf .f 8a ml<f " -x$ = x$ + " ,a,>c,mn >cd2.,<f2 .,d2 .,<b -2 " -x$ = x$ + " .m lb -,>d,f,mn>d ml <c 1, " -x$ = x$ + " <a 1, f1 ,m n> >c .< " -x$ = x$ + " a8 af ml c1 ,< e1 ,g " -x$ = x$ + " " -x$ = x$ + " 1,m n> g.f8ga8g8m l< f1 " -x$ = x$ + " ,d1, <b -1 ,m n> " -x$ = x$ + " >f .d 8d c< f2 ., " -x$ = x$ + " a2 ., c2 .,>f2. ml < b- " -x$ = x$ + " ,> d, f, mn>dml <c 1,< a1 " -x$ = x$ + " ,f 1, mn >> c. <a 8a fm " -x$ = x$ + " lc 2.,< e2 .,g2 .,mn " -x$ = x$ + " >g .f8 gml<b-,>d, f, mn " -x$ = x$ + " " -x$ = x$ + ">d ml <<f2.,a2., > c2.,m n> c." -x$ = x$ + " <a 8a ml <e, g, >c ,m n>" -x$ = x$ + " cm l< <b -2 ., >d 2. ,f 2." -x$ = x$ + " ,mn> d2.ml< <b -, >d ,f ,m n>" -x$ = x$ + " dm l<<f1, a1,>c1,mn >c.<a 8a fm" -x$ = x$ + " lc 1, <e1,g1,mn>g .f 8g a8 g8" -x$ = x$ + " ml << b- 1, >d 1, " -x$ = x$ + " f1 ,mn>f.d8dc l1 ml f, c, <a ,f"</nowiki> +{{Cl|PRINT}} <nowiki> +x$ = x$ + " o3 l4 t 0120c ml<f1 ,a 1, " +x$ = x$ + " >c 1, mnf .e 8f am l< e1 ,g " +x$ = x$ + " 1, >c 1, mn g. f8 ga 8g 8m l< " +x$ = x$ + " f2.,a2., >c 2. ,m nf .f 8a ml<f " +x$ = x$ + " ,a,>c,mn >cd2.,<f2 .,d2 .,<b -2 " +x$ = x$ + " .m lb -,>d,f,mn>d ml <c 1, " +x$ = x$ + " <a 1, f1 ,m n> >c .< " +x$ = x$ + " a8 af ml c1 ,< e1 ,g " +x$ = x$ + " " +x$ = x$ + " 1,m n> g.f8ga8g8m l< f1 " +x$ = x$ + " ,d1, <b -1 ,m n> " +x$ = x$ + " >f .d 8d c< f2 ., " +x$ = x$ + " a2 ., c2 .,>f2. ml < b- " +x$ = x$ + " ,> d, f, mn>dml <c 1,< a1 " +x$ = x$ + " ,f 1, mn >> c. <a 8a fm " +x$ = x$ + " lc 2.,< e2 .,g2 .,mn " +x$ = x$ + " >g .f8 gml<b-,>d, f, mn " +x$ = x$ + " " +x$ = x$ + ">d ml <<f2.,a2., > c2.,m n> c." +x$ = x$ + " <a 8a ml <e, g, >c ,m n>" +x$ = x$ + " cm l< <b -2 ., >d 2. ,f 2." +x$ = x$ + " ,mn> d2.ml< <b -, >d ,f ,m n>" +x$ = x$ + " dm l<<f1, a1,>c1,mn >c.<a 8a fm" +x$ = x$ + " lc 1, <e1,g1,mn>g .f 8g a8 g8" +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}} @@ -332,4 +334,4 @@ x$ = x$ + " f1 ,mn>f.d8dc l1 ml f, c, <a , * [[_SNDOPEN]] (play sound files) -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/PMAP.txt b/internal/help/PMAP.txt index 969323d6b..3402e02d2 100644 --- a/internal/help/PMAP.txt +++ b/internal/help/PMAP.txt @@ -60,4 +60,4 @@ Y = {{Cl|PMAP}}(479, 3) ' Y = 200 * [[VIEW PRINT]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/POINT.txt b/internal/help/POINT.txt index c5a016107..7d2f0f0d2 100644 --- a/internal/help/POINT.txt +++ b/internal/help/POINT.txt @@ -35,14 +35,14 @@ Graphic cursor position syntax: * '''POINT cannot be used in SCREEN 0!''' Use the [[SCREEN (function)|SCREEN]] function to point text character codes and colors in SCREEN 0. -<center>'''POINT in Qbasic Legacy Graphic SCREEN Modes:'''</center> +<center>'''POINT in Qbasic Legacy Graphic SCREEN Modes:'''</center> * The [[INTEGER]] color attributes returned are limited by the number of colors in the legacy SCREEN mode used. * ''Column'' and ''row'' [[INTEGER]] parameters denote the graphic pixel coordinate to read. -* In '''QB64''' the offscreen or off image value returned is -1. Use IF POINT(x, y) <> -1 THEN... +* In '''QB64''' the offscreen or off image value returned is -1. Use IF POINT(x, y) <> -1 THEN... * In Qbasic the coordinates MUST be on the screen or an [[ERROR Codes|Illegal Function Call error]] will occur. -<center>'''POINT in QB64 32 Bit Graphic [[_NEWIMAGE]] or [[_LOADIMAGE]] Modes:'''</center> +<center>'''POINT in QB64 32 Bit Graphic [[_NEWIMAGE]] or [[_LOADIMAGE]] Modes:'''</center> * Returns [[_UNSIGNED]] [[LONG]] 32 bit color values. Use [[_UNSIGNED]] values when you don't want negative values. * '''[[_UNSIGNED]] [[LONG]] variables should be used when comparing POINT returns with [[_RGB]] or [[_RGB32]] [[_ALPHA]] bit values''' * Convert 32 bit color values to RGB intensities(0 to 255) using the [[_RED32]], [[_GREEN32]] and [[_BLUE32]] functions. @@ -56,12 +56,12 @@ Graphic cursor position syntax: {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, 32) {{Cl|CLS}} , {{Cl|_RGB}}(255, 255, 255) 'makes the background opaque white -{{Cl|PRINT}} "POINT(100, 100) ="; {{Cl|POINT}}(100, 100) +{{Cl|PRINT}} "POINT(100, 100) ="; {{Cl|POINT}}(100, 100) clr = {{Cl|POINT}}(100, 100) -{{Cl|PRINT}} "Variable clr = "; clr -{{Cl|IF...THEN|IF}} clr = {{Cl|_RGB}}(255, 255, 255) {{Cl|THEN}} {{Cl|PRINT}} "Long OK" -{{Cl|IF...THEN|IF}} {{Cl|POINT}}(100, 100) = {{Cl|_RGB}}(255, 255, 255) {{Cl|THEN}} {{Cl|PRINT}} "_RGB OK" -{{Cl|IF...THEN|IF}} {{Cl|POINT}}(100, 100) = clr {{Cl|THEN}} {{Cl|PRINT}} "Type OK" 'will not print with a LONG variable type'' '' +{{Cl|PRINT}} "Variable clr = "; clr +{{Cl|IF...THEN|IF}} clr = {{Cl|_RGB}}(255, 255, 255) {{Cl|THEN}} {{Cl|PRINT}} "Long OK" +{{Cl|IF...THEN|IF}} {{Cl|POINT}}(100, 100) = {{Cl|_RGB}}(255, 255, 255) {{Cl|THEN}} {{Cl|PRINT}} "_RGB OK" +{{Cl|IF...THEN|IF}} {{Cl|POINT}}(100, 100) = clr {{Cl|THEN}} {{Cl|PRINT}} "Type OK" 'will not print with a LONG variable type'' '' {{CodeEnd}} :'''Note:''' Change the DIM ''clr'' variable type to [[LONG]] to see how the last IF statement doesn't PRINT as shown in the output below: {{OutputStart}}POINT(100, 100) = 4294967295 @@ -75,23 +75,23 @@ _RGB OK ''Example 2:'' Using a POINT mouse routine to get the 32 bit color values of the QB64 Bee. [http://www.qb64.net/forum/index.php Download image from top of Forum]. {{CodeStart}} '' '' {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, 32) -{{Cl|_TITLE}} "Mouse {{Cl|POINT}}er 32" +{{Cl|_TITLE}} "Mouse {{Cl|POINT}}er 32" -'{{Cl|LINE INPUT}} "Enter an image file: ", image$ 'use quotes around file names with spaces -image$ = "QB64bee.png" 'up to 320 X 240 with current {{Cl|_PUTIMAGE}} settings +'{{Cl|LINE INPUT}} "Enter an image file: ", image$ 'use quotes around file names with spaces +image$ = "QB64bee.png" 'up to 320 X 240 with current {{Cl|_PUTIMAGE}} settings i& = {{Cl|_LOADIMAGE}}(image$, 32) -{{Cl|IF...THEN|IF}} i& >= -1 {{Cl|THEN}} {{Cl|BEEP}}: {{Cl|PRINT}} "Could {{Cl|NOT}} load image!": {{Cl|END}} +{{Cl|IF...THEN|IF}} i& >= -1 {{Cl|THEN}} {{Cl|BEEP}}: {{Cl|PRINT}} "Could {{Cl|NOT}} load image!": {{Cl|END}} w& = {{Cl|_WIDTH (function)|_WIDTH}}(i&): h& = {{Cl|_HEIGHT}}(i&) -{{Cl|PRINT}} "Make background transparent?(Y\N)"; +{{Cl|PRINT}} "Make background transparent?(Y\N)"; BG$ = {{Cl|UCASE$}}({{Cl|INPUT$}}(1)) {{Cl|PRINT}} BG$ {{Cl|_DELAY}} 1 '{{Cl|CLS}} 'commented to keep background alpha 0 -{{Cl|IF...THEN|IF}} BG$ = "Y" {{Cl|THEN}} {{Cl|_CLEARCOLOR}} {{Cl|_RGB32}}(255, 255, 255), i& 'make white Background transparent +{{Cl|IF...THEN|IF}} BG$ = "Y" {{Cl|THEN}} {{Cl|_CLEARCOLOR}} {{Cl|_RGB32}}(255, 255, 255), i& 'make white Background transparent {{Cl|_PUTIMAGE}} (320 - w&, 240 - h&)-((2 * w&) + (320 - w&), (2 * h&) + (240 - h&)), i&, 0 {{Cl|_FREEIMAGE}} i& @@ -106,10 +106,10 @@ BG$ = {{Cl|UCASE$}}({{Cl|INPUT$}}(1)) g = {{Cl|_GREEN32}}(c&) b = {{Cl|_BLUE32}}(c&) a = {{Cl|_ALPHA32}}(c&) - {{Cl|LOCATE}} 1, 1: {{Cl|PRINT}} mx; my, "R:"; r, "G:"; g, "B:"; b, "A:"; a; " " - {{Cl|LOCATE}} 2, 2: {{Cl|PRINT}} "HTML Color: {{Cl|&H}}" + {{Cl|RIGHT$}}({{Cl|HEX$}}(c&), 6) + {{Cl|LOCATE}} 1, 1: {{Cl|PRINT}} mx; my, "R:"; r, "G:"; g, "B:"; b, "A:"; a; " " + {{Cl|LOCATE}} 2, 2: {{Cl|PRINT}} "HTML Color: {{Cl|&H}}" + {{Cl|RIGHT$}}({{Cl|HEX$}}(c&), 6) {{Cl|LOOP}} -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} > "" +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} > "" {{Cl|END}} '' '' {{CodeEnd}} {{small|Code by Ted Weissgerber}} @@ -151,4 +151,4 @@ BG$ = {{Cl|UCASE$}}({{Cl|INPUT$}}(1)) * [http://www.qb64.net/forum/index.php?topic=11052.0 Reading pixel colors faster using _MEMIMAGE] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/POKE.txt b/internal/help/POKE.txt index 73e6ec449..519708a83 100644 --- a/internal/help/POKE.txt +++ b/internal/help/POKE.txt @@ -51,7 +51,7 @@ The '''POKE''' statement sets the value of a specified memory address offset. '' {{Cl|POKE}} a&, {{Cl|PEEK}}((a& * 2) {{Cl|AND (boolean)|AND}} {{Cl|&H}}FFFF&) + 1 {{Cl|NEXT}} {{Cl|_LIMIT}} 25 -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" {{Cl|DEF SEG}} '' '' {{CodeEnd}} @@ -67,7 +67,7 @@ selection = 0 'the screen Y coordinate of the previously highlighted item {{Cl|IF}} selection {{Cl|THEN}} selectRow selection, minX, maxX, 0 x = {{Cl|CINT}}({{Cl|_MOUSEX}}) y = {{Cl|CINT}}({{Cl|_MOUSEY}}) - {{Cl|IF}} x >= minX {{Cl|AND (boolean)|AND}} x <= maxX {{Cl|AND (boolean)|AND}} y >= minY {{Cl|AND (boolean)|AND}} y <= maxY {{Cl|THEN}} + {{Cl|IF}} x >= minX {{Cl|AND (boolean)|AND}} x <= maxX {{Cl|AND (boolean)|AND}} y >= minY {{Cl|AND (boolean)|AND}} y <= maxY {{Cl|THEN}} selection = y {{Cl|ELSE}} selection = 0 @@ -76,7 +76,7 @@ selection = 0 'the screen Y coordinate of the previously highlighted item {{Cl|IF}} selection {{Cl|THEN}} SelectRow selection, minX, maxX, 2 {{Cl|IF}} {{Cl|_MOUSEBUTTON}}(1) {{Cl|THEN}} {{Cl|LOCATE}} 1, 2: {{Cl|PRINT}} x, y, selection {{Cl|END IF}} -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" {{Cl|SUB}} SelectRow (y, x1, x2, col) {{Cl|DEF SEG}} = {{Cl|&H}}B800 @@ -102,4 +102,4 @@ addr& = (x1 - 1 + (y - 1) * {{Cl|_WIDTH (function)|_WIDTH}}) * 2 + 1 * [[PEEK and POKE Library]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/POS.txt b/internal/help/POS.txt index 439eecb48..63a11ded6 100644 --- a/internal/help/POS.txt +++ b/internal/help/POS.txt @@ -15,10 +15,10 @@ The '''POS''' function returns the current print cursor text column position. ''Example:'' Column positions after prints. {{CodeStart}} '' '' {{Cl|PRINT}} {{Cl|POS}}(0) 'column position always starts on 1 at top of new or after {{Cl|CLS}} -{{Cl|PRINT}} "hello"; 'column position is 6 on same row immediately after text +{{Cl|PRINT}} "hello"; 'column position is 6 on same row immediately after text {{Cl|PRINT}} {{Cl|POS}}(0) {{Cl|PRINT}} 'start new row -{{Cl|PRINT}} "hello", 'column position is 15 on same row (normally tabs 9 spaces) +{{Cl|PRINT}} "hello", 'column position is 15 on same row (normally tabs 9 spaces) {{Cl|PRINT}} {{Cl|POS}}(0) {{Cl|PRINT}} 'start new row {{Cl|PRINT}} @@ -32,4 +32,4 @@ The '''POS''' function returns the current print cursor text column position. * [[_PRINTSTRING]] {{text|(graphic position print)}} -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/PRESET.txt b/internal/help/PRESET.txt index ea58a1c14..da685bdef 100644 --- a/internal/help/PRESET.txt +++ b/internal/help/PRESET.txt @@ -24,7 +24,7 @@ The '''PRESET''' graphic [[SCREEN]] statement turns a pixel at a coordinate to t {{CodeStart}} '' '' SCREEN 12 {{Cl|PRESET}}(100, 100) -{{Cl|DRAW}} "C12 U20 R20 D20 L20" '' '' +{{Cl|DRAW}} "C12 U20 R20 D20 L20" '' '' {{CodeEnd}} :''Explanation:'' The [[DRAW]] string required a color designation as PRESET defaulted to the black background color. @@ -42,27 +42,27 @@ TERMINATE {{Cl|END}} {{Cl|SUB}} ARRAY -c$(1) = "Armenia H040914" -c$(2) = "Austria H041504" -c$(3) = "Belgium V001404" -c$(4) = "Bulgaria H150204" -c$(5) = "Chad V011404" -c$(6) = "C“te D'Ivoire V061502" -c$(7) = "Estonia H090015" -c$(8) = "France V011504" -c$(9) = "Germany H000414" -c$(10) = "Hungary H041502" -c$(11) = "Ireland V021506" -c$(12) = "Italy V021504" -c$(13) = "Lithuania H140204" -c$(14) = "Luxembourg H041509" -c$(15) = "Mali V021404" -c$(16) = "Netherlands H041501" -c$(17) = "Nigeria V021502" -c$(18) = "Romania V091404" -c$(19) = "Russia H150104" -c$(20) = "Sierra Leone H021509" -c$(21) = "Yemen H041500" +c$(1) = "Armenia H040914" +c$(2) = "Austria H041504" +c$(3) = "Belgium V001404" +c$(4) = "Bulgaria H150204" +c$(5) = "Chad V011404" +c$(6) = "C“te D'Ivoire V061502" +c$(7) = "Estonia H090015" +c$(8) = "France V011504" +c$(9) = "Germany H000414" +c$(10) = "Hungary H041502" +c$(11) = "Ireland V021506" +c$(12) = "Italy V021504" +c$(13) = "Lithuania H140204" +c$(14) = "Luxembourg H041509" +c$(15) = "Mali V021404" +c$(16) = "Netherlands H041501" +c$(17) = "Nigeria V021502" +c$(18) = "Romania V091404" +c$(19) = "Russia H150104" +c$(20) = "Sierra Leone H021509" +c$(21) = "Yemen H041500" {{Cl|END SUB}} {{Cl|SUB}} DISPLAY.FLAG (calc%) @@ -70,13 +70,13 @@ f% = {{Cl|VAL}}({{Cl|MID$}}(x$(calc%), 2, 2)) s% = {{Cl|VAL}}({{Cl|MID$}}(x$(calc%), 4, 2)) t% = {{Cl|VAL}}({{Cl|MID$}}(x$(calc%), 6, 2)) -{{Cl|IF...THEN|IF}} {{Cl|LEFT$}}(x$(calc%), 1) = "V" {{Cl|THEN}} +{{Cl|IF...THEN|IF}} {{Cl|LEFT$}}(x$(calc%), 1) = "V" {{Cl|THEN}} {{Cl|LINE}} (120, 225)-(253, 465), f%, BF {{Cl|LINE}} (254, 225)-(385, 465), s%, BF {{Cl|LINE}} (386, 225)-(519, 465), t%, BF {{Cl|END IF}} -{{Cl|IF...THEN|IF}} {{Cl|LEFT$}}(x$(calc%), 1) = "H" {{Cl|THEN}} +{{Cl|IF...THEN|IF}} {{Cl|LEFT$}}(x$(calc%), 1) = "H" {{Cl|THEN}} {{Cl|LINE}} (120, 225)-(519, 305), f%, BF {{Cl|LINE}} (120, 306)-(519, 386), s%, BF {{Cl|LINE}} (120, 387)-(519, 465), t%, BF @@ -87,15 +87,15 @@ t% = {{Cl|VAL}}({{Cl|MID$}}(x$(calc%), 6, 2)) x% = 2: y% = 4 DO - {{Cl|WHILE}} (x% <> prevx% {{Cl|OR (boolean)|OR}} y% <> prevy%) {{Cl|AND (boolean)|AND}} k$ <> {{Cl|CHR$}}(27) + {{Cl|WHILE}} (x% <> prevx% {{Cl|OR (boolean)|OR}} y% <> prevy%) {{Cl|AND (boolean)|AND}} k$ <> {{Cl|CHR$}}(27) k$ = {{Cl|INKEY$}} - x% = x% + (k$ = ({{Cl|CHR$}}(0) + "K") {{Cl|AND (boolean)|AND}} x% > 1) + {{Cl|ABS}}(k$ = ({{Cl|CHR$}}(0) + "M") {{Cl|AND (boolean)|AND}} x% < 3) - y% = y% + (k$ = ({{Cl|CHR$}}(0) + "H") {{Cl|AND (boolean)|AND}} y% > 1) + {{Cl|ABS}}(k$ = ({{Cl|CHR$}}(0) + "P") {{Cl|AND (boolean)|AND}} y% < 7) + x% = x% + (k$ = ({{Cl|CHR$}}(0) + "K") {{Cl|AND (boolean)|AND}} x% > 1) + {{Cl|ABS}}(k$ = ({{Cl|CHR$}}(0) + "M") {{Cl|AND (boolean)|AND}} x% < 3) + y% = y% + (k$ = ({{Cl|CHR$}}(0) + "H") {{Cl|AND (boolean)|AND}} y% > 1) + {{Cl|ABS}}(k$ = ({{Cl|CHR$}}(0) + "P") {{Cl|AND (boolean)|AND}} y% < 7) calc% = (x% - 1) * 7 + y%: {{Cl|LOCATE}} 14, 18: {{Cl|PRINT}} c$(calc%); {{Cl|SPACE$}}(10) x1% = 140 + (x% - 1) * 128 x2% = x1% + {{Cl|LEN}}(c$(calc%)) * 8 + 7 y1% = 48 + y% * 16 - {{Cl|IF...THEN|IF}} x1% <> prevx1% {{Cl|OR (boolean)|OR}} y1% <> prevy1% {{Cl|THEN}} + {{Cl|IF...THEN|IF}} x1% <> prevx1% {{Cl|OR (boolean)|OR}} y1% <> prevy1% {{Cl|THEN}} {{Cl|IF...THEN|IF}} g% {{Cl|THEN}} {{Cl|PUT (graphics statement)|PUT}}(prevx1%, prevy1%), gg%(), {{Cl|PSET}} {{Cl|GET (graphics statement)|GET}}(x1%, y1%)-(x2%, y1% + 16), gg%(): g% = 1 {{Cl|PUT (graphics statement)|PUT}}(x1%, y1%), gg%(), {{Cl|PRESET}} @@ -119,7 +119,7 @@ c% = 1 c% = c% + 1 {{Cl|NEXT}} y%, x% -{{Cl|COLOR}} 11: {{Cl|LOCATE}} 3, 20: {{Cl|PRINT}} "Use the Cursor Keys to Select a Country:" +{{Cl|COLOR}} 11: {{Cl|LOCATE}} 3, 20: {{Cl|PRINT}} "Use the Cursor Keys to Select a Country:" {{Cl|LINE}} (119, 224)-(520, 466), 7, B {{Cl|END SUB}} @@ -139,4 +139,4 @@ c% = 1 * [[CIRCLE]], [[LINE]], [[PSET]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/PRINT.txt b/internal/help/PRINT.txt index 4a16d511d..dc09a15b5 100644 --- a/internal/help/PRINT.txt +++ b/internal/help/PRINT.txt @@ -17,14 +17,14 @@ The {{KW|PRINT}} statement prints numeric or string expressions to the program s ** [[SPACE$]]({{Parameter|n%}}) or [[SPC]]({{Parameter|n%}}) - specifies that {{Parameter|n%}} space characters will be printed. ** [[TAB]]({{Parameter|column%}}) - specifies that the print cursor is to move to column number {{Parameter|column%}}. If the print cursor is already beyond that column, it is moved to the designated column on the next row. * A ''separator'' is used to separate multiple expressions and specifies how the print cursor is to be moved: -** [[Semicolon]](;) - specifies that the print cursor stops at the end of the printed ''expression'' and may append later ''expressions'' or prints. PRINT ; or PRINT ""; will stop cursor movement and append later prints. Ending [[semicolon]]s can also stop screen roll. +** [[Semicolon]](;) - specifies that the print cursor stops at the end of the printed ''expression'' and may append later ''expressions'' or prints. PRINT ; or PRINT ""; will stop cursor movement and append later prints. Ending [[semicolon]]s can also stop screen roll. ** [[Comma]](,) - specifies that the print cursor is to move to the next 14-column tab-stop. If the print cursor is at column 56 or greater, it is moved to the next row at column 1. When used after an ''expression'' it may Tab-stop append later prints. ** [[+|Plus]](+) uses [[concatenation]] to add [[STRING]] expressions ONLY with no spacing. '''Cannot combine numerical ''expression''s!''' ** If a {{Parameter|separator}} is not used at the end of the expression list, the print cursor moves to the next row at column 1. * When '''printing numerical''' ''expressions'' values, the following rules are used: ** If the value is positive, the number is prefixed with a space character, otherwise, the number is prefixed with a negative sign (-). ** If the value is an integer (whole number), no decimal point or fractional part will be printed. -** If the value is not an [[INTEGER|integer]](whole number) and has zero for a coefficient, no leading zero is printed. EX: -0.123 prints "-.123 " +** If the value is not an [[INTEGER|integer]](whole number) and has zero for a coefficient, no leading zero is printed. EX: -0.123 prints "-.123 " ** If the expression is in [[scientific notation]], the number is also printed in scientific notation. ** The number is [[PRINT|printed]] with a space after it unless [[STR$]](number) is used to convert it to string text. ** Numerical values MUST be added to a PRINT statement string using [[comma]]s or [[semicolon]]s on each side of the value or by using [[STR$]] to convert the value to a string to use [[concatenation]] (+ string addition). @@ -46,29 +46,29 @@ The {{KW|PRINT}} statement prints numeric or string expressions to the program s ''Example 1:'' Using semicolons, comma tabs or concatenation to insert [[ASCII]] characters and numbers in a PRINT: {{CodeStart}} -{{Cl|PRINT}} CHR$(34); "Hello world!"; CHR$(34) ' adding quotation marks +{{Cl|PRINT}} CHR$(34); "Hello world!"; CHR$(34) ' adding quotation marks {{Cl|PRINT}} 123 'demonstrates the positive leading space -a$ = "Hello country!": a = 321: b = -321 +a$ = "Hello country!": a = 321: b = -321 {{Cl|PRINT}} a$, a ' demonstrates comma in statement {{Cl|PRINT}} a$; a ' demonstrates semicolon in statement {{Cl|PRINT}} a$ + {{Cl|STR$}}(b) ' concatenation of string numerical values only -? "Hello city!" ' a ? changes to PRINT after moving cursor from the code line in IDE +? "Hello city!" ' a ? changes to PRINT after moving cursor from the code line in IDE {{CodeEnd}} -{{OutputStart}}"Hello world!" +{{OutputStart}}"Hello world!" 123 Hello country! 321 Hello country! 321 Hello country!-321 Hello city! {{OutputEnd}} -:First PRINT prints the text between two quotation marks, then it prints the value 123, notice that there are no quotation marks when printing the value, quotation marks mean that it will be treated like a literal string of text. a$ is set to "Hello country" and 'a' is set to the value 321, the dollar sign is used when a variable holds the text string. The contents of a$ is then printed and the "," means that the value of 'a' is printed separated by a tab and ";" means that there is no separation from the other text except for the leading positive value space. +:First PRINT prints the text between two quotation marks, then it prints the value 123, notice that there are no quotation marks when printing the value, quotation marks mean that it will be treated like a literal string of text. a$ is set to "Hello country" and 'a' is set to the value 321, the dollar sign is used when a variable holds the text string. The contents of a$ is then printed and the "," means that the value of 'a' is printed separated by a tab and ";" means that there is no separation from the other text except for the leading positive value space. ''Example 2:'' Changing colors in a line of text using semicolons with colon separators between PRINTs on the same code line. {{CodeStart}} -{{Cl|COLOR}} 12: {{Cl|PRINT}} "Start red "; : {{Cl|COLOR}} 10: {{Cl|PRINT}} "and end green." -{{Cl|COLOR}} 11: {{Cl|PRINT}} "Start aqua "; -{{Cl|COLOR}} 14: {{Cl|PRINT}} "and end blue." +{{Cl|COLOR}} 12: {{Cl|PRINT}} "Start red "; : {{Cl|COLOR}} 10: {{Cl|PRINT}} "and end green." +{{Cl|COLOR}} 11: {{Cl|PRINT}} "Start aqua "; +{{Cl|COLOR}} 14: {{Cl|PRINT}} "and end blue." {{CodeEnd}} {{OutputStart}}{{text|Start red|#FF1515}} {{text|and end green.|#15FF15}} {{text|Start aqua|#15FFFF}} {{text|and end blue.|#0000FF}} {{OutputEnd}} @@ -84,4 +84,4 @@ Hello city! * [[Text Using Graphics]] (Demo) -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/PRINT_(TCP%2FIP_statement).txt b/internal/help/PRINT_(TCP%2FIP_statement).txt index 7e025f655..43b720c44 100644 --- a/internal/help/PRINT_(TCP%2FIP_statement).txt +++ b/internal/help/PRINT_(TCP%2FIP_statement).txt @@ -30,7 +30,7 @@ The '''PRINT #''' statement sends QB64 formatted data to an open connection hand {{CodeStart}} '''PRINT #'''c, a$ ' sends the string a$ (size is known to INPUT #) '''PRINT #'''c, x% ' if x was equal to 5, this would send ' 5 ' (without the quotes) - {{Cl|INPUT (TCP/IP statement)|INPUT}} #o, a$ ' reads the next available message (if arrived) or sets a$ = "" + {{Cl|INPUT (TCP/IP statement)|INPUT}} #o, a$ ' reads the next available message (if arrived) or sets a$ = "" {{CodeEnd}} ''Explanation:'' INPUT #o, x% effectively reads the next message, performs the VAL function upon it and stores the result in x% (if any part of this process isn't complete then [[EOF]](o) will return -1. @@ -39,8 +39,8 @@ The '''PRINT #''' statement sends QB64 formatted data to an open connection hand ''Example 2:'' Host sends multiple values using PRINT #. {{CodeStart}} - '''PRINT #'''c, 3; "Hello "; "World"; ' client sends data - '''PRINT #'''c, "!" + '''PRINT #'''c, 3; "Hello "; "World"; ' client sends data + '''PRINT #'''c, "!" {{CodeEnd}} @@ -51,10 +51,10 @@ The '''PRINT #''' statement sends QB64 formatted data to an open connection hand DO {{Cl|_LIMIT}} 1000 'limits CPU usage {{Cl|INPUT (TCP/IP statement)|INPUT}} #h, a$ - LOOP UNTIL {{Cl|LEN}}(a$) OR TIMER > t! + LOOP UNTIL {{Cl|LEN}}(a$) OR TIMER > t! {{CodeEnd}} -''Explanation:'' The loop runs 3 seconds or until the full data arrives. The value of a$ is " 3 Hello World!" or "" if all 4 messages haven't arrived yet. +''Explanation:'' The loop runs 3 seconds or until the full data arrives. The value of a$ is " 3 Hello World!" or "" if all 4 messages haven't arrived yet. ''Example 4:'' Client reads host's Example 2 data as one value using [[EOF]]. @@ -63,7 +63,7 @@ The '''PRINT #''' statement sends QB64 formatted data to an open connection hand DO {{Cl|_LIMIT}} 1000 'limits CPU usage {{Cl|INPUT (TCP/IP statement)|INPUT}} #h, a%,b$,c$,d$ ' reads data from host until EOF(h) = 0 - IF TIMER > t! THEN {{Cl|EXIT DO}} ' timeout read if over 3 seconds + IF TIMER > t! THEN {{Cl|EXIT DO}} ' timeout read if over 3 seconds LOOP WHILE {{Cl|EOF}}(h) {{CodeEnd}} @@ -79,4 +79,4 @@ The '''PRINT #''' statement sends QB64 formatted data to an open connection hand * [[TCP/IP Message Format]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/PRINT_(file_statement).txt b/internal/help/PRINT_(file_statement).txt index f035f9e82..52f3160e0 100644 --- a/internal/help/PRINT_(file_statement).txt +++ b/internal/help/PRINT_(file_statement).txt @@ -23,17 +23,17 @@ The [[PRINT (file statement)|PRINT #]] statement prints numeric or string expres * When printing literal or variable numerical values the following rules apply: ** If the value is positive, the number is prefixed with a space character, otherwise, the number is prefixed with a negative sign (-). ** If the value is an [[INTEGER]] (whole number), no decimal point or fractional part will be written. -** If the value is not an integer (whole number) and has zero for a coefficient, no leading zero is written. For example, -0.123 is written as "-.123 " +** If the value is not an integer (whole number) and has zero for a coefficient, no leading zero is written. For example, -0.123 is written as "-.123 " ** If a numeric literal is in scientific notation, the number is also written in scientific notation. [[PRINT USING (file statement)|PRINT #, USING]] can return actual rounded numerical values in string form. ** The numerical value is always followed by a space character unless [[STR$]] is used to convert it to a string value. -* Whenever [[PRINT (file statement)|PRINT #]] moves the file cursor to a new file row, a carriage return character ({{KW|CHR$|CHR$(13)}}) followed by a line feed character ({{KW|CHR$|CHR$(10)}}) is written. The combination are referred to as the "CRLF" character. +* Whenever [[PRINT (file statement)|PRINT #]] moves the file cursor to a new file row, a carriage return character ({{KW|CHR$|CHR$(13)}}) followed by a line feed character ({{KW|CHR$|CHR$(10)}}) is written. The combination are referred to as the "CRLF" character. * '''Note: [[RANDOM]] and [[BINARY]] files are not affected by PRINT # statements to them and will create a syntax error in QB64!''' ''Example:'' Prints data to a text file sequentially and reads it back to the program screen as one line of text. {{CodeStart}} '' '' -filename$ = "testfile.dat" -x = 1: y = 2: z$ = "Three" +filename$ = "testfile.dat" +x = 1: y = 2: z$ = "Three" {{Cl|OPEN}} filename$ {{Cl|FOR...NEXT|FOR}} {{Cl|OUTPUT}} {{Cl|AS}} #1 'opens and clears an existing file or creates new empty file @@ -41,7 +41,7 @@ x = 1: y = 2: z$ = "Three" {{Cl|CLOSE}} #1 -{{Cl|PRINT}} "File created with data. Press a key!" +{{Cl|PRINT}} "File created with data. Press a key!" K$ = {{Cl|INPUT$}}(1) 'press a key @@ -60,7 +60,7 @@ K$ = {{Cl|INPUT$}}(1) 'press a key {{TextStart}} 1 2 Three'' '' {{TextEnd}} : ''Screen output:'' [[PRINT]] string values will not display enclosing quotation marks. [[WRITE]] screen displays will. {{OutputStart}} 1 2 Three -" 1 2 Three" +" 1 2 Three" {{OutputEnd}} @@ -73,4 +73,4 @@ K$ = {{Cl|INPUT$}}(1) 'press a key * [[OPEN]], [[LPRINT]], [[WRITE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/PRINT_USING.txt b/internal/help/PRINT_USING.txt index 1f0020c19..07b0b1499 100644 --- a/internal/help/PRINT_USING.txt +++ b/internal/help/PRINT_USING.txt @@ -15,7 +15,7 @@ The '''PRINT USING''' statement is used to [[PRINT]] formatted data to the Scree ''Usage:'' * The ''variables'' should be listed in the order that they are used in the template from left to right. -* '''If the ''template'' string is omitted or symbols don't match the ''variable(s)'' an "Illegal Function Call" [[ERROR Codes|ERROR]] will occur!''' +* '''If the ''template'' string is omitted or symbols don't match the ''variable(s)'' an "Illegal Function Call" [[ERROR Codes|ERROR]] will occur!''' * No more than 25 # digit places are allowed in a template number or an [[ERROR Codes|error]] will occur. * Can convert numerical exponential or [[scientific notation]] values to normal decimal point values using less digits. * '''NOTE:''' If the numerical value exceeds the template's digit range a % symbol will appear in the leftmost digit area. @@ -27,9 +27,9 @@ The '''PRINT USING''' statement is used to [[PRINT]] formatted data to the Scree ''Example 1:'' Printing formatted data using a predefined [[STRING|string]] template variable. {{CodeStart}} '' '' -first$ = "Bobby": last$ = "Smith" +first$ = "Bobby": last$ = "Smith" boxes% = 1510: sales! = 4530 -tmp$ = "Salesperson: & & #####,. $$#####,.##" +tmp$ = "Salesperson: & & #####,. $$#####,.##" {{Cl|PRINT USING}} tmp$; first$; last$; boxes%; sales! {{CodeEnd}} '' '' @@ -41,9 +41,9 @@ tmp$ = "Salesperson: & & #####,. $$#####,.##" ''Example 2:'' How to display formatting symbols as normal text using underscores in a PRINT USING template. {{CodeStart}} '' '' errcode = 35 -{{Cl|PRINT USING}} "Error ## occurred!!"; errcode +{{Cl|PRINT USING}} "Error ## occurred!!"; errcode 'now there are the !! at the end of the printed string -{{Cl|PRINT USING}} "Error ## occurred_!_!"; errcode +{{Cl|PRINT USING}} "Error ## occurred_!_!"; errcode {{Cl|END}} '' {{CodeEnd}} {{OutputStart}}Error 35 occurred @@ -54,10 +54,10 @@ Error 35 occurred!! ''Example 3:'' Exponential notation is designated after the leading digits are formatted. Digit places determine rounded value displayed. {{CodeStart}} -{{Cl|PRINT USING}} "##.##^^^^"; 234.56 -{{Cl|PRINT USING}} ".####^^^^-"; -777777 -{{Cl|PRINT USING}} "+.##^^^^"; 123 -{{Cl|PRINT USING}} "+.##^^^^^"; 123 '' '' +{{Cl|PRINT USING}} "##.##^^^^"; 234.56 +{{Cl|PRINT USING}} ".####^^^^-"; -777777 +{{Cl|PRINT USING}} "+.##^^^^"; 123 +{{Cl|PRINT USING}} "+.##^^^^^"; 123 '' '' {{CodeEnd}} {{OutputStart}} 2.35E+02 .7778E+06- @@ -70,9 +70,9 @@ Error 35 occurred!! ''Example 4:'' USING does not necessarily have to immediately follow PRINT, but it must follow it in the code line. {{CodeStart}} '' '' money = 12345.45 -tmp$ = "$$#######,.##" +tmp$ = "$$#######,.##" -{{Cl|PRINT}} "I have this much money!"; {{Cl|PRINT USING|USING}} tmp$; money '' '' +{{Cl|PRINT}} "I have this much money!"; {{Cl|PRINT USING|USING}} tmp$; money '' '' {{CodeEnd}} : ''Note:'' This can also be used to print the USING formatting characters outside of the template. @@ -82,4 +82,4 @@ tmp$ = "$$#######,.##" * [[LPRINT]], [[LPRINT USING]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/PRINT_USING_(file_statement).txt b/internal/help/PRINT_USING_(file_statement).txt index fe64d28c2..69320c8b0 100644 --- a/internal/help/PRINT_USING_(file_statement).txt +++ b/internal/help/PRINT_USING_(file_statement).txt @@ -16,7 +16,7 @@ The '''PRINT #, USING''' statement is used to [[PRINT]] formatted text data to a ''Usage:'' -* '''If the ''template'' string is omitted or symbols don't match the ''variable(s)'' an "Illegal Function Call" [[ERROR Codes|ERROR]] will occur!''' +* '''If the ''template'' string is omitted or symbols don't match the ''variable(s)'' an "Illegal Function Call" [[ERROR Codes|ERROR]] will occur!''' * The list of data variables used in the template are '''separated by semicolons''' after the template string value. * The variables should be listed in the order that they are used in the template from left to right. * Normal text is allowed in the template also (see example). @@ -32,4 +32,4 @@ The '''PRINT #, USING''' statement is used to [[PRINT]] formatted text data to a * [[LPRINT USING]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/PSET.txt b/internal/help/PSET.txt index 34e5a18ae..d3b63075c 100644 --- a/internal/help/PSET.txt +++ b/internal/help/PSET.txt @@ -23,7 +23,7 @@ The '''PSET''' grahics [[SCREEN (statement)|SCREEN]] statement sets a pixel to a {{CodeStart}} '' '' SCREEN 12 {{Cl|PSET}}(100, 100), 12 -{{Cl|DRAW}} "U20 R20 D20 L20" '' '' +{{Cl|DRAW}} "U20 R20 D20 L20" '' '' {{CodeEnd}} :''Screen results:'' A drawn box that is bright red. @@ -61,7 +61,7 @@ DO {{Cl|DIM}} inc {{Cl|AS}} {{Cl|DOUBLE}}, left {{Cl|AS}} {{Cl|DOUBLE}}, top {{Cl|AS}} {{Cl|DOUBLE}} limitx = 150 * ({{Cl|LOG}}(mag) + 1) - {{Cl|IF...THEN|IF}} limitx > 32767 {{Cl|THEN}} limitx = 32767 + {{Cl|IF...THEN|IF}} limitx > 32767 {{Cl|THEN}} limitx = 32767 limit = {{Cl|INT}}(limitx) inc = .004 / mag left = a - inc * 319 @@ -100,7 +100,7 @@ DO {{Cl|IF...THEN|IF}} dmag < 2 {{Cl|THEN}} dmag = 2 {{Cl|CASE}} {{Cl|CHR$}}(0) + {{Cl|CHR$}}(80) dmag = dmag * 2 - {{Cl|IF...THEN|IF}} dmag > 128 {{Cl|THEN}} dmag = 128 + {{Cl|IF...THEN|IF}} dmag > 128 {{Cl|THEN}} dmag = 128 {{Cl|END SELECT}} {{Cl|WEND}} {{Cl|CALL}} rectangle(mx - dx, my - dy, mx + dx, my + dy) @@ -118,7 +118,7 @@ DO t = a * a - b * b + x b = 2 * a * b + y: a = t n = n + 1 - {{Cl|LOOP}} {{Cl|UNTIL}} a * a + b * b > 4 {{Cl|OR (boolean)|OR}} n > limit + {{Cl|LOOP}} {{Cl|UNTIL}} a * a + b * b > 4 {{Cl|OR (boolean)|OR}} n > limit mandel = n {{Cl|END FUNCTION}} @@ -160,4 +160,4 @@ y={{Cl|_MOUSEY}} * [[Text Using Graphics]] (Demo) -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/PUT.txt b/internal/help/PUT.txt index 2dee60b6a..ef33f9ab4 100644 --- a/internal/help/PUT.txt +++ b/internal/help/PUT.txt @@ -28,13 +28,13 @@ The '''PUT #''' file or port statement writes data to a specific byte or record {{Cl|END}} {{Cl|TYPE}} {{Cl|DIM}} Contact {{Cl|AS}} ContactType -{{Cl|INPUT}} "Enter a first name: ", Contact.first -{{Cl|INPUT}} "Enter a last name: ", Contact.last -{{Cl|INPUT}} "Enter an age: ", Contact.age +{{Cl|INPUT}} "Enter a first name: ", Contact.first +{{Cl|INPUT}} "Enter a last name: ", Contact.last +{{Cl|INPUT}} "Enter an age: ", Contact.age -{{Cl|OPEN}} "Record.lst" {{Cl|FOR...NEXT|FOR}} {{Cl|RANDOM}} {{Cl|AS}} #1 {{Cl|LEN}} = {{Cl|LEN}}(Contact) +{{Cl|OPEN}} "Record.lst" {{Cl|FOR...NEXT|FOR}} {{Cl|RANDOM}} {{Cl|AS}} #1 {{Cl|LEN}} = {{Cl|LEN}}(Contact) NumRecords% = {{Cl|LOF}}(1) \ {{Cl|LEN}}(Contact) -{{Cl|PRINT}} NumRecords%; "previous records" +{{Cl|PRINT}} NumRecords%; "previous records" {{Cl|PUT}} #1, NumRecords% + 1, Contact ' add a new record {{Cl|TYPE}} record value {{Cl|CLOSE}} #1 '' '' @@ -51,7 +51,7 @@ NumRecords% = {{Cl|LOF}}(1) \ {{Cl|LEN}}(Contact) {{Cl|NEXT}} showme 'display array contents -{{Cl|OPEN}} "BINFILE.BIN" {{Cl|FOR...NEXT|FOR}} {{Cl|BINARY}} {{Cl|AS}} #1 +{{Cl|OPEN}} "BINFILE.BIN" {{Cl|FOR...NEXT|FOR}} {{Cl|BINARY}} {{Cl|AS}} #1 {{Cl|PUT}} #1, , array() @@ -59,7 +59,7 @@ showme 'display array contents showme {{Cl|CLOSE}} #1 -{{Cl|OPEN}} "BINFILE.BIN" {{Cl|FOR...NEXT|FOR}} {{Cl|BINARY}} {{Cl|AS}} #2 +{{Cl|OPEN}} "BINFILE.BIN" {{Cl|FOR...NEXT|FOR}} {{Cl|BINARY}} {{Cl|AS}} #2 {{Cl|GET}} #2, , array() {{Cl|CLOSE}} #2 showme 'display array after transfer from file @@ -70,7 +70,7 @@ showme 'display array after transfer from file {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 100 {{Cl|PRINT}} array(i); {{Cl|NEXT}} -{{Cl|PRINT}} "done" +{{Cl|PRINT}} "done" {{Cl|END SUB}} '' '' {{CodeEnd}} : ''Note:'' Use empty brackets in QB64 when using [[GET]] to create an array or [[PUT]] to create a [[BINARY]] data file. @@ -88,4 +88,4 @@ showme 'display array after transfer from file * [[PUT (TCP/IP statement)]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/PUT_(TCP%2FIP_statement).txt b/internal/help/PUT_(TCP%2FIP_statement).txt index f69be8c52..7c39b32ad 100644 --- a/internal/help/PUT_(TCP%2FIP_statement).txt +++ b/internal/help/PUT_(TCP%2FIP_statement).txt @@ -10,11 +10,11 @@ The '''PUT #''' TCP/IP statement sends unformatted(raw) data to an open connect * The ''data'' can be any variable type value. Literal values are not allowed. -<center>'''Communicating using unformatted/raw streamed data:'''</center> +<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. -<center>'''Your program MUST cater for these situations manually.'''</center> +<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.'' @@ -36,4 +36,4 @@ The '''PUT #''' TCP/IP statement sends unformatted(raw) data to an open connect * [[IP Configuration]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/PUT_(graphics_statement).txt b/internal/help/PUT_(graphics_statement).txt index 73bd0be81..9f80cd965 100644 --- a/internal/help/PUT_(graphics_statement).txt +++ b/internal/help/PUT_(graphics_statement).txt @@ -16,7 +16,7 @@ The '''PUT''' graphics statement is used to place [[GET (graphics statement)|GET ''Usage:'' -* '''The entire box area of the image MUST be on the screen or an "Illegal function call" [[ERROR Codes|error]] will occur!''' +* '''The entire box area of the image MUST be on the screen or an "Illegal function call" [[ERROR Codes|error]] will occur!''' * In '''QB64''' [[_CLIP]] can be used when part of the image may be off of the screen. This will also prevent off screen errors! ::PUT (-10, 10), mypic(0), PSET ' this causes an illegal function call without [[_CLIP]] ::PUT (-10, 10), mypic(0), _CLIP PSET ' allows a graphic to be placed partially off-screen @@ -39,11 +39,11 @@ The '''PUT''' graphics statement is used to place [[GET (graphics statement)|GET * [[PUT]] and [[GET]] file statements can also write and read image array data using [[BINARY]] files instead of using [[BSAVE]] or [[BLOAD]]. -''Example 1:'' How [[GET]] and PUT can be used with images loaded with [[_LOADIMAGE]]. The background color is omitted or "masked". +''Example 1:'' How [[GET]] and PUT can be used with images loaded with [[_LOADIMAGE]]. The background color is omitted or "masked". {{CodeStart}} '' '' {{Cl|SCREEN (statement)|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, 256) {{Cl|_SCREENMOVE}} {{Cl|_SCREENMOVE|_MIDDLE}} -image& = {{Cl|_LOADIMAGE}}("QB64.png") '[http://www.qb64.net/forum/index.php QB64 bee image from Forum] +image& = {{Cl|_LOADIMAGE}}("QB64.png") '[http://www.qb64.net/forum/index.php QB64 bee image from Forum] wide& = {{Cl|_WIDTH (function)|_WIDTH}}(image&): deep& = {{Cl|_HEIGHT}}(image&) {{Cl|DIM}} Array(wide& * deep&) {{Cl|AS}} {{Cl|INTEGER}} @@ -56,7 +56,7 @@ wide& = {{Cl|_WIDTH (function)|_WIDTH}}(image&): deep& = {{Cl|_HEIGH {{Cl|PUT (graphics statement)|PUT}}(10, 10), Array(0), {{Cl|PSET}} , {{Cl|_RGB}}(255, 255, 255) 'mask white background color {{Cl|END}} '' '' {{CodeEnd}} -: ''Explanation:'' '''QB64''' allows one PUT color to be "masked" to allow odd shaped sprite image backgrounds to be transparent. +: ''Explanation:'' '''QB64''' allows one PUT color to be "masked" to allow odd shaped sprite image backgrounds to be transparent. ''Example 2:'' Using a [[STRING]] instead of an [[arrays|array]] to store [[GET]] image data that can be PUT later. For images up to 256 colors only. @@ -70,7 +70,7 @@ a$ = {{Cl|SPACE$}}(4 + 100) '4 byte header + 100 pixels for a 10 X 10 K$ = {{Cl|INPUT$}}(1) {{Cl|CLS}} -{{Cl|PRINT}} a$ 'display string data. Width = {{Cl|CHR$}}(10 * 8) = "P" +{{Cl|PRINT}} a$ 'display string data. Width = {{Cl|CHR$}}(10 * 8) = "P" {{Cl|PUT (graphics statement)|PUT}}(100, 100), a$, {{Cl|PSET}} '' '' {{CodeEnd}} {{small|Code by Galleon}} @@ -87,4 +87,4 @@ K$ = {{Cl|INPUT$}}(1) * [[Bitmaps]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/Parenthesis.txt b/internal/help/Parenthesis.txt index e195dfd9a..a1956b88c 100644 --- a/internal/help/Parenthesis.txt +++ b/internal/help/Parenthesis.txt @@ -1,7 +1,7 @@ '''Parenthesis''' are used to enclose [[SUB]] and [[FUNCTION]] parameters or to set the operation order in [[Mathematical Operations]]. -''Usage:'' COLOR 14: PRINT [[TAB]](30); "Hello World" +''Usage:'' COLOR 14: PRINT [[TAB]](30); "Hello World" {{OutputStart}} {{text|Hello World|yellow}} @@ -31,4 +31,4 @@ nmb$ = {{Cl|LTRIM$}}((({{Cl|RTRIM$}}(nmb$)))) 'extra bracket pairs do not affec * [[Arrays]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/QB64_FAQ.txt b/internal/help/QB64_FAQ.txt index 47609705f..a26718dcf 100644 --- a/internal/help/QB64_FAQ.txt +++ b/internal/help/QB64_FAQ.txt @@ -1,4 +1,4 @@ -{| align="center" +{| align="center" | __TOC__ |} @@ -6,9 +6,9 @@ As with everything else, this list will be updated to correspond to new progress of QB64 so make sure that you are using the latest version of '''QB64 (version 1.1 released in 1/20/17)'''. Please note that it may take a short time to update this list. -<center>'''You may need Administrator rights to install or use QB64!'''</center> +<center>'''You may need Administrator rights to install or use QB64!'''</center> -<center>'''{{text|It's a good idea to exclude "QB64.exe" (also the internal folder) from any real-time anti-virus scanning to prevent IDE Module Errors!|red}}'''</center> +<center>'''{{text|It's a good idea to exclude "QB64.exe" (also the internal folder) from any real-time anti-virus scanning to prevent IDE Module Errors!|red}}'''</center> ==Q: What is QB64?== @@ -22,33 +22,33 @@ The '''new keywords''' add some '''new features''' such as playing '''music or s QB is an abbreviation for '''QBasic''' or '''QuickBASIC''' which is an easy to learn language that grew very popular in the 90's. It uses simple syntax but holds great potential as there are methods to achieve nearly anything. '''QBasic is NOT DEAD thanks to QB64!''' -<p style="text-align: center">[[Keywords currently not supported by QB64]]</p> +<p style="text-align: center">[[Keywords currently not supported by QB64]]</p> -<center>'''You may need Administrator rights to install or use QB64!'''</center> +<center>'''You may need Administrator rights to install or use QB64!'''</center> ==Q: Does it have modern features? Do they HAVE to be used?== A: QB64 has PLENTY of modern features, but they do not have to be used. You may just want to run some of your old favorites. -<center>'''QB64 was created to run your old Qbasic 4.5(or less) programs on newer Operating Systems without ANY changes!'''</center> +<center>'''QB64 was created to run your old Qbasic 4.5(or less) programs on newer Operating Systems without ANY changes!'''</center> You could code using the original QuickBASIC syntax all the way through and it should work as you expect it to or even better. QB64 is often faster and has none of the memory limitations that plagued Qbasic in the past! Give it try! See for yourself. -<center> '''For incompatibility issues you can look in the QB64 "Discussion" board here:'''</center> +<center> '''For incompatibility issues you can look in the QB64 "Discussion" board here:'''</center> -<center>[http://www.qb64.net/forum/index.php Visit the QB64 Community Forum]</center> +<center>[http://www.qb64.net/forum/index.php Visit the QB64 Community Forum]</center> -<center>'''Some members can still run QB4.5 programs so we can test problem code!'''</center> -<center>QB 4.5 code only! QB64 was not meant to run PDS (7.1) QBX code. Will run most GW Basic code too!</center> +<center>'''Some members can still run QB4.5 programs so we can test problem code!'''</center> +<center>QB 4.5 code only! QB64 was not meant to run PDS (7.1) QBX code. Will run most GW Basic code too!</center> -<center>'''If your program(s) don't work correctly(check your code first) please feel free to post in the "Discussion" board.'''</center> +<center>'''If your program(s) don't work correctly(check your code first) please feel free to post in the "Discussion" board.'''</center> Galleon is constantly working on pure compatibility. You don't have to set it up differently to use the modern features as they are made to work alongside original QB code seamlessly (unlike FreeBASIC and any other modern BASIC out there). The modern statements are designed to go along with the BASIC philosophy and expand Qbasic into the future! -<center>'''QB64 FEATURES INCLUDE...'''</center> +<center>'''QB64 FEATURES INCLUDE...'''</center> {{TextStart}} 1) Full graphic functions for [[_NEWIMAGE|images]] up to 32 bit color. [[_ALPHA|Alpha]] transparency supported. @@ -70,77 +70,75 @@ Galleon is constantly working on pure compatibility. You don't have to set it up 9) Support for C++, OpenGL, Windows API and other custom Dynamic Link [[Libraries]]. {{TextEnd}} -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> -==Q: How do I install QB64 on Windows, Linux, macOS or run programs in Android?== +==Q: How do I install QB64 on Windows, Linux, macOS?== A: If you have a relatively new computer you will probably be fine. QB64 supports the following Operating Systems in one download: -<center>'''Windows NT(XP), Windows Vista, Windows 7, 8 or 10:'''</center> +<center>'''Windows NT(XP), Windows Vista, Windows 7, 8 or 10:'''</center> :'''1)''' Click the following link and Windows box to download QB64: [http://www.qb64.net QB64 Windows Downloads] :'''2)''' Unzip to any folder path you wish. The ZIP file will create a ''QB64'' folder for the program files. :* Executable programs are portable between like systems by copying the stand-alone executable file. :* ''Versions of QB64 prior to 1.000 require that your binary is distributed with the DLL files that came bundled.'' -<center>'''You may need Administrator rights to install or use QB64.'''</center> +<center>'''You may need Administrator rights to install or use QB64.'''</center> -<center>'''Windows 2000 running QB64 versions .94 and Above'''</center> +<center>'''Windows 2000 running QB64 versions .94 and Above'''</center> : QB64 version .940 and above contain a full version of the Ming Compiler! This may create an entry point error in Windows 2K. :'''1)''' Click the following link and Windows box to download QB64: [http://www.qb64.net QB64 Windows Downloads] :'''2)''' Unzip to any folder path you wish. The ZIP file will create a ''QB64'' folder for the program files. Check for ''MSVCRT.DLL'' errors! :'''3)''' If there is an error, unzip the contents of the ZIP FIX file into the QB64 folder after QB64 has updated to the latest version. -<center>[http://www.qbasicnews.com/dav/files/qb64v942-win2k-fix.zip Download ZIP FIX for Windows 2000 if QB64 does not run correctly!]</center> -<center>This download fix will be updated when necessary by Dav</center> +<center>[http://www.qbasicnews.com/dav/files/qb64v942-win2k-fix.zip Download ZIP FIX for Windows 2000 if QB64 does not run correctly!]</center> +<center>This download fix will be updated when necessary by Dav</center> ---- -<center>'''Most versions of LINUX 32 and 64 bit'''</center> +<center>'''Most versions of LINUX 32 and 64 bit'''</center> :'''1)''' Click on the following link and Linux box to download QB64: [http://www.qb64.net QB64 Linux Downloads] :'''2)''' You will need the following installed: OpenGL developement libraries, ALSA development libraries, GNU C++ Compiler (g++) :'''3)''' After extracting the downloaded package, run the installation batch/script called ''setup_lnx.sh'' in the main ''qb64'' folder to setup QB64. :'''4)''' It is not advisable to install QB64 as root. -<center>Executable programs are portable between like systems by copying the executable file.</center> -<center>'''The Linux 32bit & 64bit versions are combined as of the v 0.925 update'''</center> -<center>'''Note: Some QB64 keywords and procedures are not available as of this Linux release.'''</center> +<center>Executable programs are portable between like systems by copying the executable file.</center> +<center>'''The Linux 32bit & 64bit versions are combined as of the v 0.925 update'''</center> +<center>'''Note: Some QB64 keywords and procedures are not available as of this Linux release.'''</center> -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> ---- -<center>'''macOS'''</center> +<center>'''macOS'''</center> :'''1)''' You MUST install '''Xcode command line tools''' for C++ compilation from their website. In a terminal window, type 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 it installs) :'''3)''' Click on the following link and MAC OSX box to download QB64 for macOS: [http://www.qb64.net QB64 MAC OSX Downloads] :     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_start_osx.command''' to run qb64.'''</center> +<center>'''After installation you should run '''qb64_start_osx.command''' to run qb64.'''</center> :* Executable programs are portable between like OSX 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 as of this MAC release.'''</center> +<center>'''Note: Some QB64 keywords and procedures are not available as of this MAC release.'''</center> -<center>[[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Keywords Not Supported in Linux or MAC OSX versions]]</center> +<center>[[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Keywords Not Supported in Linux or MAC OSX versions]]</center> ---- -<center>'''References to Android in QB64 refer to the Android Experiment. More information here: [http://www.qb64.net/forum/index.php?topic=13162.0 Android QB64] (may be outdated/non-functional)'''</center> - -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> ==Q:The setup scripts don't work in Linux and macOS. How can I fix them?== A: If you have problems running the install scripts under Linux (./setup_lnx.sh) or macOS (./setup_osx.command), run the following line in terminal, from your QB64 folder: ===Linux=== -* <nowiki>find . -name '*.sh' -exec sed -i "s/\r//g" {} \;</nowiki> +* <nowiki>find . -name '*.sh' -exec sed -i "s/\r//g" {} \;</nowiki> ===macOS=== -* <nowiki>find . -name '*.command' -exec perl -pi -e 's/\r\n|\n|\r/\n/g' {} \;</nowiki> +* <nowiki>find . -name '*.command' -exec perl -pi -e 's/\r\n|\n|\r/\n/g' {} \;</nowiki> * Don't forget you need to have Xcode command line utilites installed to use QB64. If you have any other issues, check out the Forum: @@ -158,26 +156,26 @@ A: The process has been simplified a lot recently. # Delete everyone of those files and folders. # Extract the mingw 64-bit compiler into that folder. You're looking to replace the old contents with the new contents. Watch for nesting a folder inside a folder by accident. # Go into the main QB64 directory, look for setup_win.bat. If it's not there, grab the download for it from below and put it into the main folder. (I don't think the archives at qb64.net has the file included in it, though if you download from the repo directly, you can find it. It's kind of a developer tool, moreso than something an user needs cluttering up their directory structure.) -# Run that setup_win.bat file. If everything is extracted to the proper places, you should build and have a version of QB64 open up where the title screen now reads "QB64x64". Congrats!! You now have a working, 64-bit version of QB64. +# Run that setup_win.bat file. If everything is extracted to the proper places, you should build and have a version of QB64 open up where the title screen now reads "QB64x64". Congrats!! You now have a working, 64-bit version of QB64. That's all it takes! {{small|Tip courtesy of Steve McNeill}} -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> ==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. -<center>'''Don't move QB64 executable out of the QB64 folder! The various sub-folders hold the C++ compiler files!'''</center> -<center>Versions of QB64 prior to 1.000 require the accompanying DLL files, which may be copied into the Windows ''System32'' or ''SysWOW64'' folder for program access outside of the QB64 folder. They can also be placed in a separate folder or download package with the EXE and program files.</center> +<center>'''Don't move QB64 executable out of the QB64 folder! The various sub-folders hold the C++ compiler files!'''</center> +<center>Versions of QB64 prior to 1.000 require the accompanying DLL files, which may be copied into the Windows ''System32'' or ''SysWOW64'' folder for program access outside of the QB64 folder. They can also be placed in a separate folder or download package with the EXE and program files.</center> Does your Windows system have another version of the '''MinGW''' compiler? Does it have '''Fortran''' or '''GFortran'''? You can check your environmental values using the following batch file which will create the '''''settings.inf''''' text file in the batch folder: -{{TextStart}}set >settings.inf '' '' {{TextEnd}} +{{TextStart}}set >settings.inf '' '' {{TextEnd}} : The '''settings.inf''' file should hold environmental values similar to those listed below: @@ -193,6 +191,8 @@ HOMEPATH=\Documents and Settings\User1 '''LIBRARY_PATH={{text|\F\G77\Llib|red}}''' LOGONSERVER=\\PC1 NUMBER_OF_PROCESSORS=1 +4000 + OS=Windows_NT '''Path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;{{text|\F\G77\bin|red}}''' PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH @@ -211,10 +211,10 @@ TMP=C:\DOCUME~1\User1\LOCALS~1\Temp : Environmental values in {{text|red|red}} above indicate where another C compiler has altered or added to the Windows settings. -<center>Environmental values to check and possibly clear are '''PATH=''', '''LIBRARY_PATH=''', '''LIB=''' or '''CPLUS_INCLUDE_PATH='''</center> +<center>Environmental values to check and possibly clear are '''PATH=''', '''LIBRARY_PATH=''', '''LIB=''' or '''CPLUS_INCLUDE_PATH='''</center> -<center>'''QB64 does NOT alter computer settings! All required files are organized in the QB64 folder.'''</center> +<center>'''QB64 does NOT alter computer settings! All required files are organized in the QB64 folder.'''</center> : Try to run the following '''''TestQB64.bat''''' batch file from the QB64 folder only: @@ -225,7 +225,7 @@ set LIBRARY_PATH= REM start QB64 IDE. A BAS file can be dropped into this batch file to edit in IDE. REM this batch file must be run from the QB64 folder! Set QB64=%~dp0 -CD "%QB64%" +CD "%QB64%" start qb64.exe %1 '' '' {{TextEnd}} {{small|Adapted from code by Michael Calkins}} @@ -235,10 +235,10 @@ start qb64.exe %1 '' '' : If the batch file works, you can use it to edit and compile QB64 programs. You may want to uninstall the conflicting program. -<center>'''[[IDE#Compiler_Errors|IDE Compiler Errors]]</center> +<center>'''[[IDE#Compiler_Errors|IDE Compiler Errors]]</center> -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> ==Q: Are there any known incompatibilities?== @@ -247,7 +247,7 @@ A: There are some things that QB64 will not and NEVER was intended to do! The or '''[[DOS]] is not fully supported''', as this will require full DOS support to be emulated, however it will continually be updated to support more source code and more features, memory addresses, ports, etc. so that it always approaches 100%. If you don't use too many [[ABSOLUTE]], [[INTERRUPT]], [[PEEK]], [[POKE]] and [[OUT]] statements you probably won't notice any difference between QB 4.5 and QB64 (and if you do, report it as a bug in the forums, remember to check if the problem has been reported before please!), you can expect the most common addresses for interrupts, etc. to be functioning. Galleon has also received a comprehensive list of memory and port addresses so that even some less common addresses may work as well. If you are unsure, try them! -<p style="text-align: center">[[Keywords currently not supported by QB64]]</p> +<p style="text-align: center">[[Keywords currently not supported by QB64]]</p> '''Watch the 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. '''Monitor Task Manager!''' It can tell you how much 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: @@ -264,32 +264,32 @@ A: There are some things that QB64 will not and NEVER was intended to do! The or 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! The following programs have KNOWN issues with high CPU usage: -<center>'''[http://forums.winamp.com/showthread.php?threadid=166479 WINAMP (intermittent sound)]'''</center> +<center>'''[http://forums.winamp.com/showthread.php?threadid=166479 WINAMP (intermittent sound)]'''</center> -<center>'''Thank you for your support and happy programming!'''</center> +<center>'''Thank you for your support and happy programming!'''</center> -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> ==Q: Why won't my QB64 compiled programs run in folders other than the QB64 folder?== A: Versions of QB64 prior to 1.000 required certain DLL files to be in the program folder or in the Windows system path. -<center>{{Text|C:\WINDOWS\SYSTEM32|green}}</center> +<center>{{Text|C:\WINDOWS\SYSTEM32|green}}</center> Copy each of the DLL files included with QB64 to the System32 or [[SysWOW64]] folder. You may need administrator rights to do this! -<center>[http://www.samlogic.net/articles/32-64-bit-windows-folder-x86-syswow64.htm SysWOW64 and Program Files(x86) folders on 64 bit Windows OS.]</center> +<center>[http://www.samlogic.net/articles/32-64-bit-windows-folder-x86-syswow64.htm SysWOW64 and Program Files(x86) folders on 64 bit Windows OS.]</center> -<center>'''[[QB64_FAQ#Q:_What_files_are_required_to_run_QB64_SDL_programs_in_Windows.3F|List of required QB64 DLL files for older versions (prior to 1.000)]]'''</center> +<center>'''[[QB64_FAQ#Q:_What_files_are_required_to_run_QB64_SDL_programs_in_Windows.3F|List of required QB64 DLL files for older versions (prior to 1.000)]]'''</center> -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> ==Q: How do I find the current QB64 program path in Windows or Linux?== @@ -314,15 +314,15 @@ Result = GetModuleFileNameA(0, FileName$, {{Cl|LEN}}(FileName$)) '0 designates t PATH$ = {{Cl|LEFT$}}(FileName$, Result) start = 1 DO - posit = {{Cl|INSTR}}(start, PATH$, "\") + posit = {{Cl|INSTR}}(start, PATH$, "\") {{Cl|IF...THEN|IF}} posit {{Cl|THEN}} last = posit start = posit + 1 {{Cl|LOOP}} {{Cl|UNTIL}} posit = 0 PATH$ = {{Cl|LEFT$}}(PATH$, last) {{Cl|ELSE}} - PATH$ = "" + PATH$ = "" {{Cl|END IF}} -FileName$ = "" +FileName$ = "" {{Cl|END FUNCTION}} '' '' {{CodeEnd}}{{small| Code by EricR}} @@ -342,7 +342,7 @@ FileName$ = "" bufsize& = 500 'Initial size of the string to store the result in DO buffer$ = {{Cl|SPACE$}}(bufsize&) 'Create the buffer to put result in - ret& = readlink&("/proc/self/exe", buffer$, bufsize&) '/proc/self/exe is always a symlink to our executable file + ret& = readlink&("/proc/self/exe", buffer$, bufsize&) '/proc/self/exe is always a symlink to our executable file {{Cl|IF...THEN|IF}} ret& < bufsize& {{Cl|THEN}} {{Cl|EXIT DO}} 'ret& is how many bytes were actually put in the buffer. If they are equal, we need to make the buffer bigger and try again bufsize& = bufsize& + 500 {{Cl|LOOP}} @@ -351,7 +351,7 @@ exe$ = {{Cl|LEFT$}}(buffer$, ret&) 'This code just chops off the filename to give us the directory: {{Cl|FOR...NEXT|FOR}} i& = {{Cl|LEN}}(exe$) {{Cl|TO}} 1 {{Cl|STEP}} -1 - {{Cl|IF...THEN|IF}} {{Cl|MID$}}(exe$, i&, 1) = "/" {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR...NEXT|FOR}} + {{Cl|IF...THEN|IF}} {{Cl|MID$}}(exe$, i&, 1) = "/" {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR...NEXT|FOR}} {{Cl|NEXT}} i& directory$ = {{Cl|LEFT$}}(exe$, i&) path$ = directory$ @@ -360,14 +360,14 @@ path$ = directory$ -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> ==Q: How do I update the information in QB64 HELP?== 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. In general you may want to update monthly or a week after a new version release. -<center>[http://qb64.net/wiki/index.php?title=IDE#Help_Menu_.28Alt_.2B_H.29 QB64 IDE Help Menu]</center> +<center>[http://qb64.net/wiki/index.php?title=IDE#Help_Menu_.28Alt_.2B_H.29 QB64 IDE Help Menu]</center> ==Q: Can I use the same libraries with QB64 that I used with QB 4.5?== @@ -375,33 +375,33 @@ A: If the libraries are pure QB 4.5 code then yes, otherwise no. QLB files are n As of Dec 3, 2010 QB64 acquired [[DECLARE LIBRARY]] to allow users to reference C, Windows, OpenGL and other DLL libraries. If you find some functions that you like please share them with us at the forum! The following pages list working functions our members have found and tested: -<center>[[C Libraries]], [[DLL Libraries]], [[Windows Libraries]]</center> +<center>[[C Libraries]], [[DLL Libraries]], [[Windows Libraries]]</center> *[[SDL Libraries]] ''(obsolete since version 1.000 - available here for historic purposes) -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> ==Q: I can't get my QB 4.5 sourcecode to work in QB64! Why?== A: Perhaps that is because QB64 isn't 100% compatible yet, it is a work in progress. It is around 95-98% compatible right now, and that is a large number! The commands that haven't been implemented are either obsolete or are too obscure and have been replaced by modern functionality. Look at the [http://www.qb64.net/forum/index.php?board=15.0 Unimplemented Qbasic Commands Forum] for statements that are not available. -<p style="text-align: center">[[Keywords currently not supported by QB64]]</p> +<p style="text-align: center">[[Keywords currently not supported by QB64]]</p> '''Compiler errors''' are another subject. Always try to test the program in Qbasic BEFORE trying to run or compile it in QB64! You may find '''syntax or other code errors''' that the QB64 IDE may not find yet as a bonus! Always check the code before blaming QB64! -<center>'''You may need Administrator rights to install or use QB64.'''</center> +<center>'''You may need Administrator rights to install or use QB64.'''</center> -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> ==Q: What files are required to run my QB64 compiled program in my Operating System?== A: Programs compiled by QB64 (version 1.000 and up) are stand-alone so no external OpenGL DLL files are required to be with your program EXE file. -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> ==Q: How are foreign languages and keyboards supported in QB64?== @@ -413,29 +413,29 @@ A: As of version 0.922 (October 20, 2010) QB64 supports foreign language keyboar See the [[Unicode]] page to setup a language in a program you create. There are also links to the various [[Code Pages]] that are supported. Also there are four new keywords to work with keypresses and map them to ASCII key character codes: -<center>[[_KEYHIT]], [[_KEYDOWN]] and [[_MAPUNICODE]]</center> +<center>[[_KEYHIT]], [[_KEYDOWN]] and [[_MAPUNICODE]]</center> -<center>'''You can now re-assign key codes to Unicode characters in programs you create using the [[_MAPUNICODE]] statement!'''</center> +<center>'''You can now re-assign key codes to Unicode characters in programs you create using the [[_MAPUNICODE]] statement!'''</center> If you have any problems, post in the discussion board. In the meantime you can use any of these recommended [[ASCII]] methods: -<center>'''Using ASCII Characters'''</center> +<center>'''Using ASCII Characters'''</center> Perhaps you can use the [[ASCII]] character codes. Go to the [[ASCII]] character chart and look for the character(s) you need. If you find them, remember the code number and use either CHR$(code%) or the Alt-number pad key method to type them into literal strings(real strings with quotes) only. The following QB64 program displays the characters available on your PC: {{CodeStart}} SCREEN _NEWIMAGE(800, 600, 256) -font$ = "C:\WINDOWS\Fonts\cour.ttf" 'TTF file in Windows -style$ = "monospace" 'font style +font$ = "C:\WINDOWS\Fonts\cour.ttf" 'TTF file in Windows +style$ = "monospace" 'font style f& = _LOADFONT(font$, 22, style$) _FONT f& COLOR 11 FOR c% = 1 TO 6: PRINT c%; CHR$(c%);: NEXT FOR c% = 14 TO 27: PRINT c%; CHR$(c%);: NEXT FOR c% = 32 TO 255: PRINT c%; CHR$(c%);: NEX -DO: SLEEP: LOOP UNTIL INKEY$ <> "" +DO: SLEEP: LOOP UNTIL INKEY$ <> "" {{CodeEnd}} @@ -444,11 +444,11 @@ DO: SLEEP: LOOP UNTIL INKEY$ <> "" {{CodeStart}} -PRINT {{Cl|CHR$}}(165) + "ormally I don't use these keys. Do You " + {{Cl|CHR$}}(168) 'concatenation +PRINT {{Cl|CHR$}}(165) + "ormally I don't use these keys. Do You " + {{Cl|CHR$}}(168) 'concatenation -PRINT {{Cl|CHR$}}(165); "ormally I don't use these keys. Do you"; {{Cl|CHR$}}(168) 'semicolons +PRINT {{Cl|CHR$}}(165); "ormally I don't use these keys. Do you"; {{Cl|CHR$}}(168) 'semicolons -PRINT "Ñormally I don't use these keys. Do you¿" 'Alt-number pad method +PRINT "Ñormally I don't use these keys. Do you¿" 'Alt-number pad method {{CodeEnd}} {{OutputStart}} @@ -457,7 +457,7 @@ PRINT "Ñormally I don't use these keys. Do you¿" 'Alt-nu :'''NOTE:''' You MUST use concatenation when defining a string variable using the CHR$ function character returns! -<center>[[ASCII|Link to the ASCII Character Table]]</center> +<center>[[ASCII|Link to the ASCII Character Table]]</center> To cut down on typing CHR$(???) all day, define often used characters as string variables such as Q$ = CHR$(34) as shown below: {{CodeStart}} @@ -465,11 +465,11 @@ To cut down on typing CHR$(???) all day, define often used characters as string {{Cl|DIM}} Q AS {{Cl|STRING}} * 1 'define as one byte string(get rid of $ type suffix too) Q = {{Cl|CHR$}}(34) 'Q will now represent the elusive quotation mark in a string -PRINT "This string uses "; Q; "quotation marks"; Q; " that might cause a syntax error!" +PRINT "This string uses "; Q; "quotation marks"; Q; " that might cause a syntax error!" {{CodeEnd}} {{OutputStart}} -This string uses "quotation marks" that might cause a syntax error! +This string uses "quotation marks" that might cause a syntax error! {{OutputEnd}} @@ -477,11 +477,11 @@ This string uses "quotation marks" that might cause a syntax error! You can use ANY of the ASCII characters to add borders, arrows, and many other characters not available on the keyboard. Hopefully this information will cure your problem! -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> ==Q: MUST I copy or drag ALL of my program files to the QB64 folder?== -A: You can instruct QB64 to save the resulting executable file to the same folder as your source code file so that all your project files can reside in a separate folder, for better organization. In the [[IDE]] of versions 1.000 and up, go to the Run menu and tick the option "Save EXE in the source folder". This way, next time you hit F5, Ctrl+F5 or even F11, QB64 will compile your .BAS file and the .EXE will be placed in the same folder. +A: You can instruct QB64 to save the resulting executable file to the same folder as your source code file so that all your project files can reside in a separate folder, for better organization. In the [[IDE]] of versions 1.000 and up, go to the Run menu and tick the option "Save EXE in the source folder". This way, next time you hit F5, Ctrl+F5 or even F11, QB64 will compile your .BAS file and the .EXE will be placed in the same folder. For older versions of QB64, you can use a batch file, as instructed below: @@ -492,9 +492,9 @@ For older versions of QB64, you can use a batch file, as instructed below: # Try the EXE file to see how it works. -<center>'''The Answer to the Question below will show you how to create a batch file and compile BAS files from ANY location.'''</center> +<center>'''The Answer to the Question below will show you how to create a batch file and compile BAS files from ANY location.'''</center> -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> ==Q: Is there a way to use the compiler without running my program or using the IDE?== @@ -516,18 +516,20 @@ The batch file below can compile any BAS file from any location using drag and d Set QB64=%~dp0 Echo. QB64 path: %QB64% -REM The QB64 path must designate the drive letter when compiling from another drive letter! +REM The QB64 path must d +4000 +esignate the drive letter when compiling from another drive letter! C: CD\ -CD "%QB64%" +CD "%QB64%" cmd /c start /low QB64.exe -c %1 '' '' {{TextEnd}} -<center>'''Place the BAT file in the QB64 folder!''' You will also be able to drag and drop BAS files onto the batchfile.</center> +<center>'''Place the BAT file in the QB64 folder!''' You will also be able to drag and drop BAS files onto the batchfile.</center> -<center> '''Associating the batch file in the Right Click Open With pop-up menu'''</center> +<center> '''Associating the batch file in the Right Click Open With pop-up menu'''</center> You can associate the batch file to the Right Click Popup Menu's ''Open With'' dialogue choices when you right click ANY BAS file: ::::1) Right click any BAS file and move to ''Open With'' and click ''Choose Program'' in the pop-up menu. @@ -538,12 +540,12 @@ You can associate the batch file to the Right Click Popup Menu's ''Open With'' d ::::4) '''Make sure that the ''Always use this program'' box is NOT checked!''' Then save your choice. -<center>The compiled EXE file can be found in the QB64 folder!</center> +<center>The compiled EXE file can be found in the QB64 folder!</center> -<center>'''You may need Administrator rights to install or use QB64.'''</center> +<center>'''You may need Administrator rights to install or use QB64.'''</center> -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> ==Q: How do I LINK modules or INCLUDE SUB procedures in QB64? == @@ -552,7 +554,7 @@ A: QB64 allows you to [[$INCLUDE]] code or BAS modules into one module when it i After the EXE is compiled, you do not have to even use the added code anymore! The EXE will contain ALL of the program code as ONE stand-alone program! This also allows you to add SUB code to ANY program that you desire. Use the following syntax and rules: -<center>''Syntax:'' REM $INCLUDE: 'filename.BI'</center> +<center>''Syntax:'' REM $INCLUDE: 'filename.BI'</center> :1) '''$INCLUDE [[TYPE]] definitions or [[DATA]] field code''' at the beginning of the module that will be compiled. Text code can be used, but must be renamed to .BI (cannot be a .TXT extension!) or kept as a .BAS module. SUB or FUNCTION code MUST be included at the end of the module code! @@ -564,23 +566,23 @@ After the EXE is compiled, you do not have to even use the added code anymore! T After you have created the include files, you can add them to ANY other program that requires them! Thus you will end up with smaller BAS files and SUB procedures that can be used over and over like libraries. The files are only used during a compilation. -<center>[[LINKed or Merged Modules|Program to Convert LINKed or Merged multiple module programs into one QB64 Module]]</center> +<center>[[LINKed or Merged Modules|Program to Convert LINKed or Merged multiple module programs into one QB64 Module]]</center> -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> ==Q: CHAIN doesn't work the way I'm used to...== A: CHAIN has been implemented in QB64 versions 0.851 up. Be sure to download the latest version of the compiler when available. -<center>'''Note: QB64 will automatically compile the named BAS file if it does not find the EXE file.</center> +<center>'''Note: QB64 will automatically compile the named BAS file if it does not find the EXE file.</center> The statement also can use [[COMMON]] or [[COMMON SHARED]] to pass program information. However QB64 uses files to pass the information. If your program moves to a location other than the EXE file's location, the file may be inaccessable! To avoid this problem, make sure that your program can refer to that location using a path. There are minor differences from QBasic in that it doesn't open a program in the same window and does not retain the previous screen mode or format. -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> ==Q: Some screens look small. Can I enlarge them or make them fullscreen?== @@ -593,13 +595,13 @@ There are minor differences from QBasic in that it doesn't open a program in the * [[_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> +<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> ==Q: Can I have background music as well as [[SOUND]], [[PLAY]] and [[BEEP]]?== A: Yes, they are emulated to use the soundcard instead of the old boring monotone PC-speaker that is rapidly disappearing. -<center>'''There also are a bunch of new sound capabilities that allow the use of WAV, OGG, MP3 files and more.'''</center> +<center>'''There also are a bunch of new sound capabilities that allow the use of WAV, OGG, MP3 files and more.'''</center> Capabilities include: @@ -607,10 +609,10 @@ Capabilities include: # Volume and speaker control # Background music -<center>'''SOUND HAS RETURNED TO QBASIC!'''</center> +<center>'''SOUND HAS RETURNED TO QBASIC!'''</center> -<center>'''Get started with [[_SNDOPEN|MUSIC]] NOW!</center> +<center>'''Get started with [[_SNDOPEN|MUSIC]] NOW!</center> [[_SNDCLOSE]] (statement), [[_SNDCOPY]] (function), [[_SNDGETPOS]] (function), [[_SNDLEN]] (function), [[_SNDLIMIT]] (statement) @@ -618,10 +620,10 @@ Capabilities include: [[_SNDPLAYCOPY]] (statement), [[_SNDPLAYFILE]] (statement), [[_SNDPLAYING]] (function), [[_SNDSETPOS]] (statement) -<center>[[_SNDRAW]] (statement), [[_SNDSTOP]] (statement), [[_SNDVOL]] (statement)</center> +<center>[[_SNDRAW]] (statement), [[_SNDSTOP]] (statement), [[_SNDVOL]] (statement)</center> -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> ==Q: Can I use multiple monitors or Pole Monitors?== @@ -632,7 +634,7 @@ A: Yes, program windows can be moved to them automatically using [[_SCREENMOVE]] -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> ==Q: Why isn't the [[IDE]] always working as I would expect?== @@ -640,19 +642,19 @@ A: The [[IDE]] has many features shared with modern IDEs while retaining the ret You can also use QB64 as a compiler only, so that you can choose any alternate editor of your choice. -<center>'''You may need Administrator rights to install or use QB64'''</center> +<center>'''You may need Administrator rights to install or use QB64'''</center> -<center>'''Alternate Editors:''' [[PSPAD|PSPad Editor for Windows]] and [[GEDIT|Gedit Editor for Linux]]'''</center> +<center>'''Alternate Editors:''' [[PSPAD|PSPad Editor for Windows]] and [[GEDIT|Gedit Editor for Linux]]'''</center> -<center>[http://www.qb64.net/forum/index.php?board=21.0 Report missed Syntax Errors here!]</center> +<center>[http://www.qb64.net/forum/index.php?board=21.0 Report missed Syntax Errors here!]</center> -<center>'''[[Known QB64 Issues]]'''</center> +<center>'''[[Known QB64 Issues]]'''</center> -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> ==Q: If QB64 creates Basic programs why is there no Immediate Window?== @@ -669,14 +671,13 @@ Qbasic and Quickbasic allowed BAS programs to be run in an interpreter to test t '''Start ({{text|D|white}}etached) Ctrl+F5''' Compiles into EXE and runs program separately (no code whiteout). '''Make E{{text|X|white}}E Only F11''' Compiles into EXE without program files if there are no errors. '' '' ─────────────────────────── -'''Make {{text|A|white}}ndroid Project''' GL Compiled program as Android project(enabled in Options) {{TextEnd}}{{small|Function keys compile without entering menu}} -<center> White letters indicate CTRL + letter shortcuts when inside Run menu</center> +<center> White letters indicate CTRL + letter shortcuts when inside Run menu</center> -<center>'''Associated text [[$INCLUDE]] code files, [[DECLARE LIBRARY|LIBRARY]] DLL files and C++ ''.h'' header files must be in the QB64 folder to compile.''' +<center>'''Associated text [[$INCLUDE]] code files, [[DECLARE LIBRARY|LIBRARY]] DLL files and C++ ''.h'' header files must be in the QB64 folder to compile.''' In QB64 versions prior to 1.000 the provided DLL files need to be included with the program ''EXE'' after it is compiled. @@ -684,10 +685,10 @@ In QB64 versions prior to 1.000 the provided DLL files need to be included with '''No additional program files need to be in the QB64 folder to Make EXE Only!''' -The compiled EXE file can then be moved to a different folder holding the program files necessary when it is run.</center> +The compiled EXE file can then be moved to a different folder holding the program files necessary when it is run.</center> -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> ==Q: How can I slow my program down and/or use less CPU resources?== @@ -700,7 +701,7 @@ Not by using FOR loops! It would take a lot of loops just to slow QB64 down! Try Use [[SLEEP]] or [[INPUT$]] to wait for user entries, key presses or menu selections rather than using running [[INKEY$]] loops too. -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> ==Q: Can I resize the QB64 Editor([[IDE]])? == @@ -711,31 +712,31 @@ There is also a way to set the window size in the ''Options'' Menu. Select ''Dis If there is ever a problem with an OPTION that you set, just Delete the '''.\internal\temp\options.txt''' file. Then restart QB64. You can find the program listed in the taskbar. Right click and select ''Close'' from the pop-up menu. -<center>'''See the [[IDE|IDE Page]] for more information.'''</center> +<center>'''See the [[IDE|IDE Page]] for more information.'''</center> ==Q: The autoformatting doesn't work correctly in the [[IDE]]...== A: The autoformatting feature allows you to set a fixed number of spaces to indent your code. You can also choose to have keywords automatically changed to UPPERCASE as well as indenting the contents inside SUB/FUNCTION procedures. If you don't like the way it alters your code (both at load time and as you type it), just disable it. -<center>'''Autoformatting and Updating can be turned off in the [[IDE]] using the [[IDE#Options_Menu_.28Alt_.2B_O.29:|Options Menu]]!</center> +<center>'''Autoformatting and Updating can be turned off in the [[IDE]] using the [[IDE#Options_Menu_.28Alt_.2B_O.29:|Options Menu]]!</center> -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> ==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 (WinXP and up, Linux and macOS). The .exe files produced by QB64 should work in Windows 98 as long as the required DLL libraries, if any, are supported on that system. -<center>'''See the [[IDE|IDE Page]] for more information.'''</center> +<center>'''See the [[IDE|IDE Page]] for more information.'''</center> ==Q: Can Line Numbers be removed from older program code?== A: Yes, you can use the Microsoft program below or the program on the following page to remove line numbers that are not required by Basic keywords such as [[GOTO]]. See: [[Line number|Removing line numbers]] -<center>'''[ftp://ftp.microsoft.com/services/technet/windows/msdos/RESKIT/SUPPDISK/REMLINE.BAS Microsoft's REMLINE.BAS program removes unnecessary line numbers]'''</center> +<center>'''[ftp://ftp.microsoft.com/services/technet/windows/msdos/RESKIT/SUPPDISK/REMLINE.BAS Microsoft's REMLINE.BAS program removes unnecessary line numbers]'''</center> -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> ==Q: Does QB64 support CURRENCY values from PDS or VB programs?== @@ -746,10 +747,10 @@ A: Not directly, but [[_FLOAT]] currency values up to 4 decimal places can be mu [[GET]] can read a [[_FLOAT]] CURRENCY value as an [[INTEGER64]] variable value divided by 10000. -<center>[[PDS(7.1)_Procedures#CURRENCY|See CURRENCY examples]]</center> +<center>[[PDS(7.1)_Procedures#CURRENCY|See CURRENCY examples]]</center> -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> ==Q: What files are required to run older QB64 programs (version .954 and older) in Windows?== A: Older versions of the QB64 compiler (.954 or older) and '''EVERY''' EXE file created by this version of the compiler are dependant on various DLL Library files to function properly. These files are found inside of the QB64 folder. This also explains why QB64 will create ALL EXE files in the QB64 folder no matter where the original BAS file is located on the computer. Your new program will require these files too, but you can move the DLL files to your shared SYSTEM32 folder to eliminate duplicates! @@ -758,10 +759,10 @@ A: Older versions of the QB64 compiler (.954 or older) and '''EVERY''' EXE file '''Note:''' QB64 produces stand-alone executable files from version 1.000 onward. -<center>'''Files required for executables created by older versions of QB64:'''</center> +<center>'''Files required for executables created by older versions of QB64:'''</center> -<center>''The list of library files you need to include with your program(s) as of July 2010:''</center> +<center>''The list of library files you need to include with your program(s) as of July 2010:''</center> {{TextStart}} @@ -777,46 +778,48 @@ libvorbisfile-3.dll SDL.dll SDL_image.dll SDL_mi * denotes DLL updated in (version) {{TextEnd}} -<center>'''Other Important Files:'''</center> +<center>'''Other Important Files:'''</center> {{TextStart}} cyberbit.ttf (12.7 MB v 0.92, October 2010) {{TextEnd}} -<center>'''NOTE:''' ''cyberbit.ttf'' file is a 12.7 megabyte font for rendering [[Unicode]] characters. Auto-update may be slow downloading this file!</center> -<center>This font is NOT required to be included with a program as QB64 can use other fonts when necessary.</center> +<center>'''NOTE:''' ''cyberbit.ttf'' file is a 12.7 megabyte font for rendering [[Unicode]] characters. Auto-update may be slow downloading this file!</center> +<center>This font is NOT required to be included with a program as QB64 can use other fonts when necessary.</center> -<center>It is suggested that frequent users copy the DLL files to the SYSTEM folder in Windows. The location should be: </center> +<center>It is suggested that frequent users copy the DLL files to the SYSTEM folder in Windows. The location should be: </center> {{WhiteStart}} ''C:\WINDOWS\SYSTEM32'' or ''C:\WINDOWS\[[SysWOW64]]'' {{WhiteEnd}} This will allow all of your programs to run in any location without copies of the DLL files inside of every program folder. Administrator rights may be necessary to move them there! The '''DATA''' folder files are integrated into the compiler itself in versions .91 and above. -<center>'''You may need Administrator rights to install or use QB64.'''</center> +<center>'''You may need Administrator rights to install or use QB64.'''</center> ---- -<center>'''The DATA folder and its contents ARE NO LONGER REQUIRED as of the 8/21/2010 version .91!'''</center> +<center>'''The DATA folder and its contents ARE NO LONGER REQUIRED as of the 8/21/2010 version .91!'''</center> -<center> ''Files inside of the older version DATA folder.''</center> +<center> ''Files inside of the older version DATA folder.''</center> {{TextStart}} charset8.raw chrset16.raw qb64.pal qb64ega.pal qb64icon '' '' {{TextEnd}} -<center>{{text|These files are no longer required and are no longer available except with older version downloads!|red}}</center> +<center>{{text|These files are no longer required and are no longer available except with older version downloads!|red}}</center> -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> ==Q: Do you provide changelogs?== We do. Check below: * [[Version .9 changelog]] -* [[Version 1.000 changelog]] +* [[Version 1.000 changel +4000 +og]] * [[Version 1.1 changelog]] -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> ==Q: Does a User licence come with QB64?== @@ -859,7 +862,7 @@ The official version of MINGW GCC compiler can be found at the following URL: :The choice of license makes a big difference: using the '''Lesser GPL''' permits use of the library in proprietary programs; using the ordinary GPL for a library makes it available only for free programs. -<Center>'''QB64 GL License found in the License folder with other licenses:'''</center> +<Center>'''QB64 GL License found in the License folder with other licenses:'''</center> {{TextStart}} '''IMPORTANT LICENSING NOTE FOR QB64 GL PROGRAMMERS''' All executables which perform any kind of sound operation are subject to the LGPL license @@ -967,13 +970,13 @@ license_gnu_gpl_2.txt Location in QB64 distribution: internal/c/parts/video/font/ttf/ Software/Library Name: NanoJPEG - KeyJ's Tiny Baseline JPEG Decoder -Author: Martin J. Fiedler <martin.fiedler@gmx.net> +Author: Martin J. Fiedler <martin.fiedler@gmx.net> License: (refer to license file) License File: nanojpeg_license.txt Location in QB64 distribution: internal/c/parts/video/image/decode/jpg Software/Library Name: NanoJPEG - KeyJ's Tiny Baseline JPEG Decoder -Author: Martin J. Fiedler <martin.fiedler@gmx.net> +Author: Martin J. Fiedler <martin.fiedler@gmx.net> License: (refer to license file) License File: license_nanojpeg.txt Location in QB64 distribution: internal/c/parts/video/image/decode/jpg @@ -985,19 +988,19 @@ Location in QB64 distribution: internal/c/parts/video/image/decode/png {{TextEnd}} -<center> '''The creator of QB64 is NOT responsible for any damages or the intended use of the software it creates!'''</center> +<center> '''The creator of QB64 is NOT responsible for any damages or the intended use of the software it creates!'''</center> -<center>'''The user assumes all risk when they download or use the QB64 compiler!'''</center> +<center>'''The user assumes all risk when they download or use the QB64 compiler!'''</center> -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> ==Q: How can I find what caused a Compiler error?== A: Compiler errors are often actually coding errors that both you and the IDE don't notice! Often it is a syntax error such as forgetting a quotation mark in a PRINT. Look for syntax errors too. * You will find a script/batch file called '''recompile_win.bat''' (also '''recompile_osx.command''' or '''recompile_lnx.sh''', according to your operating system) inside the folder '''internal\temp''' (if you have more than one instance of the IDE open, look inside temp2, temp3, etc). -* Immediately after encountering a "C++ compilation failed" message, run this script to have a look at the error message returned by the gcc compiler. That usually helps track the issue. +* Immediately after encountering a "C++ compilation failed" message, run this script to have a look at the error message returned by the gcc compiler. That usually helps track the issue. ---- @@ -1005,9 +1008,9 @@ A: Compiler errors are often actually coding errors that both you and the IDE do ''For versions of QB64 below .954, the best way to get a clue to the problem is to run the following batch file IMMEDIATELY AFTER a compilation failure: '''CODE UPDATED 1/4/2011''''' -<center>'''{{text|It's a good idea to exclude "QB64.exe" from any real-time anti-virus scanning to prevent IDE Module Errors!|red}}'''</center> +<center>'''{{text|It's a good idea to exclude "QB64.exe" from any real-time anti-virus scanning to prevent IDE Module Errors!|red}}'''</center> -<center>'''Displays errors in a DOS Console window'''</center> +<center>'''Displays errors in a DOS Console window'''</center> {{TextStart}} '' '' @echo off ECHO. @@ -1024,10 +1027,10 @@ ECHO. ECHO. PAUSE '' '' {{TextEnd}} -<center>'''Note: Make sure that ''test64.exe'' is at the end of the long code line when copying!'''</center> +<center>'''Note: Make sure that ''test64.exe'' is at the end of the long code line when copying!'''</center> -<center>'''Places compiler errors into the ''0utput64.txt'' file'''</center> +<center>'''Places compiler errors into the ''0utput64.txt'' file'''</center> {{TextStart}} '' '' @echo off ECHO. @@ -1036,7 +1039,7 @@ ECHO. ECHO Please wait... ECHO. cd .\internal\c -.\bin\g -w -Wall -I.\i -I..\..\ -L.\l qbx.cpp libqbx.o -mwindows .\i686-w64-mingw32\lib\libimm32.a -lwinspool -lmingw32 -ln -lmix -limg -lttf -lmn -lSDL -s -o ..\..\ >..\..\0utput64.txt 2>&1 +.\bin\g -w -Wall -I.\i -I..\..\ -L.\l qbx.cpp libqbx.o -mwindows .\i686-w64-mingw32\lib\libimm32.a -lwinspool -lmingw32 -ln -lmix -limg -lttf -lmn -lSDL -s -o ..\..\ >..\..\0utput64.txt 2>&1 cd ..\.. ECHO. @@ -1044,24 +1047,24 @@ ECHO 0utput64.txt created! ECHO. PAUSE '' '' {{TextEnd}} -<center>'''Note: Make sure that ''0utput64.txt 2>&1'' is at the end of the long code line when copying!'''</center> +<center>'''Note: Make sure that ''0utput64.txt 2>&1'' is at the end of the long code line when copying!'''</center> -<center>'''To create the Batch file, copy code above to Notepad and save it as ''QB64ERR.BAT''. Save as type: ''All Files''.'''</center> +<center>'''To create the Batch file, copy code above to Notepad and save it as ''QB64ERR.BAT''. Save as type: ''All Files''.'''</center> Look for the word '''error''' in the resulting information. The errors often have to do with syntax or code errors not found by the [[IDE]]. -<center>'''Place the batch files into the QB64 folder to use.'''</center> +<center>'''Place the batch files into the QB64 folder to use.'''</center> -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> ==Q: How do I use the QB64 code Repository?== A: QB64 is open source freeware and all the codebase is freely available on GitHub at [https://github.com/Galleondragon/qb64 this link]. You can fork it, develop your own modified version of it and '''most importantly: help improve the official version by making pull requests.''' If you are already familiar with code collaboration, versioning control using git and would like to help, become involved! Your contributions could end up becoming part of the QB64 project. -<!-- You can find a video tutorial here: [http://www.qb64.net/qb64_repository_tutorial.mp4 Repository Video Tutorial] --> +<!-- You can find a video tutorial here: [http://www.qb64.net/qb64_repository_tutorial.mp4 Repository Video Tutorial] --> :: '''I cannot stress enough that the QB64 repository is not an official QB64 release! Even though our contributors are individually appointed, I'm not responsible for the contributions of these other authors which could potentially be malicious. ''' @@ -1069,7 +1072,7 @@ A: QB64 is open source freeware and all the codebase is freely available on GitH ::'''Galleon''' -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> ==Q: Where I can view the C++ code before it gets compiled== Look in the QB64 '''internal\temp''' folder for '''main.txt''' to get the C code used to compile the latest program. @@ -1077,24 +1080,24 @@ Look in the QB64 '''internal\temp''' folder for '''main.txt''' to get the C code ==Q: Where can I find information about a QB64 statement or function?== -<center>'''[[Known QB64 Issues]]'''</center> +<center>'''[[Known QB64 Issues]]'''</center> -<center>'''[http://www.qb64.net/forum/index.php QB64 Forum] ([[Forum Tips]])'''</center> +<center>'''[http://www.qb64.net/forum/index.php QB64 Forum] ([[Forum Tips]])'''</center> -<center>'''[http://qb64.net/wiki/index.php?title=QB64_Tutorials QB64 Tutorials]''' +<center>'''[http://qb64.net/wiki/index.php?title=QB64_Tutorials QB64 Tutorials]''' [[Main_Page#Appendix:|Appendix of QB64 Procedures]] -[http://qb64.net/wiki/index.php?title=Main_Page#Appendix: Information about Programming concepts]</center> +[http://qb64.net/wiki/index.php?title=Main_Page#Appendix: Information about Programming concepts]</center> -<p style="text-align: center">[[Keywords currently not supported by QB64]]</p> +<p style="text-align: center">[[Keywords currently not supported by QB64]]</p> -<center>[[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Keywords Not Supported in Linux or MAC OSX versions]]</center> +<center>[[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Keywords Not Supported in Linux or MAC OSX versions]]</center> -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/QB64_Help_Menu.txt b/internal/help/QB64_Help_Menu.txt index 9b6551185..aba142c10 100644 --- a/internal/help/QB64_Help_Menu.txt +++ b/internal/help/QB64_Help_Menu.txt @@ -1,7 +1,7 @@ -<center>[[Keyword Reference - Alphabetical|Alphabetical Keyword Index]] +<center>[[Keyword Reference - Alphabetical|Alphabetical Keyword Index]] [[Keyword Reference - By usage|Keyword Index by Usage]] [[QB64 FAQ|Frequently Asked Questions About QB64]] -</center> \ No newline at end of file +</center> diff --git a/internal/help/Question_mark.txt b/internal/help/Question_mark.txt index b666739a3..3c35b2ec3 100644 --- a/internal/help/Question_mark.txt +++ b/internal/help/Question_mark.txt @@ -1,10 +1,10 @@ A '''question mark''' can be used as a substitute shortcut to typing PRINT when creating code. -''Usage:'' ?"Hello world" +''Usage:'' ?"Hello world" -''Result:'' PRINT "Hello world" +''Result:'' PRINT "Hello world" * When the IDE cursor moves to the next code line, the question mark is changed to PRINT and the prompt text and variable are spaced appropriately. @@ -19,4 +19,4 @@ A '''question mark''' can be used as a substitute shortcut to typing PRINT when * [[Quotation mark]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/Quotation_mark.txt b/internal/help/Quotation_mark.txt index f2109b3c7..5922f1c68 100644 --- a/internal/help/Quotation_mark.txt +++ b/internal/help/Quotation_mark.txt @@ -1,7 +1,7 @@ A '''quotation mark''' delimits the start and end of a literal [[STRING]] value. -''Usage:'' string_value$ = "This is a text STRING." +''Usage:'' string_value$ = "This is a text STRING." * The quotation mark must delimit the ends of a string or text prompt in a [[PRINT]], [[WRITE]], [[INPUT]] or [[LINE INPUT]] statement. @@ -21,4 +21,4 @@ A '''quotation mark''' delimits the start and end of a literal [[STRING]] value. * [[CHR$]], [[LINE INPUT]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/RANDOM.txt b/internal/help/RANDOM.txt index ec3e3fc9e..fa908efc7 100644 --- a/internal/help/RANDOM.txt +++ b/internal/help/RANDOM.txt @@ -31,21 +31,21 @@ {{Cl|DIM}} {{Cl|SHARED}} cust {{Cl|AS}} customer, recLEN recLEN = {{Cl|LEN}}(cust) 'get the length of the record type -{{Cl|PRINT}} "Rec{{Cl|LEN}}:"; recLEN +{{Cl|PRINT}} "Rec{{Cl|LEN}}:"; recLEN -{{Cl|OPEN}} "randfile.rec" {{Cl|FOR...NEXT|FOR}} {{Cl|RANDOM}} {{Cl|AS}} #1 {{Cl|LEN}} = recLEN +{{Cl|OPEN}} "randfile.rec" {{Cl|FOR...NEXT|FOR}} {{Cl|RANDOM}} {{Cl|AS}} #1 {{Cl|LEN}} = recLEN {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 4 {{Cl|READ}} cust.age, cust.phone {{Cl|PUT}} #1, , cust {{Cl|NEXT}} {{Cl|CLOSE}} #1 -RP = RecordPos("randfile.rec", "2223456789") 'returns 0 if record not found! +RP = RecordPos("randfile.rec", "2223456789") 'returns 0 if record not found! {{Cl|PRINT}} RP {{Cl|IF...THEN|IF}} RP {{Cl|THEN}} - {{Cl|OPEN}} "randfile.rec" {{Cl|FOR...NEXT|FOR}} {{Cl|RANDOM}} {{Cl|AS}} #2 {{Cl|LEN}} = recLEN + {{Cl|OPEN}} "randfile.rec" {{Cl|FOR...NEXT|FOR}} {{Cl|RANDOM}} {{Cl|AS}} #2 {{Cl|LEN}} = recLEN {{Cl|GET}} #2, RP, cust {{Cl|CLOSE}} #2 {{Cl|PRINT}} cust.age, cust.phone @@ -71,12 +71,12 @@ recpos = {{Cl|INSTR}}(dat$, search$) ''Example 2:'' When not using a [[TYPE]] or fixed length strings, QB4.5 allows RANDOM files to hold variable length strings up to 2 bytes less than the LEN = record length statement: {{CodeStart}} '' '' {{Cl|_CONTROLCHR}} OFF -{{Cl|OPEN}} "myfile.txt" {{Cl|FOR...NEXT|FOR}} {{Cl|OUTPUT}} {{Cl|AS}} #1: {{Cl|CLOSE}} #1: ' clears former file of all entries. -{{Cl|OPEN}} "myfile.txt" {{Cl|FOR...NEXT|FOR}} {{Cl|RANDOM}} {{Cl|AS}} #1 {{Cl|LEN}} = 13 'strings can be up to 11 bytes with 2 byte padder +{{Cl|OPEN}} "myfile.txt" {{Cl|FOR...NEXT|FOR}} {{Cl|OUTPUT}} {{Cl|AS}} #1: {{Cl|CLOSE}} #1: ' clears former file of all entries. +{{Cl|OPEN}} "myfile.txt" {{Cl|FOR...NEXT|FOR}} {{Cl|RANDOM}} {{Cl|AS}} #1 {{Cl|LEN}} = 13 'strings can be up to 11 bytes with 2 byte padder -a$ = {{Cl|CHR$}}(1) + {{Cl|CHR$}}(0) + "ABCDEFGHI" -b$ = "ABCDEFGHI" -c$ = "1234" +a$ = {{Cl|CHR$}}(1) + {{Cl|CHR$}}(0) + "ABCDEFGHI" +b$ = "ABCDEFGHI" +c$ = "1234" {{Cl|PUT}} #1, 1, a$ {{Cl|PUT}} #1, 2, b$ @@ -102,4 +102,4 @@ ABCDEFGHI 9 * [[SEEK]], [[SEEK (statement)]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/RANDOMIZE.txt b/internal/help/RANDOMIZE.txt index f0a2b0f60..8ee16fa3a 100644 --- a/internal/help/RANDOMIZE.txt +++ b/internal/help/RANDOMIZE.txt @@ -21,7 +21,7 @@ randnum% = INT({{Cl|RND}} * 11) + 2 'add one to multiplier as INT rounds down and never equals 10 PRINT randnum% K$ = {{Cl|INPUT$}}(1) -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|UCASE$}}(K$) = "Q" 'q = quit +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|UCASE$}}(K$) = "Q" 'q = quit {{Cl|END}} '' '' {{CodeEnd}} :''Explanation:'' Procedure generates random integer values from 2 to 12 like a pair of dice. @@ -33,7 +33,7 @@ K$ = {{Cl|INPUT$}}(1) Print7 {{Cl|RANDOMIZE}} seed Print7 -{{Cl|PRINT}} "Press a key to start sequence over!" +{{Cl|PRINT}} "Press a key to start sequence over!" K$ = {{Cl|INPUT$}}(1) {{Cl|RANDOMIZE}} '''USING''' seed Print7 @@ -101,4 +101,4 @@ DO * [[TIMER]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/READ.txt b/internal/help/READ.txt index 7371f6823..0e81b8001 100644 --- a/internal/help/READ.txt +++ b/internal/help/READ.txt @@ -11,9 +11,9 @@ The '''READ''' statement reads values from a [[DATA]] field and assigns them to * [[DATA]] can be READ using [[STRING]] or numerical [[TYPE]] variables singularly or in a comma separated list: :: [[STRING]] READ variables can read quoted or unquoted text or numerical DATA values! :: Numerical type READ variables can only read '''unquoted''' numerical DATA values! -::'''If they do not agree, a [[ERROR Codes|"Syntax error"]] may result when run reading string data as numerical values!''' +::'''If they do not agree, a [[ERROR Codes|"Syntax error"]] may result when run reading string data as numerical values!''' * If the number of variables specified is fewer than the number of elements in the DATA statement(s), subsequent READ statements begin reading data at the next unread element. If there are no subsequent READ statements, the extra data is ignored. -* If variable reads exceed the number of elements in the DATA field(s), an [[ERROR Codes|"Out of data" error]] will occur! +* If variable reads exceed the number of elements in the DATA field(s), an [[ERROR Codes|"Out of data" error]] will occur! * 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!''' @@ -42,12 +42,12 @@ The '''READ''' statement reads values from a [[DATA]] field and assigns them to ''Example 2:'' Reading three pieces of data at once. {{CodeStart}} - PRINT " CITY ", " STATE ", " ZIP" - PRINT {{Cl|STRING$}}(30, "-") 'divider + PRINT " CITY ", " STATE ", " ZIP" + PRINT {{Cl|STRING$}}(30, "-") 'divider {{Cl|READ}} C$, S$, Z& PRINT C$, S$, Z& - {{Cl|DATA}} "DENVER,", COLORADO, 80211 '' '' + {{Cl|DATA}} "DENVER,", COLORADO, 80211 '' '' {{CodeEnd}} {{OutputStart}} CITY      STATE     ZIP @@ -64,4 +64,4 @@ The '''READ''' statement reads values from a [[DATA]] field and assigns them to * [[OPEN]] FOR [[INPUT (file mode)|INPUT]] {{text|(file statement)}} -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/REDIM.txt b/internal/help/REDIM.txt index 2b1510680..65069cef1 100644 --- a/internal/help/REDIM.txt +++ b/internal/help/REDIM.txt @@ -19,14 +19,14 @@ A {{KW|REDIM}} statement can re-dimension one [[$DYNAMIC|dynamic]](flexible) [[A * [[$DYNAMIC|Dynamic]] arrays MUST be [[REDIM]]ensioned if [[ERASE]] or [[CLEAR]] are used to clear the arrays as they no longer exist. * When [[AS]] is used to declare the type, use [[AS]] to retain that type or it will change to [[SINGLE]]! * '''NOTE: Many Qbasic keyword variable names CAN be used with a [[STRING]] suffix($) ONLY! You CANNOT use them without the suffix, use a numerical suffix or use [[DIM]], [[REDIM]], [[_DEFINE]], [[BYVAL]] or [[TYPE]] variable [[AS]] statements!''' -* '''Warning! Do not use negative array upper bound index values as OS access or "Out of Memory" [[ERROR Codes|errors]] will occur!''' +* '''Warning! Do not use negative array upper bound index values as OS access or "Out of Memory" [[ERROR Codes|errors]] will occur!''' ''Example 1:'' The [[$DYNAMIC]] Metacommand allows an array to be re-sized using [[DIM]] and REDIM. {{CodeStart}} '' '' '{{Cl|$DYNAMIC}} -{{Cl|INPUT}} "Enter array size: ", size +{{Cl|INPUT}} "Enter array size: ", size {{Cl|DIM}} Array(size) {{Cl|REDIM}} Array(2 * size) @@ -63,4 +63,4 @@ array(10) = 24 * [[$DYNAMIC]], [[$STATIC]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/REM.txt b/internal/help/REM.txt index 0a9a3e003..8f1d4ae76 100644 --- a/internal/help/REM.txt +++ b/internal/help/REM.txt @@ -27,4 +27,4 @@ * {{KW|$DYNAMIC}}, {{KW|$STATIC}}, {{KW|$INCLUDE|$INCLUDE:}} -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/RESET.txt b/internal/help/RESET.txt index 8cd4107bc..f0b8ad825 100644 --- a/internal/help/RESET.txt +++ b/internal/help/RESET.txt @@ -14,4 +14,4 @@ The '''RESET''' statement closes all files and writes the directory information * [[CLOSE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/RESTORE.txt b/internal/help/RESTORE.txt index bf81eeb3a..b0ffe4039 100644 --- a/internal/help/RESTORE.txt +++ b/internal/help/RESTORE.txt @@ -9,7 +9,7 @@ The '''RESTORE''' statement is used to reset the DATA pointer to the beginning o * Datafield label names are not required when working with ONE or a progression of data fields in the main body of code. * Label multiple data fields to restore them to use them again when necessary. * If RESTORE is used with unlabeled data fields or no datafield is designated then the first data field is read. -* Use RESTORE to avoid an [[ERROR Codes|"Out of Data" error]] when reading a data field! +* 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. @@ -18,14 +18,14 @@ The '''RESTORE''' statement is used to reset the DATA pointer to the beginning o ''Example:'' Restoring a labeled DATA field to avoid going past the end of DATA. {{CodeStart}} DO - {{Cl|INPUT}} "Enter a month number(1 to 12): ", monthnum% + {{Cl|INPUT}} "Enter a month number(1 to 12): ", monthnum% {{Cl|RESTORE}} Months FOR i = 1 TO monthnum% {{Cl|READ}} month$, days% 'variables must match data field types NEXT - {{Cl|PRINT}} "The month "; month$; " has"; days%; "days." -LOOP UNTIL monthnum% < 1 OR monthnum% > 12 + {{Cl|PRINT}} "The month "; month$; " has"; days%; "days." +LOOP UNTIL monthnum% < 1 OR monthnum% > 12 Months: {{Cl|DATA}} January, 31, February, 28, March, 31, April, 30, May, 31, June, 30 @@ -44,11 +44,11 @@ The month June has 30 days. {{Cl|DO}} {{Cl|READ}} dummy$ 'we won't actually use this string for anything else than to know when there is no more DATA. count = count + 1 -{{Cl|LOOP}} {{Cl|UNTIL}} dummy$ = "stop" 'when dummy$ = "stop" then we know that it is the last entry so it only does the above loop until then. +{{Cl|LOOP}} {{Cl|UNTIL}} dummy$ = "stop" 'when dummy$ = "stop" then we know that it is the last entry so it only does the above loop until then. -count = count - 1 'since the last string is "stop" and we don't want to store it in the array. +count = count - 1 'since the last string is "stop" and we don't want to store it in the array. -{{Cl|PRINT}} "The number of relevant entries are:"; count +{{Cl|PRINT}} "The number of relevant entries are:"; count {{Cl|DIM}} entry$(count) 'Now we know how many elements we need to make space for (DIM) @@ -67,7 +67,7 @@ count = count - 1 'since the last string is "stop" and we don't want t {{Cl|END}} -{{Cl|DATA}} "entry1", "entry2", "entry3", "stop" +{{Cl|DATA}} "entry1", "entry2", "entry3", "stop" {{CodeEnd}} {{small|Code By: Cyperium}} @@ -86,4 +86,4 @@ entry3 * [[line numbers]] / line labels -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/RESUME.txt b/internal/help/RESUME.txt index 59e015dd8..dd575c8be 100644 --- a/internal/help/RESUME.txt +++ b/internal/help/RESUME.txt @@ -18,4 +18,4 @@ The '''RESUME''' statement is used with '''NEXT''' or a line number or label in * [[FOR...NEXT]] (counter loop) -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/RETURN.txt b/internal/help/RETURN.txt index 32042739d..dfe8cd542 100644 --- a/internal/help/RETURN.txt +++ b/internal/help/RETURN.txt @@ -14,7 +14,7 @@ * Normally required at the end of a [[GOSUB]] procedure unless the procedure returns using a loop. * RETURN is not used in error handling procedures. Error procedures use [[RESUME]] ''line number'' or [[RESUME|RESUME NEXT]]. * GOSUB procedures use line numbers or line labels designated with a colon after the number or label. -* If RETURN is encountered without a previous [[GOSUB]] call a [[ERROR Codes|"RETURN without GOSUB" error]] is produced. +* If RETURN is encountered without a previous [[GOSUB]] call a [[ERROR Codes|"RETURN without GOSUB" error]] is produced. * To avoid errors, place [[GOSUB]] procedures AFTER the main program code [[END]] or after an [[EXIT SUB]] or [[EXIT FUNCTION]] call. @@ -28,7 +28,7 @@ {{Cl|END}} 'END or SYSTEM stop the program before the execution of a sub procedure five: -{{Cl|PRINT}} "Aha! Five!" +{{Cl|PRINT}} "Aha! Five!" {{Cl|RETURN}} '' '' {{CodeEnd}} {{OutputStart}} @@ -49,9 +49,9 @@ Aha! Five! ''Example 2:'' Returns to a specific line label. {{CodeStart}} {{Cl|GOSUB}} hey -{{Cl|PRINT}} "it didn't go here." +{{Cl|PRINT}} "it didn't go here." hoho: -{{Cl|PRINT}} "it went here." +{{Cl|PRINT}} "it went here." {{Cl|END}} hey: @@ -70,4 +70,4 @@ it went here. * [[RESUME]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/RIGHT$.txt b/internal/help/RIGHT$.txt index 6115cdc5e..7ed4ea7a3 100644 --- a/internal/help/RIGHT$.txt +++ b/internal/help/RIGHT$.txt @@ -19,9 +19,9 @@ The '''RIGHT$''' function returns a set number of characters in a [[STRING]] var ''Example 1:'' Getting the right portion of a string value such as a person's last name. {{CodeStart}} '' '' -name$ = "Tom Williams" +name$ = "Tom Williams" -Last$ = {{Cl|RIGHT$}}(name$, {{Cl|LEN}}(name$) - {{Cl|INSTR}}(name$, " ")) 'subtract space position from string length +Last$ = {{Cl|RIGHT$}}(name$, {{Cl|LEN}}(name$) - {{Cl|INSTR}}(name$, " ")) 'subtract space position from string length {{Cl|PRINT}} Last$ '' '' {{CodeEnd}} @@ -36,11 +36,11 @@ green = 0 blue = 128 Color32 red, green, blue -{{Cl|PRINT}} "Colored text" +{{Cl|PRINT}} "Colored text" {{Cl|SUB}} Color32 (R, G, B) R = R {{Cl|AND (boolean)|AND}} {{Cl|&H}}FF: G = G {{Cl|AND (boolean)|AND}} {{Cl|&H}}FF: B = B {{Cl|AND (boolean)|AND}} {{Cl|&H}}FF ' limit values to 0 to 255 -hexadecimal$ = "{{Cl|&H}}FF" + {{Cl|RIGHT$}}("0" + {{Cl|HEX$}}(R), 2) + {{Cl|RIGHT$}}("0" + {{Cl|HEX$}}(G), 2) + {{Cl|RIGHT$}}("0" + {{Cl|HEX$}}(B), 2) +hexadecimal$ = "{{Cl|&H}}FF" + {{Cl|RIGHT$}}("0" + {{Cl|HEX$}}(R), 2) + {{Cl|RIGHT$}}("0" + {{Cl|HEX$}}(G), 2) + {{Cl|RIGHT$}}("0" + {{Cl|HEX$}}(B), 2) {{Cl|PRINT}} hexadecimal$ {{Cl|COLOR}} {{Cl|VAL}}(hexadecimal$) {{Cl|END SUB}} '' '' @@ -56,4 +56,4 @@ hexadecimal$ = "{{Cl|&H}}FF" + {{Cl|RIGHT$}}("0" + {{Cl| * [[INSTR]], [[HEX$]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/RMDIR.txt b/internal/help/RMDIR.txt index 9c22a52f6..e7393f7ca 100644 --- a/internal/help/RMDIR.txt +++ b/internal/help/RMDIR.txt @@ -19,10 +19,10 @@ The {{KW|RMDIR}} statement deletes an empty directory using a designated path re {{Cl|ON ERROR|ON ERROR GOTO}} ErrorHandler DO ERRcode = 0 - {{Cl|INPUT}} "Enter path and name of directory to delete: "; directory$ + {{Cl|INPUT}} "Enter path and name of directory to delete: "; directory$ IF {{Cl|LEN}}(directory$) THEN 'valid user entry or quits {{Cl|RMDIR}} directory$ 'removes empty folder without a prompt - IF ERRcode = 0 THEN PRINT "Folder "; directory$; " removed." + IF ERRcode = 0 THEN PRINT "Folder "; directory$; " removed." END IF LOOP UNTIL ERRcode = 0 OR LEN(directory$) = 0 {{Cl|SYSTEM}} @@ -32,11 +32,11 @@ ErrorHandler: ERRcode = {{Cl|ERR}} 'get error code returned {{Cl|SELECT CASE}} ERRcode {{Cl|CASE}} 75 - {{Cl|PRINT}} directory$ + " is not empty!" + {{Cl|PRINT}} directory$ + " is not empty!" {{Cl|CASE}} 76 - {{Cl|PRINT}} directory$ + " does not exist!" + {{Cl|PRINT}} directory$ + " does not exist!" {{Cl|CASE ELSE}} - {{Cl|PRINT}} "Error"; ERRcode; "attempting to delete " + directory$ + {{Cl|PRINT}} "Error"; ERRcode; "attempting to delete " + directory$ {{Cl|END SELECT}} {{Cl|PRINT}} {{Cl|RESUME|RESUME NEXT}} @@ -62,4 +62,4 @@ C:\temp is not empty! * [[DOS]], [[Batch Files]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/RND.txt b/internal/help/RND.txt index fabae2071..6cc7148e4 100644 --- a/internal/help/RND.txt +++ b/internal/help/RND.txt @@ -10,7 +10,7 @@ The '''RND''' function returns a random number with a value between 0 (inclusive ::n parameter omitted: Returns next random number in the sequence. ::n = 0: Return the last value returned. ::n < 0: Always returns the same value for any given n -::n > 0: the sequence of numbers generated will not change unless [[RANDOMIZE]] is initiated. +::n > 0: the sequence of numbers generated will not change unless [[RANDOMIZE]] is initiated. {{PageDescription}} @@ -38,7 +38,7 @@ dice% = {{Cl|INT}}({{Cl|RND}} * 6) + 1 '' '' 'add one as INT value never reaches u! = {{Cl|RND}} * 2 - 1 v! = {{Cl|RND}} * 2 - 1 s! = u! * u! + v! * v! -{{Cl|LOOP}} {{Cl|WHILE}} s! >= 1 {{Cl|OR}} s! = 0 +{{Cl|LOOP}} {{Cl|WHILE}} s! >= 1 {{Cl|OR}} s! = 0 s! = SQR(-2 * {{Cl|LOG}}(s!) / s!) * 0.5 u! = u! * s! v! = v! * s! '' '' @@ -96,7 +96,7 @@ DO {{Cl|NEXT}} J -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" '' '' +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" '' '' {{CodeEnd}} {{small|Code by Falcon}} @@ -105,4 +105,4 @@ DO * [[INT]], [[CINT]], [[FIX]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/RSET.txt b/internal/help/RSET.txt index 328d1db7f..c265a0722 100644 --- a/internal/help/RSET.txt +++ b/internal/help/RSET.txt @@ -15,13 +15,13 @@ The '''RSET''' statement right-justifies a string according to length of the str {{CodeStart}} '' '' {{Cl|CLS}} {{Cl|DIM}} thestring {{Cl|AS}} {{Cl|STRING}} * 10 -{{Cl|PRINT}} "12345678901234567890 -{{Cl|RSET}} thestring = "Hello!" +{{Cl|PRINT}} "12345678901234567890 +{{Cl|RSET}} thestring = "Hello!" {{Cl|PRINT}} thestring anystring$ = {{Cl|SPACE$}}(20) -{{Cl|RSET}} anystring$ = "Hello again!" +{{Cl|RSET}} anystring$ = "Hello again!" {{Cl|PRINT}} anystring$ -{{Cl|RSET}} thestring = "Over ten characters long" +{{Cl|RSET}} thestring = "Over ten characters long" {{Cl|PRINT}} thestring '' '' {{CodeEnd}} {{OutputStart}} @@ -31,7 +31,7 @@ anystring$ = {{Cl|SPACE$}}(20) Over ten c {{OutputEnd}} -:''Explanation:'' Notice how "Hello!" ends at the tenth position because the length of ''thestring'' is 10. When we used SPACE$(20) the length of ''anystring$'' became 20 so "Hello Again!" ended at the 20th position. That is right-justified. The last line "Over ten c" is truncated as it didn't fit into ''thestring'''s length of only 10 characters. +:''Explanation:'' Notice how "Hello!" ends at the tenth position because the length of ''thestring'' is 10. When we used SPACE$(20) the length of ''anystring$'' became 20 so "Hello Again!" ended at the 20th position. That is right-justified. The last line "Over ten c" is truncated as it didn't fit into ''thestring'''s length of only 10 characters. ''See also:'' @@ -40,4 +40,4 @@ Over ten c * [[PUT]], [[GET]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/RTRIM$.txt b/internal/help/RTRIM$.txt index 6633f9463..215d14c53 100644 --- a/internal/help/RTRIM$.txt +++ b/internal/help/RTRIM$.txt @@ -19,9 +19,9 @@ name$ = {{Cl|RTRIM$}}(contact.name) ' trims spaces from end of fixed length {{Cl {{CodeEnd}} Trimming text string ends: -{{CodeStart}}{{Cl|PRINT}} {{Cl|RTRIM$}}("some text") + "." -{{Cl|PRINT}} {{Cl|RTRIM$}}("some text ") + "." -{{Cl|PRINT}} {{Cl|RTRIM$}}("Tommy ") +{{CodeStart}}{{Cl|PRINT}} {{Cl|RTRIM$}}("some text") + "." +{{Cl|PRINT}} {{Cl|RTRIM$}}("some text ") + "." +{{Cl|PRINT}} {{Cl|RTRIM$}}("Tommy ") {{CodeEnd}} {{OutputStart}}some text. some text. @@ -35,4 +35,4 @@ Tommy * {{KW|LSET}}, {{KW|RSET}} -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/RUN.txt b/internal/help/RUN.txt index 90813473f..183b42b41 100644 --- a/internal/help/RUN.txt +++ b/internal/help/RUN.txt @@ -35,7 +35,7 @@ The multi-modular technique goes back to when QBasic and QuickBASIC had module s ''Example 1:'' Shows how RUN can reference multiple line numbers in the main module code. No line number executes first code line. {{CodeStart}} '' '' -PRINT " A", " B", " C", " D" +PRINT " A", " B", " C", " D" 10 A = 1 20 B = 2 30 C = 3 @@ -46,8 +46,8 @@ PRINT " A", " B", " C", " D" 80 {{Cl|IF...THEN|IF}} C = 0 {{Cl|THEN}} 90 {{Cl|ELSE}} {{Cl|RUN}} 40 90 {{Cl|IF...THEN|IF}} D = 0 {{Cl|THEN}} 100 {{Cl|ELSE}} {{Cl|RUN}} 50 100 {{Cl|PRINT}} -{{Cl|INPUT}} "Do you want to quit?(Y/N)", quit$ -{{Cl|IF...THEN|IF}} {{Cl|UCASE$}}(quit$) = "Y" {{Cl|THEN}} {{Cl|END}} {{Cl|ELSE}} {{Cl|RUN}} 'RUN without line number executes at first code line +{{Cl|INPUT}} "Do you want to quit?(Y/N)", quit$ +{{Cl|IF...THEN|IF}} {{Cl|UCASE$}}(quit$) = "Y" {{Cl|THEN}} {{Cl|END}} {{Cl|ELSE}} {{Cl|RUN}} 'RUN without line number executes at first code line '' '' {{CodeEnd}} {{OutputStart}}A B C D @@ -63,20 +63,20 @@ Do you want to quit?(Y/N)_ ''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}} 12, 36: {{Cl|PRINT}} "ProgramA" -{{Cl|LOCATE}} 23, 25: {{Cl|PRINT}} "Press any key to run ProgramB" +{{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|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" +{{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|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}} @@ -90,4 +90,4 @@ parameter$ = {{Cl|UCASE$}}({{Cl|COMMAND$}}) * [[COMMAND$]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/SADD.txt b/internal/help/SADD.txt index f2bf18172..dd86e07ef 100644 --- a/internal/help/SADD.txt +++ b/internal/help/SADD.txt @@ -14,4 +14,4 @@ The '''SADD''' function returns the address of a [[STRING]] variable as an offse * [[VARSEG]], [[VARPTR]], [[DEF SEG]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/SCREEN.txt b/internal/help/SCREEN.txt index a55ff4e28..12287dc40 100644 --- a/internal/help/SCREEN.txt +++ b/internal/help/SCREEN.txt @@ -1,4 +1,4 @@ -{| align="Right" +{| align="Right" | __TOC__ |} The [[SCREEN]] statement sets the video display mode and size of the program window's workspace. @@ -59,7 +59,7 @@ The [[SCREEN]] statement sets the video display mode and size of the program win * All SCREEN modes are Windows in QB64. Use [[_FULLSCREEN]] to set the window area to full screen. * [[_SCREENMOVE]] can position a window or the _MIDDLE option can center it on the desktop. -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ==Legacy Screen Modes== @@ -93,9 +93,9 @@ The [[SCREEN]] statement sets the video display mode and size of the program win * '''[[SCREEN]] [[_LOADIMAGE]]'''(imagehandle&, colors) can load a program screen of an image file handle in '''QB64''' using 256 or 32 bit. -<center>'''QB64 can use page flipping with any number of pages in any screen mode!'''</center> +<center>'''QB64 can use page flipping with any number of pages in any screen mode!'''</center> -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ==Text and Graphics== @@ -105,7 +105,6 @@ The [[SCREEN]] statement sets the video display mode and size of the program win * Are a minimum of 1 and the values given above are the maximums. [[LOCATE]] 1, 1 is the top left [[SCREEN]] text position. * Text characters occupy a certain sized pixel box adjusted by [[WIDTH]] in some screen modes. * Text [[PRINT]] cursor positions can be read by {{KW|CSRLIN}} and {{KW|POS|POS(0)}} to [[LOCATE]] text [[PRINT]]s. -* The [[SCREEN (function)]] can be used to read the [[ASCII]] character code or color of text in SCREEN 0 only. * [[VIEW PRINT]] can be used to designate a text view port area. * In '''QB64''' the [[_WIDTH (function)|_WIDTH]] and [[_HEIGHT]] functions will return the text dimensions in SCREEN 0 only. @@ -131,22 +130,22 @@ The [[SCREEN]] statement sets the video display mode and size of the program win * The current desktop screen resolution can be found using the [[_SCREENIMAGE]] handle value with [[_WIDTH (function)|_WIDTH]] and [[_HEIGHT]]. * '''NOTE: Default 32 bit backgrounds are clear black or [[_RGBA]](0, 0, 0, 0)! Use [[CLS]] to make the black opaque!''' -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ==Examples== :''Example 1:'' Shows an example of each legacy screen mode available to Qbasic and QB64. {{CodeStart}} '' '' {{Cl|SCREEN}} 0 -{{Cl|PRINT}} "This is {{Cl|SCREEN}} 0 - only text is allowed!" +{{Cl|PRINT}} "This is {{Cl|SCREEN}} 0 - only text is allowed!" {{Cl|FOR}} S = 1 {{Cl|TO}} 13 - {{Cl|IF}} S < 3 {{Cl|OR}} S > 6 {{Cl|THEN}} - {{Cl|DO}}: {{Cl|SLEEP}}: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" + {{Cl|IF}} S < 3 {{Cl|OR}} S > 6 {{Cl|THEN}} + {{Cl|DO}}: {{Cl|SLEEP}}: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" {{Cl|SCREEN}} S - {{Cl|PRINT}} "This is {{Cl|SCREEN}}"; S; " - can use text and graphics!" - {{Cl|IF}} S = 2 {{Cl|OR}} S = 11 {{Cl|THEN}} {{Cl|PRINT}} "Monochrome - no {{Cl|COLOR}} statements!" + {{Cl|PRINT}} "This is {{Cl|SCREEN}}"; S; " - can use text and graphics!" + {{Cl|IF}} S = 2 {{Cl|OR}} S = 11 {{Cl|THEN}} {{Cl|PRINT}} "Monochrome - no {{Cl|COLOR}} statements!" {{Cl|IF}} S = 10 {{Cl|THEN}} - {{Cl|COLOR}} 2: {{Cl|PRINT}} "This {{Cl|SCREEN}} has only 4 colors. Black and 3 white: 2 blinks. + {{Cl|COLOR}} 2: {{Cl|PRINT}} "This {{Cl|SCREEN}} has only 4 colors. Black and 3 white: 2 blinks. {{Cl|CIRCLE}} (100,100), 50, 2 {{Cl|ELSE}} : {{Cl|CIRCLE}} (100,100), 100, S {{Cl|END IF}} @@ -160,42 +159,7 @@ This is SCREEN 0 - only text is allowed! {{OutputEnd}} :Displays each {{KW|SCREEN (statement)|SCREEN}} mode one at a time with a {{KW|CIRCLE}} (except for {{KW|SCREEN (statement)|SCREEN}} 0) - -''Example 2:'' Making ANY '''QB64 legacy screen mode''' larger using a SUB that easily converts PRINT to [[_PRINTSTRING]]. -{{CodeStart}} -Scr13& = {{Cl|_NEWIMAGE}}(320, 200, 13) 'this is the old SCREEN 13 image page to set the image -Big13& = {{Cl|_NEWIMAGE}}(640, 480, 256) 'use 4 X 3 aspect ratio that Qbasic used when full screen - -{{Cl|SCREEN}} Big13& -{{Cl|_DEST}} Scr13& -image1& = {{Cl|_LOADIMAGE}}("Howie.BMP", 256) 'see the download link below for 2 image files -image2& = {{Cl|_LOADIMAGE}}("Howie2.BMP", 256) -{{Cl|_PUTIMAGE}} (10, 20), image1&, Scr13& -{{Cl|_PUTIMAGE}} (160, 20), image2&, Scr13& -{{Cl|_COPYPALETTE}} image1&, Scr13& -{{Cl|COLOR}} 151: {{Cl|LOCATE}} 2, 4: PRINTS "Screen 13 Height Reduction to 83%" -{{Cl|LOCATE}} 22, 22: PRINTS {{Cl|CHR$}}(24) + " 4 X 3 Proportion" 'use {{Cl|concatenation}} -{{Cl|LOCATE}} 24, 21: PRINTS {{Cl|CHR$}}(27) + " Stretched at 100%" 'instead of a {{Cl|semicolon}}! -{{Cl|_COPYPALETTE}} Scr13&, Big13& 'required when imported image colors are used -{{Cl|_PUTIMAGE}} , Scr13&, Big13& 'stretches the screen to double the size -K$ = {{Cl|INPUT$}}(1) -{{Cl|END}} - -{{Cl|SUB}} PRINTS (Text$) -row% = ({{Cl|CSRLIN}} - 1) * {{Cl|_FONTHEIGHT}} 'finds current screen page text or font row height -col% = ({{Cl|POS}}(0) - 1) * {{Cl|_PRINTWIDTH}}("W") 'finds current page text or font column width -{{Cl|_PRINTSTRING}} (col%, row%), Text$ -{{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 '''Search Menu'''. - -<center>[https://www.dropbox.com/s/tcdik1ajegbeiz4/HOWIE.zip?dl=0 Download of Example 2 Bitmap images]</center> - - -<center>You can easily change PRINT to the PRINTS sub-procedure name in your code using the [[IDE]] ''Search'' Menu ''Change'' option.</center> - -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> ==References== @@ -226,4 +190,4 @@ col% = ({{Cl|POS}}(0) - 1) * {{Cl|_PRINTWIDTH}}("W") 'finds current pa * [[_CONSOLE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/SCREEN_(function).txt b/internal/help/SCREEN_(function).txt index fe3be02f9..1212bd0ee 100644 --- a/internal/help/SCREEN_(function).txt +++ b/internal/help/SCREEN_(function).txt @@ -15,8 +15,8 @@ The '''SCREEN''' function returns the [[ASCII]] code of a text character or the * The ''code'' value returned is the [[ASCII]] code from 0 to 255. Returns 32([[SPACE$|space]]) when no character is found at a coordinate. * If the ''colorflag'' value is omitted or it is 0, the function returns the [[ASCII]] code of the text character at the position designated. * When the ''flag'' value is greater than 0 in '''SCREEN 0''', the function returns the foreground and background color attribute of text position. -:: * The foreground color(0 to 15) is the returned SCREEN color value AND 15: '''{{text|FG <nowiki>=</nowiki> SCREEN(1, 1, 1) AND 15|green}}''' -:: * The background color(0 to 7) is the returned SCREEN color value \ 16: '''{{text|BG <nowiki>=</nowiki> SCREEN(1, 1, 1) \ 16|green}}''' +:: * The foreground color(0 to 15) is the returned SCREEN color value AND 15: '''{{text|FG <nowiki>=</nowiki> SCREEN(1, 1, 1) AND 15|green}}''' +:: * The background color(0 to 7) is the returned SCREEN color value \ 16: '''{{text|BG <nowiki>=</nowiki> SCREEN(1, 1, 1) \ 16|green}}''' * '''QB64''' can return color values in screen modes other than [[SCREEN]] 0. Qbasic returned the wrong color values in graphic screen modes! @@ -26,9 +26,9 @@ The '''SCREEN''' function returns the [[ASCII]] code of a text character or the {{Cl|COLOR}} 0, 15 {{Cl|CLS}} -{{Cl|PRINT}} "{{Cl|SCREEN}} ="; {{Cl|SCREEN (function)|SCREEN}}(1, 1, 1) -{{Cl|PRINT}} "FG color:"; {{Cl|SCREEN (function)|SCREEN}}(1, 1, 1) {{Cl|AND (boolean)|AND}} 15 'low nibble -{{Cl|PRINT}} "BG color:"; {{Cl|SCREEN (function)|SCREEN}}(1, 1, 1) \ 16 'high nibble '' '' +{{Cl|PRINT}} "{{Cl|SCREEN}} ="; {{Cl|SCREEN (function)|SCREEN}}(1, 1, 1) +{{Cl|PRINT}} "FG color:"; {{Cl|SCREEN (function)|SCREEN}}(1, 1, 1) {{Cl|AND (boolean)|AND}} 15 'low nibble +{{Cl|PRINT}} "BG color:"; {{Cl|SCREEN (function)|SCREEN}}(1, 1, 1) \ 16 'high nibble '' '' {{CodeEnd}} {{TextStart}}'''SCREEN = 112''' '''FG color: 0''' @@ -42,10 +42,10 @@ The '''SCREEN''' function returns the [[ASCII]] code of a text character or the {{Cl|SCREEN (statement)|SCREEN}} 12 row = 10: column = 10 -{{Cl|COLOR}} 9: {{Cl|LOCATE}} row, column: {{Cl|PRINT}} "Hello" +{{Cl|COLOR}} 9: {{Cl|LOCATE}} row, column: {{Cl|PRINT}} "Hello" code% = {{Cl|SCREEN (function)|SCREEN}}(row, column, 0) ' character code return parameter 0 attrib% = {{Cl|SCREEN (function)|SCREEN}}(row, column, 1) ' character color return parameter 1 -{{Cl|COLOR}} 14: {{Cl|LOCATE}} 15, 10: {{Cl|PRINT}} "ASCII:"; code%, "COLOR:"; attrib% +{{Cl|COLOR}} 14: {{Cl|LOCATE}} 15, 10: {{Cl|PRINT}} "ASCII:"; code%, "COLOR:"; attrib% {{Cl|END}} '' '' {{CodeEnd}} {{OutputStart}} @@ -55,17 +55,17 @@ attrib% = {{Cl|SCREEN (function)|SCREEN}}(row, column, 1) ' character color re {{Text| ASCII: 72 COLOR: 9|yellow}} {{OutputEnd}} -:''Explanation:'' The SCREEN function returns the [[ASCII]] code for "H" and the color 9. +:''Explanation:'' The SCREEN function returns the [[ASCII]] code for "H" and the color 9. ''Example 3:'' Finding the current program path placed on the screen using [[FILES]] and the SCREEN function in SCREEN 0. {{CodeStart}} '' '' {{Cl|SCREEN}} 0, 0, 0, 0 {{Cl|CLS}} -{{Cl|PRINT}} "This is a directory test..." +{{Cl|PRINT}} "This is a directory test..." {{Cl|SCREEN}} 0, 0, 1, 0 {{Cl|COLOR}} 0 'blank out the screen text -{{Cl|FILES}} "qb64.exe" 'the current program's filename can also be used +{{Cl|FILES}} "qb64.exe" 'the current program's filename can also be used {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 80 a$ = a$ + {{Cl|CHR$}}({{Cl|SCREEN (function)|SCREEN}}(1, i)) 'scan the black text on the screen {{Cl|NEXT}} @@ -74,7 +74,7 @@ attrib% = {{Cl|SCREEN (function)|SCREEN}}(row, column, 1) ' character color re a$ = {{Cl|RTRIM$}}(a$) {{Cl|SLEEP}} {{Cl|SCREEN (statement)|SCREEN}} 0, 0, 0, 0 -{{Cl|LOCATE}} 3, 1: {{Cl|PRINT}} "The current directory is: "; a$ +{{Cl|LOCATE}} 3, 1: {{Cl|PRINT}} "The current directory is: "; a$ {{Cl|END}} '' '' {{CodeEnd}} {{small|Code by Pete from the N54 QB site}} @@ -88,4 +88,4 @@ a$ = {{Cl|RTRIM$}}(a$) * [[Screen Memory]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/SEEK.txt b/internal/help/SEEK.txt index 3cc062da4..dfd1fdf23 100644 --- a/internal/help/SEEK.txt +++ b/internal/help/SEEK.txt @@ -18,4 +18,4 @@ The '''SEEK''' function returns the current byte or record position in a file. *[[LOC]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/SEEK_(statement).txt b/internal/help/SEEK_(statement).txt index 06141aefd..134649d40 100644 --- a/internal/help/SEEK_(statement).txt +++ b/internal/help/SEEK_(statement).txt @@ -28,4 +28,4 @@ The '''SEEK''' statement sets the next byte or record position of a file for a r * [[GET]], [[PUT]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/SELECT_CASE.txt b/internal/help/SELECT_CASE.txt index bf7d21fd0..eb5e0a813 100644 --- a/internal/help/SELECT_CASE.txt +++ b/internal/help/SELECT_CASE.txt @@ -18,11 +18,11 @@ * The literal, variable or expression {{Parameter|testExpression}} comparison can result in any string or numerical type. * '''Note:''' A {{Parameter|testExpression}} variable value can be changed inside of true CASE evaluations in SELECT EVERYCASE. * A {{Parameter|testExpression}} derived from an expression or [[FUNCTION]] will only be determined once at the start of the block execution. -* <span id="allCASES">Supports individual CASE values and ranges or lists of literal values as below:</span> +* <span id="allCASES">Supports individual CASE values and ranges or lists of literal values as below:</span> ** '''CASE''' casevalue: code {{text|''''case compares one numerical or text value'''}} ** '''CASE''' casevalue1 [[TO]] casevalue2: code {{text|''''case compares a range of values '''}} ** '''CASE''' casevalue1, casevalue2, casevalue3: code {{text|''''case compares a list of values separated by commas'''}} -** '''CASE IS''' > casevalue: code {{text|''''case compares a value as <nowiki> =, <>, < or > </nowiki>'''}} +** '''CASE IS''' > casevalue: code {{text|''''case compares a value as <nowiki> =, <>, < or > </nowiki>'''}} ** '''CASE ELSE''': code {{text|''''bottom case statement executes only when no other CASE is executed.}}''' * The CASE values should cover the normal ranges of the comparison {{Parameter|testExpression}} values. * Use '''CASE ELSE''' before '''END SELECT''' if an alternative is necessary when no other case matches. @@ -37,20 +37,20 @@ {{PageExamples}} ''Example 1:'' SELECT CASE can use literal or variable [[STRING]] or numerical values in CASE comparisons: {{CodeStart}} '' '' -{{Cl|INPUT}} "Enter a whole number value from 1 to 40: ", value +{{Cl|INPUT}} "Enter a whole number value from 1 to 40: ", value value1 = 10 value2 = 20 value3 = 30 {{Cl|SELECT CASE}} value - {{Cl|CASE}} value1: {{Cl|PRINT}} "Ten only" - {{Cl|CASE}} value1 {{Cl|TO}} value2: {{Cl|PRINT}} "11 to 20 only" '10 is already evaluated - {{Cl|CASE}} value1, value2, value3: {{Cl|PRINT}} "30 only" '10 and 20 are already evaluated - {{Cl|CASE IS}} > value2: {{Cl|PRINT}} "greater than 20 but not 30" '30 is already evaluated - {{Cl|CASE ELSE}}: {{Cl|PRINT}} "Other value" 'values less than 10 + {{Cl|CASE}} value1: {{Cl|PRINT}} "Ten only" + {{Cl|CASE}} value1 {{Cl|TO}} value2: {{Cl|PRINT}} "11 to 20 only" '10 is already evaluated + {{Cl|CASE}} value1, value2, value3: {{Cl|PRINT}} "30 only" '10 and 20 are already evaluated + {{Cl|CASE IS}} > value2: {{Cl|PRINT}} "greater than 20 but not 30" '30 is already evaluated + {{Cl|CASE ELSE}}: {{Cl|PRINT}} "Other value" 'values less than 10 {{Cl|END SELECT}} '' '' {{CodeEnd}} -: ''Explanation:'' The first true CASE is executed and SELECT CASE is exited. "Other value" is printed for values less than 10. +: ''Explanation:'' The first true CASE is executed and SELECT CASE is exited. "Other value" is printed for values less than 10. ''Example 2:'' SELECT CASE will execute the first CASE statement that is true and ignore all CASE evaluations after that: @@ -58,22 +58,22 @@ value3 = 30 a = 100 {{Cl|SELECT CASE}} a 'designate the value to compare {{Cl|CASE}} 1, 3, 5, 7, 9 - {{Cl|PRINT}} "This will not be shown." + {{Cl|PRINT}} "This will not be shown." {{Cl|CASE}} 10 - {{Cl|PRINT}} "This will not be shown." + {{Cl|PRINT}} "This will not be shown." {{Cl|CASE}} 50 - {{Cl|PRINT}} "This will not be shown." + {{Cl|PRINT}} "This will not be shown." {{Cl|CASE}} 100 - {{Cl|PRINT}} "This will be displayed when a equals 100" - {{Cl|PRINT}} "(and no other case will be checked)" + {{Cl|PRINT}} "This will be displayed when a equals 100" + {{Cl|PRINT}} "(and no other case will be checked)" {{Cl|CASE}} 150 - {{Cl|PRINT}} "This will not be shown." + {{Cl|PRINT}} "This will not be shown." {{Cl|CASE IS}} < 150 - {{Cl|PRINT}} "This will not be shown as a previous case was true" + {{Cl|PRINT}} "This will not be shown as a previous case was true" {{Cl|CASE}} 50 {{Cl|TO}} 150 - {{Cl|PRINT}} "This will not be shown as a previous case was true" + {{Cl|PRINT}} "This will not be shown as a previous case was true" {{Cl|CASE ELSE}} - {{Cl|PRINT}} "This will only print if it gets this far!" + {{Cl|PRINT}} "This will only print if it gets this far!" {{Cl|END SELECT}} '' '' {{CodeEnd}} {{OutputStart}}This will be displayed when a equals 100 @@ -87,22 +87,22 @@ a = 100 a = 100 {{Cl|SELECT CASE|SELECT EVERYCASE}} a 'designate the value to compare {{Cl|CASE}} 1, 3, 5, 7, 9 - {{Cl|PRINT}} "This will not be shown." + {{Cl|PRINT}} "This will not be shown." {{Cl|CASE}} 10 - {{Cl|PRINT}} "This will not be shown." + {{Cl|PRINT}} "This will not be shown." {{Cl|CASE}} 50 - {{Cl|PRINT}} "This will not be shown." + {{Cl|PRINT}} "This will not be shown." {{Cl|CASE}} 100 - {{Cl|PRINT}} "This will be displayed when a equals 100" - {{Cl|PRINT}} "(and other cases will be checked)" + {{Cl|PRINT}} "This will be displayed when a equals 100" + {{Cl|PRINT}} "(and other cases will be checked)" {{Cl|CASE}} 150 - {{Cl|PRINT}} "This will not be shown." + {{Cl|PRINT}} "This will not be shown." {{Cl|CASE IS}} < 150 - {{Cl|PRINT}} "This will be shown as 100 is less than 150" + {{Cl|PRINT}} "This will be shown as 100 is less than 150" {{Cl|CASE}} 50 {{Cl|TO}} 150 - {{Cl|PRINT}} "This will be shown as 100 is between 50 and 150" + {{Cl|PRINT}} "This will be shown as 100 is between 50 and 150" {{Cl|CASE ELSE}} - {{Cl|PRINT}} "This will only print if no other CASE is true!" + {{Cl|PRINT}} "This will only print if no other CASE is true!" {{Cl|END SELECT}} '' '' {{CodeEnd}} {{OutputStart}}This will be displayed when a equals 100 @@ -115,49 +115,49 @@ This will be shown as 100 is between 50 and 150 ''Example 4:'' SELECT CASE evaluates string values by the [[ASC]] code value according to [[ASCII]]. {{CodeStart}} '' '' -{{Cl|PRINT}} "Enter a letter, number or punctuation mark from the keyboard: "; +{{Cl|PRINT}} "Enter a letter, number or punctuation mark from the keyboard: "; valu$ = {{Cl|INPUT$}}(1) {{Cl|PRINT}} value$ -value1$ = "A" -value2$ = "m" -value3$ = "z" +value1$ = "A" +value2$ = "m" +value3$ = "z" {{Cl|SELECT CASE}} value$ - {{Cl|CASE}} value1$: {{Cl|PRINT}} "A only" - {{Cl|CASE}} value1$ {{Cl|TO}} value2$: {{Cl|PRINT}} "B to m" 'A is already evaluated - {{Cl|CASE}} value1$, value2$, value3$: {{Cl|PRINT}} "z only" 'A and m are already evaluated - {{Cl|CASE IS}} > value2$: {{Cl|PRINT}} "greater than m but not z" 'z is already evaluated - {{Cl|CASE ELSE}}: {{Cl|PRINT}} "other value" 'key entry below A including all numbers + {{Cl|CASE}} value1$: {{Cl|PRINT}} "A only" + {{Cl|CASE}} value1$ {{Cl|TO}} value2$: {{Cl|PRINT}} "B to m" 'A is already evaluated + {{Cl|CASE}} value1$, value2$, value3$: {{Cl|PRINT}} "z only" 'A and m are already evaluated + {{Cl|CASE IS}} > value2$: {{Cl|PRINT}} "greater than m but not z" 'z is already evaluated + {{Cl|CASE ELSE}}: {{Cl|PRINT}} "other value" 'key entry below A including all numbers {{Cl|END SELECT}} '' '' {{CodeEnd}} -: ''Notes:'' [[STRING]] values using multiple characters will be compared by the [[ASCII]] code values sequentially from left to right. Once the equivalent code value of one string is larger than the other the evaluation stops. This allows string values to be compared and sorted alphabetically using [[Greater Than|>]] or [[Less Than|<]] and to [[SWAP]] values in [[arrays]] regardless of the string lengths. +: ''Notes:'' [[STRING]] values using multiple characters will be compared by the [[ASCII]] code values sequentially from left to right. Once the equivalent code value of one string is larger than the other the evaluation stops. This allows string values to be compared and sorted alphabetically using [[Greater Than|>]] or [[Less Than|<]] and to [[SWAP]] values in [[arrays]] regardless of the string lengths. ''Example 5:'' EVERYCASE is used to draw sections of digital numbers in a simulated LED readout using numbers from 0 to 9: {{CodeStart}} {{Cl|SCREEN}} 12 DO - {{Cl|LOCATE}} 1, 1: {{Cl|INPUT}} "Enter a number 0 to 9: ", num + {{Cl|LOCATE}} 1, 1: {{Cl|INPUT}} "Enter a number 0 to 9: ", num {{Cl|CLS}} {{Cl|SELECT CASE|SELECT EVERYCASE}} num {{Cl|CASE}} 0, 2, 3, 5 {{Cl|TO}} 9: {{Cl|PSET}} (20, 20), 12 - {{Cl|DRAW}} "E2R30F2G2L30H2BR5P12,12" 'top horiz + {{Cl|DRAW}} "E2R30F2G2L30H2BR5P12,12" 'top horiz {{Cl|CASE}} 0, 4 {{Cl|TO}} 6, 8, 9: {{Cl|PSET}} (20, 20), 12 - {{Cl|DRAW}} "F2D30G2H2U30E2BD5P12,12" 'left top vert + {{Cl|DRAW}} "F2D30G2H2U30E2BD5P12,12" 'left top vert {{Cl|CASE}} 0, 2, 6, 8: {{Cl|PSET}} (20, 54), 12 - {{Cl|DRAW}} "F2D30G2H2U30E2BD5P12, 12" 'left bot vert + {{Cl|DRAW}} "F2D30G2H2U30E2BD5P12, 12" 'left bot vert {{Cl|CASE}} 2 {{Cl|TO}} 6, 8, 9: {{Cl|PSET}} (20, 54), 12 - {{Cl|DRAW}} "E2R30F2G2L30H2BR5P12, 12" 'middle horiz + {{Cl|DRAW}} "E2R30F2G2L30H2BR5P12, 12" 'middle horiz {{Cl|CASE}} 0 {{Cl|TO}} 4, 7 {{Cl|TO}} 9: {{Cl|PSET}} (54, 20), 12 - {{Cl|DRAW}} "F2D30G2H2U30E2BD5P12,12" 'top right vert + {{Cl|DRAW}} "F2D30G2H2U30E2BD5P12,12" 'top right vert {{Cl|CASE}} 0, 1, 3 {{Cl|TO}} 9: {{Cl|PSET}} (54, 54), 12 - {{Cl|DRAW}} "F2D30G2H2U30E2BD5P12,12" 'bottom right vert + {{Cl|DRAW}} "F2D30G2H2U30E2BD5P12,12" 'bottom right vert {{Cl|CASE}} 0, 2, 3, 5, 6, 8: {{Cl|PSET}} (20, 88), 12 - {{Cl|DRAW}} "E2R30F2G2L30H2BR5P12,12" 'bottom horiz + {{Cl|DRAW}} "E2R30F2G2L30H2BR5P12,12" 'bottom horiz {{Cl|CASE ELSE}} - {{Cl|LOCATE}} 20, 20: {{Cl|PRINT}} "Goodbye!"; num + {{Cl|LOCATE}} 20, 20: {{Cl|PRINT}} "Goodbye!"; num {{Cl|END SELECT}} -{{Cl|LOOP}} {{Cl|UNTIL}} num > 9 +{{Cl|LOOP}} {{Cl|UNTIL}} num > 9 {{CodeEnd}} : '''Note:''' [[CASE ELSE]] will only execute if no other CASE is true! Changing the comparison value in a CASE may affect later CASE evaluations. '''Beware of duplicate variables inside of cases affecting the comparison values and remaining cases.''' @@ -166,4 +166,4 @@ DO * [[IF...THEN]], [[Boolean]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/SETMEM.txt b/internal/help/SETMEM.txt index 59a9e00e8..5be7606e9 100644 --- a/internal/help/SETMEM.txt +++ b/internal/help/SETMEM.txt @@ -4,7 +4,7 @@ ---- -The '''SETMEM''' function is used to increase, decrease or return the current "far heap" byte size. +The '''SETMEM''' function is used to increase, decrease or return the current "far heap" byte size. @@ -31,4 +31,4 @@ The '''SETMEM''' function is used to increase, decrease or return the current &q * [[DECLARE (non-BASIC statement)]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/SGN.txt b/internal/help/SGN.txt index 92b7d9474..4f5ffbbb1 100644 --- a/internal/help/SGN.txt +++ b/internal/help/SGN.txt @@ -29,4 +29,4 @@ PRINT n '' '' * [[Mathematical Operations]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/SHARED.txt b/internal/help/SHARED.txt index 4b04b081f..084fb5bb4 100644 --- a/internal/help/SHARED.txt +++ b/internal/help/SHARED.txt @@ -23,25 +23,25 @@ The '''SHARED''' statement allows variables to be passed automatically to any [[ ''Example 2:'' The DIR$ function returns a filename or a list when more than one exist. The file spec can use a path and/or wildcards. {{CodeStart}} '' '' {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 2 - {{Cl|LINE INPUT}} "Enter a file spec: ", spec$ + {{Cl|LINE INPUT}} "Enter a file spec: ", spec$ file$ = DIR$(spec$) 'use a file spec ONCE to find the last file name listed {{Cl|PRINT}} DIRCount%, file$, 'function can return the file count using SHARED variable {{Cl|DO}} K$ = {{Cl|INPUT$}}(1) - file$ = DIR$("") 'use an empty string parameter to return a list of files! + file$ = DIR$("") 'use an empty string parameter to return a list of files! {{Cl|PRINT}} file$, {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|LEN}}(file$) = 0 'file list ends with an empty string {{Cl|NEXT}} {{Cl|END}} {{Cl|FUNCTION}} DIR$ (spec$) -{{Cl|CONST}} TmpFile$ = "DIR$INF0.INF", ListMAX% = 500 'change maximum to suit your needs +{{Cl|CONST}} TmpFile$ = "DIR$INF0.INF", ListMAX% = 500 'change maximum to suit your needs {{Cl|SHARED}} DIRCount% 'returns file count if desired {{Cl|STATIC}} Ready%, Index%, DirList$() {{Cl|IF}} {{Cl|NOT}} Ready% {{Cl|THEN}} {{Cl|REDIM}} DirList$(ListMax%): Ready% = -1 'DIM array first use -{{Cl|IF}} spec$ > "" {{Cl|THEN}} 'get file names when a spec is given - {{Cl|SHELL}} {{Cl|_HIDE}} "DIR " + spec$ + " /b > " + TmpFile$ - Index% = 0: DirList$(Index%) = "": ff% = {{Cl|FREEFILE}} +{{Cl|IF}} spec$ > "" {{Cl|THEN}} 'get file names when a spec is given + {{Cl|SHELL}} {{Cl|_HIDE}} "DIR " + spec$ + " /b > " + TmpFile$ + Index% = 0: DirList$(Index%) = "": ff% = {{Cl|FREEFILE}} {{Cl|OPEN}} TmpFile$ {{Cl|FOR (file statement)|FOR}} {{Cl|APPEND}} {{Cl|AS}} #ff% size& = {{Cl|LOF}}(ff%) {{Cl|CLOSE}} #ff% @@ -54,7 +54,7 @@ The '''SHARED''' statement allows variables to be passed automatically to any [[ DIRCount% = Index% 'SHARED variable can return the file count {{Cl|CLOSE}} #ff% {{Cl|KILL}} TmpFile$ -{{Cl|ELSE}} {{Cl|IF}} Index% > 0 {{Cl|THEN}} Index% = Index% - 1 'no spec sends next file name +{{Cl|ELSE}} {{Cl|IF}} Index% > 0 {{Cl|THEN}} Index% = Index% - 1 'no spec sends next file name {{Cl|END IF}} DIR$ = DirList$(Index%) {{Cl|END FUNCTION}} '' '' @@ -67,4 +67,4 @@ DIR$ = DirList$(Index%) * [[COMMON]], [[COMMON SHARED]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/SHELL.txt b/internal/help/SHELL.txt index 0d96f03ea..68a395818 100644 --- a/internal/help/SHELL.txt +++ b/internal/help/SHELL.txt @@ -1,54 +1,57 @@ -The '''SHELL''' statement allows a program to use [[STRING]] OS command lines in Windows, Mac OSX and Linux. +The [[SHELL]] statement allows a program to run external programs or command line statements in Windows, macOS and Linux. -''QB'' {{PageSyntax}} SHELL [''DOSCommand$''] - -''QB64'' {{PageSyntax}} SHELL [{{KW|_DONTWAIT}}] [{{KW|_HIDE}}] [''DOSCommand$''] +{{PageSyntax}} +: [[SHELL]] [{{Parameter|DOSCommand$}}] +: [[SHELL]] ['''_DONTWAIT'''] ['''_HIDE'''] [{{Parameter|DOSCommand$}}] - -* If the ''[[DOS]]Command$'' [[STRING]] parameter isn't used the "command console" is opened. -* 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"(>) to a file (recommended). -* Commands are external [[DOS]] commands as [[STRING|strings]] enclosed in quotes or string variables. +{{PageDescription}} +* If the ''[[DOS]]Command$'' [[STRING]] parameter isn't used, the "command console" is opened. +* 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. * Commands can be a mixture of [[STRING|strings]] and string variables added together using the + [[concatenation]] operator. * Command text can be in upper or lower case. Use single spacing between items and options. -* '''QB64''' automatically uses CMD /C when using [[SHELL]], but is allowed in command. {{text|Note: CMD alone may lock up program!|red}} -:: '''Note: Some commands may not work without adding CMD /C to the start of the command line.''' -* '''QB64''' program screens will not get distorted, minimized or freeze the program like Qbasic fullscreen modes will. -* '''QB64''' can use long path folder names and file names and [[SHELL]] command lines can be longer than 124 characters! -* In Windows use additional [[CHR$]](34) quotation marks around folder or file names that contain spaces. -*'''NOTE: Use [[CHDIR]] instead of CD as SHELL commands cannot affect the current program path!''' -* '''Qbasic BAS files can be run like compiled programs without returning to the [[IDE]] when [[SYSTEM]] is used to [[END|end]] them!''' -<center>'''{{text|SHELL "QB.EXE /L /RUN program.BAS"|green}}'''</center> +* '''QB64''' automatically uses CMD /C when using [[SHELL]], but it is allowed in a command string. {{text|Note: CMD alone may lock up program.|red}} +** '''Note: Some commands may not work without adding CMD /C to the start of the command line.''' +* '''QB64''' program screens will not get distorted, minimized or freeze the program like QBasic fullscreen modes would. +* '''QB64''' can use long path folder names and file names and [[SHELL]] command lines can be longer than 124 characters. +* In Windows, use additional [[CHR$]](34) quotation marks around folder or file names that contain spaces. +* For other operating systems, both the quotation mark character and the apostrophe can be used to enclose a file name that contains spaces. +*'''NOTE: Use [[CHDIR]] instead of CD as SHELL commands cannot affect the current program path.''' +==QBasic/QuickBASIC== +* '''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}} + + +{{PageExamples}} ''Example 1:'' When working with file or folder names with spaces, add quotation marks around the path and/or file name with [[CHR$]](34). {{CodeStart}} '' '' -{{Cl|SHELL}} {{Cl|_HIDE}} "dir " + {{Cl|CHR$}}(34) + "free cell.ico" + {{Cl|CHR$}}(34) + " /b > temp.dir" '' '' -{{Cl|SHELL}} "start Notepad temp.dir" ' display temp file contents in Notepad window '' '' +{{Cl|SHELL}} {{Cl|_HIDE}} "dir " + {{Cl|CHR$}}(34) + "free cell.ico" + {{Cl|CHR$}}(34) + " /b > temp.dir" '' '' +{{Cl|SHELL}} "start Notepad temp.dir" ' display temp file contents in Notepad window '' '' {{CodeEnd}} :{{small|Contents of ''temp.dir'' text file:}} {{TextStart}}Free Cell.ico {{TextEnd}} -''Example 2:'' Opening a Windows program(Notepad) to read or print a Basic created text file. +''Example 2:'' Opening a Windows program (Notepad) to read or print a Basic created text file. {{CodeStart}} -{{Cl|INPUT}} "Enter a file name to read in Notepad: ", filename$ -{{Cl|SHELL}} "CMD /C start /max notepad " + filename$ ' display in Notepad full screen in XP or NT +{{Cl|INPUT}} "Enter a file name to read in Notepad: ", filename$ +{{Cl|SHELL}} "CMD /C start /max notepad " + filename$ ' display in Notepad full screen in XP or NT -'{{Cl|SHELL}} "start /min notepad /p " + filename$ ' taskbar print using QB64 CMD /C not necessary +'{{Cl|SHELL}} "start /min notepad /p " + filename$ ' taskbar print using QB64 CMD /C not necessary {{CodeEnd}} -:''Explanation:'' Notepad is an easy program to open in Windows. No path is needed! Windows NT computers, including XP, use CMD /C where older versions of DOS don't require any command reference. The top command opens Notepad in a normal window for a user to view the file. They can use Notepad to print it. The second command places Notepad file in the taskbar and prints it automatically. The filename variable is added by the program using proper spacing. +:''Explanation:'' Notepad is an easy program to open in Windows as no path is needed. Windows NT computers, including XP, use CMD /C where older versions of DOS don't require any command reference. The top command opens Notepad in a normal window for a user to view the file. They can use Notepad to print it. The second command places Notepad file in the taskbar and prints it automatically. The filename variable is added by the program using proper spacing. ::*'''Start''' is used to allow a Basic program to run without waiting for Notepad to be closed. ::* '''/min''' places the window into the taskbar. '''/max''' is fullscreen and no option is a normal window. -::* Notepad's '''/p''' option prints the file contents. Even with USB printers! +::* Notepad's '''/p''' option prints the file contents, even with USB printers. -:'''Note: A fullscreen [[SCREEN (statement)|SCREEN]] mode must be changed after a Windows program is opened in Qbasic ONLY!''' -:: Besides minimizing a QBasic program, fullscreen modes will lose the current screen information and freeze. Switch to another screen mode and back to the one you were in immediately after the SHELL! Screen 0 windows will work OK. ''Example 3:'' Function that returns the program's current working path. @@ -57,47 +60,49 @@ The '''SHELL''' statement allows a program to use [[STRING]] OS command lines in PRINT currentpath$ {{Cl|FUNCTION}} Path$ - {{Cl|SHELL}} {{Cl|_HIDE}} "CD > D0S-DATA.INF" 'code to hide window in '''QB64''' - {{Cl|OPEN}} "D0S-DATA.INF" FOR {{Cl|APPEND}} AS #1 'this may create the file + {{Cl|SHELL}} {{Cl|_HIDE}} "CD > D0S-DATA.INF" 'code to hide window in '''QB64''' + {{Cl|OPEN}} "D0S-DATA.INF" FOR {{Cl|APPEND}} AS #1 'this may create the file L% = {{Cl|LOF}}(1) 'verify that file and data exist {{Cl|CLOSE}} #1 {{Cl|IF}} L% {{Cl|THEN}} 'read file if it has data - {{Cl|OPEN}} "D0S-DATA.INF" FOR {{Cl|INPUT (file mode)|INPUT}} AS #1 + {{Cl|OPEN}} "D0S-DATA.INF" FOR {{Cl|INPUT (file mode)|INPUT}} AS #1 {{Cl|LINE INPUT (file statement)|LINE INPUT}} #1, line$ 'read only line in file - Path$ = line$ + "\" 'add slash to path so only a filename needs added later + Path$ = line$ + "\" 'add slash to path so only a filename needs added later {{Cl|CLOSE}} #1 - {{Cl|ELSE}} : Path = "" 'returns zero length string if path not found + {{Cl|ELSE}} : Path = "" 'returns zero length string if path not found END IF - {{Cl|KILL}} "D0S-DATA.INF" 'deleting the file is optional + {{Cl|KILL}} "D0S-DATA.INF" 'deleting the file is optional {{Cl|END FUNCTION}} '' '' {{CodeEnd}} {{small|Code by Ted Weissgerber}} -:''Explanation:'' The '''SHELL "CD"''' statement requests the current working path. This info is normally printed to the screen, but the '''>''' pipe character sends the information to the DOS-DATA.INF file instead('''QB64''' can use [[_HIDE]] to not display the DOS window). The function uses the [[OPEN]] FOR [[APPEND]] mode to check for the file and the data([[INPUT (file mode)|INPUT]] would create an error if file does not exist). The current path is listed on one line of the file. The file is opened and [[LINE INPUT (file statement)|LINE INPUT]] returns one line of the file text. The function adds a "\" so that the Path$ returned can be used in another file statement by just adding a file name. Save the Path$ to another variable for later use when the program has moved to another directory. +:''Explanation:'' The '''SHELL "CD"''' statement requests the current working path. This info is normally printed to the screen, but the '''>''' pipe character sends the information to the DOS-DATA.INF file instead('''QB64''' can use [[_HIDE]] to not display the DOS window). The function uses the [[OPEN]] FOR [[APPEND]] mode to check for the file and the data([[INPUT (file mode)|INPUT]] would create an error if file does not exist). The current path is listed on one line of the file. The file is opened and [[LINE INPUT (file statement)|LINE INPUT]] returns one line of the file text. The function adds a "\" so that the Path$ returned can be used in another file statement by just adding a file name. Save the Path$ to another variable for later use when the program has moved to another directory. +: In '''QB64''' you can simply use the [[_CWD$]] statement for the same purpose of the example above. -''Example 4:'' Determining if a drive or path exists. Cannot use with a file name specification! +''Example 4:'' Determining if a drive or path exists. Cannot use with a file name specification. {{CodeStart}} '' '' -{{Cl|LINE INPUT}} "Enter a drive or path (no file name): ", DirPath$ -{{Cl|IF}} PathExist%(DirPath$) {{Cl|THEN}} PRINT "Drive Path exists!" {{Cl|ELSE}} PRINT "Drive Path does not exist!" +{{Cl|LINE INPUT}} "Enter a drive or path (no file name): ", DirPath$ +{{Cl|IF}} PathExist%(DirPath$) {{Cl|THEN}} PRINT "Drive Path exists!" {{Cl|ELSE}} PRINT "Drive Path does not exist!" {{Cl|END}} {{Cl|FUNCTION}} PathExist% (Path$) PathExist% = 0 {{Cl|IF}} {{Cl|LEN}}(Path$) = 0 {{Cl|THEN}} {{Cl|EXIT FUNCTION}} 'no entry -{{Cl|IF}} {{Cl|LEN}}({{Cl|ENVIRON$}}("OS")) {{Cl|THEN}} CMD$ = "CMD /C " {{Cl|ELSE}} CMD$ = "COMMAND /C " -{{Cl|SHELL}} {{Cl|_HIDE}} CMD$ + "If Exist " + Path$ + "\nul echo yes > D0S-DATA.INF" -{{Cl|OPEN}} "D0S-DATA.INF" {{Cl|FOR (file statement)|FOR}} {{Cl|APPEND}} {{Cl|AS}} #1 +{{Cl|IF}} {{Cl|LEN}}({{Cl|ENVIRON$}}("OS")) {{Cl|THEN}} CMD$ = "CMD /C " {{Cl|ELSE}} CMD$ = "COMMAND /C " +{{Cl|SHELL}} {{Cl|_HIDE}} CMD$ + "If Exist " + Path$ + "\nul echo yes > D0S-DATA.INF" +{{Cl|OPEN}} "D0S-DATA.INF" {{Cl|FOR (file statement)|FOR}} {{Cl|APPEND}} {{Cl|AS}} #1 {{Cl|IF}} {{Cl|LOF}}(1) {{Cl|THEN}} PathExist% = -1 'yes will be in file if path exists {{Cl|CLOSE}} #1 -{{Cl|KILL}} "D0S-DATA.INF" 'delete data file optional +{{Cl|KILL}} "D0S-DATA.INF" 'delete data file optional {{Cl|END FUNCTION}} '' '' {{CodeEnd}} {{small|Code by Ted Weissgerber}} :''Explanation: IF Exist'' checks for the drive path. ''\Nul'' allows an emply folder at end of path. ''Echo'' prints '''yes''' in the file if it exists. +: In '''QB64''' you can simply use the [[_FILEEXISTS]] statement for the same purpose of the example above. -''Snippet 1:'' When looking for '''printers''' this command gives you a file list with the default printer '''True''': -{{TextStart}}{{Cb|SHELL}} {{Cb|_HIDE}} "CMD /C" + "wmic printer get name,default > default.txt" +''Snippet 1:'' When looking for '''printers''' this command gives you a file list with the default printer marked as '''TRUE''': +{{TextStart}}{{Cb|SHELL}} {{Cb|_HIDE}} "CMD /C" + "wmic printer get name,default > default.txt" {{TextEnd}} '''Created file's text:''' {{TextStart}}Default Name @@ -109,8 +114,8 @@ PathExist% = 0 : ''Explanation:'' [[LINE INPUT]] could be used to find the printer names as [[STRING]] variables. -''Snippet 2:'' Here is the code to set the default printer to the "HP Officejet Pro 8600": -{{TextStart}}SHELL _HIDE "CMD /C" + "wmic printer where name='HP Officejet Pro 8600' call setdefaultprinter" +''Snippet 2:'' Here is the code to set the default printer to the "HP Officejet Pro 8600": +{{TextStart}}SHELL _HIDE "CMD /C" + "wmic printer where name='HP Officejet Pro 8600' call setdefaultprinter" {{TextEnd}} : After executing this program, and then running the first snippet again, we see the following '''contents of the text file:''' {{TextStart}}Default Name @@ -121,7 +126,13 @@ PathExist% = 0 {{TextEnd}} -''See also:'' +===More examples=== +''See examples in:'' +* [[FILELIST$ (function)]] (member-contributed file search routine) +* ''File Exist'' C++ Function that does not create a temp file: [[Windows_Libraries#File_Exist|FileExist Library Function]] + + +{{PageSeeAlso}} * [[SHELL (function)]], [[_SHELLHIDE]] * [[FILES]], [[CHDIR]], [[MKDIR]] * [[_CWD$]], [[_STARTDIR$]] @@ -131,16 +142,10 @@ PathExist% = 0 * [[_CONSOLE]], [[$CONSOLE]] * [[$SCREENHIDE]], [[$SCREENSHOW]] {{text|(QB64 [[Metacommand]]s)}} * [[_SCREENHIDE]], [[_SCREENSHOW]] -* [[FILELIST$]], [[DIR$]] {{text|(member file list array functions)}} +* [[FILELIST$]], [[PDS_(7.1)_Procedures#DIR.24|DIR$]] {{text|(member-contributed file list array function)}} -''See example:'' [[FILELIST$ (function)]] (member file search routine) - -''See Library:'' File Exist C++ Function that does not create a temp file. [[Windows_Libraries#File_Exist|FileExist Library Function]] - - ----- -''References:'' +===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]] @@ -151,4 +156,4 @@ PathExist% = 0 * [[Windows Printer Settings]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/SHELL_(function).txt b/internal/help/SHELL_(function).txt index d467e31e0..90eb69866 100644 --- a/internal/help/SHELL_(function).txt +++ b/internal/help/SHELL_(function).txt @@ -24,10 +24,10 @@ The '''SHELL''' function displays the console and returns the [[INTEGER]] code v {{Cb|FUNCTION}} GetSystemMetrics& ({{Cb|BYVAL}} n {{Cb|AS}} {{Cb|LONG}}) {{Cb|DECLARE LIBRARY|END DECLARE}} -{{Cb|PRINT}} trimstr$(GetSystemMetrics(SM_CXSCREEN)); "X"; trimstr$(GetSystemMetrics(SM_CYSCREEN)) +{{Cb|PRINT}} trimstr$(GetSystemMetrics(SM_CXSCREEN)); "X"; trimstr$(GetSystemMetrics(SM_CYSCREEN)) s& = {{Cb|_SCREENIMAGE}} -{{Cb|PRINT}} {{Cb|_WIDTH (function)|_WIDTH}}(s&); "X"; {{Cb|_HEIGHT}}(s&) +{{Cb|PRINT}} {{Cb|_WIDTH (function)|_WIDTH}}(s&); "X"; {{Cb|_HEIGHT}}(s&) {{Cb|END}} 3 '<<<<<< add a code to return after END or SYSTEM in any program @@ -39,7 +39,7 @@ trimstr = {{Cb|LTRIM$}}({{Cb|RTRIM$}}({{Cb|STR$}}(whatever))) : After compiling ''DesktopSize.EXE'' run the following code in the QB64 IDE. After 1st program is done 3 will appear on screen: {{CodeStart}} '' '' -returncode% = {{Cl|SHELL (function)|SHELL}}("DesktopSize") 'replace call with name of any QB64 program EXE +returncode% = {{Cl|SHELL (function)|SHELL}}("DesktopSize") 'replace call with name of any QB64 program EXE {{Cl|PRINT}} returncode% 'prints code sent by called program after it is closed @@ -56,4 +56,4 @@ returncode% = {{Cl|SHELL (function)|SHELL}}("DesktopSize") 'replace ca * [[SYSTEM]], [[END]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/SIGNAL.txt b/internal/help/SIGNAL.txt index 6a5a11bba..9deb501ca 100644 --- a/internal/help/SIGNAL.txt +++ b/internal/help/SIGNAL.txt @@ -14,21 +14,21 @@ The SIGNAL keyword was reserved for OS/2 systems (protected mode). See the examp *'''[[Keywords currently not supported by QB64|Not supported in QB64.]]''' -* It will only work with compiler 6.00 and 6.00b and Basic PDS 7.00 when compiling in protected mode under OS/2. In all other situations, a SIGNAL statement results in an "Advanced feature unavailable" error message. +* It will only work with compiler 6.00 and 6.00b and Basic PDS 7.00 when compiling in protected mode under OS/2. In all other situations, a SIGNAL statement results in an "Advanced feature unavailable" error message. ''Example:'' {{CodeStart}} '' '' -{{Cl|PRINT}} "This program traps CTRL+BREAK in OS/2. Try it." +{{Cl|PRINT}} "This program traps CTRL+BREAK in OS/2. Try it." {{Cl|ON}} SIGNAL(4) {{Cl|GOSUB}} trap {{Cl|SIGNAL}}(4) {{Cl|ON}} 10 a$ = {{Cl|INKEY$}} -{{Cl|IF...THEN|IF}} a$ = "" {{Cl|THEN}} {{Cl|GOTO}} 10 +{{Cl|IF...THEN|IF}} a$ = "" {{Cl|THEN}} {{Cl|GOTO}} 10 {{Cl|END}} trap: -{{Cl|PRINT}} "CTRL+BREAK trapped. Press any key to quit" +{{Cl|PRINT}} "CTRL+BREAK trapped. Press any key to quit" {{Cl|RETURN}} '' '' {{CodeEnd}} @@ -55,4 +55,4 @@ Advanced feature unavailable * [[ON KEY (n)]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/SIN.txt b/internal/help/SIN.txt index 35092a001..6197d6e53 100644 --- a/internal/help/SIN.txt +++ b/internal/help/SIN.txt @@ -19,20 +19,20 @@ The {{KW|SIN}} function returns the vertical component or sine of an angle measu {{CodeStart}} '' '' {{Cl|SCREEN}} 12 PI = 4 * {{Cl|ATN}}(1) -{{Cl|PRINT}} "PI = 4 * {{Cl|ATN}}(1) ="; PI -{{Cl|PRINT}} "COS(PI) = "; {{Cl|COS}}(PI) -{{Cl|PRINT}} "SIN(PI) = "; {{Cl|SIN}}(PI) +{{Cl|PRINT}} "PI = 4 * {{Cl|ATN}}(1) ="; PI +{{Cl|PRINT}} "COS(PI) = "; {{Cl|COS}}(PI) +{{Cl|PRINT}} "SIN(PI) = "; {{Cl|SIN}}(PI) DO {{Cl|PRINT}} - {{Cl|INPUT}} "Enter the degree angle (0 quits): ", DEGREES% + {{Cl|INPUT}} "Enter the degree angle (0 quits): ", DEGREES% RADIANS = DEGREES% * PI / 180 - {{Cl|PRINT}} "RADIANS = DEGREES% * PI / 180 = "; RADIANS - {{Cl|PRINT}} "X = COS(RADIANS) = "; {{Cl|COS}}(RADIANS) - {{Cl|PRINT}} "Y = SIN(RADIANS) = "; {{Cl|SIN}}(RADIANS) + {{Cl|PRINT}} "RADIANS = DEGREES% * PI / 180 = "; RADIANS + {{Cl|PRINT}} "X = COS(RADIANS) = "; {{Cl|COS}}(RADIANS) + {{Cl|PRINT}} "Y = SIN(RADIANS) = "; {{Cl|SIN}}(RADIANS) {{Cl|CIRCLE}} (400, 240), 2, 12 {{Cl|LINE}} (400, 240)-(400 + (50 * {{Cl|SIN}}(RADIANS)), 240 + (50 * {{Cl|COS}}(RADIANS))), 11 DEGREES% = RADIANS * 180 / PI - {{Cl|PRINT}} "DEGREES% = RADIANS * 180 / PI ="; DEGREES% + {{Cl|PRINT}} "DEGREES% = RADIANS * 180 / PI ="; DEGREES% {{Cl|LOOP}} {{Cl|UNTIL}} DEGREES% = 0 '' '' {{CodeEnd}} {{OutputStart}} @@ -66,7 +66,7 @@ Pi = 4 * {{Cl|ATN}}(1) {{Cl|_DISPLAY}} {{Cl|_LIMIT}} 20 'regulates gear speed and CPU usage {{Cl|NEXT}} G -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" {{Cl|END}} {{Cl|SUB}} GEARZ (XP, YP, RAD, Teeth, TH, G, CLR) @@ -79,7 +79,7 @@ m = Teeth * G x = XP + (RAD + TH * {{Cl|SIN}}((Teeth * t + m)) ^ 3) * {{Cl|COS}}(t) y = YP + (RAD + TH * {{Cl|SIN}}((Teeth * t + m)) ^ 3) * {{Cl|SIN}}(t) {{Cl|LINE}} -(x, y), CLR - IF {{Cl|INKEY$}} <> "" THEN {{Cl|END}} + IF {{Cl|INKEY$}} <> "" THEN {{Cl|END}} {{Cl|NEXT}} t {{Cl|PAINT}} (XP, YP), CLR 'gear colors optional {{Cl|END SUB}} '' '' @@ -99,7 +99,7 @@ Pi2! = 8 * {{Cl|ATN}}(1): sec! = Pi2! / 60 ' (2 * pi) / 60 movements per rotati Sx% = {{Cl|CINT}}({{Cl|COS}}(S!) * 60) ' pixel columns (60 = circular radius) Sy% = {{Cl|CINT}}({{Cl|SIN}}(S!) * 60) ' pixel rows {{Cl|LINE}} (320, 240)-(Sx% + 320, Sy% + 240), 12 - {{Cl|DO}}: Check% = {{Cl|VAL}}({{Cl|RIGHT$}}({{Cl|TIME$}}, 2)) - 15: {{Cl|LOOP}} UNTIL Check% <> Seconds% ' wait loop + {{Cl|DO}}: Check% = {{Cl|VAL}}({{Cl|RIGHT$}}({{Cl|TIME$}}, 2)) - 15: {{Cl|LOOP}} UNTIL Check% <> Seconds% ' wait loop {{Cl|LINE}} (320, 240)-(Sx% + 320, Sy% + 240), 0 ' erase previous line {{Cl|LOOP}} UNTIL {{Cl|INKEY$}} = {{Cl|CHR$}}(27) ' escape keypress exits {{CodeEnd}} @@ -116,4 +116,4 @@ The value of 2 &pi; is used to determine the sec! multiplier that determines *[[Mathematical_Operations#Derived_Mathematical_Functions|Derived Mathematical Functions]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/SINGLE.txt b/internal/help/SINGLE.txt index 1ddf835a1..46293873d 100644 --- a/internal/help/SINGLE.txt +++ b/internal/help/SINGLE.txt @@ -23,4 +23,4 @@ * [[Variable Types]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/SLEEP.txt b/internal/help/SLEEP.txt index 1557943b9..533b1ae27 100644 --- a/internal/help/SLEEP.txt +++ b/internal/help/SLEEP.txt @@ -15,12 +15,12 @@ SLEEP pauses the program indefinitely or for a specified number of seconds, prog ''Example:'' {{CodeStart}} '' '' {{Cl|CLS}} '' '' -{{Cl|PRINT}} "Press a key..." +{{Cl|PRINT}} "Press a key..." {{Cl|SLEEP}} -{{Cl|PRINT}} "You pressed a key, now wait for 2 seconds." +{{Cl|PRINT}} "You pressed a key, now wait for 2 seconds." {{Cl|SLEEP}} 2 -{{Cl|PRINT}} "You've waited for 2 seconds." -{{Cl|PRINT}} "(or you pressed a key)" +{{Cl|PRINT}} "You've waited for 2 seconds." +{{Cl|PRINT}} "(or you pressed a key)" {{CodeEnd}} {{OutputStart}} Press a key... @@ -36,4 +36,4 @@ You've waited for 2 seconds. * [[_DELAY]], [[_LIMIT]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/SOUND.txt b/internal/help/SOUND.txt index 821b59171..c86c09671 100644 --- a/internal/help/SOUND.txt +++ b/internal/help/SOUND.txt @@ -54,18 +54,18 @@ ''Example 1:'' Playing the seven octaves based on the base note DATA * 2 ^ (octave - 1). {{CodeStart}} '' '' -notes$ = "C C#D D#E F F#G G#A A#B " -{{Cl|COLOR}} 9:{{Cl|LOCATE}} 5, 20: PRINT "Select an octave (1 - 7) to play (8 quits):" +notes$ = "C C#D D#E F F#G G#A A#B " +{{Cl|COLOR}} 9:{{Cl|LOCATE}} 5, 20: PRINT "Select an octave (1 - 7) to play (8 quits):" {{Cl|DO}} {{Cl|DO}}: octa$ = {{Cl|INKEY$}} - {{Cl|IF...THEN|IF}} octa$ <> "" {{Cl|THEN}} - {{Cl|IF...THEN|IF}} {{Cl|ASC}}(octa$) > 48 {{Cl|AND (boolean)|AND}} {{Cl|ASC}}(octa$) < 58 {{Cl|THEN}} octave% = {{Cl|VAL}}(octa$): {{Cl|EXIT DO}} + {{Cl|IF...THEN|IF}} octa$ <> "" {{Cl|THEN}} + {{Cl|IF...THEN|IF}} {{Cl|ASC}}(octa$) > 48 {{Cl|AND (boolean)|AND}} {{Cl|ASC}}(octa$) < 58 {{Cl|THEN}} octave% = {{Cl|VAL}}(octa$): {{Cl|EXIT DO}} {{Cl|END IF}} - {{Cl|LOOP}} {{Cl|UNTIL}} octave% > 7 - {{Cl|IF...THEN|IF}} octave% > 0 {{Cl|AND (boolean)|AND}} octave% < 8 {{Cl|THEN}} + {{Cl|LOOP}} {{Cl|UNTIL}} octave% > 7 + {{Cl|IF...THEN|IF}} octave% > 0 {{Cl|AND (boolean)|AND}} octave% < 8 {{Cl|THEN}} {{Cl|LOCATE}} 15, 6: {{Cl|PRINT}} {{Cl|SPACE$}}(70) {{Cl|LOCATE}} 16, 6: {{Cl|PRINT}} {{Cl|SPACE$}}(70) - {{Cl|COLOR}} 14: {{Cl|LOCATE}} 15, 6: {{Cl|PRINT}} "Octave"; octave%; ":"; + {{Cl|COLOR}} 14: {{Cl|LOCATE}} 15, 6: {{Cl|PRINT}} "Octave"; octave%; ":"; {{Cl|RESTORE}} Octaves {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 12 {{Cl|READ}} note! @@ -74,20 +74,20 @@ notes$ = "C C#D D#E F F#G G#A A#B " c0l = {{Cl|POS}}(0) {{Cl|COLOR}} 11: {{Cl|LOCATE}} 16, c0l - 2: {{Cl|PRINT}} {{Cl|MID$}}(notes$, 1 + (2 * (i - 1)), 2) {{Cl|LOCATE}} 15, c0l - {{Cl|IF...THEN|IF}} snd% > 36 {{Cl|THEN}} {{Cl|SOUND}} snd%, 12 'error if sound value is < 36 + {{Cl|IF...THEN|IF}} snd% > 36 {{Cl|THEN}} {{Cl|SOUND}} snd%, 12 'error if sound value is < 36 {{Cl|_DELAY}} .8 {{Cl|NEXT}} {{Cl|END IF}} -{{Cl|LOOP}} {{Cl|UNTIL}} octave% > 7 +{{Cl|LOOP}} {{Cl|UNTIL}} octave% > 7 {{Cl|END}} Octaves: {{Cl|DATA}} 32.7,34.65,36.71,38.9,41.2,43.65,46.25,49,51.91,55,58.27,61.74 '' '' {{CodeEnd}} -{{small|Code adapted by Ted Weissgerber from code in [http://www.amazon.com/Running-MS-DOS-QBASIC-Michael-Halvorson/dp/1556153406 "Running MS-DOS Qbasic"] by Microsoft Press}} +{{small|Code adapted by Ted Weissgerber from code in [http://www.amazon.com/Running-MS-DOS-QBASIC-Michael-Halvorson/dp/1556153406 "Running MS-DOS Qbasic"] by Microsoft Press}} -''Example 2:'' Playing a song called "Bonnie" with [[SOUND]] frequencies. +''Example 2:'' Playing a song called "Bonnie" with [[SOUND]] frequencies. {{CodeStart}} '' '' {{Cl|SCREEN (statement)|SCREEN}} 13 {{Cl|_FULLSCREEN}} @@ -102,7 +102,7 @@ Octaves: {{Cl|LOCATE}} 23, i%: {{Cl|PRINT}} {{Cl|CHR$}}(220) {{Cl|NEXT}} i% {{Cl|COLOR}} 9 -{{Cl|LOCATE}} 3, 16: {{Cl|PRINT}} {{Cl|CHR$}}(34); "MY BONNIE"; {{Cl|CHR$}}(34) +{{Cl|LOCATE}} 3, 16: {{Cl|PRINT}} {{Cl|CHR$}}(34); "MY BONNIE"; {{Cl|CHR$}}(34) {{Cl|SLEEP}} 3 {{Cl|FOR...NEXT|FOR}} i% = 1 {{Cl|TO}} 34 {{Cl|SELECT CASE}} i% @@ -115,17 +115,17 @@ Octaves: {{Cl|SOUND}} note%, duration%: {{Cl|PRINT}} word$; {{Cl|NEXT}} i% {{Cl|SLEEP}} 2 -{{Cl|LOCATE}} 23, 16: {{Cl|PRINT}} "Thank You!" +{{Cl|LOCATE}} 23, 16: {{Cl|PRINT}} "Thank You!" {{Cl|SLEEP}} 4 {{Cl|SYSTEM}} -{{Cl|DATA}} 392,8,"My ",659,8,"Bon-",587,8,"nie ",523,8,"lies ",587,8,"O-",523,8,"Ver ",440,8,"the " -{{Cl|DATA}} 392,8,"O-",330,32,"cean ",392,8,"My ",659,8,"Bon-",587,8,"nie ",523,8,"lies " -{{Cl|DATA}} 523,8,"O-",494,8,"ver ",523,8,"the ",587,40,"sea ",392,8,"My ",659,8,"Bon-",587,8,"nie" -{{Cl|DATA}} 523,8," lies ",587,8,"O-",523,8,"ver ",440,8,"the ",392,8,"O-",330,32,"cean ",392,8,"Oh " -{{Cl|DATA}} 440,8,"bring ",587,8,"back ",523,8,"my ",494,8,"Bon-",440,8,"nie ",494,8,"to ",523,32,"me..!" '' '' +{{Cl|DATA}} 392,8,"My ",659,8,"Bon-",587,8,"nie ",523,8,"lies ",587,8,"O-",523,8,"Ver ",440,8,"the " +{{Cl|DATA}} 392,8,"O-",330,32,"cean ",392,8,"My ",659,8,"Bon-",587,8,"nie ",523,8,"lies " +{{Cl|DATA}} 523,8,"O-",494,8,"ver ",523,8,"the ",587,40,"sea ",392,8,"My ",659,8,"Bon-",587,8,"nie" +{{Cl|DATA}} 523,8," lies ",587,8,"O-",523,8,"ver ",440,8,"the ",392,8,"O-",330,32,"cean ",392,8,"Oh " +{{Cl|DATA}} 440,8,"bring ",587,8,"back ",523,8,"my ",494,8,"Bon-",440,8,"nie ",494,8,"to ",523,32,"me..!" '' '' {{CodeEnd}} -{{small|Code adapted by Ted Weissgerber from code [http://www.amazon.com/Running-MS-DOS-QBASIC-Michael-Halvorson/dp/1556153406 "Running MS-DOS Qbasic"] by Microsoft Press}} +{{small|Code adapted by Ted Weissgerber from code [http://www.amazon.com/Running-MS-DOS-QBASIC-Michael-Halvorson/dp/1556153406 "Running MS-DOS Qbasic"] by Microsoft Press}} ''See also:'' @@ -134,4 +134,4 @@ Octaves: * [[_SNDRAW]] (play frequency waves) -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/SPACE$.txt b/internal/help/SPACE$.txt index 7a5a0141b..a8cd6d1c3 100644 --- a/internal/help/SPACE$.txt +++ b/internal/help/SPACE$.txt @@ -24,7 +24,7 @@ The {{KW|SPACE$}} function returns a {{KW|STRING}} consisting of a number of spa ''Example 1:'' How to space text in a [[PRINT]] statement using SPACE$ with string [[concatenation]]. {{CodeStart}} '' '' {{Cl|FOR...NEXT|FOR}} count% = 0 {{Cl|FOR...NEXT|TO}} 3 - {{Cl|PRINT}} "abc" + {{Cl|SPACE$}}( count% ) + "def" + {{Cl|PRINT}} "abc" + {{Cl|SPACE$}}( count% ) + "def" {{Cl|FOR...NEXT|NEXT}} count% {{CodeEnd}} {{OutputStart}}abcdef @@ -40,7 +40,7 @@ abc def ' blue corner field with randomly twinkling stars {{Cl|CLS}} {{Cl|LOCATE}} 25, 1 -{{Cl|PRINT}} "Press any key to stop twinkling"; +{{Cl|PRINT}} "Press any key to stop twinkling"; {{Cl|COLOR}} , 4 z = 15 {{Cl|FOR...NEXT|FOR}} x = 5 {{Cl|TO}} 19 '13 red & white stripes (x =5 to 21 for 15 stripes) @@ -61,33 +61,33 @@ DO {{Cl|FOR...NEXT|FOR}} y = 1 {{Cl|TO}} 6 '5 rows of 6 stars r = {{Cl|INT}}({{Cl|RND}} * 6) {{Cl|IF...THEN|IF}} r = 0 {{Cl|THEN}} z = 31 {{Cl|ELSE}} z = 15 - {{Cl|IF...THEN|IF}} stop$ = "" {{Cl|THEN}} {{Cl|COLOR}} z {{Cl|ELSE}} {{Cl|COLOR}} 15 + {{Cl|IF...THEN|IF}} stop$ = "" {{Cl|THEN}} {{Cl|COLOR}} z {{Cl|ELSE}} {{Cl|COLOR}} 15 {{Cl|LOCATE}} x, w w = w + 4 - {{Cl|PRINT}} "*"; + {{Cl|PRINT}} "*"; {{Cl|NEXT}} y w = 18 {{Cl|FOR...NEXT|FOR}} y = 1 {{Cl|TO}} 5 '5 rows of 5 stars r = {{Cl|INT}}({{Cl|RND}} * 6) {{Cl|IF...THEN|IF}} r = 0 {{Cl|THEN}} z = 31 {{Cl|ELSE}} z = 15 - {{Cl|IF...THEN|IF}} stop$ = "" {{Cl|THEN}} {{Cl|COLOR}} z {{Cl|ELSE}} {{Cl|COLOR}} 15 + {{Cl|IF...THEN|IF}} stop$ = "" {{Cl|THEN}} {{Cl|COLOR}} z {{Cl|ELSE}} {{Cl|COLOR}} 15 {{Cl|LOCATE}} x + 1, w w = w + 4 - {{Cl|PRINT}} "*"; + {{Cl|PRINT}} "*"; {{Cl|NEXT}} y {{Cl|NEXT}} x w = 16 {{Cl|FOR...NEXT|FOR}} y = 1 {{Cl|TO}} 6 '1 row of 6 stars r = {{Cl|INT}}({{Cl|RND}} * 6) {{Cl|IF...THEN|IF}} r = 0 {{Cl|THEN}} z = 31 {{Cl|ELSE}} z = 15 - {{Cl|IF...THEN|IF}} stop$ = "" {{Cl|THEN}} {{Cl|COLOR}} z {{Cl|ELSE}} {{Cl|COLOR}} 15 + {{Cl|IF...THEN|IF}} stop$ = "" {{Cl|THEN}} {{Cl|COLOR}} z {{Cl|ELSE}} {{Cl|COLOR}} 15 {{Cl|LOCATE}} x, w w = w + 4 - {{Cl|PRINT}} "*"; + {{Cl|PRINT}} "*"; {{Cl|NEXT}} y t = {{Cl|TIMER}} - {{Cl|DO...LOOP|DO}} {{Cl|WHILE}} t + .2 >= {{Cl|TIMER}}: {{Cl|LOOP}} -{{Cl|LOOP}} {{Cl|WHILE}} stop$ = "" + {{Cl|DO...LOOP|DO}} {{Cl|WHILE}} t + .2 >= {{Cl|TIMER}}: {{Cl|LOOP}} +{{Cl|LOOP}} {{Cl|WHILE}} stop$ = "" {{Cl|COLOR}} 7, 0 {{Cl|END}} {{CodeEnd}}{{small|Code by Solitaire}} @@ -100,4 +100,4 @@ DO * [[SPC]], [[TAB]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/SPC.txt b/internal/help/SPC.txt index 580e19734..d6ed1e944 100644 --- a/internal/help/SPC.txt +++ b/internal/help/SPC.txt @@ -19,8 +19,8 @@ The {{KW|SPC}} function is used in [[PRINT]] and [[LPRINT]] statements to print ''Example:'' Using SPC to space a text print. -{{CodeStart}}{{Cl|PRINT}} "123456789" -{{Cl|PRINT}} "abc" ; {{Cl|SPC}}(3) ; "123"{{CodeEnd}} +{{CodeStart}}{{Cl|PRINT}} "123456789" +{{Cl|PRINT}} "abc" ; {{Cl|SPC}}(3) ; "123"{{CodeEnd}} {{OutputStart}}123456789 abc 123 {{OutputEnd}} @@ -32,4 +32,4 @@ abc 123 * [[TAB]], [[SPACE$]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/SQR.txt b/internal/help/SQR.txt index dd79b56bd..3539177c2 100644 --- a/internal/help/SQR.txt +++ b/internal/help/SQR.txt @@ -7,13 +7,13 @@ The '''SQR''' function returns the square root of a numerical value. * The ''square root'' returned is normally a [[SINGLE]] or [[DOUBLE]] numerical value. * The ''value'' parameter can be any '''positive''' numerical type. '''Negative parameter values will not work!''' -* Other exponential root functions can use fractional exponents([[^]]) enclosed in '''parenthesis only'''. EX: {{text|root <nowiki> = </nowiki> c ^ (a / b)|green}} +* Other exponential root functions can use fractional exponents([[^]]) enclosed in '''parenthesis only'''. EX: {{text|root <nowiki> = </nowiki> c ^ (a / b)|green}} ''Example 1:'' Finding the hypotenuse of a right triangle: {{CodeStart}} '' '' A% = 3: B% = 4 - PRINT "hypotenuse! ="; SQR((A% ^ 2) + (B% ^ 2)) '' '' + PRINT "hypotenuse! ="; SQR((A% ^ 2) + (B% ^ 2)) '' '' {{CodeEnd}} {{OutputStart}} hypotenuse = 5 @@ -48,7 +48,7 @@ The '''SQR''' function returns the square root of a numerical value. DEFLNG P DO PRIME = -1 'set PRIME as True -INPUT "Enter any number to check up to 2 million (Enter quits): ", guess$ +INPUT "Enter any number to check up to 2 million (Enter quits): ", guess$ PR = {{Cl|VAL}}(guess$) IF PR {{Cl|MOD}} 2 THEN 'check for even number FOR P = 3 TO {{Cl|SQR}}(PR) STEP 2 'largest number that could be a multiple is the SQR @@ -58,14 +58,14 @@ ELSE : PRIME = 0 'number to be checked is even so it cannot be a prime END IF IF PR = 2 THEN PRIME = -1 '2 is the ONLY even prime IF PR = 1 THEN PRIME = 0 'MOD returns true but 1 is not a prime by definition -IF PRIME THEN PRINT "PRIME! How'd you find me? " ELSE PRINT "Not a prime, you lose!" +IF PRIME THEN PRINT "PRIME! How'd you find me? " ELSE PRINT "Not a prime, you lose!" LOOP UNTIL PR = 0 '' '' {{CodeEnd}} {{OutputStart}} Enter any number to check up to 2 million (Enter quits): 12379 PRIME! How'd you find me? {{OutputEnd}} -<center>''Note:'' Prime numbers cannot be evenly divided by any other number except one.</center> +<center>''Note:'' Prime numbers cannot be evenly divided by any other number except one.</center> ''See also:'' @@ -75,4 +75,4 @@ PRIME! How'd you find me? *[[Mathematical_Operations#Derived_Mathematical_Functions|Derived Trigonometric Functions]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/STATIC.txt b/internal/help/STATIC.txt index c14f7afcd..dbb7b9d14 100644 --- a/internal/help/STATIC.txt +++ b/internal/help/STATIC.txt @@ -20,27 +20,27 @@ The {{KW|STATIC}} keyword is used in declaration statements to control where var ''Example 1: Finding the binary bit settings from a 32 bit [[LONG]] register return using recursion. {{CodeStart}} '' '' -{{Cl|INPUT}} "Enter a numerical value to see binary value: ", num& +{{Cl|INPUT}} "Enter a numerical value to see binary value: ", num& {{Cl|PRINT}} Bin$(num&) {{Cl|END}} {{Cl|FUNCTION}} Bin$ (n&) {{Cl|STATIC}} 'comment out STATIC to see what happens! {{Cl|DIM}} p%, s$ -{{Cl|IF...THEN|IF}} 2 ^ p% > n& {{Cl|THEN}} +{{Cl|IF...THEN|IF}} 2 ^ p% > n& {{Cl|THEN}} p% = 0 {{Cl|ELSE}} - {{Cl|IF...THEN|IF}} n& {{Cl|AND (boolean)|AND}} 2 ^ p% {{Cl|THEN}} s$ = "1" + s$ {{Cl|ELSE}} s$ = "0" + s$ - {{Cl|IF...THEN|IF}} n& > 2 ^ p% {{Cl|THEN}} + {{Cl|IF...THEN|IF}} n& {{Cl|AND (boolean)|AND}} 2 ^ p% {{Cl|THEN}} s$ = "1" + s$ {{Cl|ELSE}} s$ = "0" + s$ + {{Cl|IF...THEN|IF}} n& > 2 ^ p% {{Cl|THEN}} p% = p% + 1 s$ = Bin$(n&) 'recursive call to itself {{Cl|ELSE}}: p% = 0 {{Cl|END IF}} {{Cl|END IF}} -{{Cl|IF...THEN|IF}} s$ = "" {{Cl|THEN}} Bin$ = "0" {{Cl|ELSE}} Bin$ = s$ +{{Cl|IF...THEN|IF}} s$ = "" {{Cl|THEN}} Bin$ = "0" {{Cl|ELSE}} Bin$ = s$ {{Cl|END FUNCTION}} '' '' {{CodeEnd}} -: ''Explanation:'' The [[FUNCTION]] above returns a [[STRING]] value representing the bits ON in an [[INTEGER]] value. The string can be printed to the screen to see what is happening in a port register. '''STATIC''' keeps the function from overloading the memory "Stack" and is normally REQUIRED when recursive calls are used in Qbasic! '''QB64 procedures will close without warning or error!''' +: ''Explanation:'' The [[FUNCTION]] above returns a [[STRING]] value representing the bits ON in an [[INTEGER]] value. The string can be printed to the screen to see what is happening in a port register. '''STATIC''' keeps the function from overloading the memory "Stack" and is normally REQUIRED when recursive calls are used in Qbasic! '''QB64 procedures will close without warning or error!''' ''Example 2:'' Using a static array to cache factorials, speeding up repeated calculations: @@ -68,7 +68,7 @@ The {{KW|STATIC}} keyword is used in declaration statements to control where var ' See if we have the result cached. If so, we're done. {{Cl|IF...THEN|IF}} n <= maxNToCache {{Cl|IF...THEN|THEN}} - {{Cl|IF...THEN|IF}} resultCache(n) <> 0 {{Cl|IF...THEN|THEN}} + {{Cl|IF...THEN|IF}} resultCache(n) <> 0 {{Cl|IF...THEN|THEN}} Factorial = resultCache(n) {{Cl|EXIT FUNCTION}} {{Cl|IF...THEN|END IF}} @@ -95,4 +95,4 @@ The {{KW|STATIC}} keyword is used in declaration statements to control where var * [[Data types]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/STEP.txt b/internal/help/STEP.txt index 85fe1a247..af91715d6 100644 --- a/internal/help/STEP.txt +++ b/internal/help/STEP.txt @@ -53,4 +53,4 @@ The '''STEP''' keyword is used in [[FOR...NEXT]] loops to skip through the count * [[LINE]], [[CIRCLE]], [[PSET]], [[PAINT]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/STICK.txt b/internal/help/STICK.txt index f0267b1e2..7627b9096 100644 --- a/internal/help/STICK.txt +++ b/internal/help/STICK.txt @@ -13,7 +13,7 @@ QB64 {{PageSyntax}} * '''QB64''' allows any number of coordinate pairs for more than two game device controllers. STICK will not read a mouse axis. * ''axis_number'' can be used as the next axis parameter for controllers with multiple axis using the SAME ''directional'' parameters. * The ''axis_number'' 1 can be omitted for the main stick column and row parameter reads. -* Point of view "hats" also have 2 axis. Slide, turn or twist controls have one. The device determines the order of the axis. +* Point of view "hats" also have 2 axis. Slide, turn or twist controls have one. The device determines the order of the axis. * Returns coordinate values from 1 to 254. Qbasic only returned values from 1 to 200. * STICK(0) is required to get values from the other STICK functions. Always read it first! {{WhiteStart}}'''STICK(0) returns the column coordinate of device 1. Enables reads of the other STICK values.''' @@ -33,16 +33,16 @@ STICK(3) returns row coordinate of device 2 if used. (Qbasic maximum was 2 contr {{Cl|DO}}: {{Cl|_LIMIT}} 10 {{Cl|LOCATE}} 1, 1 - {{Cl|PRINT}} "JOY1: {{Cl|STICK}}"; {{Cl|STICK}}(0); {{Cl|STICK}}(1); {{Cl|STICK}}(0, 2); {{Cl|STICK}}(1, 2);_ - "STRIG"; {{Cl|STRIG}}(0); {{Cl|STRIG}}(1); {{Cl|STRIG}}(4); {{Cl|STRIG}}(5); {{Cl|STRIG}}(8); {{Cl|STRIG}}(9) + {{Cl|PRINT}} "JOY1: {{Cl|STICK}}"; {{Cl|STICK}}(0); {{Cl|STICK}}(1); {{Cl|STICK}}(0, 2); {{Cl|STICK}}(1, 2);_ + "STRIG"; {{Cl|STRIG}}(0); {{Cl|STRIG}}(1); {{Cl|STRIG}}(4); {{Cl|STRIG}}(5); {{Cl|STRIG}}(8); {{Cl|STRIG}}(9) - {{Cl|PRINT}} "JOY2: {{Cl|STICK}}"; {{Cl|STICK}}(2); {{Cl|STICK}}(3); {{Cl|STICK}}(2, 2); {{Cl|STICK}}(3, 2);_ - "STRIG"; {{Cl|STRIG}}(2); {{Cl|STRIG}}(3); {{Cl|STRIG}}(6); {{Cl|STRIG}}(7); {{Cl|STRIG}}(10); {{Cl|STRIG}}(11) + {{Cl|PRINT}} "JOY2: {{Cl|STICK}}"; {{Cl|STICK}}(2); {{Cl|STICK}}(3); {{Cl|STICK}}(2, 2); {{Cl|STICK}}(3, 2);_ + "STRIG"; {{Cl|STRIG}}(2); {{Cl|STRIG}}(3); {{Cl|STRIG}}(6); {{Cl|STRIG}}(7); {{Cl|STRIG}}(10); {{Cl|STRIG}}(11) - {{Cl|PRINT}} "JOY3: {{Cl|STICK}}"; {{Cl|STICK}}(4); {{Cl|STICK}}(5); {{Cl|STICK}}(4, 2); {{Cl|STICK}}(5, 2);_ - "STRIG"; {{Cl|STRIG}}(0, 3); {{Cl|STRIG}}(1, 3); {{Cl|STRIG}}(4, 3); {{Cl|STRIG}}(5, 3); {{Cl|STRIG}}(8, 3); {{Cl|STRIG}}(9, 3) + {{Cl|PRINT}} "JOY3: {{Cl|STICK}}"; {{Cl|STICK}}(4); {{Cl|STICK}}(5); {{Cl|STICK}}(4, 2); {{Cl|STICK}}(5, 2);_ + "STRIG"; {{Cl|STRIG}}(0, 3); {{Cl|STRIG}}(1, 3); {{Cl|STRIG}}(4, 3); {{Cl|STRIG}}(5, 3); {{Cl|STRIG}}(8, 3); {{Cl|STRIG}}(9, 3) -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} > "" '' '' +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} > "" '' '' {{CodeEnd}} :''Explanation:'' Notice the extra '''QB64 only''' parameters used to cater for the 2nd stick and the buttons of the 3rd joystick. @@ -51,23 +51,23 @@ STICK(3) returns row coordinate of device 2 if used. (Qbasic maximum was 2 contr {{CodeStart}} '' '' {{Cl|SCREEN}} 12 d = {{Cl|_DEVICES}} -{{Cl|PRINT}} "Number of input devices found ="; d +{{Cl|PRINT}} "Number of input devices found ="; d {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} d {{Cl|PRINT}} {{Cl|_DEVICE$}}(i) buttons = {{Cl|_LASTBUTTON}}(i) - {{Cl|PRINT}} "Buttons:"; buttons + {{Cl|PRINT}} "Buttons:"; buttons {{Cl|NEXT}} DO: {{Cl|_LIMIT}} 50 {{Cl|LOCATE}} 10, 1 - {{Cl|PRINT}} " X Main Y Slider Z-axis POV" - {{Cl|PRINT}} {{Cl|STICK}}(0, 1), {{Cl|STICK}}(1, 1), {{Cl|STICK}}(0, 2), {{Cl|STICK}}(1, 2), {{Cl|STICK}}(0, 3); {{Cl|STICK}}(1, 3); " " - {{Cl|PRINT}} " Buttons" + {{Cl|PRINT}} " X Main Y Slider Z-axis POV" + {{Cl|PRINT}} {{Cl|STICK}}(0, 1), {{Cl|STICK}}(1, 1), {{Cl|STICK}}(0, 2), {{Cl|STICK}}(1, 2), {{Cl|STICK}}(0, 3); {{Cl|STICK}}(1, 3); " " + {{Cl|PRINT}} " Buttons" {{Cl|FOR...NEXT|FOR}} i = 0 {{Cl|TO}} 4 * buttons - 1 {{Cl|STEP}} 4 {{Cl|PRINT}} {{Cl|STRIG}}(i); {{Cl|STRIG}}(i + 1); {{Cl|CHR$}}(219); {{Cl|NEXT}} {{Cl|PRINT}} -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" '' '' +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" '' '' {{CodeEnd}} : ''Explanation:'' Each axis on the first controller found is either STICK(0, n) or STICK(1, n) with n increasing when necessary. {{OutputStart}} @@ -86,7 +86,7 @@ Buttons: 9 -0 -1 █ 0 0 █ 0 0 █ 0 0 █ 0 0 █ 0 0 █ 0 0 █ 0 0 █ 0 0 █ {{OutputEnd}} : ''Note:'' A Sidewinder Precision Pro requires that pins 2 and 7(blue and purple) be connected together for [http://www.qb64.net/forum/index.php?topic=4167.msg42339#msg42339 digital USB recognition.] -<center> [http://www.amazon.com/Belkin-F3U200-08INCH-Joystick-Adapter-SideWinder/dp/B000067RIV Sidewinder Precision Pro game port to USB adapter]</center> +<center> [http://www.amazon.com/Belkin-F3U200-08INCH-Joystick-Adapter-SideWinder/dp/B000067RIV Sidewinder Precision Pro game port to USB adapter]</center> ''See also:'' @@ -96,4 +96,4 @@ Buttons: 9 * [http://en.wikipedia.org/wiki/Analog_stick Single and Dual Stick Controllers] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/STOP.txt b/internal/help/STOP.txt index ab3d7403d..75d2fc073 100644 --- a/internal/help/STOP.txt +++ b/internal/help/STOP.txt @@ -13,13 +13,13 @@ The '''STOP''' statement is used to stop program execution when troubleshooting ''Example:'' When run in the Qbasic IDE, the program will return to the IDE at STOP. Press F5 to finish the program. {{CodeStart}} -{{Cl|PRINT}} "start" +{{Cl|PRINT}} "start" {{Cl|SLEEP}} 3 {{Cl|STOP}} -{{Cl|PRINT}} "resumed" +{{Cl|PRINT}} "resumed" {{CodeEnd}} : ''Explanation:'' QB64 will STOP the program and close the window as it does not have an interpreter to run the rest of the code. @@ -29,4 +29,4 @@ The '''STOP''' statement is used to stop program execution when troubleshooting * [[ON]], [[OFF]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/STR$.txt b/internal/help/STR$.txt index 8063cc062..6b6a368fd 100644 --- a/internal/help/STR$.txt +++ b/internal/help/STR$.txt @@ -30,7 +30,7 @@ The '''STR$''' function returns the [[STRING]] representation of a numerical val {{CodeStart}} a = 33 -{{Cl|PRINT}} {{Cl|STR$}}(a) + "10" + "1" + "who" + {{Cl|STR$}}(a) + {{Cl|STR$}}(a) + {{Cl|LTRIM$}}({{Cl|STR$}}(a)) +{{Cl|PRINT}} {{Cl|STR$}}(a) + "10" + "1" + "who" + {{Cl|STR$}}(a) + {{Cl|STR$}}(a) + {{Cl|LTRIM$}}({{Cl|STR$}}(a)) {{CodeEnd}} {{OutputStart}} 33101who 33 3333 {{OutputEnd}} @@ -43,4 +43,4 @@ a = 33 * [[HEX$]], [[OCT$]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/STRIG(n).txt b/internal/help/STRIG(n).txt index 110d60dea..44c7c6a23 100644 --- a/internal/help/STRIG(n).txt +++ b/internal/help/STRIG(n).txt @@ -24,13 +24,13 @@ QB64 {{PageSyntax}} {{Cl|STRIG(n)|STRIG}}(0)ON DO - {{Cl|PRINT}} "."; + {{Cl|PRINT}} "."; {{Cl|_LIMIT}} 30 -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" {{Cl|END}} 10 -a$ = "[STRIG 0 EVENT]" +a$ = "[STRIG 0 EVENT]" {{Cl|FOR...NEXT|FOR}} x = 1 {{Cl|TO}} {{Cl|LEN}}(a$) {{Cl|PRINT}} {{Cl|MID$}}(a$, x, 1); {{Cl|_DELAY}} 0.02 @@ -45,4 +45,4 @@ a$ = "[STRIG 0 EVENT]" * [http://en.wikipedia.org/wiki/Analog_stick Single and Dual Stick Controllers] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/STRIG.txt b/internal/help/STRIG.txt index 86d30a8a6..37afba49c 100644 --- a/internal/help/STRIG.txt +++ b/internal/help/STRIG.txt @@ -42,16 +42,16 @@ STRIG(2, 4): STRIG(3, 4): STRIG(6, 4): STRIG(7, 4): STRIG(10, 4): STRIG(11, 4) ' {{Cl|DO}}: {{Cl|_LIMIT}} 10 {{Cl|LOCATE}} 1, 1 - {{Cl|PRINT}} "JOY1: {{Cl|STICK}}"; {{Cl|STICK}}(0); {{Cl|STICK}}(1); {{Cl|STICK}}(0, 2); {{Cl|STICK}}(1, 2);_ - "STRIG"; {{Cl|STRIG}}(0); {{Cl|STRIG}}(1); {{Cl|STRIG}}(4); {{Cl|STRIG}}(5); {{Cl|STRIG}}(8); {{Cl|STRIG}}(9) + {{Cl|PRINT}} "JOY1: {{Cl|STICK}}"; {{Cl|STICK}}(0); {{Cl|STICK}}(1); {{Cl|STICK}}(0, 2); {{Cl|STICK}}(1, 2);_ + "STRIG"; {{Cl|STRIG}}(0); {{Cl|STRIG}}(1); {{Cl|STRIG}}(4); {{Cl|STRIG}}(5); {{Cl|STRIG}}(8); {{Cl|STRIG}}(9) - {{Cl|PRINT}} "JOY2: {{Cl|STICK}}"; {{Cl|STICK}}(2); {{Cl|STICK}}(3); {{Cl|STICK}}(2, 2); {{Cl|STICK}}(3, 2);_ - "STRIG"; {{Cl|STRIG}}(2); {{Cl|STRIG}}(3); {{Cl|STRIG}}(6); {{Cl|STRIG}}(7); {{Cl|STRIG}}(10); {{Cl|STRIG}}(11) + {{Cl|PRINT}} "JOY2: {{Cl|STICK}}"; {{Cl|STICK}}(2); {{Cl|STICK}}(3); {{Cl|STICK}}(2, 2); {{Cl|STICK}}(3, 2);_ + "STRIG"; {{Cl|STRIG}}(2); {{Cl|STRIG}}(3); {{Cl|STRIG}}(6); {{Cl|STRIG}}(7); {{Cl|STRIG}}(10); {{Cl|STRIG}}(11) - {{Cl|PRINT}} "JOY3: {{Cl|STICK}}"; {{Cl|STICK}}(4); {{Cl|STICK}}(5); {{Cl|STICK}}(4, 2); {{Cl|STICK}}(5, 2);_ - "STRIG"; {{Cl|STRIG}}(0, 3); {{Cl|STRIG}}(1, 3); {{Cl|STRIG}}(4, 3); {{Cl|STRIG}}(5, 3); {{Cl|STRIG}}(8, 3); {{Cl|STRIG}}(9, 3) + {{Cl|PRINT}} "JOY3: {{Cl|STICK}}"; {{Cl|STICK}}(4); {{Cl|STICK}}(5); {{Cl|STICK}}(4, 2); {{Cl|STICK}}(5, 2);_ + "STRIG"; {{Cl|STRIG}}(0, 3); {{Cl|STRIG}}(1, 3); {{Cl|STRIG}}(4, 3); {{Cl|STRIG}}(5, 3); {{Cl|STRIG}}(8, 3); {{Cl|STRIG}}(9, 3) -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} > "" '' '' +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} > "" '' '' {{CodeEnd}} :''Explanation:'' Notice the extra '''QB64 only''' parameters used to cater for the 2nd stick and the buttons of the 3rd joystick. @@ -63,4 +63,4 @@ STRIG(2, 4): STRIG(3, 4): STRIG(6, 4): STRIG(7, 4): STRIG(10, 4): STRIG(11, 4) ' * [http://en.wikipedia.org/wiki/Analog_stick Single and Dual Stick Controllers] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/STRING$.txt b/internal/help/STRING$.txt index 62ee51e70..fa06fd87a 100644 --- a/internal/help/STRING$.txt +++ b/internal/help/STRING$.txt @@ -6,7 +6,7 @@ The {{KW|STRING$}} function returns a {{KW|STRING}} consisting of a single chara {{PageDescription}} -<!-- Stylin --> +<!-- Stylin --> * {{Parameter|count&}} is the number of times the character specified by {{Parameter|character}} is repeated. * Character is a literal string character, a string variable or an [[ASCII]] code number. * If {{Parameter|count&}} is negative, an [[ERROR Codes|illegal function call]] error will occur. The count can be zero. @@ -29,7 +29,7 @@ The {{KW|STRING$}} function returns a {{KW|STRING}} consisting of a single chara :Using a [[STRING]] to specify the repeated character. -{{CodeStart}}text$ = "B" + {{Cl|STRING$}}(40, "A") + "D" +{{CodeStart}}text$ = "B" + {{Cl|STRING$}}(40, "A") + "D" {{Cl|PRINT}} text$ {{CodeEnd}} {{OutputStart}}BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD @@ -48,4 +48,4 @@ The {{KW|STRING$}} function returns a {{KW|STRING}} consisting of a single chara * [[ASCII]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/STRING.txt b/internal/help/STRING.txt index 0617af285..95f964716 100644 --- a/internal/help/STRING.txt +++ b/internal/help/STRING.txt @@ -7,10 +7,10 @@ * ''Byte length'' is optional in [[DIM]] statements, but is required in [[TYPE]] definitions as a literal or [[CONST|constant]] [[INTEGER]] value. * Literal strings are defined by quotation marks on each end. The quotes will not [[PRINT]] to the screen. -* Quotation marks cannot be placed inside of literal string values! Use [[CHR$]](34) to display " quotes. +* Quotation marks cannot be placed inside of literal string values! Use [[CHR$]](34) to display " quotes. * Semicolons and commas outside of the string can be used to combine strings in a [[PRINT]] statement only. * [[LEN]] determines the number of bytes and number of string characters that are in a particular string. -* Literal string ends are designated by quotation marks such as: "text". Use [[CHR$]](34) to add quotes to string values. +* Literal string ends are designated by quotation marks such as: "text". Use [[CHR$]](34) to add quotes to string values. * Variable suffix type definition is $ such as: text$. * STRING values are compared according to the [[ASCII]] code values from left to right until one string code value exceeds the other. * '''NOTE: Many Qbasic keyword variable names CAN be used with a [[STRING]] suffix($) ONLY! You CANNOT use them without the suffix, use a numerical suffix or use [[DIM]], [[REDIM]], [[_DEFINE]], [[BYVAL]] or [[TYPE]] variable [[AS]] statements!''' @@ -18,7 +18,7 @@ :::::'''Creating a fixed length STRING variable in Qbasic:''' -:* Variable$ = " " ' 1 space creates a one [[_BYTE|byte]] string length in a procedure(not fixed) +:* Variable$ = " " ' 1 space creates a one [[_BYTE|byte]] string length in a procedure(not fixed) :* Variable$ = SPACE$(n%) ' defined as a n% length string in a procedure(not fixed) :* [[DIM]] variable AS STRING * n% ' fixed string length cannot be changed later :* Variable AS STRING * n% ' fixed string length in a [[SUB]] parameter or [[TYPE]] definition. @@ -42,7 +42,7 @@ ''Example 1:'' Using a string type suffix with a fixed length byte size in QB64 only. The number designates the fixed string length. {{CodeStart}} '' '' -var$5 = "1234567" +var$5 = "1234567" PRINT var$5 '' '' {{CodeEnd}} @@ -53,20 +53,20 @@ PRINT var$5 '' '' ''Example 2:'' Creating a string variable value by adding variable and literal string values. This procedure is called string [[concatenation]]. {{CodeStart}} '' '' age% = 10 -a$ = "I am " + {{Cl|CHR$}}(34) + {{Cl|LTRIM$}}({{Cl|STR$}}(age%)) + {{Cl|CHR$}}(34) + " years old." -b$ = "How old are you?" +a$ = "I am " + {{Cl|CHR$}}(34) + {{Cl|LTRIM$}}({{Cl|STR$}}(age%)) + {{Cl|CHR$}}(34) + " years old." +b$ = "How old are you?" question$ = a$ + {{Cl|SPACE$}}(1) + b$ {{Cl|PRINT}} question$ {{CodeEnd}} {{OutputStart}} -I am "10" years old. How old are you? '' '' +I am "10" years old. How old are you? '' '' {{OutputEnd}} :''Note:'' Since quotation marks are used to denote the ends of literal strings, [[CHR$]](34) must be used to place quotes inside them. ''Example 3:'' How QB64 string type suffixes can fix the length by adding a number of bytes after it. {{CodeStart}} '' '' -strings$5 = "Hello world" +strings$5 = "Hello world" PRINT strings$5 '' '' {{CodeEnd}}{{OutputStart}}Hello{{OutputEnd}} @@ -74,22 +74,22 @@ PRINT strings$5 '' '' ''Example 4:'' STRING values can be compared by the [[ASC]] code value according to [[ASCII]]. {{CodeStart}} '' '' -{{Cl|PRINT}} "Enter a letter, number or punctuation mark from the keyboard: "; +{{Cl|PRINT}} "Enter a letter, number or punctuation mark from the keyboard: "; valu$ = {{Cl|INPUT$}}(1) {{Cl|PRINT}} value$ -value1$ = "A" -value2$ = "m" -value3$ = "z" +value1$ = "A" +value2$ = "m" +value3$ = "z" {{Cl|SELECT CASE}} value$ - {{Cl|CASE}} value1$: {{Cl|PRINT}} "A only" - {{Cl|CASE}} value1$ {{Cl|TO}} value2$: {{Cl|PRINT}} "B to m" 'A is already evaluated - {{Cl|CASE}} value1$, value2$, value3$: {{Cl|PRINT}} "z only" 'A and m are already evaluated - {{Cl|CASE IS}} > value2$: {{Cl|PRINT}} "greater than m but not z" 'z is already evaluated - {{Cl|CASE ELSE}}: {{Cl|PRINT}} "other value" 'key entry below A including all numbers + {{Cl|CASE}} value1$: {{Cl|PRINT}} "A only" + {{Cl|CASE}} value1$ {{Cl|TO}} value2$: {{Cl|PRINT}} "B to m" 'A is already evaluated + {{Cl|CASE}} value1$, value2$, value3$: {{Cl|PRINT}} "z only" 'A and m are already evaluated + {{Cl|CASE IS}} > value2$: {{Cl|PRINT}} "greater than m but not z" 'z is already evaluated + {{Cl|CASE ELSE}}: {{Cl|PRINT}} "other value" 'key entry below A including all numbers {{Cl|END SELECT}} '' '' {{CodeEnd}} -: ''Notes:'' [[STRING]] values using multiple characters will be compared by the [[ASCII]] code values sequentially from left to right. Once the equivalent code value of one string is larger than the other the evaluation stops. This allows string values to be compared and sorted alphabetically using [[Greater Than|>]] or [[Less Than|<]] and to [[SWAP]] values in [[arrays]] irregardless of the string lengths. +: ''Notes:'' [[STRING]] values using multiple characters will be compared by the [[ASCII]] code values sequentially from left to right. Once the equivalent code value of one string is larger than the other the evaluation stops. This allows string values to be compared and sorted alphabetically using [[Greater Than|>]] or [[Less Than|<]] and to [[SWAP]] values in [[arrays]] irregardless of the string lengths. ''See also:'' @@ -107,4 +107,4 @@ value3$ = "z" * [[PRINT]], [[PRINT USING]], [[WRITE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/SUB.txt b/internal/help/SUB.txt index f7cd1d9aa..ee3a2a16c 100644 --- a/internal/help/SUB.txt +++ b/internal/help/SUB.txt @@ -28,7 +28,7 @@ A '''SUB''' procedure is a procedure within a program that can calculate and ret * '''Images are not deallocated when the [[SUB]] or [[FUNCTION]] they are created in ends. Free them with [[_FREEIMAGE]].''' -<center>'''Qbasic'''</center> +<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. @@ -43,7 +43,7 @@ A '''SUB''' procedure is a procedure within a program that can calculate and ret {{CodeStart}} '' '' {{Cl|DEFINT}} A-Z {{Cl|SCREEN}} 13 -Center 10, 15, "This text is centered." ' example module sub call +Center 10, 15, "This text is centered." ' example module sub call {{Cl|END}} {{Cl|DEFINT}} A-Z ' only code allowed before SUB line is a DEF statement or a comment @@ -71,12 +71,12 @@ Add1 a {{Cl|SUB}} Add1 (n) n = n + 1 Add2 n -{{Cl|PRINT}} "exit 1" +{{Cl|PRINT}} "exit 1" {{Cl|END SUB}} {{Cl|SUB}} Add2 (m) m = m + 2 -{{Cl|PRINT}} "exit 2" +{{Cl|PRINT}} "exit 2" {{Cl|END SUB}} {{CodeEnd}} {{OutputStart}}exit 2 @@ -92,4 +92,4 @@ exit 1 * [[EXIT]], [[END]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/SWAP.txt b/internal/help/SWAP.txt index da12c3e80..a037ec515 100644 --- a/internal/help/SWAP.txt +++ b/internal/help/SWAP.txt @@ -16,8 +16,8 @@ The {{KW|SWAP}} statement is used to exchange two variable or array element valu ''Example 1:'' A simple SWAP of [[STRING|string]] values. {{CodeStart}} -a$ = "one" -b$ = "two" +a$ = "one" +b$ = "two" {{Cl|SWAP}} a$, b$ @@ -41,25 +41,25 @@ one {{Cl|COLOR}} 11: {{Cl|LOCATE}} 10, 10 {{Cl|FOR...NEXT|FOR}} i = 65 {{Cl|TO}} 90 {{Cl|IF...THEN|IF}} Letter$(i) = {{Cl|CHR$}}(i) {{Cl|THEN}} 'find characters the same as the {{Cl|ASCII}} code index - {{Cl|DO...LOOP|DO}}: j = {{Cl|INT}}({{Cl|RND}} * 26) + 65: {{Cl|LOOP}} {{Cl|WHILE}} j = i 'loop until j <> i + {{Cl|DO...LOOP|DO}}: j = {{Cl|INT}}({{Cl|RND}} * 26) + 65: {{Cl|LOOP}} {{Cl|WHILE}} j = i 'loop until j <> i {{Cl|SWAP}} Letter$(i), Letter$(j) 'swap corresponding letter characters {{Cl|END IF}} - {{Cl|PRINT}} {{Cl|CHR$}}(i); " "; 'print normal alphabetical order + {{Cl|PRINT}} {{Cl|CHR$}}(i); " "; 'print normal alphabetical order {{Cl|NEXT}} {{Cl|COLOR}} 14: {{Cl|LOCATE}} 12, 10 {{Cl|FOR...NEXT|FOR}} a = 65 {{Cl|TO}} 90 'display new alphabetical order - {{Cl|PRINT}} Letter$(a); " "; + {{Cl|PRINT}} Letter$(a); " "; {{Cl|NEXT}} -text$ = "This is how a normal sentence would look before being encrypted." +text$ = "This is how a normal sentence would look before being encrypted." {{Cl|COLOR}} 11: {{Cl|LOCATE}} 20, 5: {{Cl|PRINT}} text$ L = {{Cl|LEN}}(text$) {{Cl|DIM}} Code(L) 'place ASCII code solution into an array {{Cl|COLOR}} 14: {{Cl|LOCATE}} 22, 5 {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} L Code(i) = {{Cl|ASC}}({{Cl|UCASE$}}(text$), i) 'in QB64, ASC can read by character position - {{Cl|IF...THEN|IF}} Code(i) >= 65 {{Cl|AND (boolean)|AND}} Code(i) <= 90 {{Cl|THEN}} {{Cl|PRINT}} Letter$(Code(i)); {{Cl|ELSE}} {{Cl|PRINT}} {{Cl|CHR$}}(Code(i)); + {{Cl|IF...THEN|IF}} Code(i) >= 65 {{Cl|AND (boolean)|AND}} Code(i) <= 90 {{Cl|THEN}} {{Cl|PRINT}} Letter$(Code(i)); {{Cl|ELSE}} {{Cl|PRINT}} {{Cl|CHR$}}(Code(i)); {{Cl|NEXT}} {{Cl|END}} '' '' {{CodeEnd}} @@ -82,14 +82,14 @@ swap2 = 0 'count swaps for demo only start! = {{Cl|TIMER}}(.001) {{Cl|CALL}} QuickSort(start, finish, array()) ending! = {{Cl|TIMER}}(.001) -tmp$ = " array(0)= ##.##### array(5000)= ###.#### array(10000)= ###.####" +tmp$ = " array(0)= ##.##### array(5000)= ###.#### array(10000)= ###.####" {{Cl|PRINT USING}} tmp$; array(0); array(5000); array(10000) -{{Cl|PRINT USING}} " Elapsed time: #.###### seconds with #######, swaps"; ending! - start!; swap2& +{{Cl|PRINT USING}} " Elapsed time: #.###### seconds with #######, swaps"; ending! - start!; swap2& {{Cl|FOR...NEXT|FOR}} n = 0 {{Cl|TO}} 10000 'check array sort order - {{Cl|IF}} array(n) >= max! {{Cl|THEN}} 'max should match the array type + {{Cl|IF}} array(n) >= max! {{Cl|THEN}} 'max should match the array type max! = array(n) {{Cl|ELSE}} {{Cl|BEEP}} - {{Cl|PRINT}} "Bad sort order!" + {{Cl|PRINT}} "Bad sort order!" {{Cl|EXIT}} {{Cl|FOR...NEXT|FOR}} {{Cl|END IF}} {{Cl|NEXT}} @@ -101,14 +101,14 @@ Hi = finish: Lo = start Middle = array((Lo + Hi) / 2) 'find middle of array {{Cl|DO}} {{Cl|DO}} {{Cl|WHILE}} array(Lo) < Middle: Lo = Lo + 1: {{Cl|LOOP}} - {{Cl|DO}} {{Cl|WHILE}} array(Hi) > Middle: Hi = Hi - 1: {{Cl|LOOP}} + {{Cl|DO}} {{Cl|WHILE}} array(Hi) > Middle: Hi = Hi - 1: {{Cl|LOOP}} {{Cl|IF}} Lo <= Hi {{Cl|THEN}} {{Cl|SWAP}} array(Lo), array(Hi) swap2 = swap2 + 1 'count swaps for demo only Lo = Lo + 1: Hi = Hi - 1 {{Cl|END IF}} 'If homework, you will fail -{{Cl|LOOP}} {{Cl|UNTIL}} Lo > Hi -{{Cl|IF}} Hi > start {{Cl|THEN}} {{Cl|CALL}} QuickSort(start, Hi, array()) +{{Cl|LOOP}} {{Cl|UNTIL}} Lo > Hi +{{Cl|IF}} Hi > start {{Cl|THEN}} {{Cl|CALL}} QuickSort(start, Hi, array()) {{Cl|IF}} Lo < finish {{Cl|THEN}} {{Cl|CALL}} QuickSort(Lo, finish, array()) {{Cl|END SUB}} '' '' {{CodeEnd}} @@ -124,4 +124,4 @@ Middle = array((Lo + Hi) / 2) 'find middle of array * [[ASCII]], [[Arrays]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/SYSTEM.txt b/internal/help/SYSTEM.txt index 87615a480..971ab0053 100644 --- a/internal/help/SYSTEM.txt +++ b/internal/help/SYSTEM.txt @@ -28,4 +28,4 @@ The {{KW|SYSTEM}} statement immediately closes a program and returns control to * [[_EXIT (function)]], [[END]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/Semicolon.txt b/internal/help/Semicolon.txt index 960d04b17..30ffc7fe3 100644 --- a/internal/help/Semicolon.txt +++ b/internal/help/Semicolon.txt @@ -1,7 +1,7 @@ The '''semicolon''' is used in a [[PRINT]] statement to stop the screen print cursor immediately after the printed value. -''Usage:'' COLOR 13: PRINT "Value ="; value1; value2; value3 +''Usage:'' COLOR 13: PRINT "Value ="; value1; value2; value3 {{OutputStart}}{{text|1234 5678 9012|magenta}}{{OutputEnd}} @@ -10,7 +10,7 @@ The '''semicolon''' is used in a [[PRINT]] statement to stop the screen print cu * Use the [[WRITE]] statement to print values with only commas between the values and no spacing. * A semicolon can append the next print when used at the end of a [[PRINT]] statement. * Use a semicolon after text that will be [[PRINT|printed]] on the last two text rows of a [[SCREEN (statement)|screen mode]] to prevent screen rolling. -* [[INPUT]] statements can use the semicolon '''before''' the text to prevent screen rolling. '''INPUT ; "text or question"; variable'''. +* [[INPUT]] statements can use the semicolon '''before''' the text to prevent screen rolling. '''INPUT ; "text or question"; variable'''. * A semicolon '''after''' the text will create a question mark and space after the [[INPUT]] text question. Use a comma for statements. * '''NOTE: Semicolons can NOT be used to combine string variables in a string variable definition!''' * Use the '''+''' [[concatenation]] operator to combine [[STRING|string]] variable definition values only! @@ -27,4 +27,4 @@ The '''semicolon''' is used in a [[PRINT]] statement to stop the screen print cu * [[VAL]] {{text|(convert string to number)}} -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/TAB.txt b/internal/help/TAB.txt index 3e09cac66..1425408f3 100644 --- a/internal/help/TAB.txt +++ b/internal/help/TAB.txt @@ -12,18 +12,18 @@ The {{KW|TAB}} function is used in [[PRINT]] and [[LPRINT]] statements to move t * [[Comma]] PRINT spacing is up to 15 column places (IE: TAB(15)) to a maximum column of 57. * When printing to a file, a carriage return([[CHR$]](13)) and linefeed([[CHR$]](10)) character are output when it moves to the next row. * '''Note:''' Qbasic did not allow a TAB to be [[concatenation|added]] to a string value. In [[PRINT]] statements the [[+|plus]] would be changed to a [[semicolon]]. -: In QB64, TAB [[concatenation]] is allowed instead of [[semicolon]]s. Example: {{text|PRINT "text" + TAB(9) + "here"|green}} +: In QB64, TAB [[concatenation]] is allowed instead of [[semicolon]]s. Example: {{text|PRINT "text" + TAB(9) + "here"|green}} ''Example:'' Comparing TAB to [[comma]] print spacing which moves the next text print 15 columns. {{CodeStart}} '' '' -{{Cl|PRINT}} {{Cl|TAB}}(15); "T" 'TAB spacing +{{Cl|PRINT}} {{Cl|TAB}}(15); "T" 'TAB spacing -{{Cl|PRINT}} , "T" '' '' 'comma spacing +{{Cl|PRINT}} , "T" '' '' 'comma spacing -{{Cl|PRINT}} {{Cl|TAB}}(15); "T"{{text|;|red}} {{Cl|TAB}}(20); "A"; {{Cl|TAB}}(15); "B" 'semicolons add nothing to position +{{Cl|PRINT}} {{Cl|TAB}}(15); "T"{{text|;|red}} {{Cl|TAB}}(20); "A"; {{Cl|TAB}}(15); "B" 'semicolons add nothing to position -{{Cl|PRINT}} {{Cl|TAB}}(15); "T"{{text|,|red}} {{Cl|TAB}}(20); "A"; {{Cl|TAB}}(15); "B" 'comma moves column position beyond 20 '' '' +{{Cl|PRINT}} {{Cl|TAB}}(15); "T"{{text|,|red}} {{Cl|TAB}}(20); "A"; {{Cl|TAB}}(15); "B" 'comma moves column position beyond 20 '' '' {{CodeEnd}} {{OutputStart}} T T @@ -42,4 +42,4 @@ The {{KW|TAB}} function is used in [[PRINT]] and [[LPRINT]] statements to move t * [[CHR$]], [[ASCII]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/TAN.txt b/internal/help/TAN.txt index 03981ac71..f6f822b49 100644 --- a/internal/help/TAN.txt +++ b/internal/help/TAN.txt @@ -17,7 +17,7 @@ The [[TAN]] function returns the ratio of [[SIN]]e to [[COS]]ine or tangent valu ''Example:'' Spiraling text using the [[SIN]] and [[TAN]] functions. {{CodeStart}} '' '' {{Cl|DIM}} {{Cl|SHARED}} text {{Cl|AS}} {{Cl|STRING}} -text$ = "S P I R A L" +text$ = "S P I R A L" {{Cl|DIM}} {{Cl|SHARED}} word(1 {{Cl|TO}} {{Cl|LEN}}(text$) * 8, 1 {{Cl|TO}} 16) {{Cl|CALL}} analyse @@ -56,7 +56,7 @@ DO x = (SCALE * 60 - (row * xrot / 4)) * {{Cl|TAN}}({{Cl|COS}}(i)) y = {{Cl|SIN}}(SCALE * 60 - (row * yrot)) * {{Cl|TAN}}({{Cl|SIN}}(i)) * pan cnt = cnt + 1 - {{Cl|IF...THEN|IF}} word(cnt, row) > 0 {{Cl|THEN}} + {{Cl|IF...THEN|IF}} word(cnt, row) > 0 {{Cl|THEN}} {{Cl|CIRCLE}} (x + 320, y + 220), SCALE + 1, 1 'circled letters '{{Cl|LINE}} (x + 320, y + 220)-{{Cl|STEP}}(12, 12), 1, BF 'boxed letters {{Cl|END IF}} @@ -70,7 +70,7 @@ DO now! = {{Cl|TIMER}} DO newnow! = {{Cl|TIMER}} - {{Cl|LOOP}} {{Cl|UNTIL}} newnow! - now! >= .15 + {{Cl|LOOP}} {{Cl|UNTIL}} newnow! - now! >= .15 {{Cl|LINE}} (1, 100)-(639, 280), 0, BF {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) {{Cl|END SUB}} '' '' @@ -87,4 +87,4 @@ DO * [[Mathematical_Operations#Derived_Mathematical_Functions|Derived Mathematical Functions]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/THEN.txt b/internal/help/THEN.txt index d1693518b..2bdc3a889 100644 --- a/internal/help/THEN.txt +++ b/internal/help/THEN.txt @@ -7,7 +7,7 @@ * THEN is required on the same code line as the IF statement. -* The condition value must be true(-1) or <> 0 for the statement code to be executed. +* The condition value must be true(-1) or <> 0 for the statement code to be executed. ''See also:'' @@ -16,4 +16,4 @@ * [[END IF]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/TIME$.txt b/internal/help/TIME$.txt index 10fbff0d6..8bbec2b61 100644 --- a/internal/help/TIME$.txt +++ b/internal/help/TIME$.txt @@ -2,13 +2,13 @@ The '''TIME$''' Function returns a [[STRING]] representation of the current comp {{PageSyntax}} -:: PRINT "Present time = "; '''TIME$''' +:: PRINT "Present time = "; '''TIME$''' -* Returns the present computer time in hh:mm:ss 24 hour format: "19:20:33" +* Returns the present computer time in hh:mm:ss 24 hour format: "19:20:33" * Uses 2 colon (:) separators between hours, minutes and seconds -* Hour values range from "00" to "23" starting from midnite. -* Minutes and seconds range from "00" to "59" +* Hour values range from "00" to "23" starting from midnite. +* Minutes and seconds range from "00" to "59" * Continuous TIME$ calls may lag if a QBasic program is minimized to the taskbar! @@ -20,9 +20,9 @@ The '''TIME$''' Function returns a [[STRING]] representation of the current comp t$ = {{Cl|TIME$}}: h = {{Cl|VAL}}(t$): m = {{Cl|VAL}}({{Cl|MID$}}(t$, 4, 2)): s = {{Cl|VAL}}({{Cl|MID$}}(t$, 7, 2)) {{Cl|PRINT}} t$ {{Cl|CIRCLE}} {{Cl|STEP}}(0, 0), 200, 8 - {{Cl|DRAW}} "c12ta" + {{Cl|STR$}}((h {{Cl|MOD}} 12) * -30) + "nu133" - {{Cl|DRAW}} "c14ta" + {{Cl|STR$}}(m * -6) + "nu200" - {{Cl|DRAW}} "c9ta" + {{Cl|STR$}}(s * -6) + "nu200" + {{Cl|DRAW}} "c12ta" + {{Cl|STR$}}((h {{Cl|MOD}} 12) * -30) + "nu133" + {{Cl|DRAW}} "c14ta" + {{Cl|STR$}}(m * -6) + "nu200" + {{Cl|DRAW}} "c9ta" + {{Cl|STR$}}(s * -6) + "nu200" {{Cl|_DISPLAY}} {{Cl|_LIMIT}} 1 {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) '' '' @@ -39,10 +39,10 @@ PRINT Clock$ {{Cl|FUNCTION}} Clock$ hour$ = {{Cl|LEFT$}}(TIME$, 2): H% = {{Cl|VAL}}(hour$) min$ = {{Cl|MID$}}(TIME$, 3, 3) -IF H% >= 12 THEN ampm$ = " PM" ELSE ampm$ = " AM" -IF H% > 12 THEN +IF H% >= 12 THEN ampm$ = " PM" ELSE ampm$ = " AM" +IF H% > 12 THEN IF H% - 12 < 10 THEN hour$ = {{Cl|STR$}}(H% - 12) ELSE hour$ = {{Cl|LTRIM$}}({{Cl|STR$}}(H% - 12)) -ELSEIF H% = 0 THEN hour$ = "12" ' midnight hour +ELSEIF H% = 0 THEN hour$ = "12" ' midnight hour ELSE : IF H% < 10 THEN hour$ = {{Cl|STR$}}(H%) ' eliminate leading zeros END IF Clock$ = hour$ + min$ + ampm$ @@ -63,4 +63,4 @@ END FUNCTION '' '' * [[IF...THEN]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/TIME$_(statement).txt b/internal/help/TIME$_(statement).txt index 3d7ba0cea..ecce7f131 100644 --- a/internal/help/TIME$_(statement).txt +++ b/internal/help/TIME$_(statement).txt @@ -3,7 +3,7 @@ The '''TIME$''' statement changes the computer clock time to another [[STRING]] {{PageSyntax}} -:: TIME$ = "12:23:33" +:: TIME$ = "12:23:33" * The string value or variable must have the value formatted correctly. @@ -16,4 +16,4 @@ The '''TIME$''' statement changes the computer clock time to another [[STRING]] * [[TIME$]], [[DATE$]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/TIMER.txt b/internal/help/TIMER.txt index a9260db55..bb898596c 100644 --- a/internal/help/TIMER.txt +++ b/internal/help/TIMER.txt @@ -11,7 +11,7 @@ QB {{PageSyntax|}} * TIMER return values range from 0 at midnight to 86399! A comparison value must stay within that range! * [[INTEGER]] or [[LONG]] second values range from 0 at midnight to 86399 seconds each day. * Qbasic can return [[SINGLE]] values down to about .04 or 1/18th (one tick) of a second accurately. -* '''QB64''' can read [[DOUBLE]] ''accuracy'' down to 1 millisecond. Example: {{text|start# <nowiki>=</nowiki> TIMER(.001)|green}} +* '''QB64''' can read [[DOUBLE]] ''accuracy'' down to 1 millisecond. Example: {{text|start# <nowiki>=</nowiki> TIMER(.001)|green}} * Use [[DOUBLE]] variables for millisecond accuracy as [[SINGLE]] values are only accurate to 100ths of a second later in the day! * TIMER loops should use a midnight adjustment to avoid non-ending loops in Qbasic. * TIMER can also be used for timing program Events. See [[ON TIMER(n)]] or the [[TIMER (statement)]] @@ -21,17 +21,17 @@ QB {{PageSyntax|}} ''Example 1:'' Delay SUB with a midnight correction for when TIMER returns to 0. '''QB64''' can use [[_DELAY]] for delays down to .001. {{CodeStart}} '' '' {{Cl|DO...LOOP|DO}} - {{Cl|PRINT}} "Hello"; + {{Cl|PRINT}} "Hello"; Delay .5 'accuracy down to .05 seconds or 1/18th of a second in Qbasic - {{Cl|PRINT}} "World!"; + {{Cl|PRINT}} "World!"; {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) 'escape key exit {{Cl|END}} {{Cl|SUB}} Delay (dlay!) start! = {{Cl|TIMER}} -{{Cl|DO...LOOP|DO}} {{Cl|WHILE}} start! + dlay! >= {{Cl|TIMER}} - {{Cl|IF...THEN|IF}} start! > {{Cl|TIMER}} {{Cl|THEN}} start! = start! - 86400 +{{Cl|DO...LOOP|DO}} {{Cl|WHILE}} start! + dlay! >= {{Cl|TIMER}} + {{Cl|IF...THEN|IF}} start! > {{Cl|TIMER}} {{Cl|THEN}} start! = start! - 86400 {{Cl|LOOP}} {{Cl|END SUB}} '' '' {{CodeEnd}} @@ -46,10 +46,10 @@ start! = {{Cl|TIMER}} {{Cl|POKE}} 1132, 0 ' zero Timer ticks {{Cl|DO...LOOP|DO}} ' delay loop x% = {{Cl|PEEK}}(1132) - {{Cl|IF...THEN|IF}} x% <> px% {{Cl|THEN}} {{Cl|PRINT}} x%; + {{Cl|IF...THEN|IF}} x% <> px% {{Cl|THEN}} {{Cl|PRINT}} x%; px% = x% - {{Cl|LOOP}} {{Cl|UNTIL}} x% >= 18 '18 ticks in one second - {{Cl|PRINT}} "code " ' program code + {{Cl|LOOP}} {{Cl|UNTIL}} x% >= 18 '18 ticks in one second + {{Cl|PRINT}} "code " ' program code {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) {{Cl|DEF SEG}} ' reset segment to default @@ -59,7 +59,7 @@ start! = {{Cl|TIMER}} 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 code 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 code {{OutputEnd}} -:''Explanation:'' The [[POKE]] before the delay loop sets the tick count to 0. The [[PEEK]] count increases until the tick count returns 18 ticks and ends the loop. The same thing could be approximated by using a delay loop with: {{text|second! <nowiki>=</nowiki> '''TIMER''' + 1|green}} +:''Explanation:'' The [[POKE]] before the delay loop sets the tick count to 0. The [[PEEK]] count increases until the tick count returns 18 ticks and ends the loop. The same thing could be approximated by using a delay loop with: {{text|second! <nowiki>=</nowiki> '''TIMER''' + 1|green}} ''Example 3:'' Using a [[DOUBLE]] variable for [[TIMER]](.001) millisecond accuracy in '''QB64''' throughout the day. @@ -67,8 +67,8 @@ start! = {{Cl|TIMER}} ts! = TIMER(.001) 'single variable td# = TIMER(.001) 'double variable - PRINT "Single ="; ts! - PRINT "Double ="; td# '' '' + PRINT "Single ="; ts! + PRINT "Double ="; td# '' '' {{CodeEnd}} {{OutputStart}} Single = 77073.09 @@ -83,4 +83,4 @@ start! = {{Cl|TIMER}} * [[ON TIMER(n)]], [[TIMER (statement)]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/TIMER_(statement).txt b/internal/help/TIMER_(statement).txt index 738b79a68..62bf456a1 100644 --- a/internal/help/TIMER_(statement).txt +++ b/internal/help/TIMER_(statement).txt @@ -16,14 +16,14 @@ QB64 {{PageSyntax}} * TIMER STOP disables timer event trapping. When an event occurs while stopped, it is remembered. If timer events are turned back on later, any remembered events are immediately executed. * TIMER OFF turns timer event trapping completely off and no subsequent events are remembered. -<center>'''QB64 only'''</center> +<center>'''QB64 only'''</center> * Get a TIMER number from [[_FREETIMER]] ONLY except when the base timer(no number or 0) is used. Use specific variables or an array to hold each event number value for later reference. * If the TIMER number is omitted or 0, the TIMER used is the base timer. * Specific TIMER events can be enabled, suspended, turned off or freed using [[TIMER (statement)|TIMER(n)]] ON, STOP, OFF or FREE. * TIMER(n) '''FREE''' clears a specific timer event when it is no longer needed. '''The base TIMER or TIMER(0) cannot be freed!''' -<center>'''QB64 Timing Alternatives'''</center> +<center>'''QB64 Timing Alternatives'''</center> * The [[TIMER]] function can be used to find timed intervals down to 1 millisecond(.001) accuracy. * The [[_DELAY]] statement can be used to delay program execution for intervals down to milliseconds. * [[_LIMIT]] can slow down loops to a specified number of frames per second. This can also alleviate a program's CPU usage. @@ -34,7 +34,7 @@ QB64 {{PageSyntax}} TIMER ON ' enable timer event trapping LOCATE 4, 2 ' set the starting PRINT position {{Cl|ON TIMER(n)|ON TIMER}}(10) GOSUB Clock ' set procedure execution repeat time - DO WHILE INKEY$ = "": PRINT "A"; : SLEEP 6: LOOP + DO WHILE INKEY$ = "": PRINT "A"; : SLEEP 6: LOOP TIMER OFF {{Cl|SYSTEM}} @@ -56,4 +56,4 @@ QB64 {{PageSyntax}} -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/TO.txt b/internal/help/TO.txt index 43543b614..f57bdf85f 100644 --- a/internal/help/TO.txt +++ b/internal/help/TO.txt @@ -24,4 +24,4 @@ * [[_SETALPHA]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/TROFF.txt b/internal/help/TROFF.txt index 92107c997..1fbf771c8 100644 --- a/internal/help/TROFF.txt +++ b/internal/help/TROFF.txt @@ -8,7 +8,7 @@ The {{KW|TROFF}} statement turns off line number tracing. {{PageSyntax}} -:<code>{{KW|TROFF}}</code> +:<code>{{KW|TROFF}}</code> {{PageDescription}} @@ -22,7 +22,7 @@ The {{KW|TROFF}} statement turns off line number tracing. :Demonstrates simple line number tracing: {{CodeStart}}1 {{Cl|TRON}} 2 {{Cl|FOR...NEXT|FOR}} n% = 1 {{Cl|TO}} 3 -3 {{Cl|PRINT}} "inside loop" +3 {{Cl|PRINT}} "inside loop" 4 {{Cl|FOR...NEXT|NEXT}} n% 5 {{Cl|TROFF}} {{CodeEnd}} @@ -37,4 +37,4 @@ The {{KW|TROFF}} statement turns off line number tracing. * {{KW|TRON}} -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/TRON.txt b/internal/help/TRON.txt index 8bcbdcff4..829f2e8b8 100644 --- a/internal/help/TRON.txt +++ b/internal/help/TRON.txt @@ -8,21 +8,21 @@ The {{KW|TRON}} statement turns on line number tracing. {{PageSyntax}} -:<code>{{KW|TRON}}</code> +:<code>{{KW|TRON}}</code> {{PageDescription}} *'''[[Keywords currently not supported by QB64|Not supported in QB64.]]''' * When line number tracing is on, the line numbers of statements are output immediately before they are executed. * Use {{KW|TROFF}} to turn off line number tracing. -* Line number tracing only has an effect when programs are compiled with debugging code (<tt>BC.EXE /D</tt>). +* Line number tracing only has an effect when programs are compiled with debugging code (<tt>BC.EXE /D</tt>). {{PageExamples}} :Demonstrates simple line number tracing: {{CodeStart}}1 {{Cl|TRON}} 2 {{Cl|FOR...NEXT|FOR}} n% = 1 {{Cl|TO}} 3 -3 {{Cl|PRINT}} "inside loop" +3 {{Cl|PRINT}} "inside loop" 4 {{Cl|FOR...NEXT|NEXT}} n% 5 {{Cl|TROFF}} {{CodeEnd}} @@ -37,4 +37,4 @@ The {{KW|TRON}} statement turns on line number tracing. * {{KW|TROFF}} -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/TYPE.txt b/internal/help/TYPE.txt index 94f6483d7..c381983f1 100644 --- a/internal/help/TYPE.txt +++ b/internal/help/TYPE.txt @@ -78,7 +78,7 @@ DIM Contact AS ContactInfo 'create contact record variable for {{Cl|RANDOM}} file RecordLEN% = {{Cl|LEN}}(Contact) ' 118 bytes 'define values - Contact.First = "Ted" ' the fixed string length value will contain 7 extra spaces + Contact.First = "Ted" ' the fixed string length value will contain 7 extra spaces Contact.Zip = 15236 ' {{Cl|LONG}} value that can be used to search certain zip code numbers. {{Cl|PUT|PUT #}}1, 5,Contact 'place contact info into fifth record position @@ -101,7 +101,7 @@ END TYPE {{Cl|DIM}} foobar {{Cl|AS}} foo 'create a variable to use the foo type foobar.a = 15.5 -foobar.c.b = "this is me" +foobar.c.b = "this is me" PRINT foobar.a, foobar.c.b {{Cl|END}} '' '' @@ -114,7 +114,7 @@ PRINT foobar.a, foobar.c.b 'Bitmap.BI can be included at start of program TYPE BMPHeaderType ' Description Bytes '''QB64''' - ID AS STRING * 2 ' File ID is "BM" 2 + ID AS STRING * 2 ' File ID is "BM" 2 Size AS LONG ' Size of the data file 4 Res1 AS INTEGER ' Reserved 1 should be 0 2 Res2 AS INTEGER ' Reserved 2 should be 0 2 @@ -162,4 +162,4 @@ PRINT foobar.a, foobar.c.b * [[Bitmaps]], [[Creating_Icon_Bitmaps#Icon_to_Bitmap_Conversion_Function|Icon to Bitmap Conversion Function]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/UBOUND.txt b/internal/help/UBOUND.txt index 79d8ada35..8ff1a9a51 100644 --- a/internal/help/UBOUND.txt +++ b/internal/help/UBOUND.txt @@ -8,9 +8,9 @@ The {{KW|UBOUND}} function returns the largest valid index (upper bound) of an a {{PageDescription}} * {{Parameter|arrayName}} specifies the name of the array. -* {{Parameter|dimension%}} specifies the dimension number, starting with <code>1</code> for the first dimension. -** If omitted, {{Parameter|dimension%}} is assumed to be <code>1</code>. -** If {{Parameter|dimension%}} is less than <code>1</code> or is greater than the number of dimensions, a [[ERROR Codes|subscript out of range]] error occurs. +* {{Parameter|dimension%}} specifies the dimension number, starting with <code>1</code> for the first dimension. +** If omitted, {{Parameter|dimension%}} is assumed to be <code>1</code>. +** If {{Parameter|dimension%}} is less than <code>1</code> or is greater than the number of dimensions, a [[ERROR Codes|subscript out of range]] error occurs. * {{KW|UBOUND}}, along with {{KW|LBOUND}}, is used to determine the range of valid indexes of an array. @@ -32,4 +32,4 @@ The {{KW|UBOUND}} function returns the largest valid index (upper bound) of an a * {{KW|DIM}}, {{KW|COMMON}}, {{KW|STATIC}}, {{KW|SHARED}} -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/UCASE$.txt b/internal/help/UCASE$.txt index 5ba54a096..9ec2c3508 100644 --- a/internal/help/UCASE$.txt +++ b/internal/help/UCASE$.txt @@ -12,11 +12,11 @@ The [[UCASE$]] function outputs an all-uppercase version of a [[STRING]]. {{PageExamples}} ''Example:'' The following code guarantees that all letter key entries are capitalized: -{{CodeStart}}{{Cl|PRINT}} "Do you want to continue? (y/n)" +{{CodeStart}}{{Cl|PRINT}} "Do you want to continue? (y/n)" {{Cl|DO...LOOP|DO}} K$ = {{Cl|UCASE$}}({{Cl|INKEY$}}) -{{Cl|DO...LOOP|LOOP}} {{Cl|DO...LOOP|UNTIL}} K$ = "Y" {{Cl|OR}} K$ = "N" +{{Cl|DO...LOOP|LOOP}} {{Cl|DO...LOOP|UNTIL}} K$ = "Y" {{Cl|OR}} K$ = "N" {{CodeEnd}} @@ -26,4 +26,4 @@ The [[UCASE$]] function outputs an all-uppercase version of a [[STRING]]. * [[INPUT$]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/UEVENT.txt b/internal/help/UEVENT.txt index b01a0247c..4827e5c4d 100644 --- a/internal/help/UEVENT.txt +++ b/internal/help/UEVENT.txt @@ -17,4 +17,4 @@ The '''UEVENT''' Statement uses ON, OFF or STOP to enable, turn off or suspend u * [[ON UEVENT]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/UNLOCK.txt b/internal/help/UNLOCK.txt index 374820697..9f9bae5d9 100644 --- a/internal/help/UNLOCK.txt +++ b/internal/help/UNLOCK.txt @@ -2,9 +2,9 @@ The {{KW|UNLOCK}} statement opens access to parts or all of a file to other prog {{PageSyntax}} -:<code>{{KW|UNLOCK}} [#]{{Parameter|fileNumber%}}</code> -:<code>{{KW|UNLOCK}} [#]{{Parameter|fileNumber%}}, {{Parameter|record&}}</code> -:<code>{{KW|UNLOCK}} [#]{{Parameter|fileNumber%}}, [{{Parameter|firstRecord&}}] TO {{Parameter|lastRecord&}}</code> +:<code>{{KW|UNLOCK}} [#]{{Parameter|fileNumber%}}</code> +:<code>{{KW|UNLOCK}} [#]{{Parameter|fileNumber%}}, {{Parameter|record&}}</code> +:<code>{{KW|UNLOCK}} [#]{{Parameter|fileNumber%}}, [{{Parameter|firstRecord&}}] TO {{Parameter|lastRecord&}}</code> {{PageDescription}} @@ -24,4 +24,4 @@ The {{KW|UNLOCK}} statement opens access to parts or all of a file to other prog * {{KW|ACCESS}} -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/UNTIL.txt b/internal/help/UNTIL.txt index 139e6fde4..3ef679023 100644 --- a/internal/help/UNTIL.txt +++ b/internal/help/UNTIL.txt @@ -24,4 +24,4 @@ The '''UNTIL''' condition is used in [[DO...LOOP]] exit verifications. *[[DO...LOOP]] *[[WHILE...WEND]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/Underscore.txt b/internal/help/Underscore.txt index b49a6d36e..b11a4c64a 100644 --- a/internal/help/Underscore.txt +++ b/internal/help/Underscore.txt @@ -2,7 +2,7 @@ An '''underscore''' can be used at the end of a line of code to continue a code -''Usage:'' IF x + y > 500 AND x + y < 600 THEN_ +''Usage:'' IF x + y > 500 AND x + y < 600 THEN_ :::PRINT x + y @@ -20,4 +20,4 @@ An '''underscore''' can be used at the end of a line of code to continue a code * [[IF...THEN]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/VAL.txt b/internal/help/VAL.txt index 398bcae81..d9bee142f 100644 --- a/internal/help/VAL.txt +++ b/internal/help/VAL.txt @@ -5,29 +5,29 @@ The '''VAL''' Function returns the decimal numerical equivalent value of a [[STR :: value = VAL(string_value$) -* VAL converts string numbers to numerical values including decimal point values and prefixed "[[&H]]" hexadecimal, "[[&O]]" octal. -* VAL conversion stops at non-numeric characters except for letter "D" or "E" exponential notation values. -:String values with "D" and "E" letters between numbers may be converted also! EX: '''{{text|VAL("9D4") <nowiki>=</nowiki> 90000|green}}''' -* If the first string character is not a number VAL returns 0. VAL may return erratic values with "%" or "&" starting characters. -* Hexadecimal [[HEX$]] string values with the "[[&H]]" prefix can be converted to a decimal value with digits 0 to 9 and letters A to F, like; dec = VAL("&H"+hexvar$). -* Octal [[OCT$]] string values with the "[[&O]]" prefix can be converted to a decimal value with digits from 0 to 7 only. +* VAL converts string numbers to numerical values including decimal point values and prefixed "[[&H]]" hexadecimal, "[[&O]]" octal. +* VAL conversion stops at non-numeric characters except for letter "D" or "E" exponential notation values. +:String values with "D" and "E" letters between numbers may be converted also! EX: '''{{text|VAL("9D4") <nowiki>=</nowiki> 90000|green}}''' +* If the first string character is not a number VAL returns 0. VAL may return erratic values with "%" or "&" starting characters. +* Hexadecimal [[HEX$]] string values with the "[[&H]]" prefix can be converted to a decimal value with digits 0 to 9 and letters A to F, like; dec = VAL("&H"+hexvar$). +* Octal [[OCT$]] string values with the "[[&O]]" prefix can be converted to a decimal value with digits from 0 to 7 only. * Presently VAL '''cannot''' convert QB64 binary [[&B]] prefixed strings from binary to decimal in '''QB64'''. * For character values of [[ASCII]] data use [[ASC]] to get the value. -* In QB64 use an [[INTEGER]] return variable to hold integer values returned by VAL [[HEX$|Hex]] strings: '''{{text|value% <nowiki>= VAL("&HFFFF") =</nowiki> -1|green}}''' +* In QB64 use an [[INTEGER]] return variable to hold integer values returned by VAL [[HEX$|Hex]] strings: '''{{text|value% <nowiki>= VAL("&HFFFF") =</nowiki> -1|green}}''' ''Example 1:'' Differences in values returned with Qbasic and QB64: {{CodeStart}} '' '' -{{Cl|PRINT}} {{Cl|VAL}}("{{Cl|&H}}") '203 in QB, 0 in QB64 -{{Cl|PRINT}} {{Cl|VAL}}("{{Cl|&H}}FFFF") ' -1 QB, 65535 in QB64 -{{Cl|PRINT}} {{Cl|VAL}}("{{Cl|&H}}FFFF&") '65535 in both '' '' +{{Cl|PRINT}} {{Cl|VAL}}("{{Cl|&H}}") '203 in QB, 0 in QB64 +{{Cl|PRINT}} {{Cl|VAL}}("{{Cl|&H}}FFFF") ' -1 QB, 65535 in QB64 +{{Cl|PRINT}} {{Cl|VAL}}("{{Cl|&H}}FFFF&") '65535 in both '' '' {{CodeEnd}} -:''Explanation:'' A quirk in Qbasic returned VAL values of 203 for "&" and "&H" that was never fixed until PDS(7.1). +:''Explanation:'' A quirk in Qbasic returned VAL values of 203 for "&" and "&H" that was never fixed until PDS(7.1). ''Example 2:'' Converting a string with some number characters {{CodeStart}} '' '' - text$ = "1.23Hello" + text$ = "1.23Hello" number! = VAL(text$) PRINT number! '' '' {{CodeEnd}} @@ -38,23 +38,23 @@ The '''VAL''' Function returns the decimal numerical equivalent value of a [[STR ''Example 3:'' Converting literal and variable [[STRING|string]] values to numerical values. {{CodeStart}} '' '' - a$ = "33" - PRINT VAL("10") + VAL(a$) + 1 '' '' + a$ = "33" + PRINT VAL("10") + VAL(a$) + 1 '' '' {{CodeEnd}} {{OutputStart}} 44 {{OutputEnd}} :''Explanation:'' 10 + 33 + 1 = 44, the strings were converted to values. -:You have to convert the string to values in order to use them in a mathematical expression also since mixing strings with numbers isn't allowed. VAL will stop at a text letter so VAL("123G56) would return 123. +:You have to convert the string to values in order to use them in a mathematical expression also since mixing strings with numbers isn't allowed. VAL will stop at a text letter so VAL("123G56) would return 123. -:If VAL wasn't used the program would break with an error, as you can't add the value 1 to a string, if the 1 was a string ("1") then the program would return "10331", but now since we used VAL, the numbers were added as they should. +:If VAL wasn't used the program would break with an error, as you can't add the value 1 to a string, if the 1 was a string ("1") then the program would return "10331", but now since we used VAL, the numbers were added as they should. ''Example 4:'' Converting a hexadecimal value to decimal value using HEX$ with VAL. {{CodeStart}} decnumber% = 96 - hexnumber$ = "&H" + {{Cl|HEX$}}(decnumber%) 'convert decimal value to hex and add hex prefix + hexnumber$ = "&H" + {{Cl|HEX$}}(decnumber%) 'convert decimal value to hex and add hex prefix PRINT hexnumber$ decimal% = {{Cl|VAL}}(hexnumber$) PRINT decimal% '' '' @@ -63,7 +63,7 @@ The '''VAL''' Function returns the decimal numerical equivalent value of a [[STR &H60 96 {{OutputEnd}} -: ''Explanation:'' [[HEX$]] converts a decimal number to hexadecimal, but [[VAL]] will only recognize it as a valid value with the "&H" prefix. Especially since hexadecimal numbers can use "A" through "F" in them. Create a converter function from this code! +: ''Explanation:'' [[HEX$]] converts a decimal number to hexadecimal, but [[VAL]] will only recognize it as a valid value with the "&H" prefix. Especially since hexadecimal numbers can use "A" through "F" in them. Create a converter function from this code! ''See also:'' @@ -71,4 +71,4 @@ The '''VAL''' Function returns the decimal numerical equivalent value of a [[STR * [[OCT$]], [[ASC]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/VARPTR$.txt b/internal/help/VARPTR$.txt index c25190113..52bd6efbf 100644 --- a/internal/help/VARPTR$.txt +++ b/internal/help/VARPTR$.txt @@ -7,21 +7,21 @@ * Can use any [[STRING|string]] or numerical variable reference '''existing''' in memory. * If the parameter value is from an array it must be dimensioned already. Cannot use fixed length string arrays. -* When using '''numerical''' ''variable'' values in [[DRAW]] strings, use an = sign after the function letter. "TA=" + VARPTR$(''variable%'') -* Always use variable X as in "X" + VARPTR$(''string_variable$'') to [[DRAW]] or [[PLAY]] another [[STRING]] value. -* DRAW relative Moves use a + or - before the equal sign. EX: DRAW "M+=" + VARPTR$(x%) + ",-=" + VARPTR$(y%) +* When using '''numerical''' ''variable'' values in [[DRAW]] strings, use an = sign after the function letter. "TA=" + VARPTR$(''variable%'') +* Always use variable X as in "X" + VARPTR$(''string_variable$'') to [[DRAW]] or [[PLAY]] another [[STRING]] value. +* DRAW relative Moves use a + or - before the equal sign. EX: DRAW "M+=" + VARPTR$(x%) + ",-=" + VARPTR$(y%) ''Example 1:'' How VARPTR$ reads consecutive values from memory. {{CodeStart}} '' '' {{Cl|SCREEN (statement)|SCREEN}} 2 {{Cl|CLS}} -WIND$ = "r10 d7 l10 u7 br20" 'create draw string to be read by function -ROW$ = "x"+{{Cl|VARPTR$}}(WIND$)+"x"+{{Cl|VARPTR$}}(WIND$)+"x"+{{Cl|VARPTR$}}(WIND$)+" x"+{{Cl|VARPTR$}}(WIND$)+"bl80 bd11" +WIND$ = "r10 d7 l10 u7 br20" 'create draw string to be read by function +ROW$ = "x"+{{Cl|VARPTR$}}(WIND$)+"x"+{{Cl|VARPTR$}}(WIND$)+"x"+{{Cl|VARPTR$}}(WIND$)+" x"+{{Cl|VARPTR$}}(WIND$)+"bl80 bd11" {{Cl|LINE}} (100, 50)-(200, 160), , B -{{Cl|DRAW}} "bm 115,52" +{{Cl|DRAW}} "bm 115,52" {{Cl|FOR...NEXT|FOR}} I = 1 {{Cl|TO}} 10 - {{Cl|DRAW}} "x" + {{Cl|VARPTR$}}(ROW$) + {{Cl|DRAW}} "x" + {{Cl|VARPTR$}}(ROW$) {{Cl|NEXT}} '' '' {{CodeEnd}} :''NOTE:'' '''GWBasic''' allows '''semicolons''' to be used in the ROW$ definition, but Qbasic and '''QB64''' MUST use '''+''' concatenation. @@ -34,20 +34,20 @@ ROW$ = "x"+{{Cl|VARPTR$}}(WIND$)+"x"+{{Cl|VARPTR$}}(WIND$)+& {{Cl|FOR...NEXT|FOR}} i = 0 {{Cl|TO}} 360 {{Cl|STEP}} 30 'mark clock hours every 30 degrees angle$ = {{Cl|STR$}}(i) 'change degree value i to a string {{Cl|PSET}} (175, 250), 6 'clock center - {{Cl|DRAW}} "TA" + angle$ + "BU100" 'add string angle to Turn Angle and draw blind up + {{Cl|DRAW}} "TA" + angle$ + "BU100" 'add string angle to Turn Angle and draw blind up {{Cl|CIRCLE}} {{Cl|STEP}}(0, 0), 5, 12 'place a circle at end of Up line - {{Cl|DRAW}} "P9, 12" + {{Cl|DRAW}} "P9, 12" {{Cl|_DELAY}} .5 {{Cl|NEXT}} 'Demonstrates how VARPTR$ is used with TA= {{Cl|DO}}: sec$ = {{Cl|RIGHT$}}({{Cl|TIME$}}, 2) 'get current second value from time degree = {{Cl|VAL}}(sec$) * -6 'use a negative value to Turn Angle clockwise {{Cl|PSET}} (175, 250), 9 'clock center - {{Cl|DRAW}} "TA=" + {{Cl|VARPTR$}}(degree) + "U90" 'VARPTR$ value requires = in DRAW - {{Cl|DO}}: {{Cl|_LIMIT}} 30: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|RIGHT$}}({{Cl|TIME$}}, 2) <> sec$ 'loop until seconds value changes - {{Cl|IF}} {{Cl|INKEY$}} <> "" {{Cl|THEN}} {{Cl|EXIT DO}} + {{Cl|DRAW}} "TA=" + {{Cl|VARPTR$}}(degree) + "U90" 'VARPTR$ value requires = in DRAW + {{Cl|DO}}: {{Cl|_LIMIT}} 30: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|RIGHT$}}({{Cl|TIME$}}, 2) <> sec$ 'loop until seconds value changes + {{Cl|IF}} {{Cl|INKEY$}} <> "" {{Cl|THEN}} {{Cl|EXIT DO}} {{Cl|PSET}} (175, 250), 0 - {{Cl|DRAW}} "TA=" + {{Cl|VARPTR$}}(degree) + "U90" 'erase previous second hand draw + {{Cl|DRAW}} "TA=" + {{Cl|VARPTR$}}(degree) + "U90" 'erase previous second hand draw {{Cl|LOOP}} '' '' {{CodeEnd}} :''Explanation:'' When the VARPTR$ value is used in DRAW, '''=''' MUST be used to pass the value to the draw! Negative Turn Angle values move clockwise and each second moves the hand 6 degrees. '''TA''' uses actual degree angles starting at 0 or noon. @@ -59,12 +59,12 @@ ROW$ = "x"+{{Cl|VARPTR$}}(WIND$)+"x"+{{Cl|VARPTR$}}(WIND$)+& {{Cl|PSET}} (200, 200), 12 {{Cl|CIRCLE}} {{Cl|STEP}}(0, 0), 5, 10 A = 100: B = 100 -{{Cl|DRAW}} "M+=" + {{Cl|VARPTR$}}(A) + ",-=" + {{Cl|VARPTR$}}(B) +{{Cl|DRAW}} "M+=" + {{Cl|VARPTR$}}(A) + ",-=" + {{Cl|VARPTR$}}(B) {{Cl|PSET}} (400, 400), 10 {{Cl|CIRCLE}} {{Cl|STEP}}(0, 0), 5, 12 C = 100: D = -100 -{{Cl|DRAW}} "M+" + {{Cl|STR$}}(C) + "," + {{Cl|STR$}}(D) 'must add + for positive relative moves +{{Cl|DRAW}} "M+" + {{Cl|STR$}}(C) + "," + {{Cl|STR$}}(D) 'must add + for positive relative moves {{Cl|END}} '' '' {{CodeEnd}} : ''Explanation:'' A negative STR$ value will move the DRAW relatively where VARPTR$ won't without the sign before the equal. @@ -75,4 +75,4 @@ C = 100: D = -100 * [[DRAW]], [[PLAY]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/VARPTR.txt b/internal/help/VARPTR.txt index 1cf07abfa..174490cb4 100644 --- a/internal/help/VARPTR.txt +++ b/internal/help/VARPTR.txt @@ -21,4 +21,4 @@ The '''VARPTR''' function returns an [[INTEGER]] value that is the offset part o * [[POKE]], [[PEEK]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/VARSEG.txt b/internal/help/VARSEG.txt index e76498164..bce8f3cba 100644 --- a/internal/help/VARSEG.txt +++ b/internal/help/VARSEG.txt @@ -22,4 +22,4 @@ The '''VARSEG''' function returns an [[INTEGER]] value that is the segment part * [[POKE]], [[PEEK]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/VIEW.txt b/internal/help/VIEW.txt index 974f605dc..79653c031 100644 --- a/internal/help/VIEW.txt +++ b/internal/help/VIEW.txt @@ -39,4 +39,4 @@ The '''VIEW''' statement creates a graphics view port area by defining the coord * [[SCREEN]], [[CLS]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/VIEW_PRINT.txt b/internal/help/VIEW_PRINT.txt index 7e60e359a..8043b2364 100644 --- a/internal/help/VIEW_PRINT.txt +++ b/internal/help/VIEW_PRINT.txt @@ -22,30 +22,30 @@ The [[VIEW PRINT]] statement defines the boundaries of a text viewport {{KW|PRIN ''Example:'' Demonstrates how text scrolls within the text viewport. {{CodeStart}}' clear the entire screen and show the boundaries of the new text viewport {{Cl|CLS}} -{{Cl|PRINT}} "Start at top..." -{{Cl|LOCATE}} 9, 1: {{Cl|PRINT}} "<- row 9 ->" -{{Cl|LOCATE}} 21, 1: {{Cl|PRINT}} "<- row 21 ->" +{{Cl|PRINT}} "Start at top..." +{{Cl|LOCATE}} 9, 1: {{Cl|PRINT}} "<- row 9 ->" +{{Cl|LOCATE}} 21, 1: {{Cl|PRINT}} "<- row 21 ->" ' define new text viewport boundaries {{Cl|VIEW PRINT}} 10 {{Cl|TO}} 20 ' print some text that will scroll the text viewport {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 15 - {{Cl|PRINT}} "This is viewport line:"; i + {{Cl|PRINT}} "This is viewport line:"; i {{Cl|SLEEP}} 1 {{Cl|NEXT}} i ' clear only the active text viewport with CLS or CLS 2 {{Cl|CLS}} -{{Cl|PRINT}} "After clearing, the cursor location is reset to the top of the text viewport." +{{Cl|PRINT}} "After clearing, the cursor location is reset to the top of the text viewport." ' disable the viewport {{Cl|VIEW PRINT}} {{Cl|_DELAY}} 4 -{{Cl|LOCATE}} 20, 20: {{Cl|PRINT}} "Print anywhere after view port is disabled" +{{Cl|LOCATE}} 20, 20: {{Cl|PRINT}} "Print anywhere after view port is disabled" {{Cl|_DELAY}} 4 {{Cl|CLS}} -{{Cl|PRINT}} "Back to top left after CLS!" '' '' +{{Cl|PRINT}} "Back to top left after CLS!" '' '' {{CodeEnd}} : ''Note:'' The bottom row of the VIEW PRINT port can be used only when located or prints end with semicolons. @@ -57,4 +57,4 @@ The [[VIEW PRINT]] statement defines the boundaries of a text viewport {{KW|PRIN * [[LOCATE]], [[PRINT]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/WAIT.txt b/internal/help/WAIT.txt index f98d27592..d87a5a260 100644 --- a/internal/help/WAIT.txt +++ b/internal/help/WAIT.txt @@ -7,8 +7,8 @@ The {{KW|WAIT}} statement waits until the value read from an I/O port has certai {{PageDescription}} * The {{KW|WAIT}} statement reads a value from {{Parameter|port%}} using {{KW|INP}}. -* If {{Parameter|xorMask%}} is specified, the value is {{KW|XOR}}'d with {{Parameter|xorMask%}}. It has the effect of "toggle these bits". -* The value is then {{KW|AND}}'d with {{Parameter|andMask%}}. It has the effect of "check if these bits are set". +* If {{Parameter|xorMask%}} is specified, the value is {{KW|XOR}}'d with {{Parameter|xorMask%}}. It has the effect of "toggle these bits". +* The value is then {{KW|AND}}'d with {{Parameter|andMask%}}. It has the effect of "check if these bits are set". * If the final value is non-zero, {{KW|WAIT}} returns. Otherwise, another value is read from {{Parameter|port%}} and checked again. * The {{KW|WAIT}} statement returns immediately if {{Parameter|port%}} is not supported. @@ -28,4 +28,4 @@ WAIT &H3DA, 8, 8 ' finishes whenever the screen is being written to * [[Scancodes]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/WEND.txt b/internal/help/WEND.txt index 8717af5da..c90fff2da 100644 --- a/internal/help/WEND.txt +++ b/internal/help/WEND.txt @@ -1 +1 @@ -#REDIRECT [[WHILE...WEND]] \ No newline at end of file +#REDIRECT [[WHILE...WEND]] diff --git a/internal/help/WHILE...WEND.txt b/internal/help/WHILE...WEND.txt index 2c9957d23..9c8b9c43b 100644 --- a/internal/help/WHILE...WEND.txt +++ b/internal/help/WHILE...WEND.txt @@ -24,7 +24,7 @@ The {{KW|WHILE...WEND}} statement is used to repeat a block of statements while ''Example 1:'' Reading an entire file. Example assumes the program has a [[OPEN|file opened]] as #1 {{CodeStart}} '' '' -{{Cl|OPEN}} "Readme.txt" FOR {{Cl|INPUT (file mode)|INPUT}} AS #1 +{{Cl|OPEN}} "Readme.txt" FOR {{Cl|INPUT (file mode)|INPUT}} AS #1 {{Cl|WHILE...WEND|WHILE}} {{Cl|NOT}} {{Cl|EOF}}(1) {{Cl|_LIMIT}} 1 'limit line prints to one per second {{Cl|LINE INPUT (file statement)|LINE INPUT #}}1, text$ @@ -35,7 +35,7 @@ The {{KW|WHILE...WEND}} statement is used to repeat a block of statements while ''Example 2:'' Clearing the keyboard buffer. {{CodeStart}} '' '' -{{Cl|WHILE}} {{Cl|INKEY$}} <> "" : {{Cl|WEND}} '' '' +{{Cl|WHILE}} {{Cl|INKEY$}} <> "" : {{Cl|WEND}} '' '' {{CodeEnd}} @@ -46,4 +46,4 @@ The {{KW|WHILE...WEND}} statement is used to repeat a block of statements while * [[_CONTINUE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/WHILE.txt b/internal/help/WHILE.txt index e9fc0b247..5ecf1a824 100644 --- a/internal/help/WHILE.txt +++ b/internal/help/WHILE.txt @@ -25,4 +25,4 @@ The '''WHILE''' condition is used in [[WHILE...WEND]] or [[DO...LOOP]] loops to *[[WHILE...WEND]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/WIDTH.txt b/internal/help/WIDTH.txt index fecdcc191..6be25eb49 100644 --- a/internal/help/WIDTH.txt +++ b/internal/help/WIDTH.txt @@ -39,4 +39,4 @@ The {{KW|WIDTH}} statement changes the text dimensions of certain {{KW|SCREEN (s * [[_FONT]], [[_FONTWIDTH]], [[_FONTHEIGHT]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/WINDOW.txt b/internal/help/WINDOW.txt index 17469f8c5..2b6463360 100644 --- a/internal/help/WINDOW.txt +++ b/internal/help/WINDOW.txt @@ -1,54 +1,39 @@ -The [[WINDOW]] graphics statement defines the coordinate dimensions of the current graphics view port or closes it. +The '''WINDOW''' command scales the graphics coordinate system of the current [[_DEST]] image, optionally inverting the direction of the vertical axis. Any coordinates used in drawing commands made to the image are scaled such that the image seems have have the dimensions requested. +== Syntax == +::: '''WINDOW''' [ [ '''SCREEN'''] (''x1!'', ''y1!'') - (''x2!'', ''y2!'')] -{{PageSyntax}}''' -: '''WINDOW''' [[SCREEN] (''column1'', ''row1'')-(''column2'', ''row2'')] +Where (''x1!'', ''y1!'')-(''x2!'', ''y2!'') specifies the new dimensions of the image to scale to. Non-integer values may be used. +Using '''WINDOW''' with no parameters reverts the effect of any previous calls to it. +== Details == +When a command such as [[LINE]], [[CIRCLE]] or [[_PUTIMAGE]] needs a position in an image specified, it is given as a combination of x (horizontal) and y (vertical) coordinates. Usually these values are measured as pixels from the top-left origin. The '''WINDOW''' command changes the way these values are measured. This is best illustrated with an example: +<source lang="qbasic"> +SCREEN _NEWIMAGE(600, 600, 32) 'Create an image that has 600 pixels in x and y directions and display on screen +WINDOW SCREEN (0, 0)-(6, 6) +</source> +The coordinates of the image now run from 0 to 6 in both the x and y directions. The centre of the screen is now referred to as (3, 3) and the bottom-right corner of the screen is (6, 6). The image has not actually just changed size or the number of pixels, just the way the program refers to positions on the image. Despite this example, there is no requirement for the image or scaling coordinates to be square; each direction is scaled independently, and can result in commands such as LINE (0, 0)-(10, 10), , BF drawing a rectangle instead of a square. -{{Parameters}} -* If no statement parameters are used, the previous WINDOW view port area is disabled. -* The SCREEN option inverts Cartesian row values to increase from negative to 0 to positive. Columns unchanged. -* If the SCREEN option is not used, rows use the Cartesian system with highest row at top to lowest row at bottom. -* Optional coordinate values redefine the [[SINGLE]] negative or positive port dimension values when desired. +If the '''SCREEN''' part is omitted, the y axis is inverted. Thus the origin is now at the bottom-left, and y coordinates increase as you move up the screen. Such a system may be more familiar to mathematically-oriented programmers. +'''WINDOW''' does not change any of the content already on the image; it only modifies coordinates used while it is in effect. The scaling is relative to the original image, so successive invocations do not compound upon each other. -{{PageDescription}} -* The statement allows a program to create a custom graphic coordinate system independent of the [[SCREEN]] mode used. -* WINDOW dimensions can be greater than the [[SCREEN]] mode size to create larger images for pictures. -* A [[VIEW]] statement can change the viewport area. -* All subsequent graphics statements will use the new coordinate system. -* Use [[CLS]] or [[CLS|CLS 1]] to clear the active WINDOW view port area. -* [[RUN]] or a [[SCREEN (statement)|SCREEN]] statement will also disable the window viewport. -* Note: '''QB64''' can create a custom sized window using [[_NEWIMAGE]]. -* '''Note: QB64 [[RUN]] statements will not close [[VIEW PRINT]], [[VIEW]] or [[WINDOW]] view ports presently!''' +Although '''WINDOW''' affects all coordinates, it does not affect all graphics operations entirely. [[_PUTIMAGE]], if only given one destination coordinate, will not scale or stretch the image being drawn. [[CIRCLE]] will scale its radius such that it matches the horizontal axis. This means it always draws perfect circles even if the scaling of the two axes are not the same, but the radius measured against the vertical scale may not be correct. +The location of the graphics cursor (used to calculate relative positions for STEP) is not affected. It will remain in the same position on the image, but the relative coordinates that are specified with STEP will be scaled as described above. -''Example:'' Using a WINDOW to amplify circle sizes. [[PMAP]] finds the corresponding WINDOW co-ordinates. -{{CodeStart}} -{{Cl|SCREEN}} 12 -{{Cl|WINDOW}} (0, 0)-(10, 10) 'uses Cartesian row co-ordinates -{{Cl|PRINT}} "Click mouse to place a circle. Hit enter for next color." -{{Cl|FOR...NEXT|FOR}} clr = 1 {{Cl|TO}} 15 - {{Cl|DO}} - {{Cl|DO}} - {{Cl|IF...THEN|IF}} {{Cl|_MOUSEBUTTON}}(1) {{Cl|THEN}} - x! = {{Cl|PMAP}}({{Cl|_MOUSEX}}, 2) ' Convert mouse screen co-ordinates to window co-ordinates. - y! = {{Cl|PMAP}}({{Cl|_MOUSEY}}, 3) - {{Cl|CIRCLE}} (x!, y!), .2, clr - {{Cl|PAINT}} {{Cl|STEP}}(0, 0), clr - {{Cl|END IF}} - {{Cl|LOOP}} {{Cl|WHILE}} {{Cl|_MOUSEINPUT}} - {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(13) -{{Cl|NEXT}} '' '' -{{CodeEnd}} +== Examples == +Demonstrate a circle's radius only matching the scaling in the horizontal direction by comparing against a box: +<source lang="qbasic"> +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]] - -{{PageSeeAlso}} +== See also == * [[PMAP]] -* [[VIEW]] {{text|(graphics view port)}} -* [[VIEW PRINT]] {{text|(text view port)}} -* [[_NEWIMAGE]], [[_LOADIMAGE]] -* [https://en.wikipedia.org/wiki/Cartesian_coordinate_system Cartesian coordinate system] - - -{{PageNavigation}} \ No newline at end of file +* [[VIEW]] +* [[VIEW PRINT]] diff --git a/internal/help/WRITE.txt b/internal/help/WRITE.txt index b72237268..a17e34b32 100644 --- a/internal/help/WRITE.txt +++ b/internal/help/WRITE.txt @@ -15,7 +15,7 @@ The {{KW|WRITE}} statement writes a [[comma]]-separated list of values to the sc ''Example:'' Comparing WRITE to the same PRINT statement. {{CodeStart}}a% = 123 -b$ = "Hello" +b$ = "Hello" c! = 3.1415 {{Cl|PRINT}} a%, b$, c! 'commas display tab spaced data @@ -23,7 +23,7 @@ c! = 3.1415 {{CodeEnd}} {{OutputStart}} 123        Hello      3.1415 -123,"Hello",3.1415 '' '' +123,"Hello",3.1415 '' '' {{OutputEnd}} @@ -34,4 +34,4 @@ c! = 3.1415 * [[PRINT USING]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/WRITE_(file_statement).txt b/internal/help/WRITE_(file_statement).txt index 125cc0d2b..512ae62ee 100644 --- a/internal/help/WRITE_(file_statement).txt +++ b/internal/help/WRITE_(file_statement).txt @@ -19,8 +19,8 @@ The [[WRITE (file statement)|WRITE #]] file statement writes a list of comma sep ''Example:'' Writes new data to a text file sequentially and reads it back to the program screen. {{CodeStart}} '' '' -filename$ = "testfile.dat" -x = 1: y = 2: z$ = "Three" +filename$ = "testfile.dat" +x = 1: y = 2: z$ = "Three" {{Cl|OPEN}} filename$ {{Cl|FOR...NEXT|FOR}} {{Cl|OUTPUT}} {{Cl|AS}} #1 'opens and clears an existing file or creates new empty file @@ -28,7 +28,7 @@ x = 1: y = 2: z$ = "Three" {{Cl|CLOSE}} #1 -{{Cl|PRINT}} "File created with data. Press a key!" +{{Cl|PRINT}} "File created with data. Press a key!" K$ = {{Cl|INPUT$}}(1) 'press a key @@ -44,10 +44,10 @@ K$ = {{Cl|INPUT$}}(1) 'press a key {{Cl|END}} '' '' {{CodeEnd}} : ''File content:'' [[WRITE]] string values will include quotation marks, but they are not required to read the file. -{{TextStart}}1,2,"Three" '' '' {{TextEnd}} +{{TextStart}}1,2,"Three" '' '' {{TextEnd}} : ''Screen output:'' [[PRINT]] string values will not display enclosing quotes. [[WRITE]] screen displays will. {{OutputStart}} 1 2 Three -1,2,"Three" +1,2,"Three" {{OutputEnd}} @@ -58,4 +58,4 @@ K$ = {{Cl|INPUT$}}(1) 'press a key * [[SQL Client]] {{text|(library)}} -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/XOR.txt b/internal/help/XOR.txt index 564493398..563f59082 100644 --- a/internal/help/XOR.txt +++ b/internal/help/XOR.txt @@ -1,50 +1 @@ -The '''XOR''' numerical operator returns the bitwise exclusive [[OR]] value where only bits that differ return a bit value. - - -{{PageSyntax}} -::: result% = ''value1%'' [[XOR]] ''value2%'' - - -* Given two [[INTEGER|whole integer]] type ''values'' XOR returns an integer with the property that each bit returns: -:* a bit value of 0 if both of the corresponding bit values compared are off or on. -:* a bit value of 1 if one of the two compared bit values is on and the other is off. -* XOR can be used to turn off bits that are on or turn on bits that are off, like toggling the bit values. -* Byte (8 bit) values can be from 0 to 255. 0 = all bits off. 255 = all bits on. - - -{{Template:LogicalTruthTable}} - - -''Example 1:'' Comparing the results of XOR, AND and OR value comparisons on one byte number values up to 255. -{{WhiteStart}} - - ' bit# 76543210 also the exponent of 2 value on - ' -------- - a% = 233 ' binary 11101001 values used - b% = 111 ' binary 01101111 - ' -------- - result1% = a% XOR b% ' 10000110 binary ''Result1% ='' 134 - - result2% = a% AND b% ' 01101001 binary ''Result2% ='' 105 - - result3% = a% OR b% ' 11101111 binary ''Result3% ='' 239 - -{{WhiteEnd}} -:''Explanation:'' Look down the columns to see how the bits are changed. The three values returned by XOR, AND and OR are relational. If you add the values returned by XOR(134) and AND(105) the result is the value of the OR operation, 239. - - -''Example 2:'' Using XOR to turn a parallel port's data register bits on or off -{{CodeStart}} -address% = 888 -ByteValue% = {{Cl|INP}}(address%) -{{Cl|OUT}} address%, ByteValue% {{Cl|XOR}} 7 -{{CodeEnd}} -:''Explanation:'' Only the first 3 Bits are affected. If on then turned off. If off then turned on. Each time the OUT statement above is used, the bit values alternate. That is because the value of 7 compares the bit's status to an on only value. - - -''See also:'' -* [[AND]], [[OR]] {{text|(logical operators)}} -* [[Binary]], [[Boolean]] - - -{{PageNavigation}} \ No newline at end of file +#REDIRECT [[Bitwise Operators]] diff --git a/internal/help/^.txt b/internal/help/^.txt index 02d8a2e21..3b969735c 100644 --- a/internal/help/^.txt +++ b/internal/help/^.txt @@ -21,7 +21,7 @@ The '''^''' operation raises a numerical value to an exponential value expressin {{CodeStart}} - {{Cl|INPUT}} "Enter a number to calculate it's cube root: ", num$ + {{Cl|INPUT}} "Enter a number to calculate it's cube root: ", num$ number! = {{Cl|VAL}}(num$) 'gets single number value cuberoot# = number! {{Cl|^}} (1 {{Cl|/}} 3) PRINT cuberoot# 'double type variable for accuracy @@ -46,4 +46,4 @@ Enter a number to calculate it's cube root: 144 -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_ACOS.txt b/internal/help/_ACOS.txt index a2159bbec..5dae84feb 100644 --- a/internal/help/_ACOS.txt +++ b/internal/help/_ACOS.txt @@ -6,7 +6,7 @@ The [[_ACOS]] function returns the angle measured in radians based on an input [ : {{Parameter|radian_angle!}} = [[_ACOS]]({{Parameter|cosine_value!}}) {{PageDescription}} -* The ''cosine_value!'' must be measured >= -1 and <= 1, or an error will be generated. (PRINT _ACOS(1.2) would give the result of -1.#IND, which is basically QB64's way of telling us that the number doesn't exist, much like 1/0 would.) +* The ''cosine_value!'' must be measured >= -1 and <= 1, or an error will be generated. (PRINT _ACOS(1.2) would give the result of -1.#IND, which is basically QB64's way of telling us that the number doesn't exist, much like 1/0 would.) * ARCCOSINE is the inverse function of [[COS]]ine, which lets us turn a [[COS]]ine value back into an angle. * Note: Due to rounding with floating point math, the _ACOS may not always give a perfect match for the COS angle which generated this. You can reduce the number of rounding errors by increasing the precision of your calculations by using [[DOUBLE]] or [[_FLOAT]] precision variables instead of [[SINGLE]]. @@ -20,17 +20,17 @@ The [[_ACOS]] function returns the angle measured in radians based on an input [ {{CodeStart}} '' '' {{Cl|DEFDBL}} A-Z -{{Cl|INPUT}} "Give me an Angle (in Degrees) => "; Angle +{{Cl|INPUT}} "Give me an Angle (in Degrees) => "; Angle {{Cl|PRINT}} C = {{Cl|COS}}({{Cl|_D2R}}(Angle)) '_D2R is the command to convert Degrees to Radians, which is what COS expects -{{Cl|PRINT}} "The COSINE of the Angle is: "; C +{{Cl|PRINT}} "The COSINE of the Angle is: "; C A = {{Cl|_ACOS}}(C) -{{Cl|PRINT}} "The ACOS of "; C; " is: "; A -{{Cl|PRINT}} "Notice, A is the Angle in Radians. If we convert it to degrees, the value is "; {{Cl|_R2D}}(A) '' '' +{{Cl|PRINT}} "The ACOS of "; C; " is: "; A +{{Cl|PRINT}} "Notice, A is the Angle in Radians. If we convert it to degrees, the value is "; {{Cl|_R2D}}(A) '' '' {{CodeEnd}} {{small|Example by SMcNeill}} {{OutputStart}} -Give me an Angle (in Degrees) => ? 60 +Give me an Angle (in Degrees) => ? 60 The COSINE of the Angle is: .5000000000000001 The ACOS of .5000000000000001 is: 1.047197551196598 @@ -51,4 +51,4 @@ Notice, A is the Angle in Radians. If we convert it to degrees, we discover the *[[Mathematical_Operations#Derived_Mathematical_Functions|Derived Mathematical Functions]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_ACOSH.txt b/internal/help/_ACOSH.txt index 4a4c968e6..94375bd41 100644 --- a/internal/help/_ACOSH.txt +++ b/internal/help/_ACOSH.txt @@ -18,4 +18,4 @@ The [[_ACOSH]] returns the nonnegative arc hyperbolic cosine of {{Parameter|x!}} *[[Mathematical_Operations#Derived_Mathematical_Functions|Derived Mathematical Functions]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_ALPHA.txt b/internal/help/_ALPHA.txt index 62b6c9354..c77b086dc 100644 --- a/internal/help/_ALPHA.txt +++ b/internal/help/_ALPHA.txt @@ -23,10 +23,10 @@ The [[_ALPHA]] function returns the alpha channel transparency level of a color {{Cl|SCREEN}} 13 clr~& = {{Cl|_RGBA}}(255, 0, 255, 192) 'returns closest palette color attribute -{{Cl|PRINT}} "Color:"; clr~& +{{Cl|PRINT}} "Color:"; clr~& {{Cl|COLOR}} clr~& -{{Cl|PRINT}} "Alpha:"; {{Cl|_ALPHA}}(clr~&) +{{Cl|PRINT}} "Alpha:"; {{Cl|_ALPHA}}(clr~&) {{Cl|END}} {{CodeEnd}} @@ -40,11 +40,11 @@ clr~& = {{Cl|_RGBA}}(255, 0, 255, 192) 'returns closest palette color attrib {{CodeStart}} '' '' {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, 32) BG& = {{Cl|POINT}}(1, 1) -{{Cl|PRINT}} "Alpha ="; {{Cl|_ALPHA}}(BG&); "Press a key to use CLS!" +{{Cl|PRINT}} "Alpha ="; {{Cl|_ALPHA}}(BG&); "Press a key to use CLS!" K$ = INPUT$(1) {{Cl|CLS}} BG& = {{Cl|POINT}}(1, 1) -{{Cl|PRINT}} "CLS Alpha ="; {{Cl|_ALPHA}}(BG&) '' '' +{{Cl|PRINT}} "CLS Alpha ="; {{Cl|_ALPHA}}(BG&) '' '' {{CodeEnd}} {{OutputStart}}CLS Alpha = 255 {{OutputEnd}} : ''Explanation:'' Set the ALPHA value to 255 using [[CLS]] to make the background opaque when overlaying pages. @@ -59,4 +59,4 @@ BG& = {{Cl|POINT}}(1, 1) * [[CLS]], [[COLOR]], [[Images]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_ALPHA32.txt b/internal/help/_ALPHA32.txt index caa1650d8..f5a0b7967 100644 --- a/internal/help/_ALPHA32.txt +++ b/internal/help/_ALPHA32.txt @@ -24,10 +24,10 @@ The [[_ALPHA32]] function returns the alpha transparency level of a 32 bit color {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, 32) clr~& = {{Cl|_RGBA}}(255, 0, 255, 192) -{{Cl|PRINT}} "Color:"; clr~& +{{Cl|PRINT}} "Color:"; clr~& {{Cl|COLOR}} clr~& -{{Cl|PRINT}} "Alpha32:"; {{Cl|_ALPHA32}}(clr~&) +{{Cl|PRINT}} "Alpha32:"; {{Cl|_ALPHA32}}(clr~&) {{Cl|END}} '' '' {{CodeEnd}} @@ -46,4 +46,4 @@ clr~& = {{Cl|_RGBA}}(255, 0, 255, 192) * [[Images]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_ASIN.txt b/internal/help/_ASIN.txt index b3c85cd3c..b6baf6a4f 100644 --- a/internal/help/_ASIN.txt +++ b/internal/help/_ASIN.txt @@ -7,7 +7,7 @@ The [[_ASIN]] function returns the angle measured in radians based on an input [ {{PageDescription}} -* The {{Parameter|sine_value!}} must be measured >= -1 and <= 1, or else it will generate a return value of '''-1.#IND''', which is basically QB64's way of telling us that the number doesn't exist. +* The {{Parameter|sine_value!}} must be measured >= -1 and <= 1, or else it will generate a return value of '''-1.#IND''', which is basically QB64's way of telling us that the number doesn't exist. * ARCSINE is the inverse function of [[SIN]]e, and turns a [[SIN]]e value back into an angle. * Note: Due to rounding with floating point math, the [[_ASIN]] may not always give a perfect match for the [[SIN]] angle which generated this. You can reduce the number of rounding errors by increasing the precision of your calculations by using [[DOUBLE]] or [[_FLOAT]] precision variables instead of [[SINGLE]]. @@ -21,17 +21,17 @@ The [[_ASIN]] function returns the angle measured in radians based on an input [ {{CodeStart}} '' '' {{Cl|DEFDBL}} A-Z -{{Cl|INPUT}} "Give me an Angle (in Degrees) => "; Angle +{{Cl|INPUT}} "Give me an Angle (in Degrees) => "; Angle {{Cl|PRINT}} C = {{Cl|SIN}}({{Cl|_D2R}}(Angle)) '_D2R is the command to convert Degrees to Radians, which is what SIN expects -{{Cl|PRINT}} "The SINE of the Angle is: "; C +{{Cl|PRINT}} "The SINE of the Angle is: "; C A = {{Cl|_ASIN}}(C) -{{Cl|PRINT}} "The ASIN of "; C; " is: "; A -{{Cl|PRINT}} "Notice, A is the Angle in Radians. If we convert it to degrees, the value is "; {{Cl|_R2D}}(A) '' '' +{{Cl|PRINT}} "The ASIN of "; C; " is: "; A +{{Cl|PRINT}} "Notice, A is the Angle in Radians. If we convert it to degrees, the value is "; {{Cl|_R2D}}(A) '' '' {{CodeEnd}} {{small|Example by SMcNeill}} {{OutputStart}} -Give me an Angle (in Degrees) => ? 60 +Give me an Angle (in Degrees) => ? 60 The SINE of the Angle is: .8660254037844386 The ACOS of .8660254037844386 is: 1.047197551196598 @@ -52,4 +52,4 @@ Notice, A is the Angle in Radians. If we convert it to degrees, we discover the *[[Mathematical_Operations#Derived_Mathematical_Functions|Derived Mathematical Functions]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_ASINH.txt b/internal/help/_ASINH.txt index fd089883e..6de06a22d 100644 --- a/internal/help/_ASINH.txt +++ b/internal/help/_ASINH.txt @@ -19,4 +19,4 @@ The [[_ASINH]] returns the arc hyperbolic sine of x, expressed in radians. *[[Mathematical_Operations#Derived_Mathematical_Functions|Derived Mathematical Functions]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_ATAN2.txt b/internal/help/_ATAN2.txt index 31fac599d..9d9e6f548 100644 --- a/internal/help/_ATAN2.txt +++ b/internal/help/_ATAN2.txt @@ -12,13 +12,13 @@ The [[_ATAN2]] function returns the radian angle between the positive x-axis of {{PageDescription}} -* The [[DOUBLE]] radian angle returned is '''positive''' for upper row values where y > 0. -::* _ATAN2(y, x) = [[ATN]](y# / x#) when x > 0 +* The [[DOUBLE]] radian angle returned is '''positive''' for upper row values where y > 0. +::* _ATAN2(y, x) = [[ATN]](y# / x#) when x > 0 ::* _ATAN2(y, x) = [[ATN]](y# / x#) + [[_PI]] when x < 0 ::* _ATAN2(y, x) = [[_PI]] / 2 when x = 0 -* The [[DOUBLE]] radian angle returned is 0 when x > 0 and [[_PI]] when x < 0 where y = 0 +* The [[DOUBLE]] radian angle returned is 0 when x > 0 and [[_PI]] when x < 0 where y = 0 * The [[DOUBLE]] radian angle returned is '''negative''' for lower row values where y < 0. -::* _ATAN2(y, x) = [[ATN]](y# / x#) when x > 0 +::* _ATAN2(y, x) = [[ATN]](y# / x#) when x > 0 ::* _ATAN2(y, x) = [[ATN]](y# / x#) - [[_PI]] when x < 0 ::* _ATAN2(y, x) = -[[_PI]] / 2 when x = 0 * _ATAN2(0, 0) is undefined and the function returns 0 instead of a division error. @@ -35,4 +35,4 @@ The [[_ATAN2]] function returns the radian angle between the positive x-axis of * [https://en.wikipedia.org/wiki/Atan2 Atan2 reference] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_ATANH.txt b/internal/help/_ATANH.txt index d3d417eba..3a43b6ea6 100644 --- a/internal/help/_ATANH.txt +++ b/internal/help/_ATANH.txt @@ -19,4 +19,4 @@ The [[_ATANH]] returns the arc hyperbolic tangent of {{Parameter|x!}}, expressed *[[Mathematical_Operations#Derived_Mathematical_Functions|Derived Mathematical Functions]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_AUTODISPLAY.txt b/internal/help/_AUTODISPLAY.txt index 2dce81426..489f9531c 100644 --- a/internal/help/_AUTODISPLAY.txt +++ b/internal/help/_AUTODISPLAY.txt @@ -17,4 +17,4 @@ The [[_AUTODISPLAY]] statement enables the automatic display of the screen image * [[_AUTODISPLAY (function)]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_AXIS.txt b/internal/help/_AXIS.txt index f86ae407e..0075a9a02 100644 --- a/internal/help/_AXIS.txt +++ b/internal/help/_AXIS.txt @@ -16,13 +16,13 @@ The [[_AXIS]] function returns the relative position of a specified axis number ''Example:'' Reading multiple controller device buttons, axis and wheels. {{CodeStart}} '' '' {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} {{Cl|_DEVICES}} - {{Cl|PRINT}} {{Cl|STR$}}(i) + ") " + {{Cl|_DEVICE$}}(i) + " Buttons:"; {{Cl|_LASTBUTTON}}(i); ",Axis:"; {{Cl|_LASTAXIS}}(i); ",Wheel:"; {{Cl|_LASTWHEEL}}(i) + {{Cl|PRINT}} {{Cl|STR$}}(i) + ") " + {{Cl|_DEVICE$}}(i) + " Buttons:"; {{Cl|_LASTBUTTON}}(i); ",Axis:"; {{Cl|_LASTAXIS}}(i); ",Wheel:"; {{Cl|_LASTWHEEL}}(i) {{Cl|NEXT}} {{Cl|DO...LOOP|DO}} d& = {{Cl|_DEVICEINPUT}} {{Cl|IF...THEN|IF}} d& {{Cl|THEN}} ' the device number cannot be zero! - {{Cl|PRINT}} "Found"; d&; + {{Cl|PRINT}} "Found"; d&; {{Cl|FOR...NEXT|FOR}} b = 1 {{Cl|TO}} {{Cl|_LASTBUTTON}}(d&) {{Cl|PRINT}} {{Cl|_BUTTONCHANGE}}(b); {{Cl|_BUTTON}}(b); {{Cl|NEXT}} @@ -49,4 +49,4 @@ The [[_AXIS]] function returns the relative position of a specified axis number * [[Controller Devices]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_BACKGROUNDCOLOR.txt b/internal/help/_BACKGROUNDCOLOR.txt index f6edbb51f..884657cd9 100644 --- a/internal/help/_BACKGROUNDCOLOR.txt +++ b/internal/help/_BACKGROUNDCOLOR.txt @@ -45,4 +45,4 @@ BG% = {{Cl|_BACKGROUNDCOLOR}} * [[Windows_Libraries#Color_Dialog_Box|Color Dialog Box]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_BIT.txt b/internal/help/_BIT.txt index c54c4735e..b0f10c89e 100644 --- a/internal/help/_BIT.txt +++ b/internal/help/_BIT.txt @@ -3,9 +3,9 @@ The [[_BIT]] datatype can return only values of 0 (bit off) and -1 (bit on). {{PageSyntax}} -: [[DIM]] {{Parameter|variable}} [[AS]] [[[_UNSIGNED]]] [[_BIT]] [* {{Parameter|numberofbits}}] +: [[DIM]] {{Parameter|variable}} [[AS]] [{{KW|_UNSIGNED}}] [[_BIT]] [* {{Parameter|numberofbits}}] -: [[_DEFINE]] {{Parameter|Letter}}[{{Parameter|-Range}}|,...] [[AS]] [[[_UNSIGNED]]] [[_BIT]] [* {{Parameter|numberofbits}}] +: [[_DEFINE]] {{Parameter|Letter}}[{{Parameter|-Range}}|,...] [[AS]] [{{KW|_UNSIGNED}}] [[_BIT]] [* {{Parameter|numberofbits}}] {{PageDescription}} @@ -17,29 +17,29 @@ The [[_BIT]] datatype can return only values of 0 (bit off) and -1 (bit on). * '''[[Keywords_currently_not_supported_by_QB64|_BIT is not supported in User Defined TYPES.]]''' Use a [[_BYTE]] and assign up to 8 bit values as shown below. -*'''Suffix Symbols''' The [[_BIT]] type suffix used is below the grave accent (`), usually located under the tilde (~) key, not an apostrophe! Foreign keyboards may not have the ` key. Try [[CHR$]](96). +*'''Suffix Symbols''' The [[_BIT]] type suffix used is below the grave accent (`), usually located under the tilde (~) key (not an apostrophe). Foreign keyboards may not have the ` key. Try Alt+96 in the IDE. -:You can define a bit on-the-fly by adding a ` after the variable, like this; variable` = -1 +:You can define a bit on-the-fly by adding a ` after the variable, like this: {{InlineCode}}variable` = -1{{InlineCodeEnd}} -:If you want a unsigned bit you can define it on-the-fly by adding ~` instead, like this; variable~` = 1 +:If you want an unsigned bit you can define it on-the-fly by adding ~` instead, like this: {{InlineCode}}variable~` = 1{{InlineCodeEnd}} -:You can set the number of bits on the fly by just adding that number - this defines it as being two bits; variable`2 = -1 +:You can set the number of bits on the fly by just adding that number - this defines it as being two bits: {{InlineCode}}variable`2 = -1{{InlineCodeEnd}} -<center>'''[[_BIT|BITS]]'''</center> +<center>'''[[_BIT|BITS]]'''</center> * The '''MSB''' is the most significant(largest) bit value and '''LSB''' is the least significant bit of a binary or register memory address value. The order in which the bits are read determines the binary or decimal byte value. There are two common ways to read a byte: -:* '''"Big-endian"''': MSB is the first bit encountered, decreasing to the LSB as the last bit by position, memory address or time. -:* '''"Little-endian"''': LSB is the first bit encountered, increasing to the MSB as the last bit by position, memory address or time. +:* '''"Big-endian"''': MSB is the first bit encountered, decreasing to the LSB as the last bit by position, memory address or time. +:* '''"Little-endian"''': LSB is the first bit encountered, increasing to the MSB as the last bit by position, memory address or time. {{WhiteStart}} '''Offset or Position: 0 1 2 3 4 5 6 7 Example: 11110000''' ---------------------------------- -------- '''Big-Endian Bit On Value:''' 128 64 32 16 8 4 2 1 240 '''Little-Endian Bit On Value:''' 1 2 4 8 16 32 64 128 15 {{WhiteEnd}} -::The big-endian method compares exponents of 2 <sup>7</sup> down to 2 <sup>0</sup> while the little-endian method does the opposite. +::The big-endian method compares exponents of 2 <sup>7</sup> down to 2 <sup>0</sup> while the little-endian method does the opposite. -<center>'''[[_BYTE|BYTES]]'''</center> +<center>'''[[_BYTE|BYTES]]'''</center> * [[INTEGER]] values consist of 2 bytes called the '''HI''' and '''LO''' bytes. Anytime that the number of binary digits is a multiple of 16 (2bytes, 4 bytes, etc.) and the HI byte's MSB is on(1), the value returned will be negative. Even with [[SINGLE]] or [[DOUBLE]] values! {{WhiteStart}} '''16 BIT INTEGER OR REGISTER''' '''AH (High Byte Bits) AL (Low Byte Bits)''' @@ -53,7 +53,7 @@ The [[_BIT]] datatype can return only values of 0 (bit off) and -1 (bit on). {{PageExamples}} -''Example:'' Shifting bits in a value. +''Example:'' Shifting bits in a value in QB64 versions prior to 1.3 (you can use [[_SHL]] and [[_SHR]] starting with version 1.3). {{CodeStart}} '' '' n = 24 Shift = 3 @@ -80,6 +80,7 @@ RShift = {{Cl|INT}}(n / (2 ^ RS)) {{PageSeeAlso}} * [[&B]] (binary), [[_BYTE]] +* [[_SHL]], [[_SHR]] * [[_DEFINE]], [[_UNSIGNED]] * [[DIM]] * [[Binary]], [[Boolean]] @@ -87,4 +88,4 @@ RShift = {{Cl|INT}}(n / (2 ^ RS)) * [[Converting Bytes to Bits]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_BLEND.txt b/internal/help/_BLEND.txt index 8fca011e6..6a4076c06 100644 --- a/internal/help/_BLEND.txt +++ b/internal/help/_BLEND.txt @@ -54,83 +54,83 @@ m& = {{Cl|POINT}}(303, 302) mso-yfti-tbllook:480;mso-padding-alt:0cm 5.4pt 0cm 5.4pt;mso-border-insideh: - .5pt solid windowtext;mso-border-insidev:.5pt solid windowtext'> + .5pt solid windowtext;mso-border-insidev:.5pt solid windowtext'> - <tr style='mso-yfti-irow:0;mso-yfti-lastrow:yes'> + <tr style='mso-yfti-irow:0;mso-yfti-lastrow:yes'> <td width=118 valign=top style='width:88.55pt;border:solid windowtext 1.0pt; - mso-border-alt:solid windowtext .5pt;background:#FF8000;padding:0cm 5.4pt 0cm 5.4pt'> + mso-border-alt:solid windowtext .5pt;background:#FF8000;padding:0cm 5.4pt 0cm 5.4pt'> - <p class=MsoNormal><span lang=EN-AU style='font-size:10.0pt;font-family:"Courier New"; + <p class=MsoNormal><span lang=EN-AU style='font-size:10.0pt;font-family:"Courier New"; - mso-fareast-font-family:"Times New Roman"'>&nbsp;</span></p> + mso-fareast-font-family:"Times New Roman"'>&nbsp;</span></p> - </td> + </td> <td width=181 valign=top style='width:136.05pt;border:solid windowtext 1.0pt; border-left:none;mso-border-left-alt:solid windowtext .5pt;mso-border-alt: - solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'> + solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'> - <p class=MsoNormal><span lang=EN-AU style='font-size:10.0pt;font-family:"Courier New"; + <p class=MsoNormal><span lang=EN-AU style='font-size:10.0pt;font-family:"Courier New"; - mso-fareast-font-family:"Times New Roman"'>_RGBA(255,128,0,128)</span></p> + mso-fareast-font-family:"Times New Roman"'>_RGBA(255,128,0,128)</span></p> - <p class=MsoNormal><span lang=EN-AU style='font-size:10.0pt;font-family:"Courier New"; + <p class=MsoNormal><span lang=EN-AU style='font-size:10.0pt;font-family:"Courier New"; - mso-fareast-font-family:"Times New Roman"'>   onto</span></p> + mso-fareast-font-family:"Times New Roman"'>   onto</span></p> - <p class=MsoNormal><span lang=EN-AU style='font-size:10.0pt;font-family:"Courier New"; + <p class=MsoNormal><span lang=EN-AU style='font-size:10.0pt;font-family:"Courier New"; - mso-fareast-font-family:"Times New Roman"'>     _RGBA(0,0,255,64)</span></p> + mso-fareast-font-family:"Times New Roman"'>     _RGBA(0,0,255,64)</span></p> - </td> + </td> <td width=120 valign=top style='width:90.0pt;border:solid windowtext 1.0pt; border-left:none;mso-border-left-alt:solid windowtext .5pt;mso-border-alt: - solid windowtext .5pt;background:blue;padding:0cm 5.4pt 0cm 5.4pt'> + solid windowtext .5pt;background:blue;padding:0cm 5.4pt 0cm 5.4pt'> - <p class=MsoNormal><span lang=EN-AU style='font-size:10.0pt;font-family:"Courier New"; + <p class=MsoNormal><span lang=EN-AU style='font-size:10.0pt;font-family:"Courier New"; - mso-fareast-font-family:"Times New Roman"'>&nbsp;</span></p> + mso-fareast-font-family:"Times New Roman"'>&nbsp;</span></p> - </td> + </td> <td width=180 valign=top style='width:135.0pt;border:solid windowtext 1.0pt; border-left:none;mso-border-left-alt:solid windowtext .5pt;mso-border-alt: - solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'> + solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'> - <p class=MsoNormal><span lang=EN-AU style='font-size:10.0pt;font-family:"Courier New"; + <p class=MsoNormal><span lang=EN-AU style='font-size:10.0pt;font-family:"Courier New"; - mso-fareast-font-family:"Times New Roman"'>results in</span></p> + mso-fareast-font-family:"Times New Roman"'>results in</span></p> - <p class=MsoNormal><span lang=EN-AU style='font-size:10.0pt;font-family:"Courier New"; + <p class=MsoNormal><span lang=EN-AU style='font-size:10.0pt;font-family:"Courier New"; - mso-fareast-font-family:"Times New Roman"'>  _RGBA(95,48,64,128)</span></p> + mso-fareast-font-family:"Times New Roman"'>  _RGBA(95,48,64,128)</span></p> - </td> + </td> <td width=120 valign=top style='width:90.0pt;border:solid windowtext 1.0pt; border-left:none;mso-border-left-alt:solid windowtext .5pt;mso-border-alt: - solid windowtext .5pt;background:#603080;padding:0cm 5.4pt 0cm 5.4pt'> + solid windowtext .5pt;background:#603080;padding:0cm 5.4pt 0cm 5.4pt'> - <p class=MsoNormal><span lang=EN-AU style='font-size:10.0pt;font-family:"Courier New"; + <p class=MsoNormal><span lang=EN-AU style='font-size:10.0pt;font-family:"Courier New"; - mso-fareast-font-family:"Times New Roman"'>&nbsp;</span></p> + mso-fareast-font-family:"Times New Roman"'>&nbsp;</span></p> - </td> + </td> - </tr> + </tr> -</table> +</table> {{PageSeeAlso}} @@ -138,4 +138,4 @@ m& = {{Cl|POINT}}(303, 302) * [[Images]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_BLEND_(function).txt b/internal/help/_BLEND_(function).txt index db793b177..e33db7e17 100644 --- a/internal/help/_BLEND_(function).txt +++ b/internal/help/_BLEND_(function).txt @@ -16,4 +16,4 @@ The [[_BLEND (function)|_BLEND]] function returns enabled or disabled for the cu * [[Images]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_BLUE.txt b/internal/help/_BLUE.txt index 3984104e1..08fa76706 100644 --- a/internal/help/_BLUE.txt +++ b/internal/help/_BLUE.txt @@ -28,4 +28,4 @@ The [[_BLUE]] function returns the palette intensity or the blue component inten * [[_LOADIMAGE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_BLUE32.txt b/internal/help/_BLUE32.txt index 7cf1b4453..f8aad0f11 100644 --- a/internal/help/_BLUE32.txt +++ b/internal/help/_BLUE32.txt @@ -21,4 +21,4 @@ The [[_BLUE32]] function returns the blue component intensity of a 32-bit image * [[_RGB32]], [[_BLUE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_BUTTON.txt b/internal/help/_BUTTON.txt index d30905147..dffa7c36c 100644 --- a/internal/help/_BUTTON.txt +++ b/internal/help/_BUTTON.txt @@ -17,13 +17,13 @@ The [[_BUTTON]] function returns -1 when specified button number on a controller ''Example:'' Reading multiple controller device buttons, axis and wheels. {{CodeStart}} '' '' {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} {{Cl|_DEVICES}} - {{Cl|PRINT}} {{Cl|STR$}}(i) + ") " + {{Cl|_DEVICE$}}(i) + " Buttons:"; {{Cl|_LASTBUTTON}}(i); ",Axis:"; {{Cl|_LASTAXIS}}(i); ",Wheel:"; {{Cl|_LASTWHEEL}}(i) + {{Cl|PRINT}} {{Cl|STR$}}(i) + ") " + {{Cl|_DEVICE$}}(i) + " Buttons:"; {{Cl|_LASTBUTTON}}(i); ",Axis:"; {{Cl|_LASTAXIS}}(i); ",Wheel:"; {{Cl|_LASTWHEEL}}(i) {{Cl|NEXT}} {{Cl|DO...LOOP|DO}} d& = {{Cl|_DEVICEINPUT}} {{Cl|IF...THEN|IF}} d& {{Cl|THEN}} ' the device number cannot be zero! - {{Cl|PRINT}} "Found"; d&; + {{Cl|PRINT}} "Found"; d&; {{Cl|FOR...NEXT|FOR}} b = 1 {{Cl|TO}} {{Cl|_LASTBUTTON}}(d&) {{Cl|PRINT}} {{Cl|_BUTTONCHANGE}}(b); {{Cl|_BUTTON}}(b); {{Cl|NEXT}} @@ -50,4 +50,4 @@ The [[_BUTTON]] function returns -1 when specified button number on a controller * [[Controller Devices]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_BUTTONCHANGE.txt b/internal/help/_BUTTONCHANGE.txt index f7a7de74d..d9a4de110 100644 --- a/internal/help/_BUTTONCHANGE.txt +++ b/internal/help/_BUTTONCHANGE.txt @@ -17,13 +17,13 @@ The [[_BUTTONCHANGE]] function returns -1 or 1 when a specified button number on ''Example:'' Reading multiple controller device buttons, axis and wheels. {{CodeStart}} '' '' {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} {{Cl|_DEVICES}} - {{Cl|PRINT}} {{Cl|STR$}}(i) + ") " + {{Cl|_DEVICE$}}(i) + " Buttons:"; {{Cl|_LASTBUTTON}}(i); ",Axis:"; {{Cl|_LASTAXIS}}(i); ",Wheel:"; {{Cl|_LASTWHEEL}}(i) + {{Cl|PRINT}} {{Cl|STR$}}(i) + ") " + {{Cl|_DEVICE$}}(i) + " Buttons:"; {{Cl|_LASTBUTTON}}(i); ",Axis:"; {{Cl|_LASTAXIS}}(i); ",Wheel:"; {{Cl|_LASTWHEEL}}(i) {{Cl|NEXT}} {{Cl|DO...LOOP|DO}} d& = {{Cl|_DEVICEINPUT}} {{Cl|IF...THEN|IF}} d& {{Cl|THEN}} ' the device number cannot be zero! - {{Cl|PRINT}} "Found"; d&; + {{Cl|PRINT}} "Found"; d&; {{Cl|FOR...NEXT|FOR}} b = 1 {{Cl|TO}} {{Cl|_LASTBUTTON}}(d&) {{Cl|PRINT}} {{Cl|_BUTTONCHANGE}}(b); {{Cl|_BUTTON}}(b); {{Cl|NEXT}} @@ -50,4 +50,4 @@ The [[_BUTTONCHANGE]] function returns -1 or 1 when a specified button number on * [[Controller Devices]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_BYTE.txt b/internal/help/_BYTE.txt index aaa2af1a3..7195bdd26 100644 --- a/internal/help/_BYTE.txt +++ b/internal/help/_BYTE.txt @@ -16,21 +16,21 @@ A [[_BYTE]] variable can hold signed variable values from -128 to 127 (one byte * '''When a variable has not been assigned or has no type suffix, the value defaults to [[SINGLE]].''' -<center>'''[[_BIT|BITS]]'''</center> +<center>'''[[_BIT|BITS]]'''</center> * The '''MSB''' is the most significant(largest) bit value and '''LSB''' is the least significant bit of a binary or register memory address value. The order in which the bits are read determines the binary or decimal byte value. There are two common ways to read a byte: -:* '''"Big-endian"''': MSB is the first bit encountered, decreasing to the LSB as the last bit by position, memory address or time. -:* '''"Little-endian"''': LSB is the first bit encountered, increasing to the MSB as the last bit by position, memory address or time. +:* '''"Big-endian"''': MSB is the first bit encountered, decreasing to the LSB as the last bit by position, memory address or time. +:* '''"Little-endian"''': LSB is the first bit encountered, increasing to the MSB as the last bit by position, memory address or time. {{WhiteStart}} '''Offset or Position: 0 1 2 3 4 5 6 7 Example: 11110000''' ---------------------------------- -------- '''Big-Endian Bit On Value:''' 128 64 32 16 8 4 2 1 240 '''Little-Endian Bit On Value:''' 1 2 4 8 16 32 64 128 15 {{WhiteEnd}} -::The big-endian method compares exponents of 2 <sup>7</sup> down to 2 <sup>0</sup> while the little-endian method does the opposite. +::The big-endian method compares exponents of 2 <sup>7</sup> down to 2 <sup>0</sup> while the little-endian method does the opposite. -<center>'''[[_BYTE|BYTES]]'''</center> +<center>'''[[_BYTE|BYTES]]'''</center> * [[INTEGER]] values consist of 2 bytes called the '''HI''' and '''LO''' bytes. Anytime that the number of binary digits is a multiple of 16 (2bytes, 4 bytes, etc.) and the HI byte's MSB is on(1), the value returned will be negative. Even with [[SINGLE]] or [[DOUBLE]] values! {{WhiteStart}} '''16 BIT INTEGER OR REGISTER''' '''AH (High Byte Bits) AL (Low Byte Bits)''' @@ -54,27 +54,27 @@ A [[_BYTE]] variable can hold signed variable values from -128 to 127 (one byte {{Cl|CLS}} unsig = 1 sig = 1 -{{Cl|PRINT}} "00000001 = unsigned & signed are both" + {{Cl|STR$}}(unsig {{Cl|AND}} sig) +{{Cl|PRINT}} "00000001 = unsigned & signed are both" + {{Cl|STR$}}(unsig {{Cl|AND}} sig) unsig = 127 sig = 127 -{{Cl|PRINT}} "&B01111111 = unsigned & signed are both" + {{Cl|STR$}}(unsig {{Cl|AND}} sig) +{{Cl|PRINT}} "&B01111111 = unsigned & signed are both" + {{Cl|STR$}}(unsig {{Cl|AND}} sig) unsig = 255 sig = 255 -{{Cl|PRINT}} "&B11111111 = unsigned is" + {{Cl|STR$}}(unsig) + " but signed is " + {{Cl|STR$}}(sig) +{{Cl|PRINT}} "&B11111111 = unsigned is" + {{Cl|STR$}}(unsig) + " but signed is " + {{Cl|STR$}}(sig) unsig = 254 sig = 254 -{{Cl|PRINT}} "&B11111110 = unsigned is" + {{Cl|STR$}}(unsig) + " but signed is " + {{Cl|STR$}}(sig) +{{Cl|PRINT}} "&B11111110 = unsigned is" + {{Cl|STR$}}(unsig) + " but signed is " + {{Cl|STR$}}(sig) unsig = 253 sig = 253 -{{Cl|PRINT}} "&B11111101 = unsigned is" + {{Cl|STR$}}(unsig) + " but signed is " + {{Cl|STR$}}(sig) +{{Cl|PRINT}} "&B11111101 = unsigned is" + {{Cl|STR$}}(unsig) + " but signed is " + {{Cl|STR$}}(sig) {{Cl|PRINT}} -{{Cl|PRINT}} "The signed value needs the MSB bit for the sign." -{{Cl|PRINT}} "The most significant bit is furthest to the left." +{{Cl|PRINT}} "The signed value needs the MSB bit for the sign." +{{Cl|PRINT}} "The most significant bit is furthest to the left." {{CodeEnd}} {{OutputStart}} &B00000001 = unsigned & signed are both 1 @@ -92,10 +92,11 @@ The most significant bit is furthest to the left. * [[_BIT]], [[&B]] * [[_DEFINE]], [[DIM]] * [[_UNSIGNED]] +* [[_SHL]], [[_SHR]] * [[Mathematical Operations]] * [[Screen Memory]] * [[Variable Types]] * [[Converting Bytes to Bits]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_CEIL.txt b/internal/help/_CEIL.txt index 923fa387e..f751bdb95 100644 --- a/internal/help/_CEIL.txt +++ b/internal/help/_CEIL.txt @@ -32,4 +32,4 @@ PRINT INT(-2.5), CINT(-2.5), FIX(-2.5), _CEIL(-2.5) * [[_ROUND]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_CLEARCOLOR.txt b/internal/help/_CLEARCOLOR.txt index 76e4bc84a..dfdd0d8cc 100644 --- a/internal/help/_CLEARCOLOR.txt +++ b/internal/help/_CLEARCOLOR.txt @@ -21,10 +21,10 @@ The [[_CLEARCOLOR]] statement sets a specific color to be treated as transparent {{PageExamples}} -''Example 1:'' Using _CLEARCOLOR to "mask" the background color of an image. +''Example 1:'' Using _CLEARCOLOR to "mask" the background color of an image. {{CodeStart}} '' '' {{Cl|SCREEN (statement)|SCREEN}} 13 -img& = {{Cl|_LOADIMAGE}}("qb64_trans.png") +img& = {{Cl|_LOADIMAGE}}("qb64_trans.png") {{Cl|_PUTIMAGE}} , img&, 0 'place actual image with background K$ = INPUT$(1) {{Cl|CLS}} , {{Cl|_RGB}}(255, 0, 0) 'clear screen with red background @@ -47,7 +47,7 @@ redball = {{Cl|_NEWIMAGE}}(101, 101, 32) ' create a new image page {{Cl|DO...LOOP|DO}} {{Cl|_PUTIMAGE| _PUTIMAGE}} ({{Cl|RND}} * 512, {{Cl|RND}} * 384), redball {{Cl|SLEEP| SLEEP}} 1 ' one second delay -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" '' '' +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" '' '' {{CodeEnd}} @@ -56,7 +56,7 @@ redball = {{Cl|_NEWIMAGE}}(101, 101, 32) ' create a new image page mainscreen = {{Cl|_NEWIMAGE}}(640, 480, 32) ' Main Screen (viewable) {{Cl|SCREEN}} mainscreen {{Cl|_SCREENMOVE}} {{Cl|_SCREENMOVE|_MIDDLE}} -Image1& = {{Cl|_LOADIMAGE}}("qb64_trans.png") '<<<<<< any image with one background color to clear +Image1& = {{Cl|_LOADIMAGE}}("qb64_trans.png") '<<<<<< any image with one background color to clear {{Cl|IF...THEN|IF}} Image1& < -1 {{Cl|THEN}} 'check loaded image handle value before using! {{Cl|_SOURCE}} Image1& @@ -76,7 +76,7 @@ DO {{Cl|IF...THEN|IF}} a& = 255 {{Cl|THEN}} d = -d 'reverse fade {{Cl|_SETALPHA}} a&, , NewImage1& 'sets alpha level of all colors to fade image page in/out {{Cl|_PUTIMAGE}} (0, 342), NewImage1& - {{Cl|LOCATE}} 1, 1: {{Cl|PRINT}} "Alpha: "; a& + {{Cl|LOCATE}} 1, 1: {{Cl|PRINT}} "Alpha: "; a& {{Cl|_DISPLAY}} {{Cl|LOOP}} {{Cl|UNTIL}} a& = 0 {{Cl|END}} @@ -92,4 +92,4 @@ DO * [[Images]], [[Creating Sprite Masks]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_CLEARCOLOR_(function).txt b/internal/help/_CLEARCOLOR_(function).txt index f502a684d..667d0f174 100644 --- a/internal/help/_CLEARCOLOR_(function).txt +++ b/internal/help/_CLEARCOLOR_(function).txt @@ -22,4 +22,4 @@ The [[_CLEARCOLOR (function)|_CLEARCOLOR]] function returns the current transpar * [[Images]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_CLIP.txt b/internal/help/_CLIP.txt index f2da1c587..f1a4c9f8f 100644 --- a/internal/help/_CLIP.txt +++ b/internal/help/_CLIP.txt @@ -22,13 +22,13 @@ The [[_CLIP]] option is used in a QB64 graphics [[PUT (graphics statement)|PUT]] {{Cl|CIRCLE}} (10,10),10 {{Cl|GET (graphics statement)|GET}} (0,0)-(20,20), mypic(0) -{{Cl|PRINT}} "This program puts an image off screen." -{{Cl|PRINT}} "Select which option you'd like to try." -{{Cl|PRINT}} "1 will produce an illegal function call." -{{Cl|PRINT}} "1 is putting without _CLIP." -{{Cl|PRINT}} "2 is putting with _CLIP PSET." -{{Cl|PRINT}} "3 is putting with _CLIP XOR." -{{Cl|PRINT}} "4 is putting with _CLIP PSET, 4." +{{Cl|PRINT}} "This program puts an image off screen." +{{Cl|PRINT}} "Select which option you'd like to try." +{{Cl|PRINT}} "1 will produce an illegal function call." +{{Cl|PRINT}} "1 is putting without _CLIP." +{{Cl|PRINT}} "2 is putting with _CLIP PSET." +{{Cl|PRINT}} "3 is putting with _CLIP XOR." +{{Cl|PRINT}} "4 is putting with _CLIP PSET, 4." {{Cl|INPUT}} sel {{Cl|IF...THEN|IF}} sel = 1 {{Cl|THEN}} {{Cl|PUT (graphics statement)|PUT}} (-10, 10), mypic(0), PSET ' this causes an illegal function call @@ -46,4 +46,4 @@ The [[_CLIP]] option is used in a QB64 graphics [[PUT (graphics statement)|PUT]] * [[STEP]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_CLIPBOARD$.txt b/internal/help/_CLIPBOARD$.txt index 18e5e3560..71b54eef5 100644 --- a/internal/help/_CLIPBOARD$.txt +++ b/internal/help/_CLIPBOARD$.txt @@ -16,12 +16,12 @@ The [[_CLIPBOARD$]] function returns the current Operating System's clipboard co ''Example 1:'' Passing a string value between two running programs no matter where they are located. : ''Program1:'' {{CodeStart}} '' '' -{{Cl|PRINT}} "Start Program2 to read your text entries! Empty entry quits!" -{{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "Entry program started!" 'set clipboard initially +{{Cl|PRINT}} "Start Program2 to read your text entries! Empty entry quits!" +{{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "Entry program started!" 'set clipboard initially DO - {{Cl|LINE INPUT}} "Enter some text to send to other program: ", text$ - {{Cl|IF...THEN|IF}} text$ = "" {{Cl|THEN}} {{Cl|EXIT DO}} + {{Cl|LINE INPUT}} "Enter some text to send to other program: ", text$ + {{Cl|IF...THEN|IF}} text$ = "" {{Cl|THEN}} {{Cl|EXIT DO}} {{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = text$ {{Cl|LOOP}} @@ -29,13 +29,13 @@ DO {{CodeEnd}} :''Program2:'' {{CodeStart}} -{{Cl|PRINT}} "Enter text in Program1 and this program will read it. Esc key quits!" +{{Cl|PRINT}} "Enter text in Program1 and this program will read it. Esc key quits!" DO: {{Cl|_LIMIT}} 100 text$ = {{Cl|_CLIPBOARD$}} 'function returns clipboard contents {{Cl|IF...THEN|IF}} {{Cl|LEN}}(text$) {{Cl|THEN}} {{Cl|PRINT}} text$ - {{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "" 'clear clipboard after a read + {{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "" 'clear clipboard after a read {{Cl|END IF}} {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) @@ -46,10 +46,10 @@ DO: {{Cl|_LIMIT}} 100 ''Example 2: A minimized program that pops up when Ctrl + Shift is entered anytime in '''Windows''' and adds clipboard text to be Pasted: {{CodeStart}} '' '' -'"ClippyBoard" program uses GetKeyState Win API to monitor a specific key combination. +'"ClippyBoard" program uses GetKeyState Win API to monitor a specific key combination. 'This demo will maximize the window and focus on program when Shift+A is pressed. -{{Cl|DECLARE DYNAMIC LIBRARY}} "user32" +{{Cl|DECLARE DYNAMIC LIBRARY}} "user32" {{Cl|FUNCTION}} FindWindowA%& ({{Cl|BYVAL}} ClassName {{Cl|AS}} {{Cl|_OFFSET}}, WindowName$) 'find process handle by title {{Cl|FUNCTION}} GetKeyState% ({{Cl|BYVAL}} nVirtKey {{Cl|AS}} {{Cl|LONG}}) 'Windows virtual key presses {{Cl|FUNCTION}} ShowWindow& ({{Cl|BYVAL}} hwnd {{Cl|AS}} {{Cl|_OFFSET}}, {{Cl|BYVAL}} nCmdShow {{Cl|AS}} {{Cl|LONG}}) 'maximize process @@ -57,7 +57,7 @@ DO: {{Cl|_LIMIT}} 100 {{Cl|FUNCTION}} SetForegroundWindow& ({{Cl|BYVAL}} hwnd {{Cl|AS}} {{Cl|_OFFSET}}) 'set foreground window process(focus) {{Cl|DECLARE LIBRARY|END DECLARE}} -title$ = "Clippy Clipboard (Ctrl+Shift)" 'title of program window +title$ = "Clippy Clipboard (Ctrl+Shift)" 'title of program window {{Cl|_TITLE}} title$ 'set program title hwnd%& = FindWindowA(0, title$ + {{Cl|CHR$}}(0)) 'find this program's process handle @@ -65,7 +65,7 @@ hwnd%& = FindWindowA(0, title$ + {{Cl|CHR$}}(0)) 'find this program's proces {{Cl|_SCREENMOVE}} {{Cl|_SCREENMOVE|_MIDDLE}} {{Cl|COLOR}} 10: {{Cl|PRINT}} -{{Cl|PRINT}} " Press Ctrl+Shift to see clipboard menu." +{{Cl|PRINT}} " Press Ctrl+Shift to see clipboard menu." {{Cl|_DELAY}} 4 x& = ShowWindow&(hwnd%&, 2) 'minimize @@ -76,12 +76,12 @@ x& = ShowWindow&(hwnd%&, 2) 'minimize FGwin%& = GetForegroundWindow%& 'get current process in focus y& = ShowWindow&(hwnd%&, 1) 'maximize minimized program - {{Cl|IF...THEN|IF}} FGwin%& <> hwnd%& {{Cl|THEN}} z& = SetForegroundWindow&(hwnd%&) 'set focus when necessary + {{Cl|IF...THEN|IF}} FGwin%& <> hwnd%& {{Cl|THEN}} z& = SetForegroundWindow&(hwnd%&) 'set focus when necessary {{Cl|_DELAY}} 1 GetKey x& = ShowWindow&(hwnd%&, 2) 'minimize after letter key entry {{Cl|COLOR}} 10: {{Cl|PRINT}} - {{Cl|PRINT}} " Press Ctrl+Shift to see clipboard menu." + {{Cl|PRINT}} " Press Ctrl+Shift to see clipboard menu." {{Cl|END IF}} {{Cl|LOOP}} @@ -89,40 +89,40 @@ x& = ShowWindow&(hwnd%&, 2) 'minimize {{Cl|SUB}} GetKey {{Cl|CLS}} {{Cl|COLOR}} 12: {{Cl|PRINT}}: {{Cl|PRINT}} {{Cl|_CLIPBOARD$}} -{{Cl|DO...LOOP|DO}}: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = "" +{{Cl|DO...LOOP|DO}}: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = "" {{Cl|_DELAY}} 1 {{Cl|CLS}} -{{Cl|COLOR}} 11: {{Cl|PRINT}} "Select a letter clipboard option:" +{{Cl|COLOR}} 11: {{Cl|PRINT}} "Select a letter clipboard option:" {{Cl|PRINT}} -{{Cl|PRINT}} "A = Address" -{{Cl|PRINT}} "C = Cell phone" -{{Cl|PRINT}} "E = Email" -{{Cl|PRINT}} "F = First Name" -{{Cl|PRINT}} "H = Home phone" -{{Cl|PRINT}} "L = Last Name" -{{Cl|PRINT}} "N = Name" -{{Cl|PRINT}} "M = MAC address" -{{Cl|PRINT}} "P = Password" -{{Cl|PRINT}} "W = Work name" -{{Cl|PRINT}} "X = QUIT!" -{{Cl|PRINT}} "Z = Zip code" +{{Cl|PRINT}} "A = Address" +{{Cl|PRINT}} "C = Cell phone" +{{Cl|PRINT}} "E = Email" +{{Cl|PRINT}} "F = First Name" +{{Cl|PRINT}} "H = Home phone" +{{Cl|PRINT}} "L = Last Name" +{{Cl|PRINT}} "N = Name" +{{Cl|PRINT}} "M = MAC address" +{{Cl|PRINT}} "P = Password" +{{Cl|PRINT}} "W = Work name" +{{Cl|PRINT}} "X = QUIT!" +{{Cl|PRINT}} "Z = Zip code" {{Cl|COLOR}} 14: {{Cl|PRINT}} -{{Cl|PRINT}} "Another letter will skip or X = {{Cl|EXIT}}!" +{{Cl|PRINT}} "Another letter will skip or X = {{Cl|EXIT}}!" K$ = {{Cl|UCASE$}}({{Cl|INPUT$}}(1)) {{Cl|SELECT CASE}} K$ 'The following text should be your personal user info: - {{Cl|CASE}} "A": {{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "my address" - {{Cl|CASE}} "C": {{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "cell number" - {{Cl|CASE}} "E": {{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "myemail" - {{Cl|CASE}} "F": {{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "formal name" - {{Cl|CASE}} "H": {{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "home number" - {{Cl|CASE}} "L": {{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "lastname" - {{Cl|CASE}} "M": {{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "modempassword" - {{Cl|CASE}} "N": {{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "name" - {{Cl|CASE}} "P": {{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "password" - {{Cl|CASE}} "X": {{Cl|END}} - {{Cl|CASE}} "Z": {{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "zipcode" + {{Cl|CASE}} "A": {{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "my address" + {{Cl|CASE}} "C": {{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "cell number" + {{Cl|CASE}} "E": {{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "myemail" + {{Cl|CASE}} "F": {{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "formal name" + {{Cl|CASE}} "H": {{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "home number" + {{Cl|CASE}} "L": {{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "lastname" + {{Cl|CASE}} "M": {{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "modempassword" + {{Cl|CASE}} "N": {{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "name" + {{Cl|CASE}} "P": {{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "password" + {{Cl|CASE}} "X": {{Cl|END}} + {{Cl|CASE}} "Z": {{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "zipcode" {{Cl|END SELECT}} {{Cl|CLS}} {{Cl|PRINT}} @@ -140,4 +140,4 @@ K$ = {{Cl|UCASE$}}({{Cl|INPUT$}}(1)) * [[_CLIPBOARDIMAGE (function)]], [[_CLIPBOARDIMAGE]] (statement) -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_CLIPBOARD$_(statement).txt b/internal/help/_CLIPBOARD$_(statement).txt index 3d294c5c4..7536caef5 100644 --- a/internal/help/_CLIPBOARD$_(statement).txt +++ b/internal/help/_CLIPBOARD$_(statement).txt @@ -22,7 +22,7 @@ The [[_CLIPBOARD$ (statement)|_CLIPBOARD$]] statement copies the [[STRING]] valu {{Cl|DIM}} CrLf AS {{Cl|STRING}} * 2 'define as 2 byte STRING CrLf = {{Cl|CHR$}}(13) + {{Cl|CHR$}}(10) 'carriage return & line feed -{{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "This is line 1" + CrLf + "This is line 2" +{{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "This is line 1" + CrLf + "This is line 2" {{Cl|PRINT}} {{Cl|_CLIPBOARD$}} 'display what is in the clipboard '' '' {{CodeEnd}} @@ -40,4 +40,4 @@ This is line 2 -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_COMMANDCOUNT.txt b/internal/help/_COMMANDCOUNT.txt index 69f68875c..52724c44d 100644 --- a/internal/help/_COMMANDCOUNT.txt +++ b/internal/help/_COMMANDCOUNT.txt @@ -19,7 +19,7 @@ The [[_COMMANDCOUNT]] function returns the number or arguments passed from the c {{Cl|PRINT}} {{Cl|COMMAND$}}(i) {{Cl|NEXT}} {{CodeEnd}} -: ''Explanation:'' If we start ''ThisProgram.exe'' from the command window with '''ThisProgram -l "loadfile.txt" -s "savefile.txt"''', the _COMMANDCOUNT would be 4, "-l", "loadfile.txt", "-s", "savefile.txt" command arguments passed to the program, which we could then read separately with COMMAND$(n). +: ''Explanation:'' If we start ''ThisProgram.exe'' from the command window with '''ThisProgram -l "loadfile.txt" -s "savefile.txt"''', the _COMMANDCOUNT would be 4, "-l", "loadfile.txt", "-s", "savefile.txt" command arguments passed to the program, which we could then read separately with COMMAND$(n). {{PageSeeAlso}} @@ -27,4 +27,4 @@ The [[_COMMANDCOUNT]] function returns the number or arguments passed from the c * [[SHELL]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_CONNECTED.txt b/internal/help/_CONNECTED.txt index cf87cebcb..a9e476afb 100644 --- a/internal/help/_CONNECTED.txt +++ b/internal/help/_CONNECTED.txt @@ -10,7 +10,7 @@ The [[_CONNECTED]] function returns the status of a TCP/IP connection handle. * The handle can come from the [[_OPENHOST]], [[OPENCLIENT]] or [[_OPENCONNECTION]] QB64 TCP/IP functions. * 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. +* 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 #]]. * Even if this function indicates the handle is not connected, it is important to [[CLOSE]] the connection anyway or important resources cannot be reallocated. @@ -21,7 +21,7 @@ The [[_CONNECTED]] function returns the status of a TCP/IP connection handle. {{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|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 @@ -47,4 +47,4 @@ numclients = n: n = 0 '' '' * [[Downloading Files]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_CONNECTIONADDRESS$.txt b/internal/help/_CONNECTIONADDRESS$.txt index fe992b270..b42dc7f5d 100644 --- a/internal/help/_CONNECTIONADDRESS$.txt +++ b/internal/help/_CONNECTIONADDRESS$.txt @@ -1 +1 @@ -#REDIRECT [[_CONNECTIONADDRESS]] \ No newline at end of file +#REDIRECT [[_CONNECTIONADDRESS]] diff --git a/internal/help/_CONSOLE.txt b/internal/help/_CONSOLE.txt index 9be578320..000ac9b09 100644 --- a/internal/help/_CONSOLE.txt +++ b/internal/help/_CONSOLE.txt @@ -26,7 +26,7 @@ The [[_CONSOLE]] statement can be used to turn a console window ON/OFF. {{Cl|_CONSOLE}} ON 'place console above program window {{Cl|_DEST}} {{Cl|_CONSOLE}} -{{Cl|INPUT}} "Enter your name: ", nme$ 'get program input +{{Cl|INPUT}} "Enter your name: ", nme$ 'get program input {{Cl|_CONSOLE}} OFF 'close console {{Cl|_DEST}} 0 'destination program window @@ -40,14 +40,14 @@ The [[_CONSOLE]] statement can be used to turn a console window ON/OFF. {{CodeStart}} '' '' {{Cl|$CONSOLE}} -{{Cl|_CONSOLETITLE}} "firstone" +{{Cl|_CONSOLETITLE}} "firstone" {{Cl|_DELAY}} 10 {{Cl|_CONSOLE}} OFF {{Cl|_DELAY}} 10 {{Cl|_CONSOLE}} ON -{{Cl|_CONSOLETITLE}} "secondone" +{{Cl|_CONSOLETITLE}} "secondone" {{CodeEnd}} : ''Note:'' Some versions of Windows may display the program path or Administrator: prefix in console title bars. @@ -59,4 +59,4 @@ The [[_CONSOLE]] statement can be used to turn a console window ON/OFF. * [[_DEST]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_CONSOLETITLE.txt b/internal/help/_CONSOLETITLE.txt index 75b1914a8..8477798d5 100644 --- a/internal/help/_CONSOLETITLE.txt +++ b/internal/help/_CONSOLETITLE.txt @@ -16,14 +16,14 @@ The [[_CONSOLETITLE]] statement creates the title of the console window using a {{Cl|$SCREENHIDE}} {{Cl|_DELAY}} 4 {{Cl|$CONSOLE}} -{{Cl|_CONSOLETITLE}} "Error Log" +{{Cl|_CONSOLETITLE}} "Error Log" {{Cl|_DEST}} {{Cl|_CONSOLE}} -{{Cl|PRINT}} "Errors go here! (fyi, this line is not an error)" +{{Cl|PRINT}} "Errors go here! (fyi, this line is not an error)" {{Cl|END}} {{CodeEnd}} -:''Note:'' You can also use [[SHELL]] "title consoletitle" to set the title of the console window. However, '''the recommended practice is to use [[_CONSOLETITLE]]'''. +:''Note:'' You can also use [[SHELL]] "title consoletitle" to set the title of the console window. However, '''the recommended practice is to use [[_CONSOLETITLE]]'''. ''See also:'' @@ -32,4 +32,4 @@ The [[_CONSOLETITLE]] statement creates the title of the console window using a * [[_SCREENHIDE]], [[_SCREENSHOW]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_CONTROLCHR.txt b/internal/help/_CONTROLCHR.txt index c32c7eea9..5e3244b61 100644 --- a/internal/help/_CONTROLCHR.txt +++ b/internal/help/_CONTROLCHR.txt @@ -46,4 +46,4 @@ DO * [[ASCII#Control_Characters|Control Characters]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_CONTROLCHR_(function).txt b/internal/help/_CONTROLCHR_(function).txt index d1e5680ef..b62861509 100644 --- a/internal/help/_CONTROLCHR_(function).txt +++ b/internal/help/_CONTROLCHR_(function).txt @@ -21,4 +21,4 @@ The [[_CONTROLCHR (function)|_CONTROLCHR]] function returns the current state of -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_COPYIMAGE.txt b/internal/help/_COPYIMAGE.txt index 2ad5a7bea..f486faee3 100644 --- a/internal/help/_COPYIMAGE.txt +++ b/internal/help/_COPYIMAGE.txt @@ -31,7 +31,7 @@ The [[_COPYIMAGE]] function creates an identical designated image in memory with {{Cl|SCREEN}} 13 {{Cl|CIRCLE}} (160, 100), 100, 40 -DO: {{Cl|SLEEP}}: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" +DO: {{Cl|SLEEP}}: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" 'backup screen before changing {{Cl|SCREEN}} mode oldmode& = {{Cl|_COPYIMAGE}}(0) 'the 0 value designates the current destination {{Cl|SCREEN}} @@ -39,7 +39,7 @@ oldmode& = {{Cl|_COPYIMAGE}}(0) 'the 0 value designates the current destina s& = {{Cl|_NEWIMAGE}}(800, 600, 32) {{Cl|SCREEN}} s& {{Cl|LINE}} (100, 100)-(500, 500), {{Cl|_RGB}}(0, 255, 255), BF -DO: {{Cl|SLEEP}}: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" +DO: {{Cl|SLEEP}}: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" {{Cl|SCREEN}} oldmode& 'restore original screen {{Cl|IF...THEN|IF}} s& < -1 THEN {{Cl|_FREEIMAGE}} s& @@ -55,10 +55,10 @@ my_hardware_handle = {{Cl|_COPYIMAGE}}({{Cl|_SCREENIMAGE}}, 33) 'take a screensh {{Cl|_MAPTRIANGLE}} (0, 0)-(500, 0)-(250, 500), my_hardware_handle TO_ (-1, 0, -1)-(1, 0, -1)-(0, 5, -10), , _SMOOTH {{Cl|_DISPLAY}} -{{Cl|DO...LOOP|DO}}: {{Cl|_LIMIT}} 30: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" '' '' +{{Cl|DO...LOOP|DO}}: {{Cl|_LIMIT}} 30: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" '' '' {{CodeEnd}}{{small|Code courtesy of Galleon}} -<center>[http://www.qb64.net/forum/index.php?action=dlattach;topic=12049.0;attach=2595 Example 2 PNG image]</center> +<center>[http://www.qb64.net/forum/index.php?action=dlattach;topic=12049.0;attach=2595 Example 2 PNG image]</center> {{PageSeeAlso}} @@ -71,4 +71,4 @@ my_hardware_handle = {{Cl|_COPYIMAGE}}({{Cl|_SCREENIMAGE}}, 33) 'take a screensh * [[Hardware images]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_COPYPALETTE.txt b/internal/help/_COPYPALETTE.txt index c4e436d15..1087d045e 100644 --- a/internal/help/_COPYPALETTE.txt +++ b/internal/help/_COPYPALETTE.txt @@ -27,4 +27,4 @@ The [[_COPYPALETTE]] statement copies the color palette intensities from one 4 o * [[PALETTE]], [[Images]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_CV.txt b/internal/help/_CV.txt index fd8424d11..e259f9f8a 100644 --- a/internal/help/_CV.txt +++ b/internal/help/_CV.txt @@ -26,11 +26,11 @@ The [[_CV]] function is used to convert [[_MK$]], [[ASCII]], [[STRING]] values t i64 = 2 ^ 61 i64str = {{Cl|_MK$}}({{Cl|_INTEGER64}}, i64) -{{Cl|PRINT}} "I64:"; i64 -{{Cl|PRINT}} "_MK$: "; i64str +{{Cl|PRINT}} "I64:"; i64 +{{Cl|PRINT}} "_MK$: "; i64str i64 = {{Cl|_CV}}({{Cl|_INTEGER64}}, i64str) -{{Cl|PRINT}} "_CV:"; i64 '' '' +{{Cl|PRINT}} "_CV:"; i64 '' '' {{CodeEnd}} {{OutputStart}} I64: 2305843009213693952 @@ -52,4 +52,4 @@ _CV: 2305843009213693952 * [[_CONTROLCHR]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_CWD$.txt b/internal/help/_CWD$.txt index 9f2ba2a74..51bce1307 100644 --- a/internal/help/_CWD$.txt +++ b/internal/help/_CWD$.txt @@ -23,13 +23,13 @@ The [[_CWD$]] function returns the current working directory path as a string va ''Example:'' Get the current working directory, and move around the file system: {{CodeStart}} '' '' startdir$ = _CWD$ -{{Cl|PRINT}} "We started at "; startdir$ -{{Cl|MKDIR}} "a_temporary_dir" -{{Cl|CHDIR}} "a_temporary_dir" -{{Cl|PRINT}} "We are now in "; _CWD$ +{{Cl|PRINT}} "We started at "; startdir$ +{{Cl|MKDIR}} "a_temporary_dir" +{{Cl|CHDIR}} "a_temporary_dir" +{{Cl|PRINT}} "We are now in "; _CWD$ {{Cl|CHDIR}} startdir$ -{{Cl|PRINT}} "And now we're back in "; _CWD$ -{{Cl|RMDIR}} "a_temporary_dir" +{{Cl|PRINT}} "And now we're back in "; _CWD$ +{{Cl|RMDIR}} "a_temporary_dir" {{CodeEnd}} {{OutputStart}}We started at C:\QB64 @@ -47,4 +47,4 @@ And now we're back in C:\QB64 * [[_STARTDIR$]] {{text|(returns path the user called program from)}} -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_D2G.txt b/internal/help/_D2G.txt index e91ed45a9..79b6e41a0 100644 --- a/internal/help/_D2G.txt +++ b/internal/help/_D2G.txt @@ -13,9 +13,9 @@ The [[_D2G]] function converts a '''degree''' value into a '''gradient''' value. {{PageExamples}} ''Example:'' Coverting Degrees into Gradient. {{CodeStart}} -INPUT "Give me an angle in Degrees ", D +INPUT "Give me an angle in Degrees ", D R = _D2G(D) -PRINT "That angle in Gradient is "; R +PRINT "That angle in Gradient is "; R {{CodeEnd}} {{OutputStart}} Give me an angle in Degrees 60 @@ -30,4 +30,4 @@ That angle in Gradient is 66.66666 -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_D2R.txt b/internal/help/_D2R.txt index 167d199d5..e24c68524 100644 --- a/internal/help/_D2R.txt +++ b/internal/help/_D2R.txt @@ -13,9 +13,9 @@ The [[_D2R]] function converts a '''degree''' value into a '''radian''' value. {{PageExamples}} ''Example:'' Coverting Degrees into Radians. {{CodeStart}} -INPUT "Give me an angle in Degrees ", D +INPUT "Give me an angle in Degrees ", D R = _D2R(D) -PRINT "That angle in Radians is "; R +PRINT "That angle in Radians is "; R {{CodeEnd}} {{OutputStart}} Give me an angle in Degrees 60 @@ -30,4 +30,4 @@ That angle in Radians is 1.047198 -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_DEFAULTCOLOR.txt b/internal/help/_DEFAULTCOLOR.txt index 14af082c8..787d8d558 100644 --- a/internal/help/_DEFAULTCOLOR.txt +++ b/internal/help/_DEFAULTCOLOR.txt @@ -20,7 +20,7 @@ The [[_DEFAULTCOLOR]] function returns the current default text color for an ima {{Cl|OUT}} {{Cl|&H}}3C8, 8: {{Cl|OUT}} {{Cl|&H}}3C9, 0: {{Cl|OUT}} {{Cl|&H}}3C9, 0: {{Cl|OUT}} {{Cl|&H}}3C9, 0 'assign RGB intensities to COLOR 8 {{Cl|_PRINTMODE }} _KEEPBACKGROUND {{Cl|COLOR}} 8 'assign color 8 to text foreground -{{Cl|PRINT}} "The default color is attribute"; {{Cl|_DEFAULTCOLOR}} '' '' +{{Cl|PRINT}} "The default color is attribute"; {{Cl|_DEFAULTCOLOR}} '' '' {{CodeEnd}} @@ -31,4 +31,4 @@ The [[_DEFAULTCOLOR]] function returns the current default text color for an ima * [[Windows_Libraries#Color_Dialog_Box|Color Dialog Box]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_DEFINE.txt b/internal/help/_DEFINE.txt index 147ddcb88..550a23f93 100644 --- a/internal/help/_DEFINE.txt +++ b/internal/help/_DEFINE.txt @@ -16,7 +16,7 @@ * '''When a variable has not been defined or has no type suffix, the value defaults to a [[SINGLE]] precision floating point value.''' * _DEFINE sets the [[type]] of all variable names with the starting letter(s) or letter ranges when encountered in the progression of the program (even in conditional statement blocks not executed and subsequent [[SUB]] procedures). * '''NOTE: Many Qbasic keyword variable names CAN be used with a [[STRING]] suffix ($)! You cannot use them without the suffix, use a numerical suffix or use [[DIM]], [[REDIM]], [[_DEFINE]], [[BYVAL]] or [[TYPE]] variable [[AS]] statements.''' -* '''Qbasic's IDE''' added 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. +* '''Qbasic's IDE''' added 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. @@ -45,4 +45,4 @@ Add2 = one + two * [[_UNSIGNED]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_DELAY.txt b/internal/help/_DELAY.txt index 324eb24c2..112b18137 100644 --- a/internal/help/_DELAY.txt +++ b/internal/help/_DELAY.txt @@ -18,4 +18,4 @@ The [[_DELAY]] statement suspends program execution for a [[SINGLE]] value of se * [[ON TIMER(n)]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_DEPTHBUFFER.txt b/internal/help/_DEPTHBUFFER.txt index 277cfb81c..476f8f627 100644 --- a/internal/help/_DEPTHBUFFER.txt +++ b/internal/help/_DEPTHBUFFER.txt @@ -24,4 +24,4 @@ The [[_DEPTHBUFFER]] statement turns depth buffering ON or OFF, LOCKs or _CLEARS * [[_DISPLAY]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_DESKTOPHEIGHT.txt b/internal/help/_DESKTOPHEIGHT.txt index 6d5419fd4..ac35ef595 100644 --- a/internal/help/_DESKTOPHEIGHT.txt +++ b/internal/help/_DESKTOPHEIGHT.txt @@ -34,4 +34,4 @@ The [[_DESKTOPHEIGHT]] function returns the height of the users current desktop. -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_DESKTOPWIDTH.txt b/internal/help/_DESKTOPWIDTH.txt index c25728bb4..a7fc6d2a1 100644 --- a/internal/help/_DESKTOPWIDTH.txt +++ b/internal/help/_DESKTOPWIDTH.txt @@ -34,4 +34,4 @@ The [[_DESKTOPWIDTH]] function returns the width of the users current desktop. -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_DEST.txt b/internal/help/_DEST.txt index fe4d4dbfd..0502cc349 100644 --- a/internal/help/_DEST.txt +++ b/internal/help/_DEST.txt @@ -50,19 +50,19 @@ xm = 4 ym = 4 {{Cl|REM}} Some fun things for the bouncing text. -st$(0) = "doo" -st$(1) = "rey" -st$(2) = "mee" -st$(3) = "faa" -st$(4) = "soo" -st$(5) = "laa" -st$(6) = "tee" +st$(0) = "doo" +st$(1) = "rey" +st$(2) = "mee" +st$(3) = "faa" +st$(4) = "soo" +st$(5) = "laa" +st$(6) = "tee" -sta$(0) = "This is a demo" -sta$(1) = "showing how to use" -sta$(2) = "the _DEST command" -sta$(3) = "with PRINT" -sta$(4) = "and _PUTIMAGE" +sta$(0) = "This is a demo" +sta$(1) = "showing how to use" +sta$(2) = "the _DEST command" +sta$(3) = "with PRINT" +sta$(4) = "and _PUTIMAGE" {{Cl|REM}} prints to a(3) image then switches back to the default 0 {{Cl|_DEST}} a(3): f = {{Cl|INT}}({{Cl|RND}} * 6): {{Cl|PRINT}} st$(3): {{Cl|_DEST}} 0 @@ -89,12 +89,12 @@ DO r = r + 1 {{Cl|IF...THEN|IF}} r = 4 {{Cl|THEN}} r = 0 -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" {{Cl|END}} bounce: -{{Cl|IF...THEN|IF}} xa > 600 {{Cl|OR (boolean)|OR}} xa < 20 {{Cl|THEN}} xm = xm * -1: {{Cl|_DEST}} a(3): f = {{Cl|INT}}({{Cl|RND}} * 6): {{Cl|CLS}}: {{Cl|_CLEARCOLOR}} 0: {{Cl|PRINT}} st$(f): {{Cl|_DEST}} 0 -{{Cl|IF...THEN|IF}} ya > 400 {{Cl|OR (boolean)|OR}} ya < 20 {{Cl|THEN}} ym = ym * -1: {{Cl|_DEST}} a(3): f = {{Cl|INT}}({{Cl|RND}} * 7): {{Cl|CLS}}: {{Cl|_CLEARCOLOR}} 0: {{Cl|PRINT}} st$(f): {{Cl|_DEST}} 0 +{{Cl|IF...THEN|IF}} xa > 600 {{Cl|OR (boolean)|OR}} xa < 20 {{Cl|THEN}} xm = xm * -1: {{Cl|_DEST}} a(3): f = {{Cl|INT}}({{Cl|RND}} * 6): {{Cl|CLS}}: {{Cl|_CLEARCOLOR}} 0: {{Cl|PRINT}} st$(f): {{Cl|_DEST}} 0 +{{Cl|IF...THEN|IF}} ya > 400 {{Cl|OR (boolean)|OR}} ya < 20 {{Cl|THEN}} ym = ym * -1: {{Cl|_DEST}} a(3): f = {{Cl|INT}}({{Cl|RND}} * 7): {{Cl|CLS}}: {{Cl|_CLEARCOLOR}} 0: {{Cl|PRINT}} st$(f): {{Cl|_DEST}} 0 {{Cl|_PUTIMAGE}} (xa, ya)-(xa + 150, ya + 80), a(3) xa = xa + xm ya = ya + ym @@ -110,4 +110,4 @@ ya = ya + ym * [[_CONSOLE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_DEST_(function).txt b/internal/help/_DEST_(function).txt index 951fe2386..949b19ce9 100644 --- a/internal/help/_DEST_(function).txt +++ b/internal/help/_DEST_(function).txt @@ -19,4 +19,4 @@ The [[_DEST]] function returns the handle value of the current write page (the i * [[SCREEN]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_DEVICE$.txt b/internal/help/_DEVICE$.txt index 781cba631..1ccb931cc 100644 --- a/internal/help/_DEVICE$.txt +++ b/internal/help/_DEVICE$.txt @@ -27,10 +27,10 @@ The '''_DEVICE$''' function returns a [[STRING]] value holding the controller ty ''Example 1:'' Checking for the system's input devices and the number of buttons available. {{CodeStart}} '' '' devices = {{Cl|_DEVICES}} 'MUST be read in order for other 2 device functions to work! -PRINT "Number of input devices found ="; devices +PRINT "Number of input devices found ="; devices FOR i = 1 TO devices PRINT {{Cl|_DEVICE$}}(i) - PRINT "Buttons:"; {{Cl|_LASTBUTTON}}(i); "Axis:"; {{Cl|_LASTAXIS}}(i); "Wheels:"; {{Cl|_LASTWHEEL}}(i) + PRINT "Buttons:"; {{Cl|_LASTBUTTON}}(i); "Axis:"; {{Cl|_LASTAXIS}}(i); "Wheels:"; {{Cl|_LASTWHEEL}}(i) NEXT '' '' {{CodeEnd}} {{OutputStart}}Number of input devices found = 3 @@ -48,9 +48,9 @@ Buttons: 9 Axis: 6 Wheels: 0 {{CodeStart}} '' '' {{Cl|FOR...NEXT|FOR}} d = 1 {{Cl|TO}} {{Cl|_DEVICES}} 'number of input devices found dev$ = {{Cl|_DEVICE$}}(d) - {{Cl|IF...THEN|IF}} {{Cl|INSTR}}(dev$, "[MOUSE]") {{Cl|THEN}} buttons = {{Cl|_LASTBUTTON}}(d): {{Cl|EXIT}} {{Cl|FOR...NEXT|FOR}} + {{Cl|IF...THEN|IF}} {{Cl|INSTR}}(dev$, "[MOUSE]") {{Cl|THEN}} buttons = {{Cl|_LASTBUTTON}}(d): {{Cl|EXIT}} {{Cl|FOR...NEXT|FOR}} {{Cl|NEXT}} -{{Cl|PRINT}} buttons; "mouse buttons available" '' '' +{{Cl|PRINT}} buttons; "mouse buttons available" '' '' {{CodeEnd}} @@ -65,4 +65,4 @@ Buttons: 9 Axis: 6 Wheels: 0 * [[Controller Devices]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_DEVICEINPUT.txt b/internal/help/_DEVICEINPUT.txt index 545367d9f..3e017e00c 100644 --- a/internal/help/_DEVICEINPUT.txt +++ b/internal/help/_DEVICEINPUT.txt @@ -26,14 +26,14 @@ The '''_DEVICEINPUT''' function returns the device number when a controller devi ''Example 1:'' Checking device controller interfaces and finding out what devices are being used. {{CodeStart}} '' '' {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} {{Cl|_DEVICES}} - {{Cl|PRINT}} {{Cl|STR$}}(i) + ") " + {{Cl|_DEVICE$}}(i) - {{Cl|PRINT}} "Button:"; {{Cl|_LASTBUTTON}}(i); ",Axis:"; {{Cl|_LASTAXIS}}(i); ",Wheel:"; {{Cl|_LASTWHEEL}}(i) + {{Cl|PRINT}} {{Cl|STR$}}(i) + ") " + {{Cl|_DEVICE$}}(i) + {{Cl|PRINT}} "Button:"; {{Cl|_LASTBUTTON}}(i); ",Axis:"; {{Cl|_LASTAXIS}}(i); ",Wheel:"; {{Cl|_LASTWHEEL}}(i) {{Cl|NEXT}} {{Cl|PRINT}} DO x = {{Cl|_DEVICEINPUT}} - {{Cl|IF...THEN|IF}} x {{Cl|THEN}} {{Cl|PRINT}} "Device ="; x; + {{Cl|IF...THEN|IF}} x {{Cl|THEN}} {{Cl|PRINT}} "Device ="; x; {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) 'escape key exit {{Cl|END}} '' '' @@ -54,7 +54,7 @@ Device = 2 Device = 2 {{CodeStart}} '' '' ignore = {{Cl|_MOUSEMOVEMENTX}} 'dummy call to put mouse into relative movement mode -{{Cl|PRINT}} "Move your mouse and/or your mouse wheel (ESC to exit)" +{{Cl|PRINT}} "Move your mouse and/or your mouse wheel (ESC to exit)" d = {{Cl|_DEVICES}} ' always read number of devices to enable device input DO: {{Cl|_LIMIT}} 30 'main loop @@ -69,7 +69,7 @@ DO: {{Cl|_LIMIT}} 30 'main loop ''Example 3:'' Using [[ON...GOSUB]] with the [[_DEVICEINPUT]] number to add keyboard, mouse and game controller event procedures. {{CodeStart}} '' '' n = {{Cl|_DEVICES}} 'required when reading devices -{{Cl|PRINT}} "Number of devices found ="; n +{{Cl|PRINT}} "Number of devices found ="; n {{Cl|FOR...NEXT|FOR}} i = 1 TO n PRINT i; _DEVICE$(i) ' 1 = keyboard, 2 = mouse, 3 = other controller, etc. {{Cl|NEXT}} @@ -81,15 +81,15 @@ n = {{Cl|_DEVICES}} 'required when reading devices {{Cl|END}} keyboard: -{{Cl|PRINT}} device; "Keyboard"; +{{Cl|PRINT}} device; "Keyboard"; {{Cl|RETURN}} mouse: -{{Cl|PRINT}} device; "Mouse "; +{{Cl|PRINT}} device; "Mouse "; {{Cl|RETURN}} controller: -{{Cl|PRINT}} device; "Game control "; +{{Cl|PRINT}} device; "Game control "; {{Cl|RETURN}} '' '' {{CodeEnd}} {{small|Code by Ted Weissgerber}} @@ -105,4 +105,4 @@ controller: * [[Controller Devices]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_DEVICES.txt b/internal/help/_DEVICES.txt index 2b748d0a4..63b5ab05e 100644 --- a/internal/help/_DEVICES.txt +++ b/internal/help/_DEVICES.txt @@ -16,10 +16,10 @@ The [[_DEVICES]] function returns the number of INPUT devices on your computer i ''Example:'' Checking for the system's input devices. {{CodeStart}} '' '' devices = {{Cl|_DEVICES}} 'MUST be read in order for other 2 device functions to work! -PRINT "Number of input devices found ="; devices +PRINT "Number of input devices found ="; devices FOR i = 1 TO devices PRINT {{Cl|_DEVICE$}}(i) - PRINT "Buttons:"; {{Cl|_LASTBUTTON}}(i) + PRINT "Buttons:"; {{Cl|_LASTBUTTON}}(i) NEXT '' '' {{CodeEnd}} {{OutputStart}}Number of input devices found = 2 @@ -42,4 +42,4 @@ Buttons: 3 * [[Controller Devices]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_DIREXISTS.txt b/internal/help/_DIREXISTS.txt index f8ead5769..a977a5b4d 100644 --- a/internal/help/_DIREXISTS.txt +++ b/internal/help/_DIREXISTS.txt @@ -18,8 +18,8 @@ The [[_DIREXISTS]] function determines if a designated file path or folder exist {{PageExamples}} {{Parameter|Example:'' Checks if a folder exists before proceeding. {{CodeStart}} -{{Cl|IF}} {{Cl|_DIREXISTS}}("internal\temp") THEN - {{Cl|PRINT}} "Folder found." +{{Cl|IF}} {{Cl|_DIREXISTS}}("internal\temp") THEN + {{Cl|PRINT}} "Folder found." {{Cl|END IF}} {{CodeEnd}}}} @@ -30,4 +30,4 @@ The [[_DIREXISTS]] function determines if a designated file path or folder exist * [[_OS$]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_DISPLAY.txt b/internal/help/_DISPLAY.txt index 09f288cd9..46da5483d 100644 --- a/internal/help/_DISPLAY.txt +++ b/internal/help/_DISPLAY.txt @@ -24,9 +24,9 @@ dx = 3: dy = 3 'number of pixel moves per loop {{Cl|DO}} {{Cl|_LIMIT}} 100 ' set to 100 frames per second x = x + dx: y = y + dy - {{Cl|IF...THEN|IF}} x < 0 {{Cl|OR}} x > 640 {{Cl|THEN}} dx = -dx 'limit columns and reverse column direction each side - {{Cl|IF...THEN|IF}} y < 0 {{Cl|OR}} y > 480 {{Cl|THEN}} dy = -dy 'limit rows and reverse row direction top or bottom - IF px <> x OR py <> y THEN FOR d = 1 to 20: CIRCLE (px, py), d, 0: NEXT 'erase + {{Cl|IF...THEN|IF}} x < 0 {{Cl|OR}} x > 640 {{Cl|THEN}} dx = -dx 'limit columns and reverse column direction each side + {{Cl|IF...THEN|IF}} y < 0 {{Cl|OR}} y > 480 {{Cl|THEN}} dy = -dy 'limit rows and reverse row direction top or bottom + IF px <> x OR py <> y THEN FOR d = 1 to 20: CIRCLE (px, py), d, 0: NEXT 'erase FOR c = 1 TO 20: {{Cl|CIRCLE}} (x, y), c, 6: NEXT 'draw new circle at new position px = x: py = y 'save older coordinates to erase older circle next loop {{Cl|_DISPLAY}} 'after new circle is set, show it @@ -48,7 +48,7 @@ DO {{Cl|_LIMIT}} 30 DisplayMenu k = {{Cl|_KEYHIT}} - {{Cl|IF...THEN|IF}} k <> 0 {{Cl|THEN}} {{Cl|PRINT}} k, + {{Cl|IF...THEN|IF}} k <> 0 {{Cl|THEN}} {{Cl|PRINT}} k, {{Cl|LOOP}} {{Cl|UNTIL}} k = 32 {{Cl|OR (boolean)|OR}} k = 27 @@ -59,7 +59,7 @@ DO MS = {{Cl|_NEWIMAGE}}(640, MenuHeight, 32) 'MenuScreen image D = {{Cl|_DEST}}: {{Cl|_DEST}} MS {{Cl|CLS}} , {{Cl|&H}}FFAAAAAA 'background color gray - {{Cl|_PRINTSTRING}} (20, 2), "Menu Test" 'image text + {{Cl|_PRINTSTRING}} (20, 2), "Menu Test" 'image text MS_HW = {{Cl|_COPYIMAGE}}(MS, 33) 'create the MenuScreen_HardWare image {{Cl|_FREEIMAGE}} MS {{Cl|_DEST}} D @@ -79,4 +79,4 @@ DO * [[PCOPY]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_DISPLAYORDER.txt b/internal/help/_DISPLAYORDER.txt index aad5b1933..45841635d 100644 --- a/internal/help/_DISPLAYORDER.txt +++ b/internal/help/_DISPLAYORDER.txt @@ -37,4 +37,4 @@ The [[_DISPLAYORDER]] statement defines the order to render software, hardware a * [[Hardware images]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_DISPLAY_(function).txt b/internal/help/_DISPLAY_(function).txt index 513cb94f9..03e919336 100644 --- a/internal/help/_DISPLAY_(function).txt +++ b/internal/help/_DISPLAY_(function).txt @@ -17,7 +17,7 @@ The [[_DISPLAY]] function returns the handle of the current image that is displa {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, 32) 'any graphics mode should work without setting up pages {{Cl|_MOUSEHIDE}} SetupCursor -{{Cl|PRINT}} "Hello World!" +{{Cl|PRINT}} "Hello World!" {{Cl|DO}}: {{Cl|_LIMIT}} 30 {{Cl|DO}} {{Cl|WHILE}} {{Cl|_MOUSEINPUT}}: {{Cl|LOOP}} 'main loop must contain _MOUSEINPUT ' other program code @@ -31,7 +31,7 @@ SetupCursor {{Cl|SUB}} UpdateCursor {{Cl|PCOPY}} {{Cl|_DISPLAY (function)|_DISPLAY}}, 100 'any page number as desination with the _DISPLAY function as source {{Cl|PSET}} ({{Cl|_MOUSEX}}, {{Cl|_MOUSEY}}), {{Cl|_RGB}}(0, 255, 0) -{{Cl|DRAW}} "ND10F10L3F5L4H5L3" +{{Cl|DRAW}} "ND10F10L3F5L4H5L3" {{Cl|_DISPLAY}} 'statement shows image {{Cl|PCOPY}} 100, {{Cl|_DISPLAY (function)|_DISPLAY}} 'with the function return as destination page {{Cl|END SUB}} '' '' @@ -47,4 +47,4 @@ SetupCursor * [[_DISPLAYORDER]] {{text|(statement)}} -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_DONTBLEND.txt b/internal/help/_DONTBLEND.txt index 4f79a2257..f025fdca2 100644 --- a/internal/help/_DONTBLEND.txt +++ b/internal/help/_DONTBLEND.txt @@ -28,9 +28,9 @@ The [[_DONTBLEND]] statement turns off 32 bit alpha blending for the current ima b& = SaveBackground& -{{Cl|PRINT}} "This is just test junk" +{{Cl|PRINT}} "This is just test junk" {{Cl|PRINT}} -{{Cl|PRINT}} "Hit any key and the text should disappear, leaving us our pretty yellow box." +{{Cl|PRINT}} "Hit any key and the text should disappear, leaving us our pretty yellow box." {{Cl|SLEEP}} RestoreBackground b& @@ -98,4 +98,4 @@ ph = 0 * [[Images]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_DONTWAIT.txt b/internal/help/_DONTWAIT.txt index 08d51a18a..5c4e1f1d2 100644 --- a/internal/help/_DONTWAIT.txt +++ b/internal/help/_DONTWAIT.txt @@ -16,7 +16,7 @@ {{PageExamples}} {{CodeStart}} -{{Cl|SHELL}} {{Cl|_DONTWAIT}} "notepad " + filename$ +{{Cl|SHELL}} {{Cl|_DONTWAIT}} "notepad " + filename$ {{Cl|FOR...NEXT|FOR}} x = 1 {{Cl|TO}} 5 {{Cl|_LIMIT}} 1 @@ -38,4 +38,4 @@ * [[SHELL]], [[_HIDE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_ERRORLINE.txt b/internal/help/_ERRORLINE.txt index 8bbb93697..cb51164ea 100644 --- a/internal/help/_ERRORLINE.txt +++ b/internal/help/_ERRORLINE.txt @@ -34,4 +34,4 @@ DebugLine: * [[ERROR Codes]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_EXIT_(function).txt b/internal/help/_EXIT_(function).txt index b2f865811..9a35a5178 100644 --- a/internal/help/_EXIT_(function).txt +++ b/internal/help/_EXIT_(function).txt @@ -25,22 +25,22 @@ The [[_EXIT]] function prevents the user from closing a program and indicates if q = {{Cl|_EXIT (function)|_EXIT}} 'function read prevents any program exit at start of program {{Cl|ON TIMER (n)|ON TIMER}}(5) {{Cl|GOSUB}} quit {{Cl|TIMER}} ON -{{Cl|PRINT}} " The Timer will check for exit request every 5 seconds." -{{Cl|PRINT}} "Click the X box and/or Ctrl - Break to see the {{Cl|_EXIT (function)|_EXIT}} return!" -{{Cl|PRINT}} " Any Key Quits" +{{Cl|PRINT}} " The Timer will check for exit request every 5 seconds." +{{Cl|PRINT}} "Click the X box and/or Ctrl - Break to see the {{Cl|_EXIT (function)|_EXIT}} return!" +{{Cl|PRINT}} " Any Key Quits" {{Cl|PRINT}} {{Cl|DO}}: {{Cl|_LIMIT}} 30 ' ' simulated program loop -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" {{Cl|END}} quit: q = {{Cl|_EXIT (function)|_EXIT}} {{Cl|IF}} q {{Cl|THEN}} {{Cl|PRINT}} q; {{Cl|SELECT CASE}} q - {{Cl|CASE}} 1: {{Cl|PRINT}} "= X button was clicked" - {{Cl|CASE}} 2: {{Cl|PRINT}} "= Ctrl + Break keypress" - {{Cl|CASE}} 3: {{Cl|PRINT}} "= Both X and Ctrl + Break!" + {{Cl|CASE}} 1: {{Cl|PRINT}} "= X button was clicked" + {{Cl|CASE}} 2: {{Cl|PRINT}} "= Ctrl + Break keypress" + {{Cl|CASE}} 3: {{Cl|PRINT}} "= Both X and Ctrl + Break!" {{Cl|END SELECT}} {{Cl|RETURN}} '' '' @@ -50,12 +50,12 @@ q = {{Cl|_EXIT (function)|_EXIT}} ''Example 2:'' Removing temporary files before closing a program upon a user's exit request. {{CodeStart}} '' '' x = {{Cl|_EXIT}} 'initial function call blocks a user exit -OPEN "t3mpdata.tmp" FOR APPEND AS #1 +OPEN "t3mpdata.tmp" FOR APPEND AS #1 DO -IF {{Cl|_EXIT}} THEN {{Cl|CLOSE}}: {{Cl|KILL}} "t3mpdata.tmp": {{Cl|_DELAY}} 1: {{Cl|SYSTEM}} '' '' +IF {{Cl|_EXIT}} THEN {{Cl|CLOSE}}: {{Cl|KILL}} "t3mpdata.tmp": {{Cl|_DELAY}} 1: {{Cl|SYSTEM}} '' '' LOOP '' '' {{CodeEnd}} -<center>{{text|Note: If you have a file named ''t3mpdata.tmp'' change the file name!|red}}</center> +<center>{{text|Note: If you have a file named ''t3mpdata.tmp'' change the file name!|red}}</center> {{PageSeeAlso}} @@ -64,4 +64,4 @@ LOOP '' '' * [[EXIT]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_FILEEXISTS.txt b/internal/help/_FILEEXISTS.txt index 183ec51ad..4f7340bcc 100644 --- a/internal/help/_FILEEXISTS.txt +++ b/internal/help/_FILEEXISTS.txt @@ -17,8 +17,8 @@ The '''_FILEEXISTS''' function determines if a designated file name exists and r {{PageExamples}} {{Parameter|Example:'' Checks if a file exists before opening it. {{CodeStart}} -{{Cl|IF}} {{Cl|_FILEEXISTS}}("mysettings.ini") THEN - {{Cl|PRINT}} "Settings file found." +{{Cl|IF}} {{Cl|_FILEEXISTS}}("mysettings.ini") THEN + {{Cl|PRINT}} "Settings file found." {{Cl|END IF}} {{CodeEnd}}}} @@ -29,4 +29,4 @@ The '''_FILEEXISTS''' function determines if a designated file name exists and r * [[KILL]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_FLOAT.txt b/internal/help/_FLOAT.txt index 789cd89eb..10e08c8f5 100644 --- a/internal/help/_FLOAT.txt +++ b/internal/help/_FLOAT.txt @@ -27,4 +27,4 @@ * [[Variable Types]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_FONT.txt b/internal/help/_FONT.txt index e97a416ec..3c6508570 100644 --- a/internal/help/_FONT.txt +++ b/internal/help/_FONT.txt @@ -20,7 +20,7 @@ The [[_FONT]] statement sets the current [[_LOADFONT]] function font handle to b * [[Unicode]] characters can be assigned to a monospace font that contains those unicode characters using the [[_MAPUNICODE]] TO [[ASCII]] mapping statement. The optional '''IME cyberbit.ttf''' font included with QB64 can also be used. * Can alpha blend a font with a background screen created by [[_NEWIMAGE]] in 32 bit color. * '''Check for valid handle values greater than 0 before using or freeing font handles.''' -* Free '''unused''' font handles with [[_FREEFONT]]. Freeing invalid handles will create an [[ERROR Codes|"illegal function call"]] error. +* Free '''unused''' font handles with [[_FREEFONT]]. Freeing invalid handles will create an [[ERROR Codes|"illegal function call"]] error. * '''NOTE: SCREEN 0 can only use one font type and style per viewed SCREEN page. Font size may also affect the window size.''' @@ -28,45 +28,45 @@ The [[_FONT]] statement sets the current [[_LOADFONT]] function font handle to b ''Example:'' Previewing a font in SCREEN 0. A different true type font can be substituted below. {{CodeStart}} -fontpath$ = {{Cl|ENVIRON$}}("SYSTEMROOT") + "\fonts\lucon.ttf" 'Find Windows Folder Path. +fontpath$ = {{Cl|ENVIRON$}}("SYSTEMROOT") + "\fonts\lucon.ttf" 'Find Windows Folder Path. {{Cl|DO}}: {{Cl|CLS}} {{Cl|DO}} - style$ = "MONOSPACE" + style$ = "MONOSPACE" {{Cl|PRINT}} - {{Cl|INPUT}} "Enter A FONT Size 8 {{Cl|TO}} 25: ", fontsize% - {{Cl|LOOP}} {{Cl|UNTIL}} fontsize% > 7 and fontsize% < 26 + {{Cl|INPUT}} "Enter A FONT Size 8 {{Cl|TO}} 25: ", fontsize% + {{Cl|LOOP}} {{Cl|UNTIL}} fontsize% > 7 and fontsize% < 26 {{Cl|DO}} {{Cl|PRINT}} - {{Cl|INPUT}} "Enter (0) for REGULAR {{Cl|OR}} (1) for ITALIC FONT: ", italic% + {{Cl|INPUT}} "Enter (0) for REGULAR {{Cl|OR}} (1) for ITALIC FONT: ", italic% {{Cl|LOOP}} {{Cl|UNTIL}} italic% = 0 or italic% = 1 {{Cl|DO}} {{Cl|PRINT}} - {{Cl|INPUT}} "Enter (0) for REGULAR {{Cl|OR}} (1) for BOLD FONT: ", bold% + {{Cl|INPUT}} "Enter (0) for REGULAR {{Cl|OR}} (1) for BOLD FONT: ", bold% {{Cl|LOOP}} {{Cl|UNTIL}} italic% = 0 or italic% = 1 - {{Cl|IF}} italic% = 1 {{Cl|THEN}} style$ = style$ + ", ITALIC" - {{Cl|IF}} bold% = 1 then style$ = style$ + ", BOLD" + {{Cl|IF}} italic% = 1 {{Cl|THEN}} style$ = style$ + ", ITALIC" + {{Cl|IF}} bold% = 1 then style$ = style$ + ", BOLD" {{Cl|GOSUB}} ClearFont font& = {{Cl|_LOADFONT}}(fontpath$, fontsize%, style$) {{Cl|_FONT|_FONT }}font& {{Cl|PRINT}} - {{Cl|PRINT}} "This is your LUCON font! Want to try another STYLE?(Y/N): "; - {{Cl|DO}}: {{Cl|SLEEP}}: K$ = {{Cl|UCASE$}}({{Cl|INKEY$}}): {{Cl|LOOP}} {{Cl|UNTIL}} K$ = "Y" {{Cl|OR}} K$ = "N" -{{Cl|LOOP}} {{Cl|UNTIL}} K$ = "N" + {{Cl|PRINT}} "This is your LUCON font! Want to try another STYLE?(Y/N): "; + {{Cl|DO}}: {{Cl|SLEEP}}: K$ = {{Cl|UCASE$}}({{Cl|INKEY$}}): {{Cl|LOOP}} {{Cl|UNTIL}} K$ = "Y" {{Cl|OR}} K$ = "N" +{{Cl|LOOP}} {{Cl|UNTIL}} K$ = "N" {{Cl|GOSUB}} ClearFont -{{Cl|PRINT}} "This is the QB64 default {{Cl|_FONT|_FONT }}16!" +{{Cl|PRINT}} "This is the QB64 default {{Cl|_FONT|_FONT }}16!" {{Cl|END}} ClearFont: -{{Cl|IF}} font& > 0 {{Cl|THEN}} +{{Cl|IF}} font& > 0 {{Cl|THEN}} {{Cl|_FONT|_FONT }}16 'select inbuilt 8x16 default font {{Cl|_FREEFONT}} font& {{Cl|END IF}} {{Cl|RETURN}} {{CodeEnd}} -'''NOTE:''' [[ENVIRON$]]("SYSTEMROOT") returns a string value of: "C:\WINDOWS". Add the "\FONTS\" folder and the '''.TTF''' font file name. +'''NOTE:''' [[ENVIRON$]]("SYSTEMROOT") returns a string value of: "C:\WINDOWS". Add the "\FONTS\" folder and the '''.TTF''' font file name. @@ -78,4 +78,4 @@ ClearFont: * [[Windows_Libraries#Font_Dialog_Box|Windows Font Dialog Box]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_FONTHEIGHT.txt b/internal/help/_FONTHEIGHT.txt index 36c5e38ac..cfbcebb2e 100644 --- a/internal/help/_FONTHEIGHT.txt +++ b/internal/help/_FONTHEIGHT.txt @@ -16,32 +16,32 @@ The [[_FONTHEIGHT]] function returns the font height of a font handle created by ''Example:'' Finding the [[_FONT|font]] or text block size of printed [[STRING|string]] characters in graphic [[SCREEN]] modes. {{CodeStart}} '' '' DO - {{Cl|INPUT}} "Enter Screen mode 1, 2 or 7 to 13 or 256, 32 for {{Cl|_NEWIMAGE}}: ", scr$ + {{Cl|INPUT}} "Enter Screen mode 1, 2 or 7 to 13 or 256, 32 for {{Cl|_NEWIMAGE}}: ", scr$ mode% = {{Cl|VAL}}(scr$) -{{Cl|LOOP}} {{Cl|UNTIL}} mode% > 0 +{{Cl|LOOP}} {{Cl|UNTIL}} mode% > 0 {{Cl|SELECT CASE}} mode% {{Cl|CASE}} 1, 2, 7 {{Cl|TO}} 13: {{Cl|SCREEN}} mode% {{Cl|CASE}} 256, 32: {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(800, 600, mode%) - {{Cl|CASE ELSE}}: {{Cl|PRINT}} "Invalid mode selected!": {{Cl|END}} + {{Cl|CASE ELSE}}: {{Cl|PRINT}} "Invalid mode selected!": {{Cl|END}} {{Cl|END SELECT}} -{{Cl|INPUT}} "Enter first name of TTF font to use or hit enter for text block size: ", TTFont$ -{{Cl|IF...THEN|IF}} {{Cl|LEN}}(TTFont$) {{Cl|THEN}} {{Cl|INPUT}} "Enter font height: ", hi$ +{{Cl|INPUT}} "Enter first name of TTF font to use or hit enter for text block size: ", TTFont$ +{{Cl|IF...THEN|IF}} {{Cl|LEN}}(TTFont$) {{Cl|THEN}} {{Cl|INPUT}} "Enter font height: ", hi$ height& = {{Cl|VAL}}(hi$) -{{Cl|IF...THEN|IF}} height& > 0 {{Cl|THEN}} - fnt& = {{Cl|_LOADFONT}}("C:\Windows\Fonts\" + TTFont$ + ".ttf", height&, style$) - {{Cl|IF...THEN|IF}} fnt& <= 0 {{Cl|THEN}} {{Cl|PRINT}} "Invalid Font handle!": {{Cl|END}} +{{Cl|IF...THEN|IF}} height& > 0 {{Cl|THEN}} + fnt& = {{Cl|_LOADFONT}}("C:\Windows\Fonts\" + TTFont$ + ".ttf", height&, style$) + {{Cl|IF...THEN|IF}} fnt& <= 0 {{Cl|THEN}} {{Cl|PRINT}} "Invalid Font handle!": {{Cl|END}} {{Cl|_FONT}} fnt& {{Cl|END IF}} TextSize wide&, high& 'get the font or current screen mode's text block pixel size -{{Cl|_PRINTSTRING}} (20, 100), "Block size = " + {{Cl|CHR$}}(1) + {{Cl|STR$}}(wide&) + " X" + {{Cl|STR$}}(high&) + " " + {{Cl|CHR$}}(2) +{{Cl|_PRINTSTRING}} (20, 100), "Block size = " + {{Cl|CHR$}}(1) + {{Cl|STR$}}(wide&) + " X" + {{Cl|STR$}}(high&) + " " + {{Cl|CHR$}}(2) {{Cl|END}} {{Cl|SUB}} TextSize (TextWidth&, TextHeight&) -TextWidth& = {{Cl|_PRINTWIDTH}}("W") 'measure width of one font or text character +TextWidth& = {{Cl|_PRINTWIDTH}}("W") 'measure width of one font or text character TextHeight& = {{Cl|_FONTHEIGHT}} 'can measure normal text block heights also {{Cl|END SUB}} '' '' {{CodeEnd}} @@ -54,4 +54,4 @@ TextHeight& = {{Cl|_FONTHEIGHT}} 'can measure normal text block heights also * [[Text Using Graphics]] (Demo) -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_FONTWIDTH.txt b/internal/help/_FONTWIDTH.txt index 7f8ab9b8d..654489f38 100644 --- a/internal/help/_FONTWIDTH.txt +++ b/internal/help/_FONTWIDTH.txt @@ -7,8 +7,8 @@ The [[_FONTWIDTH]] function returns the font width of a MONOSPACE font handle cr * Returns the character width of the last font used if a handle is not specified. -* '''Variable width fonts always return {{Parameter|pixelWidth%}} = 0.''' Even fixed width fonts return 0 unless the [[LOADFONT|"MONOSPACE"]] style option is used. -* QB64 '''version 1.000 and up''' can load a variable width font as monospaced with the [[LOADFONT|"MONOSPACE"]] style parameter. +* '''Variable width fonts always return {{Parameter|pixelWidth%}} = 0.''' Even fixed width fonts return 0 unless the [[LOADFONT|"MONOSPACE"]] style option is used. +* QB64 '''version 1.000 and up''' can load a variable width font as monospaced with the [[LOADFONT|"MONOSPACE"]] style parameter. * The font width is generally 3/4 of the [[_FONTHEIGHT]] specified when loading the font. * In '''graphics''' [[SCREEN (statement)|screen]] modes, [[_PRINTWIDTH]] can return the total '''pixel width''' of a literal or variable [[STRING|string]] of text. @@ -20,4 +20,4 @@ The [[_FONTWIDTH]] function returns the font width of a MONOSPACE font handle cr * [[_PRINTWIDTH]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_FONT_(function).txt b/internal/help/_FONT_(function).txt index 4b3710d44..48478bd66 100644 --- a/internal/help/_FONT_(function).txt +++ b/internal/help/_FONT_(function).txt @@ -15,4 +15,4 @@ The [[_FONT]] function retrieves the font handle from the specified image handle *[[_DEST]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_FREEFONT.txt b/internal/help/_FREEFONT.txt index aedd56e4d..683ba3c4d 100644 --- a/internal/help/_FREEFONT.txt +++ b/internal/help/_FREEFONT.txt @@ -23,22 +23,22 @@ The [[_FREEFONT]] statement frees a font handle that was created by [[_LOADFONT] ''Example 1:'' Previews and creates a file list of valid MONOSPACE TTF fonts by checking the [[_LOADFONT]] handle values. {{CodeStart}} '' '' {{Cl|SCREEN (statement)|SCREEN}} 12 -path$ = "C:\WINDOWS\Fonts\" 'path to the font folder -{{Cl|SHELL}} {{Cl|_HIDE}} "DIR /b " + path$ + "\*.ttf > TTFonts.INF" -style$ = "monospace" 'set style to MONOSPACE -{{Cl|OPEN}} "TTFonts.INF" {{Cl|FOR (file statement)|FOR}} {{Cl|INPUT (file mode)|INPUT}} {{Cl|AS}} #1 'list of TTF fonts only -{{Cl|OPEN}} "TTFMono.INF" {{Cl|FOR (file statement)|FOR}} {{Cl|OUTPUT}} {{Cl|AS}} #2 'will hold list of valid MONOSPACE fonts +path$ = "C:\WINDOWS\Fonts\" 'path to the font folder +{{Cl|SHELL}} {{Cl|_HIDE}} "DIR /b " + path$ + "\*.ttf > TTFonts.INF" +style$ = "monospace" 'set style to MONOSPACE +{{Cl|OPEN}} "TTFonts.INF" {{Cl|FOR (file statement)|FOR}} {{Cl|INPUT (file mode)|INPUT}} {{Cl|AS}} #1 'list of TTF fonts only +{{Cl|OPEN}} "TTFMono.INF" {{Cl|FOR (file statement)|FOR}} {{Cl|OUTPUT}} {{Cl|AS}} #2 'will hold list of valid MONOSPACE fonts {{Cl|DO}} {{Cl|UNTIL}} {{Cl|EOF}}(1): found = found + 1 {{Cl|LINE INPUT (file statement)|LINE INPUT}} #1, font$ f& ={{Cl|_LOADFONT}}(path$ + font$, 30, style$) - {{Cl|IF}} f& > 0 {{Cl|THEN}} 'check for valid handle values > 0 + {{Cl|IF}} f& > 0 {{Cl|THEN}} 'check for valid handle values > 0 OK = OK + 1 {{Cl|PRINT (file statement)|PRINT}} #2, font$ {{Cl|_FONT}} f& 'will create error if handle is invalid! - {{Cl|PRINT}} "Hello World!" + {{Cl|PRINT}} "Hello World!" {{Cl|PRINT}}: {{Cl|PRINT}}: {{Cl|PRINT}} font$; f& - {{Cl|PRINT}} "Press any key." + {{Cl|PRINT}} "Press any key." K$ = {{Cl|INPUT$}}(1) {{Cl|_FONT}} 16 'use QB64 default font to free tested font {{Cl|_FREEFONT}} f& 'returns an error if handle <= 0! @@ -48,7 +48,7 @@ style$ = "monospace" 'set style to MONOSPACE {{Cl|IF}} K$ = {{Cl|CHR$}}(27) {{Cl|THEN}} {{Cl|EXIT DO}} {{Cl|LOOP}} {{Cl|CLOSE}} -{{Cl|PRINT}}: {{Cl|PRINT}}: {{Cl|PRINT}} "Found"; found; "TTF files,"; OK; "can use Monospace," +{{Cl|PRINT}}: {{Cl|PRINT}}: {{Cl|PRINT}} "Found"; found; "TTF files,"; OK; "can use Monospace," {{Cl|END}} '' '' {{CodeEnd}} {{small|Code by Ted Weissgerber}} @@ -59,33 +59,33 @@ Found 106 TTF files, 13 can use Monospace. ''Example 2:'' Using a _FREEFONT sub-procedure. {{CodeStart}} -fontpath$ = {{Cl|ENVIRON$}}("SYSTEMROOT") + "\fonts\lucon.ttf" -style$ = "MONOSPACE, ITALIC, BOLD" +fontpath$ = {{Cl|ENVIRON$}}("SYSTEMROOT") + "\fonts\lucon.ttf" +style$ = "MONOSPACE, ITALIC, BOLD" fontsize% = 20 {{Cl|_FONT|_FONT }}16 {{Cl|PRINT}} -{{Cl|PRINT}} "This is the QB64 default {{Cl|_FONT|_FONT }}16! To change, press any key!" -{{Cl|DO}}: {{Cl|SLEEP}}: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" +{{Cl|PRINT}} "This is the QB64 default {{Cl|_FONT|_FONT }}16! To change, press any key!" +{{Cl|DO}}: {{Cl|SLEEP}}: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" {{Cl|GOSUB}} ClearFont 'call will not free anything if font& = 0 font& = {{Cl|_LOADFONT}}(fontpath$, fontsize%, style$) -{{Cl|IF}} font > 0 THEN {{Cl|_FONT|_FONT}} font& 'NEVER try to load a font value less than 1! +{{Cl|IF}} font > 0 THEN {{Cl|_FONT|_FONT}} font& 'NEVER try to load a font value less than 1! {{Cl|PRINT}} -{{Cl|PRINT}} "A NEW {{Cl|_FONT|_FONT}} style. To change to default, press any key!" -{{Cl|DO}}: {{Cl|SLEEP}}: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" +{{Cl|PRINT}} "A NEW {{Cl|_FONT|_FONT}} style. To change to default, press any key!" +{{Cl|DO}}: {{Cl|SLEEP}}: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" {{Cl|GOSUB}} ClearFont 'call will free a valid font handle from memory {{Cl|END}} ClearFont: -{{Cl|IF}} font& > 0 {{Cl|THEN}} +{{Cl|IF}} font& > 0 {{Cl|THEN}} {{Cl|_FONT|_FONT }}16 'change used font to the QB64 8x16 default font {{Cl|_FREEFONT}} font& - {{Cl|PRINT}}: {{Cl|PRINT}} "The previous font was freed with _FREEFONT!" -{{Cl|ELSE}} : {{Cl|PRINT}}: {{Cl|PRINT}} "_FREEFONT was not used!" + {{Cl|PRINT}}: {{Cl|PRINT}} "The previous font was freed with _FREEFONT!" +{{Cl|ELSE}} : {{Cl|PRINT}}: {{Cl|PRINT}} "_FREEFONT was not used!" {{Cl|END IF}} {{Cl|RETURN}} '' '' {{CodeEnd}} @@ -96,4 +96,4 @@ ClearFont: * [[_LOADFONT]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_FREEIMAGE.txt b/internal/help/_FREEIMAGE.txt index 6811ca9f6..bb50e48e1 100644 --- a/internal/help/_FREEIMAGE.txt +++ b/internal/help/_FREEIMAGE.txt @@ -9,8 +9,8 @@ The '''_FREEIMAGE''' statement releases the designated file image created by the {{PageDescription}} *If {{Parameter|handle&}} is omitted, the current destination image is freed from memory. *Freeing the destination image or source image will result in the display page being selected instead. -*'''Invalid image handle values of -1 or 0 cannot be freed or an [[ERROR Codes|"Illegal Function" error]] will occur.''' Check the handle value first. -* '''[[SCREEN]] modes in use cannot be freed or an [[ERROR Codes|"Illegal Function" error]] will occur.''' Change SCREEN modes before freeing. +*'''Invalid image handle values of -1 or 0 cannot be freed or an [[ERROR Codes|"Illegal Function" error]] will occur.''' Check the handle value first. +* '''[[SCREEN]] modes in use cannot be freed or an [[ERROR Codes|"Illegal Function" error]] will occur.''' Change SCREEN modes before freeing. *Once a specific image handle is no longer used or referenced by your program, it can be freed with [[_FREEIMAGE]]. * '''Images are not deallocated when the [[SUB]] or [[FUNCTION]] they are created in ends. Free them with [[_FREEIMAGE]].''' * '''It is important to free unused or unneeded images with [[_FREEIMAGE]] to prevent memory overflow errors.''' @@ -20,7 +20,7 @@ The '''_FREEIMAGE''' statement releases the designated file image created by the {{PageExamples}} ''Example:'' Loading a program splash screen and freeing image when no longer necessary: {{CodeStart}} '' '' -s& = {{Cl|_LOADIMAGE}}("SPLASH.BMP",32) 'load 32 bit(24 BPP) image +s& = {{Cl|_LOADIMAGE}}("SPLASH.BMP",32) 'load 32 bit(24 BPP) image {{Cl|IF}} s& < -1 THEN {{Cl|SCREEN (statement)|SCREEN}} s& 'use image as a 32 bit SCREEN {{Cl|_DELAY}} 6 'display splash screen for 6 seconds {{Cl|SCREEN (statement)|SCREEN}} 0 'MUST change screen mode before freeing a SCREEN image! @@ -37,4 +37,4 @@ s& = {{Cl|_LOADIMAGE}}("SPLASH.BMP",32) 'load 32 bit(24 BPP) imag * [[_COPYIMAGE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_FREETIMER.txt b/internal/help/_FREETIMER.txt index 72bd8aabc..7d1835bb3 100644 --- a/internal/help/_FREETIMER.txt +++ b/internal/help/_FREETIMER.txt @@ -16,4 +16,4 @@ The [[_FREETIMER]] function returns a free [[TIMER]] number for multiple [[ON TI * [[ON TIMER(n)]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_FULLSCREEN.txt b/internal/help/_FULLSCREEN.txt index 464ebd3d0..b61818de0 100644 --- a/internal/help/_FULLSCREEN.txt +++ b/internal/help/_FULLSCREEN.txt @@ -39,27 +39,27 @@ The [[_FULLSCREEN]] statement attempts to make the program window fullscreen. {{Cl|SCREEN (statement)|SCREEN}} 0 {{Cl|DO}} {{Cl|PRINT}} - {{Cl|LINE INPUT}} "Enter MODE 1) ENLARGE WINDOW 2) FULL _SQUAREPIXELS 3) FULL _STRETCH: ", WMODE$ + {{Cl|LINE INPUT}} "Enter MODE 1) ENLARGE WINDOW 2) FULL _SQUAREPIXELS 3) FULL _STRETCH: ", WMODE$ {{Cl|PRINT}} - {{Cl|IF}} WMODE$ = "1" {{Cl|THEN}} {{Cl|INPUT (file mode)|INPUT}} "SIZE 1 {{Cl|TO}} 9: ", ENLARGE% + {{Cl|IF}} WMODE$ = "1" {{Cl|THEN}} {{Cl|INPUT (file mode)|INPUT}} "SIZE 1 {{Cl|TO}} 9: ", ENLARGE% {{Cl|SELECT CASE}} ENLARGE% - {{Cl|CASE}} 1, 2, 3, 4, 5: STYLE$ = "MONOSPACE, BOLD" - {{Cl|CASE}} 6, 7, 8, 9: STYLE$ = "MONOSPACE" - {{Cl|CASE ELSE}}: STYLE$ = "MONOSPACE" + {{Cl|CASE}} 1, 2, 3, 4, 5: STYLE$ = "MONOSPACE, BOLD" + {{Cl|CASE}} 6, 7, 8, 9: STYLE$ = "MONOSPACE" + {{Cl|CASE ELSE}}: STYLE$ = "MONOSPACE" {{Cl|END SELECT}} {{Cl|SELECT CASE}} WMODE$ - {{Cl|CASE}} "1" + {{Cl|CASE}} "1" full = {{Cl|_FULLSCREEN (function)|_FULLSCREEN}} - {{Cl|IF}} full > 0 {{Cl|THEN}} {{Cl|_FULLSCREEN}} _OFF - f& = {{Cl|_LOADFONT}}("c:\windows\fonts\lucon.ttf", 13 + ENLARGE%, STYLE$) + {{Cl|IF}} full > 0 {{Cl|THEN}} {{Cl|_FULLSCREEN}} _OFF + f& = {{Cl|_LOADFONT}}("c:\windows\fonts\lucon.ttf", 13 + ENLARGE%, STYLE$) {{Cl|_FONT}} f& - {{Cl|CASE}} "2" + {{Cl|CASE}} "2" {{Cl|_FULLSCREEN}} _SQUAREPIXELS full = {{Cl|_FULLSCREEN (function)|_FULLSCREEN}} {{Cl|IF}} full = 0 {{Cl|THEN}} {{Cl|GOSUB}} FCHECK - {{Cl|CASE}} "3" + {{Cl|CASE}} "3" {{Cl|_FULLSCREEN}} _STRETCH full = {{Cl|_FULLSCREEN (function)|_FULLSCREEN}} {{Cl|IF}} full = 0 {{Cl|THEN}} {{Cl|GOSUB}} FCHECK @@ -67,8 +67,8 @@ The [[_FULLSCREEN]] statement attempts to make the program window fullscreen. mode = {{Cl|_FULLSCREEN (function)|_FULLSCREEN}} {{Cl|PRINT}} - {{Cl|PRINT}} "_FULLSCREEN mode ="; mode, - {{Cl|PRINT}} "PRESS ESC {{Cl|TO}} {{Cl|END}} {{Cl|OR}} ENTER {{Cl|TO}} CONTINUE..." + {{Cl|PRINT}} "_FULLSCREEN mode ="; mode, + {{Cl|PRINT}} "PRESS ESC {{Cl|TO}} {{Cl|END}} {{Cl|OR}} ENTER {{Cl|TO}} CONTINUE..." {{Cl|DO}}: {{Cl|SLEEP}}: B$ = {{Cl|INKEY$}}: {{Cl|LOOP}} {{Cl|UNTIL}} B$ = {{Cl|CHR$}}(13) {{Cl|OR}} B$ = {{Cl|CHR$}}(27) @@ -82,14 +82,14 @@ FCHECK: Z3 = timer {{Cl|DO}} {{Cl|IF}} {{Cl|TIMER (statement)|TIMER }}< Z3 {{Cl|THEN}} Z3 = Z3 - {{Cl|TIMER}} -{{Cl|IF}} {{Cl|TIMER (statement)|TIMER }}- Z3 > 4 {{Cl|THEN}} {{Cl|EXIT DO}} +{{Cl|IF}} {{Cl|TIMER (statement)|TIMER }}- Z3 > 4 {{Cl|THEN}} {{Cl|EXIT DO}} {{Cl|LOOP}} full = {{Cl|_FULLSCREEN (function)|_FULLSCREEN}} {{Cl|IF}} full = 0 {{Cl|THEN}} {{Cl|_FULLSCREEN}} _{{Cl|OFF}}: {{Cl|SOUND}} 100, .75 {{Cl|RETURN}} ClearFont: -{{Cl|IF}} f& > 0 {{Cl|THEN}} +{{Cl|IF}} f& > 0 {{Cl|THEN}} {{Cl|_FONT}} 16 'select inbuilt 8x16 default font {{Cl|_FREEFONT}} f& {{Cl|END IF}} @@ -100,12 +100,12 @@ ClearFont: ''Example 3:'' Testing all fullscreen methods. {{CodeStart}} -{{Cl|PRINT}} "Hello, world!" -{{Cl|PRINT}} "Hit 1 for windowed mode; -{{Cl|PRINT}} " 2 for _STRETCH" -{{Cl|PRINT}} " 3 for _SQUAREPIXELS" -{{Cl|PRINT}} " 4 for _STRETCH, _SMOOTH" -{{Cl|PRINT}} " 5 for _SQUAREPIXELS, _SMOOTH" +{{Cl|PRINT}} "Hello, world!" +{{Cl|PRINT}} "Hit 1 for windowed mode; +{{Cl|PRINT}} " 2 for _STRETCH" +{{Cl|PRINT}} " 3 for _SQUAREPIXELS" +{{Cl|PRINT}} " 4 for _STRETCH, _SMOOTH" +{{Cl|PRINT}} " 5 for _SQUAREPIXELS, _SMOOTH" {{Cl|DO}} k$ = {{Cl|INKEY$}} {{Cl|SELECT CASE}} {{Cl|VAL}}(k$) @@ -132,4 +132,4 @@ ClearFont: * [[_SCREENMOVE]], [[_SCREENX]], [[_SCREENY]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_FULLSCREEN_(function).txt b/internal/help/_FULLSCREEN_(function).txt index da6dfcb5e..897e45a95 100644 --- a/internal/help/_FULLSCREEN_(function).txt +++ b/internal/help/_FULLSCREEN_(function).txt @@ -12,8 +12,8 @@ The [[_FULLSCREEN]] function returns the present full screen mode setting of the ** 1 = _STRETCH ** 2 = _SQUAREPIXELS * It '''cannot''' be assumed that calling [[_FULLSCREEN]] will succeed. It cannot be assumed that the type of full screen will match the requested one. '''Always check the [[_FULLSCREEN (function)]] return in your programs.''' -* '''Warning:''' Despite your software, the user's hardware, drivers and monitor may not function in some modes. Thus, it is highly recommended that you manually confirm with the user whether the switch to full screen was successful. This can be done "quietly" in some cases by getting the user to click on a button on screen with their mouse or press an unusual key. If the user does not respond after about 8 seconds, switch them back to windowed mode. -<center>'''Using large fonts with [[_FULLSCREEN]] can cause monitor or Windows Desktop problems or kill a program.'''</center> +* '''Warning:''' Despite your software, the user's hardware, drivers and monitor may not function in some modes. Thus, it is highly recommended that you manually confirm with the user whether the switch to full screen was successful. This can be done "quietly" in some cases by getting the user to click on a button on screen with their mouse or press an unusual key. If the user does not respond after about 8 seconds, switch them back to windowed mode. +<center>'''Using large fonts with [[_FULLSCREEN]] can cause monitor or Windows Desktop problems or kill a program.'''</center> {{PageExamples}} @@ -21,56 +21,56 @@ The [[_FULLSCREEN]] function returns the present full screen mode setting of the {{CodeStart}} '' '' {{Cl|CLS}} -fontpath$ = {{Cl|ENVIRON$}}("SYSTEMROOT") + "\fonts\lucon.ttf" 'Find Windows Folder Path. +fontpath$ = {{Cl|ENVIRON$}}("SYSTEMROOT") + "\fonts\lucon.ttf" 'Find Windows Folder Path. f& = {{Cl|_FONT (function)|_FONT}}: defaultf& = f& {{Cl|DO}} - {{Cl|INPUT}} "1) DEFAULT 2) SIZE WINDOW 3) FULL SCREEN 4) FULL STRETCHED Q) QUIT: ", winmode$ + {{Cl|INPUT}} "1) DEFAULT 2) SIZE WINDOW 3) FULL SCREEN 4) FULL STRETCHED Q) QUIT: ", winmode$ - {{Cl|IF}} {{Cl|UCASE$}}(winmode$) = "Q" {{Cl|THEN}} {{Cl|EXIT DO}} + {{Cl|IF}} {{Cl|UCASE$}}(winmode$) = "Q" {{Cl|THEN}} {{Cl|EXIT DO}} - style$ = "MONOSPACE" + style$ = "MONOSPACE" {{Cl|SELECT CASE}} winmode$ - {{Cl|CASE}} "1" + {{Cl|CASE}} "1" full = {{Cl|_FULLSCREEN (function)|_FULLSCREEN}} 'get current full screen mode - {{Cl|IF}} full <> 0 {{Cl|THEN}} {{Cl|_FULLSCREEN}} _OFF + {{Cl|IF}} full <> 0 {{Cl|THEN}} {{Cl|_FULLSCREEN}} _OFF {{Cl|GOSUB}} ChangeFont - {{Cl|CASE}} "2" + {{Cl|CASE}} "2" {{Cl|DO}} {{Cl|PRINT}} - {{Cl|INPUT}} "Enter a FONT SIZE 5 to 25: ", fontsize% - {{Cl|LOOP}} {{Cl|UNTIL}} fontsize% > 4 {{Cl|AND (boolean)|AND}} fontsize% < 26 + {{Cl|INPUT}} "Enter a FONT SIZE 5 to 25: ", fontsize% + {{Cl|LOOP}} {{Cl|UNTIL}} fontsize% > 4 {{Cl|AND (boolean)|AND}} fontsize% < 26 {{Cl|DO}} {{Cl|PRINT}} - {{Cl|INPUT}} "Enter (0) for REGULAR or (1) for ITALIC FONT: ", italic% + {{Cl|INPUT}} "Enter (0) for REGULAR or (1) for ITALIC FONT: ", italic% {{Cl|LOOP}} {{Cl|UNTIL}} italic% = 0 or italic% = 1 {{Cl|DO}} {{Cl|PRINT}} - {{Cl|INPUT}} "Enter (0) for REGULAR or (1) for BOLD FONT: ", bold% + {{Cl|INPUT}} "Enter (0) for REGULAR or (1) for BOLD FONT: ", bold% {{Cl|LOOP}} {{Cl|UNTIL}} italic% = 0 or italic% = 1 - {{Cl|IF}} italic% = 1 {{Cl|THEN}} style$ = style$ + ", ITALIC" - {{Cl|IF}} bold% = 1 {{Cl|THEN}} style$ = style$ + ", BOLD" + {{Cl|IF}} italic% = 1 {{Cl|THEN}} style$ = style$ + ", ITALIC" + {{Cl|IF}} bold% = 1 {{Cl|THEN}} style$ = style$ + ", BOLD" full = {{Cl|_FULLSCREEN (function)|_FULLSCREEN}} 'get current full screen mode - {{Cl|IF}} full <> 0 {{Cl|THEN}} {{Cl|_FULLSCREEN}} _OFF + {{Cl|IF}} full <> 0 {{Cl|THEN}} {{Cl|_FULLSCREEN}} _OFF {{Cl|GOSUB}} ChangeFont - {{Cl|CASE}} "3" + {{Cl|CASE}} "3" {{Cl|GOSUB}} ChangeFont {{Cl|_FULLSCREEN}} _SQUAREPIXELS {{Cl|GOSUB}} CheckFull - {{Cl|CASE}} "4" + {{Cl|CASE}} "4" {{Cl|GOSUB}} ChangeFont {{Cl|_FULLSCREEN}} _STRETCH {{Cl|GOSUB}} CheckFull {{Cl|END SELECT}} - {{Cl|PRINT}}: {{Cl|PRINT}} "_FullScreen mode ="; {{Cl|_FULLSCREEN (function)|_FULLSCREEN}} + {{Cl|PRINT}}: {{Cl|PRINT}} "_FullScreen mode ="; {{Cl|_FULLSCREEN (function)|_FULLSCREEN}} {{Cl|PRINT}} {{Cl|LOOP}} {{Cl|GOSUB}} ChangeFont @@ -82,7 +82,7 @@ full = {{Cl|_FULLSCREEN (function)|_FULLSCREEN}} 'get current full screen mode {{Cl|RETURN}} ChangeFont: -{{Cl|IF}} winmode$ <> "2" {{Cl|THEN}} +{{Cl|IF}} winmode$ <> "2" {{Cl|THEN}} {{Cl|_FONT}} 16 'select inbuilt 8x16 default font currentf& = {{Cl|_FONT (function)|_FONT}} {{Cl|ELSE}} @@ -90,7 +90,7 @@ ChangeFont: {{Cl|_FONT}} currentf& {{Cl|END IF}} -{{Cl|IF}} currentf& <> f& {{Cl|AND (boolean)|AND}} f& <> defaultf& {{Cl|THEN}} {{Cl|_FREEFONT}} f& +{{Cl|IF}} currentf& <> f& {{Cl|AND (boolean)|AND}} f& <> defaultf& {{Cl|THEN}} {{Cl|_FREEFONT}} f& f& = currentf& {{Cl|RETURN}} '' '' @@ -104,4 +104,4 @@ f& = currentf& * [[_SCREENMOVE]], [[_SCREENX]], [[_SCREENY]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_G2D.txt b/internal/help/_G2D.txt index a9948f2ad..d04674ddb 100644 --- a/internal/help/_G2D.txt +++ b/internal/help/_G2D.txt @@ -13,9 +13,9 @@ The [[_G2D]] function converts a '''gradient''' value into a '''degree''' value. {{PageExamples}} ''Example:'' Coverting Gradients into Degree. {{CodeStart}} -INPUT "Give me an angle in Gradients ", D +INPUT "Give me an angle in Gradients ", D R = _G2D(D) -PRINT "That angle in Degrees is "; R +PRINT "That angle in Degrees is "; R {{CodeEnd}} {{OutputStart}} Give me an angle in Gradients 60 @@ -29,4 +29,4 @@ That angle in Degrees is 54 * [[_R2D]], [[_R2G]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_G2R.txt b/internal/help/_G2R.txt index 803c0a09b..c534ed60e 100644 --- a/internal/help/_G2R.txt +++ b/internal/help/_G2R.txt @@ -13,9 +13,9 @@ The [[_G2R]] function converts a '''gradient''' value into a '''radian''' value. {{PageExamples}} ''Example:'' Coverting Gradient into Radians. {{CodeStart}} -INPUT "Give me an angle in Gradient ", D +INPUT "Give me an angle in Gradient ", D R = _G2R(D) -PRINT "That angle in Radians is "; R +PRINT "That angle in Radians is "; R {{CodeEnd}} {{OutputStart}} Give me an angle in Gradient 60 @@ -29,4 +29,4 @@ That angle in Radians is .9424778 * [[_R2D]], [[_R2G]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_GREEN.txt b/internal/help/_GREEN.txt index 331dc0efb..afdae45d2 100644 --- a/internal/help/_GREEN.txt +++ b/internal/help/_GREEN.txt @@ -28,4 +28,4 @@ The [[_GREEN]] function returns the palette index or the green component intensi * [[_LOADIMAGE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_GREEN32.txt b/internal/help/_GREEN32.txt index 37a3dbefd..e84b360dd 100644 --- a/internal/help/_GREEN32.txt +++ b/internal/help/_GREEN32.txt @@ -21,4 +21,4 @@ The [[_GREEN32]] function returns the green component intensity of a 32-bit imag * [[_RGB32]], [[_GREEN]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_HEIGHT.txt b/internal/help/_HEIGHT.txt index 92da842b2..87e4d26e7 100644 --- a/internal/help/_HEIGHT.txt +++ b/internal/help/_HEIGHT.txt @@ -1,35 +1 @@ -{{DISPLAYTITLE:_HEIGHT}} -The [[_HEIGHT]] function returns the height of an image handle or current write page. - - -{{PageSyntax}} -:''result&'' = {{KW|_HEIGHT}}[({{Parameter|imageHandle&}})] - - -{{PageDescription}} -* If {{Parameter|imageHandle&}} is omitted, it's assumed to be the handle of the current write page. -* To get the width of the current program window use zero for the handle value: depth& = _HEIGHT(0) -* If the image specified by {{Parameter|imageHandle&}} is in text mode, the number of characters per column is returned. -* If the image specified by {{Parameter|imageHandle&}} is in graphics mode, the number of pixels per column is returned. -* If {{Parameter|imageHandle&}} is an invalid handle, then an [[ERROR Codes|invalid handle]] error will occur. -* The maximum pixel coordinate of a program [[SCREEN|screen]] is one less than what the function returns. - - -''Example:'' Displays the current program window area. -{{CodeStart}} '' '' -{{Cl|SCREEN}} 12 -wide = {{Cl|_WIDTH (function)|_WIDTH}} -deep = {{Cl|_HEIGHT}} - -{{Cl|PRINT}} "The program screen is"; wide; "X"; deep '' '' -{{CodeEnd}} - - -{{PageSeeAlso}} -* [[_WIDTH (function)]] -* [[_LOADIMAGE]] -* [[_FONTHEIGHT]] -* [[Bitmaps]] - - -{{PageNavigation}} \ No newline at end of file +#REDIRECT [[_HEIGHT, _WIDTH]] diff --git a/internal/help/_HIDE.txt b/internal/help/_HIDE.txt index f2d6600cf..523854e53 100644 --- a/internal/help/_HIDE.txt +++ b/internal/help/_HIDE.txt @@ -8,7 +8,7 @@ The [[_HIDE]] action is used to hide the console window opened by a [[SHELL]] st {{PageDescription}} * Allows any command line window to be hidden from view without affecting the program. -* [[_HIDE]] must be used when sending ("piping") screen information to a file. +* [[_HIDE]] must be used when sending ("piping") screen information to a file. * '''Note:''' Some commands may not work without adding CMD /C to the start of the command line. @@ -17,26 +17,26 @@ The [[_HIDE]] action is used to hide the console window opened by a [[SHELL]] st {{CodeStart}} '' '' SUB LFN - IF LEN({{Cl|ENVIRON$}}("OS")) = 0 THEN EXIT SUB ' /X not available Win 9X and ME - SHELL {{Cl|_HIDE}} "cmd /c dir /x > DOS-DATA.INF" ' load display data to a file - OPEN "DOS-DATA.INF" FOR INPUT AS #1 + IF LEN({{Cl|ENVIRON$}}("OS")) = 0 THEN EXIT SUB ' /X not available Win 9X and ME + SHELL {{Cl|_HIDE}} "cmd /c dir /x > DOS-DATA.INF" ' load display data to a file + OPEN "DOS-DATA.INF" FOR INPUT AS #1 IF {{Cl|LOF}}(1) THEN - Header$ = SPACE$(10) + "Short" + SPACE$(16) + "Long" + SPACE$(20) + "Last Modified" - tmp$ = "\ \ \ \ &" ' print using template format + Header$ = SPACE$(10) + "Short" + SPACE$(16) + "Long" + SPACE$(20) + "Last Modified" + tmp$ = "\ \ \ \ &" ' print using template format COLOR 14: LOCATE 2, 4: PRINT Header$ DO UNTIL EOF(1) {{Cl|LINE INPUT}} #1, line$ - IF LEN(line$) AND MID$(line$, 1, 1) <> SPACE$(1) THEN ' ignore other file data + IF LEN(line$) AND MID$(line$, 1, 1) <> SPACE$(1) THEN ' ignore other file data cnt% = cnt% + 1 last$ = MID$(line$, 1, 20): DIR$ = MID$(line$, 26, 3) - IF MID$(line$, 40, 1) <> SPACE$(1) THEN ' found line with short and long name + IF MID$(line$, 40, 1) <> SPACE$(1) THEN ' found line with short and long name SHFN$ = MID$(line$, 40, INSTR(40, line$, SPACE$(1)) - 1) LGFN$ = MID$(line$, 53) - ELSE : SHFN$ = MID$(line$, 53): LGFN$ = "" ' found short name only + ELSE : SHFN$ = MID$(line$, 53): LGFN$ = "" ' found short name only END IF IF cnt% MOD 25 = 0 THEN ' pause every 25 files - COLOR 14: LOCATE 29, 27 "Press a key for more files!" - DO: LOOP UNTIL INKEY$ <> "" + COLOR 14: LOCATE 29, 27 "Press a key for more files!" + DO: LOOP UNTIL INKEY$ <> "" CLS: COLOR 14: LOCATE 2, 4: PRINT Header$ END IF COLOR 11: LOCATE (cnt% MOD 25) + 3, 4 @@ -45,7 +45,7 @@ SUB LFN END IF LOOP END IF - COLOR 10: LOCATE {{Cl|CSRLIN}} + 1, 27 "Total folders and files ="; cnt% + COLOR 10: LOCATE {{Cl|CSRLIN}} + 1, 27 "Total folders and files ="; cnt% CLOSE #1 END SUB '' '' @@ -59,4 +59,4 @@ END SUB '' '' * [[FILELIST$ (function)]] ([[FILES]] function, member-contributed) -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_ICON.txt b/internal/help/_ICON.txt index f05682ffd..c0fa26d08 100644 --- a/internal/help/_ICON.txt +++ b/internal/help/_ICON.txt @@ -31,7 +31,7 @@ The [[_ICON]] statement uses an image handle from [[_LOADIMAGE]] for the program {{PageExamples}} ''Example 1:'' Loading an image to a 32 bit palette in SCREEN 0 (the default screen mode). {{CodeStart}} '' '' -i& ={{Cl|_LOADIMAGE}}("RDSWU16.BMP", 32) '<<<<<<< use your image file name here +i& ={{Cl|_LOADIMAGE}}("RDSWU16.BMP", 32) '<<<<<<< use your image file name here {{Cl|IF}} i& < -1 THEN {{Cl|_ICON}} i& @@ -44,9 +44,9 @@ i& ={{Cl|_LOADIMAGE}}("RDSWU16.BMP", 32) '<<<<<< ''Example 2:'' Function that converts an icon into a temporary bitmap for use in QB64. Function returns the available image count. {{CodeStart}} '' '' {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, 256) -{{Cl|_TITLE}} "Icon Converter" -icon$ = "daphne.ico" '<<<<<<<<< change icon file name -bitmap$ = "tempfile.bmp" +{{Cl|_TITLE}} "Icon Converter" +icon$ = "daphne.ico" '<<<<<<<<< change icon file name +bitmap$ = "tempfile.bmp" indx% = 6 '1 minimum <<<<<<< higher values than count get highest entry image in icon file {{Cl|IF...THEN|IF}} Icon2BMP(icon$, bitmap$, indx%) {{Cl|THEN}} @@ -67,16 +67,16 @@ indx% = 6 '1 minimum <<<<<<< higher values than count get {{Cl|DIM}} wide {{Cl|AS}} {{Cl|LONG}}, high {{Cl|AS}} {{Cl|LONG}}, BM {{Cl|AS}} {{Cl|INTEGER}}, bpp {{Cl|AS}} {{Cl|INTEGER}} rf = {{Cl|FREEFILE}} -{{Cl|IF...THEN|IF}} {{Cl|LCASE$}}({{Cl|RIGHT$}}(filein, 4)) = ".ico" {{Cl|THEN}} 'check file extension is ICO only +{{Cl|IF...THEN|IF}} {{Cl|LCASE$}}({{Cl|RIGHT$}}(filein, 4)) = ".ico" {{Cl|THEN}} 'check file extension is ICO only {{Cl|OPEN}} filein {{Cl|OPEN|FOR}} {{Cl|BINARY}} {{Cl|ACCESS}} {{Cl|ACCESS|READ}} {{Cl|AS}} rf {{Cl|ELSE}} {{Cl|EXIT FUNCTION}} {{Cl|END IF}} {{Cl|GET}} rf, , word {{Cl|GET}} rf, , word: icon = word {{Cl|GET}} rf, , word: count = word -{{Cl|IF...THEN|IF}} icon <> 1 {{Cl|OR (boolean)|OR}} count = 0 {{Cl|THEN}} {{Cl|CLOSE}} rf: {{Cl|EXIT FUNCTION}} +{{Cl|IF...THEN|IF}} icon <> 1 {{Cl|OR (boolean)|OR}} count = 0 {{Cl|THEN}} {{Cl|CLOSE}} rf: {{Cl|EXIT FUNCTION}} '{{Cl|PRINT}} icon, count -{{Cl|IF...THEN|IF}} index > 0 {{Cl|AND (boolean)|AND}} index <= count {{Cl|THEN}} entry = 16 * (index - 1) {{Cl|ELSE}} entry = 16 * (count - 1) +{{Cl|IF...THEN|IF}} index > 0 {{Cl|AND (boolean)|AND}} index <= count {{Cl|THEN}} entry = 16 * (index - 1) {{Cl|ELSE}} entry = 16 * (count - 1) {{Cl|SEEK}} rf, 1 + 6 + entry 'start of indexed Entry header {{Cl|GET}} rf, , byte: wide = byte ' use this unsigned for images over 127 {{Cl|GET}} rf, , byte: high = byte ' use this unsigned because it isn't doubled @@ -84,20 +84,20 @@ rf = {{Cl|FREEFILE}} {{Cl|GET}} rf, , dword '2 hot spots both normally 0 in icons, used for cursors {{Cl|GET}} rf, , dword: size = dword 'this could be used, doesn't seem to matter {{Cl|GET}} rf, , dword: offset = dword 'find where the specific index BMP header is -'{{Cl|PRINT}} wide; "X"; high, size, offset +'{{Cl|PRINT}} wide; "X"; high, size, offset {{Cl|SEEK}} rf, 1 + offset + 14 'only read the BPP in BMP header {{Cl|GET}} rf, , word: bpp = word {{Cl|IF...THEN|IF}} bpp = 0 {{Cl|THEN}} {{Cl|CLOSE}} rf: {{Cl|EXIT FUNCTION}} {{Cl|IF...THEN|IF}} bpp <= 24 {{Cl|THEN}} pixelbytes = bpp / 8 {{Cl|ELSE}} pixelbytes = 3 -{{Cl|IF...THEN|IF}} bpp > 1 {{Cl|AND (boolean)|AND}} bpp <= 8 {{Cl|THEN}} palettebytes = 4 * (2 ^ bpp) {{Cl|ELSE}} palettebytes = 0 +{{Cl|IF...THEN|IF}} bpp > 1 {{Cl|AND (boolean)|AND}} bpp <= 8 {{Cl|THEN}} palettebytes = 4 * (2 ^ bpp) {{Cl|ELSE}} palettebytes = 0 datasize& = (wide * high * pixelbytes) + palettebytes 'no padder should be necessary filesize& = datasize& + 14 + 40 ' data and palette + header bmpoffset& = palettebytes + 54 ' data offset from start of bitmap readbytes& = datasize& + 28 ' (40 - 12) bytes left to read in BMP header and {{Cl|XOR}} mask only '{{Cl|PRINT}} bpp, bmpoffset&, filesize& -BM = {{Cl|CVI}}("BM") 'this will create "BM" in file like {{Cl|MKI$}} would +BM = {{Cl|CVI}}("BM") 'this will create "BM" in file like {{Cl|MKI$}} would wf = {{Cl|FREEFILE}} {{Cl|OPEN}} fileout {{Cl|OPEN|FOR}} {{Cl|BINARY}} {{Cl|AS}} wf {{Cl|PUT}} wf, , BM @@ -129,4 +129,4 @@ Icon2BMP = count ' return the number of icons available in the icon * [[Resource_Table_extraction#Extract_Icon|Icon Extraction]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_INTEGER64.txt b/internal/help/_INTEGER64.txt index ceb3974f6..12780db40 100644 --- a/internal/help/_INTEGER64.txt +++ b/internal/help/_INTEGER64.txt @@ -25,4 +25,4 @@ * [[Variable Types]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_KEYCLEAR.txt b/internal/help/_KEYCLEAR.txt index 42c14d630..7aaad596b 100644 --- a/internal/help/_KEYCLEAR.txt +++ b/internal/help/_KEYCLEAR.txt @@ -18,7 +18,7 @@ * This command is best used just before getting input, in order to clear stray key presses from commands such as SLEEP, or just random keyboard bashing by the user. The programmer also ought to be aware of key release events in the _KEYHIT buffer; consider the following code: {{CodeStart}} -INPUT "Name: ", name$ +INPUT "Name: ", name$ _KEYCLEAR _DELAY 2 'Simulate doing some processing that takes some time. PRINT _KEYHIT @@ -28,7 +28,7 @@ PRINT _KEYHIT * As mentioned above, it is best to place the _KEYCLEAR after the processing, immediately before the PRINT _KEYHIT command: {{CodeStart}} -INPUT "Name: ", name$ +INPUT "Name: ", name$ _DELAY 2 'Simulate doing some processing that takes some time. _KEYCLEAR PRINT _KEYHIT @@ -38,14 +38,14 @@ PRINT _KEYHIT {{PageExamples}} Example: {{CodeStart}} -PRINT "Press a key" +PRINT "Press a key" SLEEP 'Wait for keypress 'Three alternative _KEYCLEAR calls. Try uncommenting different ones to see the effect. '_KEYCLEAR '_KEYCLEAR 1 '_KEYCLEAR 2 -PRINT "In regular buffer, there is "; INKEY$ 'read regular buffer -PRINT "In _KEYHIT buffer, there is "; _KEYHIT 'read the _KEYHIT buffer +PRINT "In regular buffer, there is "; INKEY$ 'read regular buffer +PRINT "In _KEYHIT buffer, there is "; _KEYHIT 'read the _KEYHIT buffer {{CodeEnd}} @@ -54,4 +54,4 @@ PRINT "In _KEYHIT buffer, there is "; _KEYHIT 'read the _KEYHIT buffer * [[INKEY$]], [[_KEYHIT]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_KEYDOWN.txt b/internal/help/_KEYDOWN.txt index ab7c07ced..995c893ed 100644 --- a/internal/help/_KEYDOWN.txt +++ b/internal/help/_KEYDOWN.txt @@ -15,7 +15,7 @@ The '''_KEYDOWN''' function returns whether modifying keys like CTRL, ALT, SHIFT :* A UTF32 value is usually(but by no means always!) the same as a UTF16 value just with the top 2 bytes set to 0. * An important difference between [[INKEY$]] and [[_KEYHIT]] is how they work when '''CTRL, ALT''' or '''SHIFT''' are used. [[INKEY$]] returns a different code if you hold down CTRL, ALT or SHIFT before pressing F1 (for example). [[_KEYHIT]] will return the same code regardless of which modifiers were used but you can check _KEYDOWN to see which modifying keys are being used. * '''Keyboards with Alt Gr key:''' [[_KEYHIT]] may return both Alt(100307) and Ctrl(100306) codes when key is pressed or released. -* '''Linux with foreign keyboards:''' [[SHELL]] [[_HIDE]] "setxkbmap us" will setup a keyboard to read US [[Scancodes]]. +* '''Linux with foreign keyboards:''' [[SHELL]] [[_HIDE]] "setxkbmap us" will setup a keyboard to read US [[Scancodes]]. {{WhiteStart}} '''The QB64 Virtual Key constant values used: ''' @@ -35,10 +35,10 @@ The '''_KEYDOWN''' function returns whether modifying keys like CTRL, ALT, SHIFT ''''Tab Q W E R T Y U I O P [{ ]} \| Del End PDn 7Hme 8/▲ 9PU + ''' ' 9 81 87 69 82 84 89 85 73 79 80 123 125 124 21248 20224 20736 18176 18432 18688 43 ''' 113 119 101 114 116 121 117 105 111 112 91 93 92 55 56 57 '' -''''CapL A S D F G H J K L ;: '" Enter 4/◄- 5 6/-► +''''CapL A S D F G H J K L ;: '" Enter 4/◄- 5 6/-► '+301 65 83 68 70 71 72 74 75 76 58 34 13 19200 19456 19712 '''E''' ''' 97 115 100 102 103 104 106 107 108 59 39 52 53 54 '' '''n''' -''''Shift Z X C V B N M ,< .> /? Shift ▲ 1End 2/▼ 3PD t''' +''''Shift Z X C V B N M ,< .> /? Shift ▲ 1End 2/▼ 3PD t''' '+304 90 88 67 86 66 78 77 60 62 63 +303 18432 20224 20480 20736 '''e''' ''' 122 120 99 118 98 110 109 44 46 47 49 50 51 '' '''r''' ''''Ctrl Win Alt Spacebar Alt Win Menu Ctrl ◄- ▼ -► 0Ins .Del ''' @@ -64,9 +64,9 @@ The '''_KEYDOWN''' function returns whether modifying keys like CTRL, ALT, SHIFT CONST KEY_LALT& = 100308 CONST KEY_RMETA& = 100309 'Left 'Apple' key (MacOSX) CONST KEY_LMETA& = 100310 'Right 'Apple' key (MacOSX) - CONST KEY_LSUPER& = 100311 'Left "Windows" key - CONST KEY_RSUPER& = 100312 'Right "Windows"key - CONST KEY_MODE& = 100313 '"AltGr" key + CONST KEY_LSUPER& = 100311 'Left "Windows" key + CONST KEY_RSUPER& = 100312 'Right "Windows"key + CONST KEY_MODE& = 100313 '"AltGr" key CONST KEY_COMPOSE& = 100314 CONST KEY_HELP& = 100315 CONST KEY_PRINT& = 100316 @@ -120,14 +120,14 @@ The '''_KEYDOWN''' function returns whether modifying keys like CTRL, ALT, SHIFT x = {{Cl|_KEYHIT}} {{Cl|IF}} x = {{Cl|CVI}}({{Cl|CHR$}}(0) + {{Cl|CHR$}}(59)) {{Cl|THEN}} {{Cl|IF}} {{Cl|_KEYDOWN}}(LSHIFT&) {{Cl|OR (boolean)|OR}} {{Cl|_KEYDOWN}}(RSHIFT&) {{Cl|THEN}} - {{Cl|PRINT}} "KEYHIT: SHIFT + F1" + {{Cl|PRINT}} "KEYHIT: SHIFT + F1" {{Cl|ELSE}} - {{Cl|PRINT}} "KEYHIT: F1" + {{Cl|PRINT}} "KEYHIT: F1" {{Cl|END IF}} {{Cl|END IF}} k$ = {{Cl|INKEY$}} 'compare key press return values - {{Cl|IF}} k$ = {{Cl|CHR$}}(0) + {{Cl|CHR$}}(59) {{Cl|THEN}} {{Cl|PRINT}} "INKEY$: F1" - {{Cl|IF}} k$ = {{Cl|CHR$}}(0) + {{Cl|CHR$}}(84) {{Cl|THEN}} {{Cl|PRINT}} "INKEY$: SHIFT+F1" + {{Cl|IF}} k$ = {{Cl|CHR$}}(0) + {{Cl|CHR$}}(59) {{Cl|THEN}} {{Cl|PRINT}} "INKEY$: F1" + {{Cl|IF}} k$ = {{Cl|CHR$}}(0) + {{Cl|CHR$}}(84) {{Cl|THEN}} {{Cl|PRINT}} "INKEY$: SHIFT+F1" {{Cl|LOOP}} {{Cl|UNTIL}} k$ = {{Cl|CHR$}}(27) 'escape key exit {{CodeEnd}} {{small|Code by Galleon}} @@ -143,21 +143,21 @@ radius = 20 DO {{Cl|CLS}} - {{Cl|LOCATE}} 1, 1: {{Cl|PRINT}} "Use the arrow keys to move the circle." + {{Cl|LOCATE}} 1, 1: {{Cl|PRINT}} "Use the arrow keys to move the circle." {{Cl|CIRCLE}} (x, y), radius, col {{Cl|PAINT}} (x, y), col - {{Cl|IF...THEN|IF}} {{Cl|_KEYDOWN}}({{Cl|CVI}}({{Cl|CHR$}}(0) + "P")) {{Cl|THEN}} y = y + 1 '_KEYDOWN(20480) - {{Cl|IF...THEN|IF}} {{Cl|_KEYDOWN}}({{Cl|CVI}}({{Cl|CHR$}}(0) + "H")) {{Cl|THEN}} y = y - 1 '_KEYDOWN(18432) - {{Cl|IF...THEN|IF}} {{Cl|_KEYDOWN}}({{Cl|CVI}}({{Cl|CHR$}}(0) + "K")) {{Cl|THEN}} x = x - 1 '_KEYDOWN(19200) - {{Cl|IF...THEN|IF}} {{Cl|_KEYDOWN}}({{Cl|CVI}}({{Cl|CHR$}}(0) + "M")) {{Cl|THEN}} x = x + 1 '_KEYDOWN(19712) + {{Cl|IF...THEN|IF}} {{Cl|_KEYDOWN}}({{Cl|CVI}}({{Cl|CHR$}}(0) + "P")) {{Cl|THEN}} y = y + 1 '_KEYDOWN(20480) + {{Cl|IF...THEN|IF}} {{Cl|_KEYDOWN}}({{Cl|CVI}}({{Cl|CHR$}}(0) + "H")) {{Cl|THEN}} y = y - 1 '_KEYDOWN(18432) + {{Cl|IF...THEN|IF}} {{Cl|_KEYDOWN}}({{Cl|CVI}}({{Cl|CHR$}}(0) + "K")) {{Cl|THEN}} x = x - 1 '_KEYDOWN(19200) + {{Cl|IF...THEN|IF}} {{Cl|_KEYDOWN}}({{Cl|CVI}}({{Cl|CHR$}}(0) + "M")) {{Cl|THEN}} x = x + 1 '_KEYDOWN(19712) {{Cl|_DISPLAY}} {{Cl|_LIMIT}} 100 'limit to 100 frames per second {{Cl|LOOP}} '' '' {{CodeEnd}} {{small|Code by Galleon}} -:''Explanation:'' When [[CVI]] is used with a 2 byte code, the code of the first character(0) is added to the second character code which is multiplied by 256. In the example, code zero is added to the [[ASCII]] code of "P" which is 80. CVI multiplies 80 * 256 = 20480. +:''Explanation:'' When [[CVI]] is used with a 2 byte code, the code of the first character(0) is added to the second character code which is multiplied by 256. In the example, code zero is added to the [[ASCII]] code of "P" which is 80. CVI multiplies 80 * 256 = 20480. ''See also: @@ -170,4 +170,4 @@ DO * [[Windows_Libraries#Hot_Keys_.28maximize.29|Windows hot keys]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_KEYHIT.txt b/internal/help/_KEYHIT.txt index 11314cf0c..9a7ecb4ab 100644 --- a/internal/help/_KEYHIT.txt +++ b/internal/help/_KEYHIT.txt @@ -23,10 +23,10 @@ The [[_KEYHIT]] function returns [[ASCII]] one and two byte, OpenGL Virtual Key ''''Tab Q W E R T Y U I O P [{ ]} \| Del End PDn 7Hme 8/▲ 9PU + ''' ' 9 81 87 69 82 84 89 85 73 79 80 123 125 124 21248 20224 20736 18176 18432 18688 43 ''' 113 119 101 114 116 121 117 105 111 112 91 93 92 55 56 57 '' -''''CapL A S D F G H J K L ;: '" Enter 4/◄- 5 6/-► +''''CapL A S D F G H J K L ;: '" Enter 4/◄- 5 6/-► '+301 65 83 68 70 71 72 74 75 76 58 34 13 19200 19456 19712 '''E''' ''' 97 115 100 102 103 104 106 107 108 59 39 52 53 54 '' '''n''' -''''Shift Z X C V B N M ,< .> /? Shift ▲ 1End 2/▼ 3PD t''' +''''Shift Z X C V B N M ,< .> /? Shift ▲ 1End 2/▼ 3PD t''' '+304 90 88 67 86 66 78 77 60 62 63 +303 18432 20224 20480 20736 '''e''' ''' 122 120 99 118 98 110 109 44 46 47 49 50 51 '' '''r''' ''''Ctrl Win Alt Spacebar Alt Win Menu Ctrl ◄- ▼ -► 0Ins .Del ''' @@ -38,11 +38,11 @@ The [[_KEYHIT]] function returns [[ASCII]] one and two byte, OpenGL Virtual Key {{small|NOTE: The above commented table can be copied and pasted directly into the QB64 IDE}} -:* >= &H40000000: [[Unicode]]. +:* >= &H40000000: [[Unicode]]. -* Font '''cyberbit.ttf''', included with QB64 ('''version 0.92 and up'''), is required to facilitate the '''IME'''(in Chinese settings) only. The 12.7 MB font is free for '''non-commercial''' use and is not loaded unless the user switches to the '''Input Mode Editor'''. Set to "UNICODE". -<center>'''[http://www.fileformat.info/tip/microsoft/enter_unicode.htm Setting up the Unicode Input Method Editor in Windows]'''</center> -<center>If you need help with IME support in '''Vista''' see the following article: [http://blogs.msdn.com/b/michkap/archive/2006/07/20/671835.aspx Setting up IME in Vista]</center> +* Font '''cyberbit.ttf''', included with QB64 ('''version 0.92 and up'''), is required to facilitate the '''IME'''(in Chinese settings) only. The 12.7 MB font is free for '''non-commercial''' use and is not loaded unless the user switches to the '''Input Mode Editor'''. Set to "UNICODE". +<center>'''[http://www.fileformat.info/tip/microsoft/enter_unicode.htm Setting up the Unicode Input Method Editor in Windows]'''</center> +<center>If you need help with IME support in '''Vista''' see the following article: [http://blogs.msdn.com/b/michkap/archive/2006/07/20/671835.aspx Setting up IME in Vista]</center> * QB64 can use several Windows fonts when '''cyberbit''' is not present so it is not necessary to include with program packages. * An '''important difference''' between [[INKEY$]] and _KEYHIT is how they work when '''CTRL, ALT''' or '''SHIFT''' are used. INKEY$ returns a different code if you hold down CTRL, ALT or SHIFT before pressing F1 (for example). _KEYHIT will return the same code regardless of which modifiers were used but you can check [[_KEYDOWN]] to see which modifying keys are being used. * '''Keyboards with an Alt Gr key note:''' _KEYHIT may return both Alt (100307) and Ctrl (100306) codes when AltGr key is pressed or released. @@ -55,8 +55,8 @@ The [[_KEYHIT]] function returns [[ASCII]] one and two byte, OpenGL Virtual Key {{Cl|DEFLNG}} A-Z {{Cl|SCREEN (statement)|SCREEN}} {{Cl|_NEWIMAGE}}(800, 600, 8) {{Cl|CLS}} , 1 -font = {{Cl|_LOADFONT}}("cyberbit.ttf", 24) -unifont = {{Cl|_LOADFONT}}("cyberbit.ttf", 24, "UNICODE") +font = {{Cl|_LOADFONT}}("cyberbit.ttf", 24) +unifont = {{Cl|_LOADFONT}}("cyberbit.ttf", 24, "UNICODE") {{Cl|_FONT}} font {{Cl|DO}} @@ -64,29 +64,29 @@ unifont = {{Cl|_LOADFONT}}("cyberbit.ttf", 24, "UNICODE") {{Cl|IF}} x {{Cl|THEN}} {{Cl|IF}} x < 0 {{Cl|THEN}} 'negative value means key released {{Cl|COLOR}} 2 - {{Cl|PRINT}} "Released "; + {{Cl|PRINT}} "Released "; x = -x {{Cl|ELSE}} {{Cl|COLOR}} 10 - {{Cl|PRINT}} "Pressed "; 'positive value means key pressed + {{Cl|PRINT}} "Pressed "; 'positive value means key pressed {{Cl|END IF}} {{Cl|IF}} x < 256 {{Cl|THEN}} 'ASCII code values - {{Cl|PRINT}} "{{Cl|ASC}}II "; x; - {{Cl|IF}} x >= 32 {{Cl|AND (boolean)|AND}} x <= 255 {{Cl|THEN}} {{Cl|PRINT}} "[" + {{Cl|CHR$}}(x) + "]" {{Cl|ELSE}} {{Cl|PRINT}} + {{Cl|PRINT}} "{{Cl|ASC}}II "; x; + {{Cl|IF}} x >= 32 {{Cl|AND (boolean)|AND}} x <= 255 {{Cl|THEN}} {{Cl|PRINT}} "[" + {{Cl|CHR$}}(x) + "]" {{Cl|ELSE}} {{Cl|PRINT}} {{Cl|END IF}} - {{Cl|IF}} x >= 256 {{Cl|AND (boolean)|AND}} x < 65536 {{Cl|THEN}} '2 byte key codes - {{Cl|PRINT}} "2-BYTE-{{Cl|COM}}BO "; x {{Cl|AND (boolean)|AND}} 255; x \ 256; + {{Cl|IF}} x >= 256 {{Cl|AND (boolean)|AND}} x < 65536 {{Cl|THEN}} '2 byte key codes + {{Cl|PRINT}} "2-BYTE-{{Cl|COM}}BO "; x {{Cl|AND (boolean)|AND}} 255; x \ 256; x2 = x \ 256 - {{Cl|IF}} x2 >= 32 {{Cl|AND (boolean)|AND}} x2 <= 255 {{Cl|THEN}} {{Cl|PRINT}} "[" + {{Cl|CHR$}}(x2) + "]" {{Cl|ELSE}} {{Cl|PRINT}} + {{Cl|IF}} x2 >= 32 {{Cl|AND (boolean)|AND}} x2 <= 255 {{Cl|THEN}} {{Cl|PRINT}} "[" + {{Cl|CHR$}}(x2) + "]" {{Cl|ELSE}} {{Cl|PRINT}} {{Cl|END IF}} - {{Cl|IF}} x >= 100000 {{Cl|AND (boolean)|AND}} x < 200000 {{Cl|THEN}} 'QB84 Virtual Key codes - {{Cl|PRINT}} "SDL VK"; x - 100000 + {{Cl|IF}} x >= 100000 {{Cl|AND (boolean)|AND}} x < 200000 {{Cl|THEN}} 'QB84 Virtual Key codes + {{Cl|PRINT}} "SDL VK"; x - 100000 {{Cl|END IF}} - {{Cl|IF}} x >= 200000 {{Cl|AND (boolean)|AND}} x < {{Cl|&H}}40000000 {{Cl|THEN}} - {{Cl|PRINT}} "QB64 VK"; x - 200000 + {{Cl|IF}} x >= 200000 {{Cl|AND (boolean)|AND}} x < {{Cl|&H}}40000000 {{Cl|THEN}} + {{Cl|PRINT}} "QB64 VK"; x - 200000 {{Cl|END IF}} - {{Cl|IF}} x >= {{Cl|&H}}40000000 {{Cl|THEN}} 'Unicode values (IME Input mode) - {{Cl|PRINT}} "UNICODE "; x - {{Cl|&H}}40000000; "0x" + {{Cl|HEX$}}(x - {{Cl|&H}}40000000) + " ..."; + {{Cl|IF}} x >= {{Cl|&H}}40000000 {{Cl|THEN}} 'Unicode values (IME Input mode) + {{Cl|PRINT}} "UNICODE "; x - {{Cl|&H}}40000000; "0x" + {{Cl|HEX$}}(x - {{Cl|&H}}40000000) + " ..."; cx = {{Cl|POS}}(1): cy = {{Cl|CSRLIN}} {{Cl|_FONT}} unifont {{Cl|LOCATE}} cy, cx @@ -102,7 +102,7 @@ unifont = {{Cl|_LOADFONT}}("cyberbit.ttf", 24, "UNICODE") {{small|Code by Galleon}} -<center>'''Find any keys that you cannot read or type in the IDE? Please report them at this forum link:''' http://www.qb64.net/forum/index.php?topic=1512.0</center> +<center>'''Find any keys that you cannot read or type in the IDE? Please report them at this forum link:''' http://www.qb64.net/forum/index.php?topic=1512.0</center> {{PageSeeAlso}} @@ -115,4 +115,4 @@ unifont = {{Cl|_LOADFONT}}("cyberbit.ttf", 24, "UNICODE") * [[Windows_Libraries#Hot_Keys_.28maximize.29|Windows hot keys]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_LASTAXIS.txt b/internal/help/_LASTAXIS.txt index a435694d9..21d924463 100644 --- a/internal/help/_LASTAXIS.txt +++ b/internal/help/_LASTAXIS.txt @@ -10,7 +10,7 @@ The [[_LASTAXIS]] function returns the number of axis a specified number INPUT d * Returns the number of axis that can be read on a specified device number within the number of [[_DEVICES]] found. * A valid number can be sent to the [[_AXIS]] function to find any relative axis movements. * The devices are listed in a numerical order determined by the OS and can be read by the [[DEVICE$]] function. -* '''The [[_DEVICES]] function must be read before using _LASTAXIS or an [[ERROR Codes|"Illegal Function Call" error]] will occur.''' +* '''The [[_DEVICES]] function must be read before using _LASTAXIS or an [[ERROR Codes|"Illegal Function Call" error]] will occur.''' * Devices include keyboard(1), mouse(2), joysticks, game pads and multiple stick game controllers. @@ -18,10 +18,10 @@ The [[_LASTAXIS]] function returns the number of axis a specified number INPUT d ''Example:'' Checking for the system's input devices and number of axis. {{CodeStart}} '' '' devices = {{Cl|_DEVICES}} 'MUST be read in order for other 2 device functions to work! -PRINT "Number of input devices found ="; devices +PRINT "Number of input devices found ="; devices FOR i = 1 TO devices PRINT {{Cl|_DEVICE$}}(i) - IF {{Cl|INSTR}}({{Cl|_DEVICE$}}(i), "[AXIS]") THEN PRINT "Axis:"; {{Cl|_LASTAXIS}}(i) + IF {{Cl|INSTR}}({{Cl|_DEVICE$}}(i), "[AXIS]") THEN PRINT "Axis:"; {{Cl|_LASTAXIS}}(i) NEXT '' '' {{CodeEnd}} {{OutputStart}}Number of input devices found = 2 @@ -41,4 +41,4 @@ Axis: 2 * [[ON STRIG(n)]], [[STRIG(n)]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_LASTBUTTON.txt b/internal/help/_LASTBUTTON.txt index d046516a2..970ebc3f4 100644 --- a/internal/help/_LASTBUTTON.txt +++ b/internal/help/_LASTBUTTON.txt @@ -10,7 +10,7 @@ The [[_LASTBUTTON]] function returns the number of buttons a specified INPUT dev * A valid number can be sent to the [[_BUTTON]] or [[_BUTTONCHANGE]] function to find any button events. * The specific device name and functions can be found by the [[_DEVICE$]] function [[STRING|string]]. * The devices are listed in a numerical order determined by the OS and can be read by the [[DEVICE$]] function. -* '''The [[_DEVICES]] function must be read before using _LASTBUTTON or an [[ERROR Codes|"Illegal Function Call" error]] will occur.''' +* '''The [[_DEVICES]] function must be read before using _LASTBUTTON or an [[ERROR Codes|"Illegal Function Call" error]] will occur.''' * Devices include keyboard (reported as 1), mouse (reported as 2), joysticks, game pads and multiple stick game controllers. @@ -18,10 +18,10 @@ The [[_LASTBUTTON]] function returns the number of buttons a specified INPUT dev ''Example:'' Checking for the system's input devices. {{CodeStart}} '' '' devices = {{Cl|_DEVICES}} 'MUST be read in order for other 2 device functions to work! -PRINT "Number of input devices found ="; devices +PRINT "Number of input devices found ="; devices FOR i = 1 TO devices PRINT {{Cl|_DEVICE$}}(i) - PRINT "Buttons:"; {{Cl|_LASTBUTTON}}(i) + PRINT "Buttons:"; {{Cl|_LASTBUTTON}}(i) NEXT '' '' {{CodeEnd}} {{OutputStart}}Number of input devices found = 2 @@ -43,4 +43,4 @@ Buttons: 3 * [[ON STRIG(n)]], [[STRIG(n)]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_LASTWHEEL.txt b/internal/help/_LASTWHEEL.txt index c92774504..989d70ae8 100644 --- a/internal/help/_LASTWHEEL.txt +++ b/internal/help/_LASTWHEEL.txt @@ -9,7 +9,7 @@ The [[_LASTWHEEL]] function returns the number of wheels a specified number INPU * Returns the number of wheels that can be used on a specified device number within the number of [[_DEVICES]] found. * A valid number can be sent to the [[_WHEEL]] function to find any relative positive or negative wheel movements. * The devices are listed in a numerical order determined by the OS and can be read by the [[_DEVICE$]] function. -* '''The [[_DEVICES]] function must be read before using _LASTWHEEL or an [[ERROR Codes|"Illegal Function Call" error]] may occur.''' +* '''The [[_DEVICES]] function must be read before using _LASTWHEEL or an [[ERROR Codes|"Illegal Function Call" error]] may occur.''' * Devices include keyboard (reported as 1), mouse (reported as 2), joysticks, game pads and multiple stick game controllers. @@ -17,10 +17,10 @@ The [[_LASTWHEEL]] function returns the number of wheels a specified number INPU ''Example:'' Checking for the system's input devices and number of wheels available. {{CodeStart}} '' '' devices = {{Cl|_DEVICES}} 'MUST be read in order for other 2 device functions to work! -PRINT "Number of input devices found ="; devices +PRINT "Number of input devices found ="; devices FOR i = 1 TO devices PRINT {{Cl|_DEVICE$}}(i) - IF {{Cl|INSTR}}({{Cl|_DEVICE$}}(i), "[WHEEL]") THEN PRINT "Wheels:"; {{Cl|_LASTWHEEL}}(i) + IF {{Cl|INSTR}}({{Cl|_DEVICE$}}(i), "[WHEEL]") THEN PRINT "Wheels:"; {{Cl|_LASTWHEEL}}(i) NEXT '' '' {{CodeEnd}} {{OutputStart}}Number of input devices found = 2 @@ -40,4 +40,4 @@ Wheels: 3 * [[ON STRIG(n)]], [[STRIG(n)]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_LIMIT.txt b/internal/help/_LIMIT.txt index 608612aa0..b5b7a7f62 100644 --- a/internal/help/_LIMIT.txt +++ b/internal/help/_LIMIT.txt @@ -18,7 +18,7 @@ The [[_LIMIT]] statement sets the loop repeat rate of a program to so many per s {{PageExamples}} ''Example:'' Limits loop execution to 30 frames per second and limits the program's CPU usage. {{CodeStart}} '' '' -{{Cl|PRINT}} "To Quit press ESC key!" +{{Cl|PRINT}} "To Quit press ESC key!" {{Cl|DO}} {{Cl|_LIMIT}} 30 {{Cl|PRINT}} {{Cl|CHR$}}(26); @@ -38,4 +38,4 @@ To Quit press ESC key! * [[SLEEP]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_LOADFONT.txt b/internal/help/_LOADFONT.txt index 903b39408..7ce790b45 100644 --- a/internal/help/_LOADFONT.txt +++ b/internal/help/_LOADFONT.txt @@ -3,30 +3,30 @@ The [[_LOADFONT]] function loads a TrueType font (.TTF) or an OpenType font (.OT {{PageSyntax}} -: {{Parameter|handle&}} = [[_LOADFONT]]({{Parameter|fontFileName$}}, {{Parameter|size%}}[, "{MONOSPACE|, BOLD|, ITALIC|, UNDERLINE|, UNICODE|, DONTBLEND}"]) +: {{Parameter|handle&}} = [[_LOADFONT]]({{Parameter|fontFileName$}}, {{Parameter|size%}}[, "{MONOSPACE|, BOLD|, ITALIC|, UNDERLINE|, UNICODE|, DONTBLEND}"]) {{PageDescription}} -* The assigned [[LONG]] font {{Parameter|handle&}} variable return value designates a font style to be used somewhere in a program. Valid handle values are greater than 0 ('''{{Parameter|handle&}} > 0'''). +* The assigned [[LONG]] font {{Parameter|handle&}} variable return value designates a font style to be used somewhere in a program. Valid handle values are greater than 0 ('''{{Parameter|handle&}} > 0'''). * {{Parameter|fontFileName$}} is the filename of a TrueType or OpenType font. Can include the path to the font file. Best practice is to include font files with a program. * If no path is specified for {{Parameter|fontFileName$}} and the font file isn't in the same folder as the resulting binary, QB64 attempts to load from the default ''C:\Windows\Fonts'' path. * {{Parameter|size%}} is the [[INTEGER]] height of the font. If the size is too large or small an [[ERROR Codes|error]] will occur. * Optional comma separated ''style'' parameter(s) used are literal [[STRING]]s (in quotes) or can be contained in variable(s). -** '''"MONOSPACE"''' loads a font with all characters occupying the same width. Results may be too spaced out for fonts that aren't designed for monospace use. -** '''"BOLD", "ITALIC"''' or '''"UNDERLINE"''' create bold, italic or underlined fonts when available in font. +** '''"MONOSPACE"''' loads a font with all characters occupying the same width. Results may be too spaced out for fonts that aren't designed for monospace use. +** '''"BOLD", "ITALIC"''' or '''"UNDERLINE"''' create bold, italic or underlined fonts when available in font. ***(valid for QB64 versions prior to 1.000). ***For '''QB64 1.000 or later''', you must specify the proper file name according to the desired attributes. For example, Courier New is in font '''cour.ttf''' while Courier New Bold is in font '''courbd.ttf''', as shipped with Windows. -** '''"UNICODE"''' loads Unicode fonts such as ''cyberbit.ttf'' which is included in the QB64 downloads. -** '''"DONTBLEND"''' turns off [[_ALPHA]] blending of fonts. This can also be done with the [[_DONTBLEND]] statement. +** '''"UNICODE"''' loads Unicode fonts such as ''cyberbit.ttf'' which is included in the QB64 downloads. +** '''"DONTBLEND"''' turns off [[_ALPHA]] blending of fonts. This can also be done with the [[_DONTBLEND]] statement. :* You can pass different font styles using different predefined [[STRING]] variable lists. You '''can''' include an empty style string. -* '''Always check that font handle values are greater than 0 ('''{{Parameter|handle&}} > 0''') before using them or [[ERROR Codes|illegal function errors]] may occur.''' +* '''Always check that font handle values are greater than 0 ('''{{Parameter|handle&}} > 0''') before using them or [[ERROR Codes|illegal function errors]] may occur.''' * '''NOTE: SCREEN 0 can only use ONE font on a screen page. Thus a style like underline would affect the entire page.''' * Font sizes can be found using the [[_FONTHEIGHT]] function. Font ''size''s can also affect [[SCREEN (statement)|SCREEN]] sizes. -* [[_FONTWIDTH]] can only measure monospaced fonts. '''"MONOSPACE" can be used to load a variable width font as a monospace font.''' +* [[_FONTWIDTH]] can only measure monospaced fonts. '''"MONOSPACE" can be used to load a variable width font as a monospace font.''' * [[_PRINTWIDTH]] can measure the width of a string of text in '''graphics modes only'''. Use one character to get the font's width. -<center> '''Font Handles'''</center> +<center> '''Font Handles'''</center> * Multiple fonts will require multiple font variable handles unless used and freed consecutively. * Font handles with values greater than 0 that are '''no longer used''' should be freed using [[_FREEFONT]]. * '''Predefined QB64''' font handle numbers can be substituted before freeing a font handle: @@ -38,21 +38,21 @@ The [[_LOADFONT]] function loads a TrueType font (.TTF) or an OpenType font (.OT * Font handle values of -1 (load failure) '''do not''' need to be freed. '''An [[ERROR Codes|error]] will occur if you try to free invalid handles.''' -<center> '''Font File Specs'''</center> +<center> '''Font File Specs'''</center> * Windows users should find '''TTF''' font files in the C:\WINDOWS\FONTS folder, but don't depend on unusual ones being there. -* '''Check the font file name. The name in the "viewer" is not necessarily the file's name. Use the name in properties (right click a font listed and choose Properties in the contextual menu)''' -* If a program is on a different drive than Windows, [[ENVIRON$]]("SYSTEMROOT") will return the path to the "WINDOWS" folder. Normally "C:\WINDOWS". Then add the "\FONTS\" folder and the font '''.TTF''' filename to the path [[STRING]]. +* '''Check the font file name. The name in the "viewer" is not necessarily the file's name. Use the name in properties (right click a font listed and choose Properties in the contextual menu)''' +* If a program is on a different drive than Windows, [[ENVIRON$]]("SYSTEMROOT") will return the path to the "WINDOWS" folder. Normally "C:\WINDOWS". Then add the "\FONTS\" folder and the font '''.TTF''' filename to the path [[STRING]]. {{PageExamples}} ''Example 1:'' You need to know that if you are in a text mode (such as SCREEN 0 - the default) then you will only be able to use mono-spaced (fixed width) fonts. {{CodeStart}} -rootpath$ = {{Cl|ENVIRON$}}("SYSTEMROOT") 'normally "C:\WINDOWS" -fontfile$ = rootpath$ + "\Fonts\cour.ttf" 'TTF file in Windows -style$ = "monospace" 'font style is not case sensitive +rootpath$ = {{Cl|ENVIRON$}}("SYSTEMROOT") 'normally "C:\WINDOWS" +fontfile$ = rootpath$ + "\Fonts\cour.ttf" 'TTF file in Windows +style$ = "monospace" 'font style is not case sensitive f& ={{Cl|_LOADFONT}}(fontfile$, 30, style$) {{Cl|_FONT}} f& -{{Cl|PRINT}} "Hello!" +{{Cl|PRINT}} "Hello!" {{CodeEnd}} {{OutputStart}} @@ -61,7 +61,7 @@ Hello! {{OutputEnd}} -''Note:'' 30 means each row of text (including vertical spacing) will be exactly 30 pixels high. This may make some program screens larger. If you don't want a style listed just use style$ = "" if using a [[STRING]] variable for different calls. +''Note:'' 30 means each row of text (including vertical spacing) will be exactly 30 pixels high. This may make some program screens larger. If you don't want a style listed just use style$ = "" if using a [[STRING]] variable for different calls. @@ -71,15 +71,15 @@ Hello! i& ={{Cl|_NEWIMAGE}}(800,600,32) {{Cl|SCREEN (statement)|SCREEN}} i& {{Cl|COLOR}} &HC0FFFF00,&H200000FF -f& ={{Cl|_LOADFONT}}("C:\Windows\Fonts\times.ttf", 25) 'normal style -{{Cl|PRINT}} "Hello!" +f& ={{Cl|_LOADFONT}}("C:\Windows\Fonts\times.ttf", 25) 'normal style +{{Cl|PRINT}} "Hello!" {{CodeEnd}} {{OutputStart}}Hello! {{OutputEnd}} -:''Note:'' You can load a fixed width font file without using the "monospace" option and it will be treated as variable width. This can be useful because LOCATE treats the horizontal position as an offset in pixels for variable width fonts. +:''Note:'' You can load a fixed width font file without using the "monospace" option and it will be treated as variable width. This can be useful because LOCATE treats the horizontal position as an offset in pixels for variable width fonts. ''Example 3:'' Loading a [[Unicode]] font, ''cyberbit.ttf'', which was downloaded with QB64: @@ -94,14 +94,14 @@ f& ={{Cl|_LOADFONT}}("C:\Windows\Fonts\times.ttf", 25) 'normal st FileName$ = {{Cl|SPACE$}}(512) Result = GetModuleFileNameA(0, FileName$, {{Cl|LEN}}(FileName$)) -{{Cl|IF...THEN|IF}} Result {{Cl|THEN}} {{Cl|PRINT}} "CURRENT PROGRAM (ASCII): "; {{Cl|LEFT$}}(FileName$, Result) +{{Cl|IF...THEN|IF}} Result {{Cl|THEN}} {{Cl|PRINT}} "CURRENT PROGRAM (ASCII): "; {{Cl|LEFT$}}(FileName$, Result) 'load a unicode font -f = {{Cl|_LOADFONT}}("cyberbit.ttf", 24, "UNICODE") +f = {{Cl|_LOADFONT}}("cyberbit.ttf", 24, "UNICODE") {{Cl|_FONT}} f Result = GetModuleFileNameW(0, FileName$, {{Cl|LEN}}(FileName$) \ 2) {{Cl|LOCATE}} 2, 1 -{{Cl|PRINT}} QuickCP437toUTF32$("CURRENT PROGRAM (UTF): ") + QuickUTF16toUTF32$({{Cl|LEFT$}}(FileName$, Result * 2)) +{{Cl|PRINT}} QuickCP437toUTF32$("CURRENT PROGRAM (UTF): ") + QuickUTF16toUTF32$({{Cl|LEFT$}}(FileName$, Result * 2)) {{Cl|_FONT}} 16 'restore CP437 font {{Cl|FUNCTION}} QuickCP437toUTF32$ (a$) @@ -133,4 +133,4 @@ QuickUTF16toUTF32$ = b$ * [[Windows_Libraries#Font_Dialog_Box|Windows Font Dialog Box]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_LOADIMAGE.txt b/internal/help/_LOADIMAGE.txt index 04810a2aa..5c333632f 100644 --- a/internal/help/_LOADIMAGE.txt +++ b/internal/help/_LOADIMAGE.txt @@ -8,15 +8,15 @@ The [[_LOADIMAGE]] function loads an image into memory and returns valid [[LONG] {{Parameters}} * {{Parameter|filename$}} is literal or variable [[STRING]] file name value. -* Optional {{Parameter|mode%}} [[INTEGER]] values can be '''any valid [[SCREEN|screen]] mode''' except zero, also: -** 256 = 8-bit (256-color) +* Optional {{Parameter|mode%}} [[INTEGER]] values can be: +** 256 = 8-bit (256-color, ''QB64 versions prior to 1.000'') ** 32 = 32-bit ** 33 = hardware image {{PageDescription}} -* File types supported: BMP, JPG, PNG, GIF, PNM, XPM, XCF, PCX, TIF, LBM, and TGA. A path can also be given. -* The {{Parameter|mode%}} can designate 256 (8 bit), 32 bit color or 33 ('''version 1.000 and up'''). Omit to use the current graphic screen settings. +* 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]]. @@ -36,7 +36,7 @@ The [[_LOADIMAGE]] function loads an image into memory and returns valid [[LONG] colors to the current palette: {{CodeStart}} '' '' {{Cl|SCREEN (statement)|SCREEN}} 13 -i& = {{Cl|_LOADIMAGE}}("mypic.jpg") +i& = {{Cl|_LOADIMAGE}}("mypic.jpg") {{Cl|_PUTIMAGE}}, i& '' '' {{CodeEnd}} @@ -45,7 +45,7 @@ i& = {{Cl|_LOADIMAGE}}("mypic.jpg") palette as the current palette: {{CodeStart}} '' '' {{Cl|SCREEN (statement)|SCREEN}} 13 -i& = {{Cl|_LOADIMAGE}}("mypic256col.bmp", 256) +i& = {{Cl|_LOADIMAGE}}("mypic256col.bmp", 256) {{Cl|_COPYPALETTE}} i&, 0 {{Cl|_PUTIMAGE}}, i& '' '' {{CodeEnd}} @@ -53,7 +53,7 @@ i& = {{Cl|_LOADIMAGE}}("mypic256col.bmp", 256) ''Example 3:'' Want to display an image in 32-bit color using its resolution as a program screen: {{CodeStart}} '' '' -i& = {{Cl|_LOADIMAGE}}("mypic.jpg", 32) +i& = {{Cl|_LOADIMAGE}}("mypic.jpg", 32) {{Cl|SCREEN (statement)|SCREEN}} i& '' '' {{CodeEnd}} @@ -61,26 +61,26 @@ i& = {{Cl|_LOADIMAGE}}("mypic.jpg", 32) ''Example 4:'' [[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 +img& = {{Cl|_LOADIMAGE}}("QB64.PNG") 'load the image file to be drawn wide% = {{Cl|_WIDTH (function)|_WIDTH}}(img&): deep% = {{Cl|_HEIGHT}}(img&) -TLC$ = "BL" + {{Cl|STR$}}(wide% \ 2) + "BU" + {{Cl|STR$}}(deep% \ 2) 'start draw at top left corner -RET$ = "BD BL" + {{Cl|STR$}}(wide%) 'return to left side of image +TLC$ = "BL" + {{Cl|STR$}}(wide% \ 2) + "BU" + {{Cl|STR$}}(deep% \ 2) 'start draw at top left corner +RET$ = "BD BL" + {{Cl|STR$}}(wide%) 'return to left side of image {{Cl|_SOURCE}} img& {{Cl|_DEST}} 0 DO {{Cl|FOR...NEXT|FOR}} angle% = 0 {{Cl|TO}} 360 {{Cl|STEP}} 15 {{Cl|CLS}} - {{Cl|DRAW}} "BM400, 300" + "TA=" + {{Cl|VARPTR$}}(angle%) + TLC$ + {{Cl|DRAW}} "BM400, 300" + "TA=" + {{Cl|VARPTR$}}(angle%) + TLC$ {{Cl|FOR...NEXT|FOR}} y = 0 {{Cl|TO}} deep% - 1 {{Cl|FOR...NEXT|FOR}} x = 0 {{Cl|TO}} wide% - 1 - {{Cl|DRAW}} "C" + {{Cl|STR$}}({{Cl|POINT}}(x, y)) + "R1" 'color and DRAW each pixel + {{Cl|DRAW}} "C" + {{Cl|STR$}}({{Cl|POINT}}(x, y)) + "R1" 'color and DRAW each pixel {{Cl|NEXT}} {{Cl|DRAW}} RET$ {{Cl|NEXT}} {{Cl|_DISPLAY}} 'NOTE: CPU usage will be HIGH! {{Cl|NEXT}} -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} > "" '' '' +{{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. @@ -103,4 +103,4 @@ DO * [[Bitmaps]], [[Icons and Cursors]], [[GIF Images]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_MAPTRIANGLE.txt b/internal/help/_MAPTRIANGLE.txt index 18773fa60..660576b34 100644 --- a/internal/help/_MAPTRIANGLE.txt +++ b/internal/help/_MAPTRIANGLE.txt @@ -13,7 +13,7 @@ The [[_MAPTRIANGLE]] statement maps a triangular portion of an image onto a dest {{Parameters}} -* The '''_SEAMLESS''' option makes the triangle skip the right-most and bottom-most pixels of the triangle. When you make larger objects using several triangles, there can be a "seam" where they overlap when using alpha transparency and the seam would be twice as bright. '''_SEAMLESS''' is ignored when rendering 3D content and is not yet supported when drawing 2D hardware images.''' +* The '''_SEAMLESS''' option makes the triangle skip the right-most and bottom-most pixels of the triangle. When you make larger objects using several triangles, there can be a "seam" where they overlap when using alpha transparency and the seam would be twice as bright. '''_SEAMLESS''' is ignored when rendering 3D content and is not yet supported when drawing 2D hardware images.''' * For 3D drawing use the '''_CLOCKWISE''' and '''_ANTICLOCKWISE''' arguments to only draw triangles in the correct direction. See ''Example 4''. * Coordinates are [[SINGLE]] values where whole numbers represent the exact center of a pixel of the source texture. * {{Parameter|source&}} and optional {{Parameter|destination&}} are [[LONG]] image or screen page handles. @@ -37,17 +37,17 @@ The [[_MAPTRIANGLE]] statement maps a triangular portion of an image onto a dest {{CodeStart}} '' '' {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(800, 600, 32) -Image& = {{Cl|_LOADIMAGE}}("qb64_trans.png") '<<< [http://www.qb64.net/qb64_trans.png Image from top of QB64 Forum] +Image& = {{Cl|_LOADIMAGE}}("qb64_trans.png") '<<< [http://www.qb64.net/qb64_trans.png Image from top of QB64 Forum] {{Cl|DO}} {{Cl|CLS}} RotoZoom 400, 300, Image&, 1.5 + {{Cl|SIN}}(zoom), angle - {{Cl|LOCATE}} 1, 1: {{Cl|PRINT}} "Angle:"; {{Cl|CINT}}(angle) - {{Cl|PRINT USING|PRINT}} "Zoom"; {{Cl|PRINT USING|USING}} "##.###"; 1.5 + {{Cl|SIN}}(zoom) + {{Cl|LOCATE}} 1, 1: {{Cl|PRINT}} "Angle:"; {{Cl|CINT}}(angle) + {{Cl|PRINT USING|PRINT}} "Zoom"; {{Cl|PRINT USING|USING}} "##.###"; 1.5 + {{Cl|SIN}}(zoom) {{Cl|_DISPLAY}} - angle = angle + .5: {{Cl|IF...THEN|IF}} angle >= 360 {{Cl|THEN}} angle = angle - 360 + angle = angle + .5: {{Cl|IF...THEN|IF}} angle >= 360 {{Cl|THEN}} angle = angle - 360 zoom = zoom + .01 -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" {{Cl|END}} {{Cl|SUB}} RotoZoom (X {{Cl|AS}} {{Cl|LONG}}, Y {{Cl|AS}} {{Cl|LONG}}, Image {{Cl|AS}} {{Cl|LONG}}, Scale {{Cl|AS}} {{Cl|SINGLE}}, Rotation {{Cl|AS}} {{Cl|SINGLE}}) @@ -149,9 +149,9 @@ PLANECOL(3) = 6 PLANECOL(4) = 7 PLANECOL(5) = 8 ' -{{Cl|_TITLE}} "QB64 _MAPTRIANGLE CUBE DEMO" +{{Cl|_TITLE}} "QB64 _MAPTRIANGLE CUBE DEMO" {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(800, 600, 32) -TextureImage& = {{Cl|_LOADIMAGE}}("qb64_trans.png") ''''<<<< '''[http://www.qb64.net/qb64_trans.png Image from top of QB64 Forum] +TextureImage& = {{Cl|_LOADIMAGE}}("qb64_trans.png") ''''<<<< '''[http://www.qb64.net/qb64_trans.png Image from top of QB64 Forum] '{{Cl|_PUTIMAGE}} , Image& DO @@ -196,7 +196,7 @@ DO T3& = x3& * (y1& * Z2& - y2& * Z1&) ' VISIBLE& = T1& - T2& - T3& - {{Cl|IF...THEN|IF}} VISIBLE& > 0 {{Cl|THEN}} + {{Cl|IF...THEN|IF}} VISIBLE& > 0 {{Cl|THEN}} ' DRAW PLANE xx1% = DPLANE2D(0, 0): yy1% = DPLANE2D(0, 1) xx2% = DPLANE2D(1, 0): yy2% = DPLANE2D(1, 1) @@ -208,38 +208,40 @@ DO xx1% = DPLANE2D(0, 0): yy1% = DPLANE2D(0, 1) xx3% = DPLANE2D(2, 0): yy3% = DPLANE2D(2, 1) xx4% = DPLANE2D(3, 0): yy4% = DPLANE2D(3, 1) - {{Cl|_MAPTRIANGLE}} (0, 0)-(255, 255)-(255, 0), TextureImage& TO(xx3%, yy3%)-(xx1%, yy1%)-(xx4%, yy4%) + {{Cl|_MAPTRIANGLE}} (0, 0 +4000 +)-(255, 255)-(255, 0), TextureImage& TO(xx3%, yy3%)-(xx1%, yy1%)-(xx4%, yy4%) 'CALL DrawTriangle(xx1%, yy1%, xx3%, yy3%, xx4%, yy4%, col%) {{Cl|END IF}} {{Cl|NEXT}} ' ' ROTATE OBJECT PIT(OB&) = PIT(OB&) + 5 - {{Cl|IF...THEN|IF}} PIT(OB&) > 359 {{Cl|THEN}} PIT(OB&) = 0 + {{Cl|IF...THEN|IF}} PIT(OB&) > 359 {{Cl|THEN}} PIT(OB&) = 0 YAW(OB&) = YAW(OB&) + 7 - {{Cl|IF...THEN|IF}} YAW(OB&) > 359 {{Cl|THEN}} YAW(OB&) = 0 + {{Cl|IF...THEN|IF}} YAW(OB&) > 359 {{Cl|THEN}} YAW(OB&) = 0 ROL(OB&) = ROL(OB&) + 9 - {{Cl|IF...THEN|IF}} ROL(OB&) > 359 {{Cl|THEN}} ROL(OB&) = 0 + {{Cl|IF...THEN|IF}} ROL(OB&) > 359 {{Cl|THEN}} ROL(OB&) = 0 {{Cl|NEXT}} ' ' Calculate Frames per Second frames% = frames% + 1 - {{Cl|IF...THEN|IF}} oldtime$ <> {{Cl|TIME$}} {{Cl|THEN}} + {{Cl|IF...THEN|IF}} oldtime$ <> {{Cl|TIME$}} {{Cl|THEN}} fps% = frames% frames% = 1 oldtime$ = {{Cl|TIME$}} {{Cl|END IF}} - {{Cl|COLOR}} {{Cl|_RGB}}(255, 255, 255): {{Cl|LOCATE}} 1, 1: {{Cl|PRINT}} "FPS :"; fps% + {{Cl|COLOR}} {{Cl|_RGB}}(255, 255, 255): {{Cl|LOCATE}} 1, 1: {{Cl|PRINT}} "FPS :"; fps% ' ' Show Image on Screen {{Cl|_DISPLAY}} -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" {{Cl|WIDTH}} 80: {{Cl|SCREEN}} 0: {{Cl|CLS}} {{Cl|SUB}} DrawHline (fromx%, tox%, yy%, col%) '{{Cl|DEF SEG}} = {{Cl|&H}}A000 - '{{Cl|IF...THEN|IF}} fromx% > tox% {{Cl|THEN}} {{Cl|SWAP}} fromx%, tox% + '{{Cl|IF...THEN|IF}} fromx% > tox% {{Cl|THEN}} {{Cl|SWAP}} fromx%, tox% 'yyy& = yy% 'sloc& = yyy& * 320 + fromx% 'eloc& = sloc& + (tox% - fromx%) @@ -253,12 +255,12 @@ DO {{Cl|SUB}} DrawTriangle (x1%, y1%, x2%, y2%, x3%, y3%, col%) DO sflag% = 0 - {{Cl|IF...THEN|IF}} y1% > y2% {{Cl|THEN}} + {{Cl|IF...THEN|IF}} y1% > y2% {{Cl|THEN}} sflag% = 1 {{Cl|SWAP}} y1%, y2% {{Cl|SWAP}} x1%, x2% {{Cl|END IF}} - {{Cl|IF...THEN|IF}} y2% > y3% {{Cl|THEN}} + {{Cl|IF...THEN|IF}} y2% > y3% {{Cl|THEN}} sflag% = 1 {{Cl|SWAP}} y2%, y3% {{Cl|SWAP}} x2%, x3% @@ -269,12 +271,12 @@ DO ' Draw a flat bottomed triangle ydiff1% = y2% - y1% ydiff2% = y3% - y1% - {{Cl|IF...THEN|IF}} ydiff1% <> 0 {{Cl|THEN}} + {{Cl|IF...THEN|IF}} ydiff1% <> 0 {{Cl|THEN}} slope1! = (x2% - x1%) / ydiff1% {{Cl|ELSE}} slope1! = 0 {{Cl|END IF}} - {{Cl|IF...THEN|IF}} ydiff2% <> 0 {{Cl|THEN}} + {{Cl|IF...THEN|IF}} ydiff2% <> 0 {{Cl|THEN}} slope2! = (x3% - x1%) / ydiff2% {{Cl|ELSE}} slope2! = 0 @@ -292,12 +294,12 @@ DO ' Draw a flat topped triangle ydiff1% = y3% - y1% ydiff2% = y3% - y2% - {{Cl|IF...THEN|IF}} ydiff1% <> 0 {{Cl|THEN}} + {{Cl|IF...THEN|IF}} ydiff1% <> 0 {{Cl|THEN}} slope1! = (x3% - x1%) / ydiff1% {{Cl|ELSE}} slope1! = 0 {{Cl|END IF}} - {{Cl|IF...THEN|IF}} ydiff2% <> 0 {{Cl|THEN}} + {{Cl|IF...THEN|IF}} ydiff2% <> 0 {{Cl|THEN}} slope2! = (x3% - x2%) / ydiff2% {{Cl|ELSE}} slope2! = 0 @@ -315,12 +317,12 @@ DO ' First draw the flat bottom portion (top half) ydiff1% = y2% - y1% ydiff2% = y3% - y1% - {{Cl|IF...THEN|IF}} ydiff1% <> 0 {{Cl|THEN}} + {{Cl|IF...THEN|IF}} ydiff1% <> 0 {{Cl|THEN}} slope1! = (x2% - x1%) / ydiff1% {{Cl|ELSE}} slope1! = 0 {{Cl|END IF}} - {{Cl|IF...THEN|IF}} ydiff2% <> 0 {{Cl|THEN}} + {{Cl|IF...THEN|IF}} ydiff2% <> 0 {{Cl|THEN}} slope2! = (x3% - x1%) / ydiff2% {{Cl|ELSE}} slope2! = 0 @@ -337,12 +339,12 @@ DO y1% = y2% ydiff1% = y3% - y1% ydiff2% = y3% - y2% - {{Cl|IF...THEN|IF}} ydiff1% <> 0 {{Cl|THEN}} + {{Cl|IF...THEN|IF}} ydiff1% <> 0 {{Cl|THEN}} slope1! = (x3% - x1%) / ydiff1% {{Cl|ELSE}} slope1! = 0 {{Cl|END IF}} - {{Cl|IF...THEN|IF}} ydiff2% <> 0 {{Cl|THEN}} + {{Cl|IF...THEN|IF}} ydiff2% <> 0 {{Cl|THEN}} slope2! = (x3% - x2%) / ydiff2% {{Cl|ELSE}} slope2! = 0 @@ -438,10 +440,10 @@ PLANECOL(3) = 6 PLANECOL(4) = 7 PLANECOL(5) = 8 ' -{{Cl|_TITLE}} "QB64 {{Cl|_MAPTRIANGLE}} CUBE DEMO" +{{Cl|_TITLE}} "QB64 {{Cl|_MAPTRIANGLE}} CUBE DEMO" {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(800, 600, 32) -TextureImage& = {{Cl|_LOADIMAGE}}("qb64_trans.png", 32)'<<<< Image from top of QB64 Forum http://www.qb64.net/qb64_trans.png +TextureImage& = {{Cl|_LOADIMAGE}}("qb64_trans.png", 32)'<<<< Image from top of QB64 Forum http://www.qb64.net/qb64_trans.png {{Cl|_SETALPHA}} 128, , TextureImage& TextureImage& = {{Cl|_COPYIMAGE}}(TextureImage&, 33)'copy of hardware image @@ -490,7 +492,7 @@ DO T3& = x3& * (y1& * Z2& - y2& * Z1&) ' VISIBLE& = T1& - T2& - T3& - {{Cl|IF...THEN|IF}} VISIBLE& > 0 {{Cl|THEN}} + {{Cl|IF...THEN|IF}} VISIBLE& > 0 {{Cl|THEN}} ' {{Cl|DRAW}} PLANE xx1% = DPLANE2D(0, 0): yy1% = DPLANE2D(0, 1) xx2% = DPLANE2D(1, 0): yy2% = DPLANE2D(1, 1) @@ -513,30 +515,30 @@ DO ' ' ROTATE OBJECT PIT(OB&) = PIT(OB&) + 5 - {{Cl|IF...THEN|IF}} PIT(OB&) > 359 {{Cl|THEN}} PIT(OB&) = 0 + {{Cl|IF...THEN|IF}} PIT(OB&) > 359 {{Cl|THEN}} PIT(OB&) = 0 YAW(OB&) = YAW(OB&) + 7 - {{Cl|IF...THEN|IF}} YAW(OB&) > 359 {{Cl|THEN}} YAW(OB&) = 0 + {{Cl|IF...THEN|IF}} YAW(OB&) > 359 {{Cl|THEN}} YAW(OB&) = 0 ROL(OB&) = ROL(OB&) + 9 - {{Cl|IF...THEN|IF}} ROL(OB&) > 359 {{Cl|THEN}} ROL(OB&) = 0 + {{Cl|IF...THEN|IF}} ROL(OB&) > 359 {{Cl|THEN}} ROL(OB&) = 0 {{Cl|NEXT}} ' ' Calculate Frames per Second frames% = frames% + 1 - {{Cl|IF...THEN|IF}} oldtime$ <> {{Cl|TIME$}} {{Cl|THEN}} + {{Cl|IF...THEN|IF}} oldtime$ <> {{Cl|TIME$}} {{Cl|THEN}} fps% = frames% frames% = 1 oldtime$ = {{Cl|TIME$}} {{Cl|END IF}} - {{Cl|COLOR}} {{Cl|_RGB}}(255, 255, 255): {{Cl|LOCATE}} 1, 1: {{Cl|PRINT}} "FPS :"; fps% + {{Cl|COLOR}} {{Cl|_RGB}}(255, 255, 255): {{Cl|LOCATE}} 1, 1: {{Cl|PRINT}} "FPS :"; fps% ' ' Show Image on Screen {{Cl|_DISPLAY}} -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" {{Cl|WIDTH}} 80: {{Cl|SCREEN}} 0: {{Cl|CLS}} {{Cl|SUB}} DrawHline (fromx%, tox%, yy%, col%) '{{Cl|DEF SEG}} = {{Cl|&H}}A000 -'{{Cl|IF...THEN|IF}} fromx% > tox% {{Cl|THEN}} {{Cl|SWAP}} fromx%, tox% +'{{Cl|IF...THEN|IF}} fromx% > tox% {{Cl|THEN}} {{Cl|SWAP}} fromx%, tox% 'yyy& = yy% 'sloc& = yyy& * 320 + fromx% 'eloc& = sloc& + (tox% - fromx%) @@ -550,12 +552,12 @@ DO {{Cl|SUB}} DrawTriangle (x1%, y1%, x2%, y2%, x3%, y3%, col%) DO sflag% = 0 - {{Cl|IF...THEN|IF}} y1% > y2% {{Cl|THEN}} + {{Cl|IF...THEN|IF}} y1% > y2% {{Cl|THEN}} sflag% = 1 {{Cl|SWAP}} y1%, y2% {{Cl|SWAP}} x1%, x2% {{Cl|END IF}} - {{Cl|IF...THEN|IF}} y2% > y3% {{Cl|THEN}} + {{Cl|IF...THEN|IF}} y2% > y3% {{Cl|THEN}} sflag% = 1 {{Cl|SWAP}} y2%, y3% {{Cl|SWAP}} x2%, x3% @@ -566,12 +568,12 @@ DO ' Draw a flat bottomed triangle ydiff1% = y2% - y1% ydiff2% = y3% - y1% - {{Cl|IF...THEN|IF}} ydiff1% <> 0 {{Cl|THEN}} + {{Cl|IF...THEN|IF}} ydiff1% <> 0 {{Cl|THEN}} slope1! = (x2% - x1%) / ydiff1% {{Cl|ELSE}} slope1! = 0 {{Cl|END IF}} - {{Cl|IF...THEN|IF}} ydiff2% <> 0 {{Cl|THEN}} + {{Cl|IF...THEN|IF}} ydiff2% <> 0 {{Cl|THEN}} slope2! = (x3% - x1%) / ydiff2% {{Cl|ELSE}} slope2! = 0 @@ -589,12 +591,12 @@ DO ' Draw a flat topped triangle ydiff1% = y3% - y1% ydiff2% = y3% - y2% - {{Cl|IF...THEN|IF}} ydiff1% <> 0 {{Cl|THEN}} + {{Cl|IF...THEN|IF}} ydiff1% <> 0 {{Cl|THEN}} slope1! = (x3% - x1%) / ydiff1% {{Cl|ELSE}} slope1! = 0 {{Cl|END IF}} - {{Cl|IF...THEN|IF}} ydiff2% <> 0 {{Cl|THEN}} + {{Cl|IF...THEN|IF}} ydiff2% <> 0 {{Cl|THEN}} slope2! = (x3% - x2%) / ydiff2% {{Cl|ELSE}} slope2! = 0 @@ -612,12 +614,12 @@ DO ' First draw the flat bottom portion (top half) ydiff1% = y2% - y1% ydiff2% = y3% - y1% - {{Cl|IF...THEN|IF}} ydiff1% <> 0 {{Cl|THEN}} + {{Cl|IF...THEN|IF}} ydiff1% <> 0 {{Cl|THEN}} slope1! = (x2% - x1%) / ydiff1% {{Cl|ELSE}} slope1! = 0 {{Cl|END IF}} - {{Cl|IF...THEN|IF}} ydiff2% <> 0 {{Cl|THEN}} + {{Cl|IF...THEN|IF}} ydiff2% <> 0 {{Cl|THEN}} slope2! = (x3% - x1%) / ydiff2% {{Cl|ELSE}} slope2! = 0 @@ -634,12 +636,14 @@ DO y1% = y2% ydiff1% = y3% - y1% ydiff2% = y3% - y2% - {{Cl|IF...THEN|IF}} ydiff1% <> 0 {{Cl|THEN}} + {{Cl|IF... +2fb2 +THEN|IF}} ydiff1% <> 0 {{Cl|THEN}} slope1! = (x3% - x1%) / ydiff1% {{Cl|ELSE}} slope1! = 0 {{Cl|END IF}} - {{Cl|IF...THEN|IF}} ydiff2% <> 0 {{Cl|THEN}} + {{Cl|IF...THEN|IF}} ydiff2% <> 0 {{Cl|THEN}} slope2! = (x3% - x2%) / ydiff2% {{Cl|ELSE}} slope2! = 0 @@ -696,7 +700,7 @@ DO {{Cl|_DISPLAY}} {{Cl|LOOP}} '' '' {{CodeEnd}} -: '''Tip:''' If you are using Linux you might want to replace "[[_SCREENIMAGE]]" with a [[_LOADIMAGE]] command if you don't see anything. +: '''Tip:''' If you are using Linux you might want to replace "[[_SCREENIMAGE]]" with a [[_LOADIMAGE]] command if you don't see anything. {{PageSeeAlso}} @@ -708,4 +712,4 @@ DO * [[Hardware images]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_MAPUNICODE.txt b/internal/help/_MAPUNICODE.txt index 1c8a41259..be81a4775 100644 --- a/internal/help/_MAPUNICODE.txt +++ b/internal/help/_MAPUNICODE.txt @@ -19,7 +19,7 @@ The [[_MAPUNICODE]] statement maps a [[Unicode]] value to an [[ASCII]] character ''Example:'' Converting the extended [[ASCII]] characters to other characters using DATA from the Unicode [[Code Pages]]. {{CodeStart}} '' '' {{Cl|SCREEN}} 0 -{{Cl|_FONT}} {{Cl|_LOADFONT}}("C:\windows\fonts\cour.ttf", 20, "MONOSPACE") +{{Cl|_FONT}} {{Cl|_LOADFONT}}("C:\windows\fonts\cour.ttf", 20, "MONOSPACE") {{Cl|RESTORE}} Microsoft_pc_cpMIK {{Cl|FOR...NEXT|FOR}} ASCIIcode = 128 {{Cl|TO}} 255 @@ -29,7 +29,7 @@ The [[_MAPUNICODE]] statement maps a [[Unicode]] value to an [[ASCII]] character {{Cl|FOR...NEXT|FOR}} i = 128 {{Cl|TO}} 255 - {{Cl|PRINT}} {{Cl|CHR$}}(i) + " "; + {{Cl|PRINT}} {{Cl|CHR$}}(i) + " "; cnt = cnt + 1 {{Cl|IF...THEN|IF}} cnt {{Cl|MOD}} 16 = 0 {{Cl|THEN}} {{Cl|PRINT}} {{Cl|NEXT}} @@ -58,4 +58,4 @@ Microsoft_pc_cpMIK: * [[Text Using Graphics]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_MAPUNICODE_(function).txt b/internal/help/_MAPUNICODE_(function).txt index fff6820f1..d3b8711d2 100644 --- a/internal/help/_MAPUNICODE_(function).txt +++ b/internal/help/_MAPUNICODE_(function).txt @@ -18,7 +18,7 @@ The [[_MAPUNICODE]] function returns the [[Unicode]] (UTF-32) code point value o {{CodeStart}} {{Cl|DIM}} Unicode&(255) {{Cl|SCREEN (statement)|SCREEN}} 0 -{{Cl|_FONT}} {{Cl|_LOADFONT}}("C:\Windows\Fonts\Cour.ttf", 20, "MONOSPACE") 'select monospace font +{{Cl|_FONT}} {{Cl|_LOADFONT}}("C:\Windows\Fonts\Cour.ttf", 20, "MONOSPACE") 'select monospace font {{Cl|FOR...NEXT|FOR}} ascii = 0 {{Cl|TO}} 255 Unicode&(ascii) = {{Cl|_MAPUNICODE (function)|_MAPUNICODE}}(ascii) 'read Unicode values @@ -36,4 +36,4 @@ Unicode&(ascii) = {{Cl|_MAPUNICODE (function)|_MAPUNICODE}}(ascii) 'read * [[Text Using Graphics]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_MEM.txt b/internal/help/_MEM.txt index 953d74f43..ee0d698eb 100644 --- a/internal/help/_MEM.txt +++ b/internal/help/_MEM.txt @@ -63,7 +63,7 @@ END TYPE ''Example 1:'' Demonstration of .IMAGE to determine an image's dimensions, .TYPE to verify the type and [[_MEMEXISTS]] to check image has not been freed {{CodeStart}} {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(500, 500, 32) -i = {{Cl|_LOADIMAGE}}("qb64_trans.png", 32) +i = {{Cl|_LOADIMAGE}}("qb64_trans.png", 32) {{Cl|_PUTIMAGE}} (0, 0), i {{Cl|DIM}} m {{Cl|AS}} {{Cl|_MEM}} m = {{Cl|_MEMIMAGE}}(i) @@ -71,13 +71,13 @@ m = {{Cl|_MEMIMAGE}}(i) '{{Cl|_MEMFREE}} m t = m.{{Cl|TYPE}} {{Cl|IF...THEN|IF}} t {{Cl|AND (boolean)|AND}} 2048 {{Cl|THEN}} - {{Cl|PRINT}} "this is/was an image" + {{Cl|PRINT}} "this is/was an image" {{Cl|IF...THEN|IF}} {{Cl|_MEMEXISTS}}(m) {{Cl|THEN}} 'check if memory m is still available - {{Cl|PRINT}} t {{Cl|AND (boolean)|AND}} 7; "bytes per pixel" - {{Cl|PRINT}} "image handle "; m.IMAGE - {{Cl|PRINT}} "image width"; {{Cl|_WIDTH (function)|_WIDTH}}(m.IMAGE) - {{Cl|PRINT}} "image height"; {{Cl|_HEIGHT}}(m.IMAGE) - {{Cl|ELSE}} {{Cl|PRINT}} "Memory already freed!" + {{Cl|PRINT}} t {{Cl|AND (boolean)|AND}} 7; "bytes per pixel" + {{Cl|PRINT}} "image handle "; m.IMAGE + {{Cl|PRINT}} "image width"; {{Cl|_WIDTH (function)|_WIDTH}}(m.IMAGE) + {{Cl|PRINT}} "image height"; {{Cl|_HEIGHT}}(m.IMAGE) + {{Cl|ELSE}} {{Cl|PRINT}} "Memory already freed!" {{Cl|END IF}} {{Cl|END IF}} '' '' {{CodeEnd}} @@ -86,11 +86,11 @@ t = m.{{Cl|TYPE}} ''Example 2:'' Converts the current [[_DEST|destination]] [[SCREEN]] 13 image memory altered by [[PSET]] to a [[STRING]] value. SCREEN 13 only. {{CodeStart}} '' '' {{Cl|SCREEN}} 13 -{{Cl|PSET}} (0, 0), {{Cl|ASC}}("H") 'top left corner of screen -{{Cl|PSET}} (1, 0), {{Cl|ASC}}("E") -{{Cl|PSET}} (2, 0), {{Cl|ASC}}("L") -{{Cl|PSET}} (3, 0), {{Cl|ASC}}("L") -{{Cl|PSET}} (4, 0), {{Cl|ASC}}("O") +{{Cl|PSET}} (0, 0), {{Cl|ASC}}("H") 'top left corner of screen +{{Cl|PSET}} (1, 0), {{Cl|ASC}}("E") +{{Cl|PSET}} (2, 0), {{Cl|ASC}}("L") +{{Cl|PSET}} (3, 0), {{Cl|ASC}}("L") +{{Cl|PSET}} (4, 0), {{Cl|ASC}}("O") {{Cl|DIM}} m {{Cl|AS}} {{Cl|_MEM}} m = {{Cl|_MEMIMAGE}}(0) 'copy the screen memory to m @@ -149,4 +149,4 @@ END FUNCTION * [[_MEMFILL]], [[_MEMFREE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_MEMCOPY.txt b/internal/help/_MEMCOPY.txt index 873dcbd75..19aa79401 100644 --- a/internal/help/_MEMCOPY.txt +++ b/internal/help/_MEMCOPY.txt @@ -30,17 +30,17 @@ The [[_MEMCOPY]] statement copies a block of bytes from one memory offset to ano m = {{Cl|_MEMNEW}}(10) n = {{Cl|_MEMNEW}}(100) -{{Cl|_MEMPUT}} m, m.OFFSET, "1234567890" +{{Cl|_MEMPUT}} m, m.OFFSET, "1234567890" s$ = {{Cl|SPACE$}}(10) 'to load into a variable length string set its length first {{Cl|_MEMGET}} m, m.OFFSET, s$ -{{Cl|PRINT}} "in:[" + s$ + "]" +{{Cl|PRINT}} "in:[" + s$ + "]" {{Cl|_MEMCOPY}} m, m.OFFSET, m.SIZE {{Cl|TO}} n, n.OFFSET 'put m into n b$ = {{Cl|SPACE$}}(10) {{Cl|_MEMGET}} n, n.OFFSET, b$ -{{Cl|PRINT}} "out:[" + b$ + "]" +{{Cl|PRINT}} "out:[" + b$ + "]" {{Cl|_MEMFREE}} m: {{Cl|_MEMFREE}} n 'always clear the memory when done '' '' {{CodeEnd}} @@ -70,4 +70,4 @@ b$ = {{Cl|SPACE$}}(10) * [[_MEMFILL]], [[_MEMFREE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_MEMELEMENT.txt b/internal/help/_MEMELEMENT.txt index ff8c675f8..909ce69a6 100644 --- a/internal/help/_MEMELEMENT.txt +++ b/internal/help/_MEMELEMENT.txt @@ -48,7 +48,7 @@ The [[_MEMELEMENT]] function returns a [[_MEM]] block referring to a variable's :::* 8 = [[STRING]] :::* 0 = unknown(eg. created with [[_MEMNEW]]) or [[TYPE|user-defined-types]] -<center>'''Note: [[_MEM]] and [[_OFFSET]] values cannot be cast to other variable types.'''</center> +<center>'''Note: [[_MEM]] and [[_OFFSET]] values cannot be cast to other variable types.'''</center> {{PageExamples}} @@ -82,4 +82,4 @@ m2 = {{Cl|_MEMELEMENT}}(a(50)) 'function returns information about the specific * [[_MEMFREE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_MEMEXISTS.txt b/internal/help/_MEMEXISTS.txt index 82df17aa5..f91a44970 100644 --- a/internal/help/_MEMEXISTS.txt +++ b/internal/help/_MEMEXISTS.txt @@ -20,4 +20,4 @@ The [[_MEMEXISTS]] function returns true (-1) if the memory block variable name * [[_MEMFILL]], [[_MEMFREE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_MEMFILL.txt b/internal/help/_MEMFILL.txt index 80b02efda..c9faad9c5 100644 --- a/internal/help/_MEMFILL.txt +++ b/internal/help/_MEMFILL.txt @@ -45,4 +45,4 @@ mema = {{Cl|_MEM (function)|_MEM}}(b()) * [[_MEMGET]], [[_MEMPUT]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_MEMFREE.txt b/internal/help/_MEMFREE.txt index 2e0f1ece2..3714a3415 100644 --- a/internal/help/_MEMFREE.txt +++ b/internal/help/_MEMFREE.txt @@ -24,4 +24,4 @@ The [[_MEMFREE]] statement frees the designated memory block [[_MEM]] value and * [[_MEMGET (function)]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_MEMGET.txt b/internal/help/_MEMGET.txt index 351df873f..611d431fd 100644 --- a/internal/help/_MEMGET.txt +++ b/internal/help/_MEMGET.txt @@ -49,4 +49,4 @@ m = {{Cl|_MEMIMAGE}} '0 or no handle necessary when accessing the current progr * [[_MEMFREE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_MEMGET_(function).txt b/internal/help/_MEMGET_(function).txt index b4ea30db3..693a884b5 100644 --- a/internal/help/_MEMGET_(function).txt +++ b/internal/help/_MEMGET_(function).txt @@ -42,4 +42,4 @@ v = {{Cl|_MEMGET (function)|_MEMGET}}(o, o.OFFSET + 1, {{Cl|_UNSIGNED}} {{Cl|_BY * [[_MEMCOPY]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_MEMIMAGE.txt b/internal/help/_MEMIMAGE.txt index 88666ed0c..7d79dfc1c 100644 --- a/internal/help/_MEMIMAGE.txt +++ b/internal/help/_MEMIMAGE.txt @@ -21,7 +21,7 @@ The [[_MEMIMAGE]] function returns a [[_MEM]] value referring to an image's memo ''Example 1:'' Darkening an image using memory with [[$CHECKING]]:OFF for greater speed. Use any 24 bit image file name on the second code line. {{CodeStart}} '' '' {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(1024, 768, 32) -i& = {{Cl|_LOADIMAGE}}("turtle.jpg") '<<<<<<<<<<<<< use any 24 bit image file +i& = {{Cl|_LOADIMAGE}}("turtle.jpg") '<<<<<<<<<<<<< use any 24 bit image file {{Cl|FOR...NEXT|FOR}} n! = 1 {{Cl|TO}} 0.01 {{Cl|STEP}} -0.01 i2& = {{Cl|_COPYIMAGE}}(i&) @@ -32,7 +32,7 @@ i& = {{Cl|_LOADIMAGE}}("turtle.jpg") '<<<<<<< {{Cl|NEXT}} {{Cl|SUB}} DarkenImage (Image {{Cl|AS}} {{Cl|LONG}}, Value_From_0_To_1 {{Cl|AS}} {{Cl|SINGLE}}) -{{Cl|IF...THEN|IF}} Value_From_0_To_1 <= 0 {{Cl|OR (boolean)|OR}} Value_From_0_To_1 >= 1 {{Cl|OR (boolean)|OR}} {{Cl|_PIXELSIZE}}(Image) <> 4 {{Cl|THEN}} {{Cl|EXIT SUB}} +{{Cl|IF...THEN|IF}} Value_From_0_To_1 <= 0 {{Cl|OR (boolean)|OR}} Value_From_0_To_1 >= 1 {{Cl|OR (boolean)|OR}} {{Cl|_PIXELSIZE}}(Image) <> 4 {{Cl|THEN}} {{Cl|EXIT SUB}} {{Cl|DIM}} Buffer {{Cl|AS}} {{Cl|_MEM}}: Buffer = {{Cl|_MEMIMAGE}}(Image) 'Get a memory reference to our image {{Cl|DIM}} Frac_Value {{Cl|AS}} {{Cl|LONG}}: Frac_Value = Value_From_0_To_1 * 65536 'Used to avoid slow floating point calculations {{Cl|DIM}} O {{Cl|AS}} {{Cl|_OFFSET}}, O_Last {{Cl|AS}} {{Cl|_OFFSET}} @@ -58,17 +58,17 @@ DO {{CodeStart}} '' '' {{Cl|SCREEN}} 13 {{Cl|_FULLSCREEN}} -{{Cl|PSET}} (0, 0), {{Cl|ASC}}("H") -{{Cl|PSET}} (1, 0), {{Cl|ASC}}("E") -{{Cl|PSET}} (2, 0), {{Cl|ASC}}("L") -{{Cl|PSET}} (3, 0), {{Cl|ASC}}("L") -{{Cl|PSET}} (4, 0), {{Cl|ASC}}("O") +{{Cl|PSET}} (0, 0), {{Cl|ASC}}("H") +{{Cl|PSET}} (1, 0), {{Cl|ASC}}("E") +{{Cl|PSET}} (2, 0), {{Cl|ASC}}("L") +{{Cl|PSET}} (3, 0), {{Cl|ASC}}("L") +{{Cl|PSET}} (4, 0), {{Cl|ASC}}("O") {{Cl|PSET}} (5, 0), 32 -{{Cl|PSET}} (6, 0), {{Cl|ASC}}("W") -{{Cl|PSET}} (7, 0), {{Cl|ASC}}("O") -{{Cl|PSET}} (8, 0), {{Cl|ASC}}("R") -{{Cl|PSET}} (9, 0), {{Cl|ASC}}("L") -{{Cl|PSET}} (10, 0), {{Cl|ASC}}("D") +{{Cl|PSET}} (6, 0), {{Cl|ASC}}("W") +{{Cl|PSET}} (7, 0), {{Cl|ASC}}("O") +{{Cl|PSET}} (8, 0), {{Cl|ASC}}("R") +{{Cl|PSET}} (9, 0), {{Cl|ASC}}("L") +{{Cl|PSET}} (10, 0), {{Cl|ASC}}("D") {{Cl|DIM}} m {{Cl|AS}} {{Cl|_MEM}} m = {{Cl|_MEMIMAGE}} x1$ = {{Cl|_MEMGET (function)|_MEMGET}}(m, m.OFFSET, {{Cl|STRING}} * 11) 'convert numbers to ASCII text characters @@ -89,4 +89,4 @@ x1$ = {{Cl|_MEMGET (function)|_MEMGET}}(m, m.OFFSET, {{Cl|STRING}} * 11) 'conver * [http://www.qb64.net/forum/index.php?topic=11052.0 Reading pixel colors faster using _MEMIMAGE] (forum post) -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_MEMNEW.txt b/internal/help/_MEMNEW.txt index 5eb820870..5d4a78e32 100644 --- a/internal/help/_MEMNEW.txt +++ b/internal/help/_MEMNEW.txt @@ -28,15 +28,15 @@ m = {{Cl|_MEMNEW}}(5) 'create new memory block of 5 bytes a = 12345.6 {{Cl|_MEMPUT}} m, m.OFFSET, a 'put single value {{Cl|_MEMGET}} m, m.OFFSET, b 'get single value -{{Cl|PRINT}} "b = "; b -c$ = "Doggy" +{{Cl|PRINT}} "b = "; b +c$ = "Doggy" {{Cl|_MEMPUT}} m, m.OFFSET, c$ 'put 5 byte string value {{Cl|_MEMGET}} m, m.OFFSET, d$ 'get unfixed length string value {{Cl|_MEMGET}} m, m.OFFSET, f 'get 5 byte string value e$ = {{Cl|_MEMGET (function)|_MEMGET}}(m, m.OFFSET, {{Cl|STRING}} * 5) 'get 5 byte string value -{{Cl|PRINT}} "d$ = "; d$; {{Cl|LEN}}(d$) 'prints empty string -{{Cl|PRINT}} "e$ = "; e$; {{Cl|LEN}}(e$) -{{Cl|PRINT}} "f = "; f; {{Cl|LEN}}(f) '' '' +{{Cl|PRINT}} "d$ = "; d$; {{Cl|LEN}}(d$) 'prints empty string +{{Cl|PRINT}} "e$ = "; e$; {{Cl|LEN}}(e$) +{{Cl|PRINT}} "f = "; f; {{Cl|LEN}}(f) '' '' {{CodeEnd}} {{OutputStart}}b = 12345.6 d$ = 0 @@ -51,4 +51,4 @@ f = Doggy 5 {{OutputEnd}} * [[_MEMFILL]], [[_MEMFREE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_MEMPUT.txt b/internal/help/_MEMPUT.txt index 4dd865d9e..396dcb2f7 100644 --- a/internal/help/_MEMPUT.txt +++ b/internal/help/_MEMPUT.txt @@ -40,4 +40,4 @@ v = {{Cl|_MEMGET (function)|_MEMGET}}(o, o.OFFSET + 1, {{Cl|_UNSIGNED}} {{Cl|_BY * [[_MEMFREE]], [[_MEMCOPY]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_MEM_(function).txt b/internal/help/_MEM_(function).txt index e16984b31..844237d4b 100644 --- a/internal/help/_MEM_(function).txt +++ b/internal/help/_MEM_(function).txt @@ -67,4 +67,4 @@ Saved(3) = n3 * [[_MEMFREE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_MK$.txt b/internal/help/_MK$.txt index 8d2459040..6ad0f74f3 100644 --- a/internal/help/_MK$.txt +++ b/internal/help/_MK$.txt @@ -28,4 +28,4 @@ The [[_MK$]] function can convert any numerical type into an [[ASCII]] [[STRING] * [[PDS(7.1) Procedures#CURRENCY|CURRENCY]] -{{PageNavigation}}{{DISPLAYTITLE:}} \ No newline at end of file +{{PageNavigation}}{{DISPLAYTITLE:}} diff --git a/internal/help/_MOUSEBUTTON.txt b/internal/help/_MOUSEBUTTON.txt index 8d33d3515..127823080 100644 --- a/internal/help/_MOUSEBUTTON.txt +++ b/internal/help/_MOUSEBUTTON.txt @@ -18,7 +18,7 @@ The [[_MOUSEBUTTON]] function returns the button status of a specified mouse but * Read [[_MOUSEINPUT]] first to return the current button up or down status. (See Example 2) * Button clicks and mouse movements will be remembered and should be cleared after an [[INPUT]] statement or other interruption. * To clear unread mouse input, use a [[_MOUSEINPUT]] loop that loops until it returns 0. -* Use [[_DEVICE$]] to find the "[MOUSE]" [[_DEVICES]] number to find the number of buttons available using [[_LASTBUTTON]]. +* Use [[_DEVICE$]] to find the "[MOUSE]" [[_DEVICES]] number to find the number of buttons available using [[_LASTBUTTON]]. * '''Note:''' The center mouse button can also be read as [[_BUTTON]](2) on [[_DEVICEINPUT]](2) when a mouse is present. @@ -27,24 +27,24 @@ The [[_MOUSEBUTTON]] function returns the button status of a specified mouse but {{CodeStart}} '' '' {{Cl|FOR...NEXT|FOR}} d = 1 {{Cl|TO}} {{Cl|_DEVICES}} 'number of input devices found dev$ = {{Cl|_DEVICE$}}(d) - {{Cl|IF...THEN|IF}} {{Cl|INSTR}}(dev$, "[MOUSE]") {{Cl|THEN}} buttons = {{Cl|_LASTBUTTON}}(d): {{Cl|EXIT}} {{Cl|FOR...NEXT|FOR}} + {{Cl|IF...THEN|IF}} {{Cl|INSTR}}(dev$, "[MOUSE]") {{Cl|THEN}} buttons = {{Cl|_LASTBUTTON}}(d): {{Cl|EXIT}} {{Cl|FOR...NEXT|FOR}} {{Cl|NEXT}} -{{Cl|PRINT}} buttons; "mouse buttons available" '' '' +{{Cl|PRINT}} buttons; "mouse buttons available" '' '' {{CodeEnd}} ''Example 2:'' How to monitor when a button is down or wait until a mouse button is not held down. {{CodeStart}} '' '' -{{Cl|PRINT}} "Hold down the left mouse button until you want to quit!" +{{Cl|PRINT}} "Hold down the left mouse button until you want to quit!" DO i = {{Cl|_MOUSEINPUT}} ' read #1 - {{Cl|IF...THEN|IF}} {{Cl|_MOUSEBUTTON}}(1) {{Cl|THEN}} {{Cl|PRINT}} "Left button down!": {{Cl|EXIT DO}} + {{Cl|IF...THEN|IF}} {{Cl|_MOUSEBUTTON}}(1) {{Cl|THEN}} {{Cl|PRINT}} "Left button down!": {{Cl|EXIT DO}} {{Cl|LOOP}} {{Cl|DO...LOOP|DO}} ' need to wait i = {{Cl|_MOUSEINPUT}} ' read #2 until the mouse {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|NOT}} {{Cl|_MOUSEBUTTON}}(1) ' button is released -{{Cl|PRINT}} "DONE!" '' '' +{{Cl|PRINT}} "DONE!" '' '' {{CodeEnd}} @@ -67,7 +67,7 @@ DO i = {{Cl|_MOUSEINPUT}} {{Cl|IF...THEN|IF}} {{Cl|_MOUSEBUTTON}}(1) {{Cl|THEN}} Click = 2: {{Cl|EXIT DO}} {{Cl|LOOP}} - {{Cl|IF...THEN|IF}} Click = 2 {{Cl|THEN}} {{Cl|PRINT}} "Double click" {{Cl|ELSE}} {{Cl|PRINT}} "Click" + {{Cl|IF...THEN|IF}} Click = 2 {{Cl|THEN}} {{Cl|PRINT}} "Double click" {{Cl|ELSE}} {{Cl|PRINT}} "Click" {{Cl|END IF}} Click = 0: buttondown = 0 'reset where needed {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) '' '' @@ -83,12 +83,12 @@ DO {{Cl|DO...LOOP|DO}} Mouser mx, my, mb {{Cl|IF...THEN|IF}} mb {{Cl|THEN}} - {{Cl|IF...THEN|IF}} mx >= 250 {{Cl|AND (boolean)|AND}} my >= 250 {{Cl|AND (boolean)|AND}} mx <= 300 {{Cl|AND (boolean)|AND}} my <= 300 {{Cl|THEN}} 'button down + {{Cl|IF...THEN|IF}} mx >= 250 {{Cl|AND (boolean)|AND}} my >= 250 {{Cl|AND (boolean)|AND}} mx <= 300 {{Cl|AND (boolean)|AND}} my <= 300 {{Cl|THEN}} 'button down {{Cl|DO...LOOP|DO}} {{Cl|WHILE}} mb 'wait for button release Mouser mx, my, mb {{Cl|LOOP}} 'verify mouse still in box area - {{Cl|IF...THEN|IF}} mx >= 250 {{Cl|AND (boolean)|AND}} my >= 250 {{Cl|AND (boolean)|AND}} mx <= 300 {{Cl|AND (boolean)|AND}} my <= 300 {{Cl|THEN}} {{Cl|PRINT}} "Click verified on yellow box!" + {{Cl|IF...THEN|IF}} mx >= 250 {{Cl|AND (boolean)|AND}} my >= 250 {{Cl|AND (boolean)|AND}} mx <= 300 {{Cl|AND (boolean)|AND}} my <= 300 {{Cl|THEN}} {{Cl|PRINT}} "Click verified on yellow box!" {{Cl|END IF}} {{Cl|END IF}} {{Cl|LOOP}} @@ -112,9 +112,9 @@ y = {{Cl|_MOUSEY}} ''Example 5:'' Combining mouse button or keyboard selections in a menu or test: {{CodeStart}} '' '' {{Cl|DO...LOOP|DO}} 'main program loop in demo only - {{Cl|LOCATE}} 10, 10: {{Cl|PRINT}} "A" 'position A, B & C in same position on every question - {{Cl|LOCATE}} 12, 10: {{Cl|PRINT}} "B" - {{Cl|LOCATE}} 14, 10: {{Cl|PRINT}} "C" 'demo only + {{Cl|LOCATE}} 10, 10: {{Cl|PRINT}} "A" 'position A, B & C in same position on every question + {{Cl|LOCATE}} 12, 10: {{Cl|PRINT}} "B" + {{Cl|LOCATE}} 14, 10: {{Cl|PRINT}} "C" 'demo only {{Cl|DO...LOOP|DO}}: {{Cl|_LIMIT}} 10 'get user answer loop {{Cl|DO...LOOP|DO}} {{Cl|WHILE}} {{Cl|_MOUSEINPUT}}: {{Cl|LOOP}} 'read mouse @@ -130,7 +130,7 @@ y = {{Cl|_MOUSEY}} x% = {{Cl|_MOUSEX}} y% = {{Cl|_MOUSEY}} {{Cl|LOOP}} {{Cl|WHILE}} {{Cl|_MOUSEBUTTON}}(1) - {{Cl|IF...THEN|IF}} x% = 10 {{Cl|AND (boolean)|AND}} y% = 10 {{Cl|THEN}} K$ = "A" 'position released + {{Cl|IF...THEN|IF}} x% = 10 {{Cl|AND (boolean)|AND}} y% = 10 {{Cl|THEN}} K$ = "A" 'position released {{Cl|END IF}} {{Cl|IF...THEN|IF}} x% = 10 {{Cl|AND (boolean)|AND}} y% = 12 {{Cl|AND (boolean)|AND}} Lclick {{Cl|THEN}} 'position clicked DO @@ -138,7 +138,7 @@ y = {{Cl|_MOUSEY}} x% = {{Cl|_MOUSEX}} y% = {{Cl|_MOUSEY}} {{Cl|LOOP}} {{Cl|WHILE}} {{Cl|_MOUSEBUTTON}}(1) - {{Cl|IF...THEN|IF}} x% = 10 {{Cl|AND (boolean)|AND}} y% = 12 {{Cl|THEN}} K$ = "B" 'position released + {{Cl|IF...THEN|IF}} x% = 10 {{Cl|AND (boolean)|AND}} y% = 12 {{Cl|THEN}} K$ = "B" 'position released {{Cl|END IF}} {{Cl|IF...THEN|IF}} x% = 10 {{Cl|AND (boolean)|AND}} y% = 14 {{Cl|AND (boolean)|AND}} Lclick {{Cl|THEN}} 'position clicked DO @@ -146,15 +146,15 @@ y = {{Cl|_MOUSEY}} x% = {{Cl|_MOUSEX}} y% = {{Cl|_MOUSEY}} {{Cl|LOOP}} {{Cl|WHILE}} {{Cl|_MOUSEBUTTON}}(1) - {{Cl|IF...THEN|IF}} x% = 10 {{Cl|AND (boolean)|AND}} y% = 14 {{Cl|THEN}} K$ = "C" 'position released + {{Cl|IF...THEN|IF}} x% = 10 {{Cl|AND (boolean)|AND}} y% = 14 {{Cl|THEN}} K$ = "C" 'position released {{Cl|END IF}} - {{Cl|LOOP}} {{Cl|UNTIL}} K$ = "A" {{Cl|OR (boolean)|OR}} K$ = "B" {{Cl|OR (boolean)|OR}} K$ = "C" '{{Cl|GOTO}} next question + {{Cl|LOOP}} {{Cl|UNTIL}} K$ = "A" {{Cl|OR (boolean)|OR}} K$ = "B" {{Cl|OR (boolean)|OR}} K$ = "C" '{{Cl|GOTO}} next question {{Cl|IF...THEN|IF}} {{Cl|LEN}}(K$) {{Cl|THEN}} 'DEMO ONLY - {{Cl|LOCATE}} 22, 35: {{Cl|PRINT}} " Answer = "; K$ 'display user answer at location + {{Cl|LOCATE}} 22, 35: {{Cl|PRINT}} " Answer = "; K$ 'display user answer at location {{Cl|_DELAY}} 2 'allow time for user to view answer - {{Cl|LOCATE}} 22, 35: {{Cl|PRINT}} "SELECT AGAIN" - K$ = "" 'reset K$ + {{Cl|LOCATE}} 22, 35: {{Cl|PRINT}} "SELECT AGAIN" + K$ = "" 'reset K$ {{Cl|END IF}} {{Cl|LOOP}} 'DEMO only loop use red X box to quit '' '' {{CodeEnd}} {{small|Code by Ted Weissgerber}} @@ -170,4 +170,4 @@ y = {{Cl|_MOUSEY}} * [[Controller Devices]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_MOUSEHIDE.txt b/internal/help/_MOUSEHIDE.txt index 89b596743..0e7a81bba 100644 --- a/internal/help/_MOUSEHIDE.txt +++ b/internal/help/_MOUSEHIDE.txt @@ -12,4 +12,4 @@ The [[_MOUSEHIDE]] statement hides the mouse cursor. * [[_MOUSEMOVE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_MOUSEINPUT.txt b/internal/help/_MOUSEINPUT.txt index 8cfa35477..6b481f90c 100644 --- a/internal/help/_MOUSEINPUT.txt +++ b/internal/help/_MOUSEINPUT.txt @@ -20,7 +20,7 @@ DO {{Cl|DO...LOOP|DO}} {{Cl|WHILE}} {{Cl|_MOUSEINPUT}} ' Check the mouse status {{Cl|PRINT}} {{Cl|_MOUSEX}}, {{Cl|_MOUSEY}}, {{Cl|_MOUSEBUTTON}}(1), {{Cl|_MOUSEWHEEL}} {{Cl|LOOP}} -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" '' '' +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" '' '' {{CodeEnd}} : ''Explanation:'' The latest mouse function status can be read after the loop. [[_LIMIT]] and [[_DELAY]] loops will slow returns down. @@ -36,7 +36,7 @@ DO {{Cl|DO...LOOP|DO}} {{Cl|WHILE}} {{Cl|_MOUSEINPUT}}'mouse status changes only x = {{Cl|_MOUSEX}} y = {{Cl|_MOUSEY}} - {{Cl|IF...THEN|IF}} x > 0 {{Cl|AND (boolean)|AND}} x < 640 {{Cl|AND (boolean)|AND}} y > 0 {{Cl|AND (boolean)|AND}} y < 480 {{Cl|THEN}} + {{Cl|IF...THEN|IF}} x > 0 {{Cl|AND (boolean)|AND}} x < 640 {{Cl|AND (boolean)|AND}} y > 0 {{Cl|AND (boolean)|AND}} y < 480 {{Cl|THEN}} {{Cl|IF...THEN|IF}} {{Cl|_MOUSEBUTTON}}(2) {{Cl|THEN}} {{Cl|PSET}} (x, y), 15 {{Cl|LOCATE}} 1, 1: {{Cl|PRINT}} x, y @@ -50,17 +50,17 @@ DO {{CodeEnd}} -''Example 3:'' Clearing any mouse data read before or during an [[INPUT]] entry. Press "I" to enter input: +''Example 3:'' Clearing any mouse data read before or during an [[INPUT]] entry. Press "I" to enter input: {{CodeStart}} -{{Cl|PRINT}} "Press I to enter input! Press Q to quit" +{{Cl|PRINT}} "Press I to enter input! Press Q to quit" {{Cl|DO...LOOP|DO}} K$ = {{Cl|UCASE$}}({{Cl|INKEY$}}) {{Cl|DO...LOOP|DO}} - {{Cl|IF...THEN|IF}} {{Cl|_MOUSEBUTTON}}(1) = -1 {{Cl|THEN}} {{Cl|PRINT}} "*" 'indicates a mouse click event + {{Cl|IF...THEN|IF}} {{Cl|_MOUSEBUTTON}}(1) = -1 {{Cl|THEN}} {{Cl|PRINT}} "*" 'indicates a mouse click event {{Cl|LOOP}} {{Cl|WHILE}} {{Cl|_MOUSEINPUT}} - {{Cl|IF...THEN|IF}} K$ = "Q" {{Cl|THEN}} {{Cl|END}} - {{Cl|IF...THEN|IF}} K$ = "I" {{Cl|THEN}} 'press I to enter text - {{Cl|INPUT}} "Click the mouse and enter something: ", entry$ 'enter some text + {{Cl|IF...THEN|IF}} K$ = "Q" {{Cl|THEN}} {{Cl|END}} + {{Cl|IF...THEN|IF}} K$ = "I" {{Cl|THEN}} 'press I to enter text + {{Cl|INPUT}} "Click the mouse and enter something: ", entry$ 'enter some text {{Cl|GOSUB}} Clickcheck 'clear mouse data {{Cl|END IF}} {{Cl|LOOP}} @@ -84,4 +84,4 @@ count = 0 * [[Controller Devices]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_MOUSEMOVE.txt b/internal/help/_MOUSEMOVE.txt index b9ff148e5..fc7dc7750 100644 --- a/internal/help/_MOUSEMOVE.txt +++ b/internal/help/_MOUSEMOVE.txt @@ -13,7 +13,7 @@ The [[_MOUSEMOVE]] statement moves the mouse pointer to a new position on the sc {{PageDescription}} * Maximum coordinate values are based on a program's current [[SCREEN]] mode resolution or the pixel size set by [[_NEWIMAGE]]. -* [[SCREEN]] 0 uses text block coordinates. '''Coordinates off the screen area will create an "Illegal Function Call" [[ERROR Codes|ERROR]]''' +* [[SCREEN]] 0 uses text block coordinates. '''Coordinates off the screen area will create an "Illegal Function Call" [[ERROR Codes|ERROR]]''' * Can be used to position the pointer to a default dialog button or move the cursor away from a button so it is not clicked twice. * Does not require [[_MOUSEINPUT]] to be used, but all moves will be remembered and can be read by mouse functions. @@ -29,7 +29,7 @@ The [[_MOUSEMOVE]] statement moves the mouse pointer to a new position on the sc {{Cl|SCREEN}} 12 i = {{Cl|_MOUSEINPUT}} 'start reading mouse events before INPUT to hold in memory {{Cl|PRINT}} -{{Cl|INPUT}} "Move the mouse pointer and make a few clicks, then press Enter!", dummy$ +{{Cl|INPUT}} "Move the mouse pointer and make a few clicks, then press Enter!", dummy$ {{Cl|_MOUSEMOVE}} 1, 1 DO: {{Cl|_LIMIT}} 30 count = count + 1 @@ -38,8 +38,8 @@ DO: {{Cl|_LIMIT}} 30 b = {{Cl|_MOUSEBUTTON}}(1) {{Cl|PRINT}} count, x, y, b {{Cl|_MOUSEMOVE}} x, y -{{Cl|LOOP}} {{Cl|UNTIL}} i = 0 {{Cl|OR (boolean)|OR}} {{Cl|INKEY$}} > "" -{{Cl|PRINT}} "Done!" '' '' +{{Cl|LOOP}} {{Cl|UNTIL}} i = 0 {{Cl|OR (boolean)|OR}} {{Cl|INKEY$}} > "" +{{Cl|PRINT}} "Done!" '' '' {{CodeEnd}} : ''Explanation:'' The [[_MOUSEINPUT]] function will hold previous and _MOUSEMOVE events so press any key when you want to quit. @@ -52,4 +52,4 @@ DO: {{Cl|_LIMIT}} 30 * [[_NEWIMAGE]], [[_SCREENIMAGE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_MOUSEMOVEMENTX.txt b/internal/help/_MOUSEMOVEMENTX.txt index 617d7d96e..a74a5e92d 100644 --- a/internal/help/_MOUSEMOVEMENTX.txt +++ b/internal/help/_MOUSEMOVEMENTX.txt @@ -42,7 +42,7 @@ PX = 320: PY = 240 'center position {{Cl|CLS}} {{Cl|CIRCLE}} (x, y), 20 {{Cl|PCOPY}} 1, 0 -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" 'press any key to exit '' '' +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" 'press any key to exit '' '' {{CodeEnd}} : '''NOTE:''' When using the function this way, give the user a keypress exit option. Make sure the user has some way to exit that is not dependent on clicking the X button. @@ -57,4 +57,4 @@ PX = 320: PY = 240 'center position * [[Screen Saver Programs]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_MOUSEMOVEMENTY.txt b/internal/help/_MOUSEMOVEMENTY.txt index 4b5082481..f15c90939 100644 --- a/internal/help/_MOUSEMOVEMENTY.txt +++ b/internal/help/_MOUSEMOVEMENTY.txt @@ -25,7 +25,7 @@ The [[_MOUSEMOVEMENTY]] function returns the relative vertical position of the m {{Cl|CLS}} {{Cl|CIRCLE}} (x, y), 20 {{Cl|PCOPY}} 1, 0 -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" 'press any key to exit '' '' +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" 'press any key to exit '' '' {{CodeEnd}} : '''NOTE:''' When using the function this way, give the user a keypress exit option. Make sure the user has some way to exit that is not dependent on clicking the X button. @@ -40,4 +40,4 @@ The [[_MOUSEMOVEMENTY]] function returns the relative vertical position of the m * [[Screen Saver Programs]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_MOUSEPIPEOPEN.txt b/internal/help/_MOUSEPIPEOPEN.txt index 0097e3b89..4bd1298df 100644 --- a/internal/help/_MOUSEPIPEOPEN.txt +++ b/internal/help/_MOUSEPIPEOPEN.txt @@ -49,7 +49,7 @@ The [[_MOUSEPIPEOPEN]] function creates a pipe handle value for a mouse when usi omb = mb - rootId = VkByRole("ROOT") + rootId = VkByRole("ROOT") editMode = VK(rootId).locked {{Cl|IF...THEN|IF}} mDown {{Cl|THEN}} @@ -69,7 +69,7 @@ The [[_MOUSEPIPEOPEN]] function creates a pipe handle value for a mouse when usi x2 = {{Cl|INT}}(x + VkUnitSize * w) - 1 y1 = sy - 1 - {{Cl|INT}}(y) y2 = sy - 1 - {{Cl|INT}}(y + VkUnitSize * h) + 1 - {{Cl|IF...THEN|IF}} mx >= x1 {{Cl|AND (boolean)|AND}} mx <= x2 {{Cl|AND (boolean)|AND}} my >= y2 {{Cl|AND (boolean)|AND}} my <= y1 {{Cl|THEN}} + {{Cl|IF...THEN|IF}} mx >= x1 {{Cl|AND (boolean)|AND}} mx <= x2 {{Cl|AND (boolean)|AND}} my >= y2 {{Cl|AND (boolean)|AND}} my <= y1 {{Cl|THEN}} i2 = i {{Cl|EXIT}} {{Cl|FOR...NEXT|FOR}} {{Cl|END IF}} @@ -99,4 +99,4 @@ The [[_MOUSEPIPEOPEN]] function creates a pipe handle value for a mouse when usi * [[$VIRTUALKEYBOARD]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_MOUSESHOW.txt b/internal/help/_MOUSESHOW.txt index ba7064d8a..c10e36f23 100644 --- a/internal/help/_MOUSESHOW.txt +++ b/internal/help/_MOUSESHOW.txt @@ -9,14 +9,14 @@ The [[_MOUSESHOW]] statement displays the mouse cursor and can change its shape. {{PageDescription}} * Simply use the statement whenever [[_MOUSEHIDE]] has been used previously. * In '''version 1.000 and up''' the following {{Parameter|cursorShape$}} can be displayed: -::_MOUSESHOW "LINK" will display an upward pointing hand cursor used to denote hypertext -::_MOUSESHOW "TEXT" will display the I cursor often used in text entry areas -::_MOUSESHOW "CROSSHAIR" will display a crosshair cursor -::_MOUSESHOW "VERTICAL" will display vertical arrow cursor for movement -::_MOUSESHOW "HORIZONTAL" will display horizontal arrow cursor for movement -::_MOUSESHOW "TOPLEFT_BOTTOMRIGHT" will display bottom diagonal arrow cursor for movement -::_MOUSESHOW "TOPRIGHT_BOTTOMLEFT" will display bottom diagonal arrow cursor for movement -::_MOUSESHOW "DEFAULT" can be used after a mouse cursor statement above was previously used. +::_MOUSESHOW "LINK" will display an upward pointing hand cursor used to denote hypertext +::_MOUSESHOW "TEXT" will display the I cursor often used in text entry areas +::_MOUSESHOW "CROSSHAIR" will display a crosshair cursor +::_MOUSESHOW "VERTICAL" will display vertical arrow cursor for movement +::_MOUSESHOW "HORIZONTAL" will display horizontal arrow cursor for movement +::_MOUSESHOW "TOPLEFT_BOTTOMRIGHT" will display bottom diagonal arrow cursor for movement +::_MOUSESHOW "TOPRIGHT_BOTTOMLEFT" will display bottom diagonal arrow cursor for movement +::_MOUSESHOW "DEFAULT" can be used after a mouse cursor statement above was previously used. * This statement will also disable [[_MOUSEMOVEMENTX]] or [[_MOUSEMOVEMENTY]] relative mouse movement reads. * The mouse cursor will not interfere with any print or graphic screen changes in '''QB64'''. @@ -28,14 +28,14 @@ The [[_MOUSESHOW]] statement displays the mouse cursor and can change its shape. {{PageExamples}} ''Example 1:'' '''QB64 1.000 and up''' allow special cursors to be displayed by using special string parameters: {{CodeStart}} -{{Cl|_MOUSESHOW}} "default": {{Cl|_DELAY}} 0.5 -{{Cl|_MOUSESHOW}} "link": {{Cl|_DELAY}} 0.5 'a hand, typically used in web browsers -{{Cl|_MOUSESHOW}} "text": {{Cl|_DELAY}} 0.5 -{{Cl|_MOUSESHOW}} "crosshair": {{Cl|_DELAY}} 0.5 -{{Cl|_MOUSESHOW}} "vertical": {{Cl|_DELAY}} 0.5 -{{Cl|_MOUSESHOW}} "horizontal": {{Cl|_DELAY}} 0.5 -{{Cl|_MOUSESHOW}} "topleft_bottomright": {{Cl|_DELAY}} 0.5 -{{Cl|_MOUSESHOW}} "topright_bottomleft": {{Cl|_DELAY}} 0.5 +{{Cl|_MOUSESHOW}} "default": {{Cl|_DELAY}} 0.5 +{{Cl|_MOUSESHOW}} "link": {{Cl|_DELAY}} 0.5 'a hand, typically used in web browsers +{{Cl|_MOUSESHOW}} "text": {{Cl|_DELAY}} 0.5 +{{Cl|_MOUSESHOW}} "crosshair": {{Cl|_DELAY}} 0.5 +{{Cl|_MOUSESHOW}} "vertical": {{Cl|_DELAY}} 0.5 +{{Cl|_MOUSESHOW}} "horizontal": {{Cl|_DELAY}} 0.5 +{{Cl|_MOUSESHOW}} "topleft_bottomright": {{Cl|_DELAY}} 0.5 +{{Cl|_MOUSESHOW}} "topright_bottomleft": {{Cl|_DELAY}} 0.5 {{CodeEnd}} : '''Note:''' There is no hourglass, stopwatch or spinning colorful wheel in the list. The fact is that these typically only appear in a program when something has gone terribly wrong and the program has crashed or frozen. @@ -50,4 +50,4 @@ The [[_MOUSESHOW]] statement displays the mouse cursor and can change its shape. * [[_DEVICES]], [[_DEVICE$]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_MOUSEWHEEL.txt b/internal/help/_MOUSEWHEEL.txt index e264f4e77..b84883867 100644 --- a/internal/help/_MOUSEWHEEL.txt +++ b/internal/help/_MOUSEWHEEL.txt @@ -13,7 +13,7 @@ The [[_MOUSEWHEEL]] function returns a positive or negative [[INTEGER]] value in {{PageExamples}} -''Example 1:'' Reading the cumulative mouse wheel "clicks". +''Example 1:'' Reading the cumulative mouse wheel "clicks". {{CodeStart}} '' '' DO: {{Cl|_LIMIT}} 100 DO WHILE {{Cl|_MOUSEINPUT}} @@ -27,7 +27,7 @@ The [[_MOUSEWHEEL]] function returns a positive or negative [[INTEGER]] value in ''Example 2:'' A simple text scrolling routine using the mouse wheel value to read a text array. {{CodeStart}} '' '' {{Cl|DIM}} Array$(100) -{{Cl|LINE INPUT}} "Enter a file name with 100 or more lines of text: ", file$ +{{Cl|LINE INPUT}} "Enter a file name with 100 or more lines of text: ", file$ {{Cl|OPEN}} file$ {{Cl|FOR (file statement)|FOR}} {{Cl|INPUT (file mode)|INPUT}} {{Cl|AS}} #1 {{Cl|DO...LOOP|DO}} {{Cl|UNTIL}} {{Cl|EOF}}(1) inputcount = inputcount + 1 @@ -38,10 +38,10 @@ The [[_MOUSEWHEEL]] function returns a positive or negative [[INTEGER]] value in {{Cl|CLOSE}} #1 DO {{Cl|DO...LOOP|DO}} {{Cl|WHILE}} {{Cl|_MOUSEINPUT}} - {{Cl|IF...THEN|IF}} row >= 0 {{Cl|THEN}} row = row + {{Cl|_MOUSEWHEEL}} {{Cl|ELSE}} row = 0 'prevent under scrolling - {{Cl|IF...THEN|IF}} row > inputcount - 20 {{Cl|THEN}} row = inputcount - 20 'prevent over scrolling - {{Cl|IF...THEN|IF}} prevrow <> row {{Cl|THEN}} 'look for a change in row value - {{Cl|IF...THEN|IF}} row > 0 {{Cl|AND (boolean)|AND}} row <= inputcount - 20 {{Cl|THEN}} + {{Cl|IF...THEN|IF}} row >= 0 {{Cl|THEN}} row = row + {{Cl|_MOUSEWHEEL}} {{Cl|ELSE}} row = 0 'prevent under scrolling + {{Cl|IF...THEN|IF}} row > inputcount - 20 {{Cl|THEN}} row = inputcount - 20 'prevent over scrolling + {{Cl|IF...THEN|IF}} prevrow <> row {{Cl|THEN}} 'look for a change in row value + {{Cl|IF...THEN|IF}} row > 0 {{Cl|AND (boolean)|AND}} row <= inputcount - 20 {{Cl|THEN}} {{Cl|CLS}}: {{Cl|LOCATE}} 2, 1 {{Cl|FOR...NEXT|FOR}} n = row {{Cl|TO}} row + 20 {{Cl|PRINT}} Array$(n) @@ -50,10 +50,10 @@ DO {{Cl|END IF}} prevrow = row 'store previous row value {{Cl|LOOP}} -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} > "" '' '' +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} > "" '' '' {{CodeEnd}} {{small|Code by Ted Weissgerber}} -<center>Note: You will need a text file that is large enough for this example.</center> +<center>Note: You will need a text file that is large enough for this example.</center> {{PageSeeAlso}} @@ -63,4 +63,4 @@ DO * [[Controller Devices]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_MOUSEX.txt b/internal/help/_MOUSEX.txt index 93194d5cd..84854b80d 100644 --- a/internal/help/_MOUSEX.txt +++ b/internal/help/_MOUSEX.txt @@ -23,13 +23,13 @@ The [[_MOUSEX]] function returns the current horizontal (column) mouse cursor po {{Cl|SCREEN (statement)|SCREEN}} 12 {{Cl|LINE}} (99, 9)-(601, 401), 7, BF {{Cl|LINE}} (101, 11)-(599, 399), 8, BF -tm$ = " Column = ### Row = ### Button1 = ## Button2 = ## Button3 = ##" -{{Cl|LOCATE}} 29, 20: {{Cl|PRINT}} "LeftButton = draw - RightButton = Erase"; +tm$ = " Column = ### Row = ### Button1 = ## Button2 = ## Button3 = ##" +{{Cl|LOCATE}} 29, 20: {{Cl|PRINT}} "LeftButton = draw - RightButton = Erase"; {{Cl|DO}}: K$ = {{Cl|INKEY$}} {{Cl|DO}} {{Cl|WHILE}} {{Cl|_MOUSEINPUT}} X = {{Cl|_MOUSEX}}: Y = {{Cl|_MOUSEY}} - {{Cl|IF}} X > 100 {{Cl|AND (boolean)|AND}} X < 600 {{Cl|AND (boolean)|AND}} PX > 100 {{Cl|AND (boolean)|AND}} PX < 600 {{Cl|THEN}} - {{Cl|IF}} Y > 10 {{Cl|AND (boolean)|AND}} Y < 400 {{Cl|AND (boolean)|AND}} PY > 10 {{Cl|AND (boolean)|AND}} PY < 400 {{Cl|THEN}} + {{Cl|IF}} X > 100 {{Cl|AND (boolean)|AND}} X < 600 {{Cl|AND (boolean)|AND}} PX > 100 {{Cl|AND (boolean)|AND}} PX < 600 {{Cl|THEN}} + {{Cl|IF}} Y > 10 {{Cl|AND (boolean)|AND}} Y < 400 {{Cl|AND (boolean)|AND}} PY > 10 {{Cl|AND (boolean)|AND}} PY < 400 {{Cl|THEN}} {{Cl|IF}} {{Cl|_MOUSEBUTTON}}(1) {{Cl|THEN}} {{Cl|LINE}} (PX, PY)-(X, Y), 15 {{Cl|IF}} {{Cl|_MOUSEBUTTON}}(2) {{Cl|THEN}} {{Cl|LINE}} (101, 11)-(599, 399), 8, BF {{Cl|END IF}} @@ -51,4 +51,4 @@ tm$ = " Column = ### Row = ### Button1 = ## Button2 = ## Button3 = ##&q * [[Controller Devices]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_MOUSEY.txt b/internal/help/_MOUSEY.txt index 46c5e5de3..0df48c644 100644 --- a/internal/help/_MOUSEY.txt +++ b/internal/help/_MOUSEY.txt @@ -29,7 +29,7 @@ selection = 0 'the screen Y coordinate of the previously highlighted item {{Cl|IF}} selection {{Cl|THEN}} selectRow selection, minX, maxX, 0 x = {{Cl|_MOUSEX}} y = {{Cl|_MOUSEY}} - {{Cl|IF}} x >= minX {{Cl|AND (boolean)|AND}} x <= maxX {{Cl|AND (boolean)|AND}} y >= minY {{Cl|AND (boolean)|AND}} y <= maxY {{Cl|THEN}} + {{Cl|IF}} x >= minX {{Cl|AND (boolean)|AND}} x <= maxX {{Cl|AND (boolean)|AND}} y >= minY {{Cl|AND (boolean)|AND}} y <= maxY {{Cl|THEN}} selection = y {{Cl|ELSE}} selection = 0 @@ -38,7 +38,7 @@ selection = 0 'the screen Y coordinate of the previously highlighted item {{Cl|IF}} selection {{Cl|THEN}} SelectRow selection, minX, maxX, 2 {{Cl|IF}} {{Cl|_MOUSEBUTTON}}(1) {{Cl|THEN}} {{Cl|LOCATE}} 1, 2: {{Cl|PRINT}} x, y, selection {{Cl|END IF}} -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" {{Cl|SUB}} SelectRow (y, x1, x2, col) {{Cl|DEF SEG}} = {{Cl|&H}}B800 @@ -60,4 +60,4 @@ addr& = (x1 - 1 + (y - 1) * {{Cl|_WIDTH (function)|_WIDTH}}) * 2 + 1 * [[Controller Devices]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_NEWIMAGE.txt b/internal/help/_NEWIMAGE.txt index 36d79f0fb..84a71554e 100644 --- a/internal/help/_NEWIMAGE.txt +++ b/internal/help/_NEWIMAGE.txt @@ -7,7 +7,7 @@ The [[_NEWIMAGE]] function prepares a window image surface and returns the [[LON {{Parameters}} -* Minimum [[LONG]] screen dimensions are {{Parameter|width&}} >= 1, {{Parameter|height&}} >= 1 measured in pixels as [[INTEGER]] or [[LONG]] values. +* Minimum [[LONG]] screen dimensions are {{Parameter|width&}} >= 1, {{Parameter|height&}} >= 1 measured in pixels as [[INTEGER]] or [[LONG]] values. ** For mode 0 (text), {{Parameter|width&}} and {{Parameter|height&}} are measured in character blocks, not pixels. * Mode is either a QBasic type [[SCREEN|screen]] mode (0 to 2 or 7 to 13), 256 colors or 32 bit (16 million colors) compatible. @@ -49,33 +49,33 @@ SCREEN _NEWIMAGE(640, 480, 32), , 1, 0 '' '' ''Example 4:'' Switching between two different SCREEN modes {{CodeStart}} '' '' -{{Cl|_TITLE}} "Switching {{Cl|SCREEN}} modes" +{{Cl|_TITLE}} "Switching {{Cl|SCREEN}} modes" {{Cl|SCREEN}} {{Cl|_NEWIMAGE}} (800, 600, 256) mode1& = {{Cl|_DEST}} 'get current screen mode handle mode2& = {{Cl|_NEWIMAGE}} (300, 200, 13) {{Cl|_DEST}} mode2& 'prepare small window -{{Cl|COLOR}} 10: {{Cl|LOCATE}} 10, 13: {{Cl|PRINT}} "mode2& = "; mode2& -{{Cl|COLOR}} 13: {{Cl|LOCATE}} 16, 16: {{Cl|PRINT}} "First" +{{Cl|COLOR}} 10: {{Cl|LOCATE}} 10, 13: {{Cl|PRINT}} "mode2& = "; mode2& +{{Cl|COLOR}} 13: {{Cl|LOCATE}} 16, 16: {{Cl|PRINT}} "First" {{Cl|_DEST}} mode1& 'work in main window {{Cl|LOCATE}} 5 {{Cl|FOR...NEXT|FOR}} c = 1 {{Cl|TO}} 248 Color c: {{Cl|PRINT}} c; {{Cl|NEXT}} -{{Cl|COLOR}} 12: {{Cl|LOCATE}} 20, 44: {{Cl|PRINT}} "mode1& = "; mode1& -{{Cl|COLOR}} 11: {{Cl|LOCATE}} 30, 34: {{Cl|PRINT}} "Press a key to goto Pop-up Window" -{{Cl|DO...LOOP|DO}}: {{Cl|SLEEP}}: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" +{{Cl|COLOR}} 12: {{Cl|LOCATE}} 20, 44: {{Cl|PRINT}} "mode1& = "; mode1& +{{Cl|COLOR}} 11: {{Cl|LOCATE}} 30, 34: {{Cl|PRINT}} "Press a key to goto Pop-up Window" +{{Cl|DO...LOOP|DO}}: {{Cl|SLEEP}}: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" {{Cl|SCREEN}} mode2& 'switch to small window -{{Cl|DO...LOOP|DO}}: {{Cl|SLEEP}}: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" +{{Cl|DO...LOOP|DO}}: {{Cl|SLEEP}}: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" {{Cl|SCREEN}} mode1& 'back to main window -{{Cl|COLOR}} 12: {{Cl|LOCATE}} 37, 43: {{Cl|PRINT}} "One more time!" -{{Cl|DO...LOOP|DO}}: {{Cl|SLEEP}}: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" +{{Cl|COLOR}} 12: {{Cl|LOCATE}} 37, 43: {{Cl|PRINT}} "One more time!" +{{Cl|DO...LOOP|DO}}: {{Cl|SLEEP}}: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" {{Cl|SCREEN}} mode2& 'back to small window -{{Cl|COLOR}} 14: {{Cl|LOCATE}} 16, 16: {{Cl|PRINT}} "LAST " '' '' +{{Cl|COLOR}} 14: {{Cl|LOCATE}} 16, 16: {{Cl|PRINT}} "LAST " '' '' {{CodeEnd}} :''Explanation:'' The [[_DEST (function)|_DEST]] function can determine the present screen mode destination handle. The second _NEWIMAGE handle is created using a SCREEN 13 palette(256 colors also). Each SCREEN is worked on after changing the destination with [[_DEST]] ''handle&'' statement. Images can be created before viewing them. When a key is pressed the second SCREEN created is displayed and so on. @@ -98,4 +98,4 @@ mode2& = {{Cl|_NEWIMAGE}} (300, 200, 13) * [[SCREEN]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_OFFSET.txt b/internal/help/_OFFSET.txt index b7ac28824..c8ab190e3 100644 --- a/internal/help/_OFFSET.txt +++ b/internal/help/_OFFSET.txt @@ -23,8 +23,8 @@ The [[_OFFSET]] variable type stores the location of a value in memory. The byte {{Cl|FUNCTION}} FindWindow& ({{Cl|BYVAL}} ClassName AS {{Cl|_OFFSET}}, WindowName$) {{Cl|END}} {{Cl|DECLARE LIBRARY|DECLARE}} -{{Cl|_TITLE}} "Super Window" -hwnd& = FindWindow(0, "Super Window" + {{Cl|CHR$}}(0)) +{{Cl|_TITLE}} "Super Window" +hwnd& = FindWindow(0, "Super Window" + {{Cl|CHR$}}(0)) {{Cl|TYPE}} BROWSEINFO 'typedef struct _browseinfo '[http://msdn.microsoft.com/en-us/library/bb773205%28v=vs.85%29.aspx Microsoft MSDN] hwndOwner {{Cl|AS}} {{Cl|LONG}} ' ' HWND @@ -37,7 +37,7 @@ hwnd& = FindWindow(0, "Super Window" + {{Cl|CHR$}}(0)) iImage {{Cl|AS}} {{Cl|LONG}} ' ' int {{Cl|END}} {{Cl|TYPE}} 'BROWSEINFO, *PBROWSEINFO, *LPBROWSEINFO; -{{Cl|DECLARE LIBRARY|DECLARE DYNAMIC LIBRARY}} "shell32" +{{Cl|DECLARE LIBRARY|DECLARE DYNAMIC LIBRARY}} "shell32" {{Cl|FUNCTION}} SHBrowseForFolder%& (x {{Cl|AS}} BROWSEINFO) '[http://msdn.microsoft.com/en-us/library/bb762115%28v=vs.85%29.aspx Microsoft MSDN] {{Cl|SUB}} SHGetPathFromIDList ({{Cl|BYVAL}} lpItem {{Cl|AS}} {{Cl|_OFFSET}}, {{Cl|BYVAL}} szDir {{Cl|AS}} {{Cl|_OFFSET}}) '[http://msdn.microsoft.com/en-us/library/bb762194%28VS.85%29.aspx Microsoft MSDN] {{Cl|DECLARE LIBRARY|END DECLARE}} @@ -46,7 +46,7 @@ hwnd& = FindWindow(0, "Super Window" + {{Cl|CHR$}}(0)) b.hwndOwner = hwnd {{Cl|DIM}} s {{Cl|AS}} {{Cl|STRING}} * 1024 b.pszDisplayName = {{Cl|_OFFSET (function)|_OFFSET}}(s$) -a$ = "Choose a folder!!!" + {{Cl|CHR$}}(0) +a$ = "Choose a folder!!!" + {{Cl|CHR$}}(0) b.lpszTitle = {{Cl|_OFFSET (function)|_OFFSET}}(a$) {{Cl|DIM}} o {{Cl|AS}} {{Cl|_OFFSET}} o = SHBrowseForFolder(b) @@ -56,13 +56,14 @@ o = SHBrowseForFolder(b) SHGetPathFromIDList o, {{Cl|_OFFSET (function)|_OFFSET}}(s2$) {{Cl|PRINT}} {{Cl|LEFT$}}(s2$, {{Cl|INSTR}}(s2$, {{Cl|CHR$}}(0)) - 1) {{Cl|ELSE}} - {{Cl|PRINT}} "Cancel?" + {{Cl|PRINT}} "Cancel?" {{Cl|END IF}} '' '' {{CodeEnd}} {{small|Code by Galleon}} {{PageSeeAlso}} +* [[_WINDOWHANDLE]] * [[Using _OFFSET]] * [[_OFFSET (function)]], [[_MEM]] * [[DECLARE LIBRARY]] @@ -70,4 +71,4 @@ o = SHBrowseForFolder(b) * [[Variable Types]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_OFFSET_(function).txt b/internal/help/_OFFSET_(function).txt index 844470d0a..74cf74870 100644 --- a/internal/help/_OFFSET_(function).txt +++ b/internal/help/_OFFSET_(function).txt @@ -23,8 +23,8 @@ The [[_OFFSET]] function returns the memory offset of/within a given variable. {{Cl|SUB}} memcpy ({{Cl|BYVAL}} dest {{Cl|AS}} {{Cl|_OFFSET}}, {{Cl|BYVAL}} source {{Cl|AS}} {{Cl|_OFFSET}}, {{Cl|BYVAL}} bytes {{Cl|AS}} {{Cl|LONG}}) {{Cl|DECLARE LIBRARY|END DECLARE}} -a$ = "1234567890" -b$ = "ABCDEFGHIJ" +a$ = "1234567890" +b$ = "ABCDEFGHIJ" memcpy {{Cl|_OFFSET (function)|_OFFSET}}(a$) + 5, {{Cl|_OFFSET (function)|_OFFSET}}(b$) + 5, 5 {{Cl|PRINT}} a$ '' '' @@ -40,4 +40,4 @@ memcpy {{Cl|_OFFSET (function)|_OFFSET}}(a$) + 5, {{Cl|_OFFSET (function)|_OFFSE * [[Using _OFFSET]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_OPENCLIENT.txt b/internal/help/_OPENCLIENT.txt index fd45373b0..daf87b948 100644 --- a/internal/help/_OPENCLIENT.txt +++ b/internal/help/_OPENCLIENT.txt @@ -3,7 +3,7 @@ The [[_OPENCLIENT]] function connects to a Host on the Internet as a Client and {{PageSyntax}} -: {{Parameter|clientHandle&}} = [[_OPENCLIENT]]('''"TCP/IP:8080:12:30:1:10"''') +: {{Parameter|clientHandle&}} = [[_OPENCLIENT]]('''"TCP/IP:8080:12:30:1:10"''') @@ -18,22 +18,22 @@ The [[_OPENCLIENT]] function connects to a Host on the Internet as a Client and ''Example 1:'' Attempting to connect to a local host(your host) as a client. A zero return indicates failure. {{CodeStart}} -client = {{Cl|_OPENCLIENT}}("TCP/IP:7319:localhost") +client = {{Cl|_OPENCLIENT}}("TCP/IP:7319:localhost") {{Cl|IF...THEN|IF}} client {{Cl|THEN}} - {{Cl|PRINT}} "[Connected to " + {{Cl|_CONNECTIONADDRESS}}(client) + "]" -{{Cl|ELSE}} {{Cl|PRINT}} "[Connection Failed!]" + {{Cl|PRINT}} "[Connected to " + {{Cl|_CONNECTIONADDRESS}}(client) + "]" +{{Cl|ELSE}} {{Cl|PRINT}} "[Connection Failed!]" {{Cl|END IF}} '' '' {{CodeEnd}} :'''NOTE:''' Try a valid TCP/IP port setting to test this routine! -''Example 2:'' Using a "raw" Download function to download the QB64 bee image and displays it. +''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 - {{Cl|SCREEN}} {{Cl|_LOADIMAGE}}("qb64logo.png",32) -{{Cl|ELSE}}: {{Cl|PRINT}} "Couldn't download QB64 logo." +{{Cl|IF...THEN|IF}} Download("www.qb64.net/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|END IF}} {{Cl|SLEEP}} {{Cl|SYSTEM}} @@ -41,21 +41,21 @@ client = {{Cl|_OPENCLIENT}}("TCP/IP:7319:localhost") {{Cl|FUNCTION}} Download (url$, file$, timelimit) ' returns -1 if successful, 0 if not url2$ = url$ -x = {{Cl|INSTR}}(url2$, "/") +x = {{Cl|INSTR}}(url2$, "/") {{Cl|IF...THEN|IF}} x {{Cl|THEN}} url2$ = {{Cl|LEFT$}}(url$, x - 1) -client = {{Cl|_OPENCLIENT}}("TCP/IP:80:" + url2$) +client = {{Cl|_OPENCLIENT}}("TCP/IP:80:" + url2$) {{Cl|IF...THEN|IF}} client = 0 {{Cl|THEN}} {{Cl|EXIT FUNCTION}} e$ = {{Cl|CHR$}}(13) + {{Cl|CHR$}}(10) ' end of line characters url3$ = {{Cl|RIGHT$}}(url$, {{Cl|LEN}}(url$) - x + 1) -x$ = "GET " + url3$ + " HTTP/1.1" + e$ -x$ = x$ + "Host: " + url2$ + e$ + e$ +x$ = "GET " + url3$ + " HTTP/1.1" + e$ +x$ = x$ + "Host: " + url2$ + e$ + e$ {{Cl|PUT (TCP/IP statement)|PUT}} #client, , x$ t! = {{Cl|TIMER}} ' start time {{Cl|DO}} {{Cl|_DELAY}} 0.05 ' 50ms delay (20 checks per second) {{Cl|GET (TCP/IP statement)|GET}} #client, , a2$ a$ = a$ + a2$ - i = {{Cl|INSTR}}(a$, "Content-Length:") + i = {{Cl|INSTR}}(a$, "Content-Length:") {{Cl|IF...THEN|IF}} i {{Cl|THEN}} i2 = {{Cl|INSTR}}(i, a$, e$) {{Cl|IF...THEN|IF}} i2 {{Cl|THEN}} @@ -78,7 +78,7 @@ t! = {{Cl|TIMER}} ' start time {{Cl|END IF}} ' i3 {{Cl|END IF}} ' i2 {{Cl|END IF}} ' i -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|TIMER}} > t! + timelimit ' (in seconds) +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|TIMER}} > t! + timelimit ' (in seconds) {{Cl|CLOSE}} client {{Cl|END FUNCTION}} '' '' {{CodeEnd}} @@ -94,4 +94,4 @@ t! = {{Cl|TIMER}} ' start time * [[Downloading Files]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_OPENCONNECTION.txt b/internal/help/_OPENCONNECTION.txt index a1914b061..26972170a 100644 --- a/internal/help/_OPENCONNECTION.txt +++ b/internal/help/_OPENCONNECTION.txt @@ -21,7 +21,7 @@ The [[_OPENCONNECTION]] function opens a connection from a client that the host {{CodeStart}} - host = {{Cl|_OPENHOST}}("TCP/IP:8080") + host = {{Cl|_OPENHOST}}("TCP/IP:8080") {{Cl|DO}} newclient = {{Cl|_OPENCONNECTION}}(host) ' monitor host connection {{Cl|IF...THEN|IF}} newclient {{Cl|THEN}} @@ -31,7 +31,7 @@ The [[_OPENCONNECTION]] function opens a connection from a client that the host {{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|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" ' any keypress quits {{Cl|CLOSE}} #host {{Cl|SYSTEM}} @@ -47,4 +47,4 @@ The [[_OPENCONNECTION]] function opens a connection from a client that the host * [[_CONNECTED]], [[_CONNECTIONADDRESS]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_OPENHOST.txt b/internal/help/_OPENHOST.txt index 207f2aecd..37e6f96c9 100644 --- a/internal/help/_OPENHOST.txt +++ b/internal/help/_OPENHOST.txt @@ -3,7 +3,7 @@ The [[_OPENHOST]] function opens a Host which listens for new connections and re {{PageSyntax}} -: {{Parameter|hostHandle}} = [[_OPENHOST]]('''"TCP/IP:8080"''') +: {{Parameter|hostHandle}} = [[_OPENHOST]]('''"TCP/IP:8080"''') {{PageDescription}} @@ -20,43 +20,43 @@ The [[_OPENHOST]] function opens a Host which listens for new connections and re {{CodeStart}} - {{Cl|PRINT}} "Mini Messenger" + {{Cl|PRINT}} "Mini Messenger" {{Cl|LOCATE}} , , 1 ' display the print cursor for INKEY$ - client = {{Cl|_OPENCLIENT}}("TCP/IP:7319:localhost") ' Attempt to connect to local host as a client + client = {{Cl|_OPENCLIENT}}("TCP/IP:7319:localhost") ' Attempt to connect to local host as a client {{Cl|IF...THEN|IF}} client {{Cl|THEN}} - {{Cl|PRINT}} "[connected to " + {{Cl|_CONNECTIONADDRESS}}(client) + "]" - {{Cl|_TITLE}} "Client - Mini Messenger" - {{Cl|INPUT}} "Enter your name: ", myname$ - {{Cl|PRINT (TCP/IP statement)|PRINT}} #client, myname$ + " connected!" + {{Cl|PRINT}} "[connected to " + {{Cl|_CONNECTIONADDRESS}}(client) + "]" + {{Cl|_TITLE}} "Client - Mini Messenger" + {{Cl|INPUT}} "Enter your name: ", myname$ + {{Cl|PRINT (TCP/IP statement)|PRINT}} #client, myname$ + " connected!" {{Cl|DO...LOOP|DO}} GetMessage client SendMessage myname$, mymessage$, client ' display current input on screen {{Cl|_DELAY}} 0.01 ' reduce CPU usage {{Cl|LOOP}} - {{Cl|ELSE}} ' "if client" alternative to open a new Host - {{Cl|PRINT}} "[No existing host found]" - host = {{Cl|_OPENHOST}}("TCP/IP:7319") ' no host found, so begin new host + {{Cl|ELSE}} ' "if client" alternative to open a new Host + {{Cl|PRINT}} "[No existing host found]" + host = {{Cl|_OPENHOST}}("TCP/IP:7319") ' no host found, so begin new host {{Cl|IF...THEN|IF}} host {{Cl|THEN}} - {{Cl|_TITLE}} "Host - Mini Messenger" - {{Cl|PRINT}} "[Beginning new host chat session!]" + {{Cl|_TITLE}} "Host - Mini Messenger" + {{Cl|PRINT}} "[Beginning new host chat session!]" {{Cl|DIM}} Users(1 to 1000) ' array to hold other client info numclients = 0 - client = {{Cl|_OPENCLIENT}}("TCP/IP:7319:localhost") - IF client = 0 THEN PRINT "ERROR: could not attach host's personal client to host!" - {{Cl|INPUT}} "Enter your name:", myname$ - {{Cl|PRINT (TCP/IP statement)|PRINT}} #client, myname$ + " connected!" - {{Cl|PRINT}} "[Chat session active!]" + client = {{Cl|_OPENCLIENT}}("TCP/IP:7319:localhost") + IF client = 0 THEN PRINT "ERROR: could not attach host's personal client to host!" + {{Cl|INPUT}} "Enter your name:", myname$ + {{Cl|PRINT (TCP/IP statement)|PRINT}} #client, myname$ + " connected!" + {{Cl|PRINT}} "[Chat session active!]" {{Cl|DO...LOOP|DO}} ' host main loop newclient = {{Cl|_OPENCONNECTION}}(host) ' receive any new connection {{Cl|IF...THEN|IF}} newclient {{Cl|THEN}} numclients = numclients + 1 Users(numclients) = newclient - {{Cl|PRINT (TCP/IP statement)|PRINT}} #Users(numclients),"Welcome!" + {{Cl|PRINT (TCP/IP statement)|PRINT}} #Users(numclients),"Welcome!" {{Cl|END IF}} {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} numclients ' distribute incoming messages to all clients {{Cl|IF...THEN|IF}} Users(i) {{Cl|THEN}} {{Cl|INPUT (TCP/IP statement)|INPUT}} #Users(i), message$ - {{Cl|IF...THEN|IF}} message$ <> "" {{Cl|THEN}} + {{Cl|IF...THEN|IF}} message$ <> "" {{Cl|THEN}} {{Cl|FOR...NEXT|FOR}} p = 1 {{Cl|TO}} numclients {{Cl|IF...THEN|IF}} Users(p) {{Cl|THEN}} {{Cl|PRINT (TCP/IP statement)|PRINT}} #Users(p), message$ {{Cl|NEXT}} p @@ -68,7 +68,7 @@ The [[_OPENHOST]] function opens a Host which listens for new connections and re {{Cl|_DELAY}} 0.01 ' reduce CPU usage {{Cl|LOOP}} {{Cl|END IF}} ' host - {{Cl|PRINT}} "ERROR: Could not begin new host!" + {{Cl|PRINT}} "ERROR: Could not begin new host!" {{Cl|END IF}} ' if client from start {{Cl|SLEEP}} {{Cl|SYSTEM}} @@ -78,7 +78,7 @@ The [[_OPENHOST]] function opens a Host which listens for new connections and re {{Cl|SUB}} GetMessage (client) ' get & display any new message {{Cl|INPUT (TCP/IP statement)|INPUT}} #client, newmessage$ - {{Cl|IF...THEN|IF}} newmessage$ <> "" {{Cl|THEN}} + {{Cl|IF...THEN|IF}} newmessage$ <> "" {{Cl|THEN}} {{Cl|VIEW PRINT}} 1 {{Cl|TO}} 23 {{Cl|LOCATE}} 23,1 {{Cl|PRINT}} newmessage$ @@ -89,18 +89,18 @@ The [[_OPENHOST]] function opens a Host which listens for new connections and re {{Cl|SUB}} SendMessage (myname$, mymessage$, client) ' simple input handler k$ = {{Cl|INKEY$}} {{Cl|IF...THEN|IF}} {{Cl|LEN}}(k$) {{Cl|THEN}} - {{Cl|IF...THEN|IF}} k$ = {{Cl|CHR$}}(8) {{Cl|AND (boolean)|AND}} [[LEN]](mymessage$) <> 0 {{Cl|THEN}} + {{Cl|IF...THEN|IF}} k$ = {{Cl|CHR$}}(8) {{Cl|AND (boolean)|AND}} [[LEN]](mymessage$) <> 0 {{Cl|THEN}} mymessage$ = {{Cl|LEFT$}}(mymessage$, {{Cl|LEN}}(mymessage$) - 1) {{Cl|ELSE}} - {{Cl|IF...THEN|IF}} {{Cl|LEN}}(k$) = 1 {{Cl|AND (boolean)|AND}} {{Cl|ASC}}(k$) >= 32 {{Cl|THEN}} mymessage$ = mymessage$ + k$ + {{Cl|IF...THEN|IF}} {{Cl|LEN}}(k$) = 1 {{Cl|AND (boolean)|AND}} {{Cl|ASC}}(k$) >= 32 {{Cl|THEN}} mymessage$ = mymessage$ + k$ {{Cl|END IF}} {{Cl|END IF}} {{Cl|LOCATE}} 24, 1: {{Cl|PRINT}} {{Cl|SPACE$}}(80); ' erase previous message displayed - {{Cl|LOCATE}} 24, 1: {{Cl|PRINT}} myname$ + ": ";mymessage$; + {{Cl|LOCATE}} 24, 1: {{Cl|PRINT}} myname$ + ": ";mymessage$; {{Cl|IF...THEN|IF}} k$ = {{Cl|CHR$}}(13) {{Cl|THEN}} ' [Enter] sends the message - {{Cl|IF...THEN|IF}} mymessage$ = "" {{Cl|THEN}} {{Cl|SYSTEM}} ' [Enter] with no message ends program - {{Cl|PRINT (TCP/IP statement)|PRINT}} #client, myname$ + ": " + mymessage$ - mymessage$ = "" + {{Cl|IF...THEN|IF}} mymessage$ = "" {{Cl|THEN}} {{Cl|SYSTEM}} ' [Enter] with no message ends program + {{Cl|PRINT (TCP/IP statement)|PRINT}} #client, myname$ + ": " + mymessage$ + mymessage$ = "" {{Cl|END IF}} {{Cl|IF...THEN|IF}} k$ = {{Cl|CHR$}}(27) {{Cl|THEN}} {{Cl|SYSTEM}} ' [Esc] key ends program {{Cl|END SUB}} @@ -114,7 +114,7 @@ Enter your name:_ {{OutputEnd}} ''Explanation:'' The SendMessage SUB program controls the program exit unless both Client and Host fail. Entering no message and hitting [Enter] or pressing the [Esc]] key closes the program. Both SUB programs allow a Client or Host to communicate with others simply. {{KW|INPUT (TCP/IP statement)|INPUT #}} is used to read messages and {{KW|PRINT (TCP/IP statement)|PRINT #}} is used to send messages. The client handle value is used as the port number. Keep in mind that this is just an example. A lot could be added, like recording IP addresses. -<center>'''To manage the users array, see the [[_CONNECTED]] page example.'''</center> +<center>'''To manage the users array, see the [[_CONNECTED]] page example.'''</center> {{PageSeeAlso}} @@ -125,4 +125,4 @@ Enter your name:_ * [[Downloading Files]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_OS$.txt b/internal/help/_OS$.txt index b4c885995..a64aa1eab 100644 --- a/internal/help/_OS$.txt +++ b/internal/help/_OS$.txt @@ -6,11 +6,11 @@ The [[_OS$]] function returns the operating system and QB64 compiler bit version {{PageDescription}} -* Returns a [[STRING]] listing the OS as [WINDOWS], [LINUX] or [MACOSX] and the compiler bit format of [32BIT] or [64BIT]. [[Example: {{text|[WINDOWS][32BIT]|green}}]] +* Returns a [[STRING]] listing the OS as [WINDOWS], [LINUX] or [MACOSX] and the compiler bit format of [32BIT] or [64BIT]. Example: {{text|[WINDOWS][32BIT]}} * Allows a BAS program to be compiled with QB64 in Windows, Linux or MacOSX using different OS or language specifications. * Use the return {{Parameter|compilerVersion$}} to specify the current OS code to use when a BAS program is compiled using another version of the QB64 compiler. * Windows can use either a 32 (default) or 64 bit compiler. Linux and Mac use 64 bit by default. -* Explanation by Galleon: http://www.qb64.net/forum/index.php?topic=12193.msg105406#msg105406 +<!-- * Explanation by Galleon: http://www.qb64.net/forum/index.php?topic=12193.msg105406#msg105406 --> {{PageSeeAlso}} @@ -18,4 +18,4 @@ The [[_OS$]] function returns the operating system and QB64 compiler bit version * [[QB64_FAQ#Q:_How_do_I_upgrade_the_32_bit_Windows_version_of_QB64_to_64_bit_functionality.3F|Upgrading QB64 to use a 64-bit compiler in Windows]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_PALETTECOLOR.txt b/internal/help/_PALETTECOLOR.txt index 36c922d41..6fdb7f5d4 100644 --- a/internal/help/_PALETTECOLOR.txt +++ b/internal/help/_PALETTECOLOR.txt @@ -15,7 +15,7 @@ The [[_PALETTECOLOR]] statement sets the color value of a palette entry of an im * If {{Parameter|destHandle&}} is an invalid handle value, an [[ERROR Codes|invalid handle]] error occurs. -<center>'''Basic's 16 Default Color Attributes (non-[[DAC]])'''</center> +<center>'''Basic's 16 Default Color Attributes (non-[[DAC]])'''</center> {{OutputStart}}{{text|  Attribute    Description     Red   Green   Blue 32 HEX HTML Name |Gold}}  0 Black 0 0 0 000000 Black {{text|  1 Dark Blue 0 0 42 00008B DarkBlue|#00208B}} @@ -34,7 +34,7 @@ The [[_PALETTECOLOR]] statement sets the color value of a palette entry of an im {{text| 14 Yellow 63 63 21 FFFF00 Yellow|#FFFF00}} {{text| 15 White 63 63 63 FFFFFF White|#FFFFFF}} '' '' {{OutputEnd}} -<center>[http://www.w3schools.com/html/html_colornames.asp HTML Color Table Values and Names] or [http://www.tayloredmktg.com/rgb/#OR Other RGB colors]</center> +<center>[http://www.w3schools.com/html/html_colornames.asp HTML Color Table Values and Names] or [http://www.tayloredmktg.com/rgb/#OR Other RGB colors]</center> ::: ''Note:'' '''QB64''' 32 bit color intensity values from 0 to 255 can be found by multiplying above values by 4. ''Summary:'' The red, green, and blue intensity values can be changed using [[OUT]] or [[PALETTE]] statements. Some '''QBasic''' RGB color attribute values can be changed in [[DAC]] [[SCREEN (statement)|SCREEN]] modes and the [[DAC]] RGB intensity settings may be different. @@ -50,15 +50,15 @@ The [[_PALETTECOLOR]] statement sets the color value of a palette entry of an im {{Cl|_PALETTECOLOR}} 5, {{Cl|_RGB32}}(170, 0, 0) ' dark red. {{Cl|_PALETTECOLOR}} 6, {{Cl|_RGB32}}(85, 0, 0) ' darker red. -{{Cl|COLOR}} 0, 1: {{Cl|PRINT}} "black on white." -{{Cl|COLOR}} 0, 2: {{Cl|PRINT}} "black on lighter red." -{{Cl|COLOR}} 0, 3: {{Cl|PRINT}} "black on light red." -{{Cl|COLOR}} 0, 4: {{Cl|PRINT}} "black on red." -{{Cl|COLOR}} 0, 5: {{Cl|PRINT}} "black on dark red." -{{Cl|COLOR}} 0, 6: {{Cl|PRINT}} "black on darker red. +{{Cl|COLOR}} 0, 1: {{Cl|PRINT}} "black on white." +{{Cl|COLOR}} 0, 2: {{Cl|PRINT}} "black on lighter red." +{{Cl|COLOR}} 0, 3: {{Cl|PRINT}} "black on light red." +{{Cl|COLOR}} 0, 4: {{Cl|PRINT}} "black on red." +{{Cl|COLOR}} 0, 5: {{Cl|PRINT}} "black on dark red." +{{Cl|COLOR}} 0, 6: {{Cl|PRINT}} "black on darker red. -{{Cl|COLOR}} 1, 6: {{Cl|PRINT}} "white on darker red" -{{Cl|COLOR}} 2, 6: {{Cl|PRINT}} "ligher red on darker red" '' '' +{{Cl|COLOR}} 1, 6: {{Cl|PRINT}} "white on darker red" +{{Cl|COLOR}} 2, 6: {{Cl|PRINT}} "ligher red on darker red" '' '' {{CodeEnd}} : ''Note:'' [[_PALETTECOLOR]] expects [[LONG]] [[_RGB32]] or [[_RGBA32]] 32 bit color values, not [[_RGB]] or [[_RGBA]] palette attribute values. @@ -72,4 +72,4 @@ The [[_PALETTECOLOR]] statement sets the color value of a palette entry of an im * [[HEX$ 32 Bit Values]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_PALETTECOLOR_(function).txt b/internal/help/_PALETTECOLOR_(function).txt index 6fbfa8767..3e1013650 100644 --- a/internal/help/_PALETTECOLOR_(function).txt +++ b/internal/help/_PALETTECOLOR_(function).txt @@ -31,8 +31,8 @@ FOR c& = 0 TO 15 RGB(c& * 3) = red%: RGB((c& * 3) + 1) = green%: RGB((c& * 3) + 2) = blue% NEXT FOR i = 0 TO 47 STEP 3 - RGBval$ = LTRIM$(STR$(RGB(i))) + "," + STR$(RGB(i + 1)) + "," + STR$(RGB(i + 2)) + ")" - PRINT "Color"; i / 3, "_RGB(" + RGBval$; + RGBval$ = LTRIM$(STR$(RGB(i))) + "," + STR$(RGB(i + 1)) + "," + STR$(RGB(i + 2)) + ")" + PRINT "Color"; i / 3, "_RGB(" + RGBval$; PRINT NEXT END '' '' @@ -47,4 +47,4 @@ END '' '' * [[SAVEIMAGE]] (example code) -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_PI.txt b/internal/help/_PI.txt index d4acb438f..928a87545 100644 --- a/internal/help/_PI.txt +++ b/internal/help/_PI.txt @@ -32,4 +32,4 @@ PRINT circlearea * [[SIN]], [[COS]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_PIXELSIZE.txt b/internal/help/_PIXELSIZE.txt index 9ec601a9f..02a566501 100644 --- a/internal/help/_PIXELSIZE.txt +++ b/internal/help/_PIXELSIZE.txt @@ -47,4 +47,4 @@ GetImage& = h& * [[_COPYPALETTE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_PRESERVE.txt b/internal/help/_PRESERVE.txt index 3f84ea681..ce2012c17 100644 --- a/internal/help/_PRESERVE.txt +++ b/internal/help/_PRESERVE.txt @@ -18,8 +18,8 @@ The [[_PRESERVE]] [[REDIM]] action preserves the current contents of [[$DYNAMIC| {{PageErrors}} * [[SUB]] or [[FUNCTION]] arrays created using [[REDIM]] require that they be recreated to be used after arrays are [[ERASE]]d. -* '''Warning:''' Do not use negative upper array index values as an "Out of Memory" [[ERROR Codes|error]] (or global Operating System errors) will occur.''' -* Use [[_PRESERVE]] before [[SHARED]] or an "invalid variable name" error will occur. +* '''Warning:''' Do not use negative upper array index values as an "Out of Memory" [[ERROR Codes|error]] (or global Operating System errors) will occur.''' +* Use [[_PRESERVE]] before [[SHARED]] or an "invalid variable name" error will occur. {{PageExamples}} @@ -38,11 +38,11 @@ a(5) = 123 {{CodeStart}} '' '' {{Cl|REDIM}} Array$(1) 'create a dynamic string array -filename$ = "Readme.txt" 'Qb64 information text file +filename$ = "Readme.txt" 'Qb64 information text file {{Cl|OPEN}} filename$ {{Cl|FOR (file statement)|FOR}} {{Cl|INPUT (file mode)|INPUT}} {{Cl|AS}} #1 {{Cl|DO}} {{Cl|UNTIL}} {{Cl|EOF}}(1) count = count + 1 - {{Cl|IF}} count > {{Cl|UBOUND}}(Array$) {{Cl|THEN}} + {{Cl|IF}} count > {{Cl|UBOUND}}(Array$) {{Cl|THEN}} {{Cl|REDIM}} {{Cl|_PRESERVE}} Array$(count * 3 / 2)'increase array's size by 50% without losing data {{cl|END IF}} @@ -65,4 +65,4 @@ filename$ = "Readme.txt" 'Qb64 information text file * [[Arrays]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_PRINTIMAGE.txt b/internal/help/_PRINTIMAGE.txt index 7d941097f..01c7945c2 100644 --- a/internal/help/_PRINTIMAGE.txt +++ b/internal/help/_PRINTIMAGE.txt @@ -25,28 +25,28 @@ CursorPosY = 0 'example text to print PointSize = 12 -text$ = "The rain in Spain falls mainly on the plain." +text$ = "The rain in Spain falls mainly on the plain." {{Cl|GOSUB}} PrintText PointSize = 50 -text$ = "BUT!" +text$ = "BUT!" {{Cl|GOSUB}} PrintText PointSize = 12 -text$ = "In Hartford, Hereford, and Hampshire, hurricanes hardly happen." +text$ = "In Hartford, Hereford, and Hampshire, hurricanes hardly happen." {{Cl|GOSUB}} PrintText -{{Cl|INPUT}} "Preview (Y/N)?", i$ 'print preview of screen (optional) -{{Cl|IF...THEN|IF}} {{Cl|UCASE$}}(i$) = "Y" {{Cl|THEN}} +{{Cl|INPUT}} "Preview (Y/N)?", i$ 'print preview of screen (optional) +{{Cl|IF...THEN|IF}} {{Cl|UCASE$}}(i$) = "Y" {{Cl|THEN}} Prev& = {{Cl|_NEWIMAGE}}(600, 900, 32) 'print preview smaller image _PUTIMAGE Page&, Prev& {{Cl|SCREEN (statement)|SCREEN}} Prev& - DO: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" + DO: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" {{Cl|SCREEN (statement)|SCREEN}} 0 {{Cl|END IF}} -{{Cl|INPUT}} "Print on printer (Y/N)?", i$ 'print screen page on printer -{{Cl|IF...THEN|IF}} {{Cl|UCASE$}}(i$) = "Y" {{Cl|THEN}} +{{Cl|INPUT}} "Print on printer (Y/N)?", i$ 'print screen page on printer +{{Cl|IF...THEN|IF}} {{Cl|UCASE$}}(i$) = "Y" {{Cl|THEN}} {{Cl|_PRINTIMAGE}} Page& {{Cl|END IF}} @@ -54,7 +54,7 @@ text$ = "In Hartford, Hereford, and Hampshire, hurricanes hardly happen.&qu PrintText: FontHeight = {{Cl|INT}}(PointSize * 0.3527 * PageScale) -FontHandle = {{Cl|_LOADFONT}}("c:\windows\fonts\times.ttf", FontHeight) +FontHandle = {{Cl|_LOADFONT}}("c:\windows\fonts\times.ttf", FontHeight) {{Cl|_DEST}} Page& {{Cl|_FONT}} FontHandle {{Cl|COLOR}} {{Cl|_RGB}}(255, 0, 0), {{Cl|_RGBA}}(0, 0, 0, 0) 'RED text on clear black background @@ -71,15 +71,15 @@ CursorPosY = CursorPosY + FontHeight 'adjust print position down ''Example 2:'' Printing an old SCREEN 12 [[ASCII]] table using a deeper sized page to prevent stretching by [[_PRINTIMAGE]]. {{CodeStart}} '' '' -{{Cl|_TITLE}} "Print Preview ASCII Table" +{{Cl|_TITLE}} "Print Preview ASCII Table" {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(640, 900, 256) 'size is proportional to 210mm X 297mm(8-1/2 X 11) paper {{Cl|OUT}} {{Cl|&H}}3C8, 0: {{Cl|OUT}} {{Cl|&H}}3C9, 63: {{Cl|OUT}} {{Cl|&H}}3C9, 63: {{Cl|OUT}} {{Cl|&H}}3C9, 63 'white background saves ink! -Align 8, 2, "ASCII and Extended Character Code Table using {{Cl|CHR$}}(n%)" +Align 8, 2, "ASCII and Extended Character Code Table using {{Cl|CHR$}}(n%)" {{Cl|PRINT}} {{Cl|STRING$}}(80, 223) {{Cl|COLOR}} 40 -{{Cl|PRINT}} " "; +{{Cl|PRINT}} " "; {{Cl|FOR...NEXT|FOR}} i% = 0 {{Cl|TO}} 13 {{Cl|PRINT}} i%;: SetCHR {{Cl|CSRLIN}}, {{Cl|POS}}(0), 40, i% {{Cl|LOCATE}} {{Cl|CSRLIN}}, {{Cl|POS}}(0) + 1 @@ -100,7 +100,7 @@ Align 8, 2, "ASCII and Extended Character Code Table using {{Cl|CHR$}}(n%)& {{Cl|FOR...NEXT|FOR}} i% = 33 {{Cl|TO}} 255 {{Cl|SELECT CASE}} i% {{Cl|CASE}} 45, 58, 71, 84: {{Cl|LOCATE}} {{Cl|CSRLIN}} + 1, 1 - {{Cl|CASE}} {{Cl|IS}} > 96: {{Cl|IF...THEN|IF}} (i% - 97) {{Cl|MOD}} 11 = 0 {{Cl|THEN}} {{Cl|LOCATE}} {{Cl|CSRLIN}} + 1, 1 + {{Cl|CASE}} {{Cl|IS}} > 96: {{Cl|IF...THEN|IF}} (i% - 97) {{Cl|MOD}} 11 = 0 {{Cl|THEN}} {{Cl|LOCATE}} {{Cl|CSRLIN}} + 1, 1 {{Cl|END SELECT}} {{Cl|SELECT CASE}} i% {{Cl|CASE}} 48 {{Cl|TO}} 57: {{Cl|COLOR}} 9 'denotes number keys 48 to 57 @@ -108,25 +108,25 @@ Align 8, 2, "ASCII and Extended Character Code Table using {{Cl|CHR$}}(n%)& {{Cl|CASE}} 97 {{Cl|TO}} 122: {{Cl|COLOR}} 36 'a to z keys 97 to 122 {{Cl|CASE}} 127 {{Cl|TO}} 175: {{Cl|COLOR}} 42 {{Cl|CASE}} 176 {{Cl|TO}} 223: {{Cl|COLOR}} 6 'drawing characters 176 to 223 - {{Cl|CASE}} {{Cl|IS}} > 223: {{Cl|COLOR}} 42 + {{Cl|CASE}} {{Cl|IS}} > 223: {{Cl|COLOR}} 42 {{Cl|CASE ELSE}}: {{Cl|COLOR}} 2 {{Cl|END SELECT}} {{Cl|IF...THEN|IF}} i% = 98 {{Cl|OR (boolean)|OR}} i% = 99 {{Cl|OR (boolean)|OR}} i% = 100 {{Cl|THEN}} {{Cl|PRINT}} {{Cl|SPACE$}}(1); - {{Cl|PRINT}} " "; i%; {{Cl|CHR$}}(i%); + {{Cl|PRINT}} " "; i%; {{Cl|CHR$}}(i%); {{Cl|NEXT}} i% -{{Cl|COLOR}} 3: {{Cl|PRINT}} "= NBSP(Non-Breaking Space)" +{{Cl|COLOR}} 3: {{Cl|PRINT}} "= NBSP(Non-Breaking Space)" {{Cl|COLOR}} 8: {{Cl|PRINT}} {{Cl|STRING$}}(80, {{Cl|CHR$}}(220)) Border 8 -{{Cl|COLOR}} 4: {{Cl|LOCATE}} 27, 4: {{Cl|PRINT}} "7) BELL, 8) Backspace, 9) Tab, 10) LineFeed(printer), 12) FormFeed(printer)" -{{Cl|LOCATE}} 28, 4: {{Cl|PRINT}} " 13) Return, 26) End Of File, 27) Escape 30) Line up, 31) Line down " +{{Cl|COLOR}} 4: {{Cl|LOCATE}} 27, 4: {{Cl|PRINT}} "7) BELL, 8) Backspace, 9) Tab, 10) LineFeed(printer), 12) FormFeed(printer)" +{{Cl|LOCATE}} 28, 4: {{Cl|PRINT}} " 13) Return, 26) End Of File, 27) Escape 30) Line up, 31) Line down " -Align 13, 29, "Press Ctrl + P to PRINT!" +Align 13, 29, "Press Ctrl + P to PRINT!" -DO: {{Cl|SLEEP}}: K$ = {{Cl|INKEY$}}: {{Cl|LOOP}} {{Cl|UNTIL}} K$ <> "" +DO: {{Cl|SLEEP}}: K$ = {{Cl|INKEY$}}: {{Cl|LOOP}} {{Cl|UNTIL}} K$ <> "" Align 13, 29, {{Cl|SPACE$}}(50) {{Cl|IF...THEN|IF}} K$ = {{Cl|CHR$}}(16) {{Cl|THEN}} {{Cl|_PRINTIMAGE}} 0 '<<<<<<<<<<<< to PRINTER - Align 11, 29, "Use the ASCII Table for a reference of the codes!" + Align 11, 29, "Use the ASCII Table for a reference of the codes!" {{Cl|SOUND}} 700, 4 {{Cl|END IF}} K$ = {{Cl|INPUT$}}(1) @@ -167,4 +167,4 @@ Srow = 16 * (Trow - 1): Scol = 8 * (Tcol - 1) 'convert text to graphic coordinat * [[Windows Printer Settings]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_PRINTMODE.txt b/internal/help/_PRINTMODE.txt index 90de86452..86f91a61f 100644 --- a/internal/help/_PRINTMODE.txt +++ b/internal/help/_PRINTMODE.txt @@ -38,4 +38,4 @@ The [[_PRINTMODE]] statement sets the text or [[_FONT]] printing mode on a backg * [[PRINT]], [[_PRINT USING]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_PRINTMODE_(function).txt b/internal/help/_PRINTMODE_(function).txt index e2857b097..908682be6 100644 --- a/internal/help/_PRINTMODE_(function).txt +++ b/internal/help/_PRINTMODE_(function).txt @@ -25,4 +25,4 @@ The [[_PRINTMODE (function)|_PRINTMODE]] function returns the current [[_PRINTM * [[_PRINTSTRING]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_PRINTSTRING.txt b/internal/help/_PRINTSTRING.txt index 0511172df..2fb0ed08d 100644 --- a/internal/help/_PRINTSTRING.txt +++ b/internal/help/_PRINTSTRING.txt @@ -37,7 +37,7 @@ The [[_PRINTSTRING]] statement prints text [[STRING|strings]] using graphic colu chrstr$ = chrstr$ + {{Cl|CHR$}}(code) + {{Cl|SPACE$}}(1) {{Cl|NEXT}} -{{Cl|_FONT}} {{Cl|_LOADFONT}}("C:\Windows\Fonts\Cour.ttf", 20, "MONOSPACE") 'select monospace font +{{Cl|_FONT}} {{Cl|_LOADFONT}}("C:\Windows\Fonts\Cour.ttf", 20, "MONOSPACE") 'select monospace font {{Cl|_PRINTSTRING}} (0, 16), chrstr$ @@ -55,14 +55,14 @@ Big13& = {{Cl|_NEWIMAGE}}(640, 480, 256) 'use 4 X 3 aspect ratio that Qbasic {{Cl|SCREEN (statement)|SCREEN}} Big13& {{Cl|_DEST}} Scr13& -image1& = {{Cl|_LOADIMAGE}}("Howie.BMP", 256) -image2& = {{Cl|_LOADIMAGE}}("Howie2.BMP", 256) +image1& = {{Cl|_LOADIMAGE}}("Howie.BMP", 256) +image2& = {{Cl|_LOADIMAGE}}("Howie2.BMP", 256) {{Cl|_PUTIMAGE}} (10, 20), image1&, Scr13& {{Cl|_PUTIMAGE}} (160, 20), image2&, Scr13& {{Cl|_COPYPALETTE}} image1&, Scr13& -{{Cl|COLOR}} 151: {{Cl|LOCATE}} 2, 4: PRINTS "Screen 13 Height Reduction to 83%" -{{Cl|LOCATE}} 22, 22: PRINTS {{Cl|CHR$}}(24) + " 4 X 3 Proportion" 'use {{Cl|concatenation}} -{{Cl|LOCATE}} 24, 21: PRINTS {{Cl|CHR$}}(27) + " Stretched at 100%" 'instead of a {{Cl|semicolon}}! +{{Cl|COLOR}} 151: {{Cl|LOCATE}} 2, 4: PRINTS "Screen 13 Height Reduction to 83%" +{{Cl|LOCATE}} 22, 22: PRINTS {{Cl|CHR$}}(24) + " 4 X 3 Proportion" 'use {{Cl|concatenation}} +{{Cl|LOCATE}} 24, 21: PRINTS {{Cl|CHR$}}(27) + " Stretched at 100%" 'instead of a {{Cl|semicolon}}! {{Cl|_COPYPALETTE}} Scr13&, Big13& 'required when imported image colors are used {{Cl|_PUTIMAGE}} , Scr13&, Big13& 'stretches the screen to double the size K$ = {{Cl|INPUT$}}(1) @@ -70,13 +70,13 @@ K$ = {{Cl|INPUT$}}(1) {{Cl|SUB}} PRINTS (Text$) row% = ({{Cl|CSRLIN}} - 1) * {{Cl|_FONTHEIGHT}} 'finds current screen page text or font row height -col% = ({{Cl|POS}}(0) - 1) * {{Cl|_PRINTWIDTH}}("W") 'finds current page text or font column width +col% = ({{Cl|POS}}(0) - 1) * {{Cl|_PRINTWIDTH}}("W") 'finds current page text or font column width {{Cl|_PRINTSTRING}} (col%, row%), Text$ {{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'''. -<center>[https://www.dropbox.com/s/tcdik1ajegbeiz4/HOWIE.zip?dl=0 Download of Example 2 Bitmap images]</center> +<center>[https://www.dropbox.com/s/tcdik1ajegbeiz4/HOWIE.zip?dl=0 Download of Example 2 Bitmap images]</center> ''Example 3:'' Rotating a text string around a graphic object. @@ -94,10 +94,10 @@ row = 1 x = 300 + (scale * 40 - (row * xrot)) * {{Cl|COS}}(i) y = 200 + (scale * 40 - (row * yrot)) * {{Cl|SIN}}(i) cnt = cnt + 1 - {{Cl|COLOR}} 7: {{Cl|_PRINTSTRING}} (x, y), "HELLO WORLD!", 0 'display + {{Cl|COLOR}} 7: {{Cl|_PRINTSTRING}} (x, y), "HELLO WORLD!", 0 'display {{Cl|IF}} cnt = {{Cl|LEN}}(text$) * 8 {{Cl|THEN}} cnt = 0: {{Cl|EXIT DO}} {{Cl|_DISPLAY}} - {{Cl|COLOR}} 0: {{Cl|_PRINTSTRING}} (x, y), "HELLO WORLD!", 0 'erase + {{Cl|COLOR}} 0: {{Cl|_PRINTSTRING}} (x, y), "HELLO WORLD!", 0 'erase {{Cl|_DELAY}} 0.02 {{Cl|NEXT}} {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) 'escape key exit @@ -116,4 +116,4 @@ row = 1 * [[Text Using Graphics]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_PRINTWIDTH.txt b/internal/help/_PRINTWIDTH.txt index 1d523a6e5..cf4dd2640 100644 --- a/internal/help/_PRINTWIDTH.txt +++ b/internal/help/_PRINTWIDTH.txt @@ -18,28 +18,28 @@ The [[_PRINTWIDTH]] function returns the width in pixels of the text [[STRING|st ''Example:'' SUB returns font or screen mode's text block size using _PRINTWIDTH and [[_FONTHEIGHT]] without a handle parameter. {{CodeStart}} '' '' {{Cl|DO}} - {{Cl|INPUT}} "Enter Screen mode 1, 2 or 7 to 13: ", scr$ + {{Cl|INPUT}} "Enter Screen mode 1, 2 or 7 to 13: ", scr$ mode% = {{Cl|VAL}}(scr$) -{{Cl|LOOP}} {{Cl|UNTIL}} mode% > 0 +{{Cl|LOOP}} {{Cl|UNTIL}} mode% > 0 {{Cl|SCREEN (statement)|SCREEN}} mode% -{{Cl|INPUT}} "Enter first name of TTF font to use or hit enter for text size: ", TTFont$ -{{Cl|IF}} {{Cl|LEN}}(TTFont$) {{Cl|THEN}} {{Cl|INPUT (file mode)|INPUT}} "Enter font height: ", hi$ +{{Cl|INPUT}} "Enter first name of TTF font to use or hit enter for text size: ", TTFont$ +{{Cl|IF}} {{Cl|LEN}}(TTFont$) {{Cl|THEN}} {{Cl|INPUT (file mode)|INPUT}} "Enter font height: ", hi$ height& = {{Cl|VAL}}(hi$) -{{Cl|IF}} height& > 0 {{Cl|THEN}} {{Cl|_FONT}} {{Cl|_LOADFONT}}("C:\Windows\Fonts\" + TTFont$ + ".ttf", height&, style$) +{{Cl|IF}} height& > 0 {{Cl|THEN}} {{Cl|_FONT}} {{Cl|_LOADFONT}}("C:\Windows\Fonts\" + TTFont$ + ".ttf", height&, style$) TextSize wide&, high& 'get the font or current screen mode's text block pixel size -{{Cl|_PRINTSTRING}} (20, 100), {{Cl|CHR$}}(1) + {{Cl|STR$}}(wide&) + " X" + {{Cl|STR$}}(high&) + " " + {{Cl|CHR$}}(2) +{{Cl|_PRINTSTRING}} (20, 100), {{Cl|CHR$}}(1) + {{Cl|STR$}}(wide&) + " X" + {{Cl|STR$}}(high&) + " " + {{Cl|CHR$}}(2) {{Cl|END}} {{Cl|SUB}} TextSize (TextWidth&, TextHeight&) -TextWidth& = {{Cl|_PRINTWIDTH}}("W") 'measure width of one font or text character +TextWidth& = {{Cl|_PRINTWIDTH}}("W") 'measure width of one font or text character TextHeight& = {{Cl|_FONTHEIGHT}} 'can measure normal text block heights also {{Cl|END SUB}} '' '' {{CodeEnd}} {{small|Code by Ted Weissgerber}} -<center>'''Note:''' The SUB procedure does not need the font handle for font sizes after [[_FONT]] enables one.</center> +<center>'''Note:''' The SUB procedure does not need the font handle for font sizes after [[_FONT]] enables one.</center> {{PageSeeAlso}} @@ -49,4 +49,4 @@ TextHeight& = {{Cl|_FONTHEIGHT}} 'can measure normal text block heig * [[Text Using Graphics]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_PUTIMAGE.txt b/internal/help/_PUTIMAGE.txt index ba94bd83b..8429d2721 100644 --- a/internal/help/_PUTIMAGE.txt +++ b/internal/help/_PUTIMAGE.txt @@ -41,7 +41,7 @@ ** {{Parameter|sy2}} = the row coordinate of the bottom-most pixel to include of the source. Can be omitted to get rest of image. * ''_SMOOTH'' applies linear filtering ('''version 1.000 and up'''). -<center>'''Note: The [[PUT (graphics statement)|PUT]] options PSET, PRESET, AND, OR and XOR are not available with _PUTIMAGE. QB64 can use [[_ALPHA|transparency]] of colors to achieve the same results.'''</center> +<center>'''Note: The [[PUT (graphics statement)|PUT]] options PSET, PRESET, AND, OR and XOR are not available with _PUTIMAGE. QB64 can use [[_ALPHA|transparency]] of colors to achieve the same results.'''</center> {{PageDescription}} @@ -49,9 +49,9 @@ * '''The {{Parameter|sourceHandle&}} and {{Parameter|destHandle&}} cannot be the same or an [[ERROR Codes|Illegal Function Call]] error will occur.''' * If the area of the source is bigger or smaller than the area of the destination then the image is adjusted to fit that area. * Supports 32 bit alpha blending, color key transparency, true type fonts, stretching, mirroring/flipping, and a variety of graphics file formats including gif, png, bmp & jpg. '''32 bit screen surface backgrounds (black) have zero [[_ALPHA]] and are transparent when placed over other surfaces.''' Use [[CLS]] or [[_DONTBLEND]] to make a new surface background [[_ALPHA]] 255 or opaque. -* All graphical surfaces, including screen pages, can be acted upon in the same manner, and are referred to as "images". +* All graphical surfaces, including screen pages, can be acted upon in the same manner, and are referred to as "images". * '''Hardware images''' (created using mode '''33''' via [[_LOADIMAGE]] or [[_COPYIMAGE]]) can be used as the source or destination. -* [[Handle]]s are used to identify graphical surfaces. Positive values are used to refer to screen pages. -1 (negative one) indicates an invalid surface. It is recommended to store image handles in [[LONG]] variables. Passing an invalid handle generates an [[ERROR Codes|"Invalid handle"]] error. +* [[Handle]]s are used to identify graphical surfaces. Positive values are used to refer to screen pages. -1 (negative one) indicates an invalid surface. It is recommended to store image handles in [[LONG]] variables. Passing an invalid handle generates an [[ERROR Codes|"Invalid handle"]] error. * When handles are not passed (or cannot be passed) to subs/functions then the default destination image or source image is referenced. These are set to the active page when the SCREEN statement is called, but can be changed to any image. So it is possible to read from one image using [[POINT]] and write to a different one with [[PSET]]. * '''[[PRINT]]ed text cannot be transferred and positioned accurately.''' Use [[_PRINTSTRING]] for graphical text or font placement. * '''Images are not deallocated when the [[SUB]] or [[FUNCTION]] they are created in ends. Free them with [[_FREEIMAGE]].''' @@ -83,7 +83,7 @@ {{CodeStart}} '' '' {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, 32) {{Cl|CLS}} , {{Cl|_RGB}}(0, 255, 0) -i = {{Cl|_LOADIMAGE}}('''"QB64.PNG"''') 'see note below examples to get the image +i = {{Cl|_LOADIMAGE}}('''"QB64.PNG"''') 'see note below examples to get the image {{Cl|_PUTIMAGE}} (0, 0), i ' places image at upper left corner of window w/o stretching it '' '' {{CodeEnd}} '' '' @@ -96,39 +96,39 @@ i = {{Cl|_LOADIMAGE}}('''"QB64.PNG"''') 'see note below examples to ge {{Cl|DEFLNG}} A-Z dest_handle = {{Cl|_NEWIMAGE}}(640, 480, 32) {{Cl|SCREEN (statement)|SCREEN}} dest_handle '32 bit Screen 12 dimensions -source_handle = {{Cl|_LOADIMAGE}}('''"QB64.PNG"''', 32) +source_handle = {{Cl|_LOADIMAGE}}('''"QB64.PNG"''', 32) dx1 = 0: dy1 = 0 dx2 = {{Cl|_WIDTH (function)|_WIDTH}}(source_handle) - 1: dy2 = {{Cl|_HEIGHT}}(source_handle) - 1 'image dimensions - 1 -{{Cl|LOCATE}} 29, 33: {{Cl|PRINT}} "Press any Key!"; +{{Cl|LOCATE}} 29, 33: {{Cl|PRINT}} "Press any Key!"; 'normal image coordinate values based on the dimensions of the image: {{Cl|_PUTIMAGE}} (dx1, dy1)-(dx2, dy2), source_handle, dest_handle -{{Cl|LOCATE}} 20, 34: {{Cl|PRINT}} "Normal layout" -{{Cl|LOCATE}} 24, 10: {{Cl|PRINT}} "_PUTIMAGE (dx1, dy1)-(dx2, dy2), source_handle, dest_handle" +{{Cl|LOCATE}} 20, 34: {{Cl|PRINT}} "Normal layout" +{{Cl|LOCATE}} 24, 10: {{Cl|PRINT}} "_PUTIMAGE (dx1, dy1)-(dx2, dy2), source_handle, dest_handle" K$ = {{Cl|INPUT$}}(1) 'to flip the image on the x axis, swap the dx coordinate values: {{Cl|_PUTIMAGE}} (dx2, dy1)-(dx1, dy2), source_handle, dest_handle -{{Cl|LOCATE}} 20, 34: {{Cl|PRINT}} "Flip by X axis" -{{Cl|LOCATE}} 24, 10: {{Cl|PRINT}} "_PUTIMAGE (dx2, dy1)-(dx1, dy2), source_handle, dest_handle" +{{Cl|LOCATE}} 20, 34: {{Cl|PRINT}} "Flip by X axis" +{{Cl|LOCATE}} 24, 10: {{Cl|PRINT}} "_PUTIMAGE (dx2, dy1)-(dx1, dy2), source_handle, dest_handle" K$ = {{Cl|INPUT$}}(1) 'to flip image on y axis, swap the dy coordinate values: {{Cl|_PUTIMAGE}} (dx1, dy2)-(dx2, dy1), source_handle, dest_handle -{{Cl|LOCATE}} 20, 34: {{Cl|PRINT}} "Flip by Y axis" -{{Cl|LOCATE}} 24, 10: {{Cl|PRINT}} "_PUTIMAGE (dx1, dy2)-(dx2, dy1), source_handle, dest_handle " +{{Cl|LOCATE}} 20, 34: {{Cl|PRINT}} "Flip by Y axis" +{{Cl|LOCATE}} 24, 10: {{Cl|PRINT}} "_PUTIMAGE (dx1, dy2)-(dx2, dy1), source_handle, dest_handle " K$ = {{Cl|INPUT$}}(1) 'to flip both, swap both the dx and dy coordinate values: {{Cl|_PUTIMAGE}} (dx2, dy2)-(dx1, dy1), source_handle, dest_handle -{{Cl|LOCATE}} 20, 34: {{Cl|PRINT}} "Flip on both axis" -{{Cl|LOCATE}} 24, 10: {{Cl|PRINT}} "_PUTIMAGE (dx2, dy2)-(dx1, dy1), source_handle, dest_handle" +{{Cl|LOCATE}} 20, 34: {{Cl|PRINT}} "Flip on both axis" +{{Cl|LOCATE}} 24, 10: {{Cl|PRINT}} "_PUTIMAGE (dx2, dy2)-(dx1, dy1), source_handle, dest_handle" K$ = {{Cl|INPUT$}}(1) 'to enlarge, double the second set of values plus any offset of the first coordinates: {{Cl|_PUTIMAGE}} (dx1, dy1)-((2 * dx2) + dx1, (2 * dy2) + dy1), source_handle, dest_handle -{{Cl|LOCATE}} 20, 34: {{Cl|PRINT}} "Double image size" +{{Cl|LOCATE}} 20, 34: {{Cl|PRINT}} "Double image size" {{Cl|LOCATE}} 24, 2: -{{Cl|PRINT}} "_PUTIMAGE (dx1, dy1)-((2 * dx2) + dx1, (2 * dy2) + dy1), s_handle, d_handle '' '' +{{Cl|PRINT}} "_PUTIMAGE (dx1, dy1)-((2 * dx2) + dx1, (2 * dy2) + dy1), s_handle, d_handle '' '' {{Cl|END}} '' '' {{CodeEnd}} {{small|Adapted from code by Darth Who}} -<center>''Note:'' The ''QB64.PNG'' Bee image used can be copied from the top of the [http://www.qb64.net/forum/index.php Main Forum Page]</center> +<center>''Note:'' The ''QB64.PNG'' Bee image used can be copied from the top of the [http://www.qb64.net/forum/index.php Main Forum Page]</center> ''Example 4:'' Using _PUTIMAGE to scroll a larger image created on a separate [[_NEWIMAGE]] screen page with QB64. @@ -145,7 +145,7 @@ s& = {{Cl|_NEWIMAGE}}(1280, 720, 32)' program screen {{Cl|CIRCLE}} (x, y), {{Cl|RND}}(1) * 300, clr& {{Cl|PAINT}} (x, y), clr& {{Cl|NEXT}} -{{Cl|PRINT}} "This is a demo of some screen scrolling. Use the number pad keys to scroll. 4 goes left, 6 goes right. 8 up, 2 down. ESC key will close this program." +{{Cl|PRINT}} "This is a demo of some screen scrolling. Use the number pad keys to scroll. 4 goes left, 6 goes right. 8 up, 2 down. ESC key will close this program." x = 0: y = 0 {{Cl|SCREEN}} s& @@ -154,11 +154,13 @@ DO {{Cl|_PUTIMAGE}} (0, 0), ws&, 0, (x, y)-(x + 1279, y + 719) a$ = {{Cl|INKEY$}} {{Cl|SELECT CASE}} a$ - {{Cl|CASE}} "4": x = x - 10: {{Cl|IF...THEN|IF}} x < 0 {{Cl|THEN}} x = 0 - {{Cl|CASE}} "6": x = x + 10: {{Cl|IF...THEN|IF}} x > 1280 {{Cl|THEN}} x = 1280 - {{Cl|CASE}} "8": y = y - 10: {{Cl|IF...THEN|IF}} y < 0 {{Cl|THEN}} y = 0 - {{Cl|CASE}} "2": y = y + 10: {{Cl|IF...THEN|IF}} y > 720 {{Cl|THEN}} y = 720 - {{Cl|CASE}} {{Cl|CHR$}}(32): {{Cl|SYSTEM}} + {{Cl|CASE}} "4": x = x - 10: {{Cl|IF...THEN|IF}} x < 0 {{Cl|THEN}} x = 0 + {{Cl|CASE}} "6": x = x + 10: {{Cl|IF...THEN|IF}} x > 1280 {{Cl|THEN}} x = 1280 + {{Cl|CASE}} "8": y = y - 10: {{Cl|IF...THEN|IF}} y < 0 {{Cl|THEN}} y = 0 + {{Cl|CASE}} "2": y = y + 10: {{Cl|IF...THEN|IF}} y > 720 {{Cl|THEN}} y = 720 + {{Cl|CA +271a +SE}} {{Cl|CHR$}}(32): {{Cl|SYSTEM}} {{Cl|END SELECT}} {{Cl|_DISPLAY}} {{Cl|LOOP}} '' '' @@ -170,7 +172,7 @@ DO {{Cl|SCREEN}} 13 h& = {{Cl|_NEWIMAGE}}(640, 480, 256) {{Cl|_DEST}} h& -{{Cl|_PRINTSTRING}} (10, 10), "This _PUTIMAGE used no parameters!" +{{Cl|_PRINTSTRING}} (10, 10), "This _PUTIMAGE used no parameters!" {{Cl|_SOURCE}} h& {{Cl|_DEST}} 0 {{Cl|_PUTIMAGE}} @@ -192,4 +194,4 @@ h& = {{Cl|_NEWIMAGE}}(640, 480, 256) * [[Hardware images]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_R2D.txt b/internal/help/_R2D.txt index 25a666d52..74eac36b2 100644 --- a/internal/help/_R2D.txt +++ b/internal/help/_R2D.txt @@ -13,9 +13,9 @@ The [[_R2D]] function converts a '''radian''' value into a '''degree''' value. {{PageExamples}} ''Example:'' Coverting Radian into Degree. {{CodeStart}} -INPUT "Give me an angle in Radians ", D +INPUT "Give me an angle in Radians ", D R = _R2D(D) -PRINT "That angle in Degrees is "; R +PRINT "That angle in Degrees is "; R {{CodeEnd}} {{OutputStart}} Give me an angle in Radians 0.5 @@ -30,4 +30,4 @@ That angle in Degrees is 28.64789 -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_R2G.txt b/internal/help/_R2G.txt index 234a23831..b27177b0d 100644 --- a/internal/help/_R2G.txt +++ b/internal/help/_R2G.txt @@ -13,9 +13,9 @@ The [[_R2G]] function converts a '''radian''' value into a '''gradient''' value. {{PageExamples}} ''Example:'' Coverting Radian into Gradient. {{CodeStart}} -INPUT "Give me an angle in Radians ", D +INPUT "Give me an angle in Radians ", D R = _R2G(D) -PRINT "That angle in Gradient is "; R +PRINT "That angle in Gradient is "; R {{CodeEnd}} {{OutputStart}} Give me an angle in Radians 0.5 @@ -30,4 +30,4 @@ That angle in Gradient is 31.83099 -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_RED.txt b/internal/help/_RED.txt index 4922e9fc2..79f1b9486 100644 --- a/internal/help/_RED.txt +++ b/internal/help/_RED.txt @@ -28,4 +28,4 @@ The [[_RED]] function returns the palette index or the red component intensity o * [[_LOADIMAGE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_RED32.txt b/internal/help/_RED32.txt index 809c306f3..23af0c2b8 100644 --- a/internal/help/_RED32.txt +++ b/internal/help/_RED32.txt @@ -21,4 +21,4 @@ The [[_RED32]] function returns the red component intensity of a 32-bit image or * [[_RGB32]], [[_RED]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_RESIZE.txt b/internal/help/_RESIZE.txt index 0224e9d35..5f37b9bac 100644 --- a/internal/help/_RESIZE.txt +++ b/internal/help/_RESIZE.txt @@ -23,4 +23,4 @@ The [[_RESIZE]] statement sets resizing of the window ON or OFF and sets the met -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_RESIZEHEIGHT.txt b/internal/help/_RESIZEHEIGHT.txt index d16214cb1..a954eb3ad 100644 --- a/internal/help/_RESIZEHEIGHT.txt +++ b/internal/help/_RESIZEHEIGHT.txt @@ -23,7 +23,7 @@ The [[_RESIZEHEIGHT]] function returns the user resized screen pixel height if [ s& = {{Cl|_NEWIMAGE}}(300, 300, 32) {{Cl|SCREEN}} s& -bee& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'QB64's bee from http://www.qb64.net/qb64_trans.png +bee& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'QB64's bee from http://www.qb64.net/qb64_trans.png {{Cl|DO}} {{Cl|IF}} {{Cl|_RESIZE (function)|_RESIZE}} THEN @@ -51,4 +51,4 @@ bee& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'QB64's bee from http:/ * [[_RESIZEWIDTH]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_RESIZEWIDTH.txt b/internal/help/_RESIZEWIDTH.txt index 6ba39663f..8fd4dbace 100644 --- a/internal/help/_RESIZEWIDTH.txt +++ b/internal/help/_RESIZEWIDTH.txt @@ -23,7 +23,7 @@ The [[_RESIZEWIDTH]] function returns the user resized screen pixel width if [[$ s& = {{Cl|_NEWIMAGE}}(300, 300, 32) {{Cl|SCREEN}} s& -bee& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'QB64's bee from http://www.qb64.net/qb64_trans.png +bee& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'QB64's bee from http://www.qb64.net/qb64_trans.png {{Cl|DO}} {{Cl|IF}} {{Cl|_RESIZE (function)|_RESIZE}} THEN @@ -51,4 +51,4 @@ bee& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'QB64's bee from http:/ * [[_RESIZEHEIGHT]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_RESIZE_(function).txt b/internal/help/_RESIZE_(function).txt index 89d509d7c..393431fc5 100644 --- a/internal/help/_RESIZE_(function).txt +++ b/internal/help/_RESIZE_(function).txt @@ -24,7 +24,7 @@ The [[_RESIZE]] function returns true (-1) when a user has attempted to resize t s& = {{Cl|_NEWIMAGE}}(300, 300, 32) {{Cl|SCREEN}} s& -bee& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'QB64's bee from http://www.qb64.net/qb64_trans.png +bee& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'QB64's bee from http://www.qb64.net/qb64_trans.png {{Cl|DO}} {{Cl|IF}} {{Cl|_RESIZE (function)|_RESIZE}} THEN @@ -52,4 +52,4 @@ bee& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'QB64's bee from http:/ * [[_RESIZEWIDTH]], [[_RESIZEHEIGHT]] {{text|(requested pixel dimensions)}} -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_RGB.txt b/internal/help/_RGB.txt index 761177c0a..429f67e68 100644 --- a/internal/help/_RGB.txt +++ b/internal/help/_RGB.txt @@ -30,26 +30,26 @@ The [[_RGB]] function returns the closest palette attribute index (legacy SCREEN red = {{Cl|INP}}({{Cl|&H}}3C9) * 4 'multiply by 4 to convert intensity to 0 to 255 RGB values grn = {{Cl|INP}}({{Cl|&H}}3C9) * 4 blu = {{Cl|INP}}({{Cl|&H}}3C9) * 4 - hex32$(attribute) = "{{Cl|&H}}" + {{Cl|HEX$}}({{Cl|_RGB32}}(red, grn, blu)) 'always returns the 32 bit value + hex32$(attribute) = "{{Cl|&H}}" + {{Cl|HEX$}}({{Cl|_RGB32}}(red, grn, blu)) 'always returns the 32 bit value {{Cl|COLOR}} attribute - {{Cl|PRINT}} "{{Cl|COLOR}}" + {{Cl|STR$}}({{Cl|_RGB}}(red, grn, blu)) + " = " + hex32$(attribute) 'closest attribute + {{Cl|PRINT}} "{{Cl|COLOR}}" + {{Cl|STR$}}({{Cl|_RGB}}(red, grn, blu)) + " = " + hex32$(attribute) 'closest attribute {{Cl|NEXT}} '' '' {{CodeEnd}} -{{OutputStart}}{{text|COLOR 1 <nowiki>=</nowiki> &HFF0000A8|#0000A8}} -{{text|COLOR 2 <nowiki>=</nowiki> &HFF00A800|#00A800}} -{{text|COLOR 3 <nowiki>=</nowiki> &HFF00A8A8|#00A8A8}} -{{text|COLOR 4 <nowiki>=</nowiki> &HFFA80000|#A80000}} -{{text|COLOR 5 <nowiki>=</nowiki> &HFFA800A8|#A800A8}} -{{text|COLOR 6 <nowiki>=</nowiki> &HFFA85400|#A85400}} -{{text|COLOR 7 <nowiki>=</nowiki> &HFFA8A8A8|#A8A8A8}} -{{text|COLOR 8 <nowiki>=</nowiki> &HFF545454|#545454}} -{{text|COLOR 9 <nowiki>=</nowiki> &HFF5454FC|#5454FC}} -{{text|COLOR 10 <nowiki>=</nowiki> &HFF54FC54|#54FC54}} -{{text|COLOR 11 <nowiki>=</nowiki> &HFF54FCFC|#54FCFC}} -{{text|COLOR 12 <nowiki>=</nowiki> &HFFFC5454|#FC5454}} -{{text|COLOR 13 <nowiki>=</nowiki> &HFFFC54FC|#FC54FC}} -{{text|COLOR 14 <nowiki>=</nowiki> &HFFFCFC54|#FCFC54}} -{{text|COLOR 15 <nowiki>=</nowiki> &HFFFCFCFC|#FCFCFC}} +{{OutputStart}}{{text|COLOR 1 <nowiki>=</nowiki> &HFF0000A8|#0000A8}} +{{text|COLOR 2 <nowiki>=</nowiki> &HFF00A800|#00A800}} +{{text|COLOR 3 <nowiki>=</nowiki> &HFF00A8A8|#00A8A8}} +{{text|COLOR 4 <nowiki>=</nowiki> &HFFA80000|#A80000}} +{{text|COLOR 5 <nowiki>=</nowiki> &HFFA800A8|#A800A8}} +{{text|COLOR 6 <nowiki>=</nowiki> &HFFA85400|#A85400}} +{{text|COLOR 7 <nowiki>=</nowiki> &HFFA8A8A8|#A8A8A8}} +{{text|COLOR 8 <nowiki>=</nowiki> &HFF545454|#545454}} +{{text|COLOR 9 <nowiki>=</nowiki> &HFF5454FC|#5454FC}} +{{text|COLOR 10 <nowiki>=</nowiki> &HFF54FC54|#54FC54}} +{{text|COLOR 11 <nowiki>=</nowiki> &HFF54FCFC|#54FCFC}} +{{text|COLOR 12 <nowiki>=</nowiki> &HFFFC5454|#FC5454}} +{{text|COLOR 13 <nowiki>=</nowiki> &HFFFC54FC|#FC54FC}} +{{text|COLOR 14 <nowiki>=</nowiki> &HFFFCFC54|#FCFC54}} +{{text|COLOR 15 <nowiki>=</nowiki> &HFFFCFCFC|#FCFCFC}} {{OutputEnd}} :''Note:'' This procedure also shows how the returns from [[_RGB]] and [[_RGB32]] differ in a non-32 bit screen mode. @@ -63,4 +63,4 @@ The [[_RGB]] function returns the closest palette attribute index (legacy SCREEN * [http://www.w3schools.com/html/html_colornames.asp Hexadecimal Color Values] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_RGB32.txt b/internal/help/_RGB32.txt index 6aa0fde0d..c64fbcf45 100644 --- a/internal/help/_RGB32.txt +++ b/internal/help/_RGB32.txt @@ -1,25 +1,39 @@ {{DISPLAYTITLE:_RGB32}} -The [[_RGB32]] function returns the 32-bit ''RGBA'' color value with specified red, green and blue component intensities. +The [[_RGB32]] function returns the 32-bit ''RGBA'' color value with specified red, green and blue component intensities and optional alpha. {{PageSyntax}} +''Original syntax'': :{{Parameter|color32value~&}} = [[_RGB32]]({{Parameter|red&}}, {{Parameter|green&}}, {{Parameter|blue&}}) +''Alternative Syntax 2'': +:{{Parameter|color32value~&}} = [[_RGB32]]({{Parameter|red&}}, {{Parameter|green&}}, {{Parameter|blue&}}, {{Parameter|alpha&}}) + +''Alternative Syntax 3'': +:{{Parameter|color32value~&}} = [[_RGB32]]({{Parameter|intensity&}}, {{Parameter|alpha&}}) + +''Alternative Syntax 4'': +:{{Parameter|color32value~&}} = [[_RGB32]]({{Parameter|intensity&}}) + {{Parameters}} * {{Parameter|red&}} specifies the red [[LONG]] component intensity from 0 to 255. * {{Parameter|green&}} specifies the green [[LONG]] component intensity from 0 to 255. * {{Parameter|blue&}} specifies the blue [[LONG]] component intensity from 0 to 255. - +* {{Parameter|alpha&}} specifies the alpha [[LONG]] component from 0 to 255. +* {{Parameter|intensity&}} specifies the red, green and blue [[LONG]] components intensity from 0 to 255 simultaneously, to generate a shade of gray. {{PageDescription}} -* The value returned is ALWAYS a 32-bit [[_UNSIGNED]] [[LONG]] color value, as is the [[POINT]] value. -* '''Return variable types must be [[LONG]] or resulting color may lose the [[_BLUE]] value.''' -* Color intensity values outside of the 0 to 255 range are clipped. -* Returns [[LONG]] 32 bit hexadecimal values from '''&HFF{{text|00|red}}{{text|00|green}}{{text|00|blue}}''' to '''&HFF{{text|FF|red}}{{text|FF|green}}{{text|FF|blue}}''', always with full [[_ALPHA]]. +* The value returned is always a 32-bit [[_UNSIGNED]] [[LONG]] color value, as is the [[POINT]] value. +* '''Return variable types must be [[_UNSIGNED]] [[LONG]] or [[LONG]], otherwise resulting color may lose the [[_BLUE]] value.''' +* Parameter values outside of the 0 to 255 range are clipped. +* Returns [[LONG]] 32 bit hexadecimal values from '''&H00{{text|00|red}}{{text|00|green}}{{text|00|blue}}''' to '''&HFF{{text|FF|red}}{{text|FF|green}}{{text|FF|blue}}'''. * When [[LONG]] values are [[PUT]] to file, the ARGB values become BGRA. Use [[LEFT$]]([[MKL$]]({{Parameter|color32value~&}}), 3) to place 3 colors. -* Colors returned are always opaque as the transparency value is always 255. Use [[_ALPHA]] or [[_CLEARCOLOR]] to change it. -* '''NOTE: Default 32-bit backgrounds are clear black or [[_RGBA]](0, 0, 0, 0). Use [[CLS]] to make the black opaque.''' +* '''NOTE: Default 32-bit backgrounds are clear black or [[_RGB32]](0, 0). Use [[CLS]] to make the black opaque.''' + + +==Availability== +* Alternative syntaxes available with '''version 1.3 and up'''. {{PageExamples}} @@ -32,26 +46,26 @@ The [[_RGB32]] function returns the 32-bit ''RGBA'' color value with specified r red = {{Cl|INP}}({{Cl|&H}}3C9) * 4 'multiply by 4 to convert intensity to 0 to 255 RGB values grn = {{Cl|INP}}({{Cl|&H}}3C9) * 4 blu = {{Cl|INP}}({{Cl|&H}}3C9) * 4 - hex32$(attribute) = "{{Cl|&H}}" + {{Cl|HEX$}}({{Cl|_RGB32}}(red, grn, blu)) 'always returns the 32 bit value + hex32$(attribute) = "{{Cl|&H}}" + {{Cl|HEX$}}({{Cl|_RGB32}}(red, grn, blu)) 'always returns the 32 bit value {{Cl|COLOR}} attribute - {{Cl|PRINT}} "{{Cl|COLOR}}" + {{Cl|STR$}}({{Cl|_RGB}}(red, grn, blu)) + " = " + hex32$(attribute) 'closest attribute + {{Cl|PRINT}} "{{Cl|COLOR}}" + {{Cl|STR$}}({{Cl|_RGB}}(red, grn, blu)) + " = " + hex32$(attribute) 'closest attribute {{Cl|NEXT}} '' '' {{CodeEnd}} -{{OutputStart}}{{text|COLOR 1 <nowiki>=</nowiki> &HFF0000A8|#0000A8}} -{{text|COLOR 2 <nowiki>=</nowiki> &HFF00A800|#00A800}} -{{text|COLOR 3 <nowiki>=</nowiki> &HFF00A8A8|#00A8A8}} -{{text|COLOR 4 <nowiki>=</nowiki> &HFFA80000|#A80000}} -{{text|COLOR 5 <nowiki>=</nowiki> &HFFA800A8|#A800A8}} -{{text|COLOR 6 <nowiki>=</nowiki> &HFFA85400|#A85400}} -{{text|COLOR 7 <nowiki>=</nowiki> &HFFA8A8A8|#A8A8A8}} -{{text|COLOR 8 <nowiki>=</nowiki> &HFF545454|#545454}} -{{text|COLOR 9 <nowiki>=</nowiki> &HFF5454FC|#5454FC}} -{{text|COLOR 10 <nowiki>=</nowiki> &HFF54FC54|#54FC54}} -{{text|COLOR 11 <nowiki>=</nowiki> &HFF54FCFC|#54FCFC}} -{{text|COLOR 12 <nowiki>=</nowiki> &HFFFC5454|#FC5454}} -{{text|COLOR 13 <nowiki>=</nowiki> &HFFFC54FC|#FC54FC}} -{{text|COLOR 14 <nowiki>=</nowiki> &HFFFCFC54|#FCFC54}} -{{text|COLOR 15 <nowiki>=</nowiki> &HFFFCFCFC|#FCFCFC}} +{{OutputStart}}{{text|COLOR 1 <nowiki>=</nowiki> &HFF0000A8|#0000A8}} +{{text|COLOR 2 <nowiki>=</nowiki> &HFF00A800|#00A800}} +{{text|COLOR 3 <nowiki>=</nowiki> &HFF00A8A8|#00A8A8}} +{{text|COLOR 4 <nowiki>=</nowiki> &HFFA80000|#A80000}} +{{text|COLOR 5 <nowiki>=</nowiki> &HFFA800A8|#A800A8}} +{{text|COLOR 6 <nowiki>=</nowiki> &HFFA85400|#A85400}} +{{text|COLOR 7 <nowiki>=</nowiki> &HFFA8A8A8|#A8A8A8}} +{{text|COLOR 8 <nowiki>=</nowiki> &HFF545454|#545454}} +{{text|COLOR 9 <nowiki>=</nowiki> &HFF5454FC|#5454FC}} +{{text|COLOR 10 <nowiki>=</nowiki> &HFF54FC54|#54FC54}} +{{text|COLOR 11 <nowiki>=</nowiki> &HFF54FCFC|#54FCFC}} +{{text|COLOR 12 <nowiki>=</nowiki> &HFFFC5454|#FC5454}} +{{text|COLOR 13 <nowiki>=</nowiki> &HFFFC54FC|#FC54FC}} +{{text|COLOR 14 <nowiki>=</nowiki> &HFFFCFC54|#FCFC54}} +{{text|COLOR 15 <nowiki>=</nowiki> &HFFFCFCFC|#FCFCFC}} {{OutputEnd}} :''Note:'' This procedure also shows how the returns from [[_RGB]] and [[_RGB32]] differ in a non-32 bit screen mode. @@ -72,21 +86,50 @@ The [[_RGB32]] function returns the 32-bit ''RGBA'' color value with specified r {{Cl|COLOR}} {{Cl|_RGB32}}(255, 255, 255), 0 'White on NO BACKGROUND {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 10 - {{Cl|PRINT}} "This is just a whole bunch of happy nothing! Happy World!!" + {{Cl|PRINT}} "This is just a whole bunch of happy nothing! Happy World!!" {{Cl|NEXT}} {{Cl|PRINT}}: {{Cl|PRINT}}: {{Cl|PRINT}}: {{Cl|COLOR}} 0, {{Cl|_RGB32}}(0, 0, 0) 'And here, we're going with NO {{Cl|COLOR}} text, with a BLACK background. 'Notice how this doesn't change the color on the screen at all, where the text is, but does toss a black background to it. -{{Cl|LOCATE}} , 15: {{Cl|PRINT}} "NOTICE HOW OUR 0 {{Cl|COLOR}} WORKS?" +{{Cl|LOCATE}} , 15: {{Cl|PRINT}} "NOTICE HOW OUR 0 {{Cl|COLOR}} WORKS?" {{Cl|PRINT}} -{{Cl|LOCATE}} , 15: {{Cl|PRINT}} "NEAT, HUH?" +{{Cl|LOCATE}} , 15: {{Cl|PRINT}} "NEAT, HUH?" {{Cl|SLEEP}} SYSTEM '' '' {{CodeEnd}}{{small|Code by Steve McNeill}} +''Example 3:'' Comparing the output of the new _RGB32 syntaxes (starting with version 1.3) and their equivalents in previous versions. +{{CodeStart}} +{{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(400, 400, 32) + +{{Cl|COLOR}} {{Cl|_RGB32}}(255, 255, 255) +{{Cl|PRINT}} "White" +{{Cl|COLOR}} {{Cl|_RGB32}}(255) +{{Cl|PRINT}} "White, too, but with less typing" +{{Cl|PRINT}} + +{{Cl|COLOR}} {{Cl|_RGB32}}(80, 80, 80) +{{Cl|PRINT}} "Dark gray" +{{Cl|COLOR}} {{Cl|_RGB32}}(80) +{{Cl|PRINT}} "Same gray, but with less typing" +{{Cl|PRINT}} + +{{Cl|COLOR}} {{Cl|_RGBA32}}(255, 255, 255, 120) +{{Cl|PRINT}} "White with alpha of 120 (out of 255)" +{{Cl|COLOR}} {{Cl|_RGB32}}(255, 120) +{{Cl|PRINT}} "White with alpha of 120 - but with less typing" +{{Cl|PRINT}} + +{{Cl|COLOR}} {{Cl|_RGBA32}}(255, 0, 255, 110) +{{Cl|PRINT}} "Magenta, 110 alpha" +{{Cl|COLOR}} {{Cl|_RGB32}}(255, 0, 255, 110) +{{Cl|PRINT}} "Magenta too, 110 alpha - but with less typing" +{{CodeEnd}} + + {{PageSeeAlso}} * [[_RGBA32]], [[_RGB]], [[_RGBA]] * [[_RED32]], [[_GREEN32]], [[_BLUE32]] @@ -96,4 +139,4 @@ SYSTEM '' '' * [http://www.w3schools.com/html/html_colornames.asp Hexadecimal Color Values] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_RGBA.txt b/internal/help/_RGBA.txt index 1bb33595d..7936bec52 100644 --- a/internal/help/_RGBA.txt +++ b/internal/help/_RGBA.txt @@ -25,14 +25,14 @@ The [[_RGBA]] function returns the closest palette index (legacy SCREEN modes) O {{CodeStart}} '' '' scrn& = {{Cl|_NEWIMAGE}}(400, 400, 32) {{Cl|SCREEN (statement)|SCREEN}} scrn& -fnt& = {{Cl|_LOADFONT}}("C:\WINDOWS\FONTS\ARIAL.TTF", 26) +fnt& = {{Cl|_LOADFONT}}("C:\WINDOWS\FONTS\ARIAL.TTF", 26) {{Cl|_FONT}} fnt& X% = 20 Y% = 20 {{Cl|COLOR}} {{Cl|_RGB}}(255, 255, 255), {{Cl|_RGB}}(0, 0, 0) 'Foreground set to WHITE background to BLACK -{{Cl|_PRINTSTRING}} (X%, Y%), "Hello World" +{{Cl|_PRINTSTRING}} (X%, Y%), "Hello World" {{Cl|COLOR}} {{Cl|_RGB}}(255, 0, 0), {{Cl|_RGBA}}(0, 0, 0, 0) 'Foreground set to RED background to TRANSPARENT BLACK -{{Cl|_PRINTSTRING}} (X% + 2, Y% + 2), "Hello World" +{{Cl|_PRINTSTRING}} (X% + 2, Y% + 2), "Hello World" {{Cl|END}} '' '' {{CodeEnd}} {{small|Code by Unseen Machine}} @@ -49,4 +49,4 @@ Y% = 20 * [http://www.w3schools.com/html/html_colornames.asp Hexadecimal Color Values] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_RGBA32.txt b/internal/help/_RGBA32.txt index 4a53232dd..a34a72384 100644 --- a/internal/help/_RGBA32.txt +++ b/internal/help/_RGBA32.txt @@ -24,7 +24,7 @@ The [[_RGBA32]] function returns the 32-bit ''RGBA'' color value with the specif {{CodeStart}} '' '' {{Cl|SCREEN (statement)|SCREEN}} {{Cl|_NEWIMAGE}}(600, 400, 32) -img& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'from http://www.qb64.net/qb64_trans.png (or use any 24/32 bit image) +img& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'from http://www.qb64.org/images/qb64bee.png (or use any 24/32 bit image) 'Turn off auto display {{Cl|_DISPLAY}} @@ -56,4 +56,4 @@ img& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'from http://www.qb64. * [http://www.w3schools.com/html/html_colornames.asp Hexadecimal Color Values] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_ROUND.txt b/internal/help/_ROUND.txt index 49661ecea..7b897d7a0 100644 --- a/internal/help/_ROUND.txt +++ b/internal/help/_ROUND.txt @@ -35,4 +35,4 @@ The [[_ROUND]] function rounds to the closest even [[INTEGER]], [[LONG]] or [[_I * [[FIX]], [[CLNG]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SCREENCLICK.txt b/internal/help/_SCREENCLICK.txt index e2351f6a5..675c5842c 100644 --- a/internal/help/_SCREENCLICK.txt +++ b/internal/help/_SCREENCLICK.txt @@ -20,4 +20,4 @@ The [[_SCREENCLICK]] statement simulates clicking on a pixel coordinate on the d * [[_DESKTOPWIDTH]], [[_DESKTOPHEIGHT]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SCREENEXISTS.txt b/internal/help/_SCREENEXISTS.txt index 6f672e264..ff79651d3 100644 --- a/internal/help/_SCREENEXISTS.txt +++ b/internal/help/_SCREENEXISTS.txt @@ -17,7 +17,7 @@ The [[_SCREENEXISTS]] function returns true (-1) once a screen has been created. {{CodeStart}} '' '' {{Cl|SCREEN}} 12 {{Cl|DO}}: {{Cl|LOOP}} {{Cl|UNTIL}} _{{Cl|SCREENEXISTS}} -{{Cl|_TITLE}} "My Title" +{{Cl|_TITLE}} "My Title" {{CodeEnd}} @@ -28,4 +28,4 @@ The [[_SCREENEXISTS]] function returns true (-1) once a screen has been created. * [[$RESIZE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SCREENHIDE.txt b/internal/help/_SCREENHIDE.txt index 446e87622..bab203f7c 100644 --- a/internal/help/_SCREENHIDE.txt +++ b/internal/help/_SCREENHIDE.txt @@ -18,4 +18,4 @@ The '''_SCREENHIDE''' statement can be used to hide the main program window in a * [[_SCREENICON]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SCREENICON.txt b/internal/help/_SCREENICON.txt index 066c704e0..8cd4302a2 100644 --- a/internal/help/_SCREENICON.txt +++ b/internal/help/_SCREENICON.txt @@ -20,4 +20,4 @@ The [[_SCREENICON]] statement can be used to minimize the main program window to * [[_SCREENICON (function)]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SCREENICON_(function).txt b/internal/help/_SCREENICON_(function).txt index 7d8298539..ab1b6d6c7 100644 --- a/internal/help/_SCREENICON_(function).txt +++ b/internal/help/_SCREENICON_(function).txt @@ -17,4 +17,4 @@ The [[_SCREENICON (function)|_SCREENICON]] function returns true (-1) or false ( * [[_SCREENSHOW]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SCREENIMAGE.txt b/internal/help/_SCREENIMAGE.txt index 999d4eb9d..a753de182 100644 --- a/internal/help/_SCREENIMAGE.txt +++ b/internal/help/_SCREENIMAGE.txt @@ -47,4 +47,4 @@ The [[_SCREENIMAGE]] function stores the current desktop image or a portion of i * [[Hardware images]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SCREENMOVE.txt b/internal/help/_SCREENMOVE.txt index 6382c7ac8..a77cc4ff2 100644 --- a/internal/help/_SCREENMOVE.txt +++ b/internal/help/_SCREENMOVE.txt @@ -40,7 +40,7 @@ scrnwidth& = {{Cl|_WIDTH}}: scrnheight& = {{Cl|_HEIGHT}} 'get the dimen wide& = {{Cl|_DESKTOPWIDTH}} high& = {{Cl|_DESKTOPHEIGHT}} -{{Cl|PRINT}} wide&; "X"; high& +{{Cl|PRINT}} wide&; "X"; high& {{Cl|_DELAY}} 4 {{Cl|_SCREENMOVE}} wide& + 200, 200 'positive value for right monitor 2 @@ -48,13 +48,13 @@ high& = {{Cl|_DESKTOPHEIGHT}} img2& = {{Cl|_SCREENIMAGE}} wide2& = {{Cl|_WIDTH (function)|_WIDTH}}(img2&) high2& = {{Cl|_HEIGHT}}(img2&) -{{Cl|PRINT}} wide2&; "X"; high2& +{{Cl|PRINT}} wide2&; "X"; high2& {{Cl|_DELAY}} 4 {{Cl|_SCREENMOVE}} {{Cl|_SCREENMOVE|_MIDDLE}} 'moves program back to main monitor 1 '' '' {{CodeEnd}} : ''Notes:'' Change the [[_SCREENMOVE]] column to negative for a left monitor. -<center>'''[[_FULLSCREEN]] works in the primary monitor and may push all running programs to a monitor on the right.'''</center> +<center>'''[[_FULLSCREEN]] works in the primary monitor and may push all running programs to a monitor on the right.'''</center> {{PageSeeAlso}} @@ -66,4 +66,4 @@ high2& = {{Cl|_HEIGHT}}(img2&) -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SCREENPRINT.txt b/internal/help/_SCREENPRINT.txt index 75fbe6de0..6772d439f 100644 --- a/internal/help/_SCREENPRINT.txt +++ b/internal/help/_SCREENPRINT.txt @@ -34,8 +34,8 @@ The [[_SCREENPRINT]] statement simulates typing text into a Windows focused prog {{CodeStart}} '' '' {{Cl|DEFLNG}} A-Z {{Cl|SCREEN (statement)|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, 32) -{{Cl|PRINT}} "OPENing and MAXIMIZING Notepad in 5 seconds..."; : {{Cl|_DELAY}} 5 -{{Cl|SHELL}} {{Cl|_DONTWAIT}} "START /MAX NotePad.exe" 'opens Notepad file "untitled.txt" +{{Cl|PRINT}} "OPENing and MAXIMIZING Notepad in 5 seconds..."; : {{Cl|_DELAY}} 5 +{{Cl|SHELL}} {{Cl|_DONTWAIT}} "START /MAX NotePad.exe" 'opens Notepad file "untitled.txt" 'detect notepad open and maximized 'condition: 80% or more of the screen is white {{Cl|DO}} 'read the desktop screen image for maximized window @@ -48,27 +48,27 @@ The [[_SCREENPRINT]] statement simulates typing text into a Windows focused prog {{Cl|IF}} c = {{Cl|_RGB32}}(255, 255, 255) {{Cl|THEN}} z = z + 1 {{Cl|NEXT}} {{Cl|NEXT}} - {{Cl|IF}} z / ({{Cl|_HEIGHT}}(s) * _{{Cl|WIDTH}}(s)) > 0.8 {{Cl|THEN}} {{Cl|EXIT DO}} 'when 80% of screen is white + {{Cl|IF}} z / ({{Cl|_HEIGHT}}(s) * _{{Cl|WIDTH}}(s)) > 0.8 {{Cl|THEN}} {{Cl|EXIT DO}} 'when 80% of screen is white {{Cl|_FREEIMAGE}} s 'free desktop image {{Cl|_LIMIT}} 1 'scans 1 loop per second -{{Cl|PRINT}} "."; +{{Cl|PRINT}} "."; {{Cl|LOOP}} {{Cl|PRINT}} -{{Cl|PRINT}} "NOTEPAD detected as OPEN and MAXIMIZED" +{{Cl|PRINT}} "NOTEPAD detected as OPEN and MAXIMIZED" -{{Cl|_SCREENPRINT}} "HELLO WORLD" +{{Cl|_SCREENPRINT}} "HELLO WORLD" {{Cl|SLEEP}} 2 {{Cl|_SCREENPRINT}} {{Cl|CHR$}}(8) + {{Cl|CHR$}}(8) + {{Cl|CHR$}}(8) + {{Cl|CHR$}}(8) + {{Cl|CHR$}}(8) 'backspace 5 characters {{Cl|SLEEP}} 3 -{{Cl|_SCREENPRINT}} "QB64!" +{{Cl|_SCREENPRINT}} "QB64!" {{Cl|SLEEP}} 2 {{Cl|_SCREENPRINT}} {{Cl|CHR$}}(1) 'CTRL + A select all {{Cl|SLEEP}} 2 {{Cl|_SCREENPRINT}} {{Cl|CHR$}}(3) 'CTRL + C copy to clipboard {{Cl|SLEEP}} 2 {{Cl|PRINT}} {{Cl|_CLIPBOARD$}} -{{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "QB64 ROCKS!" +{{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "QB64 ROCKS!" {{Cl|SLEEP}} 2 {{Cl|_SCREENPRINT}} {{Cl|CHR$}}(22) 'CTRL + V paste from clipboard {{Cl|END}} '' '' @@ -83,4 +83,4 @@ The [[_SCREENPRINT]] statement simulates typing text into a Windows focused prog * [[ASCII]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SCREENSHOW.txt b/internal/help/_SCREENSHOW.txt index 04a6227e4..38e32efe6 100644 --- a/internal/help/_SCREENSHOW.txt +++ b/internal/help/_SCREENSHOW.txt @@ -15,4 +15,4 @@ The [[_SCREENSHOW]] statement can be used to display the main program window in * [[_SCREENHIDE]], [[_CONSOLE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SCREENX.txt b/internal/help/_SCREENX.txt index 3cc2f15c4..a5655b1d7 100644 --- a/internal/help/_SCREENX.txt +++ b/internal/help/_SCREENX.txt @@ -9,22 +9,23 @@ The [[_SCREENX]] function returns the current column pixel coordinate of the pro {{PageDescription}} * Function returns the current program window's upper left corner column position on the desktop. * Use [[_DESKTOPWIDTH]] and [[_DESKTOPHEIGHT]] to find the current Windows desktop resolution to adjust the position with [[_SCREENMOVE]]. +* [[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Keyword not Supported in Linux or MAC versions]] {{PageExamples}} ''Example:'' Clicks and opens program window header menu: {{CodeStart}}{{Cl|_SCREENMOVE}} {{Cl|_SCREENMOVE|_MIDDLE}} {{Cl|_SCREENCLICK}} {{Cl|_SCREENX}} + 10, {{Cl|_SCREENY}} + 10 -{{Cl|PRINT}} "Hello window!" +{{Cl|PRINT}} "Hello window!" {{CodeEnd}} {{PageSeeAlso}} +* [[_SCREENY]] * [[_SCREENIMAGE]] * [[_SCREENCLICK]] * [[_SCREENPRINT]] * [[_SCREENMOVE]] -* [[_SCREENY]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SCREENY.txt b/internal/help/_SCREENY.txt index 767527055..89ad9218a 100644 --- a/internal/help/_SCREENY.txt +++ b/internal/help/_SCREENY.txt @@ -9,22 +9,23 @@ The [[_SCREENY]] function returns the current row pixel coordinate of the progra {{PageDescription}} * Function returns the current program window's upper left corner row position on the desktop. * Use [[_DESKTOPWIDTH]] and [[_DESKTOPHEIGHT]] to find the current user's Windows desktop resolution to adjust the position with [[_SCREENMOVE]]. +* [[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Keyword not Supported in Linux or MAC versions]] {{PageExamples}} ''Example:'' Clicks and opens program window header menu: {{CodeStart}}{{Cl|_SCREENMOVE}} {{Cl|_SCREENMOVE|_MIDDLE}} {{Cl|_SCREENCLICK}} {{Cl|_SCREENX}} + 10, {{Cl|_SCREENY}} + 10 -{{Cl|PRINT}} "Hello window!" '' '' +{{Cl|PRINT}} "Hello window!" '' '' {{CodeEnd}} {{PageSeeAlso}} +* [[_SCREENX]] * [[_SCREENIMAGE]] * [[_SCREENCLICK]] * [[_SCREENPRINT]] * [[_SCREENMOVE]] -* [[_SCREENX]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SETALPHA.txt b/internal/help/_SETALPHA.txt index 01ffadf3d..df51276e9 100644 --- a/internal/help/_SETALPHA.txt +++ b/internal/help/_SETALPHA.txt @@ -31,7 +31,7 @@ main = {{Cl|_NEWIMAGE}}(640, 480, 32) {{Cl|SCREEN}} main {{Cl|_SCREENMOVE}} {{Cl|_SCREENMOVE|_MIDDLE}} -Image1& = {{Cl|_LOADIMAGE}}("qb64_trans.png") '<<< PNG file with white background to hide +Image1& = {{Cl|_LOADIMAGE}}("qb64_trans.png") '<<< PNG file with white background to hide {{Cl|_SOURCE}} Image1& clr~& = {{Cl|POINT}}(0, 0) 'find background color of image {{Cl|_CLEARCOLOR}} clr~&, Image1& 'set background color as transparent @@ -48,7 +48,7 @@ DO {{Cl|IF...THEN|IF}} a& = 255 {{Cl|THEN}} d = -d {{Cl|_SETALPHA}} a&, 0 {{Cl|TO}} topclr~&, Image1& 'affects all colors below bright white {{Cl|_PUTIMAGE}} (0, 342), Image1& - {{Cl|LOCATE}} 1, 1: {{Cl|PRINT}} "Alpha: "; a& + {{Cl|LOCATE}} 1, 1: {{Cl|PRINT}} "Alpha: "; a& {{Cl|_DISPLAY}} {{Cl|LOOP}} {{Cl|UNTIL}} a& = 0 '' '' {{CodeEnd}} @@ -64,4 +64,4 @@ DO * [[COLOR]], [[Images]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SHELLHIDE.txt b/internal/help/_SHELLHIDE.txt index 5b8c84159..8dc0cb8c2 100644 --- a/internal/help/_SHELLHIDE.txt +++ b/internal/help/_SHELLHIDE.txt @@ -18,7 +18,7 @@ The [[_SHELLHIDE]] function hides the console window and returns any [[INTEGER]] {{PageExamples}} ''Example:'' Shelling to another QB64 program will return the exit code when one is set in the program that is run. {{CodeStart}} '' '' -returncode% = {{Cl|_SHELLHIDE}}("DesktopSize") 'replace call with your program EXE +returncode% = {{Cl|_SHELLHIDE}}("DesktopSize") 'replace call with your program EXE {{Cl|PRINT}} returncode% @@ -34,4 +34,4 @@ returncode% = {{Cl|_SHELLHIDE}}("DesktopSize") 'replace call with your * [[SYSTEM]], [[END]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SNDBAL.txt b/internal/help/_SNDBAL.txt index b98b7ae1b..9412e7eb5 100644 --- a/internal/help/_SNDBAL.txt +++ b/internal/help/_SNDBAL.txt @@ -20,23 +20,23 @@ The [[_SNDBAL]] statement attempts to set the balance or 3D position of a sound. *By setting the x! value to -1 or 1 it plays the sound at full volume from the appropriate speaker. *Sounds at a distance of 1 or -1 are played at full volume. Sounds further than a distance of 1000 cannot be heard. *The volume decreases linearly (at a constant gradient) over distance. Half volume = 500. -* An "'''Illegal Function Call'''" error can occur if another sound is using the primary or same channel position. -* Opened sound files must have the [[_SNDOPEN|"VOL"]] capability to use this statement in versions '''before build 20170811/60.''' +* An "'''Illegal Function Call'''" error can occur if another sound is using the primary or same channel position. +* Opened sound files must have the [[_SNDOPEN|"VOL"]] capability to use this statement in versions '''before build 20170811/60.''' {{PageExamples}} ''Example 1:'' {{CodeStart}} '' '' -h& = {{Cl|_SNDOPEN}}("LOL.wav", "SYNC,VOL") +h& = {{Cl|_SNDOPEN}}("LOL.wav", "SYNC,VOL") {{Cl|_SNDBAL}} h&, 1 {{Cl|_SNDPLAY}} h& '' '' {{CodeEnd}} -''Example:'' Loading a sound after '''build 20170811/60''' - no need to specify "sound capabilities" in [[_SNDOPEN]]. +''Example:'' Loading a sound after '''build 20170811/60''' - no need to specify "sound capabilities" in [[_SNDOPEN]]. {{CodeStart}} -s& = {{Cl|_SNDOPEN}}("song.ogg") -{{Cl|PRINT}} "{{Cl|READ}}Y"; s& +s& = {{Cl|_SNDOPEN}}("song.ogg") +{{Cl|PRINT}} "{{Cl|READ}}Y"; s& {{Cl|_SNDPLAY}} s& {{Cl|_SNDLOOP}} s& @@ -46,50 +46,50 @@ xright = 1 DO k$ = {{Cl|INKEY$}} {{Cl|SELECT CASE}} k$ - {{Cl|CASE}} "f" + {{Cl|CASE}} "f" xleft = xleft - 0.1 {{Cl|_SNDBAL}} s&, xleft, , , 1 - {{Cl|CASE}} "g" + {{Cl|CASE}} "g" xleft = xleft + 0.1 {{Cl|_SNDBAL}} s&, xleft, , , 1 - {{Cl|CASE}} "h" + {{Cl|CASE}} "h" xright = xright - 0.1 {{Cl|_SNDBAL}} s&, xright, , , 2 - {{Cl|CASE}} "j" + {{Cl|CASE}} "j" xright = xright + 0.1 {{Cl|_SNDBAL}} s&, xright, , , 2 - {{Cl|CASE}} "n" + {{Cl|CASE}} "n" volume = volume - 0.1 {{Cl|_SNDVOL}} s&, volume - {{Cl|CASE}} "m" + {{Cl|CASE}} "m" volume = volume + 0.1 {{Cl|_SNDVOL}} s&, volume - {{Cl|CASE}} "p" + {{Cl|CASE}} "p" {{Cl|_SNDPAUSE}} s& - {{Cl|CASE}} " " + {{Cl|CASE}} " " {{Cl|_SNDPLAY}} s& - {{Cl|CASE}} "i" + {{Cl|CASE}} "i" {{Cl|PRINT}} {{Cl|_SNDPLAYING}}(s&) {{Cl|PRINT}} {{Cl|_SNDPAUSED}}(s&) {{Cl|SLEEP}} - {{Cl|CASE}} "b" + {{Cl|CASE}} "b" {{Cl|_SNDSETPOS}} s&, 110 - {{Cl|CASE}} "l" + {{Cl|CASE}} "l" {{Cl|_SNDLIMIT}} s&, 10 - {{Cl|PRINT}} "LIM" + {{Cl|PRINT}} "LIM" {{Cl|SLEEP}} - {{Cl|CASE}} "k" + {{Cl|CASE}} "k" {{Cl|_SNDSTOP}} s& - {{Cl|CASE}} "c" + {{Cl|CASE}} "c" {{Cl|_SNDCLOSE}} s& {{Cl|SLEEP}} - s2& = {{Cl|_SNDOPEN}}("song.ogg") - {{Cl|CASE}} "d" + s2& = {{Cl|_SNDOPEN}}("song.ogg") + {{Cl|CASE}} "d" s2& = {{Cl|_SNDCOPY}}(s&) {{Cl|_SNDPLAY}} s2& {{Cl|END SELECT}} {{Cl|LOCATE}} 1, 1 - {{Cl|PRINT}} xleft, xright, volume, {{Cl|_SNDGETPOS}}(s&); " " + {{Cl|PRINT}} xleft, xright, volume, {{Cl|_SNDGETPOS}}(s&); " " LOOP {{CodeEnd}}{{small|Code by Johny B}} @@ -98,4 +98,4 @@ LOOP *[[_SNDOPEN]], [[_SNDVOL]], [[_SNDLIMIT]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SNDCLOSE.txt b/internal/help/_SNDCLOSE.txt index ca5c3b5d1..147e58ced 100644 --- a/internal/help/_SNDCLOSE.txt +++ b/internal/help/_SNDCLOSE.txt @@ -16,4 +16,4 @@ The [[_SNDCLOSE]] statement frees and unloads an open sound using a [[_SNDOPEN]] *[[_SNDSTOP]], [[_SNDPAUSE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SNDCOPY.txt b/internal/help/_SNDCOPY.txt index ec3e8ef25..651662400 100644 --- a/internal/help/_SNDCOPY.txt +++ b/internal/help/_SNDCOPY.txt @@ -10,7 +10,7 @@ The [[_SNDCOPY]] function copies a sound to a new handle so that two or more of * Returns a new handle to the a copy in memory of the sound data referred to by the source handle. * No changes to the source handle (such as a volume change) are inherited. * The sound data referred to by the handle and its copies are not freed until all of them are closed. -* In versions '''prior to build 20170811/60''', the sound identified by {{Parameter|handle&}} must have been opened using the [[_SNDOPEN|"SYNC" capability]] to use this function. +* In versions '''prior to build 20170811/60''', the sound identified by {{Parameter|handle&}} must have been opened using the [[_SNDOPEN|"SYNC" capability]] to use this function. {{PageSeeAlso}} @@ -18,4 +18,4 @@ The [[_SNDCOPY]] function copies a sound to a new handle so that two or more of * [[_SNDOPEN]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SNDGETPOS.txt b/internal/help/_SNDGETPOS.txt index 8761f0caa..ed5e039d8 100644 --- a/internal/help/_SNDGETPOS.txt +++ b/internal/help/_SNDGETPOS.txt @@ -11,17 +11,17 @@ The [[_SNDGETPOS]] function returns the current playing position in seconds usin *If a sound isn't playing, it returns 0. *If a sound is paused, it returns the paused position. *For a looping sound, the value returned continues to increment and does not reset to 0 when the sound loops. -* In versions '''prior to build 20170811/60''', the sound identified by {{Parameter|handle&}} must have been opened using the [[_SNDOPEN|"SETPOS" capability]] to use this function. +* In versions '''prior to build 20170811/60''', the sound identified by {{Parameter|handle&}} must have been opened using the [[_SNDOPEN|"SETPOS" capability]] to use this function. {{PageExamples}} ''Example:'' To check the current playing position in an MP3 file, use [[_SNDPLAY]] with [[_SNDGETPOS]] printed in a loop: {{CodeStart}} '' '' -SoundFile& = {{Cl|_SNDOPEN}}("YourSoundFile.mp3") '<<< your MP3 sound file here! +SoundFile& = {{Cl|_SNDOPEN}}("YourSoundFile.mp3") '<<< your MP3 sound file here! {{Cl|_SNDSETPOS}} SoundFile&, 5.5 'set to play sound 5 1/2 seconds into music {{Cl|_SNDPLAY}} SoundFile& 'play sound Do: {{Cl|_LIMIT}} 60 - LOCATE 5, 2: PRINT "Current play position> "; {{Cl|_SNDGETPOS}}(SoundFile&) + LOCATE 5, 2: PRINT "Current play position> "; {{Cl|_SNDGETPOS}}(SoundFile&) LOOP UNTIL {{Cl|_KEYDOWN}}(27) OR {{Cl|NOT}} {{Cl|_SNDPLAYING}}(SoundFile&) 'ESC or end of sound exit {{CodeEnd}} @@ -31,4 +31,4 @@ LOOP UNTIL {{Cl|_KEYDOWN}}(27) OR {{Cl|NOT}} {{Cl|_SNDPLAYING}}(SoundFile&) * [[_SNDOPEN]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SNDLEN.txt b/internal/help/_SNDLEN.txt index 76594c9e5..1d7ee3c53 100644 --- a/internal/help/_SNDLEN.txt +++ b/internal/help/_SNDLEN.txt @@ -8,11 +8,11 @@ The [[_SNDLEN]] function returns the length in seconds of a loaded sound using a {{PageDescription}} * Returns the length of a sound in seconds. -* In versions '''prior to build 20170811/60''', the sound identified by {{Parameter|handle&}} must have been opened using the [[_SNDOPEN|"LEN" capability]] to use this function. +* In versions '''prior to build 20170811/60''', the sound identified by {{Parameter|handle&}} must have been opened using the [[_SNDOPEN|"LEN" capability]] to use this function. {{PageSeeAlso}} * [[_SNDCOPY]], [[_SNDLIMIT]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SNDLIMIT.txt b/internal/help/_SNDLIMIT.txt index 559cbc4a1..8e8b3ad78 100644 --- a/internal/help/_SNDLIMIT.txt +++ b/internal/help/_SNDLIMIT.txt @@ -27,4 +27,4 @@ The [[_SNDLIMIT]] statement stops playing a sound after it has been playing for * [[_SNDOPEN]], [[_SNDLEN]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SNDLOOP.txt b/internal/help/_SNDLOOP.txt index e38b13e30..a1df18a9f 100644 --- a/internal/help/_SNDLOOP.txt +++ b/internal/help/_SNDLOOP.txt @@ -13,12 +13,12 @@ The [[_SNDLOOP]] statement is like [[_SNDPLAY]] but the sound is looped. Uses a {{PageExamples}} ''Example:'' Loading a sound or music file and playing it in a loop until a key is pressed. {{CodeStart}} '' '' -bg = {{Cl|_SNDOPEN}}("back.ogg") '<<<<<<<<<< change to your sound file name +bg = {{Cl|_SNDOPEN}}("back.ogg") '<<<<<<<<<< change to your sound file name {{Cl|_SNDLOOP}} bg DO {{Cl|_LIMIT}} 10 'keep CPU resources used low -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" 'key press program exit +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" 'key press program exit {{Cl|_SNDSTOP}} bg {{Cl|_SNDCLOSE}} bg '' '' {{CodeEnd}} @@ -28,4 +28,4 @@ DO * [[_SNDOPEN]], [[_SNDSTOP]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SNDOPEN.txt b/internal/help/_SNDOPEN.txt index 30b9db171..6a32cfb70 100644 --- a/internal/help/_SNDOPEN.txt +++ b/internal/help/_SNDOPEN.txt @@ -6,7 +6,7 @@ The [[_SNDOPEN]] function loads a sound file into memory and returns a [[LONG]] : {{Parameter|soundHandle&}} = [[_SNDOPEN]]({{Parameter|fileName$}}) ===Syntax prior to build 20170811/60=== -: {{Parameter|soundHandle&}} = [[_SNDOPEN]]({{Parameter|fileName$}}[, "[VOL][,][SYNC][,][LEN][,][PAUSE][,][SETPOS]"]) +: {{Parameter|soundHandle&}} = [[_SNDOPEN]]({{Parameter|fileName$}}[, "[VOL][,][SYNC][,][LEN][,][PAUSE][,][SETPOS]"]) {{PageDescription}} @@ -20,18 +20,18 @@ The [[_SNDOPEN]] function loads a sound file into memory and returns a [[LONG]] ===Older versions=== -* The second parameter ("capabilities") is a string of parameters separated by commas, according to the table below. It is not case sensitive. +* The second parameter ("capabilities") is a string of parameters separated by commas, according to the table below. It is not case sensitive. * Each capability can only be specified once and must be valid for that file or it won't play. Capabilities can be listed in any order. {{TextStart}} '''QB64 versions prior to 1.000''' support the following sound file formats ('''Bold is a guaranteed capability'''): - WAV = "'''VOL,SYNC,LEN''',PAUSE" [http://www.rarewares.org/ogg-oggdropxpd.php Free WAV to OGG GUI converter] - OGG = "VOL,SYNC,LEN,PAUSE" [http://www.rarewares.org/ogg-oggenc.php Free WAV to OGG converter] - AIF = "VOL,SYNC,LEN,PAUSE" - RIF = "VOL,SYNC,LEN,PAUSE" - VOC = "VOL,SYNC,LEN,PAUSE" - MID = "'''VOL'''" - MOD = "VOL,PAUSE" - MP3 = "'''VOL''',PAUSE,SETPOS" [http://www.freemp3wmaconverter.com/index.html Free WMA, MP3 and OGG converter] + WAV = "'''VOL,SYNC,LEN''',PAUSE" [http://www.rarewares.org/ogg-oggdropxpd.php Free WAV to OGG GUI converter] + OGG = "VOL,SYNC,LEN,PAUSE" [http://www.rarewares.org/ogg-oggenc.php Free WAV to OGG converter] + AIF = "VOL,SYNC,LEN,PAUSE" + RIF = "VOL,SYNC,LEN,PAUSE" + VOC = "VOL,SYNC,LEN,PAUSE" + MID = "'''VOL'''" + MOD = "VOL,PAUSE" + MP3 = "'''VOL''',PAUSE,SETPOS" [http://www.freemp3wmaconverter.com/index.html Free WMA, MP3 and OGG converter] ''Note:'' {{Cb|_SNDBAL}} only affects MP3 volume. Sound will reside in main channel. {{TextEnd}} @@ -39,14 +39,14 @@ The [[_SNDOPEN]] function loads a sound file into memory and returns a [[LONG]] * The required sound file capabilities can make a difference as to whether a sound file can be played or not and how it can be used. :'''Only one sound can exist on the primary channel, and it must be closed before playing another non-SYNC sound. -<center>See [[_SNDCOPY]] and [[_SNDPLAYCOPY]]</center> +<center>See [[_SNDCOPY]] and [[_SNDPLAYCOPY]]</center> {{TextStart}} '''Capability Descriptions''' - "'''VOL'''" can change the volume or balance of the sound using {{Cb|_SNDVOL}} and {{Cb|_SNDBAL}}. - "'''LEN'''" can get the length of the sound using the {{Cb|_SNDLEN}} function. - "'''PAUSE'''" can pause the sound using {{Cb|_SNDPAUSE}} and the {{Cb|_SNDPAUSED}} function can check it. - "'''SETPOS'''" can change the position the sound is (or will be) playing from. See {{Cb|_SNDSETPOS}}. - "'''SYNC'''" can load the sound onto a unique channel, to be played simultaneously with others. + "'''VOL'''" can change the volume or balance of the sound using {{Cb|_SNDVOL}} and {{Cb|_SNDBAL}}. + "'''LEN'''" can get the length of the sound using the {{Cb|_SNDLEN}} function. + "'''PAUSE'''" can pause the sound using {{Cb|_SNDPAUSE}} and the {{Cb|_SNDPAUSED}} function can check it. + "'''SETPOS'''" can change the position the sound is (or will be) playing from. See {{Cb|_SNDSETPOS}}. + "'''SYNC'''" can load the sound onto a unique channel, to be played simultaneously with others. '''When SYNC is not specified, the sound is loaded onto the primary channel.''' {{TextEnd}} @@ -57,16 +57,16 @@ The [[_SNDOPEN]] function loads a sound file into memory and returns a [[LONG]] {{PageExamples}} ''Snippet 1:'' Loading a sound file to use in the program later. Only load it once and use the handle any time you want. {{CodeStart}} -h& = {{Cl|_SNDOPEN}}("dog.wav") +h& = {{Cl|_SNDOPEN}}("dog.wav") IF h& = 0 THEN BEEP ELSE {{Cl|_SNDPLAY}} h& 'check for valid handle before using! {{CodeEnd}} ''Snippet 2:'' Playing a sound from 2 different speakers based on program results. {{CodeStart}} '' '' -Laff& = {{Cl|_SNDOPEN}}("KONGlaff.ogg") 'load sound file and get LONG handle value +Laff& = {{Cl|_SNDOPEN}}("KONGlaff.ogg") 'load sound file and get LONG handle value {{Cl|IF}} LaffX! < -1 {{Cl|THEN}} LaffX! = -1 'set full volume to left speaker -{{Cl|IF}} LaffX! > 1 {{Cl|THEN}} LaffX! = 1 'set full volume to right speaker +{{Cl|IF}} LaffX! > 1 {{Cl|THEN}} LaffX! = 1 'set full volume to right speaker {{Cl|_SNDBAL}} Laff&, LaffX! 'balance sound to left or right speaker {{Cl|_SNDPLAY}} Laff& 'play sound '' '' @@ -75,8 +75,8 @@ Laff& = {{Cl|_SNDOPEN}}("KONGlaff.ogg") 'load sound file and get L ''Example:'' Playing a file and controlling playback: {{CodeStart}} -s& = {{Cl|_SNDOPEN}}("song.ogg") -{{Cl|PRINT}} "{{Cl|READ}}Y"; s& +s& = {{Cl|_SNDOPEN}}("song.ogg") +{{Cl|PRINT}} "{{Cl|READ}}Y"; s& {{Cl|_SNDPLAY}} s& {{Cl|_SNDLOOP}} s& @@ -86,50 +86,50 @@ xright = 1 DO k$ = {{Cl|INKEY$}} {{Cl|SELECT CASE}} k$ - {{Cl|CASE}} "f" + {{Cl|CASE}} "f" xleft = xleft - 0.1 {{Cl|_SNDBAL}} s&, xleft, , , 1 - {{Cl|CASE}} "g" + {{Cl|CASE}} "g" xleft = xleft + 0.1 {{Cl|_SNDBAL}} s&, xleft, , , 1 - {{Cl|CASE}} "h" + {{Cl|CASE}} "h" xright = xright - 0.1 {{Cl|_SNDBAL}} s&, xright, , , 2 - {{Cl|CASE}} "j" + {{Cl|CASE}} "j" xright = xright + 0.1 {{Cl|_SNDBAL}} s&, xright, , , 2 - {{Cl|CASE}} "n" + {{Cl|CASE}} "n" volume = volume - 0.1 {{Cl|_SNDVOL}} s&, volume - {{Cl|CASE}} "m" + {{Cl|CASE}} "m" volume = volume + 0.1 {{Cl|_SNDVOL}} s&, volume - {{Cl|CASE}} "p" + {{Cl|CASE}} "p" {{Cl|_SNDPAUSE}} s& - {{Cl|CASE}} " " + {{Cl|CASE}} " " {{Cl|_SNDPLAY}} s& - {{Cl|CASE}} "i" + {{Cl|CASE}} "i" {{Cl|PRINT}} {{Cl|_SNDPLAYING}}(s&) {{Cl|PRINT}} {{Cl|_SNDPAUSED}}(s&) {{Cl|SLEEP}} - {{Cl|CASE}} "b" + {{Cl|CASE}} "b" {{Cl|_SNDSETPOS}} s&, 110 - {{Cl|CASE}} "l" + {{Cl|CASE}} "l" {{Cl|_SNDLIMIT}} s&, 10 - {{Cl|PRINT}} "LIM" + {{Cl|PRINT}} "LIM" {{Cl|SLEEP}} - {{Cl|CASE}} "k" + {{Cl|CASE}} "k" {{Cl|_SNDSTOP}} s& - {{Cl|CASE}} "c" + {{Cl|CASE}} "c" {{Cl|_SNDCLOSE}} s& {{Cl|SLEEP}} - s2& = {{Cl|_SNDOPEN}}("song.ogg") - {{Cl|CASE}} "d" + s2& = {{Cl|_SNDOPEN}}("song.ogg") + {{Cl|CASE}} "d" s2& = {{Cl|_SNDCOPY}}(s&) {{Cl|_SNDPLAY}} s2& {{Cl|END SELECT}} {{Cl|LOCATE}} 1, 1 - {{Cl|PRINT}} xleft, xright, volume, {{Cl|_SNDGETPOS}}(s&); " " + {{Cl|PRINT}} xleft, xright, volume, {{Cl|_SNDGETPOS}}(s&); " " LOOP {{CodeEnd}}{{small|Code by Johny B}} @@ -146,4 +146,4 @@ LOOP * [[_SNDRAW]], [[_SNDRATE]], [[_SNDRAWLEN]] {{text|(raw sounds without files)}} -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SNDOPENRAW.txt b/internal/help/_SNDOPENRAW.txt index d738614be..22306d8d1 100644 --- a/internal/help/_SNDOPENRAW.txt +++ b/internal/help/_SNDOPENRAW.txt @@ -33,4 +33,4 @@ b = {{Cl|_SNDOPENRAW}} * [[_SNDCLOSE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SNDPAUSE.txt b/internal/help/_SNDPAUSE.txt index 32286ef9b..fd294f997 100644 --- a/internal/help/_SNDPAUSE.txt +++ b/internal/help/_SNDPAUSE.txt @@ -8,7 +8,7 @@ The [[_SNDPAUSE]] statement pauses a sound using a handle from the [[_SNDOPEN]] {{PageDescription}} * Continue playing by calling [[_SNDPLAY]] {{Parameter|handle&}} -* In versions '''prior to build 20170811/60''', the sound identified by {{Parameter|handle&}} must have been opened using the [[_SNDOPEN|"PAUSE" capability]] to use this function. +* In versions '''prior to build 20170811/60''', the sound identified by {{Parameter|handle&}} must have been opened using the [[_SNDOPEN|"PAUSE" capability]] to use this function. {{PageSeeAlso}} @@ -16,4 +16,4 @@ The [[_SNDPAUSE]] statement pauses a sound using a handle from the [[_SNDOPEN]] * [[_SNDPAUSED]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SNDPAUSED.txt b/internal/help/_SNDPAUSED.txt index 8d6d34ab6..0a5a165ed 100644 --- a/internal/help/_SNDPAUSED.txt +++ b/internal/help/_SNDPAUSED.txt @@ -21,4 +21,4 @@ The [[_SNDPAUSED]] function checks if a sound is paused. Uses a handle parameter * [[_SNDSTOP]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SNDPLAY.txt b/internal/help/_SNDPLAY.txt index 388d41e9d..fc0a58346 100644 --- a/internal/help/_SNDPLAY.txt +++ b/internal/help/_SNDPLAY.txt @@ -21,4 +21,4 @@ The [[_SNDPLAY]] statement plays a sound designated by a file handle created by * [[_SNDOPEN]], [[_SNDPAUSE]], [[_SNDPLAYING]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SNDPLAYCOPY.txt b/internal/help/_SNDPLAYCOPY.txt index fb5280915..956153a0b 100644 --- a/internal/help/_SNDPLAYCOPY.txt +++ b/internal/help/_SNDPLAYCOPY.txt @@ -29,7 +29,7 @@ The [[_SNDPLAYCOPY]] statement copies a sound, plays it, and automatically close ''Example 2:'' Playing a song at random volumes. {{CodeStart}} '' '' -chomp& = _SNDOPEN("chomp.wav") +chomp& = _SNDOPEN("chomp.wav") _SNDPLAYCOPY chomp&, 0.5 + RND * 0.49 '' '' {{CodeEnd}} @@ -41,4 +41,4 @@ _SNDPLAYCOPY chomp&, 0.5 + RND * 0.49 '' '' * [[_SNDPLAYFILE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SNDPLAYFILE.txt b/internal/help/_SNDPLAYFILE.txt index 037ef1a2f..0ca557bfb 100644 --- a/internal/help/_SNDPLAYFILE.txt +++ b/internal/help/_SNDPLAYFILE.txt @@ -9,7 +9,7 @@ The [[_SNDPLAYFILE]] statement is used to play a sound file without generating a {{PageDescription}} * Supported file formats are '''WAV, OGG and MP3'''. See [[_SNDOPEN]]. * {{Parameter|ignored%}} is an optional parameter , accepted for historical reasons. -** In versions prior to '''build 20170811/60''', {{Parameter|ignored%}} identified if a sound was to be loaded with [[_SNDOPEN|"SYNC" capabilities]], (-1 for true, 0 for false). This is true for all sound files in the latest versions, making this parameter safe to be ignored. +** In versions prior to '''build 20170811/60''', {{Parameter|ignored%}} identified if a sound was to be loaded with [[_SNDOPEN|"SYNC" capabilities]], (-1 for true, 0 for false). This is true for all sound files in the latest versions, making this parameter safe to be ignored. * {{Parameter|volume!}} is a [[SINGLE]] value from 0 (silence) to 1 (full volume). If not used or outside this range, the sound will be played at full volume. * [[_SNDPLAYFILE]] never creates an error. If the sound cannot be played it takes no further action. * The sound is closed automatically after it finishes playing. @@ -19,7 +19,7 @@ The [[_SNDPLAYFILE]] statement is used to play a sound file without generating a {{PageExamples}} ''Example:'' Playing a sound file at half volume. {{CodeStart}} '' '' -{{Cl|_SNDPLAYFILE}} "dog.wav", , .5 '' '' +{{Cl|_SNDPLAYFILE}} "dog.wav", , .5 '' '' {{CodeEnd}} @@ -28,4 +28,4 @@ The [[_SNDPLAYFILE]] statement is used to play a sound file without generating a * [[_SNDPLAYCOPY]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SNDPLAYING.txt b/internal/help/_SNDPLAYING.txt index 92c058d71..be8ab948f 100644 --- a/internal/help/_SNDPLAYING.txt +++ b/internal/help/_SNDPLAYING.txt @@ -22,4 +22,4 @@ The [[_SNDPLAYING]] function returns whether a sound is being played. Uses a han * [[_SNDPAUSED]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SNDRATE.txt b/internal/help/_SNDRATE.txt index 44e240f46..2178c28fd 100644 --- a/internal/help/_SNDRATE.txt +++ b/internal/help/_SNDRATE.txt @@ -20,4 +20,4 @@ The [[_SNDRATE]] function returns the sample rate frequency per second of the cu * [[_SNDRAWLEN]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SNDRAW.txt b/internal/help/_SNDRAW.txt index b1ff5d673..ccb1f385b 100644 --- a/internal/help/_SNDRAW.txt +++ b/internal/help/_SNDRAW.txt @@ -43,8 +43,8 @@ FRate = FREQ / SampleRate' ''Example 2:'' A simple ringing bell tone that tapers off. {{CodeStart}}t = 0 -tmp$ = "Sample = ##.##### Time = ##.#####" -LOCATE 1, 60: PRINT "Rate:"; {{Cl|_SNDRATE}} +tmp$ = "Sample = ##.##### Time = ##.#####" +LOCATE 1, 60: PRINT "Rate:"; {{Cl|_SNDRATE}} DO 'queue some sound DO WHILE {{Cl|_SNDRAWLEN}} < 0.1 'you may wish to adjust this @@ -58,7 +58,7 @@ DO LOCATE 1, 1: PRINT USING tmp$; sample; t LOOP WHILE t < 3.0 'play for 3 seconds -DO WHILE {{Cl|_SNDRAWLEN}} > 0 'Finish any left over queued sound! +DO WHILE {{Cl|_SNDRAWLEN}} > 0 'Finish any left over queued sound! LOOP {{Cl|END}} '' '' {{CodeEnd}} @@ -70,24 +70,24 @@ LOOP {{Cl|DIM}} {{Cl|SHARED}} rate& rate& = {{Cl|_SNDRATE}} DO - {{Cl|PRINT}} "Enter the octave 1 to 8 (0 quits!):"; + {{Cl|PRINT}} "Enter the octave 1 to 8 (0 quits!):"; oct% = {{Cl|VAL}}({{Cl|INPUT$}}(1)): {{Cl|PRINT}} oct% {{Cl|IF...THEN|IF}} oct% = 0 {{Cl|THEN}} {{Cl|EXIT DO}} octave = oct% - 4 '440 is in the 4th octave, 9th note {{Cl|COLOR}} oct% + 1 - {{Cl|PRINT USING}} "Octave: ##"; oct% + {{Cl|PRINT USING}} "Octave: ##"; oct% {{Cl|FOR...NEXT|FOR}} Note = 0 {{Cl|TO}} 11 'notes C to B fq = FreQ(octave, Note, note$) - {{Cl|PRINT USING}} "#####.## \\"; fq, note$ + {{Cl|PRINT USING}} "#####.## \\"; fq, note$ PlaySound fq - {{Cl|IF...THEN|IF}} {{Cl|INKEY$}} > "" {{Cl|THEN}} {{Cl|EXIT DO}} + {{Cl|IF...THEN|IF}} {{Cl|INKEY$}} > "" {{Cl|THEN}} {{Cl|EXIT DO}} {{Cl|NEXT}} {{Cl|LOOP}} {{Cl|END}} {{Cl|FUNCTION}} FreQ (octave, note, note$) FreQ = 440 * 2 ^ (octave + (note + 3) / 12 - 1) '* 12 note octave starts at C (3 notes up) -note$ = {{Cl|MID$}}("C C#D D#E F F#G G#A A#B ", note * 2 + 1, 2) +note$ = {{Cl|MID$}}("C C#D D#E F F#G G#A A#B ", note * 2 + 1, 2) {{Cl|END FUNCTION}} {{Cl|SUB}} PlaySound (frq!) ' plays sine wave fading in and out @@ -111,4 +111,4 @@ SndLoop! = 0 * [[DTMF Phone Demo]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SNDRAWDONE.txt b/internal/help/_SNDRAWDONE.txt index e99b9b772..c7c11853e 100644 --- a/internal/help/_SNDRAWDONE.txt +++ b/internal/help/_SNDRAWDONE.txt @@ -21,4 +21,4 @@ * [[_SNDRATE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SNDRAWLEN.txt b/internal/help/_SNDRAWLEN.txt index 6265bd28f..52da43a6f 100644 --- a/internal/help/_SNDRAWLEN.txt +++ b/internal/help/_SNDRAWLEN.txt @@ -23,4 +23,4 @@ The [[_SNDRAWLEN]] function returns the length, in seconds, of a [[_SNDRAW]] sou * [[_SNDRATE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SNDSETPOS.txt b/internal/help/_SNDSETPOS.txt index 6c3140ea4..fe5d05923 100644 --- a/internal/help/_SNDSETPOS.txt +++ b/internal/help/_SNDSETPOS.txt @@ -10,17 +10,17 @@ The [[_SNDSETPOS]] statement changes the current/starting playing position in se *Changes the current/starting playing position in seconds (a [[SINGLE]] value) of a sound in memory. *If {{Parameter|position!}} is past the length of the sound, playback will be interrupted. *Function cannot be called while a looping sound is being played (see [[_SNDLOOP]]). -* In versions '''prior to build 20170811/60''', the sound identified by {{Parameter|handle&}} must have been opened using the [[_SNDOPEN|"SETPOS" capability]] to use this statement. +* In versions '''prior to build 20170811/60''', the sound identified by {{Parameter|handle&}} must have been opened using the [[_SNDOPEN|"SETPOS" capability]] to use this statement. {{PageExamples}} ''Example:'' To check the current playing position in an MP3 file, use [[_SNDPLAY]] with [[_SNDGETPOS]] printed in a loop {{CodeStart}} '' '' -SoundFile& = {{Cl|_SNDOPEN}}("YourSoundFile.mp3") '<<< your MP3 sound file here! +SoundFile& = {{Cl|_SNDOPEN}}("YourSoundFile.mp3") '<<< your MP3 sound file here! {{Cl|_SNDSETPOS}} SoundFile&, 5.5 'set to play sound 5 1/2 seconds into music {{Cl|_SNDPLAY}} SoundFile& 'play sound Do: {{Cl|_LIMIT}} 60 - LOCATE 5, 2: PRINT "Current play position> "; {{Cl|_SNDGETPOS}}(SoundFile&) + LOCATE 5, 2: PRINT "Current play position> "; {{Cl|_SNDGETPOS}}(SoundFile&) LOOP UNTIL {{Cl|_KEYDOWN}}(27) OR {{Cl|NOT}} {{Cl|_SNDPLAYING}}(SoundFile&) 'ESC or end of sound exit {{CodeEnd}} @@ -30,4 +30,4 @@ LOOP UNTIL {{Cl|_KEYDOWN}}(27) OR {{Cl|NOT}} {{Cl|_SNDPLAYING}}(SoundFile&) * [[_SNDOPEN]], [[_SNDLIMIT]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SNDSTOP.txt b/internal/help/_SNDSTOP.txt index 7661dd6b4..81d6855a3 100644 --- a/internal/help/_SNDSTOP.txt +++ b/internal/help/_SNDSTOP.txt @@ -21,4 +21,4 @@ The [[_SNDSTOP]] statement stops a playing or paused sound using a handle from t * [[_SNDPAUSE]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SNDVOL.txt b/internal/help/_SNDVOL.txt index a1b10b3c5..d95629075 100644 --- a/internal/help/_SNDVOL.txt +++ b/internal/help/_SNDVOL.txt @@ -8,12 +8,12 @@ The [[_SNDVOL]] statement sets the volume of a sound loaded in memory using a ha {{PageDescription}} * {{Parameter|volume!}} is a value from 0 (silence) to 1 (full volume). -* In versions '''prior to build 20170811/60''', the sound identified by {{Parameter|handle&}} must have been opened using the [[_SNDOPEN|"VOL" capability]] to use this function. +* In versions '''prior to build 20170811/60''', the sound identified by {{Parameter|handle&}} must have been opened using the [[_SNDOPEN|"VOL" capability]] to use this function. {{PageExamples}} {{CodeStart}} '' '' -h& = {{Cl|_SNDOPEN}}("bell.wav") +h& = {{Cl|_SNDOPEN}}("bell.wav") {{Cl|_SNDVOL}} h&, 0.5 {{Cl|_SNDPLAY}} h& '' '' {{CodeEnd}} @@ -23,4 +23,4 @@ h& = {{Cl|_SNDOPEN}}("bell.wav") *[[_SNDOPEN]], [[_SNDBAL]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SOURCE.txt b/internal/help/_SOURCE.txt index e499d83b2..6d611c533 100644 --- a/internal/help/_SOURCE.txt +++ b/internal/help/_SOURCE.txt @@ -41,4 +41,4 @@ See the examples in: * [[POINT]], [[GET (graphics statement)]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_SOURCE_(function).txt b/internal/help/_SOURCE_(function).txt index fac43201f..d10a6b571 100644 --- a/internal/help/_SOURCE_(function).txt +++ b/internal/help/_SOURCE_(function).txt @@ -23,4 +23,4 @@ See the examples in: * [[_SOURCE]], [[_DEST]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_STARTDIR$.txt b/internal/help/_STARTDIR$.txt index 307b72d3a..0b10ff757 100644 --- a/internal/help/_STARTDIR$.txt +++ b/internal/help/_STARTDIR$.txt @@ -18,7 +18,7 @@ The [[_STARTDIR$]] function returns the path a user called a QB64 program from. {{CodeStart}} '' '' {{Cl|$CONSOLE}}:ONLY {{Cl|_DEST}} {{Cl|_CONSOLE}} -{{Cl|SHELL}} "cd" +{{Cl|SHELL}} "cd" {{Cl|PRINT}} {{Cl|_CWD$}} {{Cl|PRINT}} {{Cl|_STARTDIR$}} {{Cl|SYSTEM}} @@ -30,4 +30,4 @@ The [[_STARTDIR$]] function returns the path a user called a QB64 program from. * [[SHELL]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_STRCMP.txt b/internal/help/_STRCMP.txt index 324539b21..3846b1d42 100644 --- a/internal/help/_STRCMP.txt +++ b/internal/help/_STRCMP.txt @@ -19,4 +19,4 @@ The [[_STRCMP]] function compares the relationship between two strings, comparin * [[ASCII]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_STRICMP.txt b/internal/help/_STRICMP.txt index edaf9cb9d..5c4bc4082 100644 --- a/internal/help/_STRICMP.txt +++ b/internal/help/_STRICMP.txt @@ -19,4 +19,4 @@ The [[_STRICMP]] function compares the relationship between two strings, ignorin * [[ASCII]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_TITLE.txt b/internal/help/_TITLE.txt index 8a8e8084c..047d08cf1 100644 --- a/internal/help/_TITLE.txt +++ b/internal/help/_TITLE.txt @@ -12,7 +12,7 @@ The [[_TITLE]] statement provides the program name in the title bar of the progr {{PageDescription}} * The title can be changed anywhere in a program procedure. -* The title bar will say "Untitled" if a title is not set. +* The title bar will say "Untitled" if a title is not set. * Change the title of the [[$CONSOLE]] windows created using [[_CONSOLETITLE]] * '''Note: A [[_DELAY|delay]] may be required before the title can be set.''' See [[_SCREENEXISTS]]. @@ -20,16 +20,16 @@ The [[_TITLE]] statement provides the program name in the title bar of the progr {{PageExamples}} ''Example 1:'' How to create the window title bar. {{CodeStart}} '' '' -{{Cl|_TITLE}} "My New Program" '' '' +{{Cl|_TITLE}} "My New Program" '' '' {{CodeEnd}} ''Example 2:'' How to find the currently running program module name and current path using a Windows API Library. {{CodeStart}} '' '' -{{Cl|_TITLE}} "My program" +{{Cl|_TITLE}} "My program" {{Cl|_DELAY}} 5 '5 second delay -{{Cl|_TITLE}} {{Cl|MID$}}(TITLE$, 1, {{Cl|INSTR}}(TITLE$, ".") - 1) +{{Cl|_TITLE}} {{Cl|MID$}}(TITLE$, 1, {{Cl|INSTR}}(TITLE$, ".") - 1) {{Cl|PRINT}} PATH$ @@ -46,13 +46,13 @@ Result = GetModuleFileNameA(0, FileName$, {{Cl|LEN}}(FileName$)) PATH$ = {{Cl|LEFT$}}(FileName$, Result) start = 1 DO - posit = {{Cl|INSTR}}(start, PATH$, "\") + posit = {{Cl|INSTR}}(start, PATH$, "\") {{Cl|IF...THEN|IF}} posit {{Cl|THEN}} last = posit start = posit + 1 {{Cl|LOOP}} {{Cl|UNTIL}} posit = 0 TITLE$ = {{Cl|MID$}}(PATH$, last + 1) PATH$ = {{Cl|LEFT$}}(PATH$, last) -{{Cl|ELSE}} TITLE$ = "": PATH$ = "" +{{Cl|ELSE}} TITLE$ = "": PATH$ = "" {{Cl|END IF}} {{Cl|END FUNCTION}} '' '' {{CodeEnd}} @@ -68,4 +68,4 @@ Result = GetModuleFileNameA(0, FileName$, {{Cl|LEN}}(FileName$)) * [[_SCREENEXISTS]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_UNSIGNED.txt b/internal/help/_UNSIGNED.txt index f534f2934..4d3bc6f3c 100644 --- a/internal/help/_UNSIGNED.txt +++ b/internal/help/_UNSIGNED.txt @@ -17,7 +17,7 @@ * The unsigned variable type suffix used is the '''tilde (~)''', right before the number's own type suffix: {{Parameter|variableName~&}} -<center>How negative values affect the [[_UNSIGNED]] value returned by a [[_BYTE]] (8 bits). </center> +<center>How negative values affect the [[_UNSIGNED]] value returned by a [[_BYTE]] (8 bits). </center> {{WhiteStart}} 00000001 - unsigned & signed are both 1     01111111 - unsigned & signed are both 127   @@ -50,12 +50,12 @@ i~% = 70000 {{CodeStart}} '' '' {{Cl|DIM}} n {{Cl|AS}} {{Cl|_UNSIGNED}} {{Cl|INTEGER}} {{Cl|DIM}} pn {{Cl|AS}} {{Cl|_UNSIGNED}} {{Cl|INTEGER}} -{{Cl|LOCATE}} 3, 6: {{Cl|PRINT}} "Press Esc to exit loop" +{{Cl|LOCATE}} 3, 6: {{Cl|PRINT}} "Press Esc to exit loop" {{Cl|FOR...NEXT|FOR}} n = 1 {{Cl|TO}} 80000 {{Cl|_LIMIT}} 10000 ' 6.5 second loop {{Cl|LOCATE}} 12, 37: {{Cl|PRINT}} n ' display current value - {{Cl|IF...THEN|IF}} n > 0 {{Cl|THEN}} pn = n ' find highest value - {{Cl|IF...THEN|IF}} n = 0 {{Cl|THEN}} Count = Count + 1: {{Cl|LOCATE}} 14, 37: {{Cl|PRINT}} "Count:"; Count; "Max:"; pn + {{Cl|IF...THEN|IF}} n > 0 {{Cl|THEN}} pn = n ' find highest value + {{Cl|IF...THEN|IF}} n = 0 {{Cl|THEN}} Count = Count + 1: {{Cl|LOCATE}} 14, 37: {{Cl|PRINT}} "Count:"; Count; "Max:"; pn {{Cl|IF...THEN|IF}} {{Cl|INP}}(&H60) = 1 {{Cl|THEN}} {{Cl|EXIT|EXIT FOR}} ' escape key exit {{Cl|NEXT}} n {{Cl|END}} '' '' @@ -86,4 +86,4 @@ i~% = 70000 * [[Variable Types]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_WHEEL.txt b/internal/help/_WHEEL.txt index b690190f0..a2081dd36 100644 --- a/internal/help/_WHEEL.txt +++ b/internal/help/_WHEEL.txt @@ -17,13 +17,13 @@ The [[_WHEEL]] function returns the relative position of a specified wheel numbe ''Example 1:'' Reading multiple controller device buttons, axis and wheels. {{CodeStart}} '' '' {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} {{Cl|_DEVICES}} - {{Cl|PRINT}} {{Cl|STR$}}(i) + ") " + {{Cl|_DEVICE$}}(i) + " Buttons:"; {{Cl|_LASTBUTTON}}(i); ",Axis:"; {{Cl|_LASTAXIS}}(i); ",Wheel:"; {{Cl|_LASTWHEEL}}(i) + {{Cl|PRINT}} {{Cl|STR$}}(i) + ") " + {{Cl|_DEVICE$}}(i) + " Buttons:"; {{Cl|_LASTBUTTON}}(i); ",Axis:"; {{Cl|_LASTAXIS}}(i); ",Wheel:"; {{Cl|_LASTWHEEL}}(i) {{Cl|NEXT}} {{Cl|DO...LOOP|DO}} d& = {{Cl|_DEVICEINPUT}} {{Cl|IF...THEN|IF}} d& {{Cl|THEN}} ' the device number cannot be zero! - {{Cl|PRINT}} "Found"; d&; + {{Cl|PRINT}} "Found"; d&; {{Cl|FOR...NEXT|FOR}} b = 1 {{Cl|TO}} {{Cl|_LASTBUTTON}}(d&) {{Cl|PRINT}} {{Cl|_BUTTONCHANGE}}(b); {{Cl|_BUTTON}}(b); {{Cl|NEXT}} @@ -46,7 +46,7 @@ The [[_WHEEL]] function returns the relative position of a specified wheel numbe {{CodeStart}} '' '' ignore = {{Cl|_MOUSEMOVEMENTX}} 'dummy call to put mouse into relative movement mode -{{Cl|PRINT}} "Move your mouse and/or your mouse wheel (ESC to exit)" +{{Cl|PRINT}} "Move your mouse and/or your mouse wheel (ESC to exit)" d = {{Cl|_DEVICES}} ' always read number of devices to enable device input DO: {{Cl|_LIMIT}} 30 'main loop @@ -67,4 +67,4 @@ DO: {{Cl|_LIMIT}} 30 'main loop * [[Controller Devices]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_WIDTH_(function).txt b/internal/help/_WIDTH_(function).txt index 1d48bd8a3..f7f6b8763 100644 --- a/internal/help/_WIDTH_(function).txt +++ b/internal/help/_WIDTH_(function).txt @@ -22,7 +22,7 @@ The [[_WIDTH (function)|_WIDTH]] function returns the width of an image handle o s& = {{Cl|_NEWIMAGE}}(800, 600, 256) SCREEN s& - Align 15, 5, s&, "This text is centered on the screen!" + Align 15, 5, s&, "This text is centered on the screen!" SUB Align (Tcolor, Trow, mode&, txt$) center& = {{Cl|_WIDTH (function)|_WIDTH}} (mode&) \ 2 'returns pixels in graphic modes @@ -46,4 +46,4 @@ The [[_WIDTH (function)|_WIDTH]] function returns the width of an image handle o * [[Bitmaps]] -{{PageNavigation}} \ No newline at end of file +{{PageNavigation}} diff --git a/internal/help/_glBindTexture.txt b/internal/help/_glBindTexture.txt index 2bf37f2ce..b5d4c55b9 100644 --- a/internal/help/_glBindTexture.txt +++ b/internal/help/_glBindTexture.txt @@ -54,4 +54,4 @@ The {{KW|_GL_TEXTURE_2D_MULTISAMPLE}} and {{KW|_GL_TEXTURE_2D_MULTISAMPLE_ARRAY} {{KW|_glActiveTexture}}, {{KW|_glDeleteTextures}}, {{KW|_glGenTextures}}, {{KW|_glGetTexParameter}}, {{KW|_glIsTexture}}, {{KW|_glTexParameter}} -{{PageCopyright}} \ No newline at end of file +{{PageCopyright}} diff --git a/internal/help/_glClear.txt b/internal/help/_glClear.txt index fe94f9fcd..475585f4b 100644 --- a/internal/help/_glClear.txt +++ b/internal/help/_glClear.txt @@ -53,4 +53,4 @@ If a buffer is not present, then a '''_glClear''' directed at that buffer has no * [[_glScissor]] -{{PageCopyright}} \ No newline at end of file +{{PageCopyright}} diff --git a/internal/help/_glClearColor.txt b/internal/help/_glClearColor.txt index 2f062168f..ab22f534e 100644 --- a/internal/help/_glClearColor.txt +++ b/internal/help/_glClearColor.txt @@ -31,4 +31,4 @@ The type of the {{Parameter|red}}, {{Parameter|green}}, {{Parameter|blue}}, and {{KW|_glClear}} -{{PageCopyright}} \ No newline at end of file +{{PageCopyright}} diff --git a/internal/help/_glClearDepth.txt b/internal/help/_glClearDepth.txt index 0501e8d7d..565daef16 100644 --- a/internal/help/_glClearDepth.txt +++ b/internal/help/_glClearDepth.txt @@ -31,4 +31,4 @@ The type of the {{Parameter|depth}} parameter was changed from GLclampf to GLflo {{KW|_glClear}} -{{PageCopyright}} \ No newline at end of file +{{PageCopyright}} diff --git a/internal/help/_glClearStencil.txt b/internal/help/_glClearStencil.txt index e2efbcaea..50126dbe2 100644 --- a/internal/help/_glClearStencil.txt +++ b/internal/help/_glClearStencil.txt @@ -29,4 +29,4 @@ {{KW|_glClear}} -{{PageCopyright}} \ No newline at end of file +{{PageCopyright}} diff --git a/internal/help/_glColorMask.txt b/internal/help/_glColorMask.txt index 33ec438d1..b9b9a1eba 100644 --- a/internal/help/_glColorMask.txt +++ b/internal/help/_glColorMask.txt @@ -37,4 +37,4 @@ Changes to individual bits of components cannot be controlled. Rather, changes a {{KW|_glClear}}, {{KW|_glClearBuffer}}, {{KW|_glDepthMask}}, {{KW|_glStencilMask}} -{{PageCopyright}} \ No newline at end of file +{{PageCopyright}} diff --git a/internal/help/_glCopyTexImage1D.txt b/internal/help/_glCopyTexImage1D.txt index 707c22a1c..5ac21f0b9 100644 --- a/internal/help/_glCopyTexImage1D.txt +++ b/internal/help/_glCopyTexImage1D.txt @@ -74,4 +74,4 @@ An image with 0 width indicates a NULL texture. {{KW|_glActiveTexture}}, {{KW|_glBindTexture}}, {{KW|_glBindFramebuffer}}, {{KW|_glCopyTexImage2D}}, {{KW|_glCopyImageSubData}}, {{KW|_glCopyTexSubImage1D}}, {{KW|_glCopyTexSubImage2D}}, {{KW|_glReadBuffer}} -{{PageCopyright}} \ No newline at end of file +{{PageCopyright}} diff --git a/internal/help/_glCopyTexImage2D.txt b/internal/help/_glCopyTexImage2D.txt index 1c994641d..8a3dbd995 100644 --- a/internal/help/_glCopyTexImage2D.txt +++ b/internal/help/_glCopyTexImage2D.txt @@ -73,4 +73,4 @@ An image with height or width of 0 indicates a NULL texture. {{KW|_glActiveTexture}}, {{KW|_glBindTexture}}, {{KW|_glBindFramebuffer}}, {{KW|_glCopyTexImage1D}}, {{KW|_glCopyImageSubData}}, {{KW|_glCopyTexSubImage1D}}, {{KW|_glCopyTexSubImage2D}}, {{KW|_glReadBuffer}} -{{PageCopyright}} \ No newline at end of file +{{PageCopyright}} diff --git a/internal/help/_glCopyTexSubImage1D.txt b/internal/help/_glCopyTexSubImage1D.txt index a22ea7f36..e8129a377 100644 --- a/internal/help/_glCopyTexSubImage1D.txt +++ b/internal/help/_glCopyTexSubImage1D.txt @@ -62,4 +62,4 @@ The {{KW|_glPixelStore}} mode affects texture images. {{KW|_glActiveTexture}}, {{KW|_glBindTexture}}, {{KW|_glBindFramebuffer}}, {{KW|_glCopyImageSubData}}, {{KW|_glCopyTexSubImage2D}}, {{KW|_glCopyTexSubImage3D}}, {{KW|_glCopyTexImage1D}}, {{KW|_glReadBuffer}} -{{PageCopyright}} \ No newline at end of file +{{PageCopyright}} diff --git a/internal/help/_glCopyTexSubImage2D.txt b/internal/help/_glCopyTexSubImage2D.txt index 6948297f4..2fe78436f 100644 --- a/internal/help/_glCopyTexSubImage2D.txt +++ b/internal/help/_glCopyTexSubImage2D.txt @@ -70,4 +70,4 @@ No change is made to the ''internalformat'', ''width'', ''height'', or ''border' {{KW|_glActiveTexture}}, {{KW|_glBindTexture}}, {{KW|_glBindFramebuffer}}, {{KW|_glCopyImageSubData}}, {{KW|_glCopyTexSubImage1D}}, {{KW|_glCopyTexSubImage3D}}, {{KW|_glCopyTexImage2D}}, {{KW|_glReadBuffer}} -{{PageCopyright}} \ No newline at end of file +{{PageCopyright}} diff --git a/internal/help/_glCullFace.txt b/internal/help/_glCullFace.txt index 36e4bdfd7..0c8a4db7f 100644 --- a/internal/help/_glCullFace.txt +++ b/internal/help/_glCullFace.txt @@ -41,4 +41,4 @@ If {{Parameter|mode}} is {{KW|_GL_FRONT_AND_BACK}}, no facets are drawn, but oth {{KW|_glEnable|(GL_CULL_FACE)}}, {{KW|_glFrontFace}} -{{PageCopyright}} \ No newline at end of file +{{PageCopyright}} diff --git a/internal/help/_glDeleteTextures.txt b/internal/help/_glDeleteTextures.txt index 1564f90a2..9f4c229c6 100644 --- a/internal/help/_glDeleteTextures.txt +++ b/internal/help/_glDeleteTextures.txt @@ -37,4 +37,4 @@ {{KW|_glBindTexture}}, {{KW|_glGenTextures}}, {{KW|_glIsTexture}} -{{PageCopyright}} \ No newline at end of file +{{PageCopyright}} diff --git a/internal/help/_glDepthFunc.txt b/internal/help/_glDepthFunc.txt index 0024b684d..27dc0ea45 100644 --- a/internal/help/_glDepthFunc.txt +++ b/internal/help/_glDepthFunc.txt @@ -59,4 +59,4 @@ Even if the depth buffer exists and the depth mask is non-zero, the depth buffer {{KW|_glEnable|(GL_DEPTH_TEST)}}, {{KW|_glDepthRange}}, {{KW|_glPolygonOffset}} -{{PageCopyright}} \ No newline at end of file +{{PageCopyright}} diff --git a/internal/help/_glDepthMask.txt b/internal/help/_glDepthMask.txt index 793efe81f..29b07ab46 100644 --- a/internal/help/_glDepthMask.txt +++ b/internal/help/_glDepthMask.txt @@ -32,4 +32,4 @@ Even if the depth buffer exists and the depth mask is non-zero, the depth buffer {{KW|_glColorMask}}, {{KW|_glClearBuffer}}, {{KW|_glDepthFunc}}, {{KW|_glDepthRange}}, {{KW|_glStencilMask}} -{{PageCopyright}} \ No newline at end of file +{{PageCopyright}} diff --git a/internal/help/_glDepthRange.txt b/internal/help/_glDepthRange.txt index 90e719206..327873f10 100644 --- a/internal/help/_glDepthRange.txt +++ b/internal/help/_glDepthRange.txt @@ -39,4 +39,4 @@ The type of the {{Parameter|nearVal}} and {{Parameter|farVal}} parameters was ch {{KW|_glDepthFunc}}, {{KW|_glDepthRangeArray}}, {{KW|_glDepthRangeIndexed}}, {{KW|_glPolygonOffset}}, {{KW|_glViewport}} -{{PageCopyright}} \ No newline at end of file +{{PageCopyright}} diff --git a/internal/help/_glDrawArrays.txt b/internal/help/_glDrawArrays.txt index 96a520aca..69fae096a 100644 --- a/internal/help/_glDrawArrays.txt +++ b/internal/help/_glDrawArrays.txt @@ -46,4 +46,4 @@ Vertex attributes that are modified by '''_glDrawArrays''' have an unspecified v {{KW|_glBindVertexArray}}, {{KW|_glDrawArraysIndirect}}, {{KW|_glDrawArraysInstanced}}, {{KW|_glDrawArraysInstancedBaseInstance}}, {{KW|_glMultiDrawArrays}}, {{KW|_glMultiDrawArraysIndirect}} -{{PageCopyright}} \ No newline at end of file +{{PageCopyright}} diff --git a/internal/help/_glDrawBuffer.txt b/internal/help/_glDrawBuffer.txt index 5feeb619b..5988f032a 100644 --- a/internal/help/_glDrawBuffer.txt +++ b/internal/help/_glDrawBuffer.txt @@ -58,4 +58,4 @@ Monoscopic contexts include only ''left'' buffers, and stereoscopic contexts inc {{KW|_glBindFramebuffer}}, {{KW|_glBlendFunc}}, {{KW|_glColorMask}}, {{KW|_glDrawBuffers}}, {{KW|_glLogicOp}} -{{PageCopyright}} \ No newline at end of file +{{PageCopyright}} diff --git a/internal/help/_glDrawElements.txt b/internal/help/_glDrawElements.txt index e9dbb9ade..b014064b8 100644 --- a/internal/help/_glDrawElements.txt +++ b/internal/help/_glDrawElements.txt @@ -48,4 +48,4 @@ Vertex attributes that are modified by '''_glDrawElements''' have an unspecified {{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}} -{{PageCopyright}} \ No newline at end of file +{{PageCopyright}} diff --git a/internal/help/_glEnable.txt b/internal/help/_glEnable.txt index cef86e4a3..b7ded5f04 100644 --- a/internal/help/_glEnable.txt +++ b/internal/help/_glEnable.txt @@ -137,4 +137,4 @@ In general, passing an indexed capability to '''_glEnable''' or '''_glDisable''' {{PageCopyright}} -Copyright 1991-2006 Silicon Graphics, Inc. Copyright 2010-2011 Khronos Group. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. \ No newline at end of file +Copyright 1991-2006 Silicon Graphics, Inc. Copyright 2010-2011 Khronos Group. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. diff --git a/internal/help/_glFinish.txt b/internal/help/_glFinish.txt index 63d7e2fd4..614f2a04e 100644 --- a/internal/help/_glFinish.txt +++ b/internal/help/_glFinish.txt @@ -26,4 +26,4 @@ {{PageCopyright}} -Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. \ No newline at end of file +Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. diff --git a/internal/help/_glFlush.txt b/internal/help/_glFlush.txt index cecab0ecb..989d255e6 100644 --- a/internal/help/_glFlush.txt +++ b/internal/help/_glFlush.txt @@ -28,4 +28,4 @@ Because any GL program might be executed over a network, or on an accelerator th {{PageCopyright}} -Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. \ No newline at end of file +Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. diff --git a/internal/help/_glFrontFace.txt b/internal/help/_glFrontFace.txt index d36906947..bf5e3fc1b 100644 --- a/internal/help/_glFrontFace.txt +++ b/internal/help/_glFrontFace.txt @@ -36,4 +36,4 @@ The projection of a polygon to window coordinates is said to have clockwise wind {{PageCopyright}} -Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. \ No newline at end of file +Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. diff --git a/internal/help/_glGenTextures.txt b/internal/help/_glGenTextures.txt index 1851a0e6f..ebc0d3524 100644 --- a/internal/help/_glGenTextures.txt +++ b/internal/help/_glGenTextures.txt @@ -40,4 +40,4 @@ Texture names returned by a call to '''_glGenTextures''' are not returned by sub {{PageCopyright}} -Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. \ No newline at end of file +Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. diff --git a/internal/help/_glGetError.txt b/internal/help/_glGetError.txt index a28e87ef7..540d14bde 100644 --- a/internal/help/_glGetError.txt +++ b/internal/help/_glGetError.txt @@ -39,4 +39,4 @@ When an error flag is set, results of a GL operation are undefined only if {{KW| {{PageCopyright}} -Copyright 1991-2006 Silicon Graphics, Inc. Copyright 2012 Khronos Group. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. \ No newline at end of file +Copyright 1991-2006 Silicon Graphics, Inc. Copyright 2012 Khronos Group. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. diff --git a/internal/help/_glGetString.txt b/internal/help/_glGetString.txt index 98ed3c810..2001cd8f4 100644 --- a/internal/help/_glGetString.txt +++ b/internal/help/_glGetString.txt @@ -69,4 +69,4 @@ The client and server may support different versions. '''_glGetString''' always {{PageCopyright}} -Copyright 1991-2006 Silicon Graphics, Inc. Copyright 2010 Khronos Group. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. \ No newline at end of file +Copyright 1991-2006 Silicon Graphics, Inc. Copyright 2010 Khronos Group. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. diff --git a/internal/help/_glGetTexImage.txt b/internal/help/_glGetTexImage.txt index 0e4acca4f..6bd768176 100644 --- a/internal/help/_glGetTexImage.txt +++ b/internal/help/_glGetTexImage.txt @@ -79,4 +79,4 @@ If an error is generated, no change is made to the contents of {{Parameter|img}} {{PageCopyright}} -Copyright 1991-2006 Silicon Graphics, Inc. Copyright 2010 Khronos Group. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. \ No newline at end of file +Copyright 1991-2006 Silicon Graphics, Inc. Copyright 2010 Khronos Group. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. diff --git a/internal/help/_glHint.txt b/internal/help/_glHint.txt index 94bd5d728..8ce497c6b 100644 --- a/internal/help/_glHint.txt +++ b/internal/help/_glHint.txt @@ -53,4 +53,4 @@ The interpretation of hints depends on the implementation. Some implementations {{PageCopyright}} -Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. \ No newline at end of file +Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. diff --git a/internal/help/_glIsEnabled.txt b/internal/help/_glIsEnabled.txt index bae98d9af..7b9ef149b 100644 --- a/internal/help/_glIsEnabled.txt +++ b/internal/help/_glIsEnabled.txt @@ -128,4 +128,4 @@ If an error is generated, '''_glIsEnabled''' and '''_glIsEnabledi''' return {{KW {{PageCopyright}} -Copyright 1991-2006 Silicon Graphics, Inc. Copyright 2010-2011 Khronos Group. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. \ No newline at end of file +Copyright 1991-2006 Silicon Graphics, Inc. Copyright 2010-2011 Khronos Group. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. diff --git a/internal/help/_glIsTexture.txt b/internal/help/_glIsTexture.txt index b225005fc..cda1266b8 100644 --- a/internal/help/_glIsTexture.txt +++ b/internal/help/_glIsTexture.txt @@ -26,4 +26,4 @@ A name returned by {{KW|_glGenTextures}}, but not yet associated with a texture {{PageCopyright}} -Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. \ No newline at end of file +Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. diff --git a/internal/help/_glLineWidth.txt b/internal/help/_glLineWidth.txt index 4ff9b18f5..f2254ee1c 100644 --- a/internal/help/_glLineWidth.txt +++ b/internal/help/_glLineWidth.txt @@ -57,4 +57,4 @@ In OpenGL 1.2, the tokens {{KW|_GL_LINE_WIDTH_RANGE}} and {{KW|_GL_LINE_WIDTH_GR {{PageCopyright}} -Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. \ No newline at end of file +Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. diff --git a/internal/help/_glLogicOp.txt b/internal/help/_glLogicOp.txt index 7007e8dd6..2880b5632 100644 --- a/internal/help/_glLogicOp.txt +++ b/internal/help/_glLogicOp.txt @@ -101,4 +101,4 @@ Logic operations have no effect on floating point draw buffers. However, if {{KW {{PageCopyright}} -Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. \ No newline at end of file +Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. diff --git a/internal/help/_glPointSize.txt b/internal/help/_glPointSize.txt index fc8de1d54..71a47b521 100644 --- a/internal/help/_glPointSize.txt +++ b/internal/help/_glPointSize.txt @@ -51,4 +51,4 @@ The point size specified by '''_glPointSize''' is always returned when {{KW|_GL_ {{PageCopyright}} -Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. \ No newline at end of file +Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. diff --git a/internal/help/_glPolygonMode.txt b/internal/help/_glPolygonMode.txt index d8cb3c565..371c8f74c 100644 --- a/internal/help/_glPolygonMode.txt +++ b/internal/help/_glPolygonMode.txt @@ -59,4 +59,4 @@ Vertices are marked as boundary or nonboundary with an edge flag. Edge flags are {{PageCopyright}} -Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. \ No newline at end of file +Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. diff --git a/internal/help/_glPolygonOffset.txt b/internal/help/_glPolygonOffset.txt index 2444e7546..464f74ec5 100644 --- a/internal/help/_glPolygonOffset.txt +++ b/internal/help/_glPolygonOffset.txt @@ -35,4 +35,4 @@ When {{KW|_GL_POLYGON_OFFSET_FILL}}, {{KW|_GL_POLYGON_OFFSET_LINE}}, or {{KW|_GL {{PageCopyright}} -Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. \ No newline at end of file +Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. diff --git a/internal/help/_glReadBuffer.txt b/internal/help/_glReadBuffer.txt index 98182813f..3c736f07e 100644 --- a/internal/help/_glReadBuffer.txt +++ b/internal/help/_glReadBuffer.txt @@ -44,4 +44,4 @@ For the default framebuffer, {{Parameter|mode}} is initially {{KW|_GL_FRONT}} in {{PageCopyright}} -Copyright 1991-2006 Silicon Graphics, Inc. Copyright 2011 Khronos Group. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. \ No newline at end of file +Copyright 1991-2006 Silicon Graphics, Inc. Copyright 2011 Khronos Group. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. diff --git a/internal/help/_glReadPixels.txt b/internal/help/_glReadPixels.txt index 083e476b4..118145384 100644 --- a/internal/help/_glReadPixels.txt +++ b/internal/help/_glReadPixels.txt @@ -198,4 +198,4 @@ If an error is generated, no change is made to the contents of {{Parameter|data} {{PageCopyright}} -Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. \ No newline at end of file +Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. diff --git a/internal/help/_glScissor.txt b/internal/help/_glScissor.txt index 2fac99238..4c2fa7981 100644 --- a/internal/help/_glScissor.txt +++ b/internal/help/_glScissor.txt @@ -42,4 +42,4 @@ When the scissor test is disabled, it is as though the scissor box includes the {{PageCopyright}} -Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. \ No newline at end of file +Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. diff --git a/internal/help/_glStencilFunc.txt b/internal/help/_glStencilFunc.txt index 03c51fc43..380359869 100644 --- a/internal/help/_glStencilFunc.txt +++ b/internal/help/_glStencilFunc.txt @@ -73,4 +73,4 @@ Initially, the stencil test is disabled. If there is no stencil buffer, no stenc {{PageCopyright}} -Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. \ No newline at end of file +Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. diff --git a/internal/help/_glStencilMask.txt b/internal/help/_glStencilMask.txt index 32e741a2c..7aa225c2b 100644 --- a/internal/help/_glStencilMask.txt +++ b/internal/help/_glStencilMask.txt @@ -36,4 +36,4 @@ There can be two separate {{Parameter|mask}} writemasks; one affects back-facing {{PageCopyright}} -Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. \ No newline at end of file +Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. diff --git a/internal/help/_glStencilOp.txt b/internal/help/_glStencilOp.txt index 366ebeb7f..4e2d1b9bb 100644 --- a/internal/help/_glStencilOp.txt +++ b/internal/help/_glStencilOp.txt @@ -73,4 +73,4 @@ Initially the stencil test is disabled. If there is no stencil buffer, no stenci {{PageCopyright}} -Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. \ No newline at end of file +Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. diff --git a/internal/help/_glTexImage1D.txt b/internal/help/_glTexImage1D.txt index 315fb20e3..bd6ac408c 100644 --- a/internal/help/_glTexImage1D.txt +++ b/internal/help/_glTexImage1D.txt @@ -132,4 +132,4 @@ Image-based shadowing can be enabled by comparing texture r coordinates to depth {{PageCopyright}} -Copyright 1991-2006 Silicon Graphics, Inc. Copyright 2011 Khronos Group. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. \ No newline at end of file +Copyright 1991-2006 Silicon Graphics, Inc. Copyright 2011 Khronos Group. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. diff --git a/internal/help/_glTexImage2D.txt b/internal/help/_glTexImage2D.txt index 153d155a6..74397bede 100644 --- a/internal/help/_glTexImage2D.txt +++ b/internal/help/_glTexImage2D.txt @@ -118,7 +118,9 @@ The {{KW|_glPixelStore}} mode affects texture images. {{KW|_GL_INVALID_OPERATION}} is generated if {{Parameter|type}} is one of {{KW|_GL_UNSIGNED_BYTE_3_3_2}}, {{KW|_GL_UNSIGNED_BYTE_2_3_3_REV}}, {{KW|_GL_UNSIGNED_SHORT_5_6_5}}, {{KW|_GL_UNSIGNED_SHORT_5_6_5_REV}}, or {{KW|_GL_UNSIGNED_INT_10F_11F_11F_REV}}, and {{Parameter|format}} is not {{KW|_GL_RGB}}. -{{KW|_GL_INVALID_OPERATION}} is generated if {{Parameter|type}} is one of {{KW|_GL_UNSIGNED_SHORT_4_4_4_4}}, {{KW|_GL_UNSIGNED_SHORT_4_4_4_4_REV}}, {{KW|_GL_UNSIGNED_SHORT_5_5_5_1}}, {{KW|_GL_UNSIGNED_SHORT_1_5_5_5_REV}}, {{KW|_GL_UNSIGNED_INT_8_8_8_8}}, {{KW|_GL_UNSIGNED_INT_8_8_8_8_REV}}, {{KW|_GL_UNSIGNED_INT_10_10_10_2}}, {{KW|_GL_UNSIGNED_INT_2_10_10_10_REV}}, or {{KW|_GL_UNSIGNED_INT_5_9_9_9_REV}}, and {{Parameter|format}} is neither {{KW|_GL_RGBA}} nor {{KW|_GL_BGRA}}. +{{KW|_GL_INVALID_OPERATION}} is generated if {{Parameter|type}} is one of {{KW|_GL_UNSIGNED_SHORT_4_4_4_4}}, {{KW|_GL_UNSIGNED_SHORT_4_4_4_4_REV}}, {{KW +3528 +|_GL_UNSIGNED_SHORT_5_5_5_1}}, {{KW|_GL_UNSIGNED_SHORT_1_5_5_5_REV}}, {{KW|_GL_UNSIGNED_INT_8_8_8_8}}, {{KW|_GL_UNSIGNED_INT_8_8_8_8_REV}}, {{KW|_GL_UNSIGNED_INT_10_10_10_2}}, {{KW|_GL_UNSIGNED_INT_2_10_10_10_REV}}, or {{KW|_GL_UNSIGNED_INT_5_9_9_9_REV}}, and {{Parameter|format}} is neither {{KW|_GL_RGBA}} nor {{KW|_GL_BGRA}}. {{KW|_GL_INVALID_OPERATION}} is generated if {{Parameter|target}} is not {{KW|_GL_TEXTURE_2D}}, {{KW|_GL_PROXY_TEXTURE_2D}}, {{KW|_GL_TEXTURE_RECTANGLE}}, or {{KW|_GL_PROXY_TEXTURE_RECTANGLE}}, and {{Parameter|internalFormat}} is {{KW|_GL_DEPTH_COMPONENT}}, {{KW|_GL_DEPTH_COMPONENT16}}, {{KW|_GL_DEPTH_COMPONENT24}}, or {{KW|_GL_DEPTH_COMPONENT32F}}. @@ -152,4 +154,4 @@ The {{KW|_glPixelStore}} mode affects texture images. {{PageCopyright}} -Copyright 1991-2006 Silicon Graphics, Inc. Copyright 2011 Khronos Group. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. \ No newline at end of file +Copyright 1991-2006 Silicon Graphics, Inc. Copyright 2011 Khronos Group. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. diff --git a/internal/help/_glTexSubImage1D.txt b/internal/help/_glTexSubImage1D.txt index e62982df9..ceaf77dc2 100644 --- a/internal/help/_glTexSubImage1D.txt +++ b/internal/help/_glTexSubImage1D.txt @@ -78,4 +78,4 @@ If a non-zero named buffer object is bound to the {{KW|_GL_PIXEL_UNPACK_BUFFER}} {{PageCopyright}} -Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. \ No newline at end of file +Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. diff --git a/internal/help/_glTexSubImage2D.txt b/internal/help/_glTexSubImage2D.txt index a4e539bc4..e819481e7 100644 --- a/internal/help/_glTexSubImage2D.txt +++ b/internal/help/_glTexSubImage2D.txt @@ -82,4 +82,4 @@ If a non-zero named buffer object is bound to the {{KW|_GL_PIXEL_UNPACK_BUFFER}} {{PageCopyright}} -Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. \ No newline at end of file +Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. diff --git a/internal/help/_glViewport.txt b/internal/help/_glViewport.txt index 6e2891420..94266e9e0 100644 --- a/internal/help/_glViewport.txt +++ b/internal/help/_glViewport.txt @@ -42,4 +42,4 @@ Viewport width and height are silently clamped to a range that depends on the im {{PageCopyright}} -Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. \ No newline at end of file +Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/]. diff --git a/internal/help/links.bin b/internal/help/links.bin index 1849081be..c0b0e7d90 100644 --- a/internal/help/links.bin +++ b/internal/help/links.bin @@ -1,5 +1,7 @@ +_ACCEPTFILEDROP,_ACCEPTFILEDROP _ACOS,_ACOS _ACOSH,_ACOSH +_ALLOWFULLSCREEN,_ALLOWFULLSCREEN _ALPHA,_ALPHA _ALPHA32,_ALPHA32 _ARCCOT,Mathematical_Operations @@ -72,6 +74,8 @@ _DISPLAY,_DISPLAY (function) _DISPLAYORDER,_DISPLAYORDER _DONTBLEND,_DONTBLEND _DONTWAIT,_DONTWAIT +_DROPPEDFILE,_DROPPEDFILE +_ECHO,_ECHO $ELSE,$ELSE $ELSEIF,$ELSEIF $END,$END IF @@ -79,6 +83,7 @@ _ERRORLINE,_ERRORLINE $EXEICON,$EXEICON _EXIT,_EXIT (function) _FILEEXISTS,_FILEEXISTS +_FINISHDROP,_FINISHDROP _FLOAT,_FLOAT _FONT,_FONT _FONT,_FONT (function) @@ -100,6 +105,7 @@ $IF,$IF _ICON,_ICON _INCLERRORFILE$,_INCLERRORFILE$ _INCLERRORLINE,_INCLERRORLINE +_INSTRREV,_INSTRREV _INTEGER64,_INTEGER64 _KEYCLEAR,_KEYCLEAR _KEYHIT,_KEYHIT @@ -188,6 +194,8 @@ _SCREENX,_SCREENX _SCREENY,_SCREENY _SETALPHA,_SETALPHA _SHELLHIDE,_SHELLHIDE +_SHL,_SHL +_SHR,_SHR _SINH,Mathematical_Operations _SNDBAL,_SNDBAL _SNDCLOSE,_SNDCLOSE @@ -219,6 +227,8 @@ _STRICMP,_STRICMP _TANH,Mathematical_Operations _TITLE,_TITLE _TITLE$,_TITLE$ +_TOTALDROPPEDFILES,_TOTALDROPPEDFILES +_TRIM$,_TRIM$ _UNSIGNED,_UNSIGNED $VERSIONINFO,$VERSIONINFO $VIRTUALKEYBOARD,$VIRTUALKEYBOARD @@ -749,157 +759,277 @@ _glRasterPos3sv,_glRasterPos3sv _glRasterPos4d,_glRasterPos4d _glRasterPos4dv,_glRasterPos4dv _glRasterPos4f,_glRasterPos4f -_glRasterPos4fv,_glRasterPos4fv +_glRasterPos4fv],_glRasterPos4fv] +_glRasterPos4i, +, +_glRasterPos4iv,tatement) {{text +_glRasterPos4s,_glRasterPos4i _glRasterPos4i,_glRasterPos4i +_glRasterPos4sv,_glRasterPos4iv _glRasterPos4iv,_glRasterPos4iv +_glReadBuffer,_glRasterPos4s _glRasterPos4s,_glRasterPos4s +_glReadPixels,_glRasterPos4sv _glRasterPos4sv,_glRasterPos4sv +_glRectd,_glReadBuffer _glReadBuffer,_glReadBuffer +_glRectdv,_glReadPixels _glReadPixels,_glReadPixels +_glRectf,_glRectd _glRectd,_glRectd +_glRectfv,_glRectdv _glRectdv,_glRectdv +_glRecti,_glRectf _glRectf,_glRectf +_glRectiv,_glRectfv _glRectfv,_glRectfv +_glRects,_glRecti _glRecti,_glRecti +_glRectsv,_glRectiv _glRectiv,_glRectiv +_GLRENDER,_glRects _glRects,_glRects +_glRenderMode,_glRectsv _glRectsv,_glRectsv +_glRotated,_GLRENDER _GLRENDER,_GLRENDER +_glRotatef,_glRenderMode _glRenderMode,_glRenderMode +_glScaled,_glRotated _glRotated,_glRotated +_glScalef,_glRotatef _glRotatef,_glRotatef +_glScissor,_glScaled _glScaled,_glScaled +_glSelectBuffer,_glScalef _glScalef,_glScalef +_glShadeModel,_glScissor _glScissor,_glScissor +_glStencilFunc,_glSelectBuffer _glSelectBuffer,_glSelectBuffer +_glStencilMask,_glShadeModel _glShadeModel,_glShadeModel +_glStencilOp,_glStencilFunc _glStencilFunc,_glStencilFunc +_glTexCoord1d,_glStencilMask _glStencilMask,_glStencilMask +_glTexCoord1dv,_glStencilOp _glStencilOp,_glStencilOp +_glTexCoord1f,_glTexCoord1d _glTexCoord1d,_glTexCoord1d +_glTexCoord1fv,_glTexCoord1dv _glTexCoord1dv,_glTexCoord1dv +_glTexCoord1i,_glTexCoord1f _glTexCoord1f,_glTexCoord1f +_glTexCoord1iv,_glTexCoord1fv _glTexCoord1fv,_glTexCoord1fv +_glTexCoord1s,_glTexCoord1i _glTexCoord1i,_glTexCoord1i +_glTexCoord1sv,_glTexCoord1iv _glTexCoord1iv,_glTexCoord1iv +_glTexCoord2d,_glTexCoord1s _glTexCoord1s,_glTexCoord1s +_glTexCoord2dv,_glTexCoord1sv _glTexCoord1sv,_glTexCoord1sv +_glTexCoord2f,_glTexCoord2d _glTexCoord2d,_glTexCoord2d +_glTexCoord2fv,_glTexCoord2dv _glTexCoord2dv,_glTexCoord2dv +_glTexCoord2i,_glTexCoord2f _glTexCoord2f,_glTexCoord2f +_glTexCoord2iv,_glTexCoord2fv _glTexCoord2fv,_glTexCoord2fv +_glTexCoord2s,_glTexCoord2i _glTexCoord2i,_glTexCoord2i +_glTexCoord2sv,_glTexCoord2iv _glTexCoord2iv,_glTexCoord2iv +_glTexCoord3d,_glTexCoord2s _glTexCoord2s,_glTexCoord2s +_glTexCoord3dv,_glTexCoord2sv _glTexCoord2sv,_glTexCoord2sv +_glTexCoord3f,_glTexCoord3d _glTexCoord3d,_glTexCoord3d +_glTexCoord3fv,_glTexCoord3dv _glTexCoord3dv,_glTexCoord3dv +_glTexCoord3i,_glTexCoord3f _glTexCoord3f,_glTexCoord3f +_glTexCoord3iv,_glTexCoord3fv _glTexCoord3fv,_glTexCoord3fv +_glTexCoord3s,_glTexCoord3i _glTexCoord3i,_glTexCoord3i +_glTexCoord3sv,_glTexCoord3iv _glTexCoord3iv,_glTexCoord3iv +_glTexCoord4d,_glTexCoord3s _glTexCoord3s,_glTexCoord3s +_glTexCoord4dv,_glTexCoord3sv _glTexCoord3sv,_glTexCoord3sv +_glTexCoord4f,_glTexCoord4d _glTexCoord4d,_glTexCoord4d +_glTexCoord4fv,_glTexCoord4dv _glTexCoord4dv,_glTexCoord4dv +_glTexCoord4i,_glTexCoord4f _glTexCoord4f,_glTexCoord4f +_glTexCoord4iv,_glTexCoord4fv _glTexCoord4fv,_glTexCoord4fv +_glTexCoord4s,_glTexCoord4i _glTexCoord4i,_glTexCoord4i +_glTexCoord4sv,_glTexCoord4iv _glTexCoord4iv,_glTexCoord4iv +_glTexCoordPointer,_glTexCoord4s _glTexCoord4s,_glTexCoord4s +_glTexEnvf,_glTexCoord4sv _glTexCoord4sv,_glTexCoord4sv +_glTexEnvfv,_glTexCoordPointer _glTexCoordPointer,_glTexCoordPointer +_glTexEnvi,_glTexEnvf _glTexEnvf,_glTexEnvf +_glTexEnviv,_glTexEnvfv _glTexEnvfv,_glTexEnvfv +_glTexGend,_glTexEnvi _glTexEnvi,_glTexEnvi +_glTexGendv,_glTexEnviv _glTexEnviv,_glTexEnviv +_glTexGenf,_glTexGend _glTexGend,_glTexGend +_glTexGenfv,_glTexGendv _glTexGendv,_glTexGendv +_glTexGeni,_glTexGenf _glTexGenf,_glTexGenf +_glTexGeniv,_glTexGenfv _glTexGenfv,_glTexGenfv +_glTexImage1D,_glTexGeni _glTexGeni,_glTexGeni +_glTexImage2D,_glTexGeniv _glTexGeniv,_glTexGeniv +_glTexParameterf,_glTexImage1D _glTexImage1D,_glTexImage1D +_glTexParameterfv,_glTexImage2D _glTexImage2D,_glTexImage2D +_glTexParameteri,_glTexParameterf _glTexParameterf,_glTexParameterf +_glTexParameteriv,_glTexParameterfv _glTexParameterfv,_glTexParameterfv +_glTexSubImage1D,_glTexParameteri _glTexParameteri,_glTexParameteri +_glTexSubImage2D,_glTexParameteriv _glTexParameteriv,_glTexParameteriv +_glTranslated,_glTexSubImage1D _glTexSubImage1D,_glTexSubImage1D +_glTranslatef,_glTexSubImage2D _glTexSubImage2D,_glTexSubImage2D +_glVertex2d,_glTranslated _glTranslated,_glTranslated +_glVertex2dv,_glTranslatef _glTranslatef,_glTranslatef +_glVertex2f,_glVertex2d _glVertex2d,_glVertex2d +_glVertex2fv,_glVertex2dv _glVertex2dv,_glVertex2dv +_glVertex2i,_glVertex2f _glVertex2f,_glVertex2f +_glVertex2iv,_glVertex2fv _glVertex2fv,_glVertex2fv +_glVertex2s,_glVertex2i _glVertex2i,_glVertex2i +_glVertex2sv,_glVertex2iv _glVertex2iv,_glVertex2iv +_glVertex3d,_glVertex2s _glVertex2s,_glVertex2s +_glVertex3dv,_glVertex2sv _glVertex2sv,_glVertex2sv +_glVertex3f,_glVertex3d _glVertex3d,_glVertex3d +_glVertex3fv,_glVertex3dv _glVertex3dv,_glVertex3dv +_glVertex3i,_glVertex3f _glVertex3f,_glVertex3f +_glVertex3iv,_glVertex3fv _glVertex3fv,_glVertex3fv +_glVertex3s,_glVertex3i _glVertex3i,_glVertex3i +_glVertex3sv,_glVertex3iv _glVertex3iv,_glVertex3iv +_glVertex4d,_glVertex3s _glVertex3s,_glVertex3s +_glVertex4dv,_glVertex3sv _glVertex3sv,_glVertex3sv +_glVertex4f,_glVertex4d _glVertex4d,_glVertex4d +_glVertex4fv,_glVertex4dv _glVertex4dv,_glVertex4dv +_glVertex4i,_glVertex4f _glVertex4f,_glVertex4f +_glVertex4iv,_glVertex4fv _glVertex4fv,_glVertex4fv +_glVertex4s,_glVertex4i _glVertex4i,_glVertex4i +_glVertex4sv,_glVertex4iv _glVertex4iv,_glVertex4iv +_glVertexPointer,_glVertex4s _glVertex4s,_glVertex4s +_glViewport,_glVertex4sv _glVertex4sv,_glVertex4sv +;,_glVertexPointer _glVertexPointer,_glVertexPointer -_glViewport,_glViewport -;,Semicolon -",Quotation mark -?,Question mark -',Apostrophe -:,Colon -$,Dollar_Sign -,Parenthesis +",comma +?,INPUT +INPUT,INPUT +',Question mark +:,SUB +SUB,SUB +$,FUNCTION +FUNCTION,FUNCTION +,Dollar_Sign ++,SUB +SUB,SUB +",+ +,+ -",Quotation mark -_,Underscore +_,CHR$ +CHR$,CHR$ $,STRING STRING,STRING -!,SINGLE +!,Underscore +#,STRING +STRING,STRING +##,SINGLE SINGLE,SINGLE -#,DOUBLE +~,DOUBLE DOUBLE,DOUBLE -##,_FLOAT -_FLOAT,_FLOAT -~,_UNSIGNED +%,_UNSIGNED _UNSIGNED,_UNSIGNED -%,INTEGER +&,INTEGER INTEGER,INTEGER -&,LONG +&&,LONG LONG,LONG -&&,_INTEGER64 +`,_INTEGER64 _INTEGER64,_INTEGER64 -`,_BIT -_BIT,_BIT -%%,_BYTE +%%,INTEGER +INTEGER,INTEGER +%&,_BYTE _BYTE,_BYTE -%&,_OFFSET +&B,_OFFSET _OFFSET,_OFFSET +&O,INTEGER +INTEGER,INTEGER +&H,&B &B,&B -&O,&O ++,&H &H,&H +-,Mathematical Operations +*,+ +,+ +/,- -,- +\,* *,* +^,/ /,/ +MOD,\ \,\ -^,^ +=,MOD MOD,MOD -=,Equal -<>,Not_Equal ->,Greater_Than -<,Less_Than ->=,Greater_Than_Or_Equal -<=,Less_Than_Or_Equal +<>,Relational Operations +>,Equal +<,Not_Equal +>=,Greater_Than +<=,Less_Than