diff --git a/internal/help/$ASSERTS.txt b/internal/help/$ASSERTS.txt deleted file mode 100644 index 5eb211879..000000000 --- a/internal/help/$ASSERTS.txt +++ /dev/null @@ -1,46 +0,0 @@ -The [[$ASSERTS]] metacommand enables debug tests with the [[_ASSERT]] macro. - - -{{PageSyntax}} -:[[$ASSERTS]] -:[[$ASSERTS]]:CONSOLE - - -{{PageDescription}} -* If an error message is passed to the [[_ASSERT]] statement, it is displayed in the console window if [[$ASSERTS|$ASSERTS:CONSOLE]] is used. - - -==Availability== -* '''Version 1.4 and up'''. - - -{{PageExamples}} -''Example:'' Adding test checks for parameter inputs in a function. -{{CodeStart}} -{{Cl|$ASSERTS}}:CONSOLE - -{{Cl|DO}} - a = {{Cl|INT}}({{Cl|RND}} * 10) - b$ = myFunc$(a) - {{Cl|PRINT}} a, , b$ - {{Cl|_LIMIT}} 3 -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|_KEYHIT}} - -{{Cl|FUNCTION}} myFunc$ (value {{Cl|AS}} {{Cl|SINGLE}}) - {{Cl|_ASSERT}} value > 0, "Value cannot be zero" - {{Cl|_ASSERT}} value <= 10, "Value cannot exceed 10" - - {{Cl|IF}} value > 1 {{Cl|THEN}} plural$ = "s" - myFunc$ = {{Cl|STRING$}}(value, "*") + {{Cl|STR$}}(value) + " star" + plural$ + " :-)" -{{Cl|END}} {{Cl|FUNCTION}} -{{CodeEnd}} - - -{{PageSeeAlso}} -* [[_ASSERT]] -* [[$CHECKING]] -* [[Relational Operations]] - - -{{PageNavigation}} -< diff --git a/internal/help/$ASSERTS_$1111111.txt b/internal/help/$ASSERTS_$1111111.txt new file mode 100644 index 000000000..71caabf3e --- /dev/null +++ b/internal/help/$ASSERTS_$1111111.txt @@ -0,0 +1,53 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:28}} +This metacommand enables debug tests with the [[_ASSERT]] statement. + + +{{PageSyntax}} +:[[$ASSERTS]][:CONSOLE] + + +{{PageDescription}} +* The metacommand does not require a comment or [[REM]] before it. There is no space after the colon. +* If this metacommand is used in a program and any of the set [[_ASSERT]] checkpoints will fail, then the program will stop with an '''{{Text|_ASSERT failed|#fc5454}}''' error. +* Detailed error messages passed to the [[_ASSERT]] statement will be displayed in the console window, but only if [[$ASSERTS|$ASSERTS:CONSOLE]] is used. + +;Note: This metacommand is the main switch to enable debug tests during development. Later just remove this metacommand to compile the program without debugging code, all the [[_ASSERT]] statements may remain in the code for later debugging sessions, they are simply ignored without this metacommand. + + +{{PageAvailability}} +* '''QB64 1.4 and up''' (QB64 Team) +* '''QBPE 0.5 and up''' (QB64 Phoenix Edition) + + +{{PageExamples}} +;Example:Adding test checks for parameter inputs in a function. +{{CodeStart}} +{{Cl|$ASSERTS}}:CONSOLE + +{{Cl|DO}} + a = {{Cl|INT}}({{Cl|RND}} * 10) + b$ = myFunc$(a) + {{Cl|PRINT}} a, , b$ + {{Cl|_LIMIT}} 3 +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|_KEYHIT}} + +{{Cl|FUNCTION}} myFunc$ (value {{Cl|AS}} {{Cl|SINGLE}}) + {{Cl|_ASSERT}} value > 0, "Value cannot be zero" + {{Cl|_ASSERT}} value <= 10, "Value cannot exceed 10" + + {{Cl|IF}} value > 1 {{Cl|THEN}} plural$ = "s" + myFunc$ = {{Cl|STRING$}}(value, "*") + {{Cl|STR$}}(value) + " star" + plural$ + " :-)" +{{Cl|END}} {{Cl|FUNCTION}} +{{CodeEnd}} + + +{{PageSeeAlso}} +* [[_ASSERT]] +* [[$CHECKING]] +* [[Relational Operations]] +* [[ERROR Codes]] + + +{{PageNavigation}} + diff --git a/internal/help/$CHECKING.txt b/internal/help/$CHECKING_$11111111.txt similarity index 96% rename from internal/help/$CHECKING.txt rename to internal/help/$CHECKING_$11111111.txt index 671eb9119..980126c3d 100644 --- a/internal/help/$CHECKING.txt +++ b/internal/help/$CHECKING_$11111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:53}} The [[$CHECKING]] metacommand turns C++ event checking ON or OFF. @@ -24,4 +26,4 @@ The [[$CHECKING]] metacommand turns C++ event checking ON or OFF. {{PageNavigation}} -< + diff --git a/internal/help/$COLOR.txt b/internal/help/$COLOR.txt deleted file mode 100644 index 391ef62ab..000000000 --- a/internal/help/$COLOR.txt +++ /dev/null @@ -1,41 +0,0 @@ -[[$COLOR]] is a metacommand that adds named color [[CONST|constants]] in a program. - - -{{PageSyntax}} -: [[$COLOR]]:0 -: [[$COLOR]]:32 - - -{{PageDescription}} -* [[$COLOR]]:0 adds [[CONST|constants]] for colors 0-15. The actual constant names can be found in the file '''source/utilities/color0.bi'''. -* [[$COLOR]]:32 adds [[CONST|constants]] for 32-bit colors, similar to HTML color names. The actual constant names can be found in the file '''source/utilities/color32.bi'''. -* [[$COLOR]] is a shorthand to manually using [[$INCLUDE]] pointing to the files listed above. -* Not compatible with [[$NOPREFIX]]. - - -{{PageExamples}} -''Example 1:'' Adding named color constants for SCREEN 0: -{{CodeStart}} -{{Cl|$COLOR}}:0 -{{Cl|COLOR}} BrightWhite, Red -{{Cl|PRINT}} "Bright white on red." - {{CodeEnd}} - - -''Example 2:'' Adding named color constants for 32-bit modes: -{{CodeStart}} -{{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(640, 400, 32) -{{Cl|$COLOR}}:32 -{{Cl|COLOR}} CrayolaGold, DarkCyan -{{Cl|PRINT}} "CrayolaGold on DarkCyan." - {{CodeEnd}} - - -{{PageSeeAlso}} -* [[COLOR]], [[SCREEN]] -* [[_NEWIMAGE]], [[$INCLUDE]] -* [[Metacommand]] - - -{{PageNavigation}} -< diff --git a/internal/help/$COLOR_$11111.txt b/internal/help/$COLOR_$11111.txt new file mode 100644 index 000000000..6e83764d9 --- /dev/null +++ b/internal/help/$COLOR_$11111.txt @@ -0,0 +1,61 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:06}} +[[$COLOR]] is a metacommand that adds named color [[CONST|constants]] in a program. + + +{{PageSyntax}} +: [[$COLOR]]:0 +: [[$COLOR]]:32 + + +{{PageDescription}} +* [[$COLOR]]:0 adds [[CONST|constants]] for colors 0-15. The actual constant names can be found in the file '''source/utilities/color0.bi'''. +* [[$COLOR]]:32 adds [[CONST|constants]] for 32-bit colors, similar to HTML color names. The actual constant names can be found in the file '''source/utilities/color32.bi'''. +* [[$COLOR]] is a shorthand to manually using [[$INCLUDE]] pointing to the files listed above. +* Prior to QBPE v0.5 (ό), [[$COLOR]] was not compatible with [[$NOPREFIX]]. +* Since QBPE v0.5, [[$COLOR]] can now be used with [[$NOPREFIX]], with a few notable differences to three conflicting colors -- Red, Green, Blue. + +:Red would conflict with [[_RED]], Green would conflict with [[_GREEN]], and Blue would conflict with [[_BLUE]], once the underscore was removed from those commands with [[$NOPREFIX]]. +: +:To prevent these conflicts, the [[COLOR]] values have had '''NP_''' prepended to the front of them, to distinguish them from the non-prefixed command names. All other color names remain the same, with only the three colors in conflict having to use '''NP_''' (for '''N'''o '''P'''refix) in front of them. +(ό) QBPE = QB64 Phoenix Edition + + +{{PageExamples}} +;Example 1:Adding named color constants for SCREEN 0. +{{CodeStart}} +{{Cl|$COLOR}}:0 +{{Cl|COLOR}} BrightWhite, Red +{{Cl|PRINT}} "Bright white on red." +{{CodeEnd}} +{{OutputStartBG4}} +{{Text|Bright white on red.|#fcfcfc}} +{{OutputEnd}} + +;Example 2:Adding named color constants for 32-bit modes. +{{CodeStart}} +{{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(640, 400, 32) +{{Cl|$COLOR}}:32 +{{Cl|COLOR}} CrayolaGold, DarkCyan +{{Cl|PRINT}} "CrayolaGold on DarkCyan." +{{CodeEnd}} + +;Example 3:Adding named color constants for 32-bit modes (with $NOPREFIX in effect). +{{CodeStart}} +{{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(640, 400, 32) +{{Cl|$COLOR}}:32 +{{Cl|$NOPREFIX}} +{{Cl|COLOR}} NP_Red, White 'notice the NP_ in front of Red? +'This is to distinguish the color from the command with $NOPREFIX. +{{Cl|PRINT}} "Red on White." +{{CodeEnd}} + + +{{PageSeeAlso}} +* [[COLOR]], [[SCREEN]] +* [[_NEWIMAGE]], [[$INCLUDE]] +* [[Metacommand]] + + +{{PageNavigation}} + diff --git a/internal/help/$CONSOLE.txt b/internal/help/$CONSOLE_$1111111.txt similarity index 87% rename from internal/help/$CONSOLE.txt rename to internal/help/$CONSOLE_$1111111.txt index d525ae658..42e8a09fa 100644 --- a/internal/help/$CONSOLE.txt +++ b/internal/help/$CONSOLE_$1111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:11}} The [[$CONSOLE]] [[Metacommand]] creates a console window that can be used throughout a QB64 program module. @@ -10,7 +12,7 @@ The [[$CONSOLE]] [[Metacommand]] creates a console window that can be used throu * [[_DEST]] [[_CONSOLE]] may be used to send screen output to the console window. * [[_SCREENHIDE]] and [[_SCREENSHOW]] can be used to hide or show the main program window. * [[_DELAY]] or [[SLEEP]] can be used to allow the console window to be set in front of the main program window. -* '''QB64 [[Metacommand]]s are not commented out with ' or REM, differently from Qbasic metacommands''' +* '''QB64 [[Metacommand]]s are not commented out with ' or REM, unlike QuickBASIC metacommands''' * Change the title of the [[$CONSOLE]] windows created using [[_CONSOLETITLE]] * '''Note:''' Text can be copied partially or totally from console screens in Windows by highlighting and using the title bar menu. :: To copy console text output, right click the title bar and select ''Edit'' for ''Mark'' to highlight and repeat to ''Copy'' @@ -18,7 +20,7 @@ The [[$CONSOLE]] [[Metacommand]] creates a console window that can be used throu {{PageExamples}} ''Example 1:'' Hiding and displaying a console window. Use [[_DELAY]] to place console in front of main program window. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|$CONSOLE}} {{Cl|_DELAY}} 4 @@ -27,28 +29,28 @@ 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}} ''Example 2:'' How to use a Console window to copy screen output using the ''Edit'' menu by right clicking the console title bar. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|$CONSOLE}} {{Cl|_DEST}} {{Cl|_CONSOLE}} -c&& = -1: d& = -1: e% = -1: f%% = -1 +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$) -hx$ = {{Cl|HEX$}}(d&) -{{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|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$) +hx$ = {{Cl|HEX$}}(c&&) +{{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" 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 @@ -74,4 +76,4 @@ Max hex _INTEGER64 = FFFFFFFFFFFFFFFF with 16 digits =-1 {{PageNavigation}} -< + diff --git a/internal/help/$DEBUG.txt b/internal/help/$DEBUG.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/$DEBUG.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/$DEBUG_$11111.txt b/internal/help/$DEBUG_$11111.txt new file mode 100644 index 000000000..762218eab --- /dev/null +++ b/internal/help/$DEBUG_$11111.txt @@ -0,0 +1,44 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:28}} +'''$DEBUG''' is precompiler [[Metacommand|metacommand]], which enables debugging features, allowing you to step through your code running line by line and to inspect variables and change their values in real time. + + +{{PageSyntax}} +:[[$DEBUG]] + + +{{PageDescription}} +* '''$DEBUG''' injects extra code in the resulting binary, allowing the IDE to control the execution flow of your program. +* When '''$DEBUG''' is used, the IDE will connect to your running program using a local TCP/IP connection. +** You may get a prompt from your Operating System regarding this, so it may be necessary to allow the IDE to receive connections. +** No external connections are created, and your running program will only attempt to connect locally to the IDE. +* The default TCP/IP port starts at 9001. Multiple running instances of the IDE will attempt to open ports 9002 and up. +** You can change the base port in the Debug menu. +* The metacommand is supposed to be removed once your program is ready for release, although leaving it in won't have any effect if your program isn't run from the IDE. +** The only drawback of leaving the metacommand in is that your binary will end up being larger than required. + +== $DEBUG Mode Operation == +* To start execution in pause mode, you can use '''F7''' or '''F8'''. +* There will be an arrow next to the line number where execution is paused, indicating the next line that will be run. +* When you enable '''$DEBUG''' mode, you can set breakpoints by clicking the line number at which you wish to stop execution. This can also be achieved by using the '''F9''' key. +** Breakpoints are indicated by a red dot next to the line number. +** To clear all breakpoints, hit '''F10'''. +* To skip a line during execution, shift-click a line number +** Lines marked for skipping are indicated by an exclamation mark next to the line number. +* '''F4''' opens the Variable List dialog, which allows you to add variables to the Watch List. +* During execution, the Variable List dialog also allows you to set the values of variables and also to create Watchpoints. +* Watchpoints halt execution, similarly to breakpoints, but do so when a variable matches the condition you specify. +** You can use relational operators (=, <>, >=, <=, >, <) to create watchpoint conditions. +* After a breakpoint or a watchpoint is reached, '''F5''' can be used to continue execution. +* '''F6''' can be used when the execution pointer is inside a sub/function. When used, execution will proceed until the procedure is ended. +* '''F7''' can be used to run line by line, and can be used to debug code inside subs/functions (Step Into). +* '''F8''' can be used to run line by line without entering sub/function calls (Step Over). +* '''F12''' can be used to show the current call stack (which procedure calls led to the current line). + + +{{PageSeeAlso}} +* [[Metacommand]]s + + +{{PageNavigation}} + diff --git a/internal/help/$DYNAMIC.txt b/internal/help/$DYNAMIC_$1111111.txt similarity index 95% rename from internal/help/$DYNAMIC.txt rename to internal/help/$DYNAMIC_$1111111.txt index e8b529757..007815cfd 100644 --- a/internal/help/$DYNAMIC.txt +++ b/internal/help/$DYNAMIC_$1111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:56}} The [[$DYNAMIC]] [[Metacommand|metacommand]] allows the creation of dynamic (changeable) arrays. @@ -16,7 +18,7 @@ The [[$DYNAMIC]] [[Metacommand|metacommand]] allows the creation of dynamic (cha {{PageExamples}} ''Example:'' [[REDIM]]ing a $DYNAMIC array using [[_PRESERVE]] to retain previous array values. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|REM}} {{Cl|$DYNAMIC}} 'create dynamic arrays only {{Cl|DIM}} array(10) 'create array with 11 elements {{Cl|FOR...NEXT|FOR}} i = 0 {{Cl|TO}} 10 @@ -27,7 +29,7 @@ The [[$DYNAMIC]] [[Metacommand|metacommand]] allows the creation of dynamic (cha {{Cl|FOR...NEXT|FOR}} i = 10 {{Cl|TO}} 20 {{Cl|PRINT}} array(i); {{Cl|NEXT}} -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} {{OutputStart}}0 1 2 3 4 5 6 7 8 9 10 @@ -44,4 +46,4 @@ The [[$DYNAMIC]] [[Metacommand|metacommand]] allows the creation of dynamic (cha {{PageNavigation}} -< + diff --git a/internal/help/$END_IF.txt b/internal/help/$ELSEIF_$111111.txt similarity index 97% rename from internal/help/$END_IF.txt rename to internal/help/$ELSEIF_$111111.txt index 56d67944c..3475ea0e4 100644 --- a/internal/help/$END_IF.txt +++ b/internal/help/$ELSEIF_$111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:03}} '''$IF''' is precompiler [[Metacommand|metacommand]], which determines which sections of code inside its blocks are included into the final code for compliing. @@ -25,7 +27,7 @@ {{PageExamples}} ''Example 1:'' -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|$LET}} ScreenMode = 32 {{Cl|$IF}} ScreenMode = 0 THEN {{Cl|CONST}} Red = 4 @@ -45,7 +47,7 @@ The [[$LET]] and $IF statements let the programmer control the code that actuall ''Example 2:'' -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|$IF}} WIN THEN {{Cl|CONST}} Slash = "\" {{Cl|$ELSE}} @@ -64,4 +66,4 @@ The [[$LET]] and $IF statements let the programmer control the code that actuall {{PageNavigation}} -< + diff --git a/internal/help/$ELSE.txt b/internal/help/$ELSE_$1111.txt similarity index 97% rename from internal/help/$ELSE.txt rename to internal/help/$ELSE_$1111.txt index 56d67944c..8fe7ab024 100644 --- a/internal/help/$ELSE.txt +++ b/internal/help/$ELSE_$1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:02}} '''$IF''' is precompiler [[Metacommand|metacommand]], which determines which sections of code inside its blocks are included into the final code for compliing. @@ -25,7 +27,7 @@ {{PageExamples}} ''Example 1:'' -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|$LET}} ScreenMode = 32 {{Cl|$IF}} ScreenMode = 0 THEN {{Cl|CONST}} Red = 4 @@ -45,7 +47,7 @@ The [[$LET]] and $IF statements let the programmer control the code that actuall ''Example 2:'' -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|$IF}} WIN THEN {{Cl|CONST}} Slash = "\" {{Cl|$ELSE}} @@ -64,4 +66,4 @@ The [[$LET]] and $IF statements let the programmer control the code that actuall {{PageNavigation}} -< + diff --git a/internal/help/$ELSEIF.txt b/internal/help/$END_IF_$111_11.txt similarity index 97% rename from internal/help/$ELSEIF.txt rename to internal/help/$END_IF_$111_11.txt index 56d67944c..a0baddd4c 100644 --- a/internal/help/$ELSEIF.txt +++ b/internal/help/$END_IF_$111_11.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:05}} '''$IF''' is precompiler [[Metacommand|metacommand]], which determines which sections of code inside its blocks are included into the final code for compliing. @@ -25,7 +27,7 @@ {{PageExamples}} ''Example 1:'' -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|$LET}} ScreenMode = 32 {{Cl|$IF}} ScreenMode = 0 THEN {{Cl|CONST}} Red = 4 @@ -45,7 +47,7 @@ The [[$LET]] and $IF statements let the programmer control the code that actuall ''Example 2:'' -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|$IF}} WIN THEN {{Cl|CONST}} Slash = "\" {{Cl|$ELSE}} @@ -64,4 +66,4 @@ The [[$LET]] and $IF statements let the programmer control the code that actuall {{PageNavigation}} -< + diff --git a/internal/help/$ERROR.txt b/internal/help/$ERROR.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/$ERROR.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/$ERROR_$11111.txt b/internal/help/$ERROR_$11111.txt new file mode 100644 index 000000000..252e3b1c6 --- /dev/null +++ b/internal/help/$ERROR_$11111.txt @@ -0,0 +1,36 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:06}} +The [[$ERROR]] metacommand triggers a compilation error. + + +{{PageSyntax}} +: [[$ERROR]] MESSAGE + + +{{PageDescription}} +* The Metacommand does '''not''' require a comment or REM before it. +* MESSAGE is any text. Quotation marks are not required. +* When QB64 tries to compile an $ERROR metacommand a compilation error is triggered and MESSAGE is shown to the user. This is useful in [[$IF]] blocks. + + +{{PageDescription}} +* If there is a particular situation where you know your program will not work properly, you can prevent the user compiling and give them a helpful error message instead by checking for the condition with [[$IF]]. +* An [[$ERROR]] directive not inside an [[$IF]] (or [[$ELSEIF]]) block is useless because the program will never compile. + + +{{PageExamples}} +{{CodeStart}} +{{Cl|$IF}} VERSION < 2.1 OR WINDOWS = 0 THEN + {{Cl|$ERROR}} Requires Windows QB64 version 2.1 or above +{{Cl|$END IF}} +{{CodeEnd}} +''Output'': Compilation check failed: REQUIRES WINDOWS QB64 VERSION 2.1 OR ABOVE on line 2 (assuming your version of QB64 doesn't meet those requirements). + + +{{PageSeeAlso}} +* [[Metacommand]] +* [[$IF]] + + +{{PageNavigation}} + diff --git a/internal/help/$EXEICON.txt b/internal/help/$EXEICON_$1111111.txt similarity index 86% rename from internal/help/$EXEICON.txt rename to internal/help/$EXEICON_$1111111.txt index a92f45f1e..cce94514b 100644 --- a/internal/help/$EXEICON.txt +++ b/internal/help/$EXEICON_$1111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:10}} '''$EXEICON''' pre-compiler metacommand embeds a designated icon file into the compiled EXE file to be viewed in Windows Explorer. @@ -11,7 +13,7 @@ {{PageDescription}} -* Calling [[_ICON]] without an {{Parameter|imageHandle&}} uses the embeded icon, if available. +* Calling [[_ICON]] without an {{Parameter|imageHandle&}} uses the embeded icon, if available. ** Starting with '''build 20170906/64''', the window will automatically use the icon embedded by [[$EXEICON]], without having to call _ICON. * '''[[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Keyword Not Supported in Linux or MAC versions]]'''. @@ -31,4 +33,4 @@ {{PageNavigation}} -< + diff --git a/internal/help/$IF.txt b/internal/help/$IF_$11.txt similarity index 97% rename from internal/help/$IF.txt rename to internal/help/$IF_$11.txt index 56d67944c..64da5e3c8 100644 --- a/internal/help/$IF.txt +++ b/internal/help/$IF_$11.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:38}} '''$IF''' is precompiler [[Metacommand|metacommand]], which determines which sections of code inside its blocks are included into the final code for compliing. @@ -25,7 +27,7 @@ {{PageExamples}} ''Example 1:'' -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|$LET}} ScreenMode = 32 {{Cl|$IF}} ScreenMode = 0 THEN {{Cl|CONST}} Red = 4 @@ -45,7 +47,7 @@ The [[$LET]] and $IF statements let the programmer control the code that actuall ''Example 2:'' -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|$IF}} WIN THEN {{Cl|CONST}} Slash = "\" {{Cl|$ELSE}} @@ -64,4 +66,4 @@ The [[$LET]] and $IF statements let the programmer control the code that actuall {{PageNavigation}} -< + diff --git a/internal/help/$INCLUDE.txt b/internal/help/$INCLUDE_$1111111.txt similarity index 97% rename from internal/help/$INCLUDE.txt rename to internal/help/$INCLUDE_$1111111.txt index 9e0a9e794..184d7a428 100644 --- a/internal/help/$INCLUDE.txt +++ b/internal/help/$INCLUDE_$1111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:39}} [[$INCLUDE]] is a metacommand that is used to insert a source code file into your program which is then executed at the point of the insertion. @@ -40,4 +42,4 @@ {{PageNavigation}} -< + diff --git a/internal/help/$LET.txt b/internal/help/$LET_$111.txt similarity index 95% rename from internal/help/$LET.txt rename to internal/help/$LET_$111.txt index b307bbb94..dc5689f3a 100644 --- a/internal/help/$LET.txt +++ b/internal/help/$LET_$111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:51}} [[$LET]] is precompiler command, which is now usable by modern day [[cavemen]] to help include and exclude which sections of code compiles in their program based on OS/bit-size or other predefined conditions. @@ -25,4 +27,4 @@ {{PageNavigation}} -< + diff --git a/internal/help/$NOPREFIX.txt b/internal/help/$NOPREFIX_$11111111.txt similarity index 87% rename from internal/help/$NOPREFIX.txt rename to internal/help/$NOPREFIX_$11111111.txt index 873ce7d53..28cafae1d 100644 --- a/internal/help/$NOPREFIX.txt +++ b/internal/help/$NOPREFIX_$11111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:37}} The [[$NOPREFIX]] metacommand allows all QB64 functions and statements to be used without the leading underscore (_). @@ -14,8 +16,9 @@ The [[$NOPREFIX]] metacommand allows all QB64 functions and statements to be use * [[$NOPREFIX]] must be the first line in a program. -==Availability== -* '''Version 1.4 and up'''. +{{PageAvailability}} +* '''QB64 1.4 and up''' (QB64 Team) +* '''QBPE 0.5 and up''' (QB64 Phoenix Edition) {{PageSeeAlso}} @@ -24,4 +27,4 @@ The [[$NOPREFIX]] metacommand allows all QB64 functions and statements to be use {{PageNavigation}} -< + diff --git a/internal/help/$RESIZE.txt b/internal/help/$RESIZE_$111111.txt similarity index 96% rename from internal/help/$RESIZE.txt rename to internal/help/$RESIZE_$111111.txt index 7bfd18b7f..9503913cb 100644 --- a/internal/help/$RESIZE.txt +++ b/internal/help/$RESIZE_$111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:13}} The [[$RESIZE]] [[Metacommand|metacommand]] determines if a program window can be resized by the user. @@ -27,7 +29,7 @@ The [[$RESIZE]] [[Metacommand|metacommand]] determines if a program window can b {{Cl|_DISPLAY}} ' CLEAR _RESIZE FLAG BY READING IT ONCE -temp& = {{Cl|_RESIZE (function)|_RESIZE}} +temp& = {{Cl|_RESIZE (function)|_RESIZE}} DO @@ -45,9 +47,9 @@ DO {{Cl|_DISPLAY}} - k& = {{Cl|_KEYHIT}} + k& = {{Cl|_KEYHIT}} -{{Cl|LOOP}} {{Cl|UNTIL}} k& = 27 {{Cl|OR (boolean)|OR}} k& = 32 +{{Cl|LOOP}} {{Cl|UNTIL}} k& = 27 {{Cl|OR (boolean)|OR}} k& = 32 {{Cl|SYSTEM}} @@ -112,4 +114,4 @@ DO {{PageNavigation}} -< + diff --git a/internal/help/$SCREENHIDE.txt b/internal/help/$SCREENHIDE_$1111111111.txt similarity index 82% rename from internal/help/$SCREENHIDE.txt rename to internal/help/$SCREENHIDE_$1111111111.txt index 877c4ef99..01fb97da1 100644 --- a/internal/help/$SCREENHIDE.txt +++ b/internal/help/$SCREENHIDE_$1111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:28}} The [[$SCREENHIDE]] [[Metacommand|metacommand]] can be used to hide the main program window throughout a program. @@ -12,13 +14,13 @@ The [[$SCREENHIDE]] [[Metacommand|metacommand]] can be used to hide the main pro {{PageExamples}} ''Example:'' Hiding a program when displaying a message box in Windows. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|$SCREENHIDE}} {{Cl|DECLARE DYNAMIC LIBRARY}} "user32" - {{Cl|FUNCTION}} MessageBoxA& ({{Cl|BYVAL}} hWnd%&, {{Cl|BYVAL}} lpText%&, {{Cl|BYVAL}} lpCaption%&, {{Cl|BYVAL}} uType~&) + {{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|SUB}} ExitProcess ({{Cl|BYVAL}} uExitCode~&) + {{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}} @@ -35,4 +37,4 @@ ExitProcess MessageBoxA(0, {{Cl|_OFFSET (function)|_OFFSET}}(s0), {{Cl|_OFFSET(f {{PageNavigation}} -< + diff --git a/internal/help/$SCREENSHOW.txt b/internal/help/$SCREENSHOW_$1111111111.txt similarity index 90% rename from internal/help/$SCREENSHOW.txt rename to internal/help/$SCREENSHOW_$1111111111.txt index 9cc0789dc..09c5b4b40 100644 --- a/internal/help/$SCREENSHOW.txt +++ b/internal/help/$SCREENSHOW_$1111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:36}} {{DISPLAYTITLE:_SCREENSHOW}} The [[_SCREENSHOW]] statement can be used to display the main program window in a section of code. @@ -16,4 +18,4 @@ The [[_SCREENSHOW]] statement can be used to display the main program window in {{PageNavigation}} -< + diff --git a/internal/help/$STATIC.txt b/internal/help/$STATIC_$111111.txt similarity index 87% rename from internal/help/$STATIC.txt rename to internal/help/$STATIC_$111111.txt index 0571d1902..295b692ee 100644 --- a/internal/help/$STATIC.txt +++ b/internal/help/$STATIC_$111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:45}} The '''$STATIC''' Metacommand allows the creation of STATIC(un-changeable) arrays. @@ -6,7 +8,7 @@ The '''$STATIC''' Metacommand allows the creation of STATIC(un-changeable) array ::: REM '''$STATIC''' -* Qbasic [[Metacommand]]s require a REM or apostrophy (') before them and are normally placed at the start of the main module. +* QBasic [[Metacommand]]s require a REM or apostrophy (') before them and are normally placed at the start of the main module. * Static arrays cannot be resized. If a variable is used to size any array, it becomes [[$DYNAMIC]]. * A [[REDIM]] statement has no effect on [[$STATIC]] arrays except perhaps a [[ERROR Codes|duplicate definition error]] at the [[REDIM]] code. * The array's type cannot be changed once [[DIM]] and a literal value sets the dimensions and element size. @@ -14,7 +16,7 @@ The '''$STATIC''' Metacommand allows the creation of STATIC(un-changeable) array ''Example:'' When a variable is used, the array can be resized despite $STATIC. The array becomes [[$DYNAMIC]]. -{{CodeStart}} '' '' +{{CodeStart}} '{{Cl|$STATIC}} {{Cl|INPUT}} "Enter array size: ", size @@ -22,7 +24,7 @@ The '''$STATIC''' Metacommand allows the creation of STATIC(un-changeable) array {{Cl|REDIM}} array(2 * size) -{{Cl|PRINT}} {{Cl|UBOUND}}(array) '' '' +{{Cl|PRINT}} {{Cl|UBOUND}}(array) {{CodeEnd}} : ''Note:'' [[DIM]] using a literal numerical size will create a Duplicate definition error. @@ -33,4 +35,4 @@ The '''$STATIC''' Metacommand allows the creation of STATIC(un-changeable) array {{PageNavigation}} -< + diff --git a/internal/help/$VERSIONINFO.txt b/internal/help/$VERSIONINFO_$11111111111.txt similarity index 68% rename from internal/help/$VERSIONINFO.txt rename to internal/help/$VERSIONINFO_$11111111111.txt index 75df784c8..aea3abfba 100644 --- a/internal/help/$VERSIONINFO.txt +++ b/internal/help/$VERSIONINFO_$11111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:32}} {{DISPLAYTITLE:$VERSIONINFO}} The [[$VERSIONINFO]] [[Metacommand|metacommand]] adds text metadata to the resulting executable for identification purposes across the OS. Windows-only. @@ -7,8 +9,9 @@ The [[$VERSIONINFO]] [[Metacommand|metacommand]] adds text metadata to the resul {{Parameters}} -* Text ''keys'' can be: '''CompanyName, FileDescription, InternalName, LegalCopyright, LegalTrademarks, OriginalFilename, ProductName, Web, Comments''' +* Text ''keys'' can be: '''Comments, CompanyName, FileDescription, FileVersion, InternalName, LegalCopyright, LegalTrademarks, OriginalFilename, ProductName, ProductVersion, Web''' * Numeric {{Parameter|keys}} can be:'''FILEVERSION#''' and '''PRODUCTVERSION#''' +**When provided, the numerical keys '''FILEVERSION#''' and '''PRODUCTVERSION#''' will also provide values to the text keys '''FileVersion''' and '''ProductVersion,''' if the text versions are not provided separately. (Phoenix Edition v0.6.0 and above) {{PageDescription}} @@ -17,8 +20,9 @@ The [[$VERSIONINFO]] [[Metacommand|metacommand]] adds text metadata to the resul * [[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Not available in Linux or macOS]]. -==Availability== -* '''Build 20170429/52 and up'''. +{{PageAvailability}} +* '''QB64 1.2 and up''' (QB64 Team) +* '''QBPE 0.5 and up''' (QB64 Phoenix Edition) {{PageExamples}} @@ -37,4 +41,4 @@ The [[$VERSIONINFO]] [[Metacommand|metacommand]] adds text metadata to the resul {{PageNavigation}} -< + diff --git a/internal/help/$VIRTUALKEYBOARD.txt b/internal/help/$VIRTUALKEYBOARD_$111111111111111.txt similarity index 90% rename from internal/help/$VIRTUALKEYBOARD.txt rename to internal/help/$VIRTUALKEYBOARD_$111111111111111.txt index 31c29be79..a3ea52349 100644 --- a/internal/help/$VIRTUALKEYBOARD.txt +++ b/internal/help/$VIRTUALKEYBOARD_$111111111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:34}} {{DISPLAYTITLE:$VIRTUALKEYBOARD}} [DEPRACATED] The [[$VIRTUALKEYBOARD]] [[Metacommand|metacommand]] turns the virtual keyboard ON or OFF. @@ -15,7 +17,7 @@ {{CodeStart}} {{Cl|$VIRTUALKEYBOARD}}:ON -{{Cl|DO}}: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) '' '' +{{Cl|DO}}: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) {{CodeEnd}} @@ -24,4 +26,4 @@ {{PageNavigation}} -< + diff --git a/internal/help/%26B.txt b/internal/help/%26B_%261.txt similarity index 82% rename from internal/help/%26B.txt rename to internal/help/%26B_%261.txt index 63c2be250..fb405277d 100644 --- a/internal/help/%26B.txt +++ b/internal/help/%26B_%261.txt @@ -1,8 +1,10 @@ -The '''&B''' prefix denotes that an integer value is expressed in a binary base 2 format using '''QB64''' only. +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:24:48}} +The '''&B''' prefix denotes that an integer value is expressed in a binary base 2 format using '''QB64''' only. {{PageSyntax}} -:::: a& = '''&B1110110000111111''' +:::: a& = '''&B1110110000111111''' * 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. @@ -12,10 +14,10 @@ The '''&B''' prefix denotes that an integer value is expressed in a binary b ** [[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 be used to convert "&B" prefixed string values to decimal. +* [[LONG]] values can be returned by appending the & or ~%([[_UNSIGNED]] [[INTEGER]]) symbols after the binary number. +* [[VAL]] can be used to convert "&B" prefixed string values to decimal. -<center>'''[[_BIT|BITS]]'''</center> +
'''[[_BIT|BITS]]'''
* 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. @@ -26,9 +28,9 @@ The '''&B''' prefix denotes that an integer value is expressed in a binary b '''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 27 down to 20 while the little-endian method does the opposite. -<center>'''[[_BYTE|BYTES]]'''</center> +
'''[[_BYTE|BYTES]]'''
* [[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 +62,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! @@ -69,22 +71,22 @@ The '''&B''' prefix denotes that an integer value is expressed in a binary b value to Binary just add the 4 binary digits for each HEX digit place so: F A C E - &HFACE = 1111 + 1010 + 1100 + 1101 = &B1111101011001101 + &HFACE = 1111 + 1010 + 1100 + 1101 = &B1111101011001101 To convert a Binary value to HEX you just need to divide the number into sections of four digits starting from the right(LSB) end. If one has less than 4 digits on the left end you could add the leading zeros like below: - &B101011100010001001 = 0010 1011 1000 1000 1001 - hexadecimal = 2 + B + 8 + 8 + 9 = &H2B889 + &B101011100010001001 = 0010 1011 1000 1000 1001 + hexadecimal = 2 + B + 8 + 8 + 9 = &H2B889 - See the Decimal to Binary conversion function that uses '''[[HEX$]]''' on the '''[[&H]]''' page. + See the Decimal to Binary conversion function that uses '''[[HEX$]]''' on the '''[[&H]]''' page. {{TextEnd}} ''Example 1:'' A Decimal to Binary [[STRING]] function that does not return leading zeroes. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|PRINT}} BIN$(255) '1 byte(8 bits) maximum {{Cl|PRINT}} BIN$(32767) 'integer(2 byte, 15 bits) maximum {{Cl|PRINT}} BIN$(-32768) 'integer(2 byte, 16 bits) minimum @@ -96,7 +98,7 @@ The '''&B''' prefix denotes that an integer value is expressed in a binary b {{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|END FUNCTION}} '' '' +{{Cl|END FUNCTION}} {{CodeEnd}} {{small|Code by Ted Weissgerber}} {{OutputStart}} @@ -109,19 +111,19 @@ The '''&B''' prefix denotes that an integer value is expressed in a binary b ''Example 2:'' QB64 converts the binary values from the example above to [[INTEGER]] decimal values automatically. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DEFLNG}} A-Z -a = &B11111111 -b = &B111111111111111 -c = &B1000000000000000 '& 'or ~% -d = &B1111111111111111 '& 'or ~% +a = &B11111111 +b = &B111111111111111 +c = &B1000000000000000 '& 'or ~% +d = &B1111111111111111 '& 'or ~% -{{Cl|PRINT}} a, b, c, d '' '' +{{Cl|PRINT}} a, b, c, d {{CodeEnd}} {{OutputStart}} 255 32767 -32768 -1 {{OutputEnd}} -:''Bonus example:'' Add an '''&''' symbol after the negative binary numbers to see the [[LONG]] decimal values below. +:''Bonus example:'' Add an '''&''' symbol after the negative binary numbers to see the [[LONG]] decimal values below. {{OutputStart}} 255 32767 32768 65535 {{OutputEnd}} @@ -131,9 +133,9 @@ d = &B1111111111111111 '& 'or ~% {{PageSeeAlso}} * [[_BIT]], [[_BYTE]] * [[_SHL]], [[_SHR]] -* [[OCT$]], [[&O]] {{text|(octal)}} -* [[HEX$]], [[&H]] {{text|(hexadecimal)}} +* [[OCT$]], [[&O]] {{text|(octal)}} +* [[HEX$]], [[&H]] {{text|(hexadecimal)}} {{PageNavigation}} -< + diff --git a/internal/help/%26H.txt b/internal/help/%26H_%261.txt similarity index 73% rename from internal/help/%26H.txt rename to internal/help/%26H_%261.txt index d08c03452..67ca32109 100644 --- a/internal/help/%26H.txt +++ b/internal/help/%26H_%261.txt @@ -1,8 +1,10 @@ -The '''&H''' prefix denotes that an integer value is expressed in a Hexadecimal base 16 format. Every 2 digits represent a [[_BYTE]]. +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:24:51}} +The '''&H''' prefix denotes that an integer value is expressed in a Hexadecimal base 16 format. Every 2 digits represent a [[_BYTE]]. {{PageSyntax}} -:::: a& = &HFACE +:::: a& = &HFACE * 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. @@ -14,28 +16,28 @@ The '''&H''' prefix denotes that an integer value is expressed in a Hexadeci ::* [[_INTEGER64]]: 16 hex digits or decimal values from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. ::* [[_UNSIGNED]] [[_INTEGER64]]: 0 to 18446744073709551615. * The maximum hexadecimal value for each numerical type is the maximum number of digits listed above, each valued at F. -* Convert hexadecimal to [[LONG]] values by appending the values with &. Example: &H8000 = -32768: &H8000& = 32768 -* [[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$). +* Convert hexadecimal to [[LONG]] values by appending the values with &. Example: &H8000 = -32768: &H8000& = 32768 +* [[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$). ''Example 1:'' The maximum octal values of decimal value -1 in each numerical type are: -{{CodeStart}} '' '' -c&& = -1: d& = -1: e% = -1: f%% = -1 +{{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$) -hx$ = {{Cl|HEX$}}(d&) -{{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|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$) +hx$ = {{Cl|HEX$}}(c&&) +{{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" 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 @@ -47,9 +49,9 @@ Min _INTEGER64 value = 8000000000000000 with 16 digits ''Example 2:'' Converting a decimal number to a binary string value using [[HEX$]]. -{{CodeStart}} '' '' -FUNCTION BIN$ (n&) - h$ = {{Cl|HEX$}}(n&) 'get hexadecimal string value +{{CodeStart}} +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" @@ -71,8 +73,8 @@ FUNCTION BIN$ (n&) 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 -END FUNCTION '' '' + 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. @@ -80,9 +82,9 @@ END FUNCTION '' '' ''See also:'' * [[HEX$]], [[OCT$]] -* [[&B]] {{text|(binary)}}, [[&O]] {{text|(octal)}} +* [[&B]] {{text|(binary)}}, [[&O]] {{text|(octal)}} * [[Base Comparisons]] {{PageNavigation}} -< + diff --git a/internal/help/%26O.txt b/internal/help/%26O_%261.txt similarity index 69% rename from internal/help/%26O.txt rename to internal/help/%26O_%261.txt index 4b6863d9a..9a15b01b3 100644 --- a/internal/help/%26O.txt +++ b/internal/help/%26O_%261.txt @@ -1,8 +1,10 @@ -The '''&O''' prefix denotes that a integer value is expressed in an Octal base 8 format. +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:24:49}} +The '''&O''' prefix denotes that a integer value is expressed in an Octal base 8 format. {{PageSyntax}} -:::: a& = &O12345671234 +:::: a& = &O12345671234 * The base eight numbering system only uses octal digit values of 0 to 7. @@ -11,20 +13,20 @@ The '''&O''' prefix denotes that a integer value is expressed in an Octal ba :: * [[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. -* [[LONG]] Octal values can be expressed by appending & after the number. Example: &O100000& = 32768 +* [[LONG]] Octal values can be expressed by appending & after the number. Example: &O100000& = 32768 ''Example:'' The maximum octal values of decimal value -1 in each numerical type are: {{CodeStart}} -c&& = -1: d& = -1: e% = -1: f%% = -1 +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$) -oc$ = {{Cl|OCT$}}(d&) -{{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|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$) +oc$ = {{Cl|OCT$}}(c&&) +{{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 @@ -35,9 +37,9 @@ Max octal _INTEGER64 = 1777777777777777777777 with 22 digits =-1 ''See also:'' * [[OCT$]], [[HEX$]], [[VAL]] -* [[&B]] (binary), [[&H]] (hexadecimal) +* [[&B]] (binary), [[&H]] (hexadecimal) * [[Base Comparisons]] {{PageNavigation}} -< + diff --git a/internal/help/%2A_%21.txt b/internal/help/%2A_%21.txt new file mode 100644 index 000000000..22a338998 --- /dev/null +++ b/internal/help/%2A_%21.txt @@ -0,0 +1,25 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:24:53}} +The '''*''' mathematical operator performs the multiplication of two values. + + +''Syntax:'' return_value = number1 * number2 + + +{{PageDescription}} + +* Multiplication can use any two literal or variable numerical type values. +* Multiplication of two negative numbers returns a positive result. One negative number will always return a negative value. +* Return values may exceed certain numerical variable type limits creating an [[ERROR Codes|"Overflow" error.]] +* Division and multiplication operations are performed before addition and subtraction in QBasic's order of operations. + + + +''See also:'' + +[[Mathematical Operations]] + + + +{{PageNavigation}} + diff --git a/internal/help/%2F.txt b/internal/help/%2F_%21.txt similarity index 95% rename from internal/help/%2F.txt rename to internal/help/%2F_%21.txt index fbedbfca7..57acae287 100644 --- a/internal/help/%2F.txt +++ b/internal/help/%2F_%21.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:24:54}} The '''/''' mathematical operator performs decimal point division on a numerical value. @@ -25,4 +27,4 @@ The '''/''' mathematical operator performs decimal point division on a numerical {{PageNavigation}} -< + diff --git a/internal/help/%5C_%51.txt b/internal/help/%5C_%51.txt new file mode 100644 index 000000000..2f3c1033e --- /dev/null +++ b/internal/help/%5C_%51.txt @@ -0,0 +1,48 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:24:56}} +The '''\''' mathematical operator performs [[INTEGER]] division on a numerical value. + + + +{{PageSyntax}} +::: return_value = number '''\''' divisor + + + +{{PageDescription}} + +* Number value can be any literal or variable numerical type. +* '''Divisor (second value) must not be a value of 0 to .5'''. This will create a [[ERROR Codes|"Division by zero" error!]] due to [[CINT]] rounding. +* Return values will be [[INTEGER]] or [[LONG]] value types only. +* Rounding is done to the closest EVEN [[INTEGER|integer]] or [[LONG|long integer]] value. +* Use the [[/]] integer division operator for [[SINGLE]] or [[DOUBLE]] floating decimal point return values. +* Division and multiplication operations are performed before addition and subtraction in QBasic's order of operations. + + +''Example:'' Displays how floating decimal point values are rounded to the closest even [[INTEGER|integer]] value. +{{CodeStart}} +{{Cl|PRINT}} 0.5 \ 1 +{{Cl|PRINT}} 1.5 \ 1 +{{Cl|PRINT}} 2.5 \ 1 +{{Cl|PRINT}} 3.5 \ 1 +{{Cl|PRINT}} 4.5 \ 1 +{{Cl|PRINT}} 5.5 \ 1 +{{CodeEnd}} +{{OutputStart}}0 +2 +2 +4 +4 +6 +{{OutputEnd}} + + +''See also:'' +* [[MOD|MOD (remainder division operator)]] +* [[/|/ (normal division operator)]] +* [[INT]], [[CINT]], [[FIX]], [[_ROUND]] +* [[Mathematical Operations]] + + +{{PageNavigation}} + diff --git a/internal/help/+.txt b/internal/help/+.txt deleted file mode 100644 index dbfb00653..000000000 --- a/internal/help/+.txt +++ /dev/null @@ -1,189 +0,0 @@ - - - - -Bad title - QB64 Phoenix Edition Wiki - - - - - - - - - - - - -
-
-
- -
-
-
-

Bad title

-
- -
-
- -
- Jump to navigation - Jump to search -

The requested page title is empty or contains only the name of a namespace. -

Return to Main Page.

- -
- -
-
- -
-

Navigation menu

-
- - -
- - - - -
-
- - - - - - -
-
- -
- - - - - - -
- -
- - - - - \ No newline at end of file diff --git a/internal/help/-.txt b/internal/help/-_-.txt similarity index 88% rename from internal/help/-.txt rename to internal/help/-_-.txt index 76897ac40..6bfc341d9 100644 --- a/internal/help/-.txt +++ b/internal/help/-_-.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:24:52}} The '''-''' mathematical operator performs subtraction on two numerical values or [[negation|negates]] a single value. @@ -11,7 +13,7 @@ The '''-''' mathematical operator performs subtraction on two numerical values o * Numbers used can be any literal or variable numerical value type. * Subtracting a negative value will actually perform addition with the other value. * Subtracting a negative or [[negation|negated]] value will make the return value more positive. -* Addition and subtraction are the last operations performed in Qbasic's normal order of operations. +* Addition and subtraction are the last operations performed in QBasic's normal order of operations. * Subtraction cannot be performed on [[STRING]] values. @@ -25,4 +27,4 @@ The '''-''' mathematical operator performs subtraction on two numerical values o {{PageNavigation}} -< + diff --git a/internal/help/.txt b/internal/help/.txt deleted file mode 100644 index 380c28d95..000000000 --- a/internal/help/.txt +++ /dev/null @@ -1,59 +0,0 @@ -==Welcome to the QB64 Wiki== - -QB64 is a modern extended BASIC programming language that retains QBasic/QuickBASIC 4.5 compatibility and compiles native binaries for Windows, Linux, and macOS. - -[[File:IDE_macos.png|thumb|left|QB64's IDE running on macOS Catalina]] - -{| align="right" - | __TOC__ - |} - -==Getting started== -* Grab the latest version of QB64 from [https://github.com/QB64Team/qb64/releases/latest the releases page]. - -===FAQ=== -* [[QB64 FAQ|Frequently asked questions about QB64]] - -===Get in touch=== -* [https://qb64phoenix.com/forum/index.php QB64 Phoenix Edition Forum] -* [https://discord.com/invite/2t9HTYK Discord invitation] - - -==Keywords== -* [[Keyword Reference - Alphabetical]] -* [[Keyword Reference - By usage]] -* [[Syntax Reference - QB64]] - -===Known issues=== -* [[Keywords currently not supported by QB64|Legacy keywords 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 macOS versions]] - -==Articles and Tutorials== -* [http://www.qb64sourcecode.com Terry Ritchie's QB64 Game Programming] -* [https://www.youtube.com/watch?v=hE-Voij5k5Q&list=PLF6199808BD4901E1 School Freeware series on QB64 (YouTube)] -* [[Arrays]] -* [[ASCII|ASCII Character Codes]] -* [[Binary|Binary Numbers]] -* [[Boolean|Boolean Operations]] -* [[_CLIPBOARD$|Clipboard]] -* [[Converting Bytes to Bits]] -* [[Console Window]] -* [[Controller Devices]] (Keyboard, Mouse, Joystick, Gamepad) -* [[Downloading Files]] (TCP/IP) -* [[Windows Environment|Environment (Windows Registry)]] -* [[Hardware images]] -* [[Images|Image file procedures]] -* [[Keyboard scancodes|Keyboard Scan Codes]] -* [[Libraries]] ([[C Libraries|C++]], [[Windows Libraries|Windows]], [[DLL Libraries|DLL]]) -* [[Mathematical Operations]] -* [[PDS (7.1) Procedures]] -* [[Port Access Libraries]] -* [[QB 4.5 Library Ports For QB64]] -* [[Relational Operations]] -* [[Line numbers]] -* [[Line number|Removing line numbers]] -* [[Resource Table extraction]] {{text|([[Resource_Table_extraction#Extract_Icon|Icon Extraction]])}} -* [[Screen Memory]] -* [[Text Using Graphics|Text, Fonts and Unicode Using Graphics]] -* [[Variable Types]] -< diff --git a/internal/help/ABS.txt b/internal/help/ABS_111.txt similarity index 86% rename from internal/help/ABS.txt rename to internal/help/ABS_111.txt index 1c6150c22..e0289fa3c 100644 --- a/internal/help/ABS.txt +++ b/internal/help/ABS_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:40}} The [[ABS]] function returns the unsigned numerical value of a variable or literal value. @@ -14,14 +16,14 @@ The [[ABS]] function returns the unsigned numerical value of a variable or liter {{PageExamples}} ''Example:'' Finding the absolute value of positive and negative numerical values. -{{CodeStart}} '' '' +{{CodeStart}} a = -6 b = -7 c = 8 -{{Cl|IF...THEN|IF}} a < 0 {{Cl|THEN}} a = {{Cl|ABS}}(a) +{{Cl|IF...THEN|IF}} a < 0 {{Cl|THEN}} a = {{Cl|ABS}}(a) b = {{Cl|ABS}}(b) c = {{Cl|ABS}}(c) -{{Cl|PRINT}} a, b, c '' '' +{{Cl|PRINT}} a, b, c {{CodeEnd}} {{OutputStart}} 6 7 8 {{OutputEnd}} @@ -35,4 +37,4 @@ c = {{Cl|ABS}}(c) {{PageNavigation}} -< + diff --git a/internal/help/BINARY.txt b/internal/help/ACCESS_111111.txt similarity index 93% rename from internal/help/BINARY.txt rename to internal/help/ACCESS_111111.txt index c364960e2..798d73e8f 100644 --- a/internal/help/BINARY.txt +++ b/internal/help/ACCESS_111111.txt @@ -1,19 +1,21 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:42}} The [[OPEN]] statement is used to open a file or [[OPEN_COM|COM]] serial communications port for program input or output. {{PageSyntax}} -: [[OPEN]] {{Parameter|fileName$}} ['''FOR''' {{Parameter|mode}}] [{{{KW|ACCESS}}|{{{KW|LOCK}}|SHARED}} [{READ|WRITE}] [[AS]] [#]{{Parameter|fileNumber&}} [LEN = {{Parameter|recordLength}}] +: [[OPEN]] {{Parameter|fileName$}} ['''FOR''' {{Parameter|mode}}] [{{{KW|ACCESS}}|{{{KW|LOCK}}|SHARED}} [{READ|WRITE}] [[AS]] [#]{{Parameter|fileNumber&}} [LEN = {{Parameter|recordLength}}] ===Legacy ''GW-BASIC'' syntax=== -: [[OPEN]] {{Parameter|modeLetter$}}, [#]{{Parameter|fileNumber&}}, {{Parameter|fileName$}}[, {{Parameter|recordLength}}] +: [[OPEN]] {{Parameter|modeLetter$}}, [#]{{Parameter|fileNumber&}}, {{Parameter|fileName$}}[, {{Parameter|recordLength}}] {{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. -* {{Parameter|fileNumber&}} can be any '''positive''' [[INTEGER]] or [[LONG]] whole number value or an unused value determined by the [[FREEFILE]] function. +* {{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. @@ -21,7 +23,7 @@ The [[OPEN]] statement is used to open a file or [[OPEN_COM|COM]] serial communi * '''QB64''' can open as many files as your computer memory can handle. QBasic could only open about 15 at a time. * '''QB64 will allocate 4 bytes of memory for every possible file number up to the highest number used in a program.''' * {{Parameter|mode}} defaults to RANDOM if the {{Parameter|mode}} or FOR access statement is omitted. (see open modes described below) -* '''Only the {{Parameter|fileName$}}, {{Parameter|fileNumber&}} and LEN = {{Parameter|recordLength}} values can use variable values in the QBasic syntax.''' +* '''Only the {{Parameter|fileName$}}, {{Parameter|fileNumber&}} and LEN = {{Parameter|recordLength}} values can use variable values in the QBasic syntax.''' * 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. @@ -32,7 +34,7 @@ The [[OPEN]] statement is used to open a file or [[OPEN_COM|COM]] serial communi {{PageErrors}} -* Illegal '''QB64''' Windows filename characters are ''' " * / \ | ? : < > '''. Multiple dots (periods) are allowed. +* 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. @@ -88,18 +90,18 @@ The [[OPEN]] statement is used to open a file or [[OPEN_COM|COM]] serial communi {{Cl|PRINT}} {{Cl|CHR$}}(code%); 'use {{Cl|LOCATE}} before {{Cl|FUNCTION}} call to place print {{Cl|NEXT}} CheckName% = E% -{{Cl|END FUNCTION}} '' '' +{{Cl|END FUNCTION}} {{CodeEnd}} ''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}} = {{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: -{{CodeStart}} '' '' +{{CodeStart}} f% = {{Cl|FREEFILE}} 'should always be 1 at program start {{Cl|OPEN}} "SCRN:" {{Cl|FOR...NEXT|FOR}} {{Cl|OUTPUT}} {{Cl|AS}} #f% g% = {{Cl|FREEFILE}} 'should always be 2 after 1 @@ -107,7 +109,7 @@ g% = {{Cl|FREEFILE}} 'should always be 2 after 1 {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 2 {{Cl|PRINT (file statement)|PRINT}} #i, "Hello World, Screen and File version" -NEXT '' '' +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. @@ -159,4 +161,4 @@ It was overwritten with this and deleted. {{PageNavigation}} -< + diff --git a/internal/help/ALIAS.txt b/internal/help/ALIAS.txt deleted file mode 100644 index 7e69929fa..000000000 --- a/internal/help/ALIAS.txt +++ /dev/null @@ -1,2 +0,0 @@ -#REDIRECT [[DECLARE LIBRARY]] -< diff --git a/internal/help/ALIAS_11111.txt b/internal/help/ALIAS_11111.txt new file mode 100644 index 000000000..6ecf6ef63 --- /dev/null +++ b/internal/help/ALIAS_11111.txt @@ -0,0 +1,4 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:44}} +See page [[DECLARE LIBRARY]] + diff --git a/internal/help/AND_(boolean).txt b/internal/help/AND_(boolean)_111_(0000000).txt similarity index 87% rename from internal/help/AND_(boolean).txt rename to internal/help/AND_(boolean)_111_(0000000).txt index 37c4b2aac..5c0f814f4 100644 --- a/internal/help/AND_(boolean).txt +++ b/internal/help/AND_(boolean)_111_(0000000).txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:46}} The [[AND (boolean)|AND]] conditonal operator is used to include another evaluation in an [[IF...THEN]] or [[Boolean]] statement. @@ -25,7 +27,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}} @@ -35,18 +37,18 @@ True ''Example:'' Using a AND a more complex way. -{{CodeStart}} '' '' +{{CodeStart}} a% = 100 b% = 50 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|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|END IF}} '' '' +{{Cl|END IF}} {{CodeEnd}} {{OutputStart}} True @@ -61,4 +63,4 @@ True {{PageNavigation}} -< + diff --git a/internal/help/AND.txt b/internal/help/AND_111.txt similarity index 87% rename from internal/help/AND.txt rename to internal/help/AND_111.txt index 600e9d4a9..07a4f4213 100644 --- a/internal/help/AND.txt +++ b/internal/help/AND_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:45}} The logical [[AND]] numerical operator compares two values in respect of their bits. If both bits at a certain position in both values are set, then that bit position is set in the result. @@ -50,13 +52,13 @@ 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 " " - LOOP UNTIL INTvalue& = 0 'zero entry quits + LOOP UNTIL INTvalue& = 0 'zero entry quits {{CodeEnd}} @@ -74,4 +76,4 @@ The logical [[AND]] numerical operator compares two values in respect of their b {{PageNavigation}} -< + diff --git a/internal/help/FOR_(file_statement).txt b/internal/help/APPEND_111111.txt similarity index 93% rename from internal/help/FOR_(file_statement).txt rename to internal/help/APPEND_111111.txt index c364960e2..1af34cc3f 100644 --- a/internal/help/FOR_(file_statement).txt +++ b/internal/help/APPEND_111111.txt @@ -1,19 +1,21 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:47}} The [[OPEN]] statement is used to open a file or [[OPEN_COM|COM]] serial communications port for program input or output. {{PageSyntax}} -: [[OPEN]] {{Parameter|fileName$}} ['''FOR''' {{Parameter|mode}}] [{{{KW|ACCESS}}|{{{KW|LOCK}}|SHARED}} [{READ|WRITE}] [[AS]] [#]{{Parameter|fileNumber&}} [LEN = {{Parameter|recordLength}}] +: [[OPEN]] {{Parameter|fileName$}} ['''FOR''' {{Parameter|mode}}] [{{{KW|ACCESS}}|{{{KW|LOCK}}|SHARED}} [{READ|WRITE}] [[AS]] [#]{{Parameter|fileNumber&}} [LEN = {{Parameter|recordLength}}] ===Legacy ''GW-BASIC'' syntax=== -: [[OPEN]] {{Parameter|modeLetter$}}, [#]{{Parameter|fileNumber&}}, {{Parameter|fileName$}}[, {{Parameter|recordLength}}] +: [[OPEN]] {{Parameter|modeLetter$}}, [#]{{Parameter|fileNumber&}}, {{Parameter|fileName$}}[, {{Parameter|recordLength}}] {{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. -* {{Parameter|fileNumber&}} can be any '''positive''' [[INTEGER]] or [[LONG]] whole number value or an unused value determined by the [[FREEFILE]] function. +* {{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. @@ -21,7 +23,7 @@ The [[OPEN]] statement is used to open a file or [[OPEN_COM|COM]] serial communi * '''QB64''' can open as many files as your computer memory can handle. QBasic could only open about 15 at a time. * '''QB64 will allocate 4 bytes of memory for every possible file number up to the highest number used in a program.''' * {{Parameter|mode}} defaults to RANDOM if the {{Parameter|mode}} or FOR access statement is omitted. (see open modes described below) -* '''Only the {{Parameter|fileName$}}, {{Parameter|fileNumber&}} and LEN = {{Parameter|recordLength}} values can use variable values in the QBasic syntax.''' +* '''Only the {{Parameter|fileName$}}, {{Parameter|fileNumber&}} and LEN = {{Parameter|recordLength}} values can use variable values in the QBasic syntax.''' * 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. @@ -32,7 +34,7 @@ The [[OPEN]] statement is used to open a file or [[OPEN_COM|COM]] serial communi {{PageErrors}} -* Illegal '''QB64''' Windows filename characters are ''' " * / \ | ? : < > '''. Multiple dots (periods) are allowed. +* 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. @@ -88,18 +90,18 @@ The [[OPEN]] statement is used to open a file or [[OPEN_COM|COM]] serial communi {{Cl|PRINT}} {{Cl|CHR$}}(code%); 'use {{Cl|LOCATE}} before {{Cl|FUNCTION}} call to place print {{Cl|NEXT}} CheckName% = E% -{{Cl|END FUNCTION}} '' '' +{{Cl|END FUNCTION}} {{CodeEnd}} ''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}} = {{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: -{{CodeStart}} '' '' +{{CodeStart}} f% = {{Cl|FREEFILE}} 'should always be 1 at program start {{Cl|OPEN}} "SCRN:" {{Cl|FOR...NEXT|FOR}} {{Cl|OUTPUT}} {{Cl|AS}} #f% g% = {{Cl|FREEFILE}} 'should always be 2 after 1 @@ -107,7 +109,7 @@ g% = {{Cl|FREEFILE}} 'should always be 2 after 1 {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 2 {{Cl|PRINT (file statement)|PRINT}} #i, "Hello World, Screen and File version" -NEXT '' '' +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. @@ -159,4 +161,4 @@ It was overwritten with this and deleted. {{PageNavigation}} -< + diff --git a/internal/help/ASC_(statement).txt b/internal/help/ASC_(statement)_111_(000000000).txt similarity index 97% rename from internal/help/ASC_(statement).txt rename to internal/help/ASC_(statement)_111_(000000000).txt index 8c26e7c85..49247607a 100644 --- a/internal/help/ASC_(statement).txt +++ b/internal/help/ASC_(statement)_111_(000000000).txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:51}} The [[ASC (statement)|ASC]] statement allows a '''QB64''' program to change a character at any position of a [[STRING]] variable. @@ -43,4 +45,4 @@ The [[ASC (statement)|ASC]] statement allows a '''QB64''' program to change a ch {{PageNavigation}} -< + diff --git a/internal/help/ASC.txt b/internal/help/ASC_111.txt similarity index 91% rename from internal/help/ASC.txt rename to internal/help/ASC_111.txt index 8da125c00..bab044a9c 100644 --- a/internal/help/ASC.txt +++ b/internal/help/ASC_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:50}} The [[ASC]] function returns the [[ASCII]] code number of a certain [[STRING]] text character or a keyboard press. @@ -10,7 +12,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$) = 0 THEN byte2 = 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''. @@ -23,7 +25,7 @@ The [[ASC]] function returns the [[ASCII]] code number of a certain [[STRING]] t ' '''' Esc F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Sys ScL Pause''' ' 27 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +133 +134 - - - -'''' `~ 1! 2@ 3# 4$ 5% 6^ 7& 8* 9( 0) -_ =+ BkSp Ins Hme PUp NumL / * -''' +'''' `~ 1! 2@ 3# 4$ 5% 6^ 7& 8* 9( 0) -_ =+ BkSp Ins Hme PUp NumL / * -''' ' 126 33 64 35 36 37 94 38 42 40 41 95 43 8 +82 +71 +73 - 47 42 45 ''' 96 49 50 51 52 53 54 55 56 57 48 45 61'' '''' Tab Q W E R T Y U I O P [{ ]} \| Del End PDn 7Hme 8/β–² 9PU + ''' @@ -32,7 +34,7 @@ The [[ASC]] function returns the [[ASCII]] code number of a certain [[STRING]] t '''' 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,13 +46,13 @@ 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> +
'''[[ASCII#Two_Byte_Codes|Two Byte Ctrl, Alt and Shift + Function key combinations]]'''
{{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$(60) [F2] "<" CHR$(0) + CHR$(61) [F3] "=" CHR$(0) + CHR$(62) [F4] ">" CHR$(0) + CHR$(63) [F5] "?" @@ -90,10 +92,10 @@ The [[ASC]] function returns the [[ASCII]] code number of a certain [[STRING]] t {{PageExamples}} ''Example 1:'' How ASC can be used to find any ASCII code in a string of characters using QB64. -{{CodeStart}} '' '' +{{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("QB64 is not only COMPATIBLE, it can find any part of the string!", 18) {{CodeEnd}} ''Returns:'' @@ -110,16 +112,16 @@ The [[ASC]] function returns the [[ASCII]] code number of a certain [[STRING]] t ''Example 2:'' Reading the ASCII and two byte code combinations with ASC in '''QB64'''. -{{CodeStart}} '' '' +{{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" 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|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$ @@ -136,19 +138,19 @@ 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 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|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 {{Cl|END IF}} {{Cl|LOCATE}} 10, 10: {{Cl|PRINT}} entry$; ' display present entry to user(semicolon required for correct POS return) - {{Cl|LOOP}} {{Cl|UNTIL}} code = 13 {{Cl|AND}} L '' '' + {{Cl|LOOP}} {{Cl|UNTIL}} code = 13 {{Cl|AND}} L {{CodeEnd}} ''Explanation:'' [[SLEEP]] waits for a keypress allowing background programs to use the processor time. It also keeps the press in the keyboard buffer for [[INKEY$]] to read and guarantees that ASC will not read an empty string value to create an error. Filtered codes 48 to 57 are only number characters. One decimal point is allowed by using the flag. Code 8 is a backspace request which is ignored if the entry has no characters. If it is allowed it removes the last character from the entry and the screen. The loop exits when the user presses the [Enter] key and the entry has a length. @@ -164,4 +166,4 @@ DO {{PageNavigation}} -< + diff --git a/internal/help/AS.txt b/internal/help/AS_11.txt similarity index 96% rename from internal/help/AS.txt rename to internal/help/AS_11.txt index 6fa4f16a5..2da04d377 100644 --- a/internal/help/AS.txt +++ b/internal/help/AS_11.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:49}} The [[AS]] keyword defines a variable data [[type]]. @@ -31,4 +33,4 @@ The [[AS]] keyword defines a variable data [[type]]. {{PageNavigation}} -< + diff --git a/internal/help/ATN.txt b/internal/help/ATN_111.txt similarity index 79% rename from internal/help/ATN.txt rename to internal/help/ATN_111.txt index 3daae6d6f..1929b1fce 100644 --- a/internal/help/ATN.txt +++ b/internal/help/ATN_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:52}} The [[ATN]] or arctangent function returns the angle in radians of a numerical [[TAN|tangent]] value. @@ -7,36 +9,36 @@ 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 = 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 function return value is between -&pi; / 2 and &pi; / 2. +* To convert from radians to degrees, multiply radians * (180 / γ). +* The ''tangent'' value would be equal to the tangent value of an angle. Ex: '''{{text|[[TAN]](ATN(1)) = 1|green}}''' +* The function return value is between -γ / 2 and γ / 2. {{PageExamples}} ''Example 1:'' When the [[TAN]]gent value equals 1, the line is drawn at a 45 degree angle (.7853982 radians) where [[SIN]] / [[COS]] = 1. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 12 x = 100 * {{Cl|COS}}({{Cl|ATN}}(1)) y = 100 * {{Cl|SIN}}({{Cl|ATN}}(1)) -{{Cl|LINE}} (200, 200)-(200 + x, 200 + y) '' '' +{{Cl|LINE}} (200, 200)-(200 + x, 200 + y) {{CodeEnd}} -''Example 2:'' [[ATN]] can be used to define &pi; in [[SINGLE]] or [[DOUBLE]] precision. The calculation cannot be used as a [[CONST]]ant. -{{CodeStart}} '' '' +''Example 2:'' [[ATN]] can be used to define γ in [[SINGLE]] or [[DOUBLE]] precision. The calculation cannot be used as a [[CONST]]ant. +{{CodeStart}} Pi = 4 * {{Cl|ATN}}(1) '{{Cl|SINGLE}} precision Pi# = 4 * {{Cl|ATN}}(1#) '{{Cl|DOUBLE}} precision -PRINT Pi, Pi# '' '' +PRINT Pi, Pi# {{CodeEnd}} :''Note:'' You can use QB64's native [[_PI]] function. ''Example 3:'' Finds the angle from the center point to the mouse pointer. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, 32) x1! = 320 y1! = 240 @@ -51,7 +53,7 @@ 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... @@ -64,7 +66,7 @@ DO {{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}} y2# < y1# {{Cl|THEN}} {{Cl|IF...THEN|IF}} x2# > x1# {{Cl|THEN}} getangle# = {{Cl|ATN}}((x2# - x1#) / (y2# - y1#)) * -57.2957795131 {{Cl|ELSE}} @@ -73,7 +75,7 @@ DO {{Cl|ELSE}} getangle# = {{Cl|ATN}}((x2# - x1#) / (y2# - y1#)) * -57.2957795131 + 180 {{Cl|END IF}} -{{Cl|END FUNCTION}} '' '' +{{Cl|END FUNCTION}} {{CodeEnd}}{{small|Function by Galleon}} @@ -86,4 +88,4 @@ DO {{PageNavigation}} -< + diff --git a/internal/help/Apostrophe.txt b/internal/help/Apostrophe_1000000000.txt similarity index 93% rename from internal/help/Apostrophe.txt rename to internal/help/Apostrophe_1000000000.txt index 761361fae..ae8e850f6 100644 --- a/internal/help/Apostrophe.txt +++ b/internal/help/Apostrophe_1000000000.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:24:40}} The '''apostrophe''' is used to tell the compiler to ignore a statement or programmer comment. {{PageDescription}} @@ -23,4 +25,4 @@ COLOR 11: PRINT "Print this...." ' PRINT "Don't print this program comment!" {{PageNavigation}} -< + diff --git a/internal/help/BEEP.txt b/internal/help/BEEP_1111.txt similarity index 94% rename from internal/help/BEEP.txt rename to internal/help/BEEP_1111.txt index 2b9394597..2e3a226c0 100644 --- a/internal/help/BEEP.txt +++ b/internal/help/BEEP_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:54}} The [[BEEP]] statement produces a beep sound through the sound card. @@ -22,4 +24,4 @@ The [[BEEP]] statement produces a beep sound through the sound card. {{PageNavigation}} -< + diff --git a/internal/help/APPEND.txt b/internal/help/BINARY_111111.txt similarity index 93% rename from internal/help/APPEND.txt rename to internal/help/BINARY_111111.txt index c364960e2..aa9c2bf36 100644 --- a/internal/help/APPEND.txt +++ b/internal/help/BINARY_111111.txt @@ -1,19 +1,21 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:55}} The [[OPEN]] statement is used to open a file or [[OPEN_COM|COM]] serial communications port for program input or output. {{PageSyntax}} -: [[OPEN]] {{Parameter|fileName$}} ['''FOR''' {{Parameter|mode}}] [{{{KW|ACCESS}}|{{{KW|LOCK}}|SHARED}} [{READ|WRITE}] [[AS]] [#]{{Parameter|fileNumber&}} [LEN = {{Parameter|recordLength}}] +: [[OPEN]] {{Parameter|fileName$}} ['''FOR''' {{Parameter|mode}}] [{{{KW|ACCESS}}|{{{KW|LOCK}}|SHARED}} [{READ|WRITE}] [[AS]] [#]{{Parameter|fileNumber&}} [LEN = {{Parameter|recordLength}}] ===Legacy ''GW-BASIC'' syntax=== -: [[OPEN]] {{Parameter|modeLetter$}}, [#]{{Parameter|fileNumber&}}, {{Parameter|fileName$}}[, {{Parameter|recordLength}}] +: [[OPEN]] {{Parameter|modeLetter$}}, [#]{{Parameter|fileNumber&}}, {{Parameter|fileName$}}[, {{Parameter|recordLength}}] {{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. -* {{Parameter|fileNumber&}} can be any '''positive''' [[INTEGER]] or [[LONG]] whole number value or an unused value determined by the [[FREEFILE]] function. +* {{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. @@ -21,7 +23,7 @@ The [[OPEN]] statement is used to open a file or [[OPEN_COM|COM]] serial communi * '''QB64''' can open as many files as your computer memory can handle. QBasic could only open about 15 at a time. * '''QB64 will allocate 4 bytes of memory for every possible file number up to the highest number used in a program.''' * {{Parameter|mode}} defaults to RANDOM if the {{Parameter|mode}} or FOR access statement is omitted. (see open modes described below) -* '''Only the {{Parameter|fileName$}}, {{Parameter|fileNumber&}} and LEN = {{Parameter|recordLength}} values can use variable values in the QBasic syntax.''' +* '''Only the {{Parameter|fileName$}}, {{Parameter|fileNumber&}} and LEN = {{Parameter|recordLength}} values can use variable values in the QBasic syntax.''' * 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. @@ -32,7 +34,7 @@ The [[OPEN]] statement is used to open a file or [[OPEN_COM|COM]] serial communi {{PageErrors}} -* Illegal '''QB64''' Windows filename characters are ''' " * / \ | ? : < > '''. Multiple dots (periods) are allowed. +* 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. @@ -88,18 +90,18 @@ The [[OPEN]] statement is used to open a file or [[OPEN_COM|COM]] serial communi {{Cl|PRINT}} {{Cl|CHR$}}(code%); 'use {{Cl|LOCATE}} before {{Cl|FUNCTION}} call to place print {{Cl|NEXT}} CheckName% = E% -{{Cl|END FUNCTION}} '' '' +{{Cl|END FUNCTION}} {{CodeEnd}} ''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}} = {{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: -{{CodeStart}} '' '' +{{CodeStart}} f% = {{Cl|FREEFILE}} 'should always be 1 at program start {{Cl|OPEN}} "SCRN:" {{Cl|FOR...NEXT|FOR}} {{Cl|OUTPUT}} {{Cl|AS}} #f% g% = {{Cl|FREEFILE}} 'should always be 2 after 1 @@ -107,7 +109,7 @@ g% = {{Cl|FREEFILE}} 'should always be 2 after 1 {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 2 {{Cl|PRINT (file statement)|PRINT}} #i, "Hello World, Screen and File version" -NEXT '' '' +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. @@ -159,4 +161,4 @@ It was overwritten with this and deleted. {{PageNavigation}} -< + diff --git a/internal/help/BLOAD.txt b/internal/help/BLOAD_11111.txt similarity index 86% rename from internal/help/BLOAD.txt rename to internal/help/BLOAD_11111.txt index c2a198fb3..17522b4a0 100644 --- a/internal/help/BLOAD.txt +++ b/internal/help/BLOAD_11111.txt @@ -1,13 +1,15 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:56}} [[BLOAD]] loads a binary graphics file created by [[BSAVE]] to an array. -==Legacy support== -* '''QB64 can load larger arrays directly from binary files using [[PUT]] # and [[GET]] # without BLOAD. For that reason, BLOAD isn't recommended practice anymore and is supported to maintain compatibility with legacy code.''' - - {{PageSyntax}} : [[BLOAD]] {{Parameter|fileName$}}, [[VARPTR]]({{Parameter|imageArray%({{Parameter|index}})}}) +{{PageLegacySupport}} +* '''QB64''' can load larger arrays directly from binary files using [[PUT]] # and [[GET]] # without '''BLOAD'''. For that reason, '''BLOAD''' isn't recommended practice anymore and is supported to maintain compatibility with legacy code. + + {{Parameters}} * {{Parameter|fileName$}} is the name of the file that the image should be [[BSAVE]]d to. * {{Parameter|imageArray%(index)}} is the [[INTEGER]] [[arrays|array]] start index to store the image loaded. @@ -25,20 +27,20 @@ {{PageExamples}} ''Example 1:'' Loading data to an array from a BSAVED file. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DEF SEG}} = {{Cl|VARSEG}}(Array(0)) {{Cl|BLOAD}} filename$, {{Cl|VARPTR}}(Array({{Cl|LBOUND}}(Array))) ' changeable index - {{Cl|DEF SEG}} '' '' + {{Cl|DEF SEG}} {{CodeEnd}} :''Explanation:'' Referance any type of array that matches the data saved. Can work with Integer, Single, Double, Long, fixed length Strings or [[TYPE]] arrays. [[LBOUND]] determines the starting offset of the array or another index could be used. ''Example 2:'' Using a QB default colored image. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DEF SEG}} = {{Cl|VARSEG}}(Image%(0)) ' pointer to first image element of an array {{Cl|BLOAD}} FileName$, {{Cl|VARPTR}}(Image%(0)) ' place data into array at index position 0 {{Cl|PUT (graphics statement)|PUT}}(Col, Row), Image%(0), PSET ' Put the image on the screen from index 0 - {{Cl|DEF SEG}} '' '' + {{Cl|DEF SEG}} {{CodeEnd}} : ''Note:'' [[PSET]] is used as a [[PUT (graphics statement)|PUT]] action that places the image over any background objects. @@ -53,4 +55,4 @@ {{PageNavigation}} -< + diff --git a/internal/help/BSAVE.txt b/internal/help/BSAVE_11111.txt similarity index 76% rename from internal/help/BSAVE.txt rename to internal/help/BSAVE_11111.txt index 76a2cd300..f85e40ad2 100644 --- a/internal/help/BSAVE.txt +++ b/internal/help/BSAVE_11111.txt @@ -1,18 +1,20 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:57}} [[BSAVE]] saves the contents of an image array to a [[BINARY]] file. -==Legacy support== -* '''QB64 can save larger arrays directly to binary files using [[PUT]] # and [[GET]] # without BSAVE. For that reason, BSAVE isn't recommended practice anymore and is supported to maintain compatibility with legacy code. - - {{PageSyntax}} -: [[BSAVE]] {{Parameter|saveFile$}}, [[VARPTR]]({{Parameter|array(index)}}), {{Parameter|fileSize&}} +: [[BSAVE]] {{Parameter|saveFile$}}, [[VARPTR]]({{Parameter|array(index)}}), {{Parameter|fileSize&}} + + +{{PageLegacySupport}} +* '''QB64''' can save larger arrays directly to binary files using [[PUT]] # and [[GET]] # without '''BSAVE'''. For that reason, '''BSAVE''' isn't recommended practice anymore and is supported to maintain compatibility with legacy code. {{Parameters}} * {{Parameter|saveFile$}} is the STRING file name of the file designated to be created. * {{Parameter|array(index)}} is the image [[arrays|array]] that already holds the [[GET (graphics statement)|GET]] image data. -* {{Parameter|fileSize&}} must be a bit over twice the size of the elements used in an [[INTEGER]] [[Arrays|array]]. +* {{Parameter|fileSize&}} must be a bit over twice the size of the elements used in an [[INTEGER]] [[Arrays|array]]. {{PageDescription}} @@ -27,30 +29,30 @@ {{PageExamples}} ''Example 1:'' Saving array data to a file quickly. -{{CodeStart}} '' '' +{{CodeStart}} LB% = {{Cl|LBOUND}}(Array) bytes% = {{Cl|LEN}}(Array(LB%)) - filesize& = (({{Cl|UBOUND}}(Array) - LB%) + 1) * bytes% + filesize& = (({{Cl|UBOUND}}(Array) - LB%) + 1) * bytes% {{Cl|DEF SEG}} = {{Cl|VARSEG}}(Array(0)) - {{Cl|BSAVE}} filename$, {{Cl|VARPTR}}(Array(LB%)), filesize& ' changeable index - {{Cl|DEF SEG}} '' '' + {{Cl|BSAVE}} filename$, {{Cl|VARPTR}}(Array(LB%)), filesize& ' changeable index + {{Cl|DEF SEG}} {{CodeEnd}} : ''Explanation:'' Procedure determines the filesize from the array size automatically. [[LBOUND]] is used with [[UBOUND]] to determine array size and byte size. Works with any type of array except variable-length strings. Used for saving program data fast. ''Example 2:'' [[BSAVE]]ing a bitmap and calculating the file size -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DEF SEG}} = {{Cl|VARSEG}}(Image(0)) {{Cl|PSET}}(BMPHead.PWidth - 1, BMPHead.PDepth - 1) 'color lower right corner if black {{Cl|GET (graphics statement)|GET}} (0, 0)-(BMPHead.PWidth - 1, BMPHead.PDepth - 1), Image(NColors * 3) ' for 16 or 256 colors - {{Cl|FOR...NEXT|FOR}} a& = 26000 {{Cl|TO}} 0 {{Cl|STEP}} -1 - {{Cl|IF...THEN|IF}} Image(a&) {{Cl|THEN}} ArraySize& = a&: {{Cl|EXIT FOR}} + {{Cl|FOR...NEXT|FOR}} a& = 26000 {{Cl|TO}} 0 {{Cl|STEP}} -1 + {{Cl|IF...THEN|IF}} Image(a&) {{Cl|THEN}} ArraySize& = a&: {{Cl|EXIT FOR}} {{Cl|NEXT}} - {{Cl|BSAVE}} SaveName$, {{Cl|VARPTR}}(Image(0)), (2 * ArraySize&) + 200 'file size - {{Cl|DEF SEG}} '' '' + {{Cl|BSAVE}} SaveName$, {{Cl|VARPTR}}(Image(0)), (2 * ArraySize&) + 200 'file size + {{Cl|DEF SEG}} {{CodeEnd}} -: ''Explanation:'' The [[FOR...NEXT|FOR]] loop reads backwards through the image array until it finds a value not 0. The [[LONG]] {{Parameter|ArraySize&}} value is doubled and 200 is added. {{Parameter|BMPhead.PWidth}} and {{Parameter|BMPhead.PDepth}} are found by reading the bitmap's information header using a [[TYPE]] definition. See [[Bitmaps]]. +: ''Explanation:'' The [[FOR...NEXT|FOR]] loop reads backwards through the image array until it finds a value not 0. The [[LONG]] {{Parameter|ArraySize&}} value is doubled and 200 is added. {{Parameter|BMPhead.PWidth}} and {{Parameter|BMPhead.PDepth}} are found by reading the bitmap's information header using a [[TYPE]] definition. See [[Bitmaps]]. ''Example 3:'' Using [[PUT]] and [[GET]] to write and read array data from a file without using BSAVE or [[BLOAD]]: @@ -65,7 +67,7 @@ {{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! @@ -89,7 +91,7 @@ K$ = {{Cl|INPUT$}}(1) 'Press any key {{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}} @@ -102,4 +104,4 @@ K$ = {{Cl|INPUT$}}(1) 'Press any key {{PageNavigation}} -< + diff --git a/internal/help/DECLARE_LIBRARY.txt b/internal/help/BYVAL_11111.txt similarity index 89% rename from internal/help/DECLARE_LIBRARY.txt rename to internal/help/BYVAL_11111.txt index 8bc9ef772..11e4bc35a 100644 --- a/internal/help/DECLARE_LIBRARY.txt +++ b/internal/help/BYVAL_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:59}} The '''DECLARE LIBRARY''' declaration allows the use of external library [[SUB]] and [[FUNCTION]] procedures supported by QB64. @@ -38,7 +40,7 @@ The '''DECLARE LIBRARY''' declaration allows the use of external library [[SUB]] {{PageExamples}} ''Example 1:'' Using an '''SDL''' library procedure as a program SUB procedure to move the mouse pointer to a coordinate (works in versions prior to 1.000): -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DECLARE LIBRARY}} {{Cl|SUB}} SDL_WarpMouse ({{Cl|BYVAL}} column {{Cl|AS}} {{Cl|LONG}}, {{Cl|BYVAL}} row {{Cl|AS}} {{Cl|LONG}}) 'SDL procedure name {{Cl|DECLARE LIBRARY|END DECLARE}} @@ -55,39 +57,39 @@ DO {{Cl|SUB}} MouseMove (x {{Cl|AS}} {{Cl|LONG}}, y {{Cl|AS}} {{Cl|LONG}}) SDL_WarpMouse x, y 'call SDL library procedure -{{Cl|END SUB}} '' '' +{{Cl|END SUB}} {{CodeEnd}} {{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> -{{CodeStart}} '' '' +
'''Using [[ALIAS]] to create a program SUB or FUNCTION''' using '''QB64 SDL ONLY'''
+{{CodeStart}} {{Cl|SCREEN}} 12 {{Cl|DECLARE LIBRARY}} - {{Cl|SUB}} MouseMove {{Cl|ALIAS}} SDL_WarpMouse ({{Cl|BYVAL}} column&, {{Cl|BYVAL}} row&) + {{Cl|SUB}} MouseMove {{Cl|ALIAS}} SDL_WarpMouse ({{Cl|BYVAL}} column&, {{Cl|BYVAL}} row&) {{Cl|DECLARE LIBRARY|END DECLARE}} {{Cl|_DELAY}} 2 MouseMove 100, 100 {{Cl|_DELAY}} 2 -MouseMove 200, 200 '' '' +MouseMove 200, 200 {{CodeEnd}} :''Explanation:'' When a Library procedure is used to represent another procedure name use [[ALIAS]] instead. Saves creating a SUB! ''Example 2:'' Don't know if a C function is defined by C++ or QB64? Try using empty quotes. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DECLARE LIBRARY}} "" - {{Cl|FUNCTION}} addone& ({{Cl|BYVAL}} value&) -{{Cl|END}} DECLARE '' '' + {{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. : '''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.''' -<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> +
'''QB64 version 1.000 and up produce standalone executables. External DLL files must be distributed with your program.'''
+
'''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.'''
''See also:'' @@ -100,4 +102,4 @@ MouseMove 200, 200 '' '' {{PageNavigation}} -< + diff --git a/internal/help/CALLS.txt b/internal/help/CALLS.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/CALLS.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/CALL.txt b/internal/help/CALL_1111.txt similarity index 97% rename from internal/help/CALL.txt rename to internal/help/CALL_1111.txt index 02d321cda..d1a0d04ce 100644 --- a/internal/help/CALL.txt +++ b/internal/help/CALL_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:00}} [[CALL]] sends code execution to a subroutine procedure in a program. In '''QB64''' the subroutine doesn't need to be declared. @@ -22,7 +24,7 @@ {{PageExamples}} ''Example:'' How parameters are passed in two [[SUB]] calls, one with CALL using brackets and one without CALL or brackets: -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DIM}} a {{Cl|AS}} {{Cl|INTEGER}} 'value not shared with SUB {{Cl|DIM}} {{Cl|SHARED}} b {{Cl|AS}} {{Cl|INTEGER}} 'value shared with any SUB a = 1 @@ -40,7 +42,7 @@ helloworld a 'a passed to c parameter w/o CALL 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 c = c + 1 'c is a SUB parameter value from a in calls which may increase inside SUB only -{{Cl|END SUB}} '' '' +{{Cl|END SUB}} {{CodeEnd}} ''Returns:'' @@ -62,4 +64,4 @@ Hello World! {{PageNavigation}} -< + diff --git a/internal/help/CALL_ABSOLUTE.txt b/internal/help/CALL_ABSOLUTE_1111_11111111.txt similarity index 85% rename from internal/help/CALL_ABSOLUTE.txt rename to internal/help/CALL_ABSOLUTE_1111_11111111.txt index f5d328024..107bbc025 100644 --- a/internal/help/CALL_ABSOLUTE.txt +++ b/internal/help/CALL_ABSOLUTE_1111_11111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:41}} [[CALL ABSOLUTE]] is used to access interrupts on the computer or execute assembly type procedures. @@ -5,8 +7,8 @@ : [[CALL ABSOLUTE]]([{{Parameter|argumentList}},] {{Parameter|integerOffset}}) -==Legacy support== -* [[CALL ABSOLUTE]] is implemented to support older code and is not recommended practice. To handle mouse input, the '''use [[_MOUSEINPUT]] and related functions'''. +{{PageLegacySupport}} +* [[CALL ABSOLUTE]] is implemented to support older code and is not recommended practice. To handle mouse input, use [[_MOUSEINPUT]] and related functions. {{PageDescription}} @@ -24,4 +26,4 @@ {{PageNavigation}} -< + diff --git a/internal/help/CASE.txt b/internal/help/CASE.txt deleted file mode 100644 index d6c07b136..000000000 --- a/internal/help/CASE.txt +++ /dev/null @@ -1,2 +0,0 @@ -#REDIRECT [[SELECT CASE]] -< diff --git a/internal/help/CASE_1111.txt b/internal/help/CASE_1111.txt new file mode 100644 index 000000000..67cfe4510 --- /dev/null +++ b/internal/help/CASE_1111.txt @@ -0,0 +1,4 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:03}} +See page [[SELECT CASE]] + diff --git a/internal/help/CASE_ELSE.txt b/internal/help/CASE_ELSE.txt deleted file mode 100644 index d6c07b136..000000000 --- a/internal/help/CASE_ELSE.txt +++ /dev/null @@ -1,2 +0,0 @@ -#REDIRECT [[SELECT CASE]] -< diff --git a/internal/help/CASE_ELSE_1111_1111.txt b/internal/help/CASE_ELSE_1111_1111.txt new file mode 100644 index 000000000..bc00e5c76 --- /dev/null +++ b/internal/help/CASE_ELSE_1111_1111.txt @@ -0,0 +1,4 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:04}} +See page [[SELECT CASE]] + diff --git a/internal/help/CASE_IS.txt b/internal/help/CASE_IS.txt deleted file mode 100644 index d6c07b136..000000000 --- a/internal/help/CASE_IS.txt +++ /dev/null @@ -1,2 +0,0 @@ -#REDIRECT [[SELECT CASE]] -< diff --git a/internal/help/CASE_IS_1111_11.txt b/internal/help/CASE_IS_1111_11.txt new file mode 100644 index 000000000..335bcbe8d --- /dev/null +++ b/internal/help/CASE_IS_1111_11.txt @@ -0,0 +1,4 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:05}} +See page [[SELECT CASE]] + diff --git a/internal/help/CDBL.txt b/internal/help/CDBL_1111.txt similarity index 95% rename from internal/help/CDBL.txt rename to internal/help/CDBL_1111.txt index e248d6d1d..eec685ed3 100644 --- a/internal/help/CDBL.txt +++ b/internal/help/CDBL_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:06}} [[CDBL]] converts a value to the closest [[DOUBLE]]-precision value. @@ -32,4 +34,4 @@ {{PageNavigation}} -< + diff --git a/internal/help/CDECL.txt b/internal/help/CDECL.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/CDECL.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/CHAIN.txt b/internal/help/CHAIN_11111.txt similarity index 77% rename from internal/help/CHAIN.txt rename to internal/help/CHAIN_11111.txt index 9afe04b02..78ea10f72 100644 --- a/internal/help/CHAIN.txt +++ b/internal/help/CHAIN_11111.txt @@ -1,13 +1,16 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:09}} [[CHAIN]] is used to change seamlessly from one module to another one in a program. -==Legacy support== -* The multi-modular technique goes back to when QBasic and QuickBASIC had module size constraints. In QB64 [[CHAIN]] has been implemented so that that older code can still be compiled, though '''it is advisable to use single modules for a single project (not counting [[$INCLUDE]] libraries), for ease of sharing and also because the module size constraints no longer exist.''' - - {{PageSyntax}} : [[CHAIN]] {{Parameter|moduleName$}} + +{{PageLegacySupport}} +* The multi-modular technique goes back to when '''QBasic''' and '''QuickBASIC''' had module size constraints. In '''QB64''' the [[CHAIN]] statement has been implemented so that that older code can still be compiled, though it is advisable to use single modules for a single project (not counting [[$INCLUDE]] libraries), for ease of sharing and also because the module size constraints no longer exist. + + {{Parameters}} * {{Parameter|moduleName$}} is a variable or a literal [[STRING]] value in quotation marks with the optional EXE or BAS file name extension. @@ -29,8 +32,8 @@ {{PageExamples}} ''Example:'' CHAIN looks for same file type extension as program module (BAS or EXE). -{{CodeStart}} '' '' - {{Cl|CHAIN}} "Level1" '' '' +{{CodeStart}} + {{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". @@ -44,4 +47,4 @@ {{PageNavigation}} -< + diff --git a/internal/help/CHDIR.txt b/internal/help/CHDIR_11111.txt similarity index 93% rename from internal/help/CHDIR.txt rename to internal/help/CHDIR_11111.txt index 8de0f93af..3651503f7 100644 --- a/internal/help/CHDIR.txt +++ b/internal/help/CHDIR_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:10}} The [[CHDIR]] statement changes the program's location from one working directory to another by specifying a literal or variable [[STRING]] path. @@ -14,16 +16,16 @@ The [[CHDIR]] statement changes the program's location from one working director {{PageExamples}} ''Example 1:'' The following code is Windows-specific: -{{CodeStart}} '' '' +{{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}} "..\" '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}} '' '' +{{CodeStart}} {{Cl|_TITLE}} "My program" {{Cl|PRINT}} TITLE$ {{Cl|PRINT}} PATH$ @@ -48,7 +50,7 @@ Result = GetModuleFileNameA(0, FileName$, {{Cl|LEN}}(FileName$)) '0 designates PATH$ = {{Cl|LEFT$}}(PATH$, last) {{Cl|ELSE}} TITLE$ = "": PATH$ = "" {{Cl|END IF}} -{{Cl|END FUNCTION}} '' '' +{{Cl|END FUNCTION}} {{CodeEnd}} : '''Note:''' The program's [[_TITLE]] name may be different from the actual program module's file name returned by Windows. @@ -60,4 +62,4 @@ Result = GetModuleFileNameA(0, FileName$, {{Cl|LEN}}(FileName$)) '0 designates {{PageNavigation}} -< + diff --git a/internal/help/CHR$.txt b/internal/help/CHR$_111$.txt similarity index 91% rename from internal/help/CHR$.txt rename to internal/help/CHR$_111$.txt index 6d2397d2e..300258084 100644 --- a/internal/help/CHR$.txt +++ b/internal/help/CHR$_111$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:12}} The [[CHR$]] function returns the character associated with a certain [[ASCII|character code]] as a [[STRING]]. @@ -38,13 +40,13 @@ This text uses "quotation marks" that could have caused a syntax error! ''Example 3:'' Using [[ASC]] and [[CHR$]] to ''encrypt'' a text file size up to 32K bytes {{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|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 {{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 @@ -64,14 +66,14 @@ 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 {{Cl|NEXT}} i {{Cl|OPEN}} FileName$ {{Cl|FOR}} {{Cl|OUTPUT}} {{Cl|AS}} #1 ' Erase file for decrypted text {{Cl|PRINT (file statement)|PRINT}} #1, Send$ ' place Text as one string -{{Cl|CLOSE}} #1 '' '' +{{Cl|CLOSE}} #1 {{CodeEnd}} {{small|Code by Ted Weissgerber}} :''Explanation:'' Examples 3 and 4 encrypt and decrypt a file up to 32 thousand bytes. [[INPUT$]] can only get strings less than 32767 characters. The upper and lower case letter characters are the only ones altered, but the encryption and decryption rely on the fact that most text files do not use the code characters above 193. You could alter any character from ASCII 32 to 125 without problems using the 130 adder. No [[ASCII]] code above 255 is allowed. Don't alter the codes below code 32 as they are control characters. Specifically, characters 13 and 10 (CrLf) may be used for line returns in text files. @@ -84,4 +86,4 @@ Send$ = "" {{PageNavigation}} -< + diff --git a/internal/help/CINT.txt b/internal/help/CINT_1111.txt similarity index 91% rename from internal/help/CINT.txt rename to internal/help/CINT_1111.txt index 3f515d7bd..bb9593e73 100644 --- a/internal/help/CINT.txt +++ b/internal/help/CINT_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:13}} The [[CINT]] function rounds decimal point numbers up or down to the nearest [[INTEGER]] value. @@ -18,9 +20,9 @@ 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". -{{CodeStart}} '' '' +{{CodeStart}} a% = {{Cl|CINT}}(1.49): b% = {{Cl|CINT}}(1.50): c = 11.5 -{{Cl|COLOR}} c: {{Cl|PRINT}} a%, b%, c '' '' +{{Cl|COLOR}} c: {{Cl|PRINT}} a%, b%, c {{CodeEnd}} {{OutputStart}}{{text|1 2 11.5|red}} {{OutputEnd}} @@ -33,4 +35,4 @@ a% = {{Cl|CINT}}(1.49): b% = {{Cl|CINT}}(1.50): c = 11.5 {{PageNavigation}} -< + diff --git a/internal/help/CIRCLE.txt b/internal/help/CIRCLE_111111.txt similarity index 86% rename from internal/help/CIRCLE.txt rename to internal/help/CIRCLE_111111.txt index b8c4afb56..9fba0ccd0 100644 --- a/internal/help/CIRCLE.txt +++ b/internal/help/CIRCLE_111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:14}} The [[CIRCLE]] statement is used in graphic [[SCREEN (statement)|SCREEN]] modes to create circles, arcs or ellipses. @@ -10,13 +12,13 @@ The [[CIRCLE]] statement is used in graphic [[SCREEN (statement)|SCREEN]] modes * Coordinates designate the center position of the circle. Can be partially drawn offscreen. * {{Parameter|radius%}} is an [[INTEGER]] value for half of the total circle diameter. * {{Parameter|drawColor%}} is any available color attribute in the [[SCREEN (statement)|SCREEN]] mode used. -* {{Parameter|startRadian!}} and {{Parameter|stopRadian!}} can be any [[SINGLE]] value from 0 to 2 * &pi; to create partial circles or ellipses. +* {{Parameter|startRadian!}} and {{Parameter|stopRadian!}} can be any [[SINGLE]] value from 0 to 2 * γ to create partial circles or ellipses. * {{Parameter|aspect!}} [[SINGLE]] values of 0 to 1 affect the vertical height and values over 1 affect the horizontal width of an ellipse. Aspect = 1 is a normal circle. {{PageDescription}} * When using {{Parameter|aspect!}} the {{Parameter|startRadian!}} and {{Parameter|stopRadian!}} commas must be included even if not used. -* Radians move in a counter clockwise direction from 0 to 2 * &pi;. Zero and 2 * &pi; are the same circle radian at 3 o'clock. +* Radians move in a counter clockwise direction from 0 to 2 * γ. Zero and 2 * γ are the same circle radian at 3 o'clock. * Negative radian values can be used to draw lines from the end of an arc or partial ellipse to the circle center. * Commas after the {{Parameter|drawColor%}} parameter are not required when creating a normal circle. {{Parameter|drawColor%}} can also be omitted to use the last color used in a draw statement. * The graphic cursor is set to the center of the program window on program start for [[STEP]] relative coordinates. @@ -25,26 +27,26 @@ The [[CIRCLE]] statement is used in graphic [[SCREEN (statement)|SCREEN]] modes {{PageExamples}} ''Example 1:'' Finding when the mouse is inside of a circular area: -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 12 -r& = 200 'radius change circle size and position here -cx& = 320 'center x horizontal -cy& = 240 'center y vertical +r& = 200 'radius change circle size and position here +cx& = 320 'center x horizontal +cy& = 240 'center y vertical DO i = {{Cl|_MOUSEINPUT}} - 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|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) 'escape key exit '' '' + 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|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. ''Example 2:'' Program illustrates how the CIRCLE command using a negative radian value can be used to create the hands of a clock. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|CONST}} PI = 3.141593 'The mathematical value of PI to six places. You can also use QB64's native _PI. {{Cl|DIM}} clock(60) 'A dimensioned array to hold 60 radian points clockcount% = 15 'A counter to keep track of the radians @@ -95,7 +97,7 @@ 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 +106,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 +115,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 @@ -130,8 +132,7 @@ previoushour% = hours% 'hold current hour for later use hours% = {{Cl|VAL}}({{Cl|LEFT$}}({{Cl|TIME$}}, 2)) {{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}} @@ -143,4 +144,4 @@ previoushour% = hours% 'hold current hour for later use * [[Alternative circle routine]] {{text|(member-contributed program)}} {{PageNavigation}} -< + diff --git a/internal/help/CLEAR.txt b/internal/help/CLEAR_11111.txt similarity index 84% rename from internal/help/CLEAR.txt rename to internal/help/CLEAR_11111.txt index 04e0e6a61..70b28690c 100644 --- a/internal/help/CLEAR.txt +++ b/internal/help/CLEAR_11111.txt @@ -1,8 +1,10 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:15}} The [[CLEAR]] statement clears all variable and array element values in a program. {{PageSyntax}} -: [[CLEAR]] [, {{Parameter|ignored&}} , {{Parameter|ignored&}}] +: [[CLEAR]] [, {{Parameter|ignored&}} , {{Parameter|ignored&}}] {{PageDescription}} @@ -15,7 +17,7 @@ The [[CLEAR]] statement clears all variable and array element values in a progra {{PageExamples}} ''Example:'' Using CLEAR to clear array elements from [[STATIC|static]] arrays or arrays created using [[DIM]]. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|CLS}} {{Cl|DIM}} array(10) 'create a {{Cl|$STATIC}} array array(5) = 23 @@ -24,7 +26,7 @@ array(5) = 23 {{Cl|CLEAR}} -{{Cl|PRINT}} array(5) '' '' +{{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. @@ -32,8 +34,8 @@ array(5) = 23 {{PageSeeAlso}} * [[ERASE]] * [[REDIM]], [[_PRESERVE]] -* [[Arrays]], [[&B|_BIT arrays]] +* [[Arrays]], [[&B|_BIT arrays]] {{PageNavigation}} -< + diff --git a/internal/help/CLNG.txt b/internal/help/CLNG_1111.txt similarity index 84% rename from internal/help/CLNG.txt rename to internal/help/CLNG_1111.txt index 3b465f638..7e90f6ea8 100644 --- a/internal/help/CLNG.txt +++ b/internal/help/CLNG_1111.txt @@ -1,8 +1,10 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:17}} The [[CLNG]] function rounds decimal point numbers up or down to the nearest [[LONG]] integer value. {{PageSyntax}} -: {{Parameter|value&}} = [[CLNG]]({{Parameter|expression}}) +: {{Parameter|value&}} = [[CLNG]]({{Parameter|expression}}) {{Parameters}} @@ -18,7 +20,7 @@ The [[CLNG]] function rounds decimal point numbers up or down to the nearest [[L {{PageExamples}} {{CodeStart}} - a& = {{Cl|CLNG}}(2345678.51) + a& = {{Cl|CLNG}}(2345678.51) {{Cl|PRINT}} {{CodeEnd}} @@ -34,4 +36,4 @@ The [[CLNG]] function rounds decimal point numbers up or down to the nearest [[L {{PageNavigation}} -< + diff --git a/internal/help/CLOSE.txt b/internal/help/CLOSE_11111.txt similarity index 95% rename from internal/help/CLOSE.txt rename to internal/help/CLOSE_11111.txt index 54c7fc087..e33c360f8 100644 --- a/internal/help/CLOSE.txt +++ b/internal/help/CLOSE_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:18}} [[CLOSE]] closes an open file or port using the number(s) assigned in an [[OPEN]] statement. @@ -27,4 +29,4 @@ {{PageNavigation}} -< + diff --git a/internal/help/CLS.txt b/internal/help/CLS_111.txt similarity index 76% rename from internal/help/CLS.txt rename to internal/help/CLS_111.txt index 55029ce6c..782ff3987 100644 --- a/internal/help/CLS.txt +++ b/internal/help/CLS_111.txt @@ -1,8 +1,10 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:19}} The [[CLS]] statement clears the [[_DEST|current write page]]. {{PageSyntax}} -: [[CLS]] [{{Parameter|method%}}] [, {{Parameter|bgColor&}}] +: [[CLS]] [{{Parameter|method%}}] [, {{Parameter|bgColor&}}] {{Parameters}} @@ -11,22 +13,22 @@ The [[CLS]] statement clears the [[_DEST|current write page]]. ** CLS 0 - Clears the entire page of text and graphics. Print cursor is moved to row 1 at column 1. ** CLS 1 - Clears only the graphics view port. Has no effect for text mode. ** CLS 2 - Clears only the text view port. The print cursor is moved to the top row of the text view port at column 1. -* The {{Parameter|bgColor&}} specifies the color attribute or palette index to use when clearing the screen in '''QB64'''. +* The {{Parameter|bgColor&}} specifies the color attribute or palette index to use when clearing the screen in '''QB64'''. {{PageDescription}} -* In legacy [[SCREEN]] modes {{Parameter|bgColor&}} specifies the color attribute of the background. -* For 32-bit graphics mode, {{Parameter|bgColor&}} specifies the [[_RGB]] or [[_RGBA]] color to use. +* In legacy [[SCREEN]] modes {{Parameter|bgColor&}} specifies the color attribute of the background. +* For 32-bit graphics mode, {{Parameter|bgColor&}} specifies the [[_RGB]] or [[_RGBA]] color to use. * '''32-bit screen surface backgrounds (black) have zero [[_ALPHA]] so that they are transparent when placed over other surfaces.''' ** Use [[CLS]] or [[_DONTBLEND]] to make a new surface background [[_ALPHA]] 255 or opaque. -* If not specified, {{Parameter|bgColor&}} is assumed to be the current background color. 32-bit backgrounds will change to opaque. -* If {{Parameter|bgColor&}} is not a valid attribute, an [[ERROR Codes|illegal function call]] error will occur. +* If not specified, {{Parameter|bgColor&}} is assumed to be the current background color. 32-bit backgrounds will change to opaque. +* If {{Parameter|bgColor&}} is not a valid attribute, an [[ERROR Codes|illegal function call]] error will occur. * Use [[_PRINTMODE]] to allow the background colors to be visible through the text or the text background. {{PageExamples}} ''Example 1:'' Printing black text on a white background in QB64. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 12 {{Cl|CLS}} , 15 {{Cl|_PRINTMODE }} _KEEPBACKGROUND 'keeps the text background visible @@ -37,13 +39,13 @@ K$ = {{Cl|INPUT$}}(1 ''Example 2:'' You don't need to do anything special to use a .PNG image with alpha/transparency. Here's a simple example: -{{CodeStart}} '' '' +{{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 {{Cl|_PUTIMAGE}} (0, 0), i 'places image at upper left corner of window w/o stretching it -'' '' -{{CodeEnd}} '' '' + +{{CodeEnd}} : ''Explanation:'' When QB64 loads a .PNG file containing a transparent color, that color will be properly treated as transparent when _PUTIMAGE is used to put it onto another image. You can use a .PNG file containing transparency information in a 256-color screen mode in QB64. [[CLS]] sets the [[_CLEARCOLOR]] setting using [[_RGB]]. @@ -56,4 +58,4 @@ i = {{Cl|_LOADIMAGE}}('''"qb64_trans.png"''') 'see note below examples to get th {{PageNavigation}} -< + diff --git a/internal/help/COLOR.txt b/internal/help/COLOR.txt deleted file mode 100644 index f567c1eda..000000000 --- a/internal/help/COLOR.txt +++ /dev/null @@ -1,239 +0,0 @@ -The [[COLOR]] statement is used to change the foreground and background colors for printing text. - -{{PageSyntax}} -: [[COLOR]] [{{Parameter|foreground&}}][, {{Parameter|background&}}] - - -{{PageDescription}} -* {{Parameter|background&}} colors are available in all QB64 color SCREEN modes. -* [[SCREEN]] mode 10 has only 3 white foreground attributes including flashing. -* To change the {{Parameter|background&}} color only, use a comma and the desired color. Ex: [[COLOR]] , {{Parameter|background&}} -* Graphic drawing statements like [[PSET]], [[PRESET]], [[LINE]], etc, also use the colors set by the [[COLOR]] statement if no color is passed when they are called. -* The [[$COLOR]] metacommand adds named color constants for both text and 32-bit modes. - - -==Screen Mode Attributes== -* '''SCREEN 0''' {{Parameter|background&}} colors 0 to 7 can be changed each text character without affecting other text. Use [[CLS]] after a background color statement to create a fullscreen background color. 64 [[DAC]] hues with 16 high intensity blinking foreground (16 to 31) color attributes. See [[_BLINK]]. -** See example 7 below for more SCREEN 0 background colors. -* '''SCREEN 1''' has '''4 background color attributes''': 0 = black, 1 = blue, 2 = green, 3 = grey. White foreground color only. -* '''SCREEN 2''' is '''monochrome''' with white forecolor and black background. -* '''SCREEN 7''' can use 16 ([[DAC]]) colors with background colors. RGB settings can be changed in colors 0 to 7 using [[_PALETTECOLOR]]. -* '''SCREEN 8''' has 16 color attributes with 16 background colors. -* '''SCREEN 9''' can use up to 64 [[DAC]] color hues in 16 color attributes with background colors assigned to attribute 0 with a [[_PALETTECOLOR]] swap. RGB settings can be changed in colors 0 to 5 and 7 using [[_PALETTECOLOR]]. -* '''SCREEN 10''' has '''only 4 color attributes''' with black background. COLOR 0 = black, 1 = grey, 2 = flash white and 3 = bright white. -* '''SCREEN 11''' is '''monochrome''' with white forecolor and a black background. -* '''SCREEN 12''' can use 16 color attributes with a black background. 256K possible RGB color hues. Background colors can be used with QB64. -* '''SCREEN 13''' can use 256 color attributes with a black background. 256K possible RGB hues. -* [[PALETTE]] swaps can be made in SCREEN 7 and 9 only. Those screens were [[DAC]] screen modes in QBasic. -* [[_DEST]] can be used to set the destination page or image to color using '''QB64'''. -* [[_DEFAULTCOLOR]] returns the current color being used on an image or screen page handle. - - -===24/32-Bit colors using QB64=== -* Pixel color intensities for red, green, blue and alpha range from 0 to 255 when used with [[_RGB]], [[_RGBA]], [[_RGB32]] and [[RGBA32]]. -* Combined RGB function values returned are [[LONG]] values. '''Blue intensity values may be cut off using [[SINGLE]] variables.''' -* [[_ALPHA]] transparency values can range from 0 as transparent up to 255 which is fully opaque. -* [[_CLEARCOLOR]] can also be used to set a color as transparent. -* 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> - -==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 -{{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}} -{{Cl|COLOR}} 7 -{{Cl|FOR...NEXT|FOR}} attribute = 0 {{Cl|TO}} 15 - {{Cl|OUT}} {{Cl|&H}}3C7, attribute 'set color attribute to read - red$ = {{Cl|HEX$}}({{Cl|INP}}({{Cl|&H}}3C9) * 4) 'convert port setting to 32 bit values - grn$ = {{Cl|HEX$}}({{Cl|INP}}({{Cl|&H}}3C9) * 4) - blu$ = {{Cl|HEX$}}({{Cl|INP}}({{Cl|&H}}3C9) * 4) - {{Cl|IF...THEN|IF}} {{Cl|LEN}}(red$) = 1 {{Cl|THEN}} red$ = "0" + red$ '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|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}} -{{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. -:'''Note:''' Black has a blue hex value of 50 due to the [[OUT]] background color setting which makes it dark blue. - - -===Reading and setting color port intensities using [[INP]] and [[OUT]]=== -* Legacy code may use [[INP]] and [[OUT]] to read or set color port intensities. '''QB64''' emulates VGA memory to maintain compatibility. -* 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|OUT &H3C8, attribute|green}}''' 'Set port to write RGB settings with: -:'''{{text|OUT &H3C9, color_intensity|green}}''' 'writes new intensity setting - -* After every 3 reads or writes, changes to next higher color attribute. Loops can be used to set more than one attribute's intensities. -* 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> - - -{{PageExamples}} -''Example 1:'' Reading the default RGB color settings of color attribute 15. -{{CodeStart}} '' '' - {{Cl|OUT}} &H3C7, 15 - red% = {{Cl|INP}}(&H3C9) - green% = {{Cl|INP}}(&H3C9) - blue% = {{Cl|INP}}(&H3C9) - {{Cl|PRINT}} red%, green%, blue% '' '' -{{CodeEnd}} - -{{OutputStart}} - 63 63 63 -{{OutputEnd}} - - -''Example 2:'' Changing the color settings of attribute 0 (the background) to dark blue in [[SCREEN]]s 12 or 13. -{{CodeStart}} '' '' -{{Cl|SCREEN}} 12 -{{Cl|OUT}} {{Cl|&H}}3C8, 0 'set color port attribute to write -{{Cl|OUT}} {{Cl|&H}}3C9, 0 'red intensity -{{Cl|OUT}} {{Cl|&H}}3C9, 0 'green intensity -{{Cl|OUT}} {{Cl|&H}}3C9, 30 'blue intensity - -{{Cl|OUT}} {{Cl|&H}}3C7, 0 -{{Cl|PRINT}} {{Cl|INP}}({{Cl|&H}}3C9); {{Cl|INP}}({{Cl|&H}}3C9); {{Cl|INP}}({{Cl|&H}}3C9) -{{Cl|END}}'' '' -{{CodeEnd}} -{{CodeStart}} 0 0 30 {{CodeEnd}} - - -''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!" '' '' -{{CodeEnd}} -:''Result:'' Hello! is printed in flashing high intensity yellow with brown background behind text only when in Qbasic [[_FULLSCREEN|fullscreen]]. - - -''Example 4:'' Using [[CLS]] after setting the background color in SCREEN 0 to make the color cover the entire screen. -{{CodeStart}} '' '' -{{Cl|SCREEN}} 0: {{Cl|_FULLSCREEN}} -{{Cl|COLOR}} , 7: {{Cl|CLS}} -{{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]]. - - -''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" '' '' -{{CodeEnd}} - -{{OutputStart}} -{{text|H|darkblue}}{{text|E|darkcyan}}{{text|L|darkred}}{{text|L|darkmagenta}}{{text|O|goldenrod}} -{{text|W|blue}}{{text|O|cyan}}{{text|R|red}}{{text|L|magenta}}{{text|D|yellow}} -{{OutputEnd}} - - -''Example 6:'' Doing the same as Example 5 but in only a few lines: -{{CodeStart}} '' '' -{{Cl|SCREEN (statement)|SCREEN}} 0 -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) 'start print on next row -{{Cl|NEXT}} - -{{CodeEnd}} -{{OutputStart}} -{{text|H|darkblue}}{{text|e|darkgreen}}{{text|l|darkcyan}}{{text|l|darkred}}{{text|o|darkmagenta}} -{{text|W|goldenrod}}{{text|o|lightgrey}}{{text|r|dimgray}}{{text|l|blue}}{{text|d|lime}} '' '' -{{OutputEnd}} -: ''Explanation:''Semicolon(;) means that the next PRINT happens on the same line, we don't want that when it comes to position 5 so when it is at position 5 the next PRINT will move to the next line (when it isn't at position 5 we want it to continue printing the letter side-by-side on the same line though). - - -''Example 7:'' Since SCREEN 0 only uses background colors 0 to 7 by default, use [[_PALETTECOLOR]] to change color intensities of color 0. -{{CodeStart}} '' '' -{{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!" '' '' -{{CodeEnd}} -{{WhiteStart}}'''{{text|Black on bright white!|#000000}}''' -{{WhiteEnd}} ----- -: ''Explanation:'' Since QB64 does not have [[DAC]] [[SCREEN]] 0 limitations, changing color intensities for custom background colors is possible. - - -''Example 8:'' Changing light gray text in [[SCREEN]] 0 to a 32 bit custom color using a [[LONG]] HTML hexadecimal value: -{{CodeStart}} '' '' -{{Cl|COLOR}} 7 -{{Cl|PRINT}} "Color 7 is gray" -K$ = {{Cl|INPUT$}}(1) -{{Cl|_PALETTECOLOR}} 7, {{Cl|&H}}FFDAA520 ' FF alpha makes the color translucent -{{Cl|PRINT}} "Color 7 is now Goldenrod in {{Cl|SCREEN}} 0! '' '' -{{CodeEnd}} -{{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> - - -{{PageSeeAlso}} -* [[$COLOR]] (metacommand) -* [[_RGB]], [[_RGBA]], [[_RGB32]], [[RGBA32]]. -* [[_RED]], [[_GREEN]], [[_BLUE]] -* [[_RED32]], [[_GREEN32]], [[_BLUE32]] -* [[_ALPHA]], [[_ALPHA32]], [[_CLEARCOLOR]] -* [[PRINT]], [[LOCATE]], [[SCREEN]] -* [[POINT]], [[SCREEN (function)]] -* [[OUT]], [[INP]], [[PALETTE]] -* [[_BLINK]] -* [[_DEFAULTCOLOR]] -* [[_BACKGROUNDCOLOR]] -* [[_PALETTECOLOR]] -* [[Windows_Libraries#Color_Dialog_Box|Color Dialog Box]] -* [http://www.w3schools.com/html/html_colornames.asp Hexadecimal Color Values] - - -{{PageNavigation}} -< diff --git a/internal/help/COLOR_11111.txt b/internal/help/COLOR_11111.txt new file mode 100644 index 000000000..71b037411 --- /dev/null +++ b/internal/help/COLOR_11111.txt @@ -0,0 +1,196 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:21}} +The [[COLOR]] statement is used to change the foreground and background colors for printing text. + +{{PageSyntax}} +: [[COLOR]] [{{Parameter|foreground&}}][, {{Parameter|background&}}] + + +{{PageDescription}} +* {{Parameter|background&}} colors are available in all QB64 color SCREEN modes. +* [[SCREEN]] mode 10 has only 3 white foreground attributes including flashing. +* To change the {{Parameter|background&}} color only, use a comma and the desired color. Ex: [[COLOR]] , {{Parameter|background&}} +* Graphic drawing statements like [[PSET]], [[PRESET]], [[LINE]], etc, also use the colors set by the [[COLOR]] statement if no color is passed when they are called. +* The [[$COLOR]] metacommand adds named color constants for both text and 32-bit modes. + + +==Screen Mode Attributes== +* '''SCREEN 0''' {{Parameter|background&}} colors 0 to 7 can be changed each text character without affecting other text. Use [[CLS]] after a background color statement to create a fullscreen background color. 64 [[DAC]] hues with 16 high intensity blinking foreground (16 to 31) color attributes. See [[_BLINK]]. +** See example 7 below for more SCREEN 0 background colors. +* '''SCREEN 1''' has '''4 background color attributes''': 0 = black, 1 = blue, 2 = green, 3 = grey. White foreground color only. +* '''SCREEN 2''' is '''monochrome''' with white forecolor and black background. +* '''SCREEN 7''' can use 16 ([[DAC]]) colors with background colors. RGB settings can be changed in colors 0 to 7 using [[_PALETTECOLOR]]. +* '''SCREEN 8''' has 16 color attributes with 16 background colors. +* '''SCREEN 9''' can use up to 64 [[DAC]] color hues in 16 color attributes with background colors assigned to attribute 0 with a [[_PALETTECOLOR]] swap. RGB settings can be changed in colors 0 to 5 and 7 using [[_PALETTECOLOR]]. +* '''SCREEN 10''' has '''only 4 color attributes''' with black background. COLOR 0 = black, 1 = grey, 2 = flash white and 3 = bright white. +* '''SCREEN 11''' is '''monochrome''' with white forecolor and a black background. +* '''SCREEN 12''' can use 16 color attributes with a black background. 256K possible RGB color hues. Background colors can be used with QB64. +* '''SCREEN 13''' can use 256 color attributes with a black background. 256K possible RGB hues. +* [[PALETTE]] swaps can be made in SCREEN 7 and 9 only. Those screens were [[DAC]] screen modes in QBasic. +* [[_DEST]] can be used to set the destination page or image to color using '''QB64'''. +* [[_DEFAULTCOLOR]] returns the current color being used on an image or screen page handle. + + +===24/32-Bit colors using QB64=== +* Pixel color intensities for red, green, blue and alpha range from 0 to 255 when used with [[_RGB]], [[_RGBA]], [[_RGB32]] and [[RGBA32]]. +* Combined RGB function values returned are [[LONG]] values. '''Blue intensity values may be cut off using [[SINGLE]] variables.''' +* [[_ALPHA]] transparency values can range from 0 as transparent up to 255 which is fully opaque. +* [[_CLEARCOLOR]] can also be used to set a color as transparent. +* 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.''' + +

([[#toc|Return to Table of Contents]])

+ +==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 +{{Cl|PRINT}} "Attribute = Hex value Red Green Blue " +{{Cl|PRINT}} +{{Cl|COLOR}} 7 +{{Cl|FOR...NEXT|FOR}} attribute = 1 {{Cl|TO}} 15 + {{Cl|OUT}} {{Cl|&H}}3C7, attribute 'set color attribute to read + red$ = {{Cl|HEX$}}({{Cl|INP}}({{Cl|&H}}3C9) * 4) 'convert port setting to 32 bit values + grn$ = {{Cl|HEX$}}({{Cl|INP}}({{Cl|&H}}3C9) * 4) + blu$ = {{Cl|HEX$}}({{Cl|INP}}({{Cl|&H}}3C9) * 4) + {{Cl|IF...THEN|IF}} {{Cl|LEN}}(red$) = 1 {{Cl|THEN}} red$ = "0" + red$ '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|NEXT}} +{{CodeEnd}} +{{OutputStart}}Attribute Hex value Red Green Blue + +{{text|COLOR 1 = &HFF0000A8 00 00 A8|#0050A8}} +{{text|COLOR 2 = &HFF00A800 00 A8 00|#00A800}} +{{text|COLOR 3 = &HFF00A8A8 00 A8 A8|#00A8A8}} +{{text|COLOR 4 = &HFFA80000 A8 00 00|#A80000}} +{{text|COLOR 5 = &HFFA800A8 A8 00 A8|#A800A8}} +{{text|COLOR 6 = &HFFA85400 A8 54 00|#A85400}} +{{text|COLOR 7 = &HFFA8A8A8 A8 A8 A8|#A8A8A8}} +{{text|COLOR 8 = &HFF545454 54 54 54|#545454}} +{{text|COLOR 9 = &HFF5454FC 54 54 FC|#5454FC}} +{{text|COLOR 10 = &HFF54FC54 54 FC 54|#54FC54}} +{{text|COLOR 11 = &HFF5454FC 54 FC FC|#54FCFC}} +{{text|COLOR 12 = &HFFFC5454 FC 54 54|#FC5454}} +{{text|COLOR 13 = &HFFFC54FC FC 54 FC|#FC54FC}} +{{text|COLOR 14 = &HFFFCFC54 FC FC 54|#FCFC54}} +{{text|COLOR 15 = &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. + + +===Read & write color port intensities with [[INP]] & [[OUT]]=== +* Legacy code may use [[INP]] and [[OUT]] to read or set color port intensities. '''QB64''' emulates VGA memory to maintain compatibility. +* The same can be achieved using [[_PALETTECOLOR]] ('''recommended practice'''). + +:'''{{text|OUT &H3C7, attribute|green}}''' 'Set port to read RGB settings with: +:'''{{text|color_intensity = 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 + +* After every 3 reads or writes, changes to next higher color attribute. Loops can be used to set more than one attribute's intensities. +* 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. + +

([[#toc|Return to Table of Contents]])

+ + +{{PageExamples}} +''Example 1:'' Reading the default RGB color settings of color attribute 15. +{{CodeStart}} + {{Cl|OUT}} &H3C7, 15 + red% = {{Cl|INP}}(&H3C9) + green% = {{Cl|INP}}(&H3C9) + blue% = {{Cl|INP}}(&H3C9) + {{Cl|PRINT}} red%, green%, blue% +{{CodeEnd}} + +{{OutputStart}} + 63 63 63 +{{OutputEnd}} + + +''Example 2:'' Changing the color settings of attribute 0 (the background) to blue in [[SCREEN]]s 12 or 13. +{{CodeStart}} +{{Cl|SCREEN}} 12 +{{Cl|OUT}} {{Cl|&H}}3C8, 0 'set color port attribute to write +{{Cl|OUT}} {{Cl|&H}}3C9, 0 'red intensity +{{Cl|OUT}} {{Cl|&H}}3C9, 0 'green intensity +{{Cl|OUT}} {{Cl|&H}}3C9, 42 'blue intensity + +{{Cl|OUT}} {{Cl|&H}}3C7, 0 +{{Cl|PRINT}} {{Cl|INP}}({{Cl|&H}}3C9); {{Cl|INP}}({{Cl|&H}}3C9); {{Cl|INP}}({{Cl|&H}}3C9) +{{Cl|END}} +{{CodeEnd}} +{{OutputStartBG1}} 0 0 42 {{OutputEnd}} + + +''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}} 14, 6: {{Cl|LOCATE}} 4, 4: {{Cl|PRINT}} "Hello!" +{{CodeEnd}} +{{OutputStart}} + + + {{Ot|Hello!|#fcfc54|#aa5500}} +{{OutputEnd}} + + +''Example 4:'' Using [[CLS]] after setting the background color in SCREEN 0 to make the color cover the entire screen. +{{CodeStart}} +{{Cl|SCREEN}} 0: {{Cl|_FULLSCREEN}} +{{Cl|COLOR}} , 7: {{Cl|CLS}} +{{Cl|COLOR}} 9: {{Cl|PRINT}} "Hello" +{{CodeEnd}} +{{OutputStartBG7}} +{{Text|Hello|#5454fc}} +{{OutputEnd}} + + +''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" +{{CodeEnd}} + +{{OutputStart}} +{{text|H|#0000aa}}{{text|E|#00aaaa}}{{text|L|#aa0000}}{{text|L|#aa00aa}}{{text|O|#aa5500}} +{{text|W|#5454fc}}{{text|O|#54fcfc}}{{text|R|#fc5454}}{{text|L|#fc54fc}}{{text|D|#fcfc54}} +{{OutputEnd}} + + +{{PageSeeAlso}} +* [[$COLOR]] (metacommand) +* [[_RGB]], [[_RGBA]], [[_RGB32]], [[RGBA32]]. +* [[_RED]], [[_GREEN]], [[_BLUE]] +* [[_RED32]], [[_GREEN32]], [[_BLUE32]] +* [[_ALPHA]], [[_ALPHA32]], [[_CLEARCOLOR]] +* [[PRINT]], [[LOCATE]], [[SCREEN]] +* [[POINT]], [[SCREEN (function)]] +* [[OUT]], [[INP]], [[PALETTE]] +* [[_BLINK]] +* [[_DEFAULTCOLOR]] +* [[_BACKGROUNDCOLOR]] +* [[_PALETTECOLOR]] +* [[Windows_Libraries#Color_Dialog_Box|Color Dialog Box]] +* [http://www.w3schools.com/html/html_colornames.asp Hexadecimal Color Values] + + +{{PageNavigation}} + diff --git a/internal/help/COMMAND$.txt b/internal/help/COMMAND$_1111111$.txt similarity index 97% rename from internal/help/COMMAND$.txt rename to internal/help/COMMAND$_1111111$.txt index f184710bd..88479e171 100644 --- a/internal/help/COMMAND$.txt +++ b/internal/help/COMMAND$_1111111$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:22}} The '''COMMAND$''' function returns the command line argument(s) passed when a program is run. @@ -24,13 +26,13 @@ K$ = {{Cl|INPUT$}}(1) {{Cl|SYSTEM}} {{CodeEnd}} : ''ProgramB'' checks for fullscreen parameter pass in QB64 and goes full screen. -{{CodeStart}} '' '' +{{CodeStart}} {{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|END}} '' '' +{{Cl|END}} {{CodeEnd}} {{OutputStart}} ProgramB @@ -59,7 +61,7 @@ a data file cmd$ = {{Cl|COMMAND$}}(count) {{Cl|IF...THEN|IF}} cmd$ = "" {{Cl|THEN}} {{Cl|EXIT DO}} 'read until an empty return {{Cl|PRINT}} cmd$ 'or process commands sent -{{Cl|LOOP}} '' '' +{{Cl|LOOP}} count = count - 1 'save the number of parameters sent to this program when run {{CodeEnd}} @@ -71,4 +73,4 @@ count = count - 1 'save the number of parameters sent to this program when run {{PageNavigation}} -< + diff --git a/internal/help/COMMON.txt b/internal/help/COMMON_111111.txt similarity index 68% rename from internal/help/COMMON.txt rename to internal/help/COMMON_111111.txt index 8d0b3f91e..f1e16bd44 100644 --- a/internal/help/COMMON.txt +++ b/internal/help/COMMON_111111.txt @@ -1,13 +1,15 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:23}} [[COMMON]] shares common variable values with other linked or [[CHAIN]]ed modules. -==Legacy support== -* The multi-modular technique goes back to when QBasic and QuickBASIC had module size constraints. In QB64 [[COMMON]] has been implemented so that that older code can still be compiled, though '''it is advisable to use single modules for a single project (not counting [[$INCLUDE]] libraries), for ease of sharing and also because the module size constraints no longer exist.''' - - {{PageSyntax}} : [[COMMON]] [SHARED] variableList +{{PageLegacySupport}} +* The multi-modular technique goes back to when '''QBasic''' and '''QuickBASIC''' had module size constraints. In '''QB64''' the [[COMMON]] statement has been implemented so that that older code can still be compiled, though it is advisable to use single modules for a single project (not counting [[$INCLUDE]] libraries), for ease of sharing and also because the module size constraints no longer exist. + + {{PageDescription}} * COMMON must be called before any executable statements. * [[SHARED]] makes the variables shared within [[SUB]] and [[FUNCTION]] procedures within that module. @@ -23,4 +25,4 @@ * [[DEFSTR]], [[DEFLNG]], [[DEFINT]], [[DEFSNG]], [[DEFDBL]] {{PageNavigation}} -< + diff --git a/internal/help/CONST.txt b/internal/help/CONST_11111.txt similarity index 98% rename from internal/help/CONST.txt rename to internal/help/CONST_11111.txt index 23ba5776b..9a271aa4a 100644 --- a/internal/help/CONST.txt +++ b/internal/help/CONST_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:24}} The [[CONST]] statement globally defines one or more named numeric or string values which will not change while the program is running. @@ -54,7 +56,7 @@ Enter the radius of a circle or zero to quit? ''0'' ''Example 2'': Using _RGB32 to set a constant's value. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|CONST}} Red = _RGB32(255,0,0) {{Cl|COLOR}} Red @@ -69,4 +71,4 @@ Enter the radius of a circle or zero to quit? ''0'' {{PageNavigation}} -< + diff --git a/internal/help/COS.txt b/internal/help/COS_111.txt similarity index 92% rename from internal/help/COS.txt rename to internal/help/COS_111.txt index c790b2f26..fd8640a5c 100644 --- a/internal/help/COS.txt +++ b/internal/help/COS_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:25}} The [[COS]] function returns the horizontal component or the cosine of an angle measured in radians. @@ -10,15 +12,15 @@ The [[COS]] function returns the horizontal component or the cosine of an angle {{PageDescription}} -* To convert from degrees to radians, multiply degrees * &pi; / 180. -* [[COS]]INE is the horizontal component of a unit vector in the direction theta (&theta;). +* To convert from degrees to radians, multiply degrees * γ / 180. +* [[COS]]INE is the horizontal component of a unit vector in the direction theta (ι). * COS(x) can be calculated in either [[SINGLE]] or [[DOUBLE]] precision depending on its argument. ::: COS(4) = -.6536436 ...... COS(4#) = -.6536436208636119 {{PageExamples}} ''Example 1:'' Converting degree angles to radians for QBasic's trig functions and drawing the line at the angle. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 12 PI = 4 * {{Cl|ATN}}(1) {{Cl|PRINT}} "PI = 4 * {{Cl|ATN}}(1) ="; PI @@ -35,7 +37,7 @@ PI = 4 * {{Cl|ATN}}(1) {{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|LOOP}} {{Cl|UNTIL}} DEGREES% = 0 '' '' +{{Cl|LOOP}} {{Cl|UNTIL}} DEGREES% = 0 {{CodeEnd}} {{OutputStart}} PI = 4 * ATN(1) = 3.141593 @@ -52,7 +54,7 @@ DEGREES% = RADIANS * 180 / PI = 45 ''Example 2:'' Creating 12 analog clock hour points using [[CIRCLE]]s and [[PAINT]] -{{CodeStart}} '' '' +{{CodeStart}} PI2 = 8 * {{Cl|ATN}}(1) '2 * Ο€ arc! = PI2 / 12 'arc interval between hour circles {{Cl|SCREEN (statement)|SCREEN}} 12 @@ -61,14 +63,14 @@ DEGREES% = RADIANS * 180 / PI = 45 cy% = {{Cl|CINT}}({{Cl|SIN}}(t!) * 70) ' pixel rows {{Cl|CIRCLE}} (cx% + 320, cy% + 240), 3, 12 {{Cl|PAINT}} {{Cl|STEP}}(0, 0), 9, 12 - NEXT '' '' + NEXT {{CodeEnd}} {{small|Code by Ted Weissgerber}} ''Explanation:'' The 12 circles are placed at radian angles that are 1/12 of 6.28318 or .523598 radians apart. ''Example 3:'' Creating a rotating spiral with COS and [[SIN]]. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, 32) {{Cl|DO...LOOP|DO}} @@ -89,7 +91,7 @@ DEGREES% = RADIANS * 180 / PI = 45 {{Cl|_DISPLAY}} {{Cl|_LIMIT}} 30 -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INP}}({{Cl|&H}}60) = 1 'escape exit '' '' +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INP}}({{Cl|&H}}60) = 1 'escape exit {{CodeEnd}} {{small|Code by Ben}} @@ -104,4 +106,4 @@ DEGREES% = RADIANS * 180 / PI = 45 {{PageNavigation}} -< + diff --git a/internal/help/CSNG.txt b/internal/help/CSNG_1111.txt similarity index 93% rename from internal/help/CSNG.txt rename to internal/help/CSNG_1111.txt index e76c343e2..80dc9d073 100644 --- a/internal/help/CSNG.txt +++ b/internal/help/CSNG_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:27}} [[CSNG]] converts a numerical value to the closest [[SINGLE]]-precision number. @@ -30,4 +32,4 @@ {{PageNavigation}} -< + diff --git a/internal/help/CSRLIN.txt b/internal/help/CSRLIN_111111.txt similarity index 95% rename from internal/help/CSRLIN.txt rename to internal/help/CSRLIN_111111.txt index 515ef3646..5788b2697 100644 --- a/internal/help/CSRLIN.txt +++ b/internal/help/CSRLIN_111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:28}} The [[CSRLIN]] function returns the current text row position of the [[PRINT]] cursor. @@ -16,13 +18,13 @@ 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}} '' '' +{{CodeStart}} LOCATE 5, 5: PRINT "HELLO "; Y = {{Cl|CSRLIN}} 'save the row X = {{Cl|POS}}(0) 'save the column LOCATE 10, 10: PRINT "WORLD" LOCATE Y, X 'restore saved position - PRINT "GOODBYE" '' '' + PRINT "GOODBYE" {{CodeEnd}} {{OutputStart}} @@ -48,4 +50,4 @@ The [[CSRLIN]] function returns the current text row position of the [[PRINT]] c {{PageNavigation}} -< + diff --git a/internal/help/CVDMBF.txt b/internal/help/CVDMBF_111111.txt similarity index 97% rename from internal/help/CVDMBF.txt rename to internal/help/CVDMBF_111111.txt index ef0f1fed8..92da9e86c 100644 --- a/internal/help/CVDMBF.txt +++ b/internal/help/CVDMBF_111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:31}} The [[CVDMBF]] function decodes an 8-byte [[STRING]] generated by [[MKDMBF$]] (or read from a file) to [[DOUBLE]] numeric values. @@ -37,4 +39,4 @@ The string above, decoded using CVDMBF: 77000.24523213 {{PageNavigation}} -< + diff --git a/internal/help/CVD.txt b/internal/help/CVD_111.txt similarity index 96% rename from internal/help/CVD.txt rename to internal/help/CVD_111.txt index 52a924641..d96ef9128 100644 --- a/internal/help/CVD.txt +++ b/internal/help/CVD_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:29}} The [[CVD]] function decodes an 8-byte [[STRING]] generated by [[MKD$]] (or read from a file) to [[DOUBLE]] numeric values. @@ -14,10 +16,10 @@ The [[CVD]] function decodes an 8-byte [[STRING]] generated by [[MKD$]] (or read {{PageExamples}} ''Example 1:'' Reading an 8-byte encoded string n$ from a file and obtaining the decoded [[DOUBLE]] value: -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|FIELD}} #1, 8 {{Cl|AS}} N$, 12 {{Cl|AS}} B$... {{Cl|GET}} #1 -Y# = {{Cl|CVD}}(N$) '' '' +Y# = {{Cl|CVD}}(N$) {{CodeEnd}} : ''Explanation:'' Reads a field from file #1, and converts the first eight bytes (N$) into an double-precision number assigned to the variable Y#. @@ -48,4 +50,4 @@ The string above, decoded using CVD: 77000.24523213 {{PageNavigation}} -< + diff --git a/internal/help/CVI.txt b/internal/help/CVI_111.txt similarity index 93% rename from internal/help/CVI.txt rename to internal/help/CVI_111.txt index faa62372b..c333a7a88 100644 --- a/internal/help/CVI.txt +++ b/internal/help/CVI_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:32}} The [[CVI]] function decodes a 2-byte [[STRING]] generated by [[MKI$]] (or read from a file) to [[INTEGER]] numeric values. @@ -14,10 +16,10 @@ The [[CVI]] function decodes a 2-byte [[STRING]] generated by [[MKI$]] (or read {{PageExamples}} ''Example 1:'' -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|FIELD}} #1, 2 {{Cl|AS}} N$, 12 {{Cl|AS}} B$... {{Cl|GET}} #1 'GET does not need a position or variable with successive FIELD buffer reads -Y = {{Cl|CVI}}(N$) '' '' +Y = {{Cl|CVI}}(N$) {{CodeEnd}} :''Explanation:'' Reads a field from file #1, and converts the first two bytes (N$) into an integer number assigned to the variable Y. :Since the representation of an integer number can use up to 5 ASCII characters (five bytes), writing to a file using [[MKI$]] conversion, and then reading back with the [[CVI]] conversion can save up to 3 bytes of storage space. @@ -31,12 +33,12 @@ Q = {{Cl|CHR$}}(34) ' create Print using templates to align the values returned tmp1$ = "1st character code = ### * 1 = ### " tmp2$ = "2nd character code = ### * 256 = ##### " -tmp3$ = " & " +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|IF...THEN|IF}} number% < 1 {{Cl|THEN}} {{Cl|EXIT DO}} + {{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 @@ -50,7 +52,7 @@ tmp4$ = " CVI Total = ##### " {{Cl|LOCATE}} 20, 20: {{Cl|PRINT USING}} tmp3$; "-----" {{Cl|LOCATE}} 21, 20: {{Cl|PRINT USING}} tmp4$; asc1% + (256 * asc2%) {{Cl|LOOP}} -{{Cl|SYSTEM}} '' '' +{{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). @@ -63,4 +65,4 @@ tmp4$ = " CVI Total = ##### " {{PageNavigation}} -< + diff --git a/internal/help/CVL.txt b/internal/help/CVL_111.txt similarity index 88% rename from internal/help/CVL.txt rename to internal/help/CVL_111.txt index 7d1316a54..b9b0c8f8c 100644 --- a/internal/help/CVL.txt +++ b/internal/help/CVL_111.txt @@ -1,8 +1,10 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:33}} The [[CVL]] function decodes a 4-byte [[STRING]] generated by [[MKL$]] (or read from a file) to [[LONG]] numeric values. {{PageSyntax}} -: {{Parameter|result&}} = [[CVL]]({{Parameter|stringData$}}) +: {{Parameter|result&}} = [[CVL]]({{Parameter|stringData$}}) {{PageDescription}} @@ -14,21 +16,21 @@ The [[CVL]] function decodes a 4-byte [[STRING]] generated by [[MKL$]] (or read {{PageExamples}} ''Example 1: 4 byte [[ASCII]] character strings show how CVL multipliers convert [[MKL$]] values into a 4 byte [[LONG]] value. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|PRINT}} {{Cl|CVL}}({{Cl|CHR$}}(1) + {{Cl|STRING$}}(3, 0)) '{{Cl|ASC}}(CHR$(1)) * 1 = 1 {{Cl|PRINT}} {{Cl|CVL}}({{Cl|CHR$}}(0) + {{Cl|CHR$}}(1) + {{Cl|STRING$}}(2, 0)) '{{Cl|ASC}}(CHR$(1)) * 256 = 256 {{Cl|PRINT}} {{Cl|CVL}}({{Cl|STRING$}}(2, 0) + {{Cl|CHR$}}(1) + {{Cl|CHR$}}(0)) '{{Cl|ASC}}(CHR$(1)) * 256 * 256 = 65536 -{{Cl|PRINT}} {{Cl|CVL}}({{Cl|STRING$}}(3, 0) + {{Cl|CHR$}}(1)) '{{Cl|ASC}}(CHR$(1)) * 256 * 256 * 256 = 16777216 '' '' +{{Cl|PRINT}} {{Cl|CVL}}({{Cl|STRING$}}(3, 0) + {{Cl|CHR$}}(1)) '{{Cl|ASC}}(CHR$(1)) * 256 * 256 * 256 = 16777216 {{CodeEnd}} ''Example 2:'' -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|FIELD}} #1, 4 {{Cl|AS}} N$, 12 {{Cl|AS}} B$... {{Cl|GET}} #1 -Y& = {{Cl|CVL}}(N$) '' '' +Y& = {{Cl|CVL}}(N$) {{CodeEnd}} -:''Explanation:'' Reads a field from file #1, and converts the first four bytes (N$) into a long integer value assigned to the variable Y&. +:''Explanation:'' Reads a field from file #1, and converts the first four bytes (N$) into a long integer value assigned to the variable Y&. :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. @@ -40,4 +42,4 @@ Y& = {{Cl|CVL}}(N$) '' '' {{PageNavigation}} -< + diff --git a/internal/help/CVSMBF.txt b/internal/help/CVSMBF_111111.txt similarity index 97% rename from internal/help/CVSMBF.txt rename to internal/help/CVSMBF_111111.txt index e35259d1c..1bac30ebe 100644 --- a/internal/help/CVSMBF.txt +++ b/internal/help/CVSMBF_111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:36}} The [[CVDMBF]] function decodes a 4-byte [[STRING]] generated by [[MKSMBF$]] (or read from a file) to [[SINGLE]] numeric values. @@ -35,4 +37,4 @@ The string above, decoded using CVSMBF: 700.2213 {{PageNavigation}} -< + diff --git a/internal/help/CVS.txt b/internal/help/CVS_111.txt similarity index 96% rename from internal/help/CVS.txt rename to internal/help/CVS_111.txt index e6f3bbf13..3ffb47b2d 100644 --- a/internal/help/CVS.txt +++ b/internal/help/CVS_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:34}} The [[CVS]] function decodes a 4-byte [[STRING]] generated by [[MKS$]] (or read from a file) to [[SINGLE]] numeric values. @@ -35,4 +37,4 @@ The string above, decoded using CVS: 700.2213 {{PageNavigation}} -< + diff --git a/internal/help/Colon.txt b/internal/help/Colon_10000.txt similarity index 93% rename from internal/help/Colon.txt rename to internal/help/Colon_10000.txt index 6b56527c0..f61c345c0 100644 --- a/internal/help/Colon.txt +++ b/internal/help/Colon_10000.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:24:41}} A '''colon''' can be used to separate two unrelated procedure statements on the same line. @@ -20,4 +22,4 @@ A '''colon''' can be used to separate two unrelated procedure statements on the {{PageNavigation}} -< + diff --git a/internal/help/DATA.txt b/internal/help/DATA_1111.txt similarity index 94% rename from internal/help/DATA.txt rename to internal/help/DATA_1111.txt index 4398a0145..2555ecacc 100644 --- a/internal/help/DATA.txt +++ b/internal/help/DATA_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:37}} The [[DATA]] statement creates a line of fixed program information separated by commas. The DATA can be later READ by the program at runtime. @@ -23,7 +25,7 @@ The [[DATA]] statement creates a line of fixed program information separated by {{PageExamples}} ''Example 1:'' Creating two DATA fields that can be [[READ]] repeatedly using [[RESTORE]] with the appropriate line label. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|RESTORE}} Database2 {{Cl|READ}} A$, B$, C$, D$ 'read 4 string values from second DATA field PRINT A$ + B$ + C$ + D$ 'note that quoted strings values are spaced @@ -41,7 +43,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 @@ -49,9 +51,9 @@ Database2: ''Example 2:'' How to [[RESTORE]] and [[READ]] DATA in a [[SUB]] procedure in QB64. Line labels can be used for multiple DATA fields. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DIM}} {{Cl|SHARED}} num(10) 'shared array or must be passed as a parameter -ReadData 2 '<<<<<<< change value to 1 to read other data +ReadData 2 '<<<<<<< change value to 1 to read other data {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 10 {{Cl|PRINT}} num(i); {{Cl|NEXT}} @@ -67,7 +69,7 @@ mydata1: {{Cl|DATA}} 1,2,3,4,5,6,7,8,9,10 mydata2: {{Cl|DATA}} 10,9,8,7,6,5,4,3,2,1 -{{Cl|END SUB}} '' '' +{{Cl|END SUB}} {{CodeEnd}} {{OutputStart}} 10 9 8 7 6 5 4 3 2 1 {{OutputEnd}} @@ -79,4 +81,4 @@ mydata2: {{PageNavigation}} -< + diff --git a/internal/help/DATE$_(statement).txt b/internal/help/DATE$_(statement).txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/DATE$_(statement).txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/DATE$.txt b/internal/help/DATE$_1111$.txt similarity index 89% rename from internal/help/DATE$.txt rename to internal/help/DATE$_1111$.txt index 5288e348a..694cf32c3 100644 --- a/internal/help/DATE$.txt +++ b/internal/help/DATE$_1111$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:38}} The [[DATE$]] function returns the current computer date as a string in the format "mm-dd-yyyy". @@ -11,7 +13,7 @@ The [[DATE$]] function returns the current computer date as a string in the form {{PageExamples}} ''Example:'' Displaying the weekday and current date. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|PRINT}} {{Cl|DATE$}} month$ = {{Cl|LEFT$}}({{Cl|DATE$}}, 2): M = {{Cl|VAL}}(month$) day$ = {{Cl|MID$}}({{Cl|DATE$}}, 4, 2): D = {{Cl|VAL}}(day$) @@ -35,13 +37,13 @@ year$ = {{Cl|RIGHT$}}({{Cl|DATE$}}, 4): Y = {{Cl|VAL}}(year$) {{Cl|DEFINT}} A-Z {{Cl|FUNCTION}} WeekDay$ (M, D, Y) -{{Cl|IF}} M < 3 {{Cl|THEN}} M = M + 12: Y = Y - 1 'add 12 to Jan - Feb month, -1 year +{{Cl|IF}} M < 3 {{Cl|THEN}} M = M + 12: Y = Y - 1 'add 12 to Jan - Feb month, -1 year C = Y \ 100: Y = Y {{Cl|MOD}} 100 'split century and year number S1 = (C \ 4) - (2 * C) - 1 'century leap S2 = (5 * Y) \ 4 '4 year leap 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|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" @@ -52,7 +54,7 @@ WkDay = (S1 + S2 + S3 + D) {{Cl|MOD}} 7 'weekday total remainder {{Cl|CASE}} 6: day$ = "Saturday" {{Cl|END SELECT}} WeekDay$ = day$ -{{Cl|END FUNCTION}} '' '' +{{Cl|END FUNCTION}} {{CodeEnd}} {{small|Code by Ted Weissgerber}} {{OutputStart}} @@ -68,4 +70,4 @@ Today is Wednesday, June 2, 2010 {{PageNavigation}} -< + diff --git a/internal/help/DECLARE_(non-BASIC_statement).txt b/internal/help/DECLARE_(non-BASIC_statement).txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/DECLARE_(non-BASIC_statement).txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/DECLARE_DYNAMIC_LIBRARY.txt b/internal/help/DECLARE_DYNAMIC_LIBRARY_1111111_1111111_1111111.txt similarity index 87% rename from internal/help/DECLARE_DYNAMIC_LIBRARY.txt rename to internal/help/DECLARE_DYNAMIC_LIBRARY_1111111_1111111_1111111.txt index 77d1d9cc9..d84722c3e 100644 --- a/internal/help/DECLARE_DYNAMIC_LIBRARY.txt +++ b/internal/help/DECLARE_DYNAMIC_LIBRARY_1111111_1111111_1111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:31}} '''DECLARE DYNAMIC LIBRARY''' allows you to dynamically link your program to functions in dynamically linkable libraries. At present, only ''.DLL'' files are supported (support for ''.so'' will be added soon). These libraries are loaded when your program begins. @@ -34,9 +36,9 @@ {{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: [https://www.qb64.org/resources/Playmidi32.dll PlayMidi32.dll] -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DECLARE DYNAMIC LIBRARY}} "playmidi32" - {{Cl|FUNCTION}} PlayMIDI& (filename {{Cl|AS}} {{Cl|STRING}}) + {{Cl|FUNCTION}} PlayMIDI& (filename {{Cl|AS}} {{Cl|STRING}}) {{Cl|DECLARE LIBRARY|END DECLARE}} result = PlayMIDI(".\samples\qb64\original\ps2battl.mid" + {{Cl|CHR$}}(0)) {{Cl|PRINT}} result @@ -45,12 +47,12 @@ result = PlayMIDI(".\samples\qb64\original\ps2battl.mid" + {{Cl|CHR$}}(0)) ''Example 2:'' Using a CUSTOMTYPE LIBRARY to return the [[Unicode]] version of the current running program's name. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 12 {{Cl|DECLARE DYNAMIC LIBRARY|DECLARE CUSTOMTYPE LIBRARY}} 'Directory Information using KERNEL32 provided by Dav - {{Cl|FUNCTION}} GetModuleFileNameA& ({{Cl|BYVAL}} hModule {{Cl|AS}} {{Cl|LONG}}, lpFileName {{Cl|AS}} {{Cl|STRING}}, {{Cl|BYVAL}} nSize {{Cl|AS}} {{Cl|LONG}}) - {{Cl|FUNCTION}} GetModuleFileNameW& ({{Cl|BYVAL}} hModule {{Cl|AS}} {{Cl|LONG}}, lpFileName {{Cl|AS}} {{Cl|STRING}}, {{Cl|BYVAL}} nSize {{Cl|AS}} {{Cl|LONG}}) + {{Cl|FUNCTION}} GetModuleFileNameA& ({{Cl|BYVAL}} hModule {{Cl|AS}} {{Cl|LONG}}, lpFileName {{Cl|AS}} {{Cl|STRING}}, {{Cl|BYVAL}} nSize {{Cl|AS}} {{Cl|LONG}}) + {{Cl|FUNCTION}} GetModuleFileNameW& ({{Cl|BYVAL}} hModule {{Cl|AS}} {{Cl|LONG}}, lpFileName {{Cl|AS}} {{Cl|STRING}}, {{Cl|BYVAL}} nSize {{Cl|AS}} {{Cl|LONG}}) {{Cl|DECLARE LIBRARY|END DECLARE}} '=== SHOW CURRENT PROGRAM @@ -82,14 +84,14 @@ b$ = {{Cl|STRING$}}({{Cl|LEN}}(a$) * 2, 0) {{Cl|ASC}}(b$, i * 4 - 2) = {{Cl|ASC}}(a$, i * 2) {{Cl|NEXT}} QuickUTF16toUTF32$ = b$ -{{Cl|END FUNCTION}} '' '' +{{Cl|END FUNCTION}} {{CodeEnd}} {{small|Code by Galleon}} : '''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> +
'''QB64 version 1.000 and up produce standalone executables. External DLL files must be distributed with your program.'''
+
'''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.'''
''See also:'' @@ -102,4 +104,4 @@ QuickUTF16toUTF32$ = b$ {{PageNavigation}} -< + diff --git a/internal/help/BYVAL.txt b/internal/help/DECLARE_LIBRARY_1111111_1111111.txt similarity index 89% rename from internal/help/BYVAL.txt rename to internal/help/DECLARE_LIBRARY_1111111_1111111.txt index 8bc9ef772..1740dcbe2 100644 --- a/internal/help/BYVAL.txt +++ b/internal/help/DECLARE_LIBRARY_1111111_1111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:30}} The '''DECLARE LIBRARY''' declaration allows the use of external library [[SUB]] and [[FUNCTION]] procedures supported by QB64. @@ -38,7 +40,7 @@ The '''DECLARE LIBRARY''' declaration allows the use of external library [[SUB]] {{PageExamples}} ''Example 1:'' Using an '''SDL''' library procedure as a program SUB procedure to move the mouse pointer to a coordinate (works in versions prior to 1.000): -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DECLARE LIBRARY}} {{Cl|SUB}} SDL_WarpMouse ({{Cl|BYVAL}} column {{Cl|AS}} {{Cl|LONG}}, {{Cl|BYVAL}} row {{Cl|AS}} {{Cl|LONG}}) 'SDL procedure name {{Cl|DECLARE LIBRARY|END DECLARE}} @@ -55,39 +57,39 @@ DO {{Cl|SUB}} MouseMove (x {{Cl|AS}} {{Cl|LONG}}, y {{Cl|AS}} {{Cl|LONG}}) SDL_WarpMouse x, y 'call SDL library procedure -{{Cl|END SUB}} '' '' +{{Cl|END SUB}} {{CodeEnd}} {{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> -{{CodeStart}} '' '' +
'''Using [[ALIAS]] to create a program SUB or FUNCTION''' using '''QB64 SDL ONLY'''
+{{CodeStart}} {{Cl|SCREEN}} 12 {{Cl|DECLARE LIBRARY}} - {{Cl|SUB}} MouseMove {{Cl|ALIAS}} SDL_WarpMouse ({{Cl|BYVAL}} column&, {{Cl|BYVAL}} row&) + {{Cl|SUB}} MouseMove {{Cl|ALIAS}} SDL_WarpMouse ({{Cl|BYVAL}} column&, {{Cl|BYVAL}} row&) {{Cl|DECLARE LIBRARY|END DECLARE}} {{Cl|_DELAY}} 2 MouseMove 100, 100 {{Cl|_DELAY}} 2 -MouseMove 200, 200 '' '' +MouseMove 200, 200 {{CodeEnd}} :''Explanation:'' When a Library procedure is used to represent another procedure name use [[ALIAS]] instead. Saves creating a SUB! ''Example 2:'' Don't know if a C function is defined by C++ or QB64? Try using empty quotes. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DECLARE LIBRARY}} "" - {{Cl|FUNCTION}} addone& ({{Cl|BYVAL}} value&) -{{Cl|END}} DECLARE '' '' + {{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. : '''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.''' -<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> +
'''QB64 version 1.000 and up produce standalone executables. External DLL files must be distributed with your program.'''
+
'''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.'''
''See also:'' @@ -100,4 +102,4 @@ MouseMove 200, 200 '' '' {{PageNavigation}} -< + diff --git a/internal/help/DEFDBL.txt b/internal/help/DEFDBL_111111.txt similarity index 84% rename from internal/help/DEFDBL.txt rename to internal/help/DEFDBL_111111.txt index b1abe8db4..63930def7 100644 --- a/internal/help/DEFDBL.txt +++ b/internal/help/DEFDBL_111111.txt @@ -1,15 +1,17 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:45}} The [[DEFDBL]] statement defines all variables with names starting with the specified letter (or letter range) AS [[DOUBLE]] variables instead of the [[SINGLE]] type default. -==Legacy support== -* '''DEF''' statements ([[DEFDBL]], [[DEFSNG]], [[DEFLNG]], [[DEFINT]], [[DEFSTR]]) were used when storage space was a concern in older computers, as their usage could save up typing. Instead of {{InlineCode}}'''DIM a AS DOUBLE, a2 AS DOUBLE, a3 AS DOUBLE'''{{InlineCodeEnd}}, simply having {{InlineCode}}'''DEFDBL A'''{{InlineCodeEnd}} in the code before using variables starting with letter '''A''' would do the same job. -* '''For clarity, it is recommended to declare variables with meaningful names'''. - - {{PageSyntax}} : [[DEFDBL]] {{Parameter|letter}}[-{{Parameter|range}}], {{Parameter|letter2}}[-{{Parameter|range2}}], [...] +{{PageLegacySupport}} +* '''DEF''' statements ([[DEFDBL]], [[DEFSNG]], [[DEFLNG]], [[DEFINT]], [[DEFSTR]]) were used when storage space was a concern in older computers, as their usage could save up typing. Instead of {{InlineCode}}DIM a AS DOUBLE, a2 AS DOUBLE, a3 AS DOUBLE{{InlineCodeEnd}}, simply having {{InlineCode}}DEFDBL A{{InlineCodeEnd}} in the code before using variables starting with letter '''A''' would do the same job. +* For clarity, it is recommended to declare variables with meaningful names. + + {{PageDescription}} * {{Parameter|letter}} (or {{Parameter|range}}) can be from A-Z or any other range, like '''G-M'''. * You can also use commas for specific undefined variable first letters. @@ -38,4 +40,4 @@ The [[DEFDBL]] statement defines all variables with names starting with the spec {{PageNavigation}} -< + diff --git a/internal/help/DEFINT.txt b/internal/help/DEFINT_111111.txt similarity index 84% rename from internal/help/DEFINT.txt rename to internal/help/DEFINT_111111.txt index 034e6d3da..de6eac48a 100644 --- a/internal/help/DEFINT.txt +++ b/internal/help/DEFINT_111111.txt @@ -1,15 +1,17 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:46}} The [[DEFINT]] statement defines all variables with names starting with the specified letter (or letter range) AS [[INTEGER]] variables instead of the [[SINGLE]] type default. -==Legacy support== -* '''DEF''' statements ([[DEFDBL]], [[DEFSNG]], [[DEFLNG]], [[DEFINT]], [[DEFSTR]]) were used when storage space was a concern in older computers, as their usage could save up typing. Instead of {{InlineCode}}'''DIM a AS INTEGER, a2 AS INTEGER, a3 AS INTEGER'''{{InlineCodeEnd}}, simply having {{InlineCode}}'''DEFINT A'''{{InlineCodeEnd}} in the code before using variables starting with letter '''A''' would do the same job. -* '''For clarity, it is recommended to declare variables with meaningful names'''. - - {{PageSyntax}} : [[DEFINT]] {{Parameter|letter}}[-{{Parameter|range}}], {{Parameter|letter2}}[-{{Parameter|range2}}], [...] +{{PageLegacySupport}} +* '''DEF''' statements ([[DEFDBL]], [[DEFSNG]], [[DEFLNG]], [[DEFINT]], [[DEFSTR]]) were used when storage space was a concern in older computers, as their usage could save up typing. Instead of {{InlineCode}}DIM a AS INTEGER, a2 AS INTEGER, a3 AS INTEGER{{InlineCodeEnd}}, simply having {{InlineCode}}DEFINT A{{InlineCodeEnd}} in the code before using variables starting with letter '''A''' would do the same job. +* For clarity, it is recommended to declare variables with meaningful names. + + {{PageDescription}} * {{Parameter|letter}} (or {{Parameter|range}}) can be from A-Z or any other range, like '''G-M'''. * You can also use commas for specific undefined variable first letters. @@ -39,4 +41,4 @@ The [[DEFINT]] statement defines all variables with names starting with the spec {{PageNavigation}} -< + diff --git a/internal/help/DEFLNG.txt b/internal/help/DEFLNG_111111.txt similarity index 85% rename from internal/help/DEFLNG.txt rename to internal/help/DEFLNG_111111.txt index f6b60e962..b405d8f55 100644 --- a/internal/help/DEFLNG.txt +++ b/internal/help/DEFLNG_111111.txt @@ -1,15 +1,17 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:47}} The [[DEFLNG]] statement defines all variables with names starting with the specified letter (or letter range) AS [[LONG]] variables instead of the [[SINGLE]] type default. -==Legacy support== -* '''DEF''' statements ([[DEFDBL]], [[DEFSNG]], [[DEFLNG]], [[DEFINT]], [[DEFSTR]]) were used when storage space was a concern in older computers, as their usage could save up typing. Instead of {{InlineCode}}'''DIM a AS LONG, a2 AS LONG, a3 AS LONG'''{{InlineCodeEnd}}, simply having {{InlineCode}}'''DEFLNG A'''{{InlineCodeEnd}} in the code before using variables starting with letter '''A''' would do the same job. -* '''For clarity, it is recommended to declare variables with meaningful names'''. - - {{PageSyntax}} : [[DEFLNG]] {{Parameter|letter}}[-{{Parameter|range}}], {{Parameter|letter2}}[-{{Parameter|range2}}], [...] +{{PageLegacySupport}} +* '''DEF''' statements ([[DEFDBL]], [[DEFSNG]], [[DEFLNG]], [[DEFINT]], [[DEFSTR]]) were used when storage space was a concern in older computers, as their usage could save up typing. Instead of {{InlineCode}}DIM a AS LONG, a2 AS LONG, a3 AS LONG{{InlineCodeEnd}}, simply having {{InlineCode}}DEFLNG A{{InlineCodeEnd}} in the code before using variables starting with letter '''A''' would do the same job. +* For clarity, it is recommended to declare variables with meaningful names. + + {{PageDescription}} * {{Parameter|letter}} (or {{Parameter|range}}) can be from A-Z or any other range, like '''G-M'''. * You can also use commas for specific undefined variable first letters. @@ -39,4 +41,4 @@ The [[DEFLNG]] statement defines all variables with names starting with the spec {{PageNavigation}} -< + diff --git a/internal/help/DEFSNG.txt b/internal/help/DEFSNG_111111.txt similarity index 84% rename from internal/help/DEFSNG.txt rename to internal/help/DEFSNG_111111.txt index b3c955050..986e1d7c7 100644 --- a/internal/help/DEFSNG.txt +++ b/internal/help/DEFSNG_111111.txt @@ -1,15 +1,17 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:48}} The [[DEFSNG]] statement defines all variables with names starting with the specified letter (or letter range) AS [[SINGLE]] variables. -==Legacy support== -* '''DEF''' statements ([[DEFDBL]], [[DEFSNG]], [[DEFLNG]], [[DEFINT]], [[DEFSTR]]) were used when storage space was a concern in older computers, as their usage could save up typing. Instead of {{InlineCode}}'''DIM a AS SINGLE, a2 AS SINGLE, a3 AS SINGLE'''{{InlineCodeEnd}}, simply having {{InlineCode}}'''DEFSNG A'''{{InlineCodeEnd}} in the code before using variables starting with letter '''A''' would do the same job. -* '''For clarity, it is recommended to declare variables with meaningful names'''. - - {{PageSyntax}} : [[DEFSNG]] {{Parameter|letter}}[-{{Parameter|range}}], {{Parameter|letter2}}[-{{Parameter|range2}}], [...] +{{PageLegacySupport}} +* '''DEF''' statements ([[DEFDBL]], [[DEFSNG]], [[DEFLNG]], [[DEFINT]], [[DEFSTR]]) were used when storage space was a concern in older computers, as their usage could save up typing. Instead of {{InlineCode}}DIM a AS SINGLE, a2 AS SINGLE, a3 AS SINGLE{{InlineCodeEnd}}, simply having {{InlineCode}}DEFSNG A{{InlineCodeEnd}} in the code before using variables starting with letter '''A''' would do the same job. +* For clarity, it is recommended to declare variables with meaningful names. + + {{PageDescription}} * Undeclared variables with no type suffix are of type [[SINGLE]] by default. * {{Parameter|letter}} (or {{Parameter|range}}) can be from A-Z or any other range, like '''G-M'''. @@ -39,4 +41,4 @@ The [[DEFSNG]] statement defines all variables with names starting with the spec {{PageNavigation}} -< + diff --git a/internal/help/DEFSTR.txt b/internal/help/DEFSTR_111111.txt similarity index 84% rename from internal/help/DEFSTR.txt rename to internal/help/DEFSTR_111111.txt index c5a8cf29f..f9397bd53 100644 --- a/internal/help/DEFSTR.txt +++ b/internal/help/DEFSTR_111111.txt @@ -1,15 +1,17 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:49}} The [[DEFSTR]] statement defines all variables with names starting with the specified letter (or letter range) AS [[STRING]] variables instead of the [[SINGLE]] type default. -==Legacy support== -* '''DEF''' statements ([[DEFDBL]], [[DEFSNG]], [[DEFLNG]], [[DEFINT]], [[DEFSTR]]) were used when storage space was a concern in older computers, as their usage could save up typing. Instead of {{InlineCode}}'''DIM a AS STRING, a2 AS STRING, a3 AS STRING'''{{InlineCodeEnd}}, simply having {{InlineCode}}'''DEFSTR A'''{{InlineCodeEnd}} in the code before using variables starting with letter '''A''' would do the same job. -* '''For clarity, it is recommended to declare variables with meaningful names'''. - - {{PageSyntax}} : [[DEFSTR]] {{Parameter|letter}}[-{{Parameter|range}}], {{Parameter|letter2}}[-{{Parameter|range2}}], [...] +{{PageLegacySupport}} +* '''DEF''' statements ([[DEFDBL]], [[DEFSNG]], [[DEFLNG]], [[DEFINT]], [[DEFSTR]]) were used when storage space was a concern in older computers, as their usage could save up typing. Instead of {{InlineCode}}DIM a AS STRING, a2 AS STRING, a3 AS STRING{{InlineCodeEnd}}, simply having {{InlineCode}}DEFSTR A{{InlineCodeEnd}} in the code before using variables starting with letter '''A''' would do the same job. +* For clarity, it is recommended to declare variables with meaningful names. + + {{PageDescription}} * {{Parameter|letter}} (or {{Parameter|range}}) can be from A-Z or any other range, like '''G-M'''. * You can also use commas for specific undefined variable first letters. @@ -38,4 +40,4 @@ The [[DEFSTR]] statement defines all variables with names starting with the spec {{PageNavigation}} -< + diff --git a/internal/help/DEF_SEG.txt b/internal/help/DEF_SEG_111_111.txt similarity index 88% rename from internal/help/DEF_SEG.txt rename to internal/help/DEF_SEG_111_111.txt index c13e3ec7b..91cdb6a35 100644 --- a/internal/help/DEF_SEG.txt +++ b/internal/help/DEF_SEG_111_111.txt @@ -1,7 +1,9 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:44}} [[DEF SEG]] is used to define the area in memory to access QB64's emulated conventional memory. -==Legacy support== +{{PageLegacySupport}} * '''QB64 implements memory access using [[_MEM]] and related functions. For that reason, [[DEF SEG]] isn't recommended practice anymore and is supported to maintain compatibility with legacy code.''' @@ -12,15 +14,15 @@ {{PageDescription}} * Used to set the pointer to a memory area of a variable/array or register. * [[PEEK]] and [[POKE]] require a segment memory address (often just 0) without using VARSEG. -* Important segments using [[PEEK]] and [[POKE]] include &HB800 (text segment) and &HA000 (graphics segment). +* Important segments using [[PEEK]] and [[POKE]] include &HB800 (text segment) and &HA000 (graphics segment). * [[BSAVE]] and [[BLOAD]] require a VARSEG reference to the grahic array(0 index) used. * Always use DEF SEG when the procedure is completed, in order to reset the segment to QBasic's default value. * [[DEF SEG]], [[VARSEG]], [[VARPTR]], [[PEEK]] and [[POKE]] access QB64's emulated 16 bit conventional memory block. '''It is highly recommended to use QB64's [[_MEM]] memory system to avoid running out of memory.''' -<!-- + @@ -70,4 +72,4 @@ filename = file + {{Cl|CHR$}}(0) 'create zero string name for DOS {{PageNavigation}} -< + diff --git a/internal/help/DIM.txt b/internal/help/DIM_111.txt similarity index 75% rename from internal/help/DIM.txt rename to internal/help/DIM_111.txt index 30d5b5bc3..2e01b2219 100644 --- a/internal/help/DIM.txt +++ b/internal/help/DIM_111.txt @@ -1,12 +1,18 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:51}} The [[DIM]] statement is used to declare a variable or a list of variables as a specified data type or to dimension [[$STATIC]] or [[$DYNAMIC]] [[Arrays|arrays]]. {{PageSyntax}} -::''Syntax 1:'' [[DIM]] [{{KW|SHARED}}] ''variable''[{suffix| {{KW|AS}} ''type''}] [, ''variable2''...]] +::''To declare variables:'' +:::[[DIM]] [{{KW|SHARED}}] ''variable''[{suffix| {{KW|AS}} [{{KW|_UNSIGNED}}] ''type''}] [, ''variable2''...]] -::''Syntax 2:'' [[DIM]] [{{KW|SHARED}}] ''array(lowest% [{{KW|TO}}) highest%])''[{suffix| {{KW|AS}} ''type''}] [, ''variable2''...] +::''To declare arrays:'' +:::[[DIM]] [{{KW|SHARED}}] ''array([lowest% {{KW|TO}}] highest%])''[{suffix| {{KW|AS}} [{{KW|_UNSIGNED}}] ''type''}] [, ''variable2''...] -:'' '''QB64''' Syntax:'' [[DIM]] [{{KW|SHARED}}] ''variable''[{suffix| {{KW|AS}} [{{KW|_UNSIGNED}}] ''type''}] [, ''variable2''...] +::'' '''QB64''' Alternative Syntax:'' +:::[[DIM]] [{{KW|SHARED}}] {{KW|AS}} [{{KW|_UNSIGNED}}] ''type'' ''variable'' [, ''variable2''...] +:::[[DIM]] [{{KW|SHARED}}] {{KW|AS}} [{{KW|_UNSIGNED}}] ''type'' ''array([lowest% {{KW|TO}}] highest%])'' [, ''array2(elements)''...] {{PageDescription}} @@ -15,18 +21,19 @@ The [[DIM]] statement is used to declare a variable or a list of variables as a * DIM [[SHARED]] shares variable values with sub-procedures without passing the value in a parameter. * Use the [[AS]] keyword to define a variable or array ''type'' [[AS]]... ** [[INTEGER]] (or use variable suffix '''%''') -** [[LONG]] (or use variable suffix '''&''') +** [[LONG]] (or use variable suffix '''&''') ** [[SINGLE]] (or use variable suffix '''!''' or no suffix by default) ** [[DOUBLE]] (or use variable suffix '''#''') ** [[STRING]] (or use variable suffix '''$'''). An AS multiplier can set the string [[LEN|length]]. Ex: {{InlineCode}}DIM ''variable'' AS STRING * 8{{InlineCodeEnd}} * '''QB64''' variable types: ** [[_BIT]] (or use variable suffix '''`'''). An AS multiplier can be used for multiple bits. Ex: {{InlineCode}}DIM ''variable'' AS _BIT * 8{{InlineCodeEnd}} ** [[_BYTE]] (or use variable suffix '''%%''') -** [[_INTEGER64]] (or use variable suffix '''&&''') +** [[_INTEGER64]] (or use variable suffix '''&&''') ** [[_FLOAT]] (or use variable suffix '''##''') -** [[_OFFSET]] (or use variable suffix '''%&''') +** [[_OFFSET]] (or use variable suffix '''%&''') ** DIM AS [[_MEM]] (the _MEM type has no type suffix). -* '''Note: When a variable has not been defined or has no type suffix, the value defaults to [[SINGLE]].''' +* '''Note: When a variable has not been defined or has no type suffix, the type defaults to [[SINGLE]].''' +* When using the '''AS type variable-list''' syntax, type symbols cannot be used. * When the [[$DYNAMIC]] metacommand or [[REDIM]] is used, array element sizes are changeable (not [[$STATIC]]). * Use [[REDIM]] instead of DIM to dimension arrays as dynamic without the {{KW|$DYNAMIC}} metacommand. * Use [[REDIM]] [[_PRESERVE]] in '''QB64''' to retain previous array values when changing the size of an array. @@ -65,25 +72,32 @@ The [[DIM]] statement is used to declare a variable or a list of variables as a ''Example 6:'' QB64 is more flexible than QBasic when it comes to "Duplicate Definition" errors. The following code does not error: -{{CodeStart}} '' '' +{{CodeStart}} x = 1 'x is a {{Cl|SINGLE}} variable {{Cl|PRINT}} x {{Cl|DIM}} x {{Cl|AS}} {{Cl|LONG}} -{{Cl|PRINT}} x '' '' +{{Cl|PRINT}} x {{CodeEnd}} -: ''Explanation:'' The [[SINGLE]] variable can be differentiated from the [[LONG]] x variable by using suffixes like x! or x& in later code. +: ''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" '''status error''' in QB64 when the variable types are the same. -{{CodeStart}} '' '' +{{CodeStart}} x = 1 'x is a {{Cl|SINGLE}} variable {{Cl|PRINT}} x {{Cl|DIM}} x {{Cl|AS}} {{Cl|SINGLE}} -{{Cl|PRINT}} x '' '' +{{Cl|PRINT}} x {{CodeEnd}} : ''Explanation:'' QB64 gives an error because the creation of the new variable would make referring to the existing one impossible. +''Example 8:'' Using QB64's alternative syntax to declare multiple variables/arrays of the same type. +{{CodeStart}} +{{Cl|DIM}} {{Cl|AS}} {{Cl|LONG}} w, h, id, weight, index 'all of these variables are created as type LONG +{{Cl|DIM}} {{Cl|AS}} {{Cl|SINGLE}} x, y, z 'all of these variables are created as type SINGLE +{{CodeEnd}} + + {{PageSeeAlso}} * [[_DEFINE]], [[_PRESERVE]] * [[REDIM]], [[TYPE]] @@ -95,4 +109,4 @@ x = 1 'x is a {{Cl|SINGLE}} variable {{PageNavigation}} -< + diff --git a/internal/help/DO...LOOP.txt b/internal/help/DO...LOOP_11...1111.txt similarity index 89% rename from internal/help/DO...LOOP.txt rename to internal/help/DO...LOOP_11...1111.txt index edfe86000..a77652b71 100644 --- a/internal/help/DO...LOOP.txt +++ b/internal/help/DO...LOOP_11...1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:52}} '''DO...LOOP''' statements are used in programs to repeat code or return to the start of a procedure. @@ -36,9 +38,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}} @@ -55,7 +57,7 @@ DO: LOOP UNTIL {{Cl|INKEY$}} = "" ' checks evaluation after one run of loop code ''Example 3:'' Using a one time DO loop to exit ANY of several FOR LOOPs, without using [[GOTO]]. :SUB reads header contents of a [[BSAVE]] file that may include embedded RGB color settings before the image. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DEFINT}} A-Z {{Cl|INPUT}} "Enter a BSAVE file name to read the file for screen mode:"', filenm$ CheckScreen filenm$ @@ -73,7 +75,7 @@ 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 + 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 @@ -85,10 +87,10 @@ DO FOR i = 10 TO 55 'check for Screen 12 embedded colors GET #1, , RGB - tot12& = tot12& + 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 i = 55 AND tot12& = 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 @@ -97,10 +99,10 @@ DO FOR i = 58 TO 775 'check for Screen 13 embedded colors GET #1, , RGB - tot13& = tot13& + RGB + tot13& = tot13& + RGB 'PRINT i; RGB; : SOUND 300, 1 'test - IF RGB > 63 OR RGB < 0 THEN {{Cl|EXIT DO}} - IF i = 775 AND tot13& = 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 GET #1, , dep13 '777 @@ -109,7 +111,7 @@ CLOSE #1 COLOR 14: LOCATE 10, 25 {{Cl|SELECT CASE}} i - {{Cl|CASE IS}} < 56: + {{Cl|CASE IS}} < 56: IF widN > 640 THEN Scr = 13: MaxColors = 0 PRINT "Default Screen 13:"; widN \ 8; "X"; depN @@ -131,7 +133,7 @@ COLOR 14: LOCATE 10, 25 Scr = 13: MaxColors = 256: PWidth = wid13 \ 8: PDepth = dep13 {{Cl|END SELECT}} -{{Cl|END SUB}} '' '' +{{Cl|END SUB}} {{CodeEnd}} {{small|Code by Ted Weissgerber}} :''Explanation:'' The SUB procedure reads a file that was [[BSAVE]]d previously. If the RGB colors are stored before the image, the values can only be between 0 and 63. Higher values indicate that the image width and height are located there and that there are no stored color values to be read. SUB later displays the dimensions of the file image that [[GET (graphics statement)|GET]] placed in the file array. The loop is set to only run once by creating '''a TRUE [[UNTIL]] statement''' such as 1 = 1. When a screen mode cannot be determined, the user must select one. @@ -148,4 +150,4 @@ COLOR 14: LOCATE 10, 25 {{PageNavigation}} -< + diff --git a/internal/help/DOUBLE.txt b/internal/help/DOUBLE_111111.txt similarity index 95% rename from internal/help/DOUBLE.txt rename to internal/help/DOUBLE_111111.txt index 00bbe600f..f99bc7d3b 100644 --- a/internal/help/DOUBLE.txt +++ b/internal/help/DOUBLE_111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:53}} [[DOUBLE]] type floating point numerical values use 8 bytes per value. @@ -29,4 +31,4 @@ {{PageNavigation}} -< + diff --git a/internal/help/DRAW.txt b/internal/help/DRAW_1111.txt similarity index 97% rename from internal/help/DRAW.txt rename to internal/help/DRAW_1111.txt index a8a7a7f89..87973d8a0 100644 --- a/internal/help/DRAW.txt +++ b/internal/help/DRAW_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:54}} The [[DRAW]] statement uses a [[STRING]] expression to draw lines on the screen. @@ -42,7 +44,7 @@ The [[DRAW]] statement uses a [[STRING]] expression to draw lines on the screen. {{PageExamples}} ''Example 1:'' Placing an octagon shape DRAW across the the screen using PSET. -{{CodeStart}} '' '' +{{CodeStart}} SCREEN 12 octagon$ = "C12 R10 F10 D10 G10 L10 H10 U10 E10" 'create a DRAW string value {{Cl|SCREEN (statement)|SCREEN}} 12 @@ -51,13 +53,13 @@ The [[DRAW]] statement uses a [[STRING]] expression to draw lines on the screen. {{Cl|_DELAY}} .5 ' delay for demo {{Cl|DRAW}} octagon$ ' DRAW the octagon using variable {{Cl|_DELAY}} .5 ' delay for demo - NEXT i% '' '' + NEXT i% {{CodeEnd}} ''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). -{{CodeStart}} '' '' +{{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 @@ -65,7 +67,7 @@ The [[DRAW]] statement uses a [[STRING]] expression to draw lines on the screen. {{Cl|CIRCLE}} {{Cl|STEP}}(0, 0), 5, 12 ' circle placed at end of blind line {{Cl|DRAW}} "P9, 12" ' paint inside of circle {{Cl|SLEEP}} 1 ' slowed for demo only - NEXT '' '' + 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. @@ -78,8 +80,8 @@ The [[DRAW]] statement uses a [[STRING]] expression to draw lines on the screen. 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 + 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 LOOP @@ -128,14 +130,14 @@ DO {{Cl|CASE}} 0, 2, 3, 5, 6, 8: {{Cl|PSET}} (20, 88), 12 {{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. ''Example 5:'' Using 32 bit or [[_RGB]] color [[STR$|string]] values when using the DRAW C text statement -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(800, 800, 12) {{Cl|PRINT}} {{Cl|_ALPHA}}(10), {{Cl|_RED}}(10), {{Cl|_GREEN}}(10), {{Cl|_BLUE}}(10) @@ -166,4 +168,4 @@ k = {{Cl|_RGB}}(80, 255, 80) {{PageNavigation}} -< + diff --git a/internal/help/Dollar_Sign.txt b/internal/help/Dollar_Sign_100000_1000.txt similarity index 75% rename from internal/help/Dollar_Sign.txt rename to internal/help/Dollar_Sign_100000_1000.txt index d59d756ea..e545428ef 100644 --- a/internal/help/Dollar_Sign.txt +++ b/internal/help/Dollar_Sign_100000_1000.txt @@ -1,4 +1,6 @@ -The '''$''' is used to denote Qbasic [[Metacommand]]s or as a [[STRING]] variable type suffix. +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:24:43}} +The '''$''' is used to denote QBasic [[Metacommand]]s or as a [[STRING]] variable type suffix. @@ -7,7 +9,7 @@ The '''$''' is used to denote Qbasic [[Metacommand]]s or as a [[STRING]] variabl * [[$STATIC]] denotes that all arrays can only be dimensioned once using [[DIM]]. * [[$DYNAMIC]] denotes that all arrays can be redimensioned using [[REDIM]] ONLY. -* [[$INCLUDE]] includes a BI file or Qbasic Library in a program. The file name requires a comment before and after the name. +* [[$INCLUDE]] includes a BI file or QBasic Library in a program. The file name requires a comment before and after the name. * The [[STRING|string]] variable suffix MUST be used if the variable is not dimensioned in a DIM statement. The statement can also set a fixed string [[LEN|length]]. @@ -18,4 +20,4 @@ The '''$''' is used to denote Qbasic [[Metacommand]]s or as a [[STRING]] variabl {{PageNavigation}} -< + diff --git a/internal/help/ELSEIF.txt b/internal/help/ELSEIF_111111.txt similarity index 93% rename from internal/help/ELSEIF.txt rename to internal/help/ELSEIF_111111.txt index cd342b27f..c344668ff 100644 --- a/internal/help/ELSEIF.txt +++ b/internal/help/ELSEIF_111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:59}} [[ELSEIF]] is used in an [[IF...THEN]] block statement to offer an alternative condition. @@ -29,7 +31,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}} @@ -40,7 +42,7 @@ IF x = 100 THEN COLOR 10: PRINT x ELSE IF x > 100 THEN COLOR 12: PRINT x ELSE PR 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" +ELSE : PRINT "< 100" END IF {{CodeEnd}} @@ -53,4 +55,4 @@ END IF {{PageNavigation}} -< + diff --git a/internal/help/ELSE.txt b/internal/help/ELSE_1111.txt similarity index 96% rename from internal/help/ELSE.txt rename to internal/help/ELSE_1111.txt index e0e9fbe53..5b498c80d 100644 --- a/internal/help/ELSE.txt +++ b/internal/help/ELSE_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:12:57}} [[ELSE]] is used in [[IF...THEN]] or [[SELECT CASE]] statements to offer an alternative to other conditional statements. @@ -60,4 +62,4 @@ IF a = 3 THEN a = 5 ELSE a = 3 {{PageNavigation}} -< + diff --git a/internal/help/END.txt b/internal/help/END_111.txt similarity index 95% rename from internal/help/END.txt rename to internal/help/END_111.txt index 69e98ab84..8779e4a49 100644 --- a/internal/help/END.txt +++ b/internal/help/END_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:00}} The [[END]] statement terminates a program without an immediate exit or ends a procedure or statement block. @@ -22,10 +24,10 @@ The [[END]] statement terminates a program without an immediate exit or ends a p {{PageExamples}} ''Example:'' In QB64 you won't return to the IDE unless you are using it to run or edit the program module. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|PRINT}} "Hello world!" {{Cl|END}} -{{Cl|PRINT}} "Hello no one!" '' '' +{{Cl|PRINT}} "Hello no one!" {{CodeEnd}} ''Returns:'' @@ -50,4 +52,4 @@ Press any key to continue... {{PageNavigation}} -< + diff --git a/internal/help/ENVIRON$.txt b/internal/help/ENVIRON$_1111111$.txt similarity index 93% rename from internal/help/ENVIRON$.txt rename to internal/help/ENVIRON$_1111111$.txt index 1c36ab1ca..68f6b4026 100644 --- a/internal/help/ENVIRON$.txt +++ b/internal/help/ENVIRON$_1111111$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:04}} The [[ENVIRON$]] function returns a [[STRING]] environmental value from '''Windows'''' environmental settings list. @@ -23,14 +25,14 @@ The [[ENVIRON$]] function returns a [[STRING]] environmental value from '''Windo ** "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. --> + * ''Note:'' '''QB64''' may not return the same environment list as QBasic or SET did in DOS. {{PageExamples}} ''Example 1:'' Viewing the list of environmental parameter settings using a counter loop like SET does in DOS. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DO}} i = i + 1 setting$ = {{Cl|ENVIRON$}}(i) ' get a setting from the list @@ -70,8 +72,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$ @@ -109,7 +111,7 @@ Q$ = {{Cl|CHR$}}(34) '=== Write URL Shortcut file info. {{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}} '' '' +{{Cl|END SUB}} {{CodeEnd}} {{small|Adapted from code by Dav}} : ''Explanation:'' The SUB program finds the current program's path and user's desktop path. It then creates the shortcut on the desktop with a program icon. The custom icon should be in the program's folder. If an environmental path is not found, the shortcut is placed in the program's folder. The SUB can be added to any program. @@ -125,4 +127,4 @@ Q$ = {{Cl|CHR$}}(34) '=== Write URL Shortcut file info. {{PageNavigation}} -< + diff --git a/internal/help/ENVIRON.txt b/internal/help/ENVIRON_1111111.txt similarity index 94% rename from internal/help/ENVIRON.txt rename to internal/help/ENVIRON_1111111.txt index 29dc4508c..7378f2b41 100644 --- a/internal/help/ENVIRON.txt +++ b/internal/help/ENVIRON_1111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:02}} The [[ENVIRON]] statement is used to temporarily set or change an environmental string value. @@ -20,4 +22,4 @@ The [[ENVIRON]] statement is used to temporarily set or change an environmental {{PageNavigation}} -< + diff --git a/internal/help/EOF.txt b/internal/help/EOF_111.txt similarity index 63% rename from internal/help/EOF.txt rename to internal/help/EOF_111.txt index 1af62090f..02a0fd5dc 100644 --- a/internal/help/EOF.txt +++ b/internal/help/EOF_111.txt @@ -1,15 +1,17 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:05}} The [[EOF]] function indicates that the end of a file has been reached. {{PageSyntax}} -: {{Parameter|endReached%%}} = EOF([#]{{Parameter|fileNumber&}}) +: {{Parameter|endReached%%}} = EOF([#]{{Parameter|fileNumber&}}) {{PageDescription}} -* {{Parameter|fileNumber&}} is the number of the file being read. '''#''' is not required. +* {{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. --> + * '''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. @@ -22,4 +24,4 @@ The [[EOF]] function indicates that the end of a file has been reached. {{PageNavigation}} -< + diff --git a/internal/help/EQV.txt b/internal/help/EQV_111.txt similarity index 90% rename from internal/help/EQV.txt rename to internal/help/EQV_111.txt index d8c27f721..e67dd6ad8 100644 --- a/internal/help/EQV.txt +++ b/internal/help/EQV_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:06}} The [[EQV]] operator returns a value based on the ''equivalence'' of two conditions or values. @@ -19,4 +21,4 @@ The [[EQV]] operator returns a value based on the ''equivalence'' of two conditi {{PageNavigation}} -< + diff --git a/internal/help/ERASE.txt b/internal/help/ERASE_11111.txt similarity index 93% rename from internal/help/ERASE.txt rename to internal/help/ERASE_11111.txt index 881034c87..5fdfdda76 100644 --- a/internal/help/ERASE.txt +++ b/internal/help/ERASE_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:07}} The [[ERASE]] statement is used to clear all data from an array. [[$STATIC]] [[Arrays|array]] dimensions are not affected. @@ -22,4 +24,4 @@ The [[ERASE]] statement is used to clear all data from an array. [[$STATIC]] [[A {{PageNavigation}} -< + diff --git a/internal/help/ERDEV$.txt b/internal/help/ERDEV$.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/ERDEV$.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/ERDEV.txt b/internal/help/ERDEV.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/ERDEV.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/ERL.txt b/internal/help/ERL_111.txt similarity index 88% rename from internal/help/ERL.txt rename to internal/help/ERL_111.txt index fb77eb770..361aa557d 100644 --- a/internal/help/ERL.txt +++ b/internal/help/ERL_111.txt @@ -1,8 +1,10 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:11}} The [[ERL]] function returns the closest previous line number before the last error. {{PageSyntax}} -: ''lastErrorLine&'' = [[ERL]] +: ''lastErrorLine&'' = [[ERL]] {{PageDescription}} @@ -24,7 +26,7 @@ The [[ERL]] function returns the closest previous line number before the last er {{Cl|END}} errorfix: {{Cl|PRINT}} {{Cl|ERL}} -{{Cl|RESUME}} {{Cl|NEXT}} '' '' +{{Cl|RESUME}} {{Cl|NEXT}} {{CodeEnd}} {{OutputStart}}1 1 @@ -41,4 +43,4 @@ errorfix: {{PageNavigation}} -< + diff --git a/internal/help/ERROR.txt b/internal/help/ERROR_11111.txt similarity index 92% rename from internal/help/ERROR.txt rename to internal/help/ERROR_11111.txt index 1afbe43c2..1da8bcb1e 100644 --- a/internal/help/ERROR.txt +++ b/internal/help/ERROR_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:14}} The [[ERROR]] statement is used to simulate a program error or to troubleshoot error handling procedures. @@ -13,7 +15,7 @@ The [[ERROR]] statement is used to simulate a program error or to troubleshoot e {{PageExamples}} ''Example:'' Creating custom error codes for a program that can be handled by an [[ON ERROR]] handling routine. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|ON ERROR}} {{Cl|GOTO}} handler {{Cl|IF...THEN|IF}} x = 0 {{Cl|THEN}} {{Cl|ERROR}} 123 @@ -26,7 +28,7 @@ x = x + 1 handler: {{Cl|PRINT}} {{Cl|ERR}}, {{Cl|_ERRORLINE}} {{Cl|BEEP}} -{{Cl|RESUME}} {{Cl|NEXT}} '' '' +{{Cl|RESUME}} {{Cl|NEXT}} {{CodeEnd}} : '''Note: Don't use error codes under 97 or over 200 as QB64 may respond to those errors and interrupt the program.''' @@ -39,4 +41,4 @@ handler: {{PageNavigation}} -< + diff --git a/internal/help/ERR.txt b/internal/help/ERR_111.txt similarity index 93% rename from internal/help/ERR.txt rename to internal/help/ERR_111.txt index 1e40cc27e..f4d8dd59e 100644 --- a/internal/help/ERR.txt +++ b/internal/help/ERR_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:13}} The [[ERR]] function returns the last QBasic error code number. @@ -12,7 +14,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. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|ON ERROR}} {{Cl|GOTO}} handler {{Cl|IF...THEN|IF}} x = 0 {{Cl|THEN}} {{Cl|ERROR}} 111 'simulate an error code that does not exist @@ -29,7 +31,7 @@ handler: K$ = {{Cl|INPUT$}}(1) {{Cl|SYSTEM}} {{Cl|END IF}} -{{Cl|RESUME}} {{Cl|NEXT}} 'RESUME can only be used in error handlers '' '' +{{Cl|RESUME}} {{Cl|NEXT}} 'RESUME can only be used in error handlers {{CodeEnd}} @@ -42,4 +44,4 @@ handler: {{PageNavigation}} -< + diff --git a/internal/help/EXIT.txt b/internal/help/EXIT_1111.txt similarity index 83% rename from internal/help/EXIT.txt rename to internal/help/EXIT_1111.txt index 18cfe144e..43e06acf8 100644 --- a/internal/help/EXIT.txt +++ b/internal/help/EXIT_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:15}} The [[EXIT]] statement is used to exit certain QBasic procedures. @@ -19,9 +21,11 @@ The [[EXIT]] statement is used to exit certain QBasic procedures. * To exit the program immediately, use [[SYSTEM]]. -== Availability == -* '''EXIT SELECT/CASE''' available with v1.5. -* All other variants available in all versions of QB64. +{{PageAvailability}} +* '''EXIT SELECT/CASE''' available in: +** '''QB64 1.5 and up''' (QB64 Team) +** '''QBPE 0.5 and up''' (QB64 Phoenix Edition) +* All other variants available in all versions of QB64 {{PageSeeAlso}} @@ -31,4 +35,4 @@ The [[EXIT]] statement is used to exit certain QBasic procedures. {{PageNavigation}} -< + diff --git a/internal/help/EXP.txt b/internal/help/EXP_111.txt similarity index 83% rename from internal/help/EXP.txt rename to internal/help/EXP_111.txt index f5e47932e..79e8dac10 100644 --- a/internal/help/EXP.txt +++ b/internal/help/EXP_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:17}} The [[EXP]] math function calculates the exponential function ('''e''' raised to the power of a {{Parameter|numericExpression}}). @@ -11,7 +13,7 @@ The [[EXP]] math function calculates the exponential function ('''e''' raised to * 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: e-3 = 1 / e3 = 1 / (e * e * e) {{PageSeeAlso}} @@ -21,4 +23,4 @@ The [[EXP]] math function calculates the exponential function ('''e''' raised to {{PageNavigation}} -< + diff --git a/internal/help/Equal.txt b/internal/help/Equal_10000.txt similarity index 93% rename from internal/help/Equal.txt rename to internal/help/Equal_10000.txt index d91767834..c84e5e09c 100644 --- a/internal/help/Equal.txt +++ b/internal/help/Equal_10000.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:24:58}} View source for Equal @@ -22,9 +24,9 @@ The '''=''' condition symbol denotes that a value must equal another value for t ''See also:'' -* [[Not_Equal|<>]] +* [[Not_Equal|<>]] * [[Greater_Than|>]] -* [[Less_Than|<]] +* [[Less_Than|<]] * [[Relational Operations]] @@ -48,4 +50,4 @@ Related changes Special pages Page information Privacy policyAbout QB64 WikiDisclaimersPowered by MediaWiki -< + diff --git a/internal/help/FIELD.txt b/internal/help/FIELD_11111.txt similarity index 92% rename from internal/help/FIELD.txt rename to internal/help/FIELD_11111.txt index 37f6f75bb..7a96865b4 100644 --- a/internal/help/FIELD.txt +++ b/internal/help/FIELD_11111.txt @@ -1,8 +1,10 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:18}} The [[FIELD]] statement creates a [[STRING]] type definition for a [[RANDOM|random]]-access file buffer. {{PageSyntax}} -: [[FIELD]] [#]{{Parameter|fileNumber&}}, {{Parameter|fieldWidth1%}} AS {{Parameter|variable1$}}[, {{Parameter|fieldWidthN%}} AS {{Parameter|variableN$}}] +: [[FIELD]] [#]{{Parameter|fileNumber&}}, {{Parameter|fieldWidth1%}} AS {{Parameter|variable1$}}[, {{Parameter|fieldWidthN%}} AS {{Parameter|variableN$}}] {{PageDescription}} @@ -17,7 +19,7 @@ The [[FIELD]] statement creates a [[STRING]] type definition for a [[RANDOM|rand {{PageExamples}} ''Example:'' Comparing a [[TYPE]] definition with a FIELD [[STRING|string]] definition. Demo using a [[TYPE]] definition to create a file: -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|TYPE}} ClientType CName {{Cl|AS}} {{Cl|STRING}} * 30 '30 bytes Address {{Cl|AS}} {{Cl|STRING}} * 30 '30 bytes @@ -51,11 +53,11 @@ ClientData: {{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}} '' '' + {{Cl|DATA}} "END",0,0,0,0 +{{CodeEnd}} Demo using the FIELD statement to read the file: -{{CodeStart}} '' '' +{{CodeStart}} {{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 ' @@ -67,7 +69,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 @@ -77,7 +79,7 @@ Demo using the FIELD statement to read the file: {{Cl|GET}} #1 'simply GET reads each FIELD record after first {{Cl|LOOP}} {{Cl|CLOSE}} #1 -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} @@ -88,4 +90,4 @@ Demo using the FIELD statement to read the file: {{PageNavigation}} -< + diff --git a/internal/help/FILEATTR.txt b/internal/help/FILEATTR.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/FILEATTR.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/FILES.txt b/internal/help/FILES_11111.txt similarity index 79% rename from internal/help/FILES.txt rename to internal/help/FILES_11111.txt index 542771f22..021316fd3 100644 --- a/internal/help/FILES.txt +++ b/internal/help/FILES_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:20}} The [[FILES]] statement is used to print a list of files in the current directory using a file specification. @@ -11,25 +13,25 @@ The [[FILES]] statement is used to print a list of files in the current director ** '''*''' 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. +* 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" {{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> --> + -<!-- 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; + ==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}} '' '' +{{CodeStart}} {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 2 {{Cl|PRINT}} {{Cl|LINE INPUT}} "Enter a file spec: ", spec$ @@ -73,11 +75,11 @@ f% = {{Cl|FREEFILE}} {{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%) + size& = {{Cl|LOF}}(ff%) {{Cl|CLOSE}} #ff% - {{Cl|IF...THEN|IF}} size& = 0 {{Cl|THEN}} {{Cl|KILL}} TmpFile$: {{Cl|EXIT FUNCTION}} + {{Cl|IF...THEN|IF}} size& = 0 {{Cl|THEN}} {{Cl|KILL}} TmpFile$: {{Cl|EXIT FUNCTION}} {{Cl|OPEN}} TmpFile$ {{Cl|FOR (file statement)|FOR}} {{Cl|INPUT (file mode)|INPUT}} {{Cl|AS}} #ff% - {{Cl|DO...LOOP|DO}} {{Cl|WHILE}} {{Cl|NOT}} {{Cl|EOF}}(ff%) {{Cl|AND (boolean)|AND}} Index% < ListMAX% + {{Cl|DO...LOOP|DO}} {{Cl|WHILE}} {{Cl|NOT}} {{Cl|EOF}}(ff%) {{Cl|AND (boolean)|AND}} Index% < ListMAX% Index% = Index% + 1 {{Cl|LINE INPUT (file statement)|LINE INPUT}} #ff%, DirList$(Index%) {{Cl|LOOP}} @@ -87,16 +89,16 @@ f% = {{Cl|FREEFILE}} {{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}} '' '' +{{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. ''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. -<!-- 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 +112,4 @@ DIR$ = DirList$(Index%) {{PageNavigation}} -< + diff --git a/internal/help/FIX.txt b/internal/help/FIX_111.txt similarity index 92% rename from internal/help/FIX.txt rename to internal/help/FIX_111.txt index 9b1039c52..3965e995d 100644 --- a/internal/help/FIX.txt +++ b/internal/help/FIX_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:22}} The [[FIX]] function rounds a numerical value to the next whole number closest to zero. @@ -17,9 +19,9 @@ The [[FIX]] function rounds a numerical value to the next whole number closest t {{PageExamples}} ''Example 1:'' Showing the behavior of [[FIX]] with positive and negative decimal point values. -{{CodeStart}} '' '' +{{CodeStart}} PRINT FIX(2.5) - PRINT FIX(-2.5) '' '' + PRINT FIX(-2.5) {{CodeEnd}} {{OutputStart}}2 -2 @@ -27,7 +29,7 @@ The [[FIX]] function rounds a numerical value to the next whole number closest t ''Example 2:'' The NORMAL arithmetic method (round half up) can be achieved using the function in the example code below: -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|PRINT}} MATHROUND(0.5) {{Cl|PRINT}} MATHROUND(1.5) {{Cl|PRINT}} MATHROUND(2.5) @@ -37,7 +39,7 @@ The [[FIX]] function rounds a numerical value to the next whole number closest t {{Cl|FUNCTION}} MATHROUND(n) MATHROUND = {{Cl|FIX}}(n + 0.5 * {{Cl|SGN}}(n)) -{{Cl|END FUNCTION}} '' '' +{{Cl|END FUNCTION}} {{CodeEnd}} {{OutputStart}}1 2 @@ -57,4 +59,4 @@ The [[FIX]] function rounds a numerical value to the next whole number closest t {{PageNavigation}} -< + diff --git a/internal/help/FOR...NEXT.txt b/internal/help/FOR...NEXT_111...1111.txt similarity index 95% rename from internal/help/FOR...NEXT.txt rename to internal/help/FOR...NEXT_111...1111.txt index 21536c959..6f585151c 100644 --- a/internal/help/FOR...NEXT.txt +++ b/internal/help/FOR...NEXT_111...1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:23}} The [[FOR]] statement creates a counter loop using specified start and stop numerical boundaries. The default increment is + 1. @@ -32,12 +34,12 @@ The [[FOR]] statement creates a counter loop using specified start and stop nume {{PageExamples}} ''Example 1:'' Adding all of the even numbers from 10 to 0. -{{CodeStart}} '' '' +{{CodeStart}} 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}} @@ -45,7 +47,7 @@ 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}} '' '' +{{CodeStart}} {{Cl|PRINT}} "hi" {{Cl|FOR...NEXT|FOR}} i = 10 {{Cl|TO}} 1 'requires a negative {{Cl|STEP}} value @@ -58,7 +60,7 @@ PRINT "After loop, i ="; i '' '' bye {{OutputEnd}} -<!-- removed redundant example as Example 2 above shows exactly the same technique + @@ -69,4 +71,4 @@ bye {{OutputEnd}} {{PageNavigation}} -< + diff --git a/internal/help/ACCESS.txt b/internal/help/FOR_(file_statement)_111_(0000_000000000).txt similarity index 93% rename from internal/help/ACCESS.txt rename to internal/help/FOR_(file_statement)_111_(0000_000000000).txt index c364960e2..3351cb40a 100644 --- a/internal/help/ACCESS.txt +++ b/internal/help/FOR_(file_statement)_111_(0000_000000000).txt @@ -1,19 +1,21 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:24}} The [[OPEN]] statement is used to open a file or [[OPEN_COM|COM]] serial communications port for program input or output. {{PageSyntax}} -: [[OPEN]] {{Parameter|fileName$}} ['''FOR''' {{Parameter|mode}}] [{{{KW|ACCESS}}|{{{KW|LOCK}}|SHARED}} [{READ|WRITE}] [[AS]] [#]{{Parameter|fileNumber&}} [LEN = {{Parameter|recordLength}}] +: [[OPEN]] {{Parameter|fileName$}} ['''FOR''' {{Parameter|mode}}] [{{{KW|ACCESS}}|{{{KW|LOCK}}|SHARED}} [{READ|WRITE}] [[AS]] [#]{{Parameter|fileNumber&}} [LEN = {{Parameter|recordLength}}] ===Legacy ''GW-BASIC'' syntax=== -: [[OPEN]] {{Parameter|modeLetter$}}, [#]{{Parameter|fileNumber&}}, {{Parameter|fileName$}}[, {{Parameter|recordLength}}] +: [[OPEN]] {{Parameter|modeLetter$}}, [#]{{Parameter|fileNumber&}}, {{Parameter|fileName$}}[, {{Parameter|recordLength}}] {{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. -* {{Parameter|fileNumber&}} can be any '''positive''' [[INTEGER]] or [[LONG]] whole number value or an unused value determined by the [[FREEFILE]] function. +* {{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. @@ -21,7 +23,7 @@ The [[OPEN]] statement is used to open a file or [[OPEN_COM|COM]] serial communi * '''QB64''' can open as many files as your computer memory can handle. QBasic could only open about 15 at a time. * '''QB64 will allocate 4 bytes of memory for every possible file number up to the highest number used in a program.''' * {{Parameter|mode}} defaults to RANDOM if the {{Parameter|mode}} or FOR access statement is omitted. (see open modes described below) -* '''Only the {{Parameter|fileName$}}, {{Parameter|fileNumber&}} and LEN = {{Parameter|recordLength}} values can use variable values in the QBasic syntax.''' +* '''Only the {{Parameter|fileName$}}, {{Parameter|fileNumber&}} and LEN = {{Parameter|recordLength}} values can use variable values in the QBasic syntax.''' * 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. @@ -32,7 +34,7 @@ The [[OPEN]] statement is used to open a file or [[OPEN_COM|COM]] serial communi {{PageErrors}} -* Illegal '''QB64''' Windows filename characters are ''' " * / \ | ? : < > '''. Multiple dots (periods) are allowed. +* 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. @@ -88,18 +90,18 @@ The [[OPEN]] statement is used to open a file or [[OPEN_COM|COM]] serial communi {{Cl|PRINT}} {{Cl|CHR$}}(code%); 'use {{Cl|LOCATE}} before {{Cl|FUNCTION}} call to place print {{Cl|NEXT}} CheckName% = E% -{{Cl|END FUNCTION}} '' '' +{{Cl|END FUNCTION}} {{CodeEnd}} ''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}} = {{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: -{{CodeStart}} '' '' +{{CodeStart}} f% = {{Cl|FREEFILE}} 'should always be 1 at program start {{Cl|OPEN}} "SCRN:" {{Cl|FOR...NEXT|FOR}} {{Cl|OUTPUT}} {{Cl|AS}} #f% g% = {{Cl|FREEFILE}} 'should always be 2 after 1 @@ -107,7 +109,7 @@ g% = {{Cl|FREEFILE}} 'should always be 2 after 1 {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 2 {{Cl|PRINT (file statement)|PRINT}} #i, "Hello World, Screen and File version" -NEXT '' '' +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. @@ -159,4 +161,4 @@ It was overwritten with this and deleted. {{PageNavigation}} -< + diff --git a/internal/help/FRE.txt b/internal/help/FRE.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/FRE.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/FREEFILE.txt b/internal/help/FREEFILE_11111111.txt similarity index 80% rename from internal/help/FREEFILE.txt rename to internal/help/FREEFILE_11111111.txt index 60484bd72..5abad8f88 100644 --- a/internal/help/FREEFILE.txt +++ b/internal/help/FREEFILE_11111111.txt @@ -1,8 +1,10 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:28}} The [[FREEFILE]] function returns a [[LONG]] value that is an unused file access number. {{PageSyntax}} -: fileHandle& = [[FREEFILE]] +: fileHandle& = [[FREEFILE]] {{PageDescription}} @@ -11,7 +13,7 @@ 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. --> + {{PageSeeAlso}} @@ -19,4 +21,4 @@ The [[FREEFILE]] function returns a [[LONG]] value that is an unused file access {{PageNavigation}} -< + diff --git a/internal/help/FUNCTION.txt b/internal/help/FUNCTION_11111111.txt similarity index 82% rename from internal/help/FUNCTION.txt rename to internal/help/FUNCTION_11111111.txt index b917bf364..b2928488b 100644 --- a/internal/help/FUNCTION.txt +++ b/internal/help/FUNCTION_11111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:29}} A [[FUNCTION]] block statement is used to create a function procedure to return a calculated value to a program. @@ -16,6 +18,8 @@ A [[FUNCTION]] block statement is used to create a function procedure to return * Functions are often referred to in program calculations, not called like SUB procedures. [[CALL]] cannot be used with functions. * If there are no parameters passed or they are [[SHARED]] the ''parameters'' and parenthesis are not required. * Variable names within the procedure do not have to match the names used in the reference parameters, just the value types. +* To pass parameter variables [[BYVAL|by value]] to protect the value in a call, parenthesis can be placed around each variable name also. +* To pass [[arrays]] to a sub-procedure use empty brackets after the name or indicate the index in the call. * All [[$DYNAMIC|dynamic]] variable values return to 0 or null strings when the procedure is exited except when a variable or the entire function is [[STATIC]]. This can save program memory as all [[$DYNAMIC|dynamic]] memory used in a FUNCTION is released on procedure exit. * FUNCTION procedure code can use [[GOSUB]] and [[GOTO]] line numbers or labels inside of the procedure when necessary. * For early function exits use [[EXIT]] [[FUNCTION]] before [[END FUNCTION]] and [[GOSUB]] procedures using [[RETURN]]. @@ -32,7 +36,7 @@ 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}} '' '' +{{CodeStart}} {{Cl|PRINT}} "Current path = "; PATH$ {{Cl|END}} @@ -44,21 +48,21 @@ A [[FUNCTION]] block statement is used to create a function procedure to return {{Cl|LINE INPUT (file statement)|LINE INPUT}} #f%, PATH$ 'read file path text to function name {{Cl|CLOSE}} #f% {{Cl|KILL}} file$ -{{Cl|END FUNCTION}} '' '' +{{Cl|END FUNCTION}} {{CodeEnd}} ''Example 2:'' Returns a [[LONG]] array byte size required for a certain sized graphics screen pixel area [[GET (graphics statement)|GET]]. -{{CodeStart}} '' '' +{{CodeStart}} {{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|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}} {{Cl|DEFINT}} A-Z -{{Cl|FUNCTION}} ImageBufferSize& (Wide&, Deep&, ScreenMode%) +{{Cl|FUNCTION}} ImageBufferSize& (Wide&, Deep&, ScreenMode%) {{Cl|SELECT CASE}} ScreenMode% {{Cl|CASE}} 1: BPPlane = 2: Planes = 1 {{Cl|CASE}} 2, 3, 4, 11: BPPlane = 1: Planes = 1 @@ -67,10 +71,10 @@ IntegerArray& = ImageBufferSize&(wide&, deep&, mode%) \ 2 ' retu {{Cl|CASE}} 13: BPPlane = 8: Planes = 1 {{Cl|CASE ELSE}}: BPPlane = 0 {{Cl|END SELECT}} - ImageBufferSize& = 4 + {{Cl|INT}}((Wide& * BPPlane + 7) / 8) * (Deep& * Planes) 'return the value to function name. -{{Cl|END FUNCTION}} '' '' + ImageBufferSize& = 4 + {{Cl|INT}}((Wide& * BPPlane + 7) / 8) * (Deep& * Planes) 'return the value to function name. +{{Cl|END FUNCTION}} {{CodeEnd}} -:''Explanation:'' Function calculates the array byte size required when you [[GET (graphics statement)|GET]] an area of a graphics [[SCREEN]]. Each mode may require a different sized array. Since graphics uses [[INTEGER]] arrays, 2 byte elements, the size returned is divided by 2 in the IntegerArray& calculation function reference. Function returns only 4 for [[SCREEN]] 0 which is a text only mode. +:''Explanation:'' Function calculates the array byte size required when you [[GET (graphics statement)|GET]] an area of a graphics [[SCREEN]]. Each mode may require a different sized array. Since graphics uses [[INTEGER]] arrays, 2 byte elements, the size returned is divided by 2 in the IntegerArray& calculation function reference. Function returns only 4 for [[SCREEN]] 0 which is a text only mode. {{PageSeeAlso}} @@ -80,4 +84,4 @@ IntegerArray& = ImageBufferSize&(wide&, deep&, mode%) \ 2 ' retu {{PageNavigation}} -< + diff --git a/internal/help/GET_(TCP%2FIP_statement).txt b/internal/help/GET_(TCP%2FIP_statement)_111_(111%2111_000000000).txt similarity index 97% rename from internal/help/GET_(TCP%2FIP_statement).txt rename to internal/help/GET_(TCP%2FIP_statement)_111_(111%2111_000000000).txt index 2f8942ee9..41ade186f 100644 --- a/internal/help/GET_(TCP%2FIP_statement).txt +++ b/internal/help/GET_(TCP%2FIP_statement)_111_(111%2111_000000000).txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:32}} '''GET''' reads unformatted (raw) data from an open TCP/IP connection opened with [[_OPENCLIENT]], [[_OPENHOST]] or [[_OPENCONNECTION]]. @@ -48,4 +50,4 @@ {{PageNavigation}} -< + diff --git a/internal/help/GET_(graphics_statement).txt b/internal/help/GET_(graphics_statement)_111_(00000000_000000000).txt similarity index 86% rename from internal/help/GET_(graphics_statement).txt rename to internal/help/GET_(graphics_statement)_111_(00000000_000000000).txt index 1d933ed84..774391b04 100644 --- a/internal/help/GET_(graphics_statement).txt +++ b/internal/help/GET_(graphics_statement)_111_(00000000_000000000).txt @@ -1,13 +1,15 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:33}} The [[GET (graphics statement)|GET]] statement is used in graphics to store a box area image of the screen into an [[INTEGER]] array. -==Legacy support== -* '''QB64 can manipulate parts of an image using [[_PUTIMAGE]]. For that reason, GET isn't recommended practice anymore and is supported to maintain compatibility with legacy code.''' - - {{PageSyntax}} : [[GET]] [STEP] ({{Parameter|column1}}, {{Parameter|row1}})-[STEP]({{Parameter|column2}}, {{Parameter|row2}}), {{Parameter|array}}([{{Parameter|index}}])[, {{Parameter|offscreenColor}}] +{{PageLegacySupport}} +* '''QB64''' can manipulate parts of an image using [[_PUTIMAGE]]. For that reason, '''GET''' isn't recommended practice anymore and is supported to maintain compatibility with legacy code. + + {{Parameters}} * ''column'' and ''row'' [[INTEGER]] coordinates for the box area must be on the screen except when using an ''offscreenColor''. * [[INTEGER]] array sizes must be large enough (use width * height of the box area + 4) to hold the data or an error will occur. @@ -36,7 +38,7 @@ The [[GET (graphics statement)|GET]] statement is used in graphics to store a bo {{PageExamples}} ''Example 1:'' How to use GET and PUT to move a sprite with the arrow keys. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DEFINT}} A-Z {{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. @@ -58,36 +60,36 @@ The [[GET (graphics statement)|GET]] statement is used in graphics to store a bo t! = {{Cl|TIMER}} + .05 {{Cl|DO...LOOP|DO}} ' 1 Tick (1/18th second) keypress scancode read loop 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 + 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 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(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(72) = 1 {{Cl|THEN}} y = y - 5: {{Cl|IF...THEN|IF}} y < 0 {{Cl|THEN}} y = 0 + {{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}} 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 {{Cl|END IF}} -{{Cl|LOOP}} {{Cl|UNTIL}} SC(1) = 1 ' main loop until [Esc] key (scan code 1) is pressed '' '' +{{Cl|LOOP}} {{Cl|UNTIL}} SC(1) = 1 ' main loop until [Esc] key (scan code 1) is pressed {{CodeEnd}} ''Example 2:'' How to GET graphics from an image other than the present screen using [[_SOURCE]] and [[_DEST]]ination. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DIM}} img(20 * 20 + 4) {{Cl|AS}} {{Cl|INTEGER}} 'create img% array to hold 20 by 20 image data -a& = {{Cl|_NEWIMAGE}}(800, 600, 13) 'larger surface a& emulates screen 13 colors & resolution +a& = {{Cl|_NEWIMAGE}}(800, 600, 13) 'larger surface a& emulates screen 13 colors & resolution {{Cl|SCREEN (statement)|SCREEN}} 13 'program screen 13 -{{Cl|_DEST}} a& 'set desination as the image page a& +{{Cl|_DEST}} a& 'set desination as the image page a& {{Cl|CIRCLE}} (700, 300), 10, 10 'draw green circle on image page -{{Cl|_SOURCE}} a& 'set source as image page a& +{{Cl|_SOURCE}} a& 'set source as image page a& {{Cl|GET}} (690, 290)-(710, 310), img() 'GET a square screen area similar to a LINE Box. @@ -100,11 +102,11 @@ a& = {{Cl|_NEWIMAGE}}(800, 600, 13) 'larger surface a& emulates scre {{PageSeeAlso}} * [[_PUTIMAGE]], [[_LOADIMAGE]] * [[_MAPTRIANGLE]] -* [[PUT (graphics statement)|PUT]], [[STEP]] +* [[POINT]], [[PUT (graphics statement)|PUT]], [[STEP]] * [[BSAVE]], [[BLOAD]] * [[Scancodes]], [[Creating Sprite Masks]] {{text|(for non-box shaped sprites)}} * [[Bitmaps]], [[GET and PUT Demo]] {{PageNavigation}} -< + diff --git a/internal/help/GET.txt b/internal/help/GET_111.txt similarity index 84% rename from internal/help/GET.txt rename to internal/help/GET_111.txt index 674d87848..5a38251cf 100644 --- a/internal/help/GET.txt +++ b/internal/help/GET_111.txt @@ -1,16 +1,18 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:30}} The [[GET #]] statement reads data from a file or port device by bytes or record positions. {{PageSyntax}} -: [[GET #]]{{Parameter|fileNumber&}}, [{{Parameter|position}}][, {{{Parameter|targetVariable}}|{{Parameter|targetArray()}}}] +: [[GET #]]{{Parameter|fileNumber&}}, [{{Parameter|position}}][, {{{Parameter|targetVariable}}|{{Parameter|targetArray()}}}] {{PageDescription}} -* {{Parameter|fileNumber&}} is the file or port number used in the [[OPEN]] AS [[BINARY]] or [[RANDOM]] statement. +* {{Parameter|fileNumber&}} is the file or port number used in the [[OPEN]] AS [[BINARY]] or [[RANDOM]] statement. * 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. * 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.''' @@ -23,7 +25,7 @@ The [[GET #]] statement reads data from a file or port device by bytes or record {{PageExamples}} ''Example 1:'' Opening a RANDOM file using LEN to calculate and LEN = to designate the file record size. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|TYPE}} variabletype x {{Cl|AS}} {{Cl|INTEGER}}' '2 bytes y {{Cl|AS}} {{Cl|STRING}} * 10' '10 bytes @@ -32,8 +34,8 @@ 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 -number% = 1 '<<<<<<<<<< record number to write cannot be zero +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" record.x = 255 @@ -53,7 +55,7 @@ PRINT NumRecords%; "records" {{Cl|CLOSE}} #2 {{Cl|PRINT}} newrec.x, newrec.y, newrec.z -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} {{OutputStart}} 16 bytes 255 Hello worl 65535 @@ -65,7 +67,7 @@ PRINT NumRecords%; "records" ''Example 2:'' Placing the contents of a numerical array into a [[BINARY]] file. You may want to put the array size at the beginning too. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DIM}} {{Cl|SHARED}} array(100) {{Cl|AS}} {{Cl|INTEGER}} {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 100 @@ -93,7 +95,7 @@ showme 'display array after transfer from file {{Cl|PRINT}} array(i); {{Cl|NEXT}} {{Cl|PRINT}} "done" -{{Cl|END SUB}} '' '' +{{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. @@ -106,4 +108,4 @@ showme 'display array after transfer from file {{PageNavigation}} -< + diff --git a/internal/help/GOSUB.txt b/internal/help/GOSUB_11111.txt similarity index 92% rename from internal/help/GOSUB.txt rename to internal/help/GOSUB_11111.txt index a170b41d5..f36d07f30 100644 --- a/internal/help/GOSUB.txt +++ b/internal/help/GOSUB_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:34}} [[GOSUB]] sends the program flow to a sub procedure identified by a line number or label. @@ -7,11 +9,11 @@ {{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. --> + * GOSUB and GOTO can be used '''within''' [[SUB]] or [[FUNCTION]] procedures, but cannot refer to a label located outside the procedure. -==QBasic/QuickBASIC== +{{PageQBasic}} * Too many GOSUBs without a [[RETURN]] can eventually cause "Out of Stack Errors" in QBasic as each GOSUB uses memory to store the location to return to. Each [[RETURN]] frees the memory of the GOSUB it returns to. @@ -75,4 +77,4 @@ It returned to IF a = 1 {{PageNavigation}} -< + diff --git a/internal/help/GOTO.txt b/internal/help/GOTO_1111.txt similarity index 94% rename from internal/help/GOTO.txt rename to internal/help/GOTO_1111.txt index 38f351bd3..0d6d49735 100644 --- a/internal/help/GOTO.txt +++ b/internal/help/GOTO_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:36}} The [[GOTO]] statement sends the procedure to a line label or a line number in the program. @@ -18,7 +20,7 @@ The [[GOTO]] statement sends the procedure to a line label or a line number in t {{PageExamples}} ''Example:'' -{{CodeStart}} '' '' +{{CodeStart}} 1 {{Cl|PRINT}} "first line": {{Cl|GOTO}} gohere 2 {{Cl|PRINT}} "second line": {{Cl|GOTO}} 3 @@ -26,7 +28,7 @@ gohere: {{Cl|PRINT}} "third line" {{Cl|GOTO}} 2 -3 {{Cl|END}} '' '' +3 {{Cl|END}} {{CodeEnd}} {{OutputStart}} first line @@ -46,4 +48,4 @@ second line {{PageNavigation}} -< + diff --git a/internal/help/Greater_Than.txt b/internal/help/Greater_Than_1000000_1000.txt similarity index 86% rename from internal/help/Greater_Than.txt rename to internal/help/Greater_Than_1000000_1000.txt index b1bd5eb7b..b070dff39 100644 --- a/internal/help/Greater_Than.txt +++ b/internal/help/Greater_Than_1000000_1000.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:25:01}} The '''>''' condition symbol denotes that a value must be greater than another value for the condition to be True. @@ -11,10 +13,10 @@ The '''>''' condition symbol denotes that a value must be greater than another v ''See also:'' * [[Equal|=]] -* [[Not_Equal|<>]] -* [[Less_Than|<]] +* [[Not_Equal|<>]] +* [[Less_Than|<]] * [[Relational Operations]] {{PageNavigation}} -< + diff --git a/internal/help/Greater_Than_Or_Equal.txt b/internal/help/Greater_Than_Or_Equal_1000000_1000_10_10000.txt similarity index 75% rename from internal/help/Greater_Than_Or_Equal.txt rename to internal/help/Greater_Than_Or_Equal_1000000_1000_10_10000.txt index 6b5e61f1e..fe4787115 100644 --- a/internal/help/Greater_Than_Or_Equal.txt +++ b/internal/help/Greater_Than_Or_Equal_1000000_1000_10_10000.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:25:03}} The '''>=''' condition symbol denotes that a value must be greater than or equal to another value for the condition to be True. @@ -7,10 +9,10 @@ The '''>=''' condition symbol denotes that a value must be greater than or equal ''See also:'' * [[Equal|=]] -* [[Not_Equal|<>]] -* [[Less_Than_Or_Equal|<=]] +* [[Not_Equal|<>]] +* [[Less_Than_Or_Equal|<=]] * [[Relational Operations]] {{PageNavigation}} -< + diff --git a/internal/help/HEX$.txt b/internal/help/HEX$.txt deleted file mode 100644 index 1f9da8461..000000000 --- a/internal/help/HEX$.txt +++ /dev/null @@ -1,70 +0,0 @@ -The [[HEX$]] function returns the base 16 hexadecimal representation of an [[INTEGER]], [[LONG]] or [[_INTEGER64]] value as a [[STRING]]. - - -{{PageSyntax}} -:{{Parameter|result$}} = [[HEX$]]({{Parameter|decimalNumber}}) - - -{{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}}. - - -{{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$ = " \ \ | \\ | \\ " - -FOR n% = 0 TO 15 - LOCATE 4 + n%, 20: {{Cl|PRINT USING}} template$; {{Cl|STR$}}(n%); {{Cl|HEX$}}(n%); {{Cl|OCT$}}(n%) -NEXT n% '' '' -{{CodeEnd}} -{{OutputStart}} - Decimal | Hexadecimal | Octal - -----------+-------------+-------- - 0 | 0 | 0 - 1 | 1 | 1 - 2 | 2 | 2 - 3 | 3 | 3 - 4 | 4 | 4 - 5 | 5 | 5 - 6 | 6 | 6 - 7 | 7 | 7 - 8 | 8 | 10 - 9 | 9 | 11 - 10 | A | 12 - 11 | B | 13 - 12 | C | 14 - 13 | D | 15 - 14 | E | 16 - 15 | F | 17 -{{OutputEnd}} -''Note:'' Decimal [[STR$]] values contain a leading sign space so values require an extra space in the template using the slash format. - - -''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$) -{{CodeEnd}} - -{{OutputStart}} -Hex: FF -Converting Hex value to Decimal: 255 -{{OutputEnd}} - - -{{PageSeeAlso}} -* [[OCT$]], [[STR$]], [[VAL]] -* [[&H]] {{text|(hexadecimal)}}, [[&O]] {{text|(octal)}}, [[&B]] {{text|(binary)}} -* [[Base Comparisons]] -* [[HEX$ 32 Bit Values]] - - -{{PageNavigation}} -< diff --git a/internal/help/HEX$_111$.txt b/internal/help/HEX$_111$.txt new file mode 100644 index 000000000..c0d5d5027 --- /dev/null +++ b/internal/help/HEX$_111$.txt @@ -0,0 +1,78 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:37}} +This function returns the hexadecimal (base 16) representation of any numeric value. + + +{{PageSyntax}} +: {{Parameter|hexvalue$}} = [[HEX$]]({{Parameter|number}}) + + +{{PageParameters}} +* {{Parameter|number}} can be any [[INTEGER]], [[LONG]] or [[_INTEGER64]] value, positive or negative. +* {{Parameter|number}} can also be any [[SINGLE]], [[DOUBLE]] or [[_FLOAT]] value, but only the integer part of the value is converted in that case. That is, from the value ''-123.45'' the function would convert the ''-123'' only. + + +{{PageDescription}} +* The function returns the base 16 (hexadecimal) representation of the given {{Parameter|number}} as [[STRING]]. +* Different from [[STR$]], this function does not return a leading sign placeholder space, so no [[LTRIM$]] to strip that space from positive numbers is necessary. +* [[VAL]] can convert the returned hex string value back to a decimal value by prefixing the string with "[[&H]]". +** Eg. {{InlineCode}}decimal = VAL("&H" + hexvalue$){{InlineCodeEnd}}. + + +{{PageExamples}} +;Example 1: Comparing decimal, hexadecimal, octal and binary string values from 0 to 15. +{{CodeStart}} +tabletop$ = " Decimal | Hexadecimal | Octal | Binary " +tablesep$ = "---------+-------------+-------+--------" +tableout$ = " \ \ | \\ | \\ | \ \ " 'the PRINT USING template + +{{Cl|LOCATE}} 2, 10: {{Cl|PRINT}} tabletop$ +{{Cl|LOCATE}} 3, 10: {{Cl|PRINT}} tablesep$ +{{Cl|FOR...NEXT|FOR}} n% = 0 {{Cl|TO}} 15 + {{Cl|LOCATE}} 4 + n%, 10: {{Cl|PRINT USING}} tableout$; {{Cl|STR$}}(n%); {{Cl|HEX$}}(n%); {{Cl|OCT$}}(n%); {{Cl|_BIN$}}(n%) +{{Cl|NEXT}} n% +{{CodeEnd}} +;Note:Although the decimal numbers 0-15 have a maximum width of 2 digits only, an extra space in the ''tableout$'' template is needed when using the (fixed width string) slash output format, as [[STR$]] values contain a leading sign placeholder space. +{{OutputStart}} + Decimal | Hexadecimal | Octal | Binary + ---------+-------------+-------+-------- + 0 | 0 | 0 | 0 + 1 | 1 | 1 | 1 + 2 | 2 | 2 | 10 + 3 | 3 | 3 | 11 + 4 | 4 | 4 | 100 + 5 | 5 | 5 | 101 + 6 | 6 | 6 | 110 + 7 | 7 | 7 | 111 + 8 | 8 | 10 | 1000 + 9 | 9 | 11 | 1001 + 10 | A | 12 | 1010 + 11 | B | 13 | 1011 + 12 | C | 14 | 1100 + 13 | D | 15 | 1101 + 14 | E | 16 | 1110 + 15 | F | 17 | 1111 +{{OutputEnd}} + + +;Example 2:Converting a hexadecimal value to decimal. +{{CodeStart}} +hexvalue$ = {{Cl|HEX$}}(255) +{{Cl|PRINT}} "Hex: "; hexvalue$ +{{Cl|PRINT}} "Converting Hex value to Decimal:"; {{Cl|VAL}}("&H" + hexvalue$) +{{CodeEnd}} +{{OutputStart}} +Hex: FF +Converting Hex value to Decimal: 255 +{{OutputEnd}} + + +{{PageSeeAlso}} +* [[_BIN$]], [[OCT$]], [[STR$]], [[VAL]] +* [[&B]] {{text|(binary)}}, [[&H]] {{text|(hexadecimal)}}, [[&O]] {{text|(octal)}} +* [[Base Comparisons]] +* [[HEX$ 32 Bit Values]] + + +{{PageNavigation}} + diff --git a/internal/help/IF...THEN.txt b/internal/help/IF...THEN_11...1111.txt similarity index 81% rename from internal/help/IF...THEN.txt rename to internal/help/IF...THEN_11...1111.txt index 1a7d2a540..893c9bff7 100644 --- a/internal/help/IF...THEN.txt +++ b/internal/help/IF...THEN_11...1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:01}} [[IF...THEN]] statements make boolean (true or false) evaluations to automate program decision making. {{PageSyntax}} @@ -38,10 +40,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> +
When evaluating a number value, no IF value > 0 operation is necessary for values not 0. Use: IF value THEN
-<center>'''Boolean Conditional Operators:'''</center> +
'''Boolean Conditional Operators:'''
:::::* [[AND (boolean)]] can be used to add extra conditions to a boolean statement evaluation. @@ -49,18 +51,18 @@ :::::* 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> +
'''Mathematical Logical operators:'''
+
* Truth table of the 6 BASIC Logical Operators:
{{Template:LogicalTruthTable}} -<center>* '''Note that Basic returns -1 for True and 0 for False.'''</center> +
* '''Note that Basic returns -1 for True and 0 for False.'''
{{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}} '' '' +{{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 '' ' @@ -68,58 +70,58 @@ ''Example 2:'' IF statement blocks require that the IF THEN and END IF statements be separate from the code executed. -{{CodeStart}} '' '' +{{CodeStart}} {{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 -{{Cl|END IF}} '' '' +{{Cl|END IF}} {{CodeEnd}} ''Example 3:'' True or False evaluation of a numerical value executes only when the value is not 0. '''Cannot evaluate [[STRING]] values.''' -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|INPUT}} "Enter a number or just hit Enter: ", x -{{Cl|IF...THEN|IF}} x {{Cl|THEN}} {{Cl|PRINT}} 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}} '' '' +{{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|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}} '' '' +{{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|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}} '' '' +{{CodeStart}} 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> +
'''QBasic decimal point value comparison errors'''
* 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}} '' '' +{{CodeStart}} 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. @@ -133,4 +135,4 @@ z# = x# + y# {{PageNavigation}} -< + diff --git a/internal/help/IMP.txt b/internal/help/IMP_111.txt similarity index 93% rename from internal/help/IMP.txt rename to internal/help/IMP_111.txt index dbdd26a46..19533d91d 100644 --- a/internal/help/IMP.txt +++ b/internal/help/IMP_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:38}} The [[IMP]] logical operator converts the result of two comparative values and returns a bit result. @@ -21,4 +23,4 @@ The [[IMP]] logical operator converts the result of two comparative values and r {{PageNavigation}} -< + diff --git a/internal/help/INKEY$.txt b/internal/help/INKEY$_11111$.txt similarity index 82% rename from internal/help/INKEY$.txt rename to internal/help/INKEY$_11111$.txt index d04efd9f3..6c951c09e 100644 --- a/internal/help/INKEY$.txt +++ b/internal/help/INKEY$_11111$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:41}} The [[INKEY$]] function returns user input as [[ASCII]] [[STRING]] character(s) from the keyboard buffer. @@ -11,27 +13,27 @@ The [[INKEY$]] function returns user input as [[ASCII]] [[STRING]] character(s) * 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. +* {{InlineCode}}{{Cl|LOCATE}} , , 1{{InlineCodeEnd}} displays the INKEY$ cursor. Use {{InlineCode}}{{Cl|LOCATE}} , , 0{{InlineCodeEnd}} to turn it off. * To receive input from a [[$CONSOLE]] window, use [[_CINP]]. * Returns can be evaluated as certain [[ASCII]] characters or codes. {{WhiteStart}}' '''ASCII Keyboard Codes''' ' -'''' Esc F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Sys ScL Pause''' +'''' Esc F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Sys ScL Pause''' ' 27 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +133 +134 - - - -'''' `~ 1! 2@ 3# 4$ 5% 6^ 7& 8* 9( 0) -_ =+ BkSp Ins Hme PUp NumL / * -''' +'''' `~ 1! 2@ 3# 4$ 5% 6^ 7& 8* 9( 0) -_ =+ BkSp Ins Hme PUp NumL / * -''' ' 126 33 64 35 36 37 94 38 42 40 41 95 43 8 +82 +71 +73 - 47 42 45 ''' 96 49 50 51 52 53 54 55 56 57 48 45 61'' '''' 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''' +''' 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''' ' * 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 ''' -' * - * 32 * - - * +75 +80 +77 +82 +83 13 +' * - * 32 * - - * +75 +80 +77 +82 +83 13 ' '' 48 46'' ' ' ''' ''Italics'' = LCase/NumLock On * = 2 byte combo only, + = 2 Byte: CHR$(0) + CHR$(code)''' @@ -39,17 +41,17 @@ The [[INKEY$]] function returns user input as [[ASCII]] [[STRING]] character(s) {{WhiteEnd}} ==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}}''' +* 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 = ASC(press$, 2)|green}}''' -<center>'''[[ASCII#Two_Byte_Codes|Two Byte Ctrl, Alt and Shift + Function key combinations]]'''</center> +
'''[[ASCII#Two_Byte_Codes|Two Byte Ctrl, Alt and Shift + Function key combinations]]'''
-{{WhiteStart}} '''Two Byte Characters Β  Β Key Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β CHR$(0)Β + "?" ''' +{{WhiteStart}} '''Two Byte Characters Key CHR$(0) + "?" ''' - CHR$(0) + CHR$(16-50) [Alt] + letter + CHR$(0) + CHR$(16-50) [Alt] + letter CHR$(0) + CHR$(59) [F1] ";" - CHR$(0) + CHR$(60) [F2] "<" + CHR$(0) + CHR$(60) [F2] "<" CHR$(0) + CHR$(61) [F3] "=" CHR$(0) + CHR$(62) [F4] ">" CHR$(0) + CHR$(63) [F5] "?" @@ -72,7 +74,7 @@ The [[INKEY$]] function returns user input as [[ASCII]] [[STRING]] character(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$(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] "Γ " @@ -84,14 +86,14 @@ The [[INKEY$]] function returns user input as [[ASCII]] [[STRING]] character(s) 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 = _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" {{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 +102,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|LOOP}} {{Cl|UNTIL}} K$ = {{Cl|CHR$}}(27) 'Esc key exit '' '' + {{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. +: ''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. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DO...LOOP|DO}} {{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|PRINT}} K$ 'print valid user entry {{Cl|IF...THEN|IF}} K$ = "N" {{Cl|THEN}} {{Cl|END}} -{{Cl|LOOP}} '' '' +{{Cl|LOOP}} {{CodeEnd}} ''Example 4:'' Getting just number values entered by a user in an INKEY$ input loop. -{{CodeStart}} '' '' +{{CodeStart}} {{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 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|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. @@ -146,11 +148,11 @@ 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$}}(80) {{Cl|AND (boolean)|AND}} movey < 23 {{Cl|THEN}} movey = movey + 1 + {{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$}}(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}} 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|LOCATE}} py, px: {{Cl|PRINT}} {{Cl|SPACE$}}(1); 'erase old sprite {{Cl|LOCATE}} movey, movex: {{Cl|PRINT}} at$; 'show new position {{Cl|END IF}} @@ -160,7 +162,7 @@ DO ''Example 6:'' Using INKEY$ with the arrow or WASD keys to move the QB64 bee image sprite with [[_PUTIMAGE]]: -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DIM}} image {{Cl|AS}} {{Cl|LONG}} {{Cl|DIM}} x {{Cl|AS}} {{Cl|INTEGER}} {{Cl|DIM}} y {{Cl|AS}} {{Cl|INTEGER}} @@ -189,8 +191,8 @@ DO {{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}} '' '' + {{Cl|_PUTIMAGE}} (x, y), image +{{Cl|LOOP}} {{CodeEnd}} {{small|Adapted from code by Daniel}} : ''Note:'' The image can be placed off of the screen without error. The image moves 10 pixels to move faster. [[CLS]] eliminates any background. @@ -201,8 +203,8 @@ DO A$ = "": {{Cl|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 + 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 C% = b% - 119 ' convert to actual number {{Cl|IF...THEN|IF}} C% > 9 {{Cl|THEN}} C% = 0 num$ = num$ + {{Cl|LTRIM$}}({{Cl|STR$}}(C%)) @@ -211,23 +213,23 @@ DO {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|LEN}}(num$) = 3 ' 3 digit codes only {{Cl|PRINT}} num$ -{{Cl|PRINT}} {{Cl|CHR$}}({{Cl|VAL}}(num$)'' '' +{{Cl|PRINT}} {{Cl|CHR$}}({{Cl|VAL}}(num$) {{CodeEnd}}{{small|Code by Ted Weissgerber}} {{OutputStart}} 155 Β’ {{OutputEnd}} -:''Explanation:'' Hold down Alt key and press 3 keyboard code number keys. '''Number pad keys may not work.''' Note that [[INKEY$]] cannot read Alt, Ctrl or Shift key presses without a key combination and the return is CHR$(0) + CHR$(code). +:''Explanation:'' Hold down Alt key and press 3 keyboard code number keys. '''Number pad keys may not work.''' Note that [[INKEY$]] cannot read Alt, Ctrl or Shift key presses without a key combination and the return is CHR$(0) + CHR$(code). -''See also:'' +''See also:'' * [[_KEYHIT]], [[_KEYDOWN]], [[_MAPUNICODE]] * [[_KEYCLEAR]] * [[INPUT]], [[LINE INPUT]] -* [[INPUT$]], [[INP]] +* [[INPUT$]], [[INP]] * [[CHR$]], [[ASCII]] * [[ASC]], [[Scancodes]] (keyboard) * [[Windows_Libraries#Hot_Keys_.28maximize.29|Windows hot keys]] {{PageNavigation}} -< + diff --git a/internal/help/INPUT$.txt b/internal/help/INPUT$_11111$.txt similarity index 87% rename from internal/help/INPUT$.txt rename to internal/help/INPUT$_11111$.txt index b66ef3b64..0a4f3b202 100644 --- a/internal/help/INPUT$.txt +++ b/internal/help/INPUT$_11111$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:47}} The [[INPUT$]] function is used to receive data from the user's keyboard, an open file or an open port. @@ -12,7 +14,7 @@ The [[INPUT$]] function is used to receive data from the user's keyboard, an ope * fileOrPortNumber is the number that was used in the [[OPEN]] AS statement. * Returns [[STRING]] values including spaces or even extended [[ASCII]] characters. * Backspace key results in the [[CHR$]](8) character being added to an entry. -* Use {{InlineCode}}[[LOCATE]] , , 1{{InlineCodeEnd}} to view the cursor entry. Turn the cursor off using {{InlineCode}}LOCATE , , 0{{InlineCodeEnd}}. +* Use {{InlineCode}}{{Cl|LOCATE}} , , 1{{InlineCodeEnd}} to view the cursor entry. Turn the cursor off using {{InlineCode}}{{Cl|LOCATE}} , , 0{{InlineCodeEnd}}. * Use [[_DEST]] [[_CONSOLE]] before INPUT$ is used to receive input from a [[$CONSOLE|console]] window. @@ -23,27 +25,27 @@ The [[INPUT$]] function is used to receive data from the user's keyboard, an ope {{PageExamples}} ''Example 1:'' A keyboard limited length entry can be made with a fixed blinking cursor. Entry must be completed before it can be shown. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|LOCATE}} 10, 10, 1 'display fixed cursor at location year$ = {{Cl|INPUT$}}(4) 'waits until all 4 digits are entered -PRINT year$ 'display the text entry '' '' +PRINT year$ 'display the text entry {{CodeEnd}} ''Example 2:'' Reading bytes from a text file for an 80 wide screen mode. -{{CodeStart}} '' '' +{{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 text$ = {{Cl|INPUT$}}(70, 1) -{{Cl|LOCATE}} 5, 6, 0: PRINT text$ 'print text and turn cursor off '' '' +{{Cl|LOCATE}} 5, 6, 0: PRINT text$ 'print text and turn cursor off {{CodeEnd}} ''Example 3:'' Getting the entire text file data as one string value. -{{CodeStart}} '' '' +{{CodeStart}} {{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 '' '' +IF {{Cl|LOF}}(1) <= 32767 THEN Text$ = {{Cl|INPUT$}}(LOF(1), 1) +{{Cl|CLOSE}} #1 {{CodeEnd}} :''Explanation:'' The IF statement gets the entire contents when the file size is less than 32768. The program can then work with the string by using [[MID$]] or [[INSTR]]. Note: A text file string will also have '''CrLf''' line break end characters [[CHR$]](13) + [[CHR$]](10). @@ -56,4 +58,4 @@ IF {{Cl|LOF}}(1) <= 32767 THEN Text$ = {{Cl|INPUT$}}(LOF(1), 1) {{PageNavigation}} -< + diff --git a/internal/help/INPUT_(file_mode).txt b/internal/help/INPUT_(file_mode).txt deleted file mode 100644 index c364960e2..000000000 --- a/internal/help/INPUT_(file_mode).txt +++ /dev/null @@ -1,162 +0,0 @@ -The [[OPEN]] statement is used to open a file or [[OPEN_COM|COM]] serial communications port for program input or output. - - -{{PageSyntax}} -: [[OPEN]] {{Parameter|fileName$}} ['''FOR''' {{Parameter|mode}}] [{{{KW|ACCESS}}|{{{KW|LOCK}}|SHARED}} [{READ|WRITE}] [[AS]] [#]{{Parameter|fileNumber&}} [LEN = {{Parameter|recordLength}}] - - -===Legacy ''GW-BASIC'' syntax=== -: [[OPEN]] {{Parameter|modeLetter$}}, [#]{{Parameter|fileNumber&}}, {{Parameter|fileName$}}[, {{Parameter|recordLength}}] - - -{{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. -* {{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. - - -{{PageDescription}} -* '''QB64''' can open as many files as your computer memory can handle. QBasic could only open about 15 at a time. -* '''QB64 will allocate 4 bytes of memory for every possible file number up to the highest number used in a program.''' -* {{Parameter|mode}} defaults to RANDOM if the {{Parameter|mode}} or FOR access statement is omitted. (see open modes described below) -* '''Only the {{Parameter|fileName$}}, {{Parameter|fileNumber&}} and LEN = {{Parameter|recordLength}} values can use variable values in the QBasic syntax.''' -* 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. -* [[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". -** 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. - - -==Details== -===File ACCESS and LOCK Permissions=== -* [[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. - -===File Access Modes=== -* FOR mode can be: -** '''OUTPUT''': Sequential mode creates a new file or erases an existing file for new program output. Use [[WRITE (file statement)|WRITE #]] to write numerical or text data or [[PRINT (file statement)|PRINT #]] for text. '''OUTPUT clears files of all data''' and clears the receive buffer on other devices such as [[ON COM(n)|COM]]. -** '''APPEND''': Sequential mode creates a new file if it doesn't exist or appends program output to the end of an existing file. Use [[WRITE (file statement)|WRITE #]] for numerical or text data or [[PRINT (file statement)|PRINT #]] for text as in the OUTPUT mode. '''APPEND does not remove previous data.''' -** '''INPUT''' : Sequential mode '''only reads input''' from an existing file. '''[[ERROR Codes|File error]] if file does not exist.''' Use [[INPUT (file statement)|INPUT #]] for comma separated numerical or text data and [[LINE INPUT (file statement)|LINE INPUT #]] or [[INPUT$]] to only read text data. '''Use [[_FILEEXISTS]] or [[_DIREXISTS]] to avoid errors.''' -** '''BINARY''': Creates a new file when it doesn't exist or reads and writes to an existing binary file. Use [[GET|GET #]] to read or [[PUT|PUT #]] to write byte positions simultaneously. [[LEN]] = statements are ignored in this mode. -** '''RANDOM''': Creates a new file when it doesn't exist or reads or writes to an existing random file record. Use [[GET|GET #]] or [[PUT|PUT #]] to read or write to file records. A [[LEN]] = statement can define the byte size of a record (no LEN statement defaults to 128 bytes) -** Modes '''INPUT''', '''BINARY''' and '''RANDOM''' allow a file to be concurrently opened in a different mode and number. - - -====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'''. - - -{{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% - -{{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}} - {{Cl|END IF}} - {{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|END SELECT}} - {{Cl|PRINT}} {{Cl|CHR$}}(code%); 'use {{Cl|LOCATE}} before {{Cl|FUNCTION}} call to place print - {{Cl|NEXT}} - CheckName% = E% -{{Cl|END FUNCTION}} '' '' -{{CodeEnd}} -''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}} -{{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: -{{CodeStart}} '' '' -f% = {{Cl|FREEFILE}} 'should always be 1 at program start -{{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|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 2 - {{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. - - -''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|CLOSE}} #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|END}} - -{{CodeEnd}} - -{{OutputStart}} -If test.tst didn't exist: -A new file was created named test.tst and then deleted. -If test.tst did exist: -It was overwritten with this and deleted. -{{OutputEnd}} -:'''Warning:''' Make sure you don't have a file named test.tst before you run this or it will be overwritten. - - -{{PageSeeAlso}} -* [[PRINT (file statement)]], [[INPUT (file statement)]] -* [[GET]], [[PUT]], [[WRITE (file statement)]] -* [[INPUT$]], [[LINE INPUT (file statement)]] -* [[CLOSE]], [[LOF]], [[EOF]], [[LOC]] -* [[SEEK (statement)]], [[SEEK]] -* [[OPEN COM]], [[LEN]], [[RESET]] -* [[FIELD]], [[TYPE]] -* [[_FILEEXISTS]], [[_DIREXISTS]] -* [[_OPENCLIENT]], [[_OPENHOST]], [[_OPENCONNECTION]] {{text|(TCP/IP)}} -* [[_SNDOPEN]], [[_LOADIMAGE]] - - -{{PageNavigation}} -< diff --git a/internal/help/INPUT_(file_mode)_11111_(0000_0000).txt b/internal/help/INPUT_(file_mode)_11111_(0000_0000).txt new file mode 100644 index 000000000..8cde11b96 --- /dev/null +++ b/internal/help/INPUT_(file_mode)_11111_(0000_0000).txt @@ -0,0 +1,164 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:45}} +The [[OPEN]] statement is used to open a file or [[OPEN_COM|COM]] serial communications port for program input or output. + + +{{PageSyntax}} +: [[OPEN]] {{Parameter|fileName$}} ['''FOR''' {{Parameter|mode}}] [{{{KW|ACCESS}}|{{{KW|LOCK}}|SHARED}} [{READ|WRITE}] [[AS]] [#]{{Parameter|fileNumber&}} [LEN = {{Parameter|recordLength}}] + + +===Legacy ''GW-BASIC'' syntax=== +: [[OPEN]] {{Parameter|modeLetter$}}, [#]{{Parameter|fileNumber&}}, {{Parameter|fileName$}}[, {{Parameter|recordLength}}] + + +{{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. +* {{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. + + +{{PageDescription}} +* '''QB64''' can open as many files as your computer memory can handle. QBasic could only open about 15 at a time. +* '''QB64 will allocate 4 bytes of memory for every possible file number up to the highest number used in a program.''' +* {{Parameter|mode}} defaults to RANDOM if the {{Parameter|mode}} or FOR access statement is omitted. (see open modes described below) +* '''Only the {{Parameter|fileName$}}, {{Parameter|fileNumber&}} and LEN = {{Parameter|recordLength}} values can use variable values in the QBasic syntax.''' +* 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. +* [[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". +** 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. + + +==Details== +===File ACCESS and LOCK Permissions=== +* [[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. + +===File Access Modes=== +* FOR mode can be: +** '''OUTPUT''': Sequential mode creates a new file or erases an existing file for new program output. Use [[WRITE (file statement)|WRITE #]] to write numerical or text data or [[PRINT (file statement)|PRINT #]] for text. '''OUTPUT clears files of all data''' and clears the receive buffer on other devices such as [[ON COM(n)|COM]]. +** '''APPEND''': Sequential mode creates a new file if it doesn't exist or appends program output to the end of an existing file. Use [[WRITE (file statement)|WRITE #]] for numerical or text data or [[PRINT (file statement)|PRINT #]] for text as in the OUTPUT mode. '''APPEND does not remove previous data.''' +** '''INPUT''' : Sequential mode '''only reads input''' from an existing file. '''[[ERROR Codes|File error]] if file does not exist.''' Use [[INPUT (file statement)|INPUT #]] for comma separated numerical or text data and [[LINE INPUT (file statement)|LINE INPUT #]] or [[INPUT$]] to only read text data. '''Use [[_FILEEXISTS]] or [[_DIREXISTS]] to avoid errors.''' +** '''BINARY''': Creates a new file when it doesn't exist or reads and writes to an existing binary file. Use [[GET|GET #]] to read or [[PUT|PUT #]] to write byte positions simultaneously. [[LEN]] = statements are ignored in this mode. +** '''RANDOM''': Creates a new file when it doesn't exist or reads or writes to an existing random file record. Use [[GET|GET #]] or [[PUT|PUT #]] to read or write to file records. A [[LEN]] = statement can define the byte size of a record (no LEN statement defaults to 128 bytes) +** Modes '''INPUT''', '''BINARY''' and '''RANDOM''' allow a file to be concurrently opened in a different mode and number. + + +====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'''. + + +{{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% + +{{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}} + {{Cl|END IF}} + {{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|END SELECT}} + {{Cl|PRINT}} {{Cl|CHR$}}(code%); 'use {{Cl|LOCATE}} before {{Cl|FUNCTION}} call to place print + {{Cl|NEXT}} + CheckName% = E% +{{Cl|END FUNCTION}} +{{CodeEnd}} +''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}} = {{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: +{{CodeStart}} +f% = {{Cl|FREEFILE}} 'should always be 1 at program start +{{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|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 2 + {{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. + + +''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|CLOSE}} #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|END}} + +{{CodeEnd}} + +{{OutputStart}} +If test.tst didn't exist: +A new file was created named test.tst and then deleted. +If test.tst did exist: +It was overwritten with this and deleted. +{{OutputEnd}} +:'''Warning:''' Make sure you don't have a file named test.tst before you run this or it will be overwritten. + + +{{PageSeeAlso}} +* [[PRINT (file statement)]], [[INPUT (file statement)]] +* [[GET]], [[PUT]], [[WRITE (file statement)]] +* [[INPUT$]], [[LINE INPUT (file statement)]] +* [[CLOSE]], [[LOF]], [[EOF]], [[LOC]] +* [[SEEK (statement)]], [[SEEK]] +* [[OPEN COM]], [[LEN]], [[RESET]] +* [[FIELD]], [[TYPE]] +* [[_FILEEXISTS]], [[_DIREXISTS]] +* [[_OPENCLIENT]], [[_OPENHOST]], [[_OPENCONNECTION]] {{text|(TCP/IP)}} +* [[_SNDOPEN]], [[_LOADIMAGE]] + + +{{PageNavigation}} + diff --git a/internal/help/INPUT_(file_statement).txt b/internal/help/INPUT_(file_statement)_11111_(0000_000000000).txt similarity index 90% rename from internal/help/INPUT_(file_statement).txt rename to internal/help/INPUT_(file_statement)_11111_(0000_000000000).txt index 6a489bb00..318d616cb 100644 --- a/internal/help/INPUT_(file_statement).txt +++ b/internal/help/INPUT_(file_statement)_11111_(0000_000000000).txt @@ -1,12 +1,14 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:46}} The [[INPUT #]] file or port statement reads sequential data using one variable or a comma separated list of matching variable types. {{PageSyntax}} -: [[INPUT #]]{{Parameter|fileNumber&}}, {{Parameter|variable1}}[, {{Parameter|variable2}}, ..., {{Parameter|variableN}}] +: [[INPUT #]]{{Parameter|fileNumber&}}, {{Parameter|variable1}}[, {{Parameter|variable2}}, ..., {{Parameter|variableN}}] {{Parameters}} -* {{Parameter|fileNumber&}} is a positive [[LONG]] integer value used to [[OPEN]] the file FOR [[INPUT (file mode)|INPUT]] mode. +* {{Parameter|fileNumber&}} is a positive [[LONG]] integer value used to [[OPEN]] the file FOR [[INPUT (file mode)|INPUT]] mode. * The [[type]] of the ''variable'' used defines the value or list of values to be returned from the file. Numeric types must match the values returned. * As reflected in the syntax you can list a number of variables with different types seperated by a comma and they will hold the values in the file (keep in mind that the information in the file should match the variable types used). @@ -24,7 +26,7 @@ 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}} '' '' +{{CodeStart}} filename$ = "testfile.dat" x = 1: y = 2: z$ = "Three" @@ -42,18 +44,20 @@ K$ = {{Cl|INPUT$}}(1) 'press a key {{Cl|PRINT}} a, b, c$ {{Cl|WRITE}} a, b, c$ -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} {{OutputStart}} 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}} '' '' +{{CodeStart}} x$ = "Hello, how are you?" y$ = "I'm fine." @@ -68,7 +72,7 @@ y$ = "I'm fine." {{Cl|CLOSE}} #1 {{Cl|PRINT}} a$, b$ -{{Cl|WRITE}} a$, b$ '' '' +{{Cl|WRITE}} a$, b$ {{CodeEnd}} {{OutputStart}}Hello, how are you? I'm fine. "Hello, how are you?","I'm fine."{{OutputEnd}} @@ -84,4 +88,4 @@ y$ = "I'm fine." {{PageNavigation}} -< + diff --git a/internal/help/INPUT.txt b/internal/help/INPUT_11111.txt similarity index 89% rename from internal/help/INPUT.txt rename to internal/help/INPUT_11111.txt index 265612f2b..86f59b918 100644 --- a/internal/help/INPUT.txt +++ b/internal/help/INPUT_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:43}} The [[INPUT]] statement requests a [[STRING]] or numerical keyboard entry from the user. @@ -16,7 +18,7 @@ The [[INPUT]] statement requests a [[STRING]] or numerical keyboard entry from t {{PageDescription}} * '''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]]. +* 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. ** [[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. @@ -24,31 +26,31 @@ The [[INPUT]] statement requests a [[STRING]] or numerical keyboard entry from t ** [[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. * [[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!''' --> +* Numerical values starting with [[&H]], [[&O]] and [[&B]] can also be entered. + * 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. {{PageExamples}} ''Example 1:'' Using a variable in an input text message using PRINT. INPUT prompts cannot use variables. -{{CodeStart}} '' '' +{{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|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. ''Example 2:'' How QB64 avoids a ''Redo from start'' multiple entry error. Use commas between values. -{{CodeStart}} '' '' -{{Cl|DO}} '' '' +{{CodeStart}} +{{Cl|DO}} {{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|END}} '' '' +{{Cl|END}} {{CodeEnd}} {{OutputStart}} What is your name, age, and sex(M/F)? Tom,24,M @@ -58,7 +60,7 @@ You can drink beer! ''Example 3:'' Preventing screen roll after an input entry on the bottom 2 screen rows. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 12 {{Cl|COLOR}} 14: {{Cl|LOCATE}} 29, 2 ' place cursor at beginning of prompt line @@ -84,4 +86,4 @@ n$ = {{Cl|UCASE$}}(name$) ' convert search name to upper case {{PageNavigation}} -< + diff --git a/internal/help/INP.txt b/internal/help/INP_111.txt similarity index 81% rename from internal/help/INP.txt rename to internal/help/INP_111.txt index 07d90db66..7347da131 100644 --- a/internal/help/INP.txt +++ b/internal/help/INP_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:42}} [[INP]] returns a value from a computer register or port values at a specified physical address. @@ -9,33 +11,33 @@ * Address can be a decimal or hexadecimal [[INTEGER]] value. * [[INP]] reads directly from a register or port address. * It does not require a [[DEF SEG]] memory segment address like [[PEEK]] or [[POKE]] do. -* Reads color port intensity settings after {{InlineCode}}[[OUT]] &H3C7, attribute{{InlineCodeEnd}} sets the starting attribute read mode. +* Reads color port intensity settings after {{InlineCode}}[[OUT]] &H3C7, attribute{{InlineCodeEnd}} sets the starting attribute read mode. {{PageExamples}} ''Example 1:'' Reading the current RGB color settings used in a bitmap to an array. -{{CodeStart}} '' '' +{{CodeStart}} SCREEN 12 {{Cl|DIM}} Colors%(47) - {{Cl|OUT}} &H3C7, 0 ' set color port for INP reads at attribute 0 to start + {{Cl|OUT}} &H3C7, 0 ' set color port for INP reads at attribute 0 to start {{Cl|FOR...NEXT|FOR}} i = 0 {{Cl|TO}} 47 - Colors%(i) = {{Cl|INP}}(&H3C9) ' moves to next color attribute every 3 loops - {{Cl|NEXT}} '' '' + Colors%(i) = {{Cl|INP}}(&H3C9) ' moves to next color attribute every 3 loops + {{Cl|NEXT}} {{CodeEnd}} ''Example 2:'' Reading the keyboard Scan Codes as an alternative to [[INKEY$]] -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DO}}: {{Cl|SLEEP}} - scancode% = {{Cl|INP}}(&H60) + scancode% = {{Cl|INP}}(&H60) a$ = {{Cl|INKEY$}} ' clears keyboard buffer {{Cl|PRINT}} scancode%; - {{Cl|LOOP}} {{Cl|UNTIL}} scancode% = 1 ' [ESC] keypress exit '' '' + {{Cl|LOOP}} {{Cl|UNTIL}} scancode% = 1 ' [ESC] keypress exit {{CodeEnd}} ''Example 3:'' A simple ping pong game using an array function to read multiple keys for two players. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DEFINT}} A-Z {{Cl|SCREEN}} 12 {{Cl|DIM}} ball%(100) ' Set aside enough space to hold the ball sprite @@ -59,22 +61,22 @@ DO: {{Cl|_LIMIT}} 100 'adjust higher for faster {{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}} 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}} +{{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 < ymin + 5 {{Cl|THEN}} dy = 1 +{{Cl|IF...THEN|IF}} y < ymin + 5 {{Cl|THEN}} dy = 1 ' Display the sprite elsewhere on the screen x = x + dx @@ -95,12 +97,12 @@ y = y + dy {{Cl|FUNCTION}} ScanKey% (scancode%) {{Cl|STATIC}} Ready%, keyflags%() {{Cl|IF...THEN|IF}} {{Cl|NOT}} Ready% {{Cl|THEN}} {{Cl|REDIM}} keyflags%(0 {{Cl|TO}} 127): Ready% = -1 -i% = {{Cl|INP}}({{Cl|&H}}60) 'read keyboard states +i% = {{Cl|INP}}({{Cl|&H}}60) 'read keyboard states {{Cl|IF...THEN|IF}} (i% {{Cl|AND (boolean)|AND}} 128) {{Cl|THEN}} keyflags%(i% {{Cl|XOR (boolean)|XOR}} 128) = 0 {{Cl|IF...THEN|IF}} (i% {{Cl|AND (boolean)|AND}} 128) = 0 {{Cl|THEN}} keyflags%(i%) = -1 K$ = {{Cl|INKEY$}} ScanKey% = keyflags%(scancode%) -{{Cl|END FUNCTION}} '' '' +{{Cl|END FUNCTION}} {{CodeEnd}} : ''Note:'' [[_KEYDOWN]] can be used to read multiple keys simultaneously and is the '''recommended practice'''. @@ -118,4 +120,4 @@ ScanKey% = keyflags%(scancode%) {{PageNavigation}} -< + diff --git a/internal/help/INSTR.txt b/internal/help/INSTR_11111.txt similarity index 97% rename from internal/help/INSTR.txt rename to internal/help/INSTR_11111.txt index dbcc502af..6d9c281b7 100644 --- a/internal/help/INSTR.txt +++ b/internal/help/INSTR_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:48}} The [[INSTR]] function searches for the first occurence of a search [[STRING]] within a base string and returns the position it was found. @@ -27,7 +29,7 @@ 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}} '' '' +{{CodeStart}} 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 @@ -35,7 +37,7 @@ text$ = "The cats and dogs where playing, even though dogs don't like cats." {{Cl|LOOP}} {{Cl|UNTIL}} findcats% = 0 findmonkey% = {{Cl|INSTR}}(text$, "monkeys") ' find any occurance? -PRINT findmonkey%; "'monkeys' were found so it returned:"; findmonkey% '' '' +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 @@ -52,4 +54,4 @@ There is 'cats' in the string at position: 62 {{PageNavigation}} -< + diff --git a/internal/help/INTEGER.txt b/internal/help/INTEGER_1111111.txt similarity index 88% rename from internal/help/INTEGER.txt rename to internal/help/INTEGER_1111111.txt index ae1dd3e9e..945a27ebc 100644 --- a/internal/help/INTEGER.txt +++ b/internal/help/INTEGER_1111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:51}} [[INTEGER]] is a 2-byte number type definition that can hold whole numerical values. @@ -13,7 +15,7 @@ * '''QB64''' _UNSIGNED [[_INTEGER64]] values range from 0 to 18446744073709551615 * Many graphic programs require [[INTEGER]] arrays. * Variable type suffix is % or ~% for [[_UNSIGNED]]. Suffix can also be placed after a literal or hexadecimal numerical value. -* [[LONG]] integers use the '''&''' suffix and [[_INTEGER64]] use the '''&&''' suffix. +* [[LONG]] integers use the '''&''' suffix and [[_INTEGER64]] use the '''&&''' suffix. * Values can be converted to 2 byte [[ASCII]] string values using [[MKI$]] and back with [[CVI]]. * '''When a variable has not been defined or has no type suffix, the value defaults to [[SINGLE]].''' * '''Warning: QBasic keyword names cannot be used as numerical variable names with or without the type suffix.''' @@ -21,28 +23,28 @@ {{PageExamples}} ''Example 1:'' QBasic signed integers were limited from -32768 to 32767, but could not exceed 32767 or it would error: -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DO...LOOP|DO}}: {{Cl|_LIMIT}} 2000 i% = i% + 1 {{Cl|PRINT}} i% -{{Cl|LOOP}} {{Cl|UNTIL}} i% = 0 '' '' +{{Cl|LOOP}} {{Cl|UNTIL}} i% = 0 {{CodeEnd}} :''Explanation:'' In '''QB64''' the count will go to 32767, then count up from -32768 to 0 before repeating the process without error. ''Example 2:'' When a signed '''QB64''' INTEGER value exceeds 32767, the value may become a negative value: -{{CodeStart}} '' '' +{{CodeStart}} i% = 38000 -{{Cl|PRINT}} i% '' '' +{{Cl|PRINT}} i% {{CodeEnd}}{{OutputStart}}-27536 {{OutputEnd}} :''Explanation:'' Use an [[_UNSIGNED]] INTEGER or a ~% variable type suffix for only positive integer values up to 65535. ''Example 3:'' In '''QB64''' [[_UNSIGNED]] INTEGER values greater than 65535 cycle over again from zero: -{{CodeStart}} '' '' +{{CodeStart}} i~% = 70000 -{{Cl|PRINT}} i~% '' '' +{{Cl|PRINT}} i~% {{CodeEnd}}{{OutputStart}} 4464 {{OutputEnd}} :''Explanation:'' In QB64 an unsigned integer value of 65536 would be 0 with values increasing by the value minus 65536. @@ -54,9 +56,9 @@ i~% = 70000 * [[LEN]], [[MKI$]], [[CVI]] * [[_DEFINE]], [[_UNSIGNED]] * [[Variable Types]] -* [[&B]] (binary), [[&O]] (octal), [[&H]] (hexadecimal) +* [[&B]] (binary), [[&O]] (octal), [[&H]] (hexadecimal) * [[\|Integer Division]], [[MOD]] (Integer remainder division) {{PageNavigation}} -< + diff --git a/internal/help/INTERRUPTX.txt b/internal/help/INTERRUPTX_1111111111.txt similarity index 88% rename from internal/help/INTERRUPTX.txt rename to internal/help/INTERRUPTX_1111111111.txt index 4682c39e6..611de9d8d 100644 --- a/internal/help/INTERRUPTX.txt +++ b/internal/help/INTERRUPTX_1111111111.txt @@ -1,25 +1,27 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:53}} The [[INTERRUPTX]] statement is an assembly routine for accessing computer information registers. -==Legacy support== -* Registers are emulated in '''QB64''' to allow older programs to be compiled. To enable mouse input in your programs, the recommended practice is to use [[_MOUSEINPUT]] and related functions. - - {{PageSyntax}} : [[CALL]] [[INTERRUPTX]]({{Parameter|intNum}}, {{Parameter|inRegs}}, {{Parameter|outRegs}}) +{{PageLegacySupport}} +* Registers are emulated in '''QB64''' to allow older programs to be compiled. To enable mouse input in your programs, the recommended practice is to use [[_MOUSEINPUT]] and related functions. + + {{Parameters}} * Registers are emulated in QB64 and there is no support for {{Parameter|intNum}} 33h mouse functions above 3 or {{Parameter|intNum}} requests other than 33. * {{Parameter|inRegs}} are the values placed into the call and {{Parameter|outRegs}} are the register return values. ==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. '''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. -{{TextStart}} '' '' +{{TextStart}} {{Cb|TYPE}} RegTypeX ax AS INTEGER bx AS INTEGER @@ -31,7 +33,7 @@ The [[INTERRUPTX]] statement is an assembly routine for accessing computer infor flags AS INTEGER ds AS INTEGER es AS INTEGER -{{Cb|END TYPE}} '' '' +{{Cb|END TYPE}} {{TextEnd}} {{CodeStart}} {{Cl|DIM}} {{Cl|SHARED}} inregs {{Cl|AS}} RegTypeX, outregs {{Cl|AS}} RegTypeX @@ -47,4 +49,4 @@ The [[INTERRUPTX]] statement is an assembly routine for accessing computer infor {{PageNavigation}} -< + diff --git a/internal/help/INTERRUPT.txt b/internal/help/INTERRUPT_111111111.txt similarity index 88% rename from internal/help/INTERRUPT.txt rename to internal/help/INTERRUPT_111111111.txt index 8a446a484..1d7514fab 100644 --- a/internal/help/INTERRUPT.txt +++ b/internal/help/INTERRUPT_111111111.txt @@ -1,25 +1,27 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:52}} The [[INTERRUPT]] statement is an assembly routine for accessing computer information registers. -==Legacy support== -* Registers are emulated in '''QB64''' to allow older programs to be compiled. To enable mouse input in your programs, the recommended practice is to use [[_MOUSEINPUT]] and related functions. - - {{PageSyntax}} : [[CALL]] [[INTERRUPT]]({{Parameter|intNum}}, {{Parameter|inRegs}}, {{Parameter|outRegs}}) +{{PageLegacySupport}} +* Registers are emulated in '''QB64''' to allow older programs to be compiled. To enable mouse input in your programs, the recommended practice is to use [[_MOUSEINPUT]] and related functions. + + {{Parameters}} * Registers are emulated in QB64 and there is no support for {{Parameter|intNum}} 33h mouse functions above 3 or {{Parameter|intNum}} requests other than 33. * {{Parameter|inRegs}} are the values placed into the call and {{Parameter|outRegs}} are the register return values. ==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. '''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. -{{TextStart}} '' '' +{{TextStart}} {{Cb|TYPE}} RegTypeX ax AS INTEGER bx AS INTEGER @@ -31,7 +33,7 @@ The [[INTERRUPT]] statement is an assembly routine for accessing computer inform flags AS INTEGER ds AS INTEGER es AS INTEGER -{{Cb|END TYPE}} '' '' +{{Cb|END TYPE}} {{TextEnd}} {{CodeStart}} {{Cl|DIM}} {{Cl|SHARED}} inregs {{Cl|AS}} RegTypeX, outregs {{Cl|AS}} RegTypeX @@ -47,4 +49,4 @@ The [[INTERRUPT]] statement is an assembly routine for accessing computer inform {{PageNavigation}} -< + diff --git a/internal/help/INT.txt b/internal/help/INT_111.txt similarity index 94% rename from internal/help/INT.txt rename to internal/help/INT_111.txt index c15a055b7..b6ddd6a5b 100644 --- a/internal/help/INT.txt +++ b/internal/help/INT_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:49}} The [[INT]] function rounds a numeric value down to the next whole number. @@ -34,4 +36,4 @@ PRINT INT(-2.5) {{PageNavigation}} -< + diff --git a/internal/help/IOCTL$.txt b/internal/help/IOCTL$.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/IOCTL$.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/IOCTL.txt b/internal/help/IOCTL.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/IOCTL.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/KEY(n).txt b/internal/help/KEY(n)_111(0).txt similarity index 96% rename from internal/help/KEY(n).txt rename to internal/help/KEY(n)_111(0).txt index f9c908ae6..7a31979da 100644 --- a/internal/help/KEY(n).txt +++ b/internal/help/KEY(n)_111(0).txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:58}} '''KEY(n)''' assigns, enables, disables or suspends event trapping of a keypress by setting the flag [[ON]], [[STOP]] or [[OFF]]. @@ -22,7 +24,7 @@ {{PageExamples}} ''Example 1:'' How to trap the LEFT direction keys on both the dedicated cursor keypad and the numeric keypad. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|KEY n|KEY}} 15, {{Cl|CHR$}}(128) + {{Cl|CHR$}}(75) ' Assign trap for LEFT arrow key on the cursor keypad {{Cl|ON KEY(n)|ON KEY(15)}} {{Cl|GOSUB}} CursorPad {{Cl|KEY(n)|KEY(15)}} {{Cl|ON}} ' enable event trapping @@ -40,12 +42,12 @@ PRINT "Pressed LEFT key on cursor keypad." NumericPad: PRINT "Pressed LEFT key on numeric keypad." -RETURN '' '' +RETURN {{CodeEnd}} ''Example 2:'' Trapping the F5 keypress. -{{CodeStart}} '' '' +{{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!)" @@ -56,7 +58,7 @@ execute: PRINT "You pressed the F5 key..." {{Cl|SLEEP}} 1 PRINT "Press any key to continue..." -SLEEP '' '' +SLEEP {{CodeEnd}} @@ -67,4 +69,4 @@ SLEEP '' '' {{PageNavigation}} -< + diff --git a/internal/help/KEY_LIST.txt b/internal/help/KEY_LIST_111_1111.txt similarity index 88% rename from internal/help/KEY_LIST.txt rename to internal/help/KEY_LIST_111_1111.txt index 3cff545ab..c1f97c7e2 100644 --- a/internal/help/KEY_LIST.txt +++ b/internal/help/KEY_LIST_111_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:00}} 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}} @@ -7,9 +9,9 @@ The [[KEY n]] statement is used to assign a "soft key" string or a flag and scan : '''KEY ''n%'', CHR$(''keyFlag%'') + CHR$(''scanCode'')''' -==Function Soft Key Strings (1 to 10, 30 & 31)== +==Function Soft Key Strings (1 to 10, 30 & 31)== -<center>'''Assigning "Softkey" [[STRING]] values to function key press events'''</center> +
'''Assigning "Softkey" [[STRING]] values to function key press events'''
* 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. @@ -30,7 +32,7 @@ The [[KEY n]] statement is used to assign a "soft key" string or a flag and scan ==User Defined Keys (15 to 29)== -<center>'''Assigning user defined keys or combinations with: KEY n, CHR$(keyflag) + CHR$(scancode)'''</center> +
'''Assigning user defined keys or combinations with: KEY n, CHR$(keyflag) + CHR$(scancode)'''
{{WhiteStart}} '''Function Key Flag Combination Values''' '''0''' = no function key combination flag(single key) @@ -50,13 +52,13 @@ The [[KEY n]] statement is used to assign a "soft key" string or a flag and scan ' {{text|1 2 3 4 5 6 7 8 9 10 30 31 Predefined Keys|red}} '''' Esc F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 SysReq ScrL Pause''' ' 1 59 60 61 62 63 64 65 66 67 68 87 88 -- 70 29 -' '''`~ 1! 2@ 3# 4$ 5% 6^ 7& 8* 9( 0) -_ =+ BkSpc Insert Home PgUp NumL / * -''' +' '''`~ 1! 2@ 3# 4$ 5% 6^ 7& 8* 9( 0) -_ =+ BkSpc Insert Home PgUp NumL / * -''' ' 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''' ' {{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 +70,13 @@ The [[KEY n]] statement is used to assign a "soft key" string or a flag and scan {{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> +
'''Trapping Ctrl, Alt and Shift key combinations'''
: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> +
'''Trapping Extended keys (Insert, Home, Page Up, Right Ctrl, R.Alt, and cursor arrow pad)'''
* 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,17 +88,17 @@ The [[KEY n]] statement is used to assign a "soft key" string or a flag and scan 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> +
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.
-<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

==Examples== ''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}} '' '' +{{CodeStart}} {{Cl|KEY n|KEY}} 1, "Help" {{Cl|KEY LIST}} INPUT "Press F1 or to quit press ENTER: ", a$ @@ -121,7 +123,7 @@ 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|CLS}} {{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 @@ -134,13 +136,13 @@ count = count + 1 control: 'NUMBER LOCK MUST BE OFF! {{Cl|PRINT}} "Control and + keys pressed!"; -{{Cl|RETURN}} '' '' +{{Cl|RETURN}} {{CodeEnd}} {{small|Code by Ted Weissgerber}} ''Example 3:'' Differentiating the extended cursor keypad arrows from the predefined Number Pad arrow keys. -{{CodeStart}} '' '' +{{CodeStart}} 'predefined keys 11 to 14 for number pad arrows only {{Cl|ON KEY(n)|ON KEY}}(11) {{Cl|GOSUB}} UpNum: {{Cl|KEY(n)|KEY}}(11) ON 'up {{Cl|ON KEY(n)|ON KEY}}(12) {{Cl|GOSUB}} LNum: {{Cl|KEY(n)|KEY}}(12) ON 'left @@ -195,12 +197,12 @@ COLOR 11: LOCATE 11, 26: PRINT "Right number pad" {{Cl|RETURN}} DnNum: COLOR 11: LOCATE 11, 26: PRINT "Down number pad " -{{Cl|RETURN}} '' '' +{{Cl|RETURN}} {{CodeEnd}} -: ''Explanation:'' The Number Lock or Caps Lock keys ON may hinder extended key reads in Qbasic but not QB64! +: ''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> +

([[#toc|Return to Table of Contents]])

{{PageSeeAlso}} @@ -211,4 +213,4 @@ COLOR 11: LOCATE 11, 26: PRINT "Down number pad " {{PageNavigation}} -< + diff --git a/internal/help/KEY_n.txt b/internal/help/KEY_n_111_0.txt similarity index 88% rename from internal/help/KEY_n.txt rename to internal/help/KEY_n_111_0.txt index 3cff545ab..144701372 100644 --- a/internal/help/KEY_n.txt +++ b/internal/help/KEY_n_111_0.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:57}} 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}} @@ -7,9 +9,9 @@ The [[KEY n]] statement is used to assign a "soft key" string or a flag and scan : '''KEY ''n%'', CHR$(''keyFlag%'') + CHR$(''scanCode'')''' -==Function Soft Key Strings (1 to 10, 30 & 31)== +==Function Soft Key Strings (1 to 10, 30 & 31)== -<center>'''Assigning "Softkey" [[STRING]] values to function key press events'''</center> +
'''Assigning "Softkey" [[STRING]] values to function key press events'''
* 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. @@ -30,7 +32,7 @@ The [[KEY n]] statement is used to assign a "soft key" string or a flag and scan ==User Defined Keys (15 to 29)== -<center>'''Assigning user defined keys or combinations with: KEY n, CHR$(keyflag) + CHR$(scancode)'''</center> +
'''Assigning user defined keys or combinations with: KEY n, CHR$(keyflag) + CHR$(scancode)'''
{{WhiteStart}} '''Function Key Flag Combination Values''' '''0''' = no function key combination flag(single key) @@ -50,13 +52,13 @@ The [[KEY n]] statement is used to assign a "soft key" string or a flag and scan ' {{text|1 2 3 4 5 6 7 8 9 10 30 31 Predefined Keys|red}} '''' Esc F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 SysReq ScrL Pause''' ' 1 59 60 61 62 63 64 65 66 67 68 87 88 -- 70 29 -' '''`~ 1! 2@ 3# 4$ 5% 6^ 7& 8* 9( 0) -_ =+ BkSpc Insert Home PgUp NumL / * -''' +' '''`~ 1! 2@ 3# 4$ 5% 6^ 7& 8* 9( 0) -_ =+ BkSpc Insert Home PgUp NumL / * -''' ' 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''' ' {{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 +70,13 @@ The [[KEY n]] statement is used to assign a "soft key" string or a flag and scan {{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> +
'''Trapping Ctrl, Alt and Shift key combinations'''
: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> +
'''Trapping Extended keys (Insert, Home, Page Up, Right Ctrl, R.Alt, and cursor arrow pad)'''
* 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,17 +88,17 @@ The [[KEY n]] statement is used to assign a "soft key" string or a flag and scan 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> +
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.
-<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

==Examples== ''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}} '' '' +{{CodeStart}} {{Cl|KEY n|KEY}} 1, "Help" {{Cl|KEY LIST}} INPUT "Press F1 or to quit press ENTER: ", a$ @@ -121,7 +123,7 @@ 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|CLS}} {{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 @@ -134,13 +136,13 @@ count = count + 1 control: 'NUMBER LOCK MUST BE OFF! {{Cl|PRINT}} "Control and + keys pressed!"; -{{Cl|RETURN}} '' '' +{{Cl|RETURN}} {{CodeEnd}} {{small|Code by Ted Weissgerber}} ''Example 3:'' Differentiating the extended cursor keypad arrows from the predefined Number Pad arrow keys. -{{CodeStart}} '' '' +{{CodeStart}} 'predefined keys 11 to 14 for number pad arrows only {{Cl|ON KEY(n)|ON KEY}}(11) {{Cl|GOSUB}} UpNum: {{Cl|KEY(n)|KEY}}(11) ON 'up {{Cl|ON KEY(n)|ON KEY}}(12) {{Cl|GOSUB}} LNum: {{Cl|KEY(n)|KEY}}(12) ON 'left @@ -195,12 +197,12 @@ COLOR 11: LOCATE 11, 26: PRINT "Right number pad" {{Cl|RETURN}} DnNum: COLOR 11: LOCATE 11, 26: PRINT "Down number pad " -{{Cl|RETURN}} '' '' +{{Cl|RETURN}} {{CodeEnd}} -: ''Explanation:'' The Number Lock or Caps Lock keys ON may hinder extended key reads in Qbasic but not QB64! +: ''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> +

([[#toc|Return to Table of Contents]])

{{PageSeeAlso}} @@ -211,4 +213,4 @@ COLOR 11: LOCATE 11, 26: PRINT "Down number pad " {{PageNavigation}} -< + diff --git a/internal/help/KILL.txt b/internal/help/KILL_1111.txt similarity index 94% rename from internal/help/KILL.txt rename to internal/help/KILL_1111.txt index f5fd0ed6c..17dd23e7a 100644 --- a/internal/help/KILL.txt +++ b/internal/help/KILL_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:01}} The [[KILL]] statement deletes a file designated by a [[STRING]] value or variable. @@ -20,7 +22,7 @@ The [[KILL]] statement deletes a file designated by a [[STRING]] value or variab {{PageExamples}} {{CodeStart}} -KILL "C:\Qbasic\data\2000data.dat" +KILL "C:\QBasic\data\2000data.dat" {{CodeEnd}} @@ -31,4 +33,4 @@ KILL "C:\Qbasic\data\2000data.dat" {{PageNavigation}} -< + diff --git a/internal/help/Keyword_Reference_-_Alphabetical.txt b/internal/help/Keyword_Reference_-_Alphabetical_1000000_100000000_-_100000000000.txt similarity index 88% rename from internal/help/Keyword_Reference_-_Alphabetical.txt rename to internal/help/Keyword_Reference_-_Alphabetical_1000000_100000000_-_100000000000.txt index c6dfb0b08..e139a6683 100644 --- a/internal/help/Keyword_Reference_-_Alphabetical.txt +++ b/internal/help/Keyword_Reference_-_Alphabetical_1000000_100000000_-_100000000000.txt @@ -1,42 +1,45 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:11}} +__NOEDITSECTION__ __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>{{small|Menu Created by Cyperium}}</p></div> +


'''Alphabetical QB64 Keyword Listings'''

Β Β Β Β '''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]] Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β 

'''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]]Β Β Β 

'''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]] Β Β Β Β Β 

[[#symbols|Symbols]] '''Β Β Β -Β Β Β ''' [[#references|References]]

{{small|Menu Created by Cyperium}}

-<center>[[QB64 FAQ|Go to Frequently Asked Questions about QB64]]</center> +
[[QB64 FAQ|Go to Frequently Asked Questions about QB64]]
-<p style="text-align: center">[[Keyword Reference - By usage|Go to keywords by Usage]]</p> +

[[Keyword Reference - By usage|Go to keywords by Usage]]

-<p style="text-align: center">Keywords beginning with _underscores are QB64 specific. '''To use them without the prefix, use [[$NOPREFIX]].'''</p> +

Keywords beginning with _underscores are QB64 specific. '''To use them without the prefix, use [[$NOPREFIX]].'''

-<p style="text-align: center">[[Keywords currently not supported by QB64]]</p> +

[[Keywords currently not supported by QB64]]

-<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> +

[[Keywords currently not supported by QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Keywords Not Supported in Linux or MAC versions]]

-<p style="text-align: center">Keywords without the underscore at the beginning should work with both QB 4.5 and QB64.</p> +

Keywords without the underscore at the beginning should work with both QB 4.5 and QB64.

-<p style="text-align: center">For comments or suggestions about this WIKI goto the [http://qb64phoenix.com/forum/index.php QB64 Forum].</p> +

For comments or suggestions about this WIKI goto the [http://qb64phoenix.com/forum/index.php QB64 Forum].

-<center> '''If code examples only display partial code, use the browser Refresh button'''</center> +
'''If code examples only display partial code, use the browser Refresh button'''
-<center>[[Main Page|Main Page with Appendix and Tutorials]]</center> +
[[Main Page|Main Page with Appendix and Tutorials]]
==QB64 specific keywords:== -<p style="text-align: center">The underscore prefix is reserved for QB64 _KEYWORDS only.</p> +

The underscore prefix is reserved for QB64 _KEYWORDS only.

-<div id = "uA">_A</div> +
_A
* [[_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}} -* [[Mathematical_Operations|_ARCCSC]] (function) {{text|is the inverse function of the cosecant. http://mathworld.wolfram.com/InverseCosecant.html}} -* [[Mathematical_Operations|_ARCSEC]] (function) {{text|is the inverse function of the secant. http://mathworld.wolfram.com/InverseSecant.html}} +* [[Mathematical Operations#Derived Mathematical Functions|_ARCCOT]] (function) {{text|is the inverse function of the cotangent. . http://mathworld.wolfram.com/InverseCosecant.html}} +* [[Mathematical Operations#Derived Mathematical Functions|_ARCCSC]] (function) {{text|is the inverse function of the cosecant. http://mathworld.wolfram.com/InverseCosecant.html}} +* [[Mathematical Operations#Derived Mathematical Functions|_ARCSEC]] (function) {{text|is the inverse function of the secant. http://mathworld.wolfram.com/InverseSecant.html}} * [[_ASIN]] (function) {{text|Returns the principal value of the arc sine of x, expressed in radians.}} * [[_ASINH]] (function) {{text|Returns the arc hyperbolic sine of x, expressed in radians.}} * [[_ASSERT]] (statement) {{text|Performs debug tests.}} @@ -50,9 +53,10 @@ __NOTOC__ ---- -<div id = "uB">_B</div> +
_B
* [[_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.}} +* [[_BIN$]] (function) {{text|returns the binary (base 2) [[STRING]] representation of the [[INTEGER]] part of any value.}} * [[_BLEND]] (statement) {{text|statement turns on 32 bit alpha blending for the current image or screen mode and is default.}} * [[_BLEND (function)]] {{text|returns -1 if enabled or 0 if disabled by [[_DONTBLEND]] statement.}} * [[_BLINK]] (statement) {{text|statement turns blinking colors on/off in SCREEN 0}} @@ -63,12 +67,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> +

([[#toc|Return to Table of Contents]])

---- -<div id = "uC">_C</div> +
_C
* [[_CAPSLOCK (function)]] {{text|returns -1 when Caps Lock is on}} * [[_CAPSLOCK]] (statement) {{text|sets Caps Lock key state}} * [[$CHECKING]] (QB64 C++ [[Metacommand]]) {{text|turns event error checking OFF or ON.}} @@ -102,14 +106,15 @@ __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> +

([[#toc|Return to Table of Contents]])

---- -<div id = "uD">_D</div> +
_D
* [[_D2G]] (function) {{text|converts degrees to gradient angle values.}} * [[_D2R]] (function) {{text|converts degrees to radian angle values.}} +* [[$DEBUG]] (metacommand) {{text|enables debugging features, allowing you to step through your code line by line}} * [[DECLARE LIBRARY|DECLARE LIBRARY (QB64 statement block)]] {{text|declares a C++, SDL or Operating System [[SUB]] or [[FUNCTION]] to be used.}} * [[DECLARE DYNAMIC LIBRARY|DECLARE DYNAMIC LIBRARY (QB64 statement)]] {{text|declares DYNAMIC, CUSTOMTYPE or STATIC library (DLL) [[SUB]] or [[FUNCTION]].}} * [[_DEFAULTCOLOR]] (function) {{text|returns the current default text color for an image handle or page.}} @@ -137,21 +142,23 @@ __NOTOC__ ---- -<div id = "uE">_E</div> +
_E
* [[_ECHO]] (statement) {{text|used in conjunction with $IF for the precompiler.}} * [[$ELSE]] (Pre-Compiler [[Metacommand]]) {{text|used in conjunction with $IF for the precompiler.}} * [[$ELSEIF]] (Pre-Compiler [[Metacommand]]) {{text|used in conjunction with $IF for the precompiler.}} * [[$END IF]] (Pre-Compiler [[Metacommand]]) {{text|used in conjunction with $IF for the precompiler.}} +* [[$ERROR]] (precompiler [[metacommand]]) {{text|used to trigger compiler errors.}} * [[_ERRORLINE]] (function) {{text|returns the source code line number that caused the most recent runtime error.}} +* [[_ERRORMESSAGE$]] (function) {{text|returns a human-readable message describing the most recent runtime error.}} * [[$EXEICON]] (Pre-Compiler [[Metacommand]]) {{text|used with a .ICO icon file name to embed the image into the QB64 executable.}} * [[_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> +

([[#toc|Return to Table of Contents]])

---- -<div id = "uF">_F</div> +
_F
* [[_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.}} @@ -168,18 +175,19 @@ __NOTOC__ ---- -<div id = "uG">_G</div> +
_G
* [[_G2D]] (function) {{text|converts gradient to degree angle values.}} * [[_G2R]] (function) {{text|converts gradient to radian angle values.}} +* [[_GLRENDER]] (statement) {{text|sets whether context is displayed, on top of or behind the software rendering.}} * [[_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> +

([[#toc|Return to Table of Contents]])

---- -<div id = "uH">_H</div> +
_H
* [[_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.}} @@ -188,22 +196,22 @@ __NOTOC__ ---- -<div id = "uI">_I</div> +
_I
* [[$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.}} * [[_INFLATE$]] (function) {{text|decompresses a string}} * [[_INSTRREV]] (function) {{text|allows searching for a substring inside another string, but unlike [[INSTR]] it returns the last occurrence instead of the first one.}} -* [[_INTEGER64]] (&& numerical type) {{text|can hold whole numerical values from -9223372036854775808 to 9223372036854775807.}} +* [[_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> +

([[#toc|Return to Table of Contents]])

---- -<div id = "uK">_K</div> +
_K
*[[_KEYCLEAR]] (statement) {{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.}} @@ -212,7 +220,7 @@ __NOTOC__ ---- -<div id = "uL">_L</div> +
_L
* [[$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$]].}} @@ -221,12 +229,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> +

([[#toc|Return to Table of Contents]])

---- -<div id = "uM">_M</div> +
_M
* [[_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.}} @@ -260,20 +268,20 @@ __NOTOC__ ---- -<div id = "uN">_N</div> +
_N
* [[_NEWIMAGE]] (function) {{text|creates a designated size program [[SCREEN]] or page image and returns a handle value.}} * [[$NOPREFIX]] (metacommand) {{text|allows QB64-specific keywords to be used without the underscore prefix.}} * [[_NUMLOCK (function)]] {{text|returns -1 when Num Lock is on}} * [[_NUMLOCK]] (statement) {{text|sets Num Lock key state}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

---- -<div id = "uO">_O</div> +
_O
* [[_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.}} +* [[_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.}} * [[_OPENCONNECTION]] (TCP/IP function) {{text|open's a connection from a client that the host has detected and returns a status handle.}} * [[_OPENHOST]] (TCP/IP function) {{text|opens a Host and returns a Host status handle.}} @@ -285,7 +293,7 @@ __NOTOC__ ---- -<div id = "uP">_P</div> +
_P
* [[_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.}} @@ -298,12 +306,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> +

([[#toc|Return to Table of Contents]])

---- -<div id = "uR">_R</div> +
_R
* [[_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.}} @@ -321,12 +329,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> +

([[#toc|Return to Table of Contents]])

---- -<div id = "uS">_S</div> +
_S
* [[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.}} @@ -379,12 +387,12 @@ __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> +

([[#toc|Return to Table of Contents]])

---- -<div id = "uT">_T</div> +
_T
* [[Mathematical_Operations|_TANH]] (function) {{text|Returns the hyperbolic tangent of x radians.}} * [[_TITLE]] (statement) {{text|sets the program title [[STRING|string]] value.}} @@ -397,7 +405,7 @@ __NOTOC__ ---- -<div id = "uU">_U</div> +
_U
* [[_UNSIGNED]] (numerical type) {{text|expands the positive range of numerical [[INTEGER]], [[LONG]] or [[_INTEGER64]] values returned.}} @@ -405,7 +413,7 @@ __NOTOC__ ---- -<div id = "uV">_V</div> +
_V
* [[$VERSIONINFO]] ([[Metacommand]]) {{text|adds metadata to Windows only binaries for identification purposes across the OS.}} * [[$VIRTUALKEYBOARD]] ([[Metacommand]] - Deprecated) {{text|turns the virtual keyboard ON or OFF for use in touch-enabled devices}} @@ -414,22 +422,22 @@ __NOTOC__ ---- -<div id = "uW">_W</div> +
_W
* [[_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> +

([[#toc|Return to Table of Contents]])

-<center>([[Keyword Reference - Alphabetical#QB64 specific keywords:|Go to Top of QB64 specific keywords]])</center> +
([[Keyword Reference - Alphabetical#QB64 specific keywords:|Go to Top of QB64 specific keywords]])
==Original QBasic keywords:== -'''<p style="text-align: center">These QBasic keywords (with a few noted exceptions) will work in all versions of QB64.</p>''' +'''

These QBasic keywords (with a few noted exceptions) will work in all versions of QB64.

''' -<div id = "A">A</div> +
A
* [[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.}} @@ -446,19 +454,19 @@ __NOTOC__ ---- -<div id = "B">B</div> +
B
* [[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> +

([[#toc|Return to Table of Contents]])

---- -<div id = "C">C</div> +
C
* [[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) @@ -490,12 +498,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> +

([[#toc|Return to Table of Contents]])

---- -<div id = "D">D</div> +
D
* [[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.}} @@ -515,12 +523,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> +

([[#toc|Return to Table of Contents]])

---- -<div id = "E">E</div> +
E
* [[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.}} @@ -538,12 +546,12 @@ __NOTOC__ * [[EXIT]] (statement) {{text|immediately exits a program [[FOR...NEXT]], [[DO...LOOP]], [[SUB]] or [[FUNCTION]] procedure.}} * [[EXP]] (function) {{text|returns the value of e to the exponential power specified.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

---- -<div id = "F">F</div> +
F
* [[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]].}} @@ -559,26 +567,26 @@ __NOTOC__ ---- -<div id = "G">G</div> +
G
* [[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> +

([[#toc|Return to Table of Contents]])

---- -<div id = "H">H</div> -* [[HEX$]] (function) {{text|returns the hexadecimal(base 16) [[STRING]] representation of a decimal [[INTEGER]] value.}} +
H
+* [[HEX$]] (function) {{text|returns the hexadecimal (base 16) [[STRING]] representation of the [[INTEGER]] part of any value.}} ---- -<div id = "I">I</div> +
I
* [[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.}} @@ -597,23 +605,23 @@ __NOTOC__ * [[IOCTL$]] (function) -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

---- -<div id = "K">K</div> +
K
* [[KEY n]] (statement) {{text|used with [[ON KEY(n)]] 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> +

([[#toc|Return to Table of Contents]])

---- -<div id = "L">L</div> +
L
* [[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]].}} @@ -628,7 +636,7 @@ __NOTOC__ * [[LOCK]] (statement) {{text|restricts access to portions or all of a file by other programs or processes.}} * [[LOF]] (function) {{text|returns the size of an [[OPEN]] file in bytes.}} * [[LOG]] (function) {{text|returns the natural logarithm of a specified numerical value}} -* [[LONG]] (& numerical type) {{text|4 byte whole values from -2147483648 to 2147483647.}} +* [[LONG]] (& numerical type) {{text|4 byte whole values from -2147483648 to 2147483647.}} * [[DO...LOOP|LOOP]] (block statement) {{text|bottom end of a recursive DO loop.}} * [[LPOS]] (function) {{text|returns the printer head position.}} * [[LPRINT]] (statement) {{text|sends [[STRING]] data to the default LPT or USB printer.}} @@ -636,12 +644,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> +

([[#toc|Return to Table of Contents]])

---- -<div id = "M">M</div> +
M
* [[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.}} @@ -657,18 +665,18 @@ __NOTOC__ ---- -<div id = "N">N</div> +
N
* [[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> +

([[#toc|Return to Table of Contents]])

---- -<div id = "O">O</div> -* [[OCT$]] (function) {{text|returns the octal (base 8) [[STRING]] representation of a decimal [[INTEGER]] value.}} +
O
+* [[OCT$]] (function) {{text|returns the octal (base 8) [[STRING]] representation of the [[INTEGER]] part of any value.}} * [[OFF]] (event statement) {{text|turns off all [[ON]] event checking.}} * [[ON COM(n)]] (statement) {{text|sets up a COM port event procedure call.}} * [[ON ERROR]] (statement) {{text|sets up and activates an error event checking procedure call. Use to avoid program errors.}} @@ -688,12 +696,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> +

([[#toc|Return to Table of Contents]])

---- -<div id = "P">P</div> +
P
* [[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]].}} @@ -717,12 +725,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> +

([[#toc|Return to Table of Contents]])

---- -<div id = "R">R</div> +
R
* [[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.}} @@ -740,12 +748,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> +

([[#toc|Return to Table of Contents]])

---- -<div id = "S">S</div> +
S
* [[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.}} @@ -779,12 +787,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> +

([[#toc|Return to Table of Contents]])

---- -<div id = "T">T</div> +
T
* [[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.}} @@ -798,19 +806,19 @@ __NOTOC__ ---- -<div id = "U">U</div> +
U
* [[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> +

([[#toc|Return to Table of Contents]])

---- -<div id = "V">V</div> +
V
* [[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.}} @@ -822,7 +830,7 @@ __NOTOC__ ---- -<div id = "W">W</div> +
W
* [[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.}} * [[WHILE]] (condition) {{text|evaluates a [[DO...LOOP]] or [[WHILE...WEND]] condition until it is False.}} @@ -836,23 +844,23 @@ __NOTOC__ ---- -<div id = "X">X</div> +
X
* [[XOR]] (logic operator) {{text|is used to compare two numerical values bitwise.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

-<center>([[Keyword Reference - Alphabetical#Original QBasic keywords:|Go to Top of Original QB keywords]])</center> +
([[Keyword Reference - Alphabetical#Original QBasic keywords:|Go to Top of Original QB keywords]])
-<!-- (referenced by QB64 IDE HELP) + -<div id = "glA">_glA</div> +
_glA
==OpenGL specific keywords:== -<center>'''All QB64 OpenGL keywords must use the underscore _gl prefix with the alphabetically listed function names.'''</center> -<center>Use [[$NOPREFIX]] to enable these to be used without the leading underscore.</center> +
'''All QB64 OpenGL keywords must use the underscore _gl prefix with the alphabetically listed function names.'''
+
Use [[$NOPREFIX]] to enable these to be used without the leading underscore.
* Important: See [[SUB _GL]] @@ -866,15 +874,15 @@ __NOTOC__ ---- -<div id = "glB">_glB</div> +
_glB
* [[_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> +

([[#toc|Return to Table of Contents]])

---- -<div id = "glC">_glC</div> +
_glC
* [[_glCallList]] (statement) {{text|OpenGL command}} * [[_glCallLists]] (statement) {{text|OpenGL command}} * [[_glClear]] (statement) {{text|OpenGL command clears buffers to preset values}} @@ -892,7 +900,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> +

([[#toc|Return to Table of Contents]])

* [[_glColor3s]] (statement) {{text|OpenGL command}} * [[_glColor3sv]] (statement) {{text|OpenGL command}} * [[_glColor3ub]] (statement) {{text|OpenGL command}} @@ -927,9 +935,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> +

([[#toc|Return to Table of Contents]])

---- -<div id = "glD">_glD</div> +
_glD
* [[_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}} @@ -944,7 +952,7 @@ __NOTOC__ ---- -<div id = "glE">_glE</div> +
_glE
* [[_glEdgeFlag]] (statement) {{text|OpenGL command}} * [[_glEdgeFlagPointer]] (statement) {{text|OpenGL command}} * [[_glEdgeFlagv]] (statement) {{text|OpenGL command}} @@ -965,9 +973,9 @@ __NOTOC__ * [[_glEvalPoint1]] (statement) {{text|OpenGL command}} * [[_glEvalPoint2]] (statement) {{text|OpenGL command}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

---- -<div id = "glF">_glF</div> +
_glF
* [[_glFeedbackBuffer]] (statement) {{text|OpenGL command}} * [[_glFinish]] (statement) {{text|OpenGL command}} * [[_glFlush]] (statement) {{text|OpenGL command}} @@ -978,9 +986,9 @@ __NOTOC__ * [[_glFrontFace]] (statement) {{text|OpenGL command}} * [[_glFrustum]] (statement) {{text|OpenGL command}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

---- -<div id = "glG">_glG</div> +
_glG
* [[_glGenLists]] (statement) {{text|OpenGL command}} * [[_glGenTextures]] (statement) {{text|OpenGL command}} * [[_glGetBooleanv]] (statement) {{text|OpenGL command}} @@ -1013,14 +1021,14 @@ __NOTOC__ * [[_glGetTexParameterfv]] (statement) {{text|OpenGL command}} * [[_glGetTexParameteriv]] (statement) {{text|OpenGL command}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

---- -<div id = "glH">_glH</div> +
_glH
* [[_glHint]] (statement) {{text|OpenGL command}} ---- -<div id = "glI">_glI</div> +
_glI
* [[_glIndexMask]] (statement) {{text|OpenGL command}} * [[_glIndexPointer]] (statement) {{text|OpenGL command}} * [[_glIndexd]] (statement) {{text|OpenGL command}} @@ -1039,9 +1047,9 @@ __NOTOC__ * [[_glIsList]] (statement) {{text|OpenGL command}} * [[_glIsTexture]] (statement) {{text|OpenGL command}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

---- -<div id = "glL">_glL</div> +
_glL
* [[_glLightModelf]] (statement) {{text|OpenGL command}} * [[_glLightModelfv]] (statement) {{text|OpenGL command}} * [[_glLightModeli]] (statement) {{text|OpenGL command}} @@ -1059,9 +1067,9 @@ __NOTOC__ * [[_glLoadName]] (statement) {{text|OpenGL command}} * [[_glLogicOp]] (statement) {{text|OpenGL command}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

---- -<div id = "glM">_glM</div> +
_glM
* [[_glMap1d]] (statement) {{text|OpenGL command}} * [[_glMap1f]] (statement) {{text|OpenGL command}} * [[_glMap2d]] (statement) {{text|OpenGL command}} @@ -1080,7 +1088,7 @@ __NOTOC__ ---- -<div id = "glN">_glN</div> +
_glN
* [[_glNewList]] (statement) {{text|OpenGL command}} * [[_glNormal3b]] (statement) {{text|OpenGL command}} * [[_glNormal3bv]] (statement) {{text|OpenGL command}} @@ -1094,14 +1102,14 @@ __NOTOC__ * [[_glNormal3sv]] (statement) {{text|OpenGL command}} * [[_glNormalPointer]] (statement) {{text|OpenGL command}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

---- -<div id = "glO">_glO</div> +
_glO
* [[_glOrtho]] (statement) {{text|OpenGL command}} ---- -<div id = "glP">_glP</div> +
_glP
* [[_glPassThrough]] (statement) {{text|OpenGL command}} * [[_glPixelMapfv]] (statement) {{text|OpenGL command}} * [[_glPixelMapuiv]] (statement) {{text|OpenGL command}} @@ -1125,9 +1133,9 @@ __NOTOC__ * [[_glPushMatrix]] (statement) {{text|OpenGL command}} * [[_glPushName]] (statement) {{text|OpenGL command}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

---- -<div id = "glR">_glR</div> +
_glR
* [[_glRasterPos2d]] (statement) {{text|OpenGL command}} * [[_glRasterPos2dv]] (statement) {{text|OpenGL command}} * [[_glRasterPos2f]] (statement) {{text|OpenGL command}} @@ -1146,7 +1154,7 @@ __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> +

([[#toc|Return to Table of Contents]])

* [[_glRasterPos4f]] (statement) {{text|OpenGL command}} * [[_glRasterPos4fv]] (statement) {{text|OpenGL command}} * [[_glRasterPos4i]] (statement) {{text|OpenGL command}} @@ -1163,14 +1171,13 @@ __NOTOC__ * [[_glRectiv]] (statement) {{text|OpenGL command}} * [[_glRects]] (statement) {{text|OpenGL command}} * [[_glRectsv]] (statement) {{text|OpenGL command}} -* [[_GLRENDER]] (statement) {{text|sets whether context is displayed, on top of or behind the software rendering.}} * [[_glRenderMode]] (statement) {{text|OpenGL command}} * [[_glRotated]] (statement) {{text|OpenGL command}} * [[_glRotatef]] (statement) {{text|OpenGL command}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

---- -<div id = "glS">_glS</div> +
_glS
* [[_glScaled]] (statement) {{text|OpenGL command}} * [[_glScalef]] (statement) {{text|OpenGL command}} * [[_glScissor]] (statement) {{text|OpenGL command}} @@ -1182,7 +1189,7 @@ __NOTOC__ ---- -<div id = "glT">_glT</div> +
_glT
* [[_glTexCoord1d]] (statement) {{text|OpenGL command}} * [[_glTexCoord1dv]] (statement) {{text|OpenGL command}} * [[_glTexCoord1f]] (statement) {{text|OpenGL command}} @@ -1204,7 +1211,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> +

([[#toc|Return to Table of Contents]])

* [[_glTexCoord3iv]] (statement) {{text|OpenGL command}} * [[_glTexCoord3s]] (statement) {{text|OpenGL command}} * [[_glTexCoord3sv]] (statement) {{text|OpenGL command}} @@ -1238,9 +1245,9 @@ __NOTOC__ * [[_glTranslated]] (statement) {{text|OpenGL command}} * [[_glTranslatef]] (statement) {{text|OpenGL command}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

---- -<div id = "glV">_glV</div> +
_glV
* [[_glVertex2d]] (statement) {{text|OpenGL command}} * [[_glVertex2dv]] (statement) {{text|OpenGL command}} * [[_glVertex2f]] (statement) {{text|OpenGL command}} @@ -1270,15 +1277,15 @@ __NOTOC__ -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

-<div id = "symbols"></div> +
==Symbols:== -<center>'''QB64 and QB Symbols:'''</center> +
'''QB64 and QB Symbols:'''
-<center>''[Note: All symbols below can also be used inside of literal quoted strings except for quotation marks.]''</center> +
''[Note: All symbols below can also be used inside of literal quoted strings except for quotation marks.]''
:'''Print, Input or File Formatting''' @@ -1297,7 +1304,7 @@ __NOTOC__ * [[+|+ 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]]. * [[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> +

([[#toc|Return to Table of Contents]])

:'''Variable Name Type Suffixes''' * [[STRING|$ STRING]] text character type: 1 byte @@ -1306,18 +1313,18 @@ __NOTOC__ * [[_FLOAT|## _FLOAT]] '''QB64''' decimal point numerical type (32 bytes) * [[_UNSIGNED|~ _UNSIGNED]] '''QB64''' [[INTEGER|whole]] positive numerical type when it precedes the 6 numerical suffixes below: * [[INTEGER|% INTEGER]] [[INTEGER|whole]] numerical type (2 bytes) -* [[LONG|& LONG]] [[INTEGER|whole]] numerical type (4 bytes} -* [[_INTEGER64|&& _INTEGER64]] '''QB64''' [[INTEGER|whole]] numerical type (8 bytes) +* [[LONG|& LONG]] [[INTEGER|whole]] numerical type (4 bytes} +* [[_INTEGER64|&& _INTEGER64]] '''QB64''' [[INTEGER|whole]] numerical type (8 bytes) * [[_BIT|` _BIT]] '''QB64''' [[INTEGER|whole]] numerical type (1 bit) (Key below tilde (~) or [[CHR$]](96)) * [[_BYTE|%% _BYTE]] '''QB64''' [[INTEGER|whole]] numerical type (1 byte) -* [[_OFFSET|%& _OFFSET]] '''QB64''' [[INTEGER|whole]] numerical pointer address type (any byte size required) +* [[_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> +

([[#toc|Return to Table of Contents]])

:'''Numerical Base Prefixes''' -* [[&B|&B Binary]] Base 2: Digits 0 or 1 ['''QB64'''] -* [[&O|&O Octal]] Base 8: Digits 0 to 7 -* [[&H|&H Hexadecimal]] Base 16: Digits 0 to F +* [[&B|&B Binary]] Base 2: Digits 0 or 1 ['''QB64'''] +* [[&O|&O Octal]] Base 8: Digits 0 to 7 +* [[&H|&H Hexadecimal]] Base 16: Digits 0 to F :'''[[Mathematical Operations]]''' @@ -1332,18 +1339,18 @@ __NOTOC__ :'''[[Relational Operations]]''' * [[Equal|=]] Equal to condition -* [[Not_Equal|<>]] Not equal condition +* [[Not_Equal|<>]] Not equal condition * [[Greater_Than|>]] Greater than condition -* [[Less_Than|<]] Less than condition +* [[Less_Than|<]] Less than condition * [[Greater_Than_Or_Equal|>=]] Greater than or equal to condition -* [[Less_Than_Or_Equal|<=]] Less 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> +

([[#toc|Return to Table of Contents]])

==References:== -<div id = "references"></div> +
-<center>'''WIKI Pages''' +
'''WIKI Pages''' [[Keyword Reference - Alphabetical#QB64 specific keywords:|Go to QB64 specific keywords]] @@ -1371,8 +1378,8 @@ __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]
-<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> -< +

([[#toc|Return to Table of Contents]])

+ diff --git a/internal/help/Keyword_Reference_-_By_usage.txt b/internal/help/Keyword_Reference_-_By_usage_1000000_100000000_-_10_00000.txt similarity index 90% rename from internal/help/Keyword_Reference_-_By_usage.txt rename to internal/help/Keyword_Reference_-_By_usage_1000000_100000000_-_10_00000.txt index 52f3c073f..beabc16a8 100644 --- a/internal/help/Keyword_Reference_-_By_usage.txt +++ b/internal/help/Keyword_Reference_-_By_usage_1000000_100000000_-_10_00000.txt @@ -1,6 +1,9 @@ -{| align="Right" - | __TOC__ - |} +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:15}} +__NOEDITSECTION__ +{|align="Right" +|__TOC__ +|} @@ -15,7 +18,7 @@ == [[Arrays]] and Data Storage == -<center>'''Arrays'''</center> +
'''Arrays'''
* [[_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.}} * [[CLEAR]] (statement) {{text|resets all variable values and array element values to 0 or null [[STRING|strings]] and closes all open files.}} @@ -34,13 +37,13 @@ : See also: [[Arrays]] -<center>'''Fixed Program DATA'''</center> +
'''Fixed Program DATA'''
* [[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.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

== [[COLOR|Colors]] and Transparency == @@ -75,8 +78,8 @@ * [[CLS]] (statement) {{text|clears the screen and can set the background color in QB64.}} * [[COLOR]] (statement) {{text|sets the current text color attribute or [[_RGB]] value to be used or background colors in some screen modes.}} -* [[INP]] (function) {{text|returns the RGB color intensity values from color port register &H3C9 for a specific attributes.}} -* [[OUT]] (statement) {{text|sets the color port access mode and sets the RGB color intensity values using &H3C9.}} +* [[INP]] (function) {{text|returns the RGB color intensity values from color port register &H3C9 for a specific attributes.}} +* [[OUT]] (statement) {{text|sets the color port access mode and sets the RGB color intensity values using &H3C9.}} * [[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]].}} * [[POINT]] (function) {{text|returns a pixel coordinate color attribute or the [[LONG]] [[_RGB]] color value of a 32 bit color.}} @@ -84,7 +87,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> +

([[#toc|Return to Table of Contents]])

==[[Console Window]]== * [[$CONSOLE]] (QB64 [[Metacommand]]) {{text|creates a console window throughout the program.}} @@ -98,7 +101,7 @@ * [[_SHELLHIDE]] (function) {{text|hides a DOS command or call to another program. Returns codes sent by [[END]] or [[SYSTEM]].}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

== Conditional Operations == @@ -112,10 +115,10 @@ {{Template:RelationalOperationsTable}} -<center>See also: [[#Logical Bitwise Operations|Logical Operations]] and [[Relational Operations]]</center> +
See also: [[#Logical Bitwise Operations|Logical Operations]] and [[Relational Operations]]
-<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

== Definitions and Variable Types == @@ -123,9 +126,9 @@ * [[_BYTE]] {%% numerical [[TYPE|type]]) {{text|values from -128 to 127 (one byte or 8 [[_BIT]]s). [[_UNSIGNED|Unsigned]] from 0 to 255.}} * [[_DEFINE]] (statement) {{text|defines a range of untyped variable names according to their first character as a datatype.}} * [[_FLOAT]] {## numerical [[TYPE|type]]) {{text|values offer the maximum floating-point decimal precision available using QB64.}} -* [[_INTEGER64]] (&& numerical [[TYPE|type]]) {{text|values -9223372036854775808 to 9223372036854775807. [[_UNSIGNED|Unsigned]] to 18446744073709551615.}} +* [[_INTEGER64]] (&& numerical [[TYPE|type]]) {{text|values -9223372036854775808 to 9223372036854775807. [[_UNSIGNED|Unsigned]] to 18446744073709551615.}} * [[_MEM]] (variable type) {{text|contains read only dot elements for the OFFSET, SIZE, TYPE and ELEMENTSIZE of a block of memory.}} -* [[_OFFSET]](%& variable type) {{text|can store any memory offset integer value when using [[DECLARE LIBRARY]] or [[_MEM]]ory only.}} +* [[_OFFSET]](%& variable type) {{text|can store any memory offset integer value when using [[DECLARE LIBRARY]] or [[_MEM]]ory only.}} * [[_UNSIGNED]] {~ numerical [[TYPE|type]]) {{text|defines an integer numerical value as being positive only in QB64.}} * [[COMMON]] (statement) {{text|shares common variable values with other Linked or [[CHAIN]]ed programs.}} * [[COMMON SHARED]] (statement) {{text|shares common variable values with all sub-procedures and other Linked or CHAINed programs.}} @@ -138,7 +141,7 @@ * [[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.}} -* [[LONG]] {& numerical [[TYPE|type]]) {{text|Integer values can be from -2147483648 to 2147483647. [[_UNSIGNED]] values to 4294967295.}} +* [[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.}} * [[SHARED]] (statement) {{text|designates variable values that can be shared with sub-procedures without using [[SUB]] parameters.}} @@ -148,9 +151,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> +
See also: [[Variable Types|QB64 Variable Types]] and [[Libraries#C.2B.2B_Variable_Types|C++ Variable Types]]
-<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

== External Disk and API calls == * [[_ACCEPTFILEDROP]] (statement) {{text|turns a program window into a valid drop destination for dragging files from Windows Explorer.}} @@ -189,7 +192,7 @@ * [[SHELL (function)|SHELL (QB64 function)]] {{text|executes a DOS command or calls another program. Returns codes sent by [[END]] or [[SYSTEM]].}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

== Error Codes == @@ -289,7 +292,7 @@ The following table describes the error codes that are reported by the '''QB64'' |- | 64 || Bad file name || File name contains illegal characters or exceeds 12 characters. || none |- -| 67 || Too many files || Over 15 files are open in Qbasic. || none +| 67 || Too many files || Over 15 files are open in QBasic. || none |- | 68 || Device unavailable. || Device does not exist, busy or not connected. || none |- @@ -312,7 +315,7 @@ 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> +
'''N/A means Not Available or Not Applicable to QB64.'''
{| border="1" cellpadding="2" @@ -324,7 +327,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> +

([[#toc|Return to Table of Contents]])

== Error Trapping == @@ -339,10 +342,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> +
See the [[ERROR Codes|Error Code Table]] reference.
-<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

== Event Trapping == @@ -367,7 +370,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> +

([[#toc|Return to Table of Contents]])

== File Input and Output == @@ -410,7 +413,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> +

([[#toc|Return to Table of Contents]])

== Fonts == @@ -433,7 +436,7 @@ 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.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

== Game Controller Input (Joystick) == * [[_AXIS]] (function) {{text|returns a [[SINGLE]] value between -1 and 1 indicating the maximum distance from device axis center 0.}} @@ -449,12 +452,12 @@ The following table describes the error codes that are reported by the '''QB64'' * [[_MOUSEMOVEMENTY]] (function) {{text|returns the relative vertical position of the mouse cursor compared to the previous position.}} * [[_WHEEL]] (function) {{text|returns -1 when a device wheel is scrolled up and 1 when scrolled down. Zero indicates no activity.}} * [[ON STRIG(n)]] (event statement) {{text|directs program flow upon a button press event of a game controller device.}} -* [[STICK]] (function) {{text|returns the directional axis coordinate values from 1 to 254 of game port (&H201) or USB controller devices.}} -* [[STRIG]] (function) {{text|returns the True or False button press status of game port (&H201) or USB controller devices.}} +* [[STICK]] (function) {{text|returns the directional axis coordinate values from 1 to 254 of game port (&H201) or USB controller devices.}} +* [[STRIG]] (function) {{text|returns the True or False button press status of game port (&H201) or USB controller devices.}} * [[STRIG(n)]] (statement) {{text|enables, suspends or disables event trapping of STRIG button return values.}} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

== Graphic Commands == @@ -465,7 +468,7 @@ The following table describes the error codes that are reported by the '''QB64'' * [[_MOUSESHOW]] (statement) {{text|a special string parameter after command in GL allows some special cursor shapes.}} * [[_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> +

([[#toc|Return to Table of Contents]])

== Graphics and Imaging: == @@ -515,9 +518,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> +
'''See also: [[Bitmaps]], [[Icons and Cursors]], [[SAVEIMAGE]], [[GIF Images]]'''
-<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

== Keyboard Input == * [[_CONTROLCHR]] (statement) {{text|[[OFF]] allows the control characters to be used as text characters. [[ON]](default) can use them as commands.}} @@ -531,7 +534,7 @@ The following table describes the error codes that are reported by the '''QB64'' * [[INKEY$]] (function) {{text|returns the [[ASCII]] [[STRING|string]] character of a keypress.}} * [[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.}} +* [[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|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.}} @@ -540,10 +543,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> +
See also: [[Keyboard scancodes]], [[ASCII|ASCII Codes]] references or [[Windows_Libraries#Hot_Keys_.28maximize.29|Hot Keys for Windows]].
-<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

== [[Libraries]] == @@ -558,13 +561,13 @@ The following table describes the error codes that are reported by the '''QB64'' * [[DECLARE LIBRARY| END DECLARE]] {{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> +
'''QB64 also supports [[$INCLUDE]] text code file Libraries. QB64 does not support QLB Libraries or OBJ files.'''
-<center>See also: [[Libraries#C++_Variable_Types|C++ Variable Types]]</center> +
See also: [[Libraries#C++_Variable_Types|C++ Variable Types]]
-<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

== Logical Bitwise Operations == @@ -579,7 +582,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> +

([[#toc|Return to Table of Contents]])

== Mathematical Functions and Operations == @@ -611,9 +614,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> +
See also: [[Mathematical Operations]] and [[#Logical Bitwise Operations:|Logical Operations:]]
-<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

== Memory Handling and Clipboard == @@ -632,10 +635,10 @@ The following table describes the error codes that are reported by the '''QB64'' * [[_MEMNEW]] (function) {{text|allocates new memory with a designated SIZE and returns a [[_MEM]] block referring to it.}} * [[_MEMPUT]] (statement) {{text|places a designated value into a designated memory [[_OFFSET]]}} * [[_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.}} +* [[_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> +
'''Functions and statements using QB64's emulated 16 bit memory'''
* [[DEF SEG]] (statement) {{text|defines the segment address in memory.}} * [[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.}} @@ -644,13 +647,13 @@ The following table describes the error codes that are reported by the '''QB64'' * [[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> +
See also: [[Screen Memory]] or [[Using _OFFSET]]
-<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

== 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> +
'''QB64 [[Metacommand]]s do NOT allow commenting or [[REM]]!'''
* [[$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.}} @@ -658,13 +661,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> +
'''QBasic [[Metacommand]]s do not require commenting or [[REM]] in QB64!'''
* '[[$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> +

([[#toc|Return to Table of Contents]])

== Mouse Input == * [[_AXIS]] (function) {{text|returns a [[SINGLE]] value between -1 and 1 indicating the maximum distances from device center 0.}} @@ -691,15 +694,14 @@ The following table describes the error codes that are reported by the '''QB64'' * [[_WHEEL]] (function) {{text|returns -1 when a device wheel is scrolled up and 1 when scrolled down. Zero indicates no activity.}} -* [[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. }} +* [[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. }} -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

== Numerical Manipulation and Conversion == -* [[&B]] [[Binary]] {{text|base number prefix used in QB64 to represent [[_BIT]]s on as 1 or off as 0.}} * [[_CV]] (function) {{text|used to convert [[_MK$]] [[ASCII]] [[STRING|string]] values to specified numerical value types.}} * [[_MK$]] (function) {{text|converts a specified numerical type into an [[ASCII]] [[STRING|string]] value that must be converted back using [[_CV]].}} * [[_PRESERVE]] ([[REDIM]] action) {{text|preserves the current contents of an [[arrays|array]], when re-dimensioning it.}} @@ -708,6 +710,7 @@ The following table describes the error codes that are reported by the '''QB64'' * [[ABS]] (function) {{text|returns the the positive value of a variable or literal numerical value.}} * [[ASC]] (function) {{text|returns the [[ASCII]] code number of a certain [[STRING]] text character or a keyboard press.}} +* [[_BIN$]] (function) {{text|converts the [[INTEGER]] part of any value to binary [[STRING]] number value.}} * [[CDBL]] (function) {{text|converts a numerical value to the closest [[DOUBLE]]-precision value.}} * [[CHR$]] (function) {{text|returns the character associated with a certain [[ASCII]] character code as a [[STRING]].}} * [[CINT]] (function) {{text|returns the closest [[INTEGER]] value of a number.}} @@ -722,10 +725,10 @@ The following table describes the error codes that are reported by the '''QB64'' * [[CVSMBF]] (function) {{text|converts a 4-byte Microsoft Binary format [[STRING|string]] value to a [[SINGLE]]-precision number.}} * [[DIM]] (statement) {{text|used to declare a variable type or dimension a [[STATIC]] array.}} * [[ERASE]] (array statement) {{text|clears a [[STATIC]] array of all values and totally removes a [[$DYNAMIC]] array.}} -* [[HEX$]] (function) {{text|converts decimal [[INTEGER]] values to hexadecimal [[STRING]] number values. Prefix values with [[&H]]}} +* [[HEX$]] (function) {{text|converts the [[INTEGER]] part of any value to hexadecimal [[STRING]] number value.}} * [[INT]] (function) {{text|rounds a numeric value down to the next whole number or [[INTEGER]] value.}} * [[LEN]] (function) {{text|returns the byte size of strings or numerical variables.}} -* [[OCT$]] {{text|converts decimal numerical values to Octal [[STRING]] number values. Prefix values with [[&O]]}} +* [[OCT$]] (function) {{text|converts the [[INTEGER]] part of any value to octal [[STRING]] number value.}} * [[RANDOMIZE]] (statement) {{text|seeds the [[RND]] random number generation sequence.}} * [[REDIM]] (statement) {{text|re-dimensions the number of elements in a [[$DYNAMIC|dynamic]](resizeable) [[arrays|array]].}} * [[RND]] (function) {{text|returns a randomly generated number from 0 to .9999999}} @@ -735,7 +738,7 @@ 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> +

([[#toc|Return to Table of Contents]])

== Port Input and Output (COM and LPT) == @@ -755,10 +758,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> +
'''See [[Port Access Libraries]] for other ways to access COM and LPT ports.'''.
-<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

== Print formatting == @@ -770,7 +773,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> +

([[#toc|Return to Table of Contents]])

== Printer Output (LPT and USB) == @@ -782,10 +785,10 @@ 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> +
'''QB64 will use the default system printer selected. [[_PRINTIMAGE]] images will be stretched to the paper size setting.'''
-<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

== Program Flow and Loops == * [[_CONTINUE]] (statement) {{text|skips the remaining lines in a control block (DO/LOOP, FOR/NEXT or WHILE/WEND)}} @@ -826,7 +829,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> +

([[#toc|Return to Table of Contents]])

== Sounds and Music == @@ -858,7 +861,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> +

([[#toc|Return to Table of Contents]])

== String Text Manipulation and Conversion == @@ -898,11 +901,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> +

([[#toc|Return to Table of Contents]])

== Sub procedures and Functions == -<center>'''Qbasic and QB64'''</center> +
'''QBasic and QB64'''
* [[CALL]] (statement) {{text|sends code execution to a [[SUB]] procedure in a program. Parameter brackets are required when used.}} * [[CALL ABSOLUTE|CALL ABSOLUTE]] (statement) {{text|used to access Interrupts on the computer or execute assembly type procedures.}} * [[CHAIN]] (statement) {{text|changes seamlessly from one program module to another.}} @@ -920,11 +923,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> +

([[#toc|Return to Table of Contents]])

== TCP/IP Networking and Email == -<center>'''All Statements and Functions Compile in QB64 Only!'''</center> +
'''All Statements and Functions Compile in QB64 Only!'''
* [[_CONNECTED]] (function) {{text|returns the connection status of a TCP/IP connection handle.}} @@ -944,10 +947,10 @@ The following table describes the error codes that are reported by the '''QB64'' * [[PUT (TCP/IP statement)]] {{text|sends unformatted(raw) data to an open connection using a user's handle.}} -<center>See also: [[Downloading Files]]</center> +
See also: [[Downloading Files]]
-<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

== Text on Screen == * [[_CONTROLCHR]] {{text|[[OFF]] allows [[ASCII]] characters 0 to 31 to be used as text characters. [[ON]](default) resets to default usage.}} @@ -981,9 +984,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> +
See also: [[#Fonts and Unicode:|Fonts and Unicode]] or [[ASCII|ASCII Code Table]]
-<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

== Time, Date and Timing == @@ -1012,11 +1015,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> +

([[#toc|Return to Table of Contents]])

== Window and Desktop == -<center>'''All Statements and Functions except [[SCREEN]] Compile in QB64 Only!'''</center> +
'''All Statements and Functions except [[SCREEN]] Compile in QB64 Only!'''
* [[_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.}} @@ -1045,15 +1048,15 @@ 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]], [[Windows_Libraries#Hot_Keys_.28maximize.29|Windows Hot Keys]] or [[Windows_Libraries#Focus|Focus on Program]].</center> +
''See also:'' [[C_Libraries#Console_Window|Console Window]], [[Windows_Libraries#Hot_Keys_.28maximize.29|Windows Hot Keys]] or [[Windows_Libraries#Focus|Focus on Program]].
-<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

== QB64 Programming Symbols == -<center>'''QB64 and QB Symbols'''</center> +
'''QB64 and QB Symbols'''
-<center>''[Note: All symbols below can also be used inside of literal quoted strings except for quotation marks.]''</center> +
''[Note: All symbols below can also be used inside of literal quoted strings except for quotation marks.]''
:'''Print, Input or File Formatting''' @@ -1064,17 +1067,17 @@ The following table describes the error codes that are reported by the '''QB64'' :'''Program Code Markers''' -* [[Apostrophe|' Apostrophe]] denotes a program comment, to ignore a code line or a Qbasic [[Metacommand]]. Same as using [[REM]]. +* [[Apostrophe|' Apostrophe]] denotes a program comment, to ignore a code line or a QBasic [[Metacommand]]. Same as using [[REM]]. * [[Comma|, Comma]] is a statement variable or [[DATA]], [[SUB]] or [[FUNCTION]] parameter separator. -* [[Colon|: Colon]]s can be used to separate two procedure statements on one code line. -* [[Dollar_Sign|$ Dollar sign]] prefix denotes a Qbasic [[Metacommand]]. Only '''QB64''''s event [[$CHECKING]] should NOT be commented. +* [[: Colon]]s can be used to separate two procedure statements on one code line. +* [[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]]. * [[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> +

([[#toc|Return to Table of Contents]])

:'''Variable Name Type Suffixes''' * [[STRING|$ STRING]] text character type: 1 byte @@ -1083,17 +1086,17 @@ The following table describes the error codes that are reported by the '''QB64'' * [[_FLOAT|## _FLOAT]] '''QB64''' decimal point numerical type (32 bytes) * [[_UNSIGNED|~ _UNSIGNED]] '''QB64''' [[INTEGER|whole]] positive numerical type when it precedes the 6 numerical suffixes below: * [[INTEGER|% INTEGER]] [[INTEGER|whole]] numerical type (2 bytes) -* [[LONG|& LONG]] [[INTEGER|whole]] numerical type (4 bytes} -* [[_INTEGER64|&& _INTEGER64]] '''QB64''' [[INTEGER|whole]] numerical type (8 bytes) +* [[LONG|& LONG]] [[INTEGER|whole]] numerical type (4 bytes} +* [[_INTEGER64|&& _INTEGER64]] '''QB64''' [[INTEGER|whole]] numerical type (8 bytes) * [[_BIT|` _BIT]] '''QB64''' [[INTEGER|whole]] numerical type (1 bit)(Key below tilde(~) or [[CHR$]](96)) * [[_BYTE|%% _BYTE]] '''QB64''' [[INTEGER|whole]] numerical type (1 byte) -* [[_OFFSET|%& _OFFSET]] '''QB64''' [[INTEGER|whole]] numerical pointer address type (any byte size required) +* [[_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> +

([[#toc|Return to Table of Contents]])

:'''Numerical Base Prefixes''' -* [[&B|&B Binary]] base 2 Digits 0 or 1 ['''QB64'''] -* [[&O|&O Octal]] base 8 Digits 0 to 7 -* [[&H|&H Hexadecimal]] base 16: Digits 0 to F +* [[&B|&B Binary]] base 2 Digits 0 or 1 ['''QB64'''] +* [[&O|&O Octal]] base 8 Digits 0 to 7 +* [[&H|&H Hexadecimal]] base 16: Digits 0 to F :'''[[Mathematical Operations]]''' @@ -1109,16 +1112,16 @@ The following table describes the error codes that are reported by the '''QB64'' :'''[[Relational Operations]]''' * [[Equal|=]] (Equal to condition) * [[Greater_Than|>]] (Greater than condition) -* [[Less_Than|<]] (Less than condition) -* [[Not_Equal|<>]] (Not equal to condition) +* [[Less_Than|<]] (Less than 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) +* [[Less_Than_Or_Equal|<=]] (Less than or equal to condition) -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

== QB64 Programming References == -<center>'''WIKI Pages''' +
'''WIKI Pages''' [[Keyword Reference - Alphabetical#QB64 specific keywords:|Go to QB64 specific keywords]] @@ -1138,5 +1141,5 @@ The following table describes the error codes that are reported by the '''QB64'' [http://qb64phoenix.com/forum/index.php Visit QB64 Community Forum] -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> -< +

([[#toc|Return to Table of Contents]])

+ diff --git a/internal/help/LBOUND.txt b/internal/help/LBOUND_111111.txt similarity index 72% rename from internal/help/LBOUND.txt rename to internal/help/LBOUND_111111.txt index 308208ecc..0c58ef742 100644 --- a/internal/help/LBOUND.txt +++ b/internal/help/LBOUND_111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:02}} The [[LBOUND]] function returns the smallest valid index (lower bound) of an array dimension. @@ -7,9 +9,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 '''1''' for the first dimension. +** If omitted, {{Parameter|dimension%}} is assumed to be '''1'''. +** If {{Parameter|dimension%}} is less than '''1''' 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. @@ -31,4 +33,4 @@ The [[LBOUND]] function returns the smallest valid index (lower bound) of an arr {{PageNavigation}} -< + diff --git a/internal/help/LCASE$.txt b/internal/help/LCASE$_11111$.txt similarity index 93% rename from internal/help/LCASE$.txt rename to internal/help/LCASE$_11111$.txt index fa3ddbdae..eff558676 100644 --- a/internal/help/LCASE$.txt +++ b/internal/help/LCASE$_11111$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:03}} The [[LCASE$]] function outputs an all-lowercase version of a [[STRING]]. @@ -27,4 +29,4 @@ The [[LCASE$]] function outputs an all-lowercase version of a [[STRING]]. {{PageNavigation}} -< + diff --git a/internal/help/LEFT$.txt b/internal/help/LEFT$_1111$.txt similarity index 95% rename from internal/help/LEFT$.txt rename to internal/help/LEFT$_1111$.txt index c139ceea1..b4dc9c5d4 100644 --- a/internal/help/LEFT$.txt +++ b/internal/help/LEFT$_1111$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:05}} The [[LEFT$]] string function returns a number of characters from the left of a [[STRING]]. @@ -18,18 +20,18 @@ 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}} '' '' +{{CodeStart}} name$ = "Tom Williams" First$ = LEFT$(name$, 3) -PRINT First$ '' '' +PRINT First$ {{CodeEnd}} {{OutputStart}}Tom {{OutputEnd}} ''Example 2:'' A replace function using LEFT$ and [[RIGHT$]] with [[INSTR]] to insert a different length word into an existing string. -{{CodeStart}} '' '' +{{CodeStart}} text$ = "This is my sentence to change my words." {{Cl|PRINT}} text$ oldword$ = "my" @@ -52,7 +54,7 @@ x = Replace(text$, oldword$, newword$) start = find {{Cl|LOOP}} {{Cl|WHILE}} find Replace = count 'function returns the number of replaced words. Comment out in SUB -{{Cl|END FUNCTION}} '' '' +{{Cl|END FUNCTION}} {{CodeEnd}} {{OutputStart}}This is my sentence to change my words. This is your sentence to change your words.{{OutputEnd}} @@ -67,4 +69,4 @@ This is your sentence to change your words.{{OutputEnd}} {{PageNavigation}} -< + diff --git a/internal/help/LEN.txt b/internal/help/LEN_111.txt similarity index 85% rename from internal/help/LEN.txt rename to internal/help/LEN_111.txt index 98beb77be..809dd8f43 100644 --- a/internal/help/LEN.txt +++ b/internal/help/LEN_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:06}} The [[LEN]] function returns the number of bytes used by a variable value and the number of characters in a [[STRING]]. @@ -17,7 +19,7 @@ The [[LEN]] function returns the number of bytes used by a variable value and th ** ''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 =''' 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 = 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]]. @@ -26,26 +28,26 @@ The [[LEN]] function returns the number of bytes used by a variable value and th ''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" '' '' +PRINT {{Cl|LEN}}(LastName$); "bytes" {{CodeEnd}} {{OutputStart}} 8 bytes {{OutputEnd}} ''Example 2:'' Testing [[INPUT]] for numerical [[STRING]] entries from a user. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|INPUT}} "number: ", num$ value$ = {{Cl|LTRIM$}}({{Cl|STR$}}({{Cl|VAL}}(num$))) L = {{Cl|LEN}}(value$) -{{Cl|PRINT}} {{Cl|LEN}}(num$), L '' '' +{{Cl|PRINT}} {{Cl|LEN}}(num$), L {{CodeEnd}} -: ''Note:'' [[&H]], [[&O]], D and E will also be accepted as numerical type data in a [[VAL]] conversion, but will add to the entry length. +: ''Note:'' [[&H]], [[&O]], D and E will also be accepted as numerical type data in a [[VAL]] conversion, but will add to the entry length. ''Example 3:'' With numerical value types you MUST use a variable to find the inherent byte length when using LEN. -{{CodeStart}} '' '' +{{CodeStart}} DIM I AS INTEGER PRINT "INTEGER ="; LEN(I); "bytes" DIM L AS LONG @@ -57,7 +59,7 @@ PRINT "SINGLE ="; LEN(S); "bytes" DIM D AS DOUBLE 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 @@ -69,7 +71,7 @@ _FLOAT = 32 bytes ''Example 4:'' Opening a RANDOM file using LEN to calculate and LEN = to designate the file record size. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|TYPE}} variabletype x {{Cl|AS}} {{Cl|INTEGER}}' '2 bytes y {{Cl|AS}} {{Cl|STRING}} * 10' '10 bytes @@ -78,8 +80,8 @@ _FLOAT = 32 bytes {{Cl|DIM}} record {{Cl|AS}} variabletype {{Cl|DIM}} newrec {{Cl|AS}} variabletype -file$ = "testrand.inf" '<<<< filename may overwrite existing file -number% = 1 '<<<<<<<<<< record number to write cannot be zero +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" record.x = 255 @@ -99,7 +101,7 @@ PRINT NumRecords%; "records" {{Cl|CLOSE}} #2 {{Cl|PRINT}} newrec.x, newrec.y, newrec.z -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} {{OutputStart}} 16 bytes 255 Hello worl 65535 @@ -118,4 +120,4 @@ PRINT NumRecords%; "records" {{PageNavigation}} -< + diff --git a/internal/help/LET.txt b/internal/help/LET_111.txt similarity index 91% rename from internal/help/LET.txt rename to internal/help/LET_111.txt index 36a4455dc..930d08793 100644 --- a/internal/help/LET.txt +++ b/internal/help/LET_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:07}} The [[LET]] is a useless statement designed by [[cavemen]] when they started programming. @@ -17,4 +19,4 @@ The [[LET]] is a useless statement designed by [[cavemen]] when they started pro {{PageNavigation}} -< + diff --git a/internal/help/LINE.txt b/internal/help/LINE_1111.txt similarity index 87% rename from internal/help/LINE.txt rename to internal/help/LINE_1111.txt index e41110531..05c530c6a 100644 --- a/internal/help/LINE.txt +++ b/internal/help/LINE_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:08}} The [[LINE]] statement is used in graphic [[SCREEN (statement)|SCREEN]] modes to create lines or boxes. @@ -31,7 +33,7 @@ The [[LINE]] statement is used in graphic [[SCREEN (statement)|SCREEN]] modes to {{Cl|LINE}} (100, 100)-(200, 200), 10 'creates a line {{Cl|LINE}} -(400, 200), 12 'creates a second line from end of first -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} :''Explanation:'' The full equivalent LINE statement would be: '''{{text|LINE(200, 200)-(400, 200), 12|green}}''' @@ -42,7 +44,7 @@ The [[LINE]] statement is used in graphic [[SCREEN (statement)|SCREEN]] modes to {{Cl|LINE}} (100, 100)-(300, 300), 10, , 63 'creates a styled line {{Cl|LINE}} (100, 100)-(300, 300), 12, B, 255 'creates styled box shape -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} :''Explanation:'' The first diagonal dashed green line bisects the red dashed square from Top Left to Bottom Right Corners. @@ -60,22 +62,22 @@ The [[LINE]] statement is used in graphic [[SCREEN (statement)|SCREEN]] modes to {{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}} '' '' +{{Cl|NEXT}} {{CodeEnd}} : ''Explanation:'' The ''style'' value's Most Significant Bit (MSB) is set to the left with LSB on right as 16 text blocks are set on or off. -''Example 4:'' Using [[&B|binary code]] to design a style pattern: +''Example 4:'' Using [[&B|binary code]] to design a style pattern: {{CodeStart}}{{Cl|SCREEN}} 12 -{{Cl|LINE}} (100, 100)-(300, 100), 10, , &B0000111100001111 '16-bits -{{Cl|LINE}} (100, 110)-(300, 110), 11, , &B0011001100110011 -{{Cl|LINE}} (100, 120)-(300, 120), 12, , &B0101010101010101 -{{Cl|LINE}} (100, 130)-(300, 130), 13, , &B1000100010001000 +{{Cl|LINE}} (100, 100)-(300, 100), 10, , &B0000111100001111 '16-bits +{{Cl|LINE}} (100, 110)-(300, 110), 11, , &B0011001100110011 +{{Cl|LINE}} (100, 120)-(300, 120), 12, , &B0101010101010101 +{{Cl|LINE}} (100, 130)-(300, 130), 13, , &B1000100010001000 {{CodeEnd}} -:''Explanation:'' The binary pattern created with 0s and 1s using the [[&B]] number prefix define the pattern to draw the colored lines. +:''Explanation:'' The binary pattern created with 0s and 1s using the [[&B]] number prefix define the pattern to draw the colored lines. {{PageSeeAlso}} @@ -86,4 +88,4 @@ The [[LINE]] statement is used in graphic [[SCREEN (statement)|SCREEN]] modes to {{PageNavigation}} -< + diff --git a/internal/help/LINE_INPUT_(file_statement).txt b/internal/help/LINE_INPUT_(file_statement)_1111_11111_(0000_000000000).txt similarity index 82% rename from internal/help/LINE_INPUT_(file_statement).txt rename to internal/help/LINE_INPUT_(file_statement)_1111_11111_(0000_000000000).txt index f8cd2ef9b..f563846fb 100644 --- a/internal/help/LINE_INPUT_(file_statement).txt +++ b/internal/help/LINE_INPUT_(file_statement)_1111_11111_(0000_000000000).txt @@ -1,17 +1,19 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:11}} The '''LINE INPUT #''' file statement reads an entire line from a text file into a string variable. {{PageSyntax}} -: '''LINE INPUT''' '''#'''{{Parameter|fileNumber&}}''',''' ''stringVariable$'' +: '''LINE INPUT''' '''#'''{{Parameter|fileNumber&}}''',''' ''stringVariable$'' {{Parameters}} -* {{Parameter|fileNumber&}} is the [[INTEGER]] number of the file previously opened with the [[OPEN]] statement. +* {{Parameter|fileNumber&}} is the [[INTEGER]] number of the file previously opened with the [[OPEN]] statement. * {{Parameter|stringVariable$}} holds the text line read from the file. {{PageDescription}} -* Reads a file using the {{Parameter|fileNumber&}} [[OPEN]]ed in the [[INPUT (file mode)]] or [[BINARY]] file mode as one file line text string. +* Reads a file using the {{Parameter|fileNumber&}} [[OPEN]]ed in the [[INPUT (file mode)]] or [[BINARY]] file mode as one file line text string. * '''NOTE:''' [[LINE INPUT (file statement)|LINE INPUT]] will work faster in [[BINARY]] mode than in [[INPUT (file mode)|INPUT]] mode. ** Using '''LINE INPUT #''' in [[BINARY]] mode is possible in '''version 1.000 and up''' * Can be used with [[EOF]] to count the number of lines of data (records) in a file using a loop. @@ -27,7 +29,7 @@ The '''LINE INPUT #''' file statement reads an entire line from a text file into {{PageExamples}} ''Example:'' Finding the number of filenames listed in a file to dimension an array to hold them. -{{CodeStart}} '' '' +{{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 @@ -39,7 +41,7 @@ The '''LINE INPUT #''' file statement reads an entire line from a text file into {{Cl|CLOSE}} #1 {{Cl|END IF}} {{Cl|REDIM}} FileArray$(filecount%) -{{Cl|PRINT}} filecount% '' '' +{{Cl|PRINT}} filecount% {{CodeEnd}} @@ -52,4 +54,4 @@ The '''LINE INPUT #''' file statement reads an entire line from a text file into {{PageNavigation}} -< + diff --git a/internal/help/LINE_INPUT.txt b/internal/help/LINE_INPUT_1111_11111.txt similarity index 92% rename from internal/help/LINE_INPUT.txt rename to internal/help/LINE_INPUT_1111_11111.txt index 4838ceea3..312cbee62 100644 --- a/internal/help/LINE_INPUT.txt +++ b/internal/help/LINE_INPUT_1111_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:10}} The [[LINE INPUT]] statement requests a [[STRING]] keyboard entry from a program user. @@ -17,14 +19,14 @@ The [[LINE INPUT]] statement requests a [[STRING]] keyboard entry from a program * Allows [[comma]]s and [[quotation mark]]s in the user input, unlike [[INPUT]] where commas denote extra input values and quotes delimit strings. * The statement halts the program until an entry is made. Pressing Enter ends the entry and code execution resumes. * LINE INPUT does not trim off leading or trailing spaces in the string entry like [[INPUT]] string returns. -* Use [[VAL]] to convert string numbers and [[&O]] (octal), [[&H]] (hexadecimal) or [[&B]] (binary) prefixed entries into numerical values. +* Use [[VAL]] to convert string numbers and [[&O]] (octal), [[&H]] (hexadecimal) or [[&B]] (binary) prefixed entries into numerical values. * Use [[_DEST]] [[_CONSOLE]] before LINE INPUT statements to receive input from a [[$CONSOLE|console]] window. * '''Note: QB64''' will not remove CHR$(0) from the end of LINE INPUT string return values like QBasic did. {{PageExamples}} ''Example:'' Preventing screen roll after an input entry on the bottom 2 screen rows. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 12 {{Cl|COLOR}} 14: {{Cl|LOCATE}} 29, 2 ' place dursor at beginning of prompt liine @@ -50,4 +52,4 @@ n$ = {{Cl|UCASE$}}(name$) ' convert search name to upper case {{PageNavigation}} -< + diff --git a/internal/help/LOCATE.txt b/internal/help/LOCATE_111111.txt similarity index 92% rename from internal/help/LOCATE.txt rename to internal/help/LOCATE_111111.txt index 07462db06..9ff8b5ffe 100644 --- a/internal/help/LOCATE.txt +++ b/internal/help/LOCATE_111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:14}} The [[LOCATE]] statement locates the screen text row and column positions for a [[PRINT]] or [[INPUT]] procedure. @@ -25,7 +27,7 @@ The [[LOCATE]] statement locates the screen text row and column positions for a {{PageExamples}} ''Example:'' Moving the cursor around (now you can finally create a Commodore 64 emulator!). '''Default SCREEN 0 only:''' -{{CodeStart}} '' '' +{{CodeStart}} crx = 10 cry = 10 DO @@ -33,12 +35,12 @@ DO 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) + "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) + "M": {{Cl|IF...THEN|IF}} crx < 80 {{Cl|THEN}} crx = crx + 1 'right {{Cl|CASE}} {{Cl|CHR$}}(27): {{Cl|END}} {{Cl|END SELECT}} -LOOP '' '' +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). @@ -53,4 +55,4 @@ LOOP '' '' {{PageNavigation}} -< + diff --git a/internal/help/LOCK.txt b/internal/help/LOCK_1111.txt similarity index 71% rename from internal/help/LOCK.txt rename to internal/help/LOCK_1111.txt index 0c0a494b7..bd4ff9c8b 100644 --- a/internal/help/LOCK.txt +++ b/internal/help/LOCK_1111.txt @@ -1,24 +1,26 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:15}} The [[LOCK]] statement restricts access to parts of a file by other programs or processes. {{PageSyntax}} :[[LOCK]] [#]{{Parameter|fileNumber%}} -:[[LOCK]] [#]{{Parameter|fileNumber%}}, {{Parameter|record&}} -:[[LOCK]] [#]{{Parameter|fileNumber%}}, [{{Parameter|firstRecord&}}] TO {{Parameter|lastRecord&}} +:[[LOCK]] [#]{{Parameter|fileNumber%}}, {{Parameter|record&}} +:[[LOCK]] [#]{{Parameter|fileNumber%}}, [{{Parameter|firstRecord&}}] TO {{Parameter|lastRecord&}} {{PageDescription}} * {{Parameter|fileNumber%}} is the file number of the file to lock. * In the first syntax, the entire file is locked. -* In the second syntax, {{Parameter|record&}} is the record number of the file to lock. -* In the third syntax, the records or bytes in the range [{{Parameter|firstRecord&}},{{Parameter|lastRecord&}}] are locked. If {{Parameter|firstRecord&}} is omitted, it is assumed to be one (the first record or byte). +* In the second syntax, {{Parameter|record&}} is the record number of the file to lock. +* In the third syntax, the records or bytes in the range [{{Parameter|firstRecord&}},{{Parameter|lastRecord&}}] are locked. If {{Parameter|firstRecord&}} is omitted, it is assumed to be one (the first record or byte). * For files opened in [[BINARY]] mode, each record corresponds to a single byte. * [[LOCK]] and [[UNLOCK]] statements are always used in pairs and each statement must match the other one. * Files must be unlocked using [[UNLOCK]] before other programs can access them, and before the file is closed. * [[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Keyword not supported in Linux or macOS versions]] -==QBasic/QuickBasic== +==QBasic/QuickBASIC== * Required DOS '''SHARED.EXE''' to be run for QBasic to use networking access modes. No longer required. @@ -29,4 +31,4 @@ The [[LOCK]] statement restricts access to parts of a file by other programs or {{PageNavigation}} -< + diff --git a/internal/help/LOC.txt b/internal/help/LOC_111.txt similarity index 94% rename from internal/help/LOC.txt rename to internal/help/LOC_111.txt index 9b4e962a8..91bbbe0f5 100644 --- a/internal/help/LOC.txt +++ b/internal/help/LOC_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:12}} The [[LOC]] function returns the status of a serial (COM) port received buffer or the current byte position in an open file. @@ -13,7 +15,7 @@ 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}} '' '' +{{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|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 @@ -23,7 +25,7 @@ The [[LOC]] function returns the status of a serial (COM) port received buffer o {{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}} # '' '' +{{Cl|CLOSE}} # {{CodeEnd}} @@ -32,4 +34,4 @@ The [[LOC]] function returns the status of a serial (COM) port received buffer o * [[SEEK]] {{PageNavigation}} -< + diff --git a/internal/help/LOF.txt b/internal/help/LOF_111.txt similarity index 89% rename from internal/help/LOF.txt rename to internal/help/LOF_111.txt index b7d36f87d..e59e35471 100644 --- a/internal/help/LOF.txt +++ b/internal/help/LOF_111.txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:16}} The [[LOF]] function is used to find the length of an [[OPEN]] file in bytes. {{PageSyntax}} -: ''totalBytes&'' = [[LOF]]([#]{{Parameter|fileNumber}}) +: ''totalBytes&'' = [[LOF]]([#]{{Parameter|fileNumber}}) {{PageDescription}} @@ -28,4 +30,4 @@ The [[LOF]] function is used to find the length of an [[OPEN]] file in bytes. {{PageNavigation}} -< + diff --git a/internal/help/LOG.txt b/internal/help/LOG_111.txt similarity index 77% rename from internal/help/LOG.txt rename to internal/help/LOG_111.txt index 4a33f6ed6..c14cb70fe 100644 --- a/internal/help/LOG.txt +++ b/internal/help/LOG_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:18}} The [[LOG]] math function returns the natural logarithm of a specified numerical value. @@ -17,20 +19,20 @@ The [[LOG]] math function returns the natural logarithm of a specified numerical {{CodeStart}} FUNCTION Log10#(value AS DOUBLE) {{Cl|STATIC}} Log10# = LOG(value) / LOG(10.#) - END FUNCTION '' '' + END FUNCTION {{CodeEnd}} :''Explanation:'' The natural logarithm of the value is divided by the base 10 logarithm. The LOG of ten is designated as a DOUBLE precision return by using # after the Log10 value. The return tells you the number of times 10 goes into a value. ''Example 2:'' A binary FUNCTION to convert [[INTEGER]] values using LOG to find the number of digits the return will be. -{{CodeStart}} '' '' -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 +{{CodeStart}} +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 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}} @@ -38,9 +40,9 @@ END FUNCTION {{PageSeeAlso}} -*[[EXP]], [[&B]] (binary number) +*[[EXP]], [[&B]] (binary number) *[[Mathematical Operations#Derived Mathematical Functions|Derived Trigonometric Functions]] {{PageNavigation}} -< + diff --git a/internal/help/LONG.txt b/internal/help/LONG_1111.txt similarity index 79% rename from internal/help/LONG.txt rename to internal/help/LONG_1111.txt index e3b4e9b50..415c65a06 100644 --- a/internal/help/LONG.txt +++ b/internal/help/LONG_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:19}} [[LONG]] defines a variable as a 4 byte number type definition for larger [[INTEGER]] values. @@ -9,8 +11,8 @@ * '''QB64''''s [[_UNSIGNED]] [[LONG]] integer values range from 0 to 4294967295. * '''QB64''' [[_UNSIGNED]] [[_INTEGER64]] values range from 0 to 18446744073709551615. * Decimal point values assigned to a [[LONG]] variable will be rounded to the nearest whole number. -* The LONG variable type suffix is & or ~& for [[_UNSIGNED]]. Suffix can also be placed after a literal or hexadecimal numerical value. -* [[_INTEGER64]] uses the '''&&''' or '''~&&''' [[_UNSIGNED]] suffix. +* The LONG variable type suffix is & or ~& for [[_UNSIGNED]]. Suffix can also be placed after a literal or hexadecimal numerical value. +* [[_INTEGER64]] uses the '''&&''' or '''~&&''' [[_UNSIGNED]] suffix. * Values can be converted to 4 byte [[ASCII]] string values using [[MKL$]] and back with [[CVL]]. * '''When a variable has not been assigned or has no type suffix, the type defaults to [[SINGLE]].''' * '''Warning: QBasic keyword names cannot be used as numerical variable names with or without the type suffix.''' @@ -27,4 +29,4 @@ {{PageNavigation}} -< + diff --git a/internal/help/LPOS.txt b/internal/help/LPOS_1111.txt similarity index 94% rename from internal/help/LPOS.txt rename to internal/help/LPOS_1111.txt index 55cdf464c..6f285a4a3 100644 --- a/internal/help/LPOS.txt +++ b/internal/help/LPOS_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:20}} The [[LPOS]] function returns the current LPT printer head position. @@ -26,7 +28,7 @@ The [[LPOS]] function returns the current LPT printer head position. {{Cl|FOR}} P = 1 TO PPT {{Cl|INPUT}} " Enter player name: ", PLAYER$ {{Cl|LPRINT}} PLAYER$; - {{Cl|IF...THEN|IF}} P < PPT {{Cl|THEN}} + {{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|LPRINT}} : {{Cl|LPRINT}} {{Cl|SPACE$}}(5); {{Cl|ELSE}} @@ -44,4 +46,4 @@ The [[LPOS]] function returns the current LPT printer head position. {{PageNavigation}} -< + diff --git a/internal/help/LPRINT.txt b/internal/help/LPRINT_111111.txt similarity index 96% rename from internal/help/LPRINT.txt rename to internal/help/LPRINT_111111.txt index 2358c5697..779b036e6 100644 --- a/internal/help/LPRINT.txt +++ b/internal/help/LPRINT_111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:22}} The [[LPRINT]] statement sends string text or numerical values to a parallel port (LPT1) printer in QBasic or a USB printer in '''QB64'''. @@ -24,4 +26,4 @@ The [[LPRINT]] statement sends string text or numerical values to a parallel por {{PageNavigation}} -< + diff --git a/internal/help/LPRINT_USING.txt b/internal/help/LPRINT_USING_111111_11111.txt similarity index 97% rename from internal/help/LPRINT_USING.txt rename to internal/help/LPRINT_USING_111111_11111.txt index e1bedf160..26d3e8036 100644 --- a/internal/help/LPRINT_USING.txt +++ b/internal/help/LPRINT_USING_111111_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:23}} The [[LPRINT USING]] statement sends formatted data to LPT1, the parallel port printer. @@ -31,4 +33,4 @@ The [[LPRINT USING]] statement sends formatted data to LPT1, the parallel port p {{PageNavigation}} -< + diff --git a/internal/help/LSET.txt b/internal/help/LSET_1111.txt similarity index 97% rename from internal/help/LSET.txt rename to internal/help/LSET_1111.txt index 67decfe6b..c3b6057da 100644 --- a/internal/help/LSET.txt +++ b/internal/help/LSET_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:24}} [[LSET]] left-justifies a fixed length string expression based on the size of the [[STRING]] variable and string expression. @@ -14,7 +16,6 @@ {{PageExamples}} ''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|FIELD}} 1, 6 {{Cl|AS}} a$, 9 {{Cl|AS}} other$ {{Cl|FIELD}} 1, 2 {{Cl|AS}} b$, 13 {{Cl|AS}} another$ @@ -60,4 +61,4 @@ you.head: ACHES {{PageNavigation}} -< + diff --git a/internal/help/LTRIM$.txt b/internal/help/LTRIM$_11111$.txt similarity index 85% rename from internal/help/LTRIM$.txt rename to internal/help/LTRIM$_11111$.txt index acb61da9b..d53ad74e3 100644 --- a/internal/help/LTRIM$.txt +++ b/internal/help/LTRIM$_11111$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:25}} The [[LTRIM$]] function removes leading space characters from a [[STRING]] value. @@ -17,16 +19,16 @@ 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}} ''Example 2:'' Trimming leading spaces from text strings. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|PRINT}} {{Cl|LTRIM$}}("some text") -{{Cl|PRINT}} {{Cl|LTRIM$}}(" some text") '' '' +{{Cl|PRINT}} {{Cl|LTRIM$}}(" some text") {{CodeEnd}} {{OutputStart}}some text some text @@ -34,14 +36,13 @@ some text ''Example 3:'' A TRIM$ function to trim spaces off of both ends of a string. -{{codeStart}} '' '' +{{codeStart}} text$ = " Text String " trimmed$ = TRIM$(text$) -{{Cl|PRINT}} {{Cl|CHR$}}(26) + trimmed$ + {{Cl|CHR$}}(27) '' '' - +{{Cl|PRINT}} {{Cl|CHR$}}(26) + trimmed$ + {{Cl|CHR$}}(27) {{Cl|FUNCTION}} TRIM$(text$) TRIM$ = {{Cl|LTRIM$}}({{Cl|RTRIM$}}(text$)) -{{Cl|END FUNCTION}} '' '' +{{Cl|END FUNCTION}} {{CodeEnd}} {{OutputStart}}β†’Text String← {{OutputEnd}} @@ -54,4 +55,4 @@ TRIM$ = {{Cl|LTRIM$}}({{Cl|RTRIM$}}(text$)) {{PageNavigation}} -< + diff --git a/internal/help/Less_Than.txt b/internal/help/Less_Than.txt deleted file mode 100644 index bea93c27e..000000000 --- a/internal/help/Less_Than.txt +++ /dev/null @@ -1,20 +0,0 @@ -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" - - -* 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. -* More than one < symbol in a numerical statement will create a [[Boolean]] evaluation of the ensuing numerical value. - - -''See also:'' - -* [[Equal|=]] -* [[Not_Equal|<>]] -* [[Greater_Than|>]] -* [[Relational Operations]] - - -{{PageNavigation}} -< diff --git a/internal/help/Less_Than_1000_1000.txt b/internal/help/Less_Than_1000_1000.txt new file mode 100644 index 000000000..861e231f3 --- /dev/null +++ b/internal/help/Less_Than_1000_1000.txt @@ -0,0 +1,22 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:25:02}} +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" + + +* 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. +* More than one < symbol in a numerical statement will create a [[Boolean]] evaluation of the ensuing numerical value. + + +''See also:'' + +* [[Equal|=]] +* [[Not_Equal|<>]] +* [[Greater_Than|>]] +* [[Relational Operations]] + + +{{PageNavigation}} + diff --git a/internal/help/Less_Than_Or_Equal.txt b/internal/help/Less_Than_Or_Equal.txt deleted file mode 100644 index 2a16da0bf..000000000 --- a/internal/help/Less_Than_Or_Equal.txt +++ /dev/null @@ -1,16 +0,0 @@ -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" - - -''See also:'' - -* [[Equal|=]] -* [[Not_Equal|<>]] -* [[Greater_Than_Or_Equal|>=]] -* [[Relational Operations]] - - -{{PageNavigation}} -< diff --git a/internal/help/Less_Than_Or_Equal_1000_1000_10_10000.txt b/internal/help/Less_Than_Or_Equal_1000_1000_10_10000.txt new file mode 100644 index 000000000..0a00a54b6 --- /dev/null +++ b/internal/help/Less_Than_Or_Equal_1000_1000_10_10000.txt @@ -0,0 +1,18 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:25:04}} +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" + + +''See also:'' + +* [[Equal|=]] +* [[Not_Equal|<>]] +* [[Greater_Than_Or_Equal|>=]] +* [[Relational Operations]] + + +{{PageNavigation}} + diff --git a/internal/help/MID$_(statement).txt b/internal/help/MID$_(statement)_111$_(000000000).txt similarity index 96% rename from internal/help/MID$_(statement).txt rename to internal/help/MID$_(statement)_111$_(000000000).txt index 616ba2fe2..b52551df4 100644 --- a/internal/help/MID$_(statement).txt +++ b/internal/help/MID$_(statement)_111$_(000000000).txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:28}} The [[MID$]] statement substitutes one or more new characters for existing characters of a previously defined [[STRING]]. @@ -28,7 +30,7 @@ The [[MID$]] statement substitutes one or more new characters for existing chara start% = position% + 1 ' advance one position to search rest of string END IF LOOP UNTIL position% = 0 ' no other matches found - PRINT text$ '' '' + PRINT text$ {{CodeEnd}} {{OutputStart}} The cats and dogs were playing, even though dogs don't like cats. @@ -44,4 +46,4 @@ The cats and rats were playing, even though rats don't like cats. {{PageNavigation}} -< + diff --git a/internal/help/MID$.txt b/internal/help/MID$_111$.txt similarity index 96% rename from internal/help/MID$.txt rename to internal/help/MID$_111$.txt index 2e09008fb..4333e2c43 100644 --- a/internal/help/MID$.txt +++ b/internal/help/MID$_111$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:27}} The [[MID$]] function returns a portion of a [[STRING|string]]. @@ -24,13 +26,13 @@ The [[MID$]] function returns a portion of a [[STRING|string]]. {{PageExamples}} ''Example 1:'' Getting the hour and minutes from [[TIME$]] -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|PRINT}} {{Cl|TIME$}} 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 @@ -38,7 +40,7 @@ hour = 11: minutes = 23 ''Example 2:'' Comparing MID$, the '''QB64''' byte position version of [[ASC]] and [[_MEMGET]] speeds parsing string characters: -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|_TITLE}} "String Speed Test" {{Cl|DEFLNG}} A-Z @@ -88,7 +90,7 @@ t5# = {{Cl|TIMER}} {{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 _MEMGET Byte"; t5# - t4# {{CodeEnd}} {{small|Code by Steve McNeill}} {{OutputStart}}6.593750 seconds for MID$ 1.044922 seconds for ASC @@ -107,4 +109,4 @@ t5# = {{Cl|TIMER}} {{PageNavigation}} -< + diff --git a/internal/help/MKD$.txt b/internal/help/MKD$_111$.txt similarity index 94% rename from internal/help/MKD$.txt rename to internal/help/MKD$_111$.txt index 38de7f457..ceaf250a4 100644 --- a/internal/help/MKD$.txt +++ b/internal/help/MKD$_111$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:42}} The [[MKD$]] function encodes a [[DOUBLE]] numerical value into an 8-byte [[ASCII]] [[STRING]] value. @@ -18,4 +20,4 @@ The [[MKD$]] function encodes a [[DOUBLE]] numerical value into an 8-byte [[ASCI * [[_MK$]], [[_CV]] {{PageNavigation}} -< + diff --git a/internal/help/MKDIR.txt b/internal/help/MKDIR_11111.txt similarity index 95% rename from internal/help/MKDIR.txt rename to internal/help/MKDIR_11111.txt index 6c76897e9..b7cb0cc3f 100644 --- a/internal/help/MKDIR.txt +++ b/internal/help/MKDIR_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:43}} The [[MKDIR]] statement creates a new folder ('''dir'''ectory) at a specified path. @@ -22,4 +24,4 @@ The [[MKDIR]] statement creates a new folder ('''dir'''ectory) at a specified pa {{PageNavigation}} -< + diff --git a/internal/help/MKDMBF$.txt b/internal/help/MKDMBF$_111111$.txt similarity index 90% rename from internal/help/MKDMBF$.txt rename to internal/help/MKDMBF$_111111$.txt index 79b7a0497..69af6e152 100644 --- a/internal/help/MKDMBF$.txt +++ b/internal/help/MKDMBF$_111111$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:44}} The [[MKDMBF$]] function encodes a double-precision IEEE number to a string value in the Microsoft Binary format. @@ -16,4 +18,4 @@ The [[MKDMBF$]] function encodes a double-precision IEEE number to a string valu {{PageNavigation}} -< + diff --git a/internal/help/MKI$.txt b/internal/help/MKI$_111$.txt similarity index 93% rename from internal/help/MKI$.txt rename to internal/help/MKI$_111$.txt index d5372b975..0a5f8abcf 100644 --- a/internal/help/MKI$.txt +++ b/internal/help/MKI$_111$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:46}} The [[MKI$]] function encodes an [[INTEGER]] numerical value into a 2-byte [[ASCII]] [[STRING]] value. @@ -15,11 +17,11 @@ The [[MKI$]] function encodes an [[INTEGER]] numerical value into a 2-byte [[ASC {{PageExamples}} ''Example:'' How MKI$ creates a two byte string integer value to save file space. -{{CodeStart}} '' '' +{{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|IF...THEN|IF}} number% < 1 {{Cl|THEN}} {{Cl|EXIT DO}} + {{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) B$ = {{Cl|CHR$}}(number% \ 256) 'second digit(0 to 127) @@ -31,7 +33,7 @@ DO {{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}} '' '' +{{Cl|END}} {{CodeEnd}} {{small|Code by Ted Weissgerber}} :''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. @@ -44,4 +46,4 @@ DO {{PageNavigation}} -< + diff --git a/internal/help/MKL$.txt b/internal/help/MKL$_111$.txt similarity index 82% rename from internal/help/MKL$.txt rename to internal/help/MKL$_111$.txt index dbf1dbf69..6a0e5353f 100644 --- a/internal/help/MKL$.txt +++ b/internal/help/MKL$_111$.txt @@ -1,12 +1,14 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:47}} The [[MKL$]] function encodes a [[LONG]] numerical value into a 4-byte [[ASCII]] [[STRING]] value. {{PageSyntax}} -: {{Parameter|result$}} = [[MKL$]]({{Parameter|longVariableOrLiteral&}}) +: {{Parameter|result$}} = [[MKL$]]({{Parameter|longVariableOrLiteral&}}) {{PageDescription}} -* {{Parameter|longVariableOrLiteral&}} is converted to four ASCII characters. To see this in action, try {{InlineCode}}PRINT MKL$(12345678){{InlineCodeEnd}}. +* {{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. @@ -27,4 +29,4 @@ See examples in: {{PageNavigation}} -< + diff --git a/internal/help/MKS$.txt b/internal/help/MKS$_111$.txt similarity index 94% rename from internal/help/MKS$.txt rename to internal/help/MKS$_111$.txt index 78af02e0d..2e54d1015 100644 --- a/internal/help/MKS$.txt +++ b/internal/help/MKS$_111$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:48}} The [[MKS$]] function encodes a [[SINGLE]] numerical value into a 4-byte [[ASCII]] [[STRING]] value. @@ -19,4 +21,4 @@ The [[MKS$]] function encodes a [[SINGLE]] numerical value into a 4-byte [[ASCII {{PageNavigation}} -< + diff --git a/internal/help/MKSMBF$.txt b/internal/help/MKSMBF$_111111$.txt similarity index 90% rename from internal/help/MKSMBF$.txt rename to internal/help/MKSMBF$_111111$.txt index 9647f342e..5b1208290 100644 --- a/internal/help/MKSMBF$.txt +++ b/internal/help/MKSMBF$_111111$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:49}} The [[MKSMBF$]] function encodes a single-precision IEEE number to a string value in the Microsoft Binary format. @@ -16,4 +18,4 @@ The [[MKSMBF$]] function encodes a single-precision IEEE number to a string valu {{PageNavigation}} -< + diff --git a/internal/help/MOD.txt b/internal/help/MOD_111.txt similarity index 76% rename from internal/help/MOD.txt rename to internal/help/MOD_111.txt index d9b29118d..1804c8da3 100644 --- a/internal/help/MOD.txt +++ b/internal/help/MOD_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:51}} The [[MOD]] operator gives the remainder after division of one number by another (sometimes called modulus). @@ -27,7 +29,7 @@ The [[MOD]] operator gives the remainder after division of one number by another PRINT "Integer division ="; I%, "Remainder ="; R% {{CodeEnd}} {{OutputStart}} - Integer division = 11 Remainder = 1 '' '' + Integer division = 11 Remainder = 1 {{OutputEnd}} ''Explanation:'' Integer division 100 \ 9 returns 11. 11 [[*]] 9 = 99. So the remainder must be 1 as 100 - 99 = 1. Normal decimal point division would return 11.11111. @@ -50,47 +52,47 @@ 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$ <> "" -NEXT '' '' +DO: SLEEP: LOOP UNTIL INKEY$ <> "" +NEXT {{CodeEnd}} ''Example 3:'' Integer division and MOD can be used to convert values to different base numbering systems from base 2 to 36 as [[STRING|strings]]: -{{CodeStart}} '' '' +{{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|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$; {{Cl|LOOP}} {{Cl|UNTIL}} K$ = {{Cl|CHR$}}(13) - 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 + 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|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}} -num& = number& 'protect value of number! +{{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}} +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 + 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}} 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}} BN$ = b$ + BN$ ' add remainder character to base number string -{{Cl|LOOP}} {{Cl|UNTIL}} num& = 0 +{{Cl|LOOP}} {{Cl|UNTIL}} num& = 0 BASEN$ = BN$ -{{Cl|END FUNCTION}} '' '' +{{Cl|END FUNCTION}} {{CodeEnd}} -: ''Note:'' Base numbering systems over base 10(0 - 9) use alphabetical letters to represent digits greater than 9 like [[&H|Hexadecimal]](0 - F). +: ''Note:'' Base numbering systems over base 10(0 - 9) use alphabetical letters to represent digits greater than 9 like [[&H|Hexadecimal]](0 - F). {{PageSeeAlso}} @@ -101,4 +103,4 @@ BASEN$ = BN$ {{PageNavigation}} -< + diff --git a/internal/help/Mathematical_Operations.txt b/internal/help/Mathematical_Operations_100000000000_1000000000.txt similarity index 75% rename from internal/help/Mathematical_Operations.txt rename to internal/help/Mathematical_Operations_100000000000_1000000000.txt index 14cfeaf77..1943a0771 100644 --- a/internal/help/Mathematical_Operations.txt +++ b/internal/help/Mathematical_Operations_100000000000_1000000000.txt @@ -1,27 +1,30 @@ -{| align="center" - | __TOC__ - |} +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:22}} +__NOEDITSECTION__ +{|align="right" +|__TOC__ +|} ==Basic and QB64 Numerical Types== -<center>'''Qbasic Number Types'''</center> +
'''QBasic Number Types'''
* [[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. +* [[LONG]] ['''&''']: 4 byte signed whole number values from -2147483648 to 2147483647. 0 to 4294967295 unsigned. * [[SINGLE]] ['''!''']: 4 byte signed floating decimal point values of up to 7 decimal place accuracy. '''Cannot be unsigned.''' * [[DOUBLE]] [#]: 8 byte signed floating decimal point values of up to 15 decimal place accuracy. '''Cannot be unsigned.''' * 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> +
'''QB64 Number Types'''
* [[_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. -* [[_INTEGER64]] ['''&&''']: 8 byte signed whole number values from -9223372036854775808 to 9223372036854775807 +* [[_INTEGER64]] ['''&&''']: 8 byte signed whole number values from -9223372036854775808 to 9223372036854775807 * [[_FLOAT]] [##]: currently set as 10 byte signed floating decimal point values up to 1.1897E+4932. '''Cannot be unsigned.''' -* [[_OFFSET]] [%&]: undefined flexable length integer offset values used in [[DECLARE DYNAMIC LIBRARY]] declarations. +* [[_OFFSET]] [%&]: undefined flexable length integer offset values used in [[DECLARE DYNAMIC LIBRARY]] declarations. -<center>'''Signed and Unsigned Integer Values'''</center> +
'''Signed and Unsigned Integer Values'''
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,7 +36,7 @@ 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> +
[[#toc|Return to Top]]
==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: @@ -71,7 +74,7 @@ BASIC can also use two other operators for '''[[INTEGER]] division'''. Integer d |} -<center>'''''It is an [[ERROR|error]] to divide by zero or to take the remainder modulo zero.'''''</center> +
'''''It is an [[ERROR|error]] to divide by zero or to take the remainder modulo zero.'''''
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. @@ -94,7 +97,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> +
[[#toc|Return to Top]]
==Basic's Order of Operations== @@ -107,7 +110,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> +
'''Using Parenthesis to Define the Operation Order'''
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,11 +126,11 @@ 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 ex, '''(n <= 88.02969)''': e = EXP(1) ' (e = 2.718281828459045) |- | [[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) |- @@ -136,13 +139,13 @@ Sometimes a calculation may need BASIC to do them in another order or the calcul | [[TAN]](angle*) || returns the tangent of an angle in radians |} -<center> '''* angles measured in radians'''</center> +
'''* angles measured in radians'''
{{TextStart}} '''Degree to Radian Conversion:''' FUNCTION Radian (degrees) Radian = degrees * (4 * {{Cb|ATN}}(1)) / 180 -END FUNCTION '' '' +END FUNCTION FUNCTION Degree (radians) Degree = radians * 180 / (4 * {{Cb|ATN}}(1)) @@ -150,23 +153,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 -END FUNCTION '' '' +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 -END FUNCTION '' '' +END FUNCTION {{TextEnd}} -<center>'''The numerical value of n in the [[LOG]](n) evaluation must be a positive value.'''</center> +
'''The numerical value of n in the [[LOG]](n) evaluation must be a positive value.'''
-<center>'''The numerical value of n in the [[EXP]](n) evaluation must be less than or equal to 88.02969.'''</center> +
'''The numerical value of n in the [[EXP]](n) evaluation must be less than or equal to 88.02969.'''
-<center>'''The numerical value of n in the [[SQR]](n) evaluation ''cannot'' be a negative value.'''</center> +
'''The numerical value of n in the [[SQR]](n) evaluation ''cannot'' be a negative value.'''
-<center>[[#toc|Return to Top]]</center> +
[[#toc|Return to Top]]
==Derived Mathematical Functions== @@ -174,101 +177,101 @@ END FUNCTION '' '' The following Trigonometric functions can be derived from the '''BASIC Mathematical Functions''' listed above. Each function checks that certain values can be used without error or a [[BEEP]] will notify the user that a value could not be returned. An error handling routine can be substituted if desired. '''Note:''' Functions requiring '''Ο€''' use 4 * [[ATN]](1) for [[SINGLE]] accuracy. Use [[ATN]](1.#) for [[DOUBLE]] accuracy. -{{TextStart}}'' '' +{{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 -IF x < 1 THEN ARCSIN = {{Cb|ATN}}(x / {{Cb|SQR}}(1 - (x * x))) ELSE BEEP +IF x < 1 THEN ARCSIN = {{Cb|ATN}}(x / {{Cb|SQR}}(1 - (x * x))) ELSE BEEP END FUNCTION FUNCTION ARCCOS (x) ' Inverse Cosine -IF x < 1 THEN ARCCOS = (2 * ATN(1)) - {{Cb|ATN}}(x / {{Cb|SQR}}(1 - x * x)) ELSE BEEP +IF x < 1 THEN ARCCOS = (2 * ATN(1)) - {{Cb|ATN}}(x / {{Cb|SQR}}(1 - x * x)) ELSE BEEP END FUNCTION FUNCTION ARCSEC (x) ' Inverse Secant -IF x < 1 THEN ARCSEC = {{Cb|ATN}}(x / {{Cb|SQR}}(1 - x * x)) + ({{Cb|SGN}}(x) - 1) * (2 * ATN(1)) ELSE BEEP +IF x < 1 THEN ARCSEC = {{Cb|ATN}}(x / {{Cb|SQR}}(1 - x * x)) + ({{Cb|SGN}}(x) - 1) * (2 * ATN(1)) ELSE BEEP END FUNCTION FUNCTION ARCCSC (x) ' Inverse CoSecant -IF x < 1 THEN ARCCSC = ATN(1 / SQR(1 - x * x)) + (SGN(x)-1) * (2 * ATN(1)) ELSE BEEP +IF x < 1 THEN ARCCSC = ATN(1 / SQR(1 - x * x)) + (SGN(x)-1) * (2 * ATN(1)) ELSE BEEP END FUNCTION FUNCTION ARCCOT (x) ' Inverse CoTangent ARCCOT = (2 * {{Cb|ATN}}(1)) - {{Cb|ATN}}(x) -END FUNCTION '' '' +END FUNCTION FUNCTION SINH (x) ' Hyperbolic Sine -IF x <= 88.02969 THEN SINH = ({{Cb|EXP}}(x) - {{Cb|EXP}}(-x)) / 2 ELSE BEEP -END FUNCTION '' '' +IF x <= 88.02969 THEN SINH = ({{Cb|EXP}}(x) - {{Cb|EXP}}(-x)) / 2 ELSE BEEP +END FUNCTION FUNCTION COSH (x) ' Hyperbolic CoSine -IF x <= 88.02969 THEN COSH = (EXP(x) + EXP(-x)) / 2 ELSE BEEP -END FUNCTION '' '' +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 '' '' +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 -END FUNCTION '' '' +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 -END FUNCTION '' '' +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 '' '' +END FUNCTION FUNCTION ARCSINH (x) ' Inverse Hyperbolic Sine 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 '' '' +END FUNCTION FUNCTION ARCCOSH (x) ' Inverse Hyperbolic CoSine 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 -END FUNCTION '' '' +END FUNCTION FUNCTION ARCTANH (x) ' Inverse Hyperbolic Tangent -IF x < 1 THEN ARCTANH = {{Cb|LOG}}((1 + x) / (1 - x)) / 2 ELSE BEEP +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 -END FUNCTION '' '' +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 '' '' +END FUNCTION FUNCTION ARCCOTH (x) ' Inverse Hyperbolic CoTangent IF x > 1 THEN ARCCOTH = {{Cb|LOG}}((x + 1) / (x - 1)) / 2 ELSE BEEP -END FUNCTION '' '' +END FUNCTION {{TextEnd}} {{WhiteStart}} '''Hyperbolic Function Relationships:''' @@ -293,25 +296,25 @@ END FUNCTION '' '' {{WhiteEnd}} -<center>[http://support.microsoft.com/kb/28249 Microsoft's Derived BASIC Functions (KB 28249)]</center> +
[http://support.microsoft.com/kb/28249 Microsoft's Derived BASIC Functions (KB 28249)]
-<center>[[#toc|Return to Top]]</center> +
[[#toc|Return to Top]]
==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> +
'''Truth table of the 6 BASIC Logical Operators'''
{{Template:LogicalTruthTable}} -<center>BASIC can accept any + or - value that is not 0 to be True when used in an evaluation.</center> +
BASIC can accept any + or - value that is not 0 to be True when used in an evaluation.
-<center>[[#toc|Return to Top]]</center> +
[[#toc|Return to Top]]
==Relational Operators== Relational Operations are used to compare values in a Conditional [[IF...THEN]], [[SELECT CASE]], [[UNTIL]] or [[WHILE]] statement. @@ -320,7 +323,7 @@ Relational Operations are used to compare values in a Conditional [[IF...THEN]], {{Template:RelationalTable}} -<center>[[#toc|Return to Top]]</center> +
[[#toc|Return to Top]]
==Basic's Rounding Functions== @@ -349,7 +352,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> +
[[#toc|Return to Top]]
==Base Number Systems== @@ -359,7 +362,7 @@ Relational Operations are used to compare values in a Conditional [[IF...THEN]], '''Decimal (base 10) Binary (base 2) Hexadecimal (base 16) Octal (base 8)''' - ''' [[&B]] [[&H]] [[HEX$]](n) [[&O]] [[OCT$]](n)''' + ''' [[&B]] [[&H]] [[HEX$]](n) [[&O]] [[OCT$]](n)''' 0 0000 0 0 1 0001 1 1 @@ -376,7 +379,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! @@ -385,40 +388,40 @@ Relational Operations are used to compare values in a Conditional [[IF...THEN]], value to Binary just add the 4 binary digits for each HEX digit place so: F A C E - &HFACE = 1111 + 1010 + 1100 + 1101 = &B1111101011001101 + &HFACE = 1111 + 1010 + 1100 + 1101 = &B1111101011001101 To convert a Binary value to HEX you just need to divide the number into sections of four digits starting from the right(LSB) end. If one has less than 4 digits on the left end you could add the leading zeros like below: - &B101011100010001001 = 0010 1011 1000 1000 1001 - hexadecimal = 2 + B + 8 + 8 + 9 = &H2B889 + &B101011100010001001 = 0010 1011 1000 1000 1001 + hexadecimal = 2 + B + 8 + 8 + 9 = &H2B889 - See the Decimal to Binary conversion function that uses '''[[HEX$]]''' on the '''[[&H]]''' page. + See the Decimal to Binary conversion function that uses '''[[HEX$]]''' on the '''[[&H]]''' page. {{TextEnd}} -<center>'''[[VAL]] converts [[STRING|string]] numbers to Decimal values.'''</center> +
'''[[VAL]] converts [[STRING|string]] numbers to Decimal values.'''
* 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]]. +* 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> +
'''The [[OCT$]] [[STRING|string]] function return can be converted to a decimal value using [[VAL]]("&O" + OCT$(n)).'''
-<center>'''The [[HEX$]] [[STRING|string]] function return can be converted to a decimal value using [[VAL]]("&H" + HEX$(n)).'''</center> +
'''The [[HEX$]] [[STRING|string]] function return can be converted to a decimal value using [[VAL]]("&H" + HEX$(n)).'''
:[[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> +
[[#toc|Return to Top]]
==Bits and Bytes== -<center>'''[[_BIT|BITS]]'''</center> +
'''[[_BIT|BITS]]'''
* 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. @@ -429,9 +432,9 @@ Relational Operations are used to compare values in a Conditional [[IF...THEN]], '''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 27 down to 20 while the little-endian method does the opposite. -<center>'''[[_BYTE|BYTES]]'''</center> +
'''[[_BYTE|BYTES]]'''
* [[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)''' @@ -444,8 +447,8 @@ Relational Operations are used to compare values in a Conditional [[IF...THEN]], ::The HI byte's '''MSB''' is often called the '''sign''' bit! When the highest bit is on, the signed value returned will be negative. -''Example:'' Program displays the bits on for any integer value between -32768 and 32767 or &H80000 and &H7FFF. -{{CodeStart}} '' '' +''Example:'' Program displays the bits on for any integer value between -32768 and 32767 or &H80000 and &H7FFF. +{{CodeStart}} {{Cl|DEFINT}} A-Z {{Cl|SCREEN (statement)|SCREEN}} 12 {{Cl|COLOR}} 11: {{Cl|LOCATE}} 10, 2 @@ -453,7 +456,7 @@ Relational Operations are used to compare values in a Conditional [[IF...THEN]], {{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|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|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 16 @@ -475,7 +478,7 @@ Relational Operations are used to compare values in a Conditional [[IF...THEN]], {{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) @@ -484,26 +487,26 @@ Relational Operations are used to compare values in a Conditional [[IF...THEN]], {{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 + 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}} '' '' +{{Cl|SYSTEM}} {{CodeEnd}} {{small|Code by Ted Weissgerber}} -<center>[[#toc|Return to Top]]</center> +
[[#toc|Return to Top]]
==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> +
'''Warning: [[_OFFSET]] values cannot be reassigned to other variable [[TYPE|types]].'''
-<center>'''[[_OFFSET]] values can only be used in conjunction with [[_MEM]]ory and [[DECLARE DYNAMIC LIBRARY]] procedures.'''</center> +
'''[[_OFFSET]] values can only be used in conjunction with [[_MEM]]ory and [[DECLARE DYNAMIC LIBRARY]] procedures.'''
==References== ''See also:'' @@ -512,4 +515,4 @@ Relational Operations are used to compare values in a Conditional [[IF...THEN]], * [[TYPE]] {{PageNavigation}} -< + diff --git a/internal/help/NAME.txt b/internal/help/NAME_1111.txt similarity index 95% rename from internal/help/NAME.txt rename to internal/help/NAME_1111.txt index 09fd12b25..515337bd1 100644 --- a/internal/help/NAME.txt +++ b/internal/help/NAME_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:52}} The [[NAME]] statement changes the name of a file or directory to a new name. @@ -28,4 +30,4 @@ The [[NAME]] statement changes the name of a file or directory to a new name. {{PageNavigation}} -< + diff --git a/internal/help/NEXT.txt b/internal/help/NEXT_1111.txt similarity index 92% rename from internal/help/NEXT.txt rename to internal/help/NEXT_1111.txt index e8a8bbf99..2fdc3ad96 100644 --- a/internal/help/NEXT.txt +++ b/internal/help/NEXT_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:53}} [[NEXT]] is used in a [[FOR...NEXT|FOR]] counter loop to progress through the loop count. @@ -19,12 +21,12 @@ {{PageExamples}} ''Example:'' Finding the FOR variable value AFTER a simple counter loop to 10. -{{CodeStart}} '' '' +{{CodeStart}} 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 @@ -39,4 +41,4 @@ PRINT "AFTER the LOOP, NEXT makes the value of i ="; i '' '' {{PageNavigation}} -< + diff --git a/internal/help/NOT.txt b/internal/help/NOT_111.txt similarity index 88% rename from internal/help/NOT.txt rename to internal/help/NOT_111.txt index 68d076776..b13afa966 100644 --- a/internal/help/NOT.txt +++ b/internal/help/NOT_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:55}} [[NOT]] is a [[Boolean|boolean]] logical operator that will change a false statement to a true one and vice-versa. @@ -33,7 +35,7 @@ k$ = {{Cl|INKEY$}} ''Example 2:'' Reading a file until it reaches the End Of File. {{CodeStart}}DO WHILE NOT EOF(1) INPUT #1, data1, data2, data3 -LOOP '' '' +LOOP {{CodeEnd}} :''Explanation:'' [[EOF]] will return 0 until a file ends. NOT converts 0 to -1 so that the loop continues to run. When EOF becomes -1, NOT converts it to 0 to end the loop. @@ -49,7 +51,7 @@ ReadBits -6 {{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}} '' '' +{{Cl|END SUB}} {{CodeEnd}} {{OutputStart}}-6 @@ -58,26 +60,26 @@ ReadBits -6 {{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. -: QB64 can use [[&B]] to convert the above [[_BIT]] values back to [[INTEGER]] or [[_BYTE]] values as shown below: +: 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 -a% = {{Cl|&B}}0000000000000101 +a% = {{Cl|&B}}0000000000000101 {{Cl|PRINT}} a% -b% = {{Cl|&B}}1111111111111010 +b% = {{Cl|&B}}1111111111111010 {{Cl|PRINT}} b% '8 bit BYTE values from -128 to 127 -a%% = {{Cl|&B}}00000101 +a%% = {{Cl|&B}}00000101 {{Cl|PRINT}} a%% -b%% = {{Cl|&B}}11111010 +b%% = {{Cl|&B}}11111010 {{Cl|PRINT}} b%% {{CodeEnd}} {{PageSeeAlso}} -* [[_BIT]], [[&B]], [[_BYTE]] +* [[_BIT]], [[&B]], [[_BYTE]] * [[AND]], [[XOR]], [[OR]] * [[Binary]], [[Boolean]] * [[Mathematical Operations]] {{PageNavigation}} -< + diff --git a/internal/help/Not_Equal.txt b/internal/help/Not_Equal.txt deleted file mode 100644 index 42dcb6e7b..000000000 --- a/internal/help/Not_Equal.txt +++ /dev/null @@ -1,20 +0,0 @@ -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" - - -* 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. - - -''See also:'' - -* [[Equal|=]] -* [[Greater_Than|>]] -* [[Less_Than|<]] -* [[Relational Operations]] - - -{{PageNavigation}} -< diff --git a/internal/help/Not_Equal_100_10000.txt b/internal/help/Not_Equal_100_10000.txt new file mode 100644 index 000000000..beaeef3ff --- /dev/null +++ b/internal/help/Not_Equal_100_10000.txt @@ -0,0 +1,22 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:24:59}} +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" + + +* 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. + + +''See also:'' + +* [[Equal|=]] +* [[Greater_Than|>]] +* [[Less_Than|<]] +* [[Relational Operations]] + + +{{PageNavigation}} + diff --git a/internal/help/OCT$.txt b/internal/help/OCT$.txt deleted file mode 100644 index 4fb798c76..000000000 --- a/internal/help/OCT$.txt +++ /dev/null @@ -1,58 +0,0 @@ -The [[OCT$]] function returns the base-8 octal representation of an [[INTEGER]], [[LONG]] or [[_INTEGER64]] value as a [[STRING]]. - - -{{PageSyntax}} -: {{Parameter|result$}} = [[OCT$]]({{Parameter|number}}) - - -{{PageDescription}} -* 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. - - -{{PageExamples}} -''Example:'' Outputs all of the decimal, hexadecimal and octal digits: -{{CodeStart}} -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. - -{{OutputStart}} - Decimal | Hexadecimal | Octal - ---------+-------------+------- - 0 | 0 | 0 - 1 | 1 | 1 - 2 | 2 | 2 - 3 | 3 | 3 - 4 | 4 | 4 - 5 | 5 | 5 - 6 | 6 | 6 - 7 | 7 | 7 - 8 | 8 | 10 - 9 | 9 | 11 - 10 | A | 12 - 11 | B | 13 - 12 | C | 14 - 13 | D | 15 - 14 | E | 16 - 15 | F | 17 -{{OutputEnd}} - - -{{PageSeeAlso}} -* [[HEX$]], [[VAL]] -* [[&H]] {{text|(hexadecimal)}}, [[&O]] {{text|(octal)}}, [[&B]] {{text|(binary)}} -* [[Base Comparisons]] - - -{{PageNavigation}} -< diff --git a/internal/help/OCT$_111$.txt b/internal/help/OCT$_111$.txt new file mode 100644 index 000000000..11f9936bf --- /dev/null +++ b/internal/help/OCT$_111$.txt @@ -0,0 +1,77 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:56}} +This function returns the octal (base 8) representation of any numeric value. + + +{{PageSyntax}} +: {{Parameter|octvalue$}} = [[OCT$]]({{Parameter|number}}) + + +{{PageParameters}} +* {{Parameter|number}} can be any [[INTEGER]], [[LONG]] or [[_INTEGER64]] value, positive or negative. +* {{Parameter|number}} can also be any [[SINGLE]], [[DOUBLE]] or [[_FLOAT]] value, but only the integer part of the value is converted in that case. That is, from the value ''-123.45'' the function would convert the ''-123'' only. + + +{{PageDescription}} +* The function returns the base 8 (octal) representation of the given {{Parameter|number}} as [[STRING]]. +* Different from [[STR$]], this function does not return a leading sign placeholder space, so no [[LTRIM$]] to strip that space from positive numbers is necessary. +* [[VAL]] can convert the returned oct string value back to a decimal value by prefixing the string with "[[&O]]". +** Eg. {{InlineCode}}decimal = VAL("&O" + octvalue$){{InlineCodeEnd}}. + + +{{PageExamples}} +;Example 1: Comparing decimal, hexadecimal, octal and binary string values from 0 to 15. +{{CodeStart}} +tabletop$ = " Decimal | Hexadecimal | Octal | Binary " +tablesep$ = "---------+-------------+-------+--------" +tableout$ = " \ \ | \\ | \\ | \ \ " 'the PRINT USING template + +{{Cl|LOCATE}} 2, 10: {{Cl|PRINT}} tabletop$ +{{Cl|LOCATE}} 3, 10: {{Cl|PRINT}} tablesep$ +{{Cl|FOR...NEXT|FOR}} n% = 0 {{Cl|TO}} 15 + {{Cl|LOCATE}} 4 + n%, 10: {{Cl|PRINT USING}} tableout$; {{Cl|STR$}}(n%); {{Cl|HEX$}}(n%); {{Cl|OCT$}}(n%); {{Cl|_BIN$}}(n%) +{{Cl|NEXT}} n% +{{CodeEnd}} +;Note:Although the decimal numbers 0-15 have a maximum width of 2 digits only, an extra space in the ''tableout$'' template is needed when using the (fixed width string) slash output format, as [[STR$]] values contain a leading sign placeholder space. +{{OutputStart}} + Decimal | Hexadecimal | Octal | Binary + ---------+-------------+-------+-------- + 0 | 0 | 0 | 0 + 1 | 1 | 1 | 1 + 2 | 2 | 2 | 10 + 3 | 3 | 3 | 11 + 4 | 4 | 4 | 100 + 5 | 5 | 5 | 101 + 6 | 6 | 6 | 110 + 7 | 7 | 7 | 111 + 8 | 8 | 10 | 1000 + 9 | 9 | 11 | 1001 + 10 | A | 12 | 1010 + 11 | B | 13 | 1011 + 12 | C | 14 | 1100 + 13 | D | 15 | 1101 + 14 | E | 16 | 1110 + 15 | F | 17 | 1111 +{{OutputEnd}} + + +;Example 2:Converting a octal value to decimal. +{{CodeStart}} +octvalue$ = {{Cl|OCT$}}(255) +{{Cl|PRINT}} "Oct: "; octvalue$ +{{Cl|PRINT}} "Converting Oct value to Decimal:"; {{Cl|VAL}}("&O" + octvalue$) +{{CodeEnd}} +{{OutputStart}} +Oct: 377 +Converting Oct value to Decimal: 255 +{{OutputEnd}} + + +{{PageSeeAlso}} +* [[_BIN$]], [[HEX$]], [[STR$]], [[VAL]] +* [[&B]] {{text|(binary)}}, [[&H]] {{text|(hexadecimal)}}, [[&O]] {{text|(octal)}} +* [[Base Comparisons]] + + +{{PageNavigation}} + diff --git a/internal/help/OFF.txt b/internal/help/OFF_111.txt similarity index 94% rename from internal/help/OFF.txt rename to internal/help/OFF_111.txt index 2f01a116e..f558ffa16 100644 --- a/internal/help/OFF.txt +++ b/internal/help/OFF_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:14:57}} [[OFF]] is a flag that disables event-trappping for [[KEY(n)]], [[ON COM (n)|COM(n)]], [[PEN]], [[PLAY]], [[STRIG(n)]], [[TIMER]], [[UEVENT]]. @@ -12,4 +14,4 @@ {{PageNavigation}} -< + diff --git a/internal/help/ON...GOSUB.txt b/internal/help/ON...GOSUB_11...11111.txt similarity index 96% rename from internal/help/ON...GOSUB.txt rename to internal/help/ON...GOSUB_11...11111.txt index d75c1aebb..2073b58f6 100644 --- a/internal/help/ON...GOSUB.txt +++ b/internal/help/ON...GOSUB_11...11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:09}} [[ON...GOSUB]] is a control-flow statement that branches to a line or label in a list depending on a numerical expression. @@ -18,7 +20,7 @@ {{PageExamples}} ''Example:'' -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|CLS}} a = 2 ''ON'' a '''GOSUB''' hello, hereweare, 143 @@ -35,7 +37,7 @@ hereweare: 143 {{Cl|PRINT}} "Line 143, with a = 3 you get to see this!" -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} {{OutputStart}} with a = 2 here we are...return to line after ON. @@ -52,4 +54,4 @@ Also notice the RETURN statement that can be used with GOSUB! {{PageNavigation}} -< + diff --git a/internal/help/ON...GOTO.txt b/internal/help/ON...GOTO_11...1111.txt similarity index 95% rename from internal/help/ON...GOTO.txt rename to internal/help/ON...GOTO_11...1111.txt index e4750e8c5..75e4db8f1 100644 --- a/internal/help/ON...GOTO.txt +++ b/internal/help/ON...GOTO_11...1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:10}} [[ON...GOTO]] is a control-flow statement that branches to a line or label in a list depending on a numerical expression. @@ -17,7 +19,7 @@ {{PageExamples}} ''Example:'' Changing the program flow when a value is not 0. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|CLS}} a = 2 {{Cl|ON...GOTO|ON a GOTO}} hello, hereweare, 143 @@ -30,7 +32,7 @@ PRINT "And here we are..." END 143 PRINT "you don't get to see this neither..." -END '' '' +END {{CodeEnd}} {{OutputStart}} And here we are... @@ -47,4 +49,4 @@ And here we are... {{PageNavigation}} -< + diff --git a/internal/help/ON_COM(n).txt b/internal/help/ON_COM(n).txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/ON_COM(n).txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/ON_ERROR.txt b/internal/help/ON_ERROR_11_11111.txt similarity index 96% rename from internal/help/ON_ERROR.txt rename to internal/help/ON_ERROR_11_11111.txt index 1d39c8f44..81bc47d86 100644 --- a/internal/help/ON_ERROR.txt +++ b/internal/help/ON_ERROR_11_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:00}} [[ON ERROR]] is used with [[GOTO]] to handle errors in a program. @@ -20,7 +22,7 @@ {{PageExamples}} ''Example 1:'' Using an error handler that ignores any error. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|ON ERROR}} {{Cl|GOTO}} Errhandler ' Main module program error simulation code {{Cl|ERROR}} 7 ' simulate an Out of Memory Error @@ -31,7 +33,7 @@ Errhandler: 'error handler sub program line label PRINT "Error"; {{Cl|ERR}}; "on program file line"; {{Cl|_ERRORLINE}} {{Cl|BEEP}} ' warning beep - {{Cl|RESUME}} NEXT ' moves program to code following the error. '' '' + {{Cl|RESUME}} NEXT ' moves program to code following the error. {{CodeEnd}} {{OutputStart}} Error 7 on program file line 3 @@ -41,7 +43,7 @@ Error handled...ending program ''Example 2:'' Using an error handler in a [[SUB]] procedure. -{{CodeStart}} '' '' +{{CodeStart}} s {{Cl|END}} @@ -54,7 +56,7 @@ hand: {{Cl|ERROR}} 1 {{Cl|ON ERROR}} {{Cl|GOTO}} 0 {{Cl|PRINT}} "Done!" -{{Cl|END SUB}} '' '' +{{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. @@ -68,4 +70,4 @@ hand: {{PageNavigation}} -< + diff --git a/internal/help/ON_KEY(n).txt b/internal/help/ON_KEY(n)_11_111(0).txt similarity index 95% rename from internal/help/ON_KEY(n).txt rename to internal/help/ON_KEY(n)_11_111(0).txt index c054606a3..188b29da9 100644 --- a/internal/help/ON_KEY(n).txt +++ b/internal/help/ON_KEY(n)_11_111(0).txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:01}} 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. @@ -19,7 +21,7 @@ The [[ON KEY(n)]] statement defines a line number or label to go to (or a [[SUB] {{PageExamples}} ''Example 1:'' Using ON KEY with [[GOSUB]] to execute code. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|KEY(n)|KEY(1) ON}} {{Cl|ON KEY(n)|ON KEY}}(1) {{Cl|GOSUB}} trap {{Cl|PRINT}} "Press F1 to quit!" @@ -28,12 +30,12 @@ The [[ON KEY(n)]] statement defines a line number or label to go to (or a [[SUB] trap: {{Cl|PRINT}} "You pressed F1 like I told you to :)" {{Cl|END}} -{{Cl|RETURN}} '' '' +{{Cl|RETURN}} {{CodeEnd}} ''Example 2:'' Setting multiple ON KEY statements to send different values to a [[SUB]] procedure. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|FOR...NEXT|FOR}} n = 1 {{Cl|TO}} 10 {{Cl|KEY n|KEY}} n, {{Cl|STR$}}(n) ' assigns soft key as a numerical string @@ -49,7 +51,7 @@ trap: {{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|END SUB}} '' '' +{{Cl|END SUB}} {{CodeEnd}} @@ -60,4 +62,4 @@ trap: {{PageNavigation}} -< + diff --git a/internal/help/ON_PEN.txt b/internal/help/ON_PEN.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/ON_PEN.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/ON_PLAY(n).txt b/internal/help/ON_PLAY(n).txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/ON_PLAY(n).txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/ON_STRIG(n).txt b/internal/help/ON_STRIG(n)_11_11111(0).txt similarity index 92% rename from internal/help/ON_STRIG(n).txt rename to internal/help/ON_STRIG(n)_11_11111(0).txt index ea356bcf1..0811c3edc 100644 --- a/internal/help/ON_STRIG(n).txt +++ b/internal/help/ON_STRIG(n)_11_11111(0).txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:05}} The [[ON STRIG(n)]] statement is an event procedure that directs program flow upon the press of a specified joystick button. @@ -18,14 +20,14 @@ The [[ON STRIG(n)]] statement is an event procedure that directs program flow up {{PageExamples}} ''Example 1:'' Reading a STRIG event to do something in a [[GOSUB]] procedure. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|ON STRIG(n)|ON STRIG}}(0) {{Cl|GOSUB}} 10 {{Cl|STRIG(n)|STRIG}}(0)ON {{Cl|DO...LOOP|DO}} {{Cl|PRINT}} "."; {{Cl|_LIMIT}} 30 -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" {{Cl|END}} 10 @@ -34,7 +36,7 @@ a$ = "[STRIG 0 EVENT]" {{Cl|PRINT}} {{Cl|MID$}}(a$, x, 1); {{Cl|_DELAY}} 0.02 {{Cl|NEXT}} -{{Cl|RETURN}} '' '' +{{Cl|RETURN}} {{CodeEnd}} @@ -50,12 +52,12 @@ a$ = "[STRIG 0 EVENT]" {{Cl|DO...LOOP|DO}} {{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|END SUB}} '' '' +{{Cl|END SUB}} {{CodeEnd}} :''Explanation:'' Up to 256 controllers can be used in QB64 with many buttons to read. @@ -71,4 +73,4 @@ a$ = "[STRIG 0 EVENT]" {{PageNavigation}} -< + diff --git a/internal/help/ON_TIMER(n).txt b/internal/help/ON_TIMER(n)_11_11111(0).txt similarity index 98% rename from internal/help/ON_TIMER(n).txt rename to internal/help/ON_TIMER(n)_11_11111(0).txt index aca20a51b..fb2a58822 100644 --- a/internal/help/ON_TIMER(n).txt +++ b/internal/help/ON_TIMER(n)_11_11111(0).txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:06}} The [[ON_TIMER(n)|ON TIMER]] statement sets up a timed event to be repeated at specified intervals throughout a program when enabled. @@ -38,7 +40,7 @@ The [[ON_TIMER(n)|ON TIMER]] statement sets up a timed event to be repeated at s {{PageExamples}} ''Example:'' Using a numbered TIMER to check the mouse button press status in '''QB64'''. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DIM}} {{Cl|SHARED}} Button {{Cl|AS}} {{Cl|LONG}} 'share variable value with Sub t1 = _{{Cl|TIMER (statement)|FREE}}{{Cl|TIMER}} 'get a timer number from _FREETIMER ONLY! @@ -66,7 +68,7 @@ DO {{Cl|ELSE}} Button = 0 {{Cl|END IF}} {{Cl|LOOP}} -{{Cl|END SUB}} '' '' +{{Cl|END SUB}} {{CodeEnd}} @@ -77,4 +79,4 @@ DO {{PageNavigation}} -< + diff --git a/internal/help/ON_UEVENT.txt b/internal/help/ON_UEVENT.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/ON_UEVENT.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/OPEN.txt b/internal/help/OPEN.txt deleted file mode 100644 index c364960e2..000000000 --- a/internal/help/OPEN.txt +++ /dev/null @@ -1,162 +0,0 @@ -The [[OPEN]] statement is used to open a file or [[OPEN_COM|COM]] serial communications port for program input or output. - - -{{PageSyntax}} -: [[OPEN]] {{Parameter|fileName$}} ['''FOR''' {{Parameter|mode}}] [{{{KW|ACCESS}}|{{{KW|LOCK}}|SHARED}} [{READ|WRITE}] [[AS]] [#]{{Parameter|fileNumber&}} [LEN = {{Parameter|recordLength}}] - - -===Legacy ''GW-BASIC'' syntax=== -: [[OPEN]] {{Parameter|modeLetter$}}, [#]{{Parameter|fileNumber&}}, {{Parameter|fileName$}}[, {{Parameter|recordLength}}] - - -{{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. -* {{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. - - -{{PageDescription}} -* '''QB64''' can open as many files as your computer memory can handle. QBasic could only open about 15 at a time. -* '''QB64 will allocate 4 bytes of memory for every possible file number up to the highest number used in a program.''' -* {{Parameter|mode}} defaults to RANDOM if the {{Parameter|mode}} or FOR access statement is omitted. (see open modes described below) -* '''Only the {{Parameter|fileName$}}, {{Parameter|fileNumber&}} and LEN = {{Parameter|recordLength}} values can use variable values in the QBasic syntax.''' -* 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. -* [[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". -** 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. - - -==Details== -===File ACCESS and LOCK Permissions=== -* [[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. - -===File Access Modes=== -* FOR mode can be: -** '''OUTPUT''': Sequential mode creates a new file or erases an existing file for new program output. Use [[WRITE (file statement)|WRITE #]] to write numerical or text data or [[PRINT (file statement)|PRINT #]] for text. '''OUTPUT clears files of all data''' and clears the receive buffer on other devices such as [[ON COM(n)|COM]]. -** '''APPEND''': Sequential mode creates a new file if it doesn't exist or appends program output to the end of an existing file. Use [[WRITE (file statement)|WRITE #]] for numerical or text data or [[PRINT (file statement)|PRINT #]] for text as in the OUTPUT mode. '''APPEND does not remove previous data.''' -** '''INPUT''' : Sequential mode '''only reads input''' from an existing file. '''[[ERROR Codes|File error]] if file does not exist.''' Use [[INPUT (file statement)|INPUT #]] for comma separated numerical or text data and [[LINE INPUT (file statement)|LINE INPUT #]] or [[INPUT$]] to only read text data. '''Use [[_FILEEXISTS]] or [[_DIREXISTS]] to avoid errors.''' -** '''BINARY''': Creates a new file when it doesn't exist or reads and writes to an existing binary file. Use [[GET|GET #]] to read or [[PUT|PUT #]] to write byte positions simultaneously. [[LEN]] = statements are ignored in this mode. -** '''RANDOM''': Creates a new file when it doesn't exist or reads or writes to an existing random file record. Use [[GET|GET #]] or [[PUT|PUT #]] to read or write to file records. A [[LEN]] = statement can define the byte size of a record (no LEN statement defaults to 128 bytes) -** Modes '''INPUT''', '''BINARY''' and '''RANDOM''' allow a file to be concurrently opened in a different mode and number. - - -====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'''. - - -{{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% - -{{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}} - {{Cl|END IF}} - {{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|END SELECT}} - {{Cl|PRINT}} {{Cl|CHR$}}(code%); 'use {{Cl|LOCATE}} before {{Cl|FUNCTION}} call to place print - {{Cl|NEXT}} - CheckName% = E% -{{Cl|END FUNCTION}} '' '' -{{CodeEnd}} -''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}} -{{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: -{{CodeStart}} '' '' -f% = {{Cl|FREEFILE}} 'should always be 1 at program start -{{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|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 2 - {{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. - - -''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|CLOSE}} #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|END}} - -{{CodeEnd}} - -{{OutputStart}} -If test.tst didn't exist: -A new file was created named test.tst and then deleted. -If test.tst did exist: -It was overwritten with this and deleted. -{{OutputEnd}} -:'''Warning:''' Make sure you don't have a file named test.tst before you run this or it will be overwritten. - - -{{PageSeeAlso}} -* [[PRINT (file statement)]], [[INPUT (file statement)]] -* [[GET]], [[PUT]], [[WRITE (file statement)]] -* [[INPUT$]], [[LINE INPUT (file statement)]] -* [[CLOSE]], [[LOF]], [[EOF]], [[LOC]] -* [[SEEK (statement)]], [[SEEK]] -* [[OPEN COM]], [[LEN]], [[RESET]] -* [[FIELD]], [[TYPE]] -* [[_FILEEXISTS]], [[_DIREXISTS]] -* [[_OPENCLIENT]], [[_OPENHOST]], [[_OPENCONNECTION]] {{text|(TCP/IP)}} -* [[_SNDOPEN]], [[_LOADIMAGE]] - - -{{PageNavigation}} -< diff --git a/internal/help/OPEN_1111.txt b/internal/help/OPEN_1111.txt new file mode 100644 index 000000000..31773d3f1 --- /dev/null +++ b/internal/help/OPEN_1111.txt @@ -0,0 +1,164 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:11}} +The [[OPEN]] statement is used to open a file or [[OPEN_COM|COM]] serial communications port for program input or output. + + +{{PageSyntax}} +: [[OPEN]] {{Parameter|fileName$}} ['''FOR''' {{Parameter|mode}}] [{{{KW|ACCESS}}|{{{KW|LOCK}}|SHARED}} [{READ|WRITE}] [[AS]] [#]{{Parameter|fileNumber&}} [LEN = {{Parameter|recordLength}}] + + +===Legacy ''GW-BASIC'' syntax=== +: [[OPEN]] {{Parameter|modeLetter$}}, [#]{{Parameter|fileNumber&}}, {{Parameter|fileName$}}[, {{Parameter|recordLength}}] + + +{{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. +* {{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. + + +{{PageDescription}} +* '''QB64''' can open as many files as your computer memory can handle. QBasic could only open about 15 at a time. +* '''QB64 will allocate 4 bytes of memory for every possible file number up to the highest number used in a program.''' +* {{Parameter|mode}} defaults to RANDOM if the {{Parameter|mode}} or FOR access statement is omitted. (see open modes described below) +* '''Only the {{Parameter|fileName$}}, {{Parameter|fileNumber&}} and LEN = {{Parameter|recordLength}} values can use variable values in the QBasic syntax.''' +* 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. +* [[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". +** 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. + + +==Details== +===File ACCESS and LOCK Permissions=== +* [[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. + +===File Access Modes=== +* FOR mode can be: +** '''OUTPUT''': Sequential mode creates a new file or erases an existing file for new program output. Use [[WRITE (file statement)|WRITE #]] to write numerical or text data or [[PRINT (file statement)|PRINT #]] for text. '''OUTPUT clears files of all data''' and clears the receive buffer on other devices such as [[ON COM(n)|COM]]. +** '''APPEND''': Sequential mode creates a new file if it doesn't exist or appends program output to the end of an existing file. Use [[WRITE (file statement)|WRITE #]] for numerical or text data or [[PRINT (file statement)|PRINT #]] for text as in the OUTPUT mode. '''APPEND does not remove previous data.''' +** '''INPUT''' : Sequential mode '''only reads input''' from an existing file. '''[[ERROR Codes|File error]] if file does not exist.''' Use [[INPUT (file statement)|INPUT #]] for comma separated numerical or text data and [[LINE INPUT (file statement)|LINE INPUT #]] or [[INPUT$]] to only read text data. '''Use [[_FILEEXISTS]] or [[_DIREXISTS]] to avoid errors.''' +** '''BINARY''': Creates a new file when it doesn't exist or reads and writes to an existing binary file. Use [[GET|GET #]] to read or [[PUT|PUT #]] to write byte positions simultaneously. [[LEN]] = statements are ignored in this mode. +** '''RANDOM''': Creates a new file when it doesn't exist or reads or writes to an existing random file record. Use [[GET|GET #]] or [[PUT|PUT #]] to read or write to file records. A [[LEN]] = statement can define the byte size of a record (no LEN statement defaults to 128 bytes) +** Modes '''INPUT''', '''BINARY''' and '''RANDOM''' allow a file to be concurrently opened in a different mode and number. + + +====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'''. + + +{{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% + +{{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}} + {{Cl|END IF}} + {{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|END SELECT}} + {{Cl|PRINT}} {{Cl|CHR$}}(code%); 'use {{Cl|LOCATE}} before {{Cl|FUNCTION}} call to place print + {{Cl|NEXT}} + CheckName% = E% +{{Cl|END FUNCTION}} +{{CodeEnd}} +''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}} = {{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: +{{CodeStart}} +f% = {{Cl|FREEFILE}} 'should always be 1 at program start +{{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|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 2 + {{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. + + +''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|CLOSE}} #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|END}} + +{{CodeEnd}} + +{{OutputStart}} +If test.tst didn't exist: +A new file was created named test.tst and then deleted. +If test.tst did exist: +It was overwritten with this and deleted. +{{OutputEnd}} +:'''Warning:''' Make sure you don't have a file named test.tst before you run this or it will be overwritten. + + +{{PageSeeAlso}} +* [[PRINT (file statement)]], [[INPUT (file statement)]] +* [[GET]], [[PUT]], [[WRITE (file statement)]] +* [[INPUT$]], [[LINE INPUT (file statement)]] +* [[CLOSE]], [[LOF]], [[EOF]], [[LOC]] +* [[SEEK (statement)]], [[SEEK]] +* [[OPEN COM]], [[LEN]], [[RESET]] +* [[FIELD]], [[TYPE]] +* [[_FILEEXISTS]], [[_DIREXISTS]] +* [[_OPENCLIENT]], [[_OPENHOST]], [[_OPENCONNECTION]] {{text|(TCP/IP)}} +* [[_SNDOPEN]], [[_LOADIMAGE]] + + +{{PageNavigation}} + diff --git a/internal/help/OPEN_COM.txt b/internal/help/OPEN_COM_1111_111.txt similarity index 95% rename from internal/help/OPEN_COM.txt rename to internal/help/OPEN_COM_1111_111.txt index 4817e4527..aa336a11d 100644 --- a/internal/help/OPEN_COM.txt +++ b/internal/help/OPEN_COM_1111_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:13}} The [[OPEN COM]] statement is used to access a computer's serial port COM. @@ -26,7 +28,7 @@ The [[OPEN COM]] statement is used to access a computer's serial port COM. {{PageDescription}} * '''If any optional CD, CS, DS or OP timeouts occur the OPEN will fail or port access will stop. Try 0 to ignore.''' * '''QB64''' can open any COM''n'' port number from 1 to 9. -* See Windows System '''Device Manager''' for COM port numbers and port addresses &H3F8, &H2F8, &H3E8 and &H2E8. +* 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). @@ -40,7 +42,7 @@ The [[OPEN COM]] statement is used to access a computer's serial port COM. {{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}} '' '' +{{CodeStart}} {{Cl|ON ERROR}} {{Cl|GOTO}} Handler FF = {{Cl|FREEFILE}} comPort$ = "COM1:" 'try a COM port number that does not exist @@ -60,7 +62,7 @@ errnum = {{Cl|ERR}} ''Example 2:'' Opening a COM port with the BIN, CS0 and DS0 options in '''QB64'''. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DIM}} bytestr {{Cl|AS}} {{Cl|STRING}} * 1 'one byte transfers {{Cl|INPUT}} "{{Cl|COM}} port number #", port$ 'any COM port number available @@ -76,17 +78,17 @@ errnum = {{Cl|ERR}} {{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|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}} ''Example 3:'' Sending string data from one COM port to another requires predefined length strings: -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DIM}} {{Cl|SHARED}} ByteIn {{Cl|AS}} {{Cl|STRING}} * 1 'One byte transfers {{Cl|DIM}} {{Cl|SHARED}} Byte4 {{Cl|AS}} {{Cl|STRING}} * 4 'Four byte transfers @@ -98,7 +100,7 @@ Byte4 = {{Cl|CHR$}}(254) + {{Cl|CHR$}}(175) + {{Cl|CHR$}}(0) + {{Cl|CHR$}}(3) 'C {{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|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}} @@ -113,7 +115,7 @@ Start# = {{Cl|TIMER}} {{Cl|GET}} #2, , ByteIn {{Cl|PRINT}} {{Cl|ASC}}(ByteIn); {{Cl|LOOP}} -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}}{{small|Code courtesy of forum member Hydrofoiler}} @@ -127,4 +129,4 @@ Start# = {{Cl|TIMER}} {{PageNavigation}} -< + diff --git a/internal/help/OPTION_BASE.txt b/internal/help/OPTION_BASE_111111_1111.txt similarity index 96% rename from internal/help/OPTION_BASE.txt rename to internal/help/OPTION_BASE_111111_1111.txt index 2f10b3f29..4d72d4f1b 100644 --- a/internal/help/OPTION_BASE.txt +++ b/internal/help/OPTION_BASE_111111_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:14}} The [[OPTION BASE]] statement is used to set the default lower bound of arrays. @@ -27,7 +29,7 @@ The [[OPTION BASE]] statement is used to set the default lower bound of arrays. ''Example 2:'' Set the default lower bound for array declarations to zero. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|OPTION BASE}} 0 ' Declare an 18-element two-dimensional array with element indexes of zero through two @@ -48,4 +50,4 @@ The [[OPTION BASE]] statement is used to set the default lower bound of arrays. {{PageNavigation}} -< + diff --git a/internal/help/OPTION__EXPLICITARRAY.txt b/internal/help/OPTION__EXPLICITARRAY_111111__1111111111111.txt similarity index 96% rename from internal/help/OPTION__EXPLICITARRAY.txt rename to internal/help/OPTION__EXPLICITARRAY_111111__1111111111111.txt index 969a39f4d..2285a27ee 100644 --- a/internal/help/OPTION__EXPLICITARRAY.txt +++ b/internal/help/OPTION__EXPLICITARRAY_111111__1111111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:48}} {{DISPLAYTITLE:OPTION _EXPLICITARRAY}} [[OPTION _EXPLICITARRAY]] instructs the compiler to require arrays be declared with [[DIM]], [[REDIM]] or equivalent. @@ -37,4 +39,4 @@ y(2) = 3 'This now generates an error {{PageNavigation}} -< + diff --git a/internal/help/OPTION__EXPLICIT.txt b/internal/help/OPTION__EXPLICIT_111111__11111111.txt similarity index 96% rename from internal/help/OPTION__EXPLICIT.txt rename to internal/help/OPTION__EXPLICIT_111111__11111111.txt index 1c62693aa..d0de7e582 100644 --- a/internal/help/OPTION__EXPLICIT.txt +++ b/internal/help/OPTION__EXPLICIT_111111__11111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:47}} {{DISPLAYTITLE:OPTION _EXPLICIT}} [[OPTION _EXPLICIT]] instructs the compiler to require variable declaration with [[DIM]], [[REDIM]] or an equivalent statement. @@ -39,4 +41,4 @@ myVariable = 5 {{PageNavigation}} -< + diff --git a/internal/help/OR_(boolean).txt b/internal/help/OR_(boolean)_11_(0000000).txt similarity index 90% rename from internal/help/OR_(boolean).txt rename to internal/help/OR_(boolean)_11_(0000000).txt index 2835ccd24..7a85ecf0a 100644 --- a/internal/help/OR_(boolean).txt +++ b/internal/help/OR_(boolean)_11_(0000000).txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:20}} The '''OR''' conditional operator evaluates an expression to true (-1) if any of the arguments is also true. @@ -20,7 +22,7 @@ The '''OR''' conditional operator evaluates an expression to true (-1) if any of 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 @@ -35,4 +37,4 @@ True {{PageNavigation}} -< + diff --git a/internal/help/OR.txt b/internal/help/OR_11.txt similarity index 87% rename from internal/help/OR.txt rename to internal/help/OR_11.txt index 39b6e6476..0b5969503 100644 --- a/internal/help/OR.txt +++ b/internal/help/OR_11.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:15}} The [[OR]] numerical operator returns a comparative bit value of 1 if either value's bit is on. @@ -17,11 +19,11 @@ The [[OR]] numerical operator returns a comparative bit value of 1 if either val {{PageExamples}} ''Example 1:'' OR always turns bits on! Never off. -{{CodeStart}} '' '' +{{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 @@ -29,10 +31,10 @@ The [[OR]] numerical operator returns a comparative bit value of 1 if either val ''Example 2:'' Turning a data register bit on. -{{CodeStart}} '' '' +{{CodeStart}} address% = 888 'parallel port data register bytevalue% = {{Cl|INP}}(address%) - {{Cl|OUT}} address%, bytevalue% {{Cl|OR}} 4 '' '' + {{Cl|OUT}} address%, bytevalue% {{Cl|OR}} 4 {{CodeEnd}} :''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 @@ -45,4 +47,4 @@ The [[OR]] numerical operator returns a comparative bit value of 1 if either val {{PageNavigation}} -< + diff --git a/internal/help/OUTPUT.txt b/internal/help/OUTPUT.txt deleted file mode 100644 index c364960e2..000000000 --- a/internal/help/OUTPUT.txt +++ /dev/null @@ -1,162 +0,0 @@ -The [[OPEN]] statement is used to open a file or [[OPEN_COM|COM]] serial communications port for program input or output. - - -{{PageSyntax}} -: [[OPEN]] {{Parameter|fileName$}} ['''FOR''' {{Parameter|mode}}] [{{{KW|ACCESS}}|{{{KW|LOCK}}|SHARED}} [{READ|WRITE}] [[AS]] [#]{{Parameter|fileNumber&}} [LEN = {{Parameter|recordLength}}] - - -===Legacy ''GW-BASIC'' syntax=== -: [[OPEN]] {{Parameter|modeLetter$}}, [#]{{Parameter|fileNumber&}}, {{Parameter|fileName$}}[, {{Parameter|recordLength}}] - - -{{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. -* {{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. - - -{{PageDescription}} -* '''QB64''' can open as many files as your computer memory can handle. QBasic could only open about 15 at a time. -* '''QB64 will allocate 4 bytes of memory for every possible file number up to the highest number used in a program.''' -* {{Parameter|mode}} defaults to RANDOM if the {{Parameter|mode}} or FOR access statement is omitted. (see open modes described below) -* '''Only the {{Parameter|fileName$}}, {{Parameter|fileNumber&}} and LEN = {{Parameter|recordLength}} values can use variable values in the QBasic syntax.''' -* 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. -* [[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". -** 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. - - -==Details== -===File ACCESS and LOCK Permissions=== -* [[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. - -===File Access Modes=== -* FOR mode can be: -** '''OUTPUT''': Sequential mode creates a new file or erases an existing file for new program output. Use [[WRITE (file statement)|WRITE #]] to write numerical or text data or [[PRINT (file statement)|PRINT #]] for text. '''OUTPUT clears files of all data''' and clears the receive buffer on other devices such as [[ON COM(n)|COM]]. -** '''APPEND''': Sequential mode creates a new file if it doesn't exist or appends program output to the end of an existing file. Use [[WRITE (file statement)|WRITE #]] for numerical or text data or [[PRINT (file statement)|PRINT #]] for text as in the OUTPUT mode. '''APPEND does not remove previous data.''' -** '''INPUT''' : Sequential mode '''only reads input''' from an existing file. '''[[ERROR Codes|File error]] if file does not exist.''' Use [[INPUT (file statement)|INPUT #]] for comma separated numerical or text data and [[LINE INPUT (file statement)|LINE INPUT #]] or [[INPUT$]] to only read text data. '''Use [[_FILEEXISTS]] or [[_DIREXISTS]] to avoid errors.''' -** '''BINARY''': Creates a new file when it doesn't exist or reads and writes to an existing binary file. Use [[GET|GET #]] to read or [[PUT|PUT #]] to write byte positions simultaneously. [[LEN]] = statements are ignored in this mode. -** '''RANDOM''': Creates a new file when it doesn't exist or reads or writes to an existing random file record. Use [[GET|GET #]] or [[PUT|PUT #]] to read or write to file records. A [[LEN]] = statement can define the byte size of a record (no LEN statement defaults to 128 bytes) -** Modes '''INPUT''', '''BINARY''' and '''RANDOM''' allow a file to be concurrently opened in a different mode and number. - - -====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'''. - - -{{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% - -{{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}} - {{Cl|END IF}} - {{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|END SELECT}} - {{Cl|PRINT}} {{Cl|CHR$}}(code%); 'use {{Cl|LOCATE}} before {{Cl|FUNCTION}} call to place print - {{Cl|NEXT}} - CheckName% = E% -{{Cl|END FUNCTION}} '' '' -{{CodeEnd}} -''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}} -{{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: -{{CodeStart}} '' '' -f% = {{Cl|FREEFILE}} 'should always be 1 at program start -{{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|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 2 - {{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. - - -''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|CLOSE}} #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|END}} - -{{CodeEnd}} - -{{OutputStart}} -If test.tst didn't exist: -A new file was created named test.tst and then deleted. -If test.tst did exist: -It was overwritten with this and deleted. -{{OutputEnd}} -:'''Warning:''' Make sure you don't have a file named test.tst before you run this or it will be overwritten. - - -{{PageSeeAlso}} -* [[PRINT (file statement)]], [[INPUT (file statement)]] -* [[GET]], [[PUT]], [[WRITE (file statement)]] -* [[INPUT$]], [[LINE INPUT (file statement)]] -* [[CLOSE]], [[LOF]], [[EOF]], [[LOC]] -* [[SEEK (statement)]], [[SEEK]] -* [[OPEN COM]], [[LEN]], [[RESET]] -* [[FIELD]], [[TYPE]] -* [[_FILEEXISTS]], [[_DIREXISTS]] -* [[_OPENCLIENT]], [[_OPENHOST]], [[_OPENCONNECTION]] {{text|(TCP/IP)}} -* [[_SNDOPEN]], [[_LOADIMAGE]] - - -{{PageNavigation}} -< diff --git a/internal/help/OUTPUT_111111.txt b/internal/help/OUTPUT_111111.txt new file mode 100644 index 000000000..64a00bcea --- /dev/null +++ b/internal/help/OUTPUT_111111.txt @@ -0,0 +1,164 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:26}} +The [[OPEN]] statement is used to open a file or [[OPEN_COM|COM]] serial communications port for program input or output. + + +{{PageSyntax}} +: [[OPEN]] {{Parameter|fileName$}} ['''FOR''' {{Parameter|mode}}] [{{{KW|ACCESS}}|{{{KW|LOCK}}|SHARED}} [{READ|WRITE}] [[AS]] [#]{{Parameter|fileNumber&}} [LEN = {{Parameter|recordLength}}] + + +===Legacy ''GW-BASIC'' syntax=== +: [[OPEN]] {{Parameter|modeLetter$}}, [#]{{Parameter|fileNumber&}}, {{Parameter|fileName$}}[, {{Parameter|recordLength}}] + + +{{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. +* {{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. + + +{{PageDescription}} +* '''QB64''' can open as many files as your computer memory can handle. QBasic could only open about 15 at a time. +* '''QB64 will allocate 4 bytes of memory for every possible file number up to the highest number used in a program.''' +* {{Parameter|mode}} defaults to RANDOM if the {{Parameter|mode}} or FOR access statement is omitted. (see open modes described below) +* '''Only the {{Parameter|fileName$}}, {{Parameter|fileNumber&}} and LEN = {{Parameter|recordLength}} values can use variable values in the QBasic syntax.''' +* 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. +* [[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". +** 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. + + +==Details== +===File ACCESS and LOCK Permissions=== +* [[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. + +===File Access Modes=== +* FOR mode can be: +** '''OUTPUT''': Sequential mode creates a new file or erases an existing file for new program output. Use [[WRITE (file statement)|WRITE #]] to write numerical or text data or [[PRINT (file statement)|PRINT #]] for text. '''OUTPUT clears files of all data''' and clears the receive buffer on other devices such as [[ON COM(n)|COM]]. +** '''APPEND''': Sequential mode creates a new file if it doesn't exist or appends program output to the end of an existing file. Use [[WRITE (file statement)|WRITE #]] for numerical or text data or [[PRINT (file statement)|PRINT #]] for text as in the OUTPUT mode. '''APPEND does not remove previous data.''' +** '''INPUT''' : Sequential mode '''only reads input''' from an existing file. '''[[ERROR Codes|File error]] if file does not exist.''' Use [[INPUT (file statement)|INPUT #]] for comma separated numerical or text data and [[LINE INPUT (file statement)|LINE INPUT #]] or [[INPUT$]] to only read text data. '''Use [[_FILEEXISTS]] or [[_DIREXISTS]] to avoid errors.''' +** '''BINARY''': Creates a new file when it doesn't exist or reads and writes to an existing binary file. Use [[GET|GET #]] to read or [[PUT|PUT #]] to write byte positions simultaneously. [[LEN]] = statements are ignored in this mode. +** '''RANDOM''': Creates a new file when it doesn't exist or reads or writes to an existing random file record. Use [[GET|GET #]] or [[PUT|PUT #]] to read or write to file records. A [[LEN]] = statement can define the byte size of a record (no LEN statement defaults to 128 bytes) +** Modes '''INPUT''', '''BINARY''' and '''RANDOM''' allow a file to be concurrently opened in a different mode and number. + + +====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'''. + + +{{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% + +{{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}} + {{Cl|END IF}} + {{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|END SELECT}} + {{Cl|PRINT}} {{Cl|CHR$}}(code%); 'use {{Cl|LOCATE}} before {{Cl|FUNCTION}} call to place print + {{Cl|NEXT}} + CheckName% = E% +{{Cl|END FUNCTION}} +{{CodeEnd}} +''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}} = {{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: +{{CodeStart}} +f% = {{Cl|FREEFILE}} 'should always be 1 at program start +{{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|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 2 + {{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. + + +''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|CLOSE}} #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|END}} + +{{CodeEnd}} + +{{OutputStart}} +If test.tst didn't exist: +A new file was created named test.tst and then deleted. +If test.tst did exist: +It was overwritten with this and deleted. +{{OutputEnd}} +:'''Warning:''' Make sure you don't have a file named test.tst before you run this or it will be overwritten. + + +{{PageSeeAlso}} +* [[PRINT (file statement)]], [[INPUT (file statement)]] +* [[GET]], [[PUT]], [[WRITE (file statement)]] +* [[INPUT$]], [[LINE INPUT (file statement)]] +* [[CLOSE]], [[LOF]], [[EOF]], [[LOC]] +* [[SEEK (statement)]], [[SEEK]] +* [[OPEN COM]], [[LEN]], [[RESET]] +* [[FIELD]], [[TYPE]] +* [[_FILEEXISTS]], [[_DIREXISTS]] +* [[_OPENCLIENT]], [[_OPENHOST]], [[_OPENCONNECTION]] {{text|(TCP/IP)}} +* [[_SNDOPEN]], [[_LOADIMAGE]] + + +{{PageNavigation}} + diff --git a/internal/help/OUT.txt b/internal/help/OUT_111.txt similarity index 71% rename from internal/help/OUT.txt rename to internal/help/OUT_111.txt index 13bb404b0..ea8a5ff6f 100644 --- a/internal/help/OUT.txt +++ b/internal/help/OUT_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:21}} [[OUT]] writes values to register and port hardware addresses. @@ -6,7 +8,7 @@ {{Parameters}} -* {{Parameter|registerAddress%}} is a value expressed as a decimal [[INTEGER]] or [[&H|hexadecimal]]. +* {{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. @@ -22,11 +24,11 @@ ==Color Port Palette access using OUT== -:::::{{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 +:::::{{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 -:::::{{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 +:::::{{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. @@ -41,12 +43,12 @@ {{PageExamples}} ''Example 1:'' Reading the default RGB color settings of color attribute 15. -{{CodeStart}} '' '' -{{Cl|OUT}} &H3C7, 15 'set color port attribute 15 for a read -red% = {{Cl|INP}}(&H3C9) -green% = INP(&H3C9) -blue% = INP(&H3C9) -PRINT red%, green%, blue% '' '' +{{CodeStart}} +{{Cl|OUT}} &H3C7, 15 'set color port attribute 15 for a read +red% = {{Cl|INP}}(&H3C9) +green% = INP(&H3C9) +blue% = INP(&H3C9) +PRINT red%, green%, blue% {{CodeEnd}} {{OutputStart}} 63 63 63 @@ -54,31 +56,31 @@ PRINT red%, green%, blue% '' '' ''Example 2:'' Changing the color intensity settings of the [[SCREEN]] background [[COLOR]] 0 to bright white. -{{CodeStart}} '' '' -{{Cl|OUT}} &H3C8, 0 'attribute number. 0 for black screen background -{{Cl|OUT}} &H3C9, 63 'red -{{Cl|OUT}} &H3C9, 63 'green -{{Cl|OUT}} &H3C9, 63 'blue '' '' +{{CodeStart}} +{{Cl|OUT}} &H3C8, 0 'attribute number. 0 for black screen background +{{Cl|OUT}} &H3C9, 63 'red +{{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. {{InlineCode}}[[COLOR]] ,15{{InlineCodeEnd}} is actually grey (7). ''Example 3:'' Toggling blinking colors in SCREEN beginning with build 20170816/61 -{{CodeStart}} '' '' -{{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) +{{CodeStart}} +{{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: 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. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN (statement)|SCREEN}} 12 - {{Cl|OUT}} {{Cl|&H}}3C8, 0 ' set color port for output at attribute 0 + {{Cl|OUT}} {{Cl|&H}}3C8, 0 ' set color port for output at attribute 0 {{Cl|FOR...NEXT|FOR}} i = 0 {{Cl|TO}} 47 ' 48 RGB values is (3 * 16) -1 color attributes from 0 in screen 12 - {{Cl|OUT}} {{Cl|&H}}3C9, Image%(i) ' changes to next attribute after 3 RGB loops + {{Cl|OUT}} {{Cl|&H}}3C9, Image%(i) ' changes to next attribute after 3 RGB loops {{Cl|NEXT}} - {{Cl|PUT (graphics statement)|PUT}}(clm, row), Image(48) PSET '' '' + {{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 [[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. @@ -99,4 +101,4 @@ PRINT red%, green%, blue% '' '' {{PageNavigation}} -< + diff --git a/internal/help/PAINT.txt b/internal/help/PAINT_11111.txt similarity index 89% rename from internal/help/PAINT.txt rename to internal/help/PAINT_11111.txt index d0cea7053..3445053a3 100644 --- a/internal/help/PAINT.txt +++ b/internal/help/PAINT_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:28}} The [[PAINT]] statement is used to fill a delimited area in a graphic screen mode with color. @@ -22,17 +24,17 @@ The [[PAINT]] statement is used to fill a delimited area in a graphic screen mod {{PageExamples}} ''Example 1:'' Painting a [[CIRCLE]] immediately after it is drawn using [[STEP]](0, 0) to paint from the circle's center point. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN (statement)|SCREEN}} 12 x = 200: y = 200 {{Cl|CIRCLE}} (x, y), 100, 10 -{{Cl|PAINT}} {{Cl|STEP}}(0, 0), 2, 10 '' '' +{{Cl|PAINT}} {{Cl|STEP}}(0, 0), 2, 10 {{CodeEnd}} :''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 closed so that a PAINT does not "leak". -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 12 drw$ = "C15S20R9D4R6U3R3D3R7U5H3U2R9D3G2D6F1D3F5L10D1G1L4H2L7G2L3H2L3U8L2U5R1BF4" @@ -56,7 +58,7 @@ drw$ = "C15S20R9D4R6U3R3D3R7U5H3U2R9D3G2D6F1D3F5L10D1G1L4H2L7G2L3H2L3U8L2U5R1BF4 {{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}} @@ -67,7 +69,7 @@ drw$ = "C15S20R9D4R6U3R3D3R7U5H3U2R9D3G2D6F1D3F5L10D1G1L4H2L7G2L3H2L3U8L2U5R1BF4 {{Cl|PRINT}} tmp$, horizont, vertical '{{Cl|SLEEP}} {{Cl|NEXT}} -{{Cl|PSET}} (300, 300): {{Cl|DRAW}} drw$ '' '' +{{Cl|PSET}} (300, 300): {{Cl|DRAW}} drw$ {{CodeEnd}} : ''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. @@ -78,11 +80,11 @@ drw$ = "C15S20R9D4R6U3R3D3R7U5H3U2R9D3G2D6F1D3F5L10D1G1L4H2L7G2L3H2L3U8L2U5R1BF4 {{Cl|SCREEN}} 12 'make red-brick wall - Row$(1) = {{Cl|CHR$}}({{Cl|&H}}0) + {{Cl|CHR$}}({{Cl|&H}}0) + {{Cl|CHR$}}({{Cl|&H}}FE) + {{Cl|CHR$}}({{Cl|&H}}FE) + Row$(1) = {{Cl|CHR$}}({{Cl|&H}}0) + {{Cl|CHR$}}({{Cl|&H}}0) + {{Cl|CHR$}}({{Cl|&H}}FE) + {{Cl|CHR$}}({{Cl|&H}}FE) Row$(2) = Row$(1) Row$(3) = Row$(1) - Row$(4) = {{Cl|CHR$}}({{Cl|&H}}0) + {{Cl|CHR$}}({{Cl|&H}}0) + {{Cl|CHR$}}({{Cl|&H}}0) + {{Cl|CHR$}}({{Cl|&H}}0) - Row$(5) = {{Cl|CHR$}}({{Cl|&H}}0) + {{Cl|CHR$}}({{Cl|&H}}0) + {{Cl|CHR$}}({{Cl|&H}}EF) + {{Cl|CHR$}}({{Cl|&H}}EF) + Row$(4) = {{Cl|CHR$}}({{Cl|&H}}0) + {{Cl|CHR$}}({{Cl|&H}}0) + {{Cl|CHR$}}({{Cl|&H}}0) + {{Cl|CHR$}}({{Cl|&H}}0) + Row$(5) = {{Cl|CHR$}}({{Cl|&H}}0) + {{Cl|CHR$}}({{Cl|&H}}0) + {{Cl|CHR$}}({{Cl|&H}}EF) + {{Cl|CHR$}}({{Cl|&H}}EF) Row$(6) = Row$(5) Row$(7) = Row$(5) Row$(8) = Row$(4) @@ -119,7 +121,7 @@ ptndata: {{Cl|READ}} row$ {{Cl|IF}} {{Cl|LEFT$}}(row$, 3) = "---" {{Cl|THEN}} {{Cl|EXIT}} {{Cl|DO}} {{Cl|FOR}} x = 0 {{Cl|TO}} 7 - pixel = {{Cl|VAL}}("&h" + {{Cl|MID$}}(row$, x + 1, 1)) + pixel = {{Cl|VAL}}("&h" + {{Cl|MID$}}(row$, x + 1, 1)) {{Cl|FOR}} bit = 0 {{Cl|TO}} 3 {{Cl|IF}} pixel {{Cl|AND}} 2 ^ bit {{Cl|THEN}} quad(bit) = quad(bit) {{Cl|OR}} (2 ^ (7 - x)) @@ -144,4 +146,4 @@ ptndata: {{PageNavigation}} -< + diff --git a/internal/help/PALETTE.txt b/internal/help/PALETTE_1111111.txt similarity index 94% rename from internal/help/PALETTE.txt rename to internal/help/PALETTE_1111111.txt index df5d0ab71..f91ba2111 100644 --- a/internal/help/PALETTE.txt +++ b/internal/help/PALETTE_1111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:29}} The [[PALETTE]] statement can swap color settings, set colors to default or set the red, green and blue color components of palette colors. @@ -23,13 +25,13 @@ The [[PALETTE]] statement can swap color settings, set colors to default or set {{PageExamples}} ''Example:'' Displaying all 64 DAC color hues as backgrounds in SCREEN 9 using a PALETTE swap. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN (statement)|SCREEN}} 9 ' background is default black {{Cl|LOCATE}} 20, 33: {{Cl|PRINT}} "Press any Key!" - {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 64 + {{Cl|FOR...NEXT|FOR}} i = 0 {{Cl|TO}} 63 a$ = {{Cl|INPUT$}}(1) ' wait for a keypress {{Cl|PALETTE}} 0, i - {{Cl|NEXT}} '' '' + {{Cl|NEXT}} {{CodeEnd}} :''Note:'' Other attributes (1 to 15) can also be swapped for DAC foreground colors. @@ -43,4 +45,4 @@ The [[PALETTE]] statement can swap color settings, set colors to default or set {{PageNavigation}} -< + diff --git a/internal/help/PALETTE_USING.txt b/internal/help/PALETTE_USING_1111111_11111.txt similarity index 97% rename from internal/help/PALETTE_USING.txt rename to internal/help/PALETTE_USING_1111111_11111.txt index b6b8e7019..c09f01ef9 100644 --- a/internal/help/PALETTE_USING.txt +++ b/internal/help/PALETTE_USING_1111111_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:30}} The [[PALETTE USING]] statement sets all RGB screen color intensities using values from an [[Arrays|array]]. @@ -32,4 +34,4 @@ The [[PALETTE USING]] statement sets all RGB screen color intensities using valu {{PageNavigation}} -< + diff --git a/internal/help/PCOPY.txt b/internal/help/PCOPY_11111.txt similarity index 93% rename from internal/help/PCOPY.txt rename to internal/help/PCOPY_11111.txt index 6c6cade30..a9c8e0e33 100644 --- a/internal/help/PCOPY.txt +++ b/internal/help/PCOPY_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:32}} The [[PCOPY]] statement copies one source screen page to a destination page in memory. @@ -41,13 +43,13 @@ SetupCursor {{Cl|DRAW}} "ND10F10L3F5L4H5L3" {{Cl|_DISPLAY}} 'statement shows image {{Cl|PCOPY}} 100, {{Cl|_DISPLAY (function)|_DISPLAY}} 'function return as destination page -{{Cl|END SUB}} '' '' +{{Cl|END SUB}} {{CodeEnd}} :''Note:'' Works with [[_DISPLAY (function)]] as the other page. If mouse reads are not crucial, put the _MOUSEINPUT loop inside of the UpdateCursor Sub. ''Example 2:'' Bouncing balls -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN (statement)|SCREEN}} 7, 0, 1, 0 {{Cl|DIM}} x(10), y(10), dx(10), dy(10) {{Cl|FOR...NEXT|FOR}} a = 1 {{Cl|TO}} 10 @@ -65,9 +67,9 @@ SetupCursor 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) < 0 {{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) < 0 {{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}} @@ -80,4 +82,4 @@ SetupCursor {{PageNavigation}} -< + diff --git a/internal/help/PEEK.txt b/internal/help/PEEK_1111.txt similarity index 93% rename from internal/help/PEEK.txt rename to internal/help/PEEK_1111.txt index 2b4fc9119..144d0bd9d 100644 --- a/internal/help/PEEK.txt +++ b/internal/help/PEEK_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:33}} The '''PEEK''' function returns the value that is contained at a certain memory address offset. '''QB64 currently has limited access!''' @@ -8,14 +10,14 @@ The '''PEEK''' function returns the value that is contained at a certain memory * Reads the specified memory ''segment_offset'' value. * Use [[DEF SEG]] before PEEK to specify which memory segment to work in. * PEEK only reads the memory byte value. Not certain bits. (See [[AND]]) -* Important [[SCREEN (statement)|SCREEN]] segments using [[PEEK]] and [[POKE]] include &HB800 (text segment) and &HA000 (graphics segment). +* Important [[SCREEN (statement)|SCREEN]] segments using [[PEEK]] and [[POKE]] include &HB800 (text segment) and &HA000 (graphics segment). * To return to Basic default segment use [[DEF SEG]] without any arguments. * '''Warning: DEF SEG, VARSEG , VARPTR, PEEK or POKE access QB64's emulated 16 bit conventional memory block!''' : '''It is highly recommended that QB64's [[_MEM]] memory system be used to avoid running out of memory.''' ''Example:'' Checking the 8 keyboard bit settings using a PEEK return value. -{{CodeStart}} '' '' +{{CodeStart}} SCREEN 12 {{Cl|DEF SEG}} = 0 ' BIOS area oldvalue = PEEK(1047) ' IMPORTANT! save initial setting to reset later @@ -43,9 +45,9 @@ The '''PEEK''' function returns the value that is contained at a certain memory 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!"; - LOOP UNTIL {{Cl|INP}}(&H60) = 1 ' escape key exit + LOOP UNTIL {{Cl|INP}}(&H60) = 1 ' escape key exit {{Cl|POKE}} 1047, oldvalue ' IMPORTANT reset to original settings - {{Cl|DEF SEG}} '' '' + {{Cl|DEF SEG}} {{CodeEnd}} : '''NOTE: Keyboard Port function key settings cannot be reset on NT machines!''' @@ -64,4 +66,4 @@ The '''PEEK''' function returns the value that is contained at a certain memory {{PageNavigation}} -< + diff --git a/internal/help/PEN.txt b/internal/help/PEN.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/PEN.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/PEN_(statement).txt b/internal/help/PEN_(statement).txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/PEN_(statement).txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/PLAY(n).txt b/internal/help/PLAY(n).txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/PLAY(n).txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/PLAY.txt b/internal/help/PLAY_1111.txt similarity index 82% rename from internal/help/PLAY.txt rename to internal/help/PLAY_1111.txt index 6c165fd05..afae27d64 100644 --- a/internal/help/PLAY.txt +++ b/internal/help/PLAY_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:38}} '''PLAY''' is a statement that plays notes of sound through the sound card in QB64 using a command [[STRING]]. @@ -8,7 +10,7 @@ {{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. +:*'''<''' - 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}}''' @@ -36,7 +38,7 @@ ''Example 1:'' Plays a sound with the volume and note varying from 0 to 50. Maximum note can only be 84. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|PLAY}} "mll64" {{Cl|DO}} {{Cl|FOR...NEXT|FOR}} x = 1 {{Cl|TO}} 50 @@ -47,14 +49,14 @@ {{Cl|NEXT}} {{Cl|PLAY}} a$ a$ = "" -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" -{{Cl|PLAY}} "v10l1c,l4egl2o5c,o4l4eg" '' '' +{{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. -{{CodeStart}} '' '' +{{CodeStart}} CLS : PRINT "Frosty the Snow Man" {{Cl|FOR...NEXT|FOR}} X = 1 {{Cl|TO}} 2 PRINT @@ -87,13 +89,13 @@ PRINT : PRINT "Thump-et-y thump thump, thump-et-y thump thump, look at Fros-ty g {{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}}'' '' +{{Cl|END}} {{CodeEnd}} {{small|Greg Rismoen 12/09/84}} ''Example 3:'' Clicking on the grid enables various notes to be played simultaneously. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DIM}} {{Cl|SHARED}} grid(16, 16), grid2(16, 16), cur {{Cl|CONST}} maxx = 512 {{Cl|CONST}} maxy = 512 @@ -102,7 +104,7 @@ PRINT "Thump-et-y thump thump, thump-et-y thump thump, ov-er the hills of snow." 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}} cur <> oldcur {{Cl|THEN}} figuregrid drawgrid playgrid @@ -120,8 +122,8 @@ scale2 = maxx \ 16 - 2 y1 = y * scale! {{Cl|FOR...NEXT|FOR}} x = 0 {{Cl|TO}} 15 x1 = x * scale! - c& = {{Cl|_RGB32}}(grid2(x, y) * 64 + 64, 0, 0) - {{Cl|LINE}} (x1, y1)-(x1 + scale2, y1 + scale2), c&, BF + c& = {{Cl|_RGB32}}(grid2(x, y) * 64 + 64, 0, 0) + {{Cl|LINE}} (x1, y1)-(x1 + scale2, y1 + scale2), c&, BF {{Cl|NEXT}} x {{Cl|NEXT}} y {{Cl|END SUB}} @@ -175,13 +177,13 @@ n$ = {{Cl|LEFT$}}(n$, {{Cl|LEN}}(n$) - 1) grid(x, y) = 0 {{Cl|NEXT}} x {{Cl|NEXT}} y -{{Cl|END SUB}} '' '' +{{Cl|END SUB}} {{CodeEnd}} {{small|Code by JP}} ''Example 4:'' Play strings starting with MB allow program code to run while music plays in background. -{{CodeStart}} '' '' +{{CodeStart}} ' 2012, 2013 mennonite ' license: creative commons cc0 1.0 universal ' (public domain) http://creativecommons.org/publicdomain/zero/1.0/ @@ -189,7 +191,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.l4dc.dc.cl2dl4dc. -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 " +{{Cl|PRINT}} +x$ = x$ + " o3 l4 t 0120c mlc 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 mlc,mn >cd2.,d,f,mn>d ml >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$ + " 1,m n> g.f8ga8g8m l< f1 " +x$ = x$ + " ,d1, " +x$ = x$ + " >f .d 8d c< f2 ., " +x$ = x$ + " a2 ., c2 .,>f2. ml < b- " +x$ = x$ + " ,> d, f, mn>dml > c. g .f8 gmld, 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> +x$ = x$ + ">d ml < c2.,m n> c." +x$ = x$ + " c ,m n>" +x$ = x$ + " cm l< d 2. ,f 2." +x$ = x$ + " ,mn> d2.ml< d ,f ,m n>" +x$ = x$ + " dm l<c1,mn >c.g .f 8g a8 g8" +x$ = x$ + " ml << b- 1, >d 1, " +x$ = x$ + " f1 ,mn>f.d8dc l1 ml f, c, {{Cl|PRINT}} x$; -{{Cl|PLAY}} x '' '' +{{Cl|PLAY}} x {{CodeEnd}}{{small|Code by Luke}} @@ -332,4 +334,4 @@ x$ = x$ + " f1 ,mn>f.d8dc l1 ml f, c, <a ,f"</n {{PageNavigation}} -< + diff --git a/internal/help/PMAP.txt b/internal/help/PMAP_1111.txt similarity index 97% rename from internal/help/PMAP.txt rename to internal/help/PMAP_1111.txt index e2157db24..c1623e6ed 100644 --- a/internal/help/PMAP.txt +++ b/internal/help/PMAP_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:39}} The '''PMAP''' statement returns the physical or [[WINDOW]] view port coordinates. @@ -19,7 +21,7 @@ The '''PMAP''' statement returns the physical or [[WINDOW]] view port coordinate ''Example:'' Use PMAP to convert coordinate values from view to screen coordinates and from screen coordinates to view coordinates. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN (statement)|SCREEN}} 12 'Coordinates of upper-left corner of the window is defined in following statement are (90,100) {{Cl|WINDOW}} {{Cl|SCREEN (statement)|SCREEN}} (90, 100)-(200, 200) 'coordinates of lower-right 'corner are 200, 200. @@ -50,7 +52,7 @@ Y = {{Cl|PMAP}}(479, 3) ' Y = 200 {{Cl|SLEEP}} ' pause before clearing view port {{Cl|CLS}} 1 ' clear grahic view port {{Cl|WINDOW}} ' end graphic view port -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} : ''Note:'' If physical screen coordinates are (0, 0) in the upper-left corner and (639, 479) in the lower-right corner, then the statements return the screen coordinate's equal to the view coordinates 90, 100. @@ -61,4 +63,4 @@ Y = {{Cl|PMAP}}(479, 3) ' Y = 200 {{PageNavigation}} -< + diff --git a/internal/help/POINT.txt b/internal/help/POINT_11111.txt similarity index 83% rename from internal/help/POINT.txt rename to internal/help/POINT_11111.txt index b58e73c39..86d4dbbdd 100644 --- a/internal/help/POINT.txt +++ b/internal/help/POINT_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:41}} The '''POINT''' function returns the pixel [[COLOR]] attribute at a specified graphics coordinate or the current graphic cursor position. @@ -35,23 +37,23 @@ 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> +
'''POINT in QBasic Legacy Graphic SCREEN Modes:'''
* 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 Qbasic the coordinates MUST be on the screen or an [[ERROR Codes|Illegal Function Call error]] will occur. +* 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> +
'''POINT in QB64 32 Bit Graphic [[_NEWIMAGE]] or [[_LOADIMAGE]] Modes:'''
* 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. -* To convert color intensities to OUT &H3C9 color port palette intensity values divide the values of 0 to 255 by 4. +* To convert color intensities to OUT &H3C9 color port palette intensity values divide the values of 0 to 255 by 4. * Use the [[_PALETTECOLOR (function)]] to convert color port palette intensities in 32 bit modes. ''Example 1:'' How [[_RGB]] 32 bit values return [[DOUBLE]] or [[_UNSIGNED]] [[LONG]] values in QB64. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DIM}} clr {{Cl|AS}} {{Cl|LONG}} 'DO NOT use LONG in older versions of QB64 (V .936 down) {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, 32) {{Cl|CLS}} , {{Cl|_RGB}}(255, 255, 255) 'makes the background opaque white @@ -61,7 +63,7 @@ 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|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 @@ -73,16 +75,16 @@ _RGB OK ''Example 2:'' Using a [[POINT]] mouse routine to get the 32 bit color values of the image. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, 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" 'any 24/32 bit image 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}} -w& = {{Cl|_WIDTH (function)|_WIDTH}}(i&): h& = {{Cl|_HEIGHT}}(i&) +i& = {{Cl|_LOADIMAGE}}(image$, 32) +{{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)"; BG$ = {{Cl|UCASE$}}({{Cl|INPUT$}}(1)) @@ -91,9 +93,9 @@ BG$ = {{Cl|UCASE$}}({{Cl|INPUT$}}(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|_PUTIMAGE}} (320 - w&, 240 - h&)-((2 * w&) + (320 - w&), (2 * h&) + (240 - h&)), i&, 0 -{{Cl|_FREEIMAGE}} i& +{{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& {{Cl|_MOUSEMOVE}} 320, 240 'center mouse pointer on screen @@ -101,16 +103,16 @@ BG$ = {{Cl|UCASE$}}({{Cl|INPUT$}}(1)) {{Cl|DO...LOOP|DO}} {{Cl|WHILE}} {{Cl|_MOUSEINPUT}} mx = {{Cl|_MOUSEX}} my = {{Cl|_MOUSEY}} - c& = {{Cl|POINT}}(mx, my) - r = {{Cl|_RED32}}(c&) - g = {{Cl|_GREEN32}}(c&) - b = {{Cl|_BLUE32}}(c&) - a = {{Cl|_ALPHA32}}(c&) + c& = {{Cl|POINT}}(mx, my) + r = {{Cl|_RED32}}(c&) + 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}} 2, 2: {{Cl|PRINT}} "HTML Color: {{Cl|&H}}" + {{Cl|RIGHT$}}({{Cl|HEX$}}(c&), 6) {{Cl|LOOP}} {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} > "" -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} {{small|Code by Ted Weissgerber}} :''Explanation:'' Use the mouse pointer to get the background RGB of the image to make it transparent with [[_CLEARCOLOR]]. @@ -151,4 +153,4 @@ BG$ = {{Cl|UCASE$}}({{Cl|INPUT$}}(1)) {{PageNavigation}} -< + diff --git a/internal/help/POKE.txt b/internal/help/POKE_1111.txt similarity index 76% rename from internal/help/POKE.txt rename to internal/help/POKE_1111.txt index 4a688132a..d9fc4127a 100644 --- a/internal/help/POKE.txt +++ b/internal/help/POKE_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:42}} The '''POKE''' statement sets the value of a specified memory address offset. '''QB64 currently has limited access!''' @@ -9,7 +11,7 @@ The '''POKE''' statement sets the value of a specified memory address offset. '' * POKE can only be used to set a value from 0 to 255 (one byte). * A segment should be defined using [[DEF SEG]], if you don't define a segment qbasics ordinary segment will be used. * POKE sends byte values to memory areas. It does not directly access registers. -* Important [[SCREEN (statement)|SCREEN]] segments using [[PEEK]] and [[POKE]] include &HB800 (text segment) and &HA000 (graphics segment). +* Important [[SCREEN (statement)|SCREEN]] segments using [[PEEK]] and [[POKE]] include &HB800 (text segment) and &HA000 (graphics segment). * [[DEF SEG]] should always be used to reset the default segment when access to other memory is no longer necessary. * POKE is safer to use than [[OUT]] which could damage a PC register. * '''Warning: DEF SEG, VARSEG , VARPTR, PEEK or POKE access QB64's emulated 16 bit conventional memory block!''' @@ -17,7 +19,7 @@ The '''POKE''' statement sets the value of a specified memory address offset. '' :''Example 1:'' Turning keyboard Lock and Insert modes on and off. -{{CodeStart}} '' '' +{{CodeStart}} DEF SEG = 0 oldsetting% = PEEK(1047) POKE 1047,PEEK(1047) OR 16 ' ENABLES SCROLL LOCK @@ -28,14 +30,14 @@ The '''POKE''' statement sets the value of a specified memory address offset. '' {{CodeEnd}} :''Note: Use [[XOR]] instead of [[OR]] above to alternate between on and off modes.'' -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DEF SEG}} = 0 oldsetting% = {{Cl|PEEK}}(1047) POKE 1047,PEEK(1047) AND 239 ' TURNS OFF SCROLL LOCK (239 = 255 - 16) POKE 1047,PEEK(1047) AND 223 ' TURNS OFF NUMBER LOCK (223 = 255 - 32) POKE 1047,PEEK(1047) AND 191 ' TURNS OFF CAPS LOCK (191 = 255 - 64) POKE 1047,PEEK(1047) AND 127 ' TURNS OFF INSERT MODE (127 = 255 - 128) - {{Cl|DEF SEG}} '' '' + {{Cl|DEF SEG}} {{CodeEnd}} :''Note: Using [[AND]] requires that the bit value is subtracted from 255 to turn off a bit.'' The above examples won't work in NT. @@ -43,16 +45,16 @@ The '''POKE''' statement sets the value of a specified memory address offset. '' ''Example 2:'' A small PEEK and POKE fractal program. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN (statement)|SCREEN}} 13 -{{Cl|DEF SEG}} = {{Cl|&H}}A000 'set to read screen buffer +{{Cl|DEF SEG}} = {{Cl|&H}}A000 'set to read screen buffer {{Cl|DO}} - {{Cl|FOR...NEXT|FOR}} a& = 0 {{Cl|TO}} 65535 - {{Cl|POKE}} a&, {{Cl|PEEK}}((a& * 2) {{Cl|AND (boolean)|AND}} {{Cl|&H}}FFFF&) + 1 + {{Cl|FOR...NEXT|FOR}} a& = 0 {{Cl|TO}} 65535 + {{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|DEF SEG}} '' '' +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" +{{Cl|DEF SEG}} {{CodeEnd}} @@ -67,7 +69,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,17 +78,17 @@ 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 -addr& = (x1 - 1 + (y - 1) * {{Cl|_WIDTH (function)|_WIDTH}}) * 2 + 1 +{{Cl|DEF SEG}} = {{Cl|&H}}B800 +addr& = (x1 - 1 + (y - 1) * {{Cl|_WIDTH (function)|_WIDTH}}) * 2 + 1 {{Cl|FOR}} x = x1 {{Cl|TO}} x2 - oldCol = {{Cl|PEEK}}(addr&) {{Cl|AND (boolean)|AND}} {{Cl|&B}}10001111 ' Mask foreground color and blink bit - {{Cl|POKE}} addr&, oldCol {{Cl|OR}} ((col {{Cl|AND (boolean)|AND}} {{Cl|&B}}111) * {{Cl|&B}}10000) ' Apply background color - addr& = addr& + 2 + oldCol = {{Cl|PEEK}}(addr&) {{Cl|AND (boolean)|AND}} {{Cl|&B}}10001111 ' Mask foreground color and blink bit + {{Cl|POKE}} addr&, oldCol {{Cl|OR}} ((col {{Cl|AND (boolean)|AND}} {{Cl|&B}}111) * {{Cl|&B}}10000) ' Apply background color + addr& = addr& + 2 {{Cl|NEXT}} -{{Cl|END SUB}} '' '' +{{Cl|END SUB}} {{CodeEnd}} @@ -103,4 +105,4 @@ addr& = (x1 - 1 + (y - 1) * {{Cl|_WIDTH (function)|_WIDTH}}) * 2 + 1 {{PageNavigation}} -< + diff --git a/internal/help/POS.txt b/internal/help/POS_111.txt similarity index 91% rename from internal/help/POS.txt rename to internal/help/POS_111.txt index 8ac5c8125..6c5ec7e09 100644 --- a/internal/help/POS.txt +++ b/internal/help/POS_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:43}} The '''POS''' function returns the current print cursor text column position. @@ -13,7 +15,7 @@ The '''POS''' function returns the current print cursor text column position. ''Example:'' Column positions after prints. -{{CodeStart}} '' '' +{{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}} {{Cl|POS}}(0) @@ -22,7 +24,7 @@ The '''POS''' function returns the current print cursor text column position. {{Cl|PRINT}} {{Cl|POS}}(0) {{Cl|PRINT}} 'start new row {{Cl|PRINT}} -{{Cl|PRINT}} {{Cl|POS}}(0) ' column position is 1 on next row '' '' +{{Cl|PRINT}} {{Cl|POS}}(0) ' column position is 1 on next row {{CodeEnd}} ''Note:'' Column tab prints may not always move 9 spaces past the center of the screen. Some may move text to next row. @@ -33,4 +35,4 @@ The '''POS''' function returns the current print cursor text column position. {{PageNavigation}} -< + diff --git a/internal/help/PRESET.txt b/internal/help/PRESET_111111.txt similarity index 93% rename from internal/help/PRESET.txt rename to internal/help/PRESET_111111.txt index b40d15cd5..6ef7f6ac3 100644 --- a/internal/help/PRESET.txt +++ b/internal/help/PRESET_111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:45}} The '''PRESET''' graphic [[SCREEN]] statement turns a pixel at a coordinate to the background color or a designated color attribute. @@ -21,17 +23,17 @@ The '''PRESET''' graphic [[SCREEN]] statement turns a pixel at a coordinate to t ''Example 1:'' Using PRESET to locate a [[DRAW]] statement that draws a box that is bright red. -{{CodeStart}} '' '' +{{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. ''Example 2:'' Displays the flags of countries that use simple horizontal or vertical color blocks with a highlighted arrow key menu. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DIM}} {{Cl|SHARED}} c$(21), x$(21), gg%(477) ARRAY @@ -87,15 +89,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}} @@ -140,4 +142,4 @@ c% = 1 {{PageNavigation}} -< + diff --git a/internal/help/PRINT_(file_statement).txt b/internal/help/PRINT_(file_statement)_11111_(0000_000000000).txt similarity index 93% rename from internal/help/PRINT_(file_statement).txt rename to internal/help/PRINT_(file_statement)_11111_(0000_000000000).txt index bc147ce2f..1a11481a8 100644 --- a/internal/help/PRINT_(file_statement).txt +++ b/internal/help/PRINT_(file_statement)_11111_(0000_000000000).txt @@ -1,12 +1,14 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:48}} The [[PRINT (file statement)|PRINT #]] statement prints numeric or string expressions to a sequential file, IO port or device. {{PageSyntax}} -::: '''PRINT #''fileNumber&''''', [ [{{Parameter|expression}}] [{;|,] ... ] +::: '''PRINT #''fileNumber&''''', [ [{{Parameter|expression}}] [{;|,] ... ] {{Parameters}} -* {{Parameter|fileNumber&}} is the file number of a file or device opened for writing. See {{KW|OPEN}}. +* {{Parameter|fileNumber&}} is the file number of a file or device opened for writing. See {{KW|OPEN}}. * {{Parameter|expression}} is a numeric or string expression to be written to the file. Quotes will be removed from strings. * The print statement can be followed by a [[semicolon]] to stop the print cursor or a [[comma]] to tab the next print. @@ -31,7 +33,7 @@ The [[PRINT (file statement)|PRINT #]] statement prints numeric or string expres ''Example:'' Prints data to a text file sequentially and reads it back to the program screen as one line of text. -{{CodeStart}} '' '' +{{CodeStart}} filename$ = "testfile.dat" x = 1: y = 2: z$ = "Three" @@ -54,10 +56,10 @@ K$ = {{Cl|INPUT$}}(1) 'press a key {{Cl|PRINT}} text$ {{Cl|WRITE}} text$ -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} : ''File content:'' [[PRINT (file statement)|PRINT]] string file values will not include the enclosing quotation marks but can be read by [[LINE INPUT (file statement)|LINE INPUT]] as text. -{{TextStart}} 1 2 Three'' '' {{TextEnd}} +{{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" @@ -74,4 +76,4 @@ K$ = {{Cl|INPUT$}}(1) 'press a key {{PageNavigation}} -< + diff --git a/internal/help/PRINT.txt b/internal/help/PRINT_11111.txt similarity index 99% rename from internal/help/PRINT.txt rename to internal/help/PRINT_11111.txt index 7ea5328c3..d23826c2f 100644 --- a/internal/help/PRINT.txt +++ b/internal/help/PRINT_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:46}} The {{KW|PRINT}} statement prints numeric or string expressions to the program screen. Typing shortcut '''?''' will convert to PRINT. @@ -85,4 +87,4 @@ Hello city! {{PageNavigation}} -< + diff --git a/internal/help/PRINT_USING_(file_statement).txt b/internal/help/PRINT_USING_(file_statement)_11111_11111_(0000_000000000).txt similarity index 97% rename from internal/help/PRINT_USING_(file_statement).txt rename to internal/help/PRINT_USING_(file_statement)_11111_11111_(0000_000000000).txt index 5ad3906c9..2611df5c8 100644 --- a/internal/help/PRINT_USING_(file_statement).txt +++ b/internal/help/PRINT_USING_(file_statement)_11111_11111_(0000_000000000).txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:51}} The '''PRINT #, USING''' statement is used to [[PRINT]] formatted text data to a file. @@ -33,4 +35,4 @@ The '''PRINT #, USING''' statement is used to [[PRINT]] formatted text data to a {{PageNavigation}} -< + diff --git a/internal/help/PRINT_USING.txt b/internal/help/PRINT_USING_11111_11111.txt similarity index 94% rename from internal/help/PRINT_USING.txt rename to internal/help/PRINT_USING_11111_11111.txt index 14ba2553f..2c7633805 100644 --- a/internal/help/PRINT_USING.txt +++ b/internal/help/PRINT_USING_11111_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:49}} The '''PRINT USING''' statement is used to [[PRINT]] formatted data to the Screen or a file using a [[STRING]] template. @@ -26,20 +28,20 @@ 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}} '' '' +{{CodeStart}} first$ = "Bobby": last$ = "Smith" boxes% = 1510: sales! = 4530 -tmp$ = "Salesperson: & & #####,. $$#####,.##" +tmp$ = "Salesperson: & & #####,. $$#####,.##" {{Cl|PRINT USING}} tmp$; first$; last$; boxes%; sales! -{{CodeEnd}} '' '' +{{CodeEnd}} {{OutputStart}}Salesperson: Bobby Smith 1,510 $4,530.00 {{OutputEnd}} ''Explanation:'' The ''Salesperson:'' text precedes the formatted data. The name lengths will change the length of the string template accordingly so columns will not all line up. If \ \ was used, the columns would stay the same, but parts of some names might be lost. If the box or sales values exceed 3 digits, a comma is used in the value every 3 digits. ''Example 2:'' How to display formatting symbols as normal text using underscores in a PRINT USING template. -{{CodeStart}} '' '' +{{CodeStart}} errcode = 35 {{Cl|PRINT USING}} "Error ## occurred!!"; errcode 'now there are the !! at the end of the printed string @@ -57,7 +59,7 @@ Error 35 occurred!! {{Cl|PRINT USING}} "##.##^^^^"; 234.56 {{Cl|PRINT USING}} ".####^^^^-"; -777777 {{Cl|PRINT USING}} "+.##^^^^"; 123 -{{Cl|PRINT USING}} "+.##^^^^^"; 123 '' '' +{{Cl|PRINT USING}} "+.##^^^^^"; 123 {{CodeEnd}} {{OutputStart}} 2.35E+02 .7778E+06- @@ -68,11 +70,11 @@ Error 35 occurred!! ''Example 4:'' USING does not necessarily have to immediately follow PRINT, but it must follow it in the code line. -{{CodeStart}} '' '' +{{CodeStart}} money = 12345.45 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. @@ -83,4 +85,4 @@ tmp$ = "$$#######,.##" {{PageNavigation}} -< + diff --git a/internal/help/PSET.txt b/internal/help/PSET_1111.txt similarity index 94% rename from internal/help/PSET.txt rename to internal/help/PSET_1111.txt index 95c2ffda5..621119871 100644 --- a/internal/help/PSET.txt +++ b/internal/help/PSET_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:52}} The '''PSET''' grahics [[SCREEN (statement)|SCREEN]] statement sets a pixel to a coordinate with a default or designated color attribute. @@ -20,16 +22,16 @@ The '''PSET''' grahics [[SCREEN (statement)|SCREEN]] statement sets a pixel to a ''Example:'' Using PSET to locate and color a [[DRAW]] statement. -{{CodeStart}} '' '' +{{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. ''Example 2:'' Magnifying a box portion of a Mandelbrot image with PSET -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DEFSTR}} A-Z {{Cl|DIM}} red(15) {{Cl|AS}} {{Cl|INTEGER}}, green(15) {{Cl|AS}} {{Cl|INTEGER}}, blue(15) {{Cl|AS}} {{Cl|INTEGER}} {{Cl|DIM}} i {{Cl|AS}} {{Cl|INTEGER}} @@ -37,7 +39,7 @@ SCREEN 12 {{Cl|FOR...NEXT|FOR}} i = 0 {{Cl|TO}} 15: {{Cl|READ}} red(i): {{Cl|NEXT}} {{Cl|FOR...NEXT|FOR}} i = 0 {{Cl|TO}} 15: {{Cl|READ}} green(i): {{Cl|NEXT}} {{Cl|FOR...NEXT|FOR}} i = 0 {{Cl|TO}} 15: {{Cl|READ}} blue(i): {{Cl|NEXT}} -{{Cl|FOR...NEXT|FOR}} i = 0 {{Cl|TO}} 15: {{Cl|PALETTE}} i, 65536 * blue(i) + 256& * green(i) + red(i): {{Cl|NEXT}} +{{Cl|FOR...NEXT|FOR}} i = 0 {{Cl|TO}} 15: {{Cl|PALETTE}} i, 65536 * blue(i) + 256& * green(i) + red(i): {{Cl|NEXT}} {{Cl|DATA}} 0,63,63,63,63,63,31, 0, 0,31,31,31,47,63,63,63 {{Cl|DATA}} 0, 0,15,31,47,63,63,63,63,31,15, 0, 0, 0, 0, 0 {{Cl|DATA}} 0, 0, 0, 0, 0, 0, 0, 0,31,63,63,63,63,63,42,21 @@ -72,7 +74,7 @@ DO {{Cl|FOR...NEXT|FOR}} xx = 0 {{Cl|TO}} 639 x = left + inc * xx z = mandel(x, y, limit) - {{Cl|IF...THEN|IF}} z < limit {{Cl|THEN}} {{Cl|PSET}} (xx, yy), 1 + z {{Cl|MOD}} 15 + {{Cl|IF...THEN|IF}} z < limit {{Cl|THEN}} {{Cl|PSET}} (xx, yy), 1 + z {{Cl|MOD}} 15 {{Cl|IF...THEN|IF}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) {{Cl|THEN}} {{Cl|SYSTEM}} {{Cl|NEXT}} {{Cl|NEXT}} @@ -93,7 +95,7 @@ DO {{Cl|SYSTEM}} {{Cl|CASE}} {{Cl|CHR$}}(0) + {{Cl|CHR$}}(72) dmag = dmag \ 2 - {{Cl|IF...THEN|IF}} dmag < 2 {{Cl|THEN}} dmag = 2 + {{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 @@ -103,7 +105,7 @@ DO {{Cl|LOOP}} a = a + inc * (mx - 319): b = b - inc * (my - 239) {{Cl|IF...THEN|IF}} (mz = 1) {{Cl|THEN}} mag = dmag * mag {{Cl|ELSE}} mag = mag / dmag - {{Cl|IF...THEN|IF}} (mag < 1) {{Cl|THEN}} mag = 1 + {{Cl|IF...THEN|IF}} (mag < 1) {{Cl|THEN}} mag = 1 {{Cl|LOOP}} {{Cl|FUNCTION}} mandel% (x {{Cl|AS}} {{Cl|DOUBLE}}, y {{Cl|AS}} {{Cl|DOUBLE}}, limit {{Cl|AS}} {{Cl|INTEGER}}) @@ -157,4 +159,4 @@ y={{Cl|_MOUSEY}} {{PageNavigation}} -< + diff --git a/internal/help/PUT_(TCP%2FIP_statement).txt b/internal/help/PUT_(TCP%2FIP_statement)_111_(111%2111_000000000).txt similarity index 88% rename from internal/help/PUT_(TCP%2FIP_statement).txt rename to internal/help/PUT_(TCP%2FIP_statement)_111_(111%2111_000000000).txt index 77ef1ccbd..60e90cb63 100644 --- a/internal/help/PUT_(TCP%2FIP_statement).txt +++ b/internal/help/PUT_(TCP%2FIP_statement)_111_(111%2111_000000000).txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:55}} The '''PUT #''' TCP/IP statement sends unformatted(raw) data to an open connection using a user's handle. @@ -10,11 +12,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> +
'''Communicating using unformatted/raw streamed data:'''
* 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> +
'''Your program MUST cater for these situations manually.'''
{{WhiteStart}}''Example: string variable b$'s length is adjusted to the number of bytes read.'' @@ -36,4 +38,4 @@ The '''PUT #''' TCP/IP statement sends unformatted(raw) data to an open connect {{PageNavigation}} -< + diff --git a/internal/help/PUT_(graphics_statement).txt b/internal/help/PUT_(graphics_statement)_111_(00000000_000000000).txt similarity index 90% rename from internal/help/PUT_(graphics_statement).txt rename to internal/help/PUT_(graphics_statement)_111_(00000000_000000000).txt index 4124abc67..9e6bebf80 100644 --- a/internal/help/PUT_(graphics_statement).txt +++ b/internal/help/PUT_(graphics_statement)_111_(00000000_000000000).txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:57}} The '''PUT''' graphics statement is used to place [[GET (graphics statement)|GET]] or [[BSAVE]] file images stored in the designated array. @@ -40,27 +42,27 @@ The '''PUT''' graphics statement is used to place [[GET (graphics statement)|GET ''Example 1:'' How [[GET]] and PUT can be used with images loaded with [[_LOADIMAGE]]. The background color is omitted or "masked". -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN (statement)|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, 256) {{Cl|_SCREENMOVE}} {{Cl|_SCREENMOVE|_MIDDLE}} -image& = {{Cl|_LOADIMAGE}}("QB64.png") +image& = {{Cl|_LOADIMAGE}}("QB64.png") -wide& = {{Cl|_WIDTH (function)|_WIDTH}}(image&): deep& = {{Cl|_HEIGHT}}(image&) -{{Cl|DIM}} Array(wide& * deep&) {{Cl|AS}} {{Cl|INTEGER}} +wide& = {{Cl|_WIDTH (function)|_WIDTH}}(image&): deep& = {{Cl|_HEIGHT}}(image&) +{{Cl|DIM}} Array(wide& * deep&) {{Cl|AS}} {{Cl|INTEGER}} -{{Cl|_SOURCE}} image& 'REQUIRED to GET the proper image area! -{{Cl|GET (graphics statement)|GET}} (0, 0)-(wide& - 1, deep& - 1), Array(0) +{{Cl|_SOURCE}} image& 'REQUIRED to GET the proper image area! +{{Cl|GET (graphics statement)|GET}} (0, 0)-(wide& - 1, deep& - 1), Array(0) {{Cl|_DEST}} 0 -{{Cl|_COPYPALETTE}} image&, 0 'necessary for custom image colors other than screen defaults +{{Cl|_COPYPALETTE}} image&, 0 'necessary for custom image colors other than screen defaults {{Cl|PUT (graphics statement)|PUT}}(10, 10), Array(0), {{Cl|PSET}} , {{Cl|_RGB}}(255, 255, 255) 'mask white background color -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} : ''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. -{{CodeStart}} '' '' +{{CodeStart}} a$ = {{Cl|SPACE$}}(4 + 100) '4 byte header + 100 pixels for a 10 X 10 image {{Cl|SCREEN}} 13 {{Cl|LINE}} (0, 0)-(319, 199), 4, BF 'color 4 = CHR$(4) = ♦ @@ -71,7 +73,7 @@ K$ = {{Cl|INPUT$}}(1) {{Cl|CLS}} {{Cl|PRINT}} a$ 'display string data. Width = {{Cl|CHR$}}(10 * 8) = "P" -{{Cl|PUT (graphics statement)|PUT}}(100, 100), a$, {{Cl|PSET}} '' '' +{{Cl|PUT (graphics statement)|PUT}}(100, 100), a$, {{Cl|PSET}} {{CodeEnd}} {{small|Code by Galleon}} : ''Explanation:'' The header holds the [[INTEGER]] width and depth of the image area as 2 bytes each. Screen 13 width is multiplied by 8. @@ -88,4 +90,4 @@ K$ = {{Cl|INPUT$}}(1) {{PageNavigation}} -< + diff --git a/internal/help/PUT.txt b/internal/help/PUT_111.txt similarity index 94% rename from internal/help/PUT.txt rename to internal/help/PUT_111.txt index 7881db08b..51a50bdba 100644 --- a/internal/help/PUT.txt +++ b/internal/help/PUT_111.txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:54}} The '''PUT #''' file or port statement writes data to a specific byte or record location. {{PageSyntax}} -:: '''PUT #''filenumber&'',''' [''position''][, {''holdingvariable''|''holdingarray()''}] +:: '''PUT #''filenumber&'',''' [''position''][, {''holdingvariable''|''holdingarray()''}] @@ -20,7 +22,7 @@ The '''PUT #''' file or port statement writes data to a specific byte or record ''Example 1:'' Using a [[TYPE]] record variable(Contact) to enter a new [[RANDOM]] record to a file. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|TYPE}} ContactType first {{Cl|AS}} {{Cl|STRING}} * 10 last {{Cl|AS}} {{Cl|STRING}} * 20 @@ -37,13 +39,13 @@ NumRecords% = {{Cl|LOF}}(1) \ {{Cl|LEN}}(Contact) {{Cl|PRINT}} NumRecords%; "previous records" {{Cl|PUT}} #1, NumRecords% + 1, Contact ' add a new record {{Cl|TYPE}} record value -{{Cl|CLOSE}} #1 '' '' +{{Cl|CLOSE}} #1 {{CodeEnd}} : ''Note:'' The DOT record variable values were created or changed before the PUT. The record length is 32 bytes. ''Example 2:'' Placing the contents of a numerical array into a [[BINARY]] file. You may want to put the array size at the beginning too. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DIM}} {{Cl|SHARED}} array(100) {{Cl|AS}} {{Cl|INTEGER}} {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 100 @@ -71,7 +73,7 @@ showme 'display array after transfer from file {{Cl|PRINT}} array(i); {{Cl|NEXT}} {{Cl|PRINT}} "done" -{{Cl|END SUB}} '' '' +{{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. @@ -89,4 +91,4 @@ showme 'display array after transfer from file {{PageNavigation}} -< + diff --git a/internal/help/Parenthesis.txt b/internal/help/Parenthesis_10000000000.txt similarity index 94% rename from internal/help/Parenthesis.txt rename to internal/help/Parenthesis_10000000000.txt index ff4bcba1a..003d5d78b 100644 --- a/internal/help/Parenthesis.txt +++ b/internal/help/Parenthesis_10000000000.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:24:44}} '''Parenthesis''' are used to enclose [[SUB]] and [[FUNCTION]] parameters or to set the operation order in [[Mathematical Operations]]. @@ -16,11 +18,11 @@ ''Example:'' Using too many brackets does not harm the code execution as long as they are paired up. -{{CodeStart}} '' '' +{{CodeStart}} nmb$ = {{Cl|STR$}}(100) nmb$ = {{Cl|LTRIM$}}((({{Cl|RTRIM$}}(nmb$)))) 'extra bracket pairs do not affect the code -{{Cl|PRINT}} nmb$ '' '' +{{Cl|PRINT}} nmb$ {{CodeEnd}} @@ -32,4 +34,4 @@ nmb$ = {{Cl|LTRIM$}}((({{Cl|RTRIM$}}(nmb$)))) 'extra bracket pairs do not affec {{PageNavigation}} -< + diff --git a/internal/help/QB64_FAQ.txt b/internal/help/QB64_FAQ_1164_111.txt similarity index 73% rename from internal/help/QB64_FAQ.txt rename to internal/help/QB64_FAQ_1164_111.txt index da2c17506..8ab074d54 100644 --- a/internal/help/QB64_FAQ.txt +++ b/internal/help/QB64_FAQ_1164_111.txt @@ -1,3 +1,6 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:13}} +__NOEDITSECTION__ {| align="center" |__TOC__ |} @@ -6,12 +9,12 @@ 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'''. Please note that it may take a short time to update this list. -<center>'''{{text|It's recommended to exclude (whitelist) "qb64.exe" (also the ''internal'' folder) from any real-time anti-virus scanning to prevent IDE Module Errors.|red}}'''</center> +
'''{{text|It's recommended to exclude (whitelist) "qb64.exe" (also the ''internal'' folder) from any real-time anti-virus scanning to prevent IDE Module Errors.|red}}'''
==Q: What is QB64?== -A: '''QB64''' is a BASIC compatible Editor and C++ emitter that creates working Executable files from Qbasic BAS files that can be run on 32 or 64 bit PC's using '''Windows''' (XP to 10), '''Linux''' or '''macOS'''. The goal is to be 100% compatible with QuickBasic 4.5 plus add hundreds of new abilities such as program icons and custom sized windows and a great retro Editor with builtin help. +A: '''QB64''' is a BASIC compatible Editor and C++ emitter that creates working Executable files from QBasic BAS files that can be run on 32 or 64 bit PC's using '''Windows''' (XP to 10), '''Linux''' or '''macOS'''. The goal is to be 100% compatible with QuickBASIC 4.5 plus add hundreds of new abilities such as program icons and custom sized windows and a great retro Editor with builtin help. The '''new keywords''' add some '''new features''' such as playing '''music or sound''' files and instant access to '''32 bit graphics''' file images. Also '''TCP/IP''' internet communication is available to '''download''' files, '''email''' messages over the web or play '''internet games'''. '''DLL Libraries''' can add more programming options and QB64 can access all of the new USB gaming '''controllers''' and '''printers'''. @@ -20,13 +23,13 @@ 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 more alive than ever with QB64!''' -<p style="text-align: center">[[Keywords currently not supported by QB64]]</p> +

[[Keywords currently not supported by QB64]]

==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> +
'''QB64 was created to run your old QBasic 4.5 (or less) programs on newer Operating Systems without any changes.'''
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. QB64 is not meant to run PDS (7.1) QBX code. Most GW Basic code will run with minor changes. @@ -34,7 +37,7 @@ QB64 is not meant to run PDS (7.1) QBX code. Most GW Basic code will run with mi The modern statements are designed to go along with the BASIC philosophy and expand QBasic into the future! -<center>'''QB64 FEATURES INCLUDE:'''</center> +
'''QB64 FEATURES INCLUDE:'''
{{TextStart}} 1) Full graphic functions for [[_NEWIMAGE|images]] up to 32 bit color. [[_ALPHA|Alpha]] transparency supported. @@ -56,13 +59,13 @@ The modern statements are designed to go along with the BASIC philosophy and exp 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> +

([[#toc|Return to FAQ topics]])

==Q: How do I install QB64 on Windows, Linux, macOS?== A: QB64 supports the following Operating Systems: -<center>'''Windows NT (XP), Windows Vista, Windows 7, 8 or 10:'''</center> +
'''Windows NT (XP), Windows Vista, Windows 7, 8 or 10:'''
:'''1)''' Download the appropriate package according to your system from [http://github.com/QB64Team/qb64/releases GitHub] :'''2)''' Unpack the contents to any location on your computer. Avoid unpacking to Program Files or other system folders that may require administrative privileges. QB64 needs to have full write permissions to its own folder. @@ -71,39 +74,39 @@ A: QB64 supports the following Operating Systems: ---- -<center>'''Most distributions of Linux, both 32 and 64 bit'''</center> +
'''Most distributions of Linux, both 32 and 64 bit'''
:'''1)''' Download the appropriate package according to your system from [http://github.com/QB64Team/qb64/releases GitHub] :'''2)''' After extracting the downloaded package, run the installation batch/script called ''./setup_lnx.sh'' in the main ''qb64'' folder to setup QB64. :'''3)''' Most dependencies should be automatically downloaded by the setup script, but these are the ones you should look for if compilation fails: OpenGL developement libraries, ALSA development libraries, GNU C++ Compiler (g++) -<center>Executable programs are portable between like systems by copying the executable file.</center> -<center>'''Note: Some QB64 keywords and procedures are not available for Linux.'''</center> +
Executable programs are portable between like systems by copying the executable file.
+
'''Note: Some QB64 keywords and procedures are not available for Linux.'''
-<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +

([[#toc|Return to FAQ topics]])

---- -<center>'''macOS'''</center> +
'''macOS'''
:'''1)''' You must install Apple's '''Xcode command line tools''' for C++ compilation from their website. The simplest way to do so is opening a terminal window and typing the following command: '''xcode-select --install''' (more info here: [http://developer.apple.com/technologies/tools/xcode.html Xcode download]) :Β Β Β Β (you won't be using the Xcode interface, QB64 just needs to have access to the C++ compiler and libraries it installs) :'''3)''' Download the appropriate package according to your system from [http://github.com/QB64Team/qb64/releases GitHub] :Β Β Β Β Extract the downloaded package and run ''./setup_osx.command'', found within the QB64 folder to install the QB64 compiler. -<center>'''After installation you should run '''./qb64''' or '''./qb64_start_osx.command''' to run qb64.'''</center> +
'''After installation you should run '''./qb64''' or '''./qb64_start_osx.command''' to run qb64.'''
:*Executable programs are portable between macOS systems by copying the executable file. :*To help launch executables without a console, a file called ''programname_start.command'' is created along with the program. -<center>'''Note: Some QB64 keywords and procedures are not available for macOS.'''</center> +
'''Note: Some QB64 keywords and procedures are not available for macOS.'''
-<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> +
[[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Keywords Not Supported in Linux or MAC OSX versions]]
---- -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +

([[#toc|Return to FAQ topics]])

==Q: Why won't QB64 work on my computer?== @@ -114,11 +117,11 @@ QB64 currently supports Windows versions from XP to the latest version. Most Lin :'''QB64 does not change any settings on your machine. All required files are in the QB64 folder.''' -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +

([[#toc|Return to FAQ topics]])

==Q: Are there any known incompatibilities?== -A: There are some things that QB64 cannot do, like direct hardware access, which makes older more advanced programs that make use of [[ABSOLUTE]], [[INTERRUPT]], [[PEEK]], [[POKE]] and [[OUT]] not work properly. Although some older functionality is emulated, if your program doesn't use such 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). You can expect the most common addresses for interrupts, etc. to be functioning. +A: There are some things that QB64 cannot do, like direct hardware access, which makes older more advanced programs that make use of [[CALL ABSOLUTE|ABSOLUTE]], [[INTERRUPT]], [[PEEK]], [[POKE]] and [[OUT]] not work properly. Although some older functionality is emulated, if your program doesn't use such 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). You can expect the most common addresses for interrupts, etc. to be functioning. See: [[Keywords currently not supported by QB64]] @@ -137,7 +140,7 @@ You should be careful with '''CPU usage'''. QB64 is a lot faster than QBasic was 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. -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +

([[#toc|Return to FAQ topics]])

==Q: How do I update the information in QB64's help system?== @@ -151,10 +154,10 @@ A: If the libraries are pure QB 4.5 code then yes, otherwise no. QLB files are n [[DECLARE LIBRARY]] allows 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> +
[[C Libraries]], [[DLL Libraries]], [[Windows Libraries]]
-<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +

([[#toc|Return to FAQ topics]])

==Q: I can't get my QB 4.5 source code to work in QB64! Why?== @@ -162,25 +165,44 @@ A: QB64 is 99% compatible with QB4.5 programs. The commands that haven't been im See: [[Keywords currently not supported by QB64]] -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +

([[#toc|Return to FAQ topics]])

==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 files are required to be with your program's EXE file. -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +

([[#toc|Return to FAQ topics]])

-==Q: Is there a way to use the compiler without running my program or using the IDE?== +==Q: Is there a way to use QB64 from the command line?== -A: Yes! No other program files besides the BAS file are required. Use the following command to compile a program without running it: +A: Yes! Just type QB64 -? at the command prompt to see a list of available options. -*'''QB64 -c yourfile.BAS''' -*'''QB64 -x yourfile.BAS''' ''(compiles using the console only)'' -*'''QB64 -c yourfile.BAS -o destination_path\destination executable_name.exe''' ''(compiles the .BAS file and outputs the executable to a separate folder)'' +;Note:The '''-c''' and '''-x''' option do just compile a program without running it. +:The '''-z''' option does not even create an executable file, it performs the first compile pass only (syntax checking and generate C code). +{{FixedStart}} +Usage: qb64 [switches] -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +Options: + Source file to load + -c Compile instead of edit + -o Write output executable to + -x Compile instead of edit and output the result to the + console + -w Show warnings + -q Quiet mode (does not inhibit warnings or errors) + -m Do not colorize compiler output (monochrome mode) + -e Enable OPTION _EXPLICIT, making variable declaration + mandatory (per-compilation; doesn't affect the + source file or global settings) + -s[:switch=true/false] View/edit compiler settings + -l: Start the IDE at the specified line number + -p Purge all pre-compiled content first + -z Generate C code without compiling to executable +{{FixedEnd}} + +

([[#toc|Return to FAQ topics]])

==Q: How do I link modules or include SUB procedures in QB64?== @@ -192,7 +214,7 @@ After the EXE is compiled, you do not have to even use the added code anymore. T See: [[$INCLUDE]] -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +

([[#toc|Return to FAQ topics]])

==Q: Some screens look small. Can I enlarge them or make them fullscreen?== @@ -206,7 +228,7 @@ See: [[$INCLUDE]] *[[_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> +

([[#toc|Return to FAQ topics]])

==Q: Can I have background music as well as [[SOUND]], [[PLAY]] and [[BEEP]]?== @@ -233,7 +255,7 @@ Capabilities include: :[[_SNDRAW]] (statement), [[_SNDSTOP]] (statement), [[_SNDVOL]] (statement) -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +

([[#toc|Return to FAQ topics]])

==Q: If QB64 creates Basic programs why is there no Immediate Window?== @@ -243,7 +265,7 @@ A: Because there is no '''QB64''' interpreter. All C code has to be compiled bef '''QB64''' uses the Immediate window area to suggest syntax for keyword entries and give the compiler status when compiling. -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +

([[#toc|Return to FAQ topics]])

==Q: Does it work on Windows 98 or any OS older than Windows 2000?== @@ -261,7 +283,7 @@ 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. -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +

([[#toc|Return to FAQ topics]])

==Q: Do you provide changelogs?== @@ -270,7 +292,7 @@ We do. *For all recent changelogs, check at [http://github.com/QB64Team/qb64/blob/development/CHANGELOG.md GitHub] -<p style="text-align: center">([[#toc|Return to FAQ topics]])</p> +

([[#toc|Return to FAQ topics]])

==Q: Where I can view the C++ code before it gets compiled?== @@ -278,4 +300,4 @@ Look in the QB64 '''internal\temp''' folder for '''main.txt''' to get the C code {{PageNavigation}} -< + diff --git a/internal/help/QB64_Help_Menu.txt b/internal/help/QB64_Help_Menu.txt deleted file mode 100644 index d68bfc576..000000000 --- a/internal/help/QB64_Help_Menu.txt +++ /dev/null @@ -1,7 +0,0 @@ -* [[Keyword Reference - Alphabetical]] -* [[Keyword Reference - By usage]] -* [[QB64 FAQ|Frequently asked questions about QB64]] - -* [https://qb64phoenix.com/forum/index.php QB64 Phoenix Edition Forum] -* [https://discord.com/invite/2t9HTYK Discord invitation] -< diff --git a/internal/help/QB64_Help_Menu_1164_1000_1000.txt b/internal/help/QB64_Help_Menu_1164_1000_1000.txt new file mode 100644 index 000000000..492412f67 --- /dev/null +++ b/internal/help/QB64_Help_Menu_1164_1000_1000.txt @@ -0,0 +1,15 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:14}} +__NOEDITSECTION__ +This is QB64's built-in help system. It's data is based on the QB64 Wiki. In fact, the pages in this build-in help are downloaded copies of the online Wiki and are displayed here in a '''simplified''' form. It should be obvious, that we can't reproduce the detailed output of a full fledged web browser here, especially tables are a bit too complex to handle it here. However, you can click the cyan colored '''View on Wiki''' button at any time to open the original online Wiki page in your standard browser. + +;Note:As the QB64 Wiki is a vital resource maintained by our community, it might be a good idea to periodically use the '''Update All Pages...''' command from the '''Help''' menu to fetch the latest changes done in the online Wiki. + +* [[Keyword Reference - Alphabetical]] +* [[Keyword Reference - By usage]] +* [[QB64 FAQ|Frequently asked questions about QB64]] + +* [https://qb64phoenix.com/forum/index.php QB64 Phoenix Edition Forum] +* [https://qb64phoenix.com/qb64wiki/index.php QB64 Phoenix Edition Wiki] '''(source of this help)''' +* [https://discord.gg/D2M7hepTSx QB64 Discord invitation] + diff --git a/internal/help/Question_mark.txt b/internal/help/Question_mark_10000000_0000.txt similarity index 92% rename from internal/help/Question_mark.txt rename to internal/help/Question_mark_10000000_0000.txt index b75576cba..861035a73 100644 --- a/internal/help/Question_mark.txt +++ b/internal/help/Question_mark_10000000_0000.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:24:39}} A '''question mark''' can be used as a substitute shortcut to typing PRINT when creating code. @@ -20,4 +22,4 @@ A '''question mark''' can be used as a substitute shortcut to typing PRINT when {{PageNavigation}} -< + diff --git a/internal/help/Quotation_mark.txt b/internal/help/Quotation_mark_100000000_0000.txt similarity index 96% rename from internal/help/Quotation_mark.txt rename to internal/help/Quotation_mark_100000000_0000.txt index b1fd5573b..84d172eb8 100644 --- a/internal/help/Quotation_mark.txt +++ b/internal/help/Quotation_mark_100000000_0000.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:24:38}} A '''quotation mark''' delimits the start and end of a literal [[STRING]] value. @@ -22,4 +24,4 @@ A '''quotation mark''' delimits the start and end of a literal [[STRING]] value. {{PageNavigation}} -< + diff --git a/internal/help/RANDOMIZE.txt b/internal/help/RANDOMIZE_111111111.txt similarity index 98% rename from internal/help/RANDOMIZE.txt rename to internal/help/RANDOMIZE_111111111.txt index 6632f91ea..54f447dbc 100644 --- a/internal/help/RANDOMIZE.txt +++ b/internal/help/RANDOMIZE_111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:01}} '''RANDOMIZE''' is used with a seed value to generate different random number sequences using the [[RND]] function. @@ -22,7 +24,7 @@ randnum% = INT({{Cl|RND}} * 11) + 2 'add one to multiplier as INT rounds down a PRINT randnum% K$ = {{Cl|INPUT$}}(1) {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|UCASE$}}(K$) = "Q" 'q = quit -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} :''Explanation:'' Procedure generates random integer values from 2 to 12 like a pair of dice. @@ -43,7 +45,7 @@ Print7 {{Cl|PRINT}} {{Cl|RND}}; {{Cl|NEXT}} {{Cl|PRINT}}: {{Cl|PRINT}} -{{Cl|END SUB}} '' '' +{{Cl|END SUB}} {{CodeEnd}} : ''Explanation:'' The second RANDOMIZE statement just continues the sequence where USING in the third restarts the sequence. @@ -102,4 +104,4 @@ DO {{PageNavigation}} -< + diff --git a/internal/help/RANDOM.txt b/internal/help/RANDOM_111111.txt similarity index 97% rename from internal/help/RANDOM.txt rename to internal/help/RANDOM_111111.txt index 0eccedb41..32cc6c493 100644 --- a/internal/help/RANDOM.txt +++ b/internal/help/RANDOM_111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:15:58}} '''RANDOM''' is used in an [[OPEN]] statement to read([[GET]]) from or write([[PUT]]) to a file. @@ -23,7 +25,7 @@ ''Example 1:'' Function that finds a RANDOM file's record number for a string value such as a phone number. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|TYPE}} customer age {{Cl|AS}} {{Cl|INTEGER}} phone {{Cl|AS}} {{Cl|STRING}} * 10 @@ -63,13 +65,13 @@ dat$ = {{Cl|INPUT$}}(FL, f) {{Cl|CLOSE}} f recpos = {{Cl|INSTR}}(dat$, search$) {{Cl|IF...THEN|IF}} recpos {{Cl|THEN}} RecordPos = recpos \ recLEN + 1 {{Cl|ELSE}} RecordPos = 0 -{{Cl|END FUNCTION}} '' '' +{{Cl|END FUNCTION}} {{CodeEnd}} :''Note:'' Random files can store records holding various variable types using a [[TYPE]] definition or a [[FIELD]] statement. ''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}} '' '' +{{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 @@ -87,7 +89,7 @@ c$ = "1234" {{Cl|PRINT}} a$, {{Cl|LEN}}(a$) {{Cl|NEXT}} -{{Cl|CLOSE}} '' '' +{{Cl|CLOSE}} {{CodeEnd}} {{OutputStart}}☺ ABCDEFGHI 11 ABCDEFGHI 9 @@ -103,4 +105,4 @@ ABCDEFGHI 9 {{PageNavigation}} -< + diff --git a/internal/help/READ.txt b/internal/help/READ_1111.txt similarity index 90% rename from internal/help/READ.txt rename to internal/help/READ_1111.txt index b1998411d..9aeb45963 100644 --- a/internal/help/READ.txt +++ b/internal/help/READ_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:02}} The '''READ''' statement reads values from a [[DATA]] field and assigns them to one or a comma separated list of variables. @@ -17,7 +19,7 @@ The '''READ''' statement reads values from a [[DATA]] field and assigns them to * Use the [[RESTORE]] statement to reread DATA statements from the start, with or without a line label as required. * [[ACCESS]] READ can be used in an [[OPEN]] statement to limit file access to read only, preserving file data. * '''WARNING! Do not place DATA fields after [[SUB]] or [[FUNCTION]] procedures! QB64 will FAIL to compile properly!''' -: Qbasic allowed programmers to add DATA fields anywhere because the IDE separated the main code from other procedures. +: QBasic allowed programmers to add DATA fields anywhere because the IDE separated the main code from other procedures. ''Example 1:'' Placing data into an array. @@ -32,7 +34,7 @@ The '''READ''' statement reads values from a [[DATA]] field and assigns them to {{Cl|END}} {{Cl|DATA}} 3.08, 5.19, 3.12, 3.98, 4.24 -{{Cl|DATA}} 5.08, 5.55, 4.00, 3.16, 3.37 '' '' +{{Cl|DATA}} 5.08, 5.55, 4.00, 3.16, 3.37 {{CodeEnd}} {{OutputStart}} 3.08 5.19 3.12 3.98 4.24 5.08 5.55 4 3.16 3.37 @@ -44,17 +46,17 @@ The '''READ''' statement reads values from a [[DATA]] field and assigns them to {{CodeStart}} PRINT " CITY ", " STATE ", " ZIP" PRINT {{Cl|STRING$}}(30, "-") 'divider - {{Cl|READ}} C$, S$, Z& - PRINT C$, S$, Z& + {{Cl|READ}} C$, S$, Z& + PRINT C$, S$, Z& - {{Cl|DATA}} "DENVER,", COLORADO, 80211 '' '' + {{Cl|DATA}} "DENVER,", COLORADO, 80211 {{CodeEnd}} {{OutputStart}} CITY STATE ZIP ------------------------------ DENVER, COLORADO 80211 {{OutputEnd}} -:''Note:'' String DATA values do not require quotes unless they contain commas, end spaces or Qbasic keywords. +:''Note:'' String DATA values do not require quotes unless they contain commas, end spaces or QBasic keywords. @@ -65,4 +67,4 @@ The '''READ''' statement reads values from a [[DATA]] field and assigns them to {{PageNavigation}} -< + diff --git a/internal/help/REDIM.txt b/internal/help/REDIM_11111.txt similarity index 93% rename from internal/help/REDIM.txt rename to internal/help/REDIM_11111.txt index 6cccbbdd6..e69381e7e 100644 --- a/internal/help/REDIM.txt +++ b/internal/help/REDIM_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:04}} A {{KW|REDIM}} statement can re-dimension one [[$DYNAMIC|dynamic]](flexible) [[Arrays|array]] or a [[comma]] separated list of arrays. @@ -18,12 +20,12 @@ A {{KW|REDIM}} statement can re-dimension one [[$DYNAMIC|dynamic]](flexible) [[A * '''REDIM [[_PRESERVE]] cannot change the number of array dimensions or type!''' * [[$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!''' +* '''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!''' ''Example 1:'' The [[$DYNAMIC]] Metacommand allows an array to be re-sized using [[DIM]] and REDIM. -{{CodeStart}} '' '' +{{CodeStart}} '{{Cl|$DYNAMIC}} {{Cl|INPUT}} "Enter array size: ", size @@ -31,12 +33,12 @@ A {{KW|REDIM}} statement can re-dimension one [[$DYNAMIC|dynamic]](flexible) [[A {{Cl|REDIM}} Array(2 * size) -{{Cl|PRINT}} {{Cl|UBOUND}}(Array) '' '' +{{Cl|PRINT}} {{Cl|UBOUND}}(Array) {{CodeEnd}} ''Example 2:'' Shows the difference between REDIM and REDIM [[_PRESERVE]]. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|REDIM}} array(20) array(10) = 24 @@ -46,7 +48,7 @@ array(10) = 24 {{Cl|PRINT}} array(10) {{Cl|REDIM}} array(15) -{{Cl|PRINT}} array(10) '' '' +{{Cl|PRINT}} array(10) {{CodeEnd}} {{OutputStart}} 24 @@ -64,4 +66,4 @@ array(10) = 24 {{PageNavigation}} -< + diff --git a/internal/help/REM.txt b/internal/help/REM_111.txt similarity index 80% rename from internal/help/REM.txt rename to internal/help/REM_111.txt index c0afd2dca..53011276f 100644 --- a/internal/help/REM.txt +++ b/internal/help/REM_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:05}} '''REM''' or an apostrophe is used for programmer remarks, comments or to stop the execution of program code. @@ -6,19 +8,19 @@ {{PageDescription}} -* Comments cannot be read by Qbasic correctly and may cause syntax and other errors without REM! +* Comments cannot be read by QBasic correctly and may cause syntax and other errors without REM! * Instead of REM you can use the {{KW|REM|'}} symbol which can be put anywhere. * Code can also be commented out for program testing purposes. -* Qbasic Metacommands such as {{KW|$DYNAMIC}} and {{KW|$INCLUDE}} require the use of REM or the apostrophe. +* QBasic Metacommands such as {{KW|$DYNAMIC}} and {{KW|$INCLUDE}} require the use of REM or the apostrophe. ''Example:'' Avoiding an END IF error. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|REM}} This is a remark... ' This is also a remark... {{Cl|IF...THEN|IF}} a = 0 {{Cl|THEN}} {{Cl|REM}} (REM follows syntax rules) {{Cl|IF...THEN|IF}} a = 0 {{Cl|THEN}} '(apostrophe doesn't follow syntax rules, so use END IF after this) -{{Cl|END IF}} '' '' +{{Cl|END IF}} {{CodeEnd}} @@ -28,4 +30,4 @@ {{PageNavigation}} -< + diff --git a/internal/help/RESET.txt b/internal/help/RESET_11111.txt similarity index 91% rename from internal/help/RESET.txt rename to internal/help/RESET_11111.txt index fe3f02589..10a2c76ac 100644 --- a/internal/help/RESET.txt +++ b/internal/help/RESET_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:06}} The '''RESET''' statement closes all files and writes the directory information to a diskette before it is removed from a disk drive. @@ -15,4 +17,4 @@ The '''RESET''' statement closes all files and writes the directory information {{PageNavigation}} -< + diff --git a/internal/help/RESTORE.txt b/internal/help/RESTORE_1111111.txt similarity index 93% rename from internal/help/RESTORE.txt rename to internal/help/RESTORE_1111111.txt index 71df480e4..caa06ba2c 100644 --- a/internal/help/RESTORE.txt +++ b/internal/help/RESTORE_1111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:08}} The '''RESTORE''' statement is used to reset the DATA pointer to the beginning of the data. @@ -12,7 +14,7 @@ The '''RESTORE''' statement is used to reset the DATA pointer to the beginning o * Use RESTORE to avoid an [[ERROR Codes|"Out of Data" error]] when reading a data field! * See the [[DATA]] statement for [[STRING]] data value specifications. * '''Do not place [[DATA]] fields after [[SUB]] or [[FUNCTION]] procedures! QB64 will FAIL to [[RESTORE]] properly!''' -: Qbasic allowed programmers to add DATA fields anywhere because the IDE separated the main code from other procedures. +: QBasic allowed programmers to add DATA fields anywhere because the IDE separated the main code from other procedures. ''Example:'' Restoring a labeled DATA field to avoid going past the end of DATA. @@ -25,7 +27,7 @@ DO {{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 +LOOP UNTIL monthnum% < 1 OR monthnum% > 12 Months: {{Cl|DATA}} January, 31, February, 28, March, 31, April, 30, May, 31, June, 30 @@ -35,7 +37,7 @@ LOOP UNTIL monthnum% < 1 OR monthnum% > 12 Enter a month number(1 to 12): 6 The month June has 30 days. {{OutputEnd}} -:''Note:'' String DATA values do not require quotes unless they have commas, end spaces or Qbasic keywords in them. +:''Note:'' String DATA values do not require quotes unless they have commas, end spaces or QBasic keywords in them. @@ -87,4 +89,4 @@ entry3 {{PageNavigation}} -< + diff --git a/internal/help/RESUME.txt b/internal/help/RESUME_111111.txt similarity index 94% rename from internal/help/RESUME.txt rename to internal/help/RESUME_111111.txt index a5bdecd26..4e16a1f1a 100644 --- a/internal/help/RESUME.txt +++ b/internal/help/RESUME_111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:09}} The '''RESUME''' statement is used with '''NEXT''' or a line number or label in an error handling routine. @@ -19,4 +21,4 @@ The '''RESUME''' statement is used with '''NEXT''' or a line number or label in {{PageNavigation}} -< + diff --git a/internal/help/RETURN.txt b/internal/help/RETURN_111111.txt similarity index 96% rename from internal/help/RETURN.txt rename to internal/help/RETURN_111111.txt index 89ae6df10..3b1abe6f2 100644 --- a/internal/help/RETURN.txt +++ b/internal/help/RETURN_111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:10}} '''RETURN''' is used in [[GOSUB]] procedures to return to the original call code line or a specified line label. @@ -29,7 +31,7 @@ five: {{Cl|PRINT}} "Aha! Five!" -{{Cl|RETURN}} '' '' +{{Cl|RETURN}} {{CodeEnd}} {{OutputStart}} 1 @@ -71,4 +73,4 @@ it went here. {{PageNavigation}} -< + diff --git a/internal/help/RIGHT$.txt b/internal/help/RIGHT$_11111$.txt similarity index 77% rename from internal/help/RIGHT$.txt rename to internal/help/RIGHT$_11111$.txt index b9dc91610..33d166627 100644 --- a/internal/help/RIGHT$.txt +++ b/internal/help/RIGHT$_11111$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:11}} The '''RIGHT$''' function returns a set number of characters in a [[STRING]] variable starting from the end and counting backwards. @@ -18,18 +20,18 @@ 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}} '' '' +{{CodeStart}} name$ = "Tom Williams" Last$ = {{Cl|RIGHT$}}(name$, {{Cl|LEN}}(name$) - {{Cl|INSTR}}(name$, " ")) 'subtract space position from string length -{{Cl|PRINT}} Last$ '' '' +{{Cl|PRINT}} Last$ {{CodeEnd}} {{OutputStart}}Williams {{OutputEnd}} ''Example 2:'' Adding the leading zero in single digit [[HEX$]] values using RIGHT to take the right two hexadecimal string digits. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, 32) '32 bit screen modes ONLY! red = 255 green = 0 @@ -39,15 +41,15 @@ Color32 red, green, blue {{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) +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) {{Cl|PRINT}} hexadecimal$ {{Cl|COLOR}} {{Cl|VAL}}(hexadecimal$) -{{Cl|END SUB}} '' '' +{{Cl|END SUB}} {{CodeEnd}} -{{OutputStart}}'''{{text|&HFFFF0080|white}}''' +{{OutputStart}}'''{{text|&HFFFF0080|white}}''' '''{{text|Colored text|#FF0080}}'''{{OutputEnd}} -: ''Note:'' When a single hexadecimal digit is returned the resulting value will need the leading zero added. Otherwise the hexa- decimal value created will have a byte missing from the value. EX: Color &HFF000000 is valid while &HFF000 is not. +: ''Note:'' When a single hexadecimal digit is returned the resulting value will need the leading zero added. Otherwise the hexa- decimal value created will have a byte missing from the value. EX: Color &HFF000000 is valid while &HFF000 is not. ''See also:'' @@ -57,4 +59,4 @@ hexadecimal$ = "{{Cl|&H}}FF" + {{Cl|RIGHT$}}("0" + {{Cl|HEX$}}(R), 2) + {{Cl {{PageNavigation}} -< + diff --git a/internal/help/RMDIR.txt b/internal/help/RMDIR_11111.txt similarity index 97% rename from internal/help/RMDIR.txt rename to internal/help/RMDIR_11111.txt index a06b0ce2b..29df2d5de 100644 --- a/internal/help/RMDIR.txt +++ b/internal/help/RMDIR_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:13}} The {{KW|RMDIR}} statement deletes an empty directory using a designated path relative to the present path location. @@ -61,4 +63,4 @@ C:\temp is not empty! {{PageNavigation}} -< + diff --git a/internal/help/RND.txt b/internal/help/RND_111.txt similarity index 93% rename from internal/help/RND.txt rename to internal/help/RND_111.txt index a2d446b67..3359dad30 100644 --- a/internal/help/RND.txt +++ b/internal/help/RND_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:14}} The '''RND''' function returns a random number with a value between 0 (inclusive) and 1 (exclusive). @@ -9,7 +11,7 @@ The '''RND''' function returns a random number with a value between 0 (inclusive * ''n'' is a [[SINGLE]] numeric value that defines the behavior of the RND function but is '''NOT normally required''': ::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: Always returns the same value for any given n ::n > 0: the sequence of numbers generated will not change unless [[RANDOMIZE]] is initiated. @@ -28,12 +30,12 @@ The '''RND''' function returns a random number with a value between 0 (inclusive ''Example 1:'' Generating a random integer value between 1 and 6 (inclusive) using INT. {{CodeStart}} -dice% = {{Cl|INT}}({{Cl|RND}} * 6) + 1 '' '' 'add one as INT value never reaches 6 +dice% = {{Cl|INT}}({{Cl|RND}} * 6) + 1 'add one as INT value never reaches 6 {{CodeEnd}} ''Example 2:'' Using uniform random numbers to create random numbers with a gaussian distribution ([http://en.wikipedia.org/wiki/Marsaglia_polar_method| Marsaglia's polar method]). -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DO}} u! = {{Cl|RND}} * 2 - 1 v! = {{Cl|RND}} * 2 - 1 @@ -41,13 +43,13 @@ dice% = {{Cl|INT}}({{Cl|RND}} * 6) + 1 '' '' 'add one as INT value never reaches {{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! '' '' +v! = v! * s! {{CodeEnd}} :''Explanation:'' Values ''u!'' and ''v!'' are now two independent random numbers with gaussian distribution, centered at 0. ''Example 3:'' Random flashes from an explosion -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, 32) {{Cl|RANDOMIZE}} {{Cl|TIMER}} BC = 120 ' BALL COUNT @@ -96,7 +98,7 @@ DO {{Cl|NEXT}} J -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" '' '' +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" {{CodeEnd}} {{small|Code by Falcon}} @@ -106,4 +108,4 @@ DO {{PageNavigation}} -< + diff --git a/internal/help/RSET.txt b/internal/help/RSET_1111.txt similarity index 94% rename from internal/help/RSET.txt rename to internal/help/RSET_1111.txt index 36d847e72..c2c43ff74 100644 --- a/internal/help/RSET.txt +++ b/internal/help/RSET_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:15}} The '''RSET''' statement right-justifies a string according to length of the string expression. @@ -12,7 +14,7 @@ The '''RSET''' statement right-justifies a string according to length of the str ''Example:'' -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|CLS}} {{Cl|DIM}} thestring {{Cl|AS}} {{Cl|STRING}} * 10 {{Cl|PRINT}} "12345678901234567890" @@ -22,7 +24,7 @@ anystring$ = {{Cl|SPACE$}}(20) {{Cl|RSET}} anystring$ = "Hello again!" {{Cl|PRINT}} anystring$ {{Cl|RSET}} thestring = "Over ten characters long" -{{Cl|PRINT}} thestring '' '' +{{Cl|PRINT}} thestring {{CodeEnd}} {{OutputStart}} 12345678901234567890 @@ -41,4 +43,4 @@ Over ten c {{PageNavigation}} -< + diff --git a/internal/help/RTRIM$.txt b/internal/help/RTRIM$_11111$.txt similarity index 95% rename from internal/help/RTRIM$.txt rename to internal/help/RTRIM$_11111$.txt index dbf255fc7..947ecb95b 100644 --- a/internal/help/RTRIM$.txt +++ b/internal/help/RTRIM$_11111$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:17}} The {{KW|RTRIM$}} function removes trailing space characters from a {{KW|STRING}} value. @@ -36,4 +38,4 @@ Tommy {{PageNavigation}} -< + diff --git a/internal/help/RUN.txt b/internal/help/RUN_111.txt similarity index 96% rename from internal/help/RUN.txt rename to internal/help/RUN_111.txt index b1bd5bb20..86fa2953f 100644 --- a/internal/help/RUN.txt +++ b/internal/help/RUN_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:18}} '''RUN''' is a control flow statement that clears and restarts the program currently in memory or executes another specified program. The multi-modular technique goes back to when QBasic and QuickBASIC had module size constraints. In QB64 it has been implemented so that that older code can still be compiled, though '''it is advisable to use single modules for a single project (not counting [[$INCLUDE]] libraries), for ease of sharing and also because the module size constraints no longer exist.''' @@ -11,7 +13,7 @@ The multi-modular technique goes back to when QBasic and QuickBASIC had module s {{Parameters}} * ''line number'' specifies a line number in the main module code. * An optional ''filespec'' specifies a program to load into memory and run. -: * BAS or EXE extensions are assumed to be the same as the calling module's extension, EXE or BAS (Qbasic only). +: * BAS or EXE extensions are assumed to be the same as the calling module's extension, EXE or BAS (QBasic only). : * ''file names specs'' with other extensions must use the full filename. No extension requires a dot. * In '''QB64''' ''command line parameters'' can follow the program file name and be read using the [[COMMAND$]] function later. @@ -27,7 +29,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}} '' '' +{{CodeStart}} PRINT " A", " B", " C", " D" 10 A = 1 20 B = 2 @@ -41,7 +43,7 @@ PRINT " A", " B", " C", " D" 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 -'' '' + {{CodeEnd}} {{OutputStart}}A B C D 1 2 3 4 @@ -60,4 +62,4 @@ Do you want to quit?(Y/N)_ {{PageNavigation}} -< + diff --git a/internal/help/SADD.txt b/internal/help/SADD_1111.txt similarity index 92% rename from internal/help/SADD.txt rename to internal/help/SADD_1111.txt index 5a8cca2a8..44b38bf38 100644 --- a/internal/help/SADD.txt +++ b/internal/help/SADD_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:19}} The '''SADD''' function returns the address of a [[STRING]] variable as an offset from the current data segment. @@ -15,4 +17,4 @@ The '''SADD''' function returns the address of a [[STRING]] variable as an offse {{PageNavigation}} -< + diff --git a/internal/help/SCREEN_(function).txt b/internal/help/SCREEN_(function)_111111_(00000000).txt similarity index 90% rename from internal/help/SCREEN_(function).txt rename to internal/help/SCREEN_(function)_111111_(00000000).txt index 06ddd62c5..290bfd724 100644 --- a/internal/help/SCREEN_(function).txt +++ b/internal/help/SCREEN_(function)_111111_(00000000).txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:20}} The '''SCREEN''' function returns the [[ASCII]] code of a text character or the color attribute at a set text location on the screen. @@ -15,20 +17,20 @@ 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}}''' -* '''QB64''' can return color values in screen modes other than [[SCREEN]] 0. Qbasic returned the wrong color values in graphic screen modes! +:: * The foreground color(0 to 15) is the returned SCREEN color value AND 15: '''{{text|FG = SCREEN(1, 1, 1) AND 15|green}}''' +:: * The background color(0 to 7) is the returned SCREEN color value \ 16: '''{{text|BG = 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! ''Example 1:'' Finding the text foreground and background colors in SCREEN 0 only: -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 0 {{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}} "BG color:"; {{Cl|SCREEN (function)|SCREEN}}(1, 1, 1) \ 16 'high nibble {{CodeEnd}} {{TextStart}}'''SCREEN = 112''' '''FG color: 0''' @@ -37,8 +39,8 @@ The '''SCREEN''' function returns the [[ASCII]] code of a text character or the : ''Note:'' How the SCREEN 0 background color can only be changed to colors 0 through 7! 7 * 16 = 112. -''Example 2:'' Reading the [[ASCII]] code and color of a text character using the SCREEN function. Graphic colors were not reliable in Qbasic! -{{CodeStart}} '' '' +''Example 2:'' Reading the [[ASCII]] code and color of a text character using the SCREEN function. Graphic colors were not reliable in QBasic! +{{CodeStart}} {{Cl|SCREEN (statement)|SCREEN}} 12 row = 10: column = 10 @@ -46,7 +48,7 @@ row = 10: column = 10 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|END}} '' '' +{{Cl|END}} {{CodeEnd}} {{OutputStart}} {{Text| Hello|blue}} @@ -59,7 +61,7 @@ attrib% = {{Cl|SCREEN (function)|SCREEN}}(row, column, 1) ' character color re ''Example 3:'' Finding the current program path placed on the screen using [[FILES]] and the SCREEN function in SCREEN 0. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 0, 0, 0, 0 {{Cl|CLS}} {{Cl|PRINT}} "This is a directory test..." @@ -75,7 +77,7 @@ 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|END}} '' '' +{{Cl|END}} {{CodeEnd}} {{small|Code by Pete from the N54 QB site}} :''Explanation:'' The SCREEN page one is used to hide the [[FILES]] display using COLOR 0. The [[SCREEN (function)|SCREEN]] function reads the top of the screen page text and creates the current path string. It is then printed on the visual page. @@ -89,4 +91,4 @@ a$ = {{Cl|RTRIM$}}(a$) {{PageNavigation}} -< + diff --git a/internal/help/SCREEN.txt b/internal/help/SCREEN_111111.txt similarity index 88% rename from internal/help/SCREEN.txt rename to internal/help/SCREEN_111111.txt index ddf7aa73d..57bce443b 100644 --- a/internal/help/SCREEN.txt +++ b/internal/help/SCREEN_111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:22}} {| align="Right" | __TOC__ |} @@ -6,7 +8,7 @@ The [[SCREEN]] statement sets the video display mode and size of the program win {{PageSyntax}} -::: '''SCREEN''' {''mode%''|''imagehandle&''} [, , active_page, visual_page] +::: '''SCREEN''' {''mode%''|''imagehandle&''} [, , active_page, visual_page] {{Parameters}} @@ -38,15 +40,15 @@ The [[SCREEN]] statement sets the video display mode and size of the program win 12 30/60 80 640 480 16/262K 4 none 8 X 16 _FONT 16 13 25 40 320 200 256/65K 8 none 8 X 8 _FONT 8 - '''QB64 allows video paging and [[PCOPY]] in ALL screen modes!''' '' '' + '''QB64 allows video paging and [[PCOPY]] in ALL screen modes!''' {{WhiteEnd}} :::::::::'''QB64 Custom Screen Modes''' :'''QB64''' {{PageSyntax}}   -::::::[[SCREEN]] ''imagehandle&'' [, , ''active_page'', ''visual_page''] +::::::[[SCREEN]] ''imagehandle&'' [, , ''active_page'', ''visual_page''] -::::::[[SCREEN]] [[_NEWIMAGE]](''wide&'', ''high&''[, {''mode''|''256''|''32''}]) [, , ''active_page'', ''visual_page''] +::::::[[SCREEN]] [[_NEWIMAGE]](''wide&'', ''high&''[, {''mode''|''256''|''32''}]) [, , ''active_page'', ''visual_page''] ::::::[[SCREEN]] [[_LOADIMAGE]](''file$''[, {''mode''|''256''|''32''}]) [, , ''active_page'', ''visual_page''] @@ -59,15 +61,15 @@ 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> +

([[#toc|Return to Table of Contents]])

==Legacy Screen Modes== -* '''[[SCREEN]] 0''' (default mode) is a '''text only''' screen mode. 64 (VGA) colors with hi-intensity(blinking) colors 16 to 31. ([[DAC]] attrib 6, 8 to 15). 8 Background colors intensities only(0 - 7). No graphics are possible! Normally runs in a window. ALT-Enter switches from a window to fullscreen. To automatically run in '''Qbasic''' fullscreen, use another Screen mode before using {{KW|SCREEN (statement)|SCREEN}} 0. Can use {{KW|PCOPY}} with video pages 0 to 7. Text is 25, 43 or 50 rows by 40 or 80 columns. Default is 25 by 80. See {{KW|WIDTH}}. +* '''[[SCREEN]] 0''' (default mode) is a '''text only''' screen mode. 64 (VGA) colors with hi-intensity(blinking) colors 16 to 31. ([[DAC]] attrib 6, 8 to 15). 8 Background colors intensities only(0 - 7). No graphics are possible! Normally runs in a window. ALT-Enter switches from a window to fullscreen. To automatically run in '''QBasic''' fullscreen, use another Screen mode before using {{KW|SCREEN (statement)|SCREEN}} 0. Can use {{KW|PCOPY}} with video pages 0 to 7. Text is 25, 43 or 50 rows by 40 or 80 columns. Default is 25 by 80. See {{KW|WIDTH}}. : '''Note:''' Use [[OUT]] or [[_PALETTECOLOR]] to create higher intensity color backgrounds than [[COLOR]] , 7. -:::'''All other available [[SCREEN]] modes can use text and graphics and are fullscreen in Qbasic ONLY.''' +:::'''All other available [[SCREEN]] modes can use text and graphics and are fullscreen in QBasic ONLY.''' * '''[[SCREEN]] 1''' has 4 background color attributes. 0 = black, 1 = blue, 2 = green, 3 = grey. White foreground only. Text is 25 by 40. White graphics is 320 by 200. @@ -89,13 +91,13 @@ The [[SCREEN]] statement sets the video display mode and size of the program win * '''[[SCREEN]] 13''' has 256 color attributes, black background. 256K possible color hues. Text is 25 by 40. Graphics is 320 by 200. -* '''[[SCREEN]] [[_NEWIMAGE]]'''(wide&, deep&, mode%) can imitate any size screen mode or use 32 bit or 256 color modes in '''QB64'''. +* '''[[SCREEN]] [[_NEWIMAGE]]'''(wide&, deep&, mode%) can imitate any size screen mode or use 32 bit or 256 color modes in '''QB64'''. -* '''[[SCREEN]] [[_LOADIMAGE]]'''(imagehandle&, colors) can load a program screen of an image file handle in '''QB64''' using 256 or 32 bit. +* '''[[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> +
'''QB64 can use page flipping with any number of pages in any screen mode!'''
-<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

==Text and Graphics== @@ -114,7 +116,7 @@ The [[SCREEN]] statement sets the video display mode and size of the program win * The minimum on screen graphics pixel coordinates are 0 for columns and rows in the top left corner. * Maximum pixel coordinates are one less than the maximum dimensions above because the pixel count starts at 0. * Graphic objects such as [[PSET]], [[PRESET]], [[LINE]], [[CIRCLE]] and [[DRAW]] can be placed partially off of the screen. -* [[GET (graphics statement)|GET]] and [[PUT (graphics statement)|PUT]] screen image operations MUST be located completely on the screen in Qbasic! +* [[GET (graphics statement)|GET]] and [[PUT (graphics statement)|PUT]] screen image operations MUST be located completely on the screen in QBasic! * [[VIEW]] can be used to designate a graphic view port area of the screen. * [[WINDOW]] can be used to set the graphics SCREEN coordinates to almost any size needed. Use the SCREEN option for normal row coordinate values. Row coordinates are Cartesian(decrease in value going down the screen) otherwise. * In '''QB64''' the [[_WIDTH (function)|_WIDTH]] and [[_HEIGHT]] functions will return the graphic pixel dimensions in SCREENs other than 0. @@ -130,17 +132,17 @@ 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> +

([[#toc|Return to Table of Contents]])

==Examples== -:''Example 1:'' Shows an example of each legacy screen mode available to Qbasic and QB64. -{{CodeStart}} '' '' +:''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|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!" @@ -152,14 +154,14 @@ The [[SCREEN]] statement sets the video display mode and size of the program win {{Cl|END IF}} {{Cl|NEXT}} {{Cl|SLEEP}} -{{Cl|SYSTEM}} '' '' +{{Cl|SYSTEM}} {{CodeEnd}} {{OutputStart}} 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) -<p style="text-align: center">([[#toc|Return to Table of Contents]])</p> +

([[#toc|Return to Table of Contents]])

==References== @@ -191,4 +193,4 @@ This is SCREEN 0 - only text is allowed! {{PageNavigation}} -< + diff --git a/internal/help/SEEK_(statement).txt b/internal/help/SEEK_(statement)_1111_(000000000).txt similarity index 92% rename from internal/help/SEEK_(statement).txt rename to internal/help/SEEK_(statement)_1111_(000000000).txt index e252a1e38..54b57f0ba 100644 --- a/internal/help/SEEK_(statement).txt +++ b/internal/help/SEEK_(statement)_1111_(000000000).txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:24}} The '''SEEK''' statement sets the next byte or record position of a file for a read or write. {{PageSyntax}} -:: SEEK ''filenumber&'', ''position'' +:: SEEK ''filenumber&'', ''position'' @@ -29,4 +31,4 @@ The '''SEEK''' statement sets the next byte or record position of a file for a r {{PageNavigation}} -< + diff --git a/internal/help/SEEK.txt b/internal/help/SEEK_1111.txt similarity index 88% rename from internal/help/SEEK.txt rename to internal/help/SEEK_1111.txt index 817d7df4f..db16a9f22 100644 --- a/internal/help/SEEK.txt +++ b/internal/help/SEEK_1111.txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:23}} The '''SEEK''' function returns the current byte or record position in a file. {{PageSyntax}} -:: byte = SEEK(filenumber&) +:: byte = SEEK(filenumber&) * Filenumber is the number of an [[OPEN]] file in any mode. @@ -19,4 +21,4 @@ The '''SEEK''' function returns the current byte or record position in a file. {{PageNavigation}} -< + diff --git a/internal/help/SELECT_CASE.txt b/internal/help/SELECT_CASE_111111_1111.txt similarity index 94% rename from internal/help/SELECT_CASE.txt rename to internal/help/SELECT_CASE_111111_1111.txt index 7d4b87d0d..116a210d0 100644 --- a/internal/help/SELECT_CASE.txt +++ b/internal/help/SELECT_CASE_111111_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:26}} [[SELECT CASE]] is used to determine the program flow by comparing the value of a variable to specific CASE values. @@ -18,11 +20,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> +* Supports individual CASE values and ranges or lists of literal values as below: ** '''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 =, <>, < or > '''}} ** '''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. @@ -36,7 +38,7 @@ {{PageExamples}} ''Example 1:'' SELECT CASE can use literal or variable [[STRING]] or numerical values in CASE comparisons: -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|INPUT}} "Enter a whole number value from 1 to 40: ", value value1 = 10 value2 = 20 @@ -48,7 +50,7 @@ value3 = 30 {{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}} '' '' +{{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. @@ -68,13 +70,13 @@ a = 100 {{Cl|PRINT}} "(and no other case will be checked)" {{Cl|CASE}} 150 {{Cl|PRINT}} "This will not be shown." - {{Cl|CASE IS}} < 150 + {{Cl|CASE IS}} < 150 {{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|CASE ELSE}} {{Cl|PRINT}} "This will only print if it gets this far!" -{{Cl|END SELECT}} '' '' +{{Cl|END SELECT}} {{CodeEnd}} {{OutputStart}}This will be displayed when a equals 100 (and no other case will be checked) @@ -97,13 +99,13 @@ a = 100 {{Cl|PRINT}} "(and other cases will be checked)" {{Cl|CASE}} 150 {{Cl|PRINT}} "This will not be shown." - {{Cl|CASE IS}} < 150 + {{Cl|CASE IS}} < 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|CASE ELSE}} {{Cl|PRINT}} "This will only print if no other CASE is true!" -{{Cl|END SELECT}} '' '' +{{Cl|END SELECT}} {{CodeEnd}} {{OutputStart}}This will be displayed when a equals 100 (and other cases will be checked) @@ -114,7 +116,7 @@ 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}} '' '' +{{CodeStart}} {{Cl|PRINT}} "Enter a letter, number or punctuation mark from the keyboard: "; valu$ = {{Cl|INPUT$}}(1) {{Cl|PRINT}} value$ @@ -128,9 +130,9 @@ value3$ = "z" {{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}} '' '' +{{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: @@ -167,4 +169,4 @@ DO {{PageNavigation}} -< + diff --git a/internal/help/SETMEM.txt b/internal/help/SETMEM.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/SETMEM.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/SGN.txt b/internal/help/SGN_111.txt similarity index 92% rename from internal/help/SGN.txt rename to internal/help/SGN_111.txt index 0509dc292..370216529 100644 --- a/internal/help/SGN.txt +++ b/internal/help/SGN_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:28}} The '''SGN''' function returns the sign of a number value. @@ -17,7 +19,7 @@ The '''SGN''' function returns the sign of a number value. {{CodeStart}} n = -100 {{Cl|IF...THEN|IF}} {{Cl|SGN}}(n) = -1 THEN n = {{Cl|ABS}}(n) -PRINT n '' '' +PRINT n {{CodeEnd}} {{OutputStart}} 100 {{OutputEnd}} @@ -30,4 +32,4 @@ PRINT n '' '' {{PageNavigation}} -< + diff --git a/internal/help/SHARED.txt b/internal/help/SHARED_111111.txt similarity index 92% rename from internal/help/SHARED.txt rename to internal/help/SHARED_111111.txt index 135f9513f..f71cd1274 100644 --- a/internal/help/SHARED.txt +++ b/internal/help/SHARED_111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:29}} The '''SHARED''' statement allows variables to be passed automatically to any [[SUB]] or [[FUNCTION]] procedure. @@ -14,14 +16,14 @@ The '''SHARED''' statement allows variables to be passed automatically to any [[ ''Example 1:'' Defining variable types with [[AS]] or type suffixes. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DIM}} {{Cl|SHARED}} Qt AS {{Cl|STRING}} * 1, price AS {{Cl|DOUBLE}}, ID AS {{Cl|INTEGER}} {{Cl|DIM}} {{Cl|SHARED}} Q$, prices#, IDs% -{{CodeEnd}} '' '' +{{CodeEnd}} ''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}} '' '' +{{CodeStart}} {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 2 {{Cl|LINE INPUT}} "Enter a file spec: ", spec$ file$ = DIR$(spec$) 'use a file spec ONCE to find the last file name listed @@ -43,11 +45,11 @@ The '''SHARED''' statement allows variables to be passed automatically to any [[ {{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%) + size& = {{Cl|LOF}}(ff%) {{Cl|CLOSE}} #ff% - {{Cl|IF}} size& = 0 {{Cl|THEN}} {{Cl|KILL}} TmpFile$: {{Cl|EXIT FUNCTION}} + {{Cl|IF}} size& = 0 {{Cl|THEN}} {{Cl|KILL}} TmpFile$: {{Cl|EXIT FUNCTION}} {{Cl|OPEN}} TmpFile$ {{Cl|FOR (file statement)|FOR}} {{Cl|INPUT (file mode)|INPUT}} {{Cl|AS}} #ff% - {{Cl|DO}} {{Cl|WHILE}} {{Cl|NOT}} {{Cl|EOF}}(ff%) {{Cl|AND (boolean)|AND}} Index% < ListMAX% + {{Cl|DO}} {{Cl|WHILE}} {{Cl|NOT}} {{Cl|EOF}}(ff%) {{Cl|AND (boolean)|AND}} Index% < ListMAX% Index% = Index% + 1 {{Cl|LINE INPUT (file statement)|LINE INPUT}} #ff%, DirList$(Index%) {{Cl|LOOP}} @@ -57,7 +59,7 @@ The '''SHARED''' statement allows variables to be passed automatically to any [[ {{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}} '' '' +{{Cl|END FUNCTION}} {{CodeEnd}}{{small|Code by Ted Weissgerber}} : ''Explanation:'' The SHARED variable value ''DIRcount%'' can tell the main program how many files were found using a wildcard spec. @@ -68,4 +70,4 @@ DIR$ = DirList$(Index%) {{PageNavigation}} -< + diff --git a/internal/help/SHELL_(function).txt b/internal/help/SHELL_(function)_11111_(00000000).txt similarity index 83% rename from internal/help/SHELL_(function).txt rename to internal/help/SHELL_(function)_11111_(00000000).txt index 303afc7be..a2c591fe3 100644 --- a/internal/help/SHELL_(function).txt +++ b/internal/help/SHELL_(function)_11111_(00000000).txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:32}} The '''SHELL''' function displays the console and returns the [[INTEGER]] code value sent when the external program exits. @@ -22,29 +24,29 @@ The '''SHELL''' function displays the console and returns the [[INTEGER]] code v {{Cb|CONST}} SM_CYSCREEN = 1 {{Cb|DECLARE LIBRARY}} - {{Cb|FUNCTION}} GetSystemMetrics& ({{Cb|BYVAL}} n {{Cb|AS}} {{Cb|LONG}}) + {{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)) -s& = {{Cb|_SCREENIMAGE}} -{{Cb|PRINT}} {{Cb|_WIDTH (function)|_WIDTH}}(s&); "X"; {{Cb|_HEIGHT}}(s&) +s& = {{Cb|_SCREENIMAGE}} +{{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 +{{Cb|END}} 3 '<<<<<< add a code to return after END or SYSTEM in any program {{Cb|FUNCTION}} trimstr$ (whatever) trimstr = {{Cb|LTRIM$}}({{Cb|RTRIM$}}({{Cb|STR$}}(whatever))) -{{Cb|END FUNCTION}} '' '' +{{Cb|END FUNCTION}} {{TextEnd}} : ''Explanation:'' To set a program exit code use an [[INTEGER]] parameter value after [[END]] or [[SYSTEM]] in the called program. : After compiling ''DesktopSize.EXE'' run the following code in the QB64 IDE. After 1st program is done 3 will appear on screen: -{{CodeStart}} '' '' +{{CodeStart}} 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 -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} {{OutputStart}}3 {{OutputEnd}} @@ -58,4 +60,4 @@ returncode% = {{Cl|SHELL (function)|SHELL}}("DesktopSize") 'replace call with na {{PageNavigation}} -< + diff --git a/internal/help/SHELL.txt b/internal/help/SHELL_11111.txt similarity index 97% rename from internal/help/SHELL.txt rename to internal/help/SHELL_11111.txt index aab2e8419..f28574c01 100644 --- a/internal/help/SHELL.txt +++ b/internal/help/SHELL_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:31}} The [[SHELL]] statement allows a program to run external programs or command line statements in Windows, macOS and Linux. @@ -29,9 +31,9 @@ The [[SHELL]] statement allows a program to run external programs or command lin {{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 '' '' +{{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 {{CodeEnd}} :{{small|Contents of ''temp.dir'' text file:}} {{TextStart}}Free Cell.ico @@ -72,7 +74,7 @@ The [[SHELL]] statement allows a program to run external programs or command lin {{Cl|ELSE}} : Path = "" 'returns zero length string if path not found END IF {{Cl|KILL}} "D0S-DATA.INF" 'deleting the file is optional - {{Cl|END FUNCTION}} '' '' + {{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. @@ -80,7 +82,7 @@ The [[SHELL]] statement allows a program to run external programs or command lin ''Example 4:'' Determining if a drive or path exists. Cannot use with a file name specification. -{{CodeStart}} '' '' +{{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|END}} @@ -94,7 +96,7 @@ PathExist% = 0 {{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|END FUNCTION}} '' '' +{{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. @@ -152,4 +154,4 @@ PathExist% = 0 {{PageNavigation}} -< + diff --git a/internal/help/SIGNAL.txt b/internal/help/SIGNAL.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/SIGNAL.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/SINGLE.txt b/internal/help/SINGLE_111111.txt similarity index 90% rename from internal/help/SINGLE.txt rename to internal/help/SINGLE_111111.txt index c9d8845a5..f68bb00e3 100644 --- a/internal/help/SINGLE.txt +++ b/internal/help/SINGLE_111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:36}} '''SINGLE''' variables are 4 byte floating decimal point numerical values up to seven digits in length. @@ -12,7 +14,7 @@ * Values returned may be expressed using exponential or [[scientific notation]] using '''E''' for SINGLE or '''D''' for DOUBLE precision. * Floating decimal point numerical values cannot be [[_UNSIGNED]]! * Values can be converted to 4 byte [[ASCII]] string values using [[_MKS$]] and back with [[_CVS]]. -* '''Warning: Qbasic keyword names cannot be used as numerical variable names with or without the type suffix!''' +* '''Warning: QBasic keyword names cannot be used as numerical variable names with or without the type suffix!''' {{PageSeeAlso}} @@ -24,4 +26,4 @@ {{PageNavigation}} -< + diff --git a/internal/help/SIN.txt b/internal/help/SIN_111.txt similarity index 80% rename from internal/help/SIN.txt rename to internal/help/SIN_111.txt index 2048038d9..d4f8eb38c 100644 --- a/internal/help/SIN.txt +++ b/internal/help/SIN_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:35}} The {{KW|SIN}} function returns the vertical component or sine of an angle measured in radians. @@ -11,12 +13,12 @@ The {{KW|SIN}} function returns the vertical component or sine of an angle measu {{PageDescription}} * To convert from degrees to radians, multiply degrees * Ο€/180. -* [[SIN]]E is the vertical component of a unit vector in the direction theta (&theta;). +* [[SIN]]E is the vertical component of a unit vector in the direction theta (ι). * Accuracy can be determined as [[SINGLE]] by default or [[DOUBLE]] by following the parameter value with a # suffix. -''Example 1:'' Converting degree angles to radians for Qbasic's trig functions and drawing the line at the angle. -{{CodeStart}} '' '' +''Example 1:'' Converting degree angles to radians for QBasic's trig functions and drawing the line at the angle. +{{CodeStart}} {{Cl|SCREEN}} 12 PI = 4 * {{Cl|ATN}}(1) {{Cl|PRINT}} "PI = 4 * {{Cl|ATN}}(1) ="; PI @@ -33,7 +35,7 @@ DO {{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|LOOP}} {{Cl|UNTIL}} DEGREES% = 0 '' '' +{{Cl|LOOP}} {{Cl|UNTIL}} DEGREES% = 0 {{CodeEnd}} {{OutputStart}} PI = 4 * ATN(1) = 3.141593 @@ -50,7 +52,7 @@ DEGREES% = RADIANS * 180 / PI = 45 ''Example 2:'' Displays rotating gears made using SIN and [[COS]] to place the teeth lines. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN (statement)|SCREEN}} 9 {{Cl|DIM}} {{Cl|SHARED}} Pi {{Cl|AS}} {{Cl|SINGLE}} Pi = 4 * {{Cl|ATN}}(1) @@ -66,7 +68,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,16 +81,16 @@ 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}} '' '' +{{Cl|END SUB}} {{CodeEnd}} {{small|Adapted from code by: DarthWho}} ''Example 3:'' Displaying the current seconds for an analog clock. See [[COS]] for the clock face hour markers. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 12 Pi2! = 8 * {{Cl|ATN}}(1): sec! = Pi2! / 60 ' (2 * pi) / 60 movements per rotation {{Cl|CIRCLE}} (320, 240), 80, 1 @@ -99,12 +101,12 @@ 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}} {{small|Code by: Ted Weissgerber}} -The value of 2 &pi; is used to determine the sec! multiplier that determines the radian value as S! The value is divided by 60 second movements. To calculate the seconds the [[TIME$]] function is used and that value is subtracted 15 seconds because the 0 value of pi is actually the 3 hour of the clock (15 seconds fast). SIN and COS will work with negative values the same as positive ones! Then the column and row coordinates for one end of the line are determined using SIN and [[COS]] multiplied by the radius of the circular line movements. The minute and hour hands could use similar procedures to read different parts of TIME$. +The value of 2 γ is used to determine the sec! multiplier that determines the radian value as S! The value is divided by 60 second movements. To calculate the seconds the [[TIME$]] function is used and that value is subtracted 15 seconds because the 0 value of pi is actually the 3 hour of the clock (15 seconds fast). SIN and COS will work with negative values the same as positive ones! Then the column and row coordinates for one end of the line are determined using SIN and [[COS]] multiplied by the radius of the circular line movements. The minute and hour hands could use similar procedures to read different parts of TIME$. {{PageSeeAlso}} @@ -117,4 +119,4 @@ The value of 2 &pi; is used to determine the sec! multiplier that determines {{PageNavigation}} -< + diff --git a/internal/help/SLEEP.txt b/internal/help/SLEEP_11111.txt similarity index 94% rename from internal/help/SLEEP.txt rename to internal/help/SLEEP_11111.txt index 58c6cef83..bdf7e5b2e 100644 --- a/internal/help/SLEEP.txt +++ b/internal/help/SLEEP_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:37}} SLEEP pauses the program indefinitely or for a specified number of seconds, program is unpaused when the user presses a key or when the specified number of seconds has passed. @@ -13,8 +15,8 @@ SLEEP pauses the program indefinitely or for a specified number of seconds, prog ''Example:'' -{{CodeStart}} '' '' -{{Cl|CLS}} '' '' +{{CodeStart}} +{{Cl|CLS}} {{Cl|PRINT}} "Press a key..." {{Cl|SLEEP}} {{Cl|PRINT}} "You pressed a key, now wait for 2 seconds." @@ -37,4 +39,4 @@ You've waited for 2 seconds. {{PageNavigation}} -< + diff --git a/internal/help/SOUND.txt b/internal/help/SOUND_11111.txt similarity index 92% rename from internal/help/SOUND.txt rename to internal/help/SOUND_11111.txt index 3bc1def60..9e0790e59 100644 --- a/internal/help/SOUND.txt +++ b/internal/help/SOUND_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:38}} '''SOUND''' sets frequency and duration of sounds from the internal PC speaker if the computer has one or the sound card in QB64. @@ -14,7 +16,7 @@ {{PageErrors}} * Low ''frequency'' values between 0 and 37 will create an [[ERROR Codes|Illegal Function call error]]. * '''Warning:''' SOUND may not work when the program is not in focus. Use SOUND 0, 0 at sound procedure start to set focus. -* '''Note:''' SOUND 0, 0 will not stop previous '''QB64''' sounds like it did in Qbasic! +* '''Note:''' SOUND 0, 0 will not stop previous '''QB64''' sounds like it did in QBasic! * SOUND may have clicks or pauses between the sounds generated. [[PLAY]] can be used for musical sounds. {{WhiteStart}} ''' The Seven Music Octaves ''' @@ -53,16 +55,16 @@ ''Example 1:'' Playing the seven octaves based on the base note DATA * 2 ^ (octave - 1). -{{CodeStart}} '' '' +{{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):" {{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|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%; ":"; @@ -74,7 +76,7 @@ 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}} @@ -82,16 +84,16 @@ notes$ = "C C#D D#E F F#G G#A A#B " {{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 '' '' +{{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. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN (statement)|SCREEN}} 13 {{Cl|_FULLSCREEN}} -{{Cl|OUT}} {{Cl|&H}}3C8, 0: {{Cl|OUT}} {{Cl|&H}}3C9, 0: {{Cl|OUT}} {{Cl|&H}}3C9, 0: {{Cl|OUT}} {{Cl|&H}}3C9, 20 +{{Cl|OUT}} {{Cl|&H}}3C8, 0: {{Cl|OUT}} {{Cl|&H}}3C9, 0: {{Cl|OUT}} {{Cl|&H}}3C9, 0: {{Cl|OUT}} {{Cl|&H}}3C9, 20 {{Cl|COLOR}} 1 {{Cl|FOR...NEXT|FOR}} i% = 1 {{Cl|TO}} 21 {{Cl|LOCATE}} 2 + i%, 2: {{Cl|PRINT}} {{Cl|CHR$}}(178) @@ -123,9 +125,9 @@ Octaves: {{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}} 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:'' @@ -135,4 +137,4 @@ Octaves: {{PageNavigation}} -< + diff --git a/internal/help/SPACE$.txt b/internal/help/SPACE$_11111$.txt similarity index 90% rename from internal/help/SPACE$.txt rename to internal/help/SPACE$_11111$.txt index 1ded0c944..0e6d2b678 100644 --- a/internal/help/SPACE$.txt +++ b/internal/help/SPACE$_11111$.txt @@ -1,12 +1,14 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:40}} The {{KW|SPACE$}} function returns a {{KW|STRING}} consisting of a number of space characters. {{PageSyntax}} -:''result$'' = '''SPACE$({{Parameter|count&}})''' +:''result$'' = '''SPACE$({{Parameter|count&}})''' {{Parameters}} -* {{Parameter|count&}} is the number of space characters to repeat. Cannot use negative values! +* {{Parameter|count&}} is the number of space characters to repeat. Cannot use negative values! ''Usage:'' @@ -22,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}} '' '' +{{CodeStart}} {{Cl|FOR...NEXT|FOR}} count% = 0 {{Cl|FOR...NEXT|TO}} 3 {{Cl|PRINT}} "abc" + {{Cl|SPACE$}}( count% ) + "def" {{Cl|FOR...NEXT|NEXT}} count% @@ -36,14 +38,14 @@ abc def ''Example 2:'' In [[SCREEN]] 0 SPACE$ can be used to change the background color to make an American flag. {{CodeStart}} - USA flag centered on screen with thin horizontal red & white stripes + USA flag centered on screen with thin horizontal red & white stripes ' blue corner field with randomly twinkling stars {{Cl|CLS}} {{Cl|LOCATE}} 25, 1 {{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) +{{Cl|FOR...NEXT|FOR}} x = 5 {{Cl|TO}} 19 '13 red & white stripes (x =5 to 21 for 15 stripes) {{Cl|IF...THEN|IF}} z = 15 {{Cl|THEN}} z = 4 {{Cl|ELSE}} z = 15 {{Cl|COLOR}} , z {{Cl|LOCATE}} x, 15 @@ -101,4 +103,4 @@ DO {{PageNavigation}} -< + diff --git a/internal/help/SPC.txt b/internal/help/SPC_111.txt similarity index 95% rename from internal/help/SPC.txt rename to internal/help/SPC_111.txt index 2cf8787f0..4ea8360ee 100644 --- a/internal/help/SPC.txt +++ b/internal/help/SPC_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:41}} The {{KW|SPC}} function is used in [[PRINT]] and [[LPRINT]] statements to print or output a number of space characters. @@ -33,4 +35,4 @@ abc 123 {{PageNavigation}} -< + diff --git a/internal/help/SQR.txt b/internal/help/SQR_111.txt similarity index 84% rename from internal/help/SQR.txt rename to internal/help/SQR_111.txt index e12da9563..f612ab7f4 100644 --- a/internal/help/SQR.txt +++ b/internal/help/SQR_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:42}} The '''SQR''' function returns the square root of a numerical value. @@ -7,13 +9,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 = c ^ (a / b)|green}} ''Example 1:'' Finding the hypotenuse of a right triangle: -{{CodeStart}} '' '' +{{CodeStart}} A% = 3: B% = 4 - PRINT "hypotenuse! ="; SQR((A% ^ 2) + (B% ^ 2)) '' '' + PRINT "hypotenuse! ="; SQR((A% ^ 2) + (B% ^ 2)) {{CodeEnd}} {{OutputStart}} hypotenuse = 5 @@ -21,10 +23,10 @@ The '''SQR''' function returns the square root of a numerical value. ''Example 2:'' Finding the Cube root of a number. -{{CodeStart}} '' '' +{{CodeStart}} number = 8 cuberoot = number {{Cl|^}} (1/3) - PRINT cuberoot '' '' + PRINT cuberoot {{CodeEnd}} {{OutputStart}} 2 @@ -32,10 +34,10 @@ The '''SQR''' function returns the square root of a numerical value. ''Example 3:'' Negative roots return fractional values of one. -{{CodeStart}} '' '' +{{CodeStart}} number = 8 negroot = number {{Cl|^}} -2 - PRINT negroot '' '' + PRINT negroot {{CodeEnd}} {{OutputStart}} .015625 @@ -59,13 +61,13 @@ 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!" -LOOP UNTIL PR = 0 '' '' +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> +
''Note:'' Prime numbers cannot be evenly divided by any other number except one.
''See also:'' @@ -76,4 +78,4 @@ PRIME! How'd you find me? {{PageNavigation}} -< + diff --git a/internal/help/STATIC.txt b/internal/help/STATIC_111111.txt similarity index 84% rename from internal/help/STATIC.txt rename to internal/help/STATIC_111111.txt index d2dcf3ca5..77f0dbc68 100644 --- a/internal/help/STATIC.txt +++ b/internal/help/STATIC_111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:43}} The {{KW|STATIC}} keyword is used in declaration statements to control where variables are stored. @@ -19,28 +21,28 @@ 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|PRINT}} Bin$(num&) +{{CodeStart}} +{{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|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 + 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|END FUNCTION}} '' '' +{{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: @@ -67,8 +69,8 @@ The {{KW|STATIC}} keyword is used in declaration statements to control where var {{Cl|IF...THEN|END IF}} ' 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}} n <= maxNToCache {{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}} @@ -96,4 +98,4 @@ The {{KW|STATIC}} keyword is used in declaration statements to control where var {{PageNavigation}} -< + diff --git a/internal/help/STEP.txt b/internal/help/STEP_1111.txt similarity index 94% rename from internal/help/STEP.txt rename to internal/help/STEP_1111.txt index b654651ff..d9bf5c131 100644 --- a/internal/help/STEP.txt +++ b/internal/help/STEP_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:46}} The '''STEP''' keyword is used in [[FOR...NEXT]] loops to skip through the count or to count down instead of up. Used in graphics to designate a relative coordinate position of a graphics object function. @@ -18,10 +20,10 @@ The '''STEP''' keyword is used in [[FOR...NEXT]] loops to skip through the count ''Example:'' Stepping down 2 in a FOR counter loop. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|FOR...NEXT}} i = 10 {{Cl|TO}} 0 {{Cl|STEP}} -2 {{Cl|PRINT}} i; -{{Cl|NEXT}} '' '' +{{Cl|NEXT}} {{CodeEnd}} {{OutputStart}} 10 8 6 4 2 0 @@ -39,10 +41,10 @@ The '''STEP''' keyword is used in [[FOR...NEXT]] loops to skip through the count ''Graphics Example:'' Using STEP coordinates to PAINT a circle's interior. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 12 {{Cl|CIRCLE}} (100, 100), 50, 12 -{{Cl|PAINT}} {{Cl|STEP}}(0, 0), 13, 12 '' '' +{{Cl|PAINT}} {{Cl|STEP}}(0, 0), 13, 12 {{CodeEnd}} :''Explanation:'' PAINT uses the CIRCLE's center coordinate position to paint the interior. @@ -54,4 +56,4 @@ The '''STEP''' keyword is used in [[FOR...NEXT]] loops to skip through the count {{PageNavigation}} -< + diff --git a/internal/help/STICK.txt b/internal/help/STICK_11111.txt similarity index 86% rename from internal/help/STICK.txt rename to internal/help/STICK_11111.txt index 1710cc8ff..0655bea0b 100644 --- a/internal/help/STICK.txt +++ b/internal/help/STICK_11111.txt @@ -1,12 +1,14 @@ -The '''STICK''' function returns the directional axis coordinate move of game port (&H201) joystick or USB controller devices. +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:47}} +The '''STICK''' function returns the directional axis coordinate move of game port (&H201) joystick or USB controller devices. {{PageSyntax}} -:: coordinate_move% = STICK(direction%) +: coordinate_move% = [[STICK]]{{Parameter|(direction%)}} QB64 {{PageSyntax}} -:: coordinate_move% = STICK(''direction%''[, ''axis_number%'']) +: coordinate_move% = [[STICK]]{{Parameter|(direction%[, axis_number%])}} ''Description:'' @@ -14,12 +16,12 @@ QB64 {{PageSyntax}} * ''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. -* Returns coordinate values from 1 to 254. Qbasic only returned values from 1 to 200. +* 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.''' '''STICK(1) returns row coordinate of device 1.''' STICK(2) returns column coordinate of device 2. (second joystick if used) -STICK(3) returns row coordinate of device 2 if used. (Qbasic maximum was 2 controllers) +STICK(3) returns row coordinate of device 2 if used. (QBasic maximum was 2 controllers) '''STICK(4) returns column coordinate of device 3. (other joysticks if used in QB64 only!)''' '''STICK(5) returns row coordinate of device 3 if used.''' {{WhiteEnd}} @@ -29,7 +31,7 @@ STICK(3) returns row coordinate of device 2 if used. (Qbasic maximum was 2 contr ''Example 1:'' Displays the input from 3 joysticks, all with dual sticks and 3 buttons. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DO}}: {{Cl|_LIMIT}} 10 {{Cl|LOCATE}} 1, 1 @@ -42,13 +44,13 @@ STICK(3) returns row coordinate of device 2 if used. (Qbasic maximum was 2 contr {{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. ''Example 2:'' Displays the Sidewinder Precision Pro Stick, Slider, Z Axis, and Hat Point of View. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 12 d = {{Cl|_DEVICES}} {{Cl|PRINT}} "Number of input devices found ="; d @@ -67,7 +69,7 @@ DO: {{Cl|_LIMIT}} 50 {{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 +88,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 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> +
[http://www.amazon.com/Belkin-F3U200-08INCH-Joystick-Adapter-SideWinder/dp/B000067RIV Sidewinder Precision Pro game port to USB adapter]
''See also:'' @@ -97,4 +99,4 @@ Buttons: 9 {{PageNavigation}} -< + diff --git a/internal/help/STOP.txt b/internal/help/STOP_1111.txt similarity index 85% rename from internal/help/STOP.txt rename to internal/help/STOP_1111.txt index 48a624a25..9f4b347a3 100644 --- a/internal/help/STOP.txt +++ b/internal/help/STOP_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:48}} The '''STOP''' statement is used to stop program execution when troubleshooting a program or to suspend event trapping. @@ -5,13 +7,13 @@ The '''STOP''' statement is used to stop program execution when troubleshooting :: STOP -* STOP used in the Qbasic IDE does not close any files or go to the operating system. It returns to the IDE. +* STOP used in the QBasic IDE does not close any files or go to the operating system. It returns to the IDE. * In the QB64 compiler, STOP closes the program window and returns to the IDE when the code is compiled from there. * STOP is ONLY used for debugging purposes and should not be used to exit programs! * STOP can also be used to suspend an event trap in the following statements: [[KEY(n)]], [[ON COM (n)|COM(n)]], [[PEN]], [[PLAY]], [[STRIG(n)]], [[TIMER]], [[UEVENT]]. The trap can be turned back on with [[ON]] and returns any trap events since '''STOP''' was used. -''Example:'' When run in the Qbasic IDE, the program will return to the IDE at STOP. Press F5 to finish the program. +''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" @@ -30,4 +32,4 @@ The '''STOP''' statement is used to stop program execution when troubleshooting {{PageNavigation}} -< + diff --git a/internal/help/STR$.txt b/internal/help/STR$_111$.txt similarity index 96% rename from internal/help/STR$.txt rename to internal/help/STR$_111$.txt index 3e0fd1eab..743bfe4e9 100644 --- a/internal/help/STR$.txt +++ b/internal/help/STR$_111$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:50}} The '''STR$''' function returns the [[STRING]] representation of a numerical value. @@ -44,4 +46,4 @@ a = 33 {{PageNavigation}} -< + diff --git a/internal/help/STRIG(n).txt b/internal/help/STRIG(n)_11111(0).txt similarity index 92% rename from internal/help/STRIG(n).txt rename to internal/help/STRIG(n)_11111(0).txt index f5ff56dfe..9e877bce6 100644 --- a/internal/help/STRIG(n).txt +++ b/internal/help/STRIG(n)_11111(0).txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:52}} The {{KW|STRIG(n)}} statement controls event trapping for a particular joystick or game pad device button. @@ -19,14 +21,14 @@ QB64 {{PageSyntax}} ''Example:'' -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|ON STRIG(n)|ON STRIG}}(0) {{Cl|GOSUB}} 10 {{Cl|STRIG(n)|STRIG}}(0)ON DO {{Cl|PRINT}} "."; {{Cl|_LIMIT}} 30 -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" {{Cl|END}} 10 @@ -35,7 +37,7 @@ a$ = "[STRIG 0 EVENT]" {{Cl|PRINT}} {{Cl|MID$}}(a$, x, 1); {{Cl|_DELAY}} 0.02 {{Cl|NEXT}} -{{Cl|RETURN}} '' '' +{{Cl|RETURN}} {{CodeEnd}} @@ -46,4 +48,4 @@ a$ = "[STRIG 0 EVENT]" {{PageNavigation}} -< + diff --git a/internal/help/STRIG.txt b/internal/help/STRIG_11111.txt similarity index 95% rename from internal/help/STRIG.txt rename to internal/help/STRIG_11111.txt index 2ce9f681d..bdb5f1777 100644 --- a/internal/help/STRIG.txt +++ b/internal/help/STRIG_11111.txt @@ -1,4 +1,6 @@ -The '''STRIG''' function returns button press True or False status of game port (&H201) or USB joystick control device(s). +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:51}} +The '''STRIG''' function returns button press True or False status of game port (&H201) or USB joystick control device(s). {{PageSyntax}} @@ -22,7 +24,7 @@ QB64 {{PageSyntax}} '''STRIG(4) = -1 'upper button 2 on device 1 pressed since last STRIG(4) read''' '''STRIG(5) = -1 'upper button 2 on device 1 currently pressed''' STRIG(6) = -1 'upper button 2 on device 2 pressed since last STRIG(6) read - STRIG(7) = -1 'upper button 2 on device 2 currently pressed (maximum in Qbasic) + STRIG(7) = -1 'upper button 2 on device 2 currently pressed (maximum in QBasic) '''STRIG(8) = -1 'button 3 on device 1 pressed since last STRIG(8) read''' 'QB64 only '''STRIG(9) = -1 'button 3 on device 1 currently pressed''' STRIG(10) = -1 'button 3 on device 2 pressed since last STRIG(10) read 'QB64 only @@ -38,7 +40,7 @@ STRIG(2, 4): STRIG(3, 4): STRIG(6, 4): STRIG(7, 4): STRIG(10, 4): STRIG(11, 4) ' ''Example:'' Displays the input from 3 joysticks, all with dual sticks and 3 buttons. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DO}}: {{Cl|_LIMIT}} 10 {{Cl|LOCATE}} 1, 1 @@ -51,7 +53,7 @@ STRIG(2, 4): STRIG(3, 4): STRIG(6, 4): STRIG(7, 4): STRIG(10, 4): STRIG(11, 4) ' {{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. @@ -64,4 +66,4 @@ STRIG(2, 4): STRIG(3, 4): STRIG(6, 4): STRIG(7, 4): STRIG(10, 4): STRIG(11, 4) ' {{PageNavigation}} -< + diff --git a/internal/help/STRING$.txt b/internal/help/STRING$_111111$.txt similarity index 80% rename from internal/help/STRING$.txt rename to internal/help/STRING$_111111$.txt index 1443ffa25..e4cab5bad 100644 --- a/internal/help/STRING$.txt +++ b/internal/help/STRING$_111111$.txt @@ -1,15 +1,17 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:55}} The {{KW|STRING$}} function returns a {{KW|STRING}} consisting of a single character repeated a number of times. {{PageSyntax}} -: result$ = STRING$(''count&'', {''character$'' | ''ASCIIcode%''} ) +: result$ = STRING$(''count&'', {''character$'' | ''ASCIIcode%''} ) {{PageDescription}} -<!-- Stylin --> -* {{Parameter|count&}} is the number of times the character specified by {{Parameter|character}} is repeated. + +* {{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. +* If {{Parameter|count&}} is negative, an [[ERROR Codes|illegal function call]] error will occur. The count can be zero. * If {{Parameter|character}} is a [[STRING]] value and its length is zero, an [[ERROR Codes|illegal function call]] error will occur. * If more than one string character value is used, the first character will be repeated. * A [[STRING]] statement can be added to a string value with the + [[concatenation]] operator. @@ -48,4 +50,4 @@ The {{KW|STRING$}} function returns a {{KW|STRING}} consisting of a single chara {{PageNavigation}} -< + diff --git a/internal/help/STRING.txt b/internal/help/STRING_111111.txt similarity index 91% rename from internal/help/STRING.txt rename to internal/help/STRING_111111.txt index 0bbc42a07..0fde75f4f 100644 --- a/internal/help/STRING.txt +++ b/internal/help/STRING_111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:54}} '''STRING''' variables or literal values are one byte per character length text or [[ASCII]] characters. @@ -13,10 +15,10 @@ * 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!''' +* '''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!''' -:::::'''Creating a fixed length STRING variable in Qbasic:''' +:::::'''Creating a fixed length STRING variable in QBasic:''' :* 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) @@ -41,17 +43,17 @@ ''Example 1:'' Using a string type suffix with a fixed length byte size in QB64 only. The number designates the fixed string length. -{{CodeStart}} '' '' +{{CodeStart}} var$5 = "1234567" -PRINT var$5 '' '' +PRINT var$5 {{CodeEnd}} {{OutputStart}}12345{{OutputEnd}} :''Note:'' The suffix must keep the same byte length or it is considered a different string variable with a different value! ''Example 2:'' Creating a string variable value by adding variable and literal string values. This procedure is called string [[concatenation]]. -{{CodeStart}} '' '' +{{CodeStart}} age% = 10 a$ = "I am " + {{Cl|CHR$}}(34) + {{Cl|LTRIM$}}({{Cl|STR$}}(age%)) + {{Cl|CHR$}}(34) + " years old." b$ = "How old are you?" @@ -59,21 +61,21 @@ 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}} '' '' +{{CodeStart}} strings$5 = "Hello world" -PRINT strings$5 '' '' +PRINT strings$5 {{CodeEnd}}{{OutputStart}}Hello{{OutputEnd}} ''Example 4:'' STRING values can be compared by the [[ASC]] code value according to [[ASCII]]. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|PRINT}} "Enter a letter, number or punctuation mark from the keyboard: "; valu$ = {{Cl|INPUT$}}(1) {{Cl|PRINT}} value$ @@ -87,9 +89,9 @@ value3$ = "z" {{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}} '' '' +{{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:'' @@ -99,7 +101,7 @@ value3$ = "z" * [[LTRIM$]], [[RTRIM$]] * [[LCASE$]], [[UCASE$]] * [[STR$]] {{text|(decimal to string value)}} -* [[HEX$]] {{text|(decimal to [[&H|hexadecimal]] string value)}} +* [[HEX$]] {{text|(decimal to [[&H|hexadecimal]] string value)}} * [[MKI$]], [[MKL$]], [[MKS$]], [[MKD$]], [[_MK$]] {{text|(numerical to [[ASCII]] string)}} * [[CVI]], [[CVL]], [[CVS]], [[CVD]], [[_CV]] {{text|([[ASCII]] string to numerical value)}} * [[LEN]], [[VAL]] {{text|(function converts string to numerical value)}} @@ -108,4 +110,4 @@ value3$ = "z" {{PageNavigation}} -< + diff --git a/internal/help/SUB.txt b/internal/help/SUB_111.txt similarity index 91% rename from internal/help/SUB.txt rename to internal/help/SUB_111.txt index 38ece70bd..7636b63cc 100644 --- a/internal/help/SUB.txt +++ b/internal/help/SUB_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:56}} A '''SUB''' procedure is a procedure within a program that can calculate and return multiple parameter values just like a full program. @@ -13,6 +15,8 @@ A '''SUB''' procedure is a procedure within a program that can calculate and ret * Parameters passed after the procedure call must match the variable types in the SUB parameters in order. * If there are no ''parameter''s passed or they are [[SHARED]] the parameters and parenthesis are not required in the procedure. * Parameter [[Variable]] names in the procedure do not have to match the names used in the [[CALL]], just the value types. +* To pass parameter variables [[BYVAL|by value]] to protect the value in a call, parenthesis can be placed around each variable name also. +* To pass [[arrays]] to a sub-procedure use empty brackets after the name or indicate the index in the call. {{PageDescription}} @@ -29,7 +33,7 @@ A '''SUB''' procedure is a procedure within a program that can calculate and ret ''Example 1:'' Text [[PRINT]] screen centering using [[PEEK]] to find the SCREEN mode width. Call and SUB procedure code: -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DEFINT}} A-Z {{Cl|SCREEN}} 13 Center 10, 15, "This text is centered." ' example module sub call @@ -41,14 +45,14 @@ Columns = {{Cl|_WIDTH}} / {{Cl|_FONTWIDTH}} 'Convert _WIDTH (in pixels) to width Middle = (Columns \ 2) + 1 ' reads any screen mode width Tcol = Middle - ({{Cl|LEN}}(Text$) \ 2) {{Cl|COLOR}} Tclr: {{Cl|LOCATE}} Trow, Tcol: {{Cl|PRINT}} Text$; ' end semicolon prevents screen roll -{{Cl|END SUB}} '' '' +{{Cl|END SUB}} {{CodeEnd}} :''Explanation:'' The procedure centers text printed to the screen. The parameters are the text color, row and the text itself as a string or string variable. The maximum width of the screen mode in characters is found and divided in half to find the center point. The text string's length is also divided in half and subtracted from the screen's center position. The procedure will also work when the [[WIDTH]] statement has been used. When adding variables to Text$ use the + concatenation operator. Not semicolons! ''Example 2:'' SUB and [[FUNCTION]] procedures always return to the place they were called in the main or other sub-procedures: -{{CodeStart}} '' '' +{{CodeStart}} a = 10 Add1 a {{Cl|PRINT}} a 'Add1 returns final 'a' value here @@ -80,4 +84,4 @@ exit 1 {{PageNavigation}} -< + diff --git a/internal/help/SWAP.txt b/internal/help/SWAP_1111.txt similarity index 91% rename from internal/help/SWAP.txt rename to internal/help/SWAP_1111.txt index 033893bf4..d07ae7cd4 100644 --- a/internal/help/SWAP.txt +++ b/internal/help/SWAP_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:58}} The {{KW|SWAP}} statement is used to exchange two variable or array element values. @@ -30,7 +32,7 @@ one ''Example 2:'' Creating Cryptograms by scrambling EVERY capital letter in the alphabet. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DIM}} Letter$(65 {{Cl|TO}} 90) {{Cl|RANDOMIZE}} {{Cl|TIMER}} {{Cl|CLS}} @@ -41,7 +43,7 @@ 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 @@ -59,16 +61,16 @@ L = {{Cl|LEN}}(text$) {{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}} '' '' +{{Cl|END}} {{CodeEnd}} {{small|Code by Ted Weissgerber}} :'' Explanation:'' The Letter$ [[STRING]] [[Arrays|array]] is first created with the letters matching the [[ASCII]] code index value. Every index is '''swap'''ped when the letter matches it's index code until every letter is different. The Code array holds the text code solution. ''Example 3:'' A very quick array sorting SUB procedure using recursion sorts 10 thousand numbers in milliseconds. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DEFINT}} A-Z {{Cl|DIM}} {{Cl|SHARED}} swap2 {{Cl|AS}} {{Cl|LONG}} 'Demo only {{Cl|DIM}} array(10000) {{Cl|AS}} {{Cl|SINGLE}} 'array can hold any type of value @@ -84,7 +86,7 @@ start! = {{Cl|TIMER}}(.001) ending! = {{Cl|TIMER}}(.001) 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 max! = array(n) @@ -100,17 +102,17 @@ tmp$ = " array(0)= ##.##### array(5000)= ###.#### array(10000)= ###.####" 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(Lo) < Middle: Lo = Lo + 1: {{Cl|LOOP}} {{Cl|DO}} {{Cl|WHILE}} array(Hi) > Middle: Hi = Hi - 1: {{Cl|LOOP}} - {{Cl|IF}} Lo <= Hi {{Cl|THEN}} + {{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|IF}} Lo < finish {{Cl|THEN}} {{Cl|CALL}} QuickSort(Lo, finish, array()) -{{Cl|END SUB}} '' '' +{{Cl|IF}} Lo < finish {{Cl|THEN}} {{Cl|CALL}} QuickSort(Lo, finish, array()) +{{Cl|END SUB}} {{CodeEnd}} {{OutputStart}} array(0)= 0.20200 array(5000)= 525.8505 array(10000)= 999.6196 Elapsed time: 0.023438 seconds with 33,759 swaps @@ -125,4 +127,4 @@ Middle = array((Lo + Hi) / 2) 'find middle of array {{PageNavigation}} -< + diff --git a/internal/help/SYSTEM.txt b/internal/help/SYSTEM_111111.txt similarity index 83% rename from internal/help/SYSTEM.txt rename to internal/help/SYSTEM_111111.txt index def1e5ef3..a5abc0ecc 100644 --- a/internal/help/SYSTEM.txt +++ b/internal/help/SYSTEM_111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:16:59}} The {{KW|SYSTEM}} statement immediately closes a program and returns control to the operating system. @@ -16,10 +18,10 @@ The {{KW|SYSTEM}} statement immediately closes a program and returns control to -''Qbasic or QuickBasic:'' -* '''Qbasic BAS files can be run like compiled programs without returning to the IDE when [[SYSTEM]] is used to [[END|end]] them!''' +''QBasic or QuickBASIC:'' +* '''QBasic BAS files can be run like compiled programs without returning to the IDE when [[SYSTEM]] is used to [[END|end]] them!''' * If a program BAS module is run from the IDE, stopped by Ctrl-Break or an error occurs the QB program will exit to the IDE. -* To run a QuickBasic program without the IDE use the following DOS command line: {{text|QB.EXE /L /RUN filename.BAS|green}} +* To run a QuickBASIC program without the IDE use the following DOS command line: {{text|QB.EXE /L /RUN filename.BAS|green}} {{PageSeeAlso}} @@ -29,4 +31,4 @@ The {{KW|SYSTEM}} statement immediately closes a program and returns control to {{PageNavigation}} -< + diff --git a/internal/help/Semicolon.txt b/internal/help/Semicolon_100000000.txt similarity index 96% rename from internal/help/Semicolon.txt rename to internal/help/Semicolon_100000000.txt index 7cdfefc2e..31c3855b5 100644 --- a/internal/help/Semicolon.txt +++ b/internal/help/Semicolon_100000000.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:24:36}} The '''semicolon''' is used in a [[PRINT]] statement to stop the screen print cursor immediately after the printed value. @@ -28,4 +30,4 @@ The '''semicolon''' is used in a [[PRINT]] statement to stop the screen print cu {{PageNavigation}} -< + diff --git a/internal/help/TAB.txt b/internal/help/TAB_111.txt similarity index 88% rename from internal/help/TAB.txt rename to internal/help/TAB_111.txt index 1ce5bc5ed..e42da79ca 100644 --- a/internal/help/TAB.txt +++ b/internal/help/TAB_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:00}} The {{KW|TAB}} function is used in [[PRINT]] and [[LPRINT]] statements to move to a specified column position. @@ -11,19 +13,19 @@ The {{KW|TAB}} function is used in [[PRINT]] and [[LPRINT]] statements to move t * [[ASCII]] [[CHR$]](9) can be substituted for sequencial 9 space column moves. * [[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]]. +* '''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}} ''Example:'' Comparing TAB to [[comma]] print spacing which moves the next text print 15 columns. -{{CodeStart}} '' '' +{{CodeStart}} {{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" '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 @@ -43,4 +45,4 @@ The {{KW|TAB}} function is used in [[PRINT]] and [[LPRINT]] statements to move t {{PageNavigation}} -< + diff --git a/internal/help/TAN.txt b/internal/help/TAN_111.txt similarity index 90% rename from internal/help/TAN.txt rename to internal/help/TAN_111.txt index a3e244514..5f6d9621e 100644 --- a/internal/help/TAN.txt +++ b/internal/help/TAN_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:01}} The [[TAN]] function returns the ratio of [[SIN]]e to [[COS]]ine or tangent value of an angle measured in radians. @@ -11,11 +13,11 @@ The [[TAN]] function returns the ratio of [[SIN]]e to [[COS]]ine or tangent valu {{PageDescription}} * To convert from degrees to radians, multiply degrees * Ο€/180. -* TANGENT is the gradient or slope of the circle or arc at [[SIN]](&theta;) / [[COS]](&theta;). Do not use division when the [[COS]] = 0 to avoid [[ERROR Codes|errors]]. +* TANGENT is the gradient or slope of the circle or arc at [[SIN]](ι) / [[COS]](ι). Do not use division when the [[COS]] = 0 to avoid [[ERROR Codes|errors]]. ''Example:'' Spiraling text using the [[SIN]] and [[TAN]] functions. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DIM}} {{Cl|SHARED}} text {{Cl|AS}} {{Cl|STRING}} text$ = "S P I R A L" {{Cl|DIM}} {{Cl|SHARED}} word(1 {{Cl|TO}} {{Cl|LEN}}(text$) * 8, 1 {{Cl|TO}} 16) @@ -47,7 +49,7 @@ DO {{Cl|DIM}} xrot {{Cl|AS}} {{Cl|INTEGER}}, yrot {{Cl|AS}} {{Cl|INTEGER}}, SCALE {{Cl|AS}} {{Cl|INTEGER}}, pan {{Cl|AS}} {{Cl|INTEGER}} cstart = 0: cend = 6.2 xrot = 6: yrot = 6: SCALE = 3: pan = 30 -{{Cl|OUT}} {{Cl|&H}}3C8, 1: {{Cl|OUT}} {{Cl|&H}}3C9, 10: {{Cl|OUT}} {{Cl|&H}}3C9, 10: {{Cl|OUT}} {{Cl|&H}}3C9, 60 +{{Cl|OUT}} {{Cl|&H}}3C8, 1: {{Cl|OUT}} {{Cl|&H}}3C9, 10: {{Cl|OUT}} {{Cl|&H}}3C9, 10: {{Cl|OUT}} {{Cl|&H}}3C9, 60 DO row = 2 DO @@ -73,7 +75,7 @@ DO {{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}} '' '' +{{Cl|END SUB}} {{CodeEnd}} {{small|Code by Unseen Machine}} @@ -88,4 +90,4 @@ DO {{PageNavigation}} -< + diff --git a/internal/help/THEN.txt b/internal/help/THEN_1111.txt similarity index 67% rename from internal/help/THEN.txt rename to internal/help/THEN_1111.txt index 2e900403f..77f7ed9c4 100644 --- a/internal/help/THEN.txt +++ b/internal/help/THEN_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:02}} '''THEN''' is required in [[IF...THEN]] conditional evaluation statements. @@ -7,7 +9,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:'' @@ -17,4 +19,4 @@ {{PageNavigation}} -< + diff --git a/internal/help/TIME$.txt b/internal/help/TIME$_1111$.txt similarity index 86% rename from internal/help/TIME$.txt rename to internal/help/TIME$_1111$.txt index eaf4715d7..f5983481a 100644 --- a/internal/help/TIME$.txt +++ b/internal/help/TIME$_1111$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:04}} The '''TIME$''' Function returns a [[STRING]] representation of the current computer time in a 24 hour format. @@ -13,7 +15,7 @@ The '''TIME$''' Function returns a [[STRING]] representation of the current comp ''Example 1:'' A simple clock using [[DRAW]] with Turn Angle. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 12 {{Cl|DO}} {{Cl|CLS}} @@ -25,14 +27,14 @@ The '''TIME$''' Function returns a [[STRING]] representation of the current comp {{Cl|DRAW}} "c9ta" + {{Cl|STR$}}(s * -6) + "nu200" {{Cl|_DISPLAY}} {{Cl|_LIMIT}} 1 -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) '' '' +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) {{CodeEnd}} {{small|Code by Galleon}} : Explanation: Note that [[VAL]](TIME$) can just return the hour number 0 to 23 as the read stops at the first colon. ''Example 2:'' The following Function converts TIME$ to normal 12 hour AM-PM digital clock format. -{{CodeStart}} '' '' +{{CodeStart}} PRINT TIME$ PRINT Clock$ @@ -41,12 +43,12 @@ 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 < 10 THEN hour$ = {{Cl|STR$}}(H% - 12) ELSE hour$ = {{Cl|LTRIM$}}({{Cl|STR$}}(H% - 12)) + 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 -ELSE : IF H% < 10 THEN hour$ = {{Cl|STR$}}(H%) ' eliminate leading zeros +ELSE : IF H% < 10 THEN hour$ = {{Cl|STR$}}(H%) ' eliminate leading zeros END IF Clock$ = hour$ + min$ + ampm$ -END FUNCTION '' '' +END FUNCTION {{CodeEnd}} {{OutputStart}} 14:13:36 @@ -64,4 +66,4 @@ END FUNCTION '' '' {{PageNavigation}} -< + diff --git a/internal/help/TIMER_(statement).txt b/internal/help/TIMER_(statement)_11111_(000000000).txt similarity index 90% rename from internal/help/TIMER_(statement).txt rename to internal/help/TIMER_(statement)_11111_(000000000).txt index a67ea77d8..2b21ec756 100644 --- a/internal/help/TIMER_(statement).txt +++ b/internal/help/TIMER_(statement)_11111_(000000000).txt @@ -1,4 +1,6 @@ -A '''TIMER''' statement enables, turns off or stops timer event trapping. Qbasic only uses the base timer, but '''QB64''' can run many. +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:13:27}} +A '''TIMER''' statement enables, turns off or stops timer event trapping. QBasic only uses the base timer, but '''QB64''' can run many. QB {{PageSyntax}} @@ -16,21 +18,21 @@ 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> +
'''QB64 only'''
* 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> +
'''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. ''Example:'' How to update the time while [[PRINT|printing]] at the same time in a program. -{{CodeStart}} '' '' +{{CodeStart}} TIMER ON ' enable timer event trapping LOCATE 4, 2 ' set the starting PRINT position {{Cl|ON TIMER(n)|ON TIMER}}(10) GOSUB Clock ' set procedure execution repeat time @@ -43,9 +45,9 @@ QB64 {{PageSyntax}} col = {{Cl|POS|POS(0)}} ' Save current print cursor column. LOCATE 2, 37: PRINT {{Cl|TIME$}}; ' print current time at top of screen. LOCATE row, col ' return to last print cursor position - {{Cl|RETURN}} '' '' + {{Cl|RETURN}} {{CodeEnd}} -: NOTE: SLEEP will be interrupted in Qbasic. +: NOTE: SLEEP will be interrupted in QBasic. ''See also:'' @@ -57,4 +59,4 @@ QB64 {{PageSyntax}} {{PageNavigation}} -< + diff --git a/internal/help/TIMER.txt b/internal/help/TIMER_11111.txt similarity index 88% rename from internal/help/TIMER.txt rename to internal/help/TIMER_11111.txt index 47dbb167c..d84b07da0 100644 --- a/internal/help/TIMER.txt +++ b/internal/help/TIMER_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:05}} The '''TIMER''' function returns the number of seconds past the previous midnite down to an accuracy of 1/18th of a second. @@ -10,16 +12,16 @@ The '''TIMER''' function returns the number of seconds past the previous midnite * 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}} +* 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# = 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 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)]] * '''QB64''' can use a [[_DELAY]] down to .001(one millisecond) or [[_LIMIT]] loops per second. Both help limit program CPU usage. ''Example 1:'' Delay SUB with a midnight correction for when TIMER returns to 0. '''QB64''' can use [[_DELAY]] for delays down to .001. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DO...LOOP|DO}} {{Cl|PRINT}} "Hello"; Delay .5 'accuracy down to .05 seconds or 1/18th of a second in Qbasic @@ -33,42 +35,42 @@ 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|LOOP}} -{{Cl|END SUB}} '' '' +{{Cl|END SUB}} {{CodeEnd}} :''Explanation:'' When the delay time is added to the present TIMER value, it could be over the maximum number of 86399 seconds. So when TIMER becomes less than start it has reached midnight. The delay value then must be corrected by subtracting 86400. ''Example 2:'' Looping one TIMER tick of 1/18th of a second (ticks per second can be changed) -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DEF SEG}} = 0 ' set to {{Cl|PEEK}} and {{Cl|POKE}} {{Cl|TIMER}} Ticks {{Cl|DO...LOOP|DO}} ' main program loop ' program code {{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}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) {{Cl|DEF SEG}} ' reset segment to default -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} {{OutputStart}} 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 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! = '''TIMER''' + 1|green}} ''Example 3:'' Using a [[DOUBLE]] variable for [[TIMER]](.001) millisecond accuracy in '''QB64''' throughout the day. -{{CodeStart}} '' '' +{{CodeStart}} ts! = TIMER(.001) 'single variable td# = TIMER(.001) 'double variable PRINT "Single ="; ts! - PRINT "Double ="; td# '' '' + PRINT "Double ="; td# {{CodeEnd}} {{OutputStart}} Single = 77073.09 @@ -84,4 +86,4 @@ start! = {{Cl|TIMER}} {{PageNavigation}} -< + diff --git a/internal/help/TO.txt b/internal/help/TO_11.txt similarity index 91% rename from internal/help/TO.txt rename to internal/help/TO_11.txt index c86fea9a8..f8c84dd4a 100644 --- a/internal/help/TO.txt +++ b/internal/help/TO_11.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:06}} [[TO]] {{text|indicates a range of numerical values or an assignment of one value to another.}} @@ -6,7 +8,7 @@ ::: DIM array(1 TO 100) ::: FOR i = 1 TO 10 ::: _MAPUNICODE unicode TO asciicode -::: _SETALPHA alpha%, c1& TO c2& +::: _SETALPHA alpha%, c1& TO c2& * To specify a range in the [[CASE]] clause of a [[SELECT CASE]] statement. @@ -25,4 +27,4 @@ {{PageNavigation}} -< + diff --git a/internal/help/TYPE.txt b/internal/help/TYPE_1111.txt similarity index 96% rename from internal/help/TYPE.txt rename to internal/help/TYPE_1111.txt index 338e39942..f3bf8c58c 100644 --- a/internal/help/TYPE.txt +++ b/internal/help/TYPE_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:08}} '''TYPE''' definitions are used to create variables that can hold more than one variable type of a fixed byte length. @@ -25,7 +27,7 @@ * Once the TYPE variable is created you can find the record or byte size by using [[LEN]](typevariable). * TYPE definitions can also be placed in [[$INCLUDE]] .BI text files such as [[QB.BI]] is used by [[INTERRUPT]] and [[INTERRUPTX]]. * '''[[_BIT]] is not currently supported in User Defined [[TYPE]]s'''. -* '''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!''' +* '''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!''' {{DataTypeTable}} @@ -50,7 +52,7 @@ InRegs.AX = 3 ' sets the mouse function to read the mouse buttons and position. - {{Cl|CALL}} {{Cl|INTERRUPT}}(&H33, InRegs, OutRegs) + {{Cl|CALL}} {{Cl|INTERRUPT}}(&H33, InRegs, OutRegs) column% = OutRegs.CX ' returns the current mouse column position {{CodeEnd}} @@ -104,7 +106,7 @@ foobar.a = 15.5 foobar.c.b = "this is me" PRINT foobar.a, foobar.c.b -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} @@ -130,7 +132,7 @@ PRINT foobar.a, foobar.c.b Yres AS LONG ' Depth in PELS per metre 4 NumColors AS LONG ' Number of Colors 4 SigColors AS LONG ' Significant Colors 4 - END TYPE ' Total Header bytes = 54 '' '' + END TYPE ' Total Header bytes = 54 {{TextEnd}} {{CodeStart}} '{{Cl|$INCLUDE}}: 'Bitmap.BI' 'use only when including a BI file @@ -141,7 +143,7 @@ PRINT foobar.a, foobar.c.b {{CodeEnd}} :''Explanation:'' Use one [[GET]] to read all of the header information from the start of the bitmap file opened AS [[BINARY]]. It reads all 54 bytes as [[STRING]], [[INTEGER]] and [[LONG]] type DOT variable values. -:NOTE: BPP returns 4(16 colors), 8(256 colors) or 24(16 million colors) bits per pixel in Qbasic. 24 bit can only be in greyscale. +:NOTE: BPP returns 4(16 colors), 8(256 colors) or 24(16 million colors) bits per pixel in QBasic. 24 bit can only be in greyscale. :Then use the DOT variable name values like this [[GET (graphics statement)]] after you load the bitmap image to the screen: @@ -163,4 +165,4 @@ PRINT foobar.a, foobar.c.b {{PageNavigation}} -< + diff --git a/internal/help/UBOUND.txt b/internal/help/UBOUND_111111.txt similarity index 72% rename from internal/help/UBOUND.txt rename to internal/help/UBOUND_111111.txt index bdf7f67c0..aae81cdbc 100644 --- a/internal/help/UBOUND.txt +++ b/internal/help/UBOUND_111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:09}} The {{KW|UBOUND}} function returns the largest valid index (upper bound) of an array dimension. @@ -8,9 +10,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 '''1''' for the first dimension. +** If omitted, {{Parameter|dimension%}} is assumed to be '''1'''. +** If {{Parameter|dimension%}} is less than '''1''' 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. @@ -33,4 +35,4 @@ The {{KW|UBOUND}} function returns the largest valid index (upper bound) of an a {{PageNavigation}} -< + diff --git a/internal/help/UCASE$.txt b/internal/help/UCASE$_11111$.txt similarity index 93% rename from internal/help/UCASE$.txt rename to internal/help/UCASE$_11111$.txt index 1025bdde6..257963182 100644 --- a/internal/help/UCASE$.txt +++ b/internal/help/UCASE$_11111$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:10}} The [[UCASE$]] function outputs an all-uppercase version of a [[STRING]]. @@ -27,4 +29,4 @@ The [[UCASE$]] function outputs an all-uppercase version of a [[STRING]]. {{PageNavigation}} -< + diff --git a/internal/help/UEVENT.txt b/internal/help/UEVENT_111111.txt similarity index 93% rename from internal/help/UEVENT.txt rename to internal/help/UEVENT_111111.txt index a4ddeecac..a52a1cd37 100644 --- a/internal/help/UEVENT.txt +++ b/internal/help/UEVENT_111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:11}} The '''UEVENT''' Statement uses ON, OFF or STOP to enable, turn off or suspend user event trapping. @@ -18,4 +20,4 @@ The '''UEVENT''' Statement uses ON, OFF or STOP to enable, turn off or suspend u {{PageNavigation}} -< + diff --git a/internal/help/UNLOCK.txt b/internal/help/UNLOCK.txt deleted file mode 100644 index 8339a2c43..000000000 --- a/internal/help/UNLOCK.txt +++ /dev/null @@ -1,28 +0,0 @@ -The {{KW|UNLOCK}} statement opens access to parts or all of a file to other programs and network users. - - -{{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> - - -{{PageDescription}} -* {{Parameter|fileNumber%}} is the file number of the file to unlock. -* In the first syntax, the entire file is unlocked. -* In the second syntax, {{Parameter|record&}} is the record number of the file to unlock. -* In the third syntax, the records or bytes in the range [{{Parameter|firstRecord&}},{{Parameter|lastRecord&}}] are unlocked. If {{Parameter|firstRecord&}} is omitted, it is assumed to be the first record or byte. -* For files opened in [[BINARY]] mode, each record corresponds to a single byte. -* [[LOCK]] and UNLOCK statements are always used in pairs and each statement must match the other one. -* Files must be unlocked before other programs can access them, and before the file is closed. -* [[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Keyword Not Supported in Linux or MAC versions]] - - -{{PageSeeAlso}} -* {{KW|LOCK}} -* {{KW|OPEN}} -* {{KW|ACCESS}} - - -{{PageNavigation}} -< diff --git a/internal/help/UNLOCK_111111.txt b/internal/help/UNLOCK_111111.txt new file mode 100644 index 000000000..138fbf250 --- /dev/null +++ b/internal/help/UNLOCK_111111.txt @@ -0,0 +1,30 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:13}} +This statement opens access to parts or all of a file to other programs and network users. + + +{{PageSyntax}} +: [[UNLOCK]] [#]{{Parameter|fileNumber%}} +: [[UNLOCK]] [#]{{Parameter|fileNumber%}}, {{Parameter|record&}} +: [[UNLOCK]] [#]{{Parameter|fileNumber%}}, [{{Parameter|firstRecord&}}] TO {{Parameter|lastRecord&}} + + +{{PageDescription}} +* {{Parameter|fileNumber%}} is the file number of the file to unlock. +* In the first syntax, the entire file is unlocked. +* In the second syntax, {{Parameter|record&}} is the record number of the file to unlock. +* In the third syntax, the records or bytes in the range [{{Parameter|firstRecord&}},{{Parameter|lastRecord&}}] are unlocked. If {{Parameter|firstRecord&}} is omitted, it is assumed to be the first record or byte. +* For files opened in [[BINARY]] mode, each record corresponds to a single byte. +* [[LOCK]] and [[UNLOCK]] statements are always used in pairs and each statement must match the other one. +* Files must be unlocked before other programs can access them, and before the file is closed. +* [[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Keyword Not Supported in Linux or MAC versions]] + + +{{PageSeeAlso}} +* [[LOCK]] +* [[OPEN]] +* [[ACCESS]] + + +{{PageNavigation}} + diff --git a/internal/help/UNTIL.txt b/internal/help/UNTIL_11111.txt similarity index 92% rename from internal/help/UNTIL.txt rename to internal/help/UNTIL_11111.txt index 245e7c22a..76d391cf8 100644 --- a/internal/help/UNTIL.txt +++ b/internal/help/UNTIL_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:14}} The '''UNTIL''' condition is used in [[DO...LOOP]] exit verifications. @@ -25,4 +27,4 @@ The '''UNTIL''' condition is used in [[DO...LOOP]] exit verifications. *[[WHILE...WEND]] {{PageNavigation}} -< + diff --git a/internal/help/Underscore.txt b/internal/help/Underscore_1000000000.txt similarity index 82% rename from internal/help/Underscore.txt rename to internal/help/Underscore_1000000000.txt index 45a42166a..7b6446094 100644 --- a/internal/help/Underscore.txt +++ b/internal/help/Underscore_1000000000.txt @@ -1,8 +1,10 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:24:47}} An '''underscore''' can be used at the end of a line of code to continue a code line to the next line. -''Usage:'' IF x + y > 500 AND x + y < 600 THEN_ +''Usage:'' IF x + y > 500 AND x + y < 600 THEN_ :::PRINT x + y @@ -10,7 +12,7 @@ An '''underscore''' can be used at the end of a line of code to continue a code * The underscore can be anywhere after the code on that line to continue the code to the next line in QB64. * Multiple underscores can be used for the same line of code in QB64 only. * Underscores can be used in the middle of variable, sub procedure or [[CONST|constant]] names. -* '''The underscore is NOT compatible with Qbasic! The Qbasic IDE will remove or move code with leading underscores!''' +* '''The underscore is NOT compatible with QBasic! The QBasic IDE will remove or move code with leading underscores!''' * In [[PRINT USING]] an underscore can precede a formatting character to display that character as text in a template [[STRING]]. @@ -21,4 +23,4 @@ An '''underscore''' can be used at the end of a line of code to continue a code {{PageNavigation}} -< + diff --git a/internal/help/VAL.txt b/internal/help/VAL_111.txt similarity index 54% rename from internal/help/VAL.txt rename to internal/help/VAL_111.txt index 156c27eb5..b0cbe980f 100644 --- a/internal/help/VAL.txt +++ b/internal/help/VAL_111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:15}} The '''VAL''' Function returns the decimal numerical equivalent value of a [[STRING]] numerical value. @@ -5,31 +7,31 @@ 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 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'''. +:String values with "D" and "E" letters between numbers may be converted also! EX: '''{{text|VAL("9D4") = 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% = VAL("&HFFFF") = -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 '' '' +''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 {{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}} '' '' +{{CodeStart}} text$ = "1.23Hello" number! = VAL(text$) - PRINT number! '' '' + PRINT number! {{CodeEnd}} {{OutputStart}} 1.23 @@ -37,9 +39,9 @@ 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}} '' '' +{{CodeStart}} a$ = "33" - PRINT VAL("10") + VAL(a$) + 1 '' '' + PRINT VAL("10") + VAL(a$) + 1 {{CodeEnd}} {{OutputStart}} 44 @@ -54,16 +56,16 @@ The '''VAL''' Function returns the decimal numerical equivalent value of a [[STR ''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% '' '' + PRINT decimal% {{CodeEnd}} {{OutputStart}} -&H60 +&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:'' @@ -72,4 +74,4 @@ The '''VAL''' Function returns the decimal numerical equivalent value of a [[STR {{PageNavigation}} -< + diff --git a/internal/help/VARPTR$.txt b/internal/help/VARPTR$_111111$.txt similarity index 91% rename from internal/help/VARPTR$.txt rename to internal/help/VARPTR$_111111$.txt index 15b03d23b..a4c010b6a 100644 --- a/internal/help/VARPTR$.txt +++ b/internal/help/VARPTR$_111111$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:18}} '''VARPTR$''' is a memory function that returns a [[STRING]] representation of a variable's memory address value for use in a [[DRAW]] or [[PLAY]] statement. @@ -13,7 +15,7 @@ ''Example 1:'' How VARPTR$ reads consecutive values from memory. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN (statement)|SCREEN}} 2 {{Cl|CLS}} WIND$ = "r10 d7 l10 u7 br20" 'create draw string to be read by function @@ -22,13 +24,13 @@ ROW$ = "x"+{{Cl|VARPTR$}}(WIND$)+"x"+{{Cl|VARPTR$}}(WIND$)+"x"+{{Cl|VARPTR$}}(WI {{Cl|DRAW}} "bm 115,52" {{Cl|FOR...NEXT|FOR}} I = 1 {{Cl|TO}} 10 {{Cl|DRAW}} "x" + {{Cl|VARPTR$}}(ROW$) -{{Cl|NEXT}} '' '' +{{Cl|NEXT}} {{CodeEnd}} -:''NOTE:'' '''GWBasic''' allows '''semicolons''' to be used in the ROW$ definition, but Qbasic and '''QB64''' MUST use '''+''' concatenation. +:''NOTE:'' '''GWBasic''' allows '''semicolons''' to be used in the ROW$ definition, but QBasic and '''QB64''' MUST use '''+''' concatenation. ''Example 2:'' Using the function to change a Turn Angle value using DRAW. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN (statement)|SCREEN}} 12 'Demonstrates how string DRAW angles are used with TA {{Cl|FOR...NEXT|FOR}} i = 0 {{Cl|TO}} 360 {{Cl|STEP}} 30 'mark clock hours every 30 degrees @@ -44,17 +46,17 @@ ROW$ = "x"+{{Cl|VARPTR$}}(WIND$)+"x"+{{Cl|VARPTR$}}(WIND$)+"x"+{{Cl|VARPTR$}}(WI 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|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|LOOP}} '' '' +{{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. ''Example 3:'' Comparing DRAW moves using VARPTR$ and [[STR$]] values. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 12 {{Cl|PSET}} (200, 200), 12 {{Cl|CIRCLE}} {{Cl|STEP}}(0, 0), 5, 10 @@ -65,7 +67,7 @@ A = 100: B = 100 {{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|END}} '' '' +{{Cl|END}} {{CodeEnd}} : ''Explanation:'' A negative STR$ value will move the DRAW relatively where VARPTR$ won't without the sign before the equal. @@ -76,4 +78,4 @@ C = 100: D = -100 {{PageNavigation}} -< + diff --git a/internal/help/VARPTR.txt b/internal/help/VARPTR_111111.txt similarity index 91% rename from internal/help/VARPTR.txt rename to internal/help/VARPTR_111111.txt index c01e67d66..1bd457b1b 100644 --- a/internal/help/VARPTR.txt +++ b/internal/help/VARPTR_111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:16}} The '''VARPTR''' function returns an [[INTEGER]] value that is the offset part of the variable or array memory address within it's segment. @@ -8,7 +10,7 @@ The '''VARPTR''' function returns an [[INTEGER]] value that is the offset part o * If variablename is not defined before VARPTR or [[VARSEG]] is called, the variable is created and it's address is returned. * Reference index is used to set the offset address of an array index, not necessarily the lowest index. * When a string variable, VARPTR returns the offset address location of the first byte of the string. -* Because many Qbasic statements change the locations of variables in memory, use the values returned by VARPTR and VARSEG immediately after the functions are used! +* Because many QBasic statements change the locations of variables in memory, use the values returned by VARPTR and VARSEG immediately after the functions are used! * Integer array sizes are limited to 32767 elements when using [[VARPTR]] in QB and '''QB64'''!. Create a larger array using [[_BYTE]]. Example: [[DIM]] [[SHARED]] Memory (65535) AS [[_UNSIGNED]] [[_BYTE]] * '''Warning: DEF SEG, VARSEG , VARPTR, PEEK or POKE access QB64's emulated 16 bit conventional memory block!''' : '''It is highly recommended that QB64's [[_MEM]] memory system be used to avoid running out of memory.''' @@ -22,4 +24,4 @@ The '''VARPTR''' function returns an [[INTEGER]] value that is the offset part o {{PageNavigation}} -< + diff --git a/internal/help/VARSEG.txt b/internal/help/VARSEG_111111.txt similarity index 91% rename from internal/help/VARSEG.txt rename to internal/help/VARSEG_111111.txt index 226a6689c..2a621b27b 100644 --- a/internal/help/VARSEG.txt +++ b/internal/help/VARSEG_111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:19}} The '''VARSEG''' function returns an [[INTEGER]] value that is the segment part of a variable or array memory address. @@ -9,7 +11,7 @@ The '''VARSEG''' function returns an [[INTEGER]] value that is the segment part * If variablename is not defined before [[VARPTR]] or VARSEG is called, the variable is created and its address is returned. * The start index is the lowest index of an array variable when used. * When a string variable, VARSEG returns the segment location address of the first byte of the string. -* Because many Qbasic statements change the locations of variables in memory, use the values returned by VARPTR and VARSEG immediately after the functions are used! +* Because many QBasic statements change the locations of variables in memory, use the values returned by VARPTR and VARSEG immediately after the functions are used! * Integer array sizes are limited to 32767 elements when using [[VARSEG]] in QB and '''QB64'''!. Create a larger array using [[_BYTE]]. Example: [[DIM]] [[SHARED]] Memory (65535) AS [[_UNSIGNED]] [[_BYTE]] * '''Warning: DEF SEG, VARSEG , VARPTR, PEEK or POKE access QB64's emulated 16 bit conventional memory block!''' : '''It is highly recommended that QB64's [[_MEM]] memory system be used to avoid running out of memory.''' @@ -23,4 +25,4 @@ The '''VARSEG''' function returns an [[INTEGER]] value that is the segment part {{PageNavigation}} -< + diff --git a/internal/help/VIEW.txt b/internal/help/VIEW_1111.txt similarity index 97% rename from internal/help/VIEW.txt rename to internal/help/VIEW_1111.txt index dabb19d4e..3bc792ab8 100644 --- a/internal/help/VIEW.txt +++ b/internal/help/VIEW_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:20}} The '''VIEW''' statement creates a graphics view port area by defining the coordinate limits to be viewed. @@ -40,4 +42,4 @@ The '''VIEW''' statement creates a graphics view port area by defining the coord {{PageNavigation}} -< + diff --git a/internal/help/VIEW_PRINT.txt b/internal/help/VIEW_PRINT_1111_11111.txt similarity index 91% rename from internal/help/VIEW_PRINT.txt rename to internal/help/VIEW_PRINT_1111_11111.txt index c69ee1948..2b6bb23b7 100644 --- a/internal/help/VIEW_PRINT.txt +++ b/internal/help/VIEW_PRINT_1111_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:21}} The [[VIEW PRINT]] statement defines the boundaries of a text viewport {{KW|PRINT}} area. @@ -23,8 +25,8 @@ The [[VIEW PRINT]] statement defines the boundaries of a text viewport {{KW|PRIN {{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|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 @@ -45,7 +47,7 @@ The [[VIEW PRINT]] statement defines the boundaries of a text viewport {{KW|PRIN {{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. @@ -58,4 +60,4 @@ The [[VIEW PRINT]] statement defines the boundaries of a text viewport {{KW|PRIN {{PageNavigation}} -< + diff --git a/internal/help/WAIT.txt b/internal/help/WAIT_1111.txt similarity index 85% rename from internal/help/WAIT.txt rename to internal/help/WAIT_1111.txt index 506ea42e4..d9eca1a6f 100644 --- a/internal/help/WAIT.txt +++ b/internal/help/WAIT_1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:23}} The {{KW|WAIT}} statement waits until the value read from an I/O port has certain bits set. @@ -18,8 +20,8 @@ The {{KW|WAIT}} statement waits until the value read from an I/O port has certai {{CodeStart}}' Either statement can be used to try to reduce screen flickering. ' If both statements are used, try changing the order. -WAIT &H3DA, 8 ' finishes whenever the screen isn't being written to -WAIT &H3DA, 8, 8 ' finishes whenever the screen is being written to +WAIT &H3DA, 8 ' finishes whenever the screen isn't being written to +WAIT &H3DA, 8, 8 ' finishes whenever the screen is being written to {{CodeEnd}} @@ -29,4 +31,4 @@ WAIT &H3DA, 8, 8 ' finishes whenever the screen is being written to {{PageNavigation}} -< + diff --git a/internal/help/WEND.txt b/internal/help/WEND.txt deleted file mode 100644 index f8206b515..000000000 --- a/internal/help/WEND.txt +++ /dev/null @@ -1,2 +0,0 @@ -#REDIRECT [[WHILE...WEND]] -< diff --git a/internal/help/WEND_1111.txt b/internal/help/WEND_1111.txt new file mode 100644 index 000000000..4a66b5ecf --- /dev/null +++ b/internal/help/WEND_1111.txt @@ -0,0 +1,4 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:24}} +See page [[WHILE...WEND]] + diff --git a/internal/help/WHILE...WEND.txt b/internal/help/WHILE...WEND_11111...1111.txt similarity index 90% rename from internal/help/WHILE...WEND.txt rename to internal/help/WHILE...WEND_11111...1111.txt index d96bd2e11..1598e212a 100644 --- a/internal/help/WHILE...WEND.txt +++ b/internal/help/WHILE...WEND_11111...1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:27}} The {{KW|WHILE...WEND}} statement is used to repeat a block of statements while the condition is met. @@ -23,19 +25,19 @@ The {{KW|WHILE...WEND}} statement is used to repeat a block of statements while {{PageExamples}} ''Example 1:'' Reading an entire file. Example assumes the program has a [[OPEN|file opened]] as #1 -{{CodeStart}} '' '' +{{CodeStart}} {{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$ IF {{Cl|INKEY$}} = {{Cl|CHR$}}(27) THEN {{Cl|EXIT}} {{Cl|WHILE}} 'ESC key exits {{Cl|PRINT}} text$ -{{Cl|WEND}} '' '' +{{Cl|WEND}} {{CodeEnd}} ''Example 2:'' Clearing the keyboard buffer. -{{CodeStart}} '' '' -{{Cl|WHILE}} {{Cl|INKEY$}} <> "" : {{Cl|WEND}} '' '' +{{CodeStart}} +{{Cl|WHILE}} {{Cl|INKEY$}} <> "" : {{Cl|WEND}} {{CodeEnd}} @@ -47,4 +49,4 @@ The {{KW|WHILE...WEND}} statement is used to repeat a block of statements while {{PageNavigation}} -< + diff --git a/internal/help/WHILE.txt b/internal/help/WHILE.txt deleted file mode 100644 index f8206b515..000000000 --- a/internal/help/WHILE.txt +++ /dev/null @@ -1,2 +0,0 @@ -#REDIRECT [[WHILE...WEND]] -< diff --git a/internal/help/WHILE_11111.txt b/internal/help/WHILE_11111.txt new file mode 100644 index 000000000..3f5ccd672 --- /dev/null +++ b/internal/help/WHILE_11111.txt @@ -0,0 +1,4 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:25}} +See page [[WHILE...WEND]] + diff --git a/internal/help/WIDTH.txt b/internal/help/WIDTH_11111.txt similarity index 95% rename from internal/help/WIDTH.txt rename to internal/help/WIDTH_11111.txt index 93d8a25f2..df83d418b 100644 --- a/internal/help/WIDTH.txt +++ b/internal/help/WIDTH_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:28}} The {{KW|WIDTH}} statement changes the text dimensions of certain {{KW|SCREEN (statement)|SCREEN}} modes. @@ -14,7 +16,7 @@ The {{KW|WIDTH}} statement changes the text dimensions of certain {{KW|SCREEN (s ''Usage:'' * WIDTH should be used AFTER a program SCREEN statement! It does not affect screen graphics or graphic coordinates. -* Affects SCREEN 0 Window size and alters the text block size of each screen mode listed in Qbasic: +* Affects SCREEN 0 Window size and alters the text block size of each screen mode listed in QBasic: :* SCREEN 0 can use 80 or 40 columns and 25, 43 or 50 rows. Default is WIDTH 80, 25. :* SCREEN 9 can use 80 columns and 25 or 43(not supported on many monitors) rows. Default WIDTH 80, 25 fullscreen. :* SCREEN 10 can use 80 columns and 25 or 43 rows. Default is WIDTH 80, 25 fullscreen. @@ -33,4 +35,4 @@ The {{KW|WIDTH}} statement changes the text dimensions of certain {{KW|SCREEN (s {{PageNavigation}} -< + diff --git a/internal/help/WINDOW.txt b/internal/help/WINDOW_111111.txt similarity index 78% rename from internal/help/WINDOW.txt rename to internal/help/WINDOW_111111.txt index 225c5ae5b..6fc7438c4 100644 --- a/internal/help/WINDOW.txt +++ b/internal/help/WINDOW_111111.txt @@ -1,17 +1,20 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:29}} 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'''] (''x1!'', ''y1!'') - (''x2!'', ''y2!'')] +{{PageParameters}} 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 == +{{PageDescription}} 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> +{{TextStart}} +{{Cb|SCREEN}} {{Cb|_NEWIMAGE}}(600, 600, 32) '600 pixels in x and y directions and displayed on screen +{{Cb|WINDOW}} {{Cb|SCREEN}} (0, 0)-(6, 6) +{{TextEnd}} 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. 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. @@ -22,20 +25,20 @@ Although '''WINDOW''' affects all coordinates, it does not affect all graphics o 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. -== Examples == +{{PageExamples}} Demonstrate a circle's radius only matching the scaling in the horizontal direction by comparing against a box: {{CodeStart}} -SCREEN _NEWIMAGE(640, 480, 32) 'Not a square image -WINDOW SCREEN (0, 0)-(10, 10) 'SCREEN keeps the axis direction the same -LINE (4, 4)-(6, 6), _RGB32(255, 0, 0), BF 'Red square centred on (5, 5); will be stretched into a rectangle -CIRCLE (5, 5), 1, _RGB32(0, 255, 0) 'Green circle at (5, 5) with radius 1 +{{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, 32) 'Not a square image +{{Cl|WINDOW}} {{Cl|SCREEN}} (0, 0)-(10, 10) 'SCREEN keeps the axis direction the same +{{Cl|LINE}} (4, 4)-(6, 6), {{Cl|_RGB32}}(255, 0, 0), BF 'Red square centred on (5, 5); will be stretched into a rectangle +{{Cl|CIRCLE}} (5, 5), 1, {{Cl|_RGB32}}(0, 255, 0) 'Green circle at (5, 5) with radius 1 {{CodeEnd}} -== See also == +{{PageSeeAlso}} * [[PMAP]] * [[VIEW]] * [[VIEW PRINT]] {{PageNavigation}} -< + diff --git a/internal/help/WRITE_(file_statement).txt b/internal/help/WRITE_(file_statement)_11111_(0000_000000000).txt similarity index 85% rename from internal/help/WRITE_(file_statement).txt rename to internal/help/WRITE_(file_statement)_11111_(0000_000000000).txt index f39190a7a..7d118c82b 100644 --- a/internal/help/WRITE_(file_statement).txt +++ b/internal/help/WRITE_(file_statement)_11111_(0000_000000000).txt @@ -1,12 +1,14 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:32}} The [[WRITE (file statement)|WRITE #]] file statement writes a list of comma separated variable values to a sequential file or port. {{PageSyntax}} -:{{KW|WRITE (file statement)|WRITE #}}{{Parameter|filenumber&}}[, {{Parameter|expressionList}}] +:{{KW|WRITE (file statement)|WRITE #}}{{Parameter|filenumber&}}[, {{Parameter|expressionList}}] {{PageDescription}} -* {{Parameter|filenumber&}} is the number of the file or device {{KW|OPEN}}ed in the {{KW|OUTPUT}} or {{KW|APPEND}} modes. See: {{KW|FREEFILE}}. +* {{Parameter|filenumber&}} is the number of the file or device {{KW|OPEN}}ed in the {{KW|OUTPUT}} or {{KW|APPEND}} modes. See: {{KW|FREEFILE}}. * {{Parameter|expressionList}} is a comma-separated list of values to be written to the file or device. * WRITE can place any number and types of variable values needed in a file record separated by commas. * String values will have quotation marks although quotes are not required to read strings in CSV files with [[INPUT (file statement)|INPUT]] #. @@ -18,7 +20,7 @@ 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}} '' '' +{{CodeStart}} filename$ = "testfile.dat" x = 1: y = 2: z$ = "Three" @@ -41,10 +43,12 @@ K$ = {{Cl|INPUT$}}(1) 'press a key {{Cl|PRINT}} a, b, c$ {{Cl|WRITE}} a, b, c$ -{{Cl|END}} '' '' +{{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" @@ -59,4 +63,4 @@ K$ = {{Cl|INPUT$}}(1) 'press a key {{PageNavigation}} -< + diff --git a/internal/help/WRITE.txt b/internal/help/WRITE_11111.txt similarity index 94% rename from internal/help/WRITE.txt rename to internal/help/WRITE_11111.txt index aa91cd6ce..5b988cb52 100644 --- a/internal/help/WRITE.txt +++ b/internal/help/WRITE_11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:30}} The {{KW|WRITE}} statement writes a [[comma]]-separated list of values to the screen without spacing. @@ -23,7 +25,7 @@ c! = 3.1415 {{CodeEnd}} {{OutputStart}} 123 Hello 3.1415 -123,"Hello",3.1415 '' '' +123,"Hello",3.1415 {{OutputEnd}} @@ -35,4 +37,4 @@ c! = 3.1415 {{PageNavigation}} -< + diff --git a/internal/help/XOR.txt b/internal/help/XOR.txt deleted file mode 100644 index 3b909a172..000000000 --- a/internal/help/XOR.txt +++ /dev/null @@ -1,103 +0,0 @@ -Bitwise operators are much like the regular mathematics operators (+, * etc.) but are defined in terms of the individual bits of their operands. The full list of bitwise operators, with a brief summary of its operation: -* '''AND''': True if both inputs are true -* '''OR''': True if one or both inputs are true -* '''NOT''': Invert all bits -* '''XOR''': True if exactly one input is true -* '''IMP''': True if both inputs are the same -* '''EQV''': True unless first input is true and second is false - -== Syntax == -With the exception of NOT, all the bitwise operators take two operands: -::: ''result'' = ''value1'' '''AND''' ''value2'' -NOT goes before the value it operates on: -::: ''result'' = '''NOT''' ''value1'' -If ''value1'' or ''value2'' are non-integer numeric types, they are rounded to the nearest integer. - -== Details == -Bitwise operators work by comparing the corresponding bits in each of the input values to generate a single bit in the output value. The operators differ in how they do the comparison. The table below shows the output bit for each pair of input bits: -{| class="wikitable" -!colspan="2"|'''Operands''' -!colspan="6"|'''Operations''' -|- -!A !! B !! A AND B !! A OR B !! NOT A !! A XOR B !! A IMP B !! A EQV B -|- -|0 || 0 || 0 || 0 || 1 || 0 || 1 || 1 -|- -|0 || 1 || 0 || 1 || 1 || 1 || 1 || 0 -|- -|1 || 0 || 0 || 1 || 0 || 1 || 0 || 0 -|- -|1 || 1 || 1 || 1 || 0 || 0 || 1 || 1 -|} -Again, note that the NOT operator only has one operand. It is shown in the same table for convenience. - -If one input has more bits than the other (say, an INTEGER vs a LONG) the shorter will be considered to have 0's in the missing bit positions if it is positive, or 1's if it is negative. This scheme comes about because of the [[wikipedia:Two's_complement|Two's Complement]] system for representing negative numbers. As a general rule, there should not be any surprises. - -=== Use as logical operators === -QB64 does not have AND/OR/NOT operators dedicated to operating on the overall truth of values. A numeric value is defined to be ''false'' if it is equal to 0, and ''true'' for any other value, though -1 is the standard ''true'' value, returned by the <, <= etc. operators. One can use the bitwise operators mostly like regular logical operators, but with caution. For instance, 3 is a true value, so as a logical operator NOT 3 would be 0 (false). Because it is in fact a bitwise operator, it evaluates to -4. - -== Examples == -Use '''AND''' to mask certain bits in a value. In this example, the 1's in the mask (y&) specify which bits in (x&) we are interested in, forcing all others to 0. -<source lang="qbasic"> -x& = VAL("&B101010") 'Arbitrary collection of bits -y& = VAL("&B001100") 'A bit mask -PRINT "Input 1: "; BIN$(x&, 6) '6 indicates we want 6 bits of output -PRINT "Input 2: "; BIN$(y&, 6) -PRINT "Output: "; BIN$(x& AND y&, 6) - -'Converts the number n& to a string of binary digits, digits& long (padding or truncating as necessary). -FUNCTION BIN$ (n&, digits&) - FOR i& = digits& - 1 TO 0 STEP -1 - IF (n& AND 2 ^ i&) THEN B$ = B$ + "1" ELSE B$ = B$ + "0" - NEXT - BIN$ = B$ -END FUNCTION -</source> -Output: -<pre>Input 1: 101010 -Input 2: 001100 -Output: 001000</pre> - -Use '''OR''' to combine bit flags into a single value. The presence of a flag can then be tested by using the flag as a mask with '''AND''': -<source lang="qbasic"> -'The trick here is to give each flag a value corresponding to a different bit being 1 -FLAG_A& = VAL("&B0001") -FLAG_B& = VAL("&B0010") -FLAG_C& = VAL("&B0100") -FLAG_D& = VAL("&B1000") - -flags& = FLAG_A& OR FLAG_C& 'Set flags A, C - -'Use each flag as a bitmask to test for its presence: -IF flags& AND FLAG_A& THEN PRINT "Flag A is set" -IF flags& AND FLAG_B& THEN PRINT "Flag B is set" -IF flags& AND FLAG_C& THEN PRINT "Flag C is set" -IF flags& AND FLAG_D& THEN PRINT "Flag D is set" -</source> -Output: -<pre>Flag A is set -Flag C is set</pre> - -Use '''XOR''' to toggle a bit flag (that is, change its state to the opposite of what it was). This example is the same as the '''OR''' example above, but with one extra line added. This time we enable flags A & C, then toggle flags A & B. This will disable flag A and enable B. -<source lang="qbasic"> -'The trick here is to give each flag a value corresponding to a different bit being 1 -FLAG_A& = VAL("&B0001") -FLAG_B& = VAL("&B0010") -FLAG_C& = VAL("&B0100") -FLAG_D& = VAL("&B1000") - -flags& = FLAG_A& OR FLAG_C& 'Set flags A, C -flags& = flags& XOR FLAG_A& XOR FLAG_B& 'Toggle flags A, B - -'Use each flag as a bitmask to test for its presence: -IF flags& AND FLAG_A& THEN PRINT "Flag A is set" -IF flags& AND FLAG_B& THEN PRINT "Flag B is set" -IF flags& AND FLAG_C& THEN PRINT "Flag C is set" -IF flags& AND FLAG_D& THEN PRINT "Flag D is set" -</source> -Output: -<pre>Flag B is set -Flag C is set</pre> - -{{PageNavigation}} -< diff --git a/internal/help/XOR_111.txt b/internal/help/XOR_111.txt new file mode 100644 index 000000000..1b36a2732 --- /dev/null +++ b/internal/help/XOR_111.txt @@ -0,0 +1,108 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:33}} +Bitwise operators are much like the regular mathematics operators (+, * etc.) but are defined in terms of the individual bits of their operands. The full list of bitwise operators, with a brief summary of its operation: +* '''AND''': True if both inputs are true +* '''OR''': True if one or both inputs are true +* '''NOT''': Invert all bits +* '''XOR''': True if exactly one input is true +* '''IMP''': True if both inputs are the same +* '''EQV''': True unless first input is true and second is false + +{{PageSyntax}} +With the exception of NOT, all the bitwise operators take two operands: +: ''result'' = ''value1'' '''AND''' ''value2'' +NOT goes before the value it operates on: +: ''result'' = '''NOT''' ''value1'' +If ''value1'' or ''value2'' are non-integer numeric types, they are rounded to the nearest integer. + +{{PageDescription}} +Bitwise operators work by comparing the corresponding bits in each of the input values to generate a single bit in the output value. The operators differ in how they do the comparison. The table below shows the output bit for each pair of input bits: +{| class="wikitable" +! colspan="2"|Operands +! colspan="6"|Operations +|- +! A !! B !! A AND B !! A OR B !! NOT A !! A XOR B !! A IMP B !! A EQV B +|- +| align="center"|0 || align="center"|0 || align="center"|0 || align="center"|0 || align="center"|1 || align="center"|0 || align="center"|1 || align="center"|1 +|- +| align="center"|0 || align="center"|1 || align="center"|0 || align="center"|1 || align="center"|1 || align="center"|1 || align="center"|1 || align="center"|0 +|- +| align="center"|1 || align="center"|0 || align="center"|0 || align="center"|1 || align="center"|0 || align="center"|1 || align="center"|0 || align="center"|0 +|- +| align="center"|1 || align="center"|1 || align="center"|1 || align="center"|1 || align="center"|0 || align="center"|0 || align="center"|1 || align="center"|1 +|} +Again, note that the NOT operator only has one operand. It is shown in the same table for convenience. + +If one input has more bits than the other (say, an INTEGER vs a LONG) the shorter will be considered to have 0's in the missing bit positions if it is positive, or 1's if it is negative. This scheme comes about because of the [[wikipedia:Two's_complement|Two's Complement]] system for representing negative numbers. As a general rule, there should not be any surprises. + +=== Use as logical operators === +QB64 does not have AND/OR/NOT operators dedicated to operating on the overall truth of values. A numeric value is defined to be ''false'' if it is equal to 0, and ''true'' for any other value, though -1 is the standard ''true'' value, returned by the <, <= etc. operators. One can use the bitwise operators mostly like regular logical operators, but with caution. For instance, 3 is a true value, so as a logical operator NOT 3 would be 0 (false). Because it is in fact a bitwise operator, it evaluates to -4. + +{{PageExamples}} +;Example 1:Use '''AND''' to mask certain bits in a value. In this example, the 1's in the mask (y&) specify which bits in (x&) we are interested in, forcing all others to 0. +{{CodeStart}} +x& = VAL("&B101010") 'Arbitrary collection of bits +y& = VAL("&B001100") 'A bit mask +PRINT "Input 1: "; BIN$(x&, 6) '6 indicates we want 6 bits of output +PRINT "Input 2: "; BIN$(y&, 6) +PRINT "Output: "; BIN$(x& AND y&, 6) + +'Converts the number n& to a string of binary digits, digits& long (padding or truncating as necessary). +FUNCTION BIN$ (n&, digits&) + FOR i& = digits& - 1 TO 0 STEP -1 + IF (n& AND 2 ^ i&) THEN B$ = B$ + "1" ELSE B$ = B$ + "0" + NEXT + BIN$ = B$ +END FUNCTION +{{CodeEnd}} +{{OutputStart}} +Input 1: 101010 +Input 2: 001100 +Output: 001000 +{{OutputEnd}} + +;Example 2:Use '''OR''' to combine bit flags into a single value. The presence of a flag can then be tested by using the flag as a mask with '''AND'''. +{{CodeStart}} +'The trick here is to give each flag a value corresponding to a different bit being 1 +FLAG_A& = VAL("&B0001") +FLAG_B& = VAL("&B0010") +FLAG_C& = VAL("&B0100") +FLAG_D& = VAL("&B1000") + +flags& = FLAG_A& OR FLAG_C& 'Set flags A, C + +'Use each flag as a bitmask to test for its presence: +IF flags& AND FLAG_A& THEN PRINT "Flag A is set" +IF flags& AND FLAG_B& THEN PRINT "Flag B is set" +IF flags& AND FLAG_C& THEN PRINT "Flag C is set" +IF flags& AND FLAG_D& THEN PRINT "Flag D is set" +{{CodeEnd}} +{{OutputStart}} +Flag A is set +Flag C is set +{{OutputEnd}} + +;Example 3:Use '''XOR''' to toggle a bit flag (that is, change its state to the opposite of what it was). This example is the same as the '''OR''' example above, but with one extra line added. This time we enable flags A & C, then toggle flags A & B. This will disable flag A and enable B. +{{CodeStart}} +'The trick here is to give each flag a value corresponding to a different bit being 1 +FLAG_A& = VAL("&B0001") +FLAG_B& = VAL("&B0010") +FLAG_C& = VAL("&B0100") +FLAG_D& = VAL("&B1000") + +flags& = FLAG_A& OR FLAG_C& 'Set flags A, C +flags& = flags& XOR FLAG_A& XOR FLAG_B& 'Toggle flags A, B + +'Use each flag as a bitmask to test for its presence: +IF flags& AND FLAG_A& THEN PRINT "Flag A is set" +IF flags& AND FLAG_B& THEN PRINT "Flag B is set" +IF flags& AND FLAG_C& THEN PRINT "Flag C is set" +IF flags& AND FLAG_D& THEN PRINT "Flag D is set" +{{CodeEnd}} +{{OutputStart}} +Flag B is set +Flag C is set +{{OutputEnd}} + +{{PageNavigation}} + diff --git a/internal/help/^.txt b/internal/help/^_^.txt similarity index 93% rename from internal/help/^.txt rename to internal/help/^_^.txt index cb3fe01cd..7e8d88004 100644 --- a/internal/help/^.txt +++ b/internal/help/^_^.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:24:57}} The '''^''' operation raises a numerical value to an exponential value expressing how many times the value is multiplied by itself. @@ -11,7 +13,7 @@ The '''^''' operation raises a numerical value to an exponential value expressin * Exponents can be any positive or negative integer or fractional numerical value inside of parenthesis brackets. * If the exponent is zero, the value returned is 1. * Fractional(or decimal point) exponents MUST be enclosed in '''() brackets''' and will return the fractional exponential root of a value. -* Exponential operations are done first in the Qbasic order of operations. +* Exponential operations are done first in the QBasic order of operations. * The square root of a number can be returned by the [[SQR]] function or by using an exponent of (1 [[/]] 2). Brackets required. * Values returned may be expressed using exponential or [[Scientific notation]] using '''E''' for SINGLE or '''D''' for DOUBLE precision. * WARNING: Exponential returns may exceed numerical type limitations and create an [[ERROR Codes|overflow error]]! @@ -47,4 +49,4 @@ Enter a number to calculate it's cube root: 144 {{PageNavigation}} -< + diff --git a/internal/help/_.txt b/internal/help/_.txt deleted file mode 100644 index f8acd9b83..000000000 --- a/internal/help/_.txt +++ /dev/null @@ -1,189 +0,0 @@ - - - - -Bad title - QB64 Phoenix Edition Wiki - - - - - - - - - - - - -
-
-
- -
-
-
-

Bad title

-
- -
-
- -
- Jump to navigation - Jump to search -

The requested page title is empty or contains only the name of a namespace. -

Return to Main Page.

- -
- -
-
- -
-

Navigation menu

-
- - -
- - - - -
-
- - - - - - -
-
- -
- - - - - - -
- -
- - - - - \ No newline at end of file diff --git a/internal/help/_ACCEPTFILEDROP.txt b/internal/help/_ACCEPTFILEDROP__11111111111111.txt similarity index 97% rename from internal/help/_ACCEPTFILEDROP.txt rename to internal/help/_ACCEPTFILEDROP__11111111111111.txt index 6d287b80f..c080a5221 100644 --- a/internal/help/_ACCEPTFILEDROP.txt +++ b/internal/help/_ACCEPTFILEDROP__11111111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:17}} {{DISPLAYTITLE:_ACCEPTFILEDROP}} The [[_ACCEPTFILEDROP]] statement prepares a program window to receive files dropped from Windows Explorer in a drag/drop operation. @@ -57,4 +59,4 @@ The [[_ACCEPTFILEDROP]] statement prepares a program window to receive files dro {{PageNavigation}} -< + diff --git a/internal/help/_ACOSH.txt b/internal/help/_ACOSH__11111.txt similarity index 95% rename from internal/help/_ACOSH.txt rename to internal/help/_ACOSH__11111.txt index 26d6030cf..5dcf608e4 100644 --- a/internal/help/_ACOSH.txt +++ b/internal/help/_ACOSH__11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:19}} {{DISPLAYTITLE:_ACOSH}} The [[_ACOSH]] returns the nonnegative arc hyperbolic cosine of {{Parameter|x!}}, expressed in radians. @@ -19,4 +21,4 @@ The [[_ACOSH]] returns the nonnegative arc hyperbolic cosine of {{Parameter|x!}} {{PageNavigation}} -< + diff --git a/internal/help/_ACOS.txt b/internal/help/_ACOS__1111.txt similarity index 84% rename from internal/help/_ACOS.txt rename to internal/help/_ACOS__1111.txt index 672f7bae9..34b16fa43 100644 --- a/internal/help/_ACOS.txt +++ b/internal/help/_ACOS__1111.txt @@ -1,15 +1,5 @@ - - - -View source for ACOS -← ACOS -Jump to navigationJump to search -You do not have permission to edit this page, for the following reason: - -The action you have requested is limited to users in the group: Users. - -You can view and copy the source of this page. - +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:18}} {{DISPLAYTITLE:_ACOS}} The [[_ACOS]] function returns the angle measured in radians based on an input [[COS]]ine value ranging from -1 to 1. @@ -18,7 +8,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]]. @@ -29,7 +19,7 @@ The [[_ACOS]] function returns the angle measured in radians based on an input [ {{PageExamples}} ''Example:'' Converting a radian angle to its COSine and using that value to find the angle in degrees again using _ACOS: -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DEFDBL}} A-Z {{Cl|INPUT}} "Give me an Angle (in Degrees) => "; Angle @@ -38,7 +28,7 @@ C = {{Cl|COS}}({{Cl|_D2R}}(Angle)) '_D2R is the command to convert Degrees to Ra {{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}} "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}} @@ -95,4 +85,4 @@ Related changes Special pages Page information Privacy policyAbout QB64 WikiDisclaimersPowered by MediaWiki -< + diff --git a/internal/help/_ALLOWFULLSCREEN.txt b/internal/help/_ALLOWFULLSCREEN__111111111111111.txt similarity index 94% rename from internal/help/_ALLOWFULLSCREEN.txt rename to internal/help/_ALLOWFULLSCREEN__111111111111111.txt index d35a010a5..d81dfb77f 100644 --- a/internal/help/_ALLOWFULLSCREEN.txt +++ b/internal/help/_ALLOWFULLSCREEN__111111111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:20}} {{DISPLAYTITLE:_ALLOWFULLSCREEN}} The [[_ALLOWFULLSCREEN]] statement allows setting the behavior of the ALT+ENTER combo. @@ -36,13 +38,13 @@ The [[_ALLOWFULLSCREEN]] statement allows setting the behavior of the ALT+ENTER {{Cl|PRINT}} " - Press ALT+ENTER to test trapping the combo..." {{Cl|PRINT}} " _ Press SPACEBAR to allow fullscreen again..." - k& = {{Cl|_KEYHIT}} + k& = {{Cl|_KEYHIT}} - {{Cl|IF}} k& = 13 {{Cl|THEN}} + {{Cl|IF}} k& = 13 {{Cl|THEN}} {{Cl|IF}} {{Cl|_KEYDOWN}}(100307) {{Cl|OR}} {{Cl|_KEYDOWN}}(100308) {{Cl|THEN}} altEnter = altEnter + 1 {{Cl|END IF}} - {{Cl|ELSEIF}} k& = 32 {{Cl|THEN}} + {{Cl|ELSEIF}} k& = 32 {{Cl|THEN}} fullscreenEnabled = {{Cl|NOT}} fullscreenEnabled {{Cl|END IF}} @@ -74,4 +76,4 @@ The [[_ALLOWFULLSCREEN]] statement allows setting the behavior of the ALT+ENTER {{PageNavigation}} -< + diff --git a/internal/help/_ALPHA32.txt b/internal/help/_ALPHA32__1111132.txt similarity index 74% rename from internal/help/_ALPHA32.txt rename to internal/help/_ALPHA32__1111132.txt index 7c72b2692..d0906846e 100644 --- a/internal/help/_ALPHA32.txt +++ b/internal/help/_ALPHA32__1111132.txt @@ -1,12 +1,14 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:23}} {{DISPLAYTITLE:_ALPHA32}} The [[_ALPHA32]] function returns the alpha transparency level of a 32 bit color value. {{PageSyntax}} -:{{Parameter|alpha&}} = [[_ALPHA32]]({{Parameter|color32~&}})''' +:{{Parameter|alpha&}} = [[_ALPHA32]]({{Parameter|color32~&}})''' {{Parameters}} -* {{Parameter|color32&}} is the [[_UNSIGNED]] [[LONG]] 32 bit color value used to retrieve the alpha level. +* {{Parameter|color32&}} is the [[_UNSIGNED]] [[LONG]] 32 bit color value used to retrieve the alpha level. ** Color values that are set as a [[_CLEARCOLOR]] always have an alpha level of 0 (transparent). ** [[_SETALPHA]] can set any alpha level from 0 (or fully transparent) to 255 (or opaque). ** Normal color values that are set by [[_RGB]] or [[_RGB32]] always have an alpha level of 255 (opaque). @@ -20,21 +22,21 @@ The [[_ALPHA32]] function returns the alpha transparency level of a 32 bit color {{PageExamples}} ''Example:'' Finding the alpha transparency level in a 32 bit screen using an [[_RGBA]] [[_UNSIGNED]] [[LONG]] color value. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, 32) -clr~& = {{Cl|_RGBA}}(255, 0, 255, 192) -{{Cl|PRINT}} "Color:"; clr~& +clr~& = {{Cl|_RGBA}}(255, 0, 255, 192) +{{Cl|PRINT}} "Color:"; clr~& -{{Cl|COLOR}} clr~& -{{Cl|PRINT}} "Alpha32:"; {{Cl|_ALPHA32}}(clr~&) +{{Cl|COLOR}} clr~& +{{Cl|PRINT}} "Alpha32:"; {{Cl|_ALPHA32}}(clr~&) -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} {{OutputStart}}{{text|Color: 3237937407|#FFFFFF}} {{text|Alpha32: 192|#FF00FF}} {{OutputEnd}} -: ''Notes:'' The color value is equivalent to [[&H|hexadecimal]] &HC0FF00FF where &HC0 equals 192. [[_RGB]] alphas are always &HFF(255). +: ''Notes:'' The color value is equivalent to [[&H|hexadecimal]] &HC0FF00FF where &HC0 equals 192. [[_RGB]] alphas are always &HFF(255). {{PageSeeAlso}} @@ -47,4 +49,4 @@ clr~& = {{Cl|_RGBA}}(255, 0, 255, 192) {{PageNavigation}} -< + diff --git a/internal/help/_ALPHA.txt b/internal/help/_ALPHA__11111.txt similarity index 73% rename from internal/help/_ALPHA.txt rename to internal/help/_ALPHA__11111.txt index 717aa26ab..7e9fd1ff9 100644 --- a/internal/help/_ALPHA.txt +++ b/internal/help/_ALPHA__11111.txt @@ -1,14 +1,16 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:21}} {{DISPLAYTITLE:_ALPHA}} The [[_ALPHA]] function returns the alpha channel transparency level of a color value used on a screen page or image. {{PageSyntax}} -:{{Parameter|result&}} = [[_ALPHA]]({{Parameter|color~&}} [, {{Parameter|imageHandle&}}]) +:{{Parameter|result&}} = [[_ALPHA]]({{Parameter|color~&}} [, {{Parameter|imageHandle&}}]) {{PageDescription}} -* If {{Parameter|imageHandle&}} is omitted, it is assumed to be the current write page. Invalid handles will create [[ERROR Codes|Illegal function call]] errors. -* [[_NEWIMAGE]] 32 bit [[SCREEN]] modes will always use an [[_UNSIGNED]] [[LONG]] ''color~&'' value. +* If {{Parameter|imageHandle&}} is omitted, it is assumed to be the current write page. Invalid handles will create [[ERROR Codes|Illegal function call]] errors. +* [[_NEWIMAGE]] 32 bit [[SCREEN]] modes will always use an [[_UNSIGNED]] [[LONG]] ''color~&'' value. ** Color values that are set as a [[_CLEARCOLOR]] always have an alpha level of 0 (transparent). ** [[_SETALPHA]] can set any alpha level from 0 (or fully transparent) to 255 (or opaque). ** Normal color values that are set by [[_RGB]] or [[_RGB32]] always have an alpha level of 255(opaque). @@ -19,14 +21,14 @@ The [[_ALPHA]] function returns the alpha channel transparency level of a color {{PageExamples}} ''Example 1:'' Alpha transparency levels are always 255 in 4 or 8 bit screen modes. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 13 -clr~& = {{Cl|_RGBA}}(255, 0, 255, 192) 'returns closest palette color attribute -{{Cl|PRINT}} "Color:"; clr~& +clr~& = {{Cl|_RGBA}}(255, 0, 255, 192) 'returns closest palette color attribute +{{Cl|PRINT}} "Color:"; clr~& -{{Cl|COLOR}} clr~& -{{Cl|PRINT}} "Alpha:"; {{Cl|_ALPHA}}(clr~&) +{{Cl|COLOR}} clr~& +{{Cl|PRINT}} "Alpha:"; {{Cl|_ALPHA}}(clr~&) {{Cl|END}} {{CodeEnd}} @@ -37,14 +39,14 @@ clr~& = {{Cl|_RGBA}}(255, 0, 255, 192) 'returns closest palette color attrib ''Example 2:'' Finding the transparency of a 32 bit screen mode's background before and after [[CLS]]. -{{CodeStart}} '' '' +{{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!" +BG& = {{Cl|POINT}}(1, 1) +{{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&) '' '' +BG& = {{Cl|POINT}}(1, 1) +{{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. @@ -60,4 +62,4 @@ BG& = {{Cl|POINT}}(1, 1) {{PageNavigation}} -< + diff --git a/internal/help/_ASINH.txt b/internal/help/_ASINH__11111.txt similarity index 95% rename from internal/help/_ASINH.txt rename to internal/help/_ASINH__11111.txt index 9bd7e51bb..506b042c2 100644 --- a/internal/help/_ASINH.txt +++ b/internal/help/_ASINH__11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:25}} {{DISPLAYTITLE:_ASINH}} The [[_ASINH]] returns the arc hyperbolic sine of x, expressed in radians. @@ -20,4 +22,4 @@ The [[_ASINH]] returns the arc hyperbolic sine of x, expressed in radians. {{PageNavigation}} -< + diff --git a/internal/help/_ASIN.txt b/internal/help/_ASIN__1111.txt similarity index 88% rename from internal/help/_ASIN.txt rename to internal/help/_ASIN__1111.txt index 68989fcfa..4c2291c41 100644 --- a/internal/help/_ASIN.txt +++ b/internal/help/_ASIN__1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:24}} {{DISPLAYTITLE:_ASIN}} The [[_ASIN]] function returns the angle measured in radians based on an input [[SIN]]e value ranging from -1 to 1. @@ -7,7 +9,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]]. @@ -18,7 +20,7 @@ The [[_ASIN]] function returns the angle measured in radians based on an input [ {{PageExamples}} ''Example:'' Converting a radian angle to its SINe and using that value to find the angle in degrees again using _ASIN: -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DEFDBL}} A-Z {{Cl|INPUT}} "Give me an Angle (in Degrees) => "; Angle @@ -27,7 +29,7 @@ C = {{Cl|SIN}}({{Cl|_D2R}}(Angle)) '_D2R is the command to convert Degrees to Ra {{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}} "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}} @@ -53,4 +55,4 @@ Notice, A is the Angle in Radians. If we convert it to degrees, we discover the {{PageNavigation}} -< + diff --git a/internal/help/_ASSERT.txt b/internal/help/_ASSERT__111111.txt similarity index 92% rename from internal/help/_ASSERT.txt rename to internal/help/_ASSERT__111111.txt index 8efa19384..3eb9e4505 100644 --- a/internal/help/_ASSERT.txt +++ b/internal/help/_ASSERT__111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:26}} {{DISPLAYTITLE:_ASSERT}} The [[_ASSERT]] statement can be used to perform tests in code that's in development, for debugging purposes. @@ -30,7 +32,7 @@ The [[_ASSERT]] statement can be used to perform tests in code that's in develop {{Cl|FUNCTION}} myFunc$ (value {{Cl|AS}} {{Cl|SINGLE}}) {{Cl|_ASSERT}} value > 0, "Value cannot be zero" - {{Cl|_ASSERT}} value <= 10, "Value cannot exceed 10" + {{Cl|_ASSERT}} value <= 10, "Value cannot exceed 10" {{Cl|IF}} value > 1 {{Cl|THEN}} plural$ = "s" myFunc$ = {{Cl|STRING$}}(value, "*") + {{Cl|STR$}}(value) + " star" + plural$ + " :-)" @@ -45,4 +47,4 @@ The [[_ASSERT]] statement can be used to perform tests in code that's in develop {{PageNavigation}} -< + diff --git a/internal/help/_ATAN2.txt b/internal/help/_ATAN2__11112.txt similarity index 85% rename from internal/help/_ATAN2.txt rename to internal/help/_ATAN2__11112.txt index 8ead858c4..db064cb66 100644 --- a/internal/help/_ATAN2.txt +++ b/internal/help/_ATAN2__11112.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:30}} {{DISPLAYTITLE:_ATAN2}} The [[_ATAN2]] function returns the radian angle between the positive x-axis of a plane and the point given by the coordinates (x, y). @@ -14,12 +16,12 @@ 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 -::* _ATAN2(y, x) = [[ATN]](y# / x#) + [[_PI]] 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 '''negative''' for lower row values 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#) - [[_PI]] 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. @@ -36,4 +38,4 @@ The [[_ATAN2]] function returns the radian angle between the positive x-axis of {{PageNavigation}} -< + diff --git a/internal/help/_ATANH.txt b/internal/help/_ATANH__11111.txt similarity index 95% rename from internal/help/_ATANH.txt rename to internal/help/_ATANH__11111.txt index ce2e9daca..c1663d44e 100644 --- a/internal/help/_ATANH.txt +++ b/internal/help/_ATANH__11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:31}} {{DISPLAYTITLE:_ATANH}} The [[_ATANH]] returns the arc hyperbolic tangent of {{Parameter|x!}}, expressed in radians. @@ -20,4 +22,4 @@ The [[_ATANH]] returns the arc hyperbolic tangent of {{Parameter|x!}}, expressed {{PageNavigation}} -< + diff --git a/internal/help/_AUTODISPLAY_(function).txt b/internal/help/_AUTODISPLAY_(function)__11111111111_(00000000).txt similarity index 84% rename from internal/help/_AUTODISPLAY_(function).txt rename to internal/help/_AUTODISPLAY_(function)__11111111111_(00000000).txt index 111997295..0d3735acc 100644 --- a/internal/help/_AUTODISPLAY_(function).txt +++ b/internal/help/_AUTODISPLAY_(function)__11111111111_(00000000).txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:34}} {{DISPLAYTITLE:_AUTODISPLAY (function)}} The [[_AUTODISPLAY (function)|_AUTODISPLAY]] function returns the current display mode as true (-1) if automatic or false (0) if disabled using [[_DISPLAY]]. @@ -11,8 +13,9 @@ The [[_AUTODISPLAY (function)|_AUTODISPLAY]] function returns the current displa * If [[_DISPLAY]] is used, then [[_AUTODISPLAY (function)|_AUTODISPLAY]] returns 0, to indicate that screen changes (text or graphics) are only displayed per request, by calling [[_DISPLAY]] again to refresh the screen. -==Availability== -* '''Build 20170924/69'''. +{{PageAvailability}} +* '''QB64 1.2 and up''' (QB64 Team) +* '''QBPE 0.5 and up''' (QB64 Phoenix Edition) {{PageSeeAlso}} @@ -21,4 +24,4 @@ The [[_AUTODISPLAY (function)|_AUTODISPLAY]] function returns the current displa {{PageNavigation}} -< + diff --git a/internal/help/_AUTODISPLAY.txt b/internal/help/_AUTODISPLAY__11111111111.txt similarity index 94% rename from internal/help/_AUTODISPLAY.txt rename to internal/help/_AUTODISPLAY__11111111111.txt index 695d199c1..b534338b4 100644 --- a/internal/help/_AUTODISPLAY.txt +++ b/internal/help/_AUTODISPLAY__11111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:33}} {{DISPLAYTITLE:_AUTODISPLAY}} The [[_AUTODISPLAY]] statement enables the automatic display of the screen image changes previously disabled by [[_DISPLAY]]. @@ -18,4 +20,4 @@ The [[_AUTODISPLAY]] statement enables the automatic display of the screen image {{PageNavigation}} -< + diff --git a/internal/help/_AXIS.txt b/internal/help/_AXIS__1111.txt similarity index 80% rename from internal/help/_AXIS.txt rename to internal/help/_AXIS__1111.txt index c6149bfc1..81a5bb9e5 100644 --- a/internal/help/_AXIS.txt +++ b/internal/help/_AXIS__1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:35}} {{DISPLAYTITLE:_AXIS}} The [[_AXIS]] function returns the relative position of a specified axis number on a controller device. @@ -14,29 +16,29 @@ The [[_AXIS]] function returns the relative position of a specified axis number {{PageExamples}} ''Example:'' Reading multiple controller device buttons, axis and wheels. -{{CodeStart}} '' '' +{{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|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|FOR...NEXT|FOR}} b = 1 {{Cl|TO}} {{Cl|_LASTBUTTON}}(d&) + d& = {{Cl|_DEVICEINPUT}} + {{Cl|IF...THEN|IF}} d& {{Cl|THEN}} ' the device number cannot be zero! + {{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}} - {{Cl|FOR...NEXT|FOR}} a = 1 {{Cl|TO}} {{Cl|_LASTAXIS}}(d&) + {{Cl|FOR...NEXT|FOR}} a = 1 {{Cl|TO}} {{Cl|_LASTAXIS}}(d&) {{Cl|PRINT}} {{Cl|_AXIS}}(a); {{Cl|NEXT}} - {{Cl|FOR...NEXT|FOR}} w = 1 {{Cl|TO}} {{Cl|_LASTWHEEL}}(d&) + {{Cl|FOR...NEXT|FOR}} w = 1 {{Cl|TO}} {{Cl|_LASTWHEEL}}(d&) {{Cl|PRINT}} {{Cl|_WHEEL}}(w); {{Cl|NEXT}} {{Cl|PRINT}} {{Cl|END IF}} {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) 'escape key exit -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} : ''Note:'' When there is no device control to read, a [[FOR...NEXT|FOR]] n = 1 TO 0 loop will not run thus avoiding a control function read error. @@ -50,4 +52,4 @@ The [[_AXIS]] function returns the relative position of a specified axis number {{PageNavigation}} -< + diff --git a/internal/help/_BACKGROUNDCOLOR.txt b/internal/help/_BACKGROUNDCOLOR__111111111111111.txt similarity index 83% rename from internal/help/_BACKGROUNDCOLOR.txt rename to internal/help/_BACKGROUNDCOLOR__111111111111111.txt index ee1117817..63c4c0bb9 100644 --- a/internal/help/_BACKGROUNDCOLOR.txt +++ b/internal/help/_BACKGROUNDCOLOR__111111111111111.txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:37}} {{DISPLAYTITLE:_BACKGROUNDCOLOR}} The [[_BACKGROUNDCOLOR]] function returns the current background color. {{PageSyntax}} -:{{Parameter|BGcolor&}} = [[_BACKGROUNDCOLOR]] +:{{Parameter|BGcolor&}} = [[_BACKGROUNDCOLOR]] @@ -14,26 +16,26 @@ The [[_BACKGROUNDCOLOR]] function returns the current background color. {{PageExamples}} ''Example 1:'' Storing a background color for later use. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 0 {{Cl|COLOR}} 1, 3 {{Cl|CLS}} BG% = {{Cl|_BACKGROUNDCOLOR}} {{Cl|PRINT}} BG% {{CodeEnd}} -{{OutputStart}}3 +{{OutputStartBG3}}{{Text|3|#0000aa}} {{OutputEnd}} ''Example 2:'' Understanding the function output -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 0 {{Cl|COLOR}} 1, 11 {{Cl|CLS}} BG% = {{Cl|_BACKGROUNDCOLOR}} {{Cl|PRINT}} BG% 'prints the attribute as 3 instead of 11 {{CodeEnd}} -{{OutputStart}}3 +{{OutputStartBG3}}{{Text|3|#0000aa}} {{OutputEnd}} :''Explanation: SCREEN 0 background colors over 7 will return the lower intensity color attribute values: EX: attribute - 8 @@ -46,4 +48,4 @@ BG% = {{Cl|_BACKGROUNDCOLOR}} {{PageNavigation}} -< + diff --git a/internal/help/_BIN$__111$.txt b/internal/help/_BIN$__111$.txt new file mode 100644 index 000000000..b0ba770c1 --- /dev/null +++ b/internal/help/_BIN$__111$.txt @@ -0,0 +1,83 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:39}} +{{DISPLAYTITLE:_BIN$}} +This function returns the binary (base 2) representation of any numeric value. + + +{{PageSyntax}} +: {{Parameter|binvalue$}} = [[_BIN$]]({{Parameter|number}}) + + +{{PageParameters}} +* {{Parameter|number}} can be any [[INTEGER]], [[LONG]] or [[_INTEGER64]] value, positive or negative. +* {{Parameter|number}} can also be any [[SINGLE]], [[DOUBLE]] or [[_FLOAT]] value, but only the integer part of the value is converted in that case. That is, from the value ''-123.45'' the function would convert the ''-123'' only. + + +{{PageDescription}} +* The function returns the base 2 (binary) representation of the given {{Parameter|number}} as [[STRING]]. +* Different from [[STR$]], this function does not return a leading sign placeholder space, so no [[LTRIM$]] to strip that space from positive numbers is necessary. +* [[VAL]] can convert the returned bin string value back to a decimal value by prefixing the string with "[[&B]]". +** Eg. {{InlineCode}}decimal = VAL("&B" + binvalue$){{InlineCodeEnd}}. + + +{{PageAvailability}} +* '''QB64 2.1 and up''' (QB64 Team) +* '''QBPE 0.5 and up''' (QB64 Phoenix Edition) + + +{{PageExamples}} +;Example 1:Comparing decimal, hexadecimal, octal and binary string values from 0 to 15. +{{CodeStart}} +tabletop$ = " Decimal | Hexadecimal | Octal | Binary " +tablesep$ = "---------+-------------+-------+--------" +tableout$ = " \ \ | \\ | \\ | \ \ " 'the PRINT USING template + +{{Cl|LOCATE}} 2, 10: {{Cl|PRINT}} tabletop$ +{{Cl|LOCATE}} 3, 10: {{Cl|PRINT}} tablesep$ +{{Cl|FOR...NEXT|FOR}} n% = 0 {{Cl|TO}} 15 + {{Cl|LOCATE}} 4 + n%, 10: {{Cl|PRINT USING}} tableout$; {{Cl|STR$}}(n%); {{Cl|HEX$}}(n%); {{Cl|OCT$}}(n%); {{Cl|_BIN$}}(n%) +{{Cl|NEXT}} n% +{{CodeEnd}} +;Note:Although the decimal numbers 0-15 have a maximum width of 2 digits only, an extra space in the ''tableout$'' template is needed when using the (fixed width string) slash output format, as [[STR$]] values contain a leading sign placeholder space. +{{OutputStart}} + Decimal | Hexadecimal | Octal | Binary + ---------+-------------+-------+-------- + 0 | 0 | 0 | 0 + 1 | 1 | 1 | 1 + 2 | 2 | 2 | 10 + 3 | 3 | 3 | 11 + 4 | 4 | 4 | 100 + 5 | 5 | 5 | 101 + 6 | 6 | 6 | 110 + 7 | 7 | 7 | 111 + 8 | 8 | 10 | 1000 + 9 | 9 | 11 | 1001 + 10 | A | 12 | 1010 + 11 | B | 13 | 1011 + 12 | C | 14 | 1100 + 13 | D | 15 | 1101 + 14 | E | 16 | 1110 + 15 | F | 17 | 1111 +{{OutputEnd}} + + +;Example 2:Converting a binary value to decimal. +{{CodeStart}} +binvalue$ = {{Cl|_BIN$}}(255) +{{Cl|PRINT}} "Bin: "; binvalue$ +{{Cl|PRINT}} "Converting Bin value to Decimal:"; {{Cl|VAL}}("&B" + binvalue$) +{{CodeEnd}} +{{OutputStart}} +Bin: 11111111 +Converting Bin value to Decimal: 255 +{{OutputEnd}} + + +{{PageSeeAlso}} +* [[HEX$]], [[OCT$]], [[STR$]], [[VAL]] +* [[&B]] {{text|(binary)}}, [[&H]] {{text|(hexadecimal)}}, [[&O]] {{text|(octal)}} +* [[Base Comparisons]] + + +{{PageNavigation}} + diff --git a/internal/help/_BIT.txt b/internal/help/_BIT__111.txt similarity index 90% rename from internal/help/_BIT.txt rename to internal/help/_BIT__111.txt index baaa04436..689f424b4 100644 --- a/internal/help/_BIT.txt +++ b/internal/help/_BIT__111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:38}} {{DISPLAYTITLE:_BIT}} The [[_BIT]] datatype can return only values of 0 (bit off) and -1 (bit on). @@ -26,7 +28,7 @@ The [[_BIT]] datatype can return only values of 0 (bit off) and -1 (bit on). :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> +
'''[[_BIT|BITS]]'''
* 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. @@ -37,9 +39,9 @@ The [[_BIT]] datatype can return only values of 0 (bit off) and -1 (bit on). '''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 27 down to 20 while the little-endian method does the opposite. -<center>'''[[_BYTE|BYTES]]'''</center> +
'''[[_BYTE|BYTES]]'''
* [[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,7 +56,7 @@ The [[_BIT]] datatype can return only values of 0 (bit off) and -1 (bit on). {{PageExamples}} ''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}} '' '' +{{CodeStart}} n = 24 Shift = 3 @@ -62,15 +64,15 @@ Shift = 3 {{Cl|PRINT}} RShift(n, Shift) {{Cl|END}} -{{Cl|FUNCTION}} LShift&(n AS {{Cl|LONG}}, LS AS {{Cl|LONG}}) -IF LS < 0 THEN {{Cl|EXIT FUNCTION}} +{{Cl|FUNCTION}} LShift&(n AS {{Cl|LONG}}, LS AS {{Cl|LONG}}) +IF LS < 0 THEN {{Cl|EXIT FUNCTION}} LShift = {{Cl|INT}}(n * (2 ^ LS)) {{Cl|END FUNCTION}} -{{Cl|FUNCTION}} RShift&(n AS {{Cl|LONG}}, RS AS {{Cl|LONG}}) -IF RS < 0 THEN {{Cl|EXIT FUNCTION}} +{{Cl|FUNCTION}} RShift&(n AS {{Cl|LONG}}, RS AS {{Cl|LONG}}) +IF RS < 0 THEN {{Cl|EXIT FUNCTION}} RShift = {{Cl|INT}}(n / (2 ^ RS)) -{{Cl|END FUNCTION}} '' '' +{{Cl|END FUNCTION}} {{CodeEnd}} {{small|Adapted from code by RThorpe}} {{OutputStart}} 192 @@ -79,7 +81,7 @@ RShift = {{Cl|INT}}(n / (2 ^ RS)) {{PageSeeAlso}} -* [[&B]] (binary), [[_BYTE]] +* [[&B]] (binary), [[_BYTE]] * [[_SHL]], [[_SHR]] * [[_DEFINE]], [[_UNSIGNED]] * [[DIM]] @@ -89,4 +91,4 @@ RShift = {{Cl|INT}}(n / (2 ^ RS)) {{PageNavigation}} -< + diff --git a/internal/help/_BLEND.txt b/internal/help/_BLEND.txt deleted file mode 100644 index b36774dae..000000000 --- a/internal/help/_BLEND.txt +++ /dev/null @@ -1,142 +0,0 @@ -{{DISPLAYTITLE:_BLEND}} -The [[_BLEND]] statement turns on 32 bit alpha blending for an image or screen mode and is on by default. - - -{{PageSyntax}} -: [[_BLEND]] [{{Parameter|imageHandle&}}] - -===Parameters=== -* {{Parameter|imageHandle&}} refers to an image in memory. If not specified, the current destination page (See [[_DEST]]) is affected. - - -{{PageDescription}} -* Alpha blending is on by default when loading a .PNG image to a 32-bit surface. -* Normally it is used to turn blending on after a previous [[_DONTBLEND]] call. -* [[_BLEND]] can only be used on 32-bit surfaces, otherwise it will produce the error [[ERROR Codes|Illegal Function Call]]. -* '''Note: [[_DONTBLEND]] is faster than the default [[_BLEND]] unless you really need to use it in 32 bit.''' -* '''32 bit screen surface backgrounds (black) have zero [[_ALPHA]] so that they are transparent when placed over other surfaces.''' - - -{{PageExamples}} -''Example:'' -{{CodeStart}} -{{Cl|SCREEN (statement)|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, 32) - -'{{Cl|CLS}} , {{Cl|_RGB}}(128, 128, 128) 'change background color for other results - -{{Cl|_DONTBLEND}} - -bg& = {{Cl|POINT}}(0, 0) -{{Cl|PRINT}} {{Cl|_RED}}(bg&), {{Cl|_GREEN}}(bg&), {{Cl|_BLUE}}(bg&), {{Cl|_ALPHA}}(bg&) - -{{Cl|LINE}} (100, 100)-(200, 200), {{Cl|_RGBA32}}(255, 128, 0, 128), BF - -{{Cl|LINE}} (440, 100)-(540, 200), {{Cl|_RGBA32}}(0, 0, 255, 64), BF - -K$ = {{Cl|INPUT$}}(1) - -{{Cl|_BLEND}} - -{{Cl|LINE}} (270, 300)-(370, 400), {{Cl|_RGBA32}}(255, 128, 0, 128), BF -m& = {{Cl|POINT}}(303, 302) -{{Cl|PRINT}} {{Cl|_RED}}(m&), {{Cl|_GREEN}}(m&), {{Cl|_BLUE}}(m&), {{Cl|_ALPHA}}(m&) -K$ = {{Cl|INPUT$}}(1) - -{{Cl|LINE}} (270, 300)-(370, 400), {{Cl|_RGBA32}}(0, 0, 255, 64), BF -m& = {{Cl|POINT}}(303, 302) -{{Cl|PRINT}} {{Cl|_RED}}(m&), {{Cl|_GREEN}}(m&), {{Cl|_BLUE}}(m&), {{Cl|_ALPHA}}(m&) -{{CodeEnd}} - - -<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0 - - style='border-collapse:collapse;border:none;mso-border-alt:solid windowtext .5pt; - - 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'> - - <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'> - - <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> - - </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'> - - <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> - - <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> - - <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> - - </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'> - - <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> - - </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'> - - <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> - - <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> - - </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'> - - <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> - - </td> - - </tr> - -</table> - - -{{PageSeeAlso}} -* [[_DONTBLEND]], [[_BLEND (function)]] -* [[Images]] - - -{{PageNavigation}} -< diff --git a/internal/help/_BLEND_(function).txt b/internal/help/_BLEND_(function)__11111_(00000000).txt similarity index 88% rename from internal/help/_BLEND_(function).txt rename to internal/help/_BLEND_(function)__11111_(00000000).txt index e9612d7dd..ed3cb410c 100644 --- a/internal/help/_BLEND_(function).txt +++ b/internal/help/_BLEND_(function)__11111_(00000000).txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:41}} {{DISPLAYTITLE:_BLEND (function)}} The [[_BLEND (function)|_BLEND]] function returns enabled or disabled for the current window or a specified image handle when 32 bit. {{PageSyntax}} -:{{Parameter|result%}} = [[_BLEND (function)|_BLEND]] [({{Parameter|imageHandle&}})] +:{{Parameter|result%}} = [[_BLEND (function)|_BLEND]] [({{Parameter|imageHandle&}})] {{PageDescription}} @@ -17,4 +19,4 @@ The [[_BLEND (function)|_BLEND]] function returns enabled or disabled for the cu {{PageNavigation}} -< + diff --git a/internal/help/_BLEND__11111.txt b/internal/help/_BLEND__11111.txt new file mode 100644 index 000000000..14f0dcadf --- /dev/null +++ b/internal/help/_BLEND__11111.txt @@ -0,0 +1,59 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:40}} +{{DISPLAYTITLE:_BLEND}} +The [[_BLEND]] statement turns on 32 bit alpha blending for an image or screen mode and is on by default. + + +{{PageSyntax}} +: [[_BLEND]] [{{Parameter|imageHandle&}}] + +===Parameters=== +* {{Parameter|imageHandle&}} refers to an image in memory. If not specified, the current destination page (See [[_DEST]]) is affected. + + +{{PageDescription}} +* Alpha blending is on by default when loading a .PNG image to a 32-bit surface. +* Normally it is used to turn blending on after a previous [[_DONTBLEND]] call. +* [[_BLEND]] can only be used on 32-bit surfaces, otherwise it will produce the error [[ERROR Codes|Illegal Function Call]]. +* '''Note: [[_DONTBLEND]] is faster than the default [[_BLEND]] unless you really need to use it in 32 bit.''' +* '''32 bit screen surface backgrounds (black) have zero [[_ALPHA]] so that they are transparent when placed over other surfaces.''' + + +{{PageExamples}} +''Example:'' +{{CodeStart}} +{{Cl|SCREEN (statement)|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, 32) + +'{{Cl|CLS}} , {{Cl|_RGB}}(128, 128, 128) 'change background color for other results + +{{Cl|_DONTBLEND}} + +bg& = {{Cl|POINT}}(0, 0) +{{Cl|PRINT}} {{Cl|_RED}}(bg&), {{Cl|_GREEN}}(bg&), {{Cl|_BLUE}}(bg&), {{Cl|_ALPHA}}(bg&) + +{{Cl|LINE}} (100, 100)-(200, 200), {{Cl|_RGBA32}}(255, 128, 0, 128), BF + +{{Cl|LINE}} (440, 100)-(540, 200), {{Cl|_RGBA32}}(0, 0, 255, 64), BF + +K$ = {{Cl|INPUT$}}(1) + +{{Cl|_BLEND}} + +{{Cl|LINE}} (270, 300)-(370, 400), {{Cl|_RGBA32}}(255, 128, 0, 128), BF +m& = {{Cl|POINT}}(303, 302) +{{Cl|PRINT}} {{Cl|_RED}}(m&), {{Cl|_GREEN}}(m&), {{Cl|_BLUE}}(m&), {{Cl|_ALPHA}}(m&) +K$ = {{Cl|INPUT$}}(1) + +{{Cl|LINE}} (270, 300)-(370, 400), {{Cl|_RGBA32}}(0, 0, 255, 64), BF +m& = {{Cl|POINT}}(303, 302) +{{Cl|PRINT}} {{Cl|_RED}}(m&), {{Cl|_GREEN}}(m&), {{Cl|_BLUE}}(m&), {{Cl|_ALPHA}}(m&) +{{CodeEnd}} + + +{{PageSeeAlso}} +* [[_DONTBLEND]], [[_BLEND (function)]] +* [[Images]] + + +{{PageNavigation}} + diff --git a/internal/help/_BLINK_(function).txt b/internal/help/_BLINK_(function)__11111_(00000000).txt similarity index 78% rename from internal/help/_BLINK_(function).txt rename to internal/help/_BLINK_(function)__11111_(00000000).txt index 7a588ccae..a72f5ea1d 100644 --- a/internal/help/_BLINK_(function).txt +++ b/internal/help/_BLINK_(function)__11111_(00000000).txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:44}} {{DISPLAYTITLE:_BLINK (function)}} The [[_BLINK]] function returns the current blink setting for SCREEN 0 colors. If enabled, returns -1 (default), otherwise returns 0. @@ -6,8 +8,9 @@ The [[_BLINK]] function returns the current blink setting for SCREEN 0 colors. I : {{Parameter|blinkState%%}} = [[_BLINK]] -==Availability== -* Build 20170816/61 up (August 16, 2017). +{{PageAvailability}} +* '''QB64 1.2 and up''' (QB64 Team) +* '''QBPE 0.5 and up''' (QB64 Phoenix Edition) {{PageExamples}} @@ -29,4 +32,4 @@ The [[_BLINK]] function returns the current blink setting for SCREEN 0 colors. I * [[OUT]] {{PageNavigation}} -< + diff --git a/internal/help/_BLINK.txt b/internal/help/_BLINK__11111.txt similarity index 96% rename from internal/help/_BLINK.txt rename to internal/help/_BLINK__11111.txt index ab3017ccf..174ccb1b9 100644 --- a/internal/help/_BLINK.txt +++ b/internal/help/_BLINK__11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:43}} {{DISPLAYTITLE:_BLINK}} The [[_BLINK]] statement toggles blinking colors in text mode (SCREEN 0). Default state is ON. @@ -33,4 +35,4 @@ The [[_BLINK]] statement toggles blinking colors in text mode (SCREEN 0). Defaul * [[_DISPLAY]] {{PageNavigation}} -< + diff --git a/internal/help/_BLUE.txt b/internal/help/_BLUE.txt deleted file mode 100644 index 8a2d5dab8..000000000 --- a/internal/help/_BLUE.txt +++ /dev/null @@ -1,32 +0,0 @@ -{{DISPLAYTITLE:_BLUE}} -The [[_BLUE]] function returns the palette intensity or the blue component intensity of a 32-bit image color. - - -{{PageSyntax}} -: {{Parameter|blueintensity&}} = [[_BLUE]]({{Parameter|rgbaColorIndex&}}[, {{Parameter|imageHandle&}}]) - - -{{PageDescription}} -* {{Parameter|rgbaColorIndex&}} is the ''RGBA'' color value or palette index of the color to retrieve the blue component intensity from. -* The [[LONG]] intensity value returned ranges from 0 (no intensity, not present) to 255 (full intensity). -* If {{Parameter|imageHandle&}} specifies a 32-bit color image, {{Parameter|rgbaColorIndex&}} is interpreted as a 32-bit ''RGBA'' color value. -* If {{Parameter|imageHandle&}} specifies an image that uses a palette, {{Parameter|rgbaColorIndex&}} is interpreted as a palette index. -* If {{Parameter|imageHandle&}} is not specified, it is assumed to be the current write page. -* If {{Parameter|imageHandle&}} is an invalid handle, an [[ERROR Codes|invalid handle]] error will occur. -* If {{Parameter|rgbaColorIndex&}} is outside the range of valid indexes for a given image mode, an [[ERROR Codes|illegal function call]] error occurs. -* Uses index parameters passed by the [[_RGB]], [[_RGBA]], [[_RGB32]] or [[_RGBA32]] funtions. -* An image handle is optional. - - -{{PageExamples}} -* See the example for [[POINT]]. - - -{{PageSeeAlso}} -* [[_RED]], [[_GREEN]] -* [[_RGB]], [[RGB32]] -* [[_LOADIMAGE]] - - -{{PageNavigation}} -< diff --git a/internal/help/_BLUE32.txt b/internal/help/_BLUE32__111132.txt similarity index 70% rename from internal/help/_BLUE32.txt rename to internal/help/_BLUE32__111132.txt index e3b70e4c7..99853a921 100644 --- a/internal/help/_BLUE32.txt +++ b/internal/help/_BLUE32__111132.txt @@ -1,13 +1,15 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:46}} {{DISPLAYTITLE:_BLUE32}} The [[_BLUE32]] function returns the blue component intensity of a 32-bit image or surface color. {{PageSyntax}} -: {{Parameter|blue32color&}} = [[_BLUE32]]({{Parameter|rgbaColor&}}) +: {{Parameter|blue32color&}} = [[_BLUE32]]({{Parameter|rgbaColor&}}) {{PageDescription}} -* {{Parameter|rgbaColor&}} is the 32-bit ''RGBA'' color value to retrieve the blue component intensity value from. +* {{Parameter|rgbaColor&}} is the 32-bit ''RGBA'' color value to retrieve the blue component intensity value from. * ''RGBA'' color values are returned by the [[_PALETTECOLOR (function)|_PALETTECOLOR]], [[POINT]], [[_RGB]], [[_RGB32]], [[_RGBA]] or [[_RGBA32]] functions. * [[LONG]] intensity values returned range from 0 (no intensity, not present) to 255 (full intensity). @@ -22,4 +24,4 @@ The [[_BLUE32]] function returns the blue component intensity of a 32-bit image {{PageNavigation}} -< + diff --git a/internal/help/_BLUE__1111.txt b/internal/help/_BLUE__1111.txt new file mode 100644 index 000000000..f159b192e --- /dev/null +++ b/internal/help/_BLUE__1111.txt @@ -0,0 +1,34 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:45}} +{{DISPLAYTITLE:_BLUE}} +The [[_BLUE]] function returns the palette intensity or the blue component intensity of a 32-bit image color. + + +{{PageSyntax}} +: {{Parameter|blueintensity&}} = [[_BLUE]]({{Parameter|rgbaColorIndex&}}[, {{Parameter|imageHandle&}}]) + + +{{PageDescription}} +* {{Parameter|rgbaColorIndex&}} is the ''RGBA'' color value or palette index of the color to retrieve the blue component intensity from. +* The [[LONG]] intensity value returned ranges from 0 (no intensity, not present) to 255 (full intensity). +* If {{Parameter|imageHandle&}} specifies a 32-bit color image, {{Parameter|rgbaColorIndex&}} is interpreted as a 32-bit ''RGBA'' color value. +* If {{Parameter|imageHandle&}} specifies an image that uses a palette, {{Parameter|rgbaColorIndex&}} is interpreted as a palette index. +* If {{Parameter|imageHandle&}} is not specified, it is assumed to be the current write page. +* If {{Parameter|imageHandle&}} is an invalid handle, an [[ERROR Codes|invalid handle]] error will occur. +* If {{Parameter|rgbaColorIndex&}} is outside the range of valid indexes for a given image mode, an [[ERROR Codes|illegal function call]] error occurs. +* Uses index parameters passed by the [[_RGB]], [[_RGBA]], [[_RGB32]] or [[_RGBA32]] funtions. +* An image handle is optional. + + +{{PageExamples}} +* See the example for [[POINT]]. + + +{{PageSeeAlso}} +* [[_RED]], [[_GREEN]] +* [[_RGB]], [[RGB32]] +* [[_LOADIMAGE]] + + +{{PageNavigation}} + diff --git a/internal/help/_BUTTONCHANGE.txt b/internal/help/_BUTTONCHANGE__111111111111.txt similarity index 80% rename from internal/help/_BUTTONCHANGE.txt rename to internal/help/_BUTTONCHANGE__111111111111.txt index 4c00995cb..b94c3f4b2 100644 --- a/internal/help/_BUTTONCHANGE.txt +++ b/internal/help/_BUTTONCHANGE__111111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:49}} {{DISPLAYTITLE:_BUTTONCHANGE}} The [[_BUTTONCHANGE]] function returns -1 or 1 when a specified button number on a controller device has been pressed or released. @@ -15,29 +17,29 @@ The [[_BUTTONCHANGE]] function returns -1 or 1 when a specified button number on {{PageExamples}} ''Example:'' Reading multiple controller device buttons, axis and wheels. -{{CodeStart}} '' '' +{{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|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|FOR...NEXT|FOR}} b = 1 {{Cl|TO}} {{Cl|_LASTBUTTON}}(d&) + d& = {{Cl|_DEVICEINPUT}} + {{Cl|IF...THEN|IF}} d& {{Cl|THEN}} ' the device number cannot be zero! + {{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}} - {{Cl|FOR...NEXT|FOR}} a = 1 {{Cl|TO}} {{Cl|_LASTAXIS}}(d&) + {{Cl|FOR...NEXT|FOR}} a = 1 {{Cl|TO}} {{Cl|_LASTAXIS}}(d&) {{Cl|PRINT}} {{Cl|_AXIS}}(a); {{Cl|NEXT}} - {{Cl|FOR...NEXT|FOR}} w = 1 {{Cl|TO}} {{Cl|_LASTWHEEL}}(d&) + {{Cl|FOR...NEXT|FOR}} w = 1 {{Cl|TO}} {{Cl|_LASTWHEEL}}(d&) {{Cl|PRINT}} {{Cl|_WHEEL}}(w); {{Cl|NEXT}} {{Cl|PRINT}} {{Cl|END IF}} {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) 'escape key exit -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} : ''Note:'' When there is no device control to read, a [[FOR...NEXT|FOR]] n = 1 TO 0 loop will not run thus avoiding a control function read error. @@ -51,4 +53,4 @@ The [[_BUTTONCHANGE]] function returns -1 or 1 when a specified button number on {{PageNavigation}} -< + diff --git a/internal/help/_BUTTON.txt b/internal/help/_BUTTON__111111.txt similarity index 80% rename from internal/help/_BUTTON.txt rename to internal/help/_BUTTON__111111.txt index 25d784daa..19bb70716 100644 --- a/internal/help/_BUTTON.txt +++ b/internal/help/_BUTTON__111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:47}} {{DISPLAYTITLE:_BUTTON}} The [[_BUTTON]] function returns -1 when specified button number on a controller device is pressed. @@ -15,29 +17,29 @@ The [[_BUTTON]] function returns -1 when specified button number on a controller {{PageExamples}} ''Example:'' Reading multiple controller device buttons, axis and wheels. -{{CodeStart}} '' '' +{{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|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|FOR...NEXT|FOR}} b = 1 {{Cl|TO}} {{Cl|_LASTBUTTON}}(d&) + d& = {{Cl|_DEVICEINPUT}} + {{Cl|IF...THEN|IF}} d& {{Cl|THEN}} ' the device number cannot be zero! + {{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}} - {{Cl|FOR...NEXT|FOR}} a = 1 {{Cl|TO}} {{Cl|_LASTAXIS}}(d&) + {{Cl|FOR...NEXT|FOR}} a = 1 {{Cl|TO}} {{Cl|_LASTAXIS}}(d&) {{Cl|PRINT}} {{Cl|_AXIS}}(a); {{Cl|NEXT}} - {{Cl|FOR...NEXT|FOR}} w = 1 {{Cl|TO}} {{Cl|_LASTWHEEL}}(d&) + {{Cl|FOR...NEXT|FOR}} w = 1 {{Cl|TO}} {{Cl|_LASTWHEEL}}(d&) {{Cl|PRINT}} {{Cl|_WHEEL}}(w); {{Cl|NEXT}} {{Cl|PRINT}} {{Cl|END IF}} {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) 'escape key exit -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} : ''Note:'' When there is no device control to read, a [[FOR...NEXT|FOR]] n = 1 TO 0 loop will not run thus avoiding a control function read error. @@ -51,4 +53,4 @@ The [[_BUTTON]] function returns -1 when specified button number on a controller {{PageNavigation}} -< + diff --git a/internal/help/_BYTE.txt b/internal/help/_BYTE__1111.txt similarity index 78% rename from internal/help/_BYTE.txt rename to internal/help/_BYTE__1111.txt index 93dadd1fb..3f15e0e7e 100644 --- a/internal/help/_BYTE.txt +++ b/internal/help/_BYTE__1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:50}} {{DISPLAYTITLE:_BYTE}} A [[_BYTE]] variable can hold signed variable values from -128 to 127 (one byte or 8 [[_BIT]]s). [[_UNSIGNED|Unsigned]] from 0 to 255. @@ -16,7 +18,7 @@ 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> +
'''[[_BIT|BITS]]'''
* 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. @@ -27,10 +29,10 @@ A [[_BYTE]] variable can hold signed variable values from -128 to 127 (one byte '''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 27 down to 20 while the little-endian method does the opposite. -<center>'''[[_BYTE|BYTES]]'''</center> +
'''[[_BYTE|BYTES]]'''
* [[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,34 +56,34 @@ 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." {{CodeEnd}} {{OutputStart}} -&B00000001 = unsigned & signed are both 1 -&B01111111 = unsigned & signed are both 127 -&B11111111 = unsigned is 255 but signed is -1 -&B11111110 = unsigned is 254 but signed is -2 -&B11111101 = unsigned is 253 but signed is -3 +&B00000001 = unsigned & signed are both 1 +&B01111111 = unsigned & signed are both 127 +&B11111111 = unsigned is 255 but signed is -1 +&B11111110 = unsigned is 254 but signed is -2 +&B11111101 = unsigned is 253 but signed is -3 The signed value needs the MSB bit for the sign. The most significant bit is furthest to the left. @@ -89,7 +91,7 @@ The most significant bit is furthest to the left. {{PageSeeAlso}} -* [[_BIT]], [[&B]] +* [[_BIT]], [[&B]] * [[_DEFINE]], [[DIM]] * [[_UNSIGNED]] * [[_SHL]], [[_SHR]] @@ -100,4 +102,4 @@ The most significant bit is furthest to the left. {{PageNavigation}} -< + diff --git a/internal/help/_CAPSLOCK_(function).txt b/internal/help/_CAPSLOCK_(function)__11111111_(00000000).txt similarity index 78% rename from internal/help/_CAPSLOCK_(function).txt rename to internal/help/_CAPSLOCK_(function)__11111111_(00000000).txt index 851129e47..2167a76e0 100644 --- a/internal/help/_CAPSLOCK_(function).txt +++ b/internal/help/_CAPSLOCK_(function)__11111111_(00000000).txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:51}} {{DISPLAYTITLE:_CAPSLOCK (function)}} The [[_CAPSLOCK (function)| _CAPSLOCK]] function returns the current state of the Caps Lock key as on (-1) or off (0). @@ -6,8 +8,9 @@ The [[_CAPSLOCK (function)| _CAPSLOCK]] function returns the current state of th : {{Parameter|keyStatus%%}} = [[_CAPSLOCK (function)| _CAPSLOCK]] -==Availability== -* Version 1.4 and up. +{{PageAvailability}} +* '''QB64 1.4 and up''' (QB64 Team) +* '''QBPE 0.5 and up''' (QB64 Phoenix Edition) * [[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Not available in Linux or macOS]]. @@ -17,4 +20,4 @@ The [[_CAPSLOCK (function)| _CAPSLOCK]] function returns the current state of th {{PageNavigation}} -< + diff --git a/internal/help/_CAPSLOCK.txt b/internal/help/_CAPSLOCK__11111111.txt similarity index 74% rename from internal/help/_CAPSLOCK.txt rename to internal/help/_CAPSLOCK__11111111.txt index 23c4e0d03..aa2f297b5 100644 --- a/internal/help/_CAPSLOCK.txt +++ b/internal/help/_CAPSLOCK__11111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:52}} {{DISPLAYTITLE:_CAPSLOCK}} The [[_CAPSLOCK]] statement sets the state of the Caps Lock key. @@ -6,8 +8,9 @@ The [[_CAPSLOCK]] statement sets the state of the Caps Lock key. : [[_CAPSLOCK]] {ON|OFF|_TOGGLE} -==Availability== -* Version 1.4 and up. +{{PageAvailability}} +* '''QB64 1.4 and up''' (QB64 Team) +* '''QBPE 0.5 and up''' (QB64 Phoenix Edition) * [[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Not available in Linux or macOS]]. @@ -17,4 +20,4 @@ The [[_CAPSLOCK]] statement sets the state of the Caps Lock key. {{PageNavigation}} -< + diff --git a/internal/help/_CEIL.txt b/internal/help/_CEIL__1111.txt similarity index 85% rename from internal/help/_CEIL.txt rename to internal/help/_CEIL__1111.txt index 4ba4b5daa..76d4ce376 100644 --- a/internal/help/_CEIL.txt +++ b/internal/help/_CEIL__1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:55}} {{DISPLAYTITLE:_CEIL}} The [[_CEIL]] function rounds a numeric value up to the next whole number or [[INTEGER]] value. @@ -10,8 +12,9 @@ The [[_CEIL]] function rounds a numeric value up to the next whole number or [[I * This means that [[_CEIL]] rounds up for both positive and negative numbers. -==Availability== -* '''Version 1.000 and up.''' +{{PageAvailability}} +* '''QB64 1.0 and up''' (QB64 Team) +* '''QBPE 0.5 and up''' (QB64 Phoenix Edition) {{PageExamples}} @@ -33,4 +36,4 @@ PRINT INT(-2.5), CINT(-2.5), FIX(-2.5), _CEIL(-2.5) {{PageNavigation}} -< + diff --git a/internal/help/_CINP.txt b/internal/help/_CINP__1111.txt similarity index 87% rename from internal/help/_CINP.txt rename to internal/help/_CINP__1111.txt index ee36051e2..2c844fd09 100644 --- a/internal/help/_CINP.txt +++ b/internal/help/_CINP__1111.txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:56}} {{DISPLAYTITLE:_CINP}} The [[_CINP]] function returns keyboard key press codes from a [[$CONSOLE]] window. Windows-only. {{PageSyntax}} -:{{Parameter|keycode&}} = [[_CINP]] +:{{Parameter|keycode&}} = [[_CINP]] {{PageDescription}} @@ -15,13 +17,13 @@ The [[_CINP]] function returns keyboard key press codes from a [[$CONSOLE]] wind ' '''' Esc F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 SysReq ScrL Pause''' ' 1 59 60 61 62 63 64 65 66 67 68 87 88 0 70 29 -' '''`~ 1! 2@ 3# 4$ 5% 6^ 7& 8* 9( 0) -_ =+ BkSpc Insert Home PgUp NumL / * -''' +' '''`~ 1! 2@ 3# 4$ 5% 6^ 7& 8* 9( 0) -_ =+ BkSpc Insert Home PgUp NumL / * -''' ' 41 2 3 4 5 6 7 8 9 10 11 12 13 14 82 71 73 69 53 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 83 79 81 71 72 73 78 ' '''CapL A S D F G H J K L ;: '" Enter 4/β—„- 5 6/-β–Ί E''' ' 58 30 31 32 33 34 35 36 37 38 39 40 28 75 76 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''' ' 42 44 45 46 47 48 49 50 51 52 53 54 72 79 80 81 '''e''' ' '''Ctrl Win Alt Spacebar Alt Win Menu Ctrl β—„- β–Ό -β–Ί 0/Insert ./Del r''' ' 29 {{text|91|purple}} 56 57 56 {{text|92 93|purple}} 29 75 80 77 82 83 28 @@ -31,11 +33,11 @@ The [[_CINP]] function returns keyboard key press codes from a [[$CONSOLE]] wind {{PageExamples}} ''Example 1:'' Reading individual key strokes from a console window (Windows). -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|$CONSOLE}}:ONLY {{Cl|_DEST}} {{Cl|_CONSOLE}}: {{Cl|_SOURCE}} {{Cl|_CONSOLE}} -{{Cl|PRINT}} "Press any key, and I'll give you the scan code for it. <ESC> quits the demo." +{{Cl|PRINT}} "Press any key, and I'll give you the scan code for it. quits the demo." {{Cl|PRINT}} {{Cl|PRINT}} {{Cl|DO}} @@ -57,4 +59,4 @@ The [[_CINP]] function returns keyboard key press codes from a [[$CONSOLE]] wind {{PageNavigation}} -< + diff --git a/internal/help/_CLEARCOLOR_(function).txt b/internal/help/_CLEARCOLOR_(function)__1111111111_(00000000).txt similarity index 69% rename from internal/help/_CLEARCOLOR_(function).txt rename to internal/help/_CLEARCOLOR_(function)__1111111111_(00000000).txt index a63b644ed..641ff0f53 100644 --- a/internal/help/_CLEARCOLOR_(function).txt +++ b/internal/help/_CLEARCOLOR_(function)__1111111111_(00000000).txt @@ -1,14 +1,16 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:57}} {{DISPLAYTITLE:_CLEARCOLOR (function)}} The [[_CLEARCOLOR (function)|_CLEARCOLOR]] function returns the current transparent color of an image or page. {{PageSyntax}} -:''result&'' = [[_CLEARCOLOR (function)|_CLEARCOLOR]] [{{Parameter|Source_Handle&}}] +:''result&'' = [[_CLEARCOLOR (function)|_CLEARCOLOR]] [{{Parameter|Source_Handle&}}] {{PageDescription}} -* If {{Parameter|Source_Handle&}} is omitted, it is assumed to be the current [[_DEST|destination]] write page. -* If {{Parameter|Source_Handle&}} is an invalid handle value(-1), then an [[ERROR Codes|invalid handle value]] is returned. +* If {{Parameter|Source_Handle&}} is omitted, it is assumed to be the current [[_DEST|destination]] write page. +* If {{Parameter|Source_Handle&}} is an invalid handle value(-1), then an [[ERROR Codes|invalid handle value]] is returned. * In color modes using a palette, the index of the current transparent color value is returned, or -1 if no transparent color is set. * In 32-bit color modes, zero is returned. * Returns the color that currently is transparent, or if no color is transparent -1 without error. @@ -23,4 +25,4 @@ The [[_CLEARCOLOR (function)|_CLEARCOLOR]] function returns the current transpar {{PageNavigation}} -< + diff --git a/internal/help/_CLEARCOLOR.txt b/internal/help/_CLEARCOLOR__1111111111.txt similarity index 51% rename from internal/help/_CLEARCOLOR.txt rename to internal/help/_CLEARCOLOR__1111111111.txt index 92aa52c5d..55cf9ba2d 100644 --- a/internal/help/_CLEARCOLOR.txt +++ b/internal/help/_CLEARCOLOR__1111111111.txt @@ -1,19 +1,24 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:06:58}} {{DISPLAYTITLE:_CLEARCOLOR}} The [[_CLEARCOLOR]] statement sets a specific color to be treated as transparent when an image is later put (via [[_PUTIMAGE]]) onto another image. +{|align="right" +|__TOC__ +|} {{PageSyntax}} -:[[_CLEARCOLOR]] {{{Parameter|color&}}|_NONE}[, {{Parameter|Dest_Handle&}}] +:[[_CLEARCOLOR]] {{{Parameter|color&}}|_NONE}[, {{Parameter|Dest_Handle&}}] {{Parameters}} -* In color modes using a palette, {{Parameter|color&}} is the palette index of the new transparent color value or _NONE designates no clear colors. -* If {{Parameter|color&}} is not a valid palette index, an [[ERROR Codes|illegal function call]] error will occur. -* In 32-bit color modes, {{Parameter|color&}} is the [[_LONG]] color value of the new transparent color. -* If {{Parameter|Dest_Handle&}} is omitted, the destination is assumed to be the current write page. Zero can designate the current program screen. +* In color modes using a palette, {{Parameter|color&}} is the palette index of the new transparent color value or _NONE designates no clear colors. +* If {{Parameter|color&}} is not a valid palette index, an [[ERROR Codes|illegal function call]] error will occur. +* In 32-bit color modes, {{Parameter|color&}} is the [[_LONG]] color value of the new transparent color. +* If {{Parameter|Dest_Handle&}} is omitted, the destination is assumed to be the current write page. Zero can designate the current program screen. {{PageDescription}} -* If {{Parameter|Dest_Handle&}} is an invalid handle, then an [[ERROR Codes|invalid handle]] error is returned. Check for bad handle values of -1 first. +* If {{Parameter|Dest_Handle&}} is an invalid handle, then an [[ERROR Codes|invalid handle]] error is returned. Check for bad handle values of -1 first. * In 32-bit color modes, it simply sets the Alpha to 0 for all pixels matching the specified color. * In the second syntax, transparency is disabled for color modes using a palette. * '''Note:''' [[_SETALPHA]] can affect any _CLEARCOLOR alpha setting within the color range set. @@ -22,16 +27,16 @@ 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. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN (statement)|SCREEN}} 13 -img& = {{Cl|_LOADIMAGE}}("qb64_trans.png") -{{Cl|_PUTIMAGE}} , img&, 0 'place actual image with background +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 -{{Cl|_CLEARCOLOR}} {{Cl|_RGB}}(255, 255, 255), img& -{{Cl|_PUTIMAGE}} , img&, 0 'place image without white background -{{Cl|PRINT}} {{Cl|_CLEARCOLOR}}(img&) 'displays closest clear color attribute -{{Cl|END}} '' '' +{{Cl|_CLEARCOLOR}} {{Cl|_RGB}}(255, 255, 255), img& +{{Cl|_PUTIMAGE}} , img&, 0 'place image without white background +{{Cl|PRINT}} {{Cl|_CLEARCOLOR}}(img&) 'displays closest clear color attribute +{{Cl|END}} {{CodeEnd}} @@ -46,38 +51,38 @@ 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}} ''Example 3:'' Fading an image with a _CLEARCOLOR background using a new page image to prevent [[_SETALPHA]] changes. -{{CodeStart}} '' '' +{{CodeStart}} 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& - clr~& = {{Cl|POINT}}(0, 0) 'get background color from image source - {{Cl|_CLEARCOLOR}} clr~&, Image1& 'clear background color of loaded image - NewImage1& = {{Cl|_NEWIMAGE}}({{Cl|_WIDTH (function)|_WIDTH}}(Image1&), {{Cl|_HEIGHT}}(Image1&), 32) 'new image page - {{Cl|_PUTIMAGE}} , Image1&, NewImage1& 'put image without background color on new page - {{Cl|_FREEIMAGE}} Image1& 'free loaded image from memory +{{Cl|IF...THEN|IF}} Image1& < -1 {{Cl|THEN}} 'check loaded image handle value before using! + {{Cl|_SOURCE}} Image1& + clr~& = {{Cl|POINT}}(0, 0) 'get background color from image source + {{Cl|_CLEARCOLOR}} clr~&, Image1& 'clear background color of loaded image + NewImage1& = {{Cl|_NEWIMAGE}}({{Cl|_WIDTH (function)|_WIDTH}}(Image1&), {{Cl|_HEIGHT}}(Image1&), 32) 'new image page + {{Cl|_PUTIMAGE}} , Image1&, NewImage1& 'put image without background color on new page + {{Cl|_FREEIMAGE}} Image1& 'free loaded image from memory {{Cl|END IF}} {{Cl|_DEST}} mainscreen: -a& = 0: d = 1 +a& = 0: d = 1 DO {{Cl|_LIMIT}} 10 'regulate speed of fades {{Cl|CLS}} - a& = a& + d - {{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& + a& = a& + d + {{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|_DISPLAY}} -{{Cl|LOOP}} {{Cl|UNTIL}} a& = 0 +{{Cl|LOOP}} {{Cl|UNTIL}} a& = 0 {{Cl|END}} {{CodeEnd}} :''Note:'' If the _CLEARCOLOR image background was not put onto a separate page, [[_SETALPHA]] would display it also. @@ -92,4 +97,4 @@ DO {{PageNavigation}} -< + diff --git a/internal/help/_CLIPBOARD$_(statement).txt b/internal/help/_CLIPBOARD$_(statement)__111111111$_(000000000).txt similarity index 95% rename from internal/help/_CLIPBOARD$_(statement).txt rename to internal/help/_CLIPBOARD$_(statement)__111111111$_(000000000).txt index 40fb5b126..747bcb81b 100644 --- a/internal/help/_CLIPBOARD$_(statement).txt +++ b/internal/help/_CLIPBOARD$_(statement)__111111111$_(000000000).txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:02}} {{DISPLAYTITLE:_CLIPBOARD$ (statement)}} The [[_CLIPBOARD$ (statement)|_CLIPBOARD$]] statement copies the [[STRING]] value into the system clipboard. @@ -18,13 +20,13 @@ The [[_CLIPBOARD$ (statement)|_CLIPBOARD$]] statement copies the [[STRING]] valu {{PageExamples}} ''Example:'' Set 2 lines of text in the clipboard using a carriage return to end text lines -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DIM}} CrLf AS {{Cl|STRING}} * 2 'define as 2 byte STRING -CrLf = {{Cl|CHR$}}(13) + {{Cl|CHR$}}(10) 'carriage return & line feed +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|PRINT}} {{Cl|_CLIPBOARD$}} 'display what is in the clipboard -'' '' + {{CodeEnd}} {{OutputStart}}This is line 1 @@ -41,4 +43,4 @@ This is line 2 {{PageNavigation}} -< + diff --git a/internal/help/_CLIPBOARD$.txt b/internal/help/_CLIPBOARD$__111111111$.txt similarity index 80% rename from internal/help/_CLIPBOARD$.txt rename to internal/help/_CLIPBOARD$__111111111$.txt index 054099732..805ccba35 100644 --- a/internal/help/_CLIPBOARD$.txt +++ b/internal/help/_CLIPBOARD$__111111111$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:01}} {{DISPLAYTITLE:_CLIPBOARD$}} The [[_CLIPBOARD$]] function returns the current Operating System's clipboard contents as a [[STRING]]. @@ -15,7 +17,7 @@ The [[_CLIPBOARD$]] function returns the current Operating System's clipboard co {{PageExamples}} ''Example 1:'' Passing a string value between two running programs no matter where they are located. : ''Program1:'' -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|PRINT}} "Start Program2 to read your text entries! Empty entry quits!" {{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "Entry program started!" 'set clipboard initially @@ -25,7 +27,7 @@ DO {{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = text$ {{Cl|LOOP}} -{{Cl|SYSTEM}} '' '' +{{Cl|SYSTEM}} {{CodeEnd}} :''Program2:'' {{CodeStart}} @@ -39,27 +41,27 @@ DO: {{Cl|_LIMIT}} 100 {{Cl|END IF}} {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} :''Explanation:'' Compile and run both programs at once to see the interaction. You could also run them on different paths. ''Example 2: A minimized program that pops up when Ctrl + Shift is entered anytime in '''Windows''' and adds clipboard text to be Pasted: -{{CodeStart}} '' '' +{{CodeStart}} '"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|FUNCTION}} FindWindowA%& ({{Cl|BYVAL}} ClassName {{Cl|AS}} {{Cl|_OFFSET}}, WindowName$) 'find process handle by title + {{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 - {{Cl|FUNCTION}} GetForegroundWindow%& 'find currently focused process handle - {{Cl|FUNCTION}} SetForegroundWindow& ({{Cl|BYVAL}} hwnd {{Cl|AS}} {{Cl|_OFFSET}}) 'set foreground window process(focus) + {{Cl|FUNCTION}} ShowWindow& ({{Cl|BYVAL}} hwnd {{Cl|AS}} {{Cl|_OFFSET}}, {{Cl|BYVAL}} nCmdShow {{Cl|AS}} {{Cl|LONG}}) 'maximize process + {{Cl|FUNCTION}} GetForegroundWindow%& 'find currently focused process handle + {{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 {{Cl|_TITLE}} title$ 'set program title -hwnd%& = FindWindowA(0, title$ + {{Cl|CHR$}}(0)) 'find this program's process handle +hwnd%& = FindWindowA(0, title$ + {{Cl|CHR$}}(0)) 'find this program's process handle {{Cl|SCREEN}} 13 {{Cl|_SCREENMOVE}} {{Cl|_SCREENMOVE|_MIDDLE}} @@ -68,18 +70,18 @@ hwnd%& = FindWindowA(0, title$ + {{Cl|CHR$}}(0)) 'find this program's proces {{Cl|PRINT}} " Press Ctrl+Shift to see clipboard menu." {{Cl|_DELAY}} 4 -x& = ShowWindow&(hwnd%&, 2) 'minimize +x& = ShowWindow&(hwnd%&, 2) 'minimize {{Cl|DO...LOOP|DO}}: {{Cl|_LIMIT}} 30 'save CPU usage while waiting for key press - {{Cl|IF...THEN|IF}} GetKeyState(16) < 0 {{Cl|AND (boolean)|AND}} GetKeyState(17) < 0 {{Cl|THEN}} '<==== Shift+A - FGwin%& = GetForegroundWindow%& 'get current process in focus - y& = ShowWindow&(hwnd%&, 1) 'maximize minimized program + {{Cl|IF...THEN|IF}} GetKeyState(16) < 0 {{Cl|AND (boolean)|AND}} GetKeyState(17) < 0 {{Cl|THEN}} '<==== Shift+A + 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 + x& = ShowWindow&(hwnd%&, 2) 'minimize after letter key entry {{Cl|COLOR}} 10: {{Cl|PRINT}} {{Cl|PRINT}} " Press Ctrl+Shift to see clipboard menu." {{Cl|END IF}} @@ -130,7 +132,7 @@ K$ = {{Cl|UCASE$}}({{Cl|INPUT$}}(1)) {{Cl|COLOR}} 14: {{Cl|PRINT}} {{Cl|_CLIPBOARD$}} {{Cl|BEEP}} {{Cl|_DELAY}} 2 -{{Cl|END SUB}} '' '' +{{Cl|END SUB}} {{CodeEnd}}{{small|Code by Ted Weissgerber}} : ''Explanation:'' The program will run minimized until Ctrl + Shift is entered and will pop up to ask for a letter choice that contains the text you want in the clipboard. More letter choices can be added. Text can be pasted into a web page or entry box and the program will minimize until it is needed later. The program uses very little resources! @@ -141,4 +143,4 @@ K$ = {{Cl|UCASE$}}({{Cl|INPUT$}}(1)) {{PageNavigation}} -< + diff --git a/internal/help/_CLIPBOARDIMAGE_(function).txt b/internal/help/_CLIPBOARDIMAGE_(function)__11111111111111_(00000000).txt similarity index 71% rename from internal/help/_CLIPBOARDIMAGE_(function).txt rename to internal/help/_CLIPBOARDIMAGE_(function)__11111111111111_(00000000).txt index 79bdfa142..194cdb8fc 100644 --- a/internal/help/_CLIPBOARDIMAGE_(function).txt +++ b/internal/help/_CLIPBOARDIMAGE_(function)__11111111111111_(00000000).txt @@ -1,14 +1,16 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:03}} {{DISPLAYTITLE:_CLIPBOARDIMAGE (function)}} The [[_CLIPBOARDIMAGE (function)|_CLIPBOARDIMAGE]] function pastes an image from the clipboard into a new 32-bit image in memory. {{PageSyntax}} -: {{Parameter|newImageHandle&}} = [[_CLIPBOARDIMAGE (function)|_CLIPBOARDIMAGE]] +: {{Parameter|newImageHandle&}} = [[_CLIPBOARDIMAGE (function)|_CLIPBOARDIMAGE]] {{PageDescription}} -* When the paste operation is successful, {{Parameter|newImageHandle&}} will be < -1. Handle values of -1 or 0 indicate that there wasn't an image in the clipboard or that the format wasn't accepted. -* Use [[_FREEIMAGE]] to free the memory used by {{Parameter|newImageHandle&}} when it's no longer needed by your program. +* When the paste operation is successful, {{Parameter|newImageHandle&}} will be < -1. Handle values of -1 or 0 indicate that there wasn't an image in the clipboard or that the format wasn't accepted. +* Use [[_FREEIMAGE]] to free the memory used by {{Parameter|newImageHandle&}} when it's no longer needed by your program. * [[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Not available in Linux or macOS]]. @@ -23,16 +25,16 @@ The [[_CLIPBOARDIMAGE (function)|_CLIPBOARDIMAGE]] function pastes an image from {{Cl|CLS}} {{Cl|COLOR}} {{Cl|_RGB32}}(177, 177, 177) {{Cl|PRINT}} "Monitoring clipboard..." - {{Cl|IF}} img& < -1 {{Cl|THEN}} _FREEIMAGE img& - img& = {{Cl|_CLIPBOARDIMAGE}} - IF img& < -1 THEN + {{Cl|IF}} img& < -1 {{Cl|THEN}} _FREEIMAGE img& + img& = {{Cl|_CLIPBOARDIMAGE}} + IF img& < -1 THEN {{Cl|PRINT}} "Image found:" {{Cl|COLOR}} _RGB32(255, 255, 255) - {{Cl|PRINT}} "Width :"; {{Cl|_WIDTH (function)|_WIDTH}}(img&) - {{Cl|PRINT}} "Height:"; {{Cl|_HEIGHT|_HEIGHT}}(img&) - w = {{Cl|_WIDTH (function)|_WIDTH}} / 2 - {{Cl|_WIDTH (function)|_WIDTH}}(img&) / 2 - IF w < 0 THEN w = 0 - {{Cl|_PUTIMAGE}} (w, {{Cl|CSRLIN}} * {{Cl|_FONTHEIGHT}}), img& + {{Cl|PRINT}} "Width :"; {{Cl|_WIDTH (function)|_WIDTH}}(img&) + {{Cl|PRINT}} "Height:"; {{Cl|_HEIGHT|_HEIGHT}}(img&) + w = {{Cl|_WIDTH (function)|_WIDTH}} / 2 - {{Cl|_WIDTH (function)|_WIDTH}}(img&) / 2 + IF w < 0 THEN w = 0 + {{Cl|_PUTIMAGE}} (w, {{Cl|CSRLIN}} * {{Cl|_FONTHEIGHT}}), img& ELSE PRINT "No image found." END IF @@ -49,4 +51,4 @@ The [[_CLIPBOARDIMAGE (function)|_CLIPBOARDIMAGE]] function pastes an image from {{PageNavigation}} -< + diff --git a/internal/help/_CLIPBOARDIMAGE.txt b/internal/help/_CLIPBOARDIMAGE__11111111111111.txt similarity index 79% rename from internal/help/_CLIPBOARDIMAGE.txt rename to internal/help/_CLIPBOARDIMAGE__11111111111111.txt index 136a28fcb..c2a3eef17 100644 --- a/internal/help/_CLIPBOARDIMAGE.txt +++ b/internal/help/_CLIPBOARDIMAGE__11111111111111.txt @@ -1,13 +1,15 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:05}} {{DISPLAYTITLE:_CLIPBOARDIMAGE}} The [[_CLIPBOARDIMAGE]] statement copies a valid QB64 image to the clipboard. {{PageSyntax}} -: [[_CLIPBOARDIMAGE]] = {{Parameter|existingImageHandle&}} +: [[_CLIPBOARDIMAGE]] = {{Parameter|existingImageHandle&}} {{PageDescription}} -* {{Parameter|existingImageHandle&}} is a valid handle to a graphic QB64 image in memory, created with [[_NEWIMAGE]], [[_LOADIMAGE]] or [[_COPYIMAGE]]. +* {{Parameter|existingImageHandle&}} is a valid handle to a graphic QB64 image in memory, created with [[_NEWIMAGE]], [[_LOADIMAGE]] or [[_COPYIMAGE]]. * You can pass [[_SOURCE]], [[_DEST]] or [[_DISPLAY]] to copy the current source, destination or active display pages, as long as they are valid graphic images. * SCREEN 0 handles (created either with [[_NEWIMAGE]] or passed using _DEST while in a text screen) are not valid and will create an [[ERROR Codes|Illegal Function Call]] or [[ERROR Codes|Invalid Handle]] error. * [[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Not available in Linux or macOS]]. @@ -22,8 +24,8 @@ The [[_CLIPBOARDIMAGE]] statement copies a valid QB64 image to the clipboard. {{CodeStart}}{{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(800, 600, 32) 'Create image in memory: -canvas& = {{Cl|_NEWIMAGE}}(300, 200, 32) -{{Cl|_DEST}} canvas& +canvas& = {{Cl|_NEWIMAGE}}(300, 200, 32) +{{Cl|_DEST}} canvas& 'Draw some random rectangles: {{Cl|RANDOMIZE}} {{Cl|TIMER}} @@ -37,11 +39,11 @@ m$ = " Hello, world! " 'Show the image: {{Cl|_DEST}} 0 -{{Cl|_PUTIMAGE}} (_WIDTH / 2 - _WIDTH(canvas&) / 2, _HEIGHT / 2 - _HEIGHT(canvas&) / 2), canvas& +{{Cl|_PUTIMAGE}} (_WIDTH / 2 - _WIDTH(canvas&) / 2, _HEIGHT / 2 - _HEIGHT(canvas&) / 2), canvas& {{Cl|PRINT}} "Image generated." 'Copy to the clipboard: -{{Cl|_CLIPBOARDIMAGE}} = canvas& +{{Cl|_CLIPBOARDIMAGE}} = canvas& PRINT "Image copied to clipboard." {{CodeEnd}} @@ -54,4 +56,4 @@ PRINT "Image copied to clipboard." {{PageNavigation}} -< + diff --git a/internal/help/_CLIP.txt b/internal/help/_CLIP__1111.txt similarity index 96% rename from internal/help/_CLIP.txt rename to internal/help/_CLIP__1111.txt index 09fb93598..f1c8dd5ac 100644 --- a/internal/help/_CLIP.txt +++ b/internal/help/_CLIP__1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:00}} {{DISPLAYTITLE:_CLIP}} The [[_CLIP]] option is used in a QB64 graphics [[PUT (graphics statement)|PUT]] to allow placement of an image partially off of the screen. @@ -14,7 +16,7 @@ The [[_CLIP]] option is used in a QB64 graphics [[PUT (graphics statement)|PUT]] {{PageExamples}} ''Example:'' Placing an image partially or fully offscreen. -{{CodeStart}}'' '' +{{CodeStart}} {{Cl|DIM}} mypic(500) {{Cl|SCREEN}} 13 @@ -36,7 +38,7 @@ The [[_CLIP]] option is used in a QB64 graphics [[PUT (graphics statement)|PUT]] {{Cl|IF...THEN|IF}} sel = 3 {{Cl|THEN}} {{Cl|PUT (graphics statement)|PUT}} (-10, 10), mypic(0), {{Cl|_CLIP}} ' uses the default PUT XOR operation {{Cl|IF...THEN|IF}} sel = 4 {{Cl|THEN}} {{Cl|PUT (graphics statement)|PUT}} (-10, 10), mypic(0), {{Cl|_CLIP}} PSET, 4 ' doesn't draw red pixels -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} @@ -47,4 +49,4 @@ The [[_CLIP]] option is used in a QB64 graphics [[PUT (graphics statement)|PUT]] {{PageNavigation}} -< + diff --git a/internal/help/_COMMANDCOUNT.txt b/internal/help/_COMMANDCOUNT__111111111111.txt similarity index 93% rename from internal/help/_COMMANDCOUNT.txt rename to internal/help/_COMMANDCOUNT__111111111111.txt index 12e20c662..2157a3bab 100644 --- a/internal/help/_COMMANDCOUNT.txt +++ b/internal/help/_COMMANDCOUNT__111111111111.txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:07}} {{DISPLAYTITLE:_COMMANDCOUNT}} The [[_COMMANDCOUNT]] function returns the number or arguments passed from the command line to the [[COMMAND$]] function. {{PageSyntax}} -:{{Parameter|result&}} = [[_COMMANDCOUNT]] +:{{Parameter|result&}} = [[_COMMANDCOUNT]] {{PageDescription}} @@ -28,4 +30,4 @@ The [[_COMMANDCOUNT]] function returns the number or arguments passed from the c {{PageNavigation}} -< + diff --git a/internal/help/_CONNECTED.txt b/internal/help/_CONNECTED__111111111.txt similarity index 88% rename from internal/help/_CONNECTED.txt rename to internal/help/_CONNECTED__111111111.txt index 2203e03a9..03d125e07 100644 --- a/internal/help/_CONNECTED.txt +++ b/internal/help/_CONNECTED__111111111.txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:08}} {{DISPLAYTITLE:_CONNECTED}} The [[_CONNECTED]] function returns the status of a TCP/IP connection handle. {{PageSyntax}} -:{{Parameter|result&}} = [[_CONNECTED]]({{Parameter|connectionHandle&}}) +:{{Parameter|result&}} = [[_CONNECTED]]({{Parameter|connectionHandle&}}) {{PageDescription}} @@ -23,4 +25,4 @@ The [[_CONNECTED]] function returns the status of a TCP/IP connection handle. {{PageNavigation}} -< + diff --git a/internal/help/_CONNECTIONADDRESS$.txt b/internal/help/_CONNECTIONADDRESS$__11111111111111111$.txt similarity index 95% rename from internal/help/_CONNECTIONADDRESS$.txt rename to internal/help/_CONNECTIONADDRESS$__11111111111111111$.txt index 8af637cae..3f2c25b17 100644 --- a/internal/help/_CONNECTIONADDRESS$.txt +++ b/internal/help/_CONNECTIONADDRESS$__11111111111111111$.txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:09}} {{DISPLAYTITLE:_CONNECTIONADDRESS}} The [[_CONNECTIONADDRESS]] function returns a connected user's [[STRING]] IP address value. {{PageSyntax}} -:{{Parameter|result$}} = [[_CONNECTIONADDRESS|_CONNECTIONADDRESS[$]]]({{Parameter|connectionHandle&}}) +:{{Parameter|result$}} = [[_CONNECTIONADDRESS|_CONNECTIONADDRESS[$]]]({{Parameter|connectionHandle&}}) {{PageDescription}} @@ -16,7 +18,7 @@ The [[_CONNECTIONADDRESS]] function returns a connected user's [[STRING]] IP add {{PageExamples}} ''Example:'' A Host logging new chat clients in a Chat program. See the [[_OPENHOST]] example for the rest of the code used. -{{CodeStart}} '' '' +{{CodeStart}} f = {{Cl|FREEFILE}} {{Cl|OPEN}} "ChatLog.dat" {{Cl|FOR}} {{Cl|APPEND}} {{Cl|AS}} #f ' code at start of host section before DO loop. @@ -29,8 +31,7 @@ newclient = {{Cl|_OPENCONNECTION}}(host) ' receive any new client connection han {{Cl|PRINT}} IP$ + " has joined." ' displayed to Host only {{Cl|PRINT (file statement)|PRINT #f}}, IP$, numclients ' print info to a log file {{Cl|PRINT (file statement)|PRINT #}}Users(numclients),"Welcome!" ' from Host to new clients only -{{Cl|END IF}} '' '' - +{{Cl|END IF}} {{CodeEnd}} : ''Explanation:'' The function returns the new client's IP address to the IP$ variable. Prints the IP and the original login position to a log file. The information can later be used by the host for referance if necessary. The host could set up a ban list too. @@ -44,4 +45,4 @@ newclient = {{Cl|_OPENCONNECTION}}(host) ' receive any new client connection han {{PageNavigation}} -< + diff --git a/internal/help/_CONSOLEINPUT.txt b/internal/help/_CONSOLEINPUT__111111111111.txt similarity index 94% rename from internal/help/_CONSOLEINPUT.txt rename to internal/help/_CONSOLEINPUT__111111111111.txt index 2afa3ef54..d5478bbfd 100644 --- a/internal/help/_CONSOLEINPUT.txt +++ b/internal/help/_CONSOLEINPUT__111111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:13}} {{DISPLAYTITLE:_CONSOLEINPUT}} The [[_CONSOLEINPUT]] function is used to monitor any new mouse or keyboard input coming from a $CONSOLE window. It must be called in order for [[_CINP]] to return valid values. Windows-only. @@ -15,11 +17,11 @@ The [[_CONSOLEINPUT]] function is used to monitor any new mouse or keyboard inpu {{PageExamples}} ''Example 1:'' Reading individual key strokes from a console window (Windows). -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|$CONSOLE}}:ONLY {{Cl|_DEST}} {{Cl|_CONSOLE}}: {{Cl|_SOURCE}} {{Cl|_CONSOLE}} -{{Cl|PRINT}} "Press any key, and I'll give you the scan code for it. <ESC> quits the demo." +{{Cl|PRINT}} "Press any key, and I'll give you the scan code for it. quits the demo." {{Cl|PRINT}} {{Cl|PRINT}} {{Cl|DO}} @@ -41,4 +43,4 @@ The [[_CONSOLEINPUT]] function is used to monitor any new mouse or keyboard inpu {{PageNavigation}} -< + diff --git a/internal/help/_CONSOLETITLE.txt b/internal/help/_CONSOLETITLE__111111111111.txt similarity index 93% rename from internal/help/_CONSOLETITLE.txt rename to internal/help/_CONSOLETITLE__111111111111.txt index 75ec734b7..2877d7ccc 100644 --- a/internal/help/_CONSOLETITLE.txt +++ b/internal/help/_CONSOLETITLE__111111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:14}} {{DISPLAYTITLE:_CONSOLETITLE}} The [[_CONSOLETITLE]] statement creates the title of the console window using a literal or variable [[STRING|string]]. @@ -12,7 +14,7 @@ The [[_CONSOLETITLE]] statement creates the title of the console window using a {{PageExamples}} ''Example:'' Hiding the main program window while displaying the console window with a title. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|$SCREENHIDE}} {{Cl|_DELAY}} 4 {{Cl|$CONSOLE}} @@ -33,4 +35,4 @@ The [[_CONSOLETITLE]] statement creates the title of the console window using a {{PageNavigation}} -< + diff --git a/internal/help/_CONSOLE.txt b/internal/help/_CONSOLE__1111111.txt similarity index 96% rename from internal/help/_CONSOLE.txt rename to internal/help/_CONSOLE__1111111.txt index a3bf97c51..ed04daee9 100644 --- a/internal/help/_CONSOLE.txt +++ b/internal/help/_CONSOLE__1111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:12}} {{DISPLAYTITLE:_CONSOLE}} The [[_CONSOLE]] statement can be used to turn a console window ON/OFF. @@ -19,7 +21,7 @@ The [[_CONSOLE]] statement can be used to turn a console window ON/OFF. {{PageExamples}} ''Example 1:'' Hiding and displaying a console window. Use [[_DELAY]] to place console in front of main program window. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|$CONSOLE}} {{Cl|_CONSOLE}} OFF 'close original console {{Cl|_DELAY}} 2 @@ -31,13 +33,13 @@ The [[_CONSOLE]] statement can be used to turn a console window ON/OFF. {{Cl|_DEST}} 0 'destination program window {{Cl|PRINT}} nme$ -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} : ''Explanation:'' The [[_DEST|destination]] must be changed with [[_DEST]] [[_CONSOLE]] to get [[INPUT]] from the [[$CONSOLE]] screen. ''Example 2:'' [[_CONSOLETITLE]] can be used to create a console title, but it must be redone every time the console window is restored once turned off: -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|$CONSOLE}} {{Cl|_CONSOLETITLE}} "firstone" @@ -60,4 +62,4 @@ The [[_CONSOLE]] statement can be used to turn a console window ON/OFF. {{PageNavigation}} -< + diff --git a/internal/help/_CONTINUE.txt b/internal/help/_CONTINUE__11111111.txt similarity index 81% rename from internal/help/_CONTINUE.txt rename to internal/help/_CONTINUE__11111111.txt index a78e5ecec..cb796c2ff 100644 --- a/internal/help/_CONTINUE.txt +++ b/internal/help/_CONTINUE__11111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:16}} {{DISPLAYTITLE:_CONTINUE}} The [[_CONTINUE]] statement is used in a [[DO...LOOP]], [[WHILE...WEND]] or [[FOR...NEXT]] block to skip the remaining lines of code in a block (without exiting it) and start the next iteration. It works as a shortcut to a [[GOTO]], but without the need for a [[line numbers|line label]]. @@ -7,8 +9,9 @@ The [[_CONTINUE]] statement is used in a [[DO...LOOP]], [[WHILE...WEND]] or [[FO : [[_CONTINUE]] -==Availability== -* Build 20170628/55 up. +{{PageAvailability}} +* '''QB64 1.2 and up''' (QB64 Team) +* '''QBPE 0.5 and up''' (QB64 Phoenix Edition) {{PageExamples}} @@ -31,4 +34,4 @@ The [[_CONTINUE]] statement is used in a [[DO...LOOP]], [[WHILE...WEND]] or [[FO * [[GOTO]] {{PageNavigation}} -< + diff --git a/internal/help/_CONTROLCHR_(function).txt b/internal/help/_CONTROLCHR_(function)__1111111111_(00000000).txt similarity index 93% rename from internal/help/_CONTROLCHR_(function).txt rename to internal/help/_CONTROLCHR_(function)__1111111111_(00000000).txt index b7904b85e..d876da508 100644 --- a/internal/help/_CONTROLCHR_(function).txt +++ b/internal/help/_CONTROLCHR_(function)__1111111111_(00000000).txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:18}} {{DISPLAYTITLE:_CONTROLCHR (function)}} The [[_CONTROLCHR (function)|_CONTROLCHR]] function returns the current state of the [[_CONTROLCHR]] statement as -1 when OFF and 0 when ON. @@ -22,4 +24,4 @@ The [[_CONTROLCHR (function)|_CONTROLCHR]] function returns the current state of {{PageNavigation}} -< + diff --git a/internal/help/_CONTROLCHR.txt b/internal/help/_CONTROLCHR__1111111111.txt similarity index 76% rename from internal/help/_CONTROLCHR.txt rename to internal/help/_CONTROLCHR__1111111111.txt index a68d436c2..fec4fe36f 100644 --- a/internal/help/_CONTROLCHR.txt +++ b/internal/help/_CONTROLCHR__1111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:17}} {{DISPLAYTITLE:_CONTROLCHR}} The [[_CONTROLCHR]] statement can be used to turn OFF control character attributes and allow them to be printed. @@ -16,7 +18,7 @@ The [[_CONTROLCHR]] statement can be used to turn OFF control character attribut {{PageExamples}} ''Example:'' Printing the 255 [[ASCII]] characters in [[SCREEN]] 0 with 32 colors. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DIM}} i {{Cl|AS}} {{Cl|_UNSIGNED}} {{Cl|_BYTE}} {{Cl|WIDTH}} 40, 25 {{Cl|CLS}} @@ -25,16 +27,16 @@ i = 0 DO {{Cl|PRINT}} {{Cl|CHR$}}(i); i = i + 1 - {{Cl|IF...THEN|IF}} (i {{Cl|AND (boolean)|AND}} {{Cl|&H}}F) = 0 {{Cl|THEN}} {{Cl|PRINT}} + {{Cl|IF...THEN|IF}} (i {{Cl|AND (boolean)|AND}} {{Cl|&H}}F) = 0 {{Cl|THEN}} {{Cl|PRINT}} {{Cl|LOOP}} {{Cl|WHILE}} i {{Cl|LOCATE}} 1, 20 DO - {{Cl|COLOR}} i {{Cl|AND (boolean)|AND}} {{Cl|&H}}F {{Cl|OR (boolean)|OR}} (i {{Cl|AND (boolean)|AND}} {{Cl|&H}}80) \ {{Cl|&H}}8, (i {{Cl|AND (boolean)|AND}} {{Cl|&H}}70) \ {{Cl|&H}}10 + {{Cl|COLOR}} i {{Cl|AND (boolean)|AND}} {{Cl|&H}}F {{Cl|OR (boolean)|OR}} (i {{Cl|AND (boolean)|AND}} {{Cl|&H}}80) \ {{Cl|&H}}8, (i {{Cl|AND (boolean)|AND}} {{Cl|&H}}70) \ {{Cl|&H}}10 {{Cl|PRINT}} {{Cl|CHR$}}(i); i = i + 1 - {{Cl|IF...THEN|IF}} (i {{Cl|AND (boolean)|AND}} {{Cl|&H}}F) = 0 {{Cl|THEN}} {{Cl|LOCATE}} 1 + i \ {{Cl|&H}}10, 20 + {{Cl|IF...THEN|IF}} (i {{Cl|AND (boolean)|AND}} {{Cl|&H}}F) = 0 {{Cl|THEN}} {{Cl|LOCATE}} 1 + i \ {{Cl|&H}}10, 20 {{Cl|LOOP}} {{Cl|WHILE}} i -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} @@ -47,4 +49,4 @@ DO {{PageNavigation}} -< + diff --git a/internal/help/_COPYIMAGE.txt b/internal/help/_COPYIMAGE__111111111.txt similarity index 71% rename from internal/help/_COPYIMAGE.txt rename to internal/help/_COPYIMAGE__111111111.txt index de7842f05..e767b7f95 100644 --- a/internal/help/_COPYIMAGE.txt +++ b/internal/help/_COPYIMAGE__111111111.txt @@ -1,15 +1,17 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:19}} {{DISPLAYTITLE:_COPYIMAGE}} The [[_COPYIMAGE]] function creates an identical designated image in memory with a different negative [[LONG]] handle value. {{PageSyntax}} -: newhandle& = [[_COPYIMAGE]][({{Parameter|imageHandle&}}[, {{Parameter|mode%}})]] +: newhandle& = [[_COPYIMAGE]][({{Parameter|imageHandle&}}[, {{Parameter|mode%}})]] {{Parameters}} -* The [[LONG]] ''newhandle&'' value returned will be different than the source handle value supplied. -* If ''imageHandle&'' parameter is omitted or zero is designated, the current software [[_DEST|destination]] screen or image is copied. -* If 1 is designated instead of an ''imageHandle&'', it designates the last OpenGL hardware surface to copy. +* The [[LONG]] ''newhandle&'' value returned will be different than the source handle value supplied. +* If ''imageHandle&'' parameter is omitted or zero is designated, the current software [[_DEST|destination]] screen or image is copied. +* If 1 is designated instead of an ''imageHandle&'', it designates the last OpenGL hardware surface to copy. * ''Mode'' 32 can be used to convert 256 color images to 32 bit colors. * ''Mode'' 33 images are hardware accelerated in '''version 1.000 and up''', and are created using [[_LOADIMAGE]] or [[_COPYIMAGE]]. @@ -27,35 +29,35 @@ The [[_COPYIMAGE]] function creates an identical designated image in memory with {{PageExamples}} ''Example:'' Restoring a Legacy SCREEN using the _COPYIMAGE return value. -{{CodeStart}}'' '' +{{CodeStart}} {{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}} +oldmode& = {{Cl|_COPYIMAGE}}(0) 'the 0 value designates the current destination {{Cl|SCREEN}} -s& = {{Cl|_NEWIMAGE}}(800, 600, 32) -{{Cl|SCREEN}} s& +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& -{{Cl|END}} '' '' +{{Cl|SCREEN}} oldmode& 'restore original screen +{{Cl|IF...THEN|IF}} s& < -1 THEN {{Cl|_FREEIMAGE}} s& +{{Cl|END}} {{CodeEnd}} : ''Note:'' Only free valid handle values with [[_FREEIMAGE]] AFTER a new [[SCREEN]] mode is being used by the program. ''Example 2:'' Program that copies desktop to a hardware image to form a 3D triangle ('''version 1.000 and up'''): -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, 32) my_hardware_handle = {{Cl|_COPYIMAGE}}({{Cl|_SCREENIMAGE}}, 33) 'take a screenshot and use it as our texture {{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}} @@ -70,4 +72,4 @@ my_hardware_handle = {{Cl|_COPYIMAGE}}({{Cl|_SCREENIMAGE}}, 33) 'take a screensh {{PageNavigation}} -< + diff --git a/internal/help/_COPYPALETTE.txt b/internal/help/_COPYPALETTE__11111111111.txt similarity index 57% rename from internal/help/_COPYPALETTE.txt rename to internal/help/_COPYPALETTE__11111111111.txt index 53a129761..e7e48ca7e 100644 --- a/internal/help/_COPYPALETTE.txt +++ b/internal/help/_COPYPALETTE__11111111111.txt @@ -1,18 +1,20 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:21}} {{DISPLAYTITLE:_COPYPALETTE}} The [[_COPYPALETTE]] statement copies the color palette intensities from one 4 or 8 BPP image to another image or a [[_NEWIMAGE]] screen page using 256 or less colors. {{PageSyntax}} -:[[_COPYPALETTE]] [{{Parameter|sourceImageHandle&}}[, {{Parameter|destinationImageHandle&}}]] +:[[_COPYPALETTE]] [{{Parameter|sourceImageHandle&}}[, {{Parameter|destinationImageHandle&}}]] {{PageDescription}} * Palette Intensity settings are '''not''' used by 24/32 bit images. Use only with 4 or 8 BPP images. * [[_PIXELSIZE]] function returns 1 to indicate that _COPYPALETTE can be used. 4 indicates 24/32 bit images. -* If {{Parameter|sourceImageHandle&}} is omitted, it is assumed to be the current read page. -* If {{Parameter|destinationImageHandle&}} is omitted, it is assumed to be the current write page. -* If either of the images specified by {{Parameter|sourceImageHandle&}} or {{Parameter|destinationImageHandle&}} do not use a palette, an [[ERROR Codes|illegal function call]] error is returned. -* If either {{Parameter|sourceImageHandle&}} or {{Parameter|destinationImageHandle&}} is an invalid handle, an [[ERROR Codes|invalid handle]] error is returned. +* If {{Parameter|sourceImageHandle&}} is omitted, it is assumed to be the current read page. +* If {{Parameter|destinationImageHandle&}} is omitted, it is assumed to be the current write page. +* If either of the images specified by {{Parameter|sourceImageHandle&}} or {{Parameter|destinationImageHandle&}} do not use a palette, an [[ERROR Codes|illegal function call]] error is returned. +* If either {{Parameter|sourceImageHandle&}} or {{Parameter|destinationImageHandle&}} is an invalid handle, an [[ERROR Codes|invalid handle]] error is returned. * When loading 4 or 8 BPP image files, it is necessary to adopt the color palette of the image or it may not have the correct colors! @@ -28,4 +30,4 @@ The [[_COPYPALETTE]] statement copies the color palette intensities from one 4 o {{PageNavigation}} -< + diff --git a/internal/help/_CV.txt b/internal/help/_CV__11.txt similarity index 95% rename from internal/help/_CV.txt rename to internal/help/_CV__11.txt index ae9006fad..744f11f34 100644 --- a/internal/help/_CV.txt +++ b/internal/help/_CV__11.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:23}} {{DISPLAYTITLE:_CV}} The [[_CV]] function is used to convert [[_MK$]], [[ASCII]], [[STRING]] values to numerical values. @@ -19,7 +21,7 @@ The [[_CV]] function is used to convert [[_MK$]], [[ASCII]], [[STRING]] values t {{PageExamples}} ''Example:'' Using the _MK$ and _CV functions: -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DIM}} i64 {{Cl|AS}} {{Cl|_INTEGER64}} {{Cl|DIM}} i64str {{Cl|AS}} {{Cl|STRING}} @@ -30,7 +32,7 @@ i64str = {{Cl|_MK$}}({{Cl|_INTEGER64}}, i64) {{Cl|PRINT}} "_MK$: "; i64str i64 = {{Cl|_CV}}({{Cl|_INTEGER64}}, i64str) -{{Cl|PRINT}} "_CV:"; i64 '' '' +{{Cl|PRINT}} "_CV:"; i64 {{CodeEnd}} {{OutputStart}} I64: 2305843009213693952 @@ -53,4 +55,4 @@ _CV: 2305843009213693952 {{PageNavigation}} -< + diff --git a/internal/help/_CWD$.txt b/internal/help/_CWD$__111$.txt similarity index 96% rename from internal/help/_CWD$.txt rename to internal/help/_CWD$__111$.txt index 5111cd840..97e3efeb3 100644 --- a/internal/help/_CWD$.txt +++ b/internal/help/_CWD$__111$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:25}} {{DISPLAYTITLE:_CWD$}} The [[_CWD$]] function returns the current working directory path as a string value without a trailing path separator. @@ -21,7 +23,7 @@ The [[_CWD$]] function returns the current working directory path as a string va {{PageExamples}} ''Example:'' Get the current working directory, and move around the file system: -{{CodeStart}} '' '' +{{CodeStart}} startdir$ = _CWD$ {{Cl|PRINT}} "We started at "; startdir$ {{Cl|MKDIR}} "a_temporary_dir" @@ -48,4 +50,4 @@ And now we're back in C:\QB64 {{PageNavigation}} -< + diff --git a/internal/help/_D2G.txt b/internal/help/_D2G__121.txt similarity index 78% rename from internal/help/_D2G.txt rename to internal/help/_D2G__121.txt index e203b1e77..02c5c681f 100644 --- a/internal/help/_D2G.txt +++ b/internal/help/_D2G__121.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:26}} {{DISPLAYTITLE:_D2G}} The [[_D2G]] function converts a '''degree''' value into a '''gradient''' value. @@ -6,8 +8,9 @@ The [[_D2G]] function converts a '''degree''' value into a '''gradient''' value. : {{Parameter|result}} = [[_D2G]]({{Parameter|num}}) -==Availability== -* '''Version 1.000 and up.''' +{{PageAvailability}} +* '''QB64 1.0 and up''' (QB64 Team) +* '''QBPE 0.5 and up''' (QB64 Phoenix Edition) {{PageExamples}} @@ -31,4 +34,4 @@ That angle in Gradient is 66.66666 {{PageNavigation}} -< + diff --git a/internal/help/_D2R.txt b/internal/help/_D2R__121.txt similarity index 78% rename from internal/help/_D2R.txt rename to internal/help/_D2R__121.txt index 2383477a0..460d0e81f 100644 --- a/internal/help/_D2R.txt +++ b/internal/help/_D2R__121.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:27}} {{DISPLAYTITLE:_D2R}} The [[_D2R]] function converts a '''degree''' value into a '''radian''' value. @@ -6,8 +8,9 @@ The [[_D2R]] function converts a '''degree''' value into a '''radian''' value. :: {{Parameter|result}} = [[_D2R]]({{Parameter|num}}) -==Availability== -* '''Version 1.000 and up.''' +{{PageAvailability}} +* '''QB64 1.0 and up''' (QB64 Team) +* '''QBPE 0.5 and up''' (QB64 Phoenix Edition) {{PageExamples}} @@ -31,4 +34,4 @@ That angle in Radians is 1.047198 {{PageNavigation}} -< + diff --git a/internal/help/_DEFAULTCOLOR.txt b/internal/help/_DEFAULTCOLOR__111111111111.txt similarity index 53% rename from internal/help/_DEFAULTCOLOR.txt rename to internal/help/_DEFAULTCOLOR__111111111111.txt index fb7ce947d..4a5c366cb 100644 --- a/internal/help/_DEFAULTCOLOR.txt +++ b/internal/help/_DEFAULTCOLOR__111111111111.txt @@ -1,26 +1,28 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:33}} {{DISPLAYTITLE:_DEFAULTCOLOR}} The [[_DEFAULTCOLOR]] function returns the current default text color for an image handle or page. {{PageSyntax}} -:{{Parameter|result&}} = [[_DEFAULTCOLOR]] [({{Parameter|imageHandle&}})] +:{{Parameter|result&}} = [[_DEFAULTCOLOR]] [({{Parameter|imageHandle&}})] {{PageDescription}} -* If {{Parameter|imageHandle&}} is omitted, it is assumed to be the current write page or image designated by [[_DEST]]. -* If {{Parameter|imageHandle&}} is an invalid handle, an [[ERROR Codes|invalid handle]] error occurs. Check handle values first. +* If {{Parameter|imageHandle&}} is omitted, it is assumed to be the current write page or image designated by [[_DEST]]. +* If {{Parameter|imageHandle&}} is an invalid handle, an [[ERROR Codes|invalid handle]] error occurs. Check handle values first. * Default foreground colors are: [[SCREEN]] 0 = 7, [[SCREEN]] 1 and 10 = 3, [[SCREEN]] 2 and 11 = 1. All other [[SCREEN]]s = 15. {{PageExamples}} ''Example:'' The default color is the color assigned to the text foreground. The [[SCREEN]] 12 default is [[COLOR]] 15. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 12 -{{Cl|OUT}} {{Cl|&H}}3C8, 0: {{Cl|OUT}} {{Cl|&H}}3C9, 63: {{Cl|OUT}} {{Cl|&H}}3C9, 63: {{Cl|OUT}} {{Cl|&H}}3C9, 63 'assign background RGB intensities -{{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|OUT}} {{Cl|&H}}3C8, 0: {{Cl|OUT}} {{Cl|&H}}3C9, 63: {{Cl|OUT}} {{Cl|&H}}3C9, 63: {{Cl|OUT}} {{Cl|&H}}3C9, 63 'assign background RGB intensities +{{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 }} {{Cl|_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}} @@ -32,4 +34,4 @@ The [[_DEFAULTCOLOR]] function returns the current default text color for an ima {{PageNavigation}} -< + diff --git a/internal/help/_DEFINE.txt b/internal/help/_DEFINE__111111.txt similarity index 91% rename from internal/help/_DEFINE.txt rename to internal/help/_DEFINE__111111.txt index edaa873ff..1f770083c 100644 --- a/internal/help/_DEFINE.txt +++ b/internal/help/_DEFINE__111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:34}} {{DISPLAYTITLE:_DEFINE}} [[_DEFINE]] defines a set of variable names according to their first character as a specified data type. @@ -15,14 +17,14 @@ {{PageDescription}} * '''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. +* '''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. * May also affect [[$INCLUDE]] procedures. {{PageExamples}} ''Example:'' Defining variables that start with the letters A, B, C or F as unsigned integers, including the ''Add2'' [[FUNCTION]]. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|_DEFINE}} A-C, F {{Cl|AS}} {{Cl|_UNSIGNED}} {{Cl|INTEGER}} {{Cl|PRINT}} Add2(-1.1, -2.2) @@ -31,7 +33,7 @@ {{Cl|FUNCTION}} Add2 (one, two) Add2 = one + two -{{Cl|END FUNCTION}} '' '' +{{Cl|END FUNCTION}} {{CodeEnd}} {{OutputStart}}65533 {{OutputEnd}} @@ -46,4 +48,4 @@ Add2 = one + two {{PageNavigation}} -< + diff --git a/internal/help/_DEFLATE$.txt b/internal/help/_DEFLATE$__1111111$.txt similarity index 96% rename from internal/help/_DEFLATE$.txt rename to internal/help/_DEFLATE$__1111111$.txt index ed20b60ad..a33558b70 100644 --- a/internal/help/_DEFLATE$.txt +++ b/internal/help/_DEFLATE$__1111111$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:36}} {{DISPLAYTITLE:_DEFLATE$}} The [[_DEFLATE$]] function compresses a [[STRING|string]]. @@ -46,4 +48,4 @@ After using _INFLATE$ to decompress it, LEN = 1474560 {{PageNavigation}} -< + diff --git a/internal/help/_DELAY.txt b/internal/help/_DELAY__11111.txt similarity index 91% rename from internal/help/_DELAY.txt rename to internal/help/_DELAY__11111.txt index bab0a8b75..60bf38825 100644 --- a/internal/help/_DELAY.txt +++ b/internal/help/_DELAY__11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:37}} {{DISPLAYTITLE:_DELAY}} The [[_DELAY]] statement suspends program execution for a [[SINGLE]] value of seconds. @@ -19,4 +21,4 @@ The [[_DELAY]] statement suspends program execution for a [[SINGLE]] value of se {{PageNavigation}} -< + diff --git a/internal/help/_DEPTHBUFFER.txt b/internal/help/_DEPTHBUFFER__11111111111.txt similarity index 93% rename from internal/help/_DEPTHBUFFER.txt rename to internal/help/_DEPTHBUFFER__11111111111.txt index 380145769..ebd9bcabb 100644 --- a/internal/help/_DEPTHBUFFER.txt +++ b/internal/help/_DEPTHBUFFER__11111111111.txt @@ -1,10 +1,12 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:39}} {{DISPLAYTITLE:_DEPTHBUFFER}} The [[_DEPTHBUFFER]] statement turns depth buffering ON or OFF, LOCKs or _CLEARS the buffer. {{PageSyntax}} -: [[_DEPTHBUFFER]] {ON|OFF|LOCK|_CLEAR}[,handle&] +: [[_DEPTHBUFFER]] {ON|OFF|LOCK|_CLEAR}[,handle&] {{PageDescription}} @@ -25,4 +27,4 @@ The [[_DEPTHBUFFER]] statement turns depth buffering ON or OFF, LOCKs or _CLEARS {{PageNavigation}} -< + diff --git a/internal/help/_DESKTOPHEIGHT.txt b/internal/help/_DESKTOPHEIGHT__1111111111111.txt similarity index 75% rename from internal/help/_DESKTOPHEIGHT.txt rename to internal/help/_DESKTOPHEIGHT__1111111111111.txt index 66d3f352b..b9de9b502 100644 --- a/internal/help/_DESKTOPHEIGHT.txt +++ b/internal/help/_DESKTOPHEIGHT__1111111111111.txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:42}} {{DISPLAYTITLE:_DESKTOPHEIGHT}} The [[_DESKTOPHEIGHT]] function returns the height of the users current desktop. {{PageSyntax}} -: {{Parameter|y&}} = [[_DESKTOPHEIGHT]] +: {{Parameter|y&}} = [[_DESKTOPHEIGHT]] {{PageDescription}} @@ -11,15 +13,16 @@ The [[_DESKTOPHEIGHT]] function returns the height of the users current desktop. * This returns the height of the user's desktop, not the size of any screen or window which might be open on that desktop. -==Availability== -* '''Version 1.000 and up.''' +{{PageAvailability}} +* '''QB64 1.0 and up''' (QB64 Team) +* '''QBPE 0.5 and up''' (QB64 Phoenix Edition) {{PageExamples}} {{CodeStart}} - s& = {{Cl|_NEWIMAGE}}(800, 600, 256) - SCREEN s& + s& = {{Cl|_NEWIMAGE}}(800, 600, 256) + SCREEN s& PRINT _DESKTOPWIDTH, _DESKTOPHEIGHT PRINT _WIDTH, _HEIGHT @@ -35,4 +38,4 @@ The [[_DESKTOPHEIGHT]] function returns the height of the users current desktop. {{PageNavigation}} -< + diff --git a/internal/help/_DESKTOPWIDTH.txt b/internal/help/_DESKTOPWIDTH__111111111111.txt similarity index 75% rename from internal/help/_DESKTOPWIDTH.txt rename to internal/help/_DESKTOPWIDTH__111111111111.txt index 13cb55c0b..e66de1b1f 100644 --- a/internal/help/_DESKTOPWIDTH.txt +++ b/internal/help/_DESKTOPWIDTH__111111111111.txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:43}} {{DISPLAYTITLE:_DESKTOPWIDTH}} The [[_DESKTOPWIDTH]] function returns the width of the users current desktop. {{PageSyntax}} -: {{Parameter|x&}} = [[_DESKTOPWIDTH]] +: {{Parameter|x&}} = [[_DESKTOPWIDTH]] {{PageDescription}} @@ -11,15 +13,16 @@ The [[_DESKTOPWIDTH]] function returns the width of the users current desktop. * This returns the width of the user's desktop, not the size of any screen or window which might be open on that desktop. -==Availability== -* '''Version 1.000 and up.''' +{{PageAvailability}} +* '''QB64 1.0 and up''' (QB64 Team) +* '''QBPE 0.5 and up''' (QB64 Phoenix Edition) {{PageExamples}} {{CodeStart}} - s& = {{Cl|_NEWIMAGE}}(800, 600, 256) - SCREEN s& + s& = {{Cl|_NEWIMAGE}}(800, 600, 256) + SCREEN s& PRINT _DESKTOPWIDTH, _DESKTOPHEIGHT PRINT _WIDTH, _HEIGHT @@ -35,4 +38,4 @@ The [[_DESKTOPWIDTH]] function returns the width of the users current desktop. {{PageNavigation}} -< + diff --git a/internal/help/_DEST_(function).txt b/internal/help/_DEST_(function)__1111_(00000000).txt similarity index 90% rename from internal/help/_DEST_(function).txt rename to internal/help/_DEST_(function)__1111_(00000000).txt index 3a3163400..1c57378b4 100644 --- a/internal/help/_DEST_(function).txt +++ b/internal/help/_DEST_(function)__1111_(00000000).txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:45}} {{DISPLAYTITLE:_DEST (function)}} The [[_DEST]] function returns the handle value of the current write page (the image used for drawing). {{PageSyntax}} -:{{Parameter|result&}} = [[_DEST]] +:{{Parameter|result&}} = [[_DEST]] {{PageDescription}} @@ -20,4 +22,4 @@ The [[_DEST]] function returns the handle value of the current write page (the i {{PageNavigation}} -< + diff --git a/internal/help/_DEST.txt b/internal/help/_DEST__1111.txt similarity index 67% rename from internal/help/_DEST.txt rename to internal/help/_DEST__1111.txt index cf9c839d3..7e6a08c8e 100644 --- a/internal/help/_DEST.txt +++ b/internal/help/_DEST__1111.txt @@ -1,37 +1,39 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:44}} {{DISPLAYTITLE:_DEST}} The [[_DEST]] statement sets the current write image or page. All graphic and print changes will be done to this image. {{PageSyntax}} -:[[_DEST]] {{Parameter|imageHandle&}} +:[[_DEST]] {{Parameter|imageHandle&}} {{PageDescription}} -* {{Parameter|imageHandle&}} is the handle of the image that will act as the current write page. +* {{Parameter|imageHandle&}} is the handle of the image that will act as the current write page. * '''_DEST 0''' refers to the present program [[SCREEN]]. You can use 0 to refer to the present program [[SCREEN]]. * [[_DEST]] [[_CONSOLE]] can set the destination to send information to a console window using [[PRINT]] or [[INPUT]]. -* If {{Parameter|imageHandle&}} is an invalid handle, an [[ERROR Codes|invalid handle]] error occurs. Always check for valid handle values first ({{Parameter|imageHandle&}} < -1). +* If {{Parameter|imageHandle&}} is an invalid handle, an [[ERROR Codes|invalid handle]] error occurs. Always check for valid handle values first ({{Parameter|imageHandle&}} < -1). *''Note:'' Use [[_SOURCE]] when you need to read a page or image with [[POINT]], [[GET (graphics statement)|GET]] or the [[SCREEN (function)|SCREEN]] function. {{PageExamples}} ''Example 1:'' Placing a center point and a circle using [[_CLEARCOLOR]] to eliminate the background color black. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN (statement)|SCREEN}} 13 'program screen can use 256 colors -a& = {{Cl|_NEWIMAGE}}(320,200,13) 'create 2 screen page handles a& and b& -b& = {{Cl|_NEWIMAGE}}(320,200,13) -{{Cl|_DEST}} a& 'set destination image to handle a& -{{Cl|PSET}} (100, 100), 15 'draw a dot on the current destination handle a& -{{Cl|_DEST}} b& 'set destination image to handle b& -{{Cl|CIRCLE}} (100, 100), 50, 15 'draw a circle on the current destination handle b& +a& = {{Cl|_NEWIMAGE}}(320,200,13) 'create 2 screen page handles a& and b& +b& = {{Cl|_NEWIMAGE}}(320,200,13) +{{Cl|_DEST}} a& 'set destination image to handle a& +{{Cl|PSET}} (100, 100), 15 'draw a dot on the current destination handle a& +{{Cl|_DEST}} b& 'set destination image to handle b& +{{Cl|CIRCLE}} (100, 100), 50, 15 'draw a circle on the current destination handle b& {{Cl|_CLEARCOLOR}} 0 'make page b color 0 (black) transparent -{{Cl|_PUTIMAGE}} , b&, a& 'put circle on image b to image a& (a PSET dot) -{{Cl|_PUTIMAGE}} , a&, 0 'put what is on image a& to the screen (handle 0) '' '' +{{Cl|_PUTIMAGE}} , b&, a& 'put circle on image b to image a& (a PSET dot) +{{Cl|_PUTIMAGE}} , a&, 0 'put what is on image a& to the screen (handle 0) {{CodeEnd}} ''Example 2:'' Demonstrates how [[PRINT|printed]] text can be stretched using [[_PUTIMAGE]] with [[_DEST]] pages. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DIM}} a(10) {{Cl|AS}} {{Cl|LONG}} {{Cl|DIM}} b {{Cl|AS}} {{Cl|LONG}} @@ -89,16 +91,16 @@ 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 -{{Cl|RETURN}} '' '' +{{Cl|RETURN}} {{CodeEnd}} {{small|Adapted from code by CodeViper}} @@ -111,4 +113,4 @@ ya = ya + ym {{PageNavigation}} -< + diff --git a/internal/help/_DEVICE$.txt b/internal/help/_DEVICE$__111111$.txt similarity index 96% rename from internal/help/_DEVICE$.txt rename to internal/help/_DEVICE$__111111$.txt index a235586d5..9603ec61a 100644 --- a/internal/help/_DEVICE$.txt +++ b/internal/help/_DEVICE$__111111$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:47}} {{DISPLAYTITLE:_DEVICE$}} The '''_DEVICE$''' function returns a [[STRING]] value holding the controller type, name and input types of the input devices on a computer. @@ -25,13 +27,13 @@ The '''_DEVICE$''' function returns a [[STRING]] value holding the controller ty {{PageExamples}} ''Example 1:'' Checking for the system's input devices and the number of buttons available. -{{CodeStart}} '' '' +{{CodeStart}} devices = {{Cl|_DEVICES}} 'MUST be read in order for other 2 device functions to work! 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) -NEXT '' '' +NEXT {{CodeEnd}} {{OutputStart}}Number of input devices found = 3 [KEYBOARD][BUTTON] @@ -45,12 +47,12 @@ Buttons: 9 Axis: 6 Wheels: 0 ''Example 2:'' Finding the number of mouse buttons available in QB64. This could also be used for other devices. -{{CodeStart}} '' '' +{{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|NEXT}} -{{Cl|PRINT}} buttons; "mouse buttons available" '' '' +{{Cl|PRINT}} buttons; "mouse buttons available" {{CodeEnd}} @@ -66,4 +68,4 @@ Buttons: 9 Axis: 6 Wheels: 0 {{PageNavigation}} -< + diff --git a/internal/help/_DEVICEINPUT.txt b/internal/help/_DEVICEINPUT__11111111111.txt similarity index 96% rename from internal/help/_DEVICEINPUT.txt rename to internal/help/_DEVICEINPUT__11111111111.txt index 46a1b3488..2e63203d8 100644 --- a/internal/help/_DEVICEINPUT.txt +++ b/internal/help/_DEVICEINPUT__11111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:48}} {{DISPLAYTITLE:_DEVICEINPUT}} The '''_DEVICEINPUT''' function returns the device number when a controller device button, wheel or axis event occurs. @@ -24,7 +26,7 @@ The '''_DEVICEINPUT''' function returns the device number when a controller devi {{PageExamples}} ''Example 1:'' Checking device controller interfaces and finding out what devices are being used. -{{CodeStart}} '' '' +{{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) @@ -36,7 +38,7 @@ DO {{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}} '' '' +{{Cl|END}} {{CodeEnd}} {{OutputStart}}[KEYBOARD][BUTTON] Buttons: 512 Axis: 0 Wheels: 0 @@ -51,7 +53,7 @@ Device = 2 Device = 2 ''Example 2:'' Why does a mouse have 3 wheels? Relative x and y movements can be read using the first 2 [[_WHEEL]] reads. -{{CodeStart}} '' '' +{{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)" @@ -61,13 +63,13 @@ DO: {{Cl|_LIMIT}} 30 'main loop {{Cl|DO...LOOP|DO}} {{Cl|WHILE}} {{Cl|_DEVICEINPUT}}(2) 'loop only runs during a device 2 mouse event {{Cl|PRINT}} {{Cl|_WHEEL}}(1), {{Cl|_WHEEL}}(2), {{Cl|_WHEEL}}(3) {{Cl|LOOP}} -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) '' '' +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) {{CodeEnd}} : ''Explanation:'' Referencing the [[_MOUSEMOVEMENTX]] function hides the mouse and sets the mouse to a relative movement mode which can be read by [[_WHEEL]]. [[_DEVICEINPUT]](2) returns -1 (true) only when the mouse is moved, scrolled or clicked. ''Example 3:'' Using [[ON...GOSUB]] with the [[_DEVICEINPUT]] number to add keyboard, mouse and game controller event procedures. -{{CodeStart}} '' '' +{{CodeStart}} n = {{Cl|_DEVICES}} 'required when reading devices {{Cl|PRINT}} "Number of devices found ="; n {{Cl|FOR...NEXT|FOR}} i = 1 TO n @@ -90,7 +92,7 @@ mouse: controller: {{Cl|PRINT}} device; "Game control "; -{{Cl|RETURN}} '' '' +{{Cl|RETURN}} {{CodeEnd}} {{small|Code by Ted Weissgerber}} : ''Note:'' [[ON...GOSUB]] and [[ON...GOTO]] events require numerical values to match the order of line labels listed in the event used inside loops. @@ -106,4 +108,4 @@ controller: {{PageNavigation}} -< + diff --git a/internal/help/_DEVICES.txt b/internal/help/_DEVICES__1111111.txt similarity index 95% rename from internal/help/_DEVICES.txt rename to internal/help/_DEVICES__1111111.txt index 9ee87ffb4..8228816c6 100644 --- a/internal/help/_DEVICES.txt +++ b/internal/help/_DEVICES__1111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:49}} {{DISPLAYTITLE:_DEVICES}} The [[_DEVICES]] function returns the number of INPUT devices on your computer including keyboard, mouse and game devices. @@ -14,13 +16,13 @@ The [[_DEVICES]] function returns the number of INPUT devices on your computer i {{PageExamples}} ''Example:'' Checking for the system's input devices. -{{CodeStart}} '' '' +{{CodeStart}} devices = {{Cl|_DEVICES}} 'MUST be read in order for other 2 device functions to work! PRINT "Number of input devices found ="; devices FOR i = 1 TO devices PRINT {{Cl|_DEVICE$}}(i) PRINT "Buttons:"; {{Cl|_LASTBUTTON}}(i) -NEXT '' '' +NEXT {{CodeEnd}} {{OutputStart}}Number of input devices found = 2 [KEYBOARD][BUTTON] @@ -43,4 +45,4 @@ Buttons: 3 {{PageNavigation}} -< + diff --git a/internal/help/_DIR$.txt b/internal/help/_DIR$__111$.txt similarity index 97% rename from internal/help/_DIR$.txt rename to internal/help/_DIR$__111$.txt index 757213de7..37aaaba59 100644 --- a/internal/help/_DIR$.txt +++ b/internal/help/_DIR$__111$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:51}} {{DISPLAYTITLE:_DIR$}} The [[_DIR$]] function returns common paths in '''Windows''' only such as My Documents, My Pictures, My Music, Desktop. @@ -50,4 +52,4 @@ LOCAL APPLICATION DATA=C:\Documents and Settings\Administrator\Local Settings\Ap {{PageNavigation}} -< + diff --git a/internal/help/_DIREXISTS.txt b/internal/help/_DIREXISTS__111111111.txt similarity index 96% rename from internal/help/_DIREXISTS.txt rename to internal/help/_DIREXISTS__111111111.txt index 44f1703d8..ac9168138 100644 --- a/internal/help/_DIREXISTS.txt +++ b/internal/help/_DIREXISTS__111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:52}} {{DISPLAYTITLE:_DIREXISTS}} The [[_DIREXISTS]] function determines if a designated file path or folder exists and returns true (-1) or false (0). @@ -31,4 +33,4 @@ The [[_DIREXISTS]] function determines if a designated file path or folder exist {{PageNavigation}} -< + diff --git a/internal/help/_DISPLAYORDER.txt b/internal/help/_DISPLAYORDER__111111111111.txt similarity index 96% rename from internal/help/_DISPLAYORDER.txt rename to internal/help/_DISPLAYORDER__111111111111.txt index d3795749f..92be52f0b 100644 --- a/internal/help/_DISPLAYORDER.txt +++ b/internal/help/_DISPLAYORDER__111111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:56}} {{DISPLAYTITLE:_DISPLAYORDER}} The [[_DISPLAYORDER]] statement defines the order to render software, hardware and custom-OpenGL-code. @@ -38,4 +40,4 @@ The [[_DISPLAYORDER]] statement defines the order to render software, hardware a {{PageNavigation}} -< + diff --git a/internal/help/_DISPLAY_(function).txt b/internal/help/_DISPLAY_(function)__1111111_(00000000).txt similarity index 94% rename from internal/help/_DISPLAY_(function).txt rename to internal/help/_DISPLAY_(function)__1111111_(00000000).txt index fda296b01..d54075c45 100644 --- a/internal/help/_DISPLAY_(function).txt +++ b/internal/help/_DISPLAY_(function)__1111111_(00000000).txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:55}} {{DISPLAYTITLE:_DISPLAY (function)}} The [[_DISPLAY]] function returns the handle of the current image that is displayed on the screen. {{PageSyntax}} -:{{Parameter|currentImage&}} = [[_DISPLAY]] +:{{Parameter|currentImage&}} = [[_DISPLAY]] {{PageDescription}} @@ -34,7 +36,7 @@ SetupCursor {{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}} '' '' +{{Cl|END SUB}} {{CodeEnd}} ''Note:'' Works with the '''_DISPLAY function''' return as the other page. If mouse reads are not crucial, put the [[_MOUSEINPUT]] loop inside of the UpdateCursor SUB. @@ -48,4 +50,4 @@ SetupCursor {{PageNavigation}} -< + diff --git a/internal/help/_DISPLAY.txt b/internal/help/_DISPLAY__1111111.txt similarity index 84% rename from internal/help/_DISPLAY.txt rename to internal/help/_DISPLAY__1111111.txt index 994e0004c..8b6986f84 100644 --- a/internal/help/_DISPLAY.txt +++ b/internal/help/_DISPLAY__1111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:53}} {{DISPLAYTITLE:_DISPLAY}} The [[_DISPLAY]] statement turns off the automatic display while only displaying the screen changes when called. @@ -17,27 +19,27 @@ The [[_DISPLAY]] statement turns off the automatic display while only displaying {{PageExamples}} ''Example 1:'' Displaying a circle bouncing around the screen. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN (statement)|SCREEN}} 12 x = 21: y =31 'start position 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 -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = CHR$(27) '' '' +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = CHR$(27) {{CodeEnd}} :''Explanation:'' The loop is set with [[_LIMIT]] to 100 frames per second to limit CPU usage and the speed of the ball. Each loop a circle is drawn while the previous one is erased when the coordinates change. _DISPLAY only shows the new circle position once each loop. The '''_DISPLAY''' routine eliminates the need for setting [[SCREEN (statement)|SCREEN]] swap pages, [[CLS]] and [[PCOPY]]. _DISPLAY keeps the image off of the screen until the changes have all completed. Drawing 40 circles every loop helps slow down the ball. ''Example 2:'' [[_DISPLAY]] must be used to render hardware images placed with [[_PUTIMAGE]] ('''version 1.000 and up'''). -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|CONST}} MenuHeight = 200 @@ -48,7 +50,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 @@ -58,7 +60,7 @@ DO init = -1 MS = {{Cl|_NEWIMAGE}}(640, MenuHeight, 32) 'MenuScreen image D = {{Cl|_DEST}}: {{Cl|_DEST}} MS - {{Cl|CLS}} , {{Cl|&H}}FFAAAAAA 'background color gray + {{Cl|CLS}} , {{Cl|&H}}FFAAAAAA 'background color gray {{Cl|_PRINTSTRING}} (20, 2), "Menu Test" 'image text MS_HW = {{Cl|_COPYIMAGE}}(MS, 33) 'create the MenuScreen_HardWare image {{Cl|_FREEIMAGE}} MS @@ -66,7 +68,7 @@ DO {{Cl|END IF}} {{Cl|_PUTIMAGE}} (0, 0)-(640, MenuHeight), MS_HW {{Cl|_DISPLAY}} -{{Cl|END SUB}} '' '' +{{Cl|END SUB}} {{CodeEnd}}{{small|Code adapted by Galleon}} : ''Notes:'' When _DISPLAY is commented out, the hardware Menu Test screen portion will blink and key codes may be seen underneath. @@ -80,4 +82,4 @@ DO {{PageNavigation}} -< + diff --git a/internal/help/_DONTBLEND.txt b/internal/help/_DONTBLEND__111111111.txt similarity index 72% rename from internal/help/_DONTBLEND.txt rename to internal/help/_DONTBLEND__111111111.txt index 930949931..0d42631f2 100644 --- a/internal/help/_DONTBLEND.txt +++ b/internal/help/_DONTBLEND__111111111.txt @@ -1,17 +1,19 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:57}} {{DISPLAYTITLE:_DONTBLEND}} The [[_DONTBLEND]] statement turns off 32 bit alpha blending for the current image or screen mode where [[_BLEND]] is default. {{PageSyntax}} -: [[_DONTBLEND]] [{{Parameter|imageHandle&}}] +: [[_DONTBLEND]] [{{Parameter|imageHandle&}}] {{Parameters}} -* If {{Parameter|imageHandle&}} is omitted, it is assumed to be the current [[_DEST]]ination write page. +* If {{Parameter|imageHandle&}} is omitted, it is assumed to be the current [[_DEST]]ination write page. {{PageDescription}} -* If {{Parameter|imageHandle&}} is not valid, an [[ERROR Codes|Invalid handle]] error will occur. +* If {{Parameter|imageHandle&}} is not valid, an [[ERROR Codes|Invalid handle]] error will occur. * [[_DONTBLEND]] is faster than the default [[_BLEND]]. '''You may want to disable it''', unless you really need to use it in 32 bit. * '''32 bit screen surface backgrounds (black) have zero [[_ALPHA]] so that they are transparent when placed over other surfaces.''' * Use [[CLS]] to make a new surface background [[_ALPHA]] 255 or opaque. @@ -20,30 +22,30 @@ The [[_DONTBLEND]] statement turns off 32 bit alpha blending for the current ima {{PageExamples}} ''Example 1:'' Use _DONTBLEND when you want the 32 bit screen surface to be opaque so that it covers up other backgrounds. [[CLS]] works too. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(1280, 720, 32) '{{Cl|CLS}} -{{Cl|_DONTBLEND}} '<<< comment out to see the difference +{{Cl|_DONTBLEND}} '<<< comment out to see the difference {{Cl|LINE}} (100, 100)-(500, 500), {{Cl|_RGB32}}(255, 255, 0), BF -b& = SaveBackground& +b& = SaveBackground& {{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|SLEEP}} -RestoreBackground b& +RestoreBackground b& {{Cl|END}} -{{Cl|FUNCTION}} SaveBackground& -SaveBackground& = {{Cl|_COPYIMAGE}}(0) +{{Cl|FUNCTION}} SaveBackground& +SaveBackground& = {{Cl|_COPYIMAGE}}(0) {{Cl|END FUNCTION}} {{Cl|SUB}} RestoreBackground (Image {{Cl|AS}} {{Cl|LONG}}) {{Cl|_PUTIMAGE}} , Image, 0 -{{Cl|END SUB}} '' '' +{{Cl|END SUB}} {{CodeEnd}} @@ -51,16 +53,16 @@ SaveBackground& = {{Cl|_COPYIMAGE}}(0) {{CodeStart}} {{Cl|SCREEN (statement)|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, 32) -alphaSprite& = {{Cl|_NEWIMAGE}}(64, 64, 32) +alphaSprite& = {{Cl|_NEWIMAGE}}(64, 64, 32) -{{Cl|_DONTBLEND}} alphaSprite& ' turn off alpha-blending +{{Cl|_DONTBLEND}} alphaSprite& ' turn off alpha-blending 'Create a simple sprite with transparency -{{Cl|_DEST}} alphaSprite& +{{Cl|_DEST}} alphaSprite& {{Cl|FOR}} y = 0 {{Cl|TO}} 63 {{Cl|FOR}} x = 0 {{Cl|TO}} 63 alpha = {{Cl|SQR}}((x - 32) ^ 2 + (y - 32) ^ 2) / 32 - {{Cl|IF}} alpha < 0 {{Cl|THEN}} alpha = 0 + {{Cl|IF}} alpha < 0 {{Cl|THEN}} alpha = 0 alpha = (1 - alpha * alpha) 'parabolic curve {{Cl|PSET}} (x, y), {{Cl|_RGBA32}}(255, 255, 255, alpha * 255) {{Cl|NEXT}} @@ -75,20 +77,20 @@ alphaSprite& = {{Cl|_NEWIMAGE}}(64, 64, 32) {{Cl|NEXT}} 'Store background so we can show moveable objects on it -background& = {{Cl|_COPYIMAGE}} +background& = {{Cl|_COPYIMAGE}} 'Treat my alpha values as transparency -{{Cl|_BLEND}} alphaSprite& +{{Cl|_BLEND}} alphaSprite& ph = 0 {{Cl|DO}}: {{Cl|_LIMIT}} 60 - x = 320 - 250 * {{Cl|COS}}(ph) - ({{Cl|_WIDTH (function)|_WIDTH}}(alphaSprite&) \ 2) - y = 240 - 150 * {{Cl|COS}}(ph * 1.3) - ({{Cl|_HEIGHT}}(alphaSprite&) \ 2) + x = 320 - 250 * {{Cl|COS}}(ph) - ({{Cl|_WIDTH (function)|_WIDTH}}(alphaSprite&) \ 2) + y = 240 - 150 * {{Cl|COS}}(ph * 1.3) - ({{Cl|_HEIGHT}}(alphaSprite&) \ 2) ph = ph + 0.03 - {{Cl|_PUTIMAGE}} , background&, 0 - {{Cl|_PUTIMAGE}} (x, y), alphaSprite&, 0 + {{Cl|_PUTIMAGE}} , background&, 0 + {{Cl|_PUTIMAGE}} (x, y), alphaSprite&, 0 {{Cl|_DISPLAY}} -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|LEN}}({{Cl|INKEY$}}) '' '' +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|LEN}}({{Cl|INKEY$}}) {{CodeEnd}}{{small|Code by Zom-B}} ''Explanation:'' To make the alpha image, turn alpha blending off. Otherwise PSET blends the pixel to instead of making the sprite transparent. @@ -100,4 +102,4 @@ ph = 0 {{PageNavigation}} -< + diff --git a/internal/help/_DONTWAIT.txt b/internal/help/_DONTWAIT__11111111.txt similarity index 92% rename from internal/help/_DONTWAIT.txt rename to internal/help/_DONTWAIT__11111111.txt index 0829f2b77..bad1a4ab7 100644 --- a/internal/help/_DONTWAIT.txt +++ b/internal/help/_DONTWAIT__11111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:07:58}} {{DISPLAYTITLE:_DONTWAIT}} [[_DONTWAIT]] is used with the [[SHELL]] statement in '''QB64''' to specify that the program shouldn't wait until the external command/program is finished (which it otherwise does by default). @@ -10,7 +12,7 @@ *Runs the command/program specified in {{Parameter|commandline$}} and lets the calling program continue at the same time in its current screen format. *Especially useful when CMD /C or START is used in a SHELL command line to run another program. * '''QB64''' automatically uses CMD /C or COMMAND /C when using SHELL. -* '''QB64''' program screens will not get distorted or minimized like Qbasic fullscreen modes would. +* '''QB64''' program screens will not get distorted or minimized like QBasic fullscreen modes would. {{PageExamples}} @@ -39,4 +41,4 @@ {{PageNavigation}} -< + diff --git a/internal/help/_DROPPEDFILE.txt b/internal/help/_DROPPEDFILE__11111111111.txt similarity index 90% rename from internal/help/_DROPPEDFILE.txt rename to internal/help/_DROPPEDFILE__11111111111.txt index c56dfd371..b46accc74 100644 --- a/internal/help/_DROPPEDFILE.txt +++ b/internal/help/_DROPPEDFILE__11111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:00}} {{DISPLAYTITLE:_DROPPEDFILE}} The [[_DROPPEDFILE]] function returns the list of items (files or folders) dropped in a program's window after [[_ACCEPTFILEDROP]] is enabled. @@ -7,11 +9,11 @@ The [[_DROPPEDFILE]] function returns the list of items (files or folders) dropp : {{Parameter|nextItem$}} = [[_DROPPEDFILE]] ''Syntax 2'' -: {{Parameter|nextItem$}} = [[_DROPPEDFILE]]({{Parameter|index&}}) +: {{Parameter|nextItem$}} = [[_DROPPEDFILE]]({{Parameter|index&}}) {{PageDescription}} * After [[_ACCEPTFILEDROP]] is enabled, once [[_TOTALDROPPEDFILES]] is greater than 0 the list of dropped items will be available for retrieval with [[_DROPPEDFILE]] -* When using [[_DROPPEDFILE]] to read the list sequentially (without specifying an ''index&''), an empty string ("") indicates the list is over and then [[_TOTALDROPPEDFILES]] gets reset to 0. +* When using [[_DROPPEDFILE]] to read the list sequentially (without specifying an ''index&''), an empty string ("") indicates the list is over and then [[_TOTALDROPPEDFILES]] gets reset to 0. * When using [[_DROPPEDFILE]] with an index (which goes from 1 to [[_TOTALDROPPEDFILES]]), you must call [[_FINISHDROP]] after you finish working with the list. * Because it returns a string, [[_DROPPEDFILE]] also accepts being followed by a string suffix ([[_DROPPEDFILE]]'''$''') * '''[[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Keyword Not Supported in Linux or MAC versions]]'''. @@ -61,4 +63,4 @@ The [[_DROPPEDFILE]] function returns the list of items (files or folders) dropp {{PageNavigation}} -< + diff --git a/internal/help/_ECHO.txt b/internal/help/_ECHO__1111.txt similarity index 82% rename from internal/help/_ECHO.txt rename to internal/help/_ECHO__1111.txt index d3db30189..1c9ff861f 100644 --- a/internal/help/_ECHO.txt +++ b/internal/help/_ECHO__1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:01}} {{DISPLAYTITLE:_ECHO}} The [[_ECHO]] statement allows outputting text to a [[$CONSOLE]] window without having to alternate between [[_DEST]] pages. @@ -11,8 +13,9 @@ The [[_ECHO]] statement allows outputting text to a [[$CONSOLE]] window without * To output numbers, use the [[STR$]] function. -==Availability== -* '''Version 1.3 and up'''. +{{PageAvailability}} +* '''QB64 1.3 and up''' (QB64 Team) +* '''QBPE 0.5 and up''' (QB64 Phoenix Edition) {{PageExamples}} @@ -30,4 +33,4 @@ The [[_ECHO]] statement allows outputting text to a [[$CONSOLE]] window without {{PageNavigation}} -< + diff --git a/internal/help/_ENVIRONCOUNT.txt b/internal/help/_ENVIRONCOUNT.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_ENVIRONCOUNT.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_ERRORLINE.txt b/internal/help/_ERRORLINE__111111111.txt similarity index 91% rename from internal/help/_ERRORLINE.txt rename to internal/help/_ERRORLINE__111111111.txt index 2fc7c91d5..f20967c84 100644 --- a/internal/help/_ERRORLINE.txt +++ b/internal/help/_ERRORLINE__111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:07}} {{DISPLAYTITLE:_ERRORLINE}} The [[_ERRORLINE]] function returns the source code line number that caused the most recent runtime error. @@ -14,7 +16,7 @@ The [[_ERRORLINE]] function returns the source code line number that caused the {{PageExamples}} ''Example:'' Displaying the current program line using a simulated [[ERROR]] code. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|ON ERROR}} {{Cl|GOTO}} DebugLine 'can't use {{Cl|GOSUB}} {{Cl|ERROR}} 250 'simulated error code @@ -22,7 +24,7 @@ The [[_ERRORLINE]] function returns the source code line number that caused the {{Cl|END}} DebugLine: {{Cl|PRINT}} {{Cl|_ERRORLINE}} -{{Cl|RESUME}} {{Cl|NEXT}} '' '' +{{Cl|RESUME}} {{Cl|NEXT}} {{CodeEnd}} @@ -35,4 +37,4 @@ DebugLine: {{PageNavigation}} -< + diff --git a/internal/help/_ERRORMESSAGE$.txt b/internal/help/_ERRORMESSAGE$.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_ERRORMESSAGE$.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_ERRORMESSAGE$__111111111111$.txt b/internal/help/_ERRORMESSAGE$__111111111111$.txt new file mode 100644 index 000000000..85b3f4272 --- /dev/null +++ b/internal/help/_ERRORMESSAGE$__111111111111$.txt @@ -0,0 +1,45 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:08}} +{{DISPLAYTITLE:_ERRORMESSAGE$}} +The [[_ERRORMESSAGE$]] function returns a human-readable description of the most recent runtime error, or the description of an arbitrary error code passed to it. + + +{{PageSyntax}} +:{{Parameter|e$}} = [[_ERRORMESSAGE$]] +:{{Parameter|e$}} = [[_ERRORMESSAGE$]]({{Parameter|errorCode%}}) + + +{{PageDescription}} +* Used in program error troubleshooting. +* The message returned is identical to the message shown in the dialog box that appears if your program has no error handler. See [[ERROR Codes]] for the full list of error codes and their messages. + +{{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" + {{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 "Description: "; {{Cl|_ERRORMESSAGE$}}; "." + {{Cl|BEEP}} ' warning beep + {{Cl|RESUME}} NEXT ' moves program to code following the error. +{{CodeEnd}} + + +{{PageSeeAlso}} +* [[ON ERROR]] +* [[_ERRORLINE]] +* [[_INCLERRORLINE]], [[_INCLERRORFILE$]] +* [[ERR]], [[ERL]] +* [[ERROR]] +* [[ERROR Codes]] + + +{{PageNavigation}} + diff --git a/internal/help/_EXIT_(function).txt b/internal/help/_EXIT_(function)__1111_(00000000).txt similarity index 90% rename from internal/help/_EXIT_(function).txt rename to internal/help/_EXIT_(function)__1111_(00000000).txt index aff42db18..b8b80f495 100644 --- a/internal/help/_EXIT_(function).txt +++ b/internal/help/_EXIT_(function)__1111_(00000000).txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:11}} {{DISPLAYTITLE:_EXIT (function)}} The [[_EXIT]] function prevents the user from closing a program and indicates if a user has clicked the close button in the window title ('''X''' button) or used CTRL + BREAK. @@ -21,7 +23,7 @@ The [[_EXIT]] function prevents the user from closing a program and indicates if {{PageExamples}} ''Example 1:'' Using an ON TIMER check to read the _EXIT request return values. -{{CodeStart}} '' '' +{{CodeStart}} 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 @@ -31,7 +33,7 @@ q = {{Cl|_EXIT (function)|_EXIT}} 'function read prevents any program exit at st {{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: @@ -42,20 +44,19 @@ q = {{Cl|_EXIT (function)|_EXIT}} {{Cl|CASE}} 2: {{Cl|PRINT}} "= Ctrl + Break keypress" {{Cl|CASE}} 3: {{Cl|PRINT}} "= Both X and Ctrl + Break!" {{Cl|END SELECT}} -{{Cl|RETURN}} '' '' - +{{Cl|RETURN}} {{CodeEnd}} ''Example 2:'' Removing temporary files before closing a program upon a user's exit request. -{{CodeStart}} '' '' +{{CodeStart}} x = {{Cl|_EXIT}} 'initial function call blocks a user exit OPEN "t3mpdata.tmp" FOR APPEND AS #1 DO -IF {{Cl|_EXIT}} THEN {{Cl|CLOSE}}: {{Cl|KILL}} "t3mpdata.tmp": {{Cl|_DELAY}} 1: {{Cl|SYSTEM}} '' '' -LOOP '' '' +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> +
{{text|Note: If you have a file named ''t3mpdata.tmp'' change the file name!|red}}
{{PageSeeAlso}} @@ -65,4 +66,4 @@ LOOP '' '' {{PageNavigation}} -< + diff --git a/internal/help/_FILEEXISTS.txt b/internal/help/_FILEEXISTS__1111111111.txt similarity index 95% rename from internal/help/_FILEEXISTS.txt rename to internal/help/_FILEEXISTS__1111111111.txt index 00c441d3b..4e0d484fa 100644 --- a/internal/help/_FILEEXISTS.txt +++ b/internal/help/_FILEEXISTS__1111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:12}} {{DISPLAYTITLE:_FILEEXISTS}} The '''_FILEEXISTS''' function determines if a designated file name exists and returns true (-1) or false (0). @@ -30,4 +32,4 @@ The '''_FILEEXISTS''' function determines if a designated file name exists and r {{PageNavigation}} -< + diff --git a/internal/help/_FINISHDROP.txt b/internal/help/_FINISHDROP__1111111111.txt similarity index 97% rename from internal/help/_FINISHDROP.txt rename to internal/help/_FINISHDROP__1111111111.txt index c70bd13c4..35f96092d 100644 --- a/internal/help/_FINISHDROP.txt +++ b/internal/help/_FINISHDROP__1111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:14}} {{DISPLAYTITLE:_FINISHDROP}} The [[_FINISHDROP]] statement resets [[_TOTALDROPPEDFILES]] and clears the [[_DROPPEDFILE]] list of items (files/folders). @@ -54,4 +56,4 @@ The [[_FINISHDROP]] statement resets [[_TOTALDROPPEDFILES]] and clears the [[_DR {{PageNavigation}} -< + diff --git a/internal/help/_FLOAT.txt b/internal/help/_FLOAT__11111.txt similarity index 96% rename from internal/help/_FLOAT.txt rename to internal/help/_FLOAT__11111.txt index 26a8bf168..b1445151e 100644 --- a/internal/help/_FLOAT.txt +++ b/internal/help/_FLOAT__11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:15}} {{DISPLAYTITLE:_FLOAT}} '''_FLOAT''' numerical values offer the maximum floating-point decimal precision available using '''QB64'''. @@ -28,4 +30,4 @@ {{PageNavigation}} -< + diff --git a/internal/help/_FONTHEIGHT.txt b/internal/help/_FONTHEIGHT__1111111111.txt similarity index 64% rename from internal/help/_FONTHEIGHT.txt rename to internal/help/_FONTHEIGHT__1111111111.txt index eaaff90bb..d49ce2e1f 100644 --- a/internal/help/_FONTHEIGHT.txt +++ b/internal/help/_FONTHEIGHT__1111111111.txt @@ -1,10 +1,12 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:19}} {{DISPLAYTITLE:_FONTHEIGHT}} The [[_FONTHEIGHT]] function returns the font height of a font handle created by [[_LOADFONT]]. {{PageSyntax}} -:{{Parameter|pixelHeight%}} = [[_FONTHEIGHT]][({{Parameter|fontHandle&}})] +:{{Parameter|pixelHeight%}} = [[_FONTHEIGHT]][({{Parameter|fontHandle&}})] {{PageDescription}} @@ -14,7 +16,7 @@ The [[_FONTHEIGHT]] function returns the font height of a font handle created by {{PageExamples}} ''Example:'' Finding the [[_FONT|font]] or text block size of printed [[STRING|string]] characters in graphic [[SCREEN]] modes. -{{CodeStart}} '' '' +{{CodeStart}} DO {{Cl|INPUT}} "Enter Screen mode 1, 2 or 7 to 13 or 256, 32 for {{Cl|_NEWIMAGE}}: ", scr$ mode% = {{Cl|VAL}}(scr$) @@ -27,23 +29,23 @@ DO {{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|_FONT}} fnt& +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|_FONT}} fnt& {{Cl|END IF}} -TextSize wide&, high& 'get the font or current screen mode's text block pixel size +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 -TextHeight& = {{Cl|_FONTHEIGHT}} 'can measure normal text block heights also -{{Cl|END SUB}} '' '' +{{Cl|SUB}} TextSize (TextWidth&, TextHeight&) +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}} @@ -55,4 +57,4 @@ TextHeight& = {{Cl|_FONTHEIGHT}} 'can measure normal text block heights also {{PageNavigation}} -< + diff --git a/internal/help/_FONTWIDTH.txt b/internal/help/_FONTWIDTH__111111111.txt similarity index 94% rename from internal/help/_FONTWIDTH.txt rename to internal/help/_FONTWIDTH__111111111.txt index 962eeb583..788baf8e0 100644 --- a/internal/help/_FONTWIDTH.txt +++ b/internal/help/_FONTWIDTH__111111111.txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:20}} {{DISPLAYTITLE:_FONTWIDTH}} The [[_FONTWIDTH]] function returns the font width of a MONOSPACE font handle created by [[_LOADFONT]]. {{PageSyntax}} -:{{Parameter|pixelWidth%}} = [[_FONTWIDTH]][({{Parameter|fontHandle&}})] +:{{Parameter|pixelWidth%}} = [[_FONTWIDTH]][({{Parameter|fontHandle&}})] * Returns the character width of the last font used if a handle is not specified. @@ -21,4 +23,4 @@ The [[_FONTWIDTH]] function returns the font width of a MONOSPACE font handle cr {{PageNavigation}} -< + diff --git a/internal/help/_FONT_(function).txt b/internal/help/_FONT_(function)__1111_(00000000).txt similarity index 50% rename from internal/help/_FONT_(function).txt rename to internal/help/_FONT_(function)__1111_(00000000).txt index d7e4136e0..f978687b6 100644 --- a/internal/help/_FONT_(function).txt +++ b/internal/help/_FONT_(function)__1111_(00000000).txt @@ -1,13 +1,15 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:18}} {{DISPLAYTITLE:_FONT (function)}} The [[_FONT]] function retrieves the font handle from the specified image handle or the current [[_DEST]]ination page's font. {{PageSyntax}} -:{{Parameter|fontHandle&}} = [[_FONT]][({{Parameter|imageHandle&}})] +:{{Parameter|fontHandle&}} = [[_FONT]][({{Parameter|imageHandle&}})] {{PageDescription}} -*imageHandle& is the handle to the image which you want to retrieve the font from. If not specified, it is assumed to be the current [[_DEST]]ination page. +*imageHandle& is the handle to the image which you want to retrieve the font from. If not specified, it is assumed to be the current [[_DEST]]ination page. {{PageSeeAlso}} @@ -16,4 +18,4 @@ The [[_FONT]] function retrieves the font handle from the specified image handle {{PageNavigation}} -< + diff --git a/internal/help/_FONT.txt b/internal/help/_FONT__1111.txt similarity index 86% rename from internal/help/_FONT.txt rename to internal/help/_FONT__1111.txt index b4a745940..8c8821687 100644 --- a/internal/help/_FONT.txt +++ b/internal/help/_FONT__1111.txt @@ -1,13 +1,15 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:16}} {{DISPLAYTITLE:_FONT}} The [[_FONT]] statement sets the current [[_LOADFONT]] function font handle to be used by [[PRINT]]. {{PageSyntax}} -: [[_FONT]] {{Parameter|fontHandle&}}[, {{Parameter|imageHandle&}}] +: [[_FONT]] {{Parameter|fontHandle&}}[, {{Parameter|imageHandle&}}] {{Parameters}} -* {{Parameter|fontHandle&}} is the handle retrieved from [[_LOADFONT]] function, the [[_FONT (function)|_FONT]] function, or a predefined handle. +* {{Parameter|fontHandle&}} is the handle retrieved from [[_LOADFONT]] function, the [[_FONT (function)|_FONT]] function, or a predefined handle. * If the image handle is omitted the current image [[_DEST]]ination is used. Zero can designate the current program [[SCREEN]]. @@ -34,7 +36,7 @@ fontpath$ = {{Cl|ENVIRON$}}("SYSTEMROOT") + "\fonts\lucon.ttf" 'Find Windows Fol 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|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% @@ -47,8 +49,8 @@ fontpath$ = {{Cl|ENVIRON$}}("SYSTEMROOT") + "\fonts\lucon.ttf" 'Find Windows Fol {{Cl|IF}} bold% = 1 then style$ = style$ + ", BOLD" {{Cl|GOSUB}} ClearFont - font& = {{Cl|_LOADFONT}}(fontpath$, fontsize%, style$) - {{Cl|_FONT|_FONT }}font& + 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" @@ -59,9 +61,9 @@ fontpath$ = {{Cl|ENVIRON$}}("SYSTEMROOT") + "\fonts\lucon.ttf" 'Find Windows Fol {{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|_FREEFONT}} font& {{Cl|END IF}} {{Cl|RETURN}} @@ -79,4 +81,4 @@ ClearFont: {{PageNavigation}} -< + diff --git a/internal/help/_FREEFONT.txt b/internal/help/_FREEFONT__11111111.txt similarity index 81% rename from internal/help/_FREEFONT.txt rename to internal/help/_FREEFONT__11111111.txt index d8dd21548..805133dd3 100644 --- a/internal/help/_FREEFONT.txt +++ b/internal/help/_FREEFONT__11111111.txt @@ -1,10 +1,12 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:22}} {{DISPLAYTITLE:_FREEFONT}} The [[_FREEFONT]] statement frees a font handle that was created by [[_LOADFONT]]. {{PageSyntax}} -:[[_FREEFONT]] ({{Parameter|fontHandle&}}) +:[[_FREEFONT]] ({{Parameter|fontHandle&}}) {{PageDescription}} @@ -21,7 +23,7 @@ The [[_FREEFONT]] statement frees a font handle that was created by [[_LOADFONT] {{PageExamples}} ''Example 1:'' Previews and creates a file list of valid MONOSPACE TTF fonts by checking the [[_LOADFONT]] handle values. -{{CodeStart}} '' '' +{{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" @@ -31,17 +33,17 @@ style$ = "monospace" 'set style to MONOSPACE {{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 + f& ={{Cl|_LOADFONT}}(path$ + font$, 30, style$) + {{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|_FONT}} f& 'will create error if handle is invalid! {{Cl|PRINT}} "Hello World!" - {{Cl|PRINT}}: {{Cl|PRINT}}: {{Cl|PRINT}} font$; f& + {{Cl|PRINT}}: {{Cl|PRINT}}: {{Cl|PRINT}} font$; f& {{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! + {{Cl|_FREEFONT}} f& 'returns an error if handle <= 0! {{Cl|CLS}} {{Cl|END IF}} {{Cl|PRINT}} @@ -49,7 +51,7 @@ style$ = "monospace" 'set style to MONOSPACE {{Cl|LOOP}} {{Cl|CLOSE}} {{Cl|PRINT}}: {{Cl|PRINT}}: {{Cl|PRINT}} "Found"; found; "TTF files,"; OK; "can use Monospace," -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} {{small|Code by Ted Weissgerber}} {{OutputStart}} @@ -66,28 +68,28 @@ 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|DO}}: {{Cl|SLEEP}}: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" -{{Cl|GOSUB}} ClearFont 'call will not free anything if font& = 0 +{{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! +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|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|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|_FREEFONT}} font& {{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}} '' '' +{{Cl|RETURN}} {{CodeEnd}} @@ -97,4 +99,4 @@ ClearFont: {{PageNavigation}} -< + diff --git a/internal/help/_FREEIMAGE.txt b/internal/help/_FREEIMAGE__111111111.txt similarity index 78% rename from internal/help/_FREEIMAGE.txt rename to internal/help/_FREEIMAGE__111111111.txt index eb1f97ca9..fb830f687 100644 --- a/internal/help/_FREEIMAGE.txt +++ b/internal/help/_FREEIMAGE__111111111.txt @@ -1,13 +1,15 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:23}} {{DISPLAYTITLE:_FREEIMAGE}} The '''_FREEIMAGE''' statement releases the designated file image created by the [[_LOADIMAGE]], [[_NEWIMAGE]] or [[_COPYIMAGE]] functions from memory when they are no longer needed. {{PageSyntax}} -: [[_FREEIMAGE]] [{{Parameter|handle&}}] +: [[_FREEIMAGE]] [{{Parameter|handle&}}] {{PageDescription}} -*If {{Parameter|handle&}} is omitted, the current destination image is freed from memory. +*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. @@ -19,13 +21,13 @@ 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 -{{Cl|IF}} s& < -1 THEN {{Cl|SCREEN (statement)|SCREEN}} s& 'use image as a 32 bit SCREEN +{{CodeStart}} +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! -{{Cl|IF}} s& < -1 THEN {{Cl|_FREEIMAGE}} s& 'handle value MUST be less than -1 or error! -{{Cl|CLS}} '' '' +{{Cl|IF}} s& < -1 THEN {{Cl|_FREEIMAGE}} s& 'handle value MUST be less than -1 or error! +{{Cl|CLS}} {{CodeEnd}} : ''Note:'' A valid image file name must be used by [[_LOADIMAGE]] or the invalid handle memory value will not need to be freed. @@ -38,4 +40,4 @@ s& = {{Cl|_LOADIMAGE}}("SPLASH.BMP",32) 'load 32 bit(24 BPP) image {{PageNavigation}} -< + diff --git a/internal/help/_FREETIMER.txt b/internal/help/_FREETIMER__111111111.txt similarity index 92% rename from internal/help/_FREETIMER.txt rename to internal/help/_FREETIMER__111111111.txt index 48b61cb3e..2ec888be2 100644 --- a/internal/help/_FREETIMER.txt +++ b/internal/help/_FREETIMER__111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:24}} {{DISPLAYTITLE:_FREETIMER}} The [[_FREETIMER]] function returns a free [[TIMER]] number for multiple [[ON TIMER(n)]] events. @@ -17,4 +19,4 @@ The [[_FREETIMER]] function returns a free [[TIMER]] number for multiple [[ON TI {{PageNavigation}} -< + diff --git a/internal/help/_FULLSCREEN_(function).txt b/internal/help/_FULLSCREEN_(function)__1111111111_(00000000).txt similarity index 80% rename from internal/help/_FULLSCREEN_(function).txt rename to internal/help/_FULLSCREEN_(function)__1111111111_(00000000).txt index 9fd48b130..a4c5f15a9 100644 --- a/internal/help/_FULLSCREEN_(function).txt +++ b/internal/help/_FULLSCREEN_(function)__1111111111_(00000000).txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:27}} {{DISPLAYTITLE:_FULLSCREEN (function)}} The [[_FULLSCREEN]] function returns the present full screen mode setting of the screen window. @@ -13,16 +15,15 @@ The [[_FULLSCREEN]] function returns the present full screen mode setting of the ** 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> +
'''Using large fonts with [[_FULLSCREEN]] can cause monitor or Windows Desktop problems or kill a program.'''
{{PageExamples}} ''Example:'' Shows how fonts and the _FULLSCREEN mode can resize a program window. {{CodeStart}} -'' '' {{Cl|CLS}} fontpath$ = {{Cl|ENVIRON$}}("SYSTEMROOT") + "\fonts\lucon.ttf" 'Find Windows Folder Path. -f& = {{Cl|_FONT (function)|_FONT}}: defaultf& = f& +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$ @@ -33,14 +34,14 @@ f& = {{Cl|_FONT (function)|_FONT}}: defaultf& = f& {{Cl|SELECT CASE}} winmode$ {{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|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|LOOP}} {{Cl|UNTIL}} fontsize% > 4 {{Cl|AND (boolean)|AND}} fontsize% < 26 {{Cl|DO}} {{Cl|PRINT}} @@ -55,7 +56,7 @@ f& = {{Cl|_FONT (function)|_FONT}}: defaultf& = f& {{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" @@ -76,24 +77,23 @@ f& = {{Cl|_FONT (function)|_FONT}}: defaultf& = f& {{Cl|GOSUB}} ChangeFont {{Cl|END}} -CheckFull: '<<<<<<<<<<<<<< turn off full screen if function returns 0! +CheckFull: '<<<<<<<<<<<<<< turn off full screen if function returns 0! full = {{Cl|_FULLSCREEN (function)|_FULLSCREEN}} 'get current full screen mode {{Cl|IF}} full = 0 {{Cl|THEN}} {{Cl|_FULLSCREEN}} _{{Cl|OFF}}: {{Cl|SOUND}} 100, .75 {{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}} + currentf& = {{Cl|_FONT (function)|_FONT}} {{Cl|ELSE}} - currentf& = {{Cl|_LOADFONT}}(fontpath$, fontsize%, style$) - {{Cl|_FONT}} currentf& + currentf& = {{Cl|_LOADFONT}}(fontpath$, fontsize%, style$) + {{Cl|_FONT}} currentf& {{Cl|END IF}} -{{Cl|IF}} currentf& <> f& {{Cl|AND (boolean)|AND}} f& <> defaultf& {{Cl|THEN}} {{Cl|_FREEFONT}} f& -f& = currentf& -{{Cl|RETURN}} '' '' - +{{Cl|IF}} currentf& <> f& {{Cl|AND (boolean)|AND}} f& <> defaultf& {{Cl|THEN}} {{Cl|_FREEFONT}} f& +f& = currentf& +{{Cl|RETURN}} {{CodeEnd}} ''Explanation:'' The '''_FULLSCREEN''' function can avoid screen display and monitor problems when used to monitor the success of the full screen operation. If a full screen mode is '''not''' achieved (the function will return 0), '''call [[_FULLSCREEN]] OFF''' @@ -106,4 +106,4 @@ f& = currentf& {{PageNavigation}} -< + diff --git a/internal/help/_FULLSCREEN.txt b/internal/help/_FULLSCREEN__1111111111.txt similarity index 94% rename from internal/help/_FULLSCREEN.txt rename to internal/help/_FULLSCREEN__1111111111.txt index c666fa19c..97f1f7d0d 100644 --- a/internal/help/_FULLSCREEN.txt +++ b/internal/help/_FULLSCREEN__1111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:25}} {{DISPLAYTITLE:_FULLSCREEN}} The [[_FULLSCREEN]] statement attempts to make the program window fullscreen. @@ -35,7 +37,6 @@ The [[_FULLSCREEN]] statement attempts to make the program window fullscreen. ''Example 2:'' How fonts and _FULLSCREEN affect the program's window size. {{CodeStart}} -'' '' {{Cl|SCREEN (statement)|SCREEN}} 0 {{Cl|DO}} {{Cl|PRINT}} @@ -53,8 +54,8 @@ The [[_FULLSCREEN]] statement attempts to make the program window fullscreen. {{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|_FONT}} f& + f& = {{Cl|_LOADFONT}}("c:\windows\fonts\lucon.ttf", 13 + ENLARGE%, STYLE$) + {{Cl|_FONT}} f& {{Cl|CASE}} "2" {{Cl|_FULLSCREEN}} _SQUAREPIXELS full = {{Cl|_FULLSCREEN (function)|_FULLSCREEN}} @@ -81,7 +82,7 @@ ClearFont 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 {{Cl|THEN}} Z3 = Z3 - {{Cl|TIMER}} {{Cl|IF}} {{Cl|TIMER (statement)|TIMER }}- Z3 > 4 {{Cl|THEN}} {{Cl|EXIT DO}} {{Cl|LOOP}} full = {{Cl|_FULLSCREEN (function)|_FULLSCREEN}} @@ -89,9 +90,9 @@ full = {{Cl|_FULLSCREEN (function)|_FULLSCREEN}} {{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|_FREEFONT}} f& {{Cl|END IF}} {{Cl|RETURN}} @@ -134,4 +135,4 @@ ClearFont: {{PageNavigation}} -< + diff --git a/internal/help/_G2D.txt b/internal/help/_G2D__121.txt similarity index 78% rename from internal/help/_G2D.txt rename to internal/help/_G2D__121.txt index 3898e511e..ac90047fe 100644 --- a/internal/help/_G2D.txt +++ b/internal/help/_G2D__121.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:28}} {{DISPLAYTITLE:_G2D}} The [[_G2D]] function converts a '''gradient''' value into a '''degree''' value. @@ -6,8 +8,9 @@ The [[_G2D]] function converts a '''gradient''' value into a '''degree''' value. : {{Parameter|result}} = [[_G2D]]({{Parameter|num}}) -==Availability== -* '''Version 1.000 and up.''' +{{PageAvailability}} +* '''QB64 1.0 and up''' (QB64 Team) +* '''QBPE 0.5 and up''' (QB64 Phoenix Edition) {{PageExamples}} @@ -30,4 +33,4 @@ That angle in Degrees is 54 {{PageNavigation}} -< + diff --git a/internal/help/_G2R.txt b/internal/help/_G2R__121.txt similarity index 78% rename from internal/help/_G2R.txt rename to internal/help/_G2R__121.txt index 86495d62d..8b767d562 100644 --- a/internal/help/_G2R.txt +++ b/internal/help/_G2R__121.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:29}} {{DISPLAYTITLE:_G2R}} The [[_G2R]] function converts a '''gradient''' value into a '''radian''' value. @@ -6,8 +8,9 @@ The [[_G2R]] function converts a '''gradient''' value into a '''radian''' value. : {{Parameter|result}} = [[_G2R]]({{Parameter|num}}) -==Availability== -* '''Version 1.000 and up.''' +{{PageAvailability}} +* '''QB64 1.0 and up''' (QB64 Team) +* '''QBPE 0.5 and up''' (QB64 Phoenix Edition) {{PageExamples}} @@ -30,4 +33,4 @@ That angle in Radians is .9424778 {{PageNavigation}} -< + diff --git a/internal/help/_GL.txt b/internal/help/_GL.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_GL.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_GLRENDER.txt b/internal/help/_GLRENDER.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_GLRENDER.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_GLRENDER__11111111.txt b/internal/help/_GLRENDER__11111111.txt new file mode 100644 index 000000000..b847d0277 --- /dev/null +++ b/internal/help/_GLRENDER__11111111.txt @@ -0,0 +1,22 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:31}} +{{DISPLAYTITLE:_GLRENDER}} + +{{PageSyntax}} +:'''_GLRENDER '''''mode'' + + +{{PageParameters}} + +Mode can be: +* _BEHIND - renders OpenGL context behind the software rendering +* _ONTOP - renders OpenGL context on the top of the software rendering [default] +* _ONLY - renders OpenGL context only + + +''See also:'' +* [[Hardware images]] + + +{{PageNavigation}} + diff --git a/internal/help/_GREEN.txt b/internal/help/_GREEN.txt deleted file mode 100644 index 535866123..000000000 --- a/internal/help/_GREEN.txt +++ /dev/null @@ -1,32 +0,0 @@ -{{DISPLAYTITLE:_GREEN}} -The [[_GREEN]] function returns the palette index or the green component intensity of a 32-bit image color. - - -{{PageSyntax}} -: {{Parameter|greenIntensity&}} = [[_GREEN]]({{Parameter|rgbaColorIndex&}}[, {{Parameter|imageHandle&}}]) - - -{{PageDescription}} -* {{Parameter|rgbaColorIndex&}} is the ''RGBA'' color value or palette index of the color to retrieve the green component intensity from. -* The [[LONG]] intensity value returned ranges from 0 (no intensity, not present) to 255 (full intensity). -* If {{Parameter|imageHandle&}} specifies a 32-bit color image, {{Parameter|rgbaColorIndex&}} is interpreted as a 32-bit ''RGBA'' color value. -* If {{Parameter|imageHandle&}} specifies an image that uses a palette, {{Parameter|rgbaColorIndex&}} is interpreted as a palette index. -* If {{Parameter|imageHandle&}} is not specified, it is assumed to be the current write page (See [[_DEST]]). -* If {{Parameter|imageHandle&}} is an invalid handle, an [[ERROR Codes|invalid handle]] error will occur. -* If {{Parameter|rgbaColorIndex&}} is outside the range of valid indexes for a given image mode, an [[ERROR Codes|illegal function call]] error occurs. -* Uses index parameters passed by the [[_RGB]], [[_RGBA]], [[_RGB32]] or [[_RGBA32]] functions. -* An image handle is optional. - - -{{PageExamples}} -* See example in [[POINT]]. - - -{{PageSeeAlso}} -* [[_RED]], [[_BLUE]] -* [[_RGB]], [[RGB32]] -* [[_LOADIMAGE]] - - -{{PageNavigation}} -< diff --git a/internal/help/_GREEN32.txt b/internal/help/_GREEN32__1111132.txt similarity index 71% rename from internal/help/_GREEN32.txt rename to internal/help/_GREEN32__1111132.txt index 30a7a14c5..8f657c7da 100644 --- a/internal/help/_GREEN32.txt +++ b/internal/help/_GREEN32__1111132.txt @@ -1,13 +1,15 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:33}} {{DISPLAYTITLE:_GREEN32}} The [[_GREEN32]] function returns the green component intensity of a 32-bit image or surface color. {{PageSyntax}} -: green32color& = [[_GREEN32]]({{Parameter|rgbaColor&}}) +: green32color& = [[_GREEN32]]({{Parameter|rgbaColor&}}) {{PageDescription}} -* {{Parameter|rgbaColor&}} is the 32-bit ''RGBA'' color value to retrieve the green component intensity value from. +* {{Parameter|rgbaColor&}} is the 32-bit ''RGBA'' color value to retrieve the green component intensity value from. * ''RGBA'' color values are returned by the [[_PALETTECOLOR (function)|_PALETTECOLOR]], [[POINT]], [[_RGB]], [[_RGB32]], [[_RGBA]] or [[_RGBA32]] functions. * [[LONG]] intensity values returned range from 0 (no intensity, not present) to 255 (full intensity). @@ -22,4 +24,4 @@ The [[_GREEN32]] function returns the green component intensity of a 32-bit imag {{PageNavigation}} -< + diff --git a/internal/help/_GREEN__11111.txt b/internal/help/_GREEN__11111.txt new file mode 100644 index 000000000..746161aae --- /dev/null +++ b/internal/help/_GREEN__11111.txt @@ -0,0 +1,34 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:32}} +{{DISPLAYTITLE:_GREEN}} +The [[_GREEN]] function returns the palette index or the green component intensity of a 32-bit image color. + + +{{PageSyntax}} +: {{Parameter|greenIntensity&}} = [[_GREEN]]({{Parameter|rgbaColorIndex&}}[, {{Parameter|imageHandle&}}]) + + +{{PageDescription}} +* {{Parameter|rgbaColorIndex&}} is the ''RGBA'' color value or palette index of the color to retrieve the green component intensity from. +* The [[LONG]] intensity value returned ranges from 0 (no intensity, not present) to 255 (full intensity). +* If {{Parameter|imageHandle&}} specifies a 32-bit color image, {{Parameter|rgbaColorIndex&}} is interpreted as a 32-bit ''RGBA'' color value. +* If {{Parameter|imageHandle&}} specifies an image that uses a palette, {{Parameter|rgbaColorIndex&}} is interpreted as a palette index. +* If {{Parameter|imageHandle&}} is not specified, it is assumed to be the current write page (See [[_DEST]]). +* If {{Parameter|imageHandle&}} is an invalid handle, an [[ERROR Codes|invalid handle]] error will occur. +* If {{Parameter|rgbaColorIndex&}} is outside the range of valid indexes for a given image mode, an [[ERROR Codes|illegal function call]] error occurs. +* Uses index parameters passed by the [[_RGB]], [[_RGBA]], [[_RGB32]] or [[_RGBA32]] functions. +* An image handle is optional. + + +{{PageExamples}} +* See example in [[POINT]]. + + +{{PageSeeAlso}} +* [[_RED]], [[_BLUE]] +* [[_RGB]], [[RGB32]] +* [[_LOADIMAGE]] + + +{{PageNavigation}} + diff --git a/internal/help/_HEIGHT.txt b/internal/help/_HEIGHT.txt deleted file mode 100644 index 449f8e8b2..000000000 --- a/internal/help/_HEIGHT.txt +++ /dev/null @@ -1,25 +0,0 @@ -{{DISPLAYTITLE:_HEIGHT}} -The [[_HEIGHT]] function returns the height of an image handle or of the current write page. - - -{{PageSyntax}} -: {{Parameter|columns&}} = [[_HEIGHT]][({{Parameter|imageHandle&}})] - - -{{PageDescription}} -* If {{Parameter|imageHandle&}} is omitted, it's assumed to be the handle of the current [[SCREEN]] or write page. -* To get the height of the current program [[SCREEN|screen]] window use zero for the handle value or nothing: {{Parameter|lines&}} = [[_HEIGHT]](0) ''or'' {{Parameter|lines&}} = [[_HEIGHT]] -* If the image specified by {{Parameter|imageHandle&}} is in text only([[SCREEN]] 0) mode, the number of characters per row is returned. -* If the image specified by {{Parameter|imageHandle&}} is in graphics mode, the number of pixels per row is returned. -* If {{Parameter|imageHandle&}} is an invalid handle, then an [[ERROR Codes|invalid handle error]] is returned. -* The last visible pixel coordinate of a program [[SCREEN|screen]] is '''[[_HEIGHT]] - 1'''. - - - -{{PageSeeAlso}} -* [[_WIDTH (function)]], [[_LOADIMAGE]], [[_NEWIMAGE]] -* [[Bitmaps]] - - -{{PageNavigation}} -< diff --git a/internal/help/_HEIGHT__111111.txt b/internal/help/_HEIGHT__111111.txt new file mode 100644 index 000000000..9a0e613e3 --- /dev/null +++ b/internal/help/_HEIGHT__111111.txt @@ -0,0 +1,27 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:34}} +{{DISPLAYTITLE:_HEIGHT}} +The [[_HEIGHT]] function returns the height of an image handle or of the current write page. + + +{{PageSyntax}} +: {{Parameter|columns&}} = [[_HEIGHT]][({{Parameter|imageHandle&}})] + + +{{PageDescription}} +* If {{Parameter|imageHandle&}} is omitted, it's assumed to be the handle of the current [[SCREEN]] or write page. +* To get the height of the current program [[SCREEN|screen]] window use zero for the handle value or nothing: {{Parameter|lines&}} = [[_HEIGHT]](0) ''or'' {{Parameter|lines&}} = [[_HEIGHT]] +* If the image specified by {{Parameter|imageHandle&}} is in text only([[SCREEN]] 0) mode, the number of characters per row is returned. +* If the image specified by {{Parameter|imageHandle&}} is in graphics mode, the number of pixels per row is returned. +* If {{Parameter|imageHandle&}} is an invalid handle, then an [[ERROR Codes|invalid handle error]] is returned. +* The last visible pixel coordinate of a program [[SCREEN|screen]] is '''[[_HEIGHT]] - 1'''. + + + +{{PageSeeAlso}} +* [[_WIDTH (function)]], [[_LOADIMAGE]], [[_NEWIMAGE]] +* [[Bitmaps]] + + +{{PageNavigation}} + diff --git a/internal/help/_HIDE.txt b/internal/help/_HIDE__1111.txt similarity index 87% rename from internal/help/_HIDE.txt rename to internal/help/_HIDE__1111.txt index 38c0f7dae..74b08b270 100644 --- a/internal/help/_HIDE.txt +++ b/internal/help/_HIDE__1111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:36}} {{DISPLAYTITLE:_HIDE}} The [[_HIDE]] action is used to hide the console window opened by a [[SHELL]] statement. @@ -15,28 +17,27 @@ The [[_HIDE]] action is used to hide the console window opened by a [[SHELL]] st {{PageExamples}} ''Example:'' Subprogram that displays long and short filenames using the DIR /X option (WindowsNT or above) in SCREEN 12: {{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 {{Cl|LOF}}(1) THEN Header$ = SPACE$(10) + "Short" + SPACE$(16) + "Long" + SPACE$(20) + "Last Modified" - tmp$ = "\ \ \ \ &" ' print using template format + 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 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$ <> "" + DO: LOOP UNTIL INKEY$ <> "" CLS: COLOR 14: LOCATE 2, 4: PRINT Header$ END IF COLOR 11: LOCATE (cnt% MOD 25) + 3, 4 @@ -47,8 +48,7 @@ SUB LFN END IF COLOR 10: LOCATE {{Cl|CSRLIN}} + 1, 27 "Total folders and files ="; cnt% CLOSE #1 -END SUB '' '' - +END SUB {{CodeEnd}} ''Explanation:'' The above routine can also be used to place the file name info into string arrays by using the count variable cnt% to determine the index. Long file names are normally returned by '''QB64'''. To keep older QBasic programs compatible, you may want to only use the short names when displaying the files on the screen. @@ -60,4 +60,4 @@ END SUB '' '' {{PageNavigation}} -< + diff --git a/internal/help/_HYPOT.txt b/internal/help/_HYPOT__11111.txt similarity index 95% rename from internal/help/_HYPOT.txt rename to internal/help/_HYPOT__11111.txt index 502cd2b80..c976fecaa 100644 --- a/internal/help/_HYPOT.txt +++ b/internal/help/_HYPOT__11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:37}} {{DISPLAYTITLE:_HYPOT}} The [[_HYPOT]] function returns the hypotenuse of a right-angled triangle whose legs are x and y. @@ -17,7 +19,7 @@ The [[_HYPOT]] function returns the hypotenuse of a right-angled triangle whose {{PageExamples}} ''Example:'' -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DIM}} leg_x {{Cl|AS}} {{Cl|DOUBLE}}, leg_y {{Cl|AS}} {{Cl|DOUBLE}}, result {{Cl|AS}} {{Cl|DOUBLE}} leg_x = 3 leg_y = 4 @@ -38,4 +40,4 @@ result = {{Cl|_HYPOT}}(leg_x, leg_y) {{PageNavigation}} -< + diff --git a/internal/help/_ICON.txt b/internal/help/_ICON__1111.txt similarity index 62% rename from internal/help/_ICON.txt rename to internal/help/_ICON__1111.txt index e406f855b..4cc7baaf9 100644 --- a/internal/help/_ICON.txt +++ b/internal/help/_ICON__1111.txt @@ -1,22 +1,24 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:39}} {{DISPLAYTITLE:_ICON}} The [[_ICON]] statement uses an image handle from [[_LOADIMAGE]] for the program header and icon image in the OS. {{PageSyntax}} -: [[_ICON]] [{{Parameter|mainImageHandle&}}[, {{Parameter|smallImageHandle&}}]] +: [[_ICON]] [{{Parameter|mainImageHandle&}}[, {{Parameter|smallImageHandle&}}]] {{Parameters}} -* {{Parameter|mainImageHandle&}} is the [[LONG]] handle value of the OS icon and title bar image pre-loaded with [[_LOADIMAGE]] when used alone. -* {{Parameter|smallImageHandle&}} is the [[LONG]] handle value of a different title bar image pre-loaded with [[_LOADIMAGE]] when used. +* {{Parameter|mainImageHandle&}} is the [[LONG]] handle value of the OS icon and title bar image pre-loaded with [[_LOADIMAGE]] when used alone. +* {{Parameter|smallImageHandle&}} is the [[LONG]] handle value of a different title bar image pre-loaded with [[_LOADIMAGE]] when used. * No image handle designates use of the default QB64 icon or the embedded icon set by [[$EXEICON]]. {{PageDescription}} * If no image handle is passed, the default QB64 icon will be used (all versions). If the [[$EXEICON]] metacommand is used, [[_ICON]] without an image handle uses the embedded icon from the binary (Windows only). * Beginning with '''version 1.000''', the following is considered: -:::{{Parameter|mainImageHandle&}} creates the image as the icon in the OS and the image in the program header (title bar). -:::{{Parameter|smallImageHandle&}} can be used for a different image in the program header bar. +:::{{Parameter|mainImageHandle&}} creates the image as the icon in the OS and the image in the program header (title bar). +:::{{Parameter|smallImageHandle&}} can be used for a different image in the program header bar. *The header image will automatically be resized to fit the icon size of 16 X 16 if smaller or larger. *Once the program's icon is set, the image handle can be discarded with [[_FREEIMAGE]]. @@ -30,31 +32,31 @@ 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 +{{CodeStart}} +i& ={{Cl|_LOADIMAGE}}("RDSWU16.BMP", 32) '<<<<<<< use your image file name here -{{Cl|IF}} i& < -1 THEN - {{Cl|_ICON}} i& - {{Cl|_FREEIMAGE}} i& ' release image handle after setting icon +{{Cl|IF}} i& < -1 THEN + {{Cl|_ICON}} i& + {{Cl|_FREEIMAGE}} i& ' release image handle after setting icon {{Cl|END IF}} {{CodeEnd}} :''Note:'' _ICON images can be freed if the [[SCREEN]] mode stays the same. Freed image handles can on longer be referenced. ''Example 2:'' Function that converts an icon into a temporary bitmap for use in QB64. Function returns the available image count. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, 256) {{Cl|_TITLE}} "Icon Converter" -icon$ = "daphne.ico" '<<<<<<<<< change icon file name +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 +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}} - img& = {{Cl|_LOADIMAGE}}(bitmap$) ' use 32 as color mode in SCREEN 0 - {{Cl|IF...THEN|IF}} img& < -1 {{Cl|THEN}} ' check that handle value is good before loading - {{Cl|_ICON}} img& ' place image in header - {{Cl|_PUTIMAGE}} (300, 250), img& 'place image on screen - {{Cl|_FREEIMAGE}} img& ' always free unused handles to save memory + img& = {{Cl|_LOADIMAGE}}(bitmap$) ' use 32 as color mode in SCREEN 0 + {{Cl|IF...THEN|IF}} img& < -1 {{Cl|THEN}} ' check that handle value is good before loading + {{Cl|_ICON}} img& ' place image in header + {{Cl|_PUTIMAGE}} (300, 250), img& 'place image on screen + {{Cl|_FREEIMAGE}} img& ' always free unused handles to save memory {{Cl|KILL}} bitmap$ ' comment out and/or rename to save the bitmaps {{Cl|END IF}} {{Cl|END IF}} @@ -74,13 +76,13 @@ rf = {{Cl|FREEFILE}} {{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 -{{Cl|GET}} rf, , word 'number of 4 BPP colors(256 & 32 = 0) & reserved bytes +{{Cl|GET}} rf, , word 'number of 4 BPP colors(256 & 32 = 0) & reserved bytes {{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 @@ -89,33 +91,33 @@ rf = {{Cl|FREEFILE}} {{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 -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& +{{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 +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 wf = {{Cl|FREEFILE}} {{Cl|OPEN}} fileout {{Cl|OPEN|FOR}} {{Cl|BINARY}} {{Cl|AS}} wf {{Cl|PUT}} wf, , BM -{{Cl|PUT}} wf, , filesize& +{{Cl|PUT}} wf, , filesize& dword = 0 {{Cl|PUT}} wf, , dword -{{Cl|PUT}} wf, , bmpoffset& 'byte location of end of palette or BMP header +{{Cl|PUT}} wf, , bmpoffset& 'byte location of end of palette or BMP header dword = 40 {{Cl|PUT}} wf, , dword ' start of 40 byte BMP header {{Cl|PUT}} wf, , wide {{Cl|PUT}} wf, , high {{Cl|SEEK}} rf, 1 + offset + 12 ' after 12 bytes start copy of BMP header starting at planes -dat$ = {{Cl|STRING$}}(readbytes&, 0) 'create string to hold remaining bytes needed w/o {{Cl|AND}} mask data +dat$ = {{Cl|STRING$}}(readbytes&, 0) 'create string to hold remaining bytes needed w/o {{Cl|AND}} mask data {{Cl|GET}} rf, , dat$ ' copy lower header, palette(if used) and {{Cl|XOR}} mask {{Cl|PUT}} wf, , dat$ ' put all of the string data in the bitmap all at once {{Cl|CLOSE}} rf, wf Icon2BMP = count ' return the number of icons available in the icon file -{{Cl|END FUNCTION}} '' '' +{{Cl|END FUNCTION}} {{CodeEnd}}{{small|Code by Ted Weissgerber}} : ''Note:'' Once the file has been loaded into memory, the image handle can still be used even after the file has been deleted. @@ -130,4 +132,4 @@ Icon2BMP = count ' return the number of icons available in the icon {{PageNavigation}} -< + diff --git a/internal/help/_INCLERRORFILE$.txt b/internal/help/_INCLERRORFILE$__1111111111111$.txt similarity index 94% rename from internal/help/_INCLERRORFILE$.txt rename to internal/help/_INCLERRORFILE$__1111111111111$.txt index 0cf49b3ef..1a950444d 100644 --- a/internal/help/_INCLERRORFILE$.txt +++ b/internal/help/_INCLERRORFILE$__1111111111111$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:41}} {{DISPLAYTITLE:_INCLERRORFILE$}} The [[_INCLERRORFILE$]] function returns the name of the original source code [[$INCLUDE]] module that caused the most recent error. @@ -32,7 +34,7 @@ DebugLine: {{Cl|IF...THEN|IF}} {{Cl|_INCLERRORLINE}} {{Cl|THEN}} {{Cl|PRINT}} " IN MODULE "; {{Cl|_INCLERRORFILE$}}; " (line"; {{Cl|_INCLERRORLINE}}; ")" {{Cl|END IF}} -{{Cl|RESUME}} {{Cl|NEXT}} '' '' +{{Cl|RESUME}} {{Cl|NEXT}} {{CodeEnd}} {{OutputStart}}An error occurred. Please contact support with the following details: ERROR 250 ON LINE: 6 @@ -52,4 +54,4 @@ ERROR 250 ON LINE: 9 {{PageNavigation}} -< + diff --git a/internal/help/_INCLERRORLINE.txt b/internal/help/_INCLERRORLINE__1111111111111.txt similarity index 92% rename from internal/help/_INCLERRORLINE.txt rename to internal/help/_INCLERRORLINE__1111111111111.txt index 845e384ef..b7403ef31 100644 --- a/internal/help/_INCLERRORLINE.txt +++ b/internal/help/_INCLERRORLINE__1111111111111.txt @@ -1,10 +1,12 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:42}} {{DISPLAYTITLE:_INCLERRORLINE}} The [[_INCLERRORFILE$]] function returns the line number in an [[$INCLUDE]] file that caused the most recent error. {{PageSyntax}} -: {{Parameter|errline&}} = [[_INCLERRORLINE]] +: {{Parameter|errline&}} = [[_INCLERRORLINE]] {{PageDescription}} @@ -33,7 +35,7 @@ DebugLine: {{Cl|IF...THEN|IF}} {{Cl|_INCLERRORLINE}} {{Cl|THEN}} {{Cl|PRINT}} " IN MODULE "; {{Cl|_INCLERRORFILE$}}; " (line"; {{Cl|_INCLERRORLINE}}; ")" {{Cl|END IF}} -{{Cl|RESUME}} {{Cl|NEXT}} '' '' +{{Cl|RESUME}} {{Cl|NEXT}} {{CodeEnd}} {{OutputStart}}An error occurred. Please contact support with the following details: ERROR 250 ON LINE: 6 @@ -54,4 +56,4 @@ ERROR 250 ON LINE: 9 {{PageNavigation}} -< + diff --git a/internal/help/_INFLATE$.txt b/internal/help/_INFLATE$__1111111$.txt similarity index 85% rename from internal/help/_INFLATE$.txt rename to internal/help/_INFLATE$__1111111$.txt index 87ab8746f..995e17218 100644 --- a/internal/help/_INFLATE$.txt +++ b/internal/help/_INFLATE$__1111111$.txt @@ -1,14 +1,16 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:43}} {{DISPLAYTITLE:_INFLATE$}} The [[_INFLATE$]] function decompresses a [[STRING|string]] compressed by the [[_DEFLATE$]] function. {{PageSyntax}} -:{{Parameter|result$}} = [[_INFLATE$]]({{Parameter|stringToDecompress$[, originalSize&]}}) +:{{Parameter|result$}} = [[_INFLATE$]]({{Parameter|stringToDecompress$[, originalSize&]}}) {{PageDescription}} * {{Parameter|result$}} will contain the original version of {{Parameter|stringToDecompress$}}. -* Optional parameter {{Parameter|originalSize&}} can be used if the original size of the uncompressed data is known beforehand, which makes the decompression routine run more efficiently. +* Optional parameter {{Parameter|originalSize&}} can be used if the original size of the uncompressed data is known beforehand, which makes the decompression routine run more efficiently. ** If unspecified, decompression still works as expected, but may use more steps and need to allocate more memory internally. @@ -46,4 +48,4 @@ After using _INFLATE$ to decompress it, LEN = 1474560 {{PageNavigation}} -< + diff --git a/internal/help/_INSTRREV.txt b/internal/help/_INSTRREV__11111111.txt similarity index 98% rename from internal/help/_INSTRREV.txt rename to internal/help/_INSTRREV__11111111.txt index 78166f243..8a1bd46dd 100644 --- a/internal/help/_INSTRREV.txt +++ b/internal/help/_INSTRREV__11111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:45}} {{DISPLAYTITLE:_INSTRREV}} The [[_INSTRREV]] function searches for a substring inside another string, but unlike [[INSTR]] it searches from right to left. @@ -71,4 +73,4 @@ Total spaces found: 13 {{PageNavigation}} -< + diff --git a/internal/help/_INTEGER64.txt b/internal/help/_INTEGER64__111111164.txt similarity index 82% rename from internal/help/_INTEGER64.txt rename to internal/help/_INTEGER64__111111164.txt index d5ad02a5a..05ec4f60f 100644 --- a/internal/help/_INTEGER64.txt +++ b/internal/help/_INTEGER64__111111164.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:46}} {{DISPLAYTITLE:_INTEGER64}} [[_INTEGER64]] is an 8 byte number type definition that can hold whole numerical values. @@ -10,7 +12,7 @@ * Can be used in 32 or 64 bit computers. * Signed numerical values can range from -9223372036854775808 to 9223372036854775807. * [[_UNSIGNED]] [[_INTEGER64]] values range from 0 to 18446744073709551615 on 64 bit computers. -* Variable type suffix is '''&&''' or '''~&&''' for [[_UNSIGNED]]. Suffix can also be placed after a literal or hexadecimal numerical value. +* Variable type suffix is '''&&''' or '''~&&''' for [[_UNSIGNED]]. Suffix can also be placed after a literal or hexadecimal numerical value. * Values can be converted to 8 byte [[ASCII]] character strings using [[_MK$]] and back using [[_CV]]. * Equivalent to INT8 or unsigned as UINT8 in C programming. * '''When a variable has not been assigned or has no type suffix, the value defaults to [[SINGLE]].''' @@ -26,4 +28,4 @@ {{PageNavigation}} -< + diff --git a/internal/help/_KEYCLEAR.txt b/internal/help/_KEYCLEAR__11111111.txt similarity index 68% rename from internal/help/_KEYCLEAR.txt rename to internal/help/_KEYCLEAR__11111111.txt index 2711914c9..47df043bc 100644 --- a/internal/help/_KEYCLEAR.txt +++ b/internal/help/_KEYCLEAR__11111111.txt @@ -1,20 +1,22 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:47}} {{DISPLAYTITLE:_KEYCLEAR}} [[_KEYCLEAR]] clears all keyboard input buffers. {{PageSyntax}} -:[[_KEYCLEAR]] {{Parameter|buffer&}} +:[[_KEYCLEAR]] [{{Parameter|buffer&}}] {{Parameters}} -*{{Parameter|buffer&}} indicates the buffer to be cleared: -** 1 - Clear the regular keyboard buffer, as used by all input command except the following: _KEYHIT, _KEYDOWN, INP(&H60. This is the same as the the emulated BIOS keyboard buffer, so legacy code reading from it via PEEK/POKE/CALL ABSOLUTE will also be affected. +*{{Parameter|buffer&}} indicates the buffer to be cleared: +** 1 - Clear the regular keyboard buffer, as used by all input command except the following: _KEYHIT, _KEYDOWN, INP(&H60. This is the same as the the emulated BIOS keyboard buffer, so legacy code reading from it via PEEK/POKE/CALL ABSOLUTE will also be affected. ** 2 - Clear the buffer used by _KEYHIT. -** 3 - Clear INP(&H60) buffer. (see '''Warning''' in the the description below) +** 3 - Clear INP(&H60) buffer. (see '''Warning''' in the the description below) * If no parameter is passed, all three buffers are cleared. {{PageDescription}} * The '''_KEYCLEAR''' command clears the specified keyboard input buffer. In effect, it is as if a loop has been used to read from the buffer until it is empty. All keys cleared are lost. -* '''Warning:''' The buffer read by INP(&H60) does not behave as the other buffers do. Whilst reading from the others will eventually empty after reading all data, this buffer will continue to return the last value. For this reason, [[_KEYCLEAR]] is of little effect, but is included for completeness (an internal flag indicating new data on the port is cleared). However, using [[INP]] for anything is strongly discouraged, and is for backwards compatibility only. +* '''Warning:''' The buffer read by INP(&H60) does not behave as the other buffers do. Whilst reading from the others will eventually empty after reading all data, this buffer will continue to return the last value. For this reason, [[_KEYCLEAR]] is of little effect, but is included for completeness (an internal flag indicating new data on the port is cleared). However, using [[INP]] for anything is strongly discouraged, and is for backwards compatibility only. * 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}} @@ -55,4 +57,4 @@ PRINT "In _KEYHIT buffer, there is "; _KEYHIT 'read the _KEYHIT buffer {{PageNavigation}} -< + diff --git a/internal/help/_KEYDOWN.txt b/internal/help/_KEYDOWN__1111111.txt similarity index 61% rename from internal/help/_KEYDOWN.txt rename to internal/help/_KEYDOWN__1111111.txt index 829c22a11..406a2b5ee 100644 --- a/internal/help/_KEYDOWN.txt +++ b/internal/help/_KEYDOWN__1111111.txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:50}} {{DISPLAYTITLE:_KEYDOWN}} The '''_KEYDOWN''' function returns whether modifying keys like CTRL, ALT, SHIFT, and any other keys are pressed. {{PageSyntax}} -:: return% = '''_KEYDOWN('''''code&''''')''' +:: return% = '''_KEYDOWN('''''code&''''')''' * The ''return'' value is -1 if a specified key is pressed or 0 if it was not pressed. It can be used to monitor key combinations. @@ -29,7 +31,7 @@ The '''_KEYDOWN''' function returns whether modifying keys like CTRL, ALT, SHIFT ' ''''Esc F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Sys ScL Pause''' ' 27 15104 15360 15616 15872 16128 16384 16640 16896 17152 17408 34048 34304 +316 +302 +019 -''''`~ 1! 2@ 3# 4$ 5% 6^ 7& 8* 9( 0) -_ =+ BkSp Ins Hme PUp NumL / * -''' +''''`~ 1! 2@ 3# 4$ 5% 6^ 7& 8* 9( 0) -_ =+ BkSp Ins Hme PUp NumL / * -''' '126 33 64 35 36 37 94 38 42 40 41 95 43 8 20992 18176 18688 +300 47 42 45 ''' 96 49 50 51 52 53 54 55 56 57 48 45 61'' ''''Tab Q W E R T Y U I O P [{ ]} \| Del End PDn 7Hme 8/β–² 9PU + ''' @@ -38,7 +40,7 @@ The '''_KEYDOWN''' function returns whether modifying keys like CTRL, ALT, SHIFT ''''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 ''' @@ -50,76 +52,76 @@ The '''_KEYDOWN''' function returns whether modifying keys like CTRL, ALT, SHIFT {{small|NOTE: The above commented table can be copied and pasted directly into the QB64 IDE}} -{{WhiteStart}} '''65536-&H40000000: QB64-specific Virtual Key codes:''' +{{WhiteStart}} '''65536-&H40000000: QB64-specific Virtual Key codes:''' - CONST KEY_PAUSE& = 100019 - CONST KEY_NUMLOCK& = 100300 - CONST KEY_CAPSLOCK& = 100301 - CONST KEY_SCROLLOCK& = 100302 - CONST KEY_RSHIFT& = 100303 - CONST KEY_LSHIFT& = 100304 - CONST KEY_RCTRL& = 100305 - CONST KEY_LCTRL& = 100306 - CONST KEY_RALT& = 100307 - 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_COMPOSE& = 100314 - CONST KEY_HELP& = 100315 - CONST KEY_PRINT& = 100316 - CONST KEY_SYSREQ& = 100317 - CONST KEY_BREAK& = 100318 - CONST KEY_MENU& = 100319 - CONST KEY_POWER& = 100320 - CONST KEY_EURO& = 100321 - CONST KEY_UNDO& = 100322 - CONST KEY_KP0& = 100256 - CONST KEY_KP1& = 100257 - CONST KEY_KP2& = 100258 - CONST KEY_KP3& = 100259 - CONST KEY_KP4& = 100260 - CONST KEY_KP5& = 100261 - CONST KEY_KP6& = 100262 - CONST KEY_KP7& = 100263 - CONST KEY_KP8& = 100264 - CONST KEY_KP9& = 100265 - CONST KEY_KP_PERIOD& = 100266 - CONST KEY_KP_DIVIDE& = 100267 - CONST KEY_KP_MULTIPLY& = 100268 - CONST KEY_KP_MINUS& = 100269 - CONST KEY_KP_PLUS& = 100270 - CONST KEY_KP_ENTER& = 100271 - CONST KEY_KP_INSERT& = 200000 - CONST KEY_KP_END& = 200001 - CONST KEY_KP_DOWN& = 200002 - CONST KEY_KP_PAGE_DOWN& = 200003 - CONST KEY_KP_LEFT& = 200004 - CONST KEY_KP_MIDDLE& = 200005 - CONST KEY_KP_RIGHT& = 200006 - CONST KEY_KP_HOME& = 200007 - CONST KEY_KP_UP& = 200008 - CONST KEY_KP_PAGE_UP& = 200009 - CONST KEY_KP_DELETE& = 200010 - CONST KEY_SCROLL_LOCK_MODE& = 200011 - CONST KEY_INSERT_MODE& = 200012 + CONST KEY_PAUSE& = 100019 + CONST KEY_NUMLOCK& = 100300 + CONST KEY_CAPSLOCK& = 100301 + CONST KEY_SCROLLOCK& = 100302 + CONST KEY_RSHIFT& = 100303 + CONST KEY_LSHIFT& = 100304 + CONST KEY_RCTRL& = 100305 + CONST KEY_LCTRL& = 100306 + CONST KEY_RALT& = 100307 + 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_COMPOSE& = 100314 + CONST KEY_HELP& = 100315 + CONST KEY_PRINT& = 100316 + CONST KEY_SYSREQ& = 100317 + CONST KEY_BREAK& = 100318 + CONST KEY_MENU& = 100319 + CONST KEY_POWER& = 100320 + CONST KEY_EURO& = 100321 + CONST KEY_UNDO& = 100322 + CONST KEY_KP0& = 100256 + CONST KEY_KP1& = 100257 + CONST KEY_KP2& = 100258 + CONST KEY_KP3& = 100259 + CONST KEY_KP4& = 100260 + CONST KEY_KP5& = 100261 + CONST KEY_KP6& = 100262 + CONST KEY_KP7& = 100263 + CONST KEY_KP8& = 100264 + CONST KEY_KP9& = 100265 + CONST KEY_KP_PERIOD& = 100266 + CONST KEY_KP_DIVIDE& = 100267 + CONST KEY_KP_MULTIPLY& = 100268 + CONST KEY_KP_MINUS& = 100269 + CONST KEY_KP_PLUS& = 100270 + CONST KEY_KP_ENTER& = 100271 + CONST KEY_KP_INSERT& = 200000 + CONST KEY_KP_END& = 200001 + CONST KEY_KP_DOWN& = 200002 + CONST KEY_KP_PAGE_DOWN& = 200003 + CONST KEY_KP_LEFT& = 200004 + CONST KEY_KP_MIDDLE& = 200005 + CONST KEY_KP_RIGHT& = 200006 + CONST KEY_KP_HOME& = 200007 + CONST KEY_KP_UP& = 200008 + CONST KEY_KP_PAGE_UP& = 200009 + CONST KEY_KP_DELETE& = 200010 + CONST KEY_SCROLL_LOCK_MODE& = 200011 + CONST KEY_INSERT_MODE& = 200012 - '''&H40000000 up''': [[Unicode]] using the '''cyberbit.ttf''' font when available. + '''&H40000000 up''': [[Unicode]] using the '''cyberbit.ttf''' font when available. '''Use [[_KEYHIT]] to find the key codes to be monitored by _KEYDOWN! ''' {{WhiteEnd}} ''Example 1:'' Comparing the _KEYDOWN returns using [[CONST|constant]] values with 2 byte [[INKEY$]] returns. -{{CodeStart}} '' '' -{{Cl|CONST}} RSHIFT& = 100303 -{{Cl|CONST}} LSHIFT& = 100304 +{{CodeStart}} +{{Cl|CONST}} RSHIFT& = 100303 +{{Cl|CONST}} LSHIFT& = 100304 {{Cl|DO}} 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|IF}} {{Cl|_KEYDOWN}}(LSHIFT&) {{Cl|OR (boolean)|OR}} {{Cl|_KEYDOWN}}(RSHIFT&) {{Cl|THEN}} {{Cl|PRINT}} "KEYHIT: SHIFT + F1" {{Cl|ELSE}} {{Cl|PRINT}} "KEYHIT: F1" @@ -134,7 +136,7 @@ The '''_KEYDOWN''' function returns whether modifying keys like CTRL, ALT, SHIFT ''Example 2:'' How to calculate the _KEYDOWN codes of the 2 byte INKEY$ arrow key codes using [[CVI]]. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN (statement)|SCREEN}} 12 x = 320: y = 240 @@ -154,7 +156,7 @@ DO {{Cl|_DISPLAY}} {{Cl|_LIMIT}} 100 'limit to 100 frames per second -{{Cl|LOOP}} '' '' +{{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. @@ -165,10 +167,10 @@ DO * [[_KEYHIT]], [[Unicode]], [[Code Pages]] (by region) * [[_MAPUNICODE]], [[_MAPUNICODE (function)]] * [[INKEY$]], [[ASCII]], [[CVI]] -* [[INP]](&H60), [[Scancodes]] +* [[INP]](&H60), [[Scancodes]] * [[ON KEY(n)]], [[KEY(n)]], [[KEY n]] * [[Windows_Libraries#Hot_Keys_.28maximize.29|Windows hot keys]] {{PageNavigation}} -< + diff --git a/internal/help/_KEYHIT.txt b/internal/help/_KEYHIT__111111.txt similarity index 51% rename from internal/help/_KEYHIT.txt rename to internal/help/_KEYHIT__111111.txt index d2d626869..0cbad9990 100644 --- a/internal/help/_KEYHIT.txt +++ b/internal/help/_KEYHIT__111111.txt @@ -1,50 +1,52 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:49}} {{DISPLAYTITLE:_KEYHIT}} The [[_KEYHIT]] function returns [[ASCII]] one and two byte, OpenGL Virtual Key and Unicode keyboard key press codes. {{PageSyntax}} -:{{Parameter|keycode&}} = [[_KEYHIT]] +:{{Parameter|keycode&}} = [[_KEYHIT]] {{PageDescription}} -* Return values range up to &H40000000 so use a [[LONG]] or [[_INTEGER64]] variable type. See the [[_KEYDOWN]] code list: +* Return values range up to &H40000000 so use a [[LONG]] or [[_INTEGER64]] variable type. See the [[_KEYDOWN]] code list: :* 0-255: [[ASCII]] values (Refer to [http://en.wikipedia.org/wiki/Code_page_437 CP437]). :* 256-65535: [[ASCII#Two_Byte_Codes|2-byte]] character codes : code = [[CVI]]([[CHR$]](0) + [[CHR$]](scancode)) (unaffected by SHIFT/ALT/CTRL modifiers). -:* 65536-&H40000000: [[_KEYDOWN|QB64-specific Virtual Key codes]] (designated with + for 100000 on keyboard below) +:* 65536-&H40000000: [[_KEYDOWN|QB64-specific Virtual Key codes]] (designated with + for 100000 on keyboard below) :* '''Negative''' [[LONG]] values returned indicate that a key was released or a lock function key has been turned off. * '''Note: _KEYHIT can only return one value at a time so use the [[_KEYDOWN]] keyhit value to find key combinations.''' * To receive input from a [[$CONSOLE]] window, use [[_CINP]]. {{WhiteStart}}' '''_KEYHIT Keyboard Codes''' ' -''''Esc F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Sys ScL Pause''' -' 27 15104 15360 15616 15872 16128 16384 16640 16896 17152 17408 34048 34304 +316 +302 +019 -''''`~ 1! 2@ 3# 4$ 5% 6^ 7& 8* 9( 0) -_ =+ BkSp Ins Hme PUp NumL / * -''' -'126 33 64 35 36 37 94 38 42 40 41 95 43 8 20992 18176 18688 +300 47 42 45 -''' 96 49 50 51 52 53 54 55 56 57 48 45 61'' -''''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/-β–Ί -'+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''' -'+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 ''' -'+306 +311 +308 32 +307 +312 +319 +305 19200 20480 19712 20992 21248 13 -' '' 48 46'' +' '''Esc F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Sys ScL Pause''' +' 27 15104 15360 15616 15872 16128 16384 16640 16896 17152 17408 34048 34304 +316 +302 +019 +' '''`~ 1! 2@ 3# 4$ 5% 6^ 7& 8* 9( 0) -_ =+ BkSp Ins Hme PUp NumL / * -''' +' 126 33 64 35 36 37 94 38 42 40 41 95 43 8 20992 18176 18688 +300 47 42 45 +' '' 96 49 50 51 52 53 54 55 56 57 48 45 61'' +' '''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/-β–Ί +' +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''' +' +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 ''' +' +306 +311 +308 32 +307 +312 +319 +305 19200 20480 19712 20992 21248 13 +' '' 48 46'' ' ' ''' Lower value = LCase/NumLock On __________________ + = add 100000 ''' {{WhiteEnd}} {{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> +
'''[http://www.fileformat.info/tip/microsoft/enter_unicode.htm Setting up the Unicode Input Method Editor in Windows]'''
+
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]
* 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. @@ -53,7 +55,6 @@ The [[_KEYHIT]] function returns [[ASCII]] one and two byte, OpenGL Virtual Key {{PageExamples}} ''Example:'' This routine will return the codes for any keyboard presses. {{CodeStart}} - '' '' {{Cl|DEFLNG}} A-Z {{Cl|SCREEN (statement)|SCREEN}} {{Cl|_NEWIMAGE}}(800, 600, 8) {{Cl|CLS}} , 1 @@ -64,7 +65,7 @@ unifont = {{Cl|_LOADFONT}}("cyberbit.ttf", 24, "UNICODE") {{Cl|DO}} x = {{Cl|_KEYHIT}} {{Cl|IF}} x {{Cl|THEN}} - {{Cl|IF}} x < 0 {{Cl|THEN}} 'negative value means key released + {{Cl|IF}} x < 0 {{Cl|THEN}} 'negative value means key released {{Cl|COLOR}} 2 {{Cl|PRINT}} "Released "; x = -x @@ -72,34 +73,34 @@ unifont = {{Cl|_LOADFONT}}("cyberbit.ttf", 24, "UNICODE") {{Cl|COLOR}} 10 {{Cl|PRINT}} "Pressed "; 'positive value means key pressed {{Cl|END IF}} - {{Cl|IF}} x < 256 {{Cl|THEN}} 'ASCII code values + {{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|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|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|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|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 {{Cl|COLOR}} 15 - z$ = {{Cl|MKL$}}(x - {{Cl|&H}}40000000) + {{Cl|MKL$}}(0) + z$ = {{Cl|MKL$}}(x - {{Cl|&H}}40000000) + {{Cl|MKL$}}(0) {{Cl|PRINT}} z$ + z$ + z$; {{Cl|_FONT}} font {{Cl|LOCATE}} cy, 1: {{Cl|PRINT}} {{Cl|END IF}} {{Cl|END IF}} -{{Cl|LOOP}} '' '' +{{Cl|LOOP}} {{CodeEnd}} {{small|Code by Galleon}} @@ -109,10 +110,10 @@ unifont = {{Cl|_LOADFONT}}("cyberbit.ttf", 24, "UNICODE") * [[_MAPUNICODE]], [[_MAPUNICODE (function)]] * [[INKEY$]], [[ASCII]] {{text|(code table)}}, * [[Unicode]], [[Code Pages]] {{text|(by region)}} -* [[INP]]([[&H|&H60]]), [[Scancodes]] +* [[INP]]([[&H|&H60]]), [[Scancodes]] * [[ON KEY(n)]], [[KEY(n)]], [[KEY n]] * [[Windows_Libraries#Hot_Keys_.28maximize.29|Windows hot keys]] {{PageNavigation}} -< + diff --git a/internal/help/_LASTAXIS.txt b/internal/help/_LASTAXIS__11111111.txt similarity index 96% rename from internal/help/_LASTAXIS.txt rename to internal/help/_LASTAXIS__11111111.txt index ecafbbe2f..db503b13a 100644 --- a/internal/help/_LASTAXIS.txt +++ b/internal/help/_LASTAXIS__11111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:52}} {{DISPLAYTITLE:_LASTAXIS}} The [[_LASTAXIS]] function returns the number of axis a specified number INPUT device on your computer has. @@ -16,13 +18,13 @@ The [[_LASTAXIS]] function returns the number of axis a specified number INPUT d {{PageExamples}} ''Example:'' Checking for the system's input devices and number of axis. -{{CodeStart}} '' '' +{{CodeStart}} devices = {{Cl|_DEVICES}} 'MUST be read in order for other 2 device functions to work! 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) -NEXT '' '' +NEXT {{CodeEnd}} {{OutputStart}}Number of input devices found = 2 [KEYBOARD][BUTTON] @@ -42,4 +44,4 @@ Axis: 2 {{PageNavigation}} -< + diff --git a/internal/help/_LASTBUTTON.txt b/internal/help/_LASTBUTTON__1111111111.txt similarity index 96% rename from internal/help/_LASTBUTTON.txt rename to internal/help/_LASTBUTTON__1111111111.txt index ccec16fe9..04f0924f4 100644 --- a/internal/help/_LASTBUTTON.txt +++ b/internal/help/_LASTBUTTON__1111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:54}} {{DISPLAYTITLE:_LASTBUTTON}} The [[_LASTBUTTON]] function returns the number of buttons a specified INPUT device on your computer has. @@ -16,13 +18,13 @@ The [[_LASTBUTTON]] function returns the number of buttons a specified INPUT dev {{PageExamples}} ''Example:'' Checking for the system's input devices. -{{CodeStart}} '' '' +{{CodeStart}} devices = {{Cl|_DEVICES}} 'MUST be read in order for other 2 device functions to work! PRINT "Number of input devices found ="; devices FOR i = 1 TO devices PRINT {{Cl|_DEVICE$}}(i) PRINT "Buttons:"; {{Cl|_LASTBUTTON}}(i) -NEXT '' '' +NEXT {{CodeEnd}} {{OutputStart}}Number of input devices found = 2 [KEYBOARD][BUTTON] @@ -44,4 +46,4 @@ Buttons: 3 {{PageNavigation}} -< + diff --git a/internal/help/_LASTWHEEL.txt b/internal/help/_LASTWHEEL__111111111.txt similarity index 96% rename from internal/help/_LASTWHEEL.txt rename to internal/help/_LASTWHEEL__111111111.txt index a7fadf122..1b8832f1e 100644 --- a/internal/help/_LASTWHEEL.txt +++ b/internal/help/_LASTWHEEL__111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:55}} {{DISPLAYTITLE:_LASTWHEEL}} The [[_LASTWHEEL]] function returns the number of wheels a specified number INPUT device on your computer has. @@ -15,13 +17,13 @@ The [[_LASTWHEEL]] function returns the number of wheels a specified number INPU {{PageExamples}} ''Example:'' Checking for the system's input devices and number of wheels available. -{{CodeStart}} '' '' +{{CodeStart}} devices = {{Cl|_DEVICES}} 'MUST be read in order for other 2 device functions to work! 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) -NEXT '' '' +NEXT {{CodeEnd}} {{OutputStart}}Number of input devices found = 2 [KEYBOARD][BUTTON] @@ -41,4 +43,4 @@ Wheels: 3 {{PageNavigation}} -< + diff --git a/internal/help/_LIMIT.txt b/internal/help/_LIMIT__11111.txt similarity index 91% rename from internal/help/_LIMIT.txt rename to internal/help/_LIMIT__11111.txt index ed6db58de..c24258a1e 100644 --- a/internal/help/_LIMIT.txt +++ b/internal/help/_LIMIT__11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:56}} {{DISPLAYTITLE:_LIMIT}} The [[_LIMIT]] statement sets the loop repeat rate of a program to so many per second, relinquishing spare CPU cycles to other applications. @@ -12,17 +14,17 @@ The [[_LIMIT]] statement sets the loop repeat rate of a program to so many per s * Loop cycle rates of 1000 or less can '''significantly reduce CPU usage''' in programs. * Do not use it to limit a loop to '''less than once every 60 seconds'''(.0167) or an [[ERROR Codes|ILLEGAL FUNCTION CALL error]] will occur. * Do not use _LIMIT as a timing delay outside of loops. Use [[_DELAY]] instead. -* Use _LIMIT to slow down old Qbasic program loops that run too fast and use too much CPU. +* Use _LIMIT to slow down old QBasic program loops that run too fast and use too much CPU. {{PageExamples}} ''Example:'' Limits loop execution to 30 frames per second and limits the program's CPU usage. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|PRINT}} "To Quit press ESC key!" {{Cl|DO}} {{Cl|_LIMIT}} 30 {{Cl|PRINT}} {{Cl|CHR$}}(26); - {{Cl|IF...THEN|IF}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) {{Cl|THEN}} {{Cl|EXIT DO}} '' '' + {{Cl|IF...THEN|IF}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) {{Cl|THEN}} {{Cl|EXIT DO}} {{Cl|LOOP}} {{CodeEnd}} {{OutputStart}} @@ -39,4 +41,4 @@ To Quit press ESC key! {{PageNavigation}} -< + diff --git a/internal/help/_LOADFONT.txt b/internal/help/_LOADFONT__11111111.txt similarity index 84% rename from internal/help/_LOADFONT.txt rename to internal/help/_LOADFONT__11111111.txt index e3e171794..552b03976 100644 --- a/internal/help/_LOADFONT.txt +++ b/internal/help/_LOADFONT__11111111.txt @@ -1,13 +1,15 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:58}} {{DISPLAYTITLE:_LOADFONT}} The [[_LOADFONT]] function loads a TrueType font (.TTF) or an OpenType font (.OTF) file in a specific size and style and returns a [[LONG]] font handle. {{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. @@ -19,14 +21,14 @@ The [[_LOADFONT]] function loads a TrueType font (.TTF) or an OpenType font (.OT ** '''"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.''' * [[_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> +
'''Font Handles'''
* 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,7 +40,7 @@ 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> +
'''Font File Specs'''
* 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]]. @@ -50,8 +52,8 @@ The [[_LOADFONT]] function loads a TrueType font (.TTF) or an OpenType font (.OT 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& +f& ={{Cl|_LOADFONT}}(fontfile$, 30, style$) +{{Cl|_FONT}} f& {{Cl|PRINT}} "Hello!" {{CodeEnd}} @@ -68,10 +70,10 @@ Hello! ''Example 2:'' In a 32-bit graphics mode you can alpha blend onto the background: {{CodeStart}} -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 +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!" {{CodeEnd}} @@ -86,8 +88,8 @@ f& ={{Cl|_LOADFONT}}("C:\Windows\Fonts\times.ttf", 25) 'normal style {{CodeStart}}{{Cl|SCREEN}} 12 {{Cl|DECLARE DYNAMIC LIBRARY|DECLARE CUSTOMTYPE LIBRARY}} 'Directory Information using KERNEL32 provided by Dav - {{Cl|FUNCTION}} GetModuleFileNameA& ({{Cl|BYVAL}} hModule {{Cl|AS}} {{Cl|LONG}}, lpFileName {{Cl|AS}} {{Cl|STRING}}, {{Cl|BYVAL}} nSize {{Cl|AS}} {{Cl|LONG}}) - {{Cl|FUNCTION}} GetModuleFileNameW& ({{Cl|BYVAL}} hModule {{Cl|AS}} {{Cl|LONG}}, lpFileName {{Cl|AS}} {{Cl|STRING}}, {{Cl|BYVAL}} nSize {{Cl|AS}} {{Cl|LONG}}) + {{Cl|FUNCTION}} GetModuleFileNameA& ({{Cl|BYVAL}} hModule {{Cl|AS}} {{Cl|LONG}}, lpFileName {{Cl|AS}} {{Cl|STRING}}, {{Cl|BYVAL}} nSize {{Cl|AS}} {{Cl|LONG}}) + {{Cl|FUNCTION}} GetModuleFileNameW& ({{Cl|BYVAL}} hModule {{Cl|AS}} {{Cl|LONG}}, lpFileName {{Cl|AS}} {{Cl|STRING}}, {{Cl|BYVAL}} nSize {{Cl|AS}} {{Cl|LONG}}) {{Cl|DECLARE LIBRARY|END DECLARE}} '=== SHOW CURRENT PROGRAM @@ -119,7 +121,7 @@ b$ = {{Cl|STRING$}}({{Cl|LEN}}(a$) * 2, 0) {{Cl|ASC}}(b$, i * 4 - 2) = {{Cl|ASC}}(a$, i * 2) {{Cl|NEXT}} QuickUTF16toUTF32$ = b$ -{{Cl|END FUNCTION}} '' '' +{{Cl|END FUNCTION}} {{CodeEnd}} @@ -134,4 +136,4 @@ QuickUTF16toUTF32$ = b$ {{PageNavigation}} -< + diff --git a/internal/help/_LOADIMAGE.txt b/internal/help/_LOADIMAGE__111111111.txt similarity index 87% rename from internal/help/_LOADIMAGE.txt rename to internal/help/_LOADIMAGE__111111111.txt index 86eac2203..b36a40b14 100644 --- a/internal/help/_LOADIMAGE.txt +++ b/internal/help/_LOADIMAGE__111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:08:59}} {{DISPLAYTITLE:_LOADIMAGE}} The [[_LOADIMAGE]] function loads an image into memory and returns valid [[LONG]] image handle values that are less than -1. @@ -5,7 +7,7 @@ The [[_LOADIMAGE]] function loads an image into memory and returns valid [[LONG] {{PageSyntax}} -:{{Parameter|handle&}} = [[_LOADIMAGE]]({{Parameter|filename$}}[, {{Parameter|mode%}}]) +:{{Parameter|handle&}} = [[_LOADIMAGE]]({{Parameter|filename$}}[, {{Parameter|mode%}}]) {{Parameters}} @@ -23,7 +25,7 @@ The [[_LOADIMAGE]] function loads an image into memory and returns valid [[LONG] *Mode 33 images are '''hardware''' accelerated and are created using [[_LOADIMAGE]] or [[_COPYIMAGE]] ('''version 1.000 and up'''). *Loaded images can be read invisibly using [[POINT]]. Image coordinates start at 0 up to the [[_WIDTH (function)|_WIDTH]] - 1 and [[_HEIGHT]] - 1. *Images can be made into a program [[SCREEN (statement)|SCREEN]] or page adopting the size and palette settings or placed using [[_PUTIMAGE]]. -*Returns -1 as an invalid handle if it can't load the image. Valid [[LONG]] handle returns are less than -1 ({{Parameter|handle&}} < -1). +*Returns -1 as an invalid handle if it can't load the image. Valid [[LONG]] handle returns are less than -1 ({{Parameter|handle&}} < -1). *Valid images only need to be loaded once. The handle can be used repeatedly until freed. *'''Images are not deallocated when the [[SUB]] or [[FUNCTION]] they are created in ends. Free them with [[_FREEIMAGE]].''' @@ -37,21 +39,21 @@ The [[_LOADIMAGE]] function loads an image into memory and returns valid [[LONG] {{PageExamples}} ''Example 1:'' To display an image in 32-bit color using its resolution as a program screen: -{{CodeStart}} '' '' -i& = {{Cl|_LOADIMAGE}}("mypic.jpg", 32) -{{Cl|SCREEN (statement)|SCREEN}} i& '' '' +{{CodeStart}} +i& = {{Cl|_LOADIMAGE}}("mypic.jpg", 32) +{{Cl|SCREEN (statement)|SCREEN}} i& {{CodeEnd}} ''Example 2:'' [[DRAW]]ing and rotating an image 360 degrees using Turn Angle. [[POINT]] is used to read the invisible image source. {{CodeStart}} {{Cl|SCREEN (statement)|SCREEN}} {{Cl|_NEWIMAGE}}(800, 600, 32) -img& = {{Cl|_LOADIMAGE}}("QB64.PNG") 'use any 24/32 bit image +img& = {{Cl|_LOADIMAGE}}("QB64.PNG") 'use any 24/32 bit image -wide% = {{Cl|_WIDTH (function)|_WIDTH}}(img&): deep% = {{Cl|_HEIGHT}}(img&) +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 -{{Cl|_SOURCE}} img& +{{Cl|_SOURCE}} img& {{Cl|_DEST}} 0 DO {{Cl|FOR...NEXT|FOR}} angle% = 0 {{Cl|TO}} 360 {{Cl|STEP}} 15 @@ -65,7 +67,7 @@ DO {{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}} @@ -90,4 +92,4 @@ DO {{PageNavigation}} -< + diff --git a/internal/help/_MAPTRIANGLE.txt b/internal/help/_MAPTRIANGLE__11111111111.txt similarity index 69% rename from internal/help/_MAPTRIANGLE.txt rename to internal/help/_MAPTRIANGLE__11111111111.txt index 27a064810..7b440ef89 100644 --- a/internal/help/_MAPTRIANGLE.txt +++ b/internal/help/_MAPTRIANGLE__11111111111.txt @@ -1,22 +1,24 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:00}} {{DISPLAYTITLE:_MAPTRIANGLE}} The [[_MAPTRIANGLE]] statement maps a triangular portion of an image onto a destination image or screen page. {{PageSyntax}} ===2D drawing=== -:[[_MAPTRIANGLE]] [{_SEAMLESS}] '''('''{{Parameter|sx1}}''',''' {{Parameter|sy1}}''')-('''{{Parameter|sx2}}''',''' {{Parameter|sy2}}''')-('''{{Parameter|sx3}}''',''' {{Parameter|sy3}}'''),''' {{Parameter|source&}} '''TO ('''{{Parameter|dx1}}''',''' {{Parameter|dy1}}''')-('''{{Parameter|dx2}}''',''' {{Parameter|dy2}}''')-('''{{Parameter|dx3}}''',''' {{Parameter|dy3}}''')'''[, {{Parameter|destination&}}][{_SMOOTH|_SMOOTHSHRUNK|_SMOOTHSTRETCHED}]] +:[[_MAPTRIANGLE]] [{_SEAMLESS}] '''('''{{Parameter|sx1}}''',''' {{Parameter|sy1}}''')-('''{{Parameter|sx2}}''',''' {{Parameter|sy2}}''')-('''{{Parameter|sx3}}''',''' {{Parameter|sy3}}'''),''' {{Parameter|source&}} '''TO ('''{{Parameter|dx1}}''',''' {{Parameter|dy1}}''')-('''{{Parameter|dx2}}''',''' {{Parameter|dy2}}''')-('''{{Parameter|dx3}}''',''' {{Parameter|dy3}}''')'''[, {{Parameter|destination&}}][{_SMOOTH|_SMOOTHSHRUNK|_SMOOTHSTRETCHED}]] ===3D drawing (hardware images only)=== -:[[_MAPTRIANGLE]] [{_CLOCKWISE|_ANTICLOCKWISE}] [{_SEAMLESS}] '''('''{{Parameter|sx1}}''',''' {{Parameter|sy1}}''')-('''{{Parameter|sx2}}''',''' {{Parameter|sy2}}''')-('''{{Parameter|sx3}}''',''' {{Parameter|sy3}}'''),''' {{Parameter|source&}} '''TO ('''{{Parameter|dx1}}''',''' {{Parameter|dy1}}''',''' {{Parameter|dz1}}''')-('''{{Parameter|dx2}}''',''' {{Parameter|dy2}}''',''' {{Parameter|dz2}}''')-('''{{Parameter|dx3}}''',''' {{Parameter|dy3}}''',''' {{Parameter|dz3}}''')'''[, {{Parameter|destination&}}][{_SMOOTH|_SMOOTHSHRUNK|_SMOOTHSTRETCHED}]] +:[[_MAPTRIANGLE]] [{_CLOCKWISE|_ANTICLOCKWISE}] [{_SEAMLESS}] '''('''{{Parameter|sx1}}''',''' {{Parameter|sy1}}''')-('''{{Parameter|sx2}}''',''' {{Parameter|sy2}}''')-('''{{Parameter|sx3}}''',''' {{Parameter|sy3}}'''),''' {{Parameter|source&}} '''TO ('''{{Parameter|dx1}}''',''' {{Parameter|dy1}}''',''' {{Parameter|dz1}}''')-('''{{Parameter|dx2}}''',''' {{Parameter|dy2}}''',''' {{Parameter|dz2}}''')-('''{{Parameter|dx3}}''',''' {{Parameter|dy3}}''',''' {{Parameter|dz3}}''')'''[, {{Parameter|destination&}}][{_SMOOTH|_SMOOTHSHRUNK|_SMOOTHSTRETCHED}]] {{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.''' * 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. +* {{Parameter|source&}} and optional {{Parameter|destination&}} are [[LONG]] image or screen page handles. * Supports an optional final argument '''_SMOOTH''' which applies linear filtering. See ''Example 3''. * Use '''_SMOOTHSTRETCHED''' or '''_SMOOTHSHRUNK''' for when a pixelated/smooth effect is desirable but not both. @@ -25,44 +27,44 @@ The [[_MAPTRIANGLE]] statement maps a triangular portion of an image onto a dest * This statement is used similar to [[_PUTIMAGE]] to place triangular sections of an image, but is more flexible. * The [[STEP]] keyword can be used to for coordinates relative to the last graphic coordinates used. * For 2D drawing, the destination coordinates are pixel coordinates either on-screen or on the destination image. -* For 3D drawing, the destination coordinates represent left (-x) to right (+x), bottom (-y) to top (+y) & furthest (-z) to nearest (z=-1). The center of the screen is therefore (0,0,-1). Note that a z value of 0 will result in off-screen content. The furthest visible z value is -10,000. +* For 3D drawing, the destination coordinates represent left (-x) to right (+x), bottom (-y) to top (+y) & furthest (-z) to nearest (z=-1). The center of the screen is therefore (0,0,-1). Note that a z value of 0 will result in off-screen content. The furthest visible z value is -10,000. * When drawing '''software images''' coordinate positions are '''limited from -16383 to 16383''' * The source coordinates can be positioned outside the boundary of the ''source'' image to achieve a tiled effect. -* If the {{Parameter|destination&}} image handle is the current [[SCREEN]] page, [[_DEST]] or hardware layer, then it can be omitted. +* If the {{Parameter|destination&}} image handle is the current [[SCREEN]] page, [[_DEST]] or hardware layer, then it can be omitted. * '''Hardware images''' (created using mode 33 via [[_LOADIMAGE]] or [[_COPYIMAGE]]) can be used as the source or destination. {{PageExamples}} ''Example 1:'' Rotating the an image using a rotation and zoom SUB with _MAPTRIANGLE. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(800, 600, 32) -Image& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'any 24/32 bit image +Image& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'any 24/32 bit image {{Cl|DO}} {{Cl|CLS}} - RotoZoom 400, 300, Image&, 1.5 + {{Cl|SIN}}(zoom), angle + 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|_DISPLAY}} 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}}) {{Cl|DIM}} px(3) {{Cl|AS}} {{Cl|SINGLE}}: {{Cl|DIM}} py(3) {{Cl|AS}} {{Cl|SINGLE}} -W& = {{Cl|_WIDTH (function)|_WIDTH}}(Image&): H& = {{Cl|_HEIGHT}}(Image&) -px(0) = -W& / 2: py(0) = -H& / 2: px(1) = -W& / 2:py(1) = H& / 2 -px(2) = W& / 2: py(2) = H& / 2: px(3) = W& / 2: py(3) = -H& / 2 +W& = {{Cl|_WIDTH (function)|_WIDTH}}(Image&): H& = {{Cl|_HEIGHT}}(Image&) +px(0) = -W& / 2: py(0) = -H& / 2: px(1) = -W& / 2:py(1) = H& / 2 +px(2) = W& / 2: py(2) = H& / 2: px(3) = W& / 2: py(3) = -H& / 2 sinr! = {{Cl|SIN}}(-Rotation / 57.2957795131): cosr! = {{Cl|COS}}(-Rotation / 57.2957795131) -{{Cl|FOR...NEXT|FOR}} i& = 0 {{Cl|TO}} 3 - x2& = (px(i&) * cosr! + sinr! * py(i&)) * Scale + X: y2& = (py(i&) * cosr! - px(i&) * sinr!) * Scale + Y - px(i&) = x2&: py(i&) = y2& +{{Cl|FOR...NEXT|FOR}} i& = 0 {{Cl|TO}} 3 + x2& = (px(i&) * cosr! + sinr! * py(i&)) * Scale + X: y2& = (py(i&) * cosr! - px(i&) * sinr!) * Scale + Y + px(i&) = x2&: py(i&) = y2& {{Cl|NEXT}} -{{Cl|_MAPTRIANGLE}} (0, 0)-(0, H& - 1)-(W& - 1, H& - 1), Image& TO(px(0), py(0))-(px(1), py(1))-(px(2), py(2)) -{{Cl|_MAPTRIANGLE}} (0, 0)-(W& - 1, 0)-(W& - 1, H& - 1), Image& TO(px(0), py(0))-(px(3), py(3))-(px(2), py(2)) -{{Cl|END SUB}} '' '' +{{Cl|_MAPTRIANGLE}} (0, 0)-(0, H& - 1)-(W& - 1, H& - 1), Image& TO(px(0), py(0))-(px(1), py(1))-(px(2), py(2)) +{{Cl|_MAPTRIANGLE}} (0, 0)-(W& - 1, 0)-(W& - 1, H& - 1), Image& TO(px(0), py(0))-(px(3), py(3))-(px(2), py(2)) +{{Cl|END SUB}} {{CodeEnd}} {{small|Code by Galleon}} {{WhiteStart}} @@ -73,7 +75,7 @@ sinr! = {{Cl|SIN}}(-Rotation / 57.2957795131): cosr! = {{Cl|COS}}(-Rotation / 57 ''Example 2:'' A 3D Spinning Cube demo using a software image and [[_MAPTRIANGLE]]: -{{CodeStart}} '' '' +{{CodeStart}} ' Copyright (C) 2011 by Andrew L. Ayers {{Cl|DIM}} OBJECT(9, 9, 4, 2) {{Cl|AS}} {{Cl|LONG}} @@ -93,12 +95,12 @@ sinr! = {{Cl|SIN}}(-Rotation / 57.2957795131): cosr! = {{Cl|COS}}(-Rotation / 57 {{Cl|DIM}} PLANECOL(9) {{Cl|AS}} {{Cl|INTEGER}} {{Cl|DIM}} STAB(359), CTAB(359) ' SINE/COSINE TABLES -D& = 400: MX& = 0: MY& = 0: MZ& = -100 +D& = 400: MX& = 0: MY& = 0: MZ& = -100 ' ' COMPUTE SINE/COSINE TABLES -{{Cl|FOR...NEXT|FOR}} t& = 0 {{Cl|TO}} 359 - STAB(t&) = {{Cl|SIN}}((6.282 / 360) * t&) - CTAB(t&) = {{Cl|COS}}((6.282 / 360) * t&) +{{Cl|FOR...NEXT|FOR}} t& = 0 {{Cl|TO}} 359 + STAB(t&) = {{Cl|SIN}}((6.282 / 360) * t&) + CTAB(t&) = {{Cl|COS}}((6.282 / 360) * t&) {{Cl|NEXT}} ' ' BUILD CUBE IN OBJECT ARRAY @@ -149,8 +151,8 @@ PLANECOL(5) = 8 ' {{Cl|_TITLE}} "QB64 _MAPTRIANGLE CUBE DEMO" {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(800, 600, 32) -TextureImage& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'any 24/32 bit image -'{{Cl|_PUTIMAGE}} , Image& +TextureImage& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'any 24/32 bit image +'{{Cl|_PUTIMAGE}} , Image& DO ' LIMIT {{Cl|TO}} 25 FPS @@ -159,70 +161,70 @@ DO {{Cl|CLS}} ' CALCULATE POSITION OF NEW IMAGE - {{Cl|FOR...NEXT|FOR}} OB& = 0 {{Cl|TO}} 0 ' UP {{Cl|TO}} 9 OBJECTS - SP = STAB(PIT(OB&)): CP = CTAB(PIT(OB&)) - SY = STAB(YAW(OB&)): CY = CTAB(YAW(OB&)) - SR = STAB(ROL(OB&)): CR = CTAB(ROL(OB&)) - {{Cl|FOR...NEXT|FOR}} PL& = 0 {{Cl|TO}} 5 ' CONSISTING OF UP {{Cl|TO}} 9 PLANES + {{Cl|FOR...NEXT|FOR}} OB& = 0 {{Cl|TO}} 0 ' UP {{Cl|TO}} 9 OBJECTS + SP = STAB(PIT(OB&)): CP = CTAB(PIT(OB&)) + SY = STAB(YAW(OB&)): CY = CTAB(YAW(OB&)) + SR = STAB(ROL(OB&)): CR = CTAB(ROL(OB&)) + {{Cl|FOR...NEXT|FOR}} PL& = 0 {{Cl|TO}} 5 ' CONSISTING OF UP {{Cl|TO}} 9 PLANES ' - {{Cl|FOR...NEXT|FOR}} PN& = 0 {{Cl|TO}} 3 ' EACH PLANE WITH UP {{Cl|TO}} 4 {{Cl|POINT}}S (#5 {{Cl|TO}} {{Cl|PAINT}}) + {{Cl|FOR...NEXT|FOR}} PN& = 0 {{Cl|TO}} 3 ' EACH PLANE WITH UP {{Cl|TO}} 4 {{Cl|POINT}}S (#5 {{Cl|TO}} {{Cl|PAINT}}) ' ' TRANSLATE, {{Cl|THEN}} ROTATE - TX& = OBJECT(OB&, PL&, PN&, 0) - TY& = OBJECT(OB&, PL&, PN&, 1) - TZ& = OBJECT(OB&, PL&, PN&, 2) - RX& = (TZ& * CP - TY& * SP) * SY - ((TZ& * SP + TY& * CP) * SR + TX& * CR) * CY - RY& = (TZ& * SP + TY& * CP) * CR - TX& * SR - RZ& = (TZ& * CP - TY& * SP) * CY + ((TZ& * SP + TY& * CP) * SR + TX& * CR) * SY + TX& = OBJECT(OB&, PL&, PN&, 0) + TY& = OBJECT(OB&, PL&, PN&, 1) + TZ& = OBJECT(OB&, PL&, PN&, 2) + RX& = (TZ& * CP - TY& * SP) * SY - ((TZ& * SP + TY& * CP) * SR + TX& * CR) * CY + RY& = (TZ& * SP + TY& * CP) * CR - TX& * SR + RZ& = (TZ& * CP - TY& * SP) * CY + ((TZ& * SP + TY& * CP) * SR + TX& * CR) * SY ' ' ROTATE, {{Cl|THEN}} TRANSLATE - RX& = RX& + MX& - RY& = RY& + MY& - RZ& = RZ& + MZ& + RX& = RX& + MX& + RY& = RY& + MY& + RZ& = RZ& + MZ& ' - DPLANE3D(PN&, 0) = RX&: DPLANE3D(PN&, 1) = RY&: DPLANE3D(PN&, 2) = RZ& - DPLANE2D(PN&, 0) = 399 + (D& * RX& / RZ&) - DPLANE2D(PN&, 1) = 299 + (D& * RY& / RZ&) + DPLANE3D(PN&, 0) = RX&: DPLANE3D(PN&, 1) = RY&: DPLANE3D(PN&, 2) = RZ& + DPLANE2D(PN&, 0) = 399 + (D& * RX& / RZ&) + DPLANE2D(PN&, 1) = 299 + (D& * RY& / RZ&) {{Cl|NEXT}} ' ' CHECK {{Cl|TO}} SEE {{Cl|IF...THEN|IF}} PLANE IS VISIBLE - x1& = DPLANE3D(0, 0): y1& = DPLANE3D(0, 1): Z1& = DPLANE3D(0, 2) - x2& = DPLANE3D(1, 0): y2& = DPLANE3D(1, 1): Z2& = DPLANE3D(1, 2) - x3& = DPLANE3D(2, 0): y3& = DPLANE3D(2, 1): Z3& = DPLANE3D(2, 2) - T1& = -x1& * (y2& * Z3& - y3& * Z2&) - T2& = x2& * (y3& * Z1& - y1& * Z3&) - T3& = x3& * (y1& * Z2& - y2& * Z1&) + x1& = DPLANE3D(0, 0): y1& = DPLANE3D(0, 1): Z1& = DPLANE3D(0, 2) + x2& = DPLANE3D(1, 0): y2& = DPLANE3D(1, 1): Z2& = DPLANE3D(1, 2) + x3& = DPLANE3D(2, 0): y3& = DPLANE3D(2, 1): Z3& = DPLANE3D(2, 2) + T1& = -x1& * (y2& * Z3& - y3& * Z2&) + T2& = x2& * (y3& * Z1& - y1& * Z3&) + T3& = x3& * (y1& * Z2& - y2& * Z1&) ' - VISIBLE& = T1& - T2& - T3& - {{Cl|IF...THEN|IF}} VISIBLE& > 0 {{Cl|THEN}} + VISIBLE& = T1& - T2& - T3& + {{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) xx3% = DPLANE2D(2, 0): yy3% = DPLANE2D(2, 1) - col% = PLANECOL(PL&) + col% = PLANECOL(PL&) - {{Cl|_MAPTRIANGLE}} (0, 0)-(0, 255)-(255, 255), TextureImage& TO(xx3%, yy3%)-(xx2%, yy2%)-(xx1%, yy1%) + {{Cl|_MAPTRIANGLE}} (0, 0)-(0, 255)-(255, 255), TextureImage& TO(xx3%, yy3%)-(xx2%, yy2%)-(xx1%, yy1%) ' CALL DrawTriangle(xx1%, yy1%, xx2%, yy2%, xx3%, yy3%, col%) 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)-(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 - YAW(OB&) = YAW(OB&) + 7 - {{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 + PIT(OB&) = PIT(OB&) + 5 + {{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 + ROL(OB&) = ROL(OB&) + 9 + {{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$}} @@ -231,18 +233,18 @@ DO ' ' 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|DEF SEG}} = {{Cl|&H}}A000 '{{Cl|IF...THEN|IF}} fromx% > tox% {{Cl|THEN}} {{Cl|SWAP}} fromx%, tox% - 'yyy& = yy% - 'sloc& = yyy& * 320 + fromx% - 'eloc& = sloc& + (tox% - fromx%) - '{{Cl|FOR...NEXT|FOR}} t& = sloc& {{Cl|TO}} eloc& - ' {{Cl|POKE}} t&, col% + 'yyy& = yy% + 'sloc& = yyy& * 320 + fromx% + 'eloc& = sloc& + (tox% - fromx%) + '{{Cl|FOR...NEXT|FOR}} t& = sloc& {{Cl|TO}} eloc& + ' {{Cl|POKE}} t&, col% '{{Cl|NEXT}} '{{Cl|DEF SEG}} {{Cl|LINE}} (fromx%, yy%)-(tox%, yy%), {{Cl|_RGB}}(255, 255, 255) 'col% @@ -267,12 +269,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 @@ -290,12 +292,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 @@ -313,12 +315,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 @@ -335,12 +337,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 @@ -355,12 +357,12 @@ DO {{Cl|END IF}} {{Cl|END IF}} ' -{{Cl|END SUB}} '' '' +{{Cl|END SUB}} {{CodeEnd}}{{small|Demo by Andrew L. Ayers}} ''Example 3:'' A 3D Spinning Cube demo using a hardware image and '''QB64GL''' hardware acceleration with [[_MAPTRIANGLE]]: -{{CodeStart}} '' '' +{{CodeStart}} ' Copyright (C) 2011 by Andrew L. Ayers {{Cl|DIM}} OBJECT(9, 9, 4, 2) {{Cl|AS}} {{Cl|LONG}} @@ -380,12 +382,12 @@ DO {{Cl|DIM}} PLANECOL(9) {{Cl|AS}} {{Cl|INTEGER}} {{Cl|DIM}} STAB(359), CTAB(359) ' SINE/COSINE TABLES -D& = 400: MX& = 0: MY& = 0: MZ& = -100 +D& = 400: MX& = 0: MY& = 0: MZ& = -100 ' ' COMPUTE SINE/COSINE TABLES -{{Cl|FOR...NEXT|FOR}} t& = 0 {{Cl|TO}} 359 - STAB(t&) = {{Cl|SIN}}((6.282 / 360) * t&) - CTAB(t&) = {{Cl|COS}}((6.282 / 360) * t&) +{{Cl|FOR...NEXT|FOR}} t& = 0 {{Cl|TO}} 359 + STAB(t&) = {{Cl|SIN}}((6.282 / 360) * t&) + CTAB(t&) = {{Cl|COS}}((6.282 / 360) * t&) {{Cl|NEXT}} ' ' BUILD CUBE IN OBJECT ARRAY @@ -437,11 +439,11 @@ PLANECOL(5) = 8 {{Cl|_TITLE}} "QB64 {{Cl|_MAPTRIANGLE}} CUBE DEMO" {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(800, 600, 32) -TextureImage& = {{Cl|_LOADIMAGE}}("qb64_trans.png", 32) 'any 24/32 bit image -{{Cl|_SETALPHA}} 128, , TextureImage& -TextureImage& = {{Cl|_COPYIMAGE}}(TextureImage&, 33)'copy of hardware image +TextureImage& = {{Cl|_LOADIMAGE}}("qb64_trans.png", 32) 'any 24/32 bit image +{{Cl|_SETALPHA}} 128, , TextureImage& +TextureImage& = {{Cl|_COPYIMAGE}}(TextureImage&, 33)'copy of hardware image -'{{Cl|_PUTIMAGE}} , Image& +'{{Cl|_PUTIMAGE}} , Image& DO @@ -451,74 +453,74 @@ DO '{{Cl|CLS}} , {{Cl|_RGB}}(0, 0, 160) ' CALCULATE POSITION OF NEW IMAGE - {{Cl|FOR...NEXT|FOR}} OB& = 0 {{Cl|TO}} 0 ' UP {{Cl|TO}} 9 OBJECTS - SP = STAB(PIT(OB&)): CP = CTAB(PIT(OB&)) - SY = STAB(YAW(OB&)): CY = CTAB(YAW(OB&)) - SR = STAB(ROL(OB&)): CR = CTAB(ROL(OB&)) - {{Cl|FOR...NEXT|FOR}} PL& = 0 {{Cl|TO}} 5 ' CONSISTING OF UP {{Cl|TO}} 9 PLANES + {{Cl|FOR...NEXT|FOR}} OB& = 0 {{Cl|TO}} 0 ' UP {{Cl|TO}} 9 OBJECTS + SP = STAB(PIT(OB&)): CP = CTAB(PIT(OB&)) + SY = STAB(YAW(OB&)): CY = CTAB(YAW(OB&)) + SR = STAB(ROL(OB&)): CR = CTAB(ROL(OB&)) + {{Cl|FOR...NEXT|FOR}} PL& = 0 {{Cl|TO}} 5 ' CONSISTING OF UP {{Cl|TO}} 9 PLANES ' - {{Cl|FOR...NEXT|FOR}} PN& = 0 {{Cl|TO}} 3 ' EACH PLANE WITH UP {{Cl|TO}} 4 {{Cl|POINT}}S (#5 {{Cl|TO}} {{Cl|PAINT}}) + {{Cl|FOR...NEXT|FOR}} PN& = 0 {{Cl|TO}} 3 ' EACH PLANE WITH UP {{Cl|TO}} 4 {{Cl|POINT}}S (#5 {{Cl|TO}} {{Cl|PAINT}}) ' ' TRANSLATE, {{Cl|THEN}} ROTATE - TX& = OBJECT(OB&, PL&, PN&, 0) - TY& = OBJECT(OB&, PL&, PN&, 1) - TZ& = OBJECT(OB&, PL&, PN&, 2) - RX& = (TZ& * CP - TY& * SP) * SY - ((TZ& * SP + TY& * CP) * SR + TX& * CR) * CY - RY& = (TZ& * SP + TY& * CP) * CR - TX& * SR - RZ& = (TZ& * CP - TY& * SP) * CY + ((TZ& * SP + TY& * CP) * SR + TX& * CR) * SY + TX& = OBJECT(OB&, PL&, PN&, 0) + TY& = OBJECT(OB&, PL&, PN&, 1) + TZ& = OBJECT(OB&, PL&, PN&, 2) + RX& = (TZ& * CP - TY& * SP) * SY - ((TZ& * SP + TY& * CP) * SR + TX& * CR) * CY + RY& = (TZ& * SP + TY& * CP) * CR - TX& * SR + RZ& = (TZ& * CP - TY& * SP) * CY + ((TZ& * SP + TY& * CP) * SR + TX& * CR) * SY ' ' ROTATE, {{Cl|THEN}} TRANSLATE - RX& = RX& + MX& - RY& = RY& + MY& - RZ& = RZ& + MZ& + RX& = RX& + MX& + RY& = RY& + MY& + RZ& = RZ& + MZ& ' - DPLANE3D(PN&, 0) = RX&: DPLANE3D(PN&, 1) = RY&: DPLANE3D(PN&, 2) = RZ& - DPLANE2D(PN&, 0) = 399 + (D& * RX& / RZ&) - DPLANE2D(PN&, 1) = 299 + (D& * RY& / RZ&) + DPLANE3D(PN&, 0) = RX&: DPLANE3D(PN&, 1) = RY&: DPLANE3D(PN&, 2) = RZ& + DPLANE2D(PN&, 0) = 399 + (D& * RX& / RZ&) + DPLANE2D(PN&, 1) = 299 + (D& * RY& / RZ&) {{Cl|NEXT}} ' ' CHECK {{Cl|TO}} SEE {{Cl|IF...THEN|IF}} PLANE {{Cl|IS}} VISIBLE - x1& = DPLANE3D(0, 0): y1& = DPLANE3D(0, 1): Z1& = DPLANE3D(0, 2) - x2& = DPLANE3D(1, 0): y2& = DPLANE3D(1, 1): Z2& = DPLANE3D(1, 2) - x3& = DPLANE3D(2, 0): y3& = DPLANE3D(2, 1): Z3& = DPLANE3D(2, 2) - T1& = -x1& * (y2& * Z3& - y3& * Z2&) - T2& = x2& * (y3& * Z1& - y1& * Z3&) - T3& = x3& * (y1& * Z2& - y2& * Z1&) + x1& = DPLANE3D(0, 0): y1& = DPLANE3D(0, 1): Z1& = DPLANE3D(0, 2) + x2& = DPLANE3D(1, 0): y2& = DPLANE3D(1, 1): Z2& = DPLANE3D(1, 2) + x3& = DPLANE3D(2, 0): y3& = DPLANE3D(2, 1): Z3& = DPLANE3D(2, 2) + T1& = -x1& * (y2& * Z3& - y3& * Z2&) + T2& = x2& * (y3& * Z1& - y1& * Z3&) + T3& = x3& * (y1& * Z2& - y2& * Z1&) ' - VISIBLE& = T1& - T2& - T3& - {{Cl|IF...THEN|IF}} VISIBLE& > 0 {{Cl|THEN}} + VISIBLE& = T1& - T2& - T3& + {{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) xx3% = DPLANE2D(2, 0): yy3% = DPLANE2D(2, 1) - col% = PLANECOL(PL&) + col% = PLANECOL(PL&) - {{Cl|_BLEND}} TextureImage& - {{Cl|_MAPTRIANGLE}} (0, 0)-(0, 255)-(255, 255), TextureImage& TO(xx1%, yy1%)-(xx2%, yy2%)-(xx3%, yy3%) + {{Cl|_BLEND}} TextureImage& + {{Cl|_MAPTRIANGLE}} (0, 0)-(0, 255)-(255, 255), TextureImage& TO(xx1%, yy1%)-(xx2%, yy2%)-(xx3%, yy3%) ' {{Cl|CALL}} DrawTriangle(xx1%, yy1%, xx2%, yy2%, xx3%, yy3%, col%) 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|_DONTBLEND}} TextureImage& - {{Cl|_MAPTRIANGLE}} (0, 0)-(255, 255)-(255, 0), TextureImage& TO(xx3%, yy3%)-(xx1%, yy1%)-(xx4%, yy4%), , _SMOOTH + {{Cl|_DONTBLEND}} TextureImage& + {{Cl|_MAPTRIANGLE}} (0, 0)-(255, 255)-(255, 0), TextureImage& TO(xx3%, yy3%)-(xx1%, yy1%)-(xx4%, yy4%), , _SMOOTH '{{Cl|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 - YAW(OB&) = YAW(OB&) + 7 - {{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 + PIT(OB&) = PIT(OB&) + 5 + {{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 + ROL(OB&) = ROL(OB&) + 9 + {{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$}} @@ -527,17 +529,17 @@ DO ' ' 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|DEF SEG}} = {{Cl|&H}}A000 '{{Cl|IF...THEN|IF}} fromx% > tox% {{Cl|THEN}} {{Cl|SWAP}} fromx%, tox% -'yyy& = yy% -'sloc& = yyy& * 320 + fromx% -'eloc& = sloc& + (tox% - fromx%) -'{{Cl|FOR...NEXT|FOR}} t& = sloc& {{Cl|TO}} eloc& -' {{Cl|POKE}} t&, col% +'yyy& = yy% +'sloc& = yyy& * 320 + fromx% +'eloc& = sloc& + (tox% - fromx%) +'{{Cl|FOR...NEXT|FOR}} t& = sloc& {{Cl|TO}} eloc& +' {{Cl|POKE}} t&, col% '{{Cl|NEXT}} '{{Cl|DEF SEG}} {{Cl|LINE}} (fromx%, yy%)-(tox%, yy%), {{Cl|_RGB}}(255, 255, 255) 'col% @@ -562,12 +564,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 @@ -585,12 +587,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 @@ -608,12 +610,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 @@ -630,12 +632,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 @@ -655,7 +657,7 @@ DO ''Example 4:'' Using a desktop image with _MAPTRIANGLE _ANTICLOCKWISE rendering. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(800, 600, 32) ss32 = {{Cl|_SCREENIMAGE}} 'take a 32bit software screenshot @@ -690,7 +692,7 @@ DO {{Cl|_LIMIT}} 30 {{Cl|_DISPLAY}} -{{Cl|LOOP}} '' '' +{{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. @@ -705,4 +707,4 @@ DO {{PageNavigation}} -< + diff --git a/internal/help/_MAPUNICODE_(function).txt b/internal/help/_MAPUNICODE_(function)__1111111111_(00000000).txt similarity index 78% rename from internal/help/_MAPUNICODE_(function).txt rename to internal/help/_MAPUNICODE_(function)__1111111111_(00000000).txt index 91791cfa7..b32ac253a 100644 --- a/internal/help/_MAPUNICODE_(function).txt +++ b/internal/help/_MAPUNICODE_(function)__1111111111_(00000000).txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:03}} {{DISPLAYTITLE:_MAPUNICODE (function)}} The [[_MAPUNICODE]] function returns the [[Unicode]] (UTF-32) code point value of a mapped [[ASCII]] character code. {{PageSyntax}} -: {{Parameter|utfValue&}} = [[_MAPUNICODE]]({{Parameter|asciiCode%}}) +: {{Parameter|utfValue&}} = [[_MAPUNICODE]]({{Parameter|asciiCode%}}) {{PageDescription}} @@ -16,13 +18,13 @@ The [[_MAPUNICODE]] function returns the [[Unicode]] (UTF-32) code point value o {{PageExamples}} ''Example:'' Store function return values in an array for ASCII codes 0 to 255 to restore them later. {{CodeStart}} -{{Cl|DIM}} Unicode&(255) +{{Cl|DIM}} Unicode&(255) {{Cl|SCREEN (statement)|SCREEN}} 0 {{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 -{{Cl|PRINT}} Unicode&(ascii); 'display values in demo +Unicode&(ascii) = {{Cl|_MAPUNICODE (function)|_MAPUNICODE}}(ascii) 'read Unicode values +{{Cl|PRINT}} Unicode&(ascii); 'display values in demo {{Cl|NEXT}} 'rest of program {{Cl|END}} @@ -37,4 +39,4 @@ Unicode&(ascii) = {{Cl|_MAPUNICODE (function)|_MAPUNICODE}}(ascii) 'read {{PageNavigation}} -< + diff --git a/internal/help/_MAPUNICODE.txt b/internal/help/_MAPUNICODE__1111111111.txt similarity index 89% rename from internal/help/_MAPUNICODE.txt rename to internal/help/_MAPUNICODE__1111111111.txt index 577b542ab..08ff08ffd 100644 --- a/internal/help/_MAPUNICODE.txt +++ b/internal/help/_MAPUNICODE__1111111111.txt @@ -1,13 +1,15 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:02}} {{DISPLAYTITLE:_MAPUNICODE}} The [[_MAPUNICODE]] statement maps a [[Unicode]] value to an [[ASCII]] character code value. {{PageSyntax}} -: [[_MAPUNICODE]] {{Parameter|unicode&}} '''TO''' {{Parameter|asciiCode%}} +: [[_MAPUNICODE]] {{Parameter|unicode&}} '''TO''' {{Parameter|asciiCode%}} -* The [[LONG]] {{Parameter|unicode&}} value is a [[HEX$|hexadecimal]] or decimal code value from a [[Unicode]] [[Code Pages|Code Page]]. +* The [[LONG]] {{Parameter|unicode&}} value is a [[HEX$|hexadecimal]] or decimal code value from a [[Unicode]] [[Code Pages|Code Page]]. * The {{Parameter|asciiCode%}} [[INTEGER]] parameter is any [[ASCII]] or Extended code value from 0 to 255. * Use the Unicode Page Table values listed here: [http://en.wikipedia.org/wiki/Category:DOS_code_pages DOS Code Pages] or [http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/ Windows Mapping] * Once the codes are mapped, key entries will display the unicode character in the '''monospace ''' [[_FONT|font]] selected. @@ -17,7 +19,7 @@ The [[_MAPUNICODE]] statement maps a [[Unicode]] value to an [[ASCII]] character {{PageExamples}} ''Example:'' Converting the extended [[ASCII]] characters to other characters using DATA from the Unicode [[Code Pages]]. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 0 {{Cl|_FONT}} {{Cl|_LOADFONT}}("C:\windows\fonts\cour.ttf", 20, "MONOSPACE") @@ -43,7 +45,7 @@ Microsoft_pc_cpMIK: {{Cl|DATA}} 9492,9524,9516,9500,9472,9532,9571,9553,9562,9566,9577,9574,9568,9552,9580,9488 {{Cl|DATA}} 9617,9618,9619,9474,9508,8470,167,9559,9565,9496,9484,9608,9604,9612,9616,9600 {{Cl|DATA}} 945,223,915,960,931,963,181,964,934,920,937,948,8734,966,949,8745 -{{Cl|DATA}} 8801,177,8805,8804,8992,8993,247,8776,176,8729,183,8730,8319,178,9632,160 '' '' +{{Cl|DATA}} 8801,177,8805,8804,8992,8993,247,8776,176,8729,183,8730,8319,178,9632,160 {{CodeEnd}} : ''Note:'' The Unicode data field is created by adding DATA before each line listed for the appropriate [[Code Pages|Code Page]]. @@ -59,4 +61,4 @@ Microsoft_pc_cpMIK: {{PageNavigation}} -< + diff --git a/internal/help/_MEMCOPY.txt b/internal/help/_MEMCOPY__1111111.txt similarity index 96% rename from internal/help/_MEMCOPY.txt rename to internal/help/_MEMCOPY__1111111.txt index 58bfef3a0..a3af87a25 100644 --- a/internal/help/_MEMCOPY.txt +++ b/internal/help/_MEMCOPY__1111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:07}} {{DISPLAYTITLE:_MEMCOPY}} The [[_MEMCOPY]] statement copies a block of bytes from one memory offset to another offset in memory. @@ -23,7 +25,7 @@ The [[_MEMCOPY]] statement copies a block of bytes from one memory offset to ano {{PageExamples}} ''Example:'' Swapping data from one [[STRING]] variable to another. Fixed length strings are recommended for speed. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DIM}} m {{Cl|AS}} {{Cl|_MEM}} {{Cl|DIM}} n {{Cl|AS}} {{Cl|_MEM}} @@ -41,12 +43,12 @@ s$ = {{Cl|SPACE$}}(10) 'to load into a variable length string set its length fir b$ = {{Cl|SPACE$}}(10) {{Cl|_MEMGET}} n, n.OFFSET, b$ {{Cl|PRINT}} "out:[" + b$ + "]" -{{Cl|_MEMFREE}} m: {{Cl|_MEMFREE}} n 'always clear the memory when done '' '' +{{Cl|_MEMFREE}} m: {{Cl|_MEMFREE}} n 'always clear the memory when done {{CodeEnd}} ''Snippet:'' Instead of copying each array element, one at a time in nested [[FOR...NEXT|FOR]] loops, _MEMCOPY does it in one statement instantly. -{{TextStart}} '' '' +{{TextStart}} 'copy array a to array b one index at a time: {{Cb|FOR...NEXT|FOR}} i1 = 0 {{Cb|TO}} 100 {{Cb|FOR...NEXT|FOR}} i2 = 0 {{Cb|TO}} 100 @@ -58,7 +60,7 @@ b$ = {{Cl|SPACE$}}(10) {{Cb|DIM}} ma {{Cl|AS}} {{Cb|_MEM}}: ma = {{Cb|_MEM (function)|_MEM}}(a()) 'place array data into blocks {{Cb|DIM}} mb {{Cl|AS}} {{Cb|_MEM}}: mb = {{Cb|_MEM (function)|_MEM}}(b()) {{Cb|_MEMCOPY}} ma, ma.OFFSET, ma.SIZE {{Cb|TO}} mb, mb.OFFSET -{{Cb|_MEMFREE}} ma: {{Cb|_MEMFREE}} mb 'clear the memory when done '' '' +{{Cb|_MEMFREE}} ma: {{Cb|_MEMFREE}} mb 'clear the memory when done {{TextEnd}} @@ -71,4 +73,4 @@ b$ = {{Cl|SPACE$}}(10) {{PageNavigation}} -< + diff --git a/internal/help/_MEMELEMENT.txt b/internal/help/_MEMELEMENT__1111111111.txt similarity index 95% rename from internal/help/_MEMELEMENT.txt rename to internal/help/_MEMELEMENT__1111111111.txt index 6991e40af..682319f87 100644 --- a/internal/help/_MEMELEMENT.txt +++ b/internal/help/_MEMELEMENT__1111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:08}} {{DISPLAYTITLE:_MEMELEMENT}} The [[_MEMELEMENT]] function returns a [[_MEM]] block referring to a variable's memory, but not past it. @@ -48,12 +50,12 @@ 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> +
'''Note: [[_MEM]] and [[_OFFSET]] values cannot be cast to other variable types.'''
{{PageExamples}} ''Example:'' Comparing the specifications returned by [[_MEM]] and _MEMELEMENT from an array. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DIM}} a(1 {{Cl|TO}} 100) {{Cl|AS}} {{Cl|_UNSIGNED}} {{Cl|_BYTE}} {{Cl|DIM}} m1 {{Cl|AS}} {{Cl|_MEM}} @@ -65,7 +67,7 @@ m1 = {{Cl|_MEM (function)|_MEM}}(a(50)) 'function returns information about arra m2 = {{Cl|_MEMELEMENT}}(a(50)) 'function returns information about the specific element {{Cl|PRINT}} m2.OFFSET, m2.SIZE, m2.TYPE, m2.ELEMENTSIZE -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} : Output using VERSION .954 ONLY .TYPE values: 1 (integer) + 2 (unsigned) {{OutputStart}}28377205 51 3 1 @@ -83,4 +85,4 @@ m2 = {{Cl|_MEMELEMENT}}(a(50)) 'function returns information about the specific {{PageNavigation}} -< + diff --git a/internal/help/_MEMEXISTS.txt b/internal/help/_MEMEXISTS__111111111.txt similarity index 94% rename from internal/help/_MEMEXISTS.txt rename to internal/help/_MEMEXISTS__111111111.txt index 6a8c040fc..623394725 100644 --- a/internal/help/_MEMEXISTS.txt +++ b/internal/help/_MEMEXISTS__111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:09}} {{DISPLAYTITLE:_MEMEXISTS}} The [[_MEMEXISTS]] function returns true (-1) if the memory block variable name specified exists in memory and false (0) if it does not. @@ -21,4 +23,4 @@ The [[_MEMEXISTS]] function returns true (-1) if the memory block variable name {{PageNavigation}} -< + diff --git a/internal/help/_MEMFILL.txt b/internal/help/_MEMFILL__1111111.txt similarity index 95% rename from internal/help/_MEMFILL.txt rename to internal/help/_MEMFILL__1111111.txt index 3692116bf..ae4d99beb 100644 --- a/internal/help/_MEMFILL.txt +++ b/internal/help/_MEMFILL__1111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:11}} {{DISPLAYTITLE:_MEMFILL}} The [[_MEMFILL]] statement converts a value to a specified type, then fills memory with that type including any non-whole remainder. @@ -20,7 +22,7 @@ The [[_MEMFILL]] statement converts a value to a specified type, then fills memo {{PageExamples}} ''Example:'' Filling array values quickly using FOR loops or a simple memory fill. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DIM}} a(100, 100) {{Cl|AS}} {{Cl|LONG}} {{Cl|DIM}} b(100, 100) {{Cl|AS}} {{Cl|LONG}} @@ -35,7 +37,7 @@ The [[_MEMFILL]] statement converts a value to a specified type, then fills memo {{Cl|DIM}} mema {{Cl|AS}} {{Cl|_MEM}} mema = {{Cl|_MEM (function)|_MEM}}(b()) {{Cl|_MEMFILL}} mema, mema.OFFSET, mema.SIZE, 13 {{Cl|AS}} {{Cl|LONG}} -{{Cl|_MEMFREE}} mema '' '' +{{Cl|_MEMFREE}} mema {{CodeEnd}} @@ -46,4 +48,4 @@ mema = {{Cl|_MEM (function)|_MEM}}(b()) {{PageNavigation}} -< + diff --git a/internal/help/_MEMFREE.txt b/internal/help/_MEMFREE__1111111.txt similarity index 94% rename from internal/help/_MEMFREE.txt rename to internal/help/_MEMFREE__1111111.txt index 99aa5ffa9..5b27952e6 100644 --- a/internal/help/_MEMFREE.txt +++ b/internal/help/_MEMFREE__1111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:12}} {{DISPLAYTITLE:_MEMFREE}} The [[_MEMFREE]] statement frees the designated memory block [[_MEM]] value and must be used with all memory functions. @@ -25,4 +27,4 @@ The [[_MEMFREE]] statement frees the designated memory block [[_MEM]] value and {{PageNavigation}} -< + diff --git a/internal/help/_MEMGET_(function).txt b/internal/help/_MEMGET_(function)__111111_(00000000).txt similarity index 91% rename from internal/help/_MEMGET_(function).txt rename to internal/help/_MEMGET_(function)__111111_(00000000).txt index 89b606a14..f7e1daf09 100644 --- a/internal/help/_MEMGET_(function).txt +++ b/internal/help/_MEMGET_(function)__111111_(00000000).txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:14}} {{DISPLAYTITLE:_MEMGET (function)}} The [[_MEMGET]] function returns a value from a specific memory block name at the specified OFFSET using a certain variable type. @@ -23,13 +25,13 @@ The [[_MEMGET]] function returns a value from a specific memory block name at th {{PageExamples}} ''Example:'' [[DEF SEG]] and [[VARPTR]] are no longer necessary to do things in memory just like [[POKE]] and [[PEEK]] do. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DIM}} o {{Cl|AS}} {{Cl|_MEM}} -o = {{Cl|_MEM (function)|_MEM}}(d&) 'OLD... o% = VARPTR(d&) +o = {{Cl|_MEM (function)|_MEM}}(d&) 'OLD... o% = VARPTR(d&) {{Cl|_MEMPUT}} o, o.OFFSET + 1, 3 {{Cl|AS}} {{Cl|_UNSIGNED}} {{Cl|_BYTE}} 'a POKE v = {{Cl|_MEMGET (function)|_MEMGET}}(o, o.OFFSET + 1, {{Cl|_UNSIGNED}} {{Cl|_BYTE}}) 'a PEEK {{Cl|PRINT}} v 'prints 3 -{{Cl|PRINT}} d& 'prints 768 because the 2nd byte of d& has been set to 3 or 3 * 256 +{{Cl|PRINT}} d& 'prints 768 because the 2nd byte of d& has been set to 3 or 3 * 256 {{Cl|_MEMFREE}} o {{CodeEnd}} :''Explanation:'' The memory block and OFFSET are given by [[_MEMPUT]] and the _MEMGET function, with the designated type. @@ -43,4 +45,4 @@ v = {{Cl|_MEMGET (function)|_MEMGET}}(o, o.OFFSET + 1, {{Cl|_UNSIGNED}} {{Cl|_BY {{PageNavigation}} -< + diff --git a/internal/help/_MEMGET.txt b/internal/help/_MEMGET__111111.txt similarity index 96% rename from internal/help/_MEMGET.txt rename to internal/help/_MEMGET__111111.txt index 326001b3a..1636ed5e2 100644 --- a/internal/help/_MEMGET.txt +++ b/internal/help/_MEMGET__111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:13}} {{DISPLAYTITLE:_MEMGET}} The [[_MEMGET]] statement reads a portion of a memory block at an OFFSET position into a variable, array or user defined type. @@ -21,7 +23,7 @@ The [[_MEMGET]] statement reads a portion of a memory block at an OFFSET positio {{PageExamples]] ''Example:'' Shows how to read the PSET color values from a program's [[SCREEN]] memory to an array. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 13 {{Cl|PSET}} (0, 0), 123 {{Cl|PSET}} (1, 0), 222 'create screen image @@ -37,7 +39,7 @@ m = {{Cl|_MEMIMAGE}} '0 or no handle necessary when accessing the current progr 'here's the proof {{Cl|PRINT}} screen_array(0, 0) 'print 123 {{Cl|PRINT}} screen_array(1, 0) 'print 222 -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} @@ -50,4 +52,4 @@ m = {{Cl|_MEMIMAGE}} '0 or no handle necessary when accessing the current progr {{PageNavigation}} -< + diff --git a/internal/help/_MEMIMAGE.txt b/internal/help/_MEMIMAGE__11111111.txt similarity index 84% rename from internal/help/_MEMIMAGE.txt rename to internal/help/_MEMIMAGE__11111111.txt index fa043ecc5..f59982753 100644 --- a/internal/help/_MEMIMAGE.txt +++ b/internal/help/_MEMIMAGE__11111111.txt @@ -1,14 +1,16 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:16}} {{DISPLAYTITLE:_MEMIMAGE}} The [[_MEMIMAGE]] function returns a [[_MEM]] value referring to an image's memory using a designated image handle. {{PageSyntax}} -: {{Parameter|imageBlock}} = [[_MEMIMAGE]][({{Parameter|imageHandle&}})] +: {{Parameter|imageBlock}} = [[_MEMIMAGE]][({{Parameter|imageHandle&}})] {{Parameters}} * The {{Parameter|imageBlock}} [[_MEM]] type variable holds the read-only elements .OFFSET, .SIZE, .TYPE and .ELEMENTSIZE. -* If the optional {{Parameter|imageHandle&}} isn't passed, it is assumed to be the current [[_DEST]]ination program screen image. +* If the optional {{Parameter|imageHandle&}} isn't passed, it is assumed to be the current [[_DEST]]ination program screen image. {{PageDescription}} @@ -19,20 +21,20 @@ The [[_MEMIMAGE]] function returns a [[_MEM]] value referring to an image's memo {{PageExamples}} ''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}} '' '' +{{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&) - DarkenImage i2&, n! - {{Cl|_PUTIMAGE}} (0, 0), i2& - {{Cl|_FREEIMAGE}} i2& + i2& = {{Cl|_COPYIMAGE}}(i&) + DarkenImage i2&, n! + {{Cl|_PUTIMAGE}} (0, 0), i2& + {{Cl|_FREEIMAGE}} i2& {{Cl|_DISPLAY}} {{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}} @@ -49,13 +51,13 @@ DO 'turn checking back on when done! {{Cl|$CHECKING}}:ON {{Cl|_MEMFREE}} Buffer -{{Cl|END SUB}} '' '' +{{Cl|END SUB}} {{CodeEnd}}{{small|Code by Galleon}} : ''Explanation:'' The second value passed to DarkenImage is a value from 0.0 to 1.0 where 0.0 is full darkness and 1 is none. ''Example 2:'' Reading information stored in an image with [[_MEMIMAGE]] to print [[ASC]] text characters to the screen. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 13 {{Cl|_FULLSCREEN}} {{Cl|PSET}} (0, 0), {{Cl|ASC}}("H") @@ -75,7 +77,7 @@ x1$ = {{Cl|_MEMGET (function)|_MEMGET}}(m, m.OFFSET, {{Cl|STRING}} * 11) 'conver {{Cl|_MEMFREE}} m 'free memory when done {{Cl|LOCATE}} 10, 1: {{Cl|PRINT}} {{Cl|LEN}}(x1$) 'prints 11 as byte length {{Cl|PRINT}} x1$ 'prints HELLO WORLD -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} : ''Notes:'' The colors in the upper left corner are the text data used. An image could hold a hidden text message this way. @@ -89,4 +91,4 @@ x1$ = {{Cl|_MEMGET (function)|_MEMGET}}(m, m.OFFSET, {{Cl|STRING}} * 11) 'conver {{PageNavigation}} -< + diff --git a/internal/help/_MEMNEW.txt b/internal/help/_MEMNEW__111111.txt similarity index 95% rename from internal/help/_MEMNEW.txt rename to internal/help/_MEMNEW__111111.txt index 4eebdd448..d81cca6f2 100644 --- a/internal/help/_MEMNEW.txt +++ b/internal/help/_MEMNEW__111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:17}} {{DISPLAYTITLE:_MEMNEW}} The [[_MEMNEW]] function allocates new memory and returns a [[_MEM]] memory block referring to it. @@ -21,7 +23,7 @@ The [[_MEMNEW]] function allocates new memory and returns a [[_MEM]] memory bloc {{PageExamples}} ''Example:'' Shows how [[SINGLE]] numerical values can be passed, but non-fixed [[STRING]] lengths cannot get the value. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DIM}} m {{Cl|AS}} {{Cl|_MEM}} {{Cl|DIM}} f {{Cl|AS}} {{Cl|STRING}} * 5 m = {{Cl|_MEMNEW}}(5) 'create new memory block of 5 bytes @@ -36,7 +38,7 @@ c$ = "Doggy" 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}} "f = "; f; {{Cl|LEN}}(f) {{CodeEnd}} {{OutputStart}}b = 12345.6 d$ = 0 @@ -52,4 +54,4 @@ f = Doggy 5 {{OutputEnd}} {{PageNavigation}} -< + diff --git a/internal/help/_MEMPUT.txt b/internal/help/_MEMPUT__111111.txt similarity index 91% rename from internal/help/_MEMPUT.txt rename to internal/help/_MEMPUT__111111.txt index 012e68367..4723affe2 100644 --- a/internal/help/_MEMPUT.txt +++ b/internal/help/_MEMPUT__111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:18}} {{DISPLAYTITLE:_MEMPUT}} The [[_MEMPUT]] statement writes data to a portion of a designated memory block at an [[OFFSET]] position. @@ -23,13 +25,13 @@ The [[_MEMPUT]] statement writes data to a portion of a designated memory block {{PageDescription}} ''Example:'' _MEMPUT can be used just like [[POKE]] without [[DEF SEG]]. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DIM}} o {{Cl|AS}} {{Cl|_MEM}} -o = {{Cl|_MEM (function)|_MEM}}(d&) +o = {{Cl|_MEM (function)|_MEM}}(d&) {{Cl|_MEMPUT}} o, o.OFFSET + 1, 3 {{Cl|AS}} {{Cl|_UNSIGNED}} {{Cl|_BYTE}} 'POKE v = {{Cl|_MEMGET (function)|_MEMGET}}(o, o.OFFSET + 1, {{Cl|_UNSIGNED}} {{Cl|_BYTE}}) 'PEEK {{Cl|PRINT}} v 'prints 3 -{{Cl|PRINT}} d& 'print 768 because the 2nd byte of d& has been set to 3 or 3 * 256 '' '' +{{Cl|PRINT}} d& 'print 768 because the 2nd byte of d& has been set to 3 or 3 * 256 {{CodeEnd}} @@ -41,4 +43,4 @@ v = {{Cl|_MEMGET (function)|_MEMGET}}(o, o.OFFSET + 1, {{Cl|_UNSIGNED}} {{Cl|_BY {{PageNavigation}} -< + diff --git a/internal/help/_MEMSOUND.txt b/internal/help/_MEMSOUND.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_MEMSOUND.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_MEM_(function).txt b/internal/help/_MEM_(function)__111_(00000000).txt similarity index 96% rename from internal/help/_MEM_(function).txt rename to internal/help/_MEM_(function)__111_(00000000).txt index fbb70cc1b..de1edafb2 100644 --- a/internal/help/_MEM_(function).txt +++ b/internal/help/_MEM_(function)__111_(00000000).txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:04}} {{DISPLAYTITLE:_MEM (function)}} The [[_MEM]] function returns a _MEM block referring to the largest possible continuous memory region beginning at a variable's offset. @@ -23,7 +25,7 @@ The [[_MEM]] function returns a _MEM block referring to the largest possible con {{PageExamples}} ''Example:'' Assigning values to reference variables in memory. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DIM}} {{Cl|SHARED}} m(3) {{Cl|AS}} {{Cl|_MEM}} {{Cl|DIM}} {{Cl|SHARED}} Saved(3) @@ -55,7 +57,7 @@ Saved(3) = n3 {{Cl|_MEMPUT}} m(1), m(1).OFFSET, Saved(1) {{Cl|_MEMPUT}} m(2), m(2).OFFSET, Saved(2) {{Cl|_MEMPUT}} m(3), m(3).OFFSET, Saved(3) -{{Cl|END SUB}} '' '' +{{Cl|END SUB}} {{CodeEnd}}{{small|Code by SMcNeill}} @@ -68,4 +70,4 @@ Saved(3) = n3 {{PageNavigation}} -< + diff --git a/internal/help/_MEM.txt b/internal/help/_MEM__111.txt similarity index 93% rename from internal/help/_MEM.txt rename to internal/help/_MEM__111.txt index f8146a9ba..fd4a654b4 100644 --- a/internal/help/_MEM.txt +++ b/internal/help/_MEM__111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:05}} {{DISPLAYTITLE:_MEM}} The [[_MEM]] variable type can be used when working with memory blocks. It has no variable [[type]] suffix. @@ -79,12 +81,12 @@ t = m.{{Cl|TYPE}} {{Cl|PRINT}} "image height"; {{Cl|_HEIGHT}}(m.IMAGE) {{Cl|ELSE}} {{Cl|PRINT}} "Memory already freed!" {{Cl|END IF}} -{{Cl|END IF}} '' '' +{{Cl|END IF}} {{CodeEnd}} ''Example 2:'' Converts the current [[_DEST|destination]] [[SCREEN]] 13 image memory altered by [[PSET]] to a [[STRING]] value. SCREEN 13 only. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 13 {{Cl|PSET}} (0, 0), {{Cl|ASC}}("H") 'top left corner of screen {{Cl|PSET}} (1, 0), {{Cl|ASC}}("E") @@ -98,7 +100,7 @@ x1$ = {{Cl|_MEMGET (function)|_MEMGET}}(m, m.OFFSET, {{Cl|STRING}} * 5) 'get at {{Cl|LOCATE}} 2, 1:{{Cl|PRINT}} {{Cl|LEN}}(x1$) 'prints 5 bytes as size is STRING * 5 {{Cl|PRINT}} x1$ 'prints HELLO as ASCII character values {{Cl|PRINT}} m.OFFSET; m.SIZE; m.ELEMENTSIZE -{{Cl|_MEMFREE}} m '' '' +{{Cl|_MEMFREE}} m {{CodeEnd}} {{OutputStart}} 5 @@ -111,7 +113,7 @@ HELLO {{WhiteEnd}} ''Example 3:'' Using _MEM to convert _OFFSET to _INTEGER64. -{{CodeStart}} '' '' +{{CodeStart}} DIM x AS INTEGER DIM m AS _MEM m = _MEM(x) @@ -119,17 +121,17 @@ PRINT m.OFFSET PRINT ConvertOffset(m.OFFSET) -FUNCTION ConvertOffset&& (value AS _OFFSET) +FUNCTION ConvertOffset&& (value AS _OFFSET) $CHECKING:OFF DIM m AS _MEM 'Define a memblock m = _MEM(value) 'Point it to use value $IF 64BIT THEN 'On 64 bit OSes, an OFFSET is 8 bytes in size. We can put it directly into an Integer64 - _MEMGET m, m.OFFSET, ConvertOffset&& 'Get the contents of the memblock and put the values there directly into ConvertOffset&& + _MEMGET m, m.OFFSET, ConvertOffset&& 'Get the contents of the memblock and put the values there directly into ConvertOffset&& $ELSE 'However, on 32 bit OSes, an OFFSET is only 4 bytes. We need to put it into a LONG variable first - _MEMGET m, m.OFFSET, temp& 'Like this - ConvertOffset&& = temp& 'And then assign that long value to ConvertOffset&& + _MEMGET m, m.OFFSET, temp& 'Like this + ConvertOffset&& = temp& 'And then assign that long value to ConvertOffset&& $END IF _MEMFREE m 'Free the memblock $CHECKING:ON @@ -150,4 +152,4 @@ END FUNCTION {{PageNavigation}} -< + diff --git a/internal/help/_MK$.txt b/internal/help/_MK$__11$.txt similarity index 96% rename from internal/help/_MK$.txt rename to internal/help/_MK$__11$.txt index 83c03680f..31946f30b 100644 --- a/internal/help/_MK$.txt +++ b/internal/help/_MK$__11$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:21}} {{DISPLAYTITLE:_MK$}}{{DISPLAYTITLE:}} The [[_MK$]] function can convert any numerical type into an [[ASCII]] [[STRING]] value that can be converted back using [[_CV]]. @@ -29,4 +31,4 @@ The [[_MK$]] function can convert any numerical type into an [[ASCII]] [[STRING] {{PageNavigation}}{{DISPLAYTITLE:}} -< + diff --git a/internal/help/_MOUSEBUTTON.txt b/internal/help/_MOUSEBUTTON__11111111111.txt similarity index 89% rename from internal/help/_MOUSEBUTTON.txt rename to internal/help/_MOUSEBUTTON__11111111111.txt index 42a3c8f86..90418d4d2 100644 --- a/internal/help/_MOUSEBUTTON.txt +++ b/internal/help/_MOUSEBUTTON__11111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:22}} {{DISPLAYTITLE:_MOUSEBUTTON}} The [[_MOUSEBUTTON]] function returns the button status of a specified mouse button when read after [[_MOUSEINPUT]]. @@ -24,17 +26,17 @@ The [[_MOUSEBUTTON]] function returns the button status of a specified mouse but {{PageExamples}} ''Example 1:'' Finding the number of mouse buttons available in QB64. This could also be used for other controller devices. -{{CodeStart}} '' '' +{{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|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}} '' '' +{{CodeStart}} {{Cl|PRINT}} "Hold down the left mouse button until you want to quit!" DO i = {{Cl|_MOUSEINPUT}} ' read #1 @@ -44,12 +46,12 @@ DO 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}} ''Example 3:'' Checking for a click or a double-click by the user. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DO...LOOP|DO}} 'main program loop {{Cl|DO...LOOP|DO}} {{Cl|WHILE}} {{Cl|_MOUSEINPUT}} 'check mouse status @@ -63,32 +65,32 @@ DO {{Cl|IF...THEN|IF}} Click = 1 {{Cl|THEN}} 'if button was pressed and released t = {{Cl|TIMER}} + .3 - {{Cl|DO...LOOP|DO}} {{Cl|WHILE}} {{Cl|TIMER}} < t 'check for a second press within .3 seconds + {{Cl|DO...LOOP|DO}} {{Cl|WHILE}} {{Cl|TIMER}} < t 'check for a second press within .3 seconds 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|END IF}} Click = 0: buttondown = 0 'reset where needed -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) '' '' +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) {{CodeEnd}} : ''Explanation:'' To find the current button status read [[_MOUSEINPUT]] repeatedly. The [[TIMER]] loop looks for a second click. ''Example 4:'' Verifying that a user clicked and released a mouse button on a program button. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 12 {{Cl|LINE}} (250, 250)-(300, 300), 14, BF {{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}} @@ -98,21 +100,21 @@ mi = {{Cl|_MOUSEINPUT}} b = {{Cl|_MOUSEBUTTON}}(1) x = {{Cl|_MOUSEX}} y = {{Cl|_MOUSEY}} -{{Cl|END SUB}} '' '' +{{Cl|END SUB}} {{CodeEnd}} : ''Explanation:'' The mouse SUB has no internal [[_MOUSEINPUT]] loop so that no button presses, releases or moves are missed. : If the above read procedure goes to another one, it may be advisable to skip over unread input in a [[_MOUSEINPUT]] only loop. {{TextStart}}{{Cb|SUB}} Catchup {{Cb|DO...LOOP|DO}} {{Cb|WHILE}} {{Cb|_MOUSEINPUT}}: {{Cb|LOOP }} -{{Cb|END SUB}} '' '' +{{Cb|END SUB}} {{TextEnd}} : The above procedure can be used to catch up after [[INPUT]], [[LINE INPUT]] or [[INPUT$]] delays when mouse input may accumulate. ''Example 5:'' Combining mouse button or keyboard selections in a menu or test: -{{CodeStart}} '' '' +{{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}} 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 @@ -156,7 +158,7 @@ y = {{Cl|_MOUSEY}} {{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 '' '' +{{Cl|LOOP}} 'DEMO only loop use red X box to quit {{CodeEnd}} {{small|Code by Ted Weissgerber}} : ''Explanation:'' User can cancel letter selection by moving pointer off letter before releasing the left mouse button. @@ -171,4 +173,4 @@ y = {{Cl|_MOUSEY}} {{PageNavigation}} -< + diff --git a/internal/help/_MOUSEHIDE.txt b/internal/help/_MOUSEHIDE__111111111.txt similarity index 81% rename from internal/help/_MOUSEHIDE.txt rename to internal/help/_MOUSEHIDE__111111111.txt index 88d5fa9bd..3f3d5eff5 100644 --- a/internal/help/_MOUSEHIDE.txt +++ b/internal/help/_MOUSEHIDE__111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:23}} {{DISPLAYTITLE:_MOUSEHIDE}} The [[_MOUSEHIDE]] statement hides the mouse cursor. @@ -13,4 +15,4 @@ The [[_MOUSEHIDE]] statement hides the mouse cursor. {{PageNavigation}} -< + diff --git a/internal/help/_MOUSEINPUT.txt b/internal/help/_MOUSEINPUT__1111111111.txt similarity index 90% rename from internal/help/_MOUSEINPUT.txt rename to internal/help/_MOUSEINPUT__1111111111.txt index a9d81270e..9abf42c53 100644 --- a/internal/help/_MOUSEINPUT.txt +++ b/internal/help/_MOUSEINPUT__1111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:25}} {{DISPLAYTITLE:_MOUSEINPUT}} The [[_MOUSEINPUT]] function is used to monitor any new mouse positions, button presses or movements of the scroll wheel. Must be called before other mouse information becomes available. @@ -15,18 +17,18 @@ The [[_MOUSEINPUT]] function is used to monitor any new mouse positions, button {{PageExamples}} ''Example 1:'' Mouse coordinate, click and scroll events are returned sequentially inside of a _MOUSEINPUT loop. -{{CodeStart}} '' '' +{{CodeStart}} 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. ''Example 2:'' How to use a _MOUSEINPUT loop to locate [[PSET]] positions on a screen using a right mouse button click. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 12 {{Cl|DO...LOOP|DO}} ' main program loop @@ -36,7 +38,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 @@ -46,7 +48,7 @@ DO ' your program code -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) '' '' +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) {{CodeEnd}} @@ -73,7 +75,7 @@ count = 0 count = count + 1 {{Cl|LOOP}} {{Cl|WHILE}} {{Cl|_MOUSEINPUT}} {{Cl|PRINT}} count 'returns the number of loops before mouse data is cleared -{{Cl|RETURN}} '' '' +{{Cl|RETURN}} {{CodeEnd}} :''Explanation:'' Click the mouse a few times while entering [[INPUT]] text. When Enter is pressed, the number of loops are displayed. @@ -85,4 +87,4 @@ count = 0 {{PageNavigation}} -< + diff --git a/internal/help/_MOUSEMOVEMENTX.txt b/internal/help/_MOUSEMOVEMENTX__11111111111111.txt similarity index 93% rename from internal/help/_MOUSEMOVEMENTX.txt rename to internal/help/_MOUSEMOVEMENTX__11111111111111.txt index 8fca624fb..a53ff9ad7 100644 --- a/internal/help/_MOUSEMOVEMENTX.txt +++ b/internal/help/_MOUSEMOVEMENTX__11111111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:27}} {{DISPLAYTITLE:_MOUSEMOVEMENTX}} The [[_MOUSEMOVEMENTX]] function returns the relative horizontal position of the mouse cursor as positive or negative values. @@ -14,7 +16,7 @@ The [[_MOUSEMOVEMENTX]] function returns the relative horizontal position of the {{PageExamples}} ''Example 1:'' Since values returned are relative to the last position, the returns can be positive or negative. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 12 PX = 320: PY = 240 'center position {{Cl|DO...LOOP|DO}}: {{Cl|_LIMIT}} 200 @@ -25,12 +27,12 @@ PX = 320: PY = 240 'center position {{Cl|CLS}} {{Cl|CIRCLE}} (PX, PY), 10, 10 {{Cl|LOCATE}} 1, 1: {{Cl|PRINT}} PX, PY -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) 'escape key exit '' '' +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) 'escape key exit {{CodeEnd}} ''Example 2:'' MOD is used to keep horizontal movement of the circle and cursor inside of the SCREEN 13 window(320). -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 13, , 1, 0 {{Cl|DO...LOOP|DO}}: {{Cl|_LIMIT}} 200 {{Cl|DO...LOOP|DO}} {{Cl|WHILE}} {{Cl|_MOUSEINPUT}} @@ -42,7 +44,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. @@ -58,4 +60,4 @@ PX = 320: PY = 240 'center position {{PageNavigation}} -< + diff --git a/internal/help/_MOUSEMOVEMENTY.txt b/internal/help/_MOUSEMOVEMENTY__11111111111111.txt similarity index 92% rename from internal/help/_MOUSEMOVEMENTY.txt rename to internal/help/_MOUSEMOVEMENTY__11111111111111.txt index a692754f8..4ad04dbf5 100644 --- a/internal/help/_MOUSEMOVEMENTY.txt +++ b/internal/help/_MOUSEMOVEMENTY__11111111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:28}} {{DISPLAYTITLE:_MOUSEMOVEMENTY}} The [[_MOUSEMOVEMENTY]] function returns the relative vertical position of the mouse cursor as positive or negative values. @@ -13,7 +15,7 @@ The [[_MOUSEMOVEMENTY]] function returns the relative vertical position of the m ''Example:'' MOD is used to keep vertical movement of circle and cursor inside of the SCREEN 13 window(200). -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 13, , 1, 0 {{Cl|DO...LOOP|DO}}: {{Cl|_LIMIT}} 200 {{Cl|DO...LOOP|DO}} {{Cl|WHILE}} {{Cl|_MOUSEINPUT}} @@ -25,7 +27,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. @@ -41,4 +43,4 @@ The [[_MOUSEMOVEMENTY]] function returns the relative vertical position of the m {{PageNavigation}} -< + diff --git a/internal/help/_MOUSEMOVE.txt b/internal/help/_MOUSEMOVE__111111111.txt similarity index 97% rename from internal/help/_MOUSEMOVE.txt rename to internal/help/_MOUSEMOVE__111111111.txt index bf012a60d..eb0c89aeb 100644 --- a/internal/help/_MOUSEMOVE.txt +++ b/internal/help/_MOUSEMOVE__111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:26}} {{DISPLAYTITLE:_MOUSEMOVE}} The [[_MOUSEMOVE]] statement moves the mouse pointer to a new position on the screen as determined by the column and row coordinates. @@ -39,7 +41,7 @@ DO: {{Cl|_LIMIT}} 30 {{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|PRINT}} "Done!" {{CodeEnd}} : ''Explanation:'' The [[_MOUSEINPUT]] function will hold previous and _MOUSEMOVE events so press any key when you want to quit. @@ -53,4 +55,4 @@ DO: {{Cl|_LIMIT}} 30 {{PageNavigation}} -< + diff --git a/internal/help/_MOUSEPIPEOPEN.txt b/internal/help/_MOUSEPIPEOPEN__1111111111111.txt similarity index 95% rename from internal/help/_MOUSEPIPEOPEN.txt rename to internal/help/_MOUSEPIPEOPEN__1111111111111.txt index 311a25365..099e83dd3 100644 --- a/internal/help/_MOUSEPIPEOPEN.txt +++ b/internal/help/_MOUSEPIPEOPEN__1111111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:30}} {{DISPLAYTITLE: _MOUSEPIPEOPEN}} The [[_MOUSEPIPEOPEN]] function creates a pipe handle value for a mouse when using a virtual keyboard. @@ -69,7 +71,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}} @@ -100,4 +102,4 @@ The [[_MOUSEPIPEOPEN]] function creates a pipe handle value for a mouse when usi {{PageNavigation}} -< + diff --git a/internal/help/_MOUSESHOW.txt b/internal/help/_MOUSESHOW__111111111.txt similarity index 66% rename from internal/help/_MOUSESHOW.txt rename to internal/help/_MOUSESHOW__111111111.txt index 7c641b48c..8a2599255 100644 --- a/internal/help/_MOUSESHOW.txt +++ b/internal/help/_MOUSESHOW__111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:31}} {{DISPLAYTITLE:_MOUSESHOW}} The [[_MOUSESHOW]] statement displays the mouse cursor and can change its shape. @@ -9,20 +11,20 @@ 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'''. ===QBasic/QuickBASIC=== -* _MOUSEHIDE statements do not accumulate like they did with [[ABSOLUTE]] or [[INTERRUPT]] in QBasic. +* _MOUSEHIDE statements do not accumulate like they did with [[CALL ABSOLUTE|ABSOLUTE]] or [[INTERRUPT]] in QBasic. {{PageExamples}} @@ -51,4 +53,4 @@ The [[_MOUSESHOW]] statement displays the mouse cursor and can change its shape. {{PageNavigation}} -< + diff --git a/internal/help/_MOUSEWHEEL.txt b/internal/help/_MOUSEWHEEL__1111111111.txt similarity index 83% rename from internal/help/_MOUSEWHEEL.txt rename to internal/help/_MOUSEWHEEL__1111111111.txt index 9ee5d8cc3..3c2f1e69c 100644 --- a/internal/help/_MOUSEWHEEL.txt +++ b/internal/help/_MOUSEWHEEL__1111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:32}} {{DISPLAYTITLE:_MOUSEWHEEL}} The [[_MOUSEWHEEL]] function returns a positive or negative [[INTEGER]] value indicating mouse scroll events since the last read of [[_MOUSEINPUT]]. @@ -14,18 +16,18 @@ The [[_MOUSEWHEEL]] function returns a positive or negative [[INTEGER]] value in {{PageExamples}} ''Example 1:'' Reading the cumulative mouse wheel "clicks". -{{CodeStart}} '' '' +{{CodeStart}} DO: {{Cl|_LIMIT}} 100 DO WHILE {{Cl|_MOUSEINPUT}} Scroll = Scroll + {{Cl|_MOUSEWHEEL}} LOCATE 10, 20: PRINT Scroll LOOP - LOOP UNTIL INKEY$ = CHR$(13) ' press Enter to quit '' '' + LOOP UNTIL INKEY$ = CHR$(13) ' press Enter to quit {{CodeEnd}} ''Example 2:'' A simple text scrolling routine using the mouse wheel value to read a text array. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DIM}} Array$(100) {{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 @@ -40,8 +42,8 @@ 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}} 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 +52,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> +
Note: You will need a text file that is large enough for this example.
{{PageSeeAlso}} @@ -64,4 +66,4 @@ DO {{PageNavigation}} -< + diff --git a/internal/help/_MOUSEX.txt b/internal/help/_MOUSEX__111111.txt similarity index 80% rename from internal/help/_MOUSEX.txt rename to internal/help/_MOUSEX__111111.txt index 9759d1176..af6aebf56 100644 --- a/internal/help/_MOUSEX.txt +++ b/internal/help/_MOUSEX__111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:33}} {{DISPLAYTITLE:_MOUSEX}} The [[_MOUSEX]] function returns the current horizontal (column) mouse cursor position when read after [[_MOUSEINPUT]]. @@ -14,12 +16,12 @@ The [[_MOUSEX]] function returns the current horizontal (column) mouse cursor po ==QBasic/QuickBASIC== -* In [[SCREEN]] 0, QBasic's [[ABSOLUTE]] returned graphic coordinates. QB64 mouse functions return the text coordinates. +* In [[SCREEN]] 0, QBasic's [[CALL ABSOLUTE|ABSOLUTE]] returned graphic coordinates. QB64 mouse functions return the text coordinates. {{PageExamples}} ''Example:'' A simple mouse drawing board using [[_MOUSEX]] and [[_MOUSEY]] coordinate values. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN (statement)|SCREEN}} 12 {{Cl|LINE}} (99, 9)-(601, 401), 7, BF {{Cl|LINE}} (101, 11)-(599, 399), 8, BF @@ -28,8 +30,8 @@ tm$ = " Column = ### Row = ### Button1 = ## Button2 = ## Button3 = ##" {{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}} @@ -38,7 +40,7 @@ tm$ = " Column = ### Row = ### Button1 = ## Button2 = ## Button3 = ##" {{Cl|LOCATE}} 28, 10: {{Cl|PRINT USING}} tm$; X; Y; {{Cl|_MOUSEBUTTON}}(1); {{Cl|_MOUSEBUTTON}}(2); {{Cl|_MOUSEBUTTON}}(3) {{Cl|LOOP}} {{Cl|LOOP}} {{Cl|UNTIL}} K$ = {{Cl|CHR$}}(27) -{{Cl|SYSTEM}} '' '' +{{Cl|SYSTEM}} {{CodeEnd}} @@ -52,4 +54,4 @@ tm$ = " Column = ### Row = ### Button1 = ## Button2 = ## Button3 = ##" {{PageNavigation}} -< + diff --git a/internal/help/_MOUSEY.txt b/internal/help/_MOUSEY__111111.txt similarity index 72% rename from internal/help/_MOUSEY.txt rename to internal/help/_MOUSEY__111111.txt index f37f3ba46..d61087944 100644 --- a/internal/help/_MOUSEY.txt +++ b/internal/help/_MOUSEY__111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:35}} {{DISPLAYTITLE:_MOUSEY}} The [[_MOUSEY]] function returns the current vertical (row) mouse cursor position when read after [[_MOUSEINPUT]]. @@ -14,12 +16,12 @@ The [[_MOUSEY]] function returns the current vertical (row) mouse cursor positio ==QBasic/QuickBASIC== -* In [[SCREEN]] 0, QBasic's [[ABSOLUTE]] returned graphic coordinates. QB64 mouse functions return the text coordinates. +* In [[SCREEN]] 0, QBasic's [[CALL ABSOLUTE|ABSOLUTE]] returned graphic coordinates. QB64 mouse functions return the text coordinates. {{PageExamples}} ''Example:'' Highlighting a row of text in Screen 0. -{{CodeStart}} '' '' +{{CodeStart}} minX = 20: maxX = 60: minY = 10: maxY = 24 selection = 0 'the screen Y coordinate of the previously highlighted item {{Cl|FOR}} i% = 1 {{Cl|TO}} 25: {{Cl|LOCATE}} i%, 40: {{Cl|PRINT}} i%;: {{Cl|NEXT}} @@ -29,7 +31,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,17 +40,17 @@ 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 -addr& = (x1 - 1 + (y - 1) * {{Cl|_WIDTH (function)|_WIDTH}}) * 2 + 1 +{{Cl|DEF SEG}} = {{Cl|&H}}B800 +addr& = (x1 - 1 + (y - 1) * {{Cl|_WIDTH (function)|_WIDTH}}) * 2 + 1 {{Cl|FOR}} x = x1 {{Cl|TO}} x2 - oldCol = {{Cl|PEEK}}(addr&) {{Cl|AND (boolean)|AND}} {{Cl|&B}}10001111 ' Mask foreground color and blink bit - {{Cl|POKE}} addr&, oldCol {{Cl|OR}} ((col {{Cl|AND (boolean)|AND}} {{Cl|&B}}111) * {{Cl|&B}}10000) ' Apply background color - addr& = addr& + 2 + oldCol = {{Cl|PEEK}}(addr&) {{Cl|AND (boolean)|AND}} {{Cl|&B}}10001111 ' Mask foreground color and blink bit + {{Cl|POKE}} addr&, oldCol {{Cl|OR}} ((col {{Cl|AND (boolean)|AND}} {{Cl|&B}}111) * {{Cl|&B}}10000) ' Apply background color + addr& = addr& + 2 {{Cl|NEXT}} -{{Cl|END SUB}} '' '' +{{Cl|END SUB}} {{CodeEnd}} @@ -61,4 +63,4 @@ addr& = (x1 - 1 + (y - 1) * {{Cl|_WIDTH (function)|_WIDTH}}) * 2 + 1 {{PageNavigation}} -< + diff --git a/internal/help/_NEWIMAGE.txt b/internal/help/_NEWIMAGE__11111111.txt similarity index 67% rename from internal/help/_NEWIMAGE.txt rename to internal/help/_NEWIMAGE__11111111.txt index 9e60444a5..a6c199463 100644 --- a/internal/help/_NEWIMAGE.txt +++ b/internal/help/_NEWIMAGE__11111111.txt @@ -1,14 +1,16 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:36}} {{DISPLAYTITLE:_NEWIMAGE}} The [[_NEWIMAGE]] function prepares a window image surface and returns the [[LONG]] [[handle]] value. {{PageSyntax}} -: {{Parameter|handle&}} = [[_NEWIMAGE]]({{Parameter|width&}}, {{Parameter|height&}}[, {''0''|''1''|''2''|''7''|''8''|''9''|''10''|''11''|''12''|''13''|''256''|''32''}]) +: {{Parameter|handle&}} = [[_NEWIMAGE]]({{Parameter|width&}}, {{Parameter|height&}}[, {''0''|''1''|''2''|''7''|''8''|''9''|''10''|''11''|''12''|''13''|''256''|''32''}]) {{Parameters}} -* 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. +* 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. @@ -17,7 +19,7 @@ The [[_NEWIMAGE]] function prepares a window image surface and returns the [[LON * Valid [[LONG]] [[handle]] returns are less than -1. Invalid handles equal -1 and a zero or positive value is also invalid. * You can create any sized window (limited by the OS) in any emulated [[SCREEN]] mode or 32 bit using this function. * Default text block size in emulated [[SCREEN]] modes 1, 2, 7, 8 and 13 is 8 X 8; 9 and 10 is 8 X 14; 11, 12, 256 and 32 bit is 8 X 16. The text block pixel size will allow you to calculate the available text rows and columns in a custom sized screen. -* To view the image page, just use [[SCREEN]] {{Parameter|handle&}}. Even if another procedure changes the screen mode and clears the screen, the image can be restored later by using the same SCREEN handle mode. +* To view the image page, just use [[SCREEN]] {{Parameter|handle&}}. Even if another procedure changes the screen mode and clears the screen, the image can be restored later by using the same SCREEN handle mode. * Use the [[_COPYIMAGE]] function to preserve a SCREEN handle value when changing to another screen mode to restore it later. * '''32 bit screen surface backgrounds (black) have zero [[_ALPHA]] so that they are transparent when placed over other surfaces.''' : Use [[CLS]] or [[_DONTBLEND]] to make a new surface background [[_ALPHA]] 255 or opague. @@ -28,58 +30,58 @@ The [[_NEWIMAGE]] function prepares a window image surface and returns the [[LON {{PageExamples}} ''Example 1:'' Shrinking a SCREEN 0 text window's size: -{{CodeStart}} '' '' -{{Cl|SCREEN (statement)|SCREEN}} {{Cl|_NEWIMAGE}}(28, 25, 0) '' '' +{{CodeStart}} +{{Cl|SCREEN (statement)|SCREEN}} {{Cl|_NEWIMAGE}}(28, 25, 0) {{CodeEnd}} ''Example 2:'' Creating an 800 by 600 window version of SCREEN 12 with 256 colors (text 37 X 100): -{{CodeStart}} '' '' -handle& = {{Cl|_NEWIMAGE}}(800, 600, 256) -{{Cl|SCREEN (statement)|SCREEN}} handle& '' '' +{{CodeStart}} +handle& = {{Cl|_NEWIMAGE}}(800, 600, 256) +{{Cl|SCREEN (statement)|SCREEN}} handle& {{CodeEnd}} ''Example 3:'' Setting up a 32 bit SCREEN with _NEWIMAGE for page flipping in QB64. -{{CodeStart}} '' '' -SCREEN _NEWIMAGE(640, 480, 32), , 1, 0 '' '' +{{CodeStart}} +SCREEN _NEWIMAGE(640, 480, 32), , 1, 0 {{CodeEnd}} : ''Note:'' [[_DISPLAY]] may be used as a substitute for page flipping or [[PCOPY]]. ''Example 4:'' Switching between two different SCREEN modes -{{CodeStart}} '' '' +{{CodeStart}} {{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) +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|_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|_DEST}} mode1& 'work in main window +{{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}} 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|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|SCREEN}} mode2& 'switch to small window +{{Cl|DO...LOOP|DO}}: {{Cl|SLEEP}}: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> "" -{{Cl|SCREEN}} mode1& 'back to main window +{{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|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|SCREEN}} mode2& 'back to small window +{{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. +:''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. -:'''Legacy SCREEN modes can also return a _DEST value, but the value will create a handle error.''' To restore legacy screens get the[[_COPYIMAGE]] function value before changing screens. Then restore it using SCREEN oldmode&. +:'''Legacy SCREEN modes can also return a _DEST value, but the value will create a handle error.''' To restore legacy screens get the[[_COPYIMAGE]] function value before changing screens. Then restore it using SCREEN oldmode&. ===More examples=== @@ -99,4 +101,4 @@ mode2& = {{Cl|_NEWIMAGE}} (300, 200, 13) {{PageNavigation}} -< + diff --git a/internal/help/_NUMLOCK_(function).txt b/internal/help/_NUMLOCK_(function)__1111111_(00000000).txt similarity index 78% rename from internal/help/_NUMLOCK_(function).txt rename to internal/help/_NUMLOCK_(function)__1111111_(00000000).txt index 7ec19ef29..61c37cb4b 100644 --- a/internal/help/_NUMLOCK_(function).txt +++ b/internal/help/_NUMLOCK_(function)__1111111_(00000000).txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:38}} {{DISPLAYTITLE: _NUMLOCK (function)}} The [[_NUMLOCK (function)| _NUMLOCK]] function returns the current state of the Num Lock key as on (-1) or off (0). @@ -6,8 +8,9 @@ The [[_NUMLOCK (function)| _NUMLOCK]] function returns the current state of the : {{Parameter|keyStatus%%}} = [[_NUMLOCK (function)| _NUMLOCK]] -==Availability== -* Version 1.4 and up. +{{PageAvailability}} +* '''QB64 1.4 and up''' (QB64 Team) +* '''QBPE 0.5 and up''' (QB64 Phoenix Edition) * [[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Not available in Linux or macOS]]. @@ -17,4 +20,4 @@ The [[_NUMLOCK (function)| _NUMLOCK]] function returns the current state of the {{PageNavigation}} -< + diff --git a/internal/help/_NUMLOCK.txt b/internal/help/_NUMLOCK__1111111.txt similarity index 74% rename from internal/help/_NUMLOCK.txt rename to internal/help/_NUMLOCK__1111111.txt index fa09256f1..5eb843050 100644 --- a/internal/help/_NUMLOCK.txt +++ b/internal/help/_NUMLOCK__1111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:40}} {{DISPLAYTITLE: _NUMLOCK}} The [[_NUMLOCK]] statement sets the state of the Num Lock key. @@ -6,8 +8,9 @@ The [[_NUMLOCK]] statement sets the state of the Num Lock key. : [[_NUMLOCK]] {ON|OFF|_TOGGLE} -==Availability== -* Version 1.4 and up. +{{PageAvailability}} +* '''QB64 1.4 and up''' (QB64 Team) +* '''QBPE 0.5 and up''' (QB64 Phoenix Edition) * [[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Not available in Linux or macOS]]. @@ -17,4 +20,4 @@ The [[_NUMLOCK]] statement sets the state of the Num Lock key. {{PageNavigation}} -< + diff --git a/internal/help/_OFFSET_(function).txt b/internal/help/_OFFSET_(function)__111111_(00000000).txt similarity index 87% rename from internal/help/_OFFSET_(function).txt rename to internal/help/_OFFSET_(function)__111111_(00000000).txt index d171a0b48..3dd1188d5 100644 --- a/internal/help/_OFFSET_(function).txt +++ b/internal/help/_OFFSET_(function)__111111_(00000000).txt @@ -1,16 +1,18 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:41}} {{DISPLAYTITLE:_OFFSET (function)}} The [[_OFFSET]] function returns the memory offset of/within a given variable. {{PageSyntax}} -: {{Parameter|offset%&}} = [[_OFFSET]]({{Parameter|variable}}) +: {{Parameter|offset%&}} = [[_OFFSET]]({{Parameter|variable}}) {{PageDescription}} * The {{Parameter|variable}} parameter can be any type of numerical or [[STRING|string]] variable name. * API [[DECLARE LIBRARY|LIBRARY]] parameter or [[TYPE|type]] names may include '''lp, ptr''' or '''p''' which designates them as a pointer type. * _OFFSET function return values should be stored in [[_OFFSET]] type variables. As no other variable type is 'elastic' like [[_OFFSET]], there can be no guarantee that any other variable type can hold the value of an _OFFSET. -* Returns the memory offset of variables, user-defined-types & elements, arrays & indices and the base offset of [[STRING]]s. +* Returns the memory offset of variables, user-defined-types & elements, arrays & indices and the base offset of [[STRING]]s. * Offset values are currently only useful when used in conjunction with [[_MEM]] or [[DECLARE LIBRARY]] procedures. * OFFSET values are used as a part of the [[_MEM]] variable [[type]] in QB64; {{Parameter|variable}}.OFFSET returns or sets the current position in memory. * '''Warning:''' QB64 variable length strings can move about in memory at any time. If you get the _OFFSET of a variable length sting on one line and use it on the next it may not be there anymore.''' To be safe, move variable length strings into fixed length strings first.''' @@ -18,7 +20,7 @@ The [[_OFFSET]] function returns the memory offset of/within a given variable. {{PageExamples}} ''Example:'' Using memcpy with the _OFFSET function values as parameters. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DECLARE DYNAMIC LIBRARY|DECLARE CUSTOMTYPE LIBRARY}} {{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}} @@ -27,7 +29,7 @@ a$ = "1234567890" b$ = "ABCDEFGHIJ" memcpy {{Cl|_OFFSET (function)|_OFFSET}}(a$) + 5, {{Cl|_OFFSET (function)|_OFFSET}}(b$) + 5, 5 -{{Cl|PRINT}} a$ '' '' +{{Cl|PRINT}} a$ {{CodeEnd}} {{OutputStart}}12345FGHIJ {{OutputEnd}} @@ -41,4 +43,4 @@ memcpy {{Cl|_OFFSET (function)|_OFFSET}}(a$) + 5, {{Cl|_OFFSET (function)|_OFFSE {{PageNavigation}} -< + diff --git a/internal/help/_OFFSET.txt b/internal/help/_OFFSET__111111.txt similarity index 87% rename from internal/help/_OFFSET.txt rename to internal/help/_OFFSET__111111.txt index 2af22c798..b1685b874 100644 --- a/internal/help/_OFFSET.txt +++ b/internal/help/_OFFSET__111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:42}} {{DISPLAYTITLE:_OFFSET}} The [[_OFFSET]] variable type stores the location of a value in memory. The byte size varies as required by the system. @@ -8,7 +10,7 @@ The [[_OFFSET]] variable type stores the location of a value in memory. The byte {{PageDescription}} * _OFFSET types can be created as signed or [[_UNSIGNED]] at the programmer's discretion. -* The type suffix for _OFFSET is '''%&''' which designates the integer value's flexible size. +* The type suffix for _OFFSET is '''%&''' which designates the integer value's flexible size. * Offset values are only useful when used in conjunction with [[_MEM]] or [[DECLARE LIBRARY]] procedures. * OFFSET values are used as a part of the [[_MEM]] variable [[type]] in QB64. Variable.OFFSET returns or sets the current position in memory. * API [[DECLARE LIBRARY|LIBRARY]] parameter or [[TYPE|type]] names may include '''lp, ptr''' or '''p''' which designates them as a pointer type. @@ -18,13 +20,13 @@ The [[_OFFSET]] variable type stores the location of a value in memory. The byte {{PageExamples}} ''Example:'' The SHBrowseForFolder function receives information about the folder selected by the user in Windows XP and 7. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DECLARE DYNAMIC LIBRARY|DECLARE CUSTOMTYPE LIBRARY}} - {{Cl|FUNCTION}} FindWindow& ({{Cl|BYVAL}} ClassName AS {{Cl|_OFFSET}}, WindowName$) + {{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)) +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 @@ -38,7 +40,7 @@ hwnd& = FindWindow(0, "Super Window" + {{Cl|CHR$}}(0)) {{Cl|END}} {{Cl|TYPE}} 'BROWSEINFO, *PBROWSEINFO, *LPBROWSEINFO; {{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|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}} @@ -57,7 +59,7 @@ o = SHBrowseForFolder(b) {{Cl|PRINT}} {{Cl|LEFT$}}(s2$, {{Cl|INSTR}}(s2$, {{Cl|CHR$}}(0)) - 1) {{Cl|ELSE}} {{Cl|PRINT}} "Cancel?" -{{Cl|END IF}} '' '' +{{Cl|END IF}} {{CodeEnd}} {{small|Code by Galleon}} @@ -72,4 +74,4 @@ o = SHBrowseForFolder(b) {{PageNavigation}} -< + diff --git a/internal/help/_OPENCLIENT.txt b/internal/help/_OPENCLIENT__1111111111.txt similarity index 91% rename from internal/help/_OPENCLIENT.txt rename to internal/help/_OPENCLIENT__1111111111.txt index 2aeb00f73..edc37b406 100644 --- a/internal/help/_OPENCLIENT.txt +++ b/internal/help/_OPENCLIENT__1111111111.txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:43}} The [[_OPENCLIENT]] function connects to a Host on the Internet as a Client and returns the Client status handle.{{PageSyntax}} -:{{Parameter|clientHandle&}} = [[_OPENCLIENT]]('''"TCP/IP:8080:12:30:1:10"''') +:{{Parameter|clientHandle&}} = [[_OPENCLIENT]]('''"TCP/IP:8080:12:30:1:10"''') {{PageDescription}} *An [[ERROR Codes|Illegal Function Call]] error will be triggered if the function is called with a string argument of the wrong syntax. *Connects to a host somewhere on the internet as a client. -*Valid {{Parameter|clientHandle&}} values are negative. 0 means that the connection failed. Always check that the handle returned is not 0. +*Valid {{Parameter|clientHandle&}} values are negative. 0 means that the connection failed. Always check that the handle returned is not 0. *[[CLOSE]] client_handle closes the client. A failed handle of value 0 does not need to be closed. {{PageExamples}}''Example 1:'' Attempting to connect to a local host(your host) as a client. A zero return indicates failure.{{CodeStart}} @@ -11,12 +13,10 @@ 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|END IF}} '' '' - +{{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.{{CodeStart}} -'' '' 'replace the fake image address below with a real image address you want to download {{Cl|IF...THEN|IF}} Download("www.qb64.org/qb64.png", "qb64logo.png", 10) {{Cl|THEN}} ' timelimit = 10 seconds {{Cl|SCREEN}} {{Cl|_LOADIMAGE}}("qb64logo.png",32) @@ -67,11 +67,11 @@ t! = {{Cl|TIMER}} ' start time {{Cl|END IF}} ' i {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|TIMER}} > t! + timelimit ' (in seconds) {{Cl|CLOSE}} client -{{Cl|END FUNCTION}} '' '' +{{Cl|END FUNCTION}} {{CodeEnd}}{{PageSeeAlso}} *[[_OPENHOST]], [[_OPENCONNECTION]] *[[_CONNECTED]], [[_CONNECTIONADDRESS$]] *[[Email Demo]], [[Inter-Program Data Sharing Demo]] *[[Downloading Files]] {{PageNavigation}} -< + diff --git a/internal/help/_OPENCONNECTION.txt b/internal/help/_OPENCONNECTION__11111111111111.txt similarity index 96% rename from internal/help/_OPENCONNECTION.txt rename to internal/help/_OPENCONNECTION__11111111111111.txt index be19da248..035665720 100644 --- a/internal/help/_OPENCONNECTION.txt +++ b/internal/help/_OPENCONNECTION__11111111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:45}} {{DISPLAYTITLE:_OPENCONNECTION}} The [[_OPENCONNECTION]] function opens a connection from a client that the host has detected and returns a status handle. @@ -22,4 +24,4 @@ The [[_OPENCONNECTION]] function opens a connection from a client that the host {{PageNavigation}} -< + diff --git a/internal/help/_OPENHOST.txt b/internal/help/_OPENHOST__11111111.txt similarity index 95% rename from internal/help/_OPENHOST.txt rename to internal/help/_OPENHOST__11111111.txt index 974c12d30..39b84a2e6 100644 --- a/internal/help/_OPENHOST.txt +++ b/internal/help/_OPENHOST__11111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:46}} {{DISPLAYTITLE:_OPENHOST}} The [[_OPENHOST]] function opens a Host which listens for new connections and returns a Host status handle. @@ -24,4 +26,4 @@ The [[_OPENHOST]] function opens a Host which listens for new connections and re {{PageNavigation}} -< + diff --git a/internal/help/_OS$.txt b/internal/help/_OS$__11$.txt similarity index 84% rename from internal/help/_OS$.txt rename to internal/help/_OS$__11$.txt index 40ab9a672..22d47d59f 100644 --- a/internal/help/_OS$.txt +++ b/internal/help/_OS$__11$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:50}} The [[_OS$]] function returns the operating system and QB64 compiler bit version used to compile a QB64 program. @@ -10,7 +12,7 @@ The [[_OS$]] function returns the operating system and QB64 compiler bit version * 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 --> + {{PageSeeAlso}} @@ -18,4 +20,4 @@ The [[_OS$]] function returns the operating system and QB64 compiler bit version {{PageNavigation}} -< + diff --git a/internal/help/_PALETTECOLOR_(function).txt b/internal/help/_PALETTECOLOR_(function)__111111111111_(00000000).txt similarity index 61% rename from internal/help/_PALETTECOLOR_(function).txt rename to internal/help/_PALETTECOLOR_(function)__111111111111_(00000000).txt index 706479e7a..7231c1c65 100644 --- a/internal/help/_PALETTECOLOR_(function).txt +++ b/internal/help/_PALETTECOLOR_(function)__111111111111_(00000000).txt @@ -1,41 +1,43 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:52}} {{DISPLAYTITLE:_PALETTECOLOR (function)}} The [[_PALETTECOLOR (function)|_PALETTECOLOR]] function is used to return the 32 bit attribute color setting of an image or screen page handle's palette. {{PageSyntax}} -: {{Parameter|color32Value&}} = [[_PALETTECOLOR (function)|_PALETTECOLOR]]({{Parameter|attributeNumber%}}, {{Parameter|imgHandle&}}) +: {{Parameter|color32Value&}} = [[_PALETTECOLOR (function)|_PALETTECOLOR]]({{Parameter|attributeNumber%}}, {{Parameter|imgHandle&}}) {{PageDescription}} * {{Parameter|attributeNumber%}} is the color attribute value from 0 to 255 for 1, 4 or 8 bit images. -* {{Parameter|imgHandle&}} is the image handle being read for color data. Zero can be used to read the current screen mode palette. +* {{Parameter|imgHandle&}} is the image handle being read for color data. Zero can be used to read the current screen mode palette. * Returns the 32 bit color value to be used by the 32 bit RGB functions. * For 32 bit images send the _PALETTECOLOR return value to [[_RED32]], [[_GREEN32]] and [[_BLUE32]] functions to get the red, green, and blue intensity values. * '''Although 32 bit palette values are returned, the function cannot be used with 32 bit images or screen modes.''' {{PageExamples}} -''Example:'' How _PALETTECOLOR works on 32 bit RGB compared to a 4 BPP(SCREEN 12) Qbasic procedure. -{{CodeStart}} '' '' -SCREEN 12 'can use any Qbasic legacy screen mode +''Example:'' How _PALETTECOLOR works on 32 bit RGB compared to a 4 BPP(SCREEN 12) QBasic procedure. +{{CodeStart}} +SCREEN 12 'can use any QBasic legacy screen mode DIM RGB(0 TO 47) AS INTEGER 'color intensity array -FOR c& = 0 TO 15 - 'OUT &H3C7, c& 'set color attribute to read - value32& = {{Cl|_PALETTECOLOR (function)|_PALETTECOLOR}}(c&, 0) 'sets color value to read of an image page handle. - 'red% = INP(&H3C9) - red% = {{Cl|_RED32}}(value32&) - 'green% = INP(&H3C9) - green% = {{Cl|_GREEN32}}(value32&) - 'blue% = INP(&H3C9) - blue% = {{Cl|_BLUE32}}(value32&) - RGB(c& * 3) = red%: RGB((c& * 3) + 1) = green%: RGB((c& * 3) + 2) = blue% +FOR c& = 0 TO 15 + 'OUT &H3C7, c& 'set color attribute to read + value32& = {{Cl|_PALETTECOLOR (function)|_PALETTECOLOR}}(c&, 0) 'sets color value to read of an image page handle. + 'red% = INP(&H3C9) + red% = {{Cl|_RED32}}(value32&) + 'green% = INP(&H3C9) + green% = {{Cl|_GREEN32}}(value32&) + 'blue% = INP(&H3C9) + blue% = {{Cl|_BLUE32}}(value32&) + 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$; PRINT NEXT -END '' '' +END {{CodeEnd}} :''Explanation:'' To save a bitmap or other image you need the RGB color settings or the colors will look all wrong. You can store that information into a larger image array and [[GET (graphics statement)|GET]] the image AFTER the color settings. Just GET the image starting at Array(48). @@ -48,4 +50,4 @@ END '' '' {{PageNavigation}} -< + diff --git a/internal/help/_PALETTECOLOR.txt b/internal/help/_PALETTECOLOR__111111111111.txt similarity index 80% rename from internal/help/_PALETTECOLOR.txt rename to internal/help/_PALETTECOLOR__111111111111.txt index 40c46c85d..dfc663ec4 100644 --- a/internal/help/_PALETTECOLOR.txt +++ b/internal/help/_PALETTECOLOR__111111111111.txt @@ -1,21 +1,23 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:51}} {{DISPLAYTITLE:_PALETTECOLOR}} The [[_PALETTECOLOR]] statement sets the color value of a palette entry of an image using 256 color modes or less (4 or 8 BPP). {{PageSyntax}} -:[[_PALETTECOLOR]] {{Parameter|attribute%}}, {{Parameter|newColor&}}[, {{Parameter|destHandle&}}] +:[[_PALETTECOLOR]] {{Parameter|attribute%}}, {{Parameter|newColor&}}[, {{Parameter|destHandle&}}] {{PageDescription}} * The {{Parameter|attribute%}} is the palette index number of the color to set, ranging from 0 to 15 (4 bit) or 0 to 255 (8 bit) color modes. -* The [[LONG]] {{Parameter|newColor&}} is the new color value to set using [[_RGB32]] or [[_RGBA32]] values or using [[HEX$ 32 Bit Values]]. -* If {{Parameter|destHandle&}} is omitted, [[_DEST|destination]] is assumed to be the current write page or screen surface. +* The [[LONG]] {{Parameter|newColor&}} is the new color value to set using [[_RGB32]] or [[_RGBA32]] values or using [[HEX$ 32 Bit Values]]. +* If {{Parameter|destHandle&}} is omitted, [[_DEST|destination]] is assumed to be the current write page or screen surface. * If {{Parameter|attribute%}} is outside of image or [[SCREEN|screen]] mode attribute range (0 to 15 or 0 to 255), an [[ERROR Codes|illegal function call]] error will occur. -* If {{Parameter|destHandle&}} does not use a palette, an [[ERROR Codes|illegal function call]] error occurs. '''Will not work in 24/32 bit color palette modes.''' -* If {{Parameter|destHandle&}} is an invalid handle value, an [[ERROR Codes|invalid handle]] error occurs. +* If {{Parameter|destHandle&}} does not use a palette, an [[ERROR Codes|illegal function call]] error occurs. '''Will not work in 24/32 bit color palette modes.''' +* 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> +
'''Basic's 16 Default Color Attributes (non-[[DAC]])'''
{{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}} @@ -32,9 +34,9 @@ The [[_PALETTECOLOR]] statement sets the color value of a palette entry of an im {{text| 12 Red 63 21 21 FF1515 Red|#FF1515}} {{text| 13 Magenta 63 21 63 FF15FF Magenta|#FF15FF}} {{text| 14 Yellow 63 63 21 FFFF00 Yellow|#FFFF00}} -{{text| 15 White 63 63 63 FFFFFF White|#FFFFFF}} '' '' +{{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> +
[http://www.w3schools.com/html/html_colornames.asp HTML Color Table Values and Names] or [http://www.tayloredmktg.com/rgb/#OR Other RGB colors]
::: ''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. @@ -58,7 +60,7 @@ The [[_PALETTECOLOR]] statement sets the color value of a palette entry of an im {{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}} 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. @@ -73,4 +75,4 @@ The [[_PALETTECOLOR]] statement sets the color value of a palette entry of an im {{PageNavigation}} -< + diff --git a/internal/help/_PIXELSIZE.txt b/internal/help/_PIXELSIZE__111111111.txt similarity index 59% rename from internal/help/_PIXELSIZE.txt rename to internal/help/_PIXELSIZE__111111111.txt index 35e445ca9..49d771f34 100644 --- a/internal/help/_PIXELSIZE.txt +++ b/internal/help/_PIXELSIZE__111111111.txt @@ -1,34 +1,36 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:55}} {{DISPLAYTITLE:_PIXELSIZE}} The [[_PIXELSIZE]] function returns the color depth (Bits Per Pixel) of an image as 0 for text, 1 for 1 to 8 BPP or 4 for 32 bit. {{PageSyntax}} -: {{Parameter|pixelSize%}} = [[_PIXELSIZE]][({{Parameter|imageHandle&}})] +: {{Parameter|pixelSize%}} = [[_PIXELSIZE]][({{Parameter|imageHandle&}})] {{PageDescription}} -* If {{Parameter|imageHandle&}} is omitted, it is assumed to be the current write page. +* If {{Parameter|imageHandle&}} is omitted, it is assumed to be the current write page. * Returns: -** 0 if the image or screen page specified by {{Parameter|imageHandle&}} is in text mode. -** 1 if the image specified by {{Parameter|imageHandle&}} is in 1 (B & W), 4 (16 colors) or 8 (256 colors) BPP mode. +** 0 if the image or screen page specified by {{Parameter|imageHandle&}} is in text mode. +** 1 if the image specified by {{Parameter|imageHandle&}} is in 1 (B & W), 4 (16 colors) or 8 (256 colors) BPP mode. ** 4 if the image specified is a 24/32-bit compatible mode. Pixels use three bytes, one per red, green and blue color intensity. * The [[SCREEN]] or [[_NEWIMAGE]] or [[_LOADIMAGE]] color mode (256 or 32) can influence the pixel sizes that can be returned. -* If {{Parameter|imageHandle&}} is an invalid handle, then an [[ERROR Codes|invalid handle]] error occurs. +* If {{Parameter|imageHandle&}} is an invalid handle, then an [[ERROR Codes|invalid handle]] error occurs. {{PageExamples}} ''Snippet:'' Saving Images for later program use. Handle values could be saved to an array. -{{TextStart}} '' '' +{{TextStart}} -handle1& = _Getimage(sx1, sy1, sx2, sy2, sourcehandle&) ' function call +handle1& = _Getimage(sx1, sy1, sx2, sy2, sourcehandle&) ' function call -{{Cb|FUNCTION}} GetImage& (sx1, sy1, sx2, sy2, sourcehandle&) -bytespp = {{Cb|_PIXELSIZE}}(sourcehandle&) +{{Cb|FUNCTION}} GetImage& (sx1, sy1, sx2, sy2, sourcehandle&) +bytespp = {{Cb|_PIXELSIZE}}(sourcehandle&) {{Cb|IF...THEN|IF}} bytespp = 4 {{Cb|THEN}} Pal = 32 {{Cb|ELSE}} {{Cb|IF...THEN|IF}} bytespp = 1 {{Cb|THEN}} Pal = 256 {{Cb|ELSE}} {{Cb|EXIT FUNCTION}} -h& = {{Cb|_NEWIMAGE}}({{Cb|ABS}}(sx2 - sx1) + 1, {{Cb|ABS}}(sy2 - sy1) + 1, Pal) -{{Cb|_PUTIMAGE}} (0, 0), sourcehandle&, h&, (sx1, sy1)-(sx2, sy2) 'image is not displayed -GetImage& = h& -{{Cb|END FUNCTION}} '' '' +h& = {{Cb|_NEWIMAGE}}({{Cb|ABS}}(sx2 - sx1) + 1, {{Cb|ABS}}(sy2 - sy1) + 1, Pal) +{{Cb|_PUTIMAGE}} (0, 0), sourcehandle&, h&, (sx1, sy1)-(sx2, sy2) 'image is not displayed +GetImage& = h& +{{Cb|END FUNCTION}} {{TextEnd}} {{small|Adapted from code by Galleon}} @@ -48,4 +50,4 @@ GetImage& = h& {{PageNavigation}} -< + diff --git a/internal/help/_PI.txt b/internal/help/_PI__11.txt similarity index 77% rename from internal/help/_PI.txt rename to internal/help/_PI__11.txt index 7981adee8..d1ad05c6b 100644 --- a/internal/help/_PI.txt +++ b/internal/help/_PI__11.txt @@ -1,5 +1,7 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:54}} {{DISPLAYTITLE: _PI}} -The [[_PI]] function returns '''&pi;''' as a [[_FLOAT]] value with an optional multiplier parameter. +The [[_PI]] function returns '''γ''' as a [[_FLOAT]] value with an optional multiplier parameter. {{PageSyntax}} @@ -13,7 +15,7 @@ The [[_PI]] function returns '''&pi;''' as a [[_FLOAT]] value with an option {{PageDescription}} * Function can be used in to supply Ο€ or multiples in a program. * Accuracy is determined by the return variable type [[AS]] [[SINGLE]], [[DOUBLE]] or [[_FLOAT]]. -* The &pi; value can also be derived using 4 * [[ATN]](1) for a [[SINGLE]] value. +* The γ value can also be derived using 4 * [[ATN]](1) for a [[SINGLE]] value. {{PageExamples}} @@ -33,4 +35,4 @@ PRINT circlearea {{PageNavigation}} -< + diff --git a/internal/help/_PRESERVE.txt b/internal/help/_PRESERVE__11111111.txt similarity index 93% rename from internal/help/_PRESERVE.txt rename to internal/help/_PRESERVE__11111111.txt index 0b93b57c6..fdc546d5a 100644 --- a/internal/help/_PRESERVE.txt +++ b/internal/help/_PRESERVE__11111111.txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:56}} {{DISPLAYTITLE:_PRESERVE}} The [[_PRESERVE]] [[REDIM]] action preserves the current contents of [[$DYNAMIC|dynamic]] [[arrays]], when resizing or changing indices. {{PageSyntax}} -: [[REDIM]] [[_PRESERVE]] array({{Parameter|newLowerIndex&}} [TO {{Parameter|newUpperIndex&}}]) [AS variabletype] +: [[REDIM]] [[_PRESERVE]] array({{Parameter|newLowerIndex&}} [TO {{Parameter|newUpperIndex&}}]) [AS variabletype] {{PageDescription}} @@ -25,7 +27,7 @@ The [[_PRESERVE]] [[REDIM]] action preserves the current contents of [[$DYNAMIC| {{PageExamples}} ''Example 1:'' Changing the upper and lower array bounds -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|REDIM}} a(5 {{Cl|TO}} 10) ' create array as dynamic using REDIM a(5) = 123 {{Cl|REDIM}} {{Cl|_PRESERVE}} a(20 {{Cl|TO}} 40) @@ -36,7 +38,7 @@ a(5) = 123 ''Example 2:'' Sizing an array while storing file data. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|REDIM}} Array$(1) 'create a dynamic string array filename$ = "Readme.txt" 'Qb64 information text file {{Cl|OPEN}} filename$ {{Cl|FOR (file statement)|FOR}} {{Cl|INPUT (file mode)|INPUT}} {{Cl|AS}} #1 @@ -54,7 +56,7 @@ filename$ = "Readme.txt" 'Qb64 information text file {{Cl|PRINT}} Array$(c) {{Cl|IF...THEN|IF}} c {{Cl|MOD}} 20 = 0 {{Cl|THEN}} k$ = {{Cl|INPUT$}}(1) {{Cl|NEXT}} -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} @@ -66,4 +68,4 @@ filename$ = "Readme.txt" 'Qb64 information text file {{PageNavigation}} -< + diff --git a/internal/help/_PRINTIMAGE.txt b/internal/help/_PRINTIMAGE__1111111111.txt similarity index 87% rename from internal/help/_PRINTIMAGE.txt rename to internal/help/_PRINTIMAGE__1111111111.txt index 14a59ff2f..d5fd2d771 100644 --- a/internal/help/_PRINTIMAGE.txt +++ b/internal/help/_PRINTIMAGE__1111111111.txt @@ -1,13 +1,15 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:58}} {{DISPLAYTITLE:_PRINTIMAGE}} The [[_PRINTIMAGE]] statement prints a colored image on the printer, stretching it to full paper size first. {{PageSyntax}} -: [[_PRINTIMAGE]] {{Parameter|imageHandle&}} +: [[_PRINTIMAGE]] {{Parameter|imageHandle&}} -* {{Parameter|imageHandle&}} is created by the [[_LOADIMAGE]], [[_NEWIMAGE]] or [[_COPYIMAGE]] functions. +* {{Parameter|imageHandle&}} is created by the [[_LOADIMAGE]], [[_NEWIMAGE]] or [[_COPYIMAGE]] functions. * Use a white background to save ink. {{InlineCode}}[[CLS]] , _RGB(255, 255, 255){{InlineCodeEnd}} can be used to set the white background in any [[SCREEN]] mode. * The image may be stretched disproportionately using normal screen sizes. To compensate, use a [[_NEWIMAGE]] screen that is proportional to the paper size. ''e.g.'' A 640 X 900 SCREEN page is roughly the same as 3 times a 210mm X 297mm paper size. * [[_NEWIMAGE]] or graphic screen pages can use [[_PRINTSTRING]] to print different sized text [[_FONT]]s. @@ -19,8 +21,8 @@ The [[_PRINTIMAGE]] statement prints a colored image on the printer, stretching {{CodeStart}}PageScale = 10 PageHeight = 297 * PageScale 'A4 paper size is 210 X 297 mm PageWidth = 210 * PageScale -Page& = {{Cl|_NEWIMAGE}}(PageWidth, PageHeight, 32) -{{Cl|_DEST}} Page&: {{Cl|CLS}} , {{Cl|_RGB}}(255, 255, 255): {{Cl|_DEST}} 0 'make background white to save ink! +Page& = {{Cl|_NEWIMAGE}}(PageWidth, PageHeight, 32) +{{Cl|_DEST}} Page&: {{Cl|CLS}} , {{Cl|_RGB}}(255, 255, 255): {{Cl|_DEST}} 0 'make background white to save ink! CursorPosY = 0 'example text to print @@ -38,16 +40,16 @@ text$ = "In Hartford, Hereford, and Hampshire, hurricanes hardly happen." {{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$}} <> "" + 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$}} <> "" {{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|_PRINTIMAGE}} Page& + {{Cl|_PRINTIMAGE}} Page& {{Cl|END IF}} {{Cl|END}} @@ -55,7 +57,7 @@ text$ = "In Hartford, Hereford, and Hampshire, hurricanes hardly happen." PrintText: FontHeight = {{Cl|INT}}(PointSize * 0.3527 * PageScale) FontHandle = {{Cl|_LOADFONT}}("c:\windows\fonts\times.ttf", FontHeight) -{{Cl|_DEST}} Page& +{{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 {{Cl|_PRINTSTRING}} (0, CursorPosY), text$ @@ -63,18 +65,18 @@ FontHandle = {{Cl|_LOADFONT}}("c:\windows\fonts\times.ttf", FontHeight) {{Cl|_FREEFONT}} FontHandle {{Cl|_DEST}} 0 CursorPosY = CursorPosY + FontHeight 'adjust print position down -{{Cl|RETURN}} '' '' +{{Cl|RETURN}} {{CodeEnd}} {{small|Code by Galleon}} :''Explanation:'' CLS with the color white makes sure that the background is not printed a color. The PrintText [[GOSUB]] sets the [[COLOR]] of the text to red with a transparent background using [[_RGBA]] to set the [[_ALPHA]] transparency to zero or clear black. ''Example 2:'' Printing an old SCREEN 12 [[ASCII]] table using a deeper sized page to prevent stretching by [[_PRINTIMAGE]]. -{{CodeStart}} '' '' +{{CodeStart}} {{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! +{{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%)" {{Cl|PRINT}} {{Cl|STRING$}}(80, 223) @@ -122,10 +124,10 @@ Border 8 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 + {{Cl|_PRINTIMAGE}} 0 '<<<<<<<<<<<< to PRINTER Align 11, 29, "Use the ASCII Table for a reference of the codes!" {{Cl|SOUND}} 700, 4 {{Cl|END IF}} @@ -154,7 +156,7 @@ Tcol = 41 - ({{Cl|LEN}}(txt$) \ 2) {{Cl|SUB}} SetCHR (Trow, Tcol, FG, ASCode) Srow = 16 * (Trow - 1): Scol = 8 * (Tcol - 1) 'convert text to graphic coordinates {{Cl|COLOR}} FG: {{Cl|_PRINTSTRING}} (Scol, Srow), {{Cl|CHR$}}(ASCode) -{{Cl|END SUB}} '' '' +{{Cl|END SUB}} {{CodeEnd}} {{small|Code by Ted Weissgerber}} :''Explanation:'' The [[ASCII]] character table was originally made in [[SCREEN]] 12 (640 X 480) and was adapted to 256 colors. @@ -168,4 +170,4 @@ Srow = 16 * (Trow - 1): Scol = 8 * (Tcol - 1) 'convert text to graphic coordinat {{PageNavigation}} -< + diff --git a/internal/help/_PRINTMODE_(function).txt b/internal/help/_PRINTMODE_(function)__111111111_(00000000).txt similarity index 78% rename from internal/help/_PRINTMODE_(function).txt rename to internal/help/_PRINTMODE_(function)__111111111_(00000000).txt index c89455661..0ed2cd104 100644 --- a/internal/help/_PRINTMODE_(function).txt +++ b/internal/help/_PRINTMODE_(function)__111111111_(00000000).txt @@ -1,13 +1,15 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:00}} {{DISPLAYTITLE:_PRINTMODE (function)}} The [[_PRINTMODE (function)|_PRINTMODE]] function returns the current [[_PRINTMODE]] status as a numerical value from 1 to 3 in graphic screen modes. {{PageSyntax}} -: {{Parameter|currentPrintMode}} = [[_PRINTMODE (function)|_PRINTMODE]][({{Parameter|imageHandle&}})] +: {{Parameter|currentPrintMode}} = [[_PRINTMODE (function)|_PRINTMODE]][({{Parameter|imageHandle&}})] {{Parameters}} -* If no {{Parameter|imageHandle&}} is given, the current [[_DEST|destination]] [[SCREEN]] page or image is assumed. +* If no {{Parameter|imageHandle&}} is given, the current [[_DEST|destination]] [[SCREEN]] page or image is assumed. {{PageDescription}} @@ -26,4 +28,4 @@ The [[_PRINTMODE (function)|_PRINTMODE]] function returns the current [[_PRINTM {{PageNavigation}} -< + diff --git a/internal/help/_PRINTMODE.txt b/internal/help/_PRINTMODE__111111111.txt similarity index 85% rename from internal/help/_PRINTMODE.txt rename to internal/help/_PRINTMODE__111111111.txt index c41560fb4..8126e330c 100644 --- a/internal/help/_PRINTMODE.txt +++ b/internal/help/_PRINTMODE__111111111.txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:59}} {{DISPLAYTITLE:_PRINTMODE}} The [[_PRINTMODE]] statement sets the text or [[_FONT]] printing mode on a background image when using [[PRINT]] or [[_PRINTSTRING]]. {{PageSyntax}} -: [[_PRINTMODE]] {''_KEEPBACKGROUND''|''_ONLYBACKGROUND''|''_FILLBACKGROUND''}[, {{Parameter|imageHandle&}}] +: [[_PRINTMODE]] {''_KEEPBACKGROUND''|''_ONLYBACKGROUND''|''_FILLBACKGROUND''}[, {{Parameter|imageHandle&}}] {{Parameters}} @@ -11,7 +13,7 @@ The [[_PRINTMODE]] statement sets the text or [[_FONT]] printing mode on a backg **''_KEEPBACKGROUND'' (mode 1): Text background transparent. Only the text is displayed over anything behind it. **''_ONLYBACKGROUND'' (mode 2): Text background only is displayed. Text is transparent to anything behind it. **''_FILLBACKGROUND'' (mode 3): Text and background block anything behind them like a normal [[PRINT]]. '''Default setting.''' -* If the optional {{Parameter|imageHandle&}} is omitted or = 0) it will use the current [[_DEST|destination]] image background. +* If the optional {{Parameter|imageHandle&}} is omitted or = 0) it will use the current [[_DEST|destination]] image background. {{PageDescription}} @@ -21,12 +23,12 @@ The [[_PRINTMODE]] statement sets the text or [[_FONT]] printing mode on a backg {{PageExamples}} ''Example:'' Using _PRINTMODE with [[PRINT]] in a graphic screen mode. The background used is CHR$(219) = β–ˆ -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN (statement)|SCREEN}} 12 {{Cl|COLOR}} 8: {{Cl|LOCATE}} 10, 10: {{Cl|PRINT}} {{Cl|STRING$}}(3, 219) 'background {{Cl|_PRINTMODE}} _KEEPBACKGROUND {{Cl|COLOR}} 15: {{Cl|LOCATE}} 10, 10: {{Cl|PRINT}} {{Cl|_PRINTMODE}} -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} @@ -39,4 +41,4 @@ The [[_PRINTMODE]] statement sets the text or [[_FONT]] printing mode on a backg {{PageNavigation}} -< + diff --git a/internal/help/_PRINTSTRING.txt b/internal/help/_PRINTSTRING__11111111111.txt similarity index 79% rename from internal/help/_PRINTSTRING.txt rename to internal/help/_PRINTSTRING__11111111111.txt index 2276325e0..efd972b15 100644 --- a/internal/help/_PRINTSTRING.txt +++ b/internal/help/_PRINTSTRING__11111111111.txt @@ -1,15 +1,17 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:02}} {{DISPLAYTITLE:_PRINTSTRING}} The [[_PRINTSTRING]] statement prints text [[STRING|strings]] using graphic column and row coordinate positions. {{PageSyntax}} -: [[_PRINTSTRING]]({{Parameter|column}}, {{Parameter|row}}), {{Parameter|textExpression$}}[, {{Parameter|imageHandle&}}] +: [[_PRINTSTRING]]({{Parameter|column}}, {{Parameter|row}}), {{Parameter|textExpression$}}[, {{Parameter|imageHandle&}}] {{Parameters}} * {{Parameter|column}} and {{Parameter|row}} are [[INTEGER]] or [[LONG]] starting PIXEL (graphic) column and row coordinates to set text or custom fonts. * {{Parameter|textExpression$}} is any literal or variable [[STRING|string]] value of text to be displayed. -* {{Parameter|imageHandle&}} is the optional image or destination to use. Zero designates current [[SCREEN (statement)|SCREEN]] page. +* {{Parameter|imageHandle&}} is the optional image or destination to use. Zero designates current [[SCREEN (statement)|SCREEN]] page. {{PageDescription}} @@ -17,7 +19,7 @@ The [[_PRINTSTRING]] statement prints text [[STRING|strings]] using graphic colu * The [[_FONT]] size can affect the [[SCREEN (statement)|screen]] and row heights. ** Custom fonts are not required. [[_PRINTSTRING]] can print all [[ASCII]] characters. * [[_PRINTWIDTH]] can be used to determine how wide a text print will be so that the screen width is not exceeded. -* If the {{Parameter|imageHandle&}} is omitted, the current image, page or screen destination is used. +* If the {{Parameter|imageHandle&}} is omitted, the current image, page or screen destination is used. * Can use the current font alpha blending with a designated image background. See the [[_RGBA]] function example. * Use the [[_PRINTMODE]] statement before printing to set how the background is rendered. ** Use the [[_PRINTMODE (function)]] to find the current _PRINTMODE setting. @@ -30,7 +32,7 @@ The [[_PRINTSTRING]] statement prints text [[STRING|strings]] using graphic colu {{PageExamples}} ''Example 1:'' Printing those unprintable [[ASCII]] control characters is no longer a problem! -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(800, 600, 256) {{Cl|FOR...NEXT|FOR}} code = 0 {{Cl|TO}} 31 @@ -41,7 +43,7 @@ The [[_PRINTSTRING]] statement prints text [[STRING|strings]] using graphic colu {{Cl|_PRINTSTRING}} (0, 16), chrstr$ -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} {{OutputStart}} ☺ ☻ β™₯ ♦ ♣ β™  β€’ β—˜ β—‹ β—™ β™‚ ♀ β™ͺ β™« ☼ β–Ί β—„ ↕ β€Ό ΒΆ Β§ β–¬ ↨ ↑ ↓ β†’ ← ∟ ↔ β–² β–Ό @@ -50,21 +52,21 @@ The [[_PRINTSTRING]] statement prints text [[STRING|strings]] using graphic colu ''Example 2:'' Making any '''QB64 program window''' 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 +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 (statement)|SCREEN}} Big13& -{{Cl|_DEST}} Scr13& -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|SCREEN (statement)|SCREEN}} Big13& +{{Cl|_DEST}} Scr13& +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|_COPYPALETTE}} Scr13&, Big13& 'required when imported image colors are used -{{Cl|_PUTIMAGE}} , Scr13&, Big13& 'stretches the screen to double the size +{{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}} @@ -72,16 +74,16 @@ K$ = {{Cl|INPUT$}}(1) 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}} '' '' +{{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> +
[https://www.dropbox.com/s/tcdik1ajegbeiz4/HOWIE.zip?dl=0 Download of Example 2 Bitmap images]
''Example 3:'' Rotating a text string around a graphic object. -{{CodeStart}} '' '' -{{Cl|SCREEN (statement)|SCREEN}} 12 '' '' +{{CodeStart}} +{{Cl|SCREEN (statement)|SCREEN}} 12 {{Cl|DIM}} row {{Cl|AS}} {{Cl|INTEGER}}, cnt {{Cl|AS}} {{Cl|INTEGER}}, cstart {{Cl|AS}} {{Cl|SINGLE}}, cend {{Cl|AS}} {{Cl|SINGLE}} {{Cl|DIM}} xrot {{Cl|AS}} {{Cl|INTEGER}}, yrot {{Cl|AS}} {{Cl|INTEGER}}, scale {{Cl|AS}} {{Cl|INTEGER}} ' {{Cl|_FULLSCREEN}} 'full screen optional @@ -102,7 +104,7 @@ row = 1 {{Cl|NEXT}} {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) 'escape key exit {{Cl|COLOR}} 15 -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} {{small|Adapted from code by Unseen Machine}} @@ -117,4 +119,4 @@ row = 1 {{PageNavigation}} -< + diff --git a/internal/help/_PRINTWIDTH.txt b/internal/help/_PRINTWIDTH__1111111111.txt similarity index 62% rename from internal/help/_PRINTWIDTH.txt rename to internal/help/_PRINTWIDTH__1111111111.txt index 99fbb6a83..65f97d735 100644 --- a/internal/help/_PRINTWIDTH.txt +++ b/internal/help/_PRINTWIDTH__1111111111.txt @@ -1,14 +1,16 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:03}} {{DISPLAYTITLE:_PRINTWIDTH}}{{DISPLAYTITLE:}} The [[_PRINTWIDTH]] function returns the width in pixels of the text [[STRING|string]] specified. {{PageSyntax}} -: {{Parameter|pixelWidth%}} = [[_PRINTWIDTH]]({{Parameter|textToPrint$}}[, {{Parameter|destinationHandle&}}]) +: {{Parameter|pixelWidth%}} = [[_PRINTWIDTH]]({{Parameter|textToPrint$}}[, {{Parameter|destinationHandle&}}]) {{PageDescription}} * {{Parameter|textToPrint$}} is any literal or variable [[STRING]] value. -* If the {{Parameter|destinationHandle&}} is omitted, the current destination image or screen page is used. +* If the {{Parameter|destinationHandle&}} is omitted, the current destination image or screen page is used. * Useful to find the width of the font print [[STRING|string]] before actually printing it. * Can be used with variable-width fonts or built-in fonts, unlike [[_FONTWIDTH]] which requires a MONOSPACE font handle. * In SCREEN 0, _PRINTWIDTH returns the character length of a text string, exactly as [[LEN]]({{Parameter|textToPrint$}}) ('''version 1.000 and up'''). @@ -16,7 +18,7 @@ The [[_PRINTWIDTH]] function returns the width in pixels of the text [[STRING|st {{PageExamples}} ''Example:'' SUB returns font or screen mode's text block size using _PRINTWIDTH and [[_FONTHEIGHT]] without a handle parameter. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DO}} {{Cl|INPUT}} "Enter Screen mode 1, 2 or 7 to 13: ", scr$ mode% = {{Cl|VAL}}(scr$) @@ -24,22 +26,22 @@ The [[_PRINTWIDTH]] function returns the width in pixels of the text [[STRING|st {{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$ -height& = {{Cl|VAL}}(hi$) -{{Cl|IF}} height& > 0 {{Cl|THEN}} {{Cl|_FONT}} {{Cl|_LOADFONT}}("C:\Windows\Fonts\" + TTFont$ + ".ttf", height&, style$) +height& = {{Cl|VAL}}(hi$) +{{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 +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 -TextHeight& = {{Cl|_FONTHEIGHT}} 'can measure normal text block heights also -{{Cl|END SUB}} '' '' +{{Cl|SUB}} TextSize (TextWidth&, TextHeight&) +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> +
'''Note:''' The SUB procedure does not need the font handle for font sizes after [[_FONT]] enables one.
{{PageSeeAlso}} @@ -50,4 +52,4 @@ TextHeight& = {{Cl|_FONTHEIGHT}} 'can measure normal text block heig {{PageNavigation}} -< + diff --git a/internal/help/_PUTIMAGE.txt b/internal/help/_PUTIMAGE__11111111.txt similarity index 71% rename from internal/help/_PUTIMAGE.txt rename to internal/help/_PUTIMAGE__11111111.txt index e97589fc5..0e3117286 100644 --- a/internal/help/_PUTIMAGE.txt +++ b/internal/help/_PUTIMAGE__11111111.txt @@ -1,25 +1,27 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:04}} {{DISPLAYTITLE:_PUTIMAGE}} [[_PUTIMAGE]] puts an area of a source image to an area of a destination image in one operation, like [[GET (graphics statement)|GET]] and [[PUT (graphics statement)|PUT]]. {{PageSyntax}} -:[[_PUTIMAGE]] [STEP] [({{Parameter|dx1}}, {{Parameter|dy1}})-[STEP][({{Parameter|dx2}}, {{Parameter|dy2}})]][, {{Parameter|sourceHandle&}}][, {{Parameter|destHandle&}}][, ][STEP][({{Parameter|sx1}}, {{Parameter|sy1}})[-STEP][({{Parameter|sx2}}, {{Parameter|sy2}})]][''_SMOOTH''] +:[[_PUTIMAGE]] [STEP] [({{Parameter|dx1}}, {{Parameter|dy1}})-[STEP][({{Parameter|dx2}}, {{Parameter|dy2}})]][, {{Parameter|sourceHandle&}}][, {{Parameter|destHandle&}}][, ][STEP][({{Parameter|sx1}}, {{Parameter|sy1}})[-STEP][({{Parameter|sx2}}, {{Parameter|sy2}})]][''_SMOOTH''] ===Sample usage=== ::[[_PUTIMAGE]] {{text|'full source image to fit full destination area after [[_SOURCE]] and [[_DEST]] are set}} -::[[_PUTIMAGE]] , {{Parameter|sourceHandle&}}, {{Parameter|destHandle&}} {{text|'size full source to fit full destination area}} +::[[_PUTIMAGE]] , {{Parameter|sourceHandle&}}, {{Parameter|destHandle&}} {{text|'size full source to fit full destination area}} -::[[_PUTIMAGE]] (''dx1'', ''dy1''), {{Parameter|sourceHandle&}}, {{Parameter|destHandle&}} {{text|'full source to top-left corner destination position}} +::[[_PUTIMAGE]] (''dx1'', ''dy1''), {{Parameter|sourceHandle&}}, {{Parameter|destHandle&}} {{text|'full source to top-left corner destination position}} -::[[_PUTIMAGE]] (''dx1'', ''dy1'')-(''dx2'', ''dy2''), {{Parameter|sourceHandle&}}, {{Parameter|destHandle&}} {{text|'size full source to destination coordinate area}} +::[[_PUTIMAGE]] (''dx1'', ''dy1'')-(''dx2'', ''dy2''), {{Parameter|sourceHandle&}}, {{Parameter|destHandle&}} {{text|'size full source to destination coordinate area}} -::[[_PUTIMAGE]] (''dx1'', ''dy1''), {{Parameter|sourceHandle&}}, {{Parameter|destHandle&}}, (''sx1'', ''sy1'')-(''sx2'', ''sy2'') {{text|'portion of source to the top-left corner of the destination page}} +::[[_PUTIMAGE]] (''dx1'', ''dy1''), {{Parameter|sourceHandle&}}, {{Parameter|destHandle&}}, (''sx1'', ''sy1'')-(''sx2'', ''sy2'') {{text|'portion of source to the top-left corner of the destination page}} -::[[_PUTIMAGE]] , {{Parameter|sourceHandle&}}, {{Parameter|destHandle&}}, (''sx1'', ''sy1'')-(''sx2'', ''sy2'') {{text|'portion of source to full destination area}} +::[[_PUTIMAGE]] , {{Parameter|sourceHandle&}}, {{Parameter|destHandle&}}, (''sx1'', ''sy1'')-(''sx2'', ''sy2'') {{text|'portion of source to full destination area}} -::[[_PUTIMAGE]] (''dx1'', ''dy1'')-(''dx2'', ''dy2''), {{Parameter|sourceHandle&}}, {{Parameter|destHandle&}},(''sx1'', ''sy1'') {{text|'right side of source from top-left corner to destination}} +::[[_PUTIMAGE]] (''dx1'', ''dy1'')-(''dx2'', ''dy2''), {{Parameter|sourceHandle&}}, {{Parameter|destHandle&}},(''sx1'', ''sy1'') {{text|'right side of source from top-left corner to destination}} ::Note: The top-left corner position designates the leftmost and topmost portion of the image to use. @@ -32,8 +34,8 @@ ** {{Parameter|dy1}} = the row coordinate at which the insertion of the source will begin (topmost); when larger than ''dy2'', inverts image. ** {{Parameter|dx2}} = the column coordinate at which the insertion of the source will end (rightmost); further apart, widens image. ** {{Parameter|dy2}} = the row coordinate at which the insertion of the source will end (bottommost); closer together, shrinks image -* {{Parameter|sourceHandle&}} = the [[LONG]] handle of the [[_SOURCE|source]] image created with [[_NEWIMAGE]], [[_LOADIMAGE]] or [[_COPYIMAGE]]. -* {{Parameter|destHandle&}} = the [[LONG]] handle of the [[_DEST|destination]] image may be created with [[_NEWIMAGE]], [[SCREEN]] or [[_DEST|destination]] 0. +* {{Parameter|sourceHandle&}} = the [[LONG]] handle of the [[_SOURCE|source]] image created with [[_NEWIMAGE]], [[_LOADIMAGE]] or [[_COPYIMAGE]]. +* {{Parameter|destHandle&}} = the [[LONG]] handle of the [[_DEST|destination]] image may be created with [[_NEWIMAGE]], [[SCREEN]] or [[_DEST|destination]] 0. * Coordinates ''sx'' and ''sy'' [[GET (graphics statement)|GET]] the box area of the [[_SOURCE|source]] image to transfer to the [[_DEST|destination]] image, page or [[SCREEN|screen]]: ** {{Parameter|sx1}} = the column coordinate of the left-most pixel to include of the source. When omitted, the entire image is used ** {{Parameter|sy1}} = the row coordinate of the upper-most pixel to include of the source. When omitted, the entire image is used @@ -41,13 +43,13 @@ ** {{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> +
'''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.'''
{{PageDescription}} * _PUTIMAGE can be used without any handle parameters if the [[_SOURCE]] and/or [[_DEST]] are already defined. * 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. +* 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". * '''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. @@ -59,39 +61,38 @@ {{PageExamples}} ''Example 1:'' -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN (statement)|SCREEN}} 13 - a& = {{Cl|_NEWIMAGE}}(640, 200, 13) ' creates a 640 * 200 image with the {{Cl|LONG}} handle a& - {{Cl|_DEST}} a& ' makes image a& the default drawing output. + a& = {{Cl|_NEWIMAGE}}(640, 200, 13) ' creates a 640 * 200 image with the {{Cl|LONG}} handle a& + {{Cl|_DEST}} a& ' makes image a& the default drawing output. {{Cl|LINE}} (10, 10)-(100, 100), 12, BF ' draws a filled box (BF) into destination - {{Cl|_PUTIMAGE}} (0, 0)-(320, 200), a&, 0, (0, 0)-(320, 200) '' '' -'' '' -{{CodeEnd}} '' '' + {{Cl|_PUTIMAGE}} (0, 0)-(320, 200), a&, 0, (0, 0)-(320, 200) +{{CodeEnd}} :''Explanation:'' : 1) A graphics mode is set by using [[SCREEN (statement)|SCREEN]] 13 which can use up to 256 colors. : 2) A new image is created that is 640 X 200 and uses the palette compatible with SCREEN 13 (256 colors). -: 3) [[_DEST]] a& makes the image with handle 'a&' the default image to draw on instead of the screen (which is [[_DEST]] 0). -: 4) Next a filled box (BF) is drawn from 10, 10 to 100, 100 with red color (12) to the destination image (set by [[_DEST]] a&) -: 5) Now we put the image from 0, 0 to 320, 200 from the image with the handle 'a&' to the screen (always handle 0) and puts this image into the coordinates 0, 0 to 320, 200. If we want to stretch the image we can alter these coordinates. +: 3) [[_DEST]] a& makes the image with handle 'a&' the default image to draw on instead of the screen (which is [[_DEST]] 0). +: 4) Next a filled box (BF) is drawn from 10, 10 to 100, 100 with red color (12) to the destination image (set by [[_DEST]] a&) +: 5) Now we put the image from 0, 0 to 320, 200 from the image with the handle 'a&' to the screen (always handle 0) and puts this image into the coordinates 0, 0 to 320, 200. If we want to stretch the image we can alter these coordinates. -:'''Note:''' All arguments are optional. If you want to simply put the whole image of the source to the whole image of the destination then you omit the area (x, y)-(x2, y2) on both sides, the last line of the example can be replaced by [[_PUTIMAGE]] , a&, 0 which indeed will stretch the image since image a& is bigger than the screen (the screen is 320 * 200 and a& is 640 * 200) +:'''Note:''' All arguments are optional. If you want to simply put the whole image of the source to the whole image of the destination then you omit the area (x, y)-(x2, y2) on both sides, the last line of the example can be replaced by [[_PUTIMAGE]] , a&, 0 which indeed will stretch the image since image a& is bigger than the screen (the screen is 320 * 200 and a& is 640 * 200) ''Example 2: ''You don't need to do anything special to use a .PNG image with alpha/transparency. Here's a simple example: -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, 32) {{Cl|CLS}} , {{Cl|_RGB}}(0, 255, 0) i = {{Cl|_LOADIMAGE}}('''"QB64.PNG"''') 'any 32 bit image (ie. with alpha channel) {{Cl|_PUTIMAGE}} (0, 0), i ' places image at upper left corner of window w/o stretching it -'' '' -{{CodeEnd}} '' '' + +{{CodeEnd}} : ''Explanation:'' When QB64 loads a 256 color .PNG file containing a transparent color, that color will be treated as transparent when _PUTIMAGE is used to put it onto another image. So actually, you can use a 256-color .PNG file containing transparency information in a 256 color screen mode in QB64. ''Example 3:'' Flipping and enlarging an image with _PUTIMAGE by swapping or increasing the desination coordinates. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|DEFLNG}} A-Z dest_handle = {{Cl|_NEWIMAGE}}(640, 480, 32) {{Cl|SCREEN (statement)|SCREEN}} dest_handle '32 bit Screen 12 dimensions @@ -123,56 +124,56 @@ K$ = {{Cl|INPUT$}}(1) {{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}} 24, 2: -{{Cl|PRINT}} "_PUTIMAGE (dx1, dy1)-((2 * dx2) + dx1, (2 * dy2) + dy1), s_handle, d_handle '' '' -{{Cl|END}} '' '' +{{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}} ''Example 4:'' Using _PUTIMAGE to scroll a larger image created on a separate [[_NEWIMAGE]] screen page with QB64. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|RANDOMIZE}} {{Cl|TIMER}} -ws& = {{Cl|_NEWIMAGE}}(2560, 1440, 32) 'large image page -s& = {{Cl|_NEWIMAGE}}(1280, 720, 32)' program screen +ws& = {{Cl|_NEWIMAGE}}(2560, 1440, 32) 'large image page +s& = {{Cl|_NEWIMAGE}}(1280, 720, 32)' program screen -{{Cl|_DEST}} ws& 'create large image of random filled circles +{{Cl|_DEST}} ws& 'create large image of random filled circles {{Cl|FOR...NEXT|FOR}} i = 1 {{Cl|TO}} 50 x = {{Cl|RND}}(1) * 2560 y = {{Cl|RND}}(1) * 1440 - clr& = {{Cl|_RGB32}}({{Cl|RND}}(1) * 255, {{Cl|RND}}(1) * 255, {{Cl|RND}}(1) * 255) - {{Cl|CIRCLE}} (x, y), {{Cl|RND}}(1) * 300, clr& - {{Cl|PAINT}} (x, y), clr& + clr& = {{Cl|_RGB32}}({{Cl|RND}}(1) * 255, {{Cl|RND}}(1) * 255, {{Cl|RND}}(1) * 255) + {{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." x = 0: y = 0 -{{Cl|SCREEN}} s& +{{Cl|SCREEN}} s& DO {{Cl|CLS}} - {{Cl|_PUTIMAGE}} (0, 0), ws&, 0, (x, y)-(x + 1279, y + 719) + {{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}} "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}} "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|END SELECT}} {{Cl|_DISPLAY}} -{{Cl|LOOP}} '' '' +{{Cl|LOOP}} {{CodeEnd}}{{small|Code example by SMcNeill}} ''Example 5:'' _PUTIMAGE can be used with no parameters at all if the [[_SOURCE]] and [[_DEST]] are already set. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 13 -h& = {{Cl|_NEWIMAGE}}(640, 480, 256) -{{Cl|_DEST}} h& +h& = {{Cl|_NEWIMAGE}}(640, 480, 256) +{{Cl|_DEST}} h& {{Cl|_PRINTSTRING}} (10, 10), "This _PUTIMAGE used no parameters!" -{{Cl|_SOURCE}} h& +{{Cl|_SOURCE}} h& {{Cl|_DEST}} 0 {{Cl|_PUTIMAGE}} -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} @@ -191,4 +192,4 @@ h& = {{Cl|_NEWIMAGE}}(640, 480, 256) {{PageNavigation}} -< + diff --git a/internal/help/_R2D.txt b/internal/help/_R2D__121.txt similarity index 78% rename from internal/help/_R2D.txt rename to internal/help/_R2D__121.txt index 6ce3fd0ab..14aa9f6af 100644 --- a/internal/help/_R2D.txt +++ b/internal/help/_R2D__121.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:05}} {{DISPLAYTITLE:_R2D}} The [[_R2D]] function converts a '''radian''' value into a '''degree''' value. @@ -6,8 +8,9 @@ The [[_R2D]] function converts a '''radian''' value into a '''degree''' value. : {{Parameter|result!}} = [[_R2D]]({{Parameter|num}}) -==Availability== -* '''Version 1.000 and up.''' +{{PageAvailability}} +* '''QB64 1.0 and up''' (QB64 Team) +* '''QBPE 0.5 and up''' (QB64 Phoenix Edition) {{PageExamples}} @@ -31,4 +34,4 @@ That angle in Degrees is 28.64789 {{PageNavigation}} -< + diff --git a/internal/help/_R2G.txt b/internal/help/_R2G__121.txt similarity index 78% rename from internal/help/_R2G.txt rename to internal/help/_R2G__121.txt index f57fdacb0..742d0c576 100644 --- a/internal/help/_R2G.txt +++ b/internal/help/_R2G__121.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:07}} {{DISPLAYTITLE:_R2G}} The [[_R2G]] function converts a '''radian''' value into a '''gradient''' value. @@ -6,8 +8,9 @@ The [[_R2G]] function converts a '''radian''' value into a '''gradient''' value. : {{Parameter|result!}} = [[_R2G]]({{Parameter|num}}) -==Availability== -* '''Version 1.000 and up.''' +{{PageAvailability}} +* '''QB64 1.0 and up''' (QB64 Team) +* '''QBPE 0.5 and up''' (QB64 Phoenix Edition) {{PageExamples}} @@ -31,4 +34,4 @@ That angle in Gradient is 31.83099 {{PageNavigation}} -< + diff --git a/internal/help/_READBIT.txt b/internal/help/_READBIT__1111111.txt similarity index 87% rename from internal/help/_READBIT.txt rename to internal/help/_READBIT__1111111.txt index 2e203a42e..29c608463 100644 --- a/internal/help/_READBIT.txt +++ b/internal/help/_READBIT__1111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:10}} {{DISPLAYTITLE:_READBIT}} The [[_READBIT]] function is used to check the state of a specified bit of a integer value. @@ -37,15 +39,15 @@ And bit 2 is currently OFF ''Example 2:'' {{CodeStart}} -B& = 12589575 -{{Cl|PRINT}} "B& ="; B& +B& = 12589575 +{{Cl|PRINT}} "B& ="; B& FOR I%% = 31 TO 0 STEP -1 '32 bits for a {{Cl|LONG}} value - Binary$ = Binary$ + {{Cl|LTRIM$}}({{Cl|STR$}}({{Cl|ABS}}({{Cl|_READBIT}}(B&, I%%)))) + Binary$ = Binary$ + {{Cl|LTRIM$}}({{Cl|STR$}}({{Cl|ABS}}({{Cl|_READBIT}}(B&, I%%)))) NEXT I%% -{{Cl|PRINT}} "B& in binary is: "; Binary${{CodeEnd}} +{{Cl|PRINT}} "B& in binary is: "; Binary${{CodeEnd}} {{OutputStart}} -B& = 12589575 -B& in binary is: 00000000110000000001101000000111 +B& = 12589575 +B& in binary is: 00000000110000000001101000000111 {{OutputEnd}} @@ -55,4 +57,4 @@ B& in binary is: 00000000110000000001101000000111 * [[_RESETBIT]], [[_TOGGLEBIT]] {{PageNavigation}} -< + diff --git a/internal/help/_RED.txt b/internal/help/_RED.txt deleted file mode 100644 index dfb41dd66..000000000 --- a/internal/help/_RED.txt +++ /dev/null @@ -1,32 +0,0 @@ -{{DISPLAYTITLE:_RED}} -The [[_RED]] function returns the palette index or the red component intensity of a 32-bit image color. - - -{{PageSyntax}} -: {{Parameter|redIntensity&}} = [[_RED]]({{Parameter|rgbaColorIndex&}}[, {{Parameter|imageHandle&}}]) - - -{{PageDescription}} -* {{Parameter|rgbaColorIndex&}} is the ''RGBA'' color value or palette index of the color to retrieve the red component intensity from. -* The [[LONG]] intensity value returned ranges from 0 (no intensity, not present) to 255 (full intensity). -* {{Parameter|imageHandle&}} is optional. -* If {{Parameter|imageHandle&}} specifies a 32-bit color image, {{Parameter|rgbaColorIndex&}} is interpreted as a 32-bit ''RGBA'' color value. -* If {{Parameter|imageHandle&}} specifies an image that uses a palette, {{Parameter|rgbaColorIndex&}} is interpreted as a palette index. -* If {{Parameter|imageHandle&}} is not specified, it is assumed to be the current write page. -* If {{Parameter|imageHandle&}} is an invalid handle, an [[ERROR Codes|invalid handle]] error occurs. -* If {{Parameter|rgbaColorIndex&}} is outside the range of valid indexes for a given image mode, an [[ERROR Codes|illegal function call]] error occurs. -* Uses index parameters passed by the [[_RGB]], [[_RGBA]], [[_RGB32]] or [[_RGBA32]] functions. - - -{{PageExamples}} -* See the example in [[POINT]]. - - -{{PageSeeAlso}} -* [[_GREEN]], [[_BLUE]] -* [[_RGB]], [[RGB32]] -* [[_LOADIMAGE]] - - -{{PageNavigation}} -< diff --git a/internal/help/_RED32.txt b/internal/help/_RED32__11132.txt similarity index 71% rename from internal/help/_RED32.txt rename to internal/help/_RED32__11132.txt index eeff13e68..0c148a9d8 100644 --- a/internal/help/_RED32.txt +++ b/internal/help/_RED32__11132.txt @@ -1,13 +1,15 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:09}} {{DISPLAYTITLE:_RED32}} The [[_RED32]] function returns the red component intensity of a 32-bit image or surface color. {{PageSyntax}} -: {{Parameter|red32color&}} = [[_RED32]]({{Parameter|rgbaColor&}}) +: {{Parameter|red32color&}} = [[_RED32]]({{Parameter|rgbaColor&}}) {{PageDescription}} -* {{Parameter|rgbaColor&}} is the 32-bit ''RGBA'' color value to retrieve the red component intensity value from. +* {{Parameter|rgbaColor&}} is the 32-bit ''RGBA'' color value to retrieve the red component intensity value from. * ''RGBA'' color values are returned by the [[_PALETTECOLOR (function)|_PALETTECOLOR]], [[POINT]], [[_RGB]], [[_RGB32]], [[_RGBA]] or [[_RGBA32]] functions. * [[LONG]] intensity values returned range from 0 (no intensity, not present) to 255 (full intensity). @@ -22,4 +24,4 @@ The [[_RED32]] function returns the red component intensity of a 32-bit image or {{PageNavigation}} -< + diff --git a/internal/help/_RED__111.txt b/internal/help/_RED__111.txt new file mode 100644 index 000000000..56e6a268b --- /dev/null +++ b/internal/help/_RED__111.txt @@ -0,0 +1,34 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:08}} +{{DISPLAYTITLE:_RED}} +The [[_RED]] function returns the palette index or the red component intensity of a 32-bit image color. + + +{{PageSyntax}} +: {{Parameter|redIntensity&}} = [[_RED]]({{Parameter|rgbaColorIndex&}}[, {{Parameter|imageHandle&}}]) + + +{{PageDescription}} +* {{Parameter|rgbaColorIndex&}} is the ''RGBA'' color value or palette index of the color to retrieve the red component intensity from. +* The [[LONG]] intensity value returned ranges from 0 (no intensity, not present) to 255 (full intensity). +* {{Parameter|imageHandle&}} is optional. +* If {{Parameter|imageHandle&}} specifies a 32-bit color image, {{Parameter|rgbaColorIndex&}} is interpreted as a 32-bit ''RGBA'' color value. +* If {{Parameter|imageHandle&}} specifies an image that uses a palette, {{Parameter|rgbaColorIndex&}} is interpreted as a palette index. +* If {{Parameter|imageHandle&}} is not specified, it is assumed to be the current write page. +* If {{Parameter|imageHandle&}} is an invalid handle, an [[ERROR Codes|invalid handle]] error occurs. +* If {{Parameter|rgbaColorIndex&}} is outside the range of valid indexes for a given image mode, an [[ERROR Codes|illegal function call]] error occurs. +* Uses index parameters passed by the [[_RGB]], [[_RGBA]], [[_RGB32]] or [[_RGBA32]] functions. + + +{{PageExamples}} +* See the example in [[POINT]]. + + +{{PageSeeAlso}} +* [[_GREEN]], [[_BLUE]] +* [[_RGB]], [[RGB32]] +* [[_LOADIMAGE]] + + +{{PageNavigation}} + diff --git a/internal/help/_RESETBIT.txt b/internal/help/_RESETBIT__11111111.txt similarity index 96% rename from internal/help/_RESETBIT.txt rename to internal/help/_RESETBIT__11111111.txt index 9e5556e24..a08eed403 100644 --- a/internal/help/_RESETBIT.txt +++ b/internal/help/_RESETBIT__11111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:12}} {{DISPLAYTITLE:_RESETBIT}} The [[_RESETBIT]] function is used to set a specified bit of a numerical value to 0 (OFF state). @@ -44,4 +46,4 @@ A~%% = {{Cl|_RESETBIT}}(A~%%,6) 'Reset the seventh bit of A~%% * [[_READBIT]], [[_TOGGLEBIT]] {{PageNavigation}} -< + diff --git a/internal/help/_RESIZEHEIGHT.txt b/internal/help/_RESIZEHEIGHT__111111111111.txt similarity index 65% rename from internal/help/_RESIZEHEIGHT.txt rename to internal/help/_RESIZEHEIGHT__111111111111.txt index 5a0946f0c..dbddf10db 100644 --- a/internal/help/_RESIZEHEIGHT.txt +++ b/internal/help/_RESIZEHEIGHT__111111111111.txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:17}} {{DISPLAYTITLE:_RESIZEHEIGHT}} The [[_RESIZEHEIGHT]] function returns the user resized screen pixel height if [[$RESIZE]]:ON allows it and [[_RESIZE (function)|_RESIZE]] returns -1 {{PageSyntax}} -: {{Parameter|newHeight&}} = [[_RESIZEHEIGHT]] +: {{Parameter|newHeight&}} = [[_RESIZEHEIGHT]] {{Parameter|Details:}} @@ -20,25 +22,25 @@ The [[_RESIZEHEIGHT]] function returns the user resized screen pixel height if [ {{CodeStart}} {{Cl|$RESIZE}}:ON -s& = {{Cl|_NEWIMAGE}}(300, 300, 32) -{{Cl|SCREEN}} s& +s& = {{Cl|_NEWIMAGE}}(300, 300, 32) +{{Cl|SCREEN}} s& -bee& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'any image +bee& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'any image {{Cl|DO}} {{Cl|IF}} {{Cl|_RESIZE (function)|_RESIZE}} THEN - oldimage& = s& - s& = _NEWIMAGE(_RESIZEWIDTH, _RESIZEHEIGHT, 32) - SCREEN s& - {{Cl|_FREEIMAGE}} oldimage& + oldimage& = s& + s& = _NEWIMAGE(_RESIZEWIDTH, _RESIZEHEIGHT, 32) + SCREEN s& + {{Cl|_FREEIMAGE}} oldimage& END IF {{Cl|CLS}} 'Center the QB64 bee image: - x = {{Cl|_WIDTH (function)|_WIDTH}} / 2 - _WIDTH(bee&) / 2 - y = {{Cl|_HEIGHT}} / 2 - _HEIGHT(bee&) / 2 - {{Cl|_PUTIMAGE}} (x, y), bee& + x = {{Cl|_WIDTH (function)|_WIDTH}} / 2 - _WIDTH(bee&) / 2 + y = {{Cl|_HEIGHT}} / 2 - _HEIGHT(bee&) / 2 + {{Cl|_PUTIMAGE}} (x, y), bee& {{Cl|_DISPLAY}} {{Cl|_LIMIT}} 30 {{Cl|LOOP}} @@ -52,4 +54,4 @@ bee& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'any image {{PageNavigation}} -< + diff --git a/internal/help/_RESIZEWIDTH.txt b/internal/help/_RESIZEWIDTH__11111111111.txt similarity index 65% rename from internal/help/_RESIZEWIDTH.txt rename to internal/help/_RESIZEWIDTH__11111111111.txt index 3ebb2ef52..07ac13922 100644 --- a/internal/help/_RESIZEWIDTH.txt +++ b/internal/help/_RESIZEWIDTH__11111111111.txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:18}} {{DISPLAYTITLE:_RESIZEWIDTH}} The [[_RESIZEWIDTH]] function returns the user resized screen pixel width if [[$RESIZE]]:ON allows it and [[_RESIZE (function)|_RESIZE]] returns -1 {{PageSyntax}} -: {{Parameter|newWidth&}} = [[_RESIZEWIDTH]] +: {{Parameter|newWidth&}} = [[_RESIZEWIDTH]] {{PageDescription}} @@ -20,25 +22,25 @@ The [[_RESIZEWIDTH]] function returns the user resized screen pixel width if [[$ {{CodeStart}} {{Cl|$RESIZE}}:ON -s& = {{Cl|_NEWIMAGE}}(300, 300, 32) -{{Cl|SCREEN}} s& +s& = {{Cl|_NEWIMAGE}}(300, 300, 32) +{{Cl|SCREEN}} s& -bee& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'any image +bee& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'any image {{Cl|DO}} {{Cl|IF}} {{Cl|_RESIZE (function)|_RESIZE}} THEN - oldimage& = s& - s& = _NEWIMAGE(_RESIZEWIDTH, _RESIZEHEIGHT, 32) - SCREEN s& - {{Cl|_FREEIMAGE}} oldimage& + oldimage& = s& + s& = _NEWIMAGE(_RESIZEWIDTH, _RESIZEHEIGHT, 32) + SCREEN s& + {{Cl|_FREEIMAGE}} oldimage& END IF {{Cl|CLS}} 'Center the QB64 bee image: - x = {{Cl|_WIDTH (function)|_WIDTH}} / 2 - _WIDTH(bee&) / 2 - y = {{Cl|_HEIGHT}} / 2 - _HEIGHT(bee&) / 2 - {{Cl|_PUTIMAGE}} (x, y), bee& + x = {{Cl|_WIDTH (function)|_WIDTH}} / 2 - _WIDTH(bee&) / 2 + y = {{Cl|_HEIGHT}} / 2 - _HEIGHT(bee&) / 2 + {{Cl|_PUTIMAGE}} (x, y), bee& {{Cl|_DISPLAY}} {{Cl|_LIMIT}} 30 {{Cl|LOOP}} @@ -52,4 +54,4 @@ bee& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'any image {{PageNavigation}} -< + diff --git a/internal/help/_RESIZE_(function).txt b/internal/help/_RESIZE_(function)__111111_(00000000).txt similarity index 67% rename from internal/help/_RESIZE_(function).txt rename to internal/help/_RESIZE_(function)__111111_(00000000).txt index 2442e7a27..e8af67e63 100644 --- a/internal/help/_RESIZE_(function).txt +++ b/internal/help/_RESIZE_(function)__111111_(00000000).txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:16}} {{DISPLAYTITLE:_RESIZE (function)}} The [[_RESIZE]] function returns true (-1) when a user has attempted to resize the program window and [[$RESIZE]]:ON has allowed it. {{PageSyntax}} -: IF '''_RESIZE''' THEN rx& = [[_RESIZEWIDTH]]: ry& = [[_RESIZEHEIGHT]] +: IF '''_RESIZE''' THEN rx& = [[_RESIZEWIDTH]]: ry& = [[_RESIZEHEIGHT]] {{PageDescription}} @@ -21,25 +23,25 @@ The [[_RESIZE]] function returns true (-1) when a user has attempted to resize t {{CodeStart}} {{Cl|$RESIZE}}:ON -s& = {{Cl|_NEWIMAGE}}(300, 300, 32) -{{Cl|SCREEN}} s& +s& = {{Cl|_NEWIMAGE}}(300, 300, 32) +{{Cl|SCREEN}} s& -bee& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'any image +bee& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'any image {{Cl|DO}} {{Cl|IF}} {{Cl|_RESIZE (function)|_RESIZE}} THEN - oldimage& = s& - s& = _NEWIMAGE(_RESIZEWIDTH, _RESIZEHEIGHT, 32) - SCREEN s& - {{Cl|_FREEIMAGE}} oldimage& + oldimage& = s& + s& = _NEWIMAGE(_RESIZEWIDTH, _RESIZEHEIGHT, 32) + SCREEN s& + {{Cl|_FREEIMAGE}} oldimage& END IF {{Cl|CLS}} 'Center the QB64 bee image: - x = {{Cl|_WIDTH (function)|_WIDTH}} / 2 - _WIDTH(bee&) / 2 - y = {{Cl|_HEIGHT}} / 2 - _HEIGHT(bee&) / 2 - {{Cl|_PUTIMAGE}} (x, y), bee& + x = {{Cl|_WIDTH (function)|_WIDTH}} / 2 - _WIDTH(bee&) / 2 + y = {{Cl|_HEIGHT}} / 2 - _HEIGHT(bee&) / 2 + {{Cl|_PUTIMAGE}} (x, y), bee& {{Cl|_DISPLAY}} {{Cl|_LIMIT}} 30 {{Cl|LOOP}} @@ -53,4 +55,4 @@ bee& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'any image {{PageNavigation}} -< + diff --git a/internal/help/_RESIZE.txt b/internal/help/_RESIZE__111111.txt similarity index 92% rename from internal/help/_RESIZE.txt rename to internal/help/_RESIZE__111111.txt index df4822bf6..8f14f7a95 100644 --- a/internal/help/_RESIZE.txt +++ b/internal/help/_RESIZE__111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:14}} {{DISPLAYTITLE:_RESIZE}} The [[_RESIZE]] statement sets resizing of the window ON or OFF and sets the method as _STRETCH or _SMOOTH. @@ -24,4 +26,4 @@ The [[_RESIZE]] statement sets resizing of the window ON or OFF and sets the met {{PageNavigation}} -< + diff --git a/internal/help/_RGB.txt b/internal/help/_RGB.txt deleted file mode 100644 index f9390e458..000000000 --- a/internal/help/_RGB.txt +++ /dev/null @@ -1,67 +0,0 @@ -{{DISPLAYTITLE:_RGB}} -The [[_RGB]] function returns the closest palette attribute index (legacy SCREEN modes) OR the [[LONG]] 32-bit color value (32-bit screens). - - -{{PageSyntax}} -: {{Parameter|colorIndex~&}} = [[_RGB]]({{Parameter|red&}}, {{Parameter|green&}}, {{Parameter|blue&}}[, {{Parameter|imageHandle&}}]) - - -{{PageDescription}} -* The value returned is either the closest color attribute number or a 32-bit [[_UNSIGNED]] [[LONG]] color value. -* '''Return variable types must be [[LONG]] or resulting color may lose the [[_BLUE]] value.''' -* {{Parameter|red&}} specifies the red component intensity from 0 to 255. -* {{Parameter|green&}} specifies the green component intensity from 0 to 255. -* {{Parameter|blue&}} specifies the blue component intensity from 0 to 255. -* Intensity values outside the valid 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]]. -* When [[LONG]] values are [[PUT]] to file, the ARGB values become BGRA. Use [[LEFT$]]([[MKL$]]({{Parameter|colorIndex~&}}), 3) to place 3 colors. -* If the {{Parameter|imageHandle&}} is omitted the image is assumed to be the current [[_DEST|destination]] or [[SCREEN]] page. -* 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.''' - - -{{PageExamples}} -''Example:'' Converting the color port RGB intensity palette values 0 to 63 to 32 bit hexadecimal values. -{{CodeStart}} -{{Cl|SCREEN}} 12 -{{Cl|DIM}} hex32$(15) -{{Cl|FOR...NEXT|FOR}} attribute = 1 {{Cl|TO}} 15 - {{Cl|OUT}} {{Cl|&H}}3C7, attribute 'set color attribute to read - 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 - {{Cl|COLOR}} 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}} -{{OutputEnd}} -:''Note:'' This procedure also shows how the returns from [[_RGB]] and [[_RGB32]] differ in a non-32 bit screen mode. - - -{{PageSeeAlso}} -* [[_RGBA]], [[_RGB32]], [[_RGBA32]] -* [[_RED]], [[_GREEN]], [[_BLUE]] -* [[_LOADIMAGE]], [[_NEWIMAGE]] -* [[HEX$ 32 Bit Values]], [[POINT]] -* [[SAVEIMAGE]] -* [http://www.w3schools.com/html/html_colornames.asp Hexadecimal Color Values] - - -{{PageNavigation}} -< diff --git a/internal/help/_RGB32.txt b/internal/help/_RGB32__11132.txt similarity index 58% rename from internal/help/_RGB32.txt rename to internal/help/_RGB32__11132.txt index 87d702df1..88cb1fc0c 100644 --- a/internal/help/_RGB32.txt +++ b/internal/help/_RGB32__11132.txt @@ -1,34 +1,36 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:21}} {{DISPLAYTITLE:_RGB32}} 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&}}) +:{{Parameter|color32value~&}} = [[_RGB32]]({{Parameter|red&}}, {{Parameter|green&}}, {{Parameter|blue&}}) ''Alternative Syntax 2'': -:{{Parameter|color32value~&}} = [[_RGB32]]({{Parameter|red&}}, {{Parameter|green&}}, {{Parameter|blue&}}, {{Parameter|alpha&}}) +:{{Parameter|color32value~&}} = [[_RGB32]]({{Parameter|red&}}, {{Parameter|green&}}, {{Parameter|blue&}}, {{Parameter|alpha&}}) ''Alternative Syntax 3'': -:{{Parameter|color32value~&}} = [[_RGB32]]({{Parameter|intensity&}}, {{Parameter|alpha&}}) +:{{Parameter|color32value~&}} = [[_RGB32]]({{Parameter|intensity&}}, {{Parameter|alpha&}}) ''Alternative Syntax 4'': -:{{Parameter|color32value~&}} = [[_RGB32]]({{Parameter|intensity&}}) +:{{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. +* {{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 [[_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. +* 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. * '''NOTE: Default 32-bit backgrounds are clear black or [[_RGB32]](0, 0). Use [[CLS]] to make the black opaque.''' @@ -42,36 +44,36 @@ The [[_RGB32]] function returns the 32-bit ''RGBA'' color value with specified r {{Cl|SCREEN}} 12 {{Cl|DIM}} hex32$(15) {{Cl|FOR...NEXT|FOR}} attribute = 1 {{Cl|TO}} 15 - {{Cl|OUT}} {{Cl|&H}}3C7, attribute 'set color attribute to read - 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 + {{Cl|OUT}} {{Cl|&H}}3C7, attribute 'set color attribute to read + 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 {{Cl|COLOR}} attribute {{Cl|PRINT}} "{{Cl|COLOR}}" + {{Cl|STR$}}({{Cl|_RGB}}(red, grn, blu)) + " = " + hex32$(attribute) 'closest attribute -{{Cl|NEXT}} '' '' +{{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 = &HFF0000A8|#0000A8}} +{{text|COLOR 2 = &HFF00A800|#00A800}} +{{text|COLOR 3 = &HFF00A8A8|#00A8A8}} +{{text|COLOR 4 = &HFFA80000|#A80000}} +{{text|COLOR 5 = &HFFA800A8|#A800A8}} +{{text|COLOR 6 = &HFFA85400|#A85400}} +{{text|COLOR 7 = &HFFA8A8A8|#A8A8A8}} +{{text|COLOR 8 = &HFF545454|#545454}} +{{text|COLOR 9 = &HFF5454FC|#5454FC}} +{{text|COLOR 10 = &HFF54FC54|#54FC54}} +{{text|COLOR 11 = &HFF54FCFC|#54FCFC}} +{{text|COLOR 12 = &HFFFC5454|#FC5454}} +{{text|COLOR 13 = &HFFFC54FC|#FC54FC}} +{{text|COLOR 14 = &HFFFCFC54|#FCFC54}} +{{text|COLOR 15 = &HFFFCFCFC|#FCFCFC}} {{OutputEnd}} :''Note:'' This procedure also shows how the returns from [[_RGB]] and [[_RGB32]] differ in a non-32 bit screen mode. ''Example 2:'' Working with 32 bit colors. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, 32) {{Cl|CLS}} , {{Cl|_RGB32}}(0, 0, 128) 'deep blue background @@ -97,7 +99,7 @@ The [[_RGB32]] function returns the 32-bit ''RGBA'' color value with specified r {{Cl|PRINT}} {{Cl|LOCATE}} , 15: {{Cl|PRINT}} "NEAT, HUH?" {{Cl|SLEEP}} -SYSTEM '' '' +SYSTEM {{CodeEnd}}{{small|Code by Steve McNeill}} @@ -140,4 +142,4 @@ SYSTEM '' '' {{PageNavigation}} -< + diff --git a/internal/help/_RGBA32.txt b/internal/help/_RGBA32__111132.txt similarity index 62% rename from internal/help/_RGBA32.txt rename to internal/help/_RGBA32__111132.txt index f5e14b2b2..cd19fbf98 100644 --- a/internal/help/_RGBA32.txt +++ b/internal/help/_RGBA32__111132.txt @@ -1,37 +1,39 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:23}} {{DISPLAYTITLE:_RGBA32}} The [[_RGBA32]] function returns the 32-bit ''RGBA'' color value with the specified red, green, blue and alpha component intensities. {{PageSyntax}} -: {{Parameter|color32value~&}} = [[_RGBA32]]({{Parameter|red&}}, {{Parameter|green&}}, {{Parameter|blue&}}, {{Parameter|alpha&}}) +: {{Parameter|color32value~&}} = [[_RGBA32]]({{Parameter|red&}}, {{Parameter|green&}}, {{Parameter|blue&}}, {{Parameter|alpha&}}) {{PageDescription}} * The value returned is a 32-bit [[_UNSIGNED]] [[LONG]] color value. * '''Return variable types must be [[_UNSIGNED]] [[LONG]] or resulting color may lose the [[_BLUE]] value.''' -* {{Parameter|red&}} specifies the red component intensity from 0 to 255. -* {{Parameter|green&}} specifies the green component intensity from 0 to 255. -* {{Parameter|blue&}} specifies the blue component intensity from 0 to 255. -* {{Parameter|alpha&}} specifies the [[_ALPHA|''alpha'']] component transparency value from 0 (fully transparent) to 255 (opaque). +* {{Parameter|red&}} specifies the red component intensity from 0 to 255. +* {{Parameter|green&}} specifies the green component intensity from 0 to 255. +* {{Parameter|blue&}} specifies the blue component intensity from 0 to 255. +* {{Parameter|alpha&}} specifies the [[_ALPHA|''alpha'']] component transparency value from 0 (fully transparent) to 255 (opaque). * Alpha or intensity values outside of the valid range of 0 to 255 are clipped. -* Returns [[LONG]] 32-bit hexadecimal values from '''&H00{{text|00|red}}{{text|00|green}}{{text|00|blue}}''' to '''&HFF{{text|FF|red}}{{text|FF|green}}{{text|FF|blue}}''' with varying [[_ALPHA]] transparency. -* When [[LONG]] values are [[PUT]] to file, the ARGB values become BGRA. Use [[LEFT$]]([[MKL$]]({{Parameter|color32value~&}}), 3) to place 3 colors. +* Returns [[LONG]] 32-bit hexadecimal values from '''&H00{{text|00|red}}{{text|00|green}}{{text|00|blue}}''' to '''&HFF{{text|FF|red}}{{text|FF|green}}{{text|FF|blue}}''' with varying [[_ALPHA]] transparency. +* When [[LONG]] values are [[PUT]] to file, the ARGB values become BGRA. Use [[LEFT$]]([[MKL$]]({{Parameter|color32value~&}}), 3) to place 3 colors. * '''NOTE: Default 32-bit backgrounds are clear black or [[_RGBA]](0, 0, 0, 0). Use [[CLS]] to make the black opaque.''' {{PageExamples}} ''Example:'' Changing the [[ALPHA]] value to fade an image in and out using a 32 bit PNG image. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN (statement)|SCREEN}} {{Cl|_NEWIMAGE}}(600, 400, 32) -img& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'use any 24/32 bit image +img& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'use any 24/32 bit image 'Turn off auto display {{Cl|_DISPLAY}} ' Fade in {{Cl|FOR...NEXT|FOR}} i% = 255 {{Cl|TO}} 0 {{Cl|STEP}} -5 {{Cl|_LIMIT}} 20 'control fade speed - {{Cl|_PUTIMAGE}} (0, 0)-(600, 400), img& + {{Cl|_PUTIMAGE}} (0, 0)-(600, 400), img& {{Cl|LINE}} (0, 0)-(600, 400), {{Cl|_RGBA}}(0, 0, 0, i%), BF 'decrease black box transparency {{Cl|_DISPLAY}} {{Cl|NEXT}} @@ -39,11 +41,11 @@ img& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'use any 24/32 bit image ' Fade out {{Cl|FOR...NEXT|FOR}} i% = 0 {{Cl|TO}} 255 {{Cl|STEP}} 5 {{Cl|_LIMIT}} 20 'control fade speed - {{Cl|_PUTIMAGE}} (0, 0)-(600, 400), img& + {{Cl|_PUTIMAGE}} (0, 0)-(600, 400), img& {{Cl|LINE}} (0, 0)-(600, 400), {{Cl|_RGBA}}(0, 0, 0, i%), BF 'increase black box transparency {{Cl|_DISPLAY}} {{Cl|NEXT}} -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} {{small|Code by Unseen Machine}} @@ -57,4 +59,4 @@ img& = {{Cl|_LOADIMAGE}}("qb64_trans.png") 'use any 24/32 bit image {{PageNavigation}} -< + diff --git a/internal/help/_RGBA.txt b/internal/help/_RGBA__1111.txt similarity index 57% rename from internal/help/_RGBA.txt rename to internal/help/_RGBA__1111.txt index 496aba0cc..1cb9cf532 100644 --- a/internal/help/_RGBA.txt +++ b/internal/help/_RGBA__1111.txt @@ -1,39 +1,41 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:22}} {{DISPLAYTITLE:_RGBA}} The [[_RGBA]] function returns the closest palette index (legacy SCREEN modes) OR the 32-bit [[LONG]] color value (32-bit screens). {{PageSyntax}} -: {{Parameter|colorIndex~&}} = [[_RGBA]]({{Parameter|red&}}, {{Parameter|green&}}, {{Parameter|blue&}}, {{Parameter|alpha&}}[, {{Parameter|imageHandle&}}]''')''' +: {{Parameter|colorIndex~&}} = [[_RGBA]]({{Parameter|red&}}, {{Parameter|green&}}, {{Parameter|blue&}}, {{Parameter|alpha&}}[, {{Parameter|imageHandle&}}]''')''' * The value returned is either the closest color attribute number or a 32-bit [[_UNSIGNED]] [[LONG]] color value. * '''Return variable types must be [[LONG]] or the resulting color may lose the [[_BLUE]] value.''' -* {{Parameter|red&}} specifies the red component intensity from 0 to 255. -* {{Parameter|green&}} specifies the green component intensity from 0 to 255. -* {{Parameter|blue&}} specifies the blue component intensity from 0 to 255. -* The [[_ALPHA|''alpha&'']] value can be set to make the color transparent (0), opaque (255) or somewhere in between. +* {{Parameter|red&}} specifies the red component intensity from 0 to 255. +* {{Parameter|green&}} specifies the green component intensity from 0 to 255. +* {{Parameter|blue&}} specifies the blue component intensity from 0 to 255. +* The [[_ALPHA|''alpha&'']] value can be set to make the color transparent (0), opaque (255) or somewhere in between. * 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}}''' with varying [[_ALPHA]] transparency. -* When [[LONG]] values are [[PUT]] to file, the ARGB values become BGRA. Use [[LEFT$]]([[MKL$]]({{Parameter|colorIndex~&}}), 3) to place 3 colors. -* If {{Parameter|imageHandle&}} is omitted, the image is assumed to be the current [[_DEST|destination]] or [[SCREEN]] page. +* Returns [[LONG]] 32-bit hexadecimal values from '''&H00{{text|00|red}}{{text|00|green}}{{text|00|blue}}''' to '''&HFF{{text|FF|red}}{{text|FF|green}}{{text|FF|blue}}''' with varying [[_ALPHA]] transparency. +* When [[LONG]] values are [[PUT]] to file, the ARGB values become BGRA. Use [[LEFT$]]([[MKL$]]({{Parameter|colorIndex~&}}), 3) to place 3 colors. +* If {{Parameter|imageHandle&}} is omitted, the image is assumed to be the current [[_DEST|destination]] or [[SCREEN]] page. * Allows the blending of pixel colors red, green and blue to create any of 16 million colors. * '''NOTE: Default 32-bit backgrounds are clear black or [[_RGBA]](0, 0, 0, 0). Use [[CLS]] to make the black opaque.''' {{PageExamples}} ''Example:'' Setting a font's background color alpha to clear to overlay a second text color. -{{CodeStart}} '' '' -scrn& = {{Cl|_NEWIMAGE}}(400, 400, 32) -{{Cl|SCREEN (statement)|SCREEN}} scrn& -fnt& = {{Cl|_LOADFONT}}("C:\WINDOWS\FONTS\ARIAL.TTF", 26) -{{Cl|_FONT}} fnt& +{{CodeStart}} +scrn& = {{Cl|_NEWIMAGE}}(400, 400, 32) +{{Cl|SCREEN (statement)|SCREEN}} scrn& +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|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|END}} '' '' +{{Cl|END}} {{CodeEnd}} {{small|Code by Unseen Machine}} ''Explanation:'' [[_PRINTSTRING]] allows text or font colors to be alpha blended in 32 bit screens. @@ -50,4 +52,4 @@ Y% = 20 {{PageNavigation}} -< + diff --git a/internal/help/_RGB__111.txt b/internal/help/_RGB__111.txt new file mode 100644 index 000000000..27dd0d0dd --- /dev/null +++ b/internal/help/_RGB__111.txt @@ -0,0 +1,69 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:20}} +{{DISPLAYTITLE:_RGB}} +The [[_RGB]] function returns the closest palette attribute index (legacy SCREEN modes) OR the [[LONG]] 32-bit color value (32-bit screens). + + +{{PageSyntax}} +: {{Parameter|colorIndex~&}} = [[_RGB]]({{Parameter|red&}}, {{Parameter|green&}}, {{Parameter|blue&}}[, {{Parameter|imageHandle&}}]) + + +{{PageDescription}} +* The value returned is either the closest color attribute number or a 32-bit [[_UNSIGNED]] [[LONG]] color value. +* '''Return variable types must be [[LONG]] or resulting color may lose the [[_BLUE]] value.''' +* {{Parameter|red&}} specifies the red component intensity from 0 to 255. +* {{Parameter|green&}} specifies the green component intensity from 0 to 255. +* {{Parameter|blue&}} specifies the blue component intensity from 0 to 255. +* Intensity values outside the valid 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]]. +* When [[LONG]] values are [[PUT]] to file, the ARGB values become BGRA. Use [[LEFT$]]([[MKL$]]({{Parameter|colorIndex~&}}), 3) to place 3 colors. +* If the {{Parameter|imageHandle&}} is omitted the image is assumed to be the current [[_DEST|destination]] or [[SCREEN]] page. +* 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.''' + + +{{PageExamples}} +''Example:'' Converting the color port RGB intensity palette values 0 to 63 to 32 bit hexadecimal values. +{{CodeStart}} +{{Cl|SCREEN}} 12 +{{Cl|DIM}} hex32$(15) +{{Cl|FOR...NEXT|FOR}} attribute = 1 {{Cl|TO}} 15 + {{Cl|OUT}} {{Cl|&H}}3C7, attribute 'set color attribute to read + 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 + {{Cl|COLOR}} attribute + {{Cl|PRINT}} "{{Cl|COLOR}}" + {{Cl|STR$}}({{Cl|_RGB}}(red, grn, blu)) + " = " + hex32$(attribute) 'closest attribute +{{Cl|NEXT}} +{{CodeEnd}} +{{OutputStart}}{{text|COLOR 1 = &HFF0000A8|#0000A8}} +{{text|COLOR 2 = &HFF00A800|#00A800}} +{{text|COLOR 3 = &HFF00A8A8|#00A8A8}} +{{text|COLOR 4 = &HFFA80000|#A80000}} +{{text|COLOR 5 = &HFFA800A8|#A800A8}} +{{text|COLOR 6 = &HFFA85400|#A85400}} +{{text|COLOR 7 = &HFFA8A8A8|#A8A8A8}} +{{text|COLOR 8 = &HFF545454|#545454}} +{{text|COLOR 9 = &HFF5454FC|#5454FC}} +{{text|COLOR 10 = &HFF54FC54|#54FC54}} +{{text|COLOR 11 = &HFF54FCFC|#54FCFC}} +{{text|COLOR 12 = &HFFFC5454|#FC5454}} +{{text|COLOR 13 = &HFFFC54FC|#FC54FC}} +{{text|COLOR 14 = &HFFFCFC54|#FCFC54}} +{{text|COLOR 15 = &HFFFCFCFC|#FCFCFC}} +{{OutputEnd}} +:''Note:'' This procedure also shows how the returns from [[_RGB]] and [[_RGB32]] differ in a non-32 bit screen mode. + + +{{PageSeeAlso}} +* [[_RGBA]], [[_RGB32]], [[_RGBA32]] +* [[_RED]], [[_GREEN]], [[_BLUE]] +* [[_LOADIMAGE]], [[_NEWIMAGE]] +* [[HEX$ 32 Bit Values]], [[POINT]] +* [[SAVEIMAGE]] +* [http://www.w3schools.com/html/html_colornames.asp Hexadecimal Color Values] + + +{{PageNavigation}} + diff --git a/internal/help/_ROUND.txt b/internal/help/_ROUND__11111.txt similarity index 91% rename from internal/help/_ROUND.txt rename to internal/help/_ROUND__11111.txt index 75d731ef4..fbf1c9c01 100644 --- a/internal/help/_ROUND.txt +++ b/internal/help/_ROUND__11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:25}} {{DISPLAYTITLE:_ROUND}} The [[_ROUND]] function rounds to the closest even [[INTEGER]], [[LONG]] or [[_INTEGER64]] numerical value. @@ -19,7 +21,7 @@ The [[_ROUND]] function rounds to the closest even [[INTEGER]], [[LONG]] or [[_I {{Cl|PRINT}} {{Cl|_ROUND}}(2.5) {{Cl|PRINT}} {{Cl|_ROUND}}(3.5) {{Cl|PRINT}} {{Cl|_ROUND}}(4.5) -{{Cl|PRINT}} {{Cl|_ROUND}}(5.5) '' '' +{{Cl|PRINT}} {{Cl|_ROUND}}(5.5) {{CodeEnd}} {{OutputStart}}0 2 @@ -36,4 +38,4 @@ The [[_ROUND]] function rounds to the closest even [[INTEGER]], [[LONG]] or [[_I {{PageNavigation}} -< + diff --git a/internal/help/_SCREENCLICK.txt b/internal/help/_SCREENCLICK__11111111111.txt similarity index 95% rename from internal/help/_SCREENCLICK.txt rename to internal/help/_SCREENCLICK__11111111111.txt index 5b9aae1ff..21939e90a 100644 --- a/internal/help/_SCREENCLICK.txt +++ b/internal/help/_SCREENCLICK__11111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:26}} {{DISPLAYTITLE:_SCREENCLICK}} The [[_SCREENCLICK]] statement simulates clicking on a pixel coordinate on the desktop screen with the left mouse button. @@ -21,4 +23,4 @@ The [[_SCREENCLICK]] statement simulates clicking on a pixel coordinate on the d {{PageNavigation}} -< + diff --git a/internal/help/_SCREENEXISTS.txt b/internal/help/_SCREENEXISTS__111111111111.txt similarity index 92% rename from internal/help/_SCREENEXISTS.txt rename to internal/help/_SCREENEXISTS__111111111111.txt index f9567f357..56f6213bd 100644 --- a/internal/help/_SCREENEXISTS.txt +++ b/internal/help/_SCREENEXISTS__111111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:27}} {{DISPLAYTITLE:_SCREENEXISTS}} The [[_SCREENEXISTS]] function returns true (-1) once a screen has been created. @@ -14,7 +16,7 @@ The [[_SCREENEXISTS]] function returns true (-1) once a screen has been created. {{PageExamples}} ''Example:'' The loop waits until the screen exists to add the title. -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 12 {{Cl|DO}}: {{Cl|LOOP}} {{Cl|UNTIL}} _{{Cl|SCREENEXISTS}} {{Cl|_TITLE}} "My Title" @@ -29,4 +31,4 @@ The [[_SCREENEXISTS]] function returns true (-1) once a screen has been created. {{PageNavigation}} -< + diff --git a/internal/help/_SCREENHIDE.txt b/internal/help/_SCREENHIDE__1111111111.txt similarity index 92% rename from internal/help/_SCREENHIDE.txt rename to internal/help/_SCREENHIDE__1111111111.txt index 5c0a980ff..0d3d714c9 100644 --- a/internal/help/_SCREENHIDE.txt +++ b/internal/help/_SCREENHIDE__1111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:30}} {{DISPLAYTITLE:_SCREENHIDE}} The '''_SCREENHIDE''' statement can be used to hide the main program window in a section of code. @@ -19,4 +21,4 @@ The '''_SCREENHIDE''' statement can be used to hide the main program window in a {{PageNavigation}} -< + diff --git a/internal/help/_SCREENICON_(function).txt b/internal/help/_SCREENICON_(function)__1111111111_(00000000).txt similarity index 91% rename from internal/help/_SCREENICON_(function).txt rename to internal/help/_SCREENICON_(function)__1111111111_(00000000).txt index 52724d39f..91c0139d7 100644 --- a/internal/help/_SCREENICON_(function).txt +++ b/internal/help/_SCREENICON_(function)__1111111111_(00000000).txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:31}} {{DISPLAYTITLE:_SCREENICON (function)}} The [[_SCREENICON (function)|_SCREENICON]] function returns true (-1) or false (0) to indicate if the window has been minimized to an icon on the taskbar. @@ -18,4 +20,4 @@ The [[_SCREENICON (function)|_SCREENICON]] function returns true (-1) or false ( {{PageNavigation}} -< + diff --git a/internal/help/_SCREENICON.txt b/internal/help/_SCREENICON__1111111111.txt similarity index 74% rename from internal/help/_SCREENICON.txt rename to internal/help/_SCREENICON__1111111111.txt index dbb7cb35f..f2f108453 100644 --- a/internal/help/_SCREENICON.txt +++ b/internal/help/_SCREENICON__1111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:32}} {{DISPLAYTITLE:_SCREENICON}} The [[_SCREENICON]] statement can be used to minimize the main program window to the taskbar. @@ -10,8 +12,9 @@ The [[_SCREENICON]] statement can be used to minimize the main program window to * Use [[_SCREENICON]] to minimize the main program window to the taskbar. -==Availability== -* '''Version 1.000 and up'''. +{{PageAvailability}} +* '''QB64 1.0 and up''' (QB64 Team) +* '''QBPE 0.5 and up''' (QB64 Phoenix Edition) {{PageSeeAlso}} @@ -21,4 +24,4 @@ The [[_SCREENICON]] statement can be used to minimize the main program window to {{PageNavigation}} -< + diff --git a/internal/help/_SCREENIMAGE.txt b/internal/help/_SCREENIMAGE__11111111111.txt similarity index 71% rename from internal/help/_SCREENIMAGE.txt rename to internal/help/_SCREENIMAGE__11111111111.txt index a27190945..d1b59f895 100644 --- a/internal/help/_SCREENIMAGE.txt +++ b/internal/help/_SCREENIMAGE__11111111111.txt @@ -1,13 +1,15 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:33}} {{DISPLAYTITLE:_SCREENIMAGE}} The [[_SCREENIMAGE]] function stores the current desktop image or a portion of it and returns an image handle. {{PageSyntax}} -: {{Parameter|imageHandle&}} = [[_SCREENIMAGE]]({{Parameter|column1}}, {{Parameter|row1}}, {{Parameter|column2}}, {{Parameter|row2}})] +: {{Parameter|imageHandle&}} = [[_SCREENIMAGE]]({{Parameter|column1}}, {{Parameter|row1}}, {{Parameter|column2}}, {{Parameter|row2}})] {{PageDescription}} -* {{Parameter|imageHandle&}} is the handle to the new image in memory that will contain the desktop screenshot. +* {{Parameter|imageHandle&}} is the handle to the new image in memory that will contain the desktop screenshot. * The optional screen {{Parameter|column}} and {{Parameter|row}} positions can be used to get only a portion of the desktop image. * The desktop image or partial image is always a 32-bit image. * The current screen resolution or width-to-height aspect ratio can be obtained with [[_DESKTOPWIDTH]] and [[_DESKTOPHEIGHT]]. @@ -19,11 +21,11 @@ The [[_SCREENIMAGE]] function stores the current desktop image or a portion of i {{PageExamples}} ''Example:'' Determining the present screen resolution of user's PC for a screensaver program. {{CodeStart}} - desktop& = {{Cl|_SCREENIMAGE}} - MaxScreenX& = {{Cl|_WIDTH (function)|_WIDTH}}(desktop&) - MaxScreenY& = {{Cl|_HEIGHT}}(desktop&) - {{Cl|_FREEIMAGE}} desktop& 'free image after measuring screen(it is not displayed) - {{Cl|SCREEN (statement)|SCREEN}} {{Cl|_NEWIMAGE}}(MaxScreenX&, MaxScreenY&, 256) 'program window is sized to fit + desktop& = {{Cl|_SCREENIMAGE}} + MaxScreenX& = {{Cl|_WIDTH (function)|_WIDTH}}(desktop&) + MaxScreenY& = {{Cl|_HEIGHT}}(desktop&) + {{Cl|_FREEIMAGE}} desktop& 'free image after measuring screen(it is not displayed) + {{Cl|SCREEN (statement)|SCREEN}} {{Cl|_NEWIMAGE}}(MaxScreenX&, MaxScreenY&, 256) 'program window is sized to fit {{Cl|_SCREENMOVE}} _MIDDLE {{CodeEnd}} @@ -48,4 +50,4 @@ The [[_SCREENIMAGE]] function stores the current desktop image or a portion of i {{PageNavigation}} -< + diff --git a/internal/help/_SCREENMOVE.txt b/internal/help/_SCREENMOVE__1111111111.txt similarity index 60% rename from internal/help/_SCREENMOVE.txt rename to internal/help/_SCREENMOVE__1111111111.txt index 25c06ded3..e3d52b62a 100644 --- a/internal/help/_SCREENMOVE.txt +++ b/internal/help/_SCREENMOVE__1111111111.txt @@ -1,20 +1,22 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:09:20}} {{DISPLAYTITLE:_SCREENMOVE}} The [[_SCREENMOVE]] statement positions the program window on the desktop using designated coordinates. {{PageSyntax}} -: [[_SCREENMOVE]] {{{Parameter|column&}}, {{Parameter|row&}}|_MIDDLE} +: [[_SCREENMOVE]] {{{Parameter|column&}}, {{Parameter|row&}}|_MIDDLE} {{Parameters}} -* Positions the program window on the desktop using the {{Parameter|column&}} and {{Parameter|row&}} pixel coordinates for the upper left corner. +* Positions the program window on the desktop using the {{Parameter|column&}} and {{Parameter|row&}} pixel coordinates for the upper left corner. * '''_MIDDLE''' can be used instead to automatically center the program window on the desktop, in any screen resolution. {{PageDescription}} * The program's [[SCREEN]] dimensions may influence the desktop position that can be used to keep the entire window on the screen. * Use [[_DESKTOPWIDTH]] and [[_DESKTOPHEIGHT]] to find the current desktop resolution to place the program's window. -* On dual monitors a negative {{Parameter|column&}} position or a value greater than the main screen width can be used to position a window in another monitor. +* On dual monitors a negative {{Parameter|column&}} position or a value greater than the main screen width can be used to position a window in another monitor. * '''A small delay may be necessary when a program first starts up to properly orient the screen on the desktop properly.''' See [[_SCREENEXISTS]]. * '''[[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Keyword not supported in Linux versions]]''' @@ -22,39 +24,39 @@ The [[_SCREENMOVE]] statement positions the program window on the desktop using {{PageExamples}} ''Example 1:'' Calculating the border and header offsets by comparing a coordinate move with _MIDDLE by using trial and error. {{CodeStart}} -userwidth& = {{Cl|_DESKTOPWIDTH}}: userheight& = {{Cl|_DESKTOPHEIGHT}} 'get current screen resolution +userwidth& = {{Cl|_DESKTOPWIDTH}}: userheight& = {{Cl|_DESKTOPHEIGHT}} 'get current screen resolution {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}(800, 600, 256) -scrnwidth& = {{Cl|_WIDTH}}: scrnheight& = {{Cl|_HEIGHT}} 'get the dimensions of the program screen +scrnwidth& = {{Cl|_WIDTH}}: scrnheight& = {{Cl|_HEIGHT}} 'get the dimensions of the program screen -{{Cl|_SCREENMOVE}} (userwidth& \ 2 - scrnwidth& \ 2) - 3, (userheight& \ 2 - scrnheight& \ 2) - 29 +{{Cl|_SCREENMOVE}} (userwidth& \ 2 - scrnwidth& \ 2) - 3, (userheight& \ 2 - scrnheight& \ 2) - 29 {{Cl|_DELAY}} 4 {{Cl|_SCREENMOVE}} _MIDDLE 'check centering -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} : When positioning the window, offset the position by -3 columns and - 29 rows to calculate the top left corner coordinate. ''Example 2:'' Moving a program window to a second monitor positioned to the right of the main desktop. {{CodeStart}} -wide& = {{Cl|_DESKTOPWIDTH}} -high& = {{Cl|_DESKTOPHEIGHT}} +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 +{{Cl|_SCREENMOVE}} wide& + 200, 200 'positive value for right monitor 2 -img2& = {{Cl|_SCREENIMAGE}} -wide2& = {{Cl|_WIDTH (function)|_WIDTH}}(img2&) -high2& = {{Cl|_HEIGHT}}(img2&) -{{Cl|PRINT}} wide2&; "X"; high2& +img2& = {{Cl|_SCREENIMAGE}} +wide2& = {{Cl|_WIDTH (function)|_WIDTH}}(img2&) +high2& = {{Cl|_HEIGHT}}(img2&) +{{Cl|PRINT}} wide2&; "X"; high2& {{Cl|_DELAY}} 4 -{{Cl|_SCREENMOVE}} {{Cl|_SCREENMOVE|_MIDDLE}} 'moves program back to main monitor 1 '' '' +{{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> +
'''[[_FULLSCREEN]] works in the primary monitor and may push all running programs to a monitor on the right.'''
{{PageSeeAlso}} @@ -67,4 +69,4 @@ high2& = {{Cl|_HEIGHT}}(img2&) {{PageNavigation}} -< + diff --git a/internal/help/_SCREENPRINT.txt b/internal/help/_SCREENPRINT__11111111111.txt similarity index 98% rename from internal/help/_SCREENPRINT.txt rename to internal/help/_SCREENPRINT__11111111111.txt index d87b70a38..928153c9e 100644 --- a/internal/help/_SCREENPRINT.txt +++ b/internal/help/_SCREENPRINT__11111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:35}} {{DISPLAYTITLE:_SCREENPRINT}} The [[_SCREENPRINT]] statement simulates typing text into a Windows focused program. @@ -31,7 +33,7 @@ The [[_SCREENPRINT]] statement simulates typing text into a Windows focused prog {{PageExamples}} ''Example:'' Printing text into a Windows text editor (Notepad) and copying to the clipboard. May not work on all systems. -{{CodeStart}} '' '' +{{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 @@ -71,7 +73,7 @@ The [[_SCREENPRINT]] statement simulates typing text into a Windows focused prog {{Cl|_CLIPBOARD$ (statement)|_CLIPBOARD$}} = "QB64 ROCKS!" {{Cl|SLEEP}} 2 {{Cl|_SCREENPRINT}} {{Cl|CHR$}}(22) 'CTRL + V paste from clipboard -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} {{small|Code by Galleon}} :''Explanation:'' If the Windows shortcuts are set up properly, printing ASCII Control characters acts like the user selected the control + letter combinations to ''Select all'' (CHR$(1)), ''Copy'' (CHR$(3)) and ''Paste'' (CHR$(22)) the text with the Windows Clipboard. If the editor program's CTRL key combinations are different, use the matching letter [[ASCII]] code from A = 1 to Z = 26 in the text editor. @@ -84,4 +86,4 @@ The [[_SCREENPRINT]] statement simulates typing text into a Windows focused prog {{PageNavigation}} -< + diff --git a/internal/help/_SCREENSHOW.txt b/internal/help/_SCREENSHOW__1111111111.txt similarity index 94% rename from internal/help/_SCREENSHOW.txt rename to internal/help/_SCREENSHOW__1111111111.txt index f619db93a..f8aef816f 100644 --- a/internal/help/_SCREENSHOW.txt +++ b/internal/help/_SCREENSHOW__1111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:37}} The [[$SCREENSHOW]] [[Metacommand|metacommand]] can be used to display the main program window throughout the program. @@ -19,4 +21,4 @@ The [[$SCREENSHOW]] [[Metacommand|metacommand]] can be used to display the main {{PageNavigation}} -< + diff --git a/internal/help/_SCREENX.txt b/internal/help/_SCREENX__1111111.txt similarity index 91% rename from internal/help/_SCREENX.txt rename to internal/help/_SCREENX__1111111.txt index b9b354d93..a2f4b5174 100644 --- a/internal/help/_SCREENX.txt +++ b/internal/help/_SCREENX__1111111.txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:39}} {{DISPLAYTITLE:_SCREENX}} The [[_SCREENX]] function returns the current column pixel coordinate of the program window on the desktop. {{PageSyntax}} -: {{Parameter|positionX&}} = [[_SCREENX]] +: {{Parameter|positionX&}} = [[_SCREENX]] {{PageDescription}} @@ -29,4 +31,4 @@ The [[_SCREENX]] function returns the current column pixel coordinate of the pro {{PageNavigation}} -< + diff --git a/internal/help/_SCREENY.txt b/internal/help/_SCREENY__1111111.txt similarity index 88% rename from internal/help/_SCREENY.txt rename to internal/help/_SCREENY__1111111.txt index df33e6d7d..797d09158 100644 --- a/internal/help/_SCREENY.txt +++ b/internal/help/_SCREENY__1111111.txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:40}} {{DISPLAYTITLE:_SCREENY}} The [[_SCREENY]] function returns the current row pixel coordinate of the program window on the desktop. {{PageSyntax}} -: {{Parameter|positionY&}} = [[_SCREENY]] +: {{Parameter|positionY&}} = [[_SCREENY]] {{PageDescription}} @@ -16,7 +18,7 @@ The [[_SCREENY]] function returns the current row pixel coordinate of the progra ''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}} @@ -29,4 +31,4 @@ The [[_SCREENY]] function returns the current row pixel coordinate of the progra {{PageNavigation}} -< + diff --git a/internal/help/_SCROLLLOCK_(function).txt b/internal/help/_SCROLLLOCK_(function)__1111111111_(00000000).txt similarity index 78% rename from internal/help/_SCROLLLOCK_(function).txt rename to internal/help/_SCROLLLOCK_(function)__1111111111_(00000000).txt index 5412cc424..b90323bf8 100644 --- a/internal/help/_SCROLLLOCK_(function).txt +++ b/internal/help/_SCROLLLOCK_(function)__1111111111_(00000000).txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:41}} {{DISPLAYTITLE: _SCROLLLOCK (function)}} The [[_SCROLLLOCK (function)| _SCROLLLOCK]] function returns the current state of the Scroll Lock key as on (-1) or off (0). @@ -6,8 +8,9 @@ The [[_SCROLLLOCK (function)| _SCROLLLOCK]] function returns the current state o : {{Parameter|keyStatus%%}} = [[_SCROLLLOCK (function)| _SCROLLLOCK]] -==Availability== -* Version 1.4 and up. +{{PageAvailability}} +* '''QB64 1.4 and up''' (QB64 Team) +* '''QBPE 0.5 and up''' (QB64 Phoenix Edition) * [[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Not available in Linux or macOS]]. @@ -17,4 +20,4 @@ The [[_SCROLLLOCK (function)| _SCROLLLOCK]] function returns the current state o {{PageNavigation}} -< + diff --git a/internal/help/_SCROLLLOCK.txt b/internal/help/_SCROLLLOCK__1111111111.txt similarity index 75% rename from internal/help/_SCROLLLOCK.txt rename to internal/help/_SCROLLLOCK__1111111111.txt index 05bf6f01c..d9e103b52 100644 --- a/internal/help/_SCROLLLOCK.txt +++ b/internal/help/_SCROLLLOCK__1111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:42}} {{DISPLAYTITLE: _SCROLLLOCK}} The [[_SCROLLLOCK]] statement sets the state of the Scroll Lock key. @@ -6,8 +8,9 @@ The [[_SCROLLLOCK]] statement sets the state of the Scroll Lock key. : [[_SCROLLLOCK]] {ON|OFF|_TOGGLE} -==Availability== -* Version 1.4 and up. +{{PageAvailability}} +* '''QB64 1.4 and up''' (QB64 Team) +* '''QBPE 0.5 and up''' (QB64 Phoenix Edition) * [[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Not available in Linux or macOS]]. @@ -17,4 +20,4 @@ The [[_SCROLLLOCK]] statement sets the state of the Scroll Lock key. {{PageNavigation}} -< + diff --git a/internal/help/_SETALPHA.txt b/internal/help/_SETALPHA.txt deleted file mode 100644 index 3f4f76e1b..000000000 --- a/internal/help/_SETALPHA.txt +++ /dev/null @@ -1,68 +0,0 @@ -{{DISPLAYTITLE:_SETALPHA}}{{DISPLAYTITLE:}} -The [[_SETALPHA]] statement sets the alpha channel transparency level of some or all of the pixels of an image. - - -{{PageSyntax}} -: [[_SETALPHA]] {{Parameter|alpha&}}[, {{Parameter|color1&}}][ [[TO]] {{Parameter|colour2&}}] [, {{Parameter|imageHandle&}}] - - -{{Parameters}} -* {{Parameter|alpha&}} is the new alpha level to set, ranging from 0 (transparent) to 255 (opaque). -* {{Parameter|color1&}} designates the 32-bit [[LONG]] color value or range of color values {{Parameter|color1&}} TO {{Parameter|colour2&}} to set the transparency. -* If no color value or range of colors is given, the entire image's alpha is changed, including any [[_CLEARCOLOR]] settings. -* If {{Parameter|imageHandle&}} is omitted, it is assumed to be the current write page or [[_DEST|destination]] image. - - -{{PageDescription}} -* In the first syntax, the alpha level of all pixels is set to {{Parameter|alpha&}}. -* In the second syntax, the alpha level of all pixels matching the color {{Parameter|color1&}} is set to {{Parameter|alpha&}}. -* In the third syntax, the alpha level of all pixels with red, green, blue and alpha channels in the range [{{Parameter|color1&}} TO {{Parameter|color2&}}] are set. -* The [[_ALPHA]] setting makes a 32-bit color transparent, opaque or something in between. Zero is clear and 255 totally blocks underlying images. Use it to see through backgrounds or image colors. -* If {{Parameter|alpha&}} is outside that range, an [[ERROR Codes|illegal function call]] error will occur. -* If the image specified by {{Parameter|imageHandle&}} uses a palette, an [[ERROR Codes|invalid handle]] error will occur. -* If {{Parameter|imageHandle&}} is an invalid handle, an [[ERROR Codes|illegal function call]] error will occur. -* '''NOTE: 32-bit [[_NEWIMAGE]] screen page backgrounds are transparent black or [[_ALPHA]] 0. Use [[_DONTBLEND]] or [[CLS]] for opaque.''' - - -{{PageExamples}} -''Example:'' Using a _SETALPHA color range to fade an image in and out while not affecting the transparent white background. -{{CodeStart}} '' '' -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 -{{Cl|_SOURCE}} Image1& -clr~& = {{Cl|POINT}}(0, 0) 'find background color of image -{{Cl|_CLEARCOLOR}} clr~&, Image1& 'set background color as transparent - -topclr~& = clr~& - {{Cl|_RGBA}}(1, 1, 1, 0) 'get topmost color range just below full white -{{Cl|_DEST}} main - -a& = 0 -d = 1 -DO - {{Cl|_LIMIT}} 10 'regulate speed of fade in and out - {{Cl|CLS}} ', {{Cl|_RGB}}(255, 0, 0) - a& = a& + d - {{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|_DISPLAY}} -{{Cl|LOOP}} {{Cl|UNTIL}} a& = 0 '' '' -{{CodeEnd}} -: ''Explanation:'' The [[POINT]] value minus [[_RGBA]](1, 1, 1, 0) subtracts a small amount from the bright white color value so that the top [[_SETALPHA]] color range will not affect the [[_CLEARCOLOR]] transparency of the bright white PNG background. - - -{{PageSeeAlso}} -* [[_ALPHA]], [[_ALPHA32]] -* [[_RGBA]], [[_RGBA32]] -* [[_CLEARCOLOR]] -* [[_CLEARCOLOR (function)]] -* [[_BLEND]], [[_DONTBLEND]] -* [[COLOR]], [[Images]] - - -{{PageNavigation}} -< diff --git a/internal/help/_SETALPHA__11111111.txt b/internal/help/_SETALPHA__11111111.txt new file mode 100644 index 000000000..ed481d246 --- /dev/null +++ b/internal/help/_SETALPHA__11111111.txt @@ -0,0 +1,70 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:43}} +{{DISPLAYTITLE:_SETALPHA}}{{DISPLAYTITLE:}} +The [[_SETALPHA]] statement sets the alpha channel transparency level of some or all of the pixels of an image. + + +{{PageSyntax}} +: [[_SETALPHA]] {{Parameter|alpha&}}[, {{Parameter|color1&}}][ [[TO]] {{Parameter|colour2&}}] [, {{Parameter|imageHandle&}}] + + +{{Parameters}} +* {{Parameter|alpha&}} is the new alpha level to set, ranging from 0 (transparent) to 255 (opaque). +* {{Parameter|color1&}} designates the 32-bit [[LONG]] color value or range of color values {{Parameter|color1&}} TO {{Parameter|colour2&}} to set the transparency. +* If no color value or range of colors is given, the entire image's alpha is changed, including any [[_CLEARCOLOR]] settings. +* If {{Parameter|imageHandle&}} is omitted, it is assumed to be the current write page or [[_DEST|destination]] image. + + +{{PageDescription}} +* In the first syntax, the alpha level of all pixels is set to {{Parameter|alpha&}}. +* In the second syntax, the alpha level of all pixels matching the color {{Parameter|color1&}} is set to {{Parameter|alpha&}}. +* In the third syntax, the alpha level of all pixels with red, green, blue and alpha channels in the range [{{Parameter|color1&}} TO {{Parameter|color2&}}] are set. +* The [[_ALPHA]] setting makes a 32-bit color transparent, opaque or something in between. Zero is clear and 255 totally blocks underlying images. Use it to see through backgrounds or image colors. +* If {{Parameter|alpha&}} is outside that range, an [[ERROR Codes|illegal function call]] error will occur. +* If the image specified by {{Parameter|imageHandle&}} uses a palette, an [[ERROR Codes|invalid handle]] error will occur. +* If {{Parameter|imageHandle&}} is an invalid handle, an [[ERROR Codes|illegal function call]] error will occur. +* '''NOTE: 32-bit [[_NEWIMAGE]] screen page backgrounds are transparent black or [[_ALPHA]] 0. Use [[_DONTBLEND]] or [[CLS]] for opaque.''' + + +{{PageExamples}} +''Example:'' Using a _SETALPHA color range to fade an image in and out while not affecting the transparent white background. +{{CodeStart}} +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 +{{Cl|_SOURCE}} Image1& +clr~& = {{Cl|POINT}}(0, 0) 'find background color of image +{{Cl|_CLEARCOLOR}} clr~&, Image1& 'set background color as transparent + +topclr~& = clr~& - {{Cl|_RGBA}}(1, 1, 1, 0) 'get topmost color range just below full white +{{Cl|_DEST}} main + +a& = 0 +d = 1 +DO + {{Cl|_LIMIT}} 10 'regulate speed of fade in and out + {{Cl|CLS}} ', {{Cl|_RGB}}(255, 0, 0) + a& = a& + d + {{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|_DISPLAY}} +{{Cl|LOOP}} {{Cl|UNTIL}} a& = 0 +{{CodeEnd}} +: ''Explanation:'' The [[POINT]] value minus [[_RGBA]](1, 1, 1, 0) subtracts a small amount from the bright white color value so that the top [[_SETALPHA]] color range will not affect the [[_CLEARCOLOR]] transparency of the bright white PNG background. + + +{{PageSeeAlso}} +* [[_ALPHA]], [[_ALPHA32]] +* [[_RGBA]], [[_RGBA32]] +* [[_CLEARCOLOR]] +* [[_CLEARCOLOR (function)]] +* [[_BLEND]], [[_DONTBLEND]] +* [[COLOR]], [[Images]] + + +{{PageNavigation}} + diff --git a/internal/help/_SETBIT.txt b/internal/help/_SETBIT__111111.txt similarity index 96% rename from internal/help/_SETBIT.txt rename to internal/help/_SETBIT__111111.txt index 23d0680ed..34ec84f07 100644 --- a/internal/help/_SETBIT.txt +++ b/internal/help/_SETBIT__111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:45}} {{DISPLAYTITLE:_SETBIT}} The [[_SETBIT]] function is used to set a specified bit of a numerical value to 1 (on state). @@ -41,4 +43,4 @@ A~%% = {{Cl|_SETBIT}}(A~%%,6) 'set the seventh bit of A~%% * [[_RESETBIT]], [[_TOGGLEBIT]] {{PageNavigation}} -< + diff --git a/internal/help/_SHELLHIDE.txt b/internal/help/_SHELLHIDE__111111111.txt similarity index 93% rename from internal/help/_SHELLHIDE.txt rename to internal/help/_SHELLHIDE__111111111.txt index b9af7a118..404f7ea6a 100644 --- a/internal/help/_SHELLHIDE.txt +++ b/internal/help/_SHELLHIDE__111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:46}} {{DISPLAYTITLE:_SHELLHIDE}} The [[_SHELLHIDE]] function hides the console window and returns any [[INTEGER]] code sent when a program exits. @@ -17,12 +19,12 @@ 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}} '' '' +{{CodeStart}} returncode% = {{Cl|_SHELLHIDE}}("DesktopSize") 'replace call with your program EXE {{Cl|PRINT}} returncode% -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} : ''Explanation:'' To set a program exit code use an [[INTEGER]] parameter value after [[END]] or [[SYSTEM]] in the called program. @@ -35,4 +37,4 @@ returncode% = {{Cl|_SHELLHIDE}}("DesktopSize") 'replace call with your program E {{PageNavigation}} -< + diff --git a/internal/help/_SHL.txt b/internal/help/_SHL__111.txt similarity index 97% rename from internal/help/_SHL.txt rename to internal/help/_SHL__111.txt index d9f65c6ec..98c207e24 100644 --- a/internal/help/_SHL.txt +++ b/internal/help/_SHL__111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:47}} {{DISPLAYTITLE:_SHL}} The [[_SHL]] function is used to shift the bits of a numerical value to the left. @@ -65,4 +67,4 @@ A~%% = 1 {{PageNavigation}} -< + diff --git a/internal/help/_SHR.txt b/internal/help/_SHR__111.txt similarity index 97% rename from internal/help/_SHR.txt rename to internal/help/_SHR__111.txt index 50424a63c..6979d91e9 100644 --- a/internal/help/_SHR.txt +++ b/internal/help/_SHR__111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:49}} {{DISPLAYTITLE:_SHR}} The [[_SHR]] function is used to shift the bits of a numerical value to the right. @@ -62,4 +64,4 @@ A~%% = 128 {{PageNavigation}} -< + diff --git a/internal/help/_SNDBAL.txt b/internal/help/_SNDBAL__111111.txt similarity index 62% rename from internal/help/_SNDBAL.txt rename to internal/help/_SNDBAL__111111.txt index 9c4334106..819a04497 100644 --- a/internal/help/_SNDBAL.txt +++ b/internal/help/_SNDBAL__111111.txt @@ -1,17 +1,19 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:50}} {{DISPLAYTITLE:_SNDBAL}} The [[_SNDBAL]] statement attempts to set the balance or 3D position of a sound. {{PageSyntax}} -: [[_SNDBAL]] {{Parameter|handle&}}[, {{Parameter|x!}}][, {{Parameter|y!}}][, {{Parameter|z!}}][, {{Parameter|channel&}}]] +: [[_SNDBAL]] {{Parameter|handle&}}[, {{Parameter|x!}}][, {{Parameter|y!}}][, {{Parameter|z!}}][, {{Parameter|channel&}}]] {{Parameters}} -* ''handle&'' is a valid sound handle created by the [[_SNDOPEN]] function. +* ''handle&'' is a valid sound handle created by the [[_SNDOPEN]] function. * {{Parameter|x!}} distance values go from left (negative) to right (positive). * {{Parameter|y!}} distance values go from below (negative) to above (positive). * {{Parameter|z!}} distance values go from behind (negative) to in front (positive). -* {{Parameter|channel&}} value 1 denotes left (mono) and 2 denotes right (stereo) channel (beginning with '''build 20170811/60''') +* {{Parameter|channel&}} value 1 denotes left (mono) and 2 denotes right (stereo) channel (beginning with '''build 20170811/60''') {{PageDescription}} @@ -26,19 +28,19 @@ The [[_SNDBAL]] statement attempts to set the balance or 3D position of a sound. {{PageExamples}} ''Example 1:'' -{{CodeStart}} '' '' -h& = {{Cl|_SNDOPEN}}("LOL.wav", "SYNC,VOL") -{{Cl|_SNDBAL}} h&, 1 -{{Cl|_SNDPLAY}} h& '' '' +{{CodeStart}} +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]]. {{CodeStart}} -s& = {{Cl|_SNDOPEN}}("song.ogg") -{{Cl|PRINT}} "{{Cl|READ}}Y"; s& -{{Cl|_SNDPLAY}} s& -{{Cl|_SNDLOOP}} s& +s& = {{Cl|_SNDOPEN}}("song.ogg") +{{Cl|PRINT}} "{{Cl|READ}}Y"; s& +{{Cl|_SNDPLAY}} s& +{{Cl|_SNDLOOP}} s& xleft = -1 @@ -48,48 +50,48 @@ DO {{Cl|SELECT CASE}} k$ {{Cl|CASE}} "f" xleft = xleft - 0.1 - {{Cl|_SNDBAL}} s&, xleft, , , 1 + {{Cl|_SNDBAL}} s&, xleft, , , 1 {{Cl|CASE}} "g" xleft = xleft + 0.1 - {{Cl|_SNDBAL}} s&, xleft, , , 1 + {{Cl|_SNDBAL}} s&, xleft, , , 1 {{Cl|CASE}} "h" xright = xright - 0.1 - {{Cl|_SNDBAL}} s&, xright, , , 2 + {{Cl|_SNDBAL}} s&, xright, , , 2 {{Cl|CASE}} "j" xright = xright + 0.1 - {{Cl|_SNDBAL}} s&, xright, , , 2 + {{Cl|_SNDBAL}} s&, xright, , , 2 {{Cl|CASE}} "n" volume = volume - 0.1 - {{Cl|_SNDVOL}} s&, volume + {{Cl|_SNDVOL}} s&, volume {{Cl|CASE}} "m" volume = volume + 0.1 - {{Cl|_SNDVOL}} s&, volume + {{Cl|_SNDVOL}} s&, volume {{Cl|CASE}} "p" - {{Cl|_SNDPAUSE}} s& + {{Cl|_SNDPAUSE}} s& {{Cl|CASE}} " " - {{Cl|_SNDPLAY}} s& + {{Cl|_SNDPLAY}} s& {{Cl|CASE}} "i" - {{Cl|PRINT}} {{Cl|_SNDPLAYING}}(s&) - {{Cl|PRINT}} {{Cl|_SNDPAUSED}}(s&) + {{Cl|PRINT}} {{Cl|_SNDPLAYING}}(s&) + {{Cl|PRINT}} {{Cl|_SNDPAUSED}}(s&) {{Cl|SLEEP}} {{Cl|CASE}} "b" - {{Cl|_SNDSETPOS}} s&, 110 + {{Cl|_SNDSETPOS}} s&, 110 {{Cl|CASE}} "l" - {{Cl|_SNDLIMIT}} s&, 10 + {{Cl|_SNDLIMIT}} s&, 10 {{Cl|PRINT}} "LIM" {{Cl|SLEEP}} {{Cl|CASE}} "k" - {{Cl|_SNDSTOP}} s& + {{Cl|_SNDSTOP}} s& {{Cl|CASE}} "c" - {{Cl|_SNDCLOSE}} s& + {{Cl|_SNDCLOSE}} s& {{Cl|SLEEP}} - s2& = {{Cl|_SNDOPEN}}("song.ogg") + s2& = {{Cl|_SNDOPEN}}("song.ogg") {{Cl|CASE}} "d" - s2& = {{Cl|_SNDCOPY}}(s&) - {{Cl|_SNDPLAY}} s2& + 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}} @@ -99,4 +101,4 @@ LOOP {{PageNavigation}} -< + diff --git a/internal/help/_SNDCLOSE.txt b/internal/help/_SNDCLOSE__11111111.txt similarity index 85% rename from internal/help/_SNDCLOSE.txt rename to internal/help/_SNDCLOSE__11111111.txt index 4c24220be..47d0c2f0f 100644 --- a/internal/help/_SNDCLOSE.txt +++ b/internal/help/_SNDCLOSE__11111111.txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:51}} {{DISPLAYTITLE:_SNDCLOSE}} The [[_SNDCLOSE]] statement frees and unloads an open sound using a [[_SNDOPEN]] or [[_SNDCOPY]] handle. {{PageSyntax}} -: [[_SNDCLOSE]] {{Parameter|handle&}} +: [[_SNDCLOSE]] {{Parameter|handle&}} {{PageDescription}} @@ -17,4 +19,4 @@ The [[_SNDCLOSE]] statement frees and unloads an open sound using a [[_SNDOPEN]] {{PageNavigation}} -< + diff --git a/internal/help/_SNDCOPY.txt b/internal/help/_SNDCOPY__1111111.txt similarity index 74% rename from internal/help/_SNDCOPY.txt rename to internal/help/_SNDCOPY__1111111.txt index 672fc7113..d08f7cc55 100644 --- a/internal/help/_SNDCOPY.txt +++ b/internal/help/_SNDCOPY__1111111.txt @@ -1,16 +1,18 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:52}} {{DISPLAYTITLE:_SNDCOPY}} The [[_SNDCOPY]] function copies a sound to a new handle so that two or more of the same sound can be played at once. The passed handle parameter is from the [[_SNDOPEN]] function. {{PageSyntax}} -: {{Parameter|copyHandle&}} = [[_SNDCOPY]]({{Parameter|handle&}}) +: {{Parameter|copyHandle&}} = [[_SNDCOPY]]({{Parameter|handle&}}) {{PageDescription}} * 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}} @@ -19,4 +21,4 @@ The [[_SNDCOPY]] function copies a sound to a new handle so that two or more of {{PageNavigation}} -< + diff --git a/internal/help/_SNDGETPOS.txt b/internal/help/_SNDGETPOS__111111111.txt similarity index 64% rename from internal/help/_SNDGETPOS.txt rename to internal/help/_SNDGETPOS__111111111.txt index c0bf59915..071a7a9b5 100644 --- a/internal/help/_SNDGETPOS.txt +++ b/internal/help/_SNDGETPOS__111111111.txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:54}} {{DISPLAYTITLE:_SNDGETPOS}} The [[_SNDGETPOS]] function returns the current playing position in seconds using a handle from [[_SNDOPEN]]. {{PageSyntax}} -:{{Parameter|position}} = [[_SNDGETPOS]]({{Parameter|handle&}}) +:{{Parameter|position}} = [[_SNDGETPOS]]({{Parameter|handle&}}) {{PageDescription}} @@ -11,18 +13,18 @@ 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! -{{Cl|_SNDSETPOS}} SoundFile&, 5.5 'set to play sound 5 1/2 seconds into music -{{Cl|_SNDPLAY}} SoundFile& 'play sound +{{CodeStart}} +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&) -LOOP UNTIL {{Cl|_KEYDOWN}}(27) OR {{Cl|NOT}} {{Cl|_SNDPLAYING}}(SoundFile&) 'ESC or end of sound exit + 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}} @@ -32,4 +34,4 @@ LOOP UNTIL {{Cl|_KEYDOWN}}(27) OR {{Cl|NOT}} {{Cl|_SNDPLAYING}}(SoundFile&) {{PageNavigation}} -< + diff --git a/internal/help/_SNDLEN.txt b/internal/help/_SNDLEN__111111.txt similarity index 61% rename from internal/help/_SNDLEN.txt rename to internal/help/_SNDLEN__111111.txt index d2a483f78..8b7b09125 100644 --- a/internal/help/_SNDLEN.txt +++ b/internal/help/_SNDLEN__111111.txt @@ -1,14 +1,16 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:55}} {{DISPLAYTITLE:_SNDLEN}} The [[_SNDLEN]] function returns the length in seconds of a loaded sound using a handle from the [[_SNDOPEN]] function. {{PageSyntax}} -: {{Parameter|soundLength}} = [[_SNDLEN]]({{Parameter|handle&}}) +: {{Parameter|soundLength}} = [[_SNDLEN]]({{Parameter|handle&}}) {{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}} @@ -16,4 +18,4 @@ The [[_SNDLEN]] function returns the length in seconds of a loaded sound using a {{PageNavigation}} -< + diff --git a/internal/help/_SNDLIMIT.txt b/internal/help/_SNDLIMIT__11111111.txt similarity index 72% rename from internal/help/_SNDLIMIT.txt rename to internal/help/_SNDLIMIT__11111111.txt index e4f9f70ab..00e30c3da 100644 --- a/internal/help/_SNDLIMIT.txt +++ b/internal/help/_SNDLIMIT__11111111.txt @@ -1,13 +1,15 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:56}} {{DISPLAYTITLE:_SNDLIMIT}} The [[_SNDLIMIT]] statement stops playing a sound after it has been playing for a set number of seconds. {{PageSyntax}} -: [[_SNDLIMIT]] {{Parameter|handle&}}, {{Parameter|numberOfSeconds!}} +: [[_SNDLIMIT]] {{Parameter|handle&}}, {{Parameter|numberOfSeconds!}} {{Parameters}} -* The {{Parameter|handle&}} variable name is created using the [[_SNDOPEN]] function from a loaded sound file. +* The {{Parameter|handle&}} variable name is created using the [[_SNDOPEN]] function from a loaded sound file. * {{Parameter|numberOfSeconds!}} is a [[SINGLE]] value of seconds that the sound will play. @@ -18,8 +20,8 @@ The [[_SNDLIMIT]] statement stops playing a sound after it has been playing for {{PageExamples}} -{{CodeStart}} '' '' -{{Cl|_SNDLIMIT}} h&, 5.5 '' '' +{{CodeStart}} +{{Cl|_SNDLIMIT}} h&, 5.5 {{CodeEnd}} @@ -28,4 +30,4 @@ The [[_SNDLIMIT]] statement stops playing a sound after it has been playing for {{PageNavigation}} -< + diff --git a/internal/help/_SNDLOOP.txt b/internal/help/_SNDLOOP__1111111.txt similarity index 58% rename from internal/help/_SNDLOOP.txt rename to internal/help/_SNDLOOP__1111111.txt index 68c946b37..11c98e393 100644 --- a/internal/help/_SNDLOOP.txt +++ b/internal/help/_SNDLOOP__1111111.txt @@ -1,26 +1,28 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:58}} {{DISPLAYTITLE:_SNDLOOP}} The [[_SNDLOOP]] statement is like [[_SNDPLAY]] but the sound is looped. Uses a handle from the [[_SNDOPEN]] function. {{PageSyntax}} -: [[_SNDLOOP]] {{Parameter|handle&}} +: [[_SNDLOOP]] {{Parameter|handle&}} {{PageDescription}} -*Plays the sound identified by {{Parameter|handle&}} in a loop. +*Plays the sound identified by {{Parameter|handle&}} in a loop. {{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 +{{CodeStart}} +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 '' '' +{{Cl|_SNDCLOSE}} bg {{CodeEnd}} @@ -29,4 +31,4 @@ DO {{PageNavigation}} -< + diff --git a/internal/help/_SNDOPENRAW.txt b/internal/help/_SNDOPENRAW__1111111111.txt similarity index 86% rename from internal/help/_SNDOPENRAW.txt rename to internal/help/_SNDOPENRAW__1111111111.txt index a7d04c3be..bdbce8307 100644 --- a/internal/help/_SNDOPENRAW.txt +++ b/internal/help/_SNDOPENRAW__1111111111.txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:00}} {{DISPLAYTITLE:_SNDOPENRAW}} The [[_SNDOPENRAW]] function opens a new channel to fill with _SNDRAW content to manage multiple dynamically generated sounds. {{PageSyntax}} -: {{Parameter|pipeHandle&}} = [[_SNDOPENRAW]] +: {{Parameter|pipeHandle&}} = [[_SNDOPENRAW]] {{PageDescription}} @@ -13,7 +15,7 @@ The [[_SNDOPENRAW]] function opens a new channel to fill with _SNDRAW content to {{PageExamples}} ''Example:'' Combining 2 sounds without worrying about mixing: -{{CodeStart}} '' '' +{{CodeStart}} a = {{Cl|_SNDOPENRAW}} b = {{Cl|_SNDOPENRAW}} @@ -23,7 +25,7 @@ b = {{Cl|_SNDOPENRAW}} {{Cl|NEXT}} {{Cl|_SNDCLOSE}} a -{{Cl|_SNDCLOSE}} b '' '' +{{Cl|_SNDCLOSE}} b {{CodeEnd}}{{small|Code by Galleon}} @@ -34,4 +36,4 @@ b = {{Cl|_SNDOPENRAW}} {{PageNavigation}} -< + diff --git a/internal/help/_SNDOPEN.txt b/internal/help/_SNDOPEN__1111111.txt similarity index 60% rename from internal/help/_SNDOPEN.txt rename to internal/help/_SNDOPEN__1111111.txt index 286b2efe4..fb0cff989 100644 --- a/internal/help/_SNDOPEN.txt +++ b/internal/help/_SNDOPEN__1111111.txt @@ -1,13 +1,15 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:10:59}} {{DISPLAYTITLE:_SNDOPEN}} The [[_SNDOPEN]] function loads a sound file into memory and returns a [[LONG]] handle value above 0. {{PageSyntax}} -: {{Parameter|soundHandle&}} = [[_SNDOPEN]]({{Parameter|fileName$}}) +: {{Parameter|soundHandle&}} = [[_SNDOPEN]]({{Parameter|fileName$}}) {{PageDescription}} -* Returns a [[LONG]] {{Parameter|soundHandle&}} value to the sound file in memory. '''A zero value means the sound could not be loaded.''' +* Returns a [[LONG]] {{Parameter|soundHandle&}} value to the sound file in memory. '''A zero value means the sound could not be loaded.''' * The literal or variable [[STRING]] sound {{Parameter|fileName$}} can be '''WAV, OGG or MP3''' file types. * '''Always check the handle value returned is greater than zero before attempting to play the sound.''' * The handle can be used by most of the _SND sound playing functions and statements in QB64 except [[_SNDPLAYFILE]] which plays a sound file directly from the disk and does not use a handle value. @@ -18,28 +20,28 @@ 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") -IF h& = 0 THEN BEEP ELSE {{Cl|_SNDPLAY}} h& 'check for valid handle before using! +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 -{{Cl|IF}} LaffX! < -1 {{Cl|THEN}} LaffX! = -1 'set full volume to left speaker +{{CodeStart}} +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|_SNDBAL}} Laff&, LaffX! 'balance sound to left or right speaker -{{Cl|_SNDPLAY}} Laff& 'play sound '' '' +{{Cl|_SNDBAL}} Laff&, LaffX! 'balance sound to left or right speaker +{{Cl|_SNDPLAY}} Laff& 'play sound {{CodeEnd}} ''Example:'' Playing a file and controlling playback: {{CodeStart}} -s& = {{Cl|_SNDOPEN}}("song.ogg") -{{Cl|PRINT}} "{{Cl|READ}}Y"; s& -{{Cl|_SNDPLAY}} s& -{{Cl|_SNDLOOP}} s& +s& = {{Cl|_SNDOPEN}}("song.ogg") +{{Cl|PRINT}} "{{Cl|READ}}Y"; s& +{{Cl|_SNDPLAY}} s& +{{Cl|_SNDLOOP}} s& xleft = -1 @@ -49,48 +51,48 @@ DO {{Cl|SELECT CASE}} k$ {{Cl|CASE}} "f" xleft = xleft - 0.1 - {{Cl|_SNDBAL}} s&, xleft, , , 1 + {{Cl|_SNDBAL}} s&, xleft, , , 1 {{Cl|CASE}} "g" xleft = xleft + 0.1 - {{Cl|_SNDBAL}} s&, xleft, , , 1 + {{Cl|_SNDBAL}} s&, xleft, , , 1 {{Cl|CASE}} "h" xright = xright - 0.1 - {{Cl|_SNDBAL}} s&, xright, , , 2 + {{Cl|_SNDBAL}} s&, xright, , , 2 {{Cl|CASE}} "j" xright = xright + 0.1 - {{Cl|_SNDBAL}} s&, xright, , , 2 + {{Cl|_SNDBAL}} s&, xright, , , 2 {{Cl|CASE}} "n" volume = volume - 0.1 - {{Cl|_SNDVOL}} s&, volume + {{Cl|_SNDVOL}} s&, volume {{Cl|CASE}} "m" volume = volume + 0.1 - {{Cl|_SNDVOL}} s&, volume + {{Cl|_SNDVOL}} s&, volume {{Cl|CASE}} "p" - {{Cl|_SNDPAUSE}} s& + {{Cl|_SNDPAUSE}} s& {{Cl|CASE}} " " - {{Cl|_SNDPLAY}} s& + {{Cl|_SNDPLAY}} s& {{Cl|CASE}} "i" - {{Cl|PRINT}} {{Cl|_SNDPLAYING}}(s&) - {{Cl|PRINT}} {{Cl|_SNDPAUSED}}(s&) + {{Cl|PRINT}} {{Cl|_SNDPLAYING}}(s&) + {{Cl|PRINT}} {{Cl|_SNDPAUSED}}(s&) {{Cl|SLEEP}} {{Cl|CASE}} "b" - {{Cl|_SNDSETPOS}} s&, 110 + {{Cl|_SNDSETPOS}} s&, 110 {{Cl|CASE}} "l" - {{Cl|_SNDLIMIT}} s&, 10 + {{Cl|_SNDLIMIT}} s&, 10 {{Cl|PRINT}} "LIM" {{Cl|SLEEP}} {{Cl|CASE}} "k" - {{Cl|_SNDSTOP}} s& + {{Cl|_SNDSTOP}} s& {{Cl|CASE}} "c" - {{Cl|_SNDCLOSE}} s& + {{Cl|_SNDCLOSE}} s& {{Cl|SLEEP}} - s2& = {{Cl|_SNDOPEN}}("song.ogg") + s2& = {{Cl|_SNDOPEN}}("song.ogg") {{Cl|CASE}} "d" - s2& = {{Cl|_SNDCOPY}}(s&) - {{Cl|_SNDPLAY}} s2& + 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}} @@ -108,4 +110,4 @@ LOOP {{PageNavigation}} -< + diff --git a/internal/help/_SNDPAUSED.txt b/internal/help/_SNDPAUSED__111111111.txt similarity index 68% rename from internal/help/_SNDPAUSED.txt rename to internal/help/_SNDPAUSED__111111111.txt index 0bfae7c6c..c3ee3fd88 100644 --- a/internal/help/_SNDPAUSED.txt +++ b/internal/help/_SNDPAUSED__111111111.txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:03}} {{DISPLAYTITLE:_SNDPAUSED}} The [[_SNDPAUSED]] function checks if a sound is paused. Uses a handle parameter passed from [[_SNDOPEN]]. {{PageSyntax}} -: {{Parameter|isPaused%%}} = [[_SNDPAUSED]]({{Parameter|handle&}}) +: {{Parameter|isPaused%%}} = [[_SNDPAUSED]]({{Parameter|handle&}}) {{PageDescription}} @@ -11,8 +13,8 @@ The [[_SNDPAUSED]] function checks if a sound is paused. Uses a handle parameter {{PageExamples}} -{{CodeStart}} '' '' -{{Cl|PRINT}} {{Cl|_SNDPAUSED}}(h&) '' '' +{{CodeStart}} +{{Cl|PRINT}} {{Cl|_SNDPAUSED}}(h&) {{CodeEnd}} @@ -22,4 +24,4 @@ The [[_SNDPAUSED]] function checks if a sound is paused. Uses a handle parameter {{PageNavigation}} -< + diff --git a/internal/help/_SNDPAUSE.txt b/internal/help/_SNDPAUSE__11111111.txt similarity index 53% rename from internal/help/_SNDPAUSE.txt rename to internal/help/_SNDPAUSE__11111111.txt index 6028a0050..afaba29bf 100644 --- a/internal/help/_SNDPAUSE.txt +++ b/internal/help/_SNDPAUSE__11111111.txt @@ -1,14 +1,16 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:01}} {{DISPLAYTITLE:_SNDPAUSE}} The [[_SNDPAUSE]] statement pauses a sound using a handle from the [[_SNDOPEN]] function. {{PageSyntax}} -: [[_SNDPAUSE]] {{Parameter|handle&}} +: [[_SNDPAUSE]] {{Parameter|handle&}} {{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. +* 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. {{PageSeeAlso}} @@ -17,4 +19,4 @@ The [[_SNDPAUSE]] statement pauses a sound using a handle from the [[_SNDOPEN]] {{PageNavigation}} -< + diff --git a/internal/help/_SNDPLAYCOPY.txt b/internal/help/_SNDPLAYCOPY__11111111111.txt similarity index 72% rename from internal/help/_SNDPLAYCOPY.txt rename to internal/help/_SNDPLAYCOPY__11111111111.txt index f93b5f0fb..47d2d30d3 100644 --- a/internal/help/_SNDPLAYCOPY.txt +++ b/internal/help/_SNDPLAYCOPY__11111111111.txt @@ -1,13 +1,15 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:05}} {{DISPLAYTITLE:_SNDPLAYCOPY}} The [[_SNDPLAYCOPY]] statement copies a sound, plays it, and automatically closes the copy using a handle parameter passed from [[_SNDOPEN]] or [[_SNDCOPY]] {{PageSyntax}} -: [[_SNDPLAYCOPY]] {{Parameter|handle&}}[, {{Parameter|volume!}}] +: [[_SNDPLAYCOPY]] {{Parameter|handle&}}[, {{Parameter|volume!}}] {{Parameters}} -* The [[LONG]] {{Parameter|handle&}} value is returned by [[_SNDOPEN]] using a specific sound file. +* The [[LONG]] {{Parameter|handle&}} value is returned by [[_SNDOPEN]] using a specific sound file. * The {{Parameter|volume!}} parameter can be any [[SINGLE]] value from 0 (no volume) to 1 (full volume). @@ -22,15 +24,15 @@ The [[_SNDPLAYCOPY]] statement copies a sound, plays it, and automatically close {{PageExamples}} ''Example 1:'' Playing a previously opened sound at half volume. -{{CodeStart}} '' '' -{{Cl|_SNDPLAYCOPY}} applause&, 0.5 '' '' +{{CodeStart}} +{{Cl|_SNDPLAYCOPY}} applause&, 0.5 {{CodeEnd}} ''Example 2:'' Playing a song at random volumes. -{{CodeStart}} '' '' -chomp& = _SNDOPEN("chomp.wav") -_SNDPLAYCOPY chomp&, 0.5 + RND * 0.49 '' '' +{{CodeStart}} +chomp& = _SNDOPEN("chomp.wav") +_SNDPLAYCOPY chomp&, 0.5 + RND * 0.49 {{CodeEnd}} @@ -42,4 +44,4 @@ _SNDPLAYCOPY chomp&, 0.5 + RND * 0.49 '' '' {{PageNavigation}} -< + diff --git a/internal/help/_SNDPLAYFILE.txt b/internal/help/_SNDPLAYFILE__11111111111.txt similarity index 93% rename from internal/help/_SNDPLAYFILE.txt rename to internal/help/_SNDPLAYFILE__11111111111.txt index c38f86f6a..7edffc527 100644 --- a/internal/help/_SNDPLAYFILE.txt +++ b/internal/help/_SNDPLAYFILE__11111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:06}} {{DISPLAYTITLE:_SNDPLAYFILE}} The [[_SNDPLAYFILE]] statement is used to play a sound file without generating a handle, automatically closing it after playback finishes. @@ -18,8 +20,8 @@ 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 '' '' +{{CodeStart}} +{{Cl|_SNDPLAYFILE}} "dog.wav", , .5 {{CodeEnd}} @@ -29,4 +31,4 @@ The [[_SNDPLAYFILE]] statement is used to play a sound file without generating a {{PageNavigation}} -< + diff --git a/internal/help/_SNDPLAYING.txt b/internal/help/_SNDPLAYING__1111111111.txt similarity index 73% rename from internal/help/_SNDPLAYING.txt rename to internal/help/_SNDPLAYING__1111111111.txt index 495cce982..669e0437a 100644 --- a/internal/help/_SNDPLAYING.txt +++ b/internal/help/_SNDPLAYING__1111111111.txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:08}} {{DISPLAYTITLE:_SNDPLAYING}} The [[_SNDPLAYING]] function returns whether a sound is being played. Uses a handle from the [[_SNDOPEN]] or [[_SNDCOPY]] functions. {{PageSyntax}} -:{{Parameter|isPlaying%}} = [[_SNDPLAYING]]({{Parameter|handle&}}) +:{{Parameter|isPlaying%}} = [[_SNDPLAYING]]({{Parameter|handle&}}) {{PageDescription}} @@ -12,8 +14,8 @@ The [[_SNDPLAYING]] function returns whether a sound is being played. Uses a han {{PageExamples}} -{{CodeStart}} '' '' -{{Cl|PRINT}} {{Cl|_SNDPLAYING}}(h&) '' '' +{{CodeStart}} +{{Cl|PRINT}} {{Cl|_SNDPLAYING}}(h&) {{CodeEnd}} @@ -23,4 +25,4 @@ The [[_SNDPLAYING]] function returns whether a sound is being played. Uses a han {{PageNavigation}} -< + diff --git a/internal/help/_SNDPLAY.txt b/internal/help/_SNDPLAY__1111111.txt similarity index 57% rename from internal/help/_SNDPLAY.txt rename to internal/help/_SNDPLAY__1111111.txt index 7bae6b459..599e5b0b8 100644 --- a/internal/help/_SNDPLAY.txt +++ b/internal/help/_SNDPLAY__1111111.txt @@ -1,19 +1,21 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:04}} {{DISPLAYTITLE:_SNDPLAY}} The [[_SNDPLAY]] statement plays a sound designated by a file handle created by [[_SNDOPEN]]. {{PageSyntax}} -: [[_SNDPLAY]] {{Parameter|handle&}} +: [[_SNDPLAY]] {{Parameter|handle&}} {{PageDescription}} -* Make sure that the {{Parameter|handle&}} value is not 0 before attempting to play it. +* Make sure that the {{Parameter|handle&}} value is not 0 before attempting to play it. {{PageExamples}} ''Example:'' Checking a handle value before playing -{{CodeStart}} '' '' - {{Cl|IF...THEN|IF}} h& {{Cl|THEN}} {{Cl|_SNDPLAY}} h& '' '' +{{CodeStart}} + {{Cl|IF...THEN|IF}} h& {{Cl|THEN}} {{Cl|_SNDPLAY}} h& {{CodeEnd}} @@ -22,4 +24,4 @@ The [[_SNDPLAY]] statement plays a sound designated by a file handle created by {{PageNavigation}} -< + diff --git a/internal/help/_SNDRATE.txt b/internal/help/_SNDRATE__1111111.txt similarity index 84% rename from internal/help/_SNDRATE.txt rename to internal/help/_SNDRATE__1111111.txt index c3e0ec7b9..0daf05484 100644 --- a/internal/help/_SNDRATE.txt +++ b/internal/help/_SNDRATE__1111111.txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:09}} {{DISPLAYTITLE:_SNDRATE}} The [[_SNDRATE]] function returns the sample rate frequency per second of the current computer's sound card. {{PageSyntax}} -: {{Parameter|sampleRate&}} = [[_SNDRATE]] +: {{Parameter|sampleRate&}} = [[_SNDRATE]] {{PageDescription}} @@ -21,4 +23,4 @@ The [[_SNDRATE]] function returns the sample rate frequency per second of the cu {{PageNavigation}} -< + diff --git a/internal/help/_SNDRAWDONE.txt b/internal/help/_SNDRAWDONE__1111111111.txt similarity index 70% rename from internal/help/_SNDRAWDONE.txt rename to internal/help/_SNDRAWDONE__1111111111.txt index 9d6142823..dd59690bb 100644 --- a/internal/help/_SNDRAWDONE.txt +++ b/internal/help/_SNDRAWDONE__1111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:12}} {{DISPLAYTITLE:_SNDRAWDONE}} [[_SNDRAWDONE]] ensures that the final buffer portion is played in short sound effects even if it is incomplete. @@ -10,8 +12,9 @@ * Use to force playing small buffers of [[_SNDRAW]] data. -==Availability== -* '''Version 1.000 and up''' +{{PageAvailability}} +* '''QB64 1.0 and up''' (QB64 Team) +* '''QBPE 0.5 and up''' (QB64 Phoenix Edition) {{PageSeeAlso}} @@ -22,4 +25,4 @@ {{PageNavigation}} -< + diff --git a/internal/help/_SNDRAWLEN.txt b/internal/help/_SNDRAWLEN__111111111.txt similarity index 95% rename from internal/help/_SNDRAWLEN.txt rename to internal/help/_SNDRAWLEN__111111111.txt index cfeeeb8a4..afcf05081 100644 --- a/internal/help/_SNDRAWLEN.txt +++ b/internal/help/_SNDRAWLEN__111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:13}} {{DISPLAYTITLE:_SNDRAWLEN}} The [[_SNDRAWLEN]] function returns the length, in seconds, of a [[_SNDRAW]] sound currently queued. @@ -24,4 +26,4 @@ The [[_SNDRAWLEN]] function returns the length, in seconds, of a [[_SNDRAW]] sou {{PageNavigation}} -< + diff --git a/internal/help/_SNDRAW.txt b/internal/help/_SNDRAW__111111.txt similarity index 87% rename from internal/help/_SNDRAW.txt rename to internal/help/_SNDRAW__111111.txt index 5544c0274..1614260b2 100644 --- a/internal/help/_SNDRAW.txt +++ b/internal/help/_SNDRAW__111111.txt @@ -1,18 +1,20 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:10}} {{DISPLAYTITLE:_SNDRAW}} The [[_SNDRAW]] statement plays sound wave sample frequencies created by a program. {{PageSyntax}} -: [[_SNDRAW]] {{Parameter|leftSample}}[, {{Parameter|rightSample}}][, {{Parameter|pipeHandle&}}] +: [[_SNDRAW]] {{Parameter|leftSample}}[, {{Parameter|rightSample}}][, {{Parameter|pipeHandle&}}] {{Parameters}} * The {{Parameter|leftSample}} and {{Parameter|rightSample}} value(s) can be any [[SINGLE]] or [[DOUBLE]] literal or variable frequency value from -1.0 to 1.0. -* The {{Parameter|pipeHandle&}} parameter refers to the sound pipe opened using [[_SNDOPENRAW]]. +* The {{Parameter|pipeHandle&}} parameter refers to the sound pipe opened using [[_SNDOPENRAW]]. {{PageDescription}} -* Specifying {{Parameter|pipeHandle&}} allows sound to be played through two or more channels at the same time ('''version 1.000 and up'''). +* Specifying {{Parameter|pipeHandle&}} allows sound to be played through two or more channels at the same time ('''version 1.000 and up'''). * If only {{Parameter|leftSample}} value is used, the sound will come out of both speakers. * Using _SNDRAW will pause any currently playing music. * _SNDRAW is designed for continuous play. It will not produce any sound until a significant number of samples have been queued. No sound is played if only a few samples are queued. @@ -35,7 +37,7 @@ FRate = FREQ / SampleRate' '{{Cl|_SNDRAW}} Amplitude * {{Cl|SGN}}({{Cl|SIN}}(Pi2 * Duration * FRate)) 'square wave {{Cl|NEXT}} {{Cl|DO}}: LOOP {{Cl|WHILE}} {{Cl|_SNDRAWLEN}} -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} {{small|Code by DarthWho}} :''Explanation:'' The loop Duration is determined by the number of seconds times the [[_SNDRATE]] number of samples per second. Square waves can use the same formula with Amplitude * [[SGN]](SIN(8 * ATN(1) * Duration * (Frequency/_SNDRATE))). @@ -47,7 +49,7 @@ 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 + DO WHILE {{Cl|_SNDRAWLEN}} < 0.1 'you may wish to adjust this sample = {{Cl|SIN}}(t * 440 * {{Cl|ATN}}(1) * 8) '440Hz sine wave (t * 440 * 2Ο€) sample = sample * {{Cl|EXP}}(-t * 3) 'fade out eliminates clicks after sound {{Cl|_SNDRAW}} sample @@ -56,19 +58,19 @@ DO 'do other stuff, but it may interrupt sound LOCATE 1, 1: PRINT USING tmp$; sample; t -LOOP WHILE t < 3.0 'play for 3 seconds +LOOP WHILE t < 3.0 'play for 3 seconds DO WHILE {{Cl|_SNDRAWLEN}} > 0 'Finish any left over queued sound! LOOP -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} {{small|Code by Artelius (responsible for the implementation of _SNDRAW)}} ''Example 3:'' Routine uses _SNDRAW to display and play 12 notes from octaves 1 through 9. -{{CodeStart}} '' '' -{{Cl|DIM}} {{Cl|SHARED}} rate& -rate& = {{Cl|_SNDRATE}} +{{CodeStart}} +{{Cl|DIM}} {{Cl|SHARED}} rate& +rate& = {{Cl|_SNDRATE}} DO {{Cl|PRINT}} "Enter the octave 1 to 8 (0 quits!):"; oct% = {{Cl|VAL}}({{Cl|INPUT$}}(1)): {{Cl|PRINT}} oct% @@ -92,12 +94,12 @@ note$ = {{Cl|MID$}}("C C#D D#E F F#G G#A A#B ", note * 2 + 1, 2) {{Cl|SUB}} PlaySound (frq!) ' plays sine wave fading in and out SndLoop! = 0 -{{Cl|DO...LOOP|DO}} {{Cl|WHILE}} SndLoop! < rate& - {{Cl|_SNDRAW}} {{Cl|SIN}}((2 * 4 * {{Cl|ATN}}(1) * SndLoop! / rate&) * frq!) * {{Cl|EXP}}(-(SndLoop! / rate&) * 3) +{{Cl|DO...LOOP|DO}} {{Cl|WHILE}} SndLoop! < rate& + {{Cl|_SNDRAW}} {{Cl|SIN}}((2 * 4 * {{Cl|ATN}}(1) * SndLoop! / rate&) * frq!) * {{Cl|EXP}}(-(SndLoop! / rate&) * 3) SndLoop! = SndLoop! + 1 {{Cl|LOOP}} {{Cl|DO}}: {{Cl|LOOP}} {{Cl|WHILE}} {{Cl|_SNDRAWLEN}} 'flush the sound playing buffer -{{Cl|END SUB}} '' '' +{{Cl|END SUB}} {{CodeEnd}} {{small|Code by CodeGuy}} @@ -112,4 +114,4 @@ SndLoop! = 0 {{PageNavigation}} -< + diff --git a/internal/help/_SNDSETPOS.txt b/internal/help/_SNDSETPOS__111111111.txt similarity index 64% rename from internal/help/_SNDSETPOS.txt rename to internal/help/_SNDSETPOS__111111111.txt index 5d365d568..d1688d8f0 100644 --- a/internal/help/_SNDSETPOS.txt +++ b/internal/help/_SNDSETPOS__111111111.txt @@ -1,27 +1,29 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:14}} {{DISPLAYTITLE:_SNDSETPOS}} The [[_SNDSETPOS]] statement changes the current/starting playing position in seconds of a sound. {{PageSyntax}} -: [[_SNDSETPOS]] {{Parameter|handle&}}, {{Parameter|position!}} +: [[_SNDSETPOS]] {{Parameter|handle&}}, {{Parameter|position!}} {{PageDescription}} *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! -{{Cl|_SNDSETPOS}} SoundFile&, 5.5 'set to play sound 5 1/2 seconds into music -{{Cl|_SNDPLAY}} SoundFile& 'play sound +{{CodeStart}} +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&) -LOOP UNTIL {{Cl|_KEYDOWN}}(27) OR {{Cl|NOT}} {{Cl|_SNDPLAYING}}(SoundFile&) 'ESC or end of sound exit + 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 +33,4 @@ LOOP UNTIL {{Cl|_KEYDOWN}}(27) OR {{Cl|NOT}} {{Cl|_SNDPLAYING}}(SoundFile&) {{PageNavigation}} -< + diff --git a/internal/help/_SNDSTOP.txt b/internal/help/_SNDSTOP__1111111.txt similarity index 75% rename from internal/help/_SNDSTOP.txt rename to internal/help/_SNDSTOP__1111111.txt index 07d98ac00..c7d8e68b7 100644 --- a/internal/help/_SNDSTOP.txt +++ b/internal/help/_SNDSTOP__1111111.txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:15}} {{DISPLAYTITLE:_SNDSTOP}} The [[_SNDSTOP]] statement stops a playing or paused sound using a handle from the [[_SNDOPEN]] or [[_SNDCOPY]] functions. {{PageSyntax}} -: [[_SNDSTOP]] {{Parameter|handle&}} +: [[_SNDSTOP]] {{Parameter|handle&}} {{PageDescription}} @@ -12,8 +14,8 @@ The [[_SNDSTOP]] statement stops a playing or paused sound using a handle from t {{PageExamples}} ''Example:'' -{{CodeStart}} '' '' -{{Cl|_SNDSTOP}} h& '' '' +{{CodeStart}} +{{Cl|_SNDSTOP}} h& {{CodeEnd}} @@ -22,4 +24,4 @@ The [[_SNDSTOP]] statement stops a playing or paused sound using a handle from t {{PageNavigation}} -< + diff --git a/internal/help/_SNDVOL.txt b/internal/help/_SNDVOL__111111.txt similarity index 57% rename from internal/help/_SNDVOL.txt rename to internal/help/_SNDVOL__111111.txt index a339fb94b..890cb0ff4 100644 --- a/internal/help/_SNDVOL.txt +++ b/internal/help/_SNDVOL__111111.txt @@ -1,21 +1,23 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:17}} {{DISPLAYTITLE:_SNDVOL}} The [[_SNDVOL]] statement sets the volume of a sound loaded in memory using a handle from the [[_SNDOPEN]] function. {{PageSyntax}} -: [[_SNDVOL]] {{Parameter|handle&}}, {{Parameter|volume!}} +: [[_SNDVOL]] {{Parameter|handle&}}, {{Parameter|volume!}} {{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") -{{Cl|_SNDVOL}} h&, 0.5 -{{Cl|_SNDPLAY}} h& '' '' +{{CodeStart}} +h& = {{Cl|_SNDOPEN}}("bell.wav") +{{Cl|_SNDVOL}} h&, 0.5 +{{Cl|_SNDPLAY}} h& {{CodeEnd}} @@ -24,4 +26,4 @@ h& = {{Cl|_SNDOPEN}}("bell.wav") {{PageNavigation}} -< + diff --git a/internal/help/_SOURCE_(function).txt b/internal/help/_SOURCE_(function)__111111_(00000000).txt similarity index 81% rename from internal/help/_SOURCE_(function).txt rename to internal/help/_SOURCE_(function)__111111_(00000000).txt index dfa0fd255..10581bb75 100644 --- a/internal/help/_SOURCE_(function).txt +++ b/internal/help/_SOURCE_(function)__111111_(00000000).txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:19}} {{DISPLAYTITLE:_SOURCE (function)}} The [[_SOURCE (function)|_SOURCE]] function returns the present image source handle value. {{PageSyntax}} -: {{Parameter|currentSource&}} = [[_SOURCE (function)|_SOURCE]] +: {{Parameter|currentSource&}} = [[_SOURCE (function)|_SOURCE]] {{PageDescription}} @@ -24,4 +26,4 @@ See the examples in: {{PageNavigation}} -< + diff --git a/internal/help/_SOURCE.txt b/internal/help/_SOURCE__111111.txt similarity index 90% rename from internal/help/_SOURCE.txt rename to internal/help/_SOURCE__111111.txt index 50d22e6b3..90c7e1b4e 100644 --- a/internal/help/_SOURCE.txt +++ b/internal/help/_SOURCE__111111.txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:18}} {{DISPLAYTITLE:_SOURCE}} The [[_SOURCE]] statement establishes the image SOURCE using a handle created by [[_LOADIMAGE]], [[_NEWIMAGE]] or [[_COPYIMAGE]]. {{PageSyntax}} -: [[_SOURCE]] {{Parameter|handle&}} +: [[_SOURCE]] {{Parameter|handle&}} {{PageDescription}} @@ -13,14 +15,14 @@ The [[_SOURCE]] statement establishes the image SOURCE using a handle created by {{PageExamples}} -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|SCREEN}} 13 a = {{Cl|_NEWIMAGE}}(320,200,13) {{Cl|_DEST}} a {{Cl|PSET}} (100, 100), 15 {{Cl|_SOURCE}} a {{Cl|_DEST}} 0 -{{Cl|PRINT}} {{Cl|POINT}}(100, 100) '' '' +{{Cl|PRINT}} {{Cl|POINT}}(100, 100) {{CodeEnd}} {{OutputStart}} 15 @@ -42,4 +44,4 @@ See the examples in: {{PageNavigation}} -< + diff --git a/internal/help/_STARTDIR$.txt b/internal/help/_STARTDIR$__11111111$.txt similarity index 77% rename from internal/help/_STARTDIR$.txt rename to internal/help/_STARTDIR$__11111111$.txt index 36eb82bfc..87961e289 100644 --- a/internal/help/_STARTDIR$.txt +++ b/internal/help/_STARTDIR$__11111111$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:21}} {{DISPLAYTITLE:_STARTDIR$}} The [[_STARTDIR$]] function returns the path a user called a QB64 program from. @@ -9,13 +11,14 @@ The [[_STARTDIR$]] function returns the path a user called a QB64 program from. * Returns a [[STRING]] representing the user's program calling path. -==Availability== -* '''Version 1.000 and up'''. +{{PageAvailability}} +* '''QB64 1.0 and up''' (QB64 Team) +* '''QBPE 0.5 and up''' (QB64 Phoenix Edition) {{PageExamples}} ''Example:'' Showcasing QB64 path functions: -{{CodeStart}} '' '' +{{CodeStart}} {{Cl|$CONSOLE}}:ONLY {{Cl|_DEST}} {{Cl|_CONSOLE}} {{Cl|SHELL}} "cd" @@ -31,4 +34,4 @@ The [[_STARTDIR$]] function returns the path a user called a QB64 program from. {{PageNavigation}} -< + diff --git a/internal/help/_STRCMP.txt b/internal/help/_STRCMP__111111.txt similarity index 92% rename from internal/help/_STRCMP.txt rename to internal/help/_STRCMP__111111.txt index a1cac8117..9e64fb55f 100644 --- a/internal/help/_STRCMP.txt +++ b/internal/help/_STRCMP__111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:22}} {{DISPLAYTITLE:_STRCMP}} The [[_STRCMP]] function compares the relationship between two strings, comparing upper or lower case. @@ -20,4 +22,4 @@ The [[_STRCMP]] function compares the relationship between two strings, comparin {{PageNavigation}} -< + diff --git a/internal/help/_STRICMP.txt b/internal/help/_STRICMP__1111111.txt similarity index 92% rename from internal/help/_STRICMP.txt rename to internal/help/_STRICMP__1111111.txt index 25773407b..f4d6865f2 100644 --- a/internal/help/_STRICMP.txt +++ b/internal/help/_STRICMP__1111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:23}} {{DISPLAYTITLE:_STRICMP}} The [[_STRICMP]] function compares the relationship between two strings, ignoring upper or lower case letters. @@ -20,4 +22,4 @@ The [[_STRICMP]] function compares the relationship between two strings, ignorin {{PageNavigation}} -< + diff --git a/internal/help/_TITLE$.txt b/internal/help/_TITLE$__11111$.txt similarity index 72% rename from internal/help/_TITLE$.txt rename to internal/help/_TITLE$__11111$.txt index fc29a7c1f..8a5327728 100644 --- a/internal/help/_TITLE$.txt +++ b/internal/help/_TITLE$__11111$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:26}} {{DISPLAYTITLE:_TITLE$}} The [[_TITLE$]] function returns the program title last set by the [[_TITLE]] statement. @@ -10,8 +12,9 @@ The [[_TITLE$]] function returns the program title last set by the [[_TITLE]] st * If no title has been set, the title bar will say "Untitled" and this function will return an empty [[STRING|string]] (""). -==Availability== -* '''Build 20170924/68.''' +{{PageAvailability}} +* '''QB64 1.2 and up''' (QB64 Team) +* '''QBPE 0.5 and up''' (QB64 Phoenix Edition) {{PageSeeAlso}} @@ -20,4 +23,4 @@ The [[_TITLE$]] function returns the program title last set by the [[_TITLE]] st {{PageNavigation}} -< + diff --git a/internal/help/_TITLE.txt b/internal/help/_TITLE__11111.txt similarity index 94% rename from internal/help/_TITLE.txt rename to internal/help/_TITLE__11111.txt index 03aea4f1f..41141b8f9 100644 --- a/internal/help/_TITLE.txt +++ b/internal/help/_TITLE__11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:25}} {{DISPLAYTITLE:_TITLE}} The [[_TITLE]] statement provides the program name in the title bar of the program window. @@ -19,13 +21,13 @@ 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" '' '' +{{CodeStart}} +{{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}} '' '' +{{CodeStart}} {{Cl|_TITLE}} "My program" {{Cl|_DELAY}} 5 '5 second delay @@ -54,7 +56,7 @@ Result = GetModuleFileNameA(0, FileName$, {{Cl|LEN}}(FileName$)) PATH$ = {{Cl|LEFT$}}(PATH$, last) {{Cl|ELSE}} TITLE$ = "": PATH$ = "" {{Cl|END IF}} -{{Cl|END FUNCTION}} '' '' +{{Cl|END FUNCTION}} {{CodeEnd}} : ''Note:'' The actual module file name is returned. Not necessarily the Title value. The value returned can be used however. @@ -69,4 +71,4 @@ Result = GetModuleFileNameA(0, FileName$, {{Cl|LEN}}(FileName$)) {{PageNavigation}} -< + diff --git a/internal/help/_TOGGLEBIT.txt b/internal/help/_TOGGLEBIT__111111111.txt similarity index 96% rename from internal/help/_TOGGLEBIT.txt rename to internal/help/_TOGGLEBIT__111111111.txt index 319220e37..8dc69b379 100644 --- a/internal/help/_TOGGLEBIT.txt +++ b/internal/help/_TOGGLEBIT__111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:27}} {{DISPLAYTITLE:_TOGLEBIT}} The [[_TOGGLEBIT]] function is used to toggle a specified bit of a numerical value. @@ -44,4 +46,4 @@ A~%% = {{Cl|_TOGGLEBIT}}(A~%%,4) 'toggle the fourth bit of A~%% * [[_RESETBIT]], [[_READBIT]] {{PageNavigation}} -< + diff --git a/internal/help/_TOTALDROPPEDFILES.txt b/internal/help/_TOTALDROPPEDFILES__11111111111111111.txt similarity index 84% rename from internal/help/_TOTALDROPPEDFILES.txt rename to internal/help/_TOTALDROPPEDFILES__11111111111111111.txt index e253fe4e4..d98c6c0bd 100644 --- a/internal/help/_TOTALDROPPEDFILES.txt +++ b/internal/help/_TOTALDROPPEDFILES__11111111111111111.txt @@ -1,9 +1,11 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:28}} {{DISPLAYTITLE:_TOTALDROPPEDFILES}} The [[_TOTALDROPPEDFILES]] function returns the number of items (files or folders) dropped in a program's window after [[_ACCEPTFILEDROP]] is enabled. {{PageSyntax}} -: {{Parameter|totalFilesReceived&}} = [[_TOTALDROPPEDFILES]] +: {{Parameter|totalFilesReceived&}} = [[_TOTALDROPPEDFILES]] {{PageDescription}} @@ -14,8 +16,9 @@ The [[_TOTALDROPPEDFILES]] function returns the number of items (files or folder * '''[[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Keyword Not Supported in Linux or MAC versions]]'''. -==Availability== -* '''Version 1.3 and up'''. +{{PageAvailability}} +* '''QB64 1.3 and up''' (QB64 Team) +* '''QBPE 0.5 and up''' (QB64 Phoenix Edition) {{PageExamples}} @@ -27,4 +30,4 @@ The [[_TOTALDROPPEDFILES]] function returns the number of items (files or folder {{PageNavigation}} -< + diff --git a/internal/help/_TRIM$.txt b/internal/help/_TRIM$__1111$.txt similarity index 76% rename from internal/help/_TRIM$.txt rename to internal/help/_TRIM$__1111$.txt index 64b19bf4b..2933aff5f 100644 --- a/internal/help/_TRIM$.txt +++ b/internal/help/_TRIM$__1111$.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:30}} {{DISPLAYTITLE:_TRIM$}} The [[_TRIM$]] function removes both leading and trailing space characters from a [[STRING]] value. @@ -17,11 +19,11 @@ The [[_TRIM$]] function removes both leading and trailing space characters from ''Example: Demonstrating how _TRIM$(text$) can replace LTRIM$(RTRIM$(text$)): {{CodeStart}} text$ = {{Cl|SPACE$}}(10) + "some text" + {{Cl|SPACE$}}(10) -{{Cl|PRINT}} "[" + text$ + "]" '' '' -{{Cl|PRINT}} "[" + {{Cl|RTRIM$}}(text$) + "]" '' '' -{{Cl|PRINT}} "[" + {{Cl|LTRIM$}}(text$) + "]" '' '' -{{Cl|PRINT}} "[" + {{Cl|LTRIM$}}({{Cl|RTRIM$}}(text$)) + "]" '' '' -{{Cl|PRINT}} "[" + {{Cl|_TRIM$}}(text$) + "]" '' '' +{{Cl|PRINT}} "[" + text$ + "]" +{{Cl|PRINT}} "[" + {{Cl|RTRIM$}}(text$) + "]" +{{Cl|PRINT}} "[" + {{Cl|LTRIM$}}(text$) + "]" +{{Cl|PRINT}} "[" + {{Cl|LTRIM$}}({{Cl|RTRIM$}}(text$)) + "]" +{{Cl|PRINT}} "[" + {{Cl|_TRIM$}}(text$) + "]" {{CodeEnd}} {{OutputStart}}[ some text ] [ some text] @@ -36,4 +38,4 @@ text$ = {{Cl|SPACE$}}(10) + "some text" + {{Cl|SPACE$}}(10) {{PageNavigation}} -< + diff --git a/internal/help/_UNSIGNED.txt b/internal/help/_UNSIGNED__11111111.txt similarity index 85% rename from internal/help/_UNSIGNED.txt rename to internal/help/_UNSIGNED__11111111.txt index 98e6e7d8b..cc73e438d 100644 --- a/internal/help/_UNSIGNED.txt +++ b/internal/help/_UNSIGNED__11111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:31}} {{DISPLAYTITLE:_UNSIGNED}} [[_UNSIGNED]] defines a numerical value as being only positive. @@ -14,13 +16,13 @@ * [[_UNSIGNED]] can be used in a [[_DEFINE]] statement to set undefined variable name first letters as all positive-only values. * Can also be used in [[DIM]] statements or subprocedure parameter definitions following [[AS]]. * [[_UNSIGNED]] allows larger positive numerical variable value limits than signed ones. -* The unsigned variable type suffix used is the '''tilde (~)''', right before the number's own type suffix: {{Parameter|variableName~&}} +* 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> +
How negative values affect the [[_UNSIGNED]] value returned by a [[_BYTE]] (8 bits).
{{WhiteStart}} - 00000001 - unsigned & signed are both 1 - 01111111 - unsigned & signed are both 127 + 00000001 - unsigned & signed are both 1 + 01111111 - unsigned & signed are both 127 11111111 - unsigned is 255 but signed is -1 11111110 - unsigned is 254 but signed is -2 11111101 - unsigned is 253 but signed is -3 @@ -29,25 +31,25 @@ {{PageExamples}} ''Example 1:'' In '''QB64''', when a signed [[INTEGER]] value exceeds 32767, the value may become a negative value: -{{CodeStart}} '' '' +{{CodeStart}} i% = 38000 -{{Cl|PRINT}} i% '' '' +{{Cl|PRINT}} i% {{CodeEnd}}{{OutputStart}}-27536 {{OutputEnd}} :''Explanation:'' Use an [[_UNSIGNED]] [[INTEGER]] or a ~% variable type suffix for only positive integer values up to 65535. ''Example 2:'' In '''QB64''', [[_UNSIGNED]] [[INTEGER]] values greater than 65535 cycle over again from zero: -{{CodeStart}} '' '' +{{CodeStart}} i~% = 70000 -{{Cl|PRINT}} i~% '' '' +{{Cl|PRINT}} i~% {{CodeEnd}}{{OutputStart}} 4464 {{OutputEnd}} :''Explanation:'' In QB64 an unsigned integer value of 65536 would be 0 with values increasing by the value minus 65536. ''Example 3:'' Demonstrating how _UNSIGNED variables expand the [[INTEGER]] range. -{{CodeStart}} '' '' +{{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" @@ -56,9 +58,9 @@ i~% = 70000 {{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}} {{Cl|INP}}(&H60) = 1 {{Cl|THEN}} {{Cl|EXIT|EXIT FOR}} ' escape key exit + {{Cl|IF...THEN|IF}} {{Cl|INP}}(&H60) = 1 {{Cl|THEN}} {{Cl|EXIT|EXIT FOR}} ' escape key exit {{Cl|NEXT}} n -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} {{OutputStart}} @@ -87,4 +89,4 @@ i~% = 70000 {{PageNavigation}} -< + diff --git a/internal/help/_WHEEL.txt b/internal/help/_WHEEL__11111.txt similarity index 84% rename from internal/help/_WHEEL.txt rename to internal/help/_WHEEL__11111.txt index a513cc0d1..22e56d6c5 100644 --- a/internal/help/_WHEEL.txt +++ b/internal/help/_WHEEL__11111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:35}} {{DISPLAYTITLE:_WHEEL}} The [[_WHEEL]] function returns the relative position of a specified wheel number on a controller device. @@ -15,35 +17,35 @@ The [[_WHEEL]] function returns the relative position of a specified wheel numbe {{PageExamples}} ''Example 1:'' Reading multiple controller device buttons, axis and wheels. -{{CodeStart}} '' '' +{{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|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|FOR...NEXT|FOR}} b = 1 {{Cl|TO}} {{Cl|_LASTBUTTON}}(d&) + d& = {{Cl|_DEVICEINPUT}} + {{Cl|IF...THEN|IF}} d& {{Cl|THEN}} ' the device number cannot be zero! + {{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}} - {{Cl|FOR...NEXT|FOR}} a = 1 {{Cl|TO}} {{Cl|_LASTAXIS}}(d&) + {{Cl|FOR...NEXT|FOR}} a = 1 {{Cl|TO}} {{Cl|_LASTAXIS}}(d&) {{Cl|PRINT}} {{Cl|_AXIS}}(a); {{Cl|NEXT}} - {{Cl|FOR...NEXT|FOR}} w = 1 {{Cl|TO}} {{Cl|_LASTWHEEL}}(d&) + {{Cl|FOR...NEXT|FOR}} w = 1 {{Cl|TO}} {{Cl|_LASTWHEEL}}(d&) {{Cl|PRINT}} {{Cl|_WHEEL}}(w); {{Cl|NEXT}} {{Cl|PRINT}} {{Cl|END IF}} {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) 'escape key exit -{{Cl|END}} '' '' +{{Cl|END}} {{CodeEnd}} : ''Note:'' When there is no device control to read, a [[FOR...NEXT|FOR]] n = 1 TO 0 loop will not run thus avoiding a control function read error. ''Example 2:'' Why does a mouse have 3 wheels? Relative x and y movements can be read using the first 2 _WHEEL reads. -{{CodeStart}} '' '' +{{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)" @@ -53,7 +55,7 @@ DO: {{Cl|_LIMIT}} 30 'main loop {{Cl|DO...LOOP|DO}} {{Cl|WHILE}} {{Cl|_DEVICEINPUT}}(2) 'loop only runs during a device 2 mouse event {{Cl|PRINT}} {{Cl|_WHEEL}}(1), {{Cl|_WHEEL}}(2), {{Cl|_WHEEL}}(3) {{Cl|LOOP}} -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) '' '' +{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Cl|CHR$}}(27) {{CodeEnd}} : ''Explanation:'' Referencing the [[_MOUSEMOVEMENTX]] function hides the mouse and sets the mouse to a relative movement mode which can be read by [[_WHEEL]]. [[_DEVICEINPUT]](2) returns -1 (true) only when the mouse is moved, scrolled or clicked. @@ -68,4 +70,4 @@ DO: {{Cl|_LIMIT}} 30 'main loop {{PageNavigation}} -< + diff --git a/internal/help/_WIDTH_(function).txt b/internal/help/_WIDTH_(function)__11111_(00000000).txt similarity index 57% rename from internal/help/_WIDTH_(function).txt rename to internal/help/_WIDTH_(function)__11111_(00000000).txt index c8591291c..d387f0017 100644 --- a/internal/help/_WIDTH_(function).txt +++ b/internal/help/_WIDTH_(function)__11111_(00000000).txt @@ -1,17 +1,19 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:36}} {{DISPLAYTITLE:_WIDTH (function)}} The [[_WIDTH (function)|_WIDTH]] function returns the width of an image handle or of the current write page. {{PageSyntax}} -: {{Parameter|columns&}} = [[_WIDTH (function)|_WIDTH]][({{Parameter|imageHandle&}})] +: {{Parameter|columns&}} = [[_WIDTH (function)|_WIDTH]][({{Parameter|imageHandle&}})] {{PageDescription}} -* If {{Parameter|imageHandle&}} is omitted, it's assumed to be the handle of the current [[SCREEN]] or write page. -* To get the width of the current program [[SCREEN|screen]] window use zero for the handle value or nothing: {{Parameter|columns&}} = [[_WIDTH (function)|_WIDTH]](0) ''or'' {{Parameter|columns&}} = [[_WIDTH (function)|_WIDTH]] -* If the image specified by {{Parameter|imageHandle&}} is in text only([[SCREEN]] 0) mode, the number of characters per row is returned. -* If the image specified by {{Parameter|imageHandle&}} is in graphics mode, the number of pixels per row is returned. -* If {{Parameter|imageHandle&}} is an invalid handle, then an [[ERROR Codes|invalid handle error]] is returned. +* If {{Parameter|imageHandle&}} is omitted, it's assumed to be the handle of the current [[SCREEN]] or write page. +* To get the width of the current program [[SCREEN|screen]] window use zero for the handle value or nothing: {{Parameter|columns&}} = [[_WIDTH (function)|_WIDTH]](0) ''or'' {{Parameter|columns&}} = [[_WIDTH (function)|_WIDTH]] +* If the image specified by {{Parameter|imageHandle&}} is in text only([[SCREEN]] 0) mode, the number of characters per row is returned. +* If the image specified by {{Parameter|imageHandle&}} is in graphics mode, the number of pixels per row is returned. +* If {{Parameter|imageHandle&}} is an invalid handle, then an [[ERROR Codes|invalid handle error]] is returned. * The last visible pixel coordinate of a program [[SCREEN|screen]] is '''[[_WIDTH (function)|_WIDTH]] - 1'''. @@ -20,13 +22,13 @@ The [[_WIDTH (function)|_WIDTH]] function returns the width of an image handle o {{CodeStart}} - s& = {{Cl|_NEWIMAGE}}(800, 600, 256) - SCREEN s& - Align 15, 5, s&, "This text is centered on the screen!" + s& = {{Cl|_NEWIMAGE}}(800, 600, 256) + SCREEN s& + 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 - MaxCol = (center& \ 8) + 1 'screen text width = 8 pixels + SUB Align (Tcolor, Trow, mode&, txt$) + center& = {{Cl|_WIDTH (function)|_WIDTH}} (mode&) \ 2 'returns pixels in graphic modes + MaxCol = (center& \ 8) + 1 'screen text width = 8 pixels Tcol = MaxCol - ({{Cl|LEN}}(txt$) \ 2) {{Cl|COLOR}} Tcolor: {{Cl|LOCATE}} Trow, Tcol: {{Cl|PRINT}} txt$; END SUB @@ -36,7 +38,7 @@ The [[_WIDTH (function)|_WIDTH]] function returns the width of an image handle o : ''Explanation:'' [[_NEWIMAGE]] enlarges a screen to 800 pixels wide which is what [[_WIDTH (function)|_WIDTH]] function will return. The center is 800 \ 2 or 400. Since the text width is 8 pixels, that is divided by 8 to get 50 as the center text column. Then half of the text length is subtracted to find the starting text print [[LOCATE]] column. -: ''Note:'' The screen handle parameter is required because using no handle could assume other page handles created by functions like [[_NEWIMAGE]] or [[_PUTIMAGE]]. Use the correct handle in the SUB call! When using SCREEN 0, the MaxCol variable is not needed because _WIDTH returns the number of text columns, not pixels. Use the center value and add 1. '''Tcol = (center& + 1) - LEN(txt$) \ 2''' +: ''Note:'' The screen handle parameter is required because using no handle could assume other page handles created by functions like [[_NEWIMAGE]] or [[_PUTIMAGE]]. Use the correct handle in the SUB call! When using SCREEN 0, the MaxCol variable is not needed because _WIDTH returns the number of text columns, not pixels. Use the center value and add 1. '''Tcol = (center& + 1) - LEN(txt$) \ 2''' @@ -47,4 +49,4 @@ The [[_WIDTH (function)|_WIDTH]] function returns the width of an image handle o {{PageNavigation}} -< + diff --git a/internal/help/_WINDOWHANDLE.txt b/internal/help/_WINDOWHANDLE.txt deleted file mode 100644 index 10c640a60..000000000 --- a/internal/help/_WINDOWHANDLE.txt +++ /dev/null @@ -1,97 +0,0 @@ -{{DISPLAYTITLE:_WINDOWHANDLE}} -The [[_WINDOWHANDLE]] function returns the window handle assigned to the current program by the OS. Windows-only. - - -{{PageSyntax}} -: {{Parameter|hwnd&&}} = [[_WINDOWHANDLE]] - - -{{PageDescription}} -* The result is an [[_INTEGER64]] number assigned by Windows to your running program. -* Use it to make [[Windows Libraries|API calls]] that require a window handle to be passed. -* [[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Not available in Linux or macOS]]. - - -==Availability== -* '''Build 20170924/68'''. - - -{{PageExamples}} -''Example:'' Showing the system-default message box in Windows. -{{CodeStart}} '' '' -'Message Box Constant values as defined by Microsoft (MBType) -{{Cl|CONST}} MB_OK& = 0 'OK button only -{{Cl|CONST}} MB_OKCANCEL& = 1 'OK & Cancel -{{Cl|CONST}} MB_ABORTRETRYIGNORE& = 2 'Abort, Retry & Ignore -{{Cl|CONST}} MB_YESNOCANCEL& = 3 'Yes, No & Cancel -{{Cl|CONST}} MB_YESNO& = 4 'Yes & No -{{Cl|CONST}} MB_RETRYCANCEL& = 5 'Retry & Cancel -{{Cl|CONST}} MB_CANCELTRYCONTINUE& = 6 'Cancel, Try Again & Continue -{{Cl|CONST}} MB_ICONSTOP& = 16 'Error stop sign icon -{{Cl|CONST}} MB_ICONQUESTION& = 32 'Question-mark icon -{{Cl|CONST}} MB_ICONEXCLAMATION& = 48 'Exclamation-point icon -{{Cl|CONST}} MB_ICONINFORMATION& = 64 'Letter i in a circle icon -{{Cl|CONST}} MB_DEFBUTTON1& = 0 '1st button default(left) -{{Cl|CONST}} MB_DEFBUTTON2& = 256 '2nd button default -{{Cl|CONST}} MB_DEFBUTTON3& = 512 '3rd button default(right) -{{Cl|CONST}} MB_APPLMODAL& = 0 'Message box applies to application only -{{Cl|CONST}} MB_SYSTEMMODAL& = 4096 'Message box on top of all other windows -{{Cl|CONST}} MB_SETFOCUS& = 65536 'Set message box as focus -{{Cl|CONST}} IDOK& = 1 'OK button pressed -{{Cl|CONST}} IDCANCEL& = 2 'Cancel button pressed -{{Cl|CONST}} IDABORT& = 3 'Abort button pressed -{{Cl|CONST}} IDRETRY& = 4 'Retry button pressed -{{Cl|CONST}} IDIGNORE& = 5 'Ignore button pressed -{{Cl|CONST}} IDYES& = 6 'Yes button pressed -{{Cl|CONST}} IDNO& = 7 'No button pressed -{{Cl|CONST}} IDTRYAGAIN& = 10 'Try again button pressed -{{Cl|CONST}} IDCONTINUE& = 1 'Continue button pressed -'---------------------------------------------------------------------------------------- - -{{Cl|DECLARE LIBRARY|DECLARE DYNAMIC LIBRARY}} "user32" -{{Cl|FUNCTION}} MessageBoxA& ({{Cl|BYVAL}} hwnd {{Cl|AS}} {{Cl|LONG}}, Message {{Cl|AS}} {{Cl|STRING}}, Title {{Cl|AS}} {{Cl|STRING}}, {{Cl|BYVAL}} MBType {{Cl|AS}} {{Cl|_UNSIGNED}} {{Cl|LONG}}) -{{Cl|DECLARE LIBRARY|END DECLARE}} - -DO - msg& = 0: icon& = 0: DB& = 0 - {{Cl|INPUT}} "Enter Message Box type(0 to 6 other Quits): ", BOX& - {{Cl|IF...THEN|IF}} BOX& < 0 {{Cl|OR (boolean)|OR}} BOX& > 6 {{Cl|THEN}} {{Cl|EXIT DO}} - - {{Cl|INPUT}} "Enter Icon&(0=none, 1=stop, 2=?, 3=!, 4=info): ", Icon& - - {{Cl|IF...THEN|IF}} BOX& {{Cl|THEN}} {{Cl|INPUT (file mode)|INPUT}} "Enter Default Button(1st, 2nd or 3rd): ", DB& - {{Cl|IF...THEN|IF}} DB& {{Cl|THEN}} DB& = DB& - 1 'adjust value to 0, 1, or 2 - msg& = MsgBox&("Box Title", "Box text message", BOX&, Icon&, DB&, 4096) 'on top of all windows - - {{Cl|PRINT}} "Button ="; msg& -{{Cl|LOOP}} -{{Cl|END}} - -{{Cl|FUNCTION}} MsgBox& (Title$, Message$, BoxType&, Icon&, DBtn&, Mode&) -{{Cl|SELECT CASE}} Icon& - {{Cl|CASE}} 1: Icon& = MB_ICONSTOP& 'warning X-sign icon - {{Cl|CASE}} 2: Icon& = MB_ICONQUESTION& 'question-mark icon - {{Cl|CASE}} 3: Icon& = MB_ICONEXCLAMATION& 'exclamation-point icon - {{Cl|CASE}} 4: Icon& = MB_ICONINFORMATION& 'lowercase letter i in circle - {{Cl|CASE ELSE}}: Icon& = 0 'no icon -{{Cl|END SELECT}} -{{Cl|IF...THEN|IF}} BoxType& > 0 {{Cl|AND (boolean)|AND}} DBtn& > 0 {{Cl|THEN}} 'set default button as 2nd(256) or 3rd(512) - {{Cl|SELECT CASE}} BoxType& - {{Cl|CASE}} 2, 3, 6 - {{Cl|IF...THEN|IF}} DBtn& = 2 {{Cl|THEN}} Icon& = Icon& + MB_DEFBUTTON3& {{Cl|ELSE}} Icon& = Icon& + MB_DEFBUTTON2& '3 button - {{Cl|CASE ELSE}}: Icon& = Icon& + MB_DEFBUTTON2& '2nd button default - {{Cl|END SELECT}} -{{Cl|END IF}} -Focus& = MB_SetFocus& -MsgBox& = MessageBoxA&({{Cl|_WINDOWHANDLE}}, Message$, Title$, BoxType& + Icon& + Mode& + Focus&) 'focus on button -{{Cl|END FUNCTION}} '' '' -{{CodeEnd}} -:''Explanation:'' Notice how the call to the external dynamic library function MessageBoxA& passes _WINDOWHANDLE to the API and how the message box shown is created as a child of your program's window, not allowing the main window to be manipulated while the message box is open. - -{{PageSeeAlso}} -* [[_WINDOWHASFOCUS]] -* [[Windows Libraries]] - - -{{PageNavigation}} -< diff --git a/internal/help/_WINDOWHANDLE__111111111111.txt b/internal/help/_WINDOWHANDLE__111111111111.txt new file mode 100644 index 000000000..3b3bb4e1a --- /dev/null +++ b/internal/help/_WINDOWHANDLE__111111111111.txt @@ -0,0 +1,99 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:38}} +{{DISPLAYTITLE:_WINDOWHANDLE}} +The [[_WINDOWHANDLE]] function returns the window handle assigned to the current program by the OS. Windows-only. + + +{{PageSyntax}} +: {{Parameter|hwnd&&}} = [[_WINDOWHANDLE]] + + +{{PageDescription}} +* The result is an [[_INTEGER64]] number assigned by Windows to your running program. +* Use it to make [[Windows Libraries|API calls]] that require a window handle to be passed. +* [[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Not available in Linux or macOS]]. + + +==Availability== +* '''Build 20170924/68'''. + + +{{PageExamples}} +''Example:'' Showing the system-default message box in Windows. +{{CodeStart}} +'Message Box Constant values as defined by Microsoft (MBType) +{{Cl|CONST}} MB_OK& = 0 'OK button only +{{Cl|CONST}} MB_OKCANCEL& = 1 'OK & Cancel +{{Cl|CONST}} MB_ABORTRETRYIGNORE& = 2 'Abort, Retry & Ignore +{{Cl|CONST}} MB_YESNOCANCEL& = 3 'Yes, No & Cancel +{{Cl|CONST}} MB_YESNO& = 4 'Yes & No +{{Cl|CONST}} MB_RETRYCANCEL& = 5 'Retry & Cancel +{{Cl|CONST}} MB_CANCELTRYCONTINUE& = 6 'Cancel, Try Again & Continue +{{Cl|CONST}} MB_ICONSTOP& = 16 'Error stop sign icon +{{Cl|CONST}} MB_ICONQUESTION& = 32 'Question-mark icon +{{Cl|CONST}} MB_ICONEXCLAMATION& = 48 'Exclamation-point icon +{{Cl|CONST}} MB_ICONINFORMATION& = 64 'Letter i in a circle icon +{{Cl|CONST}} MB_DEFBUTTON1& = 0 '1st button default(left) +{{Cl|CONST}} MB_DEFBUTTON2& = 256 '2nd button default +{{Cl|CONST}} MB_DEFBUTTON3& = 512 '3rd button default(right) +{{Cl|CONST}} MB_APPLMODAL& = 0 'Message box applies to application only +{{Cl|CONST}} MB_SYSTEMMODAL& = 4096 'Message box on top of all other windows +{{Cl|CONST}} MB_SETFOCUS& = 65536 'Set message box as focus +{{Cl|CONST}} IDOK& = 1 'OK button pressed +{{Cl|CONST}} IDCANCEL& = 2 'Cancel button pressed +{{Cl|CONST}} IDABORT& = 3 'Abort button pressed +{{Cl|CONST}} IDRETRY& = 4 'Retry button pressed +{{Cl|CONST}} IDIGNORE& = 5 'Ignore button pressed +{{Cl|CONST}} IDYES& = 6 'Yes button pressed +{{Cl|CONST}} IDNO& = 7 'No button pressed +{{Cl|CONST}} IDTRYAGAIN& = 10 'Try again button pressed +{{Cl|CONST}} IDCONTINUE& = 1 'Continue button pressed +'---------------------------------------------------------------------------------------- + +{{Cl|DECLARE LIBRARY|DECLARE DYNAMIC LIBRARY}} "user32" +{{Cl|FUNCTION}} MessageBoxA& ({{Cl|BYVAL}} hwnd {{Cl|AS}} {{Cl|LONG}}, Message {{Cl|AS}} {{Cl|STRING}}, Title {{Cl|AS}} {{Cl|STRING}}, {{Cl|BYVAL}} MBType {{Cl|AS}} {{Cl|_UNSIGNED}} {{Cl|LONG}}) +{{Cl|DECLARE LIBRARY|END DECLARE}} + +DO + msg& = 0: icon& = 0: DB& = 0 + {{Cl|INPUT}} "Enter Message Box type(0 to 6 other Quits): ", BOX& + {{Cl|IF...THEN|IF}} BOX& < 0 {{Cl|OR (boolean)|OR}} BOX& > 6 {{Cl|THEN}} {{Cl|EXIT DO}} + + {{Cl|INPUT}} "Enter Icon&(0=none, 1=stop, 2=?, 3=!, 4=info): ", Icon& + + {{Cl|IF...THEN|IF}} BOX& {{Cl|THEN}} {{Cl|INPUT (file mode)|INPUT}} "Enter Default Button(1st, 2nd or 3rd): ", DB& + {{Cl|IF...THEN|IF}} DB& {{Cl|THEN}} DB& = DB& - 1 'adjust value to 0, 1, or 2 + msg& = MsgBox&("Box Title", "Box text message", BOX&, Icon&, DB&, 4096) 'on top of all windows + + {{Cl|PRINT}} "Button ="; msg& +{{Cl|LOOP}} +{{Cl|END}} + +{{Cl|FUNCTION}} MsgBox& (Title$, Message$, BoxType&, Icon&, DBtn&, Mode&) +{{Cl|SELECT CASE}} Icon& + {{Cl|CASE}} 1: Icon& = MB_ICONSTOP& 'warning X-sign icon + {{Cl|CASE}} 2: Icon& = MB_ICONQUESTION& 'question-mark icon + {{Cl|CASE}} 3: Icon& = MB_ICONEXCLAMATION& 'exclamation-point icon + {{Cl|CASE}} 4: Icon& = MB_ICONINFORMATION& 'lowercase letter i in circle + {{Cl|CASE ELSE}}: Icon& = 0 'no icon +{{Cl|END SELECT}} +{{Cl|IF...THEN|IF}} BoxType& > 0 {{Cl|AND (boolean)|AND}} DBtn& > 0 {{Cl|THEN}} 'set default button as 2nd(256) or 3rd(512) + {{Cl|SELECT CASE}} BoxType& + {{Cl|CASE}} 2, 3, 6 + {{Cl|IF...THEN|IF}} DBtn& = 2 {{Cl|THEN}} Icon& = Icon& + MB_DEFBUTTON3& {{Cl|ELSE}} Icon& = Icon& + MB_DEFBUTTON2& '3 button + {{Cl|CASE ELSE}}: Icon& = Icon& + MB_DEFBUTTON2& '2nd button default + {{Cl|END SELECT}} +{{Cl|END IF}} +Focus& = MB_SetFocus& +MsgBox& = MessageBoxA&({{Cl|_WINDOWHANDLE}}, Message$, Title$, BoxType& + Icon& + Mode& + Focus&) 'focus on button +{{Cl|END FUNCTION}} +{{CodeEnd}} +:''Explanation:'' Notice how the call to the external dynamic library function MessageBoxA& passes _WINDOWHANDLE to the API and how the message box shown is created as a child of your program's window, not allowing the main window to be manipulated while the message box is open. + +{{PageSeeAlso}} +* [[_WINDOWHASFOCUS]] +* [[Windows Libraries]] + + +{{PageNavigation}} + diff --git a/internal/help/_WINDOWHASFOCUS.txt b/internal/help/_WINDOWHASFOCUS__11111111111111.txt similarity index 95% rename from internal/help/_WINDOWHASFOCUS.txt rename to internal/help/_WINDOWHASFOCUS__11111111111111.txt index 58fe26e17..0fbcae287 100644 --- a/internal/help/_WINDOWHASFOCUS.txt +++ b/internal/help/_WINDOWHASFOCUS__11111111111111.txt @@ -1,3 +1,5 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:11:39}} {{DISPLAYTITLE:_WINDOWHASFOCUS}} The [[_WINDOWHASFOCUS]] function returns true (-1) if the current program's window has focus. Windows-only. @@ -17,7 +19,7 @@ The [[_WINDOWHASFOCUS]] function returns true (-1) if the current program's wind {{PageExamples}} ''Example:'' Detecting if the current program has focus. Windows and Linux-only. -{{CodeStart}} '' '' +{{CodeStart}} DO {{Cl|IF}} {{Cl|_WINDOWHASFOCUS}} THEN {{Cl|COLOR}} 15, 6 @@ -40,4 +42,4 @@ DO {{PageNavigation}} -< + diff --git a/internal/help/_glAccum.txt b/internal/help/_glAccum.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glAccum.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glAlphaFunc.txt b/internal/help/_glAlphaFunc.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glAlphaFunc.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glAreTexturesResident.txt b/internal/help/_glAreTexturesResident.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glAreTexturesResident.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glArrayElement.txt b/internal/help/_glArrayElement.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glArrayElement.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glBegin.txt b/internal/help/_glBegin.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glBegin.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glBindTexture.txt b/internal/help/_glBindTexture.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glBindTexture.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glBindTexture__0010001000000.txt b/internal/help/_glBindTexture__0010001000000.txt new file mode 100644 index 000000000..d8e8f3d31 --- /dev/null +++ b/internal/help/_glBindTexture__0010001000000.txt @@ -0,0 +1,60 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:42}} +'''_glBindTexture:''' bind a named texture to a texturing target + + +{{PageSyntax}} + +:: SUB '''_glBindTexture''' (BYVAL target AS _UNSIGNED LONG, BYVAL texture AS _UNSIGNED LONG) +:: void '''_glBindTexture'''(GLenum {{Parameter|target}}, GLuint {{Parameter|texture}}); + + +; target +: Specifies the target to which the texture is bound. Must be either {{KW|_GL_TEXTURE_1D}}, {{KW|_GL_TEXTURE_2D}}, {{KW|_GL_TEXTURE_3D}}, or {{KW|_GL_TEXTURE_1D_ARRAY}}, {{KW|_GL_TEXTURE_2D_ARRAY}}, {{KW|_GL_TEXTURE_RECTANGLE}}, {{KW|_GL_TEXTURE_CUBE_MAP}}, {{KW|_GL_TEXTURE_2D_MULTISAMPLE}}, {{KW|_GL_TEXTURE_2D_MULTISAMPLE_ARRAY}}, {{KW|_GL_TEXTURE_BUFFER}}, or {{KW|_GL_TEXTURE_CUBE_MAP_ARRAY}}. +; texture +: Specifies the name of a texture. + + +{{PageDescription}} + +'''_glBindTexture''' lets you create or use a named texture. Calling '''_glBindTexture''' with {{Parameter|target}} set to {{KW|_GL_TEXTURE_1D}}, {{KW|_GL_TEXTURE_2D}}, {{KW|_GL_TEXTURE_3D}}, or {{KW|_GL_TEXTURE_1D_ARRAY}}, {{KW|_GL_TEXTURE_2D_ARRAY}}, {{KW|_GL_TEXTURE_RECTANGLE}}, {{KW|_GL_TEXTURE_CUBE_MAP}}, {{KW|_GL_TEXTURE_2D_MULTISAMPLE}} or {{KW|_GL_TEXTURE_2D_MULTISAMPLE_ARRAY}} and {{Parameter|texture}} set to the name of the new texture binds the texture name to the target. When a texture is bound to a target, the previous binding for that target is automatically broken. + +Texture names are unsigned integers. The value zero is reserved to represent the default texture for each texture target. Texture names and the corresponding texture contents are local to the shared object space of the current GL rendering context; two rendering contexts share texture names only if they explicitly enable sharing between contexts through the appropriate GL windows interfaces functions. + +You must use {{KW|_glGenTextures}} to generate a set of new texture names. + +When a texture is first bound, it assumes the specified target: A texture first bound to {{KW|_GL_TEXTURE_1D}} becomes one-dimensional texture, a texture first bound to {{KW|_GL_TEXTURE_2D}} becomes two-dimensional texture, a texture first bound to {{KW|_GL_TEXTURE_3D}} becomes three-dimensional texture, a texture first bound to {{KW|_GL_TEXTURE_1D_ARRAY}} becomes one-dimensional array texture, a texture first bound to {{KW|_GL_TEXTURE_2D_ARRAY}} becomes two-dimensional arary texture, a texture first bound to {{KW|_GL_TEXTURE_RECTANGLE}} becomes rectangle texture, a, texture first bound to {{KW|_GL_TEXTURE_CUBE_MAP}} becomes a cube-mapped texture, a texture first bound to {{KW|_GL_TEXTURE_2D_MULTISAMPLE}} becomes a two-dimensional multisampled texture, and a texture first bound to {{KW|_GL_TEXTURE_2D_MULTISAMPLE_ARRAY}} becomes a two-dimensional multisampled array texture. The state of a one-dimensional texture immediately after it is first bound is equivalent to the state of the default {{KW|_GL_TEXTURE_1D}} at GL initialization, and similarly for the other texture types. + +While a texture is bound, GL operations on the target to which it is bound affect the bound texture, and queries of the target to which it is bound return state from the bound texture. In effect, the texture targets become aliases for the textures currently bound to them, and the texture name zero refers to the default textures that were bound to them at initialization. + +A texture binding created with '''_glBindTexture''' remains active until a different texture is bound to the same target, or until the bound texture is deleted with {{KW|_glDeleteTextures}}. + +Once created, a named texture may be re-bound to its same original target as often as needed. It is usually much faster to use '''_glBindTexture''' to bind an existing named texture to one of the texture targets than it is to reload the texture image using {{KW|_glTexImage1D}}, {{KW|_glTexImage2D}}, {{KW|_glTexImage3D}} or another similar function. + + +{{PageNotes}} + +The {{KW|_GL_TEXTURE_2D_MULTISAMPLE}} and {{KW|_GL_TEXTURE_2D_MULTISAMPLE_ARRAY}} targets are available only if the GL version is 3.2 or higher. + + +{{PageErrors}} + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|target}} is not one of the allowable values. + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|target}} is not a name returned from a previous call to {{KW|_glGenTextures}}. + +{{KW|_GL_INVALID_OPERATION}} is generated if {{Parameter|texture}} was previously created with a target that doesn't match that of {{Parameter|target}}. + + +{{PageUseWith}} + +{{KW|_glGet}} with argument {{KW|_GL_TEXTURE_BINDING_1D}}, {{KW|_GL_TEXTURE_BINDING_2D}}, {{KW|_GL_TEXTURE_BINDING_3D}}, {{KW|_GL_TEXTURE_BINDING_1D_ARRAY}}, {{KW|_GL_TEXTURE_BINDING_2D_ARRAY}}, {{KW|_GL_TEXTURE_BINDING_RECTANGLE}}, {{KW|_GL_TEXTURE_BINDING_2D_MULTISAMPLE}}, or {{KW|_GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY}}. + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glActiveTexture}}, {{KW|_glDeleteTextures}}, {{KW|_glGenTextures}}, {{KW|_glGetTexParameter}}, {{KW|_glIsTexture}}, {{KW|_glTexParameter}} + + +{{PageCopyright}} + diff --git a/internal/help/_glBitmap.txt b/internal/help/_glBitmap.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glBitmap.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glBlendFunc.txt b/internal/help/_glBlendFunc.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glBlendFunc.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glCallList.txt b/internal/help/_glCallList.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glCallList.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glCallLists.txt b/internal/help/_glCallLists.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glCallLists.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glClear.txt b/internal/help/_glClear.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glClear.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glClearAccum.txt b/internal/help/_glClearAccum.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glClearAccum.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glClearColor.txt b/internal/help/_glClearColor.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glClearColor.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glClearColor__001000010000.txt b/internal/help/_glClearColor__001000010000.txt new file mode 100644 index 000000000..655bc179b --- /dev/null +++ b/internal/help/_glClearColor__001000010000.txt @@ -0,0 +1,37 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:50}} +'''_glClearColor:''' specify clear values for the color buffers + + +{{PageSyntax}} + +:: SUB '''_glClearColor''' (BYVAL red AS SINGLE, BYVAL green AS SINGLE, BYVAL blue AS SINGLE, BYVAL alpha AS SINGLE) +:: void '''_glClearColor'''(GLfloat {{Parameter|red}}, GLfloat {{Parameter|green}}, GLfloat {{Parameter|blue}}, GLfloat {{Parameter|alpha}}); + + +; red, green, blue, alpha +: Specify the red, green, blue, and alpha values used when the color buffers are cleared. The initial values are all 0. + + +{{PageDescription}} + +'''_glClearColor''' specifies the red, green, blue, and alpha values used by {{KW|_glClear}} to clear the color buffers. + + +{{PageNotes}} + +The type of the {{Parameter|red}}, {{Parameter|green}}, {{Parameter|blue}}, and {{Parameter|alpha}} parameters was changed from GLclampf to GLfloat. This change is transparent to user code. + + +{{PageUseWith}} + +{{KW|_glGet}} with argument {{KW|_GL_COLOR_CLEAR_VALUE}} + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glClear}} + + +{{PageCopyright}} + diff --git a/internal/help/_glClearDepth.txt b/internal/help/_glClearDepth.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glClearDepth.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glClearDepth__001000010000.txt b/internal/help/_glClearDepth__001000010000.txt new file mode 100644 index 000000000..1ba5aba68 --- /dev/null +++ b/internal/help/_glClearDepth__001000010000.txt @@ -0,0 +1,37 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:52}} +'''_glClearDepth:''' specify the clear value for the depth buffer + + +{{PageSyntax}} + +:: SUB _glClearDepth (BYVAL depth AS DOUBLE) +:: void '''_glClearDepth'''(GLdouble {{Parameter|depth}}); +:: void '''_glClearDepthf'''(GLfloat {{Parameter|depth}}); + +; depth +: Specifies the depth value used when the depth buffer is cleared. The initial value is 1. + + +{{PageDescription}} + +'''_glClearDepth''' specifies the depth value used by {{KW|_glClear}} to clear the depth buffer. Values specified by '''_glClearDepth''' are clamped to the range [0, 1]. + + +{{PageNotes}} + +The type of the {{Parameter|depth}} parameter was changed from GLclampf to GLfloat for '''_glClearDepthf''' and from GLclampd to GLdouble for '''_glClearDepth'''. This change is transparent to user code. + + +{{PageUseWith}} + +{{KW|_glGet}} with argument {{KW|_GL_DEPTH_CLEAR_VALUE}} + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glClear}} + + +{{PageCopyright}} + diff --git a/internal/help/_glClearIndex.txt b/internal/help/_glClearIndex.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glClearIndex.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glClearStencil.txt b/internal/help/_glClearStencil.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glClearStencil.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glClearStencil__00100001000000.txt b/internal/help/_glClearStencil__00100001000000.txt new file mode 100644 index 000000000..9cce6cfee --- /dev/null +++ b/internal/help/_glClearStencil__00100001000000.txt @@ -0,0 +1,35 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:54}} +'''_glClearStencil:''' specify the clear value for the stencil buffer + + +{{PageSyntax}} + +:: SUB _glClearStencil (BYVAL s AS LONG) +:: void '''_glClearStencil'''(GLint {{Parameter|s}}); + + +; s +: Specifies the index used when the stencil buffer is cleared. The initial value is 0. + + +{{PageDescription}} + +'''_glClearStencil''' specifies the index used by {{KW|_glClear}} to clear the stencil buffer. {{Parameter|s}} is masked with 2m - 1, where m is the number of bits in the stencil buffer. + + +{{PageUseWith}} + +{{KW|_glGet}} with argument {{KW|_GL_STENCIL_CLEAR_VALUE}} + +{{KW|_glGet}} with argument {{KW|_GL_STENCIL_BITS}} + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glClear}} + + +{{PageCopyright}} + diff --git a/internal/help/_glClear__0010000.txt b/internal/help/_glClear__0010000.txt new file mode 100644 index 000000000..c8bef2c84 --- /dev/null +++ b/internal/help/_glClear__0010000.txt @@ -0,0 +1,59 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:17:48}} +'''_glClear:''' clear buffers to preset values + + +{{PageSyntax}} + +:: [[SUB]] _glClear ([[BYVAL]] mask AS [[_UNSIGNED]] [[LONG]]) +:: void '''_glClear'''(GLbitfield {{Parameter|mask}}); + + +{{PageParameters}} +* ''mask'' that indicate the buffer [[OR]] buffers to be cleared. The three masks are [[_GL_COLOR_BUFFER_BIT]], [[_GL_DEPTH_BUFFER_BIT]], and [[_GL_STENCIL_BUFFER_BIT]]. + + +{{PageDescription}} + +* [[_glClear]] sets the bitplane area of the window to values previously selected by [[_glClearColor]], [[glClearDepth]], and [[_glClearStencil]]. +* Multiple color buffers can be cleared simultaneously by selecting more than one buffer at a time using [[_glDrawBuffer]]. +* The pixel ownership test, the scissor test, dithering, and the buffer writemasks affect the operation of [[_glClear]]. The scissor box bounds the cleared region. Alpha function, blend function, logical operation, stenciling, texture mapping, and depth-buffering are ignored by [[_glClear]]. + +* [[_glClear]] takes a single argument that is the bitwise OR of several values indicating which buffer is to be cleared. The values are as follows: + +::: [[_GL_COLOR_BUFFER_BIT]]: Indicates the buffers currently enabled for color writing. +::: [[_GL_DEPTH_BUFFER_BIT]]: Indicates the depth buffer. +::: [[_GL_STENCIL_BUFFER_BIT]]: Indicates the stencil buffer. + +* The value to which each buffer is cleared depends on the setting of the clear value for that buffer. + + +{{PageNotes}} + +If a buffer is not present, then a '''_glClear''' directed at that buffer has no effect. + + +{{PageErrors}} + +{{KW|_GL_INVALID_VALUE}} is generated if any bit other than the three defined bits is set in {{Parameter|mask}}. + + +{{PageUseWith}} + +{{KW|_glGet}} with argument {{KW|_GL_DEPTH_CLEAR_VALUE}} + +{{KW|_glGet}} with argument {{KW|_GL_COLOR_CLEAR_VALUE}} + +{{KW|_glGet}} with argument {{KW|_GL_STENCIL_CLEAR_VALUE}} + + +{{PageSeeAlso}} +* [[_GL]] +* [[_glClearBuffer]], [[_glClearColor]], [[_glClearDepth]], [[_glClearStencil]] +* [[_glColorMask]], [[_glDepthMask]], [[_glStencilMask]] +* [[_glDrawBuffer]], [[_glDrawBuffers]] +* [[_glScissor]] + + +{{PageCopyright}} + diff --git a/internal/help/_glClipPlane.txt b/internal/help/_glClipPlane.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glClipPlane.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor3b.txt b/internal/help/_glColor3b.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor3b.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor3bv.txt b/internal/help/_glColor3bv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor3bv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor3d.txt b/internal/help/_glColor3d.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor3d.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor3dv.txt b/internal/help/_glColor3dv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor3dv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor3f.txt b/internal/help/_glColor3f.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor3f.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor3fv.txt b/internal/help/_glColor3fv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor3fv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor3i.txt b/internal/help/_glColor3i.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor3i.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor3iv.txt b/internal/help/_glColor3iv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor3iv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor3s.txt b/internal/help/_glColor3s.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor3s.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor3sv.txt b/internal/help/_glColor3sv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor3sv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor3ub.txt b/internal/help/_glColor3ub.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor3ub.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor3ubv.txt b/internal/help/_glColor3ubv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor3ubv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor3ui.txt b/internal/help/_glColor3ui.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor3ui.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor3uiv.txt b/internal/help/_glColor3uiv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor3uiv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor3us.txt b/internal/help/_glColor3us.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor3us.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor3usv.txt b/internal/help/_glColor3usv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor3usv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor4b.txt b/internal/help/_glColor4b.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor4b.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor4bv.txt b/internal/help/_glColor4bv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor4bv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor4d.txt b/internal/help/_glColor4d.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor4d.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor4dv.txt b/internal/help/_glColor4dv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor4dv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor4f.txt b/internal/help/_glColor4f.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor4f.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor4fv.txt b/internal/help/_glColor4fv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor4fv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor4i.txt b/internal/help/_glColor4i.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor4i.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor4iv.txt b/internal/help/_glColor4iv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor4iv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor4s.txt b/internal/help/_glColor4s.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor4s.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor4sv.txt b/internal/help/_glColor4sv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor4sv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor4ub.txt b/internal/help/_glColor4ub.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor4ub.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor4ubv.txt b/internal/help/_glColor4ubv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor4ubv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor4ui.txt b/internal/help/_glColor4ui.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor4ui.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor4uiv.txt b/internal/help/_glColor4uiv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor4uiv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor4us.txt b/internal/help/_glColor4us.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor4us.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColor4usv.txt b/internal/help/_glColor4usv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColor4usv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColorMask.txt b/internal/help/_glColorMask.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColorMask.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColorMask__00100001000.txt b/internal/help/_glColorMask__00100001000.txt new file mode 100644 index 000000000..dbbf394a9 --- /dev/null +++ b/internal/help/_glColorMask__00100001000.txt @@ -0,0 +1,43 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:18:38}} +'''_glColorMask, glColorMaski:''' enable and disable writing of frame buffer color components + + + +{{PageSyntax}} + +:: SUB _glColorMask (BYVAL red AS _UNSIGNED _BYTE, BYVAL green AS _UNSIGNED _BYTE, BYVAL blue AS _UNSIGNED _BYTE, BYVAL alpha AS _UNSIGNED _BYTE) +:: void '''_glColorMask'''(GLboolean {{Parameter|red}}, GLboolean {{Parameter|green}}, GLboolean {{Parameter|blue}}, GLboolean {{Parameter|alpha}}); +:: void '''_glColorMaski'''(GLuint {{Parameter|buf}}, GLboolean {{Parameter|red}}, GLboolean {{Parameter|green}}, GLboolean {{Parameter|blue}}, GLboolean {{Parameter|alpha}}); + +; buf +: For '''_glColorMaski''', specifies the index of the draw buffer whose color mask to set. +; red, green, blue, alpha +: Specify whether red, green, blue, and alpha are to be written into the frame buffer. The initial values are all {{KW|_GL_TRUE}}, indicating that the color components are written. + + +{{PageDescription}} + +'''_glColorMask''' and '''_glColorMaski''' specify whether the individual color components in the frame buffer can or cannot be written. '''_glColorMaski''' sets the mask for a specific draw buffer, whereas '''_glColorMask''' sets the mask for all draw buffers. If {{Parameter|red}} is {{KW|_GL_FALSE}}, for example, no change is made to the red component of any pixel in any of the color buffers, regardless of the drawing operation attempted. + +Changes to individual bits of components cannot be controlled. Rather, changes are either enabled or disabled for entire color components. + + +{{PageErrors}} + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|buf}} is greater than {{KW|_GL_MAX_DRAW_BUFFERS}} minus 1. + + +{{PageUseWith}} + +{{KW|_glGet}} with argument {{KW|_GL_COLOR_WRITEMASK}} + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glClear}}, {{KW|_glClearBuffer}}, {{KW|_glDepthMask}}, {{KW|_glStencilMask}} + + +{{PageCopyright}} + diff --git a/internal/help/_glColorMaterial.txt b/internal/help/_glColorMaterial.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColorMaterial.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glColorPointer.txt b/internal/help/_glColorPointer.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glColorPointer.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glCopyPixels.txt b/internal/help/_glCopyPixels.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glCopyPixels.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glCopyTexImage1D.txt b/internal/help/_glCopyTexImage1D.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glCopyTexImage1D.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glCopyTexImage1D__0010001001000011.txt b/internal/help/_glCopyTexImage1D__0010001001000011.txt new file mode 100644 index 000000000..2a90d140a --- /dev/null +++ b/internal/help/_glCopyTexImage1D__0010001001000011.txt @@ -0,0 +1,80 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:18:43}} +'''_glCopyTexImage1D:''' copy pixels into a 1D texture image + + +{{PageSyntax}} + +: SUB _glCopyTexImage1D (BYVAL target AS _UNSIGNED LONG, BYVAL level AS LONG, BYVAL internalFormat AS _UNSIGNED LONG, BYVAL x AS LONG, BYVAL y AS LONG, BYVAL width AS LONG, BYVAL border AS LONG) + +: void '''_glCopyTexImage1D'''(GLenum {{Parameter|target}}, GLint {{Parameter|level}}, GLenum {{Parameter|internalformat}}, GLint {{Parameter|x}}, GLint {{Parameter|y}}, GLsizei {{Parameter|width}}, GLint {{Parameter|border}}); + + +; target +: Specifies the target texture. Must be {{KW|_GL_TEXTURE_1D}}. +; level +: Specifies the level-of-detail number. Level 0 is the base image level. Level ''n'' is the ''n''th mipmap reduction image. +; internalformat +: Specifies the internal format of the texture. Must be one of the following symbolic constants: {{KW|_GL_COMPRESSED_RED}}, {{KW|_GL_COMPRESSED_RG}}, {{KW|_GL_COMPRESSED_RGB}}, {{KW|_GL_COMPRESSED_RGBA}}. {{KW|_GL_COMPRESSED_SRGB}}, {{KW|_GL_COMPRESSED_SRGB_ALPHA}}. {{KW|_GL_DEPTH_COMPONENT}}, {{KW|_GL_DEPTH_COMPONENT16}}, {{KW|_GL_DEPTH_COMPONENT24}}, {{KW|_GL_DEPTH_COMPONENT32}}, {{KW|_GL_RED}}, {{KW|_GL_RG}}, {{KW|_GL_RGB}}, {{KW|_GL_R3_G3_B2}}, {{KW|_GL_RGB4}}, {{KW|_GL_RGB5}}, {{KW|_GL_RGB8}}, {{KW|_GL_RGB10}}, {{KW|_GL_RGB12}}, {{KW|_GL_RGB16}}, {{KW|_GL_RGBA}}, {{KW|_GL_RGBA2}}, {{KW|_GL_RGBA4}}, {{KW|_GL_RGB5_A1}}, {{KW|_GL_RGBA8}}, {{KW|_GL_RGB10_A2}}, {{KW|_GL_RGBA12}}, {{KW|_GL_RGBA16}}, {{KW|_GL_SRGB}}, {{KW|_GL_SRGB8}}, {{KW|_GL_SRGB_ALPHA}}, or {{KW|_GL_SRGB8_ALPHA8}}. +; x, y +: Specify the window coordinates of the left corner of the row of pixels to be copied. +; width +: Specifies the width of the texture image. The height of the texture image is 1. +; border +: This value must be 0. + + +{{PageDescription}} + +'''_glCopyTexImage1D''' defines a one-dimensional texture image with pixels from the current {{KW|_GL_READ_BUFFER}}. + +The screen-aligned pixel row with left corner at (''x'', ''y'') and with a length of {{Parameter|width}} defines the texture array at the mipmap level specified by {{Parameter|level}}. {{Parameter|internalformat}} specifies the internal format of the texture array. + +The pixels in the row are processed exactly as if {{KW|_glReadPixels}} had been called, but the process stops just before final conversion. At this point all pixel component values are clamped to the range [0, 1] and then converted to the texture's internal format for storage in the texel array. + +Pixel ordering is such that lower ''x'' screen coordinates correspond to lower texture coordinates. + +If any of the pixels within the specified row of the current {{KW|_GL_READ_BUFFER}} are outside the window associated with the current rendering context, then the values obtained for those pixels are undefined. + +'''_glCopyTexImage1D''' defines a one-dimensional texture image with pixels from the current {{KW|_GL_READ_BUFFER}}. + +When {{Parameter|internalformat}} is one of the sRGB types, the GL does not automatically convert the source pixels to the sRGB color space. In this case, the '''_glPixelMap''' function can be used to accomplish the conversion. + + +{{PageNotes}} + +1, 2, 3, and 4 are not accepted values for {{Parameter|internalformat}}. + +An image with 0 width indicates a NULL texture. + + +{{PageErrors}} + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|target}} is not one of the allowable values. + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|level}} is less than 0. + +{{KW|_GL_INVALID_VALUE}} may be generated if {{Parameter|level}} is greater than log2(max), where max is the returned value of {{KW|_GL_MAX_TEXTURE_SIZE}}. + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|internalformat}} is not an allowable value. + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|width}} is less than 0 or greater than {{KW|_GL_MAX_TEXTURE_SIZE}}. + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|border}} is not 0. + +{{KW|_GL_INVALID_OPERATION}} is generated if {{Parameter|internalformat}} is {{KW|_GL_DEPTH_COMPONENT}}, {{KW|_GL_DEPTH_COMPONENT16}}, {{KW|_GL_DEPTH_COMPONENT24}}, or {{KW|_GL_DEPTH_COMPONENT32}} and there is no depth buffer. + + +{{PageUseWith}} + +{{KW|_glGetTexImage}} + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glActiveTexture}}, {{KW|_glBindTexture}}, {{KW|_glBindFramebuffer}}, {{KW|_glCopyTexImage2D}}, {{KW|_glCopyImageSubData}}, {{KW|_glCopyTexSubImage1D}}, {{KW|_glCopyTexSubImage2D}}, {{KW|_glReadBuffer}} + + +{{PageCopyright}} + diff --git a/internal/help/_glCopyTexImage2D.txt b/internal/help/_glCopyTexImage2D.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glCopyTexImage2D.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glCopyTexImage2D__0010001001000021.txt b/internal/help/_glCopyTexImage2D__0010001001000021.txt new file mode 100644 index 000000000..36738c6bc --- /dev/null +++ b/internal/help/_glCopyTexImage2D__0010001001000021.txt @@ -0,0 +1,79 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:18:45}} +'''_glCopyTexImage2D:''' copy pixels into a 2D texture image + + +{{PageSyntax}} + +: SUB _glCopyTexImage2D (BYVAL target AS _UNSIGNED LONG, BYVAL level AS LONG, BYVAL internalFormat AS _UNSIGNED LONG, BYVAL x AS LONG, BYVAL y AS LONG, BYVAL width AS LONG, BYVAL height AS LONG, BYVAL border AS LONG) +: void '''_glCopyTexImage2D'''(GLenum {{Parameter|target}}, GLint {{Parameter|level}}, GLenum {{Parameter|internalformat}}, GLint {{Parameter|x}}, GLint {{Parameter|y}}, GLsizei {{Parameter|width}}, GLsizei {{Parameter|height}}, GLint {{Parameter|border}}); + + +; target +: Specifies the target texture. Must be {{KW|_GL_TEXTURE_2D}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_X}}, {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_X}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_Y}}, {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_Z}}, or {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z}}. +; level +: Specifies the level-of-detail number. Level 0 is the base image level. Level ''n'' is the ''n''th mipmap reduction image. +; internalformat +: Specifies the internal format of the texture. Must be one of the following symbolic constants: {{KW|_GL_COMPRESSED_RED}}, {{KW|_GL_COMPRESSED_RG}}, {{KW|_GL_COMPRESSED_RGB}}, {{KW|_GL_COMPRESSED_RGBA}}. {{KW|_GL_COMPRESSED_SRGB}}, {{KW|_GL_COMPRESSED_SRGB_ALPHA}}. {{KW|_GL_DEPTH_COMPONENT}}, {{KW|_GL_DEPTH_COMPONENT16}}, {{KW|_GL_DEPTH_COMPONENT24}}, {{KW|_GL_DEPTH_COMPONENT32}}, {{KW|_GL_RED}}, {{KW|_GL_RG}}, {{KW|_GL_RGB}}, {{KW|_GL_R3_G3_B2}}, {{KW|_GL_RGB4}}, {{KW|_GL_RGB5}}, {{KW|_GL_RGB8}}, {{KW|_GL_RGB10}}, {{KW|_GL_RGB12}}, {{KW|_GL_RGB16}}, {{KW|_GL_RGBA}}, {{KW|_GL_RGBA2}}, {{KW|_GL_RGBA4}}, {{KW|_GL_RGB5_A1}}, {{KW|_GL_RGBA8}}, {{KW|_GL_RGB10_A2}}, {{KW|_GL_RGBA12}}, {{KW|_GL_RGBA16}}, {{KW|_GL_SRGB}}, {{KW|_GL_SRGB8}}, {{KW|_GL_SRGB_ALPHA}}, or {{KW|_GL_SRGB8_ALPHA8}}. +; x, y +: Specify the window coordinates of the lower left corner of the rectangular region of pixels to be copied. +; width +: Specifies the width of the texture image. +; height +: Specifies the height of the texture image. +; border +: This value must be 0. + + +{{PageDescription}} + +'''_glCopyTexImage2D''' defines a two-dimensional texture image, or cube-map texture image with pixels from the current {{KW|_GL_READ_BUFFER}}. + +The screen-aligned pixel rectangle with lower left corner at ({{Parameter|x}}, {{Parameter|y}}) and with a width of {{Parameter|width}} and a height of {{Parameter|height}} defines the texture array at the mipmap level specified by {{Parameter|level}}. {{Parameter|internalformat}} specifies the internal format of the texture array. + +The pixels in the rectangle are processed exactly as if {{KW|_glReadPixels}} had been called, but the process stops just before final conversion. At this point all pixel component values are clamped to the range [0, 1] and then converted to the texture's internal format for storage in the texel array. + +Pixel ordering is such that lower x and y screen coordinates correspond to lower s and t texture coordinates. + +If any of the pixels within the specified rectangle of the current {{KW|_GL_READ_BUFFER}} are outside the window associated with the current rendering context, then the values obtained for those pixels are undefined. + +When {{Parameter|internalformat}} is one of the sRGB types, the GL does not automatically convert the source pixels to the sRGB color space. In this case, the '''_glPixelMap''' function can be used to accomplish the conversion. + + +{{PageNotes}} + +1, 2, 3, and 4 are not accepted values for {{Parameter|internalformat}}. + +An image with height or width of 0 indicates a NULL texture. + + +{{PageErrors}} + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|target}} is not {{KW|_GL_TEXTURE_2D}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_X}}, {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_X}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_Y}}, {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_Z}}, or {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z}}. + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|level}} is less than 0. + +{{KW|_GL_INVALID_VALUE}} may be generated if {{Parameter|level}} is greater than log2(max}, where max is the returned value of {{KW|_GL_MAX_TEXTURE_SIZE}}. + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|width}} is less than 0 or greater than {{KW|_GL_MAX_TEXTURE_SIZE}}. + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|border}} is not 0. + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|internalformat}} is not an accepted format. + +{{KW|_GL_INVALID_OPERATION}} is generated if {{Parameter|internalformat}} is {{KW|_GL_DEPTH_COMPONENT}}, {{KW|_GL_DEPTH_COMPONENT16}}, {{KW|_GL_DEPTH_COMPONENT24}}, or {{KW|_GL_DEPTH_COMPONENT32}} and there is no depth buffer. + + +{{PageUseWith}} + +{{KW|_glGetTexImage}} + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glActiveTexture}}, {{KW|_glBindTexture}}, {{KW|_glBindFramebuffer}}, {{KW|_glCopyTexImage1D}}, {{KW|_glCopyImageSubData}}, {{KW|_glCopyTexSubImage1D}}, {{KW|_glCopyTexSubImage2D}}, {{KW|_glReadBuffer}} + + +{{PageCopyright}} + diff --git a/internal/help/_glCopyTexSubImage1D.txt b/internal/help/_glCopyTexSubImage1D.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glCopyTexSubImage1D.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glCopyTexSubImage1D__0010001001001000011.txt b/internal/help/_glCopyTexSubImage1D__0010001001001000011.txt new file mode 100644 index 000000000..84d3e8523 --- /dev/null +++ b/internal/help/_glCopyTexSubImage1D__0010001001001000011.txt @@ -0,0 +1,68 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:18:46}} +'''_glCopyTexSubImage1D:''' copy a one-dimensional texture subimage + + +{{PageSyntax}} + +: SUB _glCopyTexSubImage1D (BYVAL target AS _UNSIGNED LONG, BYVAL level AS LONG, BYVAL xoffset AS LONG, BYVAL x AS LONG, BYVAL y AS LONG, BYVAL width AS LONG) + +: void '''_glCopyTexSubImage1D'''(GLenum {{Parameter|target}}, GLint {{Parameter|level}}, GLint {{Parameter|xoffset}}, GLint {{Parameter|x}}, GLint {{Parameter|y}}, GLsizei {{Parameter|width}}); + + +; target +: Specifies the target texture. Must be {{KW|_GL_TEXTURE_1D}}. +; level +: Specifies the level-of-detail number. Level 0 is the base image level. Level ''n'' is the ''n''th mipmap reduction image. +; xoffset +: Specifies the texel offset within the texture array. +; x, y +: Specify the window coordinates of the left corner of the row of pixels to be copied. +; width +: Specifies the width of the texture subimage. + + +{{PageDescription}} + +'''_glCopyTexSubImage1D''' replaces a portion of a one-dimensional texture image with pixels from the current {{KW|_GL_READ_BUFFER}} (rather than from main memory, as is the case for {{KW|_glTexSubImage1D}}). + +The screen-aligned pixel row with left corner at ({{Parameter|x}},\ {{Parameter|y}}), and with length {{Parameter|width}} replaces the portion of the texture array with x indices {{Parameter|xoffset}} through ''xoffset + width - 1'', inclusive. The destination in the texture array may not include any texels outside the texture array as it was originally specified. + +The pixels in the row are processed exactly as if {{KW|_glReadPixels}} had been called, but the process stops just before final conversion. At this point, all pixel component values are clamped to the range [0, 1] and then converted to the texture's internal format for storage in the texel array. + +It is not an error to specify a subtexture with zero width, but such a specification has no effect. If any of the pixels within the specified row of the current {{KW|_GL_READ_BUFFER}} are outside the read window associated with the current rendering context, then the values obtained for those pixels are undefined. + +No change is made to the ''internalformat'', ''width'', or ''border'' parameters of the specified texture array or to texel values outside the specified subregion. + + +{{PageNotes}} + +The {{KW|_glPixelStore}} mode affects texture images. + + +{{PageErrors}} + +{{KW|_GL_INVALID_ENUM}} is generated if /{{Parameter|target}} is not {{KW|_GL_TEXTURE_1D}}. + +{{KW|_GL_INVALID_OPERATION}} is generated if the texture array has not been defined by a previous {{KW|_glTexImage1D}} or {{KW|_glCopyTexImage1D}} operation. + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|level}} is less than 0. + +{{KW|_GL_INVALID_VALUE}} may be generated if ''level'' is greater than log2(max), where ''max'' is the returned value of {{KW|_GL_MAX_TEXTURE_SIZE}}. + +{{KW|_GL_INVALID_VALUE}} is generated if xoffset < 0 or xoffset + width > w, where w is the {{KW|_GL_TEXTURE_WIDTH}}. + + +{{PageUseWith}} + +{{KW|_glGetTexImage}} + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glActiveTexture}}, {{KW|_glBindTexture}}, {{KW|_glBindFramebuffer}}, {{KW|_glCopyImageSubData}}, {{KW|_glCopyTexSubImage2D}}, {{KW|_glCopyTexSubImage3D}}, {{KW|_glCopyTexImage1D}}, {{KW|_glReadBuffer}} + + +{{PageCopyright}} + diff --git a/internal/help/_glCopyTexSubImage2D.txt b/internal/help/_glCopyTexSubImage2D.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glCopyTexSubImage2D.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glCopyTexSubImage2D__0010001001001000021.txt b/internal/help/_glCopyTexSubImage2D__0010001001001000021.txt new file mode 100644 index 000000000..d5da5a2ef --- /dev/null +++ b/internal/help/_glCopyTexSubImage2D__0010001001001000021.txt @@ -0,0 +1,76 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:18:47}} +'''_glCopyTexSubImage2D:''' copy a two-dimensional texture subimage + + +{{PageSyntax}} + +: SUB _glCopyTexSubImage2D (BYVAL target AS _UNSIGNED LONG, BYVAL level AS LONG, BYVAL xoffset AS LONG, BYVAL yoffset AS LONG, BYVAL x AS LONG, BYVAL y AS LONG, BYVAL width AS LONG, BYVAL height AS LONG) + +: void '''_glCopyTexSubImage2D'''(GLenum {{Parameter|target}}, GLint {{Parameter|level}}, GLint {{Parameter|xoffset}}, GLint {{Parameter|yoffset}}, GLint {{Parameter|x}}, GLint {{Parameter|y}}, GLsizei {{Parameter|width}}, GLsizei {{Parameter|height}}); + + +; target +: Specifies the target texture. Must be {{KW|_GL_TEXTURE_2D}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_X}}, {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_X}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_Y}}, {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_Z}}, {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z}}, or {{KW|_GL_TEXTURE_1D_ARRAY}}. +; level +: Specifies the level-of-detail number. Level 0 is the base image level. Level ''n'' is the ''n''th mipmap reduction image. +; xoffset +: Specifies a texel offset in the x direction within the texture array. +; yoffset +: Specifies a texel offset in the y direction within the texture array. +; x, y +: Specify the window coordinates of the lower left corner of the rectangular region of pixels to be copied. +; width +: Specifies the width of the texture subimage. +; height +: Specifies the height of the texture subimage. + + +{{PageDescription}} + +'''_glCopyTexSubImage2D''' replaces a rectangular portion of a two-dimensional texture image, cube-map texture image or a linear portion of a number of slices of a one-dimensional array texture with pixels from the current {{KW|_GL_READ_BUFFER}} (rather than from main memory, as is the case for {{KW|_glTexSubImage2D}}). + +The screen-aligned pixel rectangle with lower left corner at (''x'', ''y'') and with width {{Parameter|width}} and height {{Parameter|height}} replaces the portion of the texture array with x indices {{Parameter|xoffset}} through ''xoffset + width - 1'', inclusive, and y indices {{Parameter|yoffset}} through ''yoffset + height - 1'', inclusive, at the mipmap level specified by {{Parameter|level}}. + +The pixels in the rectangle are processed exactly as if {{KW|_glReadPixels}} had been called, but the process stops just before final conversion. At this point, all pixel component values are clamped to the range [0, 1] and then converted to the texture's internal format for storage in the texel array. + +The destination rectangle in the texture array may not include any texels outside the texture array as it was originally specified. It is not an error to specify a subtexture with zero width or height, but such a specification has no effect. + +When {{Parameter|target}} is {{KW|_GL_TEXTURE_1D_ARRAY}} then the y coordinate and height are treated as the start slice and number of slices to modify. + +If any of the pixels within the specified rectangle of the current {{KW|_GL_READ_BUFFER}} are outside the read window associated with the current rendering context, then the values obtained for those pixels are undefined. + +No change is made to the ''internalformat'', ''width'', ''height'', or ''border'' parameters of the specified texture array or to texel values outside the specified subregion. + + +{{PageNotes}} + +{{KW|_glPixelStore}} modes affect texture images. + + +{{PageErrors}} + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|target}} is not {{KW|_GL_TEXTURE_2D}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_X}}, {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_X}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_Y}}, {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_Z}}, {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z}}, or {{KW|_GL_TEXTURE_1D_ARRAY}}. + +{{KW|_GL_INVALID_OPERATION}} is generated if the texture array has not been defined by a previous {{KW|_glTexImage2D}} or {{KW|_glCopyTexImage2D}} operation. + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|level}} is less than 0. + +{{KW|_GL_INVALID_VALUE}} may be generated if ''level'' is greater than log2(max), where ''max'' is the returned value of {{KW|_GL_MAX_TEXTURE_SIZE}}. + +{{KW|_GL_INVALID_VALUE}} is generated if xoffset < 0, xoffset + width > w, yoffset < 0, or yoffset + height > h, where w is the {{KW|_GL_TEXTURE_WIDTH}} and h is the {{KW|_GL_TEXTURE_HEIGHT}} of the texture image being modified. + + +{{PageUseWith}} + +{{KW|_glGetTexImage}} + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glActiveTexture}}, {{KW|_glBindTexture}}, {{KW|_glBindFramebuffer}}, {{KW|_glCopyImageSubData}}, {{KW|_glCopyTexSubImage1D}}, {{KW|_glCopyTexSubImage3D}}, {{KW|_glCopyTexImage2D}}, {{KW|_glReadBuffer}} + + +{{PageCopyright}} + diff --git a/internal/help/_glCullFace.txt b/internal/help/_glCullFace.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glCullFace.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glCullFace__0010001000.txt b/internal/help/_glCullFace__0010001000.txt new file mode 100644 index 000000000..6043ae549 --- /dev/null +++ b/internal/help/_glCullFace__0010001000.txt @@ -0,0 +1,47 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:18:48}} +'''_glCullFace:''' specify whether front- or back-facing facets can be culled + + +{{PageSyntax}} + +::SUB '''_glCullFace''' (BYVAL mode AS _UNSIGNED LONG) +:: void '''_glCullFace'''(GLenum {{Parameter|mode}}); + + +; mode +: Specifies whether front- or back-facing facets are candidates for culling. Symbolic constants {{KW|_GL_FRONT}}, {{KW|_GL_BACK}}, and {{KW|_GL_FRONT_AND_BACK}} are accepted. The initial value is {{KW|_GL_BACK}}. + + +{{PageDescription}} + +'''_glCullFace''' specifies whether front- or back-facing facets are culled (as specified by ''mode'') when facet culling is enabled. Facet culling is initially disabled. To enable and disable facet culling, call the {{KW|_glEnable}} and {{KW|_glDisable}} commands with the argument {{KW|_GL_CULL_FACE}}. Facets include triangles, quadrilaterals, polygons, and rectangles. + +{{KW|_glFrontFace}} specifies which of the clockwise and counterclockwise facets are front-facing and back-facing. See {{KW|_glFrontFace}}. + + +{{PageNotes}} + +If {{Parameter|mode}} is {{KW|_GL_FRONT_AND_BACK}}, no facets are drawn, but other primitives such as points and lines are drawn. + + +{{PageErrors}} + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|mode}} is not an accepted value. + + +{{PageUseWith}} + +{{KW|_glIsEnabled}} with argument {{KW|_GL_CULL_FACE}} + +{{KW|_glGet}} with argument {{KW|_GL_CULL_FACE_MODE}} + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glEnable|(GL_CULL_FACE)}}, {{KW|_glFrontFace}} + + +{{PageCopyright}} + diff --git a/internal/help/_glDeleteLists.txt b/internal/help/_glDeleteLists.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glDeleteLists.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glDeleteTextures.txt b/internal/help/_glDeleteTextures.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glDeleteTextures.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glDeleteTextures__0010000010000000.txt b/internal/help/_glDeleteTextures__0010000010000000.txt new file mode 100644 index 000000000..89a92cad2 --- /dev/null +++ b/internal/help/_glDeleteTextures__0010000010000000.txt @@ -0,0 +1,43 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:18:51}} +'''_glDeleteTextures:''' delete named textures + + +{{PageSyntax}} + +: SUB _glDeleteTextures (BYVAL n AS LONG, textures AS _UNSIGNED LONG) + +: void '''_glDeleteTextures'''(GLsizei {{Parameter|n}}, const GLuint * {{Parameter|textures}}); + + +; n +: Specifies the number of textures to be deleted. +; textures +: Specifies an array of textures to be deleted. + + +{{PageDescription}} + +'''_glDeleteTextures''' deletes {{Parameter|n}} textures named by the elements of the array {{Parameter|textures}}. After a texture is deleted, it has no contents or dimensionality, and its name is free for reuse (for example by {{KW|_glGenTextures}}). If a texture that is currently bound is deleted, the binding reverts to 0 (the default texture). + +'''_glDeleteTextures''' silently ignores 0's and names that do not correspond to existing textures. + + +{{PageErrors}} + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|n}} is negative. + + +{{PageUseWith}} + +{{KW|_glIsTexture}} + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glBindTexture}}, {{KW|_glGenTextures}}, {{KW|_glIsTexture}} + + +{{PageCopyright}} + diff --git a/internal/help/_glDepthFunc.txt b/internal/help/_glDepthFunc.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glDepthFunc.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glDepthFunc__00100001000.txt b/internal/help/_glDepthFunc__00100001000.txt new file mode 100644 index 000000000..ab9a1ea62 --- /dev/null +++ b/internal/help/_glDepthFunc__00100001000.txt @@ -0,0 +1,65 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:18:52}} +'''_glDepthFunc:''' specify the value used for depth buffer comparisons + + +{{PageSyntax}} + +:: SUB _glDepthFunc (BYVAL func AS _UNSIGNED LONG) +:: void '''_glDepthFunc'''(GLenum {{Parameter|func}}); + + +; func +: Specifies the depth comparison function. Symbolic constants {{KW|_GL_NEVER}}, {{KW|_GL_LESS}}, {{KW|_GL_EQUAL}}, {{KW|_GL_LEQUAL}}, {{KW|_GL_GREATER}}, {{KW|_GL_NOTEQUAL}}, {{KW|_GL_GEQUAL}}, and {{KW|_GL_ALWAYS}} are accepted. The initial value is {{KW|_GL_LESS}}. + + +{{PageDescription}} + +'''_glDepthFunc''' specifies the function used to compare each incoming pixel depth value with the depth value present in the depth buffer. The comparison is performed only if depth testing is enabled. (See {{KW|_glEnable}} and {{KW|_glDisable}} of {{KW|_GL_DEPTH_TEST}}.) + +{{Parameter|func}} specifies the conditions under which the pixel will be drawn. The comparison functions are as follows: + +; {{KW|_GL_NEVER}} +: Never passes. +; {{KW|_GL_LESS}} +: Passes if the incoming depth value is less than the stored depth value. +; {{KW|_GL_EQUAL}} +: Passes if the incoming depth value is equal to the stored depth value. +; {{KW|_GL_LEQUAL}} +: Passes if the incoming depth value is less than or equal to the stored depth value. +; {{KW|_GL_GREATER}} +: Passes if the incoming depth value is greater than the stored depth value. +; {{KW|_GL_NOTEQUAL}} +: Passes if the incoming depth value is not equal to the stored depth value. +; {{KW|_GL_GEQUAL}} +: Passes if the incoming depth value is greater than or equal to the stored depth value. +; {{KW|_GL_ALWAYS}} +: Always passes. +The initial value of {{Parameter|func}} is {{KW|_GL_LESS}}. Initially, depth testing is disabled. If depth testing is disabled or if no depth buffer exists, it is as if the depth test always passes. + + +{{PageNotes}} + +Even if the depth buffer exists and the depth mask is non-zero, the depth buffer is not updated if the depth test is disabled. In order to unconditionally write to the depth buffer, the depth test should be enabled and set to {{KW|_GL_ALWAYS}}. + + +{{PageErrors}} + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|func}} is not an accepted value. + + +{{PageUseWith}} + +{{KW|_glGet}} with argument {{KW|_GL_DEPTH_FUNC}} + +{{KW|_glIsEnabled}} with argument {{KW|_GL_DEPTH_TEST}} + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glEnable|(GL_DEPTH_TEST)}}, {{KW|_glDepthRange}}, {{KW|_glPolygonOffset}} + + +{{PageCopyright}} + diff --git a/internal/help/_glDepthMask.txt b/internal/help/_glDepthMask.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glDepthMask.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glDepthMask__00100001000.txt b/internal/help/_glDepthMask__00100001000.txt new file mode 100644 index 000000000..e768c7023 --- /dev/null +++ b/internal/help/_glDepthMask__00100001000.txt @@ -0,0 +1,38 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:18:54}} +'''_glDepthMask:''' enable or disable writing into the depth buffer + + +{{PageSyntax}} + +:: SUB _glDepthMask (BYVAL flag AS _UNSIGNED _BYTE) +:: void '''_glDepthMask'''(GLboolean {{Parameter|flag}}); + + +; flag +: Specifies whether the depth buffer is enabled for writing. If {{Parameter|flag}} is {{KW|_GL_FALSE}}, depth buffer writing is disabled. Otherwise, it is enabled. Initially, depth buffer writing is enabled. + + +{{PageDescription}} + +'''_glDepthMask''' specifies whether the depth buffer is enabled for writing. If {{Parameter|flag}} is {{KW|_GL_FALSE}}, depth buffer writing is disabled. Otherwise, it is enabled. Initially, depth buffer writing is enabled. + + +{{PageUseWith}} + +{{KW|_glGet}} with argument {{KW|_GL_DEPTH_WRITEMASK}} + + +{{PageNotes}} + +Even if the depth buffer exists and the depth mask is non-zero, the depth buffer is not updated if the depth test is disabled. In order to unconditionally write to the depth buffer, the depth test should be enabled and set to {{KW|_GL_ALWAYS}} (see {{KW|_glDepthFunc}}). + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glColorMask}}, {{KW|_glClearBuffer}}, {{KW|_glDepthFunc}}, {{KW|_glDepthRange}}, {{KW|_glStencilMask}} + + +{{PageCopyright}} + diff --git a/internal/help/_glDepthRange.txt b/internal/help/_glDepthRange.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glDepthRange.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glDepthRange__001000010000.txt b/internal/help/_glDepthRange__001000010000.txt new file mode 100644 index 000000000..d973cf283 --- /dev/null +++ b/internal/help/_glDepthRange__001000010000.txt @@ -0,0 +1,45 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:18:55}} +'''_glDepthRange:''' specify mapping of depth values from normalized device coordinates to window coordinates + + +{{PageSyntax}} + +:: SUB _glDepthRange (BYVAL zNear AS DOUBLE, BYVAL zFar AS DOUBLE) + +:: void '''_glDepthRange'''(GLdouble {{Parameter|nearVal}}, GLdouble {{Parameter|farVal}}); +:: void '''_glDepthRangef'''(GLfloat {{Parameter|nearVal}}, GLfloat {{Parameter|farVal}}); + +; nearVal +: Specifies the mapping of the near clipping plane to window coordinates. The initial value is 0. +; farVal +: Specifies the mapping of the far clipping plane to window coordinates. The initial value is 1. + + +{{PageDescription}} + +After clipping and division by ''w'', depth coordinates range from -1 to 1, corresponding to the near and far clipping planes. '''_glDepthRange''' specifies a linear mapping of the normalized depth coordinates in this range to window depth coordinates. Regardless of the actual depth buffer implementation, window coordinate depth values are treated as though they range from 0 through 1 (like color components). Thus, the values accepted by '''_glDepthRange''' are both clamped to this range before they are accepted. + +The setting of (0,1) maps the near plane to 0 and the far plane to 1. With this mapping, the depth buffer range is fully utilized. + + +{{PageNotes}} + +It is not necessary that {{Parameter|nearVal}} be less than {{Parameter|farVal}}. Reverse mappings such as ''nearVal'' = 1, and ''farVal'' = 0 are acceptable. + +The type of the {{Parameter|nearVal}} and {{Parameter|farVal}} parameters was changed from GLclampf to GLfloat for '''_glDepthRangef''' and from GLclampd to GLdouble for '''_glDepthRange'''. This change is transparent to user code. + + +{{PageUseWith}} + +{{KW|_glGet}} with argument {{KW|_GL_DEPTH_RANGE}} + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glDepthFunc}}, {{KW|_glDepthRangeArray}}, {{KW|_glDepthRangeIndexed}}, {{KW|_glPolygonOffset}}, {{KW|_glViewport}} + + +{{PageCopyright}} + diff --git a/internal/help/_glDisable.txt b/internal/help/_glDisable.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glDisable.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glDisableClientState.txt b/internal/help/_glDisableClientState.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glDisableClientState.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glDrawArrays.txt b/internal/help/_glDrawArrays.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glDrawArrays.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glDrawArrays__001000100000.txt b/internal/help/_glDrawArrays__001000100000.txt new file mode 100644 index 000000000..b1cd747de --- /dev/null +++ b/internal/help/_glDrawArrays__001000100000.txt @@ -0,0 +1,52 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:18:59}} +'''_glDrawArrays:''' render primitives from array data + + +{{PageSyntax}} + +:: SUB _glDrawArrays (BYVAL mode AS _UNSIGNED LONG, BYVAL first AS LONG, BYVAL count AS LONG) +:: void '''_glDrawArrays'''(GLenum {{Parameter|mode}}, GLint {{Parameter|first}}, GLsizei {{Parameter|count}}); + + +; mode +: Specifies what kind of primitives to render. Symbolic constants {{KW|_GL_POINTS}}, {{KW|_GL_LINE_STRIP}}, {{KW|_GL_LINE_LOOP}}, {{KW|_GL_LINES}}, {{KW|_GL_LINE_STRIP_ADJACENCY}}, {{KW|_GL_LINES_ADJACENCY}}, {{KW|_GL_TRIANGLE_STRIP}}, {{KW|_GL_TRIANGLE_FAN}}, {{KW|_GL_TRIANGLES}}, {{KW|_GL_TRIANGLE_STRIP_ADJACENCY}}, {{KW|_GL_TRIANGLES_ADJACENCY}} and {{KW|_GL_PATCHES}} are accepted. +; first +: Specifies the starting index in the enabled arrays. +; count +: Specifies the number of indices to be rendered. + + +{{PageDescription}} + +'''_glDrawArrays''' specifies multiple geometric primitives with very few subroutine calls. Instead of calling a GL procedure to pass each individual vertex, normal, texture coordinate, edge flag, or color, you can prespecify separate arrays of vertices, normals, and colors and use them to construct a sequence of primitives with a single call to '''_glDrawArrays'''. + +When '''_glDrawArrays''' is called, it uses {{Parameter|count}} sequential elements from each enabled array to construct a sequence of geometric primitives, beginning with element {{Parameter|first}}. {{Parameter|mode}} specifies what kind of primitives are constructed and how the array elements construct those primitives. + +Vertex attributes that are modified by '''_glDrawArrays''' have an unspecified value after '''_glDrawArrays''' returns. Attributes that aren't modified remain well defined. + + +{{PageNotes}} + +{{KW|_GL_LINE_STRIP_ADJACENCY}}, {{KW|_GL_LINES_ADJACENCY}}, {{KW|_GL_TRIANGLE_STRIP_ADJACENCY}} and {{KW|_GL_TRIANGLES_ADJACENCY}} are available only if the GL version is 3.2 or greater. + + +{{PageErrors}} + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|mode}} is not an accepted value. + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|count}} is negative. + +{{KW|_GL_INVALID_OPERATION}} is generated if a non-zero buffer object name is bound to an enabled array and the buffer object's data store is currently mapped. + +{{KW|_GL_INVALID_OPERATION}} is generated if a geometry shader is active and {{Parameter|mode}} is incompatible with the input primitive type of the geometry shader in the currently installed program object. + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glBindVertexArray}}, {{KW|_glDrawArraysIndirect}}, {{KW|_glDrawArraysInstanced}}, {{KW|_glDrawArraysInstancedBaseInstance}}, {{KW|_glMultiDrawArrays}}, {{KW|_glMultiDrawArraysIndirect}} + + +{{PageCopyright}} + diff --git a/internal/help/_glDrawBuffer.txt b/internal/help/_glDrawBuffer.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glDrawBuffer.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glDrawBuffer__001000100000.txt b/internal/help/_glDrawBuffer__001000100000.txt new file mode 100644 index 000000000..0e271c2aa --- /dev/null +++ b/internal/help/_glDrawBuffer__001000100000.txt @@ -0,0 +1,64 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:19:00}} +'''_glDrawBuffer:''' specify which color buffers are to be drawn into + + +{{PageSyntax}} + +:: SUB _glDrawBuffer (BYVAL mode AS _UNSIGNED LONG) +:: void '''_glDrawBuffer'''(GLenum {{Parameter|mode}}); + + +; mode +: Specifies up to four color buffers to be drawn into. Symbolic constants {{KW|_GL_NONE}}, {{KW|_GL_FRONT_LEFT}}, {{KW|_GL_FRONT_RIGHT}}, {{KW|_GL_BACK_LEFT}}, {{KW|_GL_BACK_RIGHT}}, {{KW|_GL_FRONT}}, {{KW|_GL_BACK}}, {{KW|_GL_LEFT}}, {{KW|_GL_RIGHT}}, and {{KW|_GL_FRONT_AND_BACK}} are accepted. The initial value is {{KW|_GL_FRONT}} for single-buffered contexts, and {{KW|_GL_BACK}} for double-buffered contexts. + + +{{PageDescription}} + +When colors are written to the frame buffer, they are written into the color buffers specified by '''_glDrawBuffer'''. The specifications are as follows: + +; {{KW|_GL_NONE}} +: No color buffers are written. +; {{KW|_GL_FRONT_LEFT}} +: Only the front left color buffer is written. +; {{KW|_GL_FRONT_RIGHT}} +: Only the front right color buffer is written. +; {{KW|_GL_BACK_LEFT}} +: Only the back left color buffer is written. +; {{KW|_GL_BACK_RIGHT}} +: Only the back right color buffer is written. +; {{KW|_GL_FRONT}} +: Only the front left and front right color buffers are written. If there is no front right color buffer, only the front left color buffer is written. +; {{KW|_GL_BACK}} +: Only the back left and back right color buffers are written. If there is no back right color buffer, only the back left color buffer is written. +; {{KW|_GL_LEFT}} +: Only the front left and back left color buffers are written. If there is no back left color buffer, only the front left color buffer is written. +; {{KW|_GL_RIGHT}} +: Only the front right and back right color buffers are written. If there is no back right color buffer, only the front right color buffer is written. +; {{KW|_GL_FRONT_AND_BACK}} +: All the front and back color buffers (front left, front right, back left, back right) are written. If there are no back color buffers, only the front left and front right color buffers are written. If there are no right color buffers, only the front left and back left color buffers are written. If there are no right or back color buffers, only the front left color buffer is written. +If more than one color buffer is selected for drawing, then blending or logical operations are computed and applied independently for each color buffer and can produce different results in each buffer. + +Monoscopic contexts include only ''left'' buffers, and stereoscopic contexts include both ''left'' and ''right'' buffers. Likewise, single-buffered contexts include only ''front'' buffers, and double-buffered contexts include both ''front'' and ''back'' buffers. The context is selected at GL initialization. + + +{{PageErrors}} + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|mode}} is not an accepted value. + +{{KW|_GL_INVALID_OPERATION}} is generated if none of the buffers indicated by {{Parameter|mode}} exists. + + +{{PageUseWith}} + +{{KW|_glGet}} with argument {{KW|_GL_DRAW_BUFFER}} + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glBindFramebuffer}}, {{KW|_glBlendFunc}}, {{KW|_glColorMask}}, {{KW|_glDrawBuffers}}, {{KW|_glLogicOp}} + + +{{PageCopyright}} + diff --git a/internal/help/_glDrawElements.txt b/internal/help/_glDrawElements.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glDrawElements.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glDrawElements__00100010000000.txt b/internal/help/_glDrawElements__00100010000000.txt new file mode 100644 index 000000000..935139099 --- /dev/null +++ b/internal/help/_glDrawElements__00100010000000.txt @@ -0,0 +1,54 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:19:01}} +'''_glDrawElements:''' render primitives from array data + + +{{PageSyntax}} + +: SUB _glDrawElements (BYVAL mode AS _UNSIGNED LONG, BYVAL count AS LONG, BYVAL type AS _UNSIGNED LONG, indices AS _OFFSET) +: void '''_glDrawElements'''(GLenum {{Parameter|mode}}, GLsizei {{Parameter|count}}, GLenum {{Parameter|type}}, const GLvoid * {{Parameter|indices}}); + + +; mode +: Specifies what kind of primitives to render. Symbolic constants {{KW|_GL_POINTS}}, {{KW|_GL_LINE_STRIP}}, {{KW|_GL_LINE_LOOP}}, {{KW|_GL_LINES}}, {{KW|_GL_LINE_STRIP_ADJACENCY}}, {{KW|_GL_LINES_ADJACENCY}}, {{KW|_GL_TRIANGLE_STRIP}}, {{KW|_GL_TRIANGLE_FAN}}, {{KW|_GL_TRIANGLES}}, {{KW|_GL_TRIANGLE_STRIP_ADJACENCY}}, {{KW|_GL_TRIANGLES_ADJACENCY}} and {{KW|_GL_PATCHES}} are accepted. +; count +: Specifies the number of elements to be rendered. +; type +: Specifies the type of the values in {{Parameter|indices}}. Must be one of {{KW|_GL_UNSIGNED_BYTE}}, {{KW|_GL_UNSIGNED_SHORT}}, or {{KW|_GL_UNSIGNED_INT}}. +; indices +: Specifies a pointer to the location where the indices are stored. + + +{{PageDescription}} + +'''_glDrawElements''' specifies multiple geometric primitives with very few subroutine calls. Instead of calling a GL function to pass each individual vertex, normal, texture coordinate, edge flag, or color, you can prespecify separate arrays of vertices, normals, and so on, and use them to construct a sequence of primitives with a single call to '''_glDrawElements'''. + +When '''_glDrawElements''' is called, it uses {{Parameter|count}} sequential elements from an enabled array, starting at {{Parameter|indices}} (interpreted as a byte count) to construct a sequence of geometric primitives. {{Parameter|mode}} specifies what kind of primitives are constructed and how the array elements construct these primitives. If more than one array is enabled, each is used. + +Vertex attributes that are modified by '''_glDrawElements''' have an unspecified value after '''_glDrawElements''' returns. Attributes that aren't modified maintain their previous values. + + +{{PageNotes}} + +{{KW|_GL_LINE_STRIP_ADJACENCY}}, {{KW|_GL_LINES_ADJACENCY}}, {{KW|_GL_TRIANGLE_STRIP_ADJACENCY}} and {{KW|_GL_TRIANGLES_ADJACENCY}} are available only if the GL version is 3.2 or greater. + + +{{PageErrors}} + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|mode}} is not an accepted value. + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|count}} is negative. + +{{KW|_GL_INVALID_OPERATION}} is generated if a geometry shader is active and {{Parameter|mode}} is incompatible with the input primitive type of the geometry shader in the currently installed program object. + +{{KW|_GL_INVALID_OPERATION}} is generated if a non-zero buffer object name is bound to an enabled array or the element array and the buffer object's data store is currently mapped. + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glBindVertexArray}}, {{KW|_glDrawArrays}}, {{KW|_glDrawElementsBaseVertex}}, {{KW|_glDrawElementsIndirect}}, {{KW|_glDrawElementsInstanced}}, {{KW|_glDrawElementsInstancedBaseInstance}}, {{KW|_glDrawElementsInstancedBaseVertex}}, {{KW|_glDrawElementsInstancedBaseVertexBaseInstance}}, {{KW|_glDrawRangeElements}}, {{KW|_glDrawRangeElementsBaseVertex}}, {{KW|_glMultiDrawElements}}, {{KW|_glMultiDrawElementsBaseVertex}}, {{KW|_glMultiDrawElementsIndirect}} + + +{{PageCopyright}} + diff --git a/internal/help/_glDrawPixels.txt b/internal/help/_glDrawPixels.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glDrawPixels.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glEdgeFlag.txt b/internal/help/_glEdgeFlag.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glEdgeFlag.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glEdgeFlagPointer.txt b/internal/help/_glEdgeFlagPointer.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glEdgeFlagPointer.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glEdgeFlagv.txt b/internal/help/_glEdgeFlagv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glEdgeFlagv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glEnable.txt b/internal/help/_glEnable.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glEnable.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glEnableClientState.txt b/internal/help/_glEnableClientState.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glEnableClientState.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glEnable__00100000.txt b/internal/help/_glEnable__00100000.txt new file mode 100644 index 000000000..b24c9f8ce --- /dev/null +++ b/internal/help/_glEnable__00100000.txt @@ -0,0 +1,143 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:19:08}} +'''_glEnable:''' enable or disable server-side GL capabilities + + +{{PageSyntax}} + + SUB _glEnable (BYVAL cap AS _UNSIGNED LONG) + void '''_glEnable'''(GLenum {{Parameter|cap}}); + + SUB _glDisable (BYVAL cap AS _UNSIGNED LONG) + void '''_glDisable'''(GLenum {{Parameter|cap}}); + + +; cap +: Specifies a symbolic constant indicating a GL capability. + + +{{PageSyntax}} + +| name = glEnablei, glDisablei +| core = 3.0 +}} + + void '''_glEnablei'''(GLenum {{Parameter|cap}}, GLuint {{Parameter|index}}); + void '''_glDisablei'''(GLenum {{Parameter|cap}}, GLuint {{Parameter|index}}); + +; cap +: Specifies a symbolic constant indicating a GL capability. +; index +: Specifies the index of the capability to enable/disable. + + +{{PageDescription}} + +'''_glEnable''' and {{KW|_glDisable}} enable and disable various capabilities. Use {{KW|_glIsEnabled}} or {{KW|_glGet}} to determine the current setting of any capability. The initial value for each capability with the exception of {{KW|_GL_DITHER}} and {{KW|_GL_MULTISAMPLE}} is {{KW|_GL_FALSE}}. The initial value for {{KW|_GL_DITHER}} and {{KW|_GL_MULTISAMPLE}} is {{KW|_GL_TRUE}}. + +Both '''_glEnable''' and {{KW|_glDisable}} take a single argument, {{Parameter|cap}}, which can assume one of the following values: + +; {{KW|_GL_BLEND}} +: If enabled, blend the computed fragment color values with the values in the color buffers. See [[GLAPI/glBlendFunc|glBlendFunc]]. Sets the blend enable/disable flag for all color buffers. +; {{KW|_GL_CLIP_DISTANCE}}''i'' +: If enabled, clip geometry against user-defined half space ''i''. +; {{KW|_GL_COLOR_LOGIC_OP}} +: If enabled, apply the currently selected logical operation to the computed fragment color and color buffer values. See [[GLAPI/glLogicOp|glLogicOp]]. +; {{KW|_GL_CULL_FACE}} +: If enabled, cull polygons based on their winding in window coordinates. See [[GLAPI/glCullFace|glCullFace]]. +; {{KW|_GL_DEBUG_OUTPUT}} +: If enabled, debug messages are produced by a debug context. When disabled, the debug message log is silenced. Note that in a non-debug context, very few, if any messages might be produced, even when {{KW|_GL_DEBUG_OUTPUT}} is enabled. +; {{KW|_GL_DEBUG_OUTPUT_SYNCHRONOUS}} +: If enabled, debug messages are produced synchronously by a debug context. If disabled, debug messages may be produced asynchronously. In particular, they may be delayed relative to the execution of GL commands, and the debug callback function may be called from a thread other than that in which the commands are executed. See {{KW|_glDebugMessageCallback}}. +; {{KW|_GL_DEPTH_CLAMP}} +: If enabled, the -wc <= zc <= wc plane equation is ignored by view volume clipping (effectively, there is no near or far plane clipping). See [[GLAPI/glDepthRange|glDepthRange]]. +; {{KW|_GL_DEPTH_TEST}} +: If enabled, do depth comparisons and update the depth buffer. Note that even if the depth buffer exists and the depth mask is non-zero, the depth buffer is not updated if the depth test is disabled. See [[GLAPI/glDepthFunc|glDepthFunc]] and [[GLAPI/glDepthRange|glDepthRange]]. +; {{KW|_GL_DITHER}} +: If enabled, dither color components or indices before they are written to the color buffer. +; {{KW|_GL_FRAMEBUFFER_SRGB}} +: If enabled and the value of {{KW|_GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING}} for the framebuffer attachment corresponding to the destination buffer is {{KW|_GL_SRGB}}, the R, G, and B destination color values (after conversion from fixed-point to floating-point) are considered to be encoded for the sRGB color space and hence are linearized prior to their use in blending. +; {{KW|_GL_LINE_SMOOTH}} +: If enabled, draw lines with correct filtering. Otherwise, draw aliased lines. See [[GLAPI/glLineWidth|glLineWidth]]. +; {{KW|_GL_MULTISAMPLE}} +: If enabled, use multiple fragment samples in computing the final color of a pixel. See [[GLAPI/glSampleCoverage|glSampleCoverage]]. +; {{KW|_GL_POLYGON_OFFSET_FILL}} +: If enabled, and if the polygon is rendered in {{KW|_GL_FILL}} mode, an offset is added to depth values of a polygon's fragments before the depth comparison is performed. See [[GLAPI/glPolygonOffset|glPolygonOffset]]. +; {{KW|_GL_POLYGON_OFFSET_LINE}} +: If enabled, and if the polygon is rendered in {{KW|_GL_LINE}} mode, an offset is added to depth values of a polygon's fragments before the depth comparison is performed. See [[GLAPI/glPolygonOffset|glPolygonOffset]]. +; {{KW|_GL_POLYGON_OFFSET_POINT}} +: If enabled, an offset is added to depth values of a polygon's fragments before the depth comparison is performed, if the polygon is rendered in {{KW|_GL_POINT}} mode. See [[GLAPI/glPolygonOffset|glPolygonOffset]]. +; {{KW|_GL_POLYGON_SMOOTH}} +: If enabled, draw polygons with proper filtering. Otherwise, draw aliased polygons. For correct antialiased polygons, an alpha buffer is needed and the polygons must be sorted front to back. +; {{KW|_GL_PRIMITIVE_RESTART}} +: Enables primitive restarting. If enabled, any one of the draw commands which transfers a set of generic attribute array elements to the GL will restart the primitive when the index of the vertex is equal to the primitive restart index. See {{KW|_glPrimitiveRestartIndex}}. +; {{KW|_GL_PRIMITIVE_RESTART_FIXED_INDEX}} +: Enables primitive restarting with a fixed index. If enabled, any one of the draw commands which transfers a set of generic attribute array elements to the GL will restart the primitive when the index of the vertex is equal to the fixed primitive index for the specified index type. The fixed index is equal to 2^n - 1 where ''n'' is equal to 8 for {{KW|_GL_UNSIGNED_BYTE}}, 16 for {{KW|_GL_UNSIGNED_SHORT}} and 32 for {{KW|_GL_UNSIGNED_INT}}. +; {{KW|_GL_RASTERIZER_DISCARD}} +: If enabled, all primitives are discarded before rasterization, but ''after'' any optional transform feedback. Also causes {{KW|_glClear}} and {{KW|_glClearBuffer}} commands to be ignored. +; {{KW|_GL_SAMPLE_ALPHA_TO_COVERAGE}} +: If enabled, compute a temporary coverage value where each bit is determined by the alpha value at the corresponding sample location. The temporary coverage value is then ANDed with the fragment coverage value. +; {{KW|_GL_SAMPLE_ALPHA_TO_ONE}} +: If enabled, each sample alpha value is replaced by the maximum representable alpha value. +; {{KW|_GL_SAMPLE_COVERAGE}} +: If enabled, the fragment's coverage is ANDed with the temporary coverage value. If {{KW|_GL_SAMPLE_COVERAGE_INVERT}} is set to {{KW|_GL_TRUE}}, invert the coverage value. See [[GLAPI/glSampleCoverage|glSampleCoverage]]. +; {{KW|_GL_SAMPLE_SHADING}} +: If enabled, the active fragment shader is run once for each covered sample, or at fraction of this rate as determined by the current value of {{KW|_GL_MIN_SAMPLE_SHADING_VALUE}}. See [[GLAPI/glMinSampleShading|glMinSampleShading]]. +; {{KW|_GL_SAMPLE_MASK}} +: If enabled, the sample coverage mask generated for a fragment during rasterization will be ANDed with the value of {{KW|_GL_SAMPLE_MASK_VALUE}} before shading occurs. See [[GLAPI/glSampleMaski|glSampleMaski]]. +; {{KW|_GL_SCISSOR_TEST}} +: If enabled, discard fragments that are outside the scissor rectangle. See [[GLAPI/glScissor|glScissor]]. +; {{KW|_GL_STENCIL_TEST}} +: If enabled, do stencil testing and update the stencil buffer. See [[GLAPI/glStencilFunc|glStencilFunc]] and [[GLAPI/glStencilOp|glStencilOp]]. +; {{KW|_GL_TEXTURE_CUBE_MAP_SEAMLESS}} +: If enabled, cubemap textures are sampled such that when linearly sampling from the border between two adjacent faces, texels from both faces are used to generate the final sample value. When disabled, texels from only a single face are used to construct the final sample value. +; {{KW|_GL_PROGRAM_POINT_SIZE}} +: If enabled and a vertex or geometry shader is active, then the derived point size is taken from the (potentially clipped) shader builtin {{code|gl_PointSize}} and clamped to the implementation-dependent point size range. + +=== Indexed Capabilities === + +Some of the GL's capabilities are indexed. '''_glEnablei''' and '''_glDisablei''' enable and disable indexed capabilities. Only the following capabilities may be used with indices higher than zero: + +; {{KW|_GL_BLEND}} +: If enabled, blend the computed fragment color values with the values in the specified color buffer. {{Parameter|index}} must be less than {{KW|_GL_MAX_DRAW_BUFFERS}} or {{KW|_GL_INVALID_VALUE}} will result. See [[GLAPI/glBlendFunc|glBlendFunc]]. + + +{{PageErrors}} + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|cap}} is not one of the values listed previously. + +{{KW|_GL_INVALID_VALUE}} is generated by '''_glEnablei''' and '''_glDisablei''' if {{Parameter|index}} is greater than or equal to the number of indexed capabilities for {{Parameter|cap}}. + + +{{PageNotes}} + +{{KW|_GL_PRIMITIVE_RESTART}} is available only if the GL version is 3.1 or greater. + +{{KW|_GL_TEXTURE_CUBE_MAP_SEAMLESS}} is available only if the GL version is 3.2 or greater. + +{{KW|_GL_PRIMITIVE_RESTART_FIXED_INDEX}} is available only if the GL version is 4.3 or greater. + +{{KW|_GL_DEBUG_OUTPUT}} and {{KW|_GL_DEBUG_OUTPUT_SYNCHRONOUS}} are available only if the GL version is 4.3 or greater. + +Any token accepted by '''_glEnable''' or '''_glDisable''' is also accepted by '''_glEnablei''' and '''_glDisablei''', but if the capability is not indexed, the maximum value that {{Parameter|index}} may take is zero. + +In general, passing an indexed capability to '''_glEnable''' or '''_glDisable''' will enable or disable that capability for all indices, resepectively. + + +{{PageUseWith}} + +{{KW|_glIsEnabled}} + +{{KW|_glGet}} + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glActiveTexture}}, {{KW|_glBlendFunc}}, {{KW|_glCullFace}}, {{KW|_glDepthFunc}}, {{KW|_glDepthRange}}, {{KW|_glGet}}, {{KW|_glIsEnabled}}, {{KW|_glLineWidth}}, {{KW|_glLogicOp}}, {{KW|_glPointSize}}, {{KW|_glPolygonMode}}, {{KW|_glPolygonOffset}}, {{KW|_glSampleCoverage}}, {{KW|_glScissor}}, {{KW|_glStencilFunc}}, {{KW|_glStencilOp}}, {{KW|_glTexImage1D}}, {{KW|_glTexImage2D}}, {{KW|_glTexImage3D}} + + +{{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/]. + diff --git a/internal/help/_glEnd.txt b/internal/help/_glEnd.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glEnd.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glEndList.txt b/internal/help/_glEndList.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glEndList.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glEvalCoord1d.txt b/internal/help/_glEvalCoord1d.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glEvalCoord1d.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glEvalCoord1dv.txt b/internal/help/_glEvalCoord1dv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glEvalCoord1dv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glEvalCoord1f.txt b/internal/help/_glEvalCoord1f.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glEvalCoord1f.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glEvalCoord1fv.txt b/internal/help/_glEvalCoord1fv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glEvalCoord1fv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glEvalCoord2d.txt b/internal/help/_glEvalCoord2d.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glEvalCoord2d.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glEvalCoord2dv.txt b/internal/help/_glEvalCoord2dv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glEvalCoord2dv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glEvalCoord2f.txt b/internal/help/_glEvalCoord2f.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glEvalCoord2f.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glEvalCoord2fv.txt b/internal/help/_glEvalCoord2fv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glEvalCoord2fv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glEvalMesh1.txt b/internal/help/_glEvalMesh1.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glEvalMesh1.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glEvalMesh2.txt b/internal/help/_glEvalMesh2.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glEvalMesh2.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glEvalPoint1.txt b/internal/help/_glEvalPoint1.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glEvalPoint1.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glEvalPoint2.txt b/internal/help/_glEvalPoint2.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glEvalPoint2.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glFeedbackBuffer.txt b/internal/help/_glFeedbackBuffer.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glFeedbackBuffer.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glFinish.txt b/internal/help/_glFinish.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glFinish.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glFinish__00100000.txt b/internal/help/_glFinish__00100000.txt new file mode 100644 index 000000000..f65e0630b --- /dev/null +++ b/internal/help/_glFinish__00100000.txt @@ -0,0 +1,32 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:19:29}} +'''_glFinish:''' block until all GL execution is complete + + +{{PageSyntax}} + + SUB _glFinish + void '''_glFinish'''({{Parameter|void}}); + + + +{{PageDescription}} + +'''_glFinish''' does not return until the effects of all previously called GL commands are complete. Such effects include all changes to GL state, all changes to connection state, and all changes to the frame buffer contents. + + +{{PageNotes}} + +'''_glFinish''' requires a round trip to the server. + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glFlush}}, {{KW|_glFenceSync}}, {{KW|_glWaitSync}}, {{KW|_glClientWaitSync}} + + +{{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/]. + diff --git a/internal/help/_glFlush.txt b/internal/help/_glFlush.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glFlush.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glFlush__0010000.txt b/internal/help/_glFlush__0010000.txt new file mode 100644 index 000000000..2432c8338 --- /dev/null +++ b/internal/help/_glFlush__0010000.txt @@ -0,0 +1,34 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:19:30}} +'''_glFlush:''' force execution of GL commands in finite time + + +{{PageSyntax}} + + SUB _glFlush + void '''_glFlush'''({{Parameter|void}}); + + + +{{PageDescription}} + +Different GL implementations buffer commands in several different locations, including network buffers and the graphics accelerator itself. '''_glFlush''' empties all of these buffers, causing all issued commands to be executed as quickly as they are accepted by the actual rendering engine. Though this execution may not be completed in any particular time period, it does complete in finite time. + +Because any GL program might be executed over a network, or on an accelerator that buffers commands, all programs should call '''_glFlush''' whenever they count on having all of their previously issued commands completed. For example, call '''_glFlush''' before waiting for user input that depends on the generated image. + + +{{PageNotes}} + +'''_glFlush''' can return at any time. It does not wait until the execution of all previously issued GL commands is complete. + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glFinish}} + + +{{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/]. + diff --git a/internal/help/_glFogf.txt b/internal/help/_glFogf.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glFogf.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glFogfv.txt b/internal/help/_glFogfv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glFogfv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glFogi.txt b/internal/help/_glFogi.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glFogi.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glFogiv.txt b/internal/help/_glFogiv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glFogiv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glFrontFace.txt b/internal/help/_glFrontFace.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glFrontFace.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glFrontFace__00100001000.txt b/internal/help/_glFrontFace__00100001000.txt new file mode 100644 index 000000000..4ce9c35d8 --- /dev/null +++ b/internal/help/_glFrontFace__00100001000.txt @@ -0,0 +1,42 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:19:37}} +'''_glFrontFace:''' define front- and back-facing polygons + + +{{PageSyntax}} + + SUB _glFrontFace (BYVAL mode AS _UNSIGNED LONG) + void '''_glFrontFace'''(GLenum {{Parameter|mode}}); + + +; mode +: Specifies the orientation of front-facing polygons. {{KW|_GL_CW}} and {{KW|_GL_CCW}} are accepted. The initial value is {{KW|_GL_CCW}}. + + +{{PageDescription}} + +In a scene composed entirely of opaque closed surfaces, back-facing polygons are never visible. Eliminating these invisible polygons has the obvious benefit of speeding up the rendering of the image. To enable and disable elimination of back-facing polygons, call {{KW|_glEnable}} and {{KW|_glDisable}} with argument {{KW|_GL_CULL_FACE}}. + +The projection of a polygon to window coordinates is said to have clockwise winding if an imaginary object following the path from its first vertex, its second vertex, and so on, to its last vertex, and finally back to its first vertex, moves in a clockwise direction about the interior of the polygon. The polygon's winding is said to be counterclockwise if the imaginary object following the same path moves in a counterclockwise direction about the interior of the polygon. '''_glFrontFace''' specifies whether polygons with clockwise winding in window coordinates, or counterclockwise winding in window coordinates, are taken to be front-facing. Passing {{KW|_GL_CCW}} to {{Parameter|mode}} selects counterclockwise polygons as front-facing; {{KW|_GL_CW}} selects clockwise polygons as front-facing. By default, counterclockwise polygons are taken to be front-facing. + + +{{PageErrors}} + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|mode}} is not an accepted value. + + +{{PageUseWith}} + +{{KW|_glGet}} with argument {{KW|_GL_FRONT_FACE}} + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glCullFace}} + + +{{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/]. + diff --git a/internal/help/_glFrustum.txt b/internal/help/_glFrustum.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glFrustum.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGenLists.txt b/internal/help/_glGenLists.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGenLists.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGenTextures.txt b/internal/help/_glGenTextures.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGenTextures.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGenTextures__0010010000000.txt b/internal/help/_glGenTextures__0010010000000.txt new file mode 100644 index 000000000..84f8b07c1 --- /dev/null +++ b/internal/help/_glGenTextures__0010010000000.txt @@ -0,0 +1,46 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:19:41}} +'''_glGenTextures:''' generate texture names + + +{{PageSyntax}} + + SUB _glGenTextures (BYVAL n AS LONG, textures AS _UNSIGNED LONG) + void '''_glGenTextures'''(GLsizei {{Parameter|n}}, GLuint * {{Parameter|textures}}); + + +; n +: Specifies the number of texture names to be generated. +; textures +: Specifies an array in which the generated texture names are stored. + + +{{PageDescription}} + +'''_glGenTextures''' returns {{Parameter|n}} texture names in {{Parameter|textures}}. There is no guarantee that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names was in use immediately before the call to '''_glGenTextures'''. + +The generated textures have no dimensionality; they assume the dimensionality of the texture target to which they are first bound (see {{KW|_glBindTexture}}). + +Texture names returned by a call to '''_glGenTextures''' are not returned by subsequent calls, unless they are first deleted with {{KW|_glDeleteTextures}}. + + +{{PageErrors}} + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|n}} is negative. + + +{{PageUseWith}} + +{{KW|_glIsTexture}} + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glBindTexture}}, {{KW|_glDeleteTextures}}, {{KW|_glIsTexture}} + + +{{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/]. + diff --git a/internal/help/_glGetBooleanv.txt b/internal/help/_glGetBooleanv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGetBooleanv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGetClipPlane.txt b/internal/help/_glGetClipPlane.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGetClipPlane.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGetDoublev.txt b/internal/help/_glGetDoublev.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGetDoublev.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGetError.txt b/internal/help/_glGetError.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGetError.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGetError__0010010000.txt b/internal/help/_glGetError__0010010000.txt new file mode 100644 index 000000000..28d28973a --- /dev/null +++ b/internal/help/_glGetError__0010010000.txt @@ -0,0 +1,45 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:19:46}} +'''_glGetError:''' return error information + + +{{PageSyntax}} + + FUNCTION _glGetError~& + GLenum '''_glGetError'''({{Parameter|void}}); + + + +{{PageDescription}} + +'''_glGetError''' returns the value of the error flag. Each detectable error is assigned a numeric code and symbolic name. When an error occurs, the error flag is set to the appropriate error code value. No other errors are recorded until '''_glGetError''' is called, the error code is returned, and the flag is reset to {{KW|_GL_NO_ERROR}}. If a call to '''_glGetError''' returns {{KW|_GL_NO_ERROR}}, there has been no detectable error since the last call to '''_glGetError''', or since the GL was initialized. + +To allow for distributed implementations, there may be several error flags. If any single error flag has recorded an error, the value of that flag is returned and that flag is reset to {{KW|_GL_NO_ERROR}} when '''_glGetError''' is called. If more than one flag has recorded an error, '''_glGetError''' returns and clears an arbitrary error flag value. Thus, '''_glGetError''' should always be called in a loop, until it returns {{KW|_GL_NO_ERROR}}, if all error flags are to be reset. + +Initially, all error flags are set to {{KW|_GL_NO_ERROR}}. + +The following errors are currently defined: + +; {{KW|_GL_NO_ERROR}} +: No error has been recorded. The value of this symbolic constant is guaranteed to be 0. +; {{KW|_GL_INVALID_ENUM}} +: An unacceptable value is specified for an enumerated argument. The offending command is ignored and has no other side effect than to set the error flag. +; {{KW|_GL_INVALID_VALUE}} +: A numeric argument is out of range. The offending command is ignored and has no other side effect than to set the error flag. +; {{KW|_GL_INVALID_OPERATION}} +: The specified operation is not allowed in the current state. The offending command is ignored and has no other side effect than to set the error flag. +; {{KW|_GL_INVALID_FRAMEBUFFER_OPERATION}} +: The framebuffer object is not complete. The offending command is ignored and has no other side effect than to set the error flag. +; {{KW|_GL_OUT_OF_MEMORY}} +: There is not enough memory left to execute the command. The state of the GL is undefined, except for the state of the error flags, after this error is recorded. +; {{KW|_GL_STACK_UNDERFLOW}} +: An attempt has been made to perform an operation that would cause an internal stack to underflow. +; {{KW|_GL_STACK_OVERFLOW}} +: An attempt has been made to perform an operation that would cause an internal stack to overflow. +When an error flag is set, results of a GL operation are undefined only if {{KW|_GL_OUT_OF_MEMORY}} has occurred. In all other cases, the command generating the error is ignored and has no effect on the GL state or frame buffer contents. If the generating command returns a value, it returns 0. If '''_glGetError''' itself generates an error, it returns 0. + + +{{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/]. + diff --git a/internal/help/_glGetFloatv.txt b/internal/help/_glGetFloatv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGetFloatv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGetIntegerv.txt b/internal/help/_glGetIntegerv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGetIntegerv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGetLightfv.txt b/internal/help/_glGetLightfv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGetLightfv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGetLightiv.txt b/internal/help/_glGetLightiv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGetLightiv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGetMapdv.txt b/internal/help/_glGetMapdv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGetMapdv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGetMapfv.txt b/internal/help/_glGetMapfv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGetMapfv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGetMapiv.txt b/internal/help/_glGetMapiv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGetMapiv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGetMaterialfv.txt b/internal/help/_glGetMaterialfv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGetMaterialfv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGetMaterialiv.txt b/internal/help/_glGetMaterialiv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGetMaterialiv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGetPixelMapfv.txt b/internal/help/_glGetPixelMapfv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGetPixelMapfv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGetPixelMapuiv.txt b/internal/help/_glGetPixelMapuiv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGetPixelMapuiv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGetPixelMapusv.txt b/internal/help/_glGetPixelMapusv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGetPixelMapusv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGetPointerv.txt b/internal/help/_glGetPointerv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGetPointerv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGetPolygonStipple.txt b/internal/help/_glGetPolygonStipple.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGetPolygonStipple.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGetString.txt b/internal/help/_glGetString.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGetString.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGetString__00100100000.txt b/internal/help/_glGetString__00100100000.txt new file mode 100644 index 000000000..4398161e6 --- /dev/null +++ b/internal/help/_glGetString__00100100000.txt @@ -0,0 +1,75 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:20:05}} +'''_glGetString:''' return a string describing the current GL connection + + +{{PageSyntax}} + + FUNCTION _glGetString&& (BYVAL name AS _UNSIGNED LONG) + const GLubyte* '''_glGetString'''(GLenum {{Parameter|name}}); + + const GLubyte* '''_glGetStringi'''(GLenum {{Parameter|name}}, GLuint {{Parameter|index}}); + +; name +: Specifies a symbolic constant, one of {{KW|_GL_VENDOR}}, {{KW|_GL_RENDERER}}, {{KW|_GL_VERSION}}, or {{KW|_GL_SHADING_LANGUAGE_VERSION}}. Additionally, '''_glGetStringi''' accepts the {{KW|_GL_EXTENSIONS}} token. +; index +: For '''_glGetStringi''', specifies the index of the string to return. + + +{{PageDescription}} + +'''_glGetString''' returns a pointer to a static string describing some aspect of the current GL connection. {{Parameter|name}} can be one of the following: + +; {{KW|_GL_VENDOR}} +: +Returns the company responsible for this GL implementation. This name does not change from release to release. +; {{KW|_GL_RENDERER}} +: +Returns the name of the renderer. This name is typically specific to a particular configuration of a hardware platform. It does not change from release to release. +; {{KW|_GL_VERSION}} +: +Returns a version or release number. +; {{KW|_GL_SHADING_LANGUAGE_VERSION}} +: +Returns a version or release number for the shading language. + +Strings {{KW|_GL_VENDOR}} and {{KW|_GL_RENDERER}} together uniquely specify a platform. They do not change from release to release and should be used by platform-recognition algorithms. + +'''_glGetStringi''' returns a pointer to a static string indexed by {{Parameter|index}}. {{Parameter|name}} can be one of the following: + +; {{KW|_GL_EXTENSIONS}} +: For '''_glGetStringi''' only, returns the extension string supported by the implementation at {{Parameter|index}}. The index {{Parameter|index}} is on the range [0 to {{KW|_glGet|Integerv(GL_NUM_EXTENSIONS)}} - 1]. +; {{KW|_GL_SHADING_LANGUAGE_VERSION}} +: Returns one of the versions of [[GLSL]] supported by this implementation. {{Parameter|index}} is on the range [0 to {{KW|_glGet|Integerv(GL_NUM_SHADING_LANGUAGE_VERSIONS)}} - 1]. + +The {{KW|_GL_VERSION}} and {{KW|_GL_SHADING_LANGUAGE_VERSION}} strings begin with a version number. The version number uses one of these forms: + +''major_number.minor_number'' + +or + +''major_number.minor_number.release_number'' + +Vendor-specific information may follow the version number. Its format depends on the implementation, but a space always separates the version number and the vendor-specific information. + +All strings are null-terminated. + + +{{PageNotes}} + +If an error is generated, '''_glGetString''' returns 0. + +The client and server may support different versions. '''_glGetString''' always returns a compatible version number. The release number always describes the server. + + +{{PageErrors}} + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|name}} is not an accepted value. + +{{KW|_GL_INVALID_VALUE}} is generated by '''_glGetStringi''' if {{Parameter|index}} is outside the valid range for indexed state {{Parameter|name}}. + + +{{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/]. + diff --git a/internal/help/_glGetTexEnvfv.txt b/internal/help/_glGetTexEnvfv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGetTexEnvfv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGetTexEnviv.txt b/internal/help/_glGetTexEnviv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGetTexEnviv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGetTexGendv.txt b/internal/help/_glGetTexGendv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGetTexGendv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGetTexGenfv.txt b/internal/help/_glGetTexGenfv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGetTexGenfv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGetTexGeniv.txt b/internal/help/_glGetTexGeniv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGetTexGeniv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGetTexImage.txt b/internal/help/_glGetTexImage.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGetTexImage.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGetTexImage__0010010010000.txt b/internal/help/_glGetTexImage__0010010010000.txt new file mode 100644 index 000000000..2b825b3b4 --- /dev/null +++ b/internal/help/_glGetTexImage__0010010010000.txt @@ -0,0 +1,85 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:20:13}} +'''_glGetTexImage:''' return a texture image + + +{{PageSyntax}} + + SUB _glGetTexImage (BYVAL target AS _UNSIGNED LONG, BYVAL level AS LONG, BYVAL format AS _UNSIGNED LONG, BYVAL type AS _UNSIGNED LONG, pixels AS _OFFSET) + void '''_glGetTexImage'''(GLenum {{Parameter|target}}, GLint {{Parameter|level}}, GLenum {{Parameter|format}}, GLenum {{Parameter|type}}, GLvoid * {{Parameter|img}}); + + +; target +: Specifies which texture is to be obtained. {{KW|_GL_TEXTURE_1D}}, {{KW|_GL_TEXTURE_2D}}, {{KW|_GL_TEXTURE_3D}}, {{KW|_GL_TEXTURE_1D_ARRAY}}, {{KW|_GL_TEXTURE_2D_ARRAY}}, {{KW|_GL_TEXTURE_RECTANGLE}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_X}}, {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_X}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_Y}}, {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_Z}}, and {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z}} are accepted. +; level +: Specifies the level-of-detail number of the desired image. Level 0 is the base image level. Level ''n'' is the ''n''th mipmap reduction image. +; format +: Specifies a pixel format for the returned data. The supported formats are {{KW|_GL_STENCIL_INDEX}}, {{KW|_GL_DEPTH_COMPONENT}}, {{KW|_GL_DEPTH_STENCIL}}, {{KW|_GL_RED}}, {{KW|_GL_GREEN}}, {{KW|_GL_BLUE}}, {{KW|_GL_RG}}, {{KW|_GL_RGB}}, {{KW|_GL_RGBA}}, {{KW|_GL_BGR}}, {{KW|_GL_BGRA}}, {{KW|_GL_RED_INTEGER}}, {{KW|_GL_GREEN_INTEGER}}, {{KW|_GL_BLUE_INTEGER}}, {{KW|_GL_RG_INTEGER}}, {{KW|_GL_RGB_INTEGER}}, {{KW|_GL_RGBA_INTEGER}}, {{KW|_GL_BGR_INTEGER}}, {{KW|_GL_BGRA_INTEGER}}. +; type +: Specifies a pixel type for the returned data. The supported types are {{KW|_GL_UNSIGNED_BYTE}}, {{KW|_GL_BYTE}}, {{KW|_GL_UNSIGNED_SHORT}}, {{KW|_GL_SHORT}}, {{KW|_GL_UNSIGNED_INT}}, {{KW|_GL_INT}}, {{KW|_GL_HALF_FLOAT}}, {{KW|_GL_FLOAT}}, {{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}}, {{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}}, {{KW|_GL_UNSIGNED_INT_24_8}}, {{KW|_GL_UNSIGNED_INT_10F_11F_11F_REV}}, {{KW|_GL_UNSIGNED_INT_5_9_9_9_REV}}, and {{KW|_GL_FLOAT_32_UNSIGNED_INT_24_8_REV}}. +; img +: Returns the texture image. Should be a pointer to an array of the type specified by {{Parameter|type}}. + + +{{PageDescription}} + +'''_glGetTexImage''' returns a texture image into {{Parameter|img}}. {{Parameter|target}} specifies whether the desired texture image is one specified by {{KW|_glTexImage1D}} ({{KW|_GL_TEXTURE_1D}}), {{KW|_glTexImage2D}} ({{KW|_GL_TEXTURE_1D_ARRAY}}, {{KW|_GL_TEXTURE_RECTANGLE}}, {{KW|_GL_TEXTURE_2D}} or any of {{KW|_GL_TEXTURE_CUBE_MAP_*}}), or {{KW|_glTexImage3D}} ({{KW|_GL_TEXTURE_2D_ARRAY}}, {{KW|_GL_TEXTURE_3D}}). {{Parameter|level}} specifies the level-of-detail number of the desired image. {{Parameter|format}} and {{Parameter|type}} specify the format and type of the desired image array. See the reference page for {{KW|_glTexImage1D}} for a description of the acceptable values for the {{Parameter|format}} and {{Parameter|type}} parameters, respectively. + +If a non-zero named buffer object is bound to the {{KW|_GL_PIXEL_PACK_BUFFER}} target (see {{KW|_glBindBuffer}}) while a texture image is requested, {{Parameter|img}} is treated as a byte offset into the buffer object's data store. + +To understand the operation of '''_glGetTexImage''', consider the selected internal four-component texture image to be an RGBA color buffer the size of the image. The semantics of '''_glGetTexImage''' are then identical to those of {{KW|_glReadPixels}}, with the exception that no pixel transfer operations are performed, when called with the same {{Parameter|format}} and {{Parameter|type}}, with ''x'' and ''y'' set to 0, ''width'' set to the width of the texture image and ''height'' set to 1 for 1D images, or to the height of the texture image for 2D images. + +If the selected texture image does not contain four components, the following mappings are applied. Single-component textures are treated as RGBA buffers with red set to the single-component value, green set to 0, blue set to 0, and alpha set to 1. Two-component textures are treated as RGBA buffers with red set to the value of component zero, alpha set to the value of component one, and green and blue set to 0. Finally, three-component textures are treated as RGBA buffers with red set to component zero, green set to component one, blue set to component two, and alpha set to 1. + +To determine the required size of {{Parameter|img}}, use {{KW|_glGetTexLevelParameter}} to determine the dimensions of the internal texture image, then scale the required number of pixels by the storage required for each pixel, based on {{Parameter|format}} and {{Parameter|type}}. Be sure to take the pixel storage parameters into account, especially {{KW|_GL_PACK_ALIGNMENT}}. + + +{{PageNotes}} + +If an error is generated, no change is made to the contents of {{Parameter|img}}. + +'''_glGetTexImage''' returns the texture image for the active texture unit. + + +{{PageErrors}} + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|target}}, {{Parameter|format}}, or {{Parameter|type}} is not an accepted value. + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|level}} is less than 0. + +{{KW|_GL_INVALID_VALUE}} may be generated if {{Parameter|level}} is greater than log2(''max''), where ''max'' is the returned value of {{KW|_GL_MAX_TEXTURE_SIZE}}. + +{{KW|_GL_INVALID_OPERATION}} is returned 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 returned 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}} or {{KW|_GL_BGRA}}. + +{{KW|_GL_INVALID_OPERATION}} is generated if a non-zero buffer object name is bound to the {{KW|_GL_PIXEL_PACK_BUFFER}} target and the buffer object's data store is currently mapped. + +{{KW|_GL_INVALID_OPERATION}} is generated if a non-zero buffer object name is bound to the {{KW|_GL_PIXEL_PACK_BUFFER}} target and the data would be packed to the buffer object such that the memory writes required would exceed the data store size. + +{{KW|_GL_INVALID_OPERATION}} is generated if a non-zero buffer object name is bound to the {{KW|_GL_PIXEL_PACK_BUFFER}} target and {{Parameter|img}} is not evenly divisible into the number of bytes needed to store in memory a datum indicated by {{Parameter|type}}. + + +{{PageUseWith}} + +{{KW|_glGetTexLevelParameter}} with argument {{KW|_GL_TEXTURE_WIDTH}} + +{{KW|_glGetTexLevelParameter}} with argument {{KW|_GL_TEXTURE_HEIGHT}} + +{{KW|_glGetTexLevelParameter}} with argument {{KW|_GL_TEXTURE_INTERNAL_FORMAT}} + +{{KW|_glGet}} with arguments {{KW|_GL_PACK_ALIGNMENT}} and others + +{{KW|_glGet}} with argument {{KW|_GL_PIXEL_PACK_BUFFER_BINDING}} + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glActiveTexture}}, {{KW|_glBindTexture}}, {{KW|_glPixelStore}}, {{KW|_glReadPixels}}, {{KW|_glTexSubImage1D}}, {{KW|_glTexSubImage2D}}, {{KW|_glTexSubImage3D}} + + +{{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/]. + diff --git a/internal/help/_glGetTexLevelParameterfv.txt b/internal/help/_glGetTexLevelParameterfv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGetTexLevelParameterfv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGetTexLevelParameteriv.txt b/internal/help/_glGetTexLevelParameteriv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGetTexLevelParameteriv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGetTexParameterfv.txt b/internal/help/_glGetTexParameterfv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGetTexParameterfv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glGetTexParameteriv.txt b/internal/help/_glGetTexParameteriv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glGetTexParameteriv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glHint.txt b/internal/help/_glHint.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glHint.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glHint__001000.txt b/internal/help/_glHint__001000.txt new file mode 100644 index 000000000..54b1ee48b --- /dev/null +++ b/internal/help/_glHint__001000.txt @@ -0,0 +1,59 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:20:19}} +'''_glHint:''' specify implementation-specific hints + + +{{PageSyntax}} + + SUB _glHint (BYVAL target AS _UNSIGNED LONG, BYVAL mode AS _UNSIGNED LONG) + void '''_glHint'''(GLenum {{Parameter|target}}, GLenum {{Parameter|mode}}); + + +; target +: Specifies a symbolic constant indicating the behavior to be controlled. {{KW|_GL_LINE_SMOOTH_HINT}}, {{KW|_GL_POLYGON_SMOOTH_HINT}}, {{KW|_GL_TEXTURE_COMPRESSION_HINT}}, and {{KW|_GL_FRAGMENT_SHADER_DERIVATIVE_HINT}} are accepted. +; mode +: Specifies a symbolic constant indicating the desired behavior. {{KW|_GL_FASTEST}}, {{KW|_GL_NICEST}}, and {{KW|_GL_DONT_CARE}} are accepted. + + +{{PageDescription}} + +Certain aspects of GL behavior, when there is room for interpretation, can be controlled with hints. A hint is specified with two arguments. {{Parameter|target}} is a symbolic constant indicating the behavior to be controlled, and {{Parameter|mode}} is another symbolic constant indicating the desired behavior. The initial value for each {{Parameter|target}} is {{KW|_GL_DONT_CARE}}. {{Parameter|mode}} can be one of the following: + +; {{KW|_GL_FASTEST}} +: +The most efficient option should be chosen. +; {{KW|_GL_NICEST}} +: +The most correct, or highest quality, option should be chosen. +; {{KW|_GL_DONT_CARE}} +: +No preference. +Though the implementation aspects that can be hinted are well defined, the interpretation of the hints depends on the implementation. The hint aspects that can be specified with {{Parameter|target}}, along with suggested semantics, are as follows: + +; {{KW|_GL_FRAGMENT_SHADER_DERIVATIVE_HINT}} +: +Indicates the accuracy of the derivative calculation for the GL shading language fragment processing built-in functions: {{KW|_dFdx}}, {{KW|_dFdy}}, and {{KW|_fwidth}}. +; {{KW|_GL_LINE_SMOOTH_HINT}} +: +Indicates the sampling quality of antialiased lines. If a larger filter function is applied, hinting {{KW|_GL_NICEST}} can result in more pixel fragments being generated during rasterization. +; {{KW|_GL_POLYGON_SMOOTH_HINT}} +: +Indicates the sampling quality of antialiased polygons. Hinting {{KW|_GL_NICEST}} can result in more pixel fragments being generated during rasterization, if a larger filter function is applied. +; {{KW|_GL_TEXTURE_COMPRESSION_HINT}} +: +Indicates the quality and performance of the compressing texture images. Hinting {{KW|_GL_FASTEST}} indicates that texture images should be compressed as quickly as possible, while {{KW|_GL_NICEST}} indicates that texture images should be compressed with as little image quality loss as possible. {{KW|_GL_NICEST}} should be selected if the texture is to be retrieved by {{KW|_glGetCompressedTexImage}} for reuse. + +{{PageNotes}} + +The interpretation of hints depends on the implementation. Some implementations ignore '''_glHint''' settings. + + +{{PageErrors}} + +{{KW|_GL_INVALID_ENUM}} is generated if either {{Parameter|target}} or {{Parameter|mode}} is not an accepted value. + + +{{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/]. + diff --git a/internal/help/_glIndexMask.txt b/internal/help/_glIndexMask.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glIndexMask.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glIndexPointer.txt b/internal/help/_glIndexPointer.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glIndexPointer.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glIndexd.txt b/internal/help/_glIndexd.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glIndexd.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glIndexdv.txt b/internal/help/_glIndexdv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glIndexdv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glIndexf.txt b/internal/help/_glIndexf.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glIndexf.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glIndexfv.txt b/internal/help/_glIndexfv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glIndexfv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glIndexi.txt b/internal/help/_glIndexi.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glIndexi.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glIndexiv.txt b/internal/help/_glIndexiv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glIndexiv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glIndexs.txt b/internal/help/_glIndexs.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glIndexs.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glIndexsv.txt b/internal/help/_glIndexsv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glIndexsv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glIndexub.txt b/internal/help/_glIndexub.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glIndexub.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glIndexubv.txt b/internal/help/_glIndexubv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glIndexubv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glInitNames.txt b/internal/help/_glInitNames.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glInitNames.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glInterleavedArrays.txt b/internal/help/_glInterleavedArrays.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glInterleavedArrays.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glIsEnabled.txt b/internal/help/_glIsEnabled.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glIsEnabled.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glIsEnabled__00101000000.txt b/internal/help/_glIsEnabled__00101000000.txt new file mode 100644 index 000000000..5a607e71d --- /dev/null +++ b/internal/help/_glIsEnabled__00101000000.txt @@ -0,0 +1,134 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:20:40}} +'''_glIsEnabled, glIsEnabledi:''' test whether a capability is enabled + + +{{PageSyntax}} + + FUNCTION _glIsEnabled~%% (BYVAL cap AS _UNSIGNED LONG) + GLboolean '''_glIsEnabled'''(GLenum {{Parameter|cap}}); + + GLboolean '''_glIsEnabledi'''(GLenum {{Parameter|cap}}, GLuint {{Parameter|index}}); + +; cap +: Specifies a symbolic constant indicating a GL capability. +; index +: Specifies the index of the capability. + + +{{PageDescription}} + +'''_glIsEnabled''' returns {{KW|_GL_TRUE}} if {{Parameter|cap}} is an enabled capability and returns {{KW|_GL_FALSE}} otherwise. Boolean states that are indexed may be tested with '''_glIsEnabledi'''. For '''_glIsEnabledi''', {{Parameter|index}} specifies the index of the capability to test. {{Parameter|index}} must be between zero and the count of indexed capabilities for {{Parameter|cap}}. Initially all capabilities except {{KW|_GL_DITHER}} are disabled; {{KW|_GL_DITHER}} is initially enabled. + +The following capabilities are accepted for {{Parameter|cap}}: + + + +{| +|+ +! '''Constant''' +! '''See''' +|+ +| {{KW|_GL_BLEND}} +| {{KW|_glBlendFunc}}, {{KW|_glLogicOp}} +|+ +| {{KW|_GL_CLIP_DISTANCE}}''i'' +| {{KW|_glEnable}} +|+ +| {{KW|_GL_COLOR_LOGIC_OP}} +| {{KW|_glLogicOp}} +|+ +| {{KW|_GL_CULL_FACE}} +| {{KW|_glCullFace}} +|+ +| {{KW|_GL_DEPTH_CLAMP}} +| {{KW|_glEnable}} +|+ +| {{KW|_GL_DEBUG_OUTPUT}} +| {{KW|_glEnable}} +|+ +| {{KW|_GL_DEBUG_OUTPUT_SYNCHRONOUS}} +| {{KW|_glEnable}} +|+ +| {{KW|_GL_DEPTH_TEST}} +| {{KW|_glDepthFunc}}, {{KW|_glDepthRange}} +|+ +| {{KW|_GL_DITHER}} +| {{KW|_glEnable}} +|+ +| {{KW|_GL_FRAMEBUFFER_SRGB}} +| {{KW|_glEnable}} +|+ +| {{KW|_GL_LINE_SMOOTH}} +| {{KW|_glLineWidth}} +|+ +| {{KW|_GL_MULTISAMPLE}} +| {{KW|_glSampleCoverage}} +|+ +| {{KW|_GL_POLYGON_SMOOTH}} +| {{KW|_glPolygonMode}} +|+ +| {{KW|_GL_POLYGON_OFFSET_FILL}} +| {{KW|_glPolygonOffset}} +|+ +| {{KW|_GL_POLYGON_OFFSET_LINE}} +| {{KW|_glPolygonOffset}} +|+ +| {{KW|_GL_POLYGON_OFFSET_POINT}} +| {{KW|_glPolygonOffset}} +|+ +| {{KW|_GL_PROGRAM_POINT_SIZE}} +| {{KW|_glEnable}} +|+ +| {{KW|_GL_PRIMITIVE_RESTART}} +| {{KW|_glEnable}}, {{KW|_glPrimitiveRestartIndex}} +|+ +| {{KW|_GL_SAMPLE_ALPHA_TO_COVERAGE}} +| {{KW|_glSampleCoverage}} +|+ +| {{KW|_GL_SAMPLE_ALPHA_TO_ONE}} +| {{KW|_glSampleCoverage}} +|+ +| {{KW|_GL_SAMPLE_COVERAGE}} +| {{KW|_glSampleCoverage}} +|+ +| {{KW|_GL_SAMPLE_MASK}} +| {{KW|_glEnable}} +|+ +| {{KW|_GL_SCISSOR_TEST}} +| {{KW|_glScissor}} +|+ +| {{KW|_GL_STENCIL_TEST}} +| {{KW|_glStencilFunc}}, {{KW|_glStencilOp}} +|+ +| {{KW|_GL_TEXTURE_CUBEMAP_SEAMLESS}} +| {{KW|_glEnable}} +|} + + + + +{{PageNotes}} + +If an error is generated, '''_glIsEnabled''' and '''_glIsEnabledi''' return {{KW|_GL_FALSE}}. + +{{KW|_GL_DEBUG_OUTPUT}} and {{KW|_GL_DEBUG_OUTPUT_SYNCHRONOUS}} are available only if the GL version is 4.3 or greater. + + +{{PageErrors}} + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|cap}} is not an accepted value. + +{{KW|_GL_INVALID_VALUE}} is generated by '''_glIsEnabledi''' if {{Parameter|index}} is outside the valid range for the indexed state {{Parameter|cap}}. + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glEnable}}, {{KW|_glDisable}}, {{KW|_glGet}} + + +{{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/]. + diff --git a/internal/help/_glIsList.txt b/internal/help/_glIsList.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glIsList.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glIsTexture.txt b/internal/help/_glIsTexture.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glIsTexture.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glIsTexture__00101000000.txt b/internal/help/_glIsTexture__00101000000.txt new file mode 100644 index 000000000..24258e925 --- /dev/null +++ b/internal/help/_glIsTexture__00101000000.txt @@ -0,0 +1,32 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:20:42}} +'''_glIsTexture:''' determine if a name corresponds to a texture + + +{{PageSyntax}} + + FUNCTION _glIsTexture~%% (BYVAL texture AS _UNSIGNED LONG) + GLboolean '''_glIsTexture'''(GLuint {{Parameter|texture}}); + + +; texture +: Specifies a value that may be the name of a texture. + + +{{PageDescription}} + +'''_glIsTexture''' returns {{KW|_GL_TRUE}} if {{Parameter|texture}} is currently the name of a texture. If {{Parameter|texture}} is zero, or is a non-zero value that is not currently the name of a texture, or if an error occurs, '''_glIsTexture''' returns {{KW|_GL_FALSE}}. + +A name returned by {{KW|_glGenTextures}}, but not yet associated with a texture by calling {{KW|_glBindTexture}}, is not the name of a texture. + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glBindTexture}}, {{KW|_glDeleteTextures}}, {{KW|_glGenTextures}} + + +{{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/]. + diff --git a/internal/help/_glLightModelf.txt b/internal/help/_glLightModelf.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glLightModelf.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glLightModelfv.txt b/internal/help/_glLightModelfv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glLightModelfv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glLightModeli.txt b/internal/help/_glLightModeli.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glLightModeli.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glLightModeliv.txt b/internal/help/_glLightModeliv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glLightModeliv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glLightf.txt b/internal/help/_glLightf.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glLightf.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glLightfv.txt b/internal/help/_glLightfv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glLightfv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glLighti.txt b/internal/help/_glLighti.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glLighti.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glLightiv.txt b/internal/help/_glLightiv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glLightiv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glLineStipple.txt b/internal/help/_glLineStipple.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glLineStipple.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glLineWidth.txt b/internal/help/_glLineWidth.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glLineWidth.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glLineWidth__00100010000.txt b/internal/help/_glLineWidth__00100010000.txt new file mode 100644 index 000000000..0ec82f3f7 --- /dev/null +++ b/internal/help/_glLineWidth__00100010000.txt @@ -0,0 +1,63 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:20:55}} +'''_glLineWidth:''' specify the width of rasterized lines + + +{{PageSyntax}} + + SUB _glLineWidth (BYVAL width AS SINGLE) + void '''_glLineWidth'''(GLfloat {{Parameter|width}}); + + +; width +: Specifies the width of rasterized lines. The initial value is 1. + + +{{PageDescription}} + +'''_glLineWidth''' specifies the rasterized width of both aliased and antialiased lines. Using a line width other than 1 has different effects, depending on whether line antialiasing is enabled. To enable and disable line antialiasing, call {{KW|_glEnable}} and {{KW|_glDisable}} with argument {{KW|_GL_LINE_SMOOTH}}. Line antialiasing is initially disabled. + +If line antialiasing is disabled, the actual width is determined by rounding the supplied width to the nearest integer. (If the rounding results in the value 0, it is as if the line width were 1.) If |\Delta X| \ge |\Delta Y|, ''i'' pixels are filled in each column that is rasterized, where ''i'' is the rounded value of {{Parameter|width}}. Otherwise, ''i'' pixels are filled in each row that is rasterized. + +If antialiasing is enabled, line rasterization produces a fragment for each pixel square that intersects the region lying within the rectangle having width equal to the current line width, length equal to the actual length of the line, and centered on the mathematical line segment. The coverage value for each fragment is the window coordinate area of the intersection of the rectangular region with the corresponding pixel square. This value is saved and used in the final rasterization step. + +Not all widths can be supported when line antialiasing is enabled. If an unsupported width is requested, the nearest supported width is used. Only width 1 is guaranteed to be supported; others depend on the implementation. Likewise, there is a range for aliased line widths as well. To query the range of supported widths and the size difference between supported widths within the range, call {{KW|_glGet}} with arguments {{KW|_GL_ALIASED_LINE_WIDTH_RANGE}}, {{KW|_GL_SMOOTH_LINE_WIDTH_RANGE}}, and {{KW|_GL_SMOOTH_LINE_WIDTH_GRANULARITY}}. + + +{{PageNotes}} + +The line width specified by '''_glLineWidth''' is always returned when {{KW|_GL_LINE_WIDTH}} is queried. Clamping and rounding for aliased and antialiased lines have no effect on the specified value. + +Nonantialiased line width may be clamped to an implementation-dependent maximum. Call {{KW|_glGet}} with {{KW|_GL_ALIASED_LINE_WIDTH_RANGE}} to determine the maximum width. + +In OpenGL 1.2, the tokens {{KW|_GL_LINE_WIDTH_RANGE}} and {{KW|_GL_LINE_WIDTH_GRANULARITY}} were replaced by {{KW|_GL_ALIASED_LINE_WIDTH_RANGE}}, {{KW|_GL_SMOOTH_LINE_WIDTH_RANGE}}, and {{KW|_GL_SMOOTH_LINE_WIDTH_GRANULARITY}}. The old names are retained for backward compatibility, but should not be used in new code. + + +{{PageErrors}} + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|width}} is less than or equal to 0. + + +{{PageUseWith}} + +{{KW|_glGet}} with argument {{KW|_GL_LINE_WIDTH}} + +{{KW|_glGet}} with argument {{KW|_GL_ALIASED_LINE_WIDTH_RANGE}} + +{{KW|_glGet}} with argument {{KW|_GL_SMOOTH_LINE_WIDTH_RANGE}} + +{{KW|_glGet}} with argument {{KW|_GL_SMOOTH_LINE_WIDTH_GRANULARITY}} + +{{KW|_glIsEnabled}} with argument {{KW|_GL_LINE_SMOOTH}} + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glEnable}} + + +{{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/]. + diff --git a/internal/help/_glListBase.txt b/internal/help/_glListBase.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glListBase.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glLoadIdentity.txt b/internal/help/_glLoadIdentity.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glLoadIdentity.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glLoadMatrixd.txt b/internal/help/_glLoadMatrixd.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glLoadMatrixd.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glLoadMatrixf.txt b/internal/help/_glLoadMatrixf.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glLoadMatrixf.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glLoadName.txt b/internal/help/_glLoadName.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glLoadName.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glLogicOp.txt b/internal/help/_glLogicOp.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glLogicOp.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glLogicOp__001000010.txt b/internal/help/_glLogicOp__001000010.txt new file mode 100644 index 000000000..dbeecaa71 --- /dev/null +++ b/internal/help/_glLogicOp__001000010.txt @@ -0,0 +1,107 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:21:03}} +'''_glLogicOp:''' specify a logical pixel operation for rendering + + +{{PageSyntax}} + + SUB _glLogicOp (BYVAL opcode AS _UNSIGNED LONG) + void '''_glLogicOp'''(GLenum {{Parameter|opcode}}); + + +; opcode +: Specifies a symbolic constant that selects a logical operation. The following symbols are accepted: {{KW|_GL_CLEAR}}, {{KW|_GL_SET}}, {{KW|_GL_COPY}}, {{KW|_GL_COPY_INVERTED}}, {{KW|_GL_NOOP}}, {{KW|_GL_INVERT}}, {{KW|_GL_AND}}, {{KW|_GL_NAND}}, {{KW|_GL_OR}}, {{KW|_GL_NOR}}, {{KW|_GL_XOR}}, {{KW|_GL_EQUIV}}, {{KW|_GL_AND_REVERSE}}, {{KW|_GL_AND_INVERTED}}, {{KW|_GL_OR_REVERSE}}, and {{KW|_GL_OR_INVERTED}}. The initial value is {{KW|_GL_COPY}}. + + +{{PageDescription}} + +'''_glLogicOp''' specifies a logical operation that, when enabled, is applied between the incoming RGBA color and the RGBA color at the corresponding location in the frame buffer. To enable or disable the logical operation, call {{KW|_glEnable}} and {{KW|_glDisable}} using the symbolic constant {{KW|_GL_COLOR_LOGIC_OP}}. The initial value is disabled. + + + +{| +|+ +! '''Opcode''' +! '''Resulting Operation''' +|+ +| {{KW|_GL_CLEAR}} +| 0 +|+ +| {{KW|_GL_SET}} +| 1 +|+ +| {{KW|_GL_COPY}} +| s +|+ +| {{KW|_GL_COPY_INVERTED}} +| ~s +|+ +| {{KW|_GL_NOOP}} +| d +|+ +| {{KW|_GL_INVERT}} +| ~d +|+ +| {{KW|_GL_AND}} +| s & d +|+ +| {{KW|_GL_NAND}} +| ~(s & d) +|+ +| {{KW|_GL_OR}} +| s | d +|+ +| {{KW|_GL_NOR}} +| ~(s | d) +|+ +| {{KW|_GL_XOR}} +| s ^ d +|+ +| {{KW|_GL_EQUIV}} +| ~(s ^ d) +|+ +| {{KW|_GL_AND_REVERSE}} +| s & ~d +|+ +| {{KW|_GL_AND_INVERTED}} +| ~s & d +|+ +| {{KW|_GL_OR_REVERSE}} +| s | ~d +|+ +| {{KW|_GL_OR_INVERTED}} +| ~s | d +|} + +{{Parameter|opcode}} is a symbolic constant chosen from the list above. In the explanation of the logical operations, ''s'' represents the incoming color and ''d'' represents the color in the frame buffer. Standard C-language operators are used. As these bitwise operators suggest, the logical operation is applied independently to each bit pair of the source and destination colors. + + +{{PageNotes}} + +When more than one RGBA color buffer is enabled for drawing, logical operations are performed separately for each enabled buffer, using for the destination value the contents of that buffer (see {{KW|_glDrawBuffer}}). + +Logic operations have no effect on floating point draw buffers. However, if {{KW|_GL_COLOR_LOGIC_OP}} is enabled, blending is still disabled in this case. + + +{{PageErrors}} + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|opcode}} is not an accepted value. + + +{{PageUseWith}} + +{{KW|_glGet}} with argument {{KW|_GL_LOGIC_OP_MODE}}. + +{{KW|_glIsEnabled}} with argument {{KW|_GL_COLOR_LOGIC_OP}}. + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glEnable|(GL_COLOR_LOGIC_OP)}}, {{KW|_glDrawBuffer}}, {{KW|_glDrawBuffers}}, {{KW|_glStencilOp}} + + +{{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/]. + diff --git a/internal/help/_glMap1d.txt b/internal/help/_glMap1d.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glMap1d.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glMap1f.txt b/internal/help/_glMap1f.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glMap1f.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glMap2d.txt b/internal/help/_glMap2d.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glMap2d.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glMap2f.txt b/internal/help/_glMap2f.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glMap2f.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glMapGrid1d.txt b/internal/help/_glMapGrid1d.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glMapGrid1d.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glMapGrid1f.txt b/internal/help/_glMapGrid1f.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glMapGrid1f.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glMapGrid2d.txt b/internal/help/_glMapGrid2d.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glMapGrid2d.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glMapGrid2f.txt b/internal/help/_glMapGrid2f.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glMapGrid2f.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glMaterialf.txt b/internal/help/_glMaterialf.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glMaterialf.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glMaterialfv.txt b/internal/help/_glMaterialfv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glMaterialfv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glMateriali.txt b/internal/help/_glMateriali.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glMateriali.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glMaterialiv.txt b/internal/help/_glMaterialiv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glMaterialiv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glMatrixMode.txt b/internal/help/_glMatrixMode.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glMatrixMode.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glMultMatrixd.txt b/internal/help/_glMultMatrixd.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glMultMatrixd.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glMultMatrixf.txt b/internal/help/_glMultMatrixf.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glMultMatrixf.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glNewList.txt b/internal/help/_glNewList.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glNewList.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glNormal3b.txt b/internal/help/_glNormal3b.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glNormal3b.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glNormal3bv.txt b/internal/help/_glNormal3bv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glNormal3bv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glNormal3d.txt b/internal/help/_glNormal3d.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glNormal3d.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glNormal3dv.txt b/internal/help/_glNormal3dv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glNormal3dv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glNormal3f.txt b/internal/help/_glNormal3f.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glNormal3f.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glNormal3fv.txt b/internal/help/_glNormal3fv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glNormal3fv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glNormal3i.txt b/internal/help/_glNormal3i.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glNormal3i.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glNormal3iv.txt b/internal/help/_glNormal3iv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glNormal3iv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glNormal3s.txt b/internal/help/_glNormal3s.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glNormal3s.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glNormal3sv.txt b/internal/help/_glNormal3sv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glNormal3sv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glNormalPointer.txt b/internal/help/_glNormalPointer.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glNormalPointer.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glOrtho.txt b/internal/help/_glOrtho.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glOrtho.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glPassThrough.txt b/internal/help/_glPassThrough.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glPassThrough.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glPixelMapfv.txt b/internal/help/_glPixelMapfv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glPixelMapfv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glPixelMapuiv.txt b/internal/help/_glPixelMapuiv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glPixelMapuiv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glPixelMapusv.txt b/internal/help/_glPixelMapusv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glPixelMapusv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glPixelStoref.txt b/internal/help/_glPixelStoref.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glPixelStoref.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glPixelStorei.txt b/internal/help/_glPixelStorei.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glPixelStorei.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glPixelTransferf.txt b/internal/help/_glPixelTransferf.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glPixelTransferf.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glPixelTransferi.txt b/internal/help/_glPixelTransferi.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glPixelTransferi.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glPixelZoom.txt b/internal/help/_glPixelZoom.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glPixelZoom.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glPointSize.txt b/internal/help/_glPointSize.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glPointSize.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glPointSize__00100001000.txt b/internal/help/_glPointSize__00100001000.txt new file mode 100644 index 000000000..e8478a84a --- /dev/null +++ b/internal/help/_glPointSize__00100001000.txt @@ -0,0 +1,57 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:21:51}} +'''_glPointSize:''' specify the diameter of rasterized points + + +{{PageSyntax}} + + SUB _glPointSize (BYVAL size AS SINGLE) + void '''_glPointSize'''(GLfloat {{Parameter|size}}); + + +; size +: Specifies the diameter of rasterized points. The initial value is 1. + + +{{PageDescription}} + +'''_glPointSize''' specifies the rasterized diameter of points. If point size mode is disabled (see {{KW|_glEnable}} with parameter {{KW|_GL_PROGRAM_POINT_SIZE}}), this value will be used to rasterize points. Otherwise, the value written to the shading language built-in variable {{code|gl_PointSize}} will be used. + + +{{PageNotes}} + +The point size specified by '''_glPointSize''' is always returned when {{KW|_GL_POINT_SIZE}} is queried. Clamping and rounding for points have no effect on the specified value. + + +{{PageErrors}} + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|size}} is less than or equal to 0. + + +{{PageUseWith}} + +{{KW|_glGet}} with argument {{KW|_GL_POINT_SIZE_RANGE}} + +{{KW|_glGet}} with argument {{KW|_GL_POINT_SIZE_GRANULARITY}} + +{{KW|_glGet}} with argument {{KW|_GL_POINT_SIZE}} + +{{KW|_glGet}} with argument {{KW|_GL_POINT_SIZE_MIN}} + +{{KW|_glGet}} with argument {{KW|_GL_POINT_SIZE_MAX}} + +{{KW|_glGet}} with argument {{KW|_GL_POINT_FADE_THRESHOLD_SIZE}} + +{{KW|_glIsEnabled}} with argument {{KW|_GL_PROGRAM_POINT_SIZE}} + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glEnable|(GL_PROGRAM_POINT_SIZE)}}, {{KW|_glPointParameter}} + + +{{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/]. + diff --git a/internal/help/_glPolygonMode.txt b/internal/help/_glPolygonMode.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glPolygonMode.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glPolygonMode__0010000001000.txt b/internal/help/_glPolygonMode__0010000001000.txt new file mode 100644 index 000000000..bc3cc4ec0 --- /dev/null +++ b/internal/help/_glPolygonMode__0010000001000.txt @@ -0,0 +1,59 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:21:53}} +'''_glPolygonMode:''' select a polygon rasterization mode + + +{{PageSyntax}} + + SUB _glPolygonMode (BYVAL face AS _UNSIGNED LONG, BYVAL mode AS _UNSIGNED LONG) + void '''_glPolygonMode'''(GLenum {{Parameter|face}}, GLenum {{Parameter|mode}}); + + +; face +: Specifies the polygons that {{Parameter|mode}} applies to. Must be {{KW|_GL_FRONT_AND_BACK}} for front- and back-facing polygons. +; mode +: Specifies how polygons will be rasterized. Accepted values are {{KW|_GL_POINT}}, {{KW|_GL_LINE}}, and {{KW|_GL_FILL}}. The initial value is {{KW|_GL_FILL}} for both front- and back-facing polygons. + + +{{PageDescription}} + +'''_glPolygonMode''' controls the interpretation of polygons for rasterization. {{Parameter|face}} describes which polygons {{Parameter|mode}} applies to: both front and back-facing polygons ({{KW|_GL_FRONT_AND_BACK}}). The polygon mode affects only the final rasterization of polygons. In particular, a polygon's vertices are lit and the polygon is clipped and possibly culled before these modes are applied. + +Three modes are defined and can be specified in {{Parameter|mode}}: + +; {{KW|_GL_POINT}} +: Polygon vertices that are marked as the start of a boundary edge are drawn as points. Point attributes such as {{KW|_GL_POINT_SIZE}} and {{KW|_GL_POINT_SMOOTH}} control the rasterization of the points. Polygon rasterization attributes other than {{KW|_GL_POLYGON_MODE}} have no effect. +; {{KW|_GL_LINE}} +: Boundary edges of the polygon are drawn as line segments. Line attributes such as {{KW|_GL_LINE_WIDTH}} and {{KW|_GL_LINE_SMOOTH}} control the rasterization of the lines. Polygon rasterization attributes other than {{KW|_GL_POLYGON_MODE}} have no effect. +; {{KW|_GL_FILL}} +: The interior of the polygon is filled. Polygon attributes such as {{KW|_GL_POLYGON_SMOOTH}} control the rasterization of the polygon. +== Examples == + +To draw a surface with outlined polygons, call {{InlineCode}}glPolygonMode(, ){{InlineCodeEnd}} + + +{{PageNotes}} + +Vertices are marked as boundary or nonboundary with an edge flag. Edge flags are generated internally by the GL when it decomposes triangle stips and fans. + + +{{PageErrors}} + +{{KW|_GL_INVALID_ENUM}} is generated if either {{Parameter|face}} or {{Parameter|mode}} is not an accepted value. + + +{{PageUseWith}} + +{{KW|_glGet}} with argument {{KW|_GL_POLYGON_MODE}} + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glLineWidth}}, {{KW|_glPointSize}} + + +{{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/]. + diff --git a/internal/help/_glPolygonOffset.txt b/internal/help/_glPolygonOffset.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glPolygonOffset.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glPolygonOffset__001000000100000.txt b/internal/help/_glPolygonOffset__001000000100000.txt new file mode 100644 index 000000000..6a5e657e5 --- /dev/null +++ b/internal/help/_glPolygonOffset__001000000100000.txt @@ -0,0 +1,41 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:21:54}} +'''_glPolygonOffset:''' set the scale and units used to calculate depth values + + +{{PageSyntax}} + + SUB _glPolygonOffset (BYVAL factor AS SINGLE, BYVAL units AS SINGLE) + void '''_glPolygonOffset'''(GLfloat {{Parameter|factor}}, GLfloat {{Parameter|units}}); + + +; factor +: Specifies a scale factor that is used to create a variable depth offset for each polygon. The initial value is 0. +; units +: Is multiplied by an implementation-specific value to create a constant depth offset. The initial value is 0. + + +{{PageDescription}} + +When {{KW|_GL_POLYGON_OFFSET_FILL}}, {{KW|_GL_POLYGON_OFFSET_LINE}}, or {{KW|_GL_POLYGON_OFFSET_POINT}} is enabled, each fragment's ''depth'' value will be offset after it is interpolated from the ''depth'' values of the appropriate vertices. The value of the offset is ''factor'' * ''DZ'' + ''r'' * ''units'', where ''DZ'' is a measurement of the change in depth relative to the screen area of the polygon, and ''r'' is the smallest value that is guaranteed to produce a resolvable offset for a given implementation. The offset is added before the depth test is performed and before the value is written into the depth buffer. + +'''_glPolygonOffset''' is useful for rendering hidden-line images, for applying decals to surfaces, and for rendering solids with highlighted edges. + + +{{PageUseWith}} + +{{KW|_glIsEnabled}} with argument {{KW|_GL_POLYGON_OFFSET_FILL}}, {{KW|_GL_POLYGON_OFFSET_LINE}}, or {{KW|_GL_POLYGON_OFFSET_POINT}}. + +{{KW|_glGet}} with argument {{KW|_GL_POLYGON_OFFSET_FACTOR}} or {{KW|_GL_POLYGON_OFFSET_UNITS}}. + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glDepthFunc}}, {{KW|_glEnable}} + + +{{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/]. + diff --git a/internal/help/_glPolygonStipple.txt b/internal/help/_glPolygonStipple.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glPolygonStipple.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glPopAttrib.txt b/internal/help/_glPopAttrib.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glPopAttrib.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glPopClientAttrib.txt b/internal/help/_glPopClientAttrib.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glPopClientAttrib.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glPopMatrix.txt b/internal/help/_glPopMatrix.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glPopMatrix.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glPopName.txt b/internal/help/_glPopName.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glPopName.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glPrioritizeTextures.txt b/internal/help/_glPrioritizeTextures.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glPrioritizeTextures.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glPushAttrib.txt b/internal/help/_glPushAttrib.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glPushAttrib.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glPushClientAttrib.txt b/internal/help/_glPushClientAttrib.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glPushClientAttrib.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glPushMatrix.txt b/internal/help/_glPushMatrix.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glPushMatrix.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glPushName.txt b/internal/help/_glPushName.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glPushName.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRasterPos2d.txt b/internal/help/_glRasterPos2d.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRasterPos2d.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRasterPos2dv.txt b/internal/help/_glRasterPos2dv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRasterPos2dv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRasterPos2f.txt b/internal/help/_glRasterPos2f.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRasterPos2f.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRasterPos2fv.txt b/internal/help/_glRasterPos2fv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRasterPos2fv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRasterPos2i.txt b/internal/help/_glRasterPos2i.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRasterPos2i.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRasterPos2iv.txt b/internal/help/_glRasterPos2iv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRasterPos2iv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRasterPos2s.txt b/internal/help/_glRasterPos2s.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRasterPos2s.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRasterPos2sv.txt b/internal/help/_glRasterPos2sv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRasterPos2sv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRasterPos3d.txt b/internal/help/_glRasterPos3d.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRasterPos3d.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRasterPos3dv.txt b/internal/help/_glRasterPos3dv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRasterPos3dv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRasterPos3f.txt b/internal/help/_glRasterPos3f.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRasterPos3f.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRasterPos3fv.txt b/internal/help/_glRasterPos3fv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRasterPos3fv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRasterPos3i.txt b/internal/help/_glRasterPos3i.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRasterPos3i.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRasterPos3iv.txt b/internal/help/_glRasterPos3iv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRasterPos3iv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRasterPos3s.txt b/internal/help/_glRasterPos3s.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRasterPos3s.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRasterPos3sv.txt b/internal/help/_glRasterPos3sv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRasterPos3sv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRasterPos4d.txt b/internal/help/_glRasterPos4d.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRasterPos4d.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRasterPos4dv.txt b/internal/help/_glRasterPos4dv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRasterPos4dv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRasterPos4f.txt b/internal/help/_glRasterPos4f.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRasterPos4f.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRasterPos4fv.txt b/internal/help/_glRasterPos4fv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRasterPos4fv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRasterPos4i.txt b/internal/help/_glRasterPos4i.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRasterPos4i.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRasterPos4iv.txt b/internal/help/_glRasterPos4iv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRasterPos4iv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRasterPos4s.txt b/internal/help/_glRasterPos4s.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRasterPos4s.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRasterPos4sv.txt b/internal/help/_glRasterPos4sv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRasterPos4sv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glReadBuffer.txt b/internal/help/_glReadBuffer.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glReadBuffer.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glReadBuffer__001000100000.txt b/internal/help/_glReadBuffer__001000100000.txt new file mode 100644 index 000000000..b42d794ef --- /dev/null +++ b/internal/help/_glReadBuffer__001000100000.txt @@ -0,0 +1,50 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:22:38}} +'''_glReadBuffer:''' select a color buffer source for pixel read operations from the current read framebuffer. + + +{{PageSyntax}} + + SUB _glReadBuffer (BYVAL mode AS _UNSIGNED LONG) + void '''_glReadBuffer'''(GLenum {{Parameter|mode}}); + + +; mode +: Specifies a color buffer. Accepted values are {{KW|_GL_FRONT_LEFT}}, {{KW|_GL_FRONT_RIGHT}}, {{KW|_GL_BACK_LEFT}}, {{KW|_GL_BACK_RIGHT}}, {{KW|_GL_FRONT}}, {{KW|_GL_BACK}}, {{KW|_GL_LEFT}}, {{KW|_GL_RIGHT}}, and the constants {{KW|_GL_COLOR_ATTACHMENT''i''}}. + + +{{PageDescription}} + +'''_glReadBuffer''' specifies which color buffer within the current bound {{KW|_GL_READ_FRAMEBUFFER}} will be used as the source for pixel reading commands. These commands include: {{KW|_glBlitFramebuffer}}, {{KW|_glReadPixels}}, {{KW|_glCopyTexImage1D}}, {{KW|_glCopyTexImage2D}}, {{KW|_glCopyTexSubImage1D}}, {{KW|_glCopyTexSubImage2D}}, and {{KW|_glCopyTexSubImage3D}}. + +{{Parameter|mode}} accepts one of twelve or more predefined values. If the [[default framebuffer]] (the zero [[framebuffer object]])is bound to {{KW|_GL_READ_FRAMEBUFFER}}, then the following enumerators can be used: {{KW|_GL_FRONT}}, {{KW|_GL_LEFT}}, and {{KW|_GL_FRONT_LEFT}} all name the front left buffer, {{KW|_GL_FRONT_RIGHT}} and {{KW|_GL_RIGHT}} name the front right buffer, and {{KW|_GL_BACK_LEFT}} and {{KW|_GL_BACK}} name the back left buffer. Nonstereo double-buffered configurations have only a front left and a back left buffer. Single-buffered configurations have a front left and a front right buffer if stereo, and only a front left buffer if nonstereo. + +If a non-zero framebuffer object is bound, then the constants {{KW|_GL_COLOR_ATTACHMENT''i''}} may be used to indicate the ''i''th color attachment, where ''i'' ranges from zero to the value of {{KW|_GL_MAX_COLOR_ATTACHMENTS}} minus one. + +It is an error to specify a nonexistent buffer to '''_glReadBuffer'''. + +For the default framebuffer, {{Parameter|mode}} is initially {{KW|_GL_FRONT}} in single-buffered configurations and {{KW|_GL_BACK}} in double-buffered configurations. For framebuffer objects, the default read buffer is {{KW|_GL_COLOR_ATTACHMENT0}}. + + +{{PageErrors}} + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|mode}} is not one of the twelve (or more) accepted values. + +{{KW|_GL_INVALID_OPERATION}} is generated if {{Parameter|mode}} specifies a buffer that does not exist. + + +{{PageUseWith}} + +{{KW|_glGet}} with argument {{KW|_GL_READ_BUFFER}} + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glBindFramebuffer}}, {{KW|_glDrawBuffer}}, {{KW|_glDrawBuffers}}, {{KW|_glReadPixels}} + + +{{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/]. + diff --git a/internal/help/_glReadPixels.txt b/internal/help/_glReadPixels.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glReadPixels.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glReadPixels__001000100000.txt b/internal/help/_glReadPixels__001000100000.txt new file mode 100644 index 000000000..6ed756fe1 --- /dev/null +++ b/internal/help/_glReadPixels__001000100000.txt @@ -0,0 +1,204 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:22:39}} +'''_glReadPixels:''' read a block of pixels from the frame buffer + + +{{PageSyntax}} + + SUB _glReadPixels (BYVAL x AS LONG, BYVAL y AS LONG, BYVAL width AS LONG, BYVAL height AS LONG, BYVAL format AS _UNSIGNED LONG, BYVAL type AS _UNSIGNED LONG, pixels AS _OFFSET) + void '''_glReadPixels'''(GLint {{Parameter|x}}, GLint {{Parameter|y}}, GLsizei {{Parameter|width}}, GLsizei {{Parameter|height}}, GLenum {{Parameter|format}}, GLenum {{Parameter|type}}, GLvoid * {{Parameter|data}}); + + +; x, y +: Specify the window coordinates of the first pixel that is read from the frame buffer. This location is the lower left corner of a rectangular block of pixels. +; width, height +: Specify the dimensions of the pixel rectangle. {{Parameter|width}} and {{Parameter|height}} of one correspond to a single pixel. +{{Template:Glapi pixeltransferupparams|read=|}} + + +{{PageDescription}} + +'''_glReadPixels''' returns pixel data from the frame buffer, starting with the pixel whose lower left corner is at location ({{Parameter|x}}, {{Parameter|y}}), into client memory starting at location {{Parameter|data}}. Several parameters control the processing of the pixel data before it is placed into client memory. These parameters are set with {{KW|_glPixelStore}}. This reference page describes the effects on '''_glReadPixels''' of most, but not all of the parameters specified by these three commands. + +If a non-zero named buffer object is bound to the {{KW|_GL_PIXEL_PACK_BUFFER}} target (see {{KW|_glBindBuffer}}) while a block of pixels is requested, {{Parameter|data}} is treated as a byte offset into the buffer object's data store rather than a pointer to client memory. + +'''_glReadPixels''' returns values from each pixel with lower left corner at (''x'' + ''i'', ''y'' + ''j'') for 0 <= ''i'' < ''width'' and 0 <= ''j'' < ''height''. This pixel is said to be the ''i''th pixel in the ''j''th row. Pixels are returned in row order from the lowest to the highest row, left to right in each row. + +{{Parameter|format}} specifies the format for the returned pixel values; accepted values are: + +; {{KW|_GL_STENCIL_INDEX}} +: Stencil values are read from the stencil buffer. Each index is converted to fixed point, shifted left or right depending on the value and sign of {{KW|_GL_INDEX_SHIFT}}, and added to {{KW|_GL_INDEX_OFFSET}}. If {{KW|_GL_MAP_STENCIL}} is {{KW|_GL_TRUE}}, indices are replaced by their mappings in the table {{KW|_GL_PIXEL_MAP_S_TO_S}}. +; {{KW|_GL_DEPTH_COMPONENT}} +: Depth values are read from the depth buffer. Each component is converted to floating point such that the minimum depth value maps to 0 and the maximum value maps to 1. Each component is then multiplied by {{KW|_GL_DEPTH_SCALE}}, added to {{KW|_GL_DEPTH_BIAS}}, and finally clamped to the range [0, 1]. +; {{KW|_GL_DEPTH_STENCIL}} +: Values are taken from both the depth and stencil buffers. The {{Parameter|type}} parameter must be {{KW|_GL_UNSIGNED_INT_24_8}} or {{KW|_GL_FLOAT_32_UNSIGNED_INT_24_8_REV}}. +; {{KW|_GL_RED}} +; {{KW|_GL_GREEN}} +; {{KW|_GL_BLUE}} +; {{KW|_GL_RGB}} +; {{KW|_GL_BGR}} +; {{KW|_GL_RGBA}} +; {{KW|_GL_BGRA}} +: Finally, the indices or components are converted to the proper format, as specified by {{Parameter|type}}. If {{Parameter|format}} is {{KW|_GL_STENCIL_INDEX}} and {{Parameter|type}} is not {{KW|_GL_FLOAT}}, each index is masked with the mask value given in the following table. If {{Parameter|type}} is {{KW|_GL_FLOAT}}, then each integer index is converted to single-precision floating-point format. + +If {{Parameter|format}} is {{KW|_GL_RED}}, {{KW|_GL_GREEN}}, {{KW|_GL_BLUE}}, {{KW|_GL_RGB}}, {{KW|_GL_BGR}}, {{KW|_GL_RGBA}}, or {{KW|_GL_BGRA}} and {{Parameter|type}} is not {{KW|_GL_FLOAT}}, each component is multiplied by the multiplier shown in the following table. If type is {{KW|_GL_FLOAT}}, then each component is passed as is (or converted to the client's single-precision floating-point format if it is different from the one used by the GL). + +{| class="wikitable" +|+ +! {{Parameter|type}} +! '''Index Mask''' +! '''Component Conversion''' +|+ +| {{KW|_GL_UNSIGNED_BYTE}} +| 28 - 1 +| (2^8 - 1)c +|+ +| {{KW|_GL_BYTE}} +| 27 - 1 +| \tfrac{(2^8 - 1)c - 1}{2} +|+ +| {{KW|_GL_UNSIGNED_SHORT}} +| 216 - 1 +| (2^{16} - 1)c +|+ +| {{KW|_GL_SHORT}} +| 215 - 1 +| \tfrac{(2^{16} - 1)c - 1}{2} +|+ +| {{KW|_GL_UNSIGNED_INT}} +| 232 - 1 +| (2^{32} - 1)c +|+ +| {{KW|_GL_INT}} +| 231 - 1 +| \tfrac{(2^{32} - 1)c - 1}{2} +|+ +| {{KW|_GL_HALF_FLOAT}} +| none +| ''c'' +|+ +| {{KW|_GL_FLOAT}} +| none +| ''c'' +|+ +| {{KW|_GL_UNSIGNED_BYTE_3_3_2}} +| 2N - 1 +| (2^N - 1)c +|+ +| {{KW|_GL_UNSIGNED_BYTE_2_3_3_REV}} +| 2N - 1 +| (2^N - 1)c +|+ +| {{KW|_GL_UNSIGNED_SHORT_5_6_5}} +| 2N - 1 +| (2^N - 1)c +|+ +| {{KW|_GL_UNSIGNED_SHORT_5_6_5_REV}} +| 2N - 1 +| (2^N - 1)c +|+ +| {{KW|_GL_UNSIGNED_SHORT_4_4_4_4}} +| 2N - 1 +| (2^N - 1)c +|+ +| {{KW|_GL_UNSIGNED_SHORT_4_4_4_4_REV}} +| 2N - 1 +| (2^N - 1)c +|+ +| {{KW|_GL_UNSIGNED_SHORT_5_5_5_1}} +| 2N - 1 +| (2^N - 1)c +|+ +| {{KW|_GL_UNSIGNED_SHORT_1_5_5_5_REV}} +| 2N - 1 +| (2^N - 1)c +|+ +| {{KW|_GL_UNSIGNED_INT_8_8_8_8}} +| 2N - 1 +| (2^N - 1)c +|+ +| {{KW|_GL_UNSIGNED_INT_8_8_8_8_REV}} +| 2N - 1 +| (2^N - 1)c +|+ +| {{KW|_GL_UNSIGNED_INT_10_10_10_2}} +| 2N - 1 +| (2^N - 1)c +|+ +| {{KW|_GL_UNSIGNED_INT_2_10_10_10_REV}} +| 2N - 1 +| (2^N - 1)c +|+ +| {{KW|_GL_UNSIGNED_INT_24_8}} +| 2N - 1 +| (2^N - 1)c +|+ +| {{KW|_GL_UNSIGNED_INT_10F_11F_11F_REV}} +| -- +| Special +|+ +| {{KW|_GL_UNSIGNED_INT_5_9_9_9_REV}} +| -- +| Special +|+ +| {{KW|_GL_FLOAT_32_UNSIGNED_INT_24_8_REV}} +| none +| ''c'' (Depth Only) +|} + +Return values are placed in memory as follows. If {{Parameter|format}} is {{KW|_GL_STENCIL_INDEX}}, {{KW|_GL_DEPTH_COMPONENT}}, {{KW|_GL_RED}}, {{KW|_GL_GREEN}}, or {{KW|_GL_BLUE}}, a single value is returned and the data for the ''i''th pixel in the ''j''th row is placed in location ''j'' * ''width'' + ''i''. {{KW|_GL_RGB}} and {{KW|_GL_BGR}} return three values, {{KW|_GL_RGBA}} and {{KW|_GL_BGRA}} return four values for each pixel, with all values corresponding to a single pixel occupying contiguous space in {{Parameter|data}}. Storage parameters set by {{KW|_glPixelStore}}, such as {{KW|_GL_PACK_LSB_FIRST}} and {{KW|_GL_PACK_SWAP_BYTES}}, affect the way that data is written into memory. See {{KW|_glPixelStore}} for a description. + + +{{PageNotes}} + +Values for pixels that lie outside the window connected to the current GL context are undefined. + +If an error is generated, no change is made to the contents of {{Parameter|data}}. + + +{{PageErrors}} + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|format}} or {{Parameter|type}} is not an accepted value. + +{{KW|_GL_INVALID_VALUE}} is generated if either {{Parameter|width}} or {{Parameter|height}} is negative. + +{{KW|_GL_INVALID_OPERATION}} is generated if {{Parameter|format}} is {{KW|_GL_STENCIL_INDEX}} and there is no stencil buffer. + +{{KW|_GL_INVALID_OPERATION}} is generated if {{Parameter|format}} is {{KW|_GL_DEPTH_COMPONENT}} and there is no depth buffer. + +{{KW|_GL_INVALID_OPERATION}} is generated if {{Parameter|format}} is {{KW|_GL_DEPTH_STENCIL}} and there is no depth buffer or if there is no stencil buffer. + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|format}} is {{KW|_GL_DEPTH_STENCIL}} and {{Parameter|type}} is not {{KW|_GL_UNSIGNED_INT_24_8}} or {{KW|_GL_FLOAT_32_UNSIGNED_INT_24_8_REV}}. + +{{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}}, or {{KW|_GL_UNSIGNED_SHORT_5_6_5_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}}, or {{KW|_GL_UNSIGNED_INT_2_10_10_10_REV}} and {{Parameter|format}} is neither {{KW|_GL_RGBA}} nor {{KW|_GL_BGRA}}. + +{{KW|_GL_INVALID_OPERATION}} is generated if a non-zero buffer object name is bound to the {{KW|_GL_PIXEL_PACK_BUFFER}} target and the buffer object's data store is currently mapped. + +{{KW|_GL_INVALID_OPERATION}} is generated if a non-zero buffer object name is bound to the {{KW|_GL_PIXEL_PACK_BUFFER}} target and the data would be packed to the buffer object such that the memory writes required would exceed the data store size. + +{{KW|_GL_INVALID_OPERATION}} is generated if a non-zero buffer object name is bound to the {{KW|_GL_PIXEL_PACK_BUFFER}} target and {{Parameter|data}} is not evenly divisible into the number of bytes needed to store in memory a datum indicated by {{Parameter|type}}. + +{{KW|_GL_INVALID_OPERATION}} is generated if {{KW|_GL_READ_FRAMEBUFFER_BINDING}} is non-zero, the read framebuffer is complete, and the value of {{KW|_GL_SAMPLE_BUFFERS}} for the read framebuffer is greater than zero. + + +{{PageUseWith}} + +{{KW|_glGet}} with argument {{KW|_GL_INDEX_MODE}} + +{{KW|_glGet}} with argument {{KW|_GL_PIXEL_PACK_BUFFER_BINDING}} + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glBindFramebuffer}}, {{KW|_glClampColor}}, {{KW|_glDrawBuffers}}, {{KW|_glDrawBuffers}}, {{KW|_glPixelStore}} + +[[Pixel Transfer]], [[Pixel Buffer Object]] + + +{{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/]. + diff --git a/internal/help/_glRectd.txt b/internal/help/_glRectd.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRectd.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRectdv.txt b/internal/help/_glRectdv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRectdv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRectf.txt b/internal/help/_glRectf.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRectf.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRectfv.txt b/internal/help/_glRectfv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRectfv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRecti.txt b/internal/help/_glRecti.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRecti.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRectiv.txt b/internal/help/_glRectiv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRectiv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRects.txt b/internal/help/_glRects.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRects.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRectsv.txt b/internal/help/_glRectsv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRectsv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRenderMode.txt b/internal/help/_glRenderMode.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRenderMode.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRotated.txt b/internal/help/_glRotated.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRotated.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glRotatef.txt b/internal/help/_glRotatef.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glRotatef.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glScaled.txt b/internal/help/_glScaled.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glScaled.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glScalef.txt b/internal/help/_glScalef.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glScalef.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glScissor.txt b/internal/help/_glScissor.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glScissor.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glScissor__001000000.txt b/internal/help/_glScissor__001000000.txt new file mode 100644 index 000000000..397afc469 --- /dev/null +++ b/internal/help/_glScissor__001000000.txt @@ -0,0 +1,47 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:22:58}} +{{DISPLAYTITLE:_glScissor}} +This will define the scissor box. + + +{{PageSyntax}} +; QB64: SUB [[_glScissor]] (BYVAL {{Parameter|x}} AS LONG, BYVAL {{Parameter|y}} AS LONG, BYVAL {{Parameter|width}} AS LONG, BYVAL {{Parameter|height}}) AS LONG) +; C/C++: void [[_glScissor]](GLint {{Parameter|x}}, GLint {{Parameter|y}}, GLsizei {{Parameter|width}}, GLsizei {{Parameter|height}}); + + +{{PageParameters}} +* {{Parameter|x}}, {{Parameter|y}} Specify the lower left corner of the scissor box. Initially (0, 0). +* {{Parameter|width}}, {{Parameter|height}} Specify the width and height of the scissor box. When a GL context is first attached to a window, {{Parameter|width}} and {{Parameter|height}} are set to the dimensions of that window. + + +{{PageDescription}} + +'''_glScissor''' defines a rectangle, called the scissor box, in window coordinates. The first two arguments, {{Parameter|x}} and {{Parameter|y}}, specify the lower left corner of the box. {{Parameter|width}} and {{Parameter|height}} specify the width and height of the box. + +To enable and disable the scissor test, call {{KW|_glEnable}} and {{KW|_glDisable}} with argument {{KW|_GL_SCISSOR_TEST}}. The test is initially disabled. While the test is enabled, only pixels that lie within the scissor box can be modified by drawing commands. Window coordinates have integer values at the shared corners of frame buffer pixels. {{InlineCode}}_glScissor(0,0,1,1){{InlineCodeEnd}} allows modification of only the lower left pixel in the window, and {{InlineCode}}_glScissor(0,0,0,0){{InlineCodeEnd}} doesn't allow modification of any pixels in the window. + +When the scissor test is disabled, it is as though the scissor box includes the entire window. + + +{{PageErrors}} +* {{KW|_GL_INVALID_VALUE}} is generated if either {{Parameter|width}} or {{Parameter|height}} is negative. + + +{{PageUseWith}} +* {{KW|_glGet}} with argument {{KW|_GL_SCISSOR_BOX}} +* {{KW|_glIsEnabled}} with argument {{KW|_GL_SCISSOR_TEST}} + + +{{PageSeeAlso}} +* [[_GL|SUB _GL]] +* {{KW|_glEnable|(GL_SCISSOR_TEST)}} +* {{KW|_glScissorArray}} +* {{KW|_glScissorIndexed}} +* {{KW|_glViewport}} + + +{{PageCopyright}} + + +{{PageNavigation}} + diff --git a/internal/help/_glSelectBuffer.txt b/internal/help/_glSelectBuffer.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glSelectBuffer.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glShadeModel.txt b/internal/help/_glShadeModel.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glShadeModel.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glStencilFunc.txt b/internal/help/_glStencilFunc.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glStencilFunc.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glStencilFunc__0010000001000.txt b/internal/help/_glStencilFunc__0010000001000.txt new file mode 100644 index 000000000..e07e4d70f --- /dev/null +++ b/internal/help/_glStencilFunc__0010000001000.txt @@ -0,0 +1,80 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:23:02}} +'''_glStencilFunc:''' set front and back function and reference value for stencil testing + + +{{PageSyntax}} + + SUB _glStencilFunc (BYVAL func AS _UNSIGNED LONG, BYVAL ref AS LONG, BYVAL mask AS _UNSIGNED LONG) + void '''_glStencilFunc'''(GLenum {{Parameter|func}}, GLint {{Parameter|ref}}, GLuint {{Parameter|mask}}); + + +; func +: Specifies the test function. Eight symbolic constants are valid: {{KW|_GL_NEVER}}, {{KW|_GL_LESS}}, {{KW|_GL_LEQUAL}}, {{KW|_GL_GREATER}}, {{KW|_GL_GEQUAL}}, {{KW|_GL_EQUAL}}, {{KW|_GL_NOTEQUAL}}, and {{KW|_GL_ALWAYS}}. The initial value is {{KW|_GL_ALWAYS}}. +; ref +: Specifies the reference value for the stencil test. {{Parameter|ref}} is clamped to the range [0, 2n - 1, where ''n'' is the number of bitplanes in the stencil buffer. The initial value is 0. +; mask +: Specifies a mask that is ANDed with both the reference value and the stored stencil value when the test is done. The initial value is all 1's. + + +{{PageDescription}} + +Stenciling, like depth-buffering, enables and disables drawing on a per-pixel basis. Stencil planes are first drawn into using GL drawing primitives, then geometry and images are rendered using the stencil planes to mask out portions of the screen. Stenciling is typically used in multipass rendering algorithms to achieve special effects, such as decals, outlining, and constructive solid geometry rendering. + +The stencil test conditionally eliminates a pixel based on the outcome of a comparison between the reference value and the value in the stencil buffer. To enable and disable the test, call {{KW|_glEnable}} and {{KW|_glDisable}} with argument {{KW|_GL_STENCIL_TEST}}. To specify actions based on the outcome of the stencil test, call {{KW|_glStencilOp}} or {{KW|_glStencilOpSeparate}}. + +There can be two separate sets of {{Parameter|func}}, {{Parameter|ref}}, and {{Parameter|mask}} parameters; one affects back-facing polygons, and the other affects front-facing polygons as well as other non-polygon primitives. {{KW|_glStencilFunc}} sets both front and back stencil state to the same values. Use {{KW|_glStencilFuncSeparate}} to set front and back stencil state to different values. + +{{Parameter|func}} is a symbolic constant that determines the stencil comparison function. It accepts one of eight values, shown in the following list. {{Parameter|ref}} is an integer reference value that is used in the stencil comparison. It is clamped to the range [0, 2n - 1], where ''n'' is the number of bitplanes in the stencil buffer. {{Parameter|mask}} is bitwise ANDed with both the reference value and the stored stencil value, with the ANDed values participating in the comparison. + +If ''stencil'' represents the value stored in the corresponding stencil buffer location, the following list shows the effect of each comparison function that can be specified by {{Parameter|func}}. Only if the comparison succeeds is the pixel passed through to the next stage in the rasterization process (see {{KW|_glStencilOp}}). All tests treat ''stencil'' values as unsigned integers in the range [0, 2n - 1], where ''n'' is the number of bitplanes in the stencil buffer. + +The following values are accepted by {{Parameter|func}}: + +; {{KW|_GL_NEVER}} +: Always fails. +; {{KW|_GL_LESS}} +: Passes if ( {{Parameter|ref}} & {{Parameter|mask}} ) < ( ''stencil'' & {{Parameter|mask}} ). +; {{KW|_GL_LEQUAL}} +: Passes if ( {{Parameter|ref}} & {{Parameter|mask}} ) <= ( ''stencil'' & {{Parameter|mask}} ). +; {{KW|_GL_GREATER}} +: Passes if ( {{Parameter|ref}} & {{Parameter|mask}} ) > ( ''stencil'' & {{Parameter|mask}} ). +; {{KW|_GL_GEQUAL}} +: Passes if ( {{Parameter|ref}} & {{Parameter|mask}} ) >= ( ''stencil'' & {{Parameter|mask}} ). +; {{KW|_GL_EQUAL}} +: Passes if ( {{Parameter|ref}} & {{Parameter|mask}} ) = ( ''stencil'' & {{Parameter|mask}} ). +; {{KW|_GL_NOTEQUAL}} +: Passes if ( {{Parameter|ref}} & {{Parameter|mask}} ) != ( ''stencil'' & {{Parameter|mask}} ). +; {{KW|_GL_ALWAYS}} +: Always passes. + +{{PageNotes}} + +Initially, the stencil test is disabled. If there is no stencil buffer, no stencil modification can occur and it is as if the stencil test always passes. + +{{KW|_glStencilFunc}} is the same as calling {{KW|_glStencilFuncSeparate}} with {{Parameter|face}} set to {{KW|_GL_FRONT_AND_BACK}}. + + +{{PageErrors}} + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|func}} is not one of the eight accepted values. + + +{{PageUseWith}} + +{{KW|_glGet}} with argument {{KW|_GL_STENCIL_FUNC}}, {{KW|_GL_STENCIL_VALUE_MASK}}, {{KW|_GL_STENCIL_REF}}, {{KW|_GL_STENCIL_BACK_FUNC}}, {{KW|_GL_STENCIL_BACK_VALUE_MASK}}, {{KW|_GL_STENCIL_BACK_REF}}, or {{KW|_GL_STENCIL_BITS}} + +{{KW|_glIsEnabled}} with argument {{KW|_GL_STENCIL_TEST}} + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glEnable|(GL_STENCIL_TEST)}}, {{KW|_glLogicOp}}, {{KW|_glStencilFuncSeparate}}, {{KW|_glStencilMask}}, {{KW|_glStencilMaskSeparate}}, {{KW|_glStencilOp}}, {{KW|_glStencilOpSeparate}} + + +{{PageCopyright}} + + +{{PageNavigation}} + diff --git a/internal/help/_glStencilMask.txt b/internal/help/_glStencilMask.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glStencilMask.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glStencilMask__0010000001000.txt b/internal/help/_glStencilMask__0010000001000.txt new file mode 100644 index 000000000..2ff9bc056 --- /dev/null +++ b/internal/help/_glStencilMask__0010000001000.txt @@ -0,0 +1,43 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:23:03}} +'''_glStencilMask:''' control the front and back writing of individual bits in the stencil planes + + +{{PageSyntax}} + + SUB _glStencilMask (BYVAL mask AS _UNSIGNED LONG) + void '''_glStencilMask'''(GLuint {{Parameter|mask}}); + + +; mask +: Specifies a bit mask to enable and disable writing of individual bits in the stencil planes. Initially, the mask is all 1's. + + +{{PageDescription}} + +'''_glStencilMask''' controls the writing of individual bits in the stencil planes. The least significant ''n'' bits of {{Parameter|mask}}, where ''n'' is the number of bits in the stencil buffer, specify a mask. Where a 1 appears in the mask, it's possible to write to the corresponding bit in the stencil buffer. Where a 0 appears, the corresponding bit is write-protected. Initially, all bits are enabled for writing. + +There can be two separate {{Parameter|mask}} writemasks; one affects back-facing polygons, and the other affects front-facing polygons as well as other non-polygon primitives. {{KW|_glStencilMask}} sets both front and back stencil writemasks to the same values. Use {{KW|_glStencilMaskSeparate}} to set front and back stencil writemasks to different values. + + +{{PageNotes}} + +{{KW|_glStencilMask}} is the same as calling {{KW|_glStencilMaskSeparate}} with {{Parameter|face}} set to {{KW|_GL_FRONT_AND_BACK}}. + + +{{PageUseWith}} + +{{KW|_glGet}} with argument {{KW|_GL_STENCIL_WRITEMASK}}, {{KW|_GL_STENCIL_BACK_WRITEMASK}}, or {{KW|_GL_STENCIL_BITS}} + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glClear}}, {{KW|_glClearBuffer}}, {{KW|_glColorMask}}, {{KW|_glDepthMask}}, {{KW|_glStencilFunc}}, {{KW|_glStencilFuncSeparate}}, {{KW|_glStencilMaskSeparate}}, {{KW|_glStencilOp}}, {{KW|_glStencilOpSeparate}} + + +{{PageCopyright}} + + +{{PageNavigation}} + diff --git a/internal/help/_glStencilOp.txt b/internal/help/_glStencilOp.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glStencilOp.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glStencilOp__00100000010.txt b/internal/help/_glStencilOp__00100000010.txt new file mode 100644 index 000000000..031ec33b9 --- /dev/null +++ b/internal/help/_glStencilOp__00100000010.txt @@ -0,0 +1,80 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:23:04}} +'''_glStencilOp:''' set front and back stencil test actions + + +{{PageSyntax}} + + SUB _glStencilOp (BYVAL fail AS _UNSIGNED LONG, BYVAL zfail AS _UNSIGNED LONG, BYVAL zpass AS _UNSIGNED LONG) + void '''_glStencilOp'''(GLenum {{Parameter|sfail}}, GLenum {{Parameter|dpfail}}, GLenum {{Parameter|dppass}}); + + +; sfail +: Specifies the action to take when the stencil test fails. Eight symbolic constants are accepted: {{KW|_GL_KEEP}}, {{KW|_GL_ZERO}}, {{KW|_GL_REPLACE}}, {{KW|_GL_INCR}}, {{KW|_GL_INCR_WRAP}}, {{KW|_GL_DECR}}, {{KW|_GL_DECR_WRAP}}, and {{KW|_GL_INVERT}}. The initial value is {{KW|_GL_KEEP}}. +; dpfail +: Specifies the stencil action when the stencil test passes, but the depth test fails. {{Parameter|dpfail}} accepts the same symbolic constants as {{Parameter|sfail}}. The initial value is {{KW|_GL_KEEP}}. +; dppass +: Specifies the stencil action when both the stencil test and the depth test pass, or when the stencil test passes and either there is no depth buffer or depth testing is not enabled. {{Parameter|dppass}} accepts the same symbolic constants as {{Parameter|sfail}}. The initial value is {{KW|_GL_KEEP}}. + + +{{PageDescription}} + +Stenciling, like depth-buffering, enables and disables drawing on a per-pixel basis. You draw into the stencil planes using GL drawing primitives, then render geometry and images, using the stencil planes to mask out portions of the screen. Stenciling is typically used in multipass rendering algorithms to achieve special effects, such as decals, outlining, and constructive solid geometry rendering. + +The stencil test conditionally eliminates a pixel based on the outcome of a comparison between the value in the stencil buffer and a reference value. To enable and disable the test, call {{KW|_glEnable}} and {{KW|_glDisable}} with argument {{KW|_GL_STENCIL_TEST}}; to control it, call {{KW|_glStencilFunc}} or {{KW|_glStencilFuncSeparate}}. + +There can be two separate sets of {{Parameter|sfail}}, {{Parameter|dpfail}}, and {{Parameter|dppass}} parameters; one affects back-facing polygons, and the other affects front-facing polygons as well as other non-polygon primitives. {{KW|_glStencilOp}} sets both front and back stencil state to the same values. Use {{KW|_glStencilOpSeparate}} to set front and back stencil state to different values. + +'''_glStencilOp''' takes three arguments that indicate what happens to the stored stencil value while stenciling is enabled. If the stencil test fails, no change is made to the pixel's color or depth buffers, and {{Parameter|sfail}} specifies what happens to the stencil buffer contents. The following eight actions are possible. + +; {{KW|_GL_KEEP}} +: Keeps the current value. +; {{KW|_GL_ZERO}} +: Sets the stencil buffer value to 0. +; {{KW|_GL_REPLACE}} +: Sets the stencil buffer value to ''ref'', as specified by {{KW|_glStencilFunc}}. +; {{KW|_GL_INCR}} +: Increments the current stencil buffer value. Clamps to the maximum representable unsigned value. +; {{KW|_GL_INCR_WRAP}} +: Increments the current stencil buffer value. Wraps stencil buffer value to zero when incrementing the maximum representable unsigned value. +; {{KW|_GL_DECR}} +: Decrements the current stencil buffer value. Clamps to 0. +; {{KW|_GL_DECR_WRAP}} +: Decrements the current stencil buffer value. Wraps stencil buffer value to the maximum representable unsigned value when decrementing a stencil buffer value of zero. +; {{KW|_GL_INVERT}} +: Bitwise inverts the current stencil buffer value. +Stencil buffer values are treated as unsigned integers. When incremented and decremented, values are clamped to 0 and 2n - 1, where ''n'' is the value returned by querying {{KW|_GL_STENCIL_BITS}}. + +The other two arguments to '''_glStencilOp''' specify stencil buffer actions that depend on whether subsequent depth buffer tests succeed ({{Parameter|dppass}}) or fail ({{Parameter|dpfail}}) (see {{KW|_glDepthFunc}}). The actions are specified using the same eight symbolic constants as {{Parameter|sfail}}. Note that {{Parameter|dpfail}} is ignored when there is no depth buffer, or when the depth buffer is not enabled. In these cases, {{Parameter|sfail}} and {{Parameter|dppass}} specify stencil action when the stencil test fails and passes, respectively. + + +{{PageNotes}} + +Initially the stencil test is disabled. If there is no stencil buffer, no stencil modification can occur and it is as if the stencil tests always pass, regardless of any call to '''_glStencilOp'''. + +{{KW|_glStencilOp}} is the same as calling {{KW|_glStencilOpSeparate}} with {{Parameter|face}} set to {{KW|_GL_FRONT_AND_BACK}}. + + +{{PageErrors}} + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|sfail}}, {{Parameter|dpfail}}, or {{Parameter|dppass}} is any value other than the defined constant values. + + +{{PageUseWith}} + +{{KW|_glGet}} with argument {{KW|_GL_STENCIL_FAIL}}, {{KW|_GL_STENCIL_PASS_DEPTH_PASS}}, {{KW|_GL_STENCIL_PASS_DEPTH_FAIL}}, {{KW|_GL_STENCIL_BACK_FAIL}}, {{KW|_GL_STENCIL_BACK_PASS_DEPTH_PASS}}, {{KW|_GL_STENCIL_BACK_PASS_DEPTH_FAIL}}, or {{KW|_GL_STENCIL_BITS}} + +{{KW|_glIsEnabled}} with argument {{KW|_GL_STENCIL_TEST}} + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glBlendFunc}}, {{KW|_glDepthFunc}}, {{KW|_glEnable}}, {{KW|_glLogicOp}}, {{KW|_glStencilFunc}}, {{KW|_glStencilFuncSeparate}}, {{KW|_glStencilMask}}, {{KW|_glStencilMaskSeparate}}, {{KW|_glStencilOpSeparate}} + + +{{PageCopyright}} + + +{{PageNavigation}} + diff --git a/internal/help/_glTexCoord1d.txt b/internal/help/_glTexCoord1d.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord1d.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord1dv.txt b/internal/help/_glTexCoord1dv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord1dv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord1f.txt b/internal/help/_glTexCoord1f.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord1f.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord1fv.txt b/internal/help/_glTexCoord1fv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord1fv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord1i.txt b/internal/help/_glTexCoord1i.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord1i.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord1iv.txt b/internal/help/_glTexCoord1iv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord1iv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord1s.txt b/internal/help/_glTexCoord1s.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord1s.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord1sv.txt b/internal/help/_glTexCoord1sv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord1sv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord2d.txt b/internal/help/_glTexCoord2d.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord2d.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord2dv.txt b/internal/help/_glTexCoord2dv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord2dv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord2f.txt b/internal/help/_glTexCoord2f.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord2f.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord2fv.txt b/internal/help/_glTexCoord2fv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord2fv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord2i.txt b/internal/help/_glTexCoord2i.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord2i.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord2iv.txt b/internal/help/_glTexCoord2iv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord2iv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord2s.txt b/internal/help/_glTexCoord2s.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord2s.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord2sv.txt b/internal/help/_glTexCoord2sv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord2sv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord3d.txt b/internal/help/_glTexCoord3d.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord3d.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord3dv.txt b/internal/help/_glTexCoord3dv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord3dv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord3f.txt b/internal/help/_glTexCoord3f.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord3f.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord3fv.txt b/internal/help/_glTexCoord3fv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord3fv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord3i.txt b/internal/help/_glTexCoord3i.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord3i.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord3iv.txt b/internal/help/_glTexCoord3iv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord3iv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord3s.txt b/internal/help/_glTexCoord3s.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord3s.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord3sv.txt b/internal/help/_glTexCoord3sv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord3sv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord4d.txt b/internal/help/_glTexCoord4d.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord4d.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord4dv.txt b/internal/help/_glTexCoord4dv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord4dv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord4f.txt b/internal/help/_glTexCoord4f.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord4f.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord4fv.txt b/internal/help/_glTexCoord4fv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord4fv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord4i.txt b/internal/help/_glTexCoord4i.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord4i.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord4iv.txt b/internal/help/_glTexCoord4iv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord4iv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord4s.txt b/internal/help/_glTexCoord4s.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord4s.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoord4sv.txt b/internal/help/_glTexCoord4sv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoord4sv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexCoordPointer.txt b/internal/help/_glTexCoordPointer.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexCoordPointer.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexEnvf.txt b/internal/help/_glTexEnvf.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexEnvf.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexEnvfv.txt b/internal/help/_glTexEnvfv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexEnvfv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexEnvi.txt b/internal/help/_glTexEnvi.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexEnvi.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexEnviv.txt b/internal/help/_glTexEnviv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexEnviv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexGend.txt b/internal/help/_glTexGend.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexGend.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexGendv.txt b/internal/help/_glTexGendv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexGendv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexGenf.txt b/internal/help/_glTexGenf.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexGenf.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexGenfv.txt b/internal/help/_glTexGenfv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexGenfv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexGeni.txt b/internal/help/_glTexGeni.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexGeni.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexGeniv.txt b/internal/help/_glTexGeniv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexGeniv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexImage1D.txt b/internal/help/_glTexImage1D.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexImage1D.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexImage1D__001001000011.txt b/internal/help/_glTexImage1D__001001000011.txt new file mode 100644 index 000000000..fa246c220 --- /dev/null +++ b/internal/help/_glTexImage1D__001001000011.txt @@ -0,0 +1,139 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:23:54}} +'''_glTexImage1D:''' specify a one-dimensional texture image + + +{{PageSyntax}} + + SUB _glTexImage1D (BYVAL target AS _UNSIGNED LONG, BYVAL level AS LONG, BYVAL internalformat AS LONG, BYVAL width AS LONG, BYVAL border AS LONG, BYVAL format AS _UNSIGNED LONG, BYVAL type AS _UNSIGNED LONG, pixels AS _OFFSET) + void '''_glTexImage1D'''(GLenum {{Parameter|target}}, GLint {{Parameter|level}}, GLint {{Parameter|internalFormat}}, GLsizei {{Parameter|width}}, GLint {{Parameter|border}}, GLenum {{Parameter|format}}, GLenum {{Parameter|type}}, const GLvoid * {{Parameter|data}}); + + +; target +: Specifies the target texture. Must be {{KW|_GL_TEXTURE_1D}} or {{KW|_GL_PROXY_TEXTURE_1D}}. +; level +: Specifies the level-of-detail number. Level 0 is the base image level. Level ''n'' is the ''n''th mipmap reduction image. +; internalFormat +: Specifies the number of color components in the texture. Must be one of base internal formats given in Table 1, one of the sized internal formats given in Table 2, or one of the compressed internal formats given in Table 3, below. +; width +: Specifies the width of the texture image. All implementations support texture images that are at least 1024 texels wide. The height of the 1D texture image is 1. +; border +: This value must be 0. +{{glapi pixeltransferupparams|}} + + +{{PageDescription}} + +Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled. To enable and disable one-dimensional texturing, call {{KW|_glEnable}} and {{KW|_glDisable}} with argument {{KW|_GL_TEXTURE_1D}}. + +Texture images are defined with '''_glTexImage1D'''. The arguments describe the parameters of the texture image, such as width, width of the border, level-of-detail number (see {{KW|_glTexParameter}}), and the internal resolution and format used to store the image. The last three arguments describe how the image is represented in memory. + +If {{Parameter|target}} is {{KW|_GL_PROXY_TEXTURE_1D}}, no data is read from {{Parameter|data}}, but all of the texture image state is recalculated, checked for consistency, and checked against the implementation's capabilities. If the implementation cannot handle a texture of the requested texture size, it sets all of the image state to 0, but does not generate an error (see {{KW|_glGetError}}). To query for an entire mipmap array, use an image array level greater than or equal to 1. + +If {{Parameter|target}} is {{KW|_GL_TEXTURE_1D}}, data is read from {{Parameter|data}} as a sequence of signed or unsigned bytes, shorts, or longs, or single-precision floating-point values, depending on {{Parameter|type}}. These values are grouped into sets of one, two, three, or four values, depending on {{Parameter|format}}, to form elements. Each data byte is treated as eight 1-bit elements, with bit ordering determined by {{KW|_GL_UNPACK_LSB_FIRST}} (see {{KW|_glPixelStore}}). + +If a non-zero named buffer object is bound to the {{KW|_GL_PIXEL_UNPACK_BUFFER}} target (see {{KW|_glBindBuffer}}) while a texture image is specified, {{Parameter|data}} is treated as a byte offset into the buffer object's data store. + +The first element corresponds to the left end of the texture array. Subsequent elements progress left-to-right through the remaining texels in the texture array. The final element corresponds to the right end of the texture array. + +{{Parameter|format}} determines the composition of each element in {{Parameter|data}}. It can assume one of these symbolic values: + +; {{KW|_GL_RED}} +: Each element is a single red component. The GL converts it to floating point and assembles it into an RGBA element by attaching 0 for green and blue, and 1 for alpha. Each component is then multiplied by the signed scale factor {{KW|_GL_c_SCALE}}, added to the signed bias {{KW|_GL_c_BIAS}}, and clamped to the range [0,1]. +; {{KW|_GL_RG}} +: Each element is a red/green pair. The GL converts it to floating point and assembles it into an RGBA element by attaching 0 for blue, and 1 for alpha. Each component is then multiplied by the signed scale factor {{KW|_GL_c_SCALE}}, added to the signed bias {{KW|_GL_c_BIAS}}, and clamped to the range [0,1]. +; {{KW|_GL_RGB}} or {{KW|_GL_BGR}} +: Each element is an RGB triple. The GL converts it to floating point and assembles it into an RGBA element by attaching 1 for alpha. Each component is then multiplied by the signed scale factor {{KW|_GL_c_SCALE}}, added to the signed bias {{KW|_GL_c_BIAS}}, and clamped to the range [0,1]. +; {{KW|_GL_RGBA}} or {{KW|_GL_BGRA}} +: Each element contains all four components. Each component is multiplied by the signed scale factor {{KW|_GL_c_SCALE}}, added to the signed bias {{KW|_GL_c_BIAS}}, and clamped to the range [0,1]. +; {{KW|_GL_DEPTH_COMPONENT}} +: Each element is a single depth value. The GL converts it to floating point, multiplies by the signed scale factor {{KW|_GL_DEPTH_SCALE}}, adds the signed bias {{KW|_GL_DEPTH_BIAS}}, and clamps to the range [0,1]. +If an application wants to store the texture at a certain resolution or in a certain format, it can request the resolution and format with {{Parameter|internalFormat}}. The GL will choose an internal representation that closely approximates that requested by {{Parameter|internalFormat}}, but it may not match exactly. (The representations specified by {{KW|_GL_RED}}, {{KW|_GL_RG}}, {{KW|_GL_RGB}} and {{KW|_GL_RGBA}} must match exactly.) + +{{Parameter|internalFormat}} may be one of the base internal formats shown in Table 1, below + +{{glapi baseformattable}} + +{{Parameter|internalFormat}} may also be one of the sized internal formats shown in Table 2, below + +{{glapi internalformattable}} + +Finally, {{Parameter|internalFormat}} may also be one of the generic or compressed compressed texture formats shown in Table 3 below + +{{glapi compressedformattable}} + +If the {{Parameter|internalFormat}} parameter is one of the generic compressed formats, {{KW|_GL_COMPRESSED_RED}}, {{KW|_GL_COMPRESSED_RG}}, {{KW|_GL_COMPRESSED_RGB}}, or {{KW|_GL_COMPRESSED_RGBA}}, the GL will replace the internal format with the symbolic constant for a specific internal format and compress the texture before storage. If no corresponding internal format is available, or the GL can not compress that image for any reason, the internal format is instead replaced with a corresponding base internal format. + +If the {{Parameter|internalFormat}} parameter is {{KW|_GL_SRGB}}, {{KW|_GL_SRGB8}}, {{KW|_GL_SRGB_ALPHA}}or {{KW|_GL_SRGB8_ALPHA8}}, the texture is treated as if the red, green, or blue components are encoded in the sRGB color space. Any alpha component is left unchanged. The conversion from the sRGB encoded component cs to a linear component cl is: + +{{glapi srgb equation}} + +Assume cs is the sRGB component in the range [0,1]. + +Use the {{KW|_GL_PROXY_TEXTURE_1D}} target to try out a resolution and format. The implementation will update and recompute its best match for the requested storage resolution and format. To then query this state, call {{KW|_glGetTexLevelParameter}}. If the texture cannot be accommodated, texture state is set to 0. + +A one-component texture image uses only the red component of the RGBA color from {{Parameter|data}}. A two-component image uses the R and A values. A three-component image uses the R, G, and B values. A four-component image uses all of the RGBA components. + +Image-based shadowing can be enabled by comparing texture r coordinates to depth texture values to generate a boolean result. See {{KW|_glTexParameter}} for details on texture comparison. + + +{{PageNotes}} + +{{KW|_glPixelStore}} modes affect texture images. + +{{Parameter|data}} may be a null pointer. In this case texture memory is allocated to accommodate a texture of width {{Parameter|width}}. You can then download subtextures to initialize the texture memory. The image is undefined if the program tries to apply an uninitialized portion of the texture image to a primitive. + +'''_glTexImage1D''' specifies the one-dimensional texture for the current texture unit, specified with {{KW|_glActiveTexture}}. + + +{{PageErrors}} + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|target}} is not {{KW|_GL_TEXTURE_1D}} or {{KW|_GL_PROXY_TEXTURE_1D}}. + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|format}} is not an accepted format constant. Format constants other than {{KW|_GL_STENCIL_INDEX}} are accepted. + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|type}} is not a type constant. + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|level}} is less than 0. + +{{KW|_GL_INVALID_VALUE}} may be generated if {{Parameter|level}} is greater than log2(''max''), where ''max'' is the returned value of {{KW|_GL_MAX_TEXTURE_SIZE}}. + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|internalFormat}} is not one of the accepted resolution and format symbolic constants. + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|width}} is less than 0 or greater than {{KW|_GL_MAX_TEXTURE_SIZE}}. + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|border}} is not 0. + +{{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}}, or {{KW|_GL_UNSIGNED_SHORT_5_6_5_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}}, or {{KW|_GL_UNSIGNED_INT_2_10_10_10_REV}} and {{Parameter|format}} is neither {{KW|_GL_RGBA}} nor {{KW|_GL_BGRA}}. + +{{KW|_GL_INVALID_OPERATION}} is generated if {{Parameter|format}} is {{KW|_GL_DEPTH_COMPONENT}} and {{Parameter|internalFormat}} is not {{KW|_GL_DEPTH_COMPONENT}}, {{KW|_GL_DEPTH_COMPONENT16}}, {{KW|_GL_DEPTH_COMPONENT24}}, or {{KW|_GL_DEPTH_COMPONENT32}}. + +{{KW|_GL_INVALID_OPERATION}} is generated if {{Parameter|internalFormat}} is {{KW|_GL_DEPTH_COMPONENT}}, {{KW|_GL_DEPTH_COMPONENT16}}, {{KW|_GL_DEPTH_COMPONENT24}}, or {{KW|_GL_DEPTH_COMPONENT32}}, and {{Parameter|format}} is not {{KW|_GL_DEPTH_COMPONENT}}. + +{{KW|_GL_INVALID_OPERATION}} is generated if a non-zero buffer object name is bound to the {{KW|_GL_PIXEL_UNPACK_BUFFER}} target and the buffer object's data store is currently mapped. + +{{KW|_GL_INVALID_OPERATION}} is generated if a non-zero buffer object name is bound to the {{KW|_GL_PIXEL_UNPACK_BUFFER}} target and the data would be unpacked from the buffer object such that the memory reads required would exceed the data store size. + +{{KW|_GL_INVALID_OPERATION}} is generated if a non-zero buffer object name is bound to the {{KW|_GL_PIXEL_UNPACK_BUFFER}} target and {{Parameter|data}} is not evenly divisible into the number of bytes needed to store in memory a datum indicated by {{Parameter|type}}. + + +{{PageUseWith}} + +{{KW|_glGetTexImage}} + +{{KW|_glGet}} with argument {{KW|_GL_PIXEL_UNPACK_BUFFER_BINDING}} + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glActiveTexture}}, {{KW|_glBindTexture}}, {{KW|_glTexBuffer}}, {{KW|_glTexBufferRange}}, {{KW|_glTexImage2D}}, {{KW|_glTexImage2DMultisample}}, {{KW|_glTexImage3D}}, {{KW|_glTexImage3DMultisample}}, {{KW|_glTexSubImage1D}}, {{KW|_glPixelStore}} + + +{{PageCopyright}} + + +{{PageNavigation}} + diff --git a/internal/help/_glTexImage2D.txt b/internal/help/_glTexImage2D.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexImage2D.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexImage2D__001001000021.txt b/internal/help/_glTexImage2D__001001000021.txt new file mode 100644 index 000000000..d47b5267b --- /dev/null +++ b/internal/help/_glTexImage2D__001001000021.txt @@ -0,0 +1,157 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:23:55}} +'''_glTexImage2D:''' specify a two-dimensional texture image + + +{{PageSyntax}} + + SUB _glTexImage2D (BYVAL target AS _UNSIGNED LONG, BYVAL level AS LONG, BYVAL internalformat AS LONG, BYVAL width AS LONG, BYVAL height AS LONG, BYVAL border AS LONG, BYVAL format AS _UNSIGNED LONG, BYVAL type AS _UNSIGNED LONG, pixels AS _OFFSET) + void '''_glTexImage2D'''(GLenum {{Parameter|target}}, GLint {{Parameter|level}}, GLint {{Parameter|internalFormat}}, GLsizei {{Parameter|width}}, GLsizei {{Parameter|height}}, GLint {{Parameter|border}}, GLenum {{Parameter|format}}, GLenum {{Parameter|type}}, const GLvoid * {{Parameter|data}}); + + +; target +: Specifies the target texture. Must be {{KW|_GL_TEXTURE_2D}}, {{KW|_GL_PROXY_TEXTURE_2D}}, {{KW|_GL_TEXTURE_1D_ARRAY}}, {{KW|_GL_PROXY_TEXTURE_1D_ARRAY}}, {{KW|_GL_TEXTURE_RECTANGLE}}, {{KW|_GL_PROXY_TEXTURE_RECTANGLE}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_X}}, {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_X}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_Y}}, {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_Z}}, {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z}}, or {{KW|_GL_PROXY_TEXTURE_CUBE_MAP}}. +; level +: Specifies the level-of-detail number. Level 0 is the base image level. Level ''n'' is the ''n''th mipmap reduction image. If {{Parameter|target}} is {{KW|_GL_TEXTURE_RECTANGLE}} or {{KW|_GL_PROXY_TEXTURE_RECTANGLE}}, {{Parameter|level}} must be 0. +; internalFormat +: Specifies the number of color components in the texture. Must be one of base internal formats given in Table 1, one of the sized internal formats given in Table 2, or one of the compressed internal formats given in Table 3, below. +; width +: Specifies the width of the texture image. All implementations support texture images that are at least 1024 texels wide. +; height +: Specifies the height of the texture image, or the number of layers in a texture array, in the case of the {{KW|_GL_TEXTURE_1D_ARRAY}} and {{KW|_GL_PROXY_TEXTURE_1D_ARRAY}} targets. All implementations support 2D texture images that are at least 1024 texels high, and texture arrays that are at least 256 layers deep. +; border +: This value must be 0. +{{glapi pixeltransferupparams}} + + +{{PageDescription}} + +Texturing allows elements of an image array to be read by shaders. + +To define texture images, call '''_glTexImage2D'''. The arguments describe the parameters of the texture image, such as height, width, width of the border, level-of-detail number (see {{KW|_glTexParameter}}), and number of color components provided. The last three arguments describe how the image is represented in memory. + +If {{Parameter|target}} is {{KW|_GL_PROXY_TEXTURE_2D}}, {{KW|_GL_PROXY_TEXTURE_1D_ARRAY}}, {{KW|_GL_PROXY_TEXTURE_CUBE_MAP}}, or {{KW|_GL_PROXY_TEXTURE_RECTANGLE}}, no data is read from {{Parameter|data}}, but all of the texture image state is recalculated, checked for consistency, and checked against the implementation's capabilities. If the implementation cannot handle a texture of the requested texture size, it sets all of the image state to 0, but does not generate an error (see {{KW|_glGetError}}). To query for an entire mipmap array, use an image array level greater than or equal to 1. + +If {{Parameter|target}} is {{KW|_GL_TEXTURE_2D}}, {{KW|_GL_TEXTURE_RECTANGLE}} or one of the {{KW|_GL_TEXTURE_CUBE_MAP}} targets, data is read from {{Parameter|data}} as a sequence of signed or unsigned bytes, shorts, or longs, or single-precision floating-point values, depending on {{Parameter|type}}. These values are grouped into sets of one, two, three, or four values, depending on {{Parameter|format}}, to form elements. Each data byte is treated as eight 1-bit elements, with bit ordering determined by {{KW|_GL_UNPACK_LSB_FIRST}} (see {{KW|_glPixelStore}}). + +If {{Parameter|target}} is {{KW|_GL_TEXTURE_1D_ARRAY}}, data is interpreted as an array of one-dimensional images. + +If a non-zero named buffer object is bound to the {{KW|_GL_PIXEL_UNPACK_BUFFER}} target (see {{KW|_glBindBuffer}}) while a texture image is specified, {{Parameter|data}} is treated as a byte offset into the buffer object's data store. + +The first element corresponds to the lower left corner of the texture image. Subsequent elements progress left-to-right through the remaining texels in the lowest row of the texture image, and then in successively higher rows of the texture image. The final element corresponds to the upper right corner of the texture image. + +{{Parameter|format}} determines the composition of each element in {{Parameter|data}}. It can assume one of these symbolic values: + +; {{KW|_GL_RED}} +: Each element is a single red component. The GL converts it to floating point and assembles it into an RGBA element by attaching 0 for green and blue, and 1 for alpha. Each component is then multiplied by the signed scale factor {{KW|_GL_c_SCALE}}, added to the signed bias {{KW|_GL_c_BIAS}}, and clamped to the range [0,1]. +; {{KW|_GL_RG}} +: Each element is a red/green double. The GL converts it to floating point and assembles it into an RGBA element by attaching 0 for blue, and 1 for alpha. Each component is then multiplied by the signed scale factor {{KW|_GL_c_SCALE}}, added to the signed bias {{KW|_GL_c_BIAS}}, and clamped to the range [0,1]. +; {{KW|_GL_RGB}} +: ; {{KW|_GL_BGR}} +: Each element is an RGB triple. The GL converts it to floating point and assembles it into an RGBA element by attaching 1 for alpha. Each component is then multiplied by the signed scale factor {{KW|_GL_c_SCALE}}, added to the signed bias {{KW|_GL_c_BIAS}}, and clamped to the range [0,1]. +; {{KW|_GL_RGBA}} +: ; {{KW|_GL_BGRA}} +: Each element contains all four components. Each component is multiplied by the signed scale factor {{KW|_GL_c_SCALE}}, added to the signed bias {{KW|_GL_c_BIAS}}, and clamped to the range [0,1]. +; {{KW|_GL_DEPTH_COMPONENT}} +: Each element is a single depth value. The GL converts it to floating point, multiplies by the signed scale factor {{KW|_GL_DEPTH_SCALE}}, adds the signed bias {{KW|_GL_DEPTH_BIAS}}, and clamps to the range [0,1]. +; {{KW|_GL_DEPTH_STENCIL}} +: Each element is a pair of depth and stencil values. The depth component of the pair is interpreted as in {{KW|_GL_DEPTH_COMPONENT}}. The stencil component is interpreted based on specified the depth + stencil internal format. +If an application wants to store the texture at a certain resolution or in a certain format, it can request the resolution and format with {{Parameter|internalFormat}}. The GL will choose an internal representation that closely approximates that requested by {{Parameter|internalFormat}}, but it may not match exactly. (The representations specified by {{KW|_GL_RED}}, {{KW|_GL_RG}}, {{KW|_GL_RGB}}, and {{KW|_GL_RGBA}} must match exactly.) + +{{Parameter|internalFormat}} may be one of the base internal formats shown in Table 1, below + +{{glapi baseformattable}} + +{{Parameter|internalFormat}} may also be one of the sized internal formats shown in Table 2, below + +{{glapi internalformattable}} + +Finally, {{Parameter|internalFormat}} may also be one of the generic or compressed compressed texture formats shown in Table 3 below + +{{glapi compressedformattable}} + +If the {{Parameter|internalFormat}} parameter is one of the generic compressed formats, {{KW|_GL_COMPRESSED_RED}}, {{KW|_GL_COMPRESSED_RG}}, {{KW|_GL_COMPRESSED_RGB}}, or {{KW|_GL_COMPRESSED_RGBA}}, the GL will replace the internal format with the symbolic constant for a specific internal format and compress the texture before storage. If no corresponding internal format is available, or the GL can not compress that image for any reason, the internal format is instead replaced with a corresponding base internal format. + +If the {{Parameter|internalFormat}} parameter is {{KW|_GL_SRGB}}, {{KW|_GL_SRGB8}}, {{KW|_GL_SRGB_ALPHA}}, or {{KW|_GL_SRGB8_ALPHA8}}, the texture is treated as if the red, green, or blue components are encoded in the sRGB color space. Any alpha component is left unchanged. The conversion from the sRGB encoded component cs to a linear component cl is: + +{{glapi srgb equation}} + +Assume cs is the sRGB component in the range [0,1]. + +Use the {{KW|_GL_PROXY_TEXTURE_2D}}, {{KW|_GL_PROXY_TEXTURE_1D_ARRAY}}, {{KW|_GL_PROXY_TEXTURE_RECTANGLE}}, or {{KW|_GL_PROXY_TEXTURE_CUBE_MAP}} target to try out a resolution and format. The implementation will update and recompute its best match for the requested storage resolution and format. To then query this state, call {{KW|_glGetTexLevelParameter}}. If the texture cannot be accommodated, texture state is set to 0. + +A one-component texture image uses only the red component of the RGBA color extracted from {{Parameter|data}}. A two-component image uses the R and G values. A three-component image uses the R, G, and B values. A four-component image uses all of the RGBA components. + +Image-based shadowing can be enabled by comparing texture r coordinates to depth texture values to generate a boolean result. See {{KW|_glTexParameter}} for details on texture comparison. + + +{{PageNotes}} + +The {{KW|_glPixelStore}} mode affects texture images. + +{{Parameter|data}} may be a null pointer. In this case, texture memory is allocated to accommodate a texture of width {{Parameter|width}} and height {{Parameter|height}}. You can then download subtextures to initialize this texture memory. The image is undefined if the user tries to apply an uninitialized portion of the texture image to a primitive. + +'''_glTexImage2D''' specifies the two-dimensional texture for the current texture unit, specified with {{KW|_glActiveTexture}}. + + +{{PageErrors}} + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|target}} is not {{KW|_GL_TEXTURE_2D}}, {{KW|_GL_TEXTURE_1D_ARRAY}}, {{KW|_GL_TEXTURE_RECTANGLE}}, {{KW|_GL_PROXY_TEXTURE_2D}}, {{KW|_GL_PROXY_TEXTURE_1D_ARRAY}}, {{KW|_GL_PROXY_TEXTURE_RECTANGLE}}, {{KW|_GL_PROXY_TEXTURE_CUBE_MAP}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_X}}, {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_X}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_Y}}, {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_Z}}, or {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z}}. + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|target}} is one of the six cube map 2D image targets and the width and height parameters are not equal. + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|type}} is not a type constant. + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|width}} is less than 0 or greater than {{KW|_GL_MAX_TEXTURE_SIZE}}. + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|target}} is not {{KW|_GL_TEXTURE_1D_ARRAY}} or {{KW|_GL_PROXY_TEXTURE_1D_ARRAY}} and {{Parameter|height}} is less than 0 or greater than {{KW|_GL_MAX_TEXTURE_SIZE}}. + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|target}} is {{KW|_GL_TEXTURE_1D_ARRAY}} or {{KW|_GL_PROXY_TEXTURE_1D_ARRAY}} and {{Parameter|height}} is less than 0 or greater than {{KW|_GL_MAX_ARRAY_TEXTURE_LAYERS}}. + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|level}} is less than 0. + +{{KW|_GL_INVALID_VALUE}} may be generated if {{Parameter|level}} is greater than log2(''max''), where ''max'' is the returned value of {{KW|_GL_MAX_TEXTURE_SIZE}}. + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|internalFormat}} is not one of the accepted resolution and format symbolic constants. + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|width}} or {{Parameter|height}} is less than 0 or greater than {{KW|_GL_MAX_TEXTURE_SIZE}}. + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|border}} is not 0. + +{{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|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}}. + +{{KW|_GL_INVALID_OPERATION}} is generated if {{Parameter|format}} is {{KW|_GL_DEPTH_COMPONENT}} and {{Parameter|internalFormat}} is not {{KW|_GL_DEPTH_COMPONENT}}, {{KW|_GL_DEPTH_COMPONENT16}}, {{KW|_GL_DEPTH_COMPONENT24}}, or {{KW|_GL_DEPTH_COMPONENT32F}}. + +{{KW|_GL_INVALID_OPERATION}} is generated if {{Parameter|internalFormat}} is {{KW|_GL_DEPTH_COMPONENT}}, {{KW|_GL_DEPTH_COMPONENT16}}, {{KW|_GL_DEPTH_COMPONENT24}}, or {{KW|_GL_DEPTH_COMPONENT32F}}, and {{Parameter|format}} is not {{KW|_GL_DEPTH_COMPONENT}}. + +{{KW|_GL_INVALID_OPERATION}} is generated if a non-zero buffer object name is bound to the {{KW|_GL_PIXEL_UNPACK_BUFFER}} target and the buffer object's data store is currently mapped. + +{{KW|_GL_INVALID_OPERATION}} is generated if a non-zero buffer object name is bound to the {{KW|_GL_PIXEL_UNPACK_BUFFER}} target and the data would be unpacked from the buffer object such that the memory reads required would exceed the data store size. + +{{KW|_GL_INVALID_OPERATION}} is generated if a non-zero buffer object name is bound to the {{KW|_GL_PIXEL_UNPACK_BUFFER}} target and {{Parameter|data}} is not evenly divisible into the number of bytes needed to store in memory a datum indicated by {{Parameter|type}}. + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|target}} is {{KW|_GL_TEXTURE_RECTANGLE}} or {{KW|_GL_PROXY_TEXTURE_RECTANGLE}} and {{Parameter|level}} is not 0. + + +{{PageUseWith}} + +{{KW|_glGetTexImage}} + +{{KW|_glGet}} with argument {{KW|_GL_PIXEL_UNPACK_BUFFER_BINDING}} + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glActiveTexture}}, {{KW|_glBindTexture}}, {{KW|_glTexImage1D}}, {{KW|_glTexImage2DMultisample}}, {{KW|_glTexImage3D}}, {{KW|_glTexImage3DMultisample}}, {{KW|_glTexSubImage2D}}, {{KW|_glPixelStore}} + + +{{PageCopyright}} + + +{{PageNavigation}} + diff --git a/internal/help/_glTexParameterf.txt b/internal/help/_glTexParameterf.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexParameterf.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexParameterfv.txt b/internal/help/_glTexParameterfv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexParameterfv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexParameteri.txt b/internal/help/_glTexParameteri.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexParameteri.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexParameteriv.txt b/internal/help/_glTexParameteriv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexParameteriv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexSubImage1D.txt b/internal/help/_glTexSubImage1D.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexSubImage1D.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexSubImage1D__001001001000011.txt b/internal/help/_glTexSubImage1D__001001001000011.txt new file mode 100644 index 000000000..c5240112e --- /dev/null +++ b/internal/help/_glTexSubImage1D__001001001000011.txt @@ -0,0 +1,85 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:24:01}} +'''_glTexSubImage1D:''' specify a one-dimensional texture subimage + + +{{PageSyntax}} + + SUB _glTexSubImage1D (BYVAL target AS _UNSIGNED LONG, BYVAL level AS LONG, BYVAL xoffset AS LONG, BYVAL width AS LONG, BYVAL format AS _UNSIGNED LONG, BYVAL type AS _UNSIGNED LONG, pixels AS _OFFSET) + void '''_glTexSubImage1D'''(GLenum {{Parameter|target}}, GLint {{Parameter|level}}, GLint {{Parameter|xoffset}}, GLsizei {{Parameter|width}}, GLenum {{Parameter|format}}, GLenum {{Parameter|type}}, const GLvoid * {{Parameter|data}}); + + +; target +: Specifies the target texture. Must be {{KW|_GL_TEXTURE_1D}}. +; level +: Specifies the level-of-detail number. Level 0 is the base image level. Level ''n'' is the ''n''th mipmap reduction image. +; xoffset +: Specifies a texel offset in the x direction within the texture array. +; width +: Specifies the width of the texture subimage. +{{glapi pixeltransferupparams}} + + +{{PageDescription}} + +Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled. To enable or disable one-dimensional texturing, call {{KW|_glEnable}} and {{KW|_glDisable}} with argument {{KW|_GL_TEXTURE_1D}}. + +'''_glTexSubImage1D''' redefines a contiguous subregion of an existing one-dimensional texture image. The texels referenced by {{Parameter|data}} replace the portion of the existing texture array with x indices {{Parameter|xoffset}} and xoffset + width - 1, inclusive. This region may not include any texels outside the range of the texture array as it was originally specified. It is not an error to specify a subtexture with width of 0, but such a specification has no effect. + +If a non-zero named buffer object is bound to the {{KW|_GL_PIXEL_UNPACK_BUFFER}} target (see {{KW|_glBindBuffer}}) while a texture image is specified, {{Parameter|data}} is treated as a byte offset into the buffer object's data store. + + +{{PageNotes}} + +{{KW|_glPixelStore}} modes affect texture images. + +'''_glTexSubImage1D''' specifies a one-dimensional subtexture for the current texture unit, specified with {{KW|_glActiveTexture}}. + + +{{PageErrors}} + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|target}} is not one of the allowable values. + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|format}} is not an accepted format constant. + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|type}} is not a type constant. + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|level}} is less than 0. + +{{KW|_GL_INVALID_VALUE}} may be generated if {{Parameter|level}} is greater than log2(''max''), where ''max'' is the returned value of {{KW|_GL_MAX_TEXTURE_SIZE}}. + +{{KW|_GL_INVALID_VALUE}} is generated if ''xoffset'' < 0, or if ''xoffset'' + ''width'' > ''w'', where ''w'' is the {{KW|_GL_TEXTURE_WIDTH}}. Note that ''w'' includes twice the border width. + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|width}} is less than 0. + +{{KW|_GL_INVALID_OPERATION}} is generated if the texture array has not been defined by a previous {{KW|_glTexImage1D}} operation. + +{{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}}, or {{KW|_GL_UNSIGNED_SHORT_5_6_5_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}}, or {{KW|_GL_UNSIGNED_INT_2_10_10_10_REV}} and {{Parameter|format}} is neither {{KW|_GL_RGBA}} nor {{KW|_GL_BGRA}}. + +{{KW|_GL_INVALID_OPERATION}} is generated if a non-zero buffer object name is bound to the {{KW|_GL_PIXEL_UNPACK_BUFFER}} target and the buffer object's data store is currently mapped. + +{{KW|_GL_INVALID_OPERATION}} is generated if a non-zero buffer object name is bound to the {{KW|_GL_PIXEL_UNPACK_BUFFER}} target and the data would be unpacked from the buffer object such that the memory reads required would exceed the data store size. + +{{KW|_GL_INVALID_OPERATION}} is generated if a non-zero buffer object name is bound to the {{KW|_GL_PIXEL_UNPACK_BUFFER}} target and {{Parameter|data}} is not evenly divisible into the number of bytes needed to store in memory a datum indicated by {{Parameter|type}}. + + +{{PageUseWith}} + +{{KW|_glGetTexImage}} + +{{KW|_glGet}} with argument {{KW|_GL_PIXEL_UNPACK_BUFFER_BINDING}} + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glActiveTexture}}, {{KW|_glBindTexture}}, {{KW|_glTexSubImage2D}}, {{KW|_glTexSubImage3D}}, {{KW|_glCopyTexImage1D}}, {{KW|_glTexImage1D}}, {{KW|_glTexStorage1D}}, {{KW|_glTextureView}}, {{KW|_glPixelStore}} + + +{{PageCopyright}} + + +{{PageNavigation}} + diff --git a/internal/help/_glTexSubImage2D.txt b/internal/help/_glTexSubImage2D.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTexSubImage2D.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTexSubImage2D__001001001000021.txt b/internal/help/_glTexSubImage2D__001001001000021.txt new file mode 100644 index 000000000..3ecbe9fac --- /dev/null +++ b/internal/help/_glTexSubImage2D__001001001000021.txt @@ -0,0 +1,89 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:24:03}} +'''_glTexSubImage2D:''' specify a two-dimensional texture subimage + + +{{PageSyntax}} + + SUB _glTexSubImage2D (BYVAL target AS _UNSIGNED LONG, BYVAL level AS LONG, BYVAL xoffset AS LONG, BYVAL yoffset AS LONG, BYVAL width AS LONG, BYVAL height AS LONG, BYVAL format AS _UNSIGNED LONG, BYVAL type AS _UNSIGNED LONG, pixels AS _OFFSET) + void '''_glTexSubImage2D'''(GLenum {{Parameter|target}}, GLint {{Parameter|level}}, GLint {{Parameter|xoffset}}, GLint {{Parameter|yoffset}}, GLsizei {{Parameter|width}}, GLsizei {{Parameter|height}}, GLenum {{Parameter|format}}, GLenum {{Parameter|type}}, const GLvoid * {{Parameter|data}}); + + +; target +: Specifies the target texture. Must be {{KW|_GL_TEXTURE_2D}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_X}}, {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_X}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_Y}}, {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_Z}}, {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z}}, or {{KW|_GL_TEXTURE_1D_ARRAY}}. +; level +: Specifies the level-of-detail number. Level 0 is the base image level. Level ''n'' is the ''n''th mipmap reduction image. +; xoffset +: Specifies a texel offset in the x direction within the texture array. +; yoffset +: Specifies a texel offset in the y direction within the texture array. +; width +: Specifies the width of the texture subimage. +; height +: Specifies the height of the texture subimage. +{{Glapi pixeltransferupparams|}} + + +{{PageDescription}} + +Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled. + +'''_glTexSubImage2D''' redefines a contiguous subregion of an existing two-dimensional or one-dimensional array texture image. The texels referenced by {{Parameter|data}} replace the portion of the existing texture array with x indices {{Parameter|xoffset}} and ''xoffset'' + ''width'' - 1, inclusive, and y indices {{Parameter|yoffset}} and ''yoffset'' + ''height'' - 1, inclusive. This region may not include any texels outside the range of the texture array as it was originally specified. It is not an error to specify a subtexture with zero width or height, but such a specification has no effect. + +If a non-zero named buffer object is bound to the {{KW|_GL_PIXEL_UNPACK_BUFFER}} target (see {{KW|_glBindBuffer}}) while a texture image is specified, {{Parameter|data}} is treated as a byte offset into the buffer object's data store. + + +{{PageNotes}} + +{{KW|_glPixelStore}} modes affect texture images. + +'''_glTexSubImage2D''' specifies a two-dimensional subtexture for the current texture unit, specified with {{KW|_glActiveTexture}}. + + +{{PageErrors}} + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|target}} is not {{KW|_GL_TEXTURE_2D}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_X}}, {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_X}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_Y}}, {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_Z}}, {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z}}, or {{KW|_GL_TEXTURE_1D_ARRAY}}. + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|format}} is not an accepted format constant. + +{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|type}} is not a type constant. + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|level}} is less than 0. + +{{KW|_GL_INVALID_VALUE}} may be generated if {{Parameter|level}} is greater than log2(''max''), where ''max'' is the returned value of {{KW|_GL_MAX_TEXTURE_SIZE}}. + +{{KW|_GL_INVALID_VALUE}} is generated if ''xoffset'' < 0, (''xoffset'' + ''width'') > ''w'', ''yoffset'' < 0, or (''yoffset'' + ''height'') > ''h'', where ''w'' is the {{KW|_GL_TEXTURE_WIDTH}} and ''h'' is the {{KW|_GL_TEXTURE_HEIGHT}}. + +{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|width}} or {{Parameter|height}} is less than 0. + +{{KW|_GL_INVALID_OPERATION}} is generated if the texture array has not been defined by a previous {{KW|_glTexImage2D}} operation. + +{{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}}, or {{KW|_GL_UNSIGNED_SHORT_5_6_5_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}}, or {{KW|_GL_UNSIGNED_INT_2_10_10_10_REV}} and {{Parameter|format}} is neither {{KW|_GL_RGBA}} nor {{KW|_GL_BGRA}}. + +{{KW|_GL_INVALID_OPERATION}} is generated if a non-zero buffer object name is bound to the {{KW|_GL_PIXEL_UNPACK_BUFFER}} target and the buffer object's data store is currently mapped. + +{{KW|_GL_INVALID_OPERATION}} is generated if a non-zero buffer object name is bound to the {{KW|_GL_PIXEL_UNPACK_BUFFER}} target and the data would be unpacked from the buffer object such that the memory reads required would exceed the data store size. + +{{KW|_GL_INVALID_OPERATION}} is generated if a non-zero buffer object name is bound to the {{KW|_GL_PIXEL_UNPACK_BUFFER}} target and {{Parameter|data}} is not evenly divisible into the number of bytes needed to store in memory a datum indicated by {{Parameter|type}}. + + +{{PageUseWith}} + +{{KW|_glGetTexImage}} + +{{KW|_glGet}} with argument {{KW|_GL_PIXEL_UNPACK_BUFFER_BINDING}} + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glActiveTexture}}, {{KW|_glBindTexture}}, {{KW|_glTexSubImage1D}}, {{KW|_glTexSubImage3D}}, {{KW|_glCopyTexImage2D}}, {{KW|_glTexImage2D}}, {{KW|_glTexStorage2D}}, {{KW|_glTextureView}}, {{KW|_glPixelStore}} + + +{{PageCopyright}} + + +{{PageNavigation}} + diff --git a/internal/help/_glTranslated.txt b/internal/help/_glTranslated.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTranslated.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glTranslatef.txt b/internal/help/_glTranslatef.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glTranslatef.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glVertex2d.txt b/internal/help/_glVertex2d.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glVertex2d.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glVertex2dv.txt b/internal/help/_glVertex2dv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glVertex2dv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glVertex2f.txt b/internal/help/_glVertex2f.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glVertex2f.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glVertex2fv.txt b/internal/help/_glVertex2fv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glVertex2fv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glVertex2i.txt b/internal/help/_glVertex2i.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glVertex2i.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glVertex2iv.txt b/internal/help/_glVertex2iv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glVertex2iv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glVertex2s.txt b/internal/help/_glVertex2s.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glVertex2s.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glVertex2sv.txt b/internal/help/_glVertex2sv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glVertex2sv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glVertex3d.txt b/internal/help/_glVertex3d.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glVertex3d.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glVertex3dv.txt b/internal/help/_glVertex3dv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glVertex3dv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glVertex3f.txt b/internal/help/_glVertex3f.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glVertex3f.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glVertex3fv.txt b/internal/help/_glVertex3fv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glVertex3fv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glVertex3i.txt b/internal/help/_glVertex3i.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glVertex3i.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glVertex3iv.txt b/internal/help/_glVertex3iv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glVertex3iv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glVertex3s.txt b/internal/help/_glVertex3s.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glVertex3s.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glVertex3sv.txt b/internal/help/_glVertex3sv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glVertex3sv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glVertex4d.txt b/internal/help/_glVertex4d.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glVertex4d.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glVertex4dv.txt b/internal/help/_glVertex4dv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glVertex4dv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glVertex4f.txt b/internal/help/_glVertex4f.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glVertex4f.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glVertex4fv.txt b/internal/help/_glVertex4fv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glVertex4fv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glVertex4i.txt b/internal/help/_glVertex4i.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glVertex4i.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glVertex4iv.txt b/internal/help/_glVertex4iv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glVertex4iv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glVertex4s.txt b/internal/help/_glVertex4s.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glVertex4s.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glVertex4sv.txt b/internal/help/_glVertex4sv.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glVertex4sv.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glVertexPointer.txt b/internal/help/_glVertexPointer.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glVertexPointer.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glViewport.txt b/internal/help/_glViewport.txt deleted file mode 100644 index 931841834..000000000 --- a/internal/help/_glViewport.txt +++ /dev/null @@ -1 +0,0 @@ -< diff --git a/internal/help/_glViewport__0010000000.txt b/internal/help/_glViewport__0010000000.txt new file mode 100644 index 000000000..413f97de8 --- /dev/null +++ b/internal/help/_glViewport__0010000000.txt @@ -0,0 +1,50 @@ +{{QBDLDATE:05-20-2022}} +{{QBDLTIME:23:24:35}} +{{DISPLAYTITLE:_glViewport}} +'''_glViewport:''' set the viewport + + +{{PageSyntax}} + +;QB64:SUB _glViewport (BYVAL x AS LONG, BYVAL y AS LONG, BYVAL width AS LONG, BYVAL height AS LONG) +;C/C++:void '''_glViewport'''(GLint {{Parameter|x}}, GLint {{Parameter|y}}, GLsizei {{Parameter|width}}, GLsizei {{Parameter|height}}); + + +; x, y +: Specify the lower left corner of the viewport rectangle, in pixels. The initial value is (0,0). +; width, height +: Specify the width and height of the viewport. When a GL context is first attached to a window, {{Parameter|width}} and {{Parameter|height}} are set to the dimensions of that window. + + +{{PageDescription}} + +'''_glViewport''' specifies the affine transformation of ''x'' and ''y'' from normalized device coordinates to window coordinates. Let (xnd, ynd) be normalized device coordinates. Then the window coordinates (xw, yw) are computed as follows: + +{{glapi viewport equations}} + +Viewport width and height are silently clamped to a range that depends on the implementation. To query this range, call {{KW|_glGet}} with argument {{KW|_GL_MAX_VIEWPORT_DIMS}}. + + +{{PageErrors}} + +{{KW|_GL_INVALID_VALUE}} is generated if either {{Parameter|width}} or {{Parameter|height}} is negative. + + +{{PageUseWith}} + +{{KW|_glGet}} with argument {{KW|_GL_VIEWPORT}} + +{{KW|_glGet}} with argument {{KW|_GL_MAX_VIEWPORT_DIMS}} + + +{{PageSeeAlso}} + +[[_GL|SUB _GL]] +{{KW|_glDepthRange}}, {{KW|_glViewportArray}}, {{KW|_glViewportIndexed}} + + +{{PageCopyright}} + + +{{PageNavigation}} + diff --git a/internal/help/links.bin b/internal/help/links.bin index 850720663..806131736 100644 --- a/internal/help/links.bin +++ b/internal/help/links.bin @@ -4,9 +4,6 @@ _ACOSH,_ACOSH _ALLOWFULLSCREEN,_ALLOWFULLSCREEN _ALPHA,_ALPHA _ALPHA32,_ALPHA32 -_ARCCOT,Mathematical_Operations -_ARCCSC,Mathematical_Operations -_ARCSEC,Mathematical_Operations _ASIN,_ASIN _ASINH,_ASINH _ASSERT,_ASSERT @@ -18,6 +15,7 @@ _AUTODISPLAY,_AUTODISPLAY (function) _AXIS,_AXIS _BACKGROUNDCOLOR,_BACKGROUNDCOLOR _BIT,_BIT +_BIN$,_BIN$ _BLEND,_BLEND _BLEND,_BLEND (function) _BLINK,_BLINK @@ -61,6 +59,7 @@ _CV,_CV _CWD$,_CWD$ _D2G,_D2G _D2R,_D2R +$DEBUG,$DEBUG DECLARE,DECLARE LIBRARY DECLARE,DECLARE DYNAMIC LIBRARY _DEFAULTCOLOR,_DEFAULTCOLOR @@ -87,7 +86,9 @@ _ECHO,_ECHO $ELSE,$ELSE $ELSEIF,$ELSEIF $END,$END IF +$ERROR,$ERROR _ERRORLINE,_ERRORLINE +_ERRORMESSAGE$,_ERRORMESSAGE$ $EXEICON,$EXEICON _EXIT,_EXIT (function) _FILEEXISTS,_FILEEXISTS @@ -104,6 +105,7 @@ _FULLSCREEN,_FULLSCREEN _FULLSCREEN,_FULLSCREEN (function) _G2D,_G2D _G2R,_G2R +_GLRENDER,_GLRENDER _GREEN,_GREEN _GREEN32,_GREEN32 _HEIGHT,_HEIGHT @@ -786,7 +788,6 @@ _glRecti,_glRecti _glRectiv,_glRectiv _glRects,_glRects _glRectsv,_glRectsv -_GLRENDER,_GLRENDER _glRenderMode,_glRenderMode _glRotated,_glRotated _glRotatef,_glRotatef diff --git a/source/ide/ide_methods.bas b/source/ide/ide_methods.bas index c8b2dab4e..e37fea771 100644 --- a/source/ide/ide_methods.bas +++ b/source/ide/ide_methods.bas @@ -2588,54 +2588,74 @@ FUNCTION ide2 (ignore) NEXT l2 = INSTR(l1, Help_Link$, Help_Link_Sep$) - 1 l$ = MID$(Help_Link$, l1, l2 - l1 + 1) - 'assume PAGE - l$ = RIGHT$(l$, LEN(l$) - 5) IF mCLICK OR K$ = CHR$(13) THEN mCLICK = 0 - IF Back$(Help_Back_Pos) <> l$ THEN - Help_Select = 0: Help_MSelect = 0 - 'COLOR 7, 0 - - Help_Back(Help_Back_Pos).sx = Help_sx 'update position - Help_Back(Help_Back_Pos).sy = Help_sy - Help_Back(Help_Back_Pos).cx = Help_cx - Help_Back(Help_Back_Pos).cy = Help_cy - - top = UBOUND(back$) - - IF Help_Back_Pos < top THEN - IF Back$(Help_Back_Pos + 1) = l$ THEN - GOTO usenextentry + IF LEFT$(l$, 5) = "EXTL:" THEN + IF (K$ = CHR$(13)) OR (mY = Help_cy - Help_sy + Help_wy1 AND mX = Help_cx - Help_sx + Help_wx1) THEN + l$ = RIGHT$(l$, LEN(l$) - 5) + l$ = StrReplace$(l$, " ", "%20") + IF INSTR(_OS$, "WIN") = 0 THEN + l$ = StrReplace$(l$, "$", "\$") + l$ = StrReplace$(l$, "&", "\&") + l$ = StrReplace$(l$, "(", "\(") + l$ = StrReplace$(l$, ")", "\)") + END IF + IF INSTR(_OS$, "WIN") THEN + SHELL _HIDE _DONTWAIT "start " + l$ + ELSEIF INSTR(_OS$, "MAC") THEN + SHELL _HIDE _DONTWAIT "open " + l$ + ELSE + SHELL _HIDE _DONTWAIT "xdg-open " + l$ END IF END IF + GOTO specialchar + ELSEIF LEFT$(l$, 5) = "PAGE:" THEN + l$ = RIGHT$(l$, LEN(l$) - 5) + IF Back$(Help_Back_Pos) <> l$ THEN + Help_Select = 0: Help_MSelect = 0 + 'COLOR 7, 0 - top = top + 1 - REDIM _PRESERVE Back(top) AS STRING - REDIM _PRESERVE Help_Back(top) AS Help_Back_Type - REDIM _PRESERVE Back_Name(top) AS STRING - 'Shuffle array upwards after current pos - FOR x = top - 1 TO Help_Back_Pos + 1 STEP -1 - Back_Name$(x + 1) = Back_Name$(x) - Back$(x + 1) = Back$(x) - Help_Back(x + 1).sx = Help_Back(x).sx - Help_Back(x + 1).sy = Help_Back(x).sy - Help_Back(x + 1).cx = Help_Back(x).cx - Help_Back(x + 1).cy = Help_Back(x).cy - NEXT - usenextentry: - Help_Back_Pos = Help_Back_Pos + 1 - Back$(Help_Back_Pos) = l$ - Back_Name$(Help_Back_Pos) = Back2BackName$(l$) - Help_Back(Help_Back_Pos).sx = 1 - Help_Back(Help_Back_Pos).sy = 1 - Help_Back(Help_Back_Pos).cx = 1 - Help_Back(Help_Back_Pos).cy = 1 - Help_sx = 1: Help_sy = 1: Help_cx = 1: Help_cy = 1 - a$ = Wiki(l$) - WikiParse a$ - GOTO newpageparsed + Help_Back(Help_Back_Pos).sx = Help_sx 'update position + Help_Back(Help_Back_Pos).sy = Help_sy + Help_Back(Help_Back_Pos).cx = Help_cx + Help_Back(Help_Back_Pos).cy = Help_cy + + top = UBOUND(back$) + + IF Help_Back_Pos < top THEN + IF Back$(Help_Back_Pos + 1) = l$ THEN + GOTO usenextentry + END IF + END IF + + top = top + 1 + REDIM _PRESERVE Back(top) AS STRING + REDIM _PRESERVE Help_Back(top) AS Help_Back_Type + REDIM _PRESERVE Back_Name(top) AS STRING + 'Shuffle array upwards after current pos + FOR x = top - 1 TO Help_Back_Pos + 1 STEP -1 + Back_Name$(x + 1) = Back_Name$(x) + Back$(x + 1) = Back$(x) + Help_Back(x + 1).sx = Help_Back(x).sx + Help_Back(x + 1).sy = Help_Back(x).sy + Help_Back(x + 1).cx = Help_Back(x).cx + Help_Back(x + 1).cy = Help_Back(x).cy + NEXT + usenextentry: + Help_Back_Pos = Help_Back_Pos + 1 + Back$(Help_Back_Pos) = l$ + Back_Name$(Help_Back_Pos) = Back2BackName$(l$) + Help_Back(Help_Back_Pos).sx = 1 + Help_Back(Help_Back_Pos).sy = 1 + Help_Back(Help_Back_Pos).cx = 1 + Help_Back(Help_Back_Pos).cy = 1 + Help_sx = 1: Help_sy = 1: Help_cx = 1: Help_cy = 1 + a$ = Wiki(l$) + WikiParse a$ + GOTO newpageparsed + END IF END IF END IF @@ -2802,10 +2822,13 @@ FUNCTION ide2 (ignore) LOOP IF UCASE$(n$) = a2$ THEN - a$ = "'''" + backupn$ + "''' is a symbol that is used in your program as follows:" + a$ = "{{DISPLAYTITLE:agp@" + backupn$ + "}}" + CHR$(10) + a$ = a$ + "This is a subroutine or function that is used in your program as follows:" + CHR$(10) a$ = a$ + CHR$(10) + CHR$(10) + "{{PageSyntax}}" + CHR$(10) - a$ = a$ + ": " + sf$ + "'''" + backupn$ + "''' " + args$ - a$ = a$ + CHR$(10) + "{{PageNavigation}}" + a$ = a$ + ": [[" + LEFT$(sf$, LEN(sf$) - 1) + "]] '''" + backupn$ + "''' " + args$ + CHR$(10) + a$ = a$ + CHR$(10) + CHR$(10) + "{{PageSeeAlso}}" + CHR$(10) + a$ = a$ + "* [[Sub (explanatory)]]" + CHR$(10) + a$ = a$ + "* [[Function (explanatory)]]" + CHR$(10) IdeContextHelpSF = -1 @@ -5389,7 +5412,7 @@ FUNCTION ide2 (ignore) IF menu$(m, s) = "Update All #Pages..." THEN PCOPY 2, 0 - q$ = ideyesnobox("Update Help", "This can take up to 10 minutes.\nRedownload all cached help content from the wiki?") + q$ = ideyesnobox("Update Help", "This can take up to 15 minutes.\nRedownload all cached help content from the wiki?") PCOPY 2, 0 IF q$ = "Y" THEN ideupdatehelpbox PCOPY 3, 0: SCREEN , , 3, 0 @@ -14595,6 +14618,7 @@ FUNCTION idezfilelist$ (path$, method, mask$) 'method0=*.bas, method1=*.*, metho DO UNTIL EOF(150) LINE INPUT #150, a$ IF LEN(a$) THEN 'skip blank entries + IF path$ = "internal/help" THEN a$ = LEFT$(a$, (LEN(a$) - 5) \ 2) + ".txt" 'remove spelling label IF filelist$ = "" THEN filelist$ = a$ ELSE filelist$ = filelist$ + sep + a$ END IF LOOP @@ -14634,6 +14658,7 @@ FUNCTION idezfilelist$ (path$, method, mask$) 'method0=*.bas, method1=*.*, metho EXIT FOR END IF NEXT + IF path$ = "internal/help" THEN a$ = LEFT$(a$, (LEN(a$) - 5) \ 2) + ".txt" 'remove spelling label IF filelist$ = "" THEN filelist$ = a$ ELSE filelist$ = filelist$ + sep + a$ LOOP CLOSE #150 @@ -18753,7 +18778,7 @@ SUB ideupdatehelpbox SELECT CASE UpdateStep CASE 1 'Create a list of all files to be recached - f$ = CHR$(0) + idezfilelist$("internal/help", 1, "") + CHR$(0) + f$ = CHR$(0) + idezfilelist$("internal/help", 2, "*.txt") + CHR$(0) IF LEN(f$) = 2 THEN f$ = CHR$(0) 'Prepend core pages to list @@ -18778,18 +18803,20 @@ SUB ideupdatehelpbox DO UNTIL EOF(fh) LINE INPUT #fh, l$ IF LEN(l$) THEN - c = INSTR(l$, ","): PageName2$ = RIGHT$(l$, LEN(l$) - c) - DO WHILE INSTR(PageName2$, " ") - ASC(PageName2$, INSTR(PageName2$, " ")) = 95 - LOOP - DO WHILE INSTR(PageName2$, "&") - i = INSTR(PageName2$, "&") - PageName2$ = LEFT$(PageName2$, i - 1) + "%26" + RIGHT$(PageName2$, LEN(PageName2$) - i) - LOOP - DO WHILE INSTR(PageName2$, "/") - i = INSTR(PageName2$, "/") - PageName2$ = LEFT$(PageName2$, i - 1) + "%2F" + RIGHT$(PageName2$, LEN(PageName2$) - i) - LOOP + c = INSTR(l$, ","): l$ = RIGHT$(l$, LEN(l$) - c) + 'Escape all invalid and other critical chars in filenames + PageName2$ = "" + FOR i = 1 TO LEN(l$) + c = ASC(l$, i) + SELECT CASE c + CASE 32 ' '(space) + PageName2$ = PageName2$ + "_" + CASE 34, 38, 42, 47, 58, 60, 62, 63, 92, 124 '("&*/:<>?\|) + PageName2$ = PageName2$ + "%" + HEX$(c) + CASE ELSE + PageName2$ = PageName2$ + CHR$(c) + END SELECT + NEXT PageName2$ = PageName2$ + ".txt" IF INSTR(f$, CHR$(0) + PageName2$ + CHR$(0)) = 0 THEN f$ = f$ + PageName2$ + CHR$(0) @@ -19801,9 +19828,19 @@ FUNCTION findHelpTopic$(topic$, lnks, firstOnly AS _BYTE) 'check if topic$ is in help links ' - returns a list of help links separated by CHR$(0) ' - returns the total number of links found by changing 'lnks' + IF NOT _FILEEXISTS("internal\help\links.bin") THEN + q$ = ideyesnobox("Help problem", "The help system is not yet initialized,\ndo it now? (Make sure you're online.)") + PCOPY 3, 0: SCREEN , , 3, 0 + IF q$ = "N" THEN lnks = 0: lnks$ = CHR$(0): GOTO noLinksFile + Help_IgnoreCache = 1 + a$ = Wiki$("Keyword Reference - Alphabetical") + Help_IgnoreCache = 0 + Help_ww = 78: WikiParse a$ 'assume standard IDE width for parsing + END IF + '---------- a2$ = UCASE$(topic$) fh = FREEFILE - OPEN "internal\help\links.bin" FOR BINARY AS #fh + OPEN "internal\help\links.bin" FOR INPUT AS #fh lnks = 0: lnks$ = CHR$(0) DO UNTIL EOF(fh) LINE INPUT #fh, l$ @@ -19821,6 +19858,7 @@ FUNCTION findHelpTopic$(topic$, lnks, firstOnly AS _BYTE) END IF LOOP CLOSE #fh + noLinksFile: findHelpTopic$ = lnks$ END FUNCTION diff --git a/source/ide/wiki/wiki_global.bas b/source/ide/wiki/wiki_global.bas index 5bf5463ec..da2b99853 100644 --- a/source/ide/wiki/wiki_global.bas +++ b/source/ide/wiki/wiki_global.bas @@ -20,6 +20,7 @@ DIM SHARED Help_NewLineIndent DIM SHARED Help_Underline 'Link Types: ' PAGE:wikipagename +' EXTL:external link url DIM SHARED Help_Pos, Help_Wrap_Pos DIM SHARED Help_BG_Col DIM SHARED Help_Col_Normal: Help_Col_Normal = 7 @@ -27,8 +28,9 @@ DIM SHARED Help_Col_Link: Help_Col_Link = 9 DIM SHARED Help_Col_Bold: Help_Col_Bold = 15 DIM SHARED Help_Col_Italic: Help_Col_Italic = 15 DIM SHARED Help_Col_Section: Help_Col_Section = 8 -DIM SHARED Help_Bold, Help_Italic -DIM SHARED Help_LockWrap +DIM SHARED Help_Bold, Help_Italic, Help_DList +DIM SHARED Help_LockWrap, Help_LockParse +DIM SHARED Help_Center, Help_CIndent$ REDIM SHARED Help_LineLen(1) REDIM SHARED Back$(1) REDIM SHARED Back_Name$(1) @@ -48,3 +50,54 @@ DIM SHARED Help_Search_Time AS DOUBLE DIM SHARED Help_Search_Str AS STRING DIM SHARED Help_PageLoaded AS STRING DIM SHARED Help_Recaching, Help_IgnoreCache + +'Unicode replacements +TYPE wikiUtf8Replace + utf8 AS STRING * 4 '= MKI$(reversed hex 2-byte UTF-8 sequence) or MKL$(reversed hex 3/4-byte UTF-8 sequence) + repl AS STRING * 8 '= replacement string (1-8 chars) +END TYPE +DIM SHARED wpUtfRepl(0 TO 50) AS wikiUtf8Replace +DIM SHARED wpUtfReplCnt: wpUtfReplCnt = -1 'wpUtfRepl index counter (pre-increment, hence +'you don't need "wpUtfReplCnt - 1" when used in loops, just do "0 TO wpUtfReplCnt" +'Note: All UTF-8 values must be reversed in MKI$/MKL$, as it flips them to little endian. +' In the wiki text they are noted in big endian, hence we need to pre-flip them. +'2-byte sequences +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKI$(&HA9C2): wpUtfRepl(wpUtfReplCnt).repl = "(c)" 'copyright +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKI$(&HA9C3): wpUtfRepl(wpUtfReplCnt).repl = CHR$(130) 'accent (ι) +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKI$(&HA2C3): wpUtfRepl(wpUtfReplCnt).repl = CHR$(131) 'accent (β) +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKI$(&HA0C3): wpUtfRepl(wpUtfReplCnt).repl = CHR$(133) 'accent (ΰ) +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKI$(&HA5C3): wpUtfRepl(wpUtfReplCnt).repl = CHR$(134) 'accent (ε) +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKI$(&HA7C3): wpUtfRepl(wpUtfReplCnt).repl = CHR$(135) 'accent (η) +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKI$(&HAAC3): wpUtfRepl(wpUtfReplCnt).repl = CHR$(136) 'accent (κ) +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKI$(&HABC3): wpUtfRepl(wpUtfReplCnt).repl = CHR$(137) 'accent (λ) +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKI$(&HA8C3): wpUtfRepl(wpUtfReplCnt).repl = CHR$(138) 'accent (θ) +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKI$(&HAFC3): wpUtfRepl(wpUtfReplCnt).repl = CHR$(139) 'accent (ο) +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKI$(&HAEC3): wpUtfRepl(wpUtfReplCnt).repl = CHR$(140) 'accent (ξ) +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKI$(&HA2C2): wpUtfRepl(wpUtfReplCnt).repl = CHR$(155) 'cents (ψ) +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKI$(&HBDC2): wpUtfRepl(wpUtfReplCnt).repl = CHR$(171) 'fraction (½) +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKI$(&HBCC2): wpUtfRepl(wpUtfReplCnt).repl = CHR$(172) 'fraction (Ό) +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKI$(&HA0C2): wpUtfRepl(wpUtfReplCnt).repl = CHR$(255) 'non-breaking space +'3-byte sequences +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKL$(&HA680E2): wpUtfRepl(wpUtfReplCnt).repl = "..." 'ellipsis +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKL$(&H8C94E2): wpUtfRepl(wpUtfReplCnt).repl = CHR$(218) 'single line draw (top/left corner) +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKL$(&H9094E2): wpUtfRepl(wpUtfReplCnt).repl = CHR$(191) 'single line draw (top/right corner) +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKL$(&H9494E2): wpUtfRepl(wpUtfReplCnt).repl = CHR$(192) 'single line draw (bottom/left corner) +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKL$(&H9894E2): wpUtfRepl(wpUtfReplCnt).repl = CHR$(217) 'single line draw (bottom/right corner) +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKL$(&H8094E2): wpUtfRepl(wpUtfReplCnt).repl = CHR$(196) 'single line draw (horizontal line) +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKL$(&H8294E2): wpUtfRepl(wpUtfReplCnt).repl = CHR$(179) 'single line draw (vertical line) +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKL$(&HB494E2): wpUtfRepl(wpUtfReplCnt).repl = CHR$(193) 'single line draw (hori. line + up connection) +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKL$(&HAC94E2): wpUtfRepl(wpUtfReplCnt).repl = CHR$(194) 'single line draw (hori. line + down connection) +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKL$(&HA494E2): wpUtfRepl(wpUtfReplCnt).repl = CHR$(180) 'single line draw (vert. line + left connection) +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKL$(&H9C94E2): wpUtfRepl(wpUtfReplCnt).repl = CHR$(195) 'single line draw (vert. line + right connection) +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKL$(&HBC94E2): wpUtfRepl(wpUtfReplCnt).repl = CHR$(197) 'single line draw (hori./vert. line cross) +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKL$(&HB296E2): wpUtfRepl(wpUtfReplCnt).repl = CHR$(30) 'triangle up +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKL$(&HBC96E2): wpUtfRepl(wpUtfReplCnt).repl = CHR$(31) 'triangle down +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKL$(&H8497E2): wpUtfRepl(wpUtfReplCnt).repl = CHR$(17) 'triangle left +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKL$(&HBA96E2): wpUtfRepl(wpUtfReplCnt).repl = CHR$(16) 'triangle right +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKL$(&H9186E2): wpUtfRepl(wpUtfReplCnt).repl = CHR$(24) 'arrow up +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKL$(&H9386E2): wpUtfRepl(wpUtfReplCnt).repl = CHR$(25) 'arrow down +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKL$(&H9086E2): wpUtfRepl(wpUtfReplCnt).repl = CHR$(27) 'arrow left +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKL$(&H9286E2): wpUtfRepl(wpUtfReplCnt).repl = CHR$(26) 'arrow right +'4-byte sequences +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKL$(&H80989ff0): wpUtfRepl(wpUtfReplCnt).repl = ":)" 'smily +wpUtfReplCnt = wpUtfReplCnt + 1: wpUtfRepl(wpUtfReplCnt).utf8 = MKL$(&H88989ff0): wpUtfRepl(wpUtfReplCnt).repl = ";)" 'wink diff --git a/source/ide/wiki/wiki_methods.bas b/source/ide/wiki/wiki_methods.bas index 6ae2977a2..9d0cd3d56 100644 --- a/source/ide/wiki/wiki_methods.bas +++ b/source/ide/wiki/wiki_methods.bas @@ -6,27 +6,29 @@ FUNCTION Back2BackName$ (a$) Back2BackName$ = a$ END FUNCTION -FUNCTION Wiki$ (PageName$) +FUNCTION Wiki$ (PageName$) 'Read cached wiki page (download, if not yet cached) Help_PageLoaded$ = PageName$ - PageName2$ = PageName$ - DO WHILE INSTR(PageName2$, " ") - ASC(PageName2$, INSTR(PageName2$, " ")) = 95 - LOOP - DO WHILE INSTR(PageName2$, "&") - i = INSTR(PageName2$, "&") - PageName2$ = LEFT$(PageName2$, i - 1) + "%26" + RIGHT$(PageName2$, LEN(PageName2$) - i) - LOOP - DO WHILE INSTR(PageName2$, "/") - i = INSTR(PageName2$, "/") - PageName2$ = LEFT$(PageName2$, i - 1) + "%2F" + RIGHT$(PageName2$, LEN(PageName2$) - i) - LOOP + 'Escape all invalid and other critical chars in filenames + PageName2$ = "" + FOR i = 1 TO LEN(PageName$) + c = ASC(PageName$, i) + SELECT CASE c + CASE 32 ' '(space) + PageName2$ = PageName2$ + "_" + CASE 34, 38, 42, 47, 58, 60, 62, 63, 92, 124 '("&*/:<>?\|) + PageName2$ = PageName2$ + "%" + HEX$(c) + CASE ELSE + PageName2$ = PageName2$ + CHR$(c) + END SELECT + NEXT + PageName3$ = wikiSafeName$(PageName2$) 'case independent name 'Is this page in the cache? IF Help_IgnoreCache = 0 THEN - IF _FILEEXISTS(Cache_Folder$ + "/" + PageName2$ + ".txt") THEN + IF _FILEEXISTS(Cache_Folder$ + "/" + PageName3$ + ".txt") THEN fh = FREEFILE - OPEN Cache_Folder$ + "/" + PageName2$ + ".txt" FOR BINARY AS #fh + OPEN Cache_Folder$ + "/" + PageName3$ + ".txt" FOR BINARY AS #fh a$ = SPACE$(LOF(fh)) GET #fh, , a$ CLOSE #fh @@ -39,8 +41,8 @@ FUNCTION Wiki$ (PageName$) LOOP IF removedchr13 THEN fh = FREEFILE - OPEN Cache_Folder$ + "/" + PageName2$ + ".txt" FOR OUTPUT AS #fh: CLOSE #fh - OPEN Cache_Folder$ + "/" + PageName2$ + ".txt" FOR BINARY AS #fh + OPEN Cache_Folder$ + "/" + PageName3$ + ".txt" FOR OUTPUT AS #fh: CLOSE #fh + OPEN Cache_Folder$ + "/" + PageName3$ + ".txt" FOR BINARY AS #fh PUT #fh, 1, a$ CLOSE #fh END IF @@ -49,6 +51,7 @@ FUNCTION Wiki$ (PageName$) END IF END IF + 'Check for curl IF _SHELLHIDE("curl --version") <> 0 THEN PCOPY 2, 0 result = idemessagebox("QB64", "Cannot find 'curl'.", "#Abort") @@ -56,6 +59,7 @@ FUNCTION Wiki$ (PageName$) EXIT FUNCTION END IF + 'Download message (Status Bar) IF Help_Recaching = 0 THEN a$ = "Downloading '" + PageName$ + "' page..." IF LEN(a$) > 60 THEN a$ = LEFT$(a$, 57) + STRING$(3, 250) @@ -67,13 +71,14 @@ FUNCTION Wiki$ (PageName$) PCOPY 3, 0 END IF + 'Url query and output arguments for curl url$ = CHR$(34) + wikiBaseAddress$ + "/index.php?title=" + PageName2$ + "&action=edit" + CHR$(34) - outputFile$ = Cache_Folder$ + "/" + PageName2$ + ".txt" - - 'wiki text delimiters: + outputFile$ = Cache_Folder$ + "/" + PageName3$ + ".txt" + 'Wikitext delimiters s1$ = "name=" + CHR$(34) + "wpTextbox1" + CHR$(34) + ">" s2$ = "" + 'Download page using curl SHELL _HIDE "curl -o " + CHR$(34) + outputFile$ + CHR$(34) + " " + url$ fh = FREEFILE OPEN outputFile$ FOR BINARY AS #fh 'get new content @@ -81,39 +86,63 @@ FUNCTION Wiki$ (PageName$) GET #fh, 1, a$ CLOSE #fh + 'Find wikitext in the downloaded page s1 = INSTR(a$, s1$) - IF s1 > 0 THEN - 'clean up downloaded contents - a$ = MID$(a$, s1 + LEN(s1$)) - s2 = INSTR(a$, s2$) - IF s2 > 0 THEN - a$ = LEFT$(a$, s2) - END IF - - OPEN outputFile$ FOR OUTPUT AS #fh 'clear old content - PRINT #fh, a$ 'save clean content + IF s1 > 0 THEN a$ = MID$(a$, s1 + LEN(s1$)): s2 = INSTR(a$, s2$): ELSE s2 = 0 + IF s2 > 0 THEN a$ = LEFT$(a$, s2 - 1) + IF s1 > 0 AND s2 > 0 AND a$ <> "" THEN + 'If wikitext was found, then substitute stuff & save it + '--- first HTML specific entities + WHILE INSTR(a$, "&") > 0 ' '& must be first and looped until all + a$ = StrReplace$(a$, "&", "&") 'multi-escapes are resolved (eg. &lt; &amp;lt; etc.) + WEND + a$ = StrReplace$(a$, "<", "<") + a$ = StrReplace$(a$, ">", ">") + a$ = StrReplace$(a$, """, CHR$(34)) + '--- then other entities + a$ = StrReplace$(a$, "|", "|") + a$ = StrReplace$(a$, "π", CHR$(227)) + a$ = StrReplace$(a$, "θ", CHR$(233)) + a$ = StrReplace$(a$, "¹", CHR$(252)) + a$ = StrReplace$(a$, "²", CHR$(253)) + a$ = StrReplace$(a$, " ", CHR$(255)) + '--- useless styles in blocks + a$ = StrReplace$(a$, "Start}}'' ''", "Start}}") + a$ = StrReplace$(a$, "Start}} '' ''", "Start}}") + a$ = StrReplace$(a$, "Start}}" + CHR$(10) + "'' ''", "Start}}") + a$ = StrReplace$(a$, "'' ''" + CHR$(10) + "{{", CHR$(10) + "{{") + a$ = StrReplace$(a$, "'' '' " + CHR$(10) + "{{", CHR$(10) + "{{") + a$ = StrReplace$(a$, "'' ''" + MKI$(&H0A0A) + "{{", CHR$(10) + "{{") + '--- wiki redirects + a$ = StrReplace$(a$, "#REDIRECT", "See page") + '--- put a download date/time entry + a$ = "{{QBDLDATE:" + DATE$ + "}}" + CHR$(10) + "{{QBDLTIME:" + TIME$ + "}}" + CHR$(10) + a$ + '--- now save it + OPEN outputFile$ FOR OUTPUT AS #fh + PRINT #fh, a$ CLOSE #fh + ELSE + 'Delete page, if empty or corrupted (force re-download on next access) + KILL outputFile$ + a$ = CHR$(10) + "{{PageInternalError}}" + CHR$(10) +_ + "* Either the requested page is not yet available in the Wiki," + CHR$(10) +_ + "* or the download from Wiki failed and corrupted the page data." + CHR$(10) +_ + "** You may try ''Update Current Page'' from the ''Help'' menu." + CHR$(10) END IF Wiki$ = a$ - EXIT FUNCTION END FUNCTION -SUB Help_AddTxt (t$, col, link) - +SUB Help_AddTxt (t$, col, link) 'Add help text, handle word wrap IF t$ = CHR$(13) THEN Help_NewLine: EXIT SUB FOR i = 1 TO LEN(t$) - c = ASC(t$, i) + IF Help_LockParse = 0 AND Help_LockWrap = 0 THEN - IF Help_BG_Col = 0 AND Help_LockWrap = 0 THEN - - 'addtxt handles all wrapping issues IF c = 32 THEN - - IF Help_Pos = Help_ww THEN Help_NewLine: GOTO special + IF Help_Pos = Help_ww THEN Help_NewLine: _CONTINUE Help_Txt_Len = Help_Txt_Len + 1: ASC(Help_Txt$, Help_Txt_Len) = 32 Help_Txt_Len = Help_Txt_Len + 1: ASC(Help_Txt$, Help_Txt_Len) = col + Help_BG_Col * 16 @@ -121,8 +150,7 @@ SUB Help_AddTxt (t$, col, link) Help_Txt_Len = Help_Txt_Len + 1: ASC(Help_Txt$, Help_Txt_Len) = link \ 256 Help_Wrap_Pos = Help_Txt_Len 'pos to backtrack to when wrapping content - Help_Pos = Help_Pos + 1 - GOTO special + Help_Pos = Help_Pos + 1: _CONTINUE END IF IF Help_Pos > Help_ww THEN @@ -141,21 +169,18 @@ SUB Help_AddTxt (t$, col, link) END IF END IF - END IF 'bg_col=0 + END IF - c = ASC(t$, i) Help_Txt_Len = Help_Txt_Len + 1: ASC(Help_Txt$, Help_Txt_Len) = c Help_Txt_Len = Help_Txt_Len + 1: ASC(Help_Txt$, Help_Txt_Len) = col + Help_BG_Col * 16 Help_Txt_Len = Help_Txt_Len + 1: ASC(Help_Txt$, Help_Txt_Len) = link AND 255 Help_Txt_Len = Help_Txt_Len + 1: ASC(Help_Txt$, Help_Txt_Len) = link \ 256 Help_Pos = Help_Pos + 1 - special: NEXT - END SUB -SUB Help_NewLine +SUB Help_NewLine 'Start a new help line, apply indention (if any) IF Help_Pos > help_w THEN help_w = Help_Pos Help_Txt_Len = Help_Txt_Len + 1: ASC(Help_Txt$, Help_Txt_Len) = 13 @@ -168,116 +193,149 @@ SUB Help_NewLine Help_Wrap_Pos = 0 IF Help_Underline THEN - Help_Underline = 0 w = Help_Pos Help_Pos = 1 - Help_AddTxt STRING$(w - 1, 196), Help_Col, 0 + IF Help_Underline = Help_Col_Section THEN + Help_AddTxt STRING$(w - 1, 205), Help_Underline, 0 + ELSE + Help_AddTxt STRING$(w - 1, 196), Help_Underline, 0 + END IF + Help_Underline = 0 'keep before Help_NewLine (recursion) Help_NewLine END IF Help_Pos = 1 - IF Help_NewLineIndent THEN + IF Help_Center > 0 THEN 'center overrides regular indent + Help_NewLineIndent = 0 + Help_AddTxt SPACE$(ASC(Help_CIndent$, 1)), Help_Col, 0 + Help_CIndent$ = MID$(Help_CIndent$, 2) + ELSEIF Help_NewLineIndent > 0 THEN Help_AddTxt SPACE$(Help_NewLineIndent), Help_Col, 0 END IF - - END SUB -SUB Help_PreView +SUB Help_CheckFinishLine 'Make sure the current help line is finished + IF Help_Txt_Len >= 4 THEN + IF ASC(Help_Txt$, Help_Txt_Len - 3) <> 13 THEN Help_NewLine + END IF +END SUB - OPEN "help_preview.txt" FOR OUTPUT AS #1 - FOR i = 1 TO LEN(Help_Txt$) STEP 4 - c = ASC(Help_Txt$, i) - c$ = CHR$(c) - IF c = 13 THEN c$ = CHR$(13) + CHR$(10) - PRINT #1, c$; - NEXT - CLOSE #1 +SUB Help_CheckBlankLine 'Make sure the last help line is a blank line (implies finish current) + IF Help_Txt_Len >= 8 THEN + IF ASC(Help_Txt$, Help_Txt_Len - 3) <> 13 THEN Help_NewLine + IF ASC(Help_Txt$, Help_Txt_Len - 7) <> 13 THEN Help_NewLine + END IF +END SUB - CLS - FOR i = 1 TO LEN(Help_Txt$) STEP 4 - c = ASC(Help_Txt$, i) - col = ASC(Help_Txt$, i + 1) - IF c = 13 THEN - COLOR col AND 15, col \ 16 - PRINT SPACE$(help_w - POS(0)); - COLOR 7, 0 - PRINT SPACE$(_WIDTH - POS(0) + 1); - COLOR col AND 15, col \ 16 - SLEEP - ELSE - COLOR col AND 15, col \ 16 - PRINT CHR$(c); +SUB Help_CheckRemoveBlankLine 'If the last help line is blank, then remove it + IF Help_Txt_Len >= 8 THEN + IF ASC(Help_Txt$, Help_Txt_Len - 3) = 13 THEN + Help_Txt_Len = Help_Txt_Len - 4 + help_h = help_h - 1 + Help_Line$ = LEFT$(Help_Line$, LEN(Help_Line$) - 4) END IF - NEXT + FOR i = Help_Txt_Len - 3 TO 1 STEP -4 + IF ASC(Help_Txt$, i) <> 32 THEN + Help_Txt_Len = i + 3: EXIT FOR + END IF + NEXT + IF ASC(Help_Txt$, Help_Txt_Len - 3) <> 13 THEN Help_NewLine + END IF END SUB - -FUNCTION Help_Col 'helps to calculate the default color +FUNCTION Help_Col 'Helps to calculate the default color col = Help_Col_Normal IF Help_Italic THEN col = Help_Col_Italic IF Help_Bold THEN col = Help_Col_Bold 'Note: Bold overrides italic Help_Col = col END FUNCTION +SUB WikiParse (a$) 'Wiki page interpret - -SUB WikiParse (a$) - 'PRINT "Parsing...": _DISPLAY - - 'wiki page interpret - - 'clear info + 'Clear info help_h = 0: help_w = 0: Help_Line$ = "": Help_Link$ = "": Help_LinkN = 0 Help_Txt$ = SPACE$(1000000) Help_Txt_Len = 0 Help_Pos = 1: Help_Wrap_Pos = 0 Help_Line$ = MKL$(1) + 'Word wrap locks (lock wrapping only, but continue parsing regularly) Help_LockWrap = 0 + 'Parser locks (neg: soft lock, zero: unlocked, pos: hard lock) + 'hard: 2 = inside code blocks, 1 = inside output blocks + 'soft: -1 = inside text blocks, -2 = inside fixed blocks + '=> all parser locks also imply a wrapping lock + '=> hard locks almost every parsing except utf-8 substitution and line breaks + '=> soft allows all elements not disrupting the current block, hence only + ' paragraph creating things are locked (eg. headings, lists, rulers etc.), + ' but text styles, links and template processing is still possible + Help_LockParse = 0 Help_Bold = 0: Help_Italic = 0 Help_Underline = 0 Help_BG_Col = 0 + Help_Center = 0: Help_CIndent$ = "" + Help_DList = 0 - link = 0: elink = 0: cb = 0 + link = 0: elink = 0: cb = 0: nl = 1 col = Help_Col 'Syntax Notes: - ' '''=bold - ' ''=italic - ' {{macroname|macroparam}} or simply {{macroname}} - ' eg. {{KW|PRINT}}=a key word, a link to a page - ' {{Cl|PRINT}}=a key word in a code example, will be printed in bold and aqua - ' {{Parameter|expression}}=a parameter, in italics - ' {{PageSyntax}} {{PageParameters}} {{PageDescription}} {{PageExamples}} - ' {{CodeStart}} {{CodeEnd}} {{OutputStart}} {{OutputEnd}} - ' {{PageSeeAlso}} {{PageNavigation}} {{PageLegacySupport}} - ' {{PageQBasic}} {{PageAvailability}} - ' [[SPACE$]]=a link to wikipage called "SPACE$" - ' [[INTEGER|integer]]=a link, link's name is on left and text to appear is on right - ' *=a dot point - ' **=a sub(ie. further indented) dot point - ' "=a quotation mark - ' :=indent (if beginning a new line) - ' CHR$(10)=new line character + '============= + 'everywhere in text + '------------------ + ' ''' = bold text style + ' '' = italic text style + ' [url text] = external link to url with text to appear (url ends at 1st found space) + ' [[page]] = link to another wikipage + ' [[page|text]] = link to another wikipage with alternative text to appear + ' {{templatename|param|param|param}} or simply {{templatename}} = predefined styles + '--------------------- + 'at start of line only + '--------------------- + ' * = dot list point + ' ** = sub (ie. further indented) dot list point + ' ;def:desc = full definition/description list + ' :desc = description only, but indented as in a full def/desc list + ' ;* def:desc = combi list, list dot always belongs to description + ' :* desc = combi, description only - prefetch = 16 + 'First find and write the page title and last update + d$ = "Page not yet updated, expect visual glitches.": i = INSTR(a$, "{{QBDLDATE:") + IF i > 0 THEN + d$ = "Last updated: " + MID$(a$, i + 11, INSTR(i + 11, a$, "}}") - i - 11) + i = INSTR(a$, "{{QBDLTIME:") + IF i > 0 THEN d$ = d$ + ", at " + MID$(a$, i + 11, INSTR(i + 11, a$, "}}") - i - 11) + ELSEIF INSTR(a$, "{{PageInternalError}}") > 0 THEN + d$ = "Page not found." + END IF + t$ = Help_PageLoaded$: i = INSTR(a$, "{{DISPLAYTITLE:") + IF i > 0 THEN t$ = MID$(a$, i + 15, INSTR(i + 15, a$, "}}") - i - 15) + IF LEFT$(t$, 4) = "agp@" THEN + d$ = "Auto-generated temporary page." + t$ = MID$(t$, 5) + END IF + i = LEN(d$): ii = LEN(t$) + Help_AddTxt " Ϊ" + STRING$(ii + 2, "Δ") + "Ώ", 14, 0: Help_NewLine + Help_AddTxt " ³ ", 14, 0: Help_AddTxt t$, 12, 0: Help_AddTxt " ³", 14, 0 + Help_AddTxt SPACE$(Help_ww - i - 2 - Help_Pos) + CHR$(4), 14, 0 + IF LEFT$(d$, 4) = "Page" THEN i = 8: ELSE i = 7 + Help_AddTxt " " + d$, i, 0: Help_NewLine + Help_AddTxt "ΔΔΔΑ" + STRING$(ii + 2, "Δ") + "Α" + STRING$(Help_ww - ii - 7, "Δ"), 14, 0: Help_NewLine + + 'Init prefetch array + prefetch = 20 DIM c$(prefetch) FOR ii = 1 TO prefetch c$(ii) = SPACE$(ii) NEXT - i = INSTR(a$, "") + 1) - i = INSTR(a$, "") + IF INSTR(wla$, "#toc") > 0 OR INSTR(wla$, "to Top") > 0 THEN + i = i + LEN(wla$) + 9 'ignore TOC links + ELSE + Help_Center = 1: Help_CIndent$ = wikiBuildCIndent$(wla$) + Help_AddTxt SPACE$(ASC(Help_CIndent$, 1)), col, 0 'center content + Help_CIndent$ = MID$(Help_CIndent$, 2) + END IF + GOTO charDone END IF - - s$ = "&" + s$ = "
" IF c$(LEN(s$)) = s$ THEN i = i + LEN(s$) - 1 - c$ = "&": c = ASC(c$) - GOTO SpecialChr + Help_Center = 0 + Help_NewLine + GOTO charDone END IF - - s$ = ">" + s$ = "

": c = ASC(c$) - GOTO SpecialChr + FOR ii = i TO LEN(a$) - 1 + IF MID$(a$, ii, 1) = ">" THEN + wla$ = wikiLookAhead$(a$, ii + 1, "

") + IF INSTR(wla$, "#toc") > 0 OR INSTR(wla$, "to Top") > 0 THEN + i = ii + LEN(wla$) + 4 'ignore TOC links + ELSEIF INSTR(MID$(a$, i, ii - i), "center") > 0 THEN + Help_Center = 1: Help_CIndent$ = wikiBuildCIndent$(wla$) + Help_AddTxt SPACE$(ASC(Help_CIndent$, 1)), col, 0 'center (if in style) + Help_CIndent$ = MID$(Help_CIndent$, 2) + i = ii + END IF + EXIT FOR + END IF + NEXT + GOTO charDone + END IF + s$ = "

" + IF c$(LEN(s$)) = s$ THEN + i = i + LEN(s$) - 1 + Help_Center = 0 + Help_NewLine + GOTO charDone + END IF + s$ = " 0 THEN + etext$ = RIGHT$(elink$, LEN(elink$) - i2) + elink$ = LEFT$(elink$, i2 - 1) + END IF - s$ = "</center>" - IF c$(LEN(s$)) = s$ THEN - i = i + LEN(s$) - 1 - GOTO Special + Help_LinkN = Help_LinkN + 1 + Help_Link$ = Help_Link$ + "EXTL:" + elink$ + Help_Link_Sep$ + + IF Help_LockParse = 0 THEN + Help_AddTxt etext$, Help_Col_Link, Help_LinkN + ELSE + Help_AddTxt etext$, Help_Col_Bold, Help_LinkN + END IF + GOTO charDone + END IF + elink$ = elink$ + c$ + GOTO charDone END IF - - s$ = "<nowiki>" - IF c$(LEN(s$)) = s$ THEN - i = i + LEN(s$) - 1 - GOTO Special - END IF - - s$ = "</nowiki>" - IF c$(LEN(s$)) = s$ THEN - i = i + LEN(s$) - 1 - GOTO Special - END IF - - - s$ = "<p style=" - IF c$(LEN(s$)) = s$ THEN - i = i + LEN(s$) - 1 - FOR ii = i TO LEN(a$) - 1 - IF MID$(a$, ii, 1) = ">" THEN i = ii: EXIT FOR - NEXT - GOTO Special - END IF - - s$ = "</p" - IF c$(LEN(s$)) = s$ THEN - i = i + LEN(s$) - 1 - FOR ii = i TO LEN(a$) - 1 - IF MID$(a$, ii, 1) = ">" THEN i = ii: EXIT FOR - NEXT - GOTO Special - END IF - - s$ = "<div" - IF c$(LEN(s$)) = s$ THEN - i = i + LEN(s$) - 1 - FOR ii = i TO LEN(a$) - 1 - IF MID$(a$, ii, 9) = "</div>" THEN i = ii + 8: EXIT FOR - NEXT - GOTO Special - END IF - - s$ = "<" - IF c$(LEN(s$)) = s$ THEN - i = i + LEN(s$) - 1 - c$ = "<": c = ASC(c$) - GOTO SpecialChr - END IF - SpecialChr: - END IF 'c=38 '"&" - - 'Links - IF c = 91 THEN '"[" + 'Internal links IF c$(2) = "[[" AND link = 0 THEN i = i + 1 link = 1 link$ = "" - GOTO Special + GOTO charDone END IF END IF + 'However, the internal link logic must run always, as it also handles + 'the template {{Cb|, {{Cl| and {{KW| links used in code blocks IF link = 1 THEN IF c$(2) = "]]" OR c$(2) = "}}" THEN i = i + 1 link = 0 text$ = link$ i2 = INSTR(link$, "|") - IF i2 THEN + IF i2 > 0 THEN text$ = RIGHT$(link$, LEN(link$) - i2) link$ = LEFT$(link$, i2 - 1) END IF - IF INSTR(link$, "#") THEN 'local page links not supported yet + IF INSTR(link$, "#") THEN 'local page links not supported Help_AddTxt text$, 8, 0 - GOTO Special + GOTO charDone + ELSEIF LEFT$(link$, 9) = "Category:" THEN 'ignore category links + Help_CheckRemoveBlankLine + GOTO charDone END IF Help_LinkN = Help_LinkN + 1 Help_Link$ = Help_Link$ + "PAGE:" + link$ + Help_Link_Sep$ - IF Help_BG_Col = 0 THEN + IF Help_LockParse = 0 THEN Help_AddTxt text$, Help_Col_Link, Help_LinkN ELSE Help_AddTxt text$, Help_Col_Bold, Help_LinkN END IF - GOTO Special + GOTO charDone END IF link$ = link$ + c$ - GOTO Special + GOTO charDone END IF - - 'External links - IF c = 91 THEN '"[" - IF c$(6) = "[http:" AND elink = 0 THEN - elink = 2 - elink$ = "" - GOTO Special - END IF - END IF - IF elink = 2 THEN - IF c$ = " " THEN - elink = 1 - GOTO Special - END IF - elink$ = elink$ + c$ - GOTO Special - END IF - IF elink >= 1 THEN - IF c$ = "]" THEN - elink = 0 - elink$ = " " + elink$ - Help_LockWrap = 1: Help_Wrap_Pos = 0 - Help_AddTxt elink$, 8, 0 - Help_LockWrap = 0 - elink$ = "" - GOTO Special + 'Wiki tables ({|...|}) are not handled in Code/Output blocks (hard lock), + 'as everything could be part of the code example itself + IF Help_LockParse <= 0 THEN + 'Tables (ignored, give info, if not in blocks) + IF c$(2) = "{|" THEN + wla$ = wikiLookAhead$(a$, i + 2, "|}"): iii = 0 + FOR ii = 1 TO LEN(wla$) + IF MID$(wla$, ii, 1) = "|" AND MID$(wla$, ii, 2) <> "|-" THEN iii = iii + 1 + NEXT + i = i + 1 + LEN(wla$) + 2 + IF iii > 1 OR INSTR(wla$, "__TOC__") = 0 THEN 'ignore TOC only tables + IF Help_LockParse = 0 THEN + Help_AddTxt SPACE$((Help_ww - 52) \ 2) + "ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»", 8, 0: Help_NewLine + Help_AddTxt SPACE$((Help_ww - 52) \ 2) + "Ί ", 8, 0: Help_AddTxt "The original help page has a table here, please ", 15, 0: Help_AddTxt " Ί", 8, 0: Help_NewLine + Help_AddTxt SPACE$((Help_ww - 52) \ 2) + "Ί ", 8, 0: Help_AddTxt "use the ", 15, 0: ii = Help_BG_Col: Help_BG_Col = 3: Help_AddTxt " View on Wiki ", 15, 0: Help_BG_Col = ii: Help_AddTxt " button in the upper right", 15, 0: Help_AddTxt " Ί", 8, 0: Help_NewLine + Help_AddTxt SPACE$((Help_ww - 52) \ 2) + "Ί ", 8, 0: Help_AddTxt "corner to load the page into your browser. ", 15, 0: Help_AddTxt " Ί", 8, 0: Help_NewLine + Help_AddTxt SPACE$((Help_ww - 52) \ 2) + "ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ", 8, 0 + END IF + END IF + GOTO charDone END IF END IF - IF c = 123 THEN '"{" - IF c$(5) = "{{KW|" THEN 'this is really a link! - i = i + 4 - link = 1 - link$ = "" - GOTO Special - END IF - IF c$(5) = "{{Cl|" THEN 'this is really a link too (in code example) - i = i + 4 - link = 1 - link$ = "" - GOTO Special - END IF - IF c$(2) = "{{" THEN - i = i + 1 - cb = 1 - cb$ = "" - GOTO Special - END IF + 'Wiki templates are handled always, as these are the basic building blocks of all + 'the wiki pages, but look for special conditions inside (Help_LockParse checks) + IF c$(5) = "{{Cb|" OR c$(5) = "{{Cl|" OR c$(5) = "{{KW|" THEN 'just nice wrapped links + i = i + 4 ' 'KW is deprecated (but kept for existing pages) + link = 1 + link$ = "" + GOTO charDone END IF - - IF cb = 1 THEN + IF c$(2) = "{{" THEN 'any other templates + i = i + 1 + cb = 1 + cb$ = "" + GOTO charDone + END IF + IF cb > 0 THEN IF c$ = "|" OR c$(2) = "}}" THEN - IF c$(2) = "}}" THEN i = i + 1 - cb = 0 - - IF cb$ = "PageSyntax" THEN Help_AddTxt "Syntax:" + CHR$(13), Help_Col_Section, 0 - IF cb$ = "PageParameters" THEN Help_AddTxt "Parameters:" + CHR$(13), Help_Col_Section, 0 - IF cb$ = "PageDescription" THEN Help_AddTxt "Description:" + CHR$(13), Help_Col_Section, 0 - IF cb$ = "PageAvailability" THEN Help_AddTxt "Availability:" + CHR$(13), Help_Col_Section, 0 - IF cb$ = "PageExamples" THEN Help_AddTxt "Code Examples:" + CHR$(13), Help_Col_Section, 0 - IF cb$ = "PageSeeAlso" THEN Help_AddTxt "See also:" + CHR$(13), Help_Col_Section, 0 - IF cb$ = "PageLegacySupport" THEN Help_AddTxt "Legacy support" + CHR$(13), Help_Col_Section, 0 - IF cb$ = "PageQBasic" THEN Help_AddTxt "QBasic/QuickBASIC" + CHR$(13), Help_Col_Section, 0 - - IF cb$ = "CodeStart" THEN - Help_NewLine - Help_BG_Col = 1 - 'Skip non-meaningful content before section begins - ws = 1 - FOR ii = i + 1 TO LEN(a$) - IF ASC(a$, ii) = 10 THEN EXIT FOR - IF ASC(a$, ii) <> 32 AND ASC(a$, ii) <> 39 THEN ws = 0 - NEXT - IF ws THEN i = ii - END IF - IF cb$ = "CodeEnd" THEN Help_BG_Col = 0 - IF cb$ = "OutputStart" THEN - Help_NewLine - Help_BG_Col = 2 - 'Skip non-meaningful content before section begins - ws = 1 - FOR ii = i + 1 TO LEN(a$) - IF ASC(a$, ii) = 10 THEN EXIT FOR - IF ASC(a$, ii) <> 32 AND ASC(a$, ii) <> 39 THEN ws = 0 - NEXT - IF ws THEN i = ii - END IF - IF cb$ = "OutputEnd" THEN Help_BG_Col = 0 - - GOTO Special - - END IF - - cb$ = cb$ + c$ 'reading maro name - GOTO Special - END IF 'cb=1 - - IF c$(2) = "}}" THEN 'probably the end of a text section of macro'd text - i = i + 1 - GOTO Special - END IF - - - - IF c$(4) = " == " THEN - i = i + 3 - Help_Underline = 1 - GOTO Special - END IF - IF c$(3) = "== " THEN - i = i + 2 - Help_Underline = 1 - GOTO Special - END IF - IF c$(3) = " ==" THEN - i = i + 2 - GOTO Special - END IF - IF c$(2) = "==" THEN - i = i + 1 - Help_Underline = 1 - GOTO Special - END IF - - - IF c$(3) = "'''" THEN - i = i + 2 - IF Help_Bold = 0 THEN Help_Bold = 1 ELSE Help_Bold = 0 - col = Help_Col - GOTO Special - END IF - - IF c$(2) = "''" THEN - i = i + 1 - IF Help_Italic = 0 THEN Help_Italic = 1 ELSE Help_Italic = 0 - col = Help_Col - GOTO Special - END IF - - IF nl = 1 THEN - - IF c$(3) = "** " THEN - i = i + 2 - Help_AddTxt " " + CHR$(254) + " ", col, 0 - Help_NewLineIndent = Help_NewLineIndent + 6 - GOTO Special - END IF - IF c$(2) = "* " THEN - i = i + 1 - Help_AddTxt CHR$(254) + " ", col, 0 - Help_NewLineIndent = Help_NewLineIndent + 2 - GOTO Special - END IF - IF c$(2) = "**" THEN - i = i + 1 - Help_AddTxt " " + CHR$(254) + " ", col, 0 - Help_NewLineIndent = Help_NewLineIndent + 6 - GOTO Special - END IF - IF c$ = "*" THEN - Help_AddTxt CHR$(254) + " ", col, 0 - Help_NewLineIndent = Help_NewLineIndent + 2 - GOTO Special - END IF - - END IF - - s$ = "{|" - IF c$(LEN(s$)) = s$ THEN - IF MID$(a$, i, 20) = "{| class=" + CHR$(34) + "wikitable" + CHR$(34) THEN - REDIM tableRow(1 TO 100) AS STRING - REDIM tableCol(1 TO 100) AS INTEGER - DIM totalCols AS INTEGER - DIM totalRows AS INTEGER - DIM thisCol AS INTEGER - totalCols = 0: totalRows = 0 - DO - l$ = wikiGetLine$(a$, i) - IF l$ = "|}" OR i >= LEN(a$) THEN EXIT DO - IF l$ = "|-" THEN _CONTINUE - - m$ = "" - IF LEFT$(l$, 2) = "! " THEN m$ = "!!" - IF LEFT$(l$, 2) = "| " THEN m$ = "||" - - IF LEN(m$) THEN - 'new row - totalRows = totalRows + 1 - IF totalRows > UBOUND(tableRow) THEN - REDIM _PRESERVE tableRow(1 TO UBOUND(tableRow) + 99) AS STRING + IF c$ = "|" AND cb = 2 THEN + wla$ = wikiLookAhead$(a$, i + 1, "}}") + cb = 0: i = i + LEN(wla$) + 2 'after 1st, ignore all further template parameters + ELSEIF c$(2) = "}}" THEN + IF LCASE$(LEFT$(cb$, 5)) = "small" THEN + IF ASC(cb$, 6) = 196 THEN + Help_AddTxt " " + STRING$(Help_ww - Help_Pos, 196), 15, 0 + Help_BG_Col = 0: col = Help_Col + ELSE + Help_Center = 0 END IF + Help_NewLine: cb$ = "" 'avoid reactivation below + END IF + cb = 0: i = i + 1 + END IF + IF c$ = "|" AND cb = 1 THEN cb = 2 - 'columns - j = 3 - thisCol = 0 - DO - p$ = wikiGetUntil$(l$, j, m$) - j = j + 1 - IF LEN(_TRIM$(p$)) THEN - thisCol = thisCol + 1 - IF totalCols < thisCol THEN totalCols = thisCol - IF thisCol > UBOUND(tableCol) THEN - REDIM _PRESERVE tableCol(1 TO UBOUND(tableCol) + 99) AS INTEGER - END IF - IF tableCol(thisCol) < LEN(_TRIM$(p$)) + 2 THEN tableCol(thisCol) = LEN(_TRIM$(p$)) + 2 - tableRow(totalRows) = tableRow(totalRows) + _TRIM$(p$) + CHR$(0) + IF Help_LockParse = 0 THEN 'no section headings in blocks + cbo$ = "" + 'Standard section headings (section color, h3 w/o underline, h2 with underline) + 'Recommended order of main page sections (h2) with it's considered sub-sections (h3) + IF cb$ = "PageSyntax" THEN cbo$ = "Syntax:" + IF cb$ = "PageLegacySupport" THEN cbo$ = "Legacy support" 'sub-sect + IF cb$ = "PageParameters" OR cb$ = "Parameters" THEN cbo$ = "Parameters:" 'w/o Page suffix is deprecated (but kept for existing pages) + IF cb$ = "PageDescription" THEN cbo$ = "Description:" + IF cb$ = "PageQBasic" THEN cbo$ = "QBasic/QuickBASIC" 'sub-sect + IF cb$ = "PageNotes" THEN cbo$ = "Notes" 'sub-sect + IF cb$ = "PageErrors" THEN cbo$ = "Errors" 'sub-sect + IF cb$ = "PageUseWith" THEN cbo$ = "Use with" 'sub-sect + IF cb$ = "PageAvailability" THEN cbo$ = "Availability:" + IF cb$ = "PageExamples" THEN cbo$ = "Examples:" + IF cb$ = "PageSeeAlso" THEN cbo$ = "See also:" + 'Independent main page end sections (centered, no title) + IF cb$ = "PageCopyright" THEN cbo$ = "Copyright" + IF cb$ = "PageNavigation" THEN cbo$ = "" 'ignored for built-in help + 'Internally used templates (not available in Wiki) + IF cb$ = "PageInternalError" THEN cbo$ = "Sorry, an error occurred:" + '---------- + IF cbo$ <> "" THEN + IF RIGHT$(cbo$, 1) = ":" THEN Help_Underline = Help_Col_Section + Help_AddTxt cbo$, Help_Col_Section, 0: Help_NewLine + IF cbo$ = "Copyright" THEN '_gl commands only + Help_NewLine: Help_AddTxt "1991-2006 Silicon Graphics, Inc.", 7, 0: Help_NewLine + Help_AddTxt "This document is licensed under the SGI Free Software B License.", 7, 0: Help_NewLine + Help_AddTxt "https://spdx.org/licenses/SGI-B-2.0.html https://spdx.org/licenses/SGI-B-2.0.html", 15, 0: Help_NewLine + END IF + END IF + END IF + + 'Code Block + IF cb$ = "InlineCode" AND Help_LockParse = 0 THEN + Help_BG_Col = 1: Help_LockParse = 2 + END IF + IF cb$ = "InlineCodeEnd" AND Help_LockParse <> 0 THEN + Help_BG_Col = 0: Help_LockParse = 0 + Help_Bold = 0: Help_Italic = 0: col = Help_Col + END IF + IF cb$ = "CodeStart" AND Help_LockParse = 0 THEN + Help_CheckBlankLine + Help_BG_Col = 1: Help_LockParse = 2 + Help_AddTxt STRING$(Help_ww - 15, 196) + " Code Block " + STRING$(3, 196), 15, 0: Help_NewLine + IF c$(3) = "}}" + CHR$(10) THEN i = i + 1 + END IF + IF cb$ = "CodeEnd" AND Help_LockParse <> 0 THEN + Help_CheckFinishLine: Help_CheckRemoveBlankLine + Help_AddTxt STRING$(Help_ww, 196), 15, 0: Help_NewLine + Help_BG_Col = 0: Help_LockParse = 0 + Help_Bold = 0: Help_Italic = 0: col = Help_Col + END IF + 'Output Block + IF LEFT$(cb$, 11) = "OutputStart" AND Help_LockParse = 0 THEN 'does also match new OutputStartBGn templates + Help_CheckBlankLine + Help_BG_Col = 2: Help_LockParse = 1 + Help_AddTxt STRING$(Help_ww - 17, 196) + " Output Block " + STRING$(3, 196), 15, 0: Help_NewLine + IF c$(3) = "}}" + CHR$(10) THEN i = i + 1 + END IF + IF cb$ = "OutputEnd" AND Help_LockParse <> 0 THEN + Help_CheckFinishLine: Help_CheckRemoveBlankLine + Help_AddTxt STRING$((Help_ww - 54) \ 2, 196), 15, 0 + Help_AddTxt " This block does not reflect the actual output colors ", 15, 0 + Help_AddTxt STRING$(Help_ww - Help_Pos + 1, 196), 15, 0: Help_NewLine + Help_BG_Col = 0: Help_LockParse = 0 + Help_Bold = 0: Help_Italic = 0: col = Help_Col + END IF + 'Text Block + IF cb$ = "TextStart" AND Help_LockParse = 0 THEN + Help_CheckBlankLine + Help_BG_Col = 6: Help_LockParse = -1 + Help_AddTxt STRING$(Help_ww - 15, 196) + " Text Block " + STRING$(3, 196), 15, 0: Help_NewLine + IF c$(3) = "}}" + CHR$(10) THEN i = i + 1 + END IF + IF cb$ = "TextEnd" AND Help_LockParse <> 0 THEN + Help_CheckFinishLine: Help_CheckRemoveBlankLine + Help_AddTxt STRING$(Help_ww, 196), 15, 0: Help_NewLine + Help_BG_Col = 0: Help_LockParse = 0 + Help_Bold = 0: Help_Italic = 0: col = Help_Col + END IF + 'Fixed Block + IF (cb$ = "FixedStart" OR cb$ = "WhiteStart") AND Help_LockParse = 0 THEN 'White is deprecated (but kept for existing pages) + Help_CheckBlankLine + Help_BG_Col = 6: Help_LockParse = -2 + Help_AddTxt STRING$(Help_ww - 16, 196) + " Fixed Block " + STRING$(3, 196), 15, 0: Help_NewLine + IF c$(3) = "}}" + CHR$(10) THEN i = i + 1 + END IF + IF (cb$ = "FixedEnd" OR cb$ = "WhiteEnd") AND Help_LockParse <> 0 THEN 'White is deprecated (but kept for existing pages) + Help_CheckFinishLine: Help_CheckRemoveBlankLine + Help_AddTxt STRING$(Help_ww, 196), 15, 0: Help_NewLine + Help_BG_Col = 0: Help_LockParse = 0 + Help_Bold = 0: Help_Italic = 0: col = Help_Col + END IF + + 'Template wrapped table + IF RIGHT$(cb$, 5) = "Table" AND Help_LockParse = 0 THEN 'no table info in blocks + Help_AddTxt SPACE$((Help_ww - 52) \ 2) + "ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»", 8, 0: Help_NewLine + Help_AddTxt SPACE$((Help_ww - 52) \ 2) + "Ί ", 8, 0: Help_AddTxt "The original help page has a table here, please ", 15, 0: Help_AddTxt " Ί", 8, 0: Help_NewLine + Help_AddTxt SPACE$((Help_ww - 52) \ 2) + "Ί ", 8, 0: Help_AddTxt "use the ", 15, 0: ii = Help_BG_Col: Help_BG_Col = 3: Help_AddTxt " View on Wiki ", 15, 0: Help_BG_Col = ii: Help_AddTxt " button in the upper right", 15, 0: Help_AddTxt " Ί", 8, 0: Help_NewLine + Help_AddTxt SPACE$((Help_ww - 52) \ 2) + "Ί ", 8, 0: Help_AddTxt "corner to load the page into your browser. ", 15, 0: Help_AddTxt " Ί", 8, 0: Help_NewLine + Help_AddTxt SPACE$((Help_ww - 52) \ 2) + "ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ", 8, 0 + END IF + + 'Small template text will be centered (maybe as block note) + IF LCASE$(cb$) = "small" AND Help_LockParse <= 0 THEN 'keep as is in Code/Output blocks + wla$ = wikiLookAhead$(a$, i + 1, "}}") + Help_CIndent$ = wikiBuildCIndent$(wla$): iii = 0 + IF i > 31 AND ASC(Help_CIndent$, 1) >= Help_ww / 4 THEN + IF INSTR(MID$(a$, i - 30, 30), "{{CodeEnd}}") > 0 THEN iii = -1 + IF INSTR(MID$(a$, i - 30, 30), "{{TextEnd}}") > 0 THEN iii = -6 + IF INSTR(MID$(a$, i - 31, 31), "{{FixedEnd}}") > 0 THEN iii = -6 + IF INSTR(MID$(a$, i - 31, 31), "{{WhiteEnd}}") > 0 THEN iii = -6 + END IF + IF iii <> 0 THEN + FOR ii = Help_Txt_Len - 3 TO 1 STEP -4 + IF ASC(Help_Txt$, ii) = 13 AND iii < 0 THEN + help_h = help_h - 1: Help_Line$ = LEFT$(Help_Line$, LEN(Help_Line$) - 4) + ELSEIF ASC(Help_Txt$, ii) = 196 AND iii < 0 THEN + iii = -iii + ELSEIF ASC(Help_Txt$, ii) = 13 AND iii > 0 THEN + Help_Txt_Len = ii + 3: EXIT FOR END IF - LOOP WHILE j < LEN(l$) - END IF - LOOP - backupHelp_BG_Col = Help_BG_Col - backupBold = Help_Bold - Help_BG_Col = 2 - FOR printTable = 1 TO totalRows - IF printTable = 1 THEN - Help_Bold = 1 + NEXT + Help_BG_Col = iii: cb$ = cb$ + CHR$(196) 'special signal byte + Help_AddTxt STRING$(ASC(Help_CIndent$, 1) - 1, 196) + " ", 15, 0 + col = 15 'further text color until closing ELSE - Help_Bold = 0 + Help_Center = 1: cb$ = cb$ + CHR$(0) 'no special signal + Help_AddTxt SPACE$(ASC(Help_CIndent$, 1)), col, 0 'center content END IF - col = Help_Col + Help_CIndent$ = MID$(Help_CIndent$, 2) + END IF - j = 1 - tableOutput$ = "" - FOR checkCol = 1 TO totalCols - p$ = wikiGetUntil$(tableRow(printTable), j, CHR$(0)) - p$ = StrReplace$(p$, "<", "<") - p$ = StrReplace$(p$, ">", ">") - p$ = StrReplace$(p$, CHR$(194) + CHR$(160), "") - p$ = StrReplace$(p$, "&", "&") - p$ = StrReplace$(p$, CHR$(226) + CHR$(136) + CHR$(146), "-") - p$ = StrReplace$(p$, "", "") - p$ = StrReplace$(p$, "", "") - p$ = StrReplace$(p$, "
", "") - p$ = StrReplace$(p$, "
", "") - p$ = StrReplace$(p$, "", "") - - thisCol$ = SPACE$(tableCol(checkCol)) - MID$(thisCol$, 2) = p$ - tableOutput$ = tableOutput$ + thisCol$ - NEXT - Help_AddTxt tableOutput$, col, 0 - Help_AddTxt CHR$(13), col, 0 - NEXT - Help_BG_Col = backupHelp_BG_Col - Help_Bold = backupBold - Help_AddTxt CHR$(13), col, 0 - ELSE - i = i + 1 - FOR ii = i TO LEN(a$) - 1 - IF MID$(a$, ii, 2) = "|}" THEN i = ii + 1: EXIT FOR - NEXT + GOTO charDone END IF - GOTO Special + + IF cb = 1 THEN cb$ = cb$ + c$ 'reading macro name + IF cb = 2 THEN Help_AddTxt CHR$(c), col, 0 'copy macro'd text + GOTO charDone END IF - IF c$(3) = CHR$(226) + CHR$(128) + CHR$(166) THEN '... + 'Wiki headings (==...==}) are not handled in blocks (soft- and hard lock), as it would + 'disrupt the block, also in code blocks it could be part of the code example itself + IF Help_LockParse = 0 THEN + 'Custom section headings (current color, h3 w/o underline, h2 with underline) + ii = 0 + IF c$(5) = " === " THEN ii = 4 + IF c$(4) = "=== " THEN ii = 3 + IF c$(4) = " ===" THEN ii = 3 + IF c$(3) = "===" THEN ii = 2 + IF ii > 0 THEN i = i + ii: GOTO charDone + ii = 0 + IF c$(4) = " == " THEN ii = 3 + IF c$(3) = "== " THEN ii = 2 + IF c$(3) = " ==" THEN ii = 2 + IF c$(2) = "==" THEN ii = 1 + IF ii > 0 THEN i = i + ii: Help_Underline = col: GOTO charDone + END IF + + 'Wiki/HTML rulers (----,
) are not handled in blocks (soft- and hard lock), as it would + 'disrupt the block, also in code blocks it could be part of the code example itself + IF Help_LockParse = 0 THEN + 'Rulers + IF c$(4) = "----" AND nl = 1 THEN + i = i + 3 + Help_AddTxt STRING$(Help_ww, 196), 8, 0 + GOTO charDone + END IF + IF c$(4) = "
" OR c$(6) = "
" THEN + IF c$(4) = "
" THEN i = i + 3 + IF c$(6) = "
" THEN i = i + 5 + Help_CheckFinishLine + Help_AddTxt STRING$(Help_ww, 196), 8, 0 + GOTO charDone + END IF + END IF + + 'Wiki definition lists (;...:...) are not handled in blocks (soft- and hard lock), as it would + 'disrupt the block, also in code blocks it could be part of the code example itself + IF Help_LockParse = 0 THEN + 'Definition lists + IF c$ = ";" AND nl = 1 THEN 'definition (new line only) + IF c$(2) = "; " THEN i = i + 1 + Help_Bold = 1: col = Help_Col: Help_DList = 1 + IF c$(3) = ";* " THEN i = i + 2: Help_DList = 3 'list dot belongs to description + IF c$(2) = ";*" THEN i = i + 1: Help_DList = 2 'list dot belongs to description + GOTO charDone + END IF + IF c$ = ":" AND Help_DList > 0 THEN 'description (same or new line) + IF c$(2) = ": " THEN i = i + 1 + Help_Bold = 0: col = Help_Col + IF nl = 0 THEN Help_NewLine + Help_AddTxt " ", col, 0 + Help_NewLineIndent = Help_NewLineIndent + 3 + IF Help_DList > 1 THEN + Help_AddTxt CHR$(4) + " ", 14, 0 + Help_NewLineIndent = Help_NewLineIndent + 2 + END IF + Help_DList = 0 + GOTO charDone + END IF + IF c$ = ":" AND nl = 1 THEN 'description w/o definition (new line only) + IF c$(2) = ": " THEN i = i + 1 + Help_AddTxt " ", col, 0 + Help_NewLineIndent = Help_NewLineIndent + 3 + GOTO charDoneKnl 'keep nl state for possible
    list bullets + END IF + END IF + + 'Wiki lists (*, **) are not handled in blocks (soft- and hard lock), as it would + 'disrupt the block, also in code blocks it could be part of the code example itself + IF Help_LockParse = 0 THEN + 'Unordered lists + IF nl = 1 THEN + IF c$(2) = "**" THEN + IF c$(3) = "** " THEN i = i + 2: ELSE i = i + 1 + Help_AddTxt " " + CHR$(4) + " ", 14, 0 + Help_NewLineIndent = Help_NewLineIndent + 5 + GOTO charDone + END IF + IF c$ = "*" THEN + IF c$(2) = "* " THEN i = i + 1 + Help_AddTxt CHR$(4) + " ", 14, 0 + Help_NewLineIndent = Help_NewLineIndent + 2 + GOTO charDone + END IF + END IF + END IF + + 'Unicode handling (no restrictions) + IF ((c AND &HE0~%%) = 192) AND ((ASC(c$(2), 2) AND &HC0~%%) = 128) THEN '2-byte UTF-8 + i = i + 1 + FOR ii = 0 TO wpUtfReplCnt + IF wpUtfRepl(ii).utf8 = c$(2) + MKI$(&H2020) THEN + Help_AddTxt RTRIM$(wpUtfRepl(ii).repl), col, 0: EXIT FOR + END IF + NEXT + GOTO charDone + END IF + IF ((c AND &HF0~%%) = 224) AND ((ASC(c$(2), 2) AND &HC0~%%) = 128) AND ((ASC(c$(3), 3) AND &HC0~%%) = 128) THEN '3-byte UTF-8 i = i + 2 - Help_AddTxt "...", col, 0 - GOTO Special + FOR ii = 0 TO wpUtfReplCnt + IF wpUtfRepl(ii).utf8 = c$(3) + CHR$(0) THEN + Help_AddTxt RTRIM$(wpUtfRepl(ii).repl), col, 0: EXIT FOR + END IF + NEXT + GOTO charDone END IF - - IF c$ = CHR$(226) THEN 'UNICODE UTF8 extender, it's a very good bet the following 2 characters will be 2 bytes of UNICODE - i = i + 2 - GOTO Special - END IF - - IF c$ = ":" AND nl = 1 THEN - Help_AddTxt " ", col, 0 - Help_NewLineIndent = Help_NewLineIndent + 4 - i = i + 1: GOTO special2 - END IF - - s$ = "__NOTOC__" + CHR$(10) - IF c$(LEN(s$)) = s$ THEN - i = i + LEN(s$) - 1 - GOTO Special - END IF - s$ = "__NOTOC__" - IF c$(LEN(s$)) = s$ THEN - i = i + LEN(s$) - 1 - GOTO Special - END IF - - IF c$(4) = "----" THEN + IF ((c AND &HF8~%%) = 240) AND ((ASC(c$(2), 2) AND &HC0~%%) = 128) AND ((ASC(c$(3), 3) AND &HC0~%%) = 128) AND ((ASC(c$(4), 4) AND &HC0~%%) = 128) THEN '4-byte UTF-8 i = i + 3 - Help_AddTxt STRING$(100, 196), 8, 0 - GOTO Special + FOR ii = 0 TO wpUtfReplCnt + IF wpUtfRepl(ii).utf8 = c$(4) THEN + Help_AddTxt RTRIM$(wpUtfRepl(ii).repl), col, 0: EXIT FOR + END IF + NEXT + GOTO charDone END IF - - - IF c$ = CHR$(10) THEN + 'Line break handling (no restrictions) + IF c = 10 OR c$(4) = "
    " OR c$(6) = "
    " THEN + IF c$(4) = "
    " THEN i = i + 3 + IF c$(6) = "
    " THEN i = i + 5 Help_NewLineIndent = 0 - IF Help_Txt_Len >= 8 THEN - IF ASC(Help_Txt$, Help_Txt_Len - 3) = 13 AND ASC(Help_Txt$, Help_Txt_Len - 7) = 13 THEN GOTO skipdoubleblanks + IF Help_LockParse > -2 THEN 'everywhere except in fixed blocks + IF Help_Txt_Len >= 8 THEN 'allow max. one blank line (ie. collapse multi blanks to just one) + IF ASC(Help_Txt$, Help_Txt_Len - 3) = 13 AND ASC(Help_Txt$, Help_Txt_Len - 7) = 13 THEN + IF Help_Center > 0 THEN Help_CIndent$ = MID$(Help_CIndent$, 2) 'drop respective center indent + GOTO skipMultiBlanks + END IF + END IF END IF - Help_AddTxt CHR$(13), col, 0 - skipdoubleblanks: + skipMultiBlanks: + IF Help_LockParse <> 0 THEN 'in all blocks reset styles at EOL + Help_Bold = 0: Help_Italic = 0: col = Help_Col + ELSE + IF c = 10 THEN Help_DList = 0: Help_Bold = 0: col = Help_Col 'def list incl. style ends after real new line + END IF nl = 1 - i = i + 1: GOTO special2 + GOTO charDoneKnl 'keep just set nl state END IF - Help_AddTxt CHR$(c), col, 0 - Special: - i = i + 1 + charDone: nl = 0 - special2: + charDoneKnl: 'done, but keep nl state + i = i + 1 LOOP + 'END_PARSE_LOOP 'Trim Help_Txt$ Help_Txt$ = LEFT$(Help_Txt$, Help_Txt_Len) + CHR$(13) 'chr13 stops reads past end of content - 'generate preview file - 'OPEN "help_preview.txt" FOR OUTPUT AS #1 - 'FOR i = 1 TO LEN(Help_Txt$) STEP 4 - ' c = ASC(Help_Txt$, i) - ' c$ = CHR$(c) - ' IF c = 13 THEN c$ = CHR$(13) + CHR$(10) - ' PRINT #1, c$; - 'NEXT - 'CLOSE #1 - - 'PRINT "Finished parsing!": _DISPLAY - - IF Help_PageLoaded$ = "Keyword Reference - Alphabetical" THEN fh = FREEFILE @@ -771,7 +907,7 @@ SUB WikiParse (a$) lnkx2 = x2: IF lnk = 0 THEN lnkx2 = lnkx2 - 1 IF lnkx1 <> 3 THEN GOTO ignorelink - IF ASC(a$, 1) <> 254 THEN GOTO ignorelink + IF ASC(a$, 1) <> 4 THEN GOTO ignorelink 'retrieve lnk info lnk2 = lnk: IF lnk2 = 0 THEN lnk2 = oldlnk @@ -806,7 +942,6 @@ SUB WikiParse (a$) a2$ = LEFT$(a2$, INSTR(a2$, "...") - 1) END IF - skip = 0 IF UCASE$(LEFT$(a2$, 3)) <> "_GL" THEN FOR ci = 1 TO LEN(a2$) @@ -859,26 +994,101 @@ SUB WikiParse (a$) CLOSE #fh END IF - - - - - END SUB -FUNCTION wikiGetLine$ (a$, i) - wikiGetLine$ = wikiGetUntil(a$, i, CHR$(10)) +FUNCTION wikiSafeName$(page$) 'create a unique name for both case sensitive & insensitive systems + ext$ = SPACE$(LEN(page$)) + FOR i = 1 TO LEN(page$) + c = ASC(page$, i) + SELECT CASE c + CASE 65 TO 90: ASC(ext$, i) = 49 'upper = 1 + CASE 97 TO 122: ASC(ext$, i) = 48 'lower = 0 + CASE ELSE: ASC(ext$, i) = c 'non-letter = take as is + END SELECT + NEXT + wikiSafeName$ = page$ + "_" + ext$ END FUNCTION -FUNCTION wikiGetUntil$ (a$, i, separator$) - IF i >= LEN(a$) THEN EXIT FUNCTION - j = INSTR(i, a$, separator$) +FUNCTION wikiLookAhead$ (a$, i, token$) 'Prefetch further wiki text + wikiLookAhead$ = "": IF i >= LEN(a$) THEN EXIT FUNCTION + j = INSTR(i, a$, token$) IF j = 0 THEN - wikiGetUntil$ = MID$(a$, i) - i = LEN(a$) + wikiLookAhead$ = MID$(a$, i) ELSE - wikiGetUntil$ = MID$(a$, i, j - i) - i = j + 1 + wikiLookAhead$ = MID$(a$, i, j - i) END IF END FUNCTION +FUNCTION wikiBuildCIndent$ (a$) 'Pre-calc center indentions + wikiBuildCIndent$ = "": IF a$ = "" THEN EXIT FUNCTION + + org$ = a$: b$ = "" 'eliminate internal links + FOR i = 1 TO LEN(org$) + IF MID$(org$, i, 2) = "[[" THEN + FOR ii = i + 2 TO LEN(org$) + IF MID$(org$, ii, 1) = "|" THEN i = ii + 1: EXIT FOR + IF MID$(org$, ii, 2) = "]]" THEN i = i + 2: EXIT FOR + NEXT + END IF + IF MID$(org$, i, 2) = "]]" THEN i = i + 2 + b$ = b$ + MID$(org$, i, 1) + NEXT + org$ = b$: b$ = "" 'eliminate external links + FOR i = 1 TO LEN(org$) + IF MID$(org$, i, 5) = "[http" THEN + FOR ii = i + 5 TO LEN(org$) + IF MID$(org$, ii, 1) = " " THEN i = ii + 1: EXIT FOR + IF MID$(org$, ii, 1) = "]" THEN i = i + 1: EXIT FOR + NEXT + END IF + IF MID$(org$, i, 1) = "]" THEN i = i + 1 + b$ = b$ + MID$(org$, i, 1) + NEXT + org$ = b$: b$ = "" 'eliminate templates + FOR i = 1 TO LEN(org$) + IF MID$(org$, i, 2) = "{{" THEN + FOR ii = i + 2 TO LEN(org$) + IF MID$(org$, ii, 1) = "|" THEN i = ii + 1: EXIT FOR + IF MID$(org$, ii, 2) = "}}" THEN i = i + 2: EXIT FOR + NEXT + END IF + IF MID$(org$, i, 1) = "|" THEN + FOR ii = i + 1 TO LEN(org$) + IF MID$(org$, ii, 2) = "}}" THEN i = ii: EXIT FOR + NEXT + END IF + IF MID$(org$, i, 2) = "}}" THEN i = i + 2 + b$ = b$ + MID$(org$, i, 1) + NEXT + org$ = b$: b$ = "" 'eliminate text styles + FOR i = 1 TO LEN(org$) + IF MID$(org$, i, 3) = "'''" THEN i = i + 3 + IF MID$(org$, i, 2) = "''" THEN i = i + 2 + b$ = b$ + MID$(org$, i, 1) + NEXT + b$ = StrReplace$(b$, "
    ", CHR$(10)) 'convert HTML line breaks + b$ = StrReplace$(b$, "
    ", CHR$(10)) 'convert XHTML line breaks + b$ = _TRIM$(b$) + CHR$(10) 'safety fallback + + i = 1: st = 1: br = 0: res$ = "" + WHILE i <= LEN(b$) + ws = INSTR(i, b$, " "): lb = INSTR(i, b$, CHR$(10)) + IF lb > 0 AND (ws > lb OR lb - st <= Help_ww) THEN SWAP ws, lb + IF ws > 0 AND ws - st <= Help_ww THEN + br = ws: i = ws + 1 + IF ASC(b$, ws) <> 10 AND i <= LEN(b$) THEN _CONTINUE + END IF + IF br = 0 THEN + IF lb < ws THEN + br = lb + ELSE + IF ws > 0 THEN br = ws: ELSE br = lb + END IF + END IF + ci = (Help_ww - (br - st)) \ 2: IF ci < 0 THEN ci = 0 + res$ = res$ + CHR$(ci) + i = br + 1: st = br + 1: br = 0 + WEND + wikiBuildCIndent$ = res$ +END FUNCTION +