From 1ad0cfa114d5cc09740ed1247497aa3352750f3c Mon Sep 17 00:00:00 2001 From: Fellippe Heitor Date: Sat, 28 Aug 2021 01:56:00 -0300 Subject: [PATCH] Updates help files. --- internal/help/CLS.txt | 4 +-- internal/help/CONST.txt | 4 +-- internal/help/DECLARE_LIBRARY.txt | 41 +------------------------------ internal/help/DIR$.txt | 2 +- internal/help/STATIC.txt | 2 +- internal/help/STRING.txt | 4 +-- internal/help/_DIR$.txt | 2 +- internal/help/_LOADIMAGE.txt | 6 ----- internal/help/_WINDOWHANDLE.txt | 6 ++--- 9 files changed, 13 insertions(+), 58 deletions(-) diff --git a/internal/help/CLS.txt b/internal/help/CLS.txt index c72989040..82ca19754 100644 --- a/internal/help/CLS.txt +++ b/internal/help/CLS.txt @@ -7,7 +7,7 @@ The [[CLS]] statement clears the [[_DEST|current write page]]. {{PageParameters}} * {{Parameter|method%}} specifies which parts of the page to clear, and can have one of the following values: -** CLS    - clears the active graphics or text viewport or the entire text screen and refreshes bottom function [[KEY LIST|KEY ON]] line. +** CLS - clears the active graphics or text viewport or the entire text screen and refreshes bottom function [[KEY LIST|KEY ON]] line. ** 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. @@ -31,7 +31,7 @@ The [[CLS]] statement clears the [[_DEST|current write page]]. {{Cl|CLS}} , 15 {{Cl|_PRINTMODE }} _KEEPBACKGROUND 'keeps the text background visible {{Cl|COLOR}} 0: {{Cl|PRINT}} "This is black text on a white background!" -K$ = {{Cl|INPUT$}}(1 +K$ = {{Cl|INPUT$}}(1) {{CodeEnd}} :''Explanation:'' [[_PRINTMODE]] can be used with [[PRINT]] or [[_PRINTSTRING]] to make the text or the text background transparent. diff --git a/internal/help/CONST.txt b/internal/help/CONST.txt index ca6c76703..1c5a875e3 100644 --- a/internal/help/CONST.txt +++ b/internal/help/CONST.txt @@ -14,8 +14,8 @@ The [[CONST]] statement globally defines one or more named numeric or string val {{PageDescription}} * The {{Parameter|constantName}} does not have to include a type suffix. The datatype is automatically infered by the compiler using the {{Parameter|value}}. -* Constant values cannot reference a variable, [[SUB]] or [[FUNCTION]] return values when defined. -** The exception to the above are color functions [[_RGB32]] and [[_RGBA32]], which can be used in a CONST statement. See ''Example 2'' below. +* Constant values cannot reference a variable or [[FUNCTION]] return values. +** The exception to the above are the internal functions: [[_PI]], [[_ACOS]], [[_ASIN]], [[_ARCSEC]], [[_ARCCSC]], [[_ARCCOT]], [[_SECH]], [[_CSCH]], [[_COTH]], [[COS]], [[SIN]], [[TAN]], [[LOG]], [[EXP]], [[ATN]], [[_D2R]], [[_D2G]], [[_R2D]], [[_R2G]], [[_G2D]], [[_G2R]], [[ABS]], [[SGN]], [[INT]], [[_ROUND]], [[_CEIL]], [[FIX]], [[_SEC]], [[_CSC]], [[_COT]], [[ASC]], [[_RGB32]], [[_RGBA32]], [[_RGB]], [[_RGBA]], [[_RED32]], [[_GREEN32]], [[_BLUE32]], [[_ALPHA32]], [[_RED]], [[_GREEN]], [[_BLUE]], [[_ALPHA]] (See Example 2 below). * Constants cannot be reassigned values. They retain the same value throughout all of the program procedures. * Constants defined in module-level code have [[SHARED|shared]] scope, so they can also be used in [[SUB]] or [[FUNCTION]] procedures. * Constants defined in [[SUB]] or [[FUNCTION]] procedures are local to those procedures. diff --git a/internal/help/DECLARE_LIBRARY.txt b/internal/help/DECLARE_LIBRARY.txt index 04f36e943..0ebb3a1d0 100644 --- a/internal/help/DECLARE_LIBRARY.txt +++ b/internal/help/DECLARE_LIBRARY.txt @@ -37,45 +37,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}} '' '' -{{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}} -{{Cl|SCREEN (statement)|SCREEN}} {{Cl|_NEWIMAGE}}(640, 480, 256) 'simulate screen 12 with 256 colors -{{Cl|RANDOMIZE}} {{Cl|TIMER}} - -{{Cl|DO}} - {{Cl|_DELAY}} 1 - x = {{Cl|RND}} * 640: y = {{Cl|RND}} * 480 - {{Cl|LINE}} (x, y)-{{Cl|STEP}}(10, 10), {{Cl|RND}} * 100 + 32, BF - MouseMove x + 5, y + 5 -{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|LEN}}({{Cl|INKEY$}}) 'any keypress quits -{{Cl|END}} - -{{Cl|SUB}} MouseMove (x {{Cl|AS}} {{Cl|LONG}}, y {{Cl|AS}} {{Cl|LONG}}) - SDL_WarpMouse x, y 'call SDL library procedure -{{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}} '' '' -{{Cl|SCREEN}} 12 -{{Cl|DECLARE LIBRARY}} - {{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 '' '' -{{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. +''Example:'' Don't know if a C function is defined by C++ or QB64? Try using empty quotes. {{CodeStart}} '' '' {{Cl|DECLARE LIBRARY}} "" {{Cl|FUNCTION}} addone& ({{Cl|BYVAL}} value&) @@ -87,7 +49,6 @@ MouseMove 200, 200 '' '' <center>'''QB64 version 1.000 and up produce standalone executables. External DLL files must be distributed with your program.'''</center> -<center>'''Note: QB64 versions prior to 1.000 require all default DLL files to either be with the program or in the C:\WINDOWS\SYSTEM32 folder.'''</center> ''See also:'' diff --git a/internal/help/DIR$.txt b/internal/help/DIR$.txt index 8714c53c1..09ac84ec3 100644 --- a/internal/help/DIR$.txt +++ b/internal/help/DIR$.txt @@ -31,7 +31,7 @@ Example: Displaying default paths in Windows only. {{Cl|PRINT}} "MUSIC=" + {{Cl|_DIR$}}("music") {{Cl|PRINT}} "VIDEO=" + {{Cl|_DIR$}}("video") {{Cl|PRINT}} "APPLICATION DATA=" + {{Cl|_DIR$}}("data") -{{Cl|PRINT}} "LOCAL APPLICATION DATA=" + {{Cl|_DIR$}}("local application data" +{{Cl|PRINT}} "LOCAL APPLICATION DATA=" + {{Cl|_DIR$}}("local application data") {{CodeEnd}} {{OutputStart}}DESKTOP=C:\Documents and Settings\Administrator\Desktop\ DOWNLOADS=C:\Documents and Settings\Administrator\Downloads\ diff --git a/internal/help/STATIC.txt b/internal/help/STATIC.txt index 10cdf48ff..656c69806 100644 --- a/internal/help/STATIC.txt +++ b/internal/help/STATIC.txt @@ -49,7 +49,7 @@ The {{KW|STATIC}} keyword is used in declaration statements to control where var {{Cl|PRINT}} Factorial(0) {{Cl|PRINT}} Factorial(5) -{{Cl|PRINT}} Factorial(50 +{{Cl|PRINT}} Factorial(50) {{Cl|FUNCTION}} Factorial# ( n {{Cl|AS}} {{Cl|DOUBLE}} ) {{Cl|CONST}} maxNToCache = 50 diff --git a/internal/help/STRING.txt b/internal/help/STRING.txt index 7d81356b9..d5ba30053 100644 --- a/internal/help/STRING.txt +++ b/internal/help/STRING.txt @@ -13,16 +13,16 @@ * 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!''' -:::::'''Creating a fixed length STRING variable in QBasic:''' +:::::'''Creating a fixed length STRING variable''' :* Variable$ = " " ' 1 space creates a one [[_BYTE|byte]] string length in a procedure(not fixed) :* Variable$ = SPACE$(n%) ' defined as a n% length string in a procedure(not fixed) :* [[DIM]] variable AS STRING * n% ' fixed string length cannot be changed later :* Variable AS STRING * n% ' fixed string length in a [[SUB]] parameter or [[TYPE]] definition. :* [[CONST]] variables can also be used after the constant value is defined. +:* Fixed length strings may not be initialized with spaces and may contain only a series of CHR$(0) at program start. :::::'''QB64 fixed length string type suffixes''' diff --git a/internal/help/_DIR$.txt b/internal/help/_DIR$.txt index 8714c53c1..09ac84ec3 100644 --- a/internal/help/_DIR$.txt +++ b/internal/help/_DIR$.txt @@ -31,7 +31,7 @@ Example: Displaying default paths in Windows only. {{Cl|PRINT}} "MUSIC=" + {{Cl|_DIR$}}("music") {{Cl|PRINT}} "VIDEO=" + {{Cl|_DIR$}}("video") {{Cl|PRINT}} "APPLICATION DATA=" + {{Cl|_DIR$}}("data") -{{Cl|PRINT}} "LOCAL APPLICATION DATA=" + {{Cl|_DIR$}}("local application data" +{{Cl|PRINT}} "LOCAL APPLICATION DATA=" + {{Cl|_DIR$}}("local application data") {{CodeEnd}} {{OutputStart}}DESKTOP=C:\Documents and Settings\Administrator\Desktop\ DOWNLOADS=C:\Documents and Settings\Administrator\Downloads\ diff --git a/internal/help/_LOADIMAGE.txt b/internal/help/_LOADIMAGE.txt index 4bf3e4047..6ff9504dd 100644 --- a/internal/help/_LOADIMAGE.txt +++ b/internal/help/_LOADIMAGE.txt @@ -1,15 +1,12 @@ {{DISPLAYTITLE:_LOADIMAGE}} - The [[_LOADIMAGE]] function loads an image into memory and returns valid [[LONG]] image handle values that are less than -1. {{PageSyntax}} - :{{Parameter|handle&}} = [[_LOADIMAGE]]({{Parameter|filename$}}[, {{Parameter|mode%}}]) {{PageParameters}} - *{{Parameter|filename$}} is literal or variable [[STRING]] file name value. *Optional {{Parameter|mode%}} [[INTEGER]] values can be: **32 = 32-bit @@ -17,7 +14,6 @@ The [[_LOADIMAGE]] function loads an image into memory and returns valid [[LONG] {{PageDescription}} - *Various common image file formats supported, like BMP, JPG, PNG, etc. A path can also be given. *The {{Parameter|mode%}} can designate 32-bit color or 33 ('''version 1.000 and up'''). Omit to use the current graphic screen settings. *Mode 33 images are '''hardware''' accelerated and are created using [[_LOADIMAGE]] or [[_COPYIMAGE]] ('''version 1.000 and up'''). @@ -29,7 +25,6 @@ The [[_LOADIMAGE]] function loads an image into memory and returns valid [[LONG] {{PageErrors}} - *Some picture file images may not load when a {{Parameter|mode%}} value is designated. Try loading it without a {{Parameter|mode%}} designation. *'''It is important to free unused or discarded images with [[_FREEIMAGE]] to prevent CPU memory overflow errors.''' *'''In text-only [[SCREEN]] 0, {{Parameter|mode%}} 32 must be specified.''' When loading an [[_ICON]] image use 32 for the {{Parameter|mode%}} too. @@ -80,7 +75,6 @@ DO {{PageSeeAlso}} - *[[_FREEIMAGE]], [[_ICON]] *[[_PUTIMAGE]], [[_MAPTRIANGLE]] *[[_NEWIMAGE]], [[_COPYIMAGE]] diff --git a/internal/help/_WINDOWHANDLE.txt b/internal/help/_WINDOWHANDLE.txt index b81562be8..0deb932a9 100644 --- a/internal/help/_WINDOWHANDLE.txt +++ b/internal/help/_WINDOWHANDLE.txt @@ -3,11 +3,11 @@ The [[_WINDOWHANDLE]] function returns the window handle assigned to the current {{PageSyntax}} -: {{Parameter|hwnd&&}} = [[_WINDOWHANDLE]] +: {{Parameter|hwnd%&}} = [[_WINDOWHANDLE]] {{PageDescription}} -* The result is an [[_INTEGER64]] number assigned by Windows to your running program. +* The result is an [[_OFFSET]] 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]]. @@ -49,7 +49,7 @@ The [[_WINDOWHANDLE]] function returns the window handle assigned to the current '---------------------------------------------------------------------------------------- {{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|FUNCTION}} MessageBoxA& ({{Cl|BYVAL}} hwnd {{Cl|AS}} {{Cl|_OFFSET}}, 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