BlankPage: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
(Replaced content with "{{DISPLAYTITLE:_BlankPage}} The '''_BlankPage''' serves as a skeleton for new Wiki pages. {{PageSyntax}} : _BlankSub {{Parameter|arg1}}[, {{Parameter|arg2}}] : {{Parameter|result%}} = _BlankFunc({{Parameter|arg1}}[, {{Parameter|arg2}}]) {{PageParameters}} * {{Parameter|arg1}} is a mandatory argument * the {{Parameter|arg2}} is optional {{PageDescription}} To use this skeleton click on the '''Edit''' tab above the page, then copy the raw text of this pag...")
Tags: Replaced Manual revert
No edit summary
Tag: Reverted
Line 96: Line 96:


{{PageNavigation}}
{{PageNavigation}}
{{CodeStart}}
{{Text|<nowiki>'All variables will be of type LONG unless explicitly defined</nowiki>|#31C4C4}}
{{Text|DEFLNG|#F0F0F0}} A-Z
{{Text|<nowiki>'All arrays will be dynamically allocated so they can be REDIM-ed</nowiki>|#31C4C4}}
{{Text|<nowiki>'</nowiki>|#31C4C4}}{{Text|$DYNAMIC|#55FF55}}
{{Text|<nowiki>'We need console access to support command-line compilation via the -x command line compile option</nowiki>|#31C4C4}}
{{Text|$CONSOLE|#55FF55}}
{{Text|<nowiki>'Initially the "SCREEN" will be hidden, if the -x option is used it will never be created</nowiki>|#31C4C4}}
{{Text|$SCREENHIDE|#55FF55}}
{{Text|$EXEICON:|#55FF55}}{{Text|<nowiki>'./qb64pe.ico'</nowiki>|#31C4C4}}
{{Text|$VERSIONINFO:|#55FF55}}CompanyName=QB64 Phoenix Edition
{{Text|$VERSIONINFO:|#55FF55}}FileDescription=QB64 IDE and Compiler
{{Text|$VERSIONINFO:|#55FF55}}InternalName=qb64pe.bas
{{Text|$VERSIONINFO:|#55FF55}}LegalCopyright=MIT
{{Text|$VERSIONINFO:|#55FF55}}LegalTrademarks=
{{Text|$VERSIONINFO:|#55FF55}}OriginalFilename=qb64pe.exe
{{Text|$VERSIONINFO:|#55FF55}}ProductName=QB64-PE
{{Text|$VERSIONINFO:|#55FF55}}Comments=QB64 is a modern extended BASIC programming language that retains QB4.5/QBasic compatibility and compiles native binaries for Windows, Linux and macOS.
{{Text|<nowiki>'</nowiki>|#31C4C4}}{{Text|$INCLUDE:|#55FF55}}{{Text|<nowiki>'global\version.bas'</nowiki>|#31C4C4}}
{{Text|<nowiki>'</nowiki>|#31C4C4}}{{Text|$INCLUDE:|#55FF55}}{{Text|<nowiki>'global\settings.bas'</nowiki>|#31C4C4}}
{{Text|<nowiki>'</nowiki>|#31C4C4}}{{Text|$INCLUDE:|#55FF55}}{{Text|<nowiki>'global\constants.bas'</nowiki>|#31C4C4}}
{{Text|<nowiki>'</nowiki>|#31C4C4}}{{Text|$INCLUDE:|#55FF55}}{{Text|<nowiki>'subs_functions\extensions\opengl\opengl_global.bas'</nowiki>|#31C4C4}}
{{Text|<nowiki>'</nowiki>|#31C4C4}}{{Text|$INCLUDE:|#55FF55}}{{Text|<nowiki>'utilities\ini-manager\ini.bi'</nowiki>|#31C4C4}}
{{Text|<nowiki>'</nowiki>|#31C4C4}}{{Text|$INCLUDE:|#55FF55}}{{Text|<nowiki>'utilities\s-buffer\simplebuffer.bi'</nowiki>|#31C4C4}}
{{Text|DEFLNG|#F0F0F0}} A-Z
{{Text|<nowiki>'-------- Optional IDE Component (1/2) --------</nowiki>|#31C4C4}}
{{Text|<nowiki>'</nowiki>|#31C4C4}}{{Text|$INCLUDE:|#55FF55}}{{Text|<nowiki>'ide\ide_global.bas'</nowiki>|#31C4C4}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} OName({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} {{Text|<nowiki>'Operation Name</nowiki>|#31C4C4}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} PL({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}} {{Text|<nowiki>'Priority Level</nowiki>|#31C4C4}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} PP_TypeMod({{Text|0|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}, PP_ConvertedMod({{Text|0|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} {{Text|<nowiki>'Prepass Name Conversion variables.</nowiki>|#31C4C4}}
Set_OrderOfOperations
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} NoExeSaved {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} vWatchOn, vWatchRecompileAttempts, vWatchDesiredState, vWatchErrorCall$
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} vWatchNewVariable$, vWatchVariableExclusions$
vWatchErrorCall$ = {{Text|<nowiki>"if (stop_program) {*__LONG_VWATCH_LINENUMBER=0; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);};if(new_error){bkp_new_error=new_error;new_error=0;*__LONG_VWATCH_LINENUMBER=-1; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);new_error=bkp_new_error;};"</nowiki>|#FFB100}}
vWatchVariableExclusions$ = {{Text|<nowiki>"@__LONG_VWATCH_LINENUMBER@__LONG_VWATCH_SUBLEVEL@__LONG_VWATCH_GOTO@"</nowiki>|#FFB100}} + _
              {{Text|<nowiki>"@__STRING_VWATCH_SUBNAME@__STRING_VWATCH_CALLSTACK@__ARRAY_BYTE_VWATCH_BREAKPOINTS"</nowiki>|#FFB100}} + _
              {{Text|<nowiki>"@__ARRAY_BYTE_VWATCH_SKIPLINES@__STRING_VWATCH_INTERNALSUBNAME@__ARRAY_STRING_VWATCH_STACK@"</nowiki>|#FFB100}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} nativeDataTypes$
nativeDataTypes$ = {{Text|<nowiki>"@_OFFSET@OFFSET@_UNSIGNED _OFFSET@UNSIGNED OFFSET@_BIT@BIT@_UNSIGNED _BIT@UNSIGNED BIT@_BYTE@_UNSIGNED _BYTE@BYTE@UNSIGNED BYTE@INTEGER@_UNSIGNED INTEGER@UNSIGNED INTEGER@LONG@_UNSIGNED LONG@UNSIGNED LONG@_INTEGER64@INTEGER64@_UNSIGNED _INTEGER64@UNSIGNED INTEGER64@SINGLE@DOUBLE@_FLOAT@FLOAT@STRING@"</nowiki>|#FFB100}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} qb64prefix_set_recompileAttempts, qb64prefix_set_desiredState
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} opex_recompileAttempts, opex_desiredState
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} opexarray_recompileAttempts, opexarray_desiredState
{{Text|REDIM|#F0F0F0}} EveryCaseSet({{Text|100|#F580B1}}), SelectCaseCounter {{Text|AS|#F0F0F0}} {{Text|_UNSIGNED|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|REDIM|#F0F0F0}} SelectCaseHasCaseBlock({{Text|100|#F580B1}})
{{Text|DIM|#F0F0F0}} ExecLevel({{Text|255|#F580B1}}), ExecCounter {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} UserDefine({{Text|1|#F580B1}}, {{Text|100|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} {{Text|<nowiki>'0 element is the name, 1 element is the string value</nowiki>|#31C4C4}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} InValidLine({{Text|10000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|_BYTE|#F0F0F0}}
{{Text|DIM|#F0F0F0}} DefineElse({{Text|255|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|_BYTE|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} UserDefineCount {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}, UserDefineList$
UserDefineList$ = {{Text|<nowiki>"@DEFINED@UNDEFINED@WINDOWS@WIN@LINUX@MAC@MACOSX@32BIT@64BIT@VERSION@"</nowiki>|#FFB100}}
UserDefine({{Text|0|#F580B1}}, {{Text|0|#F580B1}}) = {{Text|<nowiki>"WINDOWS"</nowiki>|#FFB100}}: UserDefine({{Text|0|#F580B1}}, {{Text|1|#F580B1}}) = {{Text|<nowiki>"WIN"</nowiki>|#FFB100}}
UserDefine({{Text|0|#F580B1}}, {{Text|2|#F580B1}}) = {{Text|<nowiki>"LINUX"</nowiki>|#FFB100}}
UserDefine({{Text|0|#F580B1}}, {{Text|3|#F580B1}}) = {{Text|<nowiki>"MAC"</nowiki>|#FFB100}}: UserDefine({{Text|0|#F580B1}}, {{Text|4|#F580B1}}) = {{Text|<nowiki>"MACOSX"</nowiki>|#FFB100}}
UserDefine({{Text|0|#F580B1}}, {{Text|5|#F580B1}}) = {{Text|<nowiki>"32BIT"</nowiki>|#FFB100}}: UserDefine({{Text|0|#F580B1}}, {{Text|6|#F580B1}}) = {{Text|<nowiki>"64BIT"</nowiki>|#FFB100}}
UserDefine({{Text|0|#F580B1}}, {{Text|7|#F580B1}}) = {{Text|<nowiki>"VERSION"</nowiki>|#FFB100}}
{{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}({{Text|_OS$|#F0F0F0}}, {{Text|<nowiki>"WIN"</nowiki>|#FFB100}}) {{Text|THEN|#F0F0F0}} UserDefine({{Text|1|#F580B1}}, {{Text|0|#F580B1}}) = {{Text|<nowiki>"-1"</nowiki>|#FFB100}}: UserDefine({{Text|1|#F580B1}}, {{Text|1|#F580B1}}) = {{Text|<nowiki>"-1"</nowiki>|#FFB100}} {{Text|ELSE|#F0F0F0}} UserDefine({{Text|1|#F580B1}}, {{Text|0|#F580B1}}) = {{Text|<nowiki>"0"</nowiki>|#FFB100}}: UserDefine({{Text|1|#F580B1}}, {{Text|1|#F580B1}}) = {{Text|<nowiki>"0"</nowiki>|#FFB100}}
{{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}({{Text|_OS$|#F0F0F0}}, {{Text|<nowiki>"LINUX"</nowiki>|#FFB100}}) {{Text|THEN|#F0F0F0}} UserDefine({{Text|1|#F580B1}}, {{Text|2|#F580B1}}) = {{Text|<nowiki>"-1"</nowiki>|#FFB100}} {{Text|ELSE|#F0F0F0}} UserDefine({{Text|1|#F580B1}}, {{Text|2|#F580B1}}) = {{Text|<nowiki>"0"</nowiki>|#FFB100}}
{{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}({{Text|_OS$|#F0F0F0}}, {{Text|<nowiki>"MAC"</nowiki>|#FFB100}}) {{Text|THEN|#F0F0F0}} UserDefine({{Text|1|#F580B1}}, {{Text|3|#F580B1}}) = {{Text|<nowiki>"-1"</nowiki>|#FFB100}}: UserDefine({{Text|1|#F580B1}}, {{Text|4|#F580B1}}) = {{Text|<nowiki>"-1"</nowiki>|#FFB100}} {{Text|ELSE|#F0F0F0}} UserDefine({{Text|1|#F580B1}}, {{Text|3|#F580B1}}) = {{Text|<nowiki>"0"</nowiki>|#FFB100}}: UserDefine({{Text|1|#F580B1}}, {{Text|4|#F580B1}}) = {{Text|<nowiki>"0"</nowiki>|#FFB100}}
{{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}({{Text|_OS$|#F0F0F0}}, {{Text|<nowiki>"32BIT"</nowiki>|#FFB100}}) {{Text|THEN|#F0F0F0}} UserDefine({{Text|1|#F580B1}}, {{Text|5|#F580B1}}) = {{Text|<nowiki>"-1"</nowiki>|#FFB100}}: UserDefine({{Text|1|#F580B1}}, {{Text|6|#F580B1}}) = {{Text|<nowiki>"0"</nowiki>|#FFB100}} {{Text|ELSE|#F0F0F0}} UserDefine({{Text|1|#F580B1}}, {{Text|5|#F580B1}}) = {{Text|<nowiki>"0"</nowiki>|#FFB100}}: UserDefine({{Text|1|#F580B1}}, {{Text|6|#F580B1}}) = {{Text|<nowiki>"-1"</nowiki>|#FFB100}}
UserDefine({{Text|1|#F580B1}}, {{Text|7|#F580B1}}) = Version$
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} QB64_uptime!
QB64_uptime! = {{Text|TIMER|#F0F0F0}}
NoInternalFolder:
{{Text|IF|#F0F0F0}} {{Text|_DIREXISTS|#F0F0F0}}({{Text|<nowiki>"internal"</nowiki>|#FFB100}}) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
    {{Text|_SCREENSHOW|#F0F0F0}}
    {{Text|PRINT|#F0F0F0}} {{Text|<nowiki>"QB64-PE cannot locate the 'internal' folder"</nowiki>|#FFB100}}
    {{Text|PRINT|#F0F0F0}}
    {{Text|PRINT|#F0F0F0}} {{Text|<nowiki>"Check that QB64-PE has been extracted properly."</nowiki>|#FFB100}}
    {{Text|PRINT|#F0F0F0}} {{Text|<nowiki>"For MacOSX, launch 'qb64pe_start.command' or enter './qb64pe' in Terminal."</nowiki>|#FFB100}}
    {{Text|PRINT|#F0F0F0}} {{Text|<nowiki>"For Linux, in the console enter './qb64pe'."</nowiki>|#FFB100}}
    {{Text|DO|#F0F0F0}}
        {{Text|_LIMIT|#F0F0F0}} {{Text|1|#F580B1}}
    {{Text|LOOP|#F0F0F0}} {{Text|UNTIL|#F0F0F0}} {{Text|INKEY$|#F0F0F0}} <> {{Text|<nowiki>""</nowiki>|#FFB100}}
    {{Text|SYSTEM|#F0F0F0}} {{Text|1|#F580B1}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} Include_GDB_Debugging_Info {{Text|<nowiki>'set using "options.bin"</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} DEPENDENCY_LAST
{{Text|CONST|#F0F0F0}} DEPENDENCY_LOADFONT = {{Text|1|#F580B1}}: DEPENDENCY_LAST = DEPENDENCY_LAST + {{Text|1|#F580B1}}
{{Text|CONST|#F0F0F0}} DEPENDENCY_AUDIO_CONVERSION = {{Text|2|#F580B1}}: DEPENDENCY_LAST = DEPENDENCY_LAST + {{Text|1|#F580B1}}
{{Text|CONST|#F0F0F0}} DEPENDENCY_AUDIO_DECODE = {{Text|3|#F580B1}}: DEPENDENCY_LAST = DEPENDENCY_LAST + {{Text|1|#F580B1}}
{{Text|CONST|#F0F0F0}} DEPENDENCY_AUDIO_OUT = {{Text|4|#F580B1}}: DEPENDENCY_LAST = DEPENDENCY_LAST + {{Text|1|#F580B1}}
{{Text|CONST|#F0F0F0}} DEPENDENCY_GL = {{Text|5|#F580B1}}: DEPENDENCY_LAST = DEPENDENCY_LAST + {{Text|1|#F580B1}}
{{Text|CONST|#F0F0F0}} DEPENDENCY_IMAGE_CODEC = {{Text|6|#F580B1}}: DEPENDENCY_LAST = DEPENDENCY_LAST + {{Text|1|#F580B1}}
{{Text|CONST|#F0F0F0}} DEPENDENCY_CONSOLE_ONLY = {{Text|7|#F580B1}}: DEPENDENCY_LAST = DEPENDENCY_LAST + {{Text|1|#F580B1}} {{Text|<nowiki>'=2 if via -g switch, =1 if via metacommand $CONSOLE:ONLY</nowiki>|#31C4C4}}
{{Text|CONST|#F0F0F0}} DEPENDENCY_SOCKETS = {{Text|8|#F580B1}}: DEPENDENCY_LAST = DEPENDENCY_LAST + {{Text|1|#F580B1}}
{{Text|CONST|#F0F0F0}} DEPENDENCY_PRINTER = {{Text|9|#F580B1}}: DEPENDENCY_LAST = DEPENDENCY_LAST + {{Text|1|#F580B1}}
{{Text|CONST|#F0F0F0}} DEPENDENCY_ICON = {{Text|10|#F580B1}}: DEPENDENCY_LAST = DEPENDENCY_LAST + {{Text|1|#F580B1}}
{{Text|CONST|#F0F0F0}} DEPENDENCY_SCREENIMAGE = {{Text|11|#F580B1}}: DEPENDENCY_LAST = DEPENDENCY_LAST + {{Text|1|#F580B1}}
{{Text|CONST|#F0F0F0}} DEPENDENCY_DEVICEINPUT = {{Text|12|#F580B1}}: DEPENDENCY_LAST = DEPENDENCY_LAST + {{Text|1|#F580B1}} {{Text|<nowiki>'removes support for gamepad input if not present</nowiki>|#31C4C4}}
{{Text|CONST|#F0F0F0}} DEPENDENCY_ZLIB = {{Text|13|#F580B1}}: DEPENDENCY_LAST = DEPENDENCY_LAST + {{Text|1|#F580B1}} {{Text|<nowiki>'ZLIB library linkage, if desired, for compression/decompression.</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} DEPENDENCY({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} DEPENDENCY_LAST)
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} UseGL {{Text|<nowiki>'declared SUB _GL (no params)</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} OS_BITS {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}, WindowTitle {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
OS_BITS = {{Text|64|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}({{Text|_OS$|#F0F0F0}}, {{Text|<nowiki>"[32BIT]"</nowiki>|#FFB100}}) {{Text|THEN|#F0F0F0}} OS_BITS = {{Text|32|#F580B1}}
{{Text|IF|#F0F0F0}} OS_BITS = {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} WindowTitle = {{Text|<nowiki>"QB64 Phoenix Edition (x32)"</nowiki>|#FFB100}} {{Text|ELSE|#F0F0F0}} WindowTitle = {{Text|<nowiki>"QB64 Phoenix Edition (x64)"</nowiki>|#FFB100}}
{{Text|_TITLE|#F0F0F0}} WindowTitle
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} ConsoleMode, No_C_Compile_Mode, NoIDEMode
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} ShowWarnings {{Text|AS|#F0F0F0}} {{Text|_BYTE|#F0F0F0}}, QuietMode {{Text|AS|#F0F0F0}} {{Text|_BYTE|#F0F0F0}}, CMDLineFile {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} MonochromeLoggingMode {{Text|AS|#F0F0F0}} {{Text|_BYTE|#F0F0F0}}
{{Text|TYPE|#F0F0F0}} usedVarList
    {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}} id, linenumber, includeLevel, includedLine, scope, localIndex
    {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}} arrayElementSize
    {{Text|AS|#F0F0F0}} {{Text|_BYTE|#F0F0F0}} used, watch, isarray, displayFormat {{Text|<nowiki>'displayFormat: 0=DEC;1=HEX;2=BIN;3=OCT</nowiki>|#31C4C4}}
    {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} name, cname, varType, includedFile, subfunc
    {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} watchRange, indexes, elements, elementTypes {{Text|<nowiki>'for Arrays and UDTs</nowiki>|#31C4C4}}
    {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} elementOffset, storage
{{Text|END|#F0F0F0}} {{Text|TYPE|#F0F0F0}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} backupUsedVariableList({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} usedVarList
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} typeDefinitions$, backupTypeDefinitions$
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} totalVariablesCreated {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}, totalMainVariablesCreated {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} bypassNextVariable {{Text|AS|#F0F0F0}} {{Text|_BYTE|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} totalWarnings {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}, warningListItems {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}, lastWarningHeader {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} duplicateConstWarning {{Text|AS|#F0F0F0}} {{Text|_BYTE|#F0F0F0}}, warningsissued {{Text|AS|#F0F0F0}} {{Text|_BYTE|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} emptySCWarning {{Text|AS|#F0F0F0}} {{Text|_BYTE|#F0F0F0}}, maxLineNumber {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} ExeIconSet {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}, qb64prefix$, qb64prefix_set
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} VersionInfoSet {{Text|AS|#F0F0F0}} {{Text|_BYTE|#F0F0F0}}
{{Text|<nowiki>'Variables to handle $VERSIONINFO metacommand:</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} viFileVersionNum$, viProductVersionNum$, viCompanyName$
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} viFileDescription$, viFileVersion$, viInternalName$
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} viLegalCopyright$, viLegalTrademarks$, viOriginalFilename$
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} viProductName$, viProductVersion$, viComments$, viWeb$
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} NoChecks
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} Console
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} ScreenHide
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} Asserts
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} OptMax {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
OptMax = {{Text|256|#F580B1}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} Opt({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} OptMax, {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|10|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} * {{Text|256|#F580B1}}
{{Text|<nowiki>'  (1,1)="READ"</nowiki>|#31C4C4}}
{{Text|<nowiki>'  (1,2)="WRITE"</nowiki>|#31C4C4}}
{{Text|<nowiki>'  (1,3)="READ WRITE"</nowiki>|#31C4C4}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} OptWords({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} OptMax, {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|10|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}} {{Text|<nowiki>'The number of words of each opt () element</nowiki>|#31C4C4}}
{{Text|<nowiki>'  (1,1)=1 '"READ"</nowiki>|#31C4C4}}
{{Text|<nowiki>'  (1,2)=1 '"WRITE"</nowiki>|#31C4C4}}
{{Text|<nowiki>'  (1,3)=2 '"READ WRITE"</nowiki>|#31C4C4}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} T({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} OptMax) {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}} {{Text|<nowiki>'The type of the entry</nowiki>|#31C4C4}}
{{Text|<nowiki>'  t is 0 for ? opts</nowiki>|#31C4C4}}
{{Text|<nowiki>'  ---------- 0 means ? , 1+ means a symbol or {}block ----------</nowiki>|#31C4C4}}
{{Text|<nowiki>'  t is 1 for symbol opts</nowiki>|#31C4C4}}
{{Text|<nowiki>'  t is the number of rhs opt () index enteries for {READ¦WRITE¦READ WRITE} like opts</nowiki>|#31C4C4}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} Lev({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} OptMax) {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}} {{Text|<nowiki>'The indwelling level of each opt () element (the lowest is 0)</nowiki>|#31C4C4}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} EntryLev({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} OptMax) {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}} {{Text|<nowiki>'The level required from which this opt () can be validly be entered/checked-for</nowiki>|#31C4C4}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} DitchLev({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} OptMax) {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}} {{Text|<nowiki>'The lowest level recorded between the previous Opt and this Opt</nowiki>|#31C4C4}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} DontPass({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} OptMax) {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}} {{Text|<nowiki>'Set to 1 or 0, with 1 meaning don't pass</nowiki>|#31C4C4}}
{{Text|<nowiki>'Determines whether the opt () entry needs to actually be passed to the C++ sub/function</nowiki>|#31C4C4}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} TempList({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} OptMax) {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} PassRule({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} OptMax) {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|<nowiki>'0 means no pass rule</nowiki>|#31C4C4}}
{{Text|<nowiki>'negative values refer to an opt () element</nowiki>|#31C4C4}}
{{Text|<nowiki>'positive values refer to a flag value</nowiki>|#31C4C4}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} LevelEntered(OptMax) {{Text|<nowiki>'up to 64 levels supported</nowiki>|#31C4C4}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} separgs(OptMax + {{Text|1|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} separgslayout(OptMax + {{Text|1|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} separgs2(OptMax + {{Text|1|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} separgslayout2(OptMax + {{Text|1|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} E
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} ResolveStaticFunctions
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} ResolveStaticFunction_File({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|100|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} ResolveStaticFunction_Name({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|100|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} ResolveStaticFunction_Method({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|100|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} Error_Happened {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} Error_Message {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} os {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
os$ = {{Text|<nowiki>"WIN"</nowiki>|#FFB100}}
{{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}({{Text|_OS$|#F0F0F0}}, {{Text|<nowiki>"[LINUX]"</nowiki>|#FFB100}}) {{Text|THEN|#F0F0F0}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} MacOSX {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}({{Text|_OS$|#F0F0F0}}, {{Text|<nowiki>"[MACOSX]"</nowiki>|#FFB100}}) {{Text|THEN|#F0F0F0}} MacOSX = {{Text|1|#F580B1}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} inline_DATA
{{Text|IF|#F0F0F0}} MacOSX {{Text|THEN|#F0F0F0}} inline_DATA = {{Text|1|#F580B1}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} BATCHFILE_EXTENSION {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
BATCHFILE_EXTENSION = {{Text|<nowiki>".bat"</nowiki>|#FFB100}}
{{Text|IF|#F0F0F0}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}} BATCHFILE_EXTENSION = {{Text|<nowiki>".sh"</nowiki>|#FFB100}}
{{Text|IF|#F0F0F0}} MacOSX {{Text|THEN|#F0F0F0}} BATCHFILE_EXTENSION = {{Text|<nowiki>".command"</nowiki>|#FFB100}}
{{Text|DIM|#F0F0F0}} inlinedatastr({{Text|255|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|FOR|#F0F0F0}} i = {{Text|0|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|255|#F580B1}}
    inlinedatastr(i) = str2$(i) + {{Text|<nowiki>","</nowiki>|#FFB100}}
{{Text|NEXT|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} extension {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} path.exe$, path.source$, lastBinaryGenerated$
extension$ = {{Text|<nowiki>".exe"</nowiki>|#FFB100}}
{{Text|IF|#F0F0F0}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}} extension$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Text|<nowiki>'no extension under Linux</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} pathsep {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} * {{Text|1|#F580B1}}
pathsep$ = {{Text|<nowiki>"\"</nowiki>|#FFB100}}
{{Text|IF|#F0F0F0}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}} pathsep$ = {{Text|<nowiki>"/"</nowiki>|#FFB100}}
{{Text|<nowiki>'note: QB64 handles OS specific path separators automatically except under SHELL calls</nowiki>|#31C4C4}}
{{Text|ON|#F0F0F0}} {{Text|ERROR|#F0F0F0}} {{Text|GOTO|#F0F0F0}} qberror_test
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} tmpdir {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}, tmpdir2 {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|IF|#F0F0F0}} os$ = {{Text|<nowiki>"WIN"</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}} tmpdir$ = {{Text|<nowiki>".\internal\temp\"</nowiki>|#FFB100}}: tmpdir2$ = {{Text|<nowiki>"..\\temp\\"</nowiki>|#FFB100}}
{{Text|IF|#F0F0F0}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}} tmpdir$ = {{Text|<nowiki>"./internal/temp/"</nowiki>|#FFB100}}: tmpdir2$ = {{Text|<nowiki>"../temp/"</nowiki>|#FFB100}}
{{Text|IF|#F0F0F0}} {{Text|NOT|#F0F0F0}} {{Text|_DIREXISTS|#F0F0F0}}(tmpdir$) {{Text|THEN|#F0F0F0}} {{Text|MKDIR|#F0F0F0}} tmpdir$
{{Text|DECLARE|#F0F0F0}} {{Text|LIBRARY|#F0F0F0}}
    {{Text|FUNCTION|#F0F0F0}} getpid& ()
{{Text|END|#F0F0F0}} {{Text|DECLARE|#F0F0F0}}
thisinstancepid = getpid&
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} tempfolderindex
{{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}({{Text|_OS$|#F0F0F0}}, {{Text|<nowiki>"LINUX"</nowiki>|#FFB100}}) {{Text|THEN|#F0F0F0}}
    fh = {{Text|FREEFILE|#F0F0F0}}
    {{Text|OPEN|#F0F0F0}} {{Text|<nowiki>".\internal\temp\tempfoldersearch.bin"</nowiki>|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|RANDOM|#F0F0F0}} {{Text|AS|#F0F0F0}} #fh {{Text|LEN|#F0F0F0}} = {{Text|LEN|#F0F0F0}}(tempfolderindex)
    tempfolderrecords = {{Text|LOF|#F0F0F0}}(fh) / {{Text|LEN|#F0F0F0}}(tempfolderindex)
    i = {{Text|1|#F580B1}}
    {{Text|IF|#F0F0F0}} tempfolderrecords = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|<nowiki>'first run ever?</nowiki>|#31C4C4}}
        {{Text|PUT|#F0F0F0}} #fh, {{Text|1|#F580B1}}, thisinstancepid
    {{Text|ELSE|#F0F0F0}}
        {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} tempfolderrecords
            {{Text|<nowiki>'check if any of the temp folders is being used = pid still active</nowiki>|#31C4C4}}
            {{Text|GET|#F0F0F0}} #fh, i, tempfoldersearch
            {{Text|SHELL|#F0F0F0}} {{Text|_HIDE|#F0F0F0}} {{Text|<nowiki>"ps -p "</nowiki>|#FFB100}} + {{Text|STR$|#F0F0F0}}(tempfoldersearch) + {{Text|<nowiki>" > /dev/null 2>&1; echo $? > internal/temp/checkpid.bin"</nowiki>|#FFB100}}
            fh2 = {{Text|FREEFILE|#F0F0F0}}
            {{Text|OPEN|#F0F0F0}} {{Text|<nowiki>"internal/temp/checkpid.bin"</nowiki>|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|BINARY|#F0F0F0}} {{Text|AS|#F0F0F0}} #fh2
            {{Text|LINE|#F0F0F0}} {{Text|INPUT|#F0F0F0}} #fh2, checkpid$
            {{Text|CLOSE|#F0F0F0}} #fh2
            {{Text|IF|#F0F0F0}} {{Text|VAL|#F0F0F0}}(checkpid$) = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|<nowiki>'This temp folder was locked by an instance that's no longer active, so</nowiki>|#31C4C4}}
                {{Text|<nowiki>'this will be our temp folder</nowiki>|#31C4C4}}
                {{Text|PUT|#F0F0F0}} #fh, i, thisinstancepid
                {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|NEXT|#F0F0F0}}
        {{Text|IF|#F0F0F0}} i > tempfolderrecords {{Text|THEN|#F0F0F0}}
            {{Text|<nowiki>'All indexes were busy. Let's initiate a new one:</nowiki>|#31C4C4}}
            {{Text|PUT|#F0F0F0}} #fh, i, thisinstancepid
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|CLOSE|#F0F0F0}} #fh
    {{Text|IF|#F0F0F0}} i > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        tmpdir$ = {{Text|<nowiki>"./internal/temp"</nowiki>|#FFB100}} + str2$(i) + {{Text|<nowiki>"/"</nowiki>|#FFB100}}: tmpdir2$ = {{Text|<nowiki>"../temp"</nowiki>|#FFB100}} + str2$(i) + {{Text|<nowiki>"/"</nowiki>|#FFB100}}
        {{Text|IF|#F0F0F0}} {{Text|_DIREXISTS|#F0F0F0}}(tmpdir$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|MKDIR|#F0F0F0}} tmpdir$
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|OPEN|#F0F0F0}} tmpdir$ + {{Text|<nowiki>"temp.bin"</nowiki>|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|OUTPUT|#F0F0F0}} {{Text|LOCK|#F0F0F0}} {{Text|WRITE|#F0F0F0}} {{Text|AS|#F0F0F0}} #26
{{Text|ELSE|#F0F0F0}}
    {{Text|ON|#F0F0F0}} {{Text|ERROR|#F0F0F0}} {{Text|GOTO|#F0F0F0}} qberror_test
    E = {{Text|0|#F580B1}}
    i = {{Text|1|#F580B1}}
    {{Text|OPEN|#F0F0F0}} tmpdir$ + {{Text|<nowiki>"temp.bin"</nowiki>|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|OUTPUT|#F0F0F0}} {{Text|LOCK|#F0F0F0}} {{Text|WRITE|#F0F0F0}} {{Text|AS|#F0F0F0}} #26
    {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} E
        i = i + {{Text|1|#F580B1}}
        {{Text|IF|#F0F0F0}} i = {{Text|1000|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} {{Text|<nowiki>"Unable to locate the 'internal' folder"</nowiki>|#FFB100}}: {{Text|END|#F0F0F0}} {{Text|1|#F580B1}}
        {{Text|MKDIR|#F0F0F0}} {{Text|<nowiki>".\internal\temp"</nowiki>|#FFB100}} + str2$(i)
        {{Text|IF|#F0F0F0}} os$ = {{Text|<nowiki>"WIN"</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}} tmpdir$ = {{Text|<nowiki>".\internal\temp"</nowiki>|#FFB100}} + str2$(i) + {{Text|<nowiki>"\"</nowiki>|#FFB100}}: tmpdir2$ = {{Text|<nowiki>"..\\temp"</nowiki>|#FFB100}} + str2$(i) + {{Text|<nowiki>"\\"</nowiki>|#FFB100}}
        {{Text|IF|#F0F0F0}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}} tmpdir$ = {{Text|<nowiki>"./internal/temp"</nowiki>|#FFB100}} + str2$(i) + {{Text|<nowiki>"/"</nowiki>|#FFB100}}: tmpdir2$ = {{Text|<nowiki>"../temp"</nowiki>|#FFB100}} + str2$(i) + {{Text|<nowiki>"/"</nowiki>|#FFB100}}
        E = {{Text|0|#F580B1}}
        {{Text|OPEN|#F0F0F0}} tmpdir$ + {{Text|<nowiki>"temp.bin"</nowiki>|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|OUTPUT|#F0F0F0}} {{Text|LOCK|#F0F0F0}} {{Text|WRITE|#F0F0F0}} {{Text|AS|#F0F0F0}} #26
    {{Text|LOOP|#F0F0F0}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|<nowiki>'temp folder established</nowiki>|#31C4C4}}
tempfolderindex = i
{{Text|IF|#F0F0F0}} i > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
    {{Text|<nowiki>'create modified version of qbx.cpp</nowiki>|#31C4C4}}
    {{Text|OPEN|#F0F0F0}} {{Text|<nowiki>".\internal\c\qbx"</nowiki>|#FFB100}} + str2$(i) + {{Text|<nowiki>".cpp"</nowiki>|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|OUTPUT|#F0F0F0}} {{Text|AS|#F0F0F0}} #2
    {{Text|OPEN|#F0F0F0}} {{Text|<nowiki>".\internal\c\qbx.cpp"</nowiki>|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|BINARY|#F0F0F0}} {{Text|AS|#F0F0F0}} #1
    {{Text|DO|#F0F0F0}} {{Text|UNTIL|#F0F0F0}} {{Text|EOF|#F0F0F0}}({{Text|1|#F580B1}})
        {{Text|LINE|#F0F0F0}} {{Text|INPUT|#F0F0F0}} #1, a$
        x = {{Text|INSTR|#F0F0F0}}(a$, {{Text|<nowiki>"..\\temp\\"</nowiki>|#FFB100}}): {{Text|IF|#F0F0F0}} x {{Text|THEN|#F0F0F0}} a$ = {{Text|LEFT$|#F0F0F0}}(a$, x - {{Text|1|#F580B1}}) + {{Text|<nowiki>"..\\temp"</nowiki>|#FFB100}} + str2$(i) + {{Text|<nowiki>"\\"</nowiki>|#FFB100}} + {{Text|RIGHT$|#F0F0F0}}(a$, {{Text|LEN|#F0F0F0}}(a$) - (x + {{Text|9|#F580B1}}))
        x = {{Text|INSTR|#F0F0F0}}(a$, {{Text|<nowiki>"../temp/"</nowiki>|#FFB100}}): {{Text|IF|#F0F0F0}} x {{Text|THEN|#F0F0F0}} a$ = {{Text|LEFT$|#F0F0F0}}(a$, x - {{Text|1|#F580B1}}) + {{Text|<nowiki>"../temp"</nowiki>|#FFB100}} + str2$(i) + {{Text|<nowiki>"/"</nowiki>|#FFB100}} + {{Text|RIGHT$|#F0F0F0}}(a$, {{Text|LEN|#F0F0F0}}(a$) - (x + {{Text|7|#F580B1}}))
        {{Text|PRINT|#F0F0F0}} #2, a$
    {{Text|LOOP|#F0F0F0}}
    {{Text|CLOSE|#F0F0F0}} #1, #2
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|OPEN|#F0F0F0}} tmpdir$ + {{Text|<nowiki>"debug.txt"</nowiki>|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|OUTPUT|#F0F0F0}} {{Text|AS|#F0F0F0}} #9
{{Text|ON|#F0F0F0}} {{Text|ERROR|#F0F0F0}} {{Text|GOTO|#F0F0F0}} qberror
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} tempfolderindexstr {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} {{Text|<nowiki>'appended to "Untitled"</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} tempfolderindexstr2 {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|IF|#F0F0F0}} tempfolderindex <> {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} tempfolderindexstr$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} + str2$(tempfolderindex) + {{Text|<nowiki>")"</nowiki>|#FFB100}}: tempfolderindexstr2$ = str2$(tempfolderindex)
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} idedebuginfo
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} seperateargs_error
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} seperateargs_error_message {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} compfailed
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} reginternalsubfunc
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} reginternalvariable
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} symboltype_size
symboltype_size = {{Text|0|#F580B1}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} use_global_byte_elements
use_global_byte_elements = {{Text|0|#F580B1}}
{{Text|<nowiki>'compiler-side IDE data & definitions</nowiki>|#31C4C4}}
{{Text|<nowiki>'SHARED variables "passed" to/from the compiler & IDE</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} idecommand {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} {{Text|<nowiki>'a 1 byte message-type code, followed by optional string data</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} idereturn {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} {{Text|<nowiki>'used to pass formatted-lines and return information back to the IDE</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} ideerror {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} idecompiled {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} idemode {{Text|<nowiki>'1 if using the IDE to compile</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} ideerrorline {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}} {{Text|<nowiki>'set by qb64-error(...) to the line number it would have reported, this number</nowiki>|#31C4C4}}
{{Text|<nowiki>'is later passed to the ide in message #8</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} idemessage {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} {{Text|<nowiki>'set by qb64-error(...) to the error message to be reported, this</nowiki>|#31C4C4}}
{{Text|<nowiki>'is later passed to the ide in message #8</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} optionexplicit {{Text|AS|#F0F0F0}} {{Text|_BYTE|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} optionexplicitarray {{Text|AS|#F0F0F0}} {{Text|_BYTE|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} optionexplicit_cmd {{Text|AS|#F0F0F0}} {{Text|_BYTE|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} ideStartAtLine {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}, errorLineInInclude {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} warningInInclude {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}, warningInIncludeLine {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} outputfile_cmd$
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} compilelog$
{{Text|<nowiki>'</nowiki>|#31C4C4}}{{Text|$INCLUDE:|#55FF55}}{{Text|<nowiki>'global\IDEsettings.bas'</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} OutputIsRelativeToStartDir {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
CMDLineFile = ParseCMDLineArgs$
{{Text|IF|#F0F0F0}} CMDLineFile <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Text|AND|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|_STARTDIR$|#F0F0F0}} + {{Text|<nowiki>"/"</nowiki>|#FFB100}} + CMDLineFile) {{Text|THEN|#F0F0F0}}
    CMDLineFile = {{Text|_STARTDIR$|#F0F0F0}} + {{Text|<nowiki>"/"</nowiki>|#FFB100}} + CMDLineFile
    OutputIsRelativeToStartDir = {{Text|-1|#F580B1}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}} ConsoleMode {{Text|THEN|#F0F0F0}}
    {{Text|_DEST|#F0F0F0}} {{Text|_CONSOLE|#F0F0F0}}
{{Text|ELSE|#F0F0F0}}
    {{Text|_CONSOLE|#F0F0F0}} {{Text|OFF|#F0F0F0}}
    {{Text|_SCREENSHOW|#F0F0F0}}
    {{Text|_ICON|#F0F0F0}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|<nowiki>'the function ?=ide(?) should always be passed 0, it returns a message code number, any further information</nowiki>|#31C4C4}}
{{Text|<nowiki>'is passed back in idereturn</nowiki>|#31C4C4}}
{{Text|<nowiki>'message code numbers:</nowiki>|#31C4C4}}
{{Text|<nowiki>'0  no ide present  (auto defined array ide() return 0)</nowiki>|#31C4C4}}
{{Text|<nowiki>'1  launch ide & with passed filename (compiler->ide)</nowiki>|#31C4C4}}
{{Text|<nowiki>'2  begin new compilation with returned line of code (compiler<-ide)</nowiki>|#31C4C4}}
{{Text|<nowiki>'  [2][line of code]</nowiki>|#31C4C4}}
{{Text|<nowiki>'3  request next line (compiler->ide)</nowiki>|#31C4C4}}
{{Text|<nowiki>'  [3]</nowiki>|#31C4C4}}
{{Text|<nowiki>'4  next line of code returned (compiler<-ide)</nowiki>|#31C4C4}}
{{Text|<nowiki>'  [4][line of code]</nowiki>|#31C4C4}}
{{Text|<nowiki>'5  no more lines of code exist (compiler<-ide)</nowiki>|#31C4C4}}
{{Text|<nowiki>'  [5]</nowiki>|#31C4C4}}
{{Text|<nowiki>'6  code is OK/ready (compiler->ide)</nowiki>|#31C4C4}}
{{Text|<nowiki>'  [6]</nowiki>|#31C4C4}}
{{Text|<nowiki>'7  repass the code from the beginning (compiler->ide)</nowiki>|#31C4C4}}
{{Text|<nowiki>'  [7]</nowiki>|#31C4C4}}
{{Text|<nowiki>'8  an error has occurred with 'this' message on 'this' line(compiler->ide)</nowiki>|#31C4C4}}
{{Text|<nowiki>'  [8][error message][line as LONG]</nowiki>|#31C4C4}}
{{Text|<nowiki>'9  C++ compile (if necessary) and run with 'this' name (compiler<-ide)</nowiki>|#31C4C4}}
{{Text|<nowiki>'  [9][name(no path, no .bas)]</nowiki>|#31C4C4}}
{{Text|<nowiki>'10 The line requires more time to process</nowiki>|#31C4C4}}
{{Text|<nowiki>'      Pass-back 'line of code' using method [4] when ready</nowiki>|#31C4C4}}
{{Text|<nowiki>'  [10][line of code]</nowiki>|#31C4C4}}
{{Text|<nowiki>'11 ".EXE file created" message</nowiki>|#31C4C4}}
{{Text|<nowiki>'12    The name of the exe I'll create is '...' (compiler->ide)</nowiki>|#31C4C4}}
{{Text|<nowiki>'  [12][exe name without .exe]</nowiki>|#31C4C4}}
{{Text|<nowiki>'255    A qb error happened in the IDE (compiler->ide)</nowiki>|#31C4C4}}
{{Text|<nowiki>'  note: detected by the fact that ideerror was not set to 0</nowiki>|#31C4C4}}
{{Text|<nowiki>'  [255]</nowiki>|#31C4C4}}
{{Text|<nowiki>'hash table data</nowiki>|#31C4C4}}
{{Text|TYPE|#F0F0F0}} HashListItem
    Flags {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
    Reference {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
    NextItem {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
    PrevItem {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
    LastItem {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}} {{Text|<nowiki>'note: this value is only valid on the first item in the list</nowiki>|#31C4C4}}
    {{Text|<nowiki>'note: name is stored in a seperate array of strings</nowiki>|#31C4C4}}
{{Text|END|#F0F0F0}} {{Text|TYPE|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} HashFind_NextListItem {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} HashFind_Reverse {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} HashFind_SearchFlags {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} HashFind_Name {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} HashRemove_LastFound {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} HashListSize {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} HashListNext {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} HashListFreeSize {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} HashListFreeLast {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|<nowiki>'hash lookup tables</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} hash1char({{Text|255|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} hash2char({{Text|65535|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
{{Text|FOR|#F0F0F0}} x = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|26|#F580B1}}
    hash1char({{Text|64|#F580B1}} + x) = x
    hash1char({{Text|96|#F580B1}} + x) = x
{{Text|NEXT|#F0F0F0}}
hash1char({{Text|95|#F580B1}}) = {{Text|27|#F580B1}} {{Text|<nowiki>'_</nowiki>|#31C4C4}}
hash1char({{Text|48|#F580B1}}) = {{Text|28|#F580B1}} {{Text|<nowiki>'0</nowiki>|#31C4C4}}
hash1char({{Text|49|#F580B1}}) = {{Text|29|#F580B1}} {{Text|<nowiki>'1</nowiki>|#31C4C4}}
hash1char({{Text|50|#F580B1}}) = {{Text|30|#F580B1}} {{Text|<nowiki>'2</nowiki>|#31C4C4}}
hash1char({{Text|51|#F580B1}}) = {{Text|31|#F580B1}} {{Text|<nowiki>'3</nowiki>|#31C4C4}}
hash1char({{Text|52|#F580B1}}) = {{Text|23|#F580B1}} {{Text|<nowiki>'4 'note: x, y, z and beginning alphabet letters avoided because of common usage (eg. a2, y3)</nowiki>|#31C4C4}}
hash1char({{Text|53|#F580B1}}) = {{Text|22|#F580B1}} {{Text|<nowiki>'5</nowiki>|#31C4C4}}
hash1char({{Text|54|#F580B1}}) = {{Text|20|#F580B1}} {{Text|<nowiki>'6</nowiki>|#31C4C4}}
hash1char({{Text|55|#F580B1}}) = {{Text|19|#F580B1}} {{Text|<nowiki>'7</nowiki>|#31C4C4}}
hash1char({{Text|56|#F580B1}}) = {{Text|18|#F580B1}} {{Text|<nowiki>'8</nowiki>|#31C4C4}}
hash1char({{Text|57|#F580B1}}) = {{Text|17|#F580B1}} {{Text|<nowiki>'9</nowiki>|#31C4C4}}
{{Text|FOR|#F0F0F0}} c1 = {{Text|0|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|255|#F580B1}}
    {{Text|FOR|#F0F0F0}} c2 = {{Text|0|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|255|#F580B1}}
        hash2char(c1 + c2 * {{Text|256|#F580B1}}) = hash1char(c1) + hash1char(c2) * {{Text|32|#F580B1}}
    {{Text|NEXT|#F0F0F0}}
{{Text|NEXT|#F0F0F0}}
{{Text|<nowiki>'init</nowiki>|#31C4C4}}
HashListSize = {{Text|65536|#F580B1}}
HashListNext = {{Text|1|#F580B1}}
HashListFreeSize = {{Text|1024|#F580B1}}
HashListFreeLast = {{Text|0|#F580B1}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} HashList({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} HashListSize) {{Text|AS|#F0F0F0}} HashListItem
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} HashListName({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} HashListSize) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} * {{Text|256|#F580B1}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} HashListFree({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} HashListFreeSize) {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} HashTable({{Text|16777215|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}} {{Text|<nowiki>'64MB lookup table with indexes to the hashlist</nowiki>|#31C4C4}}
{{Text|CONST|#F0F0F0}} HASHFLAG_LABEL = {{Text|2|#F580B1}}
{{Text|CONST|#F0F0F0}} HASHFLAG_TYPE = {{Text|4|#F580B1}}
{{Text|CONST|#F0F0F0}} HASHFLAG_RESERVED = {{Text|8|#F580B1}}
{{Text|CONST|#F0F0F0}} HASHFLAG_OPERATOR = {{Text|16|#F580B1}}
{{Text|CONST|#F0F0F0}} HASHFLAG_CUSTOMSYNTAX = {{Text|32|#F580B1}}
{{Text|CONST|#F0F0F0}} HASHFLAG_SUB = {{Text|64|#F580B1}}
{{Text|CONST|#F0F0F0}} HASHFLAG_FUNCTION = {{Text|128|#F580B1}}
{{Text|CONST|#F0F0F0}} HASHFLAG_UDT = {{Text|256|#F580B1}}
{{Text|CONST|#F0F0F0}} HASHFLAG_UDTELEMENT = {{Text|512|#F580B1}}
{{Text|CONST|#F0F0F0}} HASHFLAG_CONSTANT = {{Text|1024|#F580B1}}
{{Text|CONST|#F0F0F0}} HASHFLAG_VARIABLE = {{Text|2048|#F580B1}}
{{Text|CONST|#F0F0F0}} HASHFLAG_ARRAY = {{Text|4096|#F580B1}}
{{Text|CONST|#F0F0F0}} HASHFLAG_XELEMENTNAME = {{Text|8192|#F580B1}}
{{Text|CONST|#F0F0F0}} HASHFLAG_XTYPENAME = {{Text|16384|#F580B1}}
{{Text|TYPE|#F0F0F0}} Label_Type
    State {{Text|AS|#F0F0F0}} {{Text|_UNSIGNED|#F0F0F0}} {{Text|_BYTE|#F0F0F0}} {{Text|<nowiki>'0=label referenced, 1=label created</nowiki>|#31C4C4}}
    cn {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} * {{Text|256|#F580B1}}
    Scope {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
    Data_Offset {{Text|AS|#F0F0F0}} {{Text|_INTEGER64|#F0F0F0}} {{Text|<nowiki>'offset within data</nowiki>|#31C4C4}}
    Data_Referenced {{Text|AS|#F0F0F0}} {{Text|_UNSIGNED|#F0F0F0}} {{Text|_BYTE|#F0F0F0}} {{Text|<nowiki>'set to 1 if data is referenced (data_offset will be used to create the data offset variable)</nowiki>|#31C4C4}}
    Error_Line {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}} {{Text|<nowiki>'the line number to reference on errors</nowiki>|#31C4C4}}
    Scope_Restriction {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}} {{Text|<nowiki>'cannot exist inside this scope (post checked)</nowiki>|#31C4C4}}
    SourceLineNumber {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|END|#F0F0F0}} {{Text|TYPE|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} nLabels, Labels_Ubound
Labels_Ubound = {{Text|100|#F580B1}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} Labels({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} Labels_Ubound) {{Text|AS|#F0F0F0}} Label_Type
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} Empty_Label {{Text|AS|#F0F0F0}} Label_Type
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} PossibleSubNameLabels {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} {{Text|<nowiki>'format: name+sp+name+sp+name <-ucase$'d</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} SubNameLabels {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} {{Text|<nowiki>'format: name+sp+name+sp+name <-ucase$'d</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} CreatingLabel {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} AllowLocalName {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} DataOffset
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} prepass
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} autoarray
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} ontimerid, onkeyid, onstrigid
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} revertmaymusthave({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|10000|#F580B1}})
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} revertmaymusthaven
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} linecontinuation
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} dim2typepassback {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} {{Text|<nowiki>'passes back correct case sensitive version of type</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} inclevel
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} incname({{Text|100|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} {{Text|<nowiki>'must be full path as given</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} inclinenumber({{Text|100|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} incerror {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} fix046 {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
fix046$ = {{Text|<nowiki>"__"</nowiki>|#FFB100}} + {{Text|<nowiki>"ASCII"</nowiki>|#FFB100}} + {{Text|<nowiki>"_"</nowiki>|#FFB100}} + {{Text|<nowiki>"CHR"</nowiki>|#FFB100}} + {{Text|<nowiki>"_"</nowiki>|#FFB100}} + {{Text|<nowiki>"046"</nowiki>|#FFB100}} + {{Text|<nowiki>"__"</nowiki>|#FFB100}} {{Text|<nowiki>'broken up to avoid detection for layout reversion</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} layout {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} {{Text|<nowiki>'passed to IDE</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} layoutok {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}} {{Text|<nowiki>'tracks status of entire line</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} layoutcomment {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} tlayout {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} {{Text|<nowiki>'temporary layout string set by supporting functions</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} layoutdone {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}} {{Text|<nowiki>'tracks status of single command</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} fooindwel
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} alphanumeric({{Text|255|#F580B1}})
{{Text|FOR|#F0F0F0}} i = {{Text|48|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|57|#F580B1}}
    alphanumeric(i) = {{Text|-1|#F580B1}}
{{Text|NEXT|#F0F0F0}}
{{Text|FOR|#F0F0F0}} i = {{Text|65|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|90|#F580B1}}
    alphanumeric(i) = {{Text|-1|#F580B1}}
{{Text|NEXT|#F0F0F0}}
{{Text|FOR|#F0F0F0}} i = {{Text|97|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|122|#F580B1}}
    alphanumeric(i) = {{Text|-1|#F580B1}}
{{Text|NEXT|#F0F0F0}}
{{Text|<nowiki>'_ is treated as an alphabet letter</nowiki>|#31C4C4}}
alphanumeric({{Text|95|#F580B1}}) = {{Text|-1|#F580B1}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} isalpha({{Text|255|#F580B1}})
{{Text|FOR|#F0F0F0}} i = {{Text|65|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|90|#F580B1}}
    isalpha(i) = {{Text|-1|#F580B1}}
{{Text|NEXT|#F0F0F0}}
{{Text|FOR|#F0F0F0}} i = {{Text|97|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|122|#F580B1}}
    isalpha(i) = {{Text|-1|#F580B1}}
{{Text|NEXT|#F0F0F0}}
{{Text|<nowiki>'_ is treated as an alphabet letter</nowiki>|#31C4C4}}
isalpha({{Text|95|#F580B1}}) = {{Text|-1|#F580B1}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} isnumeric({{Text|255|#F580B1}})
{{Text|FOR|#F0F0F0}} i = {{Text|48|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|57|#F580B1}}
    isnumeric(i) = {{Text|-1|#F580B1}}
{{Text|NEXT|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} lfsinglechar({{Text|255|#F580B1}})
lfsinglechar({{Text|40|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>'(</nowiki>|#31C4C4}}
lfsinglechar({{Text|41|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>')</nowiki>|#31C4C4}}
lfsinglechar({{Text|42|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>'*</nowiki>|#31C4C4}}
lfsinglechar({{Text|43|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>'+</nowiki>|#31C4C4}}
lfsinglechar({{Text|45|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>'-</nowiki>|#31C4C4}}
lfsinglechar({{Text|47|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>'/</nowiki>|#31C4C4}}
lfsinglechar({{Text|60|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>'<</nowiki>|#31C4C4}}
lfsinglechar({{Text|61|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>'=</nowiki>|#31C4C4}}
lfsinglechar({{Text|62|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>'></nowiki>|#31C4C4}}
lfsinglechar({{Text|92|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>'\</nowiki>|#31C4C4}}
lfsinglechar({{Text|94|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>'^</nowiki>|#31C4C4}}
lfsinglechar({{Text|44|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>',</nowiki>|#31C4C4}}
lfsinglechar({{Text|46|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>'.</nowiki>|#31C4C4}}
lfsinglechar({{Text|58|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>':</nowiki>|#31C4C4}}
lfsinglechar({{Text|59|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>';</nowiki>|#31C4C4}}
lfsinglechar({{Text|35|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>'# (file no only)</nowiki>|#31C4C4}}
lfsinglechar({{Text|36|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>'$ (metacommand only)</nowiki>|#31C4C4}}
lfsinglechar({{Text|63|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>'? (print macro)</nowiki>|#31C4C4}}
lfsinglechar({{Text|95|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>'_</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} nextrunlineindex {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} lineinput3buffer {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} lineinput3index {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} dimstatic {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} staticarraylist {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} staticarraylistn {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} commonarraylist {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} commonarraylistn {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|<nowiki>'CONST support</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} constmax {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
constmax = {{Text|100|#F580B1}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} constlast {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
constlast = {{Text|-1|#F580B1}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} constname(constmax) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} constcname(constmax) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} constnamesymbol(constmax) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} {{Text|<nowiki>'optional name symbol</nowiki>|#31C4C4}}
{{Text|<nowiki>' `1 and `no-number must be handled correctly</nowiki>|#31C4C4}}
{{Text|<nowiki>'DIM SHARED constlastshared AS LONG 'so any defined inside a sub/function after this index can be "forgotten" when sub/function exits</nowiki>|#31C4C4}}
{{Text|<nowiki>'constlastshared = -1</nowiki>|#31C4C4}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} consttype(constmax) {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}} {{Text|<nowiki>'variable type number</nowiki>|#31C4C4}}
{{Text|<nowiki>'consttype determines storage</nowiki>|#31C4C4}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} constinteger(constmax) {{Text|AS|#F0F0F0}} {{Text|_INTEGER64|#F0F0F0}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} constuinteger(constmax) {{Text|AS|#F0F0F0}} {{Text|_UNSIGNED|#F0F0F0}} {{Text|_INTEGER64|#F0F0F0}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} constfloat(constmax) {{Text|AS|#F0F0F0}} {{Text|_FLOAT|#F0F0F0}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} conststring(constmax) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} constsubfunc(constmax) {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} constdefined(constmax) {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|<nowiki>'UDT</nowiki>|#31C4C4}}
{{Text|<nowiki>'names</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} lasttype {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} lasttypeelement {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|TYPE|#F0F0F0}} idstruct
    n {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} * {{Text|256|#F580B1}} {{Text|<nowiki>'name</nowiki>|#31C4C4}}
    cn {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} * {{Text|256|#F580B1}} {{Text|<nowiki>'case sensitive version of n</nowiki>|#31C4C4}}
    arraytype {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}} {{Text|<nowiki>'similar to t</nowiki>|#31C4C4}}
    arrayelements {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
    staticarray {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}} {{Text|<nowiki>'set for arrays declared in the main module with static elements</nowiki>|#31C4C4}}
    mayhave {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} * {{Text|8|#F580B1}} {{Text|<nowiki>'mayhave and musthave are exclusive of each other</nowiki>|#31C4C4}}
    musthave {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} * {{Text|8|#F580B1}}
    t {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}} {{Text|<nowiki>'type</nowiki>|#31C4C4}}
    tsize {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
    subfunc {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}} {{Text|<nowiki>'if function=1, sub=2 (max 100 arguments)</nowiki>|#31C4C4}}
    Dependency {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
    internal_subfunc {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
    callname {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} * {{Text|256|#F580B1}}
    ccall {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
    overloaded {{Text|AS|#F0F0F0}} {{Text|_BYTE|#F0F0F0}}
    args {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
    minargs {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
    arg {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} * {{Text|400|#F580B1}} {{Text|<nowiki>'similar to t</nowiki>|#31C4C4}}
    argsize {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} * {{Text|400|#F580B1}} {{Text|<nowiki>'similar to tsize (used for fixed length strings)</nowiki>|#31C4C4}}
    specialformat {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} * {{Text|256|#F580B1}}
    secondargmustbe {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} * {{Text|256|#F580B1}}
    secondargcantbe {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} * {{Text|256|#F580B1}}
    ret {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}} {{Text|<nowiki>'the value it returns if it is a function (again like t)</nowiki>|#31C4C4}}
    insubfunc {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} * {{Text|256|#F580B1}}
    insubfuncn {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
    share {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
    nele {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} * {{Text|100|#F580B1}}
    nelereq {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} * {{Text|100|#F580B1}}
    linkid {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
    linkarg {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
    staticscope {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
    {{Text|<nowiki>'For variables which are arguments passed to a sub/function</nowiki>|#31C4C4}}
    sfid {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}} {{Text|<nowiki>'id number of variable's parent sub/function</nowiki>|#31C4C4}}
    sfarg {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}} {{Text|<nowiki>'argument/parameter # within call (1=first)</nowiki>|#31C4C4}}
    hr_syntax {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|END|#F0F0F0}} {{Text|TYPE|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} id {{Text|AS|#F0F0F0}} idstruct
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} idn {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} ids_max {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
ids_max = {{Text|1024|#F580B1}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} ids({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} ids_max) {{Text|AS|#F0F0F0}} idstruct
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} cmemlist({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} ids_max + {{Text|1|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}} {{Text|<nowiki>'variables that must be in cmem</nowiki>|#31C4C4}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} sfcmemargs({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} ids_max + {{Text|1|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} * {{Text|100|#F580B1}} {{Text|<nowiki>'s/f arg that must be in cmem</nowiki>|#31C4C4}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} arrayelementslist({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} ids_max + {{Text|1|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}} {{Text|<nowiki>'arrayelementslist (like cmemlist) helps to resolve the number of elements in arrays with an unknown number of elements. Note: arrays with an unknown number of elements have .arrayelements=-1</nowiki>|#31C4C4}}
{{Text|<nowiki>'create blank id template for idclear to copy (stops strings being set to chr$(0))</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} cleariddata {{Text|AS|#F0F0F0}} idstruct
cleariddata.cn = {{Text|<nowiki>""</nowiki>|#FFB100}}
cleariddata.n = {{Text|<nowiki>""</nowiki>|#FFB100}}
cleariddata.mayhave = {{Text|<nowiki>""</nowiki>|#FFB100}}
cleariddata.musthave = {{Text|<nowiki>""</nowiki>|#FFB100}}
cleariddata.callname = {{Text|<nowiki>""</nowiki>|#FFB100}}
cleariddata.arg = {{Text|<nowiki>""</nowiki>|#FFB100}}
cleariddata.argsize = {{Text|<nowiki>""</nowiki>|#FFB100}}
cleariddata.specialformat = {{Text|<nowiki>""</nowiki>|#FFB100}}
cleariddata.secondargmustbe = {{Text|<nowiki>""</nowiki>|#FFB100}}
cleariddata.secondargcantbe = {{Text|<nowiki>""</nowiki>|#FFB100}}
cleariddata.insubfunc = {{Text|<nowiki>""</nowiki>|#FFB100}}
cleariddata.nele = {{Text|<nowiki>""</nowiki>|#FFB100}}
cleariddata.nelereq = {{Text|<nowiki>""</nowiki>|#FFB100}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} ISSTRING {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} ISFLOAT {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} ISUNSIGNED {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} ISPOINTER {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} ISFIXEDLENGTH {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} ISINCONVENTIONALMEMORY {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} ISOFFSETINBITS {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} ISARRAY {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} ISREFERENCE {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} ISUDT {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} ISOFFSET {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} STRINGTYPE {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} BITTYPE {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} UBITTYPE {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} BYTETYPE {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} UBYTETYPE {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} INTEGERTYPE {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} UINTEGERTYPE {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} LONGTYPE {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} ULONGTYPE {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} INTEGER64TYPE {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} UINTEGER64TYPE {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} SINGLETYPE {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} DOUBLETYPE {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} FLOATTYPE {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} OFFSETTYPE {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} UOFFSETTYPE {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} UDTTYPE {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} gosubid {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} redimoption {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} dimoption {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} arraydesc {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} qberrorhappened {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} qberrorcode {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} qberrorline {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
{{Text|<nowiki>'COMMON SHARED defineaz() AS STRING</nowiki>|#31C4C4}}
{{Text|<nowiki>'COMMON SHARED defineextaz() AS STRING</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} sourcefile {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} {{Text|<nowiki>'the full path and filename</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} file {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} {{Text|<nowiki>'name of the file (without .bas or path)</nowiki>|#31C4C4}}
{{Text|<nowiki>'COMMON SHARED separgs() AS STRING</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} constequation {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} DynamicMode {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} findidsecondarg {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} findanotherid {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} findidinternal {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} currentid {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}} {{Text|<nowiki>'is the index of the last ID accessed</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} linenumber {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}, reallinenumber {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}, totallinenumber {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}, definingtypeerror {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} wholeline {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} firstLineNumberLabelvWatch {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}, lastLineNumberLabelvWatch {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} vWatchUsedLabels {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}, vWatchUsedSkipLabels {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} linefragment {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|<nowiki>'COMMON SHARED bitmask() AS _INTEGER64</nowiki>|#31C4C4}}
{{Text|<nowiki>'COMMON SHARED bitmaskinv() AS _INTEGER64</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} arrayprocessinghappened {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} stringprocessinghappened {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} cleanupstringprocessingcall {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} inputfunctioncalled {{Text|AS|#F0F0F0}} {{Text|_BYTE|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} recompile {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}} {{Text|<nowiki>'forces recompilation</nowiki>|#31C4C4}}
{{Text|<nowiki>'COMMON SHARED cmemlist() AS INTEGER</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} optionbase {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} addmetastatic {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} addmetadynamic {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} addmetainclude {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} closedmain {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} module {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} subfunc {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} subfuncn {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} closedsubfunc {{Text|AS|#F0F0F0}} {{Text|_BYTE|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} subfuncid {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} defdatahandle {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} dimsfarray {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} dimshared {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
{{Text|<nowiki>'Allows passing of known elements to recompilation</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} sflistn {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
{{Text|<nowiki>'COMMON SHARED sfidlist() AS LONG</nowiki>|#31C4C4}}
{{Text|<nowiki>'COMMON SHARED sfarglist() AS INTEGER</nowiki>|#31C4C4}}
{{Text|<nowiki>'COMMON SHARED sfelelist() AS INTEGER</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} glinkid {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} glinkarg {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} typname2typsize {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} uniquenumbern {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|<nowiki>'CLEAR , , 16384</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} bitmask({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|64|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|_INTEGER64|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} bitmaskinv({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|64|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|_INTEGER64|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} defineextaz({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|27|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} defineaz({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|27|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} {{Text|<nowiki>'27 is an underscore</nowiki>|#31C4C4}}
ISSTRING = {{Text|1073741824|#F580B1}}
ISFLOAT = {{Text|536870912|#F580B1}}
ISUNSIGNED = {{Text|268435456|#F580B1}}
ISPOINTER = {{Text|134217728|#F580B1}}
ISFIXEDLENGTH = {{Text|67108864|#F580B1}} {{Text|<nowiki>'only set for strings with pointer flag</nowiki>|#31C4C4}}
ISINCONVENTIONALMEMORY = {{Text|33554432|#F580B1}}
ISOFFSETINBITS = {{Text|16777216|#F580B1}}
ISARRAY = {{Text|8388608|#F580B1}}
ISREFERENCE = {{Text|4194304|#F580B1}}
ISUDT = {{Text|2097152|#F580B1}}
ISOFFSET = {{Text|1048576|#F580B1}}
STRINGTYPE = ISSTRING + ISPOINTER
BITTYPE = {{Text|1&|#F580B1}} + ISPOINTER + ISOFFSETINBITS
UBITTYPE = {{Text|1&|#F580B1}} + ISPOINTER + ISUNSIGNED + ISOFFSETINBITS {{Text|<nowiki>'QB64 will also support BIT*n, eg. DIM bitarray[10] AS _UNSIGNED _BIT*10</nowiki>|#31C4C4}}
BYTETYPE = {{Text|8&|#F580B1}} + ISPOINTER
UBYTETYPE = {{Text|8&|#F580B1}} + ISPOINTER + ISUNSIGNED
INTEGERTYPE = {{Text|16&|#F580B1}} + ISPOINTER
UINTEGERTYPE = {{Text|16&|#F580B1}} + ISPOINTER + ISUNSIGNED
LONGTYPE = {{Text|32&|#F580B1}} + ISPOINTER
ULONGTYPE = {{Text|32&|#F580B1}} + ISPOINTER + ISUNSIGNED
INTEGER64TYPE = {{Text|64&|#F580B1}} + ISPOINTER
UINTEGER64TYPE = {{Text|64&|#F580B1}} + ISPOINTER + ISUNSIGNED
SINGLETYPE = {{Text|32&|#F580B1}} + ISFLOAT + ISPOINTER
DOUBLETYPE = {{Text|64&|#F580B1}} + ISFLOAT + ISPOINTER
FLOATTYPE = {{Text|256&|#F580B1}} + ISFLOAT + ISPOINTER {{Text|<nowiki>'8-32 bytes</nowiki>|#31C4C4}}
OFFSETTYPE = {{Text|64&|#F580B1}} + ISOFFSET + ISPOINTER: {{Text|IF|#F0F0F0}} OS_BITS = {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} OFFSETTYPE = {{Text|32&|#F580B1}} + ISOFFSET + ISPOINTER
UOFFSETTYPE = {{Text|64&|#F580B1}} + ISOFFSET + ISUNSIGNED + ISPOINTER: {{Text|IF|#F0F0F0}} OS_BITS = {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} UOFFSETTYPE = {{Text|32&|#F580B1}} + ISOFFSET + ISUNSIGNED + ISPOINTER
UDTTYPE = ISUDT + ISPOINTER
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} statementn {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} everycasenewcase {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} controllevel {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}} {{Text|<nowiki>'0=not in a control block</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} controltype({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
{{Text|<nowiki>'1=IF (awaiting END IF)</nowiki>|#31C4C4}}
{{Text|<nowiki>'2=FOR (awaiting NEXT)</nowiki>|#31C4C4}}
{{Text|<nowiki>'3=DO (awaiting LOOP [UNTIL¦WHILE param])</nowiki>|#31C4C4}}
{{Text|<nowiki>'4=DO WHILE/UNTIL (awaiting LOOP)</nowiki>|#31C4C4}}
{{Text|<nowiki>'5=WHILE (awaiting WEND)</nowiki>|#31C4C4}}
{{Text|<nowiki>'6=$IF (precompiler)</nowiki>|#31C4C4}}
{{Text|<nowiki>'10=SELECT CASE qbs (awaiting END SELECT/CASE)</nowiki>|#31C4C4}}
{{Text|<nowiki>'11=SELECT CASE int64 (awaiting END SELECT/CASE)</nowiki>|#31C4C4}}
{{Text|<nowiki>'12=SELECT CASE uint64 (awaiting END SELECT/CASE)</nowiki>|#31C4C4}}
{{Text|<nowiki>'13=SELECT CASE LONG double (awaiting END SELECT/CASE/CASE ELSE)</nowiki>|#31C4C4}}
{{Text|<nowiki>'14=SELECT CASE float ...</nowiki>|#31C4C4}}
{{Text|<nowiki>'15=SELECT CASE double</nowiki>|#31C4C4}}
{{Text|<nowiki>'16=SELECT CASE int32</nowiki>|#31C4C4}}
{{Text|<nowiki>'17=SELECT CASE uint32</nowiki>|#31C4C4}}
{{Text|<nowiki>'18=CASE (awaiting END SELECT/CASE/CASE ELSE)</nowiki>|#31C4C4}}
{{Text|<nowiki>'19=CASE ELSE (awaiting END SELECT)</nowiki>|#31C4C4}}
{{Text|<nowiki>'32=SUB/FUNCTION (awaiting END SUB/FUNCTION)</nowiki>|#31C4C4}}
{{Text|DIM|#F0F0F0}} controlid({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} controlvalue({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} controlstate({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} controlref({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}} {{Text|<nowiki>'the line number the control was created on</nowiki>|#31C4C4}}
{{Text|<nowiki>'</nowiki>|#31C4C4}}
{{Text|<nowiki>' Collection of flags indicating which unstable features should be used during compilation</nowiki>|#31C4C4}}
{{Text|<nowiki>'</nowiki>|#31C4C4}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} unstableFlags({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|2|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|_BYTE|#F0F0F0}}
{{Text|DIM|#F0F0F0}} UNSTABLE_MIDI {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} UNSTABLE_HTTP {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
UNSTABLE_MIDI = {{Text|1|#F580B1}}
UNSTABLE_HTTP = {{Text|2|#F580B1}}
{{Text|ON|#F0F0F0}} {{Text|ERROR|#F0F0F0}} {{Text|GOTO|#F0F0F0}} qberror
i2&& = {{Text|1|#F580B1}}
{{Text|FOR|#F0F0F0}} i&& = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|64|#F580B1}}
    bitmask(i&&) = i2&&
    bitmaskinv(i&&) = {{Text|NOT|#F0F0F0}} i2&&
    i2&& = i2&& + {{Text|2|#F580B1}} ^ i&&
{{Text|NEXT|#F0F0F0}}
{{Text|DIM|#F0F0F0}} id2 {{Text|AS|#F0F0F0}} idstruct
cleanupstringprocessingcall$ = {{Text|<nowiki>"qbs_cleanup(qbs_tmp_base,"</nowiki>|#FFB100}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} sfidlist({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} sfarglist({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} sfelelist({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
{{Text|<nowiki>'----------------ripgl.bas--------------------------------------------------------------------------------</nowiki>|#31C4C4}}
gl_scan_header
{{Text|<nowiki>'----------------ripgl.bas--------------------------------------------------------------------------------</nowiki>|#31C4C4}}
{{Text|<nowiki>'-----------------------QB64 COMPILER ONCE ONLY SETUP CODE ENDS HERE---------------------------------------</nowiki>|#31C4C4}}
{{Text|IF|#F0F0F0}} NoIDEMode {{Text|THEN|#F0F0F0}} IDE_AutoPosition = {{Text|0|#F580B1}}: {{Text|GOTO|#F0F0F0}} noide
{{Text|DIM|#F0F0F0}} FileDropEnabled {{Text|AS|#F0F0F0}} {{Text|_BYTE|#F0F0F0}}
{{Text|IF|#F0F0F0}} FileDropEnabled = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} FileDropEnabled = {{Text|-1|#F580B1}}: {{Text|_ACCEPTFILEDROP|#F0F0F0}}
{{Text|IF|#F0F0F0}} IDE_AutoPosition {{Text|AND|#F0F0F0}} {{Text|NOT|#F0F0F0}} IDE_BypassAutoPosition {{Text|THEN|#F0F0F0}} {{Text|_SCREENMOVE|#F0F0F0}} IDE_LeftPosition, IDE_TopPosition
idemode = {{Text|1|#F580B1}}
sendc$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Text|<nowiki>'no initial message</nowiki>|#31C4C4}}
{{Text|IF|#F0F0F0}} CMDLineFile <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}} sendc$ = {{Text|CHR$|#F0F0F0}}({{Text|1|#F580B1}}) + CMDLineFile
sendcommand:
idecommand$ = sendc$
C = ide({{Text|0|#F580B1}})
ideerror = {{Text|0|#F580B1}}
{{Text|IF|#F0F0F0}} C = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} idemode = {{Text|0|#F580B1}}: {{Text|GOTO|#F0F0F0}} noide
c$ = idereturn$
{{Text|IF|#F0F0F0}} C = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|<nowiki>'begin</nowiki>|#31C4C4}}
    ideerrorline = {{Text|0|#F580B1}} {{Text|<nowiki>'addresses invalid prepass error line numbers being reported</nowiki>|#31C4C4}}
    idepass = {{Text|1|#F580B1}}
    {{Text|GOTO|#F0F0F0}} fullrecompile
    ideret1:
    wholeline$ = c$
    {{Text|GOTO|#F0F0F0}} ideprepass
    ideret2:
    {{Text|IF|#F0F0F0}} lastLineReturn {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} lastLineReturn
    sendc$ = {{Text|CHR$|#F0F0F0}}({{Text|3|#F580B1}}) {{Text|<nowiki>'request next line</nowiki>|#31C4C4}}
    {{Text|GOTO|#F0F0F0}} sendcommand
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}} C = {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|<nowiki>'next line</nowiki>|#31C4C4}}
    {{Text|IF|#F0F0F0}} idepass = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        wholeline$ = c$
        {{Text|GOTO|#F0F0F0}} ideprepass
        {{Text|<nowiki>'(returns to ideret2: above)</nowiki>|#31C4C4}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|<nowiki>'assume idepass>1</nowiki>|#31C4C4}}
    a3$ = c$
    continuelinefrom = {{Text|0|#F580B1}}
    {{Text|GOTO|#F0F0F0}} ide4
    ideret4:
    {{Text|IF|#F0F0F0}} lastLineReturn {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} lastLineReturn
    sendc$ = {{Text|CHR$|#F0F0F0}}({{Text|3|#F580B1}}) {{Text|<nowiki>'request next line</nowiki>|#31C4C4}}
    {{Text|GOTO|#F0F0F0}} sendcommand
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}} C = {{Text|5|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|<nowiki>'end of program reached</nowiki>|#31C4C4}}
    lastLine = {{Text|1|#F580B1}}
    lastLineReturn = {{Text|1|#F580B1}}
    {{Text|IF|#F0F0F0}} idepass = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        wholeline$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Text|GOTO|#F0F0F0}} ideprepass
        {{Text|<nowiki>'(returns to ideret2: above, then to lastLinePrepassReturn below)</nowiki>|#31C4C4}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|<nowiki>'idepass>1</nowiki>|#31C4C4}}
    a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
    continuelinefrom = {{Text|0|#F580B1}}
    {{Text|GOTO|#F0F0F0}} ide4 {{Text|<nowiki>'returns to ideret4, then to lastLinePrepassReturn below</nowiki>|#31C4C4}}
    lastLineReturn:
    lastLineReturn = {{Text|0|#F580B1}}
    lastLine = {{Text|0|#F580B1}}
    {{Text|IF|#F0F0F0}} idepass = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|<nowiki>'prepass complete</nowiki>|#31C4C4}}
        idepass = {{Text|2|#F580B1}}
        {{Text|GOTO|#F0F0F0}} ide3
        ideret3:
        sendc$ = {{Text|CHR$|#F0F0F0}}({{Text|7|#F580B1}}) {{Text|<nowiki>'repass request</nowiki>|#31C4C4}}
        firstLine = {{Text|1|#F580B1}}
        {{Text|GOTO|#F0F0F0}} sendcommand
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|<nowiki>'assume idepass=2</nowiki>|#31C4C4}}
    {{Text|<nowiki>'finalize program</nowiki>|#31C4C4}}
    {{Text|GOTO|#F0F0F0}} ide5
    ideret5: {{Text|<nowiki>'note: won't return here if a recompile was required!</nowiki>|#31C4C4}}
    sendc$ = {{Text|CHR$|#F0F0F0}}({{Text|6|#F580B1}}) {{Text|<nowiki>'ready</nowiki>|#31C4C4}}
    idecompiled = {{Text|0|#F580B1}}
    {{Text|GOTO|#F0F0F0}} sendcommand
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}} C = {{Text|9|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|<nowiki>'run</nowiki>|#31C4C4}}
    {{Text|IF|#F0F0F0}} idecompiled = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|<nowiki>'exe needs to be compiled</nowiki>|#31C4C4}}
        file$ = c$
        {{Text|<nowiki>'locate accessible file and truncate</nowiki>|#31C4C4}}
        f$ = file$
        path.exe$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Text|IF|#F0F0F0}} SaveExeWithSource {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(ideprogname) {{Text|THEN|#F0F0F0}} path.exe$ = idepath$ + pathsep$
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        i = {{Text|1|#F580B1}}
        nextexeindex:
        {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(path.exe$ + file$ + extension$) {{Text|THEN|#F0F0F0}}
            E = {{Text|0|#F580B1}}
            {{Text|ON|#F0F0F0}} {{Text|ERROR|#F0F0F0}} {{Text|GOTO|#F0F0F0}} qberror_test
            {{Text|KILL|#F0F0F0}} path.exe$ + file$ + extension$
            {{Text|ON|#F0F0F0}} {{Text|ERROR|#F0F0F0}} {{Text|GOTO|#F0F0F0}} qberror
            {{Text|IF|#F0F0F0}} E = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                i = i + {{Text|1|#F580B1}}
                file$ = f$ + {{Text|<nowiki>"("</nowiki>|#FFB100}} + str2$(i) + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                {{Text|GOTO|#F0F0F0}} nextexeindex
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|<nowiki>'inform IDE of name change if necessary (IDE will respond with message 9 and corrected name)</nowiki>|#31C4C4}}
        {{Text|IF|#F0F0F0}} i <> {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
            sendc$ = {{Text|CHR$|#F0F0F0}}({{Text|12|#F580B1}}) + file$
            {{Text|GOTO|#F0F0F0}} sendcommand
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        ideerrorline = {{Text|0|#F580B1}} {{Text|<nowiki>'addresses C++ comp. error's line number</nowiki>|#31C4C4}}
        {{Text|GOTO|#F0F0F0}} ide6
        ideret6:
        idecompiled = {{Text|1|#F580B1}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} iderunmode = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
        sendc$ = {{Text|CHR$|#F0F0F0}}({{Text|11|#F580B1}}) {{Text|<nowiki>'.EXE file created</nowiki>|#31C4C4}}
        {{Text|GOTO|#F0F0F0}} sendcommand
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|<nowiki>'execute program</nowiki>|#31C4C4}}
    {{Text|IF|#F0F0F0}} iderunmode = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} NoExeSaved {{Text|THEN|#F0F0F0}}
            {{Text|<nowiki>'This is the section which deals with if the user selected to run the program without</nowiki>|#31C4C4}}
            {{Text|<nowiki>'saving an EXE file to the disk.</nowiki>|#31C4C4}}
            {{Text|<nowiki>'We start off by first running the EXE, and then we delete it from the drive.</nowiki>|#31C4C4}}
            {{Text|<nowiki>'making it a temporary file when all is said and done.</nowiki>|#31C4C4}}
            {{Text|IF|#F0F0F0}} os$ = {{Text|<nowiki>"WIN"</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}}
                {{Text|SHELL|#F0F0F0}} QuotedFilename$({{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + lastBinaryGenerated$ + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}})) + ModifyCOMMAND$ {{Text|<nowiki>'run the newly created program</nowiki>|#31C4C4}}
                {{Text|SHELL|#F0F0F0}} {{Text|_HIDE|#F0F0F0}} {{Text|_DONTWAIT|#F0F0F0}} {{Text|<nowiki>"del "</nowiki>|#FFB100}} + QuotedFilename$({{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + lastBinaryGenerated$ + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}})) {{Text|<nowiki>'kill it</nowiki>|#31C4C4}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} path.exe$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}} path.exe$ = {{Text|<nowiki>"./"</nowiki>|#FFB100}}
            {{Text|IF|#F0F0F0}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(lastBinaryGenerated$, {{Text|LEN|#F0F0F0}}(path.exe$)) = path.exe$ {{Text|THEN|#F0F0F0}}
                    {{Text|SHELL|#F0F0F0}} QuotedFilename$(lastBinaryGenerated$) + ModifyCOMMAND$
                    {{Text|KILL|#F0F0F0}} lastBinaryGenerated$
                {{Text|ELSE|#F0F0F0}}
                    {{Text|SHELL|#F0F0F0}} QuotedFilename$(path.exe$ + lastBinaryGenerated$) + ModifyCOMMAND$
                    {{Text|KILL|#F0F0F0}} path.exe$ + lastBinaryGenerated$
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} path.exe$ = {{Text|<nowiki>"./"</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}} path.exe$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            NoExeSaved = {{Text|0|#F580B1}} {{Text|<nowiki>'reset the flag for a temp EXE</nowiki>|#31C4C4}}
            sendc$ = {{Text|CHR$|#F0F0F0}}({{Text|6|#F580B1}}) {{Text|<nowiki>'ready</nowiki>|#31C4C4}}
            {{Text|GOTO|#F0F0F0}} sendcommand
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} os$ = {{Text|<nowiki>"WIN"</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|SHELL|#F0F0F0}} {{Text|_DONTWAIT|#F0F0F0}} QuotedFilename$({{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + lastBinaryGenerated$ + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}})) + ModifyCOMMAND$
        {{Text|IF|#F0F0F0}} path.exe$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}} path.exe$ = {{Text|<nowiki>"./"</nowiki>|#FFB100}}
        {{Text|IF|#F0F0F0}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(lastBinaryGenerated$, {{Text|LEN|#F0F0F0}}(path.exe$)) = path.exe$ {{Text|THEN|#F0F0F0}}
                {{Text|SHELL|#F0F0F0}} {{Text|_DONTWAIT|#F0F0F0}} QuotedFilename$(lastBinaryGenerated$) + ModifyCOMMAND$
            {{Text|ELSE|#F0F0F0}}
                {{Text|SHELL|#F0F0F0}} {{Text|_DONTWAIT|#F0F0F0}} QuotedFilename$(path.exe$ + lastBinaryGenerated$) + ModifyCOMMAND$
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} path.exe$ = {{Text|<nowiki>"./"</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}} path.exe$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
    {{Text|ELSE|#F0F0F0}}
        {{Text|IF|#F0F0F0}} os$ = {{Text|<nowiki>"WIN"</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|SHELL|#F0F0F0}} QuotedFilename$({{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + lastBinaryGenerated$ + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}})) + ModifyCOMMAND$
        {{Text|IF|#F0F0F0}} path.exe$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}} path.exe$ = {{Text|<nowiki>"./"</nowiki>|#FFB100}}
        {{Text|IF|#F0F0F0}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(lastBinaryGenerated$, {{Text|LEN|#F0F0F0}}(path.exe$)) = path.exe$ {{Text|THEN|#F0F0F0}}
                {{Text|SHELL|#F0F0F0}} QuotedFilename$(lastBinaryGenerated$) + ModifyCOMMAND$
            {{Text|ELSE|#F0F0F0}}
                {{Text|SHELL|#F0F0F0}} QuotedFilename$(path.exe$ + lastBinaryGenerated$) + ModifyCOMMAND$
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} path.exe$ = {{Text|<nowiki>"./"</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}} path.exe$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Text|DO|#F0F0F0}}: {{Text|LOOP|#F0F0F0}} {{Text|UNTIL|#F0F0F0}} {{Text|INKEY$|#F0F0F0}} = {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Text|DO|#F0F0F0}}: {{Text|LOOP|#F0F0F0}} {{Text|UNTIL|#F0F0F0}} {{Text|_KEYHIT|#F0F0F0}} = {{Text|0|#F580B1}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} idemode {{Text|THEN|#F0F0F0}}
        {{Text|<nowiki>'Darken fg/bg colors</nowiki>|#31C4C4}}
        dummy = DarkenFGBG({{Text|0|#F580B1}})
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} vWatchOn {{Text|THEN|#F0F0F0}}
        sendc$ = {{Text|CHR$|#F0F0F0}}({{Text|254|#F580B1}}) {{Text|<nowiki>'launch debug interface</nowiki>|#31C4C4}}
    {{Text|ELSE|#F0F0F0}}
        sendc$ = {{Text|CHR$|#F0F0F0}}({{Text|6|#F580B1}}) {{Text|<nowiki>'ready</nowiki>|#31C4C4}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|GOTO|#F0F0F0}} sendcommand
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|PRINT|#F0F0F0}} {{Text|<nowiki>"Invalid IDE message"</nowiki>|#FFB100}}: {{Text|END|#F0F0F0}}
ideerror:
{{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(idemessage$, sp$) {{Text|THEN|#F0F0F0}}
    {{Text|<nowiki>'Something went wrong here, so let's give a generic error message to the user.</nowiki>|#31C4C4}}
    {{Text|<nowiki>'(No error message should contain sp$ - that is, CHR$(13), when not in Debug mode)</nowiki>|#31C4C4}}
    terrmsg$ = {{Text|_ERRORMESSAGE$|#F0F0F0}}
    {{Text|IF|#F0F0F0}} terrmsg$ = {{Text|<nowiki>"No error"</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}} terrmsg$ = {{Text|<nowiki>"Internal error"</nowiki>|#FFB100}}
    idemessage$ = {{Text|<nowiki>"Compiler error (check for syntax errors) ("</nowiki>|#FFB100}} + terrmsg$ + {{Text|<nowiki>":"</nowiki>|#FFB100}}
    {{Text|IF|#F0F0F0}} {{Text|ERR|#F0F0F0}} {{Text|THEN|#F0F0F0}} idemessage$ = idemessage$ + str2$({{Text|ERR|#F0F0F0}}) + {{Text|<nowiki>"-"</nowiki>|#FFB100}}
    {{Text|IF|#F0F0F0}} {{Text|_ERRORLINE|#F0F0F0}} {{Text|THEN|#F0F0F0}} idemessage$ = idemessage$ + str2$({{Text|_ERRORLINE|#F0F0F0}})
    {{Text|IF|#F0F0F0}} {{Text|_INCLERRORLINE|#F0F0F0}} {{Text|THEN|#F0F0F0}} idemessage$ = idemessage$ + {{Text|<nowiki>"-"</nowiki>|#FFB100}} + {{Text|_INCLERRORFILE$|#F0F0F0}} + {{Text|<nowiki>"-"</nowiki>|#FFB100}} + str2$({{Text|_INCLERRORLINE|#F0F0F0}})
    idemessage$ = idemessage$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
    {{Text|IF|#F0F0F0}} inclevel > {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} idemessage$ = idemessage$ + incerror$
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
sendc$ = {{Text|CHR$|#F0F0F0}}({{Text|8|#F580B1}}) + idemessage$ + {{Text|MKL$|#F0F0F0}}(ideerrorline)
{{Text|GOTO|#F0F0F0}} sendcommand
noide:
{{Text|IF|#F0F0F0}} (qb64versionprinted = {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} ConsoleMode = {{Text|0|#F580B1}}) {{Text|AND|#F0F0F0}} {{Text|NOT|#F0F0F0}} QuietMode {{Text|THEN|#F0F0F0}}
    qb64versionprinted = {{Text|-1|#F580B1}}
    {{Text|PRINT|#F0F0F0}} {{Text|<nowiki>"QB64-PE Compiler V"</nowiki>|#FFB100}} + Version$
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}} CMDLineFile = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}}
    {{Text|LINE|#F0F0F0}} {{Text|INPUT|#F0F0F0}} ; {{Text|<nowiki>"COMPILE (.bas)>"</nowiki>|#FFB100}}, f$
{{Text|ELSE|#F0F0F0}}
    f$ = CMDLineFile
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
f$ = {{Text|LTRIM$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(f$))
{{Text|IF|#F0F0F0}} FileHasExtension(f$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} f$ = f$ + {{Text|<nowiki>".bas"</nowiki>|#FFB100}}
sourcefile$ = f$
CMDLineFile = sourcefile$
{{Text|<nowiki>'derive name from sourcefile</nowiki>|#31C4C4}}
f$ = RemoveFileExtension$(f$)
path.exe$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
currentdir$ = {{Text|_CWD$|#F0F0F0}}
path.source$ = getfilepath$(sourcefile$)
{{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(path.source$) {{Text|THEN|#F0F0F0}}
    {{Text|IF|#F0F0F0}} {{Text|_DIREXISTS|#F0F0F0}}(path.source$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|PRINT|#F0F0F0}}
        {{Text|PRINT|#F0F0F0}} {{Text|<nowiki>"Cannot locate source file: "</nowiki>|#FFB100}} + sourcefile$
        {{Text|IF|#F0F0F0}} ConsoleMode {{Text|THEN|#F0F0F0}} {{Text|SYSTEM|#F0F0F0}} {{Text|1|#F580B1}}
        {{Text|END|#F0F0F0}} {{Text|1|#F580B1}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|CHDIR|#F0F0F0}} path.source$
    path.source$ = {{Text|_CWD$|#F0F0F0}}
    {{Text|IF|#F0F0F0}} {{Text|RIGHT$|#F0F0F0}}(path.source$, {{Text|1|#F580B1}}) <> pathsep$ {{Text|THEN|#F0F0F0}} path.source$ = path.source$ + pathsep$
    {{Text|CHDIR|#F0F0F0}} currentdir$
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}} SaveExeWithSource {{Text|THEN|#F0F0F0}} path.exe$ = path.source$
{{Text|FOR|#F0F0F0}} x = {{Text|LEN|#F0F0F0}}(f$) {{Text|TO|#F0F0F0}} {{Text|1|#F580B1}} {{Text|STEP|#F0F0F0}} {{Text|-1|#F580B1}}
    a$ = {{Text|MID$|#F0F0F0}}(f$, x, {{Text|1|#F580B1}})
    {{Text|IF|#F0F0F0}} a$ = {{Text|<nowiki>"/"</nowiki>|#FFB100}} {{Text|OR|#F0F0F0}} a$ = {{Text|<nowiki>"\"</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}}
        f$ = {{Text|RIGHT$|#F0F0F0}}(f$, {{Text|LEN|#F0F0F0}}(f$) - x)
        {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|NEXT|#F0F0F0}}
file$ = f$
{{Text|<nowiki>'if cmemlist(currentid+1)<>0 before calling regid the variable</nowiki>|#31C4C4}}
{{Text|<nowiki>'MUST be defined in cmem!</nowiki>|#31C4C4}}
fullrecompile:
{{Text|IF|#F0F0F0}} idemode = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|NOT|#F0F0F0}} QuietMode {{Text|THEN|#F0F0F0}}
    {{Text|PRINT|#F0F0F0}}
    {{Text|PRINT|#F0F0F0}} {{Text|<nowiki>"Beginning C++ output from QB64 code... "</nowiki>|#FFB100}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
BU_DEPENDENCY_CONSOLE_ONLY = DEPENDENCY(DEPENDENCY_CONSOLE_ONLY)
{{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|UBOUND|#F0F0F0}}(DEPENDENCY): DEPENDENCY(i) = {{Text|0|#F580B1}}: {{Text|NEXT|#F0F0F0}}
DEPENDENCY(DEPENDENCY_CONSOLE_ONLY) = BU_DEPENDENCY_CONSOLE_ONLY {{Text|AND|#F0F0F0}} {{Text|2|#F580B1}} {{Text|<nowiki>'Restore -g switch if used</nowiki>|#31C4C4}}
Error_Happened = {{Text|0|#F580B1}}
{{Text|FOR|#F0F0F0}} closeall = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|255|#F580B1}}: {{Text|CLOSE|#F0F0F0}} closeall: {{Text|NEXT|#F0F0F0}}
{{Text|OPEN|#F0F0F0}} tmpdir$ + {{Text|<nowiki>"temp.bin"</nowiki>|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|OUTPUT|#F0F0F0}} {{Text|LOCK|#F0F0F0}} {{Text|WRITE|#F0F0F0}} {{Text|AS|#F0F0F0}} #26 {{Text|<nowiki>'relock</nowiki>|#31C4C4}}
bh = OpenBuffer%({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"dyninfo.txt"</nowiki>|#FFB100}})
{{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|CLOSE|#F0F0F0}} #9: {{Text|OPEN|#F0F0F0}} tmpdir$ + {{Text|<nowiki>"debug.txt"</nowiki>|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|OUTPUT|#F0F0F0}} {{Text|AS|#F0F0F0}} #9
{{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} ids_max + {{Text|1|#F580B1}}
    arrayelementslist(i) = {{Text|0|#F580B1}}
    cmemlist(i) = {{Text|0|#F580B1}}
    sfcmemargs(i) = {{Text|<nowiki>""</nowiki>|#FFB100}}
{{Text|NEXT|#F0F0F0}}
{{Text|<nowiki>'erase cmemlist</nowiki>|#31C4C4}}
{{Text|<nowiki>'erase sfcmemargs</nowiki>|#31C4C4}}
lastunresolved = {{Text|-1|#F580B1}} {{Text|<nowiki>'first pass</nowiki>|#31C4C4}}
sflistn = {{Text|-1|#F580B1}} {{Text|<nowiki>'no entries</nowiki>|#31C4C4}}
SubNameLabels = sp {{Text|<nowiki>'QB64 will perform a repass to resolve sub names used as labels</nowiki>|#31C4C4}}
vWatchDesiredState = {{Text|0|#F580B1}}
vWatchRecompileAttempts = {{Text|0|#F580B1}}
qb64prefix_set_desiredState = {{Text|0|#F580B1}}
qb64prefix_set_recompileAttempts = {{Text|0|#F580B1}}
opex_desiredState = {{Text|0|#F580B1}}
opex_recompileAttempts = {{Text|0|#F580B1}}
opexarray_desiredState = {{Text|0|#F580B1}}
opexarray_recompileAttempts = {{Text|0|#F580B1}}
recompile:
vWatchOn = vWatchDesiredState
vWatchVariable {{Text|<nowiki>""</nowiki>|#FFB100}}, {{Text|-1|#F580B1}} {{Text|<nowiki>'reset internal variables list</nowiki>|#31C4C4}}
qb64prefix_set = qb64prefix_set_desiredState
qb64prefix$ = {{Text|<nowiki>"_"</nowiki>|#FFB100}}
optionexplicit = opex_desiredState
{{Text|IF|#F0F0F0}} optionexplicit_cmd = {{Text|-1|#F580B1}} {{Text|AND|#F0F0F0}} NoIDEMode = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} optionexplicit = {{Text|-1|#F580B1}}
optionexplicitarray = opexarray_desiredState
lastLineReturn = {{Text|0|#F580B1}}
lastLine = {{Text|0|#F580B1}}
firstLine = {{Text|1|#F580B1}}
Resize = {{Text|0|#F580B1}}
Resize_Scale = {{Text|0|#F580B1}}
UseGL = {{Text|0|#F580B1}}
Error_Happened = {{Text|0|#F580B1}}
HashClear {{Text|<nowiki>'clear the hash table</nowiki>|#31C4C4}}
{{Text|<nowiki>'add reserved words to hashtable</nowiki>|#31C4C4}}
f = HASHFLAG_TYPE + HASHFLAG_RESERVED
HashAdd {{Text|<nowiki>"_UNSIGNED"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"_BIT"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"_BYTE"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"INTEGER"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"LONG"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"_INTEGER64"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"_OFFSET"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"SINGLE"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"DOUBLE"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"_FLOAT"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"STRING"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"ANY"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
f = HASHFLAG_OPERATOR + HASHFLAG_RESERVED
HashAdd {{Text|<nowiki>"NOT"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"IMP"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"EQV"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"AND"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"OR"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"XOR"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"MOD"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
f = HASHFLAG_RESERVED + HASHFLAG_CUSTOMSYNTAX
HashAdd {{Text|<nowiki>"LIST"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"BASE"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"_EXPLICIT"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"AS"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"IS"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"OFF"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"ON"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"STOP"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"TO"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"USING"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|<nowiki>'PUT(graphics) statement:</nowiki>|#31C4C4}}
HashAdd {{Text|<nowiki>"PRESET"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"PSET"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|<nowiki>'OPEN statement:</nowiki>|#31C4C4}}
HashAdd {{Text|<nowiki>"FOR"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"OUTPUT"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"RANDOM"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"BINARY"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"APPEND"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"SHARED"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"ACCESS"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"LOCK"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"READ"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"WRITE"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|<nowiki>'LINE statement:</nowiki>|#31C4C4}}
HashAdd {{Text|<nowiki>"STEP"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|<nowiki>'WIDTH statement:</nowiki>|#31C4C4}}
HashAdd {{Text|<nowiki>"LPRINT"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|<nowiki>'VIEW statement:</nowiki>|#31C4C4}}
HashAdd {{Text|<nowiki>"PRINT"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
f = HASHFLAG_RESERVED + HASHFLAG_XELEMENTNAME + HASHFLAG_XTYPENAME
{{Text|<nowiki>'A</nowiki>|#31C4C4}}
{{Text|<nowiki>'B</nowiki>|#31C4C4}}
{{Text|<nowiki>'C</nowiki>|#31C4C4}}
HashAdd {{Text|<nowiki>"COMMON"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"CALL"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"CASE"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"COM"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}} {{Text|<nowiki>'(ON...)</nowiki>|#31C4C4}}
HashAdd {{Text|<nowiki>"CONST"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|<nowiki>'D</nowiki>|#31C4C4}}
HashAdd {{Text|<nowiki>"DATA"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"DECLARE"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"DEF"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"DEFDBL"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"DEFINT"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"DEFLNG"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"DEFSNG"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"DEFSTR"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"DIM"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"DO"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME, {{Text|0|#F580B1}}
{{Text|<nowiki>'E</nowiki>|#31C4C4}}
HashAdd {{Text|<nowiki>"ERROR"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME, {{Text|0|#F580B1}} {{Text|<nowiki>'(ON ...)</nowiki>|#31C4C4}}
HashAdd {{Text|<nowiki>"ELSE"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"ELSEIF"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"ENDIF"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"EXIT"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME, {{Text|0|#F580B1}}
{{Text|<nowiki>'F</nowiki>|#31C4C4}}
HashAdd {{Text|<nowiki>"FIELD"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"FUNCTION"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|<nowiki>'G</nowiki>|#31C4C4}}
HashAdd {{Text|<nowiki>"GOSUB"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"GOTO"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|<nowiki>'H</nowiki>|#31C4C4}}
{{Text|<nowiki>'I</nowiki>|#31C4C4}}
HashAdd {{Text|<nowiki>"INPUT"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME - HASHFLAG_XTYPENAME, {{Text|0|#F580B1}} {{Text|<nowiki>'(INPUT$ function exists, so conflicts if allowed as custom syntax)</nowiki>|#31C4C4}}
HashAdd {{Text|<nowiki>"IF"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|<nowiki>'K</nowiki>|#31C4C4}}
HashAdd {{Text|<nowiki>"KEY"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME - HASHFLAG_XTYPENAME, {{Text|0|#F580B1}} {{Text|<nowiki>'(ON...)</nowiki>|#31C4C4}}
{{Text|<nowiki>'L</nowiki>|#31C4C4}}
HashAdd {{Text|<nowiki>"LET"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"LOOP"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"LEN"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME, {{Text|0|#F580B1}} {{Text|<nowiki>'(LEN function exists, so conflicts if allowed as custom syntax)</nowiki>|#31C4C4}}
{{Text|<nowiki>'M</nowiki>|#31C4C4}}
{{Text|<nowiki>'N</nowiki>|#31C4C4}}
HashAdd {{Text|<nowiki>"NEXT"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME, {{Text|0|#F580B1}}
{{Text|<nowiki>'O</nowiki>|#31C4C4}}
{{Text|<nowiki>'P</nowiki>|#31C4C4}}
HashAdd {{Text|<nowiki>"PLAY"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME - HASHFLAG_XTYPENAME, {{Text|0|#F580B1}} {{Text|<nowiki>'(ON...)</nowiki>|#31C4C4}}
HashAdd {{Text|<nowiki>"PEN"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME - HASHFLAG_XTYPENAME, {{Text|0|#F580B1}} {{Text|<nowiki>'(ON...)</nowiki>|#31C4C4}}
{{Text|<nowiki>'Q</nowiki>|#31C4C4}}
{{Text|<nowiki>'R</nowiki>|#31C4C4}}
HashAdd {{Text|<nowiki>"REDIM"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"REM"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"RESTORE"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"RESUME"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"RETURN"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"RUN"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME, {{Text|0|#F580B1}}
{{Text|<nowiki>'S</nowiki>|#31C4C4}}
HashAdd {{Text|<nowiki>"STATIC"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"STRIG"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}} {{Text|<nowiki>'(ON...)</nowiki>|#31C4C4}}
HashAdd {{Text|<nowiki>"SEG"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"SELECT"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME - HASHFLAG_XTYPENAME, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"SUB"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"SCREEN"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME - HASHFLAG_XTYPENAME, {{Text|0|#F580B1}}
{{Text|<nowiki>'T</nowiki>|#31C4C4}}
HashAdd {{Text|<nowiki>"THEN"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"TIMER"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME - HASHFLAG_XTYPENAME, {{Text|0|#F580B1}} {{Text|<nowiki>'(ON...)</nowiki>|#31C4C4}}
HashAdd {{Text|<nowiki>"TYPE"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME, {{Text|0|#F580B1}}
{{Text|<nowiki>'U</nowiki>|#31C4C4}}
HashAdd {{Text|<nowiki>"UNTIL"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"UEVENT"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|<nowiki>'V</nowiki>|#31C4C4}}
{{Text|<nowiki>'W</nowiki>|#31C4C4}}
HashAdd {{Text|<nowiki>"WEND"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
HashAdd {{Text|<nowiki>"WHILE"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|<nowiki>'X</nowiki>|#31C4C4}}
{{Text|<nowiki>'Y</nowiki>|#31C4C4}}
{{Text|<nowiki>'Z</nowiki>|#31C4C4}}
{{Text|<nowiki>'clear/init variables</nowiki>|#31C4C4}}
Console = {{Text|0|#F580B1}}
ScreenHide = {{Text|0|#F580B1}}
Asserts = {{Text|0|#F580B1}}
ResolveStaticFunctions = {{Text|0|#F580B1}}
dynamiclibrary = {{Text|0|#F580B1}}
dimsfarray = {{Text|0|#F580B1}}
dimstatic = {{Text|0|#F580B1}}
AllowLocalName = {{Text|0|#F580B1}}
PossibleSubNameLabels = sp {{Text|<nowiki>'QB64 will perform a repass to resolve sub names used as labels</nowiki>|#31C4C4}}
use_global_byte_elements = {{Text|0|#F580B1}}
dimshared = {{Text|0|#F580B1}}: dimmethod = {{Text|0|#F580B1}}: dimoption = {{Text|0|#F580B1}}: redimoption = {{Text|0|#F580B1}}: commonoption = {{Text|0|#F580B1}}
mylib$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: mylibopt$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
declaringlibrary = {{Text|0|#F580B1}}
nLabels = {{Text|0|#F580B1}}
dynscope = {{Text|0|#F580B1}}
elsefollowup = {{Text|0|#F580B1}}
ontimerid = {{Text|0|#F580B1}}: onkeyid = {{Text|0|#F580B1}}: onstrigid = {{Text|0|#F580B1}}
commonarraylist = {{Text|<nowiki>""</nowiki>|#FFB100}}: commonarraylistn = {{Text|0|#F580B1}}
staticarraylist = {{Text|<nowiki>""</nowiki>|#FFB100}}: staticarraylistn = {{Text|0|#F580B1}}
fooindwel = {{Text|0|#F580B1}}
layout = {{Text|<nowiki>""</nowiki>|#FFB100}}
layoutok = {{Text|0|#F580B1}}
NoChecks = {{Text|0|#F580B1}}
inclevel = {{Text|0|#F580B1}}
errorLineInInclude = {{Text|0|#F580B1}}
addmetainclude$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
nextrunlineindex = {{Text|1|#F580B1}}
lasttype = {{Text|0|#F580B1}}
lasttypeelement = {{Text|0|#F580B1}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} udtxname({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} * {{Text|256|#F580B1}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} udtxcname({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} * {{Text|256|#F580B1}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} udtxsize({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} udtxbytealign({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}} {{Text|<nowiki>'first element MUST be on a byte alignment & size is a multiple of 8</nowiki>|#31C4C4}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} udtxnext({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} udtxvariable({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}} {{Text|<nowiki>'true if the udt contains variable length elements</nowiki>|#31C4C4}}
{{Text|<nowiki>'elements</nowiki>|#31C4C4}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} udtename({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} * {{Text|256|#F580B1}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} udtecname({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}} * {{Text|256|#F580B1}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} udtebytealign({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} udtesize({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} udtetype({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} udtetypesize({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} udtearrayelements({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} udtenext({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
definingtype = {{Text|0|#F580B1}}
definingtypeerror = {{Text|0|#F580B1}}
constlast = {{Text|-1|#F580B1}}
{{Text|<nowiki>'constlastshared = -1</nowiki>|#31C4C4}}
closedmain = {{Text|0|#F580B1}}
addmetastatic = {{Text|0|#F580B1}}
addmetadynamic = {{Text|0|#F580B1}}
DynamicMode = {{Text|0|#F580B1}}
optionbase = {{Text|0|#F580B1}}
ExeIconSet = {{Text|0|#F580B1}}
VersionInfoSet = {{Text|0|#F580B1}}
viFileVersionNum$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: viProductVersionNum$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: viCompanyName$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
viFileDescription$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: viFileVersion$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: viInternalName$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
viLegalCopyright$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: viLegalTrademarks$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: viOriginalFilename$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
viProductName$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: viProductVersion$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: viComments$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: viWeb$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
DataOffset = {{Text|0|#F580B1}}
statementn = {{Text|0|#F580B1}}
everycasenewcase = {{Text|0|#F580B1}}
qberrorhappened = {{Text|0|#F580B1}}: qberrorcode = {{Text|0|#F580B1}}: qberrorline = {{Text|0|#F580B1}}
{{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|27|#F580B1}}: defineaz(i) = {{Text|<nowiki>"SINGLE"</nowiki>|#FFB100}}: defineextaz(i) = {{Text|<nowiki>"!"</nowiki>|#FFB100}}: {{Text|NEXT|#F0F0F0}}
controllevel = {{Text|0|#F580B1}}
findidsecondarg$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: findanotherid = {{Text|0|#F580B1}}: findidinternal = {{Text|0|#F580B1}}: currentid = {{Text|0|#F580B1}}
linenumber = {{Text|0|#F580B1}}
wholeline$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
linefragment$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
idn = {{Text|0|#F580B1}}
arrayprocessinghappened = {{Text|0|#F580B1}}
stringprocessinghappened = {{Text|0|#F580B1}}
inputfunctioncalled = {{Text|0|#F580B1}}
subfuncn = {{Text|0|#F580B1}}
closedsubfunc = {{Text|0|#F580B1}}
subfunc = {{Text|<nowiki>""</nowiki>|#FFB100}}
SelectCaseCounter = {{Text|0|#F580B1}}
ExecCounter = {{Text|0|#F580B1}}
UserDefineCount = {{Text|7|#F580B1}}
totalVariablesCreated = {{Text|0|#F580B1}}
typeDefinitions$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
totalMainVariablesCreated = {{Text|0|#F580B1}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} usedVariableList({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} usedVarList
totalWarnings = {{Text|0|#F580B1}}
duplicateConstWarning = {{Text|0|#F580B1}}
emptySCWarning = {{Text|0|#F580B1}}
warningListItems = {{Text|0|#F580B1}}
lastWarningHeader = {{Text|<nowiki>""</nowiki>|#FFB100}}
vWatchUsedLabels = {{Text|SPACE$|#F0F0F0}}({{Text|1000|#F580B1}})
vWatchUsedSkipLabels = {{Text|SPACE$|#F0F0F0}}({{Text|1000|#F580B1}})
firstLineNumberLabelvWatch = {{Text|0|#F580B1}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} warning$({{Text|1000|#F580B1}})
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} warningLines({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} warningIncLines({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
{{Text|REDIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} warningIncFiles({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
maxLineNumber = {{Text|0|#F580B1}}
uniquenumbern = {{Text|0|#F580B1}}
{{Text|<nowiki>''create a type for storing memory blocks</nowiki>|#31C4C4}}
{{Text|<nowiki>''UDT</nowiki>|#31C4C4}}
{{Text|<nowiki>''names</nowiki>|#31C4C4}}
{{Text|<nowiki>'DIM SHARED lasttype AS LONG</nowiki>|#31C4C4}}
{{Text|<nowiki>'DIM SHARED udtxname(1000) AS STRING * 256</nowiki>|#31C4C4}}
{{Text|<nowiki>'DIM SHARED udtxcname(1000) AS STRING * 256</nowiki>|#31C4C4}}
{{Text|<nowiki>'DIM SHARED udtxsize(1000) AS LONG</nowiki>|#31C4C4}}
{{Text|<nowiki>'DIM SHARED udtxbytealign(1000) AS INTEGER 'first element MUST be on a byte alignment & size is a multiple of 8</nowiki>|#31C4C4}}
{{Text|<nowiki>'DIM SHARED udtxnext(1000) AS LONG</nowiki>|#31C4C4}}
{{Text|<nowiki>''elements</nowiki>|#31C4C4}}
{{Text|<nowiki>'DIM SHARED lasttypeelement AS LONG</nowiki>|#31C4C4}}
{{Text|<nowiki>'DIM SHARED udtename(1000) AS STRING * 256</nowiki>|#31C4C4}}
{{Text|<nowiki>'DIM SHARED udtecname(1000) AS STRING * 256</nowiki>|#31C4C4}}
{{Text|<nowiki>'DIM SHARED udtebytealign(1000) AS INTEGER</nowiki>|#31C4C4}}
{{Text|<nowiki>'DIM SHARED udtesize(1000) AS LONG</nowiki>|#31C4C4}}
{{Text|<nowiki>'DIM SHARED udtetype(1000) AS LONG</nowiki>|#31C4C4}}
{{Text|<nowiki>'DIM SHARED udtetypesize(1000) AS LONG</nowiki>|#31C4C4}}
{{Text|<nowiki>'DIM SHARED udtearrayelements(1000) AS LONG</nowiki>|#31C4C4}}
{{Text|<nowiki>'DIM SHARED udtenext(1000) AS LONG</nowiki>|#31C4C4}}
{{Text|<nowiki>'import _MEM type</nowiki>|#31C4C4}}
ptrsz = OS_BITS \ {{Text|8|#F580B1}}
lasttype = lasttype + {{Text|1|#F580B1}}: i = lasttype
udtxname(i) = {{Text|<nowiki>"_MEM"</nowiki>|#FFB100}}
udtxcname(i) = {{Text|<nowiki>"_MEM"</nowiki>|#FFB100}}
udtxsize(i) = ((ptrsz) * {{Text|5|#F580B1}} + ({{Text|4|#F580B1}}) * {{Text|2|#F580B1}} + ({{Text|8|#F580B1}}) * {{Text|1|#F580B1}}) * {{Text|8|#F580B1}}
udtxbytealign(i) = {{Text|1|#F580B1}}
lasttypeelement = lasttypeelement + {{Text|1|#F580B1}}: i2 = lasttypeelement
udtename(i2) = {{Text|<nowiki>"OFFSET"</nowiki>|#FFB100}}
udtecname(i2) = {{Text|<nowiki>"OFFSET"</nowiki>|#FFB100}}
udtebytealign(i2) = {{Text|1|#F580B1}}
udtetype(i2) = OFFSETTYPE: udtesize(i2) = ptrsz * {{Text|8|#F580B1}}
udtetypesize(i2) = {{Text|0|#F580B1}} {{Text|<nowiki>'tsize</nowiki>|#31C4C4}}
udtxnext(i) = i2
i3 = i2
lasttypeelement = lasttypeelement + {{Text|1|#F580B1}}: i2 = lasttypeelement
udtename(i2) = {{Text|<nowiki>"SIZE"</nowiki>|#FFB100}}
udtecname(i2) = {{Text|<nowiki>"SIZE"</nowiki>|#FFB100}}
udtebytealign(i2) = {{Text|1|#F580B1}}
udtetype(i2) = OFFSETTYPE: udtesize(i2) = ptrsz * {{Text|8|#F580B1}}
udtetypesize(i2) = {{Text|0|#F580B1}} {{Text|<nowiki>'tsize</nowiki>|#31C4C4}}
udtenext(i3) = i2
i3 = i2
lasttypeelement = lasttypeelement + {{Text|1|#F580B1}}: i2 = lasttypeelement
udtename(i2) = {{Text|<nowiki>"$_LOCK_ID"</nowiki>|#FFB100}}
udtecname(i2) = {{Text|<nowiki>"$_LOCK_ID"</nowiki>|#FFB100}}
udtebytealign(i2) = {{Text|1|#F580B1}}
udtetype(i2) = INTEGER64TYPE: udtesize(i2) = {{Text|64|#F580B1}}
udtetypesize(i2) = {{Text|0|#F580B1}} {{Text|<nowiki>'tsize</nowiki>|#31C4C4}}
udtenext(i3) = i2
i3 = i2
lasttypeelement = lasttypeelement + {{Text|1|#F580B1}}: i2 = lasttypeelement
udtename(i2) = {{Text|<nowiki>"$_LOCK_OFFSET"</nowiki>|#FFB100}}
udtecname(i2) = {{Text|<nowiki>"$_LOCK_OFFSET"</nowiki>|#FFB100}}
udtebytealign(i2) = {{Text|1|#F580B1}}
udtetype(i2) = OFFSETTYPE: udtesize(i2) = ptrsz * {{Text|8|#F580B1}}
udtetypesize(i2) = {{Text|0|#F580B1}} {{Text|<nowiki>'tsize</nowiki>|#31C4C4}}
udtenext(i3) = i2
i3 = i2
lasttypeelement = lasttypeelement + {{Text|1|#F580B1}}: i2 = lasttypeelement
udtename(i2) = {{Text|<nowiki>"TYPE"</nowiki>|#FFB100}}
udtecname(i2) = {{Text|<nowiki>"TYPE"</nowiki>|#FFB100}}
udtebytealign(i2) = {{Text|1|#F580B1}}
udtetype(i2) = OFFSETTYPE: udtesize(i2) = ptrsz * {{Text|8|#F580B1}}
udtetypesize(i2) = {{Text|0|#F580B1}} {{Text|<nowiki>'tsize</nowiki>|#31C4C4}}
udtenext(i3) = i2
i3 = i2
lasttypeelement = lasttypeelement + {{Text|1|#F580B1}}: i2 = lasttypeelement
udtename(i2) = {{Text|<nowiki>"ELEMENTSIZE"</nowiki>|#FFB100}}
udtecname(i2) = {{Text|<nowiki>"ELEMENTSIZE"</nowiki>|#FFB100}}
udtebytealign(i2) = {{Text|1|#F580B1}}
udtetype(i2) = OFFSETTYPE: udtesize(i2) = ptrsz * {{Text|8|#F580B1}}
udtetypesize(i2) = {{Text|0|#F580B1}} {{Text|<nowiki>'tsize</nowiki>|#31C4C4}}
udtenext(i3) = i2
udtenext(i2) = {{Text|0|#F580B1}}
i3 = i2
lasttypeelement = lasttypeelement + {{Text|1|#F580B1}}: i2 = lasttypeelement
udtename(i2) = {{Text|<nowiki>"IMAGE"</nowiki>|#FFB100}}
udtecname(i2) = {{Text|<nowiki>"IMAGE"</nowiki>|#FFB100}}
udtebytealign(i2) = {{Text|1|#F580B1}}
udtetype(i2) = LONGTYPE: udtesize(i2) = {{Text|32|#F580B1}}
udtetypesize(i2) = {{Text|0|#F580B1}} {{Text|<nowiki>'tsize</nowiki>|#31C4C4}}
udtenext(i3) = i2
udtenext(i2) = {{Text|0|#F580B1}}
i3 = i2
lasttypeelement = lasttypeelement + {{Text|1|#F580B1}}: i2 = lasttypeelement
udtename(i2) = {{Text|<nowiki>"SOUND"</nowiki>|#FFB100}}
udtecname(i2) = {{Text|<nowiki>"SOUND"</nowiki>|#FFB100}}
udtebytealign(i2) = {{Text|1|#F580B1}}
udtetype(i2) = LONGTYPE: udtesize(i2) = {{Text|32|#F580B1}}
udtetypesize(i2) = {{Text|0|#F580B1}} {{Text|<nowiki>'tsize</nowiki>|#31C4C4}}
udtenext(i3) = i2
udtenext(i2) = {{Text|0|#F580B1}}
{{Text|<nowiki>' Reset all unstable flags</nowiki>|#31C4C4}}
{{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|UBOUND|#F0F0F0}}(unstableFlags): unstableFlags(i) = {{Text|0|#F580B1}}: {{Text|NEXT|#F0F0F0}}
{{Text|<nowiki>' Indicates if a MIDI sound font was selected</nowiki>|#31C4C4}}
{{Text|<nowiki>'</nowiki>|#31C4C4}}
{{Text|<nowiki>' Captures both the line number and line contents for error reporting later-on</nowiki>|#31C4C4}}
{{Text|<nowiki>' in the compilation process</nowiki>|#31C4C4}}
MidiSoundFontSet = {{Text|0|#F580B1}}
MidiSoundFontLine$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
{{Text|<nowiki>' If MidiSoundFont$ is blank, then the default is used</nowiki>|#31C4C4}}
MidiSoundFont$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
{{Text|<nowiki>'begin compilation</nowiki>|#31C4C4}}
{{Text|FOR|#F0F0F0}} closeall = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|255|#F580B1}}: {{Text|CLOSE|#F0F0F0}} closeall: {{Text|NEXT|#F0F0F0}}
{{Text|OPEN|#F0F0F0}} tmpdir$ + {{Text|<nowiki>"temp.bin"</nowiki>|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|OUTPUT|#F0F0F0}} {{Text|LOCK|#F0F0F0}} {{Text|WRITE|#F0F0F0}} {{Text|AS|#F0F0F0}} #26 {{Text|<nowiki>'relock</nowiki>|#31C4C4}}
bh = OpenBuffer%({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"icon.rc"</nowiki>|#FFB100}})
{{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|CLOSE|#F0F0F0}} #9: {{Text|OPEN|#F0F0F0}} tmpdir$ + {{Text|<nowiki>"debug.txt"</nowiki>|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|APPEND|#F0F0F0}} {{Text|AS|#F0F0F0}} #9
{{Text|IF|#F0F0F0}} idemode = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
    qberrorhappened = {{Text|-1|#F580B1}}
    {{Text|OPEN|#F0F0F0}} sourcefile$ {{Text|FOR|#F0F0F0}} {{Text|INPUT|#F0F0F0}} {{Text|AS|#F0F0F0}} #1
    qberrorhappened1:
    {{Text|IF|#F0F0F0}} qberrorhappened = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|PRINT|#F0F0F0}}
        {{Text|PRINT|#F0F0F0}} {{Text|<nowiki>"Cannot locate source file: "</nowiki>|#FFB100}} + sourcefile$
        {{Text|IF|#F0F0F0}} ConsoleMode {{Text|THEN|#F0F0F0}} {{Text|SYSTEM|#F0F0F0}} {{Text|1|#F580B1}}
        {{Text|END|#F0F0F0}} {{Text|1|#F580B1}}
    {{Text|ELSE|#F0F0F0}}
        {{Text|CLOSE|#F0F0F0}} #1
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    qberrorhappened = {{Text|0|#F580B1}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
reginternal
{{Text|IF|#F0F0F0}} qb64prefix_set {{Text|THEN|#F0F0F0}}
    qb64prefix$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
    {{Text|<nowiki>'re-add internal keywords without the "_" prefix</nowiki>|#31C4C4}}
    reginternal
    f = HASHFLAG_TYPE + HASHFLAG_RESERVED
    HashAdd {{Text|<nowiki>"UNSIGNED"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
    HashAdd {{Text|<nowiki>"BIT"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
    HashAdd {{Text|<nowiki>"BYTE"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
    HashAdd {{Text|<nowiki>"INTEGER64"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
    HashAdd {{Text|<nowiki>"OFFSET"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
    HashAdd {{Text|<nowiki>"FLOAT"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
    f = HASHFLAG_RESERVED + HASHFLAG_CUSTOMSYNTAX
    HashAdd {{Text|<nowiki>"EXPLICIT"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} GlobTxtBuf: GlobTxtBuf = OpenBuffer%({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"global.txt"</nowiki>|#FFB100}})
defdatahandle = GlobTxtBuf
{{Text|IF|#F0F0F0}} iderecompile {{Text|THEN|#F0F0F0}}
    iderecompile = {{Text|0|#F580B1}}
    idepass = {{Text|1|#F580B1}} {{Text|<nowiki>'prepass must be done again</nowiki>|#31C4C4}}
    sendc$ = {{Text|CHR$|#F0F0F0}}({{Text|7|#F580B1}}) {{Text|<nowiki>'repass request</nowiki>|#31C4C4}}
    {{Text|GOTO|#F0F0F0}} sendcommand
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}} idemode {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} ideret1
lineinput3load sourcefile$
{{Text|DO|#F0F0F0}}
    {{Text|<nowiki>'### STEVE EDIT FOR CONST EXPANSION 10/11/2013</nowiki>|#31C4C4}}
    wholeline$ = lineinput3$
    {{Text|IF|#F0F0F0}} wholeline$ = {{Text|CHR$|#F0F0F0}}({{Text|13|#F580B1}}) {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
    ideprepass:
    prepassLastLine:
    {{Text|IF|#F0F0F0}} lastLine <> {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} firstLine <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
        lineBackup$ = wholeline$ {{Text|<nowiki>'backup the real line (will be blank when lastline is set)</nowiki>|#31C4C4}}
        forceIncludeFromRoot$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Text|IF|#F0F0F0}} vWatchOn {{Text|THEN|#F0F0F0}}
            addingvWatch = {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} firstLine <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} forceIncludeFromRoot$ = {{Text|<nowiki>"internal\support\vwatch\vwatch.bi"</nowiki>|#FFB100}}
            {{Text|IF|#F0F0F0}} lastLine <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} forceIncludeFromRoot$ = {{Text|<nowiki>"internal\support\vwatch\vwatch.bm"</nowiki>|#FFB100}}
        {{Text|ELSE|#F0F0F0}}
            {{Text|<nowiki>'IF firstLine <> 0 THEN forceIncludeFromRoot$ = "internal\support\vwatch\vwatch_stub.bi"</nowiki>|#31C4C4}}
            {{Text|IF|#F0F0F0}} lastLine <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} forceIncludeFromRoot$ = {{Text|<nowiki>"internal\support\vwatch\vwatch_stub.bm"</nowiki>|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        firstLine = {{Text|0|#F580B1}}: lastLine = {{Text|0|#F580B1}}
        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(forceIncludeFromRoot$) {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} forceInclude_prepass
        forceIncludeCompleted_prepass:
        addingvWatch = {{Text|0|#F580B1}}
        wholeline$ = lineBackup$
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    wholestv$ = wholeline$ {{Text|<nowiki>'### STEVE EDIT FOR CONST EXPANSION 10/11/2013</nowiki>|#31C4C4}}
    prepass = {{Text|1|#F580B1}}
    layout = {{Text|<nowiki>""</nowiki>|#FFB100}}
    layoutok = {{Text|0|#F580B1}}
    linenumber = linenumber + {{Text|1|#F580B1}}
    reallinenumber = reallinenumber + {{Text|1|#F580B1}}
    {{Text|DO|#F0F0F0}} {{Text|UNTIL|#F0F0F0}} linenumber < {{Text|UBOUND|#F0F0F0}}(InValidLine) {{Text|<nowiki>'color information flag for each line</nowiki>|#31C4C4}}
        {{Text|REDIM|#F0F0F0}} {{Text|_PRESERVE|#F0F0F0}} InValidLine({{Text|UBOUND|#F0F0F0}}(InValidLine) + {{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|_BYTE|#F0F0F0}}
    {{Text|LOOP|#F0F0F0}}
    InValidLine(linenumber) = {{Text|0|#F580B1}}
    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(wholeline$) {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} {{Text|UCASE$|#F0F0F0}}({{Text|_TRIM$|#F0F0F0}}(wholeline$)) = {{Text|<nowiki>"$NOPREFIX"</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}}
            qb64prefix_set_desiredState = {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} qb64prefix_set = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} qb64prefix_set_recompileAttempts = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    qb64prefix_set_recompileAttempts = qb64prefix_set_recompileAttempts + {{Text|1|#F580B1}}
                    {{Text|GOTO|#F0F0F0}} do_recompile
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        wholeline$ = lineformat(wholeline$)
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
        temp$ = {{Text|LTRIM$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}({{Text|UCASE$|#F0F0F0}}(wholestv$)))
        {{Text|IF|#F0F0F0}} temp$ = {{Text|<nowiki>"$COLOR:0"</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} qb64prefix_set {{Text|THEN|#F0F0F0}}
                addmetainclude$ = getfilepath$({{Text|COMMAND$|#F0F0F0}}({{Text|0|#F580B1}})) + {{Text|<nowiki>"internal"</nowiki>|#FFB100}} + pathsep$ + {{Text|<nowiki>"support"</nowiki>|#FFB100}} + pathsep$ + {{Text|<nowiki>"color"</nowiki>|#FFB100}} + pathsep$ + {{Text|<nowiki>"color0_noprefix.bi"</nowiki>|#FFB100}}
            {{Text|ELSE|#F0F0F0}}
                addmetainclude$ = getfilepath$({{Text|COMMAND$|#F0F0F0}}({{Text|0|#F580B1}})) + {{Text|<nowiki>"internal"</nowiki>|#FFB100}} + pathsep$ + {{Text|<nowiki>"support"</nowiki>|#FFB100}} + pathsep$ + {{Text|<nowiki>"color"</nowiki>|#FFB100}} + pathsep$ + {{Text|<nowiki>"color0.bi"</nowiki>|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|GOTO|#F0F0F0}} finishedlinepp
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} temp$ = {{Text|<nowiki>"$COLOR:32"</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} qb64prefix_set {{Text|THEN|#F0F0F0}}
                addmetainclude$ = getfilepath$({{Text|COMMAND$|#F0F0F0}}({{Text|0|#F580B1}})) + {{Text|<nowiki>"internal"</nowiki>|#FFB100}} + pathsep$ + {{Text|<nowiki>"support"</nowiki>|#FFB100}} + pathsep$ + {{Text|<nowiki>"color"</nowiki>|#FFB100}} + pathsep$ + {{Text|<nowiki>"color32_noprefix.bi"</nowiki>|#FFB100}}
            {{Text|ELSE|#F0F0F0}}
                addmetainclude$ = getfilepath$({{Text|COMMAND$|#F0F0F0}}({{Text|0|#F580B1}})) + {{Text|<nowiki>"internal"</nowiki>|#FFB100}} + pathsep$ + {{Text|<nowiki>"support"</nowiki>|#FFB100}} + pathsep$ + {{Text|<nowiki>"color"</nowiki>|#FFB100}} + pathsep$ + {{Text|<nowiki>"color32.bi"</nowiki>|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|GOTO|#F0F0F0}} finishedlinepp
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} temp$ = {{Text|<nowiki>"$DEBUG"</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}}
            vWatchDesiredState = {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} vWatchOn = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} vWatchRecompileAttempts = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|<nowiki>'this is the first time a conflict has occurred, so react immediately with a full recompilation using the desired state</nowiki>|#31C4C4}}
                    vWatchRecompileAttempts = vWatchRecompileAttempts + {{Text|1|#F580B1}}
                    {{Text|GOTO|#F0F0F0}} do_recompile
                {{Text|ELSE|#F0F0F0}}
                    {{Text|<nowiki>'continue compilation to retrieve the final state requested and act on that as required</nowiki>|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(temp$, {{Text|4|#F580B1}}) = {{Text|<nowiki>"$IF "</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} {{Text|RIGHT$|#F0F0F0}}(temp$, {{Text|5|#F580B1}}) <> {{Text|<nowiki>" THEN"</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|<nowiki>"$IF without THEN"</nowiki>|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            temp$ = {{Text|LTRIM$|#F0F0F0}}({{Text|MID$|#F0F0F0}}(temp$, {{Text|4|#F580B1}})) {{Text|<nowiki>'strip off the $IF and extra spaces</nowiki>|#31C4C4}}
            temp$ = {{Text|RTRIM$|#F0F0F0}}({{Text|LEFT$|#F0F0F0}}(temp$, {{Text|LEN|#F0F0F0}}(temp$) - {{Text|4|#F580B1}})) {{Text|<nowiki>'and strip off the THEN and extra spaces</nowiki>|#31C4C4}}
            temp = {{Text|INSTR|#F0F0F0}}(temp$, {{Text|<nowiki>"="</nowiki>|#FFB100}})
            ExecCounter = ExecCounter + {{Text|1|#F580B1}}
            ExecLevel(ExecCounter) = {{Text|-1|#F580B1}} {{Text|<nowiki>'default to a skip value</nowiki>|#31C4C4}}
            DefineElse(ExecCounter) = {{Text|1|#F580B1}} {{Text|<nowiki>'1 says we have an $IF statement at this level</nowiki>|#31C4C4}}
            result = EvalPreIF(temp$, a$)
            {{Text|IF|#F0F0F0}} a$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} result <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                ExecLevel(ExecCounter) = ExecLevel(ExecCounter - {{Text|1|#F580B1}}) {{Text|<nowiki>'So we inherit the execlevel from above</nowiki>|#31C4C4}}
                {{Text|IF|#F0F0F0}} ExecLevel(ExecCounter) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} DefineElse(ExecCounter) = DefineElse(ExecCounter) {{Text|OR|#F0F0F0}} {{Text|4|#F580B1}} {{Text|<nowiki>'Else if used and conditon found</nowiki>|#31C4C4}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|GOTO|#F0F0F0}} finishedlinepp {{Text|<nowiki>'and then we're finished -- and at this point we didn't make a match so we exit with a DONT READ type flag on our code.</nowiki>|#31C4C4}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} temp$ = {{Text|<nowiki>"$ELSE"</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} DefineElse(ExecCounter) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|<nowiki>"$ELSE without $IF"</nowiki>|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} DefineElse(ExecCounter) {{Text|AND|#F0F0F0}} {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|<nowiki>"$IF block already has $ELSE statement in it"</nowiki>|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            DefineElse(ExecCounter) = DefineElse(ExecCounter) {{Text|OR|#F0F0F0}} {{Text|2|#F580B1}} {{Text|<nowiki>'set the flag to declare an $ELSE already in this block</nowiki>|#31C4C4}}
            {{Text|IF|#F0F0F0}} DefineElse(ExecCounter) {{Text|AND|#F0F0F0}} {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|<nowiki>'If we executed code in a previous IF or ELSE IF statement, we can't do it here</nowiki>|#31C4C4}}
                ExecLevel(ExecCounter) = {{Text|-1|#F580B1}} {{Text|<nowiki>'So we inherit the execlevel from above</nowiki>|#31C4C4}}
            {{Text|ELSE|#F0F0F0}}
                ExecLevel(ExecCounter) = ExecLevel(ExecCounter - {{Text|1|#F580B1}}) {{Text|<nowiki>'If we were processing code before, code after this segment is going to be SKIPPED</nowiki>|#31C4C4}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|GOTO|#F0F0F0}} finishedlinepp
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(temp$, {{Text|5|#F580B1}}) = {{Text|<nowiki>"$ELSE"</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|<nowiki>'looking for $ELSE IF</nowiki>|#31C4C4}}
            temp$ = {{Text|LTRIM$|#F0F0F0}}({{Text|MID$|#F0F0F0}}(temp$, {{Text|6|#F580B1}}))
            {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(temp$, {{Text|3|#F580B1}}) = {{Text|<nowiki>"IF "</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} DefineElse(ExecCounter) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|<nowiki>"$ELSE IF without $IF"</nowiki>|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} DefineElse(ExecCounter) {{Text|AND|#F0F0F0}} {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|<nowiki>"$ELSE IF cannot follow $ELSE"</nowiki>|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} {{Text|RIGHT$|#F0F0F0}}(temp$, {{Text|5|#F580B1}}) <> {{Text|<nowiki>" THEN"</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|<nowiki>"$ELSE IF without THEN"</nowiki>|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} DefineElse(ExecCounter) {{Text|AND|#F0F0F0}} {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|<nowiki>'If we executed code in a previous IF or ELSE IF statement, we can't do it here</nowiki>|#31C4C4}}
                    ExecLevel(ExecCounter) = {{Text|-1|#F580B1}}
                    {{Text|GOTO|#F0F0F0}} finishedlinepp
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                temp$ = {{Text|LTRIM$|#F0F0F0}}({{Text|MID$|#F0F0F0}}(temp$, {{Text|3|#F580B1}})) {{Text|<nowiki>'strip off the IF and extra spaces</nowiki>|#31C4C4}}
                temp$ = {{Text|RTRIM$|#F0F0F0}}({{Text|LEFT$|#F0F0F0}}(temp$, {{Text|LEN|#F0F0F0}}(temp$) - {{Text|4|#F580B1}})) {{Text|<nowiki>'and strip off the THEN and extra spaces</nowiki>|#31C4C4}}
                result = EvalPreIF(temp$, a$)
                {{Text|IF|#F0F0F0}} a$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} result <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    ExecLevel(ExecCounter) = ExecLevel(ExecCounter - {{Text|1|#F580B1}}) {{Text|<nowiki>'So we inherit the execlevel from above</nowiki>|#31C4C4}}
                    {{Text|IF|#F0F0F0}} ExecLevel(ExecCounter) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} DefineElse(ExecCounter) = DefineElse(ExecCounter) {{Text|OR|#F0F0F0}} {{Text|4|#F580B1}} {{Text|<nowiki>'Else if used and conditon found</nowiki>|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|GOTO|#F0F0F0}} finishedlinepp {{Text|<nowiki>'and then we're finished -- and at this point we didn't make a match so we exit with a DONT READ type flag on our code.</nowiki>|#31C4C4}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} temp$ = {{Text|<nowiki>"$END IF"</nowiki>|#FFB100}} {{Text|OR|#F0F0F0}} temp$ = {{Text|<nowiki>"$ENDIF"</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} DefineElse(ExecCounter) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|<nowiki>"$END IF without $IF"</nowiki>|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            DefineElse(ExecCounter) = {{Text|0|#F580B1}} {{Text|<nowiki>'We no longer have an $IF block at this level</nowiki>|#31C4C4}}
            ExecCounter = ExecCounter - {{Text|1|#F580B1}}
            {{Text|GOTO|#F0F0F0}} finishedlinepp
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} ExecLevel(ExecCounter) {{Text|THEN|#F0F0F0}}
            {{Text|DO|#F0F0F0}} {{Text|UNTIL|#F0F0F0}} linenumber < {{Text|UBOUND|#F0F0F0}}(InValidLine)
                {{Text|REDIM|#F0F0F0}} {{Text|_PRESERVE|#F0F0F0}} InValidLine({{Text|UBOUND|#F0F0F0}}(InValidLine) + {{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|_BYTE|#F0F0F0}}
            {{Text|LOOP|#F0F0F0}}
            InValidLine(linenumber) = {{Text|-1|#F580B1}}
            {{Text|GOTO|#F0F0F0}} finishedlinepp {{Text|<nowiki>'we don't check for anything inside lines that we've marked for skipping</nowiki>|#31C4C4}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(temp$, {{Text|7|#F580B1}}) = {{Text|<nowiki>"$ERROR "</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}}
            temp$ = {{Text|LTRIM$|#F0F0F0}}({{Text|MID$|#F0F0F0}}(temp$, {{Text|7|#F580B1}}))
            a$ = {{Text|<nowiki>"Compilation check failed: "</nowiki>|#FFB100}} + temp$
            {{Text|GOTO|#F0F0F0}} errmes
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(temp$, {{Text|5|#F580B1}}) = {{Text|<nowiki>"$LET "</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}}
            temp$ = {{Text|LTRIM$|#F0F0F0}}({{Text|MID$|#F0F0F0}}(temp$, {{Text|5|#F580B1}})) {{Text|<nowiki>'simply shorten our string to parse</nowiki>|#31C4C4}}
            {{Text|<nowiki>'For starters, let's make certain that we have 3 elements to deal with</nowiki>|#31C4C4}}
            temp = {{Text|INSTR|#F0F0F0}}(temp$, {{Text|<nowiki>"="</nowiki>|#FFB100}}) {{Text|<nowiki>'without an = in there, we can't get a value from the left and right side</nowiki>|#31C4C4}}
            {{Text|IF|#F0F0F0}} temp = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|<nowiki>"Invalid Syntax.  $LET <flag> = <value>"</nowiki>|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            l$ = {{Text|RTRIM$|#F0F0F0}}({{Text|LEFT$|#F0F0F0}}(temp$, temp - {{Text|1|#F580B1}})): r$ = {{Text|LTRIM$|#F0F0F0}}({{Text|MID$|#F0F0F0}}(temp$, temp + {{Text|1|#F580B1}}))
            {{Text|<nowiki>'then validate to make certain the left side looks proper</nowiki>|#31C4C4}}
            {{Text|IF|#F0F0F0}} validname(l$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|<nowiki>"Invalid flag name"</nowiki>|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(r$, {{Text|1|#F580B1}}) = {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) {{Text|THEN|#F0F0F0}} r$ = {{Text|LTRIM$|#F0F0F0}}({{Text|MID$|#F0F0F0}}(r$, {{Text|2|#F580B1}}))
            {{Text|IF|#F0F0F0}} {{Text|RIGHT$|#F0F0F0}}(r$, {{Text|1|#F580B1}}) = {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) {{Text|THEN|#F0F0F0}} r$ = {{Text|RTRIM$|#F0F0F0}}({{Text|LEFT$|#F0F0F0}}(r$, {{Text|LEN|#F0F0F0}}(r$) - {{Text|1|#F580B1}}))
            {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(r$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"-"</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}}
                r1$ = {{Text|<nowiki>"-"</nowiki>|#FFB100}}
                r$ = {{Text|LTRIM$|#F0F0F0}}({{Text|MID$|#F0F0F0}}(r$, {{Text|2|#F580B1}}))
            {{Text|ELSE|#F0F0F0}}
                r1$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|<nowiki>'then validate to make certain the left side looks proper</nowiki>|#31C4C4}}
            {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|LEN|#F0F0F0}}(r$)
                a = {{Text|ASC|#F0F0F0}}(r$, i)
                {{Text|SELECT|#F0F0F0}} {{Text|CASE|#F0F0F0}} a
                    {{Text|CASE|#F0F0F0}} {{Text|32|#F580B1}}
                    {{Text|CASE|#F0F0F0}} {{Text|46|#F580B1}} {{Text|<nowiki>'periods are fine.</nowiki>|#31C4C4}}
                        r1$ = r1$ + {{Text|<nowiki>"."</nowiki>|#FFB100}}
                    {{Text|CASE|#F0F0F0}} {{Text|IS|#F0F0F0}} < {{Text|48|#F580B1}}, {{Text|IS|#F0F0F0}} > {{Text|90|#F580B1}}
                        a$ = {{Text|<nowiki>"Invalid value"</nowiki>|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|CASE|#F0F0F0}} {{Text|ELSE|#F0F0F0}}
                        r1$ = r1$ + {{Text|CHR$|#F0F0F0}}(a)
                {{Text|END|#F0F0F0}} {{Text|SELECT|#F0F0F0}}
            {{Text|NEXT|#F0F0F0}}
            r$ = r1$
            {{Text|<nowiki>'First look to see if we have an existing setting like this and if so, update it</nowiki>|#31C4C4}}
            {{Text|FOR|#F0F0F0}} i = {{Text|8|#F580B1}} {{Text|TO|#F0F0F0}} UserDefineCount {{Text|<nowiki>'UserDefineCount 1-7 are reserved for automatic OS/BIT detection & version</nowiki>|#31C4C4}}
                {{Text|IF|#F0F0F0}} UserDefine({{Text|0|#F580B1}}, i) = l$ {{Text|THEN|#F0F0F0}} UserDefine({{Text|1|#F580B1}}, i) = r$: {{Text|GOTO|#F0F0F0}} finishedlinepp
            {{Text|NEXT|#F0F0F0}}
            {{Text|<nowiki>'Otherwise create a new setting and set the initial value for it</nowiki>|#31C4C4}}
            UserDefineCount = UserDefineCount + {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} UserDefineCount > {{Text|UBOUND|#F0F0F0}}(UserDefine, {{Text|2|#F580B1}}) {{Text|THEN|#F0F0F0}}
                {{Text|REDIM|#F0F0F0}} {{Text|_PRESERVE|#F0F0F0}} UserDefine({{Text|1|#F580B1}}, {{Text|UBOUND|#F0F0F0}}(UserDefine, {{Text|2|#F580B1}}) + {{Text|10|#F580B1}}) {{Text|<nowiki>'Add another 10 elements to the array so it'll expand as the user adds to it</nowiki>|#31C4C4}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            UserDefine({{Text|0|#F580B1}}, UserDefineCount) = l$
            UserDefine({{Text|1|#F580B1}}, UserDefineCount) = r$
            {{Text|GOTO|#F0F0F0}} finishedlinepp
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|<nowiki>' We check for Unstable flags during the preprocessing step because it</nowiki>|#31C4C4}}
        {{Text|<nowiki>' impacts what valid commands there are in all the other steps</nowiki>|#31C4C4}}
        {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(temp$, {{Text|10|#F580B1}}) = {{Text|<nowiki>"$UNSTABLE:"</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}}
            token$ = {{Text|UCASE$|#F0F0F0}}({{Text|LTRIM$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}({{Text|MID$|#F0F0F0}}(temp$, {{Text|11|#F580B1}}))))
            {{Text|SELECT|#F0F0F0}} {{Text|CASE|#F0F0F0}} token$
                {{Text|CASE|#F0F0F0}} {{Text|<nowiki>"MIDI"</nowiki>|#FFB100}}
                    {{Text|IF|#F0F0F0}} {{Text|NOT|#F0F0F0}} UseMiniaudioBackend {{Text|THEN|#F0F0F0}}
                        a$ = {{Text|<nowiki>"Midi is not supported with the old OpenAL audio backend."</nowiki>|#FFB100}}
                        {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    unstableFlags(UNSTABLE_MIDI) = {{Text|-1|#F580B1}}
                {{Text|CASE|#F0F0F0}} {{Text|<nowiki>"HTTP"</nowiki>|#FFB100}}
                    unstableFlags(UNSTABLE_HTTP) = {{Text|-1|#F580B1}}
                    regUnstableHttp
                {{Text|CASE|#F0F0F0}} {{Text|ELSE|#F0F0F0}}
                    a$ = {{Text|<nowiki>"Unrecognized unstable flag "</nowiki>|#FFB100}} + AddQuotes$(token$)
                    {{Text|GOTO|#F0F0F0}} errmes
            {{Text|END|#F0F0F0}} {{Text|SELECT|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        cwholeline$ = wholeline$
        wholeline$ = eleucase$(wholeline$) {{Text|<nowiki>'********REMOVE THIS LINE LATER********</nowiki>|#31C4C4}}
        addmetadynamic = {{Text|0|#F580B1}}: addmetastatic = {{Text|0|#F580B1}}
        wholelinen = numelements(wholeline$)
        {{Text|IF|#F0F0F0}} wholelinen {{Text|THEN|#F0F0F0}}
            wholelinei = {{Text|1|#F580B1}}
            {{Text|<nowiki>'skip line number?</nowiki>|#31C4C4}}
            e$ = getelement$(wholeline$, {{Text|1|#F580B1}})
            {{Text|IF|#F0F0F0}} ({{Text|ASC|#F0F0F0}}(e$) >= {{Text|48|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|ASC|#F0F0F0}}(e$) <= {{Text|59|#F580B1}}) {{Text|OR|#F0F0F0}} {{Text|ASC|#F0F0F0}}(e$) = {{Text|46|#F580B1}} {{Text|THEN|#F0F0F0}} wholelinei = {{Text|2|#F580B1}}: {{Text|GOTO|#F0F0F0}} ppskpl
            {{Text|<nowiki>'skip 'POSSIBLE' line label?</nowiki>|#31C4C4}}
            {{Text|IF|#F0F0F0}} wholelinen >= {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                x2 = {{Text|INSTR|#F0F0F0}}(wholeline$, sp + {{Text|<nowiki>":"</nowiki>|#FFB100}} + sp): x3 = x2 + {{Text|2|#F580B1}}
                {{Text|IF|#F0F0F0}} x2 = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} {{Text|RIGHT$|#F0F0F0}}(wholeline$, {{Text|2|#F580B1}}) = sp + {{Text|<nowiki>":"</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}} x2 = {{Text|LEN|#F0F0F0}}(wholeline$) - {{Text|1|#F580B1}}: x3 = x2 + {{Text|1|#F580B1}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} x2 {{Text|THEN|#F0F0F0}}
                    e$ = {{Text|LEFT$|#F0F0F0}}(wholeline$, x2 - {{Text|1|#F580B1}})
                    {{Text|IF|#F0F0F0}} validlabel(e$) {{Text|THEN|#F0F0F0}}
                        wholeline$ = {{Text|RIGHT$|#F0F0F0}}(wholeline$, {{Text|LEN|#F0F0F0}}(wholeline$) - x3)
                        cwholeline$ = {{Text|RIGHT$|#F0F0F0}}(cwholeline$, {{Text|LEN|#F0F0F0}}(wholeline$) - x3)
                        wholelinen = numelements(wholeline$)
                        {{Text|GOTO|#F0F0F0}} ppskpl
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|<nowiki>'valid</nowiki>|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|<nowiki>'includes ":"</nowiki>|#31C4C4}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|<nowiki>'wholelinen>=2</nowiki>|#31C4C4}}
            ppskpl:
            {{Text|IF|#F0F0F0}} wholelinei <= wholelinen {{Text|THEN|#F0F0F0}}
                {{Text|<nowiki>'----------------------------------------</nowiki>|#31C4C4}}
                a$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                ca$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                ppblda:
                e$ = getelement$(wholeline$, wholelinei)
                ce$ = getelement$(cwholeline$, wholelinei)
                {{Text|IF|#F0F0F0}} e$ = {{Text|<nowiki>":"</nowiki>|#FFB100}} {{Text|OR|#F0F0F0}} e$ = {{Text|<nowiki>"ELSE"</nowiki>|#FFB100}} {{Text|OR|#F0F0F0}} e$ = {{Text|<nowiki>"THEN"</nowiki>|#FFB100}} {{Text|OR|#F0F0F0}} e$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(a$) {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|<nowiki>"PP["</nowiki>|#FFB100}} + a$ + {{Text|<nowiki>"]"</nowiki>|#FFB100}}
                        n = numelements(a$)
                        firstelement$ = getelement(a$, {{Text|1|#F580B1}})
                        secondelement$ = getelement(a$, {{Text|2|#F580B1}})
                        thirdelement$ = getelement(a$, {{Text|3|#F580B1}})
                        {{Text|<nowiki>'========================================</nowiki>|#31C4C4}}
                        {{Text|IF|#F0F0F0}} n = {{Text|2|#F580B1}} {{Text|AND|#F0F0F0}} firstelement$ = {{Text|<nowiki>"END"</nowiki>|#FFB100}} {{Text|AND|#F0F0F0}} (secondelement$ = {{Text|<nowiki>"SUB"</nowiki>|#FFB100}} {{Text|OR|#F0F0F0}} secondelement$ = {{Text|<nowiki>"FUNCTION"</nowiki>|#FFB100}}) {{Text|THEN|#F0F0F0}}
                            closedsubfunc = {{Text|-1|#F580B1}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|<nowiki>'declare library</nowiki>|#31C4C4}}
                        {{Text|IF|#F0F0F0}} declaringlibrary {{Text|THEN|#F0F0F0}}
{{CodeEnd}}

Revision as of 00:24, 24 February 2023

The _BlankPage serves as a skeleton for new Wiki pages.


Syntax

_BlankSub arg1[, arg2]
result% = _BlankFunc(arg1[, arg2])


Parameters

  • arg1 is a mandatory argument
  • the arg2 is optional


Description

To use this skeleton click on the Edit tab above the page, then copy the raw text of this page and paste it into your new page. Change/remove sections as needed. Use this for italic and this for bold text style. To color your writings use the Text template. It takes either a color name or a #RRGGBB 32bit color, if the color part is omitted it will default to gray.

You can inline simple code one liners like w = _WIDTH

  • an askerisk marks a list point
    • two askerisks will indent the list
      • three askerisks will indent even more
This is a definition list
The first description can follow right after a colon
or in a new line
more descriptions can follow
  • using list bullets with an askerisk
as already seen in the syntax above, you may use desciptions without a defininition too
you may also nest descriptions
but at some point it's cluttering the page so please use it sparingly
This is a nice piece of paper for quotes and similar things. In case of short code snippets you may use the "Cb" (code blue) template to highlight and link keywords to the Wiki pages.

FOR x = 1 TO 5
   PRINT "Hello World!"
NEXT x
END

As you see, this Text block is suitable for preformatted text, but note that the browser is still allowed to wrap too long lines. If you really need your preformatted text to be shown as is, then use a fixed text block instaed, see below.
Use this fixed text block for preformatted text, which is not even allowed to wrap long lines, such as tables etc..
As you see this very long line goes far over the display width, so please limit youself to the available space to not clutter the display too much.

Notes

  • This may be a sub-section for further notes like special behavior, required prerequisites etc.
  • If used/required, then this should always be a sub-section under the Description main section

Errors

  • If used/required, then this also should be a sub-section under the Description main section
  • This is not intended for the regular errors a SUB/FUNCTION could throw, those should be handled in the main description section.
    • Rather use it for subtle things, known mis-behavior, tendency for stack overflows and seg faults etc.


Availability

  • The capability to load from memory was introduced in QB64-PE v3.5.0.


Examples

Example 1
Each example should have a short description.
'Place your code example here
'The "Cl" (code link) template can be used to link keywords to its
'respective Wiki page. Those words will also get highlighted.
COLOR 15,4
PRINT "Hello World!"
This template allows for a short author credit.


The output block is available for the SCREEN 0 background colors 0-7
Inside the output block use the "Ot" (output text) template for coloring
Hello World!


See also



Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link
'All variables will be of type LONG unless explicitly defined
DEFLNG A-Z

'All arrays will be dynamically allocated so they can be REDIM-ed
'$DYNAMIC

'We need console access to support command-line compilation via the -x command line compile option
$CONSOLE

'Initially the "SCREEN" will be hidden, if the -x option is used it will never be created
$SCREENHIDE

$EXEICON:'./qb64pe.ico'

$VERSIONINFO:CompanyName=QB64 Phoenix Edition
$VERSIONINFO:FileDescription=QB64 IDE and Compiler
$VERSIONINFO:InternalName=qb64pe.bas
$VERSIONINFO:LegalCopyright=MIT
$VERSIONINFO:LegalTrademarks=
$VERSIONINFO:OriginalFilename=qb64pe.exe
$VERSIONINFO:ProductName=QB64-PE
$VERSIONINFO:Comments=QB64 is a modern extended BASIC programming language that retains QB4.5/QBasic compatibility and compiles native binaries for Windows, Linux and macOS.

'$INCLUDE:'global\version.bas'
'$INCLUDE:'global\settings.bas'
'$INCLUDE:'global\constants.bas'
'$INCLUDE:'subs_functions\extensions\opengl\opengl_global.bas'
'$INCLUDE:'utilities\ini-manager\ini.bi'
'$INCLUDE:'utilities\s-buffer\simplebuffer.bi'

DEFLNG A-Z

'-------- Optional IDE Component (1/2) --------
'$INCLUDE:'ide\ide_global.bas'

REDIM SHARED OName(1000) AS STRING 'Operation Name
REDIM SHARED PL(1000) AS INTEGER 'Priority Level
REDIM SHARED PP_TypeMod(0) AS STRING, PP_ConvertedMod(0) AS STRING 'Prepass Name Conversion variables.
Set_OrderOfOperations

DIM SHARED NoExeSaved AS INTEGER

DIM SHARED vWatchOn, vWatchRecompileAttempts, vWatchDesiredState, vWatchErrorCall$
DIM SHARED vWatchNewVariable$, vWatchVariableExclusions$
vWatchErrorCall$ = "if (stop_program) {*__LONG_VWATCH_LINENUMBER=0; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);};if(new_error){bkp_new_error=new_error;new_error=0;*__LONG_VWATCH_LINENUMBER=-1; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);new_error=bkp_new_error;};"
vWatchVariableExclusions$ = "@__LONG_VWATCH_LINENUMBER@__LONG_VWATCH_SUBLEVEL@__LONG_VWATCH_GOTO@" + _
              "@__STRING_VWATCH_SUBNAME@__STRING_VWATCH_CALLSTACK@__ARRAY_BYTE_VWATCH_BREAKPOINTS" + _
              "@__ARRAY_BYTE_VWATCH_SKIPLINES@__STRING_VWATCH_INTERNALSUBNAME@__ARRAY_STRING_VWATCH_STACK@"

DIM SHARED nativeDataTypes$
nativeDataTypes$ = "@_OFFSET@OFFSET@_UNSIGNED _OFFSET@UNSIGNED OFFSET@_BIT@BIT@_UNSIGNED _BIT@UNSIGNED BIT@_BYTE@_UNSIGNED _BYTE@BYTE@UNSIGNED BYTE@INTEGER@_UNSIGNED INTEGER@UNSIGNED INTEGER@LONG@_UNSIGNED LONG@UNSIGNED LONG@_INTEGER64@INTEGER64@_UNSIGNED _INTEGER64@UNSIGNED INTEGER64@SINGLE@DOUBLE@_FLOAT@FLOAT@STRING@"

DIM SHARED qb64prefix_set_recompileAttempts, qb64prefix_set_desiredState
DIM SHARED opex_recompileAttempts, opex_desiredState
DIM SHARED opexarray_recompileAttempts, opexarray_desiredState

REDIM EveryCaseSet(100), SelectCaseCounter AS _UNSIGNED LONG
REDIM SelectCaseHasCaseBlock(100)
DIM ExecLevel(255), ExecCounter AS INTEGER
REDIM SHARED UserDefine(1, 100) AS STRING '0 element is the name, 1 element is the string value
REDIM SHARED InValidLine(10000) AS _BYTE
DIM DefineElse(255) AS _BYTE
DIM SHARED UserDefineCount AS INTEGER, UserDefineList$
UserDefineList$ = "@DEFINED@UNDEFINED@WINDOWS@WIN@LINUX@MAC@MACOSX@32BIT@64BIT@VERSION@"
UserDefine(0, 0) = "WINDOWS": UserDefine(0, 1) = "WIN"
UserDefine(0, 2) = "LINUX"
UserDefine(0, 3) = "MAC": UserDefine(0, 4) = "MACOSX"
UserDefine(0, 5) = "32BIT": UserDefine(0, 6) = "64BIT"
UserDefine(0, 7) = "VERSION"
IF INSTR(_OS$, "WIN") THEN UserDefine(1, 0) = "-1": UserDefine(1, 1) = "-1" ELSE UserDefine(1, 0) = "0": UserDefine(1, 1) = "0"
IF INSTR(_OS$, "LINUX") THEN UserDefine(1, 2) = "-1" ELSE UserDefine(1, 2) = "0"
IF INSTR(_OS$, "MAC") THEN UserDefine(1, 3) = "-1": UserDefine(1, 4) = "-1" ELSE UserDefine(1, 3) = "0": UserDefine(1, 4) = "0"
IF INSTR(_OS$, "32BIT") THEN UserDefine(1, 5) = "-1": UserDefine(1, 6) = "0" ELSE UserDefine(1, 5) = "0": UserDefine(1, 6) = "-1"
UserDefine(1, 7) = Version$

DIM SHARED QB64_uptime!

QB64_uptime! = TIMER

NoInternalFolder:
IF _DIREXISTS("internal") = 0 THEN
    _SCREENSHOW
    PRINT "QB64-PE cannot locate the 'internal' folder"
    PRINT
    PRINT "Check that QB64-PE has been extracted properly."
    PRINT "For MacOSX, launch 'qb64pe_start.command' or enter './qb64pe' in Terminal."
    PRINT "For Linux, in the console enter './qb64pe'."
    DO
        _LIMIT 1
    LOOP UNTIL INKEY$ <> ""
    SYSTEM 1
END IF

DIM SHARED Include_GDB_Debugging_Info 'set using "options.bin"

DIM SHARED DEPENDENCY_LAST
CONST DEPENDENCY_LOADFONT = 1: DEPENDENCY_LAST = DEPENDENCY_LAST + 1
CONST DEPENDENCY_AUDIO_CONVERSION = 2: DEPENDENCY_LAST = DEPENDENCY_LAST + 1
CONST DEPENDENCY_AUDIO_DECODE = 3: DEPENDENCY_LAST = DEPENDENCY_LAST + 1
CONST DEPENDENCY_AUDIO_OUT = 4: DEPENDENCY_LAST = DEPENDENCY_LAST + 1
CONST DEPENDENCY_GL = 5: DEPENDENCY_LAST = DEPENDENCY_LAST + 1
CONST DEPENDENCY_IMAGE_CODEC = 6: DEPENDENCY_LAST = DEPENDENCY_LAST + 1
CONST DEPENDENCY_CONSOLE_ONLY = 7: DEPENDENCY_LAST = DEPENDENCY_LAST + 1 '=2 if via -g switch, =1 if via metacommand $CONSOLE:ONLY
CONST DEPENDENCY_SOCKETS = 8: DEPENDENCY_LAST = DEPENDENCY_LAST + 1
CONST DEPENDENCY_PRINTER = 9: DEPENDENCY_LAST = DEPENDENCY_LAST + 1
CONST DEPENDENCY_ICON = 10: DEPENDENCY_LAST = DEPENDENCY_LAST + 1
CONST DEPENDENCY_SCREENIMAGE = 11: DEPENDENCY_LAST = DEPENDENCY_LAST + 1
CONST DEPENDENCY_DEVICEINPUT = 12: DEPENDENCY_LAST = DEPENDENCY_LAST + 1 'removes support for gamepad input if not present
CONST DEPENDENCY_ZLIB = 13: DEPENDENCY_LAST = DEPENDENCY_LAST + 1 'ZLIB library linkage, if desired, for compression/decompression.



DIM SHARED DEPENDENCY(1 TO DEPENDENCY_LAST)

DIM SHARED UseGL 'declared SUB _GL (no params)


DIM SHARED OS_BITS AS LONG, WindowTitle AS STRING
OS_BITS = 64: IF INSTR(_OS$, "[32BIT]") THEN OS_BITS = 32

IF OS_BITS = 32 THEN WindowTitle = "QB64 Phoenix Edition (x32)" ELSE WindowTitle = "QB64 Phoenix Edition (x64)"
_TITLE WindowTitle

DIM SHARED ConsoleMode, No_C_Compile_Mode, NoIDEMode
DIM SHARED ShowWarnings AS _BYTE, QuietMode AS _BYTE, CMDLineFile AS STRING
DIM SHARED MonochromeLoggingMode AS _BYTE

TYPE usedVarList
    AS LONG id, linenumber, includeLevel, includedLine, scope, localIndex
    AS LONG arrayElementSize
    AS _BYTE used, watch, isarray, displayFormat 'displayFormat: 0=DEC;1=HEX;2=BIN;3=OCT
    AS STRING name, cname, varType, includedFile, subfunc
    AS STRING watchRange, indexes, elements, elementTypes 'for Arrays and UDTs
    AS STRING elementOffset, storage
END TYPE

REDIM SHARED backupUsedVariableList(1000) AS usedVarList
DIM SHARED typeDefinitions$, backupTypeDefinitions$
DIM SHARED totalVariablesCreated AS LONG, totalMainVariablesCreated AS LONG
DIM SHARED bypassNextVariable AS _BYTE
DIM SHARED totalWarnings AS LONG, warningListItems AS LONG, lastWarningHeader AS STRING
DIM SHARED duplicateConstWarning AS _BYTE, warningsissued AS _BYTE
DIM SHARED emptySCWarning AS _BYTE, maxLineNumber AS LONG
DIM SHARED ExeIconSet AS LONG, qb64prefix$, qb64prefix_set
DIM SHARED VersionInfoSet AS _BYTE

'Variables to handle $VERSIONINFO metacommand:
DIM SHARED viFileVersionNum$, viProductVersionNum$, viCompanyName$
DIM SHARED viFileDescription$, viFileVersion$, viInternalName$
DIM SHARED viLegalCopyright$, viLegalTrademarks$, viOriginalFilename$
DIM SHARED viProductName$, viProductVersion$, viComments$, viWeb$

DIM SHARED NoChecks

DIM SHARED Console
DIM SHARED ScreenHide
DIM SHARED Asserts
DIM SHARED OptMax AS LONG
OptMax = 256
REDIM SHARED Opt(1 TO OptMax, 1 TO 10) AS STRING * 256
'   (1,1)="READ"
'   (1,2)="WRITE"
'   (1,3)="READ WRITE"
REDIM SHARED OptWords(1 TO OptMax, 1 TO 10) AS INTEGER 'The number of words of each opt () element
'   (1,1)=1 '"READ"
'   (1,2)=1 '"WRITE"
'   (1,3)=2 '"READ WRITE"
REDIM SHARED T(1 TO OptMax) AS INTEGER 'The type of the entry
'   t is 0 for ? opts
'   ---------- 0 means ? , 1+ means a symbol or {}block ----------
'   t is 1 for symbol opts
'   t is the number of rhs opt () index enteries for {READ¦WRITE¦READ WRITE} like opts
REDIM SHARED Lev(1 TO OptMax) AS INTEGER 'The indwelling level of each opt () element (the lowest is 0)
REDIM SHARED EntryLev(1 TO OptMax) AS INTEGER 'The level required from which this opt () can be validly be entered/checked-for
REDIM SHARED DitchLev(1 TO OptMax) AS INTEGER 'The lowest level recorded between the previous Opt and this Opt
REDIM SHARED DontPass(1 TO OptMax) AS INTEGER 'Set to 1 or 0, with 1 meaning don't pass
'Determines whether the opt () entry needs to actually be passed to the C++ sub/function
REDIM SHARED TempList(1 TO OptMax) AS INTEGER
REDIM SHARED PassRule(1 TO OptMax) AS LONG
'0 means no pass rule
'negative values refer to an opt () element
'positive values refer to a flag value
REDIM SHARED LevelEntered(OptMax) 'up to 64 levels supported
REDIM SHARED separgs(OptMax + 1) AS STRING
REDIM SHARED separgslayout(OptMax + 1) AS STRING
REDIM SHARED separgs2(OptMax + 1) AS STRING
REDIM SHARED separgslayout2(OptMax + 1) AS STRING





DIM SHARED E










DIM SHARED ResolveStaticFunctions
REDIM SHARED ResolveStaticFunction_File(1 TO 100) AS STRING
REDIM SHARED ResolveStaticFunction_Name(1 TO 100) AS STRING
REDIM SHARED ResolveStaticFunction_Method(1 TO 100) AS LONG





DIM SHARED Error_Happened AS LONG
DIM SHARED Error_Message AS STRING

DIM SHARED os AS STRING
os$ = "WIN"
IF INSTR(_OS$, "[LINUX]") THEN os$ = "LNX"

DIM SHARED MacOSX AS LONG
IF INSTR(_OS$, "[MACOSX]") THEN MacOSX = 1

DIM SHARED inline_DATA
IF MacOSX THEN inline_DATA = 1

DIM SHARED BATCHFILE_EXTENSION AS STRING
BATCHFILE_EXTENSION = ".bat"
IF os$ = "LNX" THEN BATCHFILE_EXTENSION = ".sh"
IF MacOSX THEN BATCHFILE_EXTENSION = ".command"


DIM inlinedatastr(255) AS STRING
FOR i = 0 TO 255
    inlinedatastr(i) = str2$(i) + ","
NEXT


DIM SHARED extension AS STRING
DIM SHARED path.exe$, path.source$, lastBinaryGenerated$
extension$ = ".exe"
IF os$ = "LNX" THEN extension$ = "" 'no extension under Linux

DIM SHARED pathsep AS STRING * 1
pathsep$ = "\"
IF os$ = "LNX" THEN pathsep$ = "/"
'note: QB64 handles OS specific path separators automatically except under SHELL calls

ON ERROR GOTO qberror_test

DIM SHARED tmpdir AS STRING, tmpdir2 AS STRING
IF os$ = "WIN" THEN tmpdir$ = ".\internal\temp\": tmpdir2$ = "..\\temp\\"
IF os$ = "LNX" THEN tmpdir$ = "./internal/temp/": tmpdir2$ = "../temp/"

IF NOT _DIREXISTS(tmpdir$) THEN MKDIR tmpdir$

DECLARE LIBRARY
    FUNCTION getpid& ()
END DECLARE

thisinstancepid = getpid&
DIM SHARED tempfolderindex

IF INSTR(_OS$, "LINUX") THEN
    fh = FREEFILE
    OPEN ".\internal\temp\tempfoldersearch.bin" FOR RANDOM AS #fh LEN = LEN(tempfolderindex)
    tempfolderrecords = LOF(fh) / LEN(tempfolderindex)
    i = 1
    IF tempfolderrecords = 0 THEN
        'first run ever?
        PUT #fh, 1, thisinstancepid
    ELSE
        FOR i = 1 TO tempfolderrecords
            'check if any of the temp folders is being used = pid still active
            GET #fh, i, tempfoldersearch

            SHELL _HIDE "ps -p " + STR$(tempfoldersearch) + " > /dev/null 2>&1; echo $? > internal/temp/checkpid.bin"
            fh2 = FREEFILE
            OPEN "internal/temp/checkpid.bin" FOR BINARY AS #fh2
            LINE INPUT #fh2, checkpid$
            CLOSE #fh2
            IF VAL(checkpid$) = 1 THEN
                'This temp folder was locked by an instance that's no longer active, so
                'this will be our temp folder
                PUT #fh, i, thisinstancepid
                EXIT FOR
            END IF
        NEXT
        IF i > tempfolderrecords THEN
            'All indexes were busy. Let's initiate a new one:
            PUT #fh, i, thisinstancepid
        END IF
    END IF
    CLOSE #fh
    IF i > 1 THEN
        tmpdir$ = "./internal/temp" + str2$(i) + "/": tmpdir2$ = "../temp" + str2$(i) + "/"
        IF _DIREXISTS(tmpdir$) = 0 THEN
            MKDIR tmpdir$
        END IF
    END IF
    OPEN tmpdir$ + "temp.bin" FOR OUTPUT LOCK WRITE AS #26
ELSE
    ON ERROR GOTO qberror_test
    E = 0
    i = 1
    OPEN tmpdir$ + "temp.bin" FOR OUTPUT LOCK WRITE AS #26
    DO WHILE E
        i = i + 1
        IF i = 1000 THEN PRINT "Unable to locate the 'internal' folder": END 1
        MKDIR ".\internal\temp" + str2$(i)
        IF os$ = "WIN" THEN tmpdir$ = ".\internal\temp" + str2$(i) + "\": tmpdir2$ = "..\\temp" + str2$(i) + "\\"
        IF os$ = "LNX" THEN tmpdir$ = "./internal/temp" + str2$(i) + "/": tmpdir2$ = "../temp" + str2$(i) + "/"
        E = 0
        OPEN tmpdir$ + "temp.bin" FOR OUTPUT LOCK WRITE AS #26
    LOOP
END IF


'temp folder established
tempfolderindex = i
IF i > 1 THEN
    'create modified version of qbx.cpp
    OPEN ".\internal\c\qbx" + str2$(i) + ".cpp" FOR OUTPUT AS #2
    OPEN ".\internal\c\qbx.cpp" FOR BINARY AS #1
    DO UNTIL EOF(1)
        LINE INPUT #1, a$
        x = INSTR(a$, "..\\temp\\"): IF x THEN a$ = LEFT$(a$, x - 1) + "..\\temp" + str2$(i) + "\\" + RIGHT$(a$, LEN(a$) - (x + 9))
        x = INSTR(a$, "../temp/"): IF x THEN a$ = LEFT$(a$, x - 1) + "../temp" + str2$(i) + "/" + RIGHT$(a$, LEN(a$) - (x + 7))
        PRINT #2, a$
    LOOP
    CLOSE #1, #2
END IF

IF Debug THEN OPEN tmpdir$ + "debug.txt" FOR OUTPUT AS #9

ON ERROR GOTO qberror



DIM SHARED tempfolderindexstr AS STRING 'appended to "Untitled"
DIM SHARED tempfolderindexstr2 AS STRING
IF tempfolderindex <> 1 THEN tempfolderindexstr$ = "(" + str2$(tempfolderindex) + ")": tempfolderindexstr2$ = str2$(tempfolderindex)


DIM SHARED idedebuginfo
DIM SHARED seperateargs_error
DIM SHARED seperateargs_error_message AS STRING

DIM SHARED compfailed

DIM SHARED reginternalsubfunc
DIM SHARED reginternalvariable


DIM SHARED symboltype_size
symboltype_size = 0

DIM SHARED use_global_byte_elements
use_global_byte_elements = 0

'compiler-side IDE data & definitions
'SHARED variables "passed" to/from the compiler & IDE
DIM SHARED idecommand AS STRING 'a 1 byte message-type code, followed by optional string data
DIM SHARED idereturn AS STRING 'used to pass formatted-lines and return information back to the IDE
DIM SHARED ideerror AS LONG
DIM SHARED idecompiled AS LONG
DIM SHARED idemode '1 if using the IDE to compile
DIM SHARED ideerrorline AS LONG 'set by qb64-error(...) to the line number it would have reported, this number
'is later passed to the ide in message #8
DIM SHARED idemessage AS STRING 'set by qb64-error(...) to the error message to be reported, this
'is later passed to the ide in message #8

DIM SHARED optionexplicit AS _BYTE
DIM SHARED optionexplicitarray AS _BYTE
DIM SHARED optionexplicit_cmd AS _BYTE
DIM SHARED ideStartAtLine AS LONG, errorLineInInclude AS LONG
DIM SHARED warningInInclude AS LONG, warningInIncludeLine AS LONG
DIM SHARED outputfile_cmd$
DIM SHARED compilelog$

'$INCLUDE:'global\IDEsettings.bas'

DIM OutputIsRelativeToStartDir AS LONG

CMDLineFile = ParseCMDLineArgs$
IF CMDLineFile <> "" AND _FILEEXISTS(_STARTDIR$ + "/" + CMDLineFile) THEN
    CMDLineFile = _STARTDIR$ + "/" + CMDLineFile
    OutputIsRelativeToStartDir = -1
END IF

IF ConsoleMode THEN
    _DEST _CONSOLE
ELSE
    _CONSOLE OFF
    _SCREENSHOW
    _ICON
END IF

'the function ?=ide(?) should always be passed 0, it returns a message code number, any further information
'is passed back in idereturn

'message code numbers:
'0  no ide present  (auto defined array ide() return 0)

'1  launch ide & with passed filename (compiler->ide)

'2  begin new compilation with returned line of code (compiler<-ide)
'   [2][line of code]

'3  request next line (compiler->ide)
'   [3]

'4  next line of code returned (compiler<-ide)
'   [4][line of code]

'5  no more lines of code exist (compiler<-ide)
'   [5]

'6  code is OK/ready (compiler->ide)
'   [6]

'7  repass the code from the beginning (compiler->ide)
'   [7]

'8  an error has occurred with 'this' message on 'this' line(compiler->ide)
'   [8][error message][line as LONG]

'9  C++ compile (if necessary) and run with 'this' name (compiler<-ide)
'   [9][name(no path, no .bas)]

'10 The line requires more time to process
'       Pass-back 'line of code' using method [4] when ready
'   [10][line of code]

'11 ".EXE file created" message

'12     The name of the exe I'll create is '...' (compiler->ide)
'   [12][exe name without .exe]

'255    A qb error happened in the IDE (compiler->ide)
'   note: detected by the fact that ideerror was not set to 0
'   [255]

'hash table data
TYPE HashListItem
    Flags AS LONG
    Reference AS LONG
    NextItem AS LONG
    PrevItem AS LONG
    LastItem AS LONG 'note: this value is only valid on the first item in the list
    'note: name is stored in a seperate array of strings
END TYPE
DIM SHARED HashFind_NextListItem AS LONG
DIM SHARED HashFind_Reverse AS LONG
DIM SHARED HashFind_SearchFlags AS LONG
DIM SHARED HashFind_Name AS STRING
DIM SHARED HashRemove_LastFound AS LONG
DIM SHARED HashListSize AS LONG
DIM SHARED HashListNext AS LONG
DIM SHARED HashListFreeSize AS LONG
DIM SHARED HashListFreeLast AS LONG
'hash lookup tables
DIM SHARED hash1char(255) AS INTEGER
DIM SHARED hash2char(65535) AS INTEGER
FOR x = 1 TO 26
    hash1char(64 + x) = x
    hash1char(96 + x) = x
NEXT
hash1char(95) = 27 '_
hash1char(48) = 28 '0
hash1char(49) = 29 '1
hash1char(50) = 30 '2
hash1char(51) = 31 '3
hash1char(52) = 23 '4 'note: x, y, z and beginning alphabet letters avoided because of common usage (eg. a2, y3)
hash1char(53) = 22 '5
hash1char(54) = 20 '6
hash1char(55) = 19 '7
hash1char(56) = 18 '8
hash1char(57) = 17 '9
FOR c1 = 0 TO 255
    FOR c2 = 0 TO 255
        hash2char(c1 + c2 * 256) = hash1char(c1) + hash1char(c2) * 32
    NEXT
NEXT
'init
HashListSize = 65536
HashListNext = 1
HashListFreeSize = 1024
HashListFreeLast = 0
REDIM SHARED HashList(1 TO HashListSize) AS HashListItem
REDIM SHARED HashListName(1 TO HashListSize) AS STRING * 256
REDIM SHARED HashListFree(1 TO HashListFreeSize) AS LONG
REDIM SHARED HashTable(16777215) AS LONG '64MB lookup table with indexes to the hashlist

CONST HASHFLAG_LABEL = 2
CONST HASHFLAG_TYPE = 4
CONST HASHFLAG_RESERVED = 8
CONST HASHFLAG_OPERATOR = 16
CONST HASHFLAG_CUSTOMSYNTAX = 32
CONST HASHFLAG_SUB = 64
CONST HASHFLAG_FUNCTION = 128
CONST HASHFLAG_UDT = 256
CONST HASHFLAG_UDTELEMENT = 512
CONST HASHFLAG_CONSTANT = 1024
CONST HASHFLAG_VARIABLE = 2048
CONST HASHFLAG_ARRAY = 4096
CONST HASHFLAG_XELEMENTNAME = 8192
CONST HASHFLAG_XTYPENAME = 16384

TYPE Label_Type
    State AS _UNSIGNED _BYTE '0=label referenced, 1=label created
    cn AS STRING * 256
    Scope AS LONG
    Data_Offset AS _INTEGER64 'offset within data
    Data_Referenced AS _UNSIGNED _BYTE 'set to 1 if data is referenced (data_offset will be used to create the data offset variable)
    Error_Line AS LONG 'the line number to reference on errors
    Scope_Restriction AS LONG 'cannot exist inside this scope (post checked)
    SourceLineNumber AS LONG
END TYPE
DIM SHARED nLabels, Labels_Ubound
Labels_Ubound = 100
REDIM SHARED Labels(1 TO Labels_Ubound) AS Label_Type
DIM SHARED Empty_Label AS Label_Type

DIM SHARED PossibleSubNameLabels AS STRING 'format: name+sp+name+sp+name <-ucase$'d
DIM SHARED SubNameLabels AS STRING 'format: name+sp+name+sp+name <-ucase$'d
DIM SHARED CreatingLabel AS LONG

DIM SHARED AllowLocalName AS LONG

DIM SHARED DataOffset

DIM SHARED prepass


DIM SHARED autoarray

DIM SHARED ontimerid, onkeyid, onstrigid

DIM SHARED revertmaymusthave(1 TO 10000)
DIM SHARED revertmaymusthaven

DIM SHARED linecontinuation

DIM SHARED dim2typepassback AS STRING 'passes back correct case sensitive version of type


DIM SHARED inclevel
DIM SHARED incname(100) AS STRING 'must be full path as given
DIM SHARED inclinenumber(100) AS LONG
DIM SHARED incerror AS STRING


DIM SHARED fix046 AS STRING
fix046$ = "__" + "ASCII" + "_" + "CHR" + "_" + "046" + "__" 'broken up to avoid detection for layout reversion

DIM SHARED layout AS STRING 'passed to IDE
DIM SHARED layoutok AS LONG 'tracks status of entire line

DIM SHARED layoutcomment AS STRING

DIM SHARED tlayout AS STRING 'temporary layout string set by supporting functions
DIM SHARED layoutdone AS LONG 'tracks status of single command


DIM SHARED fooindwel

DIM SHARED alphanumeric(255)
FOR i = 48 TO 57
    alphanumeric(i) = -1
NEXT
FOR i = 65 TO 90
    alphanumeric(i) = -1
NEXT
FOR i = 97 TO 122
    alphanumeric(i) = -1
NEXT
'_ is treated as an alphabet letter
alphanumeric(95) = -1

DIM SHARED isalpha(255)
FOR i = 65 TO 90
    isalpha(i) = -1
NEXT
FOR i = 97 TO 122
    isalpha(i) = -1
NEXT
'_ is treated as an alphabet letter
isalpha(95) = -1

DIM SHARED isnumeric(255)
FOR i = 48 TO 57
    isnumeric(i) = -1
NEXT


DIM SHARED lfsinglechar(255)
lfsinglechar(40) = 1 '(
lfsinglechar(41) = 1 ')
lfsinglechar(42) = 1 '*
lfsinglechar(43) = 1 '+
lfsinglechar(45) = 1 '-
lfsinglechar(47) = 1 '/
lfsinglechar(60) = 1 '<
lfsinglechar(61) = 1 '=
lfsinglechar(62) = 1 '>
lfsinglechar(92) = 1 '\
lfsinglechar(94) = 1 '^

lfsinglechar(44) = 1 ',
lfsinglechar(46) = 1 '.
lfsinglechar(58) = 1 ':
lfsinglechar(59) = 1 ';

lfsinglechar(35) = 1 '# (file no only)
lfsinglechar(36) = 1 '$ (metacommand only)
lfsinglechar(63) = 1 '? (print macro)
lfsinglechar(95) = 1 '_










DIM SHARED nextrunlineindex AS LONG

DIM SHARED lineinput3buffer AS STRING
DIM SHARED lineinput3index AS LONG

DIM SHARED dimstatic AS LONG

DIM SHARED staticarraylist AS STRING
DIM SHARED staticarraylistn AS LONG
DIM SHARED commonarraylist AS STRING
DIM SHARED commonarraylistn AS LONG

'CONST support
DIM SHARED constmax AS LONG
constmax = 100
DIM SHARED constlast AS LONG
constlast = -1
REDIM SHARED constname(constmax) AS STRING
REDIM SHARED constcname(constmax) AS STRING
REDIM SHARED constnamesymbol(constmax) AS STRING 'optional name symbol
' `1 and `no-number must be handled correctly
'DIM SHARED constlastshared AS LONG 'so any defined inside a sub/function after this index can be "forgotten" when sub/function exits
'constlastshared = -1
REDIM SHARED consttype(constmax) AS LONG 'variable type number
'consttype determines storage
REDIM SHARED constinteger(constmax) AS _INTEGER64
REDIM SHARED constuinteger(constmax) AS _UNSIGNED _INTEGER64
REDIM SHARED constfloat(constmax) AS _FLOAT
REDIM SHARED conststring(constmax) AS STRING
REDIM SHARED constsubfunc(constmax) AS LONG
REDIM SHARED constdefined(constmax) AS LONG

'UDT
'names
DIM SHARED lasttype AS LONG
DIM SHARED lasttypeelement AS LONG

TYPE idstruct

    n AS STRING * 256 'name
    cn AS STRING * 256 'case sensitive version of n

    arraytype AS LONG 'similar to t
    arrayelements AS INTEGER
    staticarray AS INTEGER 'set for arrays declared in the main module with static elements

    mayhave AS STRING * 8 'mayhave and musthave are exclusive of each other
    musthave AS STRING * 8
    t AS LONG 'type

    tsize AS LONG


    subfunc AS INTEGER 'if function=1, sub=2 (max 100 arguments)
    Dependency AS INTEGER
    internal_subfunc AS INTEGER

    callname AS STRING * 256
    ccall AS INTEGER
    overloaded AS _BYTE
    args AS INTEGER
    minargs AS INTEGER
    arg AS STRING * 400 'similar to t
    argsize AS STRING * 400 'similar to tsize (used for fixed length strings)
    specialformat AS STRING * 256
    secondargmustbe AS STRING * 256
    secondargcantbe AS STRING * 256
    ret AS LONG 'the value it returns if it is a function (again like t)

    insubfunc AS STRING * 256
    insubfuncn AS LONG

    share AS INTEGER
    nele AS STRING * 100
    nelereq AS STRING * 100
    linkid AS LONG
    linkarg AS INTEGER
    staticscope AS INTEGER
    'For variables which are arguments passed to a sub/function
    sfid AS LONG 'id number of variable's parent sub/function
    sfarg AS INTEGER 'argument/parameter # within call (1=first)

    hr_syntax AS STRING
END TYPE

DIM SHARED id AS idstruct

DIM SHARED idn AS LONG
DIM SHARED ids_max AS LONG
ids_max = 1024
REDIM SHARED ids(1 TO ids_max) AS idstruct
REDIM SHARED cmemlist(1 TO ids_max + 1) AS INTEGER 'variables that must be in cmem
REDIM SHARED sfcmemargs(1 TO ids_max + 1) AS STRING * 100 's/f arg that must be in cmem
REDIM SHARED arrayelementslist(1 TO ids_max + 1) AS INTEGER 'arrayelementslist (like cmemlist) helps to resolve the number of elements in arrays with an unknown number of elements. Note: arrays with an unknown number of elements have .arrayelements=-1


'create blank id template for idclear to copy (stops strings being set to chr$(0))
DIM SHARED cleariddata AS idstruct
cleariddata.cn = ""
cleariddata.n = ""
cleariddata.mayhave = ""
cleariddata.musthave = ""
cleariddata.callname = ""
cleariddata.arg = ""
cleariddata.argsize = ""
cleariddata.specialformat = ""
cleariddata.secondargmustbe = ""
cleariddata.secondargcantbe = ""
cleariddata.insubfunc = ""
cleariddata.nele = ""
cleariddata.nelereq = ""

DIM SHARED ISSTRING AS LONG
DIM SHARED ISFLOAT AS LONG
DIM SHARED ISUNSIGNED AS LONG
DIM SHARED ISPOINTER AS LONG
DIM SHARED ISFIXEDLENGTH AS LONG
DIM SHARED ISINCONVENTIONALMEMORY AS LONG
DIM SHARED ISOFFSETINBITS AS LONG
DIM SHARED ISARRAY AS LONG
DIM SHARED ISREFERENCE AS LONG
DIM SHARED ISUDT AS LONG
DIM SHARED ISOFFSET AS LONG

DIM SHARED STRINGTYPE AS LONG
DIM SHARED BITTYPE AS LONG
DIM SHARED UBITTYPE AS LONG
DIM SHARED BYTETYPE AS LONG
DIM SHARED UBYTETYPE AS LONG
DIM SHARED INTEGERTYPE AS LONG
DIM SHARED UINTEGERTYPE AS LONG
DIM SHARED LONGTYPE AS LONG
DIM SHARED ULONGTYPE AS LONG
DIM SHARED INTEGER64TYPE AS LONG
DIM SHARED UINTEGER64TYPE AS LONG
DIM SHARED SINGLETYPE AS LONG
DIM SHARED DOUBLETYPE AS LONG
DIM SHARED FLOATTYPE AS LONG
DIM SHARED OFFSETTYPE AS LONG
DIM SHARED UOFFSETTYPE AS LONG
DIM SHARED UDTTYPE AS LONG

DIM SHARED gosubid AS LONG
DIM SHARED redimoption AS INTEGER
DIM SHARED dimoption AS INTEGER
DIM SHARED arraydesc AS INTEGER
DIM SHARED qberrorhappened AS INTEGER
DIM SHARED qberrorcode AS INTEGER
DIM SHARED qberrorline AS INTEGER
'COMMON SHARED defineaz() AS STRING
'COMMON SHARED defineextaz() AS STRING

DIM SHARED sourcefile AS STRING 'the full path and filename
DIM SHARED file AS STRING 'name of the file (without .bas or path)

'COMMON SHARED separgs() AS STRING

DIM SHARED constequation AS INTEGER
DIM SHARED DynamicMode AS INTEGER
DIM SHARED findidsecondarg AS STRING
DIM SHARED findanotherid AS INTEGER
DIM SHARED findidinternal AS LONG
DIM SHARED currentid AS LONG 'is the index of the last ID accessed
DIM SHARED linenumber AS LONG, reallinenumber AS LONG, totallinenumber AS LONG, definingtypeerror AS LONG
DIM SHARED wholeline AS STRING
DIM SHARED firstLineNumberLabelvWatch AS LONG, lastLineNumberLabelvWatch AS LONG
DIM SHARED vWatchUsedLabels AS STRING, vWatchUsedSkipLabels AS STRING
DIM SHARED linefragment AS STRING
'COMMON SHARED bitmask() AS _INTEGER64
'COMMON SHARED bitmaskinv() AS _INTEGER64

DIM SHARED arrayprocessinghappened AS INTEGER
DIM SHARED stringprocessinghappened AS INTEGER
DIM SHARED cleanupstringprocessingcall AS STRING
DIM SHARED inputfunctioncalled AS _BYTE
DIM SHARED recompile AS INTEGER 'forces recompilation
'COMMON SHARED cmemlist() AS INTEGER
DIM SHARED optionbase AS INTEGER

DIM SHARED addmetastatic AS INTEGER
DIM SHARED addmetadynamic AS INTEGER
DIM SHARED addmetainclude AS STRING

DIM SHARED closedmain AS INTEGER
DIM SHARED module AS STRING

DIM SHARED subfunc AS STRING
DIM SHARED subfuncn AS LONG
DIM SHARED closedsubfunc AS _BYTE
DIM SHARED subfuncid AS LONG

DIM SHARED defdatahandle AS INTEGER
DIM SHARED dimsfarray AS INTEGER
DIM SHARED dimshared AS INTEGER

'Allows passing of known elements to recompilation
DIM SHARED sflistn AS INTEGER
'COMMON SHARED sfidlist() AS LONG
'COMMON SHARED sfarglist() AS INTEGER
'COMMON SHARED sfelelist() AS INTEGER
DIM SHARED glinkid AS LONG
DIM SHARED glinkarg AS INTEGER
DIM SHARED typname2typsize AS LONG
DIM SHARED uniquenumbern AS LONG

'CLEAR , , 16384


DIM SHARED bitmask(1 TO 64) AS _INTEGER64
DIM SHARED bitmaskinv(1 TO 64) AS _INTEGER64

DIM SHARED defineextaz(1 TO 27) AS STRING
DIM SHARED defineaz(1 TO 27) AS STRING '27 is an underscore

ISSTRING = 1073741824
ISFLOAT = 536870912
ISUNSIGNED = 268435456
ISPOINTER = 134217728
ISFIXEDLENGTH = 67108864 'only set for strings with pointer flag
ISINCONVENTIONALMEMORY = 33554432
ISOFFSETINBITS = 16777216
ISARRAY = 8388608
ISREFERENCE = 4194304
ISUDT = 2097152
ISOFFSET = 1048576

STRINGTYPE = ISSTRING + ISPOINTER
BITTYPE = 1& + ISPOINTER + ISOFFSETINBITS
UBITTYPE = 1& + ISPOINTER + ISUNSIGNED + ISOFFSETINBITS 'QB64 will also support BIT*n, eg. DIM bitarray[10] AS _UNSIGNED _BIT*10
BYTETYPE = 8& + ISPOINTER
UBYTETYPE = 8& + ISPOINTER + ISUNSIGNED
INTEGERTYPE = 16& + ISPOINTER
UINTEGERTYPE = 16& + ISPOINTER + ISUNSIGNED
LONGTYPE = 32& + ISPOINTER
ULONGTYPE = 32& + ISPOINTER + ISUNSIGNED
INTEGER64TYPE = 64& + ISPOINTER
UINTEGER64TYPE = 64& + ISPOINTER + ISUNSIGNED
SINGLETYPE = 32& + ISFLOAT + ISPOINTER
DOUBLETYPE = 64& + ISFLOAT + ISPOINTER
FLOATTYPE = 256& + ISFLOAT + ISPOINTER '8-32 bytes
OFFSETTYPE = 64& + ISOFFSET + ISPOINTER: IF OS_BITS = 32 THEN OFFSETTYPE = 32& + ISOFFSET + ISPOINTER
UOFFSETTYPE = 64& + ISOFFSET + ISUNSIGNED + ISPOINTER: IF OS_BITS = 32 THEN UOFFSETTYPE = 32& + ISOFFSET + ISUNSIGNED + ISPOINTER
UDTTYPE = ISUDT + ISPOINTER






DIM SHARED statementn AS LONG
DIM SHARED everycasenewcase AS LONG




DIM SHARED controllevel AS INTEGER '0=not in a control block
DIM SHARED controltype(1000) AS INTEGER
'1=IF (awaiting END IF)
'2=FOR (awaiting NEXT)
'3=DO (awaiting LOOP [UNTIL¦WHILE param])
'4=DO WHILE/UNTIL (awaiting LOOP)
'5=WHILE (awaiting WEND)
'6=$IF (precompiler)
'10=SELECT CASE qbs (awaiting END SELECT/CASE)
'11=SELECT CASE int64 (awaiting END SELECT/CASE)
'12=SELECT CASE uint64 (awaiting END SELECT/CASE)
'13=SELECT CASE LONG double (awaiting END SELECT/CASE/CASE ELSE)
'14=SELECT CASE float ...
'15=SELECT CASE double
'16=SELECT CASE int32
'17=SELECT CASE uint32
'18=CASE (awaiting END SELECT/CASE/CASE ELSE)
'19=CASE ELSE (awaiting END SELECT)
'32=SUB/FUNCTION (awaiting END SUB/FUNCTION)
DIM controlid(1000) AS LONG
DIM controlvalue(1000) AS LONG
DIM controlstate(1000) AS INTEGER
DIM SHARED controlref(1000) AS LONG 'the line number the control was created on

'
' Collection of flags indicating which unstable features should be used during compilation
'
REDIM SHARED unstableFlags(1 TO 2) AS _BYTE
DIM UNSTABLE_MIDI AS LONG
DIM UNSTABLE_HTTP AS LONG

UNSTABLE_MIDI = 1
UNSTABLE_HTTP = 2




ON ERROR GOTO qberror

i2&& = 1
FOR i&& = 1 TO 64
    bitmask(i&&) = i2&&
    bitmaskinv(i&&) = NOT i2&&
    i2&& = i2&& + 2 ^ i&&
NEXT

DIM id2 AS idstruct

cleanupstringprocessingcall$ = "qbs_cleanup(qbs_tmp_base,"

DIM SHARED sfidlist(1000) AS LONG
DIM SHARED sfarglist(1000) AS INTEGER
DIM SHARED sfelelist(1000) AS INTEGER















'----------------ripgl.bas--------------------------------------------------------------------------------
gl_scan_header
'----------------ripgl.bas--------------------------------------------------------------------------------







'-----------------------QB64 COMPILER ONCE ONLY SETUP CODE ENDS HERE---------------------------------------

IF NoIDEMode THEN IDE_AutoPosition = 0: GOTO noide
DIM FileDropEnabled AS _BYTE
IF FileDropEnabled = 0 THEN FileDropEnabled = -1: _ACCEPTFILEDROP

IF IDE_AutoPosition AND NOT IDE_BypassAutoPosition THEN _SCREENMOVE IDE_LeftPosition, IDE_TopPosition
idemode = 1
sendc$ = "" 'no initial message
IF CMDLineFile <> "" THEN sendc$ = CHR$(1) + CMDLineFile
sendcommand:
idecommand$ = sendc$
C = ide(0)
ideerror = 0
IF C = 0 THEN idemode = 0: GOTO noide
c$ = idereturn$

IF C = 2 THEN 'begin
    ideerrorline = 0 'addresses invalid prepass error line numbers being reported
    idepass = 1
    GOTO fullrecompile
    ideret1:
    wholeline$ = c$
    GOTO ideprepass
    ideret2:
    IF lastLineReturn THEN GOTO lastLineReturn
    sendc$ = CHR$(3) 'request next line
    GOTO sendcommand
END IF

IF C = 4 THEN 'next line
    IF idepass = 1 THEN
        wholeline$ = c$
        GOTO ideprepass
        '(returns to ideret2: above)
    END IF
    'assume idepass>1
    a3$ = c$
    continuelinefrom = 0
    GOTO ide4
    ideret4:
    IF lastLineReturn THEN GOTO lastLineReturn
    sendc$ = CHR$(3) 'request next line
    GOTO sendcommand
END IF

IF C = 5 THEN 'end of program reached

    lastLine = 1
    lastLineReturn = 1
    IF idepass = 1 THEN
        wholeline$ = ""
        GOTO ideprepass
        '(returns to ideret2: above, then to lastLinePrepassReturn below)
    END IF
    'idepass>1
    a3$ = ""
    continuelinefrom = 0
    GOTO ide4 'returns to ideret4, then to lastLinePrepassReturn below
    lastLineReturn:
    lastLineReturn = 0
    lastLine = 0

    IF idepass = 1 THEN
        'prepass complete
        idepass = 2
        GOTO ide3
        ideret3:
        sendc$ = CHR$(7) 'repass request
        firstLine = 1
        GOTO sendcommand
    END IF
    'assume idepass=2
    'finalize program
    GOTO ide5
    ideret5: 'note: won't return here if a recompile was required!
    sendc$ = CHR$(6) 'ready
    idecompiled = 0
    GOTO sendcommand
END IF

IF C = 9 THEN 'run

    IF idecompiled = 0 THEN 'exe needs to be compiled
        file$ = c$

        'locate accessible file and truncate
        f$ = file$

        path.exe$ = ""
        IF SaveExeWithSource THEN
            IF LEN(ideprogname) THEN path.exe$ = idepath$ + pathsep$
        END IF

        i = 1
        nextexeindex:
        IF _FILEEXISTS(path.exe$ + file$ + extension$) THEN
            E = 0
            ON ERROR GOTO qberror_test
            KILL path.exe$ + file$ + extension$
            ON ERROR GOTO qberror
            IF E = 1 THEN
                i = i + 1
                file$ = f$ + "(" + str2$(i) + ")"
                GOTO nextexeindex
            END IF
        END IF

        'inform IDE of name change if necessary (IDE will respond with message 9 and corrected name)
        IF i <> 1 THEN
            sendc$ = CHR$(12) + file$
            GOTO sendcommand
        END IF

        ideerrorline = 0 'addresses C++ comp. error's line number
        GOTO ide6
        ideret6:
        idecompiled = 1
    END IF

    IF iderunmode = 2 THEN
        sendc$ = CHR$(11) '.EXE file created
        GOTO sendcommand
    END IF

    'execute program




    IF iderunmode = 1 THEN
        IF NoExeSaved THEN
            'This is the section which deals with if the user selected to run the program without
            'saving an EXE file to the disk.
            'We start off by first running the EXE, and then we delete it from the drive.
            'making it a temporary file when all is said and done.
            IF os$ = "WIN" THEN
                SHELL QuotedFilename$(CHR$(34) + lastBinaryGenerated$ + CHR$(34)) + ModifyCOMMAND$ 'run the newly created program
                SHELL _HIDE _DONTWAIT "del " + QuotedFilename$(CHR$(34) + lastBinaryGenerated$ + CHR$(34)) 'kill it
            END IF
            IF path.exe$ = "" THEN path.exe$ = "./"
            IF os$ = "LNX" THEN
                IF LEFT$(lastBinaryGenerated$, LEN(path.exe$)) = path.exe$ THEN
                    SHELL QuotedFilename$(lastBinaryGenerated$) + ModifyCOMMAND$
                    KILL lastBinaryGenerated$
                ELSE
                    SHELL QuotedFilename$(path.exe$ + lastBinaryGenerated$) + ModifyCOMMAND$
                    KILL path.exe$ + lastBinaryGenerated$
                END IF
            END IF
            IF path.exe$ = "./" THEN path.exe$ = ""
            NoExeSaved = 0 'reset the flag for a temp EXE
            sendc$ = CHR$(6) 'ready
            GOTO sendcommand
        END IF



        IF os$ = "WIN" THEN SHELL _DONTWAIT QuotedFilename$(CHR$(34) + lastBinaryGenerated$ + CHR$(34)) + ModifyCOMMAND$
        IF path.exe$ = "" THEN path.exe$ = "./"
        IF os$ = "LNX" THEN
            IF LEFT$(lastBinaryGenerated$, LEN(path.exe$)) = path.exe$ THEN
                SHELL _DONTWAIT QuotedFilename$(lastBinaryGenerated$) + ModifyCOMMAND$
            ELSE
                SHELL _DONTWAIT QuotedFilename$(path.exe$ + lastBinaryGenerated$) + ModifyCOMMAND$
            END IF
        END IF
        IF path.exe$ = "./" THEN path.exe$ = ""
    ELSE
        IF os$ = "WIN" THEN SHELL QuotedFilename$(CHR$(34) + lastBinaryGenerated$ + CHR$(34)) + ModifyCOMMAND$
        IF path.exe$ = "" THEN path.exe$ = "./"
        IF os$ = "LNX" THEN
            IF LEFT$(lastBinaryGenerated$, LEN(path.exe$)) = path.exe$ THEN
                SHELL QuotedFilename$(lastBinaryGenerated$) + ModifyCOMMAND$
            ELSE
                SHELL QuotedFilename$(path.exe$ + lastBinaryGenerated$) + ModifyCOMMAND$
            END IF
        END IF
        IF path.exe$ = "./" THEN path.exe$ = ""
        DO: LOOP UNTIL INKEY$ = ""
        DO: LOOP UNTIL _KEYHIT = 0
    END IF

    IF idemode THEN
        'Darken fg/bg colors
        dummy = DarkenFGBG(0)
    END IF

    IF vWatchOn THEN
        sendc$ = CHR$(254) 'launch debug interface
    ELSE
        sendc$ = CHR$(6) 'ready
    END IF
    GOTO sendcommand
END IF

PRINT "Invalid IDE message": END

ideerror:
IF INSTR(idemessage$, sp$) THEN
    'Something went wrong here, so let's give a generic error message to the user.
    '(No error message should contain sp$ - that is, CHR$(13), when not in Debug mode)
    terrmsg$ = _ERRORMESSAGE$
    IF terrmsg$ = "No error" THEN terrmsg$ = "Internal error"
    idemessage$ = "Compiler error (check for syntax errors) (" + terrmsg$ + ":"
    IF ERR THEN idemessage$ = idemessage$ + str2$(ERR) + "-"
    IF _ERRORLINE THEN idemessage$ = idemessage$ + str2$(_ERRORLINE)
    IF _INCLERRORLINE THEN idemessage$ = idemessage$ + "-" + _INCLERRORFILE$ + "-" + str2$(_INCLERRORLINE)
    idemessage$ = idemessage$ + ")"
    IF inclevel > 0 THEN idemessage$ = idemessage$ + incerror$
END IF

sendc$ = CHR$(8) + idemessage$ + MKL$(ideerrorline)
GOTO sendcommand


noide:
IF (qb64versionprinted = 0 OR ConsoleMode = 0) AND NOT QuietMode THEN
    qb64versionprinted = -1
    PRINT "QB64-PE Compiler V" + Version$
END IF

IF CMDLineFile = "" THEN
    LINE INPUT ; "COMPILE (.bas)>", f$
ELSE
    f$ = CMDLineFile
END IF

f$ = LTRIM$(RTRIM$(f$))

IF FileHasExtension(f$) = 0 THEN f$ = f$ + ".bas"

sourcefile$ = f$
CMDLineFile = sourcefile$
'derive name from sourcefile
f$ = RemoveFileExtension$(f$)

path.exe$ = ""
currentdir$ = _CWD$
path.source$ = getfilepath$(sourcefile$)
IF LEN(path.source$) THEN
    IF _DIREXISTS(path.source$) = 0 THEN
        PRINT
        PRINT "Cannot locate source file: " + sourcefile$
        IF ConsoleMode THEN SYSTEM 1
        END 1
    END IF
    CHDIR path.source$
    path.source$ = _CWD$
    IF RIGHT$(path.source$, 1) <> pathsep$ THEN path.source$ = path.source$ + pathsep$
    CHDIR currentdir$
END IF
IF SaveExeWithSource THEN path.exe$ = path.source$

FOR x = LEN(f$) TO 1 STEP -1
    a$ = MID$(f$, x, 1)
    IF a$ = "/" OR a$ = "\" THEN
        f$ = RIGHT$(f$, LEN(f$) - x)
        EXIT FOR
    END IF
NEXT
file$ = f$

'if cmemlist(currentid+1)<>0 before calling regid the variable
'MUST be defined in cmem!

fullrecompile:

IF idemode = 0 AND NOT QuietMode THEN
    PRINT
    PRINT "Beginning C++ output from QB64 code... "
END IF

BU_DEPENDENCY_CONSOLE_ONLY = DEPENDENCY(DEPENDENCY_CONSOLE_ONLY)
FOR i = 1 TO UBOUND(DEPENDENCY): DEPENDENCY(i) = 0: NEXT
DEPENDENCY(DEPENDENCY_CONSOLE_ONLY) = BU_DEPENDENCY_CONSOLE_ONLY AND 2 'Restore -g switch if used

Error_Happened = 0

FOR closeall = 1 TO 255: CLOSE closeall: NEXT

OPEN tmpdir$ + "temp.bin" FOR OUTPUT LOCK WRITE AS #26 'relock

bh = OpenBuffer%("O", tmpdir$ + "dyninfo.txt")

IF Debug THEN CLOSE #9: OPEN tmpdir$ + "debug.txt" FOR OUTPUT AS #9

FOR i = 1 TO ids_max + 1
    arrayelementslist(i) = 0
    cmemlist(i) = 0
    sfcmemargs(i) = ""
NEXT

'erase cmemlist
'erase sfcmemargs

lastunresolved = -1 'first pass
sflistn = -1 'no entries

SubNameLabels = sp 'QB64 will perform a repass to resolve sub names used as labels

vWatchDesiredState = 0
vWatchRecompileAttempts = 0

qb64prefix_set_desiredState = 0
qb64prefix_set_recompileAttempts = 0

opex_desiredState = 0
opex_recompileAttempts = 0

opexarray_desiredState = 0
opexarray_recompileAttempts = 0

recompile:
vWatchOn = vWatchDesiredState
vWatchVariable "", -1 'reset internal variables list

qb64prefix_set = qb64prefix_set_desiredState
qb64prefix$ = "_"

optionexplicit = opex_desiredState
IF optionexplicit_cmd = -1 AND NoIDEMode = 1 THEN optionexplicit = -1
optionexplicitarray = opexarray_desiredState

lastLineReturn = 0
lastLine = 0
firstLine = 1

Resize = 0
Resize_Scale = 0

UseGL = 0

Error_Happened = 0

HashClear 'clear the hash table

'add reserved words to hashtable

f = HASHFLAG_TYPE + HASHFLAG_RESERVED
HashAdd "_UNSIGNED", f, 0
HashAdd "_BIT", f, 0
HashAdd "_BYTE", f, 0
HashAdd "INTEGER", f, 0
HashAdd "LONG", f, 0
HashAdd "_INTEGER64", f, 0
HashAdd "_OFFSET", f, 0
HashAdd "SINGLE", f, 0
HashAdd "DOUBLE", f, 0
HashAdd "_FLOAT", f, 0
HashAdd "STRING", f, 0
HashAdd "ANY", f, 0

f = HASHFLAG_OPERATOR + HASHFLAG_RESERVED
HashAdd "NOT", f, 0
HashAdd "IMP", f, 0
HashAdd "EQV", f, 0
HashAdd "AND", f, 0
HashAdd "OR", f, 0
HashAdd "XOR", f, 0
HashAdd "MOD", f, 0

f = HASHFLAG_RESERVED + HASHFLAG_CUSTOMSYNTAX
HashAdd "LIST", f, 0
HashAdd "BASE", f, 0
HashAdd "_EXPLICIT", f, 0
HashAdd "AS", f, 0
HashAdd "IS", f, 0
HashAdd "OFF", f, 0
HashAdd "ON", f, 0
HashAdd "STOP", f, 0
HashAdd "TO", f, 0
HashAdd "USING", f, 0
'PUT(graphics) statement:
HashAdd "PRESET", f, 0
HashAdd "PSET", f, 0
'OPEN statement:
HashAdd "FOR", f, 0
HashAdd "OUTPUT", f, 0
HashAdd "RANDOM", f, 0
HashAdd "BINARY", f, 0
HashAdd "APPEND", f, 0
HashAdd "SHARED", f, 0
HashAdd "ACCESS", f, 0
HashAdd "LOCK", f, 0
HashAdd "READ", f, 0
HashAdd "WRITE", f, 0
'LINE statement:
HashAdd "STEP", f, 0
'WIDTH statement:
HashAdd "LPRINT", f, 0
'VIEW statement:
HashAdd "PRINT", f, 0

f = HASHFLAG_RESERVED + HASHFLAG_XELEMENTNAME + HASHFLAG_XTYPENAME
'A
'B
'C
HashAdd "COMMON", f, 0
HashAdd "CALL", f, 0
HashAdd "CASE", f - HASHFLAG_XELEMENTNAME, 0
HashAdd "COM", f, 0 '(ON...)
HashAdd "CONST", f, 0
'D
HashAdd "DATA", f, 0
HashAdd "DECLARE", f, 0
HashAdd "DEF", f, 0
HashAdd "DEFDBL", f, 0
HashAdd "DEFINT", f, 0
HashAdd "DEFLNG", f, 0
HashAdd "DEFSNG", f, 0
HashAdd "DEFSTR", f, 0
HashAdd "DIM", f, 0
HashAdd "DO", f - HASHFLAG_XELEMENTNAME, 0
'E
HashAdd "ERROR", f - HASHFLAG_XELEMENTNAME, 0 '(ON ...)
HashAdd "ELSE", f, 0
HashAdd "ELSEIF", f, 0
HashAdd "ENDIF", f, 0
HashAdd "EXIT", f - HASHFLAG_XELEMENTNAME, 0
'F
HashAdd "FIELD", f - HASHFLAG_XELEMENTNAME, 0
HashAdd "FUNCTION", f, 0
'G
HashAdd "GOSUB", f, 0
HashAdd "GOTO", f, 0
'H
'I
HashAdd "INPUT", f - HASHFLAG_XELEMENTNAME - HASHFLAG_XTYPENAME, 0 '(INPUT$ function exists, so conflicts if allowed as custom syntax)
HashAdd "IF", f, 0
'K
HashAdd "KEY", f - HASHFLAG_XELEMENTNAME - HASHFLAG_XTYPENAME, 0 '(ON...)
'L
HashAdd "LET", f - HASHFLAG_XELEMENTNAME, 0
HashAdd "LOOP", f - HASHFLAG_XELEMENTNAME, 0
HashAdd "LEN", f - HASHFLAG_XELEMENTNAME, 0 '(LEN function exists, so conflicts if allowed as custom syntax)
'M
'N
HashAdd "NEXT", f - HASHFLAG_XELEMENTNAME, 0
'O
'P
HashAdd "PLAY", f - HASHFLAG_XELEMENTNAME - HASHFLAG_XTYPENAME, 0 '(ON...)
HashAdd "PEN", f - HASHFLAG_XELEMENTNAME - HASHFLAG_XTYPENAME, 0 '(ON...)
'Q
'R
HashAdd "REDIM", f, 0
HashAdd "REM", f, 0
HashAdd "RESTORE", f - HASHFLAG_XELEMENTNAME, 0
HashAdd "RESUME", f - HASHFLAG_XELEMENTNAME, 0
HashAdd "RETURN", f - HASHFLAG_XELEMENTNAME, 0
HashAdd "RUN", f - HASHFLAG_XELEMENTNAME, 0
'S
HashAdd "STATIC", f, 0
HashAdd "STRIG", f, 0 '(ON...)
HashAdd "SEG", f, 0
HashAdd "SELECT", f - HASHFLAG_XELEMENTNAME - HASHFLAG_XTYPENAME, 0
HashAdd "SUB", f, 0
HashAdd "SCREEN", f - HASHFLAG_XELEMENTNAME - HASHFLAG_XTYPENAME, 0
'T
HashAdd "THEN", f, 0
HashAdd "TIMER", f - HASHFLAG_XELEMENTNAME - HASHFLAG_XTYPENAME, 0 '(ON...)
HashAdd "TYPE", f - HASHFLAG_XELEMENTNAME, 0
'U
HashAdd "UNTIL", f, 0
HashAdd "UEVENT", f, 0
'V
'W
HashAdd "WEND", f, 0
HashAdd "WHILE", f, 0
'X
'Y
'Z







'clear/init variables
Console = 0
ScreenHide = 0
Asserts = 0
ResolveStaticFunctions = 0
dynamiclibrary = 0
dimsfarray = 0
dimstatic = 0
AllowLocalName = 0
PossibleSubNameLabels = sp 'QB64 will perform a repass to resolve sub names used as labels
use_global_byte_elements = 0
dimshared = 0: dimmethod = 0: dimoption = 0: redimoption = 0: commonoption = 0
mylib$ = "": mylibopt$ = ""
declaringlibrary = 0
nLabels = 0
dynscope = 0
elsefollowup = 0
ontimerid = 0: onkeyid = 0: onstrigid = 0
commonarraylist = "": commonarraylistn = 0
staticarraylist = "": staticarraylistn = 0
fooindwel = 0
layout = ""
layoutok = 0
NoChecks = 0
inclevel = 0
errorLineInInclude = 0
addmetainclude$ = ""
nextrunlineindex = 1
lasttype = 0
lasttypeelement = 0
REDIM SHARED udtxname(1000) AS STRING * 256
REDIM SHARED udtxcname(1000) AS STRING * 256
REDIM SHARED udtxsize(1000) AS LONG
REDIM SHARED udtxbytealign(1000) AS INTEGER 'first element MUST be on a byte alignment & size is a multiple of 8
REDIM SHARED udtxnext(1000) AS LONG
REDIM SHARED udtxvariable(1000) AS INTEGER 'true if the udt contains variable length elements
'elements
REDIM SHARED udtename(1000) AS STRING * 256
REDIM SHARED udtecname(1000) AS STRING * 256
REDIM SHARED udtebytealign(1000) AS INTEGER
REDIM SHARED udtesize(1000) AS LONG
REDIM SHARED udtetype(1000) AS LONG
REDIM SHARED udtetypesize(1000) AS LONG
REDIM SHARED udtearrayelements(1000) AS LONG
REDIM SHARED udtenext(1000) AS LONG
definingtype = 0
definingtypeerror = 0
constlast = -1
'constlastshared = -1
closedmain = 0
addmetastatic = 0
addmetadynamic = 0
DynamicMode = 0
optionbase = 0
ExeIconSet = 0
VersionInfoSet = 0
viFileVersionNum$ = "": viProductVersionNum$ = "": viCompanyName$ = ""
viFileDescription$ = "": viFileVersion$ = "": viInternalName$ = ""
viLegalCopyright$ = "": viLegalTrademarks$ = "": viOriginalFilename$ = ""
viProductName$ = "": viProductVersion$ = "": viComments$ = "": viWeb$ = ""
DataOffset = 0
statementn = 0
everycasenewcase = 0
qberrorhappened = 0: qberrorcode = 0: qberrorline = 0
FOR i = 1 TO 27: defineaz(i) = "SINGLE": defineextaz(i) = "!": NEXT
controllevel = 0
findidsecondarg$ = "": findanotherid = 0: findidinternal = 0: currentid = 0
linenumber = 0
wholeline$ = ""
linefragment$ = ""
idn = 0
arrayprocessinghappened = 0
stringprocessinghappened = 0
inputfunctioncalled = 0
subfuncn = 0
closedsubfunc = 0
subfunc = ""
SelectCaseCounter = 0
ExecCounter = 0
UserDefineCount = 7
totalVariablesCreated = 0
typeDefinitions$ = ""
totalMainVariablesCreated = 0
REDIM SHARED usedVariableList(1000) AS usedVarList
totalWarnings = 0
duplicateConstWarning = 0
emptySCWarning = 0
warningListItems = 0
lastWarningHeader = ""
vWatchUsedLabels = SPACE$(1000)
vWatchUsedSkipLabels = SPACE$(1000)
firstLineNumberLabelvWatch = 0
REDIM SHARED warning$(1000)
REDIM SHARED warningLines(1000) AS LONG
REDIM SHARED warningIncLines(1000) AS LONG
REDIM SHARED warningIncFiles(1000) AS STRING
maxLineNumber = 0
uniquenumbern = 0


''create a type for storing memory blocks
''UDT
''names
'DIM SHARED lasttype AS LONG
'DIM SHARED udtxname(1000) AS STRING * 256
'DIM SHARED udtxcname(1000) AS STRING * 256
'DIM SHARED udtxsize(1000) AS LONG
'DIM SHARED udtxbytealign(1000) AS INTEGER 'first element MUST be on a byte alignment & size is a multiple of 8
'DIM SHARED udtxnext(1000) AS LONG
''elements
'DIM SHARED lasttypeelement AS LONG
'DIM SHARED udtename(1000) AS STRING * 256
'DIM SHARED udtecname(1000) AS STRING * 256
'DIM SHARED udtebytealign(1000) AS INTEGER
'DIM SHARED udtesize(1000) AS LONG
'DIM SHARED udtetype(1000) AS LONG
'DIM SHARED udtetypesize(1000) AS LONG
'DIM SHARED udtearrayelements(1000) AS LONG
'DIM SHARED udtenext(1000) AS LONG

'import _MEM type
ptrsz = OS_BITS \ 8

lasttype = lasttype + 1: i = lasttype
udtxname(i) = "_MEM"
udtxcname(i) = "_MEM"
udtxsize(i) = ((ptrsz) * 5 + (4) * 2 + (8) * 1) * 8
udtxbytealign(i) = 1
lasttypeelement = lasttypeelement + 1: i2 = lasttypeelement
udtename(i2) = "OFFSET"
udtecname(i2) = "OFFSET"
udtebytealign(i2) = 1
udtetype(i2) = OFFSETTYPE: udtesize(i2) = ptrsz * 8
udtetypesize(i2) = 0 'tsize
udtxnext(i) = i2
i3 = i2
lasttypeelement = lasttypeelement + 1: i2 = lasttypeelement
udtename(i2) = "SIZE"
udtecname(i2) = "SIZE"
udtebytealign(i2) = 1
udtetype(i2) = OFFSETTYPE: udtesize(i2) = ptrsz * 8
udtetypesize(i2) = 0 'tsize
udtenext(i3) = i2
i3 = i2
lasttypeelement = lasttypeelement + 1: i2 = lasttypeelement
udtename(i2) = "$_LOCK_ID"
udtecname(i2) = "$_LOCK_ID"
udtebytealign(i2) = 1
udtetype(i2) = INTEGER64TYPE: udtesize(i2) = 64
udtetypesize(i2) = 0 'tsize
udtenext(i3) = i2
i3 = i2
lasttypeelement = lasttypeelement + 1: i2 = lasttypeelement
udtename(i2) = "$_LOCK_OFFSET"
udtecname(i2) = "$_LOCK_OFFSET"
udtebytealign(i2) = 1
udtetype(i2) = OFFSETTYPE: udtesize(i2) = ptrsz * 8
udtetypesize(i2) = 0 'tsize
udtenext(i3) = i2
i3 = i2
lasttypeelement = lasttypeelement + 1: i2 = lasttypeelement
udtename(i2) = "TYPE"
udtecname(i2) = "TYPE"
udtebytealign(i2) = 1
udtetype(i2) = OFFSETTYPE: udtesize(i2) = ptrsz * 8
udtetypesize(i2) = 0 'tsize
udtenext(i3) = i2
i3 = i2
lasttypeelement = lasttypeelement + 1: i2 = lasttypeelement
udtename(i2) = "ELEMENTSIZE"
udtecname(i2) = "ELEMENTSIZE"
udtebytealign(i2) = 1
udtetype(i2) = OFFSETTYPE: udtesize(i2) = ptrsz * 8
udtetypesize(i2) = 0 'tsize
udtenext(i3) = i2
udtenext(i2) = 0
i3 = i2
lasttypeelement = lasttypeelement + 1: i2 = lasttypeelement
udtename(i2) = "IMAGE"
udtecname(i2) = "IMAGE"
udtebytealign(i2) = 1
udtetype(i2) = LONGTYPE: udtesize(i2) = 32
udtetypesize(i2) = 0 'tsize
udtenext(i3) = i2
udtenext(i2) = 0
i3 = i2
lasttypeelement = lasttypeelement + 1: i2 = lasttypeelement
udtename(i2) = "SOUND"
udtecname(i2) = "SOUND"
udtebytealign(i2) = 1
udtetype(i2) = LONGTYPE: udtesize(i2) = 32
udtetypesize(i2) = 0 'tsize
udtenext(i3) = i2
udtenext(i2) = 0

' Reset all unstable flags
FOR i = 1 TO UBOUND(unstableFlags): unstableFlags(i) = 0: NEXT

' Indicates if a MIDI sound font was selected
'
' Captures both the line number and line contents for error reporting later-on
' in the compilation process
MidiSoundFontSet = 0
MidiSoundFontLine$ = ""

' If MidiSoundFont$ is blank, then the default is used
MidiSoundFont$ = ""








'begin compilation
FOR closeall = 1 TO 255: CLOSE closeall: NEXT
OPEN tmpdir$ + "temp.bin" FOR OUTPUT LOCK WRITE AS #26 'relock

bh = OpenBuffer%("O", tmpdir$ + "icon.rc")

IF Debug THEN CLOSE #9: OPEN tmpdir$ + "debug.txt" FOR APPEND AS #9

IF idemode = 0 THEN
    qberrorhappened = -1
    OPEN sourcefile$ FOR INPUT AS #1
    qberrorhappened1:
    IF qberrorhappened = 1 THEN
        PRINT
        PRINT "Cannot locate source file: " + sourcefile$
        IF ConsoleMode THEN SYSTEM 1
        END 1
    ELSE
        CLOSE #1
    END IF
    qberrorhappened = 0
END IF

reginternal

IF qb64prefix_set THEN
    qb64prefix$ = ""

    're-add internal keywords without the "_" prefix
    reginternal

    f = HASHFLAG_TYPE + HASHFLAG_RESERVED
    HashAdd "UNSIGNED", f, 0
    HashAdd "BIT", f, 0
    HashAdd "BYTE", f, 0
    HashAdd "INTEGER64", f, 0
    HashAdd "OFFSET", f, 0
    HashAdd "FLOAT", f, 0

    f = HASHFLAG_RESERVED + HASHFLAG_CUSTOMSYNTAX
    HashAdd "EXPLICIT", f, 0
END IF

DIM SHARED GlobTxtBuf: GlobTxtBuf = OpenBuffer%("O", tmpdir$ + "global.txt")
defdatahandle = GlobTxtBuf

IF iderecompile THEN
    iderecompile = 0
    idepass = 1 'prepass must be done again
    sendc$ = CHR$(7) 'repass request
    GOTO sendcommand
END IF

IF idemode THEN GOTO ideret1

lineinput3load sourcefile$

DO

    '### STEVE EDIT FOR CONST EXPANSION 10/11/2013

    wholeline$ = lineinput3$
    IF wholeline$ = CHR$(13) THEN EXIT DO

    ideprepass:
    prepassLastLine:

    IF lastLine <> 0 OR firstLine <> 0 THEN
        lineBackup$ = wholeline$ 'backup the real line (will be blank when lastline is set)
        forceIncludeFromRoot$ = ""
        IF vWatchOn THEN
            addingvWatch = 1
            IF firstLine <> 0 THEN forceIncludeFromRoot$ = "internal\support\vwatch\vwatch.bi"
            IF lastLine <> 0 THEN forceIncludeFromRoot$ = "internal\support\vwatch\vwatch.bm"
        ELSE
            'IF firstLine <> 0 THEN forceIncludeFromRoot$ = "internal\support\vwatch\vwatch_stub.bi"
            IF lastLine <> 0 THEN forceIncludeFromRoot$ = "internal\support\vwatch\vwatch_stub.bm"
        END IF
        firstLine = 0: lastLine = 0
        IF LEN(forceIncludeFromRoot$) THEN GOTO forceInclude_prepass
        forceIncludeCompleted_prepass:
        addingvWatch = 0
        wholeline$ = lineBackup$
    END IF

    wholestv$ = wholeline$ '### STEVE EDIT FOR CONST EXPANSION 10/11/2013

    prepass = 1
    layout = ""
    layoutok = 0

    linenumber = linenumber + 1
    reallinenumber = reallinenumber + 1

    DO UNTIL linenumber < UBOUND(InValidLine) 'color information flag for each line
        REDIM _PRESERVE InValidLine(UBOUND(InValidLine) + 1000) AS _BYTE
    LOOP
    InValidLine(linenumber) = 0

    IF LEN(wholeline$) THEN

        IF UCASE$(_TRIM$(wholeline$)) = "$NOPREFIX" THEN
            qb64prefix_set_desiredState = 1
            IF qb64prefix_set = 0 THEN
                IF qb64prefix_set_recompileAttempts = 0 THEN
                    qb64prefix_set_recompileAttempts = qb64prefix_set_recompileAttempts + 1
                    GOTO do_recompile
                END IF
            END IF
        END IF

        wholeline$ = lineformat(wholeline$)
        IF Error_Happened THEN GOTO errmes


        temp$ = LTRIM$(RTRIM$(UCASE$(wholestv$)))

        IF temp$ = "$COLOR:0" THEN
            IF qb64prefix_set THEN
                addmetainclude$ = getfilepath$(COMMAND$(0)) + "internal" + pathsep$ + "support" + pathsep$ + "color" + pathsep$ + "color0_noprefix.bi"
            ELSE
                addmetainclude$ = getfilepath$(COMMAND$(0)) + "internal" + pathsep$ + "support" + pathsep$ + "color" + pathsep$ + "color0.bi"
            END IF
            GOTO finishedlinepp
        END IF

        IF temp$ = "$COLOR:32" THEN
            IF qb64prefix_set THEN
                addmetainclude$ = getfilepath$(COMMAND$(0)) + "internal" + pathsep$ + "support" + pathsep$ + "color" + pathsep$ + "color32_noprefix.bi"
            ELSE
                addmetainclude$ = getfilepath$(COMMAND$(0)) + "internal" + pathsep$ + "support" + pathsep$ + "color" + pathsep$ + "color32.bi"
            END IF
            GOTO finishedlinepp
        END IF

        IF temp$ = "$DEBUG" THEN
            vWatchDesiredState = 1
            IF vWatchOn = 0 THEN
                IF vWatchRecompileAttempts = 0 THEN
                    'this is the first time a conflict has occurred, so react immediately with a full recompilation using the desired state
                    vWatchRecompileAttempts = vWatchRecompileAttempts + 1
                    GOTO do_recompile
                ELSE
                    'continue compilation to retrieve the final state requested and act on that as required
                END IF
            END IF
        END IF

        IF LEFT$(temp$, 4) = "$IF " THEN
            IF RIGHT$(temp$, 5) <> " THEN" THEN a$ = "$IF without THEN": GOTO errmes
            temp$ = LTRIM$(MID$(temp$, 4)) 'strip off the $IF and extra spaces
            temp$ = RTRIM$(LEFT$(temp$, LEN(temp$) - 4)) 'and strip off the THEN and extra spaces
            temp = INSTR(temp$, "=")
            ExecCounter = ExecCounter + 1
            ExecLevel(ExecCounter) = -1 'default to a skip value
            DefineElse(ExecCounter) = 1 '1 says we have an $IF statement at this level
            result = EvalPreIF(temp$, a$)
            IF a$ <> "" THEN GOTO errmes
            IF result <> 0 THEN
                ExecLevel(ExecCounter) = ExecLevel(ExecCounter - 1) 'So we inherit the execlevel from above
                IF ExecLevel(ExecCounter) = 0 THEN DefineElse(ExecCounter) = DefineElse(ExecCounter) OR 4 'Else if used and conditon found
            END IF
            GOTO finishedlinepp 'and then we're finished -- and at this point we didn't make a match so we exit with a DONT READ type flag on our code.
        END IF

        IF temp$ = "$ELSE" THEN
            IF DefineElse(ExecCounter) = 0 THEN a$ = "$ELSE without $IF": GOTO errmes
            IF DefineElse(ExecCounter) AND 2 THEN a$ = "$IF block already has $ELSE statement in it": GOTO errmes
            DefineElse(ExecCounter) = DefineElse(ExecCounter) OR 2 'set the flag to declare an $ELSE already in this block
            IF DefineElse(ExecCounter) AND 4 THEN 'If we executed code in a previous IF or ELSE IF statement, we can't do it here
                ExecLevel(ExecCounter) = -1 'So we inherit the execlevel from above
            ELSE
                ExecLevel(ExecCounter) = ExecLevel(ExecCounter - 1) 'If we were processing code before, code after this segment is going to be SKIPPED
            END IF
            GOTO finishedlinepp
        END IF

        IF LEFT$(temp$, 5) = "$ELSE" THEN 'looking for $ELSE IF
            temp$ = LTRIM$(MID$(temp$, 6))
            IF LEFT$(temp$, 3) = "IF " THEN
                IF DefineElse(ExecCounter) = 0 THEN a$ = "$ELSE IF without $IF": GOTO errmes
                IF DefineElse(ExecCounter) AND 2 THEN a$ = "$ELSE IF cannot follow $ELSE": GOTO errmes
                IF RIGHT$(temp$, 5) <> " THEN" THEN a$ = "$ELSE IF without THEN": GOTO errmes
                IF DefineElse(ExecCounter) AND 4 THEN 'If we executed code in a previous IF or ELSE IF statement, we can't do it here
                    ExecLevel(ExecCounter) = -1
                    GOTO finishedlinepp
                END IF
                temp$ = LTRIM$(MID$(temp$, 3)) 'strip off the IF and extra spaces
                temp$ = RTRIM$(LEFT$(temp$, LEN(temp$) - 4)) 'and strip off the THEN and extra spaces
                result = EvalPreIF(temp$, a$)
                IF a$ <> "" THEN GOTO errmes
                IF result <> 0 THEN
                    ExecLevel(ExecCounter) = ExecLevel(ExecCounter - 1) 'So we inherit the execlevel from above
                    IF ExecLevel(ExecCounter) = 0 THEN DefineElse(ExecCounter) = DefineElse(ExecCounter) OR 4 'Else if used and conditon found
                END IF
                GOTO finishedlinepp 'and then we're finished -- and at this point we didn't make a match so we exit with a DONT READ type flag on our code.
            END IF
        END IF

        IF temp$ = "$END IF" OR temp$ = "$ENDIF" THEN
            IF DefineElse(ExecCounter) = 0 THEN a$ = "$END IF without $IF": GOTO errmes
            DefineElse(ExecCounter) = 0 'We no longer have an $IF block at this level
            ExecCounter = ExecCounter - 1
            GOTO finishedlinepp
        END IF

        IF ExecLevel(ExecCounter) THEN
            DO UNTIL linenumber < UBOUND(InValidLine)
                REDIM _PRESERVE InValidLine(UBOUND(InValidLine) + 1000) AS _BYTE
            LOOP

            InValidLine(linenumber) = -1
            GOTO finishedlinepp 'we don't check for anything inside lines that we've marked for skipping
        END IF

        IF LEFT$(temp$, 7) = "$ERROR " THEN
            temp$ = LTRIM$(MID$(temp$, 7))
            a$ = "Compilation check failed: " + temp$
            GOTO errmes
        END IF

        IF LEFT$(temp$, 5) = "$LET " THEN
            temp$ = LTRIM$(MID$(temp$, 5)) 'simply shorten our string to parse
            'For starters, let's make certain that we have 3 elements to deal with
            temp = INSTR(temp$, "=") 'without an = in there, we can't get a value from the left and right side
            IF temp = 0 THEN a$ = "Invalid Syntax.  $LET <flag> = <value>": GOTO errmes
            l$ = RTRIM$(LEFT$(temp$, temp - 1)): r$ = LTRIM$(MID$(temp$, temp + 1))
            'then validate to make certain the left side looks proper
            IF validname(l$) = 0 THEN a$ = "Invalid flag name": GOTO errmes
            IF LEFT$(r$, 1) = CHR$(34) THEN r$ = LTRIM$(MID$(r$, 2))
            IF RIGHT$(r$, 1) = CHR$(34) THEN r$ = RTRIM$(LEFT$(r$, LEN(r$) - 1))
            IF LEFT$(r$, 1) = "-" THEN
                r1$ = "-"
                r$ = LTRIM$(MID$(r$, 2))
            ELSE
                r1$ = ""
            END IF
            'then validate to make certain the left side looks proper
            FOR i = 1 TO LEN(r$)
                a = ASC(r$, i)
                SELECT CASE a
                    CASE 32
                    CASE 46 'periods are fine.
                        r1$ = r1$ + "."
                    CASE IS < 48, IS > 90
                        a$ = "Invalid value": GOTO errmes
                    CASE ELSE
                        r1$ = r1$ + CHR$(a)
                END SELECT
            NEXT
            r$ = r1$
            'First look to see if we have an existing setting like this and if so, update it
            FOR i = 8 TO UserDefineCount 'UserDefineCount 1-7 are reserved for automatic OS/BIT detection & version
                IF UserDefine(0, i) = l$ THEN UserDefine(1, i) = r$: GOTO finishedlinepp
            NEXT
            'Otherwise create a new setting and set the initial value for it
            UserDefineCount = UserDefineCount + 1
            IF UserDefineCount > UBOUND(UserDefine, 2) THEN
                REDIM _PRESERVE UserDefine(1, UBOUND(UserDefine, 2) + 10) 'Add another 10 elements to the array so it'll expand as the user adds to it
            END IF
            UserDefine(0, UserDefineCount) = l$
            UserDefine(1, UserDefineCount) = r$
            GOTO finishedlinepp
        END IF

        ' We check for Unstable flags during the preprocessing step because it
        ' impacts what valid commands there are in all the other steps
        IF LEFT$(temp$, 10) = "$UNSTABLE:" THEN
            token$ = UCASE$(LTRIM$(RTRIM$(MID$(temp$, 11))))

            SELECT CASE token$
                CASE "MIDI"
                    IF NOT UseMiniaudioBackend THEN
                        a$ = "Midi is not supported with the old OpenAL audio backend."
                        GOTO errmes
                    END IF

                    unstableFlags(UNSTABLE_MIDI) = -1

                CASE "HTTP"
                    unstableFlags(UNSTABLE_HTTP) = -1
                    regUnstableHttp

                CASE ELSE
                    a$ = "Unrecognized unstable flag " + AddQuotes$(token$)
                    GOTO errmes
            END SELECT
        END IF

        cwholeline$ = wholeline$
        wholeline$ = eleucase$(wholeline$) '********REMOVE THIS LINE LATER********


        addmetadynamic = 0: addmetastatic = 0
        wholelinen = numelements(wholeline$)

        IF wholelinen THEN

            wholelinei = 1

            'skip line number?
            e$ = getelement$(wholeline$, 1)
            IF (ASC(e$) >= 48 AND ASC(e$) <= 59) OR ASC(e$) = 46 THEN wholelinei = 2: GOTO ppskpl

            'skip 'POSSIBLE' line label?
            IF wholelinen >= 2 THEN
                x2 = INSTR(wholeline$, sp + ":" + sp): x3 = x2 + 2
                IF x2 = 0 THEN
                    IF RIGHT$(wholeline$, 2) = sp + ":" THEN x2 = LEN(wholeline$) - 1: x3 = x2 + 1
                END IF

                IF x2 THEN
                    e$ = LEFT$(wholeline$, x2 - 1)
                    IF validlabel(e$) THEN
                        wholeline$ = RIGHT$(wholeline$, LEN(wholeline$) - x3)
                        cwholeline$ = RIGHT$(cwholeline$, LEN(wholeline$) - x3)
                        wholelinen = numelements(wholeline$)
                        GOTO ppskpl
                    END IF 'valid
                END IF 'includes ":"
            END IF 'wholelinen>=2

            ppskpl:
            IF wholelinei <= wholelinen THEN
                '----------------------------------------
                a$ = ""
                ca$ = ""
                ppblda:
                e$ = getelement$(wholeline$, wholelinei)
                ce$ = getelement$(cwholeline$, wholelinei)
                IF e$ = ":" OR e$ = "ELSE" OR e$ = "THEN" OR e$ = "" THEN
                    IF LEN(a$) THEN
                        IF Debug THEN PRINT #9, "PP[" + a$ + "]"
                        n = numelements(a$)
                        firstelement$ = getelement(a$, 1)
                        secondelement$ = getelement(a$, 2)
                        thirdelement$ = getelement(a$, 3)
                        '========================================

                        IF n = 2 AND firstelement$ = "END" AND (secondelement$ = "SUB" OR secondelement$ = "FUNCTION") THEN
                            closedsubfunc = -1
                        END IF

                        'declare library
                        IF declaringlibrary THEN