BlankPage: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
No edit summary
Tag: Reverted
(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
Line 96: Line 96:


{{PageNavigation}}
{{PageNavigation}}
{{CodeStart}}
{{Text|<nowiki>'All variables will be of type LONG unless explicitly defined</nowiki>|#919191}}
{{Cl|DEFLNG}} A-Z
{{Text|<nowiki>'All arrays will be dynamically allocated so they can be REDIM-ed</nowiki>|#919191}}
{{Text|<nowiki>'</nowiki>|#919191}}{{Cm|$DYNAMIC}}
{{Text|<nowiki>'We need console access to support command-line compilation via the -x command line compile option</nowiki>|#919191}}
{{Cm|$CONSOLE}}
{{Text|<nowiki>'Initially the "SCREEN" will be hidden, if the -x option is used it will never be created</nowiki>|#919191}}
{{Cm|$SCREENHIDE}}
{{Cm|$EXEICON}}:{{Text|<nowiki>'./qb64pe.ico'</nowiki>|#919191}}
{{Cm|$VERSIONINFO}}:CompanyName=QB64 Phoenix Edition
{{Cm|$VERSIONINFO}}:FileDescription=QB64 IDE and Compiler
{{Cm|$VERSIONINFO}}:InternalName=qb64pe.bas
{{Cm|$VERSIONINFO}}:LegalCopyright=MIT
{{Cm|$VERSIONINFO}}:LegalTrademarks=
{{Cm|$VERSIONINFO}}:OriginalFilename=qb64pe.exe
{{Cm|$VERSIONINFO}}:ProductName=QB64-PE
{{Cm|$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.
{{Text|<nowiki>'</nowiki>|#919191}}{{Cm|$INCLUDE}}:{{Text|<nowiki>'global\version.bas'</nowiki>|#919191}}
{{Text|<nowiki>'</nowiki>|#919191}}{{Cm|$INCLUDE}}:{{Text|<nowiki>'global\settings.bas'</nowiki>|#919191}}
{{Text|<nowiki>'</nowiki>|#919191}}{{Cm|$INCLUDE}}:{{Text|<nowiki>'global\constants.bas'</nowiki>|#919191}}
{{Text|<nowiki>'</nowiki>|#919191}}{{Cm|$INCLUDE}}:{{Text|<nowiki>'subs_functions\extensions\opengl\opengl_global.bas'</nowiki>|#919191}}
{{Text|<nowiki>'</nowiki>|#919191}}{{Cm|$INCLUDE}}:{{Text|<nowiki>'utilities\ini-manager\ini.bi'</nowiki>|#919191}}
{{Text|<nowiki>'</nowiki>|#919191}}{{Cm|$INCLUDE}}:{{Text|<nowiki>'utilities\s-buffer\simplebuffer.bi'</nowiki>|#919191}}
{{Cl|DEFLNG}} A-Z
{{Text|<nowiki>'-------- Optional IDE Component (1/2) --------</nowiki>|#919191}}
{{Text|<nowiki>'</nowiki>|#919191}}{{Cm|$INCLUDE}}:{{Text|<nowiki>'ide\ide_global.bas'</nowiki>|#919191}}
{{Cl|REDIM}} {{Cl|SHARED}} OName({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|STRING}} {{Text|<nowiki>'Operation Name</nowiki>|#919191}}
{{Cl|REDIM}} {{Cl|SHARED}} PL({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|INTEGER}} {{Text|<nowiki>'Priority Level</nowiki>|#919191}}
{{Cl|REDIM}} {{Cl|SHARED}} PP_TypeMod({{Text|0|#F580B1}}) {{Cl|AS}} {{Cl|STRING}}, PP_ConvertedMod({{Text|0|#F580B1}}) {{Cl|AS}} {{Cl|STRING}} {{Text|<nowiki>'Prepass Name Conversion variables.</nowiki>|#919191}}
{{Text|Set_OrderOfOperations|#55FF55}}
{{Cl|DIM}} {{Cl|SHARED}} NoExeSaved {{Cl|AS}} {{Cl|INTEGER}}
{{Cl|DIM}} {{Cl|SHARED}} vWatchOn, vWatchRecompileAttempts, vWatchDesiredState, vWatchErrorCall$
{{Cl|DIM}} {{Cl|SHARED}} 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}}
{{Cl|DIM}} {{Cl|SHARED}} 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}}
{{Cl|DIM}} {{Cl|SHARED}} qb64prefix_set_recompileAttempts, qb64prefix_set_desiredState
{{Cl|DIM}} {{Cl|SHARED}} opex_recompileAttempts, opex_desiredState
{{Cl|DIM}} {{Cl|SHARED}} opexarray_recompileAttempts, opexarray_desiredState
{{Cl|REDIM}} EveryCaseSet({{Text|100|#F580B1}}), SelectCaseCounter {{Cl|AS}} {{Cl|_UNSIGNED}} {{Cl|LONG}}
{{Cl|REDIM}} SelectCaseHasCaseBlock({{Text|100|#F580B1}})
{{Cl|DIM}} ExecLevel({{Text|255|#F580B1}}), ExecCounter {{Cl|AS}} {{Cl|INTEGER}}
{{Cl|REDIM}} {{Cl|SHARED}} UserDefine({{Text|1|#F580B1}}, {{Text|100|#F580B1}}) {{Cl|AS}} {{Cl|STRING}} {{Text|<nowiki>'0 element is the name, 1 element is the string value</nowiki>|#919191}}
{{Cl|REDIM}} {{Cl|SHARED}} InValidLine({{Text|10000|#F580B1}}) {{Cl|AS}} {{Cl|_BYTE}}
{{Cl|DIM}} DefineElse({{Text|255|#F580B1}}) {{Cl|AS}} {{Cl|_BYTE}}
{{Cl|DIM}} {{Cl|SHARED}} UserDefineCount {{Cl|AS}} {{Cl|INTEGER}}, 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}}
{{Cl|IF}} {{Cl|INSTR}}({{Cl|_OS$}}, {{Text|<nowiki>"WIN"</nowiki>|#FFB100}}) {{Cl|THEN}} UserDefine({{Text|1|#F580B1}}, {{Text|0|#F580B1}}) = {{Text|<nowiki>"-1"</nowiki>|#FFB100}}: UserDefine({{Text|1|#F580B1}}, {{Text|1|#F580B1}}) = {{Text|<nowiki>"-1"</nowiki>|#FFB100}} {{Cl|ELSE}} UserDefine({{Text|1|#F580B1}}, {{Text|0|#F580B1}}) = {{Text|<nowiki>"0"</nowiki>|#FFB100}}: UserDefine({{Text|1|#F580B1}}, {{Text|1|#F580B1}}) = {{Text|<nowiki>"0"</nowiki>|#FFB100}}
{{Cl|IF}} {{Cl|INSTR}}({{Cl|_OS$}}, {{Text|<nowiki>"LINUX"</nowiki>|#FFB100}}) {{Cl|THEN}} UserDefine({{Text|1|#F580B1}}, {{Text|2|#F580B1}}) = {{Text|<nowiki>"-1"</nowiki>|#FFB100}} {{Cl|ELSE}} UserDefine({{Text|1|#F580B1}}, {{Text|2|#F580B1}}) = {{Text|<nowiki>"0"</nowiki>|#FFB100}}
{{Cl|IF}} {{Cl|INSTR}}({{Cl|_OS$}}, {{Text|<nowiki>"MAC"</nowiki>|#FFB100}}) {{Cl|THEN}} UserDefine({{Text|1|#F580B1}}, {{Text|3|#F580B1}}) = {{Text|<nowiki>"-1"</nowiki>|#FFB100}}: UserDefine({{Text|1|#F580B1}}, {{Text|4|#F580B1}}) = {{Text|<nowiki>"-1"</nowiki>|#FFB100}} {{Cl|ELSE}} UserDefine({{Text|1|#F580B1}}, {{Text|3|#F580B1}}) = {{Text|<nowiki>"0"</nowiki>|#FFB100}}: UserDefine({{Text|1|#F580B1}}, {{Text|4|#F580B1}}) = {{Text|<nowiki>"0"</nowiki>|#FFB100}}
{{Cl|IF}} {{Cl|INSTR}}({{Cl|_OS$}}, {{Text|<nowiki>"32BIT"</nowiki>|#FFB100}}) {{Cl|THEN}} UserDefine({{Text|1|#F580B1}}, {{Text|5|#F580B1}}) = {{Text|<nowiki>"-1"</nowiki>|#FFB100}}: UserDefine({{Text|1|#F580B1}}, {{Text|6|#F580B1}}) = {{Text|<nowiki>"0"</nowiki>|#FFB100}} {{Cl|ELSE}} 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$
{{Cl|DIM}} {{Cl|SHARED}} QB64_uptime!
QB64_uptime! = {{Cl|TIMER (function)|TIMER}}
NoInternalFolder:
{{Cl|IF}} {{Cl|_DIREXISTS}}({{Text|<nowiki>"internal"</nowiki>|#FFB100}}) = {{Text|0|#F580B1}} {{Cl|THEN}}
    {{Cl|_SCREENSHOW}}
    {{Cl|PRINT}} {{Text|<nowiki>"QB64-PE cannot locate the 'internal' folder"</nowiki>|#FFB100}}
    {{Cl|PRINT}}
    {{Cl|PRINT}} {{Text|<nowiki>"Check that QB64-PE has been extracted properly."</nowiki>|#FFB100}}
    {{Cl|PRINT}} {{Text|<nowiki>"For MacOSX, launch 'qb64pe_start.command' or enter './qb64pe' in Terminal."</nowiki>|#FFB100}}
    {{Cl|PRINT}} {{Text|<nowiki>"For Linux, in the console enter './qb64pe'."</nowiki>|#FFB100}}
    {{Cl|DO}}
        {{Cl|_LIMIT}} {{Text|1|#F580B1}}
    {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} <> {{Text|<nowiki>""</nowiki>|#FFB100}}
    {{Cl|SYSTEM}} {{Text|1|#F580B1}}
{{Cl|END}} {{Cl|IF}}
{{Cl|DIM}} {{Cl|SHARED}} Include_GDB_Debugging_Info {{Text|<nowiki>'set using "options.bin"</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} DEPENDENCY_LAST
{{Cl|CONST}} DEPENDENCY_LOADFONT = {{Text|1|#F580B1}}: DEPENDENCY_LAST = DEPENDENCY_LAST + {{Text|1|#F580B1}}
{{Cl|CONST}} DEPENDENCY_AUDIO_CONVERSION = {{Text|2|#F580B1}}: DEPENDENCY_LAST = DEPENDENCY_LAST + {{Text|1|#F580B1}}
{{Cl|CONST}} DEPENDENCY_AUDIO_DECODE = {{Text|3|#F580B1}}: DEPENDENCY_LAST = DEPENDENCY_LAST + {{Text|1|#F580B1}}
{{Cl|CONST}} DEPENDENCY_AUDIO_OUT = {{Text|4|#F580B1}}: DEPENDENCY_LAST = DEPENDENCY_LAST + {{Text|1|#F580B1}}
{{Cl|CONST}} DEPENDENCY_GL = {{Text|5|#F580B1}}: DEPENDENCY_LAST = DEPENDENCY_LAST + {{Text|1|#F580B1}}
{{Cl|CONST}} DEPENDENCY_IMAGE_CODEC = {{Text|6|#F580B1}}: DEPENDENCY_LAST = DEPENDENCY_LAST + {{Text|1|#F580B1}}
{{Cl|CONST}} 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>|#919191}}
{{Cl|CONST}} DEPENDENCY_SOCKETS = {{Text|8|#F580B1}}: DEPENDENCY_LAST = DEPENDENCY_LAST + {{Text|1|#F580B1}}
{{Cl|CONST}} DEPENDENCY_PRINTER = {{Text|9|#F580B1}}: DEPENDENCY_LAST = DEPENDENCY_LAST + {{Text|1|#F580B1}}
{{Cl|CONST}} DEPENDENCY_ICON = {{Text|10|#F580B1}}: DEPENDENCY_LAST = DEPENDENCY_LAST + {{Text|1|#F580B1}}
{{Cl|CONST}} DEPENDENCY_SCREENIMAGE = {{Text|11|#F580B1}}: DEPENDENCY_LAST = DEPENDENCY_LAST + {{Text|1|#F580B1}}
{{Cl|CONST}} DEPENDENCY_DEVICEINPUT = {{Text|12|#F580B1}}: DEPENDENCY_LAST = DEPENDENCY_LAST + {{Text|1|#F580B1}} {{Text|<nowiki>'removes support for gamepad input if not present</nowiki>|#919191}}
{{Cl|CONST}} DEPENDENCY_ZLIB = {{Text|13|#F580B1}}: DEPENDENCY_LAST = DEPENDENCY_LAST + {{Text|1|#F580B1}} {{Text|<nowiki>'ZLIB library linkage, if desired, for compression/decompression.</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} DEPENDENCY({{Text|1|#F580B1}} {{Cl|TO}} DEPENDENCY_LAST)
{{Cl|DIM}} {{Cl|SHARED}} UseGL {{Text|<nowiki>'declared SUB _GL (no params)</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} OS_BITS {{Cl|AS}} {{Cl|LONG}}, WindowTitle {{Cl|AS}} {{Cl|STRING}}
OS_BITS = {{Text|64|#F580B1}}: {{Cl|IF}} {{Cl|INSTR}}({{Cl|_OS$}}, {{Text|<nowiki>"[32BIT]"</nowiki>|#FFB100}}) {{Cl|THEN}} OS_BITS = {{Text|32|#F580B1}}
{{Cl|IF}} OS_BITS = {{Text|32|#F580B1}} {{Cl|THEN}} WindowTitle = {{Text|<nowiki>"QB64 Phoenix Edition (x32)"</nowiki>|#FFB100}} {{Cl|ELSE}} WindowTitle = {{Text|<nowiki>"QB64 Phoenix Edition (x64)"</nowiki>|#FFB100}}
{{Cl|_TITLE}} WindowTitle
{{Cl|DIM}} {{Cl|SHARED}} ConsoleMode, No_C_Compile_Mode, NoIDEMode
{{Cl|DIM}} {{Cl|SHARED}} ShowWarnings {{Cl|AS}} {{Cl|_BYTE}}, QuietMode {{Cl|AS}} {{Cl|_BYTE}}, CMDLineFile {{Cl|AS}} {{Cl|STRING}}
{{Cl|DIM}} {{Cl|SHARED}} MonochromeLoggingMode {{Cl|AS}} {{Cl|_BYTE}}
{{Cl|TYPE}} usedVarList
    {{Cl|AS}} {{Cl|LONG}} id, linenumber, includeLevel, includedLine, {{Text|scope|#55FF55}}, localIndex
    {{Cl|AS}} {{Cl|LONG}} arrayElementSize
    {{Cl|AS}} {{Cl|_BYTE}} used, watch, isarray, displayFormat {{Text|<nowiki>'displayFormat: 0=DEC;1=HEX;2=BIN;3=OCT</nowiki>|#919191}}
    {{Cl|AS}} {{Cl|STRING}} name, cname, varType, includedFile, subfunc
    {{Cl|AS}} {{Cl|STRING}} watchRange, indexes, elements, elementTypes {{Text|<nowiki>'for Arrays and UDTs</nowiki>|#919191}}
    {{Cl|AS}} {{Cl|STRING}} elementOffset, storage
{{Cl|END}} {{Cl|TYPE}}
{{Cl|REDIM}} {{Cl|SHARED}} backupUsedVariableList({{Text|1000|#F580B1}}) {{Cl|AS}} usedVarList
{{Cl|DIM}} {{Cl|SHARED}} typeDefinitions$, backupTypeDefinitions$
{{Cl|DIM}} {{Cl|SHARED}} totalVariablesCreated {{Cl|AS}} {{Cl|LONG}}, totalMainVariablesCreated {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} bypassNextVariable {{Cl|AS}} {{Cl|_BYTE}}
{{Cl|DIM}} {{Cl|SHARED}} totalWarnings {{Cl|AS}} {{Cl|LONG}}, warningListItems {{Cl|AS}} {{Cl|LONG}}, lastWarningHeader {{Cl|AS}} {{Cl|STRING}}
{{Cl|DIM}} {{Cl|SHARED}} duplicateConstWarning {{Cl|AS}} {{Cl|_BYTE}}, warningsissued {{Cl|AS}} {{Cl|_BYTE}}
{{Cl|DIM}} {{Cl|SHARED}} emptySCWarning {{Cl|AS}} {{Cl|_BYTE}}, maxLineNumber {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} ExeIconSet {{Cl|AS}} {{Cl|LONG}}, qb64prefix$, qb64prefix_set
{{Cl|DIM}} {{Cl|SHARED}} VersionInfoSet {{Cl|AS}} {{Cl|_BYTE}}
{{Text|<nowiki>'Variables to handle $VERSIONINFO metacommand:</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} viFileVersionNum$, viProductVersionNum$, viCompanyName$
{{Cl|DIM}} {{Cl|SHARED}} viFileDescription$, viFileVersion$, viInternalName$
{{Cl|DIM}} {{Cl|SHARED}} viLegalCopyright$, viLegalTrademarks$, viOriginalFilename$
{{Cl|DIM}} {{Cl|SHARED}} viProductName$, viProductVersion$, viComments$, viWeb$
{{Cl|DIM}} {{Cl|SHARED}} NoChecks
{{Cl|DIM}} {{Cl|SHARED}} Console
{{Cl|DIM}} {{Cl|SHARED}} ScreenHide
{{Cl|DIM}} {{Cl|SHARED}} Asserts
{{Cl|DIM}} {{Cl|SHARED}} OptMax {{Cl|AS}} {{Cl|LONG}}
OptMax = {{Text|256|#F580B1}}
{{Cl|REDIM}} {{Cl|SHARED}} Opt({{Text|1|#F580B1}} {{Cl|TO}} OptMax, {{Text|1|#F580B1}} {{Cl|TO}} {{Text|10|#F580B1}}) {{Cl|AS}} {{Cl|STRING}} * {{Text|256|#F580B1}}
{{Text|<nowiki>'  (1,1)="READ"</nowiki>|#919191}}
{{Text|<nowiki>'  (1,2)="WRITE"</nowiki>|#919191}}
{{Text|<nowiki>'  (1,3)="READ WRITE"</nowiki>|#919191}}
{{Cl|REDIM}} {{Cl|SHARED}} OptWords({{Text|1|#F580B1}} {{Cl|TO}} OptMax, {{Text|1|#F580B1}} {{Cl|TO}} {{Text|10|#F580B1}}) {{Cl|AS}} {{Cl|INTEGER}} {{Text|<nowiki>'The number of words of each opt () element</nowiki>|#919191}}
{{Text|<nowiki>'  (1,1)=1 '"READ"</nowiki>|#919191}}
{{Text|<nowiki>'  (1,2)=1 '"WRITE"</nowiki>|#919191}}
{{Text|<nowiki>'  (1,3)=2 '"READ WRITE"</nowiki>|#919191}}
{{Cl|REDIM}} {{Cl|SHARED}} T({{Text|1|#F580B1}} {{Cl|TO}} OptMax) {{Cl|AS}} {{Cl|INTEGER}} {{Text|<nowiki>'The type of the entry</nowiki>|#919191}}
{{Text|<nowiki>'  t is 0 for ? opts</nowiki>|#919191}}
{{Text|<nowiki>'  ---------- 0 means ? , 1+ means a symbol or {}block ----------</nowiki>|#919191}}
{{Text|<nowiki>'  t is 1 for symbol opts</nowiki>|#919191}}
{{Text|<nowiki>'  t is the number of rhs opt () index enteries for {READ|WRITE|READ WRITE} like opts</nowiki>|#919191}}
{{Cl|REDIM}} {{Cl|SHARED}} Lev({{Text|1|#F580B1}} {{Cl|TO}} OptMax) {{Cl|AS}} {{Cl|INTEGER}} {{Text|<nowiki>'The indwelling level of each opt () element (the lowest is 0)</nowiki>|#919191}}
{{Cl|REDIM}} {{Cl|SHARED}} EntryLev({{Text|1|#F580B1}} {{Cl|TO}} OptMax) {{Cl|AS}} {{Cl|INTEGER}} {{Text|<nowiki>'The level required from which this opt () can be validly be entered/checked-for</nowiki>|#919191}}
{{Cl|REDIM}} {{Cl|SHARED}} DitchLev({{Text|1|#F580B1}} {{Cl|TO}} OptMax) {{Cl|AS}} {{Cl|INTEGER}} {{Text|<nowiki>'The lowest level recorded between the previous Opt and this Opt</nowiki>|#919191}}
{{Cl|REDIM}} {{Cl|SHARED}} DontPass({{Text|1|#F580B1}} {{Cl|TO}} OptMax) {{Cl|AS}} {{Cl|INTEGER}} {{Text|<nowiki>'Set to 1 or 0, with 1 meaning don't pass</nowiki>|#919191}}
{{Text|<nowiki>'Determines whether the opt () entry needs to actually be passed to the C++ sub/function</nowiki>|#919191}}
{{Cl|REDIM}} {{Cl|SHARED}} TempList({{Text|1|#F580B1}} {{Cl|TO}} OptMax) {{Cl|AS}} {{Cl|INTEGER}}
{{Cl|REDIM}} {{Cl|SHARED}} PassRule({{Text|1|#F580B1}} {{Cl|TO}} OptMax) {{Cl|AS}} {{Cl|LONG}}
{{Text|<nowiki>'0 means no pass rule</nowiki>|#919191}}
{{Text|<nowiki>'negative values refer to an opt () element</nowiki>|#919191}}
{{Text|<nowiki>'positive values refer to a flag value</nowiki>|#919191}}
{{Cl|REDIM}} {{Cl|SHARED}} LevelEntered(OptMax) {{Text|<nowiki>'up to 64 levels supported</nowiki>|#919191}}
{{Cl|REDIM}} {{Cl|SHARED}} separgs(OptMax + {{Text|1|#F580B1}}) {{Cl|AS}} {{Cl|STRING}}
{{Cl|REDIM}} {{Cl|SHARED}} separgslayout(OptMax + {{Text|1|#F580B1}}) {{Cl|AS}} {{Cl|STRING}}
{{Cl|REDIM}} {{Cl|SHARED}} separgs2(OptMax + {{Text|1|#F580B1}}) {{Cl|AS}} {{Cl|STRING}}
{{Cl|REDIM}} {{Cl|SHARED}} separgslayout2(OptMax + {{Text|1|#F580B1}}) {{Cl|AS}} {{Cl|STRING}}
{{Cl|DIM}} {{Cl|SHARED}} E
{{Cl|DIM}} {{Cl|SHARED}} ResolveStaticFunctions
{{Cl|REDIM}} {{Cl|SHARED}} ResolveStaticFunction_File({{Text|1|#F580B1}} {{Cl|TO}} {{Text|100|#F580B1}}) {{Cl|AS}} {{Cl|STRING}}
{{Cl|REDIM}} {{Cl|SHARED}} ResolveStaticFunction_Name({{Text|1|#F580B1}} {{Cl|TO}} {{Text|100|#F580B1}}) {{Cl|AS}} {{Cl|STRING}}
{{Cl|REDIM}} {{Cl|SHARED}} ResolveStaticFunction_Method({{Text|1|#F580B1}} {{Cl|TO}} {{Text|100|#F580B1}}) {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} Error_Happened {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} Error_Message {{Cl|AS}} {{Cl|STRING}}
{{Cl|DIM}} {{Cl|SHARED}} os {{Cl|AS}} {{Cl|STRING}}
os$ = {{Text|<nowiki>"WIN"</nowiki>|#FFB100}}
{{Cl|IF}} {{Cl|INSTR}}({{Cl|_OS$}}, {{Text|<nowiki>"[LINUX]"</nowiki>|#FFB100}}) {{Cl|THEN}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}}
{{Cl|DIM}} {{Cl|SHARED}} MacOSX {{Cl|AS}} {{Cl|LONG}}
{{Cl|IF}} {{Cl|INSTR}}({{Cl|_OS$}}, {{Text|<nowiki>"[MACOSX]"</nowiki>|#FFB100}}) {{Cl|THEN}} MacOSX = {{Text|1|#F580B1}}
{{Cl|DIM}} {{Cl|SHARED}} inline_DATA
{{Cl|IF}} MacOSX {{Cl|THEN}} inline_DATA = {{Text|1|#F580B1}}
{{Cl|DIM}} {{Cl|SHARED}} BATCHFILE_EXTENSION {{Cl|AS}} {{Cl|STRING}}
BATCHFILE_EXTENSION = {{Text|<nowiki>".bat"</nowiki>|#FFB100}}
{{Cl|IF}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Cl|THEN}} BATCHFILE_EXTENSION = {{Text|<nowiki>".sh"</nowiki>|#FFB100}}
{{Cl|IF}} MacOSX {{Cl|THEN}} BATCHFILE_EXTENSION = {{Text|<nowiki>".command"</nowiki>|#FFB100}}
{{Cl|DIM}} inlinedatastr({{Text|255|#F580B1}}) {{Cl|AS}} {{Cl|STRING}}
{{Cl|FOR}} i = {{Text|0|#F580B1}} {{Cl|TO}} {{Text|255|#F580B1}}
    inlinedatastr(i) = {{Text|str2$|#55FF55}}(i) + {{Text|<nowiki>","</nowiki>|#FFB100}}
{{Cl|NEXT}}
{{Cl|DIM}} {{Cl|SHARED}} extension {{Cl|AS}} {{Cl|STRING}}
{{Cl|DIM}} {{Cl|SHARED}} path.exe$, path.source$, lastBinaryGenerated$
extension$ = {{Text|<nowiki>".exe"</nowiki>|#FFB100}}
{{Cl|IF}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Cl|THEN}} extension$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Text|<nowiki>'no extension under Linux</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} pathsep {{Cl|AS}} {{Cl|STRING}} * {{Text|1|#F580B1}}
pathsep$ = {{Text|<nowiki>"\"</nowiki>|#FFB100}}
{{Cl|IF}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Cl|THEN}} pathsep$ = {{Text|<nowiki>"/"</nowiki>|#FFB100}}
{{Text|<nowiki>'note: QB64 handles OS specific path separators automatically except under SHELL calls</nowiki>|#919191}}
{{Cl|ON}} {{Cl|ERROR}} {{Cl|GOTO}} qberror_test
{{Cl|DIM}} {{Cl|SHARED}} tmpdir {{Cl|AS}} {{Cl|STRING}}, tmpdir2 {{Cl|AS}} {{Cl|STRING}}
{{Cl|IF}} os$ = {{Text|<nowiki>"WIN"</nowiki>|#FFB100}} {{Cl|THEN}} tmpdir$ = {{Text|<nowiki>".\internal\temp\"</nowiki>|#FFB100}}: tmpdir2$ = {{Text|<nowiki>"..\\temp\\"</nowiki>|#FFB100}}
{{Cl|IF}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Cl|THEN}} tmpdir$ = {{Text|<nowiki>"./internal/temp/"</nowiki>|#FFB100}}: tmpdir2$ = {{Text|<nowiki>"../temp/"</nowiki>|#FFB100}}
{{Cl|IF}} {{Cl|NOT}} {{Cl|_DIREXISTS}}(tmpdir$) {{Cl|THEN}} {{Cl|MKDIR}} tmpdir$
{{Cl|DECLARE}} {{Cl|LIBRARY}}
    {{Cl|FUNCTION}} {{Text|getpid&|#55FF55}} ()
{{Cl|END}} {{Cl|DECLARE}}
thisinstancepid = {{Text|getpid&|#55FF55}}
{{Cl|DIM}} {{Cl|SHARED}} tempfolderindex
{{Cl|IF}} {{Cl|INSTR}}({{Cl|_OS$}}, {{Text|<nowiki>"LINUX"</nowiki>|#FFB100}}) {{Cl|THEN}}
    fh = {{Cl|FREEFILE}}
    {{Cl|OPEN}} {{Text|<nowiki>".\internal\temp\tempfoldersearch.bin"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|RANDOM}} {{Cl|OPEN|AS}} #fh {{Cl|OPEN|LEN}} = {{Cl|OPEN|LEN}}(tempfolderindex)
    tempfolderrecords = {{Cl|LOF}}(fh) / {{Cl|LEN}}(tempfolderindex)
    i = {{Text|1|#F580B1}}
    {{Cl|IF}} tempfolderrecords = {{Text|0|#F580B1}} {{Cl|THEN}}
        {{Text|<nowiki>'first run ever?</nowiki>|#919191}}
        {{Cl|PUT}} #fh, {{Text|1|#F580B1}}, thisinstancepid
    {{Cl|ELSE}}
        {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} tempfolderrecords
            {{Text|<nowiki>'check if any of the temp folders is being used = pid still active</nowiki>|#919191}}
            {{Cl|GET}} #fh, i, tempfoldersearch
            {{Cl|SHELL}} {{Cl|_HIDE}} {{Text|<nowiki>"ps -p "</nowiki>|#FFB100}} + {{Cl|STR$}}(tempfoldersearch) + {{Text|<nowiki>" > /dev/null 2>&1; echo $? > internal/temp/checkpid.bin"</nowiki>|#FFB100}}
            fh2 = {{Cl|FREEFILE}}
            {{Cl|OPEN}} {{Text|<nowiki>"internal/temp/checkpid.bin"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|BINARY}} {{Cl|OPEN|AS}} #fh2
            {{Cl|LINE INPUT (file statement)|LINE INPUT}} #fh2, checkpid$
            {{Cl|CLOSE}} #fh2
            {{Cl|IF}} {{Cl|VAL}}(checkpid$) = {{Text|1|#F580B1}} {{Cl|THEN}}
                {{Text|<nowiki>'This temp folder was locked by an instance that's no longer active, so</nowiki>|#919191}}
                {{Text|<nowiki>'this will be our temp folder</nowiki>|#919191}}
                {{Cl|PUT}} #fh, i, thisinstancepid
                {{Cl|EXIT}} {{Cl|FOR}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|NEXT}}
        {{Cl|IF}} i > tempfolderrecords {{Cl|THEN}}
            {{Text|<nowiki>'All indexes were busy. Let's initiate a new one:</nowiki>|#919191}}
            {{Cl|PUT}} #fh, i, thisinstancepid
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|CLOSE}} #fh
    {{Cl|IF}} i > {{Text|1|#F580B1}} {{Cl|THEN}}
        tmpdir$ = {{Text|<nowiki>"./internal/temp"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(i) + {{Text|<nowiki>"/"</nowiki>|#FFB100}}: tmpdir2$ = {{Text|<nowiki>"../temp"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(i) + {{Text|<nowiki>"/"</nowiki>|#FFB100}}
        {{Cl|IF}} {{Cl|_DIREXISTS}}(tmpdir$) = {{Text|0|#F580B1}} {{Cl|THEN}}
            {{Cl|MKDIR}} tmpdir$
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|OPEN}} tmpdir$ + {{Text|<nowiki>"temp.bin"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|OUTPUT}} {{Cl|OPEN#File_ACCESS_and_LOCK_Permissions|LOCK}} {{Cl|OPEN#File_ACCESS_and_LOCK_Permissions|WRITE}} {{Cl|OPEN|AS}} #26
{{Cl|ELSE}}
    {{Cl|ON}} {{Cl|ERROR}} {{Cl|GOTO}} qberror_test
    E = {{Text|0|#F580B1}}
    i = {{Text|1|#F580B1}}
    {{Cl|OPEN}} tmpdir$ + {{Text|<nowiki>"temp.bin"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|OUTPUT}} {{Cl|OPEN#File_ACCESS_and_LOCK_Permissions|LOCK}} {{Cl|OPEN#File_ACCESS_and_LOCK_Permissions|WRITE}} {{Cl|OPEN|AS}} #26
    {{Cl|DO}} {{Cl|WHILE}} E
        i = i + {{Text|1|#F580B1}}
        {{Cl|IF}} i = {{Text|1000|#F580B1}} {{Cl|THEN}} {{Cl|PRINT}} {{Text|<nowiki>"Unable to locate the 'internal' folder"</nowiki>|#FFB100}}: {{Cl|END}} {{Text|1|#F580B1}}
        {{Cl|MKDIR}} {{Text|<nowiki>".\internal\temp"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(i)
        {{Cl|IF}} os$ = {{Text|<nowiki>"WIN"</nowiki>|#FFB100}} {{Cl|THEN}} tmpdir$ = {{Text|<nowiki>".\internal\temp"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(i) + {{Text|<nowiki>"\"</nowiki>|#FFB100}}: tmpdir2$ = {{Text|<nowiki>"..\\temp"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(i) + {{Text|<nowiki>"\\"</nowiki>|#FFB100}}
        {{Cl|IF}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Cl|THEN}} tmpdir$ = {{Text|<nowiki>"./internal/temp"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(i) + {{Text|<nowiki>"/"</nowiki>|#FFB100}}: tmpdir2$ = {{Text|<nowiki>"../temp"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(i) + {{Text|<nowiki>"/"</nowiki>|#FFB100}}
        E = {{Text|0|#F580B1}}
        {{Cl|OPEN}} tmpdir$ + {{Text|<nowiki>"temp.bin"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|OUTPUT}} {{Cl|OPEN#File_ACCESS_and_LOCK_Permissions|LOCK}} {{Cl|OPEN#File_ACCESS_and_LOCK_Permissions|WRITE}} {{Cl|OPEN|AS}} #26
    {{Cl|LOOP}}
{{Cl|END}} {{Cl|IF}}
{{Text|<nowiki>'temp folder established</nowiki>|#919191}}
tempfolderindex = i
{{Cl|IF}} i > {{Text|1|#F580B1}} {{Cl|THEN}}
    {{Text|<nowiki>'create modified version of qbx.cpp</nowiki>|#919191}}
    {{Cl|OPEN}} {{Text|<nowiki>".\internal\c\qbx"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(i) + {{Text|<nowiki>".cpp"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|OUTPUT}} {{Cl|OPEN|AS}} #2
    {{Cl|OPEN}} {{Text|<nowiki>".\internal\c\qbx.cpp"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|BINARY}} {{Cl|OPEN|AS}} #1
    {{Cl|DO}} {{Cl|UNTIL}} {{Cl|EOF}}({{Text|1|#F580B1}})
        {{Cl|LINE INPUT (file statement)|LINE INPUT}} #1, a$
        x = {{Cl|INSTR}}(a$, {{Text|<nowiki>"..\\temp\\"</nowiki>|#FFB100}}): {{Cl|IF}} x {{Cl|THEN}} a$ = {{Cl|LEFT$}}(a$, x - {{Text|1|#F580B1}}) + {{Text|<nowiki>"..\\temp"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(i) + {{Text|<nowiki>"\\"</nowiki>|#FFB100}} + {{Cl|RIGHT$}}(a$, {{Cl|LEN}}(a$) - (x + {{Text|9|#F580B1}}))
        x = {{Cl|INSTR}}(a$, {{Text|<nowiki>"../temp/"</nowiki>|#FFB100}}): {{Cl|IF}} x {{Cl|THEN}} a$ = {{Cl|LEFT$}}(a$, x - {{Text|1|#F580B1}}) + {{Text|<nowiki>"../temp"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(i) + {{Text|<nowiki>"/"</nowiki>|#FFB100}} + {{Cl|RIGHT$}}(a$, {{Cl|LEN}}(a$) - (x + {{Text|7|#F580B1}}))
        {{Cl|PRINT (file statement)|PRINT}} #2, a$
    {{Cl|LOOP}}
    {{Cl|CLOSE}} #1, #2
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} Debug {{Cl|THEN}} {{Cl|OPEN}} tmpdir$ + {{Text|<nowiki>"debug.txt"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|OUTPUT}} {{Cl|OPEN|AS}} #9
{{Cl|ON}} {{Cl|ERROR}} {{Cl|GOTO}} qberror
{{Cl|DIM}} {{Cl|SHARED}} tempfolderindexstr {{Cl|AS}} {{Cl|STRING}} {{Text|<nowiki>'appended to "Untitled"</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} tempfolderindexstr2 {{Cl|AS}} {{Cl|STRING}}
{{Cl|IF}} tempfolderindex <> {{Text|1|#F580B1}} {{Cl|THEN}} tempfolderindexstr$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(tempfolderindex) + {{Text|<nowiki>")"</nowiki>|#FFB100}}: tempfolderindexstr2$ = {{Text|str2$|#55FF55}}(tempfolderindex)
{{Cl|DIM}} {{Cl|SHARED}} idedebuginfo
{{Cl|DIM}} {{Cl|SHARED}} seperateargs_error
{{Cl|DIM}} {{Cl|SHARED}} seperateargs_error_message {{Cl|AS}} {{Cl|STRING}}
{{Cl|DIM}} {{Cl|SHARED}} compfailed
{{Cl|DIM}} {{Cl|SHARED}} reginternalsubfunc
{{Cl|DIM}} {{Cl|SHARED}} reginternalvariable
{{Cl|DIM}} {{Cl|SHARED}} symboltype_size
symboltype_size = {{Text|0|#F580B1}}
{{Cl|DIM}} {{Cl|SHARED}} use_global_byte_elements
use_global_byte_elements = {{Text|0|#F580B1}}
{{Text|<nowiki>'compiler-side IDE data & definitions</nowiki>|#919191}}
{{Text|<nowiki>'SHARED variables "passed" to/from the compiler & IDE</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} idecommand {{Cl|AS}} {{Cl|STRING}} {{Text|<nowiki>'a 1 byte message-type code, followed by optional string data</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} idereturn {{Cl|AS}} {{Cl|STRING}} {{Text|<nowiki>'used to pass formatted-lines and return information back to the IDE</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} ideerror {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} idecompiled {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} idemode {{Text|<nowiki>'1 if using the IDE to compile</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} ideerrorline {{Cl|AS}} {{Cl|LONG}} {{Text|<nowiki>'set by qb64-error(...) to the line number it would have reported, this number</nowiki>|#919191}}
{{Text|<nowiki>'is later passed to the ide in message #8</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} idemessage {{Cl|AS}} {{Cl|STRING}} {{Text|<nowiki>'set by qb64-error(...) to the error message to be reported, this</nowiki>|#919191}}
{{Text|<nowiki>'is later passed to the ide in message #8</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} optionexplicit {{Cl|AS}} {{Cl|_BYTE}}
{{Cl|DIM}} {{Cl|SHARED}} optionexplicitarray {{Cl|AS}} {{Cl|_BYTE}}
{{Cl|DIM}} {{Cl|SHARED}} optionexplicit_cmd {{Cl|AS}} {{Cl|_BYTE}}
{{Cl|DIM}} {{Cl|SHARED}} ideStartAtLine {{Cl|AS}} {{Cl|LONG}}, errorLineInInclude {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} warningInInclude {{Cl|AS}} {{Cl|LONG}}, warningInIncludeLine {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} outputfile_cmd$
{{Cl|DIM}} {{Cl|SHARED}} compilelog$
{{Text|<nowiki>'</nowiki>|#919191}}{{Cm|$INCLUDE}}:{{Text|<nowiki>'global\IDEsettings.bas'</nowiki>|#919191}}
{{Cl|DIM}} OutputIsRelativeToStartDir {{Cl|AS}} {{Cl|LONG}}
CMDLineFile = {{Text|ParseCMDLineArgs$|#55FF55}}
{{Cl|IF}} CMDLineFile <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} {{Cl|_FILEEXISTS}}({{Cl|_STARTDIR$}} + {{Text|<nowiki>"/"</nowiki>|#FFB100}} + CMDLineFile) {{Cl|THEN}}
    CMDLineFile = {{Cl|_STARTDIR$}} + {{Text|<nowiki>"/"</nowiki>|#FFB100}} + CMDLineFile
    OutputIsRelativeToStartDir = {{Text|-1|#F580B1}}
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} ConsoleMode {{Cl|THEN}}
    {{Cl|_DEST}} {{Cl|_CONSOLE}}
{{Cl|ELSE}}
    {{Cl|_CONSOLE}} {{Cl|OFF}}
    {{Cl|_SCREENSHOW}}
    {{Cl|_ICON}}
{{Cl|END}} {{Cl|IF}}
{{Text|<nowiki>'the function ?=ide(?) should always be passed 0, it returns a message code number, any further information</nowiki>|#919191}}
{{Text|<nowiki>'is passed back in idereturn</nowiki>|#919191}}
{{Text|<nowiki>'message code numbers:</nowiki>|#919191}}
{{Text|<nowiki>'0  no ide present  (auto defined array ide() return 0)</nowiki>|#919191}}
{{Text|<nowiki>'1  launch ide & with passed filename (compiler->ide)</nowiki>|#919191}}
{{Text|<nowiki>'2  begin new compilation with returned line of code (compiler<-ide)</nowiki>|#919191}}
{{Text|<nowiki>'  [2][line of code]</nowiki>|#919191}}
{{Text|<nowiki>'3  request next line (compiler->ide)</nowiki>|#919191}}
{{Text|<nowiki>'  [3]</nowiki>|#919191}}
{{Text|<nowiki>'4  next line of code returned (compiler<-ide)</nowiki>|#919191}}
{{Text|<nowiki>'  [4][line of code]</nowiki>|#919191}}
{{Text|<nowiki>'5  no more lines of code exist (compiler<-ide)</nowiki>|#919191}}
{{Text|<nowiki>'  [5]</nowiki>|#919191}}
{{Text|<nowiki>'6  code is OK/ready (compiler->ide)</nowiki>|#919191}}
{{Text|<nowiki>'  [6]</nowiki>|#919191}}
{{Text|<nowiki>'7  repass the code from the beginning (compiler->ide)</nowiki>|#919191}}
{{Text|<nowiki>'  [7]</nowiki>|#919191}}
{{Text|<nowiki>'8  an error has occurred with 'this' message on 'this' line(compiler->ide)</nowiki>|#919191}}
{{Text|<nowiki>'  [8][error message][line as LONG]</nowiki>|#919191}}
{{Text|<nowiki>'9  C++ compile (if necessary) and run with 'this' name (compiler<-ide)</nowiki>|#919191}}
{{Text|<nowiki>'  [9][name(no path, no .bas)]</nowiki>|#919191}}
{{Text|<nowiki>'10 The line requires more time to process</nowiki>|#919191}}
{{Text|<nowiki>'      Pass-back 'line of code' using method [4] when ready</nowiki>|#919191}}
{{Text|<nowiki>'  [10][line of code]</nowiki>|#919191}}
{{Text|<nowiki>'11 ".EXE file created" message</nowiki>|#919191}}
{{Text|<nowiki>'12    The name of the exe I'll create is '...' (compiler->ide)</nowiki>|#919191}}
{{Text|<nowiki>'  [12][exe name without .exe]</nowiki>|#919191}}
{{Text|<nowiki>'255    A qb error happened in the IDE (compiler->ide)</nowiki>|#919191}}
{{Text|<nowiki>'  note: detected by the fact that ideerror was not set to 0</nowiki>|#919191}}
{{Text|<nowiki>'  [255]</nowiki>|#919191}}
{{Text|<nowiki>'hash table data</nowiki>|#919191}}
{{Cl|TYPE}} HashListItem
    Flags {{Cl|AS}} {{Cl|LONG}}
    Reference {{Cl|AS}} {{Cl|LONG}}
    NextItem {{Cl|AS}} {{Cl|LONG}}
    PrevItem {{Cl|AS}} {{Cl|LONG}}
    LastItem {{Cl|AS}} {{Cl|LONG}} {{Text|<nowiki>'note: this value is only valid on the first item in the list</nowiki>|#919191}}
    {{Text|<nowiki>'note: name is stored in a seperate array of strings</nowiki>|#919191}}
{{Cl|END}} {{Cl|TYPE}}
{{Cl|DIM}} {{Cl|SHARED}} HashFind_NextListItem {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} HashFind_Reverse {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} HashFind_SearchFlags {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} HashFind_Name {{Cl|AS}} {{Cl|STRING}}
{{Cl|DIM}} {{Cl|SHARED}} HashRemove_LastFound {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} HashListSize {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} HashListNext {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} HashListFreeSize {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} HashListFreeLast {{Cl|AS}} {{Cl|LONG}}
{{Text|<nowiki>'hash lookup tables</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} hash1char({{Text|255|#F580B1}}) {{Cl|AS}} {{Cl|INTEGER}}
{{Cl|DIM}} {{Cl|SHARED}} hash2char({{Text|65535|#F580B1}}) {{Cl|AS}} {{Cl|INTEGER}}
{{Cl|FOR}} x = {{Text|1|#F580B1}} {{Cl|TO}} {{Text|26|#F580B1}}
    hash1char({{Text|64|#F580B1}} + x) = x
    hash1char({{Text|96|#F580B1}} + x) = x
{{Cl|NEXT}}
hash1char({{Text|95|#F580B1}}) = {{Text|27|#F580B1}} {{Text|<nowiki>'_</nowiki>|#919191}}
hash1char({{Text|48|#F580B1}}) = {{Text|28|#F580B1}} {{Text|<nowiki>'0</nowiki>|#919191}}
hash1char({{Text|49|#F580B1}}) = {{Text|29|#F580B1}} {{Text|<nowiki>'1</nowiki>|#919191}}
hash1char({{Text|50|#F580B1}}) = {{Text|30|#F580B1}} {{Text|<nowiki>'2</nowiki>|#919191}}
hash1char({{Text|51|#F580B1}}) = {{Text|31|#F580B1}} {{Text|<nowiki>'3</nowiki>|#919191}}
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>|#919191}}
hash1char({{Text|53|#F580B1}}) = {{Text|22|#F580B1}} {{Text|<nowiki>'5</nowiki>|#919191}}
hash1char({{Text|54|#F580B1}}) = {{Text|20|#F580B1}} {{Text|<nowiki>'6</nowiki>|#919191}}
hash1char({{Text|55|#F580B1}}) = {{Text|19|#F580B1}} {{Text|<nowiki>'7</nowiki>|#919191}}
hash1char({{Text|56|#F580B1}}) = {{Text|18|#F580B1}} {{Text|<nowiki>'8</nowiki>|#919191}}
hash1char({{Text|57|#F580B1}}) = {{Text|17|#F580B1}} {{Text|<nowiki>'9</nowiki>|#919191}}
{{Cl|FOR}} c1 = {{Text|0|#F580B1}} {{Cl|TO}} {{Text|255|#F580B1}}
    {{Cl|FOR}} c2 = {{Text|0|#F580B1}} {{Cl|TO}} {{Text|255|#F580B1}}
        hash2char(c1 + c2 * {{Text|256|#F580B1}}) = hash1char(c1) + hash1char(c2) * {{Text|32|#F580B1}}
    {{Cl|NEXT}}
{{Cl|NEXT}}
{{Text|<nowiki>'init</nowiki>|#919191}}
HashListSize = {{Text|65536|#F580B1}}
HashListNext = {{Text|1|#F580B1}}
HashListFreeSize = {{Text|1024|#F580B1}}
HashListFreeLast = {{Text|0|#F580B1}}
{{Cl|REDIM}} {{Cl|SHARED}} HashList({{Text|1|#F580B1}} {{Cl|TO}} HashListSize) {{Cl|AS}} HashListItem
{{Cl|REDIM}} {{Cl|SHARED}} HashListName({{Text|1|#F580B1}} {{Cl|TO}} HashListSize) {{Cl|AS}} {{Cl|STRING}} * {{Text|256|#F580B1}}
{{Cl|REDIM}} {{Cl|SHARED}} HashListFree({{Text|1|#F580B1}} {{Cl|TO}} HashListFreeSize) {{Cl|AS}} {{Cl|LONG}}
{{Cl|REDIM}} {{Cl|SHARED}} HashTable({{Text|16777215|#F580B1}}) {{Cl|AS}} {{Cl|LONG}} {{Text|<nowiki>'64MB lookup table with indexes to the hashlist</nowiki>|#919191}}
{{Cl|CONST}} HASHFLAG_LABEL = {{Text|2|#F580B1}}
{{Cl|CONST}} HASHFLAG_TYPE = {{Text|4|#F580B1}}
{{Cl|CONST}} HASHFLAG_RESERVED = {{Text|8|#F580B1}}
{{Cl|CONST}} HASHFLAG_OPERATOR = {{Text|16|#F580B1}}
{{Cl|CONST}} HASHFLAG_CUSTOMSYNTAX = {{Text|32|#F580B1}}
{{Cl|CONST}} HASHFLAG_SUB = {{Text|64|#F580B1}}
{{Cl|CONST}} HASHFLAG_FUNCTION = {{Text|128|#F580B1}}
{{Cl|CONST}} HASHFLAG_UDT = {{Text|256|#F580B1}}
{{Cl|CONST}} HASHFLAG_UDTELEMENT = {{Text|512|#F580B1}}
{{Cl|CONST}} HASHFLAG_CONSTANT = {{Text|1024|#F580B1}}
{{Cl|CONST}} HASHFLAG_VARIABLE = {{Text|2048|#F580B1}}
{{Cl|CONST}} HASHFLAG_ARRAY = {{Text|4096|#F580B1}}
{{Cl|CONST}} HASHFLAG_XELEMENTNAME = {{Text|8192|#F580B1}}
{{Cl|CONST}} HASHFLAG_XTYPENAME = {{Text|16384|#F580B1}}
{{Cl|TYPE}} Label_Type
    State {{Cl|AS}} {{Cl|_UNSIGNED}} {{Cl|_BYTE}} {{Text|<nowiki>'0=label referenced, 1=label created</nowiki>|#919191}}
    cn {{Cl|AS}} {{Cl|STRING}} * {{Text|256|#F580B1}}
    {{Text|Scope|#55FF55}} {{Cl|AS}} {{Cl|LONG}}
    Data_Offset {{Cl|AS}} {{Cl|_INTEGER64}} {{Text|<nowiki>'offset within data</nowiki>|#919191}}
    Data_Referenced {{Cl|AS}} {{Cl|_UNSIGNED}} {{Cl|_BYTE}} {{Text|<nowiki>'set to 1 if data is referenced (data_offset will be used to create the data offset variable)</nowiki>|#919191}}
    Error_Line {{Cl|AS}} {{Cl|LONG}} {{Text|<nowiki>'the line number to reference on errors</nowiki>|#919191}}
    Scope_Restriction {{Cl|AS}} {{Cl|LONG}} {{Text|<nowiki>'cannot exist inside this scope (post checked)</nowiki>|#919191}}
    SourceLineNumber {{Cl|AS}} {{Cl|LONG}}
{{Cl|END}} {{Cl|TYPE}}
{{Cl|DIM}} {{Cl|SHARED}} nLabels, Labels_Ubound
Labels_Ubound = {{Text|100|#F580B1}}
{{Cl|REDIM}} {{Cl|SHARED}} Labels({{Text|1|#F580B1}} {{Cl|TO}} Labels_Ubound) {{Cl|AS}} Label_Type
{{Cl|DIM}} {{Cl|SHARED}} Empty_Label {{Cl|AS}} Label_Type
{{Cl|DIM}} {{Cl|SHARED}} PossibleSubNameLabels {{Cl|AS}} {{Cl|STRING}} {{Text|<nowiki>'format: name+sp+name+sp+name <-ucase$'d</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} SubNameLabels {{Cl|AS}} {{Cl|STRING}} {{Text|<nowiki>'format: name+sp+name+sp+name <-ucase$'d</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} CreatingLabel {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} AllowLocalName {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} DataOffset
{{Cl|DIM}} {{Cl|SHARED}} prepass
{{Cl|DIM}} {{Cl|SHARED}} autoarray
{{Cl|DIM}} {{Cl|SHARED}} ontimerid, onkeyid, onstrigid
{{Cl|DIM}} {{Cl|SHARED}} revertmaymusthave({{Text|1|#F580B1}} {{Cl|TO}} {{Text|10000|#F580B1}})
{{Cl|DIM}} {{Cl|SHARED}} revertmaymusthaven
{{Cl|DIM}} {{Cl|SHARED}} linecontinuation
{{Cl|DIM}} {{Cl|SHARED}} dim2typepassback {{Cl|AS}} {{Cl|STRING}} {{Text|<nowiki>'passes back correct case sensitive version of type</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} inclevel
{{Cl|DIM}} {{Cl|SHARED}} incname({{Text|100|#F580B1}}) {{Cl|AS}} {{Cl|STRING}} {{Text|<nowiki>'must be full path as given</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} inclinenumber({{Text|100|#F580B1}}) {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} incerror {{Cl|AS}} {{Cl|STRING}}
{{Cl|DIM}} {{Cl|SHARED}} fix046 {{Cl|AS}} {{Cl|STRING}}
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>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} layout {{Cl|AS}} {{Cl|STRING}} {{Text|<nowiki>'passed to IDE</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} layoutok {{Cl|AS}} {{Cl|LONG}} {{Text|<nowiki>'tracks status of entire line</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} layoutcomment {{Cl|AS}} {{Cl|STRING}}
{{Cl|DIM}} {{Cl|SHARED}} tlayout {{Cl|AS}} {{Cl|STRING}} {{Text|<nowiki>'temporary layout string set by supporting functions</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} layoutdone {{Cl|AS}} {{Cl|LONG}} {{Text|<nowiki>'tracks status of single command</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} fooindwel
{{Cl|DIM}} {{Cl|SHARED}} alphanumeric({{Text|255|#F580B1}})
{{Cl|FOR}} i = {{Text|48|#F580B1}} {{Cl|TO}} {{Text|57|#F580B1}}
    alphanumeric(i) = {{Text|-1|#F580B1}}
{{Cl|NEXT}}
{{Cl|FOR}} i = {{Text|65|#F580B1}} {{Cl|TO}} {{Text|90|#F580B1}}
    alphanumeric(i) = {{Text|-1|#F580B1}}
{{Cl|NEXT}}
{{Cl|FOR}} i = {{Text|97|#F580B1}} {{Cl|TO}} {{Text|122|#F580B1}}
    alphanumeric(i) = {{Text|-1|#F580B1}}
{{Cl|NEXT}}
{{Text|<nowiki>'_ is treated as an alphabet letter</nowiki>|#919191}}
alphanumeric({{Text|95|#F580B1}}) = {{Text|-1|#F580B1}}
{{Cl|DIM}} {{Cl|SHARED}} isalpha({{Text|255|#F580B1}})
{{Cl|FOR}} i = {{Text|65|#F580B1}} {{Cl|TO}} {{Text|90|#F580B1}}
    isalpha(i) = {{Text|-1|#F580B1}}
{{Cl|NEXT}}
{{Cl|FOR}} i = {{Text|97|#F580B1}} {{Cl|TO}} {{Text|122|#F580B1}}
    isalpha(i) = {{Text|-1|#F580B1}}
{{Cl|NEXT}}
{{Text|<nowiki>'_ is treated as an alphabet letter</nowiki>|#919191}}
isalpha({{Text|95|#F580B1}}) = {{Text|-1|#F580B1}}
{{Cl|DIM}} {{Cl|SHARED}} isnumeric({{Text|255|#F580B1}})
{{Cl|FOR}} i = {{Text|48|#F580B1}} {{Cl|TO}} {{Text|57|#F580B1}}
    isnumeric(i) = {{Text|-1|#F580B1}}
{{Cl|NEXT}}
{{Cl|DIM}} {{Cl|SHARED}} lfsinglechar({{Text|255|#F580B1}})
lfsinglechar({{Text|40|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>'(</nowiki>|#919191}}
lfsinglechar({{Text|41|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>')</nowiki>|#919191}}
lfsinglechar({{Text|42|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>'*</nowiki>|#919191}}
lfsinglechar({{Text|43|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>'+</nowiki>|#919191}}
lfsinglechar({{Text|45|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>'-</nowiki>|#919191}}
lfsinglechar({{Text|47|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>'/</nowiki>|#919191}}
lfsinglechar({{Text|60|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>'<</nowiki>|#919191}}
lfsinglechar({{Text|61|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>'=</nowiki>|#919191}}
lfsinglechar({{Text|62|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>'></nowiki>|#919191}}
lfsinglechar({{Text|92|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>'\</nowiki>|#919191}}
lfsinglechar({{Text|94|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>'^</nowiki>|#919191}}
lfsinglechar({{Text|44|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>',</nowiki>|#919191}}
lfsinglechar({{Text|46|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>'.</nowiki>|#919191}}
lfsinglechar({{Text|58|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>':</nowiki>|#919191}}
lfsinglechar({{Text|59|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>';</nowiki>|#919191}}
lfsinglechar({{Text|35|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>'# (file no only)</nowiki>|#919191}}
lfsinglechar({{Text|36|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>'$ (metacommand only)</nowiki>|#919191}}
lfsinglechar({{Text|63|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>'? (print macro)</nowiki>|#919191}}
lfsinglechar({{Text|95|#F580B1}}) = {{Text|1|#F580B1}} {{Text|<nowiki>'_</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} nextrunlineindex {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} lineinput3buffer {{Cl|AS}} {{Cl|STRING}}
{{Cl|DIM}} {{Cl|SHARED}} lineinput3index {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} dimstatic {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} staticarraylist {{Cl|AS}} {{Cl|STRING}}
{{Cl|DIM}} {{Cl|SHARED}} staticarraylistn {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} commonarraylist {{Cl|AS}} {{Cl|STRING}}
{{Cl|DIM}} {{Cl|SHARED}} commonarraylistn {{Cl|AS}} {{Cl|LONG}}
{{Text|<nowiki>'CONST support</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} constmax {{Cl|AS}} {{Cl|LONG}}
constmax = {{Text|100|#F580B1}}
{{Cl|DIM}} {{Cl|SHARED}} constlast {{Cl|AS}} {{Cl|LONG}}
constlast = {{Text|-1|#F580B1}}
{{Cl|REDIM}} {{Cl|SHARED}} constname(constmax) {{Cl|AS}} {{Cl|STRING}}
{{Cl|REDIM}} {{Cl|SHARED}} constcname(constmax) {{Cl|AS}} {{Cl|STRING}}
{{Cl|REDIM}} {{Cl|SHARED}} constnamesymbol(constmax) {{Cl|AS}} {{Cl|STRING}} {{Text|<nowiki>'optional name symbol</nowiki>|#919191}}
{{Text|<nowiki>' `1 and `no-number must be handled correctly</nowiki>|#919191}}
{{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>|#919191}}
{{Text|<nowiki>'constlastshared = -1</nowiki>|#919191}}
{{Cl|REDIM}} {{Cl|SHARED}} consttype(constmax) {{Cl|AS}} {{Cl|LONG}} {{Text|<nowiki>'variable type number</nowiki>|#919191}}
{{Text|<nowiki>'consttype determines storage</nowiki>|#919191}}
{{Cl|REDIM}} {{Cl|SHARED}} constinteger(constmax) {{Cl|AS}} {{Cl|_INTEGER64}}
{{Cl|REDIM}} {{Cl|SHARED}} constuinteger(constmax) {{Cl|AS}} {{Cl|_UNSIGNED}} {{Cl|_INTEGER64}}
{{Cl|REDIM}} {{Cl|SHARED}} constfloat(constmax) {{Cl|AS}} {{Cl|_FLOAT}}
{{Cl|REDIM}} {{Cl|SHARED}} conststring(constmax) {{Cl|AS}} {{Cl|STRING}}
{{Cl|REDIM}} {{Cl|SHARED}} constsubfunc(constmax) {{Cl|AS}} {{Cl|LONG}}
{{Cl|REDIM}} {{Cl|SHARED}} constdefined(constmax) {{Cl|AS}} {{Cl|LONG}}
{{Text|<nowiki>'UDT</nowiki>|#919191}}
{{Text|<nowiki>'names</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} lasttype {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} lasttypeelement {{Cl|AS}} {{Cl|LONG}}
{{Cl|TYPE}} idstruct
    n {{Cl|AS}} {{Cl|STRING}} * {{Text|256|#F580B1}} {{Text|<nowiki>'name</nowiki>|#919191}}
    cn {{Cl|AS}} {{Cl|STRING}} * {{Text|256|#F580B1}} {{Text|<nowiki>'case sensitive version of n</nowiki>|#919191}}
    arraytype {{Cl|AS}} {{Cl|LONG}} {{Text|<nowiki>'similar to t</nowiki>|#919191}}
    arrayelements {{Cl|AS}} {{Cl|INTEGER}}
    staticarray {{Cl|AS}} {{Cl|INTEGER}} {{Text|<nowiki>'set for arrays declared in the main module with static elements</nowiki>|#919191}}
    mayhave {{Cl|AS}} {{Cl|STRING}} * {{Text|8|#F580B1}} {{Text|<nowiki>'mayhave and musthave are exclusive of each other</nowiki>|#919191}}
    musthave {{Cl|AS}} {{Cl|STRING}} * {{Text|8|#F580B1}}
    t {{Cl|AS}} {{Cl|LONG}} {{Text|<nowiki>'type</nowiki>|#919191}}
    tsize {{Cl|AS}} {{Cl|LONG}}
    subfunc {{Cl|AS}} {{Cl|INTEGER}} {{Text|<nowiki>'if function=1, sub=2 (max 100 arguments)</nowiki>|#919191}}
    Dependency {{Cl|AS}} {{Cl|INTEGER}}
    internal_subfunc {{Cl|AS}} {{Cl|INTEGER}}
    callname {{Cl|AS}} {{Cl|STRING}} * {{Text|256|#F580B1}}
    ccall {{Cl|AS}} {{Cl|INTEGER}}
    overloaded {{Cl|AS}} {{Cl|_BYTE}}
    args {{Cl|AS}} {{Cl|INTEGER}}
    minargs {{Cl|AS}} {{Cl|INTEGER}}
    arg {{Cl|AS}} {{Cl|STRING}} * {{Text|400|#F580B1}} {{Text|<nowiki>'similar to t</nowiki>|#919191}}
    argsize {{Cl|AS}} {{Cl|STRING}} * {{Text|400|#F580B1}} {{Text|<nowiki>'similar to tsize (used for fixed length strings)</nowiki>|#919191}}
    specialformat {{Cl|AS}} {{Cl|STRING}} * {{Text|256|#F580B1}}
    secondargmustbe {{Cl|AS}} {{Cl|STRING}} * {{Text|256|#F580B1}}
    secondargcantbe {{Cl|AS}} {{Cl|STRING}} * {{Text|256|#F580B1}}
    ret {{Cl|AS}} {{Cl|LONG}} {{Text|<nowiki>'the value it returns if it is a function (again like t)</nowiki>|#919191}}
    insubfunc {{Cl|AS}} {{Cl|STRING}} * {{Text|256|#F580B1}}
    insubfuncn {{Cl|AS}} {{Cl|LONG}}
    share {{Cl|AS}} {{Cl|INTEGER}}
    nele {{Cl|AS}} {{Cl|STRING}} * {{Text|100|#F580B1}}
    nelereq {{Cl|AS}} {{Cl|STRING}} * {{Text|100|#F580B1}}
    linkid {{Cl|AS}} {{Cl|LONG}}
    linkarg {{Cl|AS}} {{Cl|INTEGER}}
    staticscope {{Cl|AS}} {{Cl|INTEGER}}
    {{Text|<nowiki>'For variables which are arguments passed to a sub/function</nowiki>|#919191}}
    sfid {{Cl|AS}} {{Cl|LONG}} {{Text|<nowiki>'id number of variable's parent sub/function</nowiki>|#919191}}
    sfarg {{Cl|AS}} {{Cl|INTEGER}} {{Text|<nowiki>'argument/parameter # within call (1=first)</nowiki>|#919191}}
    hr_syntax {{Cl|AS}} {{Cl|STRING}}
{{Cl|END}} {{Cl|TYPE}}
{{Cl|DIM}} {{Cl|SHARED}} id {{Cl|AS}} idstruct
{{Cl|DIM}} {{Cl|SHARED}} idn {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} ids_max {{Cl|AS}} {{Cl|LONG}}
ids_max = {{Text|1024|#F580B1}}
{{Cl|REDIM}} {{Cl|SHARED}} ids({{Text|1|#F580B1}} {{Cl|TO}} ids_max) {{Cl|AS}} idstruct
{{Cl|REDIM}} {{Cl|SHARED}} cmemlist({{Text|1|#F580B1}} {{Cl|TO}} ids_max + {{Text|1|#F580B1}}) {{Cl|AS}} {{Cl|INTEGER}} {{Text|<nowiki>'variables that must be in cmem</nowiki>|#919191}}
{{Cl|REDIM}} {{Cl|SHARED}} sfcmemargs({{Text|1|#F580B1}} {{Cl|TO}} ids_max + {{Text|1|#F580B1}}) {{Cl|AS}} {{Cl|STRING}} * {{Text|100|#F580B1}} {{Text|<nowiki>'s/f arg that must be in cmem</nowiki>|#919191}}
{{Cl|REDIM}} {{Cl|SHARED}} arrayelementslist({{Text|1|#F580B1}} {{Cl|TO}} ids_max + {{Text|1|#F580B1}}) {{Cl|AS}} {{Cl|INTEGER}} {{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>|#919191}}
{{Text|<nowiki>'create blank id template for idclear to copy (stops strings being set to chr$(0))</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} cleariddata {{Cl|AS}} 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}}
{{Cl|DIM}} {{Cl|SHARED}} ISSTRING {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} ISFLOAT {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} ISUNSIGNED {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} ISPOINTER {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} ISFIXEDLENGTH {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} ISINCONVENTIONALMEMORY {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} ISOFFSETINBITS {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} ISARRAY {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} ISREFERENCE {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} ISUDT {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} ISOFFSET {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} STRINGTYPE {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} BITTYPE {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} UBITTYPE {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} BYTETYPE {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} UBYTETYPE {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} INTEGERTYPE {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} UINTEGERTYPE {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} LONGTYPE {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} ULONGTYPE {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} INTEGER64TYPE {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} UINTEGER64TYPE {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} SINGLETYPE {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} DOUBLETYPE {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} FLOATTYPE {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} OFFSETTYPE {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} UOFFSETTYPE {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} UDTTYPE {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} gosubid {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} redimoption {{Cl|AS}} {{Cl|INTEGER}}
{{Cl|DIM}} {{Cl|SHARED}} dimoption {{Cl|AS}} {{Cl|INTEGER}}
{{Cl|DIM}} {{Cl|SHARED}} arraydesc {{Cl|AS}} {{Cl|INTEGER}}
{{Cl|DIM}} {{Cl|SHARED}} qberrorhappened {{Cl|AS}} {{Cl|INTEGER}}
{{Cl|DIM}} {{Cl|SHARED}} qberrorcode {{Cl|AS}} {{Cl|INTEGER}}
{{Cl|DIM}} {{Cl|SHARED}} qberrorline {{Cl|AS}} {{Cl|INTEGER}}
{{Text|<nowiki>'COMMON SHARED defineaz() AS STRING</nowiki>|#919191}}
{{Text|<nowiki>'COMMON SHARED defineextaz() AS STRING</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} sourcefile {{Cl|AS}} {{Cl|STRING}} {{Text|<nowiki>'the full path and filename</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} file {{Cl|AS}} {{Cl|STRING}} {{Text|<nowiki>'name of the file (without .bas or path)</nowiki>|#919191}}
{{Text|<nowiki>'COMMON SHARED separgs() AS STRING</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} constequation {{Cl|AS}} {{Cl|INTEGER}}
{{Cl|DIM}} {{Cl|SHARED}} DynamicMode {{Cl|AS}} {{Cl|INTEGER}}
{{Cl|DIM}} {{Cl|SHARED}} findidsecondarg {{Cl|AS}} {{Cl|STRING}}
{{Cl|DIM}} {{Cl|SHARED}} findanotherid {{Cl|AS}} {{Cl|INTEGER}}
{{Cl|DIM}} {{Cl|SHARED}} findidinternal {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} currentid {{Cl|AS}} {{Cl|LONG}} {{Text|<nowiki>'is the index of the last ID accessed</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} linenumber {{Cl|AS}} {{Cl|LONG}}, reallinenumber {{Cl|AS}} {{Cl|LONG}}, totallinenumber {{Cl|AS}} {{Cl|LONG}}, definingtypeerror {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} wholeline {{Cl|AS}} {{Cl|STRING}}
{{Cl|DIM}} {{Cl|SHARED}} firstLineNumberLabelvWatch {{Cl|AS}} {{Cl|LONG}}, lastLineNumberLabelvWatch {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} vWatchUsedLabels {{Cl|AS}} {{Cl|STRING}}, vWatchUsedSkipLabels {{Cl|AS}} {{Cl|STRING}}
{{Cl|DIM}} {{Cl|SHARED}} linefragment {{Cl|AS}} {{Cl|STRING}}
{{Text|<nowiki>'COMMON SHARED bitmask() AS _INTEGER64</nowiki>|#919191}}
{{Text|<nowiki>'COMMON SHARED bitmaskinv() AS _INTEGER64</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} arrayprocessinghappened {{Cl|AS}} {{Cl|INTEGER}}
{{Cl|DIM}} {{Cl|SHARED}} stringprocessinghappened {{Cl|AS}} {{Cl|INTEGER}}
{{Cl|DIM}} {{Cl|SHARED}} cleanupstringprocessingcall {{Cl|AS}} {{Cl|STRING}}
{{Cl|DIM}} {{Cl|SHARED}} inputfunctioncalled {{Cl|AS}} {{Cl|_BYTE}}
{{Cl|DIM}} {{Cl|SHARED}} recompile {{Cl|AS}} {{Cl|INTEGER}} {{Text|<nowiki>'forces recompilation</nowiki>|#919191}}
{{Text|<nowiki>'COMMON SHARED cmemlist() AS INTEGER</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} optionbase {{Cl|AS}} {{Cl|INTEGER}}
{{Cl|DIM}} {{Cl|SHARED}} addmetastatic {{Cl|AS}} {{Cl|INTEGER}}
{{Cl|DIM}} {{Cl|SHARED}} addmetadynamic {{Cl|AS}} {{Cl|INTEGER}}
{{Cl|DIM}} {{Cl|SHARED}} addmetainclude {{Cl|AS}} {{Cl|STRING}}
{{Cl|DIM}} {{Cl|SHARED}} closedmain {{Cl|AS}} {{Cl|INTEGER}}
{{Cl|DIM}} {{Cl|SHARED}} module {{Cl|AS}} {{Cl|STRING}}
{{Cl|DIM}} {{Cl|SHARED}} subfunc {{Cl|AS}} {{Cl|STRING}}
{{Cl|DIM}} {{Cl|SHARED}} subfuncn {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} closedsubfunc {{Cl|AS}} {{Cl|_BYTE}}
{{Cl|DIM}} {{Cl|SHARED}} subfuncid {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} defdatahandle {{Cl|AS}} {{Cl|INTEGER}}
{{Cl|DIM}} {{Cl|SHARED}} dimsfarray {{Cl|AS}} {{Cl|INTEGER}}
{{Cl|DIM}} {{Cl|SHARED}} dimshared {{Cl|AS}} {{Cl|INTEGER}}
{{Text|<nowiki>'Allows passing of known elements to recompilation</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} sflistn {{Cl|AS}} {{Cl|INTEGER}}
{{Text|<nowiki>'COMMON SHARED sfidlist() AS LONG</nowiki>|#919191}}
{{Text|<nowiki>'COMMON SHARED sfarglist() AS INTEGER</nowiki>|#919191}}
{{Text|<nowiki>'COMMON SHARED sfelelist() AS INTEGER</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} glinkid {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} glinkarg {{Cl|AS}} {{Cl|INTEGER}}
{{Cl|DIM}} {{Cl|SHARED}} typname2typsize {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} uniquenumbern {{Cl|AS}} {{Cl|LONG}}
{{Text|<nowiki>'CLEAR , , 16384</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} bitmask({{Text|1|#F580B1}} {{Cl|TO}} {{Text|64|#F580B1}}) {{Cl|AS}} {{Cl|_INTEGER64}}
{{Cl|DIM}} {{Cl|SHARED}} bitmaskinv({{Text|1|#F580B1}} {{Cl|TO}} {{Text|64|#F580B1}}) {{Cl|AS}} {{Cl|_INTEGER64}}
{{Cl|DIM}} {{Cl|SHARED}} defineextaz({{Text|1|#F580B1}} {{Cl|TO}} {{Text|27|#F580B1}}) {{Cl|AS}} {{Cl|STRING}}
{{Cl|DIM}} {{Cl|SHARED}} defineaz({{Text|1|#F580B1}} {{Cl|TO}} {{Text|27|#F580B1}}) {{Cl|AS}} {{Cl|STRING}} {{Text|<nowiki>'27 is an underscore</nowiki>|#919191}}
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>|#919191}}
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>|#919191}}
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>|#919191}}
OFFSETTYPE = {{Text|64&|#F580B1}} + ISOFFSET + ISPOINTER: {{Cl|IF}} OS_BITS = {{Text|32|#F580B1}} {{Cl|THEN}} OFFSETTYPE = {{Text|32&|#F580B1}} + ISOFFSET + ISPOINTER
UOFFSETTYPE = {{Text|64&|#F580B1}} + ISOFFSET + ISUNSIGNED + ISPOINTER: {{Cl|IF}} OS_BITS = {{Text|32|#F580B1}} {{Cl|THEN}} UOFFSETTYPE = {{Text|32&|#F580B1}} + ISOFFSET + ISUNSIGNED + ISPOINTER
UDTTYPE = ISUDT + ISPOINTER
{{Cl|DIM}} {{Cl|SHARED}} statementn {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} everycasenewcase {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} controllevel {{Cl|AS}} {{Cl|INTEGER}} {{Text|<nowiki>'0=not in a control block</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} controltype({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|INTEGER}}
{{Text|<nowiki>'1=IF (awaiting END IF)</nowiki>|#919191}}
{{Text|<nowiki>'2=FOR (awaiting NEXT)</nowiki>|#919191}}
{{Text|<nowiki>'3=DO (awaiting LOOP [UNTIL|WHILE param])</nowiki>|#919191}}
{{Text|<nowiki>'4=DO WHILE/UNTIL (awaiting LOOP)</nowiki>|#919191}}
{{Text|<nowiki>'5=WHILE (awaiting WEND)</nowiki>|#919191}}
{{Text|<nowiki>'6=$IF (precompiler)</nowiki>|#919191}}
{{Text|<nowiki>'10=SELECT CASE qbs (awaiting END SELECT/CASE)</nowiki>|#919191}}
{{Text|<nowiki>'11=SELECT CASE int64 (awaiting END SELECT/CASE)</nowiki>|#919191}}
{{Text|<nowiki>'12=SELECT CASE uint64 (awaiting END SELECT/CASE)</nowiki>|#919191}}
{{Text|<nowiki>'13=SELECT CASE LONG double (awaiting END SELECT/CASE/CASE ELSE)</nowiki>|#919191}}
{{Text|<nowiki>'14=SELECT CASE float ...</nowiki>|#919191}}
{{Text|<nowiki>'15=SELECT CASE double</nowiki>|#919191}}
{{Text|<nowiki>'16=SELECT CASE int32</nowiki>|#919191}}
{{Text|<nowiki>'17=SELECT CASE uint32</nowiki>|#919191}}
{{Text|<nowiki>'18=CASE (awaiting END SELECT/CASE/CASE ELSE)</nowiki>|#919191}}
{{Text|<nowiki>'19=CASE ELSE (awaiting END SELECT)</nowiki>|#919191}}
{{Text|<nowiki>'32=SUB/FUNCTION (awaiting END SUB/FUNCTION)</nowiki>|#919191}}
{{Cl|DIM}} controlid({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} controlvalue({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} controlstate({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|INTEGER}}
{{Cl|DIM}} {{Cl|SHARED}} controlref({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|LONG}} {{Text|<nowiki>'the line number the control was created on</nowiki>|#919191}}
{{Text|<nowiki>'</nowiki>|#919191}}
{{Text|<nowiki>' Collection of flags indicating which unstable features should be used during compilation</nowiki>|#919191}}
{{Text|<nowiki>'</nowiki>|#919191}}
{{Cl|REDIM}} {{Cl|SHARED}} unstableFlags({{Text|1|#F580B1}} {{Cl|TO}} {{Text|2|#F580B1}}) {{Cl|AS}} {{Cl|_BYTE}}
{{Cl|DIM}} UNSTABLE_MIDI {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} UNSTABLE_HTTP {{Cl|AS}} {{Cl|LONG}}
UNSTABLE_MIDI = {{Text|1|#F580B1}}
UNSTABLE_HTTP = {{Text|2|#F580B1}}
{{Cl|ON}} {{Cl|ERROR}} {{Cl|GOTO}} qberror
i2&& = {{Text|1|#F580B1}}
{{Cl|FOR}} i&& = {{Text|1|#F580B1}} {{Cl|TO}} {{Text|64|#F580B1}}
    bitmask(i&&) = i2&&
    bitmaskinv(i&&) = {{Cl|NOT}} i2&&
    i2&& = i2&& + {{Text|2|#F580B1}} ^ i&&
{{Cl|NEXT}}
{{Cl|DIM}} id2 {{Cl|AS}} idstruct
cleanupstringprocessingcall$ = {{Text|<nowiki>"qbs_cleanup(qbs_tmp_base,"</nowiki>|#FFB100}}
{{Cl|DIM}} {{Cl|SHARED}} sfidlist({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|LONG}}
{{Cl|DIM}} {{Cl|SHARED}} sfarglist({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|INTEGER}}
{{Cl|DIM}} {{Cl|SHARED}} sfelelist({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|INTEGER}}
{{Text|<nowiki>'----------------ripgl.bas--------------------------------------------------------------------------------</nowiki>|#919191}}
{{Text|gl_scan_header|#55FF55}}
{{Text|<nowiki>'----------------ripgl.bas--------------------------------------------------------------------------------</nowiki>|#919191}}
{{Text|<nowiki>'-----------------------QB64 COMPILER ONCE ONLY SETUP CODE ENDS HERE---------------------------------------</nowiki>|#919191}}
{{Cl|IF}} NoIDEMode {{Cl|THEN}} IDE_AutoPosition = {{Text|0|#F580B1}}: {{Cl|GOTO}} noide
{{Cl|DIM}} FileDropEnabled {{Cl|AS}} {{Cl|_BYTE}}
{{Cl|IF}} FileDropEnabled = {{Text|0|#F580B1}} {{Cl|THEN}} FileDropEnabled = {{Text|-1|#F580B1}}: {{Cl|_ACCEPTFILEDROP}}
{{Cl|IF}} IDE_AutoPosition {{Cl|AND (boolean)|AND}} {{Cl|NOT}} IDE_BypassAutoPosition {{Cl|THEN}} {{Cl|_SCREENMOVE}} IDE_LeftPosition, IDE_TopPosition
idemode = {{Text|1|#F580B1}}
sendc$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Text|<nowiki>'no initial message</nowiki>|#919191}}
{{Cl|IF}} CMDLineFile <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} sendc$ = {{Cl|CHR$}}({{Text|1|#F580B1}}) + CMDLineFile
sendcommand:
idecommand$ = sendc$
C = {{Text|ide|#55FF55}}({{Text|0|#F580B1}})
ideerror = {{Text|0|#F580B1}}
{{Cl|IF}} C = {{Text|0|#F580B1}} {{Cl|THEN}} idemode = {{Text|0|#F580B1}}: {{Cl|GOTO}} noide
c$ = idereturn$
{{Cl|IF}} C = {{Text|2|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'begin</nowiki>|#919191}}
    ideerrorline = {{Text|0|#F580B1}} {{Text|<nowiki>'addresses invalid prepass error line numbers being reported</nowiki>|#919191}}
    idepass = {{Text|1|#F580B1}}
    {{Cl|GOTO}} fullrecompile
    ideret1:
    wholeline$ = c$
    {{Cl|GOTO}} ideprepass
    ideret2:
    {{Cl|IF}} lastLineReturn {{Cl|THEN}} {{Cl|GOTO}} lastLineReturn
    sendc$ = {{Cl|CHR$}}({{Text|3|#F580B1}}) {{Text|<nowiki>'request next line</nowiki>|#919191}}
    {{Cl|GOTO}} sendcommand
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} C = {{Text|4|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'next line</nowiki>|#919191}}
    {{Cl|IF}} idepass = {{Text|1|#F580B1}} {{Cl|THEN}}
        wholeline$ = c$
        {{Cl|GOTO}} ideprepass
        {{Text|<nowiki>'(returns to ideret2: above)</nowiki>|#919191}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'assume idepass>1</nowiki>|#919191}}
    a3$ = c$
    continuelinefrom = {{Text|0|#F580B1}}
    {{Cl|GOTO}} ide4
    ideret4:
    {{Cl|IF}} lastLineReturn {{Cl|THEN}} {{Cl|GOTO}} lastLineReturn
    sendc$ = {{Cl|CHR$}}({{Text|3|#F580B1}}) {{Text|<nowiki>'request next line</nowiki>|#919191}}
    {{Cl|GOTO}} sendcommand
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} C = {{Text|5|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'end of program reached</nowiki>|#919191}}
    lastLine = {{Text|1|#F580B1}}
    lastLineReturn = {{Text|1|#F580B1}}
    {{Cl|IF}} idepass = {{Text|1|#F580B1}} {{Cl|THEN}}
        wholeline$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Cl|GOTO}} ideprepass
        {{Text|<nowiki>'(returns to ideret2: above, then to lastLinePrepassReturn below)</nowiki>|#919191}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'idepass>1</nowiki>|#919191}}
    a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
    continuelinefrom = {{Text|0|#F580B1}}
    {{Cl|GOTO}} ide4 {{Text|<nowiki>'returns to ideret4, then to lastLinePrepassReturn below</nowiki>|#919191}}
    lastLineReturn:
    lastLineReturn = {{Text|0|#F580B1}}
    lastLine = {{Text|0|#F580B1}}
    {{Cl|IF}} idepass = {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Text|<nowiki>'prepass complete</nowiki>|#919191}}
        idepass = {{Text|2|#F580B1}}
        {{Cl|GOTO}} ide3
        ideret3:
        sendc$ = {{Cl|CHR$}}({{Text|7|#F580B1}}) {{Text|<nowiki>'repass request</nowiki>|#919191}}
        firstLine = {{Text|1|#F580B1}}
        {{Cl|GOTO}} sendcommand
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'assume idepass=2</nowiki>|#919191}}
    {{Text|<nowiki>'finalize program</nowiki>|#919191}}
    {{Cl|GOTO}} ide5
    ideret5: {{Text|<nowiki>'note: won't return here if a recompile was required!</nowiki>|#919191}}
    sendc$ = {{Cl|CHR$}}({{Text|6|#F580B1}}) {{Text|<nowiki>'ready</nowiki>|#919191}}
    idecompiled = {{Text|0|#F580B1}}
    {{Cl|GOTO}} sendcommand
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} C = {{Text|9|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'run</nowiki>|#919191}}
    {{Cl|IF}} idecompiled = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'exe needs to be compiled</nowiki>|#919191}}
        file$ = c$
        {{Text|<nowiki>'locate accessible file and truncate</nowiki>|#919191}}
        f$ = file$
        path.exe$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Cl|IF}} SaveExeWithSource {{Cl|THEN}}
            {{Cl|IF}} {{Cl|LEN}}(ideprogname) {{Cl|THEN}} path.exe$ = idepath$ + pathsep$
        {{Cl|END}} {{Cl|IF}}
        i = {{Text|1|#F580B1}}
        nextexeindex:
        {{Cl|IF}} {{Cl|_FILEEXISTS}}(path.exe$ + file$ + extension$) {{Cl|THEN}}
            E = {{Text|0|#F580B1}}
            {{Cl|ON}} {{Cl|ERROR}} {{Cl|GOTO}} qberror_test
            {{Cl|KILL}} path.exe$ + file$ + extension$
            {{Cl|ON}} {{Cl|ERROR}} {{Cl|GOTO}} qberror
            {{Cl|IF}} E = {{Text|1|#F580B1}} {{Cl|THEN}}
                i = i + {{Text|1|#F580B1}}
                file$ = f$ + {{Text|<nowiki>"("</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(i) + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                {{Cl|GOTO}} nextexeindex
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'inform IDE of name change if necessary (IDE will respond with message 9 and corrected name)</nowiki>|#919191}}
        {{Cl|IF}} i <> {{Text|1|#F580B1}} {{Cl|THEN}}
            sendc$ = {{Cl|CHR$}}({{Text|12|#F580B1}}) + file$
            {{Cl|GOTO}} sendcommand
        {{Cl|END}} {{Cl|IF}}
        ideerrorline = {{Text|0|#F580B1}} {{Text|<nowiki>'addresses C++ comp. error's line number</nowiki>|#919191}}
        {{Cl|GOTO}} ide6
        ideret6:
        idecompiled = {{Text|1|#F580B1}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} iderunmode = {{Text|2|#F580B1}} {{Cl|THEN}}
        sendc$ = {{Cl|CHR$}}({{Text|11|#F580B1}}) {{Text|<nowiki>'.EXE file created</nowiki>|#919191}}
        {{Cl|GOTO}} sendcommand
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'execute program</nowiki>|#919191}}
    {{Cl|IF}} iderunmode = {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} NoExeSaved {{Cl|THEN}}
            {{Text|<nowiki>'This is the section which deals with if the user selected to run the program without</nowiki>|#919191}}
            {{Text|<nowiki>'saving an EXE file to the disk.</nowiki>|#919191}}
            {{Text|<nowiki>'We start off by first running the EXE, and then we delete it from the drive.</nowiki>|#919191}}
            {{Text|<nowiki>'making it a temporary file when all is said and done.</nowiki>|#919191}}
            {{Cl|IF}} os$ = {{Text|<nowiki>"WIN"</nowiki>|#FFB100}} {{Cl|THEN}}
                {{Cl|SHELL}} {{Text|QuotedFilename$|#55FF55}}({{Cl|CHR$}}({{Text|34|#F580B1}}) + lastBinaryGenerated$ + {{Cl|CHR$}}({{Text|34|#F580B1}})) + ModifyCOMMAND$ {{Text|<nowiki>'run the newly created program</nowiki>|#919191}}
                {{Cl|SHELL}} {{Cl|_HIDE}} {{Cl|_DONTWAIT}} {{Text|<nowiki>"del "</nowiki>|#FFB100}} + {{Text|QuotedFilename$|#55FF55}}({{Cl|CHR$}}({{Text|34|#F580B1}}) + lastBinaryGenerated$ + {{Cl|CHR$}}({{Text|34|#F580B1}})) {{Text|<nowiki>'kill it</nowiki>|#919191}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} path.exe$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} path.exe$ = {{Text|<nowiki>"./"</nowiki>|#FFB100}}
            {{Cl|IF}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Cl|THEN}}
                {{Cl|IF}} {{Cl|LEFT$}}(lastBinaryGenerated$, {{Cl|LEN}}(path.exe$)) = path.exe$ {{Cl|THEN}}
                    {{Cl|SHELL}} {{Text|QuotedFilename$|#55FF55}}(lastBinaryGenerated$) + ModifyCOMMAND$
                    {{Cl|KILL}} lastBinaryGenerated$
                {{Cl|ELSE}}
                    {{Cl|SHELL}} {{Text|QuotedFilename$|#55FF55}}(path.exe$ + lastBinaryGenerated$) + ModifyCOMMAND$
                    {{Cl|KILL}} path.exe$ + lastBinaryGenerated$
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} path.exe$ = {{Text|<nowiki>"./"</nowiki>|#FFB100}} {{Cl|THEN}} path.exe$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            NoExeSaved = {{Text|0|#F580B1}} {{Text|<nowiki>'reset the flag for a temp EXE</nowiki>|#919191}}
            sendc$ = {{Cl|CHR$}}({{Text|6|#F580B1}}) {{Text|<nowiki>'ready</nowiki>|#919191}}
            {{Cl|GOTO}} sendcommand
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} os$ = {{Text|<nowiki>"WIN"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|SHELL}} {{Cl|_DONTWAIT}} {{Text|QuotedFilename$|#55FF55}}({{Cl|CHR$}}({{Text|34|#F580B1}}) + lastBinaryGenerated$ + {{Cl|CHR$}}({{Text|34|#F580B1}})) + ModifyCOMMAND$
        {{Cl|IF}} path.exe$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} path.exe$ = {{Text|<nowiki>"./"</nowiki>|#FFB100}}
        {{Cl|IF}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} {{Cl|LEFT$}}(lastBinaryGenerated$, {{Cl|LEN}}(path.exe$)) = path.exe$ {{Cl|THEN}}
                {{Cl|SHELL}} {{Cl|_DONTWAIT}} {{Text|QuotedFilename$|#55FF55}}(lastBinaryGenerated$) + ModifyCOMMAND$
            {{Cl|ELSE}}
                {{Cl|SHELL}} {{Cl|_DONTWAIT}} {{Text|QuotedFilename$|#55FF55}}(path.exe$ + lastBinaryGenerated$) + ModifyCOMMAND$
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} path.exe$ = {{Text|<nowiki>"./"</nowiki>|#FFB100}} {{Cl|THEN}} path.exe$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
    {{Cl|ELSE}}
        {{Cl|IF}} os$ = {{Text|<nowiki>"WIN"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|SHELL}} {{Text|QuotedFilename$|#55FF55}}({{Cl|CHR$}}({{Text|34|#F580B1}}) + lastBinaryGenerated$ + {{Cl|CHR$}}({{Text|34|#F580B1}})) + ModifyCOMMAND$
        {{Cl|IF}} path.exe$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} path.exe$ = {{Text|<nowiki>"./"</nowiki>|#FFB100}}
        {{Cl|IF}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} {{Cl|LEFT$}}(lastBinaryGenerated$, {{Cl|LEN}}(path.exe$)) = path.exe$ {{Cl|THEN}}
                {{Cl|SHELL}} {{Text|QuotedFilename$|#55FF55}}(lastBinaryGenerated$) + ModifyCOMMAND$
            {{Cl|ELSE}}
                {{Cl|SHELL}} {{Text|QuotedFilename$|#55FF55}}(path.exe$ + lastBinaryGenerated$) + ModifyCOMMAND$
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} path.exe$ = {{Text|<nowiki>"./"</nowiki>|#FFB100}} {{Cl|THEN}} path.exe$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Cl|DO}}: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|INKEY$}} = {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Cl|DO}}: {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|_KEYHIT}} = {{Text|0|#F580B1}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} idemode {{Cl|THEN}}
        {{Text|<nowiki>'Darken fg/bg colors</nowiki>|#919191}}
        dummy = {{Text|DarkenFGBG|#55FF55}}({{Text|0|#F580B1}})
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} vWatchOn {{Cl|THEN}}
        sendc$ = {{Cl|CHR$}}({{Text|254|#F580B1}}) {{Text|<nowiki>'launch debug interface</nowiki>|#919191}}
    {{Cl|ELSE}}
        sendc$ = {{Cl|CHR$}}({{Text|6|#F580B1}}) {{Text|<nowiki>'ready</nowiki>|#919191}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|GOTO}} sendcommand
{{Cl|END}} {{Cl|IF}}
{{Cl|PRINT}} {{Text|<nowiki>"Invalid IDE message"</nowiki>|#FFB100}}: {{Cl|END}}
ideerror:
{{Cl|IF}} {{Cl|INSTR}}(idemessage$, sp$) {{Cl|THEN}}
    {{Text|<nowiki>'Something went wrong here, so let's give a generic error message to the user.</nowiki>|#919191}}
    {{Text|<nowiki>'(No error message should contain sp$ - that is, CHR$(13), when not in Debug mode)</nowiki>|#919191}}
    terrmsg$ = {{Cl|_ERRORMESSAGE$}}
    {{Cl|IF}} terrmsg$ = {{Text|<nowiki>"No error"</nowiki>|#FFB100}} {{Cl|THEN}} terrmsg$ = {{Text|<nowiki>"Internal error"</nowiki>|#FFB100}}
    idemessage$ = {{Text|<nowiki>"Compiler error (check for syntax errors) ("</nowiki>|#FFB100}} + terrmsg$ + {{Text|<nowiki>":"</nowiki>|#FFB100}}
    {{Cl|IF}} {{Cl|ERR}} {{Cl|THEN}} idemessage$ = idemessage$ + {{Text|str2$|#55FF55}}({{Cl|ERR}}) + {{Text|<nowiki>"-"</nowiki>|#FFB100}}
    {{Cl|IF}} {{Cl|_ERRORLINE}} {{Cl|THEN}} idemessage$ = idemessage$ + {{Text|str2$|#55FF55}}({{Cl|_ERRORLINE}})
    {{Cl|IF}} {{Cl|_INCLERRORLINE}} {{Cl|THEN}} idemessage$ = idemessage$ + {{Text|<nowiki>"-"</nowiki>|#FFB100}} + {{Cl|_INCLERRORFILE$}} + {{Text|<nowiki>"-"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}({{Cl|_INCLERRORLINE}})
    idemessage$ = idemessage$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
    {{Cl|IF}} inclevel > {{Text|0|#F580B1}} {{Cl|THEN}} idemessage$ = idemessage$ + incerror$
{{Cl|END}} {{Cl|IF}}
sendc$ = {{Cl|CHR$}}({{Text|8|#F580B1}}) + idemessage$ + {{Cl|MKL$}}(ideerrorline)
{{Cl|GOTO}} sendcommand
noide:
{{Cl|IF}} (qb64versionprinted = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} ConsoleMode = {{Text|0|#F580B1}}) {{Cl|AND (boolean)|AND}} {{Cl|NOT}} QuietMode {{Cl|THEN}}
    qb64versionprinted = {{Text|-1|#F580B1}}
    {{Cl|PRINT}} {{Text|<nowiki>"QB64-PE Compiler V"</nowiki>|#FFB100}} + Version$
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} CMDLineFile = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
    {{Cl|LINE INPUT}} ; {{Text|<nowiki>"COMPILE (.bas)>"</nowiki>|#FFB100}}, f$
{{Cl|ELSE}}
    f$ = CMDLineFile
{{Cl|END}} {{Cl|IF}}
f$ = {{Cl|LTRIM$}}({{Cl|RTRIM$}}(f$))
{{Cl|IF}} {{Text|FileHasExtension|#55FF55}}(f$) = {{Text|0|#F580B1}} {{Cl|THEN}} f$ = f$ + {{Text|<nowiki>".bas"</nowiki>|#FFB100}}
sourcefile$ = f$
CMDLineFile = sourcefile$
{{Text|<nowiki>'derive name from sourcefile</nowiki>|#919191}}
f$ = {{Text|RemoveFileExtension$|#55FF55}}(f$)
path.exe$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
currentdir$ = {{Cl|_CWD$}}
path.source$ = {{Text|getfilepath$|#55FF55}}(sourcefile$)
{{Cl|IF}} {{Cl|LEN}}(path.source$) {{Cl|THEN}}
    {{Cl|IF}} {{Cl|_DIREXISTS}}(path.source$) = {{Text|0|#F580B1}} {{Cl|THEN}}
        {{Cl|PRINT}}
        {{Cl|PRINT}} {{Text|<nowiki>"Cannot locate source file: "</nowiki>|#FFB100}} + sourcefile$
        {{Cl|IF}} ConsoleMode {{Cl|THEN}} {{Cl|SYSTEM}} {{Text|1|#F580B1}}
        {{Cl|END}} {{Text|1|#F580B1}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|CHDIR}} path.source$
    path.source$ = {{Cl|_CWD$}}
    {{Cl|IF}} {{Cl|RIGHT$}}(path.source$, {{Text|1|#F580B1}}) <> pathsep$ {{Cl|THEN}} path.source$ = path.source$ + pathsep$
    {{Cl|CHDIR}} currentdir$
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} SaveExeWithSource {{Cl|THEN}} path.exe$ = path.source$
{{Cl|FOR}} x = {{Cl|LEN}}(f$) {{Cl|TO}} {{Text|1|#F580B1}} {{Cl|STEP}} {{Text|-1|#F580B1}}
    a$ = {{Cl|MID$ (function)|MID$}}(f$, x, {{Text|1|#F580B1}})
    {{Cl|IF}} a$ = {{Text|<nowiki>"/"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} a$ = {{Text|<nowiki>"\"</nowiki>|#FFB100}} {{Cl|THEN}}
        f$ = {{Cl|RIGHT$}}(f$, {{Cl|LEN}}(f$) - x)
        {{Cl|EXIT}} {{Cl|FOR}}
    {{Cl|END}} {{Cl|IF}}
{{Cl|NEXT}}
file$ = f$
{{Text|<nowiki>'if cmemlist(currentid+1)<>0 before calling regid the variable</nowiki>|#919191}}
{{Text|<nowiki>'MUST be defined in cmem!</nowiki>|#919191}}
fullrecompile:
{{Cl|IF}} idemode = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|NOT}} QuietMode {{Cl|THEN}}
    {{Cl|PRINT}}
    {{Cl|PRINT}} {{Text|<nowiki>"Beginning C++ output from QB64 code... "</nowiki>|#FFB100}}
{{Cl|END}} {{Cl|IF}}
BU_DEPENDENCY_CONSOLE_ONLY = DEPENDENCY(DEPENDENCY_CONSOLE_ONLY)
{{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|UBOUND}}(DEPENDENCY): DEPENDENCY(i) = {{Text|0|#F580B1}}: {{Cl|NEXT}}
DEPENDENCY(DEPENDENCY_CONSOLE_ONLY) = BU_DEPENDENCY_CONSOLE_ONLY {{Cl|AND}} {{Text|2|#F580B1}} {{Text|<nowiki>'Restore -g switch if used</nowiki>|#919191}}
Error_Happened = {{Text|0|#F580B1}}
{{Cl|FOR}} closeall = {{Text|1|#F580B1}} {{Cl|TO}} {{Text|255|#F580B1}}: {{Cl|CLOSE}} closeall: {{Cl|NEXT}}
{{Cl|OPEN}} tmpdir$ + {{Text|<nowiki>"temp.bin"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|OUTPUT}} {{Cl|OPEN#File_ACCESS_and_LOCK_Permissions|LOCK}} {{Cl|OPEN#File_ACCESS_and_LOCK_Permissions|WRITE}} {{Cl|OPEN|AS}} #26 {{Text|<nowiki>'relock</nowiki>|#919191}}
bh = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"dyninfo.txt"</nowiki>|#FFB100}})
{{Cl|IF}} Debug {{Cl|THEN}} {{Cl|CLOSE}} #9: {{Cl|OPEN}} tmpdir$ + {{Text|<nowiki>"debug.txt"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|OUTPUT}} {{Cl|OPEN|AS}} #9
{{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} ids_max + {{Text|1|#F580B1}}
    arrayelementslist(i) = {{Text|0|#F580B1}}
    cmemlist(i) = {{Text|0|#F580B1}}
    sfcmemargs(i) = {{Text|<nowiki>""</nowiki>|#FFB100}}
{{Cl|NEXT}}
{{Text|<nowiki>'erase cmemlist</nowiki>|#919191}}
{{Text|<nowiki>'erase sfcmemargs</nowiki>|#919191}}
lastunresolved = {{Text|-1|#F580B1}} {{Text|<nowiki>'first pass</nowiki>|#919191}}
sflistn = {{Text|-1|#F580B1}} {{Text|<nowiki>'no entries</nowiki>|#919191}}
SubNameLabels = sp {{Text|<nowiki>'QB64 will perform a repass to resolve sub names used as labels</nowiki>|#919191}}
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
{{Text|vWatchVariable|#55FF55}} {{Text|<nowiki>""</nowiki>|#FFB100}}, {{Text|-1|#F580B1}} {{Text|<nowiki>'reset internal variables list</nowiki>|#919191}}
qb64prefix_set = qb64prefix_set_desiredState
qb64prefix$ = {{Text|<nowiki>"_"</nowiki>|#FFB100}}
optionexplicit = opex_desiredState
{{Cl|IF}} optionexplicit_cmd = {{Text|-1|#F580B1}} {{Cl|AND (boolean)|AND}} NoIDEMode = {{Text|1|#F580B1}} {{Cl|THEN}} 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}}
{{Text|HashClear|#55FF55}} {{Text|<nowiki>'clear the hash table</nowiki>|#919191}}
{{Text|<nowiki>'add reserved words to hashtable</nowiki>|#919191}}
f = HASHFLAG_TYPE + HASHFLAG_RESERVED
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"_UNSIGNED"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"_BIT"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"_BYTE"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"INTEGER"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"LONG"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"_INTEGER64"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"_OFFSET"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"SINGLE"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"DOUBLE"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"_FLOAT"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"STRING"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"ANY"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
f = HASHFLAG_OPERATOR + HASHFLAG_RESERVED
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"NOT"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"IMP"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"EQV"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"AND"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"OR"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"XOR"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"MOD"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
f = HASHFLAG_RESERVED + HASHFLAG_CUSTOMSYNTAX
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"LIST"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"BASE"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"_EXPLICIT"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"AS"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"IS"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"OFF"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"ON"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"STOP"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"TO"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"USING"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|<nowiki>'PUT(graphics) statement:</nowiki>|#919191}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"PRESET"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"PSET"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|<nowiki>'OPEN statement:</nowiki>|#919191}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"FOR"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"OUTPUT"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"RANDOM"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"BINARY"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"APPEND"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"SHARED"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"ACCESS"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"LOCK"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"READ"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"WRITE"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|<nowiki>'LINE statement:</nowiki>|#919191}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"STEP"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|<nowiki>'WIDTH statement:</nowiki>|#919191}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"LPRINT"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|<nowiki>'VIEW statement:</nowiki>|#919191}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"PRINT"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
f = HASHFLAG_RESERVED + HASHFLAG_XELEMENTNAME + HASHFLAG_XTYPENAME
{{Text|<nowiki>'A</nowiki>|#919191}}
{{Text|<nowiki>'B</nowiki>|#919191}}
{{Text|<nowiki>'C</nowiki>|#919191}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"COMMON"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"CALL"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"CASE"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"COM"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}} {{Text|<nowiki>'(ON...)</nowiki>|#919191}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"CONST"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|<nowiki>'D</nowiki>|#919191}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"DATA"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"DECLARE"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"DEF"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"DEFDBL"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"DEFINT"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"DEFLNG"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"DEFSNG"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"DEFSTR"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"DIM"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"DO"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME, {{Text|0|#F580B1}}
{{Text|<nowiki>'E</nowiki>|#919191}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"ERROR"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME, {{Text|0|#F580B1}} {{Text|<nowiki>'(ON ...)</nowiki>|#919191}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"ELSE"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"ELSEIF"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"ENDIF"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"EXIT"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME, {{Text|0|#F580B1}}
{{Text|<nowiki>'F</nowiki>|#919191}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"FIELD"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"FUNCTION"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|<nowiki>'G</nowiki>|#919191}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"GOSUB"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"GOTO"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|<nowiki>'H</nowiki>|#919191}}
{{Text|<nowiki>'I</nowiki>|#919191}}
{{Text|HashAdd|#55FF55}} {{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>|#919191}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"IF"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|<nowiki>'K</nowiki>|#919191}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"KEY"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME - HASHFLAG_XTYPENAME, {{Text|0|#F580B1}} {{Text|<nowiki>'(ON...)</nowiki>|#919191}}
{{Text|<nowiki>'L</nowiki>|#919191}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"LET"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"LOOP"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"LEN"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME, {{Text|0|#F580B1}} {{Text|<nowiki>'(LEN function exists, so conflicts if allowed as custom syntax)</nowiki>|#919191}}
{{Text|<nowiki>'M</nowiki>|#919191}}
{{Text|<nowiki>'N</nowiki>|#919191}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"NEXT"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME, {{Text|0|#F580B1}}
{{Text|<nowiki>'O</nowiki>|#919191}}
{{Text|<nowiki>'P</nowiki>|#919191}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"PLAY"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME - HASHFLAG_XTYPENAME, {{Text|0|#F580B1}} {{Text|<nowiki>'(ON...)</nowiki>|#919191}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"PEN"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME - HASHFLAG_XTYPENAME, {{Text|0|#F580B1}} {{Text|<nowiki>'(ON...)</nowiki>|#919191}}
{{Text|<nowiki>'Q</nowiki>|#919191}}
{{Text|<nowiki>'R</nowiki>|#919191}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"REDIM"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"REM"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"RESTORE"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"RESUME"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"RETURN"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"RUN"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME, {{Text|0|#F580B1}}
{{Text|<nowiki>'S</nowiki>|#919191}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"STATIC"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"STRIG"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}} {{Text|<nowiki>'(ON...)</nowiki>|#919191}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"SEG"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"SELECT"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME - HASHFLAG_XTYPENAME, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"SUB"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"SCREEN"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME - HASHFLAG_XTYPENAME, {{Text|0|#F580B1}}
{{Text|<nowiki>'T</nowiki>|#919191}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"THEN"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"TIMER"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME - HASHFLAG_XTYPENAME, {{Text|0|#F580B1}} {{Text|<nowiki>'(ON...)</nowiki>|#919191}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"TYPE"</nowiki>|#FFB100}}, f - HASHFLAG_XELEMENTNAME, {{Text|0|#F580B1}}
{{Text|<nowiki>'U</nowiki>|#919191}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"UNTIL"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"UEVENT"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|<nowiki>'V</nowiki>|#919191}}
{{Text|<nowiki>'W</nowiki>|#919191}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"WEND"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|HashAdd|#55FF55}} {{Text|<nowiki>"WHILE"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Text|<nowiki>'X</nowiki>|#919191}}
{{Text|<nowiki>'Y</nowiki>|#919191}}
{{Text|<nowiki>'Z</nowiki>|#919191}}
{{Text|<nowiki>'clear/init variables</nowiki>|#919191}}
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>|#919191}}
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}}
{{Cl|REDIM}} {{Cl|SHARED}} udtxname({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|STRING}} * {{Text|256|#F580B1}}
{{Cl|REDIM}} {{Cl|SHARED}} udtxcname({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|STRING}} * {{Text|256|#F580B1}}
{{Cl|REDIM}} {{Cl|SHARED}} udtxsize({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|LONG}}
{{Cl|REDIM}} {{Cl|SHARED}} udtxbytealign({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|INTEGER}} {{Text|<nowiki>'first element MUST be on a byte alignment & size is a multiple of 8</nowiki>|#919191}}
{{Cl|REDIM}} {{Cl|SHARED}} udtxnext({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|LONG}}
{{Cl|REDIM}} {{Cl|SHARED}} udtxvariable({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|INTEGER}} {{Text|<nowiki>'true if the udt contains variable length elements</nowiki>|#919191}}
{{Text|<nowiki>'elements</nowiki>|#919191}}
{{Cl|REDIM}} {{Cl|SHARED}} udtename({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|STRING}} * {{Text|256|#F580B1}}
{{Cl|REDIM}} {{Cl|SHARED}} udtecname({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|STRING}} * {{Text|256|#F580B1}}
{{Cl|REDIM}} {{Cl|SHARED}} udtebytealign({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|INTEGER}}
{{Cl|REDIM}} {{Cl|SHARED}} udtesize({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|LONG}}
{{Cl|REDIM}} {{Cl|SHARED}} udtetype({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|LONG}}
{{Cl|REDIM}} {{Cl|SHARED}} udtetypesize({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|LONG}}
{{Cl|REDIM}} {{Cl|SHARED}} udtearrayelements({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|LONG}}
{{Cl|REDIM}} {{Cl|SHARED}} udtenext({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|LONG}}
definingtype = {{Text|0|#F580B1}}
definingtypeerror = {{Text|0|#F580B1}}
constlast = {{Text|-1|#F580B1}}
{{Text|<nowiki>'constlastshared = -1</nowiki>|#919191}}
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}}
{{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} {{Text|27|#F580B1}}: defineaz(i) = {{Text|<nowiki>"SINGLE"</nowiki>|#FFB100}}: defineextaz(i) = {{Text|<nowiki>"!"</nowiki>|#FFB100}}: {{Cl|NEXT}}
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}}
{{Cl|REDIM}} {{Cl|SHARED}} usedVariableList({{Text|1000|#F580B1}}) {{Cl|AS}} usedVarList
totalWarnings = {{Text|0|#F580B1}}
duplicateConstWarning = {{Text|0|#F580B1}}
emptySCWarning = {{Text|0|#F580B1}}
warningListItems = {{Text|0|#F580B1}}
lastWarningHeader = {{Text|<nowiki>""</nowiki>|#FFB100}}
vWatchUsedLabels = {{Cl|SPACE$}}({{Text|1000|#F580B1}})
vWatchUsedSkipLabels = {{Cl|SPACE$}}({{Text|1000|#F580B1}})
firstLineNumberLabelvWatch = {{Text|0|#F580B1}}
{{Cl|REDIM}} {{Cl|SHARED}} warning$({{Text|1000|#F580B1}})
{{Cl|REDIM}} {{Cl|SHARED}} warningLines({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|LONG}}
{{Cl|REDIM}} {{Cl|SHARED}} warningIncLines({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|LONG}}
{{Cl|REDIM}} {{Cl|SHARED}} warningIncFiles({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|STRING}}
maxLineNumber = {{Text|0|#F580B1}}
uniquenumbern = {{Text|0|#F580B1}}
{{Text|<nowiki>''create a type for storing memory blocks</nowiki>|#919191}}
{{Text|<nowiki>''UDT</nowiki>|#919191}}
{{Text|<nowiki>''names</nowiki>|#919191}}
{{Text|<nowiki>'DIM SHARED lasttype AS LONG</nowiki>|#919191}}
{{Text|<nowiki>'DIM SHARED udtxname(1000) AS STRING * 256</nowiki>|#919191}}
{{Text|<nowiki>'DIM SHARED udtxcname(1000) AS STRING * 256</nowiki>|#919191}}
{{Text|<nowiki>'DIM SHARED udtxsize(1000) AS LONG</nowiki>|#919191}}
{{Text|<nowiki>'DIM SHARED udtxbytealign(1000) AS INTEGER 'first element MUST be on a byte alignment & size is a multiple of 8</nowiki>|#919191}}
{{Text|<nowiki>'DIM SHARED udtxnext(1000) AS LONG</nowiki>|#919191}}
{{Text|<nowiki>''elements</nowiki>|#919191}}
{{Text|<nowiki>'DIM SHARED lasttypeelement AS LONG</nowiki>|#919191}}
{{Text|<nowiki>'DIM SHARED udtename(1000) AS STRING * 256</nowiki>|#919191}}
{{Text|<nowiki>'DIM SHARED udtecname(1000) AS STRING * 256</nowiki>|#919191}}
{{Text|<nowiki>'DIM SHARED udtebytealign(1000) AS INTEGER</nowiki>|#919191}}
{{Text|<nowiki>'DIM SHARED udtesize(1000) AS LONG</nowiki>|#919191}}
{{Text|<nowiki>'DIM SHARED udtetype(1000) AS LONG</nowiki>|#919191}}
{{Text|<nowiki>'DIM SHARED udtetypesize(1000) AS LONG</nowiki>|#919191}}
{{Text|<nowiki>'DIM SHARED udtearrayelements(1000) AS LONG</nowiki>|#919191}}
{{Text|<nowiki>'DIM SHARED udtenext(1000) AS LONG</nowiki>|#919191}}
{{Text|<nowiki>'import _MEM type</nowiki>|#919191}}
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>|#919191}}
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>|#919191}}
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>|#919191}}
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>|#919191}}
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>|#919191}}
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>|#919191}}
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>|#919191}}
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>|#919191}}
udtenext(i3) = i2
udtenext(i2) = {{Text|0|#F580B1}}
{{Text|<nowiki>' Reset all unstable flags</nowiki>|#919191}}
{{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|UBOUND}}(unstableFlags): unstableFlags(i) = {{Text|0|#F580B1}}: {{Cl|NEXT}}
{{Text|<nowiki>' Indicates if a MIDI sound font was selected</nowiki>|#919191}}
{{Text|<nowiki>'</nowiki>|#919191}}
{{Text|<nowiki>' Captures both the line number and line contents for error reporting later-on</nowiki>|#919191}}
{{Text|<nowiki>' in the compilation process</nowiki>|#919191}}
MidiSoundFontSet = {{Text|0|#F580B1}}
MidiSoundFontLine$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
{{Text|<nowiki>' If MidiSoundFont$ is blank, then the default is used</nowiki>|#919191}}
MidiSoundFont$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
{{Text|<nowiki>'begin compilation</nowiki>|#919191}}
{{Cl|FOR}} closeall = {{Text|1|#F580B1}} {{Cl|TO}} {{Text|255|#F580B1}}: {{Cl|CLOSE}} closeall: {{Cl|NEXT}}
{{Cl|OPEN}} tmpdir$ + {{Text|<nowiki>"temp.bin"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|OUTPUT}} {{Cl|OPEN#File_ACCESS_and_LOCK_Permissions|LOCK}} {{Cl|OPEN#File_ACCESS_and_LOCK_Permissions|WRITE}} {{Cl|OPEN|AS}} #26 {{Text|<nowiki>'relock</nowiki>|#919191}}
bh = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"icon.rc"</nowiki>|#FFB100}})
{{Cl|IF}} Debug {{Cl|THEN}} {{Cl|CLOSE}} #9: {{Cl|OPEN}} tmpdir$ + {{Text|<nowiki>"debug.txt"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|APPEND}} {{Cl|OPEN|AS}} #9
{{Cl|IF}} idemode = {{Text|0|#F580B1}} {{Cl|THEN}}
    qberrorhappened = {{Text|-1|#F580B1}}
    {{Cl|OPEN}} sourcefile$ {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|INPUT}} {{Cl|OPEN|AS}} #1
    qberrorhappened1:
    {{Cl|IF}} qberrorhappened = {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|PRINT}}
        {{Cl|PRINT}} {{Text|<nowiki>"Cannot locate source file: "</nowiki>|#FFB100}} + sourcefile$
        {{Cl|IF}} ConsoleMode {{Cl|THEN}} {{Cl|SYSTEM}} {{Text|1|#F580B1}}
        {{Cl|END}} {{Text|1|#F580B1}}
    {{Cl|ELSE}}
        {{Cl|CLOSE}} #1
    {{Cl|END}} {{Cl|IF}}
    qberrorhappened = {{Text|0|#F580B1}}
{{Cl|END}} {{Cl|IF}}
{{Text|reginternal|#55FF55}}
{{Cl|IF}} qb64prefix_set {{Cl|THEN}}
    qb64prefix$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
    {{Text|<nowiki>'re-add internal keywords without the "_" prefix</nowiki>|#919191}}
    {{Text|reginternal|#55FF55}}
    f = HASHFLAG_TYPE + HASHFLAG_RESERVED
    {{Text|HashAdd|#55FF55}} {{Text|<nowiki>"UNSIGNED"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
    {{Text|HashAdd|#55FF55}} {{Text|<nowiki>"BIT"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
    {{Text|HashAdd|#55FF55}} {{Text|<nowiki>"BYTE"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
    {{Text|HashAdd|#55FF55}} {{Text|<nowiki>"INTEGER64"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
    {{Text|HashAdd|#55FF55}} {{Text|<nowiki>"OFFSET"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
    {{Text|HashAdd|#55FF55}} {{Text|<nowiki>"FLOAT"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
    f = HASHFLAG_RESERVED + HASHFLAG_CUSTOMSYNTAX
    {{Text|HashAdd|#55FF55}} {{Text|<nowiki>"EXPLICIT"</nowiki>|#FFB100}}, f, {{Text|0|#F580B1}}
{{Cl|END}} {{Cl|IF}}
{{Cl|DIM}} {{Cl|SHARED}} GlobTxtBuf: GlobTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"global.txt"</nowiki>|#FFB100}})
defdatahandle = GlobTxtBuf
{{Cl|IF}} iderecompile {{Cl|THEN}}
    iderecompile = {{Text|0|#F580B1}}
    idepass = {{Text|1|#F580B1}} {{Text|<nowiki>'prepass must be done again</nowiki>|#919191}}
    sendc$ = {{Cl|CHR$}}({{Text|7|#F580B1}}) {{Text|<nowiki>'repass request</nowiki>|#919191}}
    {{Cl|GOTO}} sendcommand
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} idemode {{Cl|THEN}} {{Cl|GOTO}} ideret1
{{Text|lineinput3load|#55FF55}} sourcefile$
{{Cl|DO}}
    {{Text|<nowiki>'### STEVE EDIT FOR CONST EXPANSION 10/11/2013</nowiki>|#919191}}
    wholeline$ = {{Text|lineinput3$|#55FF55}}
    {{Cl|IF}} wholeline$ = {{Cl|CHR$}}({{Text|13|#F580B1}}) {{Cl|THEN}} {{Cl|EXIT}} {{Cl|DO}}
    ideprepass:
    prepassLastLine:
    {{Cl|IF}} lastLine <> {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} firstLine <> {{Text|0|#F580B1}} {{Cl|THEN}}
        lineBackup$ = wholeline$ {{Text|<nowiki>'backup the real line (will be blank when lastline is set)</nowiki>|#919191}}
        forceIncludeFromRoot$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Cl|IF}} vWatchOn {{Cl|THEN}}
            addingvWatch = {{Text|1|#F580B1}}
            {{Cl|IF}} firstLine <> {{Text|0|#F580B1}} {{Cl|THEN}} forceIncludeFromRoot$ = {{Text|<nowiki>"internal\support\vwatch\vwatch.bi"</nowiki>|#FFB100}}
            {{Cl|IF}} lastLine <> {{Text|0|#F580B1}} {{Cl|THEN}} forceIncludeFromRoot$ = {{Text|<nowiki>"internal\support\vwatch\vwatch.bm"</nowiki>|#FFB100}}
        {{Cl|ELSE}}
            {{Text|<nowiki>'IF firstLine <> 0 THEN forceIncludeFromRoot$ = "internal\support\vwatch\vwatch_stub.bi"</nowiki>|#919191}}
            {{Cl|IF}} lastLine <> {{Text|0|#F580B1}} {{Cl|THEN}} forceIncludeFromRoot$ = {{Text|<nowiki>"internal\support\vwatch\vwatch_stub.bm"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        firstLine = {{Text|0|#F580B1}}: lastLine = {{Text|0|#F580B1}}
        {{Cl|IF}} {{Cl|LEN}}(forceIncludeFromRoot$) {{Cl|THEN}} {{Cl|GOTO}} forceInclude_prepass
        forceIncludeCompleted_prepass:
        addingvWatch = {{Text|0|#F580B1}}
        wholeline$ = lineBackup$
    {{Cl|END}} {{Cl|IF}}
    wholestv$ = wholeline$ {{Text|<nowiki>'### STEVE EDIT FOR CONST EXPANSION 10/11/2013</nowiki>|#919191}}
    prepass = {{Text|1|#F580B1}}
    layout = {{Text|<nowiki>""</nowiki>|#FFB100}}
    layoutok = {{Text|0|#F580B1}}
    linenumber = linenumber + {{Text|1|#F580B1}}
    reallinenumber = reallinenumber + {{Text|1|#F580B1}}
    {{Cl|DO}} {{Cl|UNTIL}} linenumber < {{Cl|UBOUND}}(InValidLine) {{Text|<nowiki>'color information flag for each line</nowiki>|#919191}}
        {{Cl|REDIM}} {{Cl|_PRESERVE}} InValidLine({{Cl|UBOUND}}(InValidLine) + {{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|_BYTE}}
    {{Cl|LOOP}}
    InValidLine(linenumber) = {{Text|0|#F580B1}}
    {{Cl|IF}} {{Cl|LEN}}(wholeline$) {{Cl|THEN}}
        {{Cl|IF}} {{Cl|UCASE$}}({{Cl|_TRIM$}}(wholeline$)) = {{Text|<nowiki>"$NOPREFIX"</nowiki>|#FFB100}} {{Cl|THEN}}
            qb64prefix_set_desiredState = {{Text|1|#F580B1}}
            {{Cl|IF}} qb64prefix_set = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} qb64prefix_set_recompileAttempts = {{Text|0|#F580B1}} {{Cl|THEN}}
                    qb64prefix_set_recompileAttempts = qb64prefix_set_recompileAttempts + {{Text|1|#F580B1}}
                    {{Cl|GOTO}} do_recompile
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        wholeline$ = {{Text|lineformat|#55FF55}}(wholeline$)
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
        temp$ = {{Cl|LTRIM$}}({{Cl|RTRIM$}}({{Cl|UCASE$}}(wholestv$)))
        {{Cl|IF}} temp$ = {{Text|<nowiki>"$COLOR:0"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} qb64prefix_set {{Cl|THEN}}
                addmetainclude$ = {{Text|getfilepath$|#55FF55}}({{Cl|COMMAND$}}({{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}}
            {{Cl|ELSE}}
                addmetainclude$ = {{Text|getfilepath$|#55FF55}}({{Cl|COMMAND$}}({{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}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|GOTO}} finishedlinepp
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} temp$ = {{Text|<nowiki>"$COLOR:32"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} qb64prefix_set {{Cl|THEN}}
                addmetainclude$ = {{Text|getfilepath$|#55FF55}}({{Cl|COMMAND$}}({{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}}
            {{Cl|ELSE}}
                addmetainclude$ = {{Text|getfilepath$|#55FF55}}({{Cl|COMMAND$}}({{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}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|GOTO}} finishedlinepp
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} temp$ = {{Text|<nowiki>"$DEBUG"</nowiki>|#FFB100}} {{Cl|THEN}}
            vWatchDesiredState = {{Text|1|#F580B1}}
            {{Cl|IF}} vWatchOn = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} vWatchRecompileAttempts = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Text|<nowiki>'this is the first time a conflict has occurred, so react immediately with a full recompilation using the desired state</nowiki>|#919191}}
                    vWatchRecompileAttempts = vWatchRecompileAttempts + {{Text|1|#F580B1}}
                    {{Cl|GOTO}} do_recompile
                {{Cl|ELSE}}
                    {{Text|<nowiki>'continue compilation to retrieve the final state requested and act on that as required</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} {{Cl|LEFT$}}(temp$, {{Text|4|#F580B1}}) = {{Text|<nowiki>"$IF "</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} {{Cl|RIGHT$}}(temp$, {{Text|5|#F580B1}}) <> {{Text|<nowiki>" THEN"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"$IF without THEN"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            temp$ = {{Cl|LTRIM$}}({{Cl|MID$ (function)|MID$}}(temp$, {{Text|4|#F580B1}})) {{Text|<nowiki>'strip off the $IF and extra spaces</nowiki>|#919191}}
            temp$ = {{Cl|RTRIM$}}({{Cl|LEFT$}}(temp$, {{Cl|LEN}}(temp$) - {{Text|4|#F580B1}})) {{Text|<nowiki>'and strip off the THEN and extra spaces</nowiki>|#919191}}
            temp = {{Cl|INSTR}}(temp$, {{Text|<nowiki>"="</nowiki>|#FFB100}})
            ExecCounter = ExecCounter + {{Text|1|#F580B1}}
            ExecLevel(ExecCounter) = {{Text|-1|#F580B1}} {{Text|<nowiki>'default to a skip value</nowiki>|#919191}}
            DefineElse(ExecCounter) = {{Text|1|#F580B1}} {{Text|<nowiki>'1 says we have an $IF statement at this level</nowiki>|#919191}}
            result = {{Text|EvalPreIF|#55FF55}}(temp$, a$)
            {{Cl|IF}} a$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Cl|IF}} result <> {{Text|0|#F580B1}} {{Cl|THEN}}
                ExecLevel(ExecCounter) = ExecLevel(ExecCounter - {{Text|1|#F580B1}}) {{Text|<nowiki>'So we inherit the execlevel from above</nowiki>|#919191}}
                {{Cl|IF}} ExecLevel(ExecCounter) = {{Text|0|#F580B1}} {{Cl|THEN}} DefineElse(ExecCounter) = DefineElse(ExecCounter) {{Cl|OR}} {{Text|4|#F580B1}} {{Text|<nowiki>'Else if used and conditon found</nowiki>|#919191}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|GOTO}} 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>|#919191}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} temp$ = {{Text|<nowiki>"$ELSE"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} DefineElse(ExecCounter) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"$ELSE without $IF"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|IF}} DefineElse(ExecCounter) {{Cl|AND (boolean)|AND}} {{Text|2|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"$IF block already has $ELSE statement in it"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            DefineElse(ExecCounter) = DefineElse(ExecCounter) {{Cl|OR}} {{Text|2|#F580B1}} {{Text|<nowiki>'set the flag to declare an $ELSE already in this block</nowiki>|#919191}}
            {{Cl|IF}} DefineElse(ExecCounter) {{Cl|AND (boolean)|AND}} {{Text|4|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'If we executed code in a previous IF or ELSE IF statement, we can't do it here</nowiki>|#919191}}
                ExecLevel(ExecCounter) = {{Text|-1|#F580B1}} {{Text|<nowiki>'So we inherit the execlevel from above</nowiki>|#919191}}
            {{Cl|ELSE}}
                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>|#919191}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|GOTO}} finishedlinepp
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} {{Cl|LEFT$}}(temp$, {{Text|5|#F580B1}}) = {{Text|<nowiki>"$ELSE"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|<nowiki>'looking for $ELSE IF</nowiki>|#919191}}
            temp$ = {{Cl|LTRIM$}}({{Cl|MID$ (function)|MID$}}(temp$, {{Text|6|#F580B1}}))
            {{Cl|IF}} {{Cl|LEFT$}}(temp$, {{Text|3|#F580B1}}) = {{Text|<nowiki>"IF "</nowiki>|#FFB100}} {{Cl|THEN}}
                {{Cl|IF}} DefineElse(ExecCounter) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"$ELSE IF without $IF"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|IF}} DefineElse(ExecCounter) {{Cl|AND (boolean)|AND}} {{Text|2|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"$ELSE IF cannot follow $ELSE"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|IF}} {{Cl|RIGHT$}}(temp$, {{Text|5|#F580B1}}) <> {{Text|<nowiki>" THEN"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"$ELSE IF without THEN"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|IF}} DefineElse(ExecCounter) {{Cl|AND (boolean)|AND}} {{Text|4|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'If we executed code in a previous IF or ELSE IF statement, we can't do it here</nowiki>|#919191}}
                    ExecLevel(ExecCounter) = {{Text|-1|#F580B1}}
                    {{Cl|GOTO}} finishedlinepp
                {{Cl|END}} {{Cl|IF}}
                temp$ = {{Cl|LTRIM$}}({{Cl|MID$ (function)|MID$}}(temp$, {{Text|3|#F580B1}})) {{Text|<nowiki>'strip off the IF and extra spaces</nowiki>|#919191}}
                temp$ = {{Cl|RTRIM$}}({{Cl|LEFT$}}(temp$, {{Cl|LEN}}(temp$) - {{Text|4|#F580B1}})) {{Text|<nowiki>'and strip off the THEN and extra spaces</nowiki>|#919191}}
                result = {{Text|EvalPreIF|#55FF55}}(temp$, a$)
                {{Cl|IF}} a$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Cl|IF}} result <> {{Text|0|#F580B1}} {{Cl|THEN}}
                    ExecLevel(ExecCounter) = ExecLevel(ExecCounter - {{Text|1|#F580B1}}) {{Text|<nowiki>'So we inherit the execlevel from above</nowiki>|#919191}}
                    {{Cl|IF}} ExecLevel(ExecCounter) = {{Text|0|#F580B1}} {{Cl|THEN}} DefineElse(ExecCounter) = DefineElse(ExecCounter) {{Cl|OR}} {{Text|4|#F580B1}} {{Text|<nowiki>'Else if used and conditon found</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|GOTO}} 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>|#919191}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} temp$ = {{Text|<nowiki>"$END IF"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} temp$ = {{Text|<nowiki>"$ENDIF"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} DefineElse(ExecCounter) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"$END IF without $IF"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            DefineElse(ExecCounter) = {{Text|0|#F580B1}} {{Text|<nowiki>'We no longer have an $IF block at this level</nowiki>|#919191}}
            ExecCounter = ExecCounter - {{Text|1|#F580B1}}
            {{Cl|GOTO}} finishedlinepp
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} ExecLevel(ExecCounter) {{Cl|THEN}}
            {{Cl|DO}} {{Cl|UNTIL}} linenumber < {{Cl|UBOUND}}(InValidLine)
                {{Cl|REDIM}} {{Cl|_PRESERVE}} InValidLine({{Cl|UBOUND}}(InValidLine) + {{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|_BYTE}}
            {{Cl|LOOP}}
            InValidLine(linenumber) = {{Text|-1|#F580B1}}
            {{Cl|GOTO}} finishedlinepp {{Text|<nowiki>'we don't check for anything inside lines that we've marked for skipping</nowiki>|#919191}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} {{Cl|LEFT$}}(temp$, {{Text|7|#F580B1}}) = {{Text|<nowiki>"$ERROR "</nowiki>|#FFB100}} {{Cl|THEN}}
            temp$ = {{Cl|LTRIM$}}({{Cl|MID$ (function)|MID$}}(temp$, {{Text|7|#F580B1}}))
            a$ = {{Text|<nowiki>"Compilation check failed: "</nowiki>|#FFB100}} + temp$
            {{Cl|GOTO}} errmes
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} {{Cl|LEFT$}}(temp$, {{Text|5|#F580B1}}) = {{Text|<nowiki>"$LET "</nowiki>|#FFB100}} {{Cl|THEN}}
            temp$ = {{Cl|LTRIM$}}({{Cl|MID$ (function)|MID$}}(temp$, {{Text|5|#F580B1}})) {{Text|<nowiki>'simply shorten our string to parse</nowiki>|#919191}}
            {{Text|<nowiki>'For starters, let's make certain that we have 3 elements to deal with</nowiki>|#919191}}
            temp = {{Cl|INSTR}}(temp$, {{Text|<nowiki>"="</nowiki>|#FFB100}}) {{Text|<nowiki>'without an = in there, we can't get a value from the left and right side</nowiki>|#919191}}
            {{Cl|IF}} temp = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid Syntax.  $LET <flag> = <value>"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            l$ = {{Cl|RTRIM$}}({{Cl|LEFT$}}(temp$, temp - {{Text|1|#F580B1}})): r$ = {{Cl|LTRIM$}}({{Cl|MID$ (function)|MID$}}(temp$, temp + {{Text|1|#F580B1}}))
            {{Text|<nowiki>'then validate to make certain the left side looks proper</nowiki>|#919191}}
            {{Cl|IF}} {{Text|validname|#55FF55}}(l$) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid flag name"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|IF}} {{Cl|LEFT$}}(r$, {{Text|1|#F580B1}}) = {{Cl|CHR$}}({{Text|34|#F580B1}}) {{Cl|THEN}} r$ = {{Cl|LTRIM$}}({{Cl|MID$ (function)|MID$}}(r$, {{Text|2|#F580B1}}))
            {{Cl|IF}} {{Cl|RIGHT$}}(r$, {{Text|1|#F580B1}}) = {{Cl|CHR$}}({{Text|34|#F580B1}}) {{Cl|THEN}} r$ = {{Cl|RTRIM$}}({{Cl|LEFT$}}(r$, {{Cl|LEN}}(r$) - {{Text|1|#F580B1}}))
            {{Cl|IF}} {{Cl|LEFT$}}(r$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"-"</nowiki>|#FFB100}} {{Cl|THEN}}
                r1$ = {{Text|<nowiki>"-"</nowiki>|#FFB100}}
                r$ = {{Cl|LTRIM$}}({{Cl|MID$ (function)|MID$}}(r$, {{Text|2|#F580B1}}))
            {{Cl|ELSE}}
                r1$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'then validate to make certain the left side looks proper</nowiki>|#919191}}
            {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(r$)
                a = {{Cl|ASC (function)|ASC}}(r$, i)
                {{Cl|SELECT}} {{Cl|CASE}} a
                    {{Cl|CASE}} {{Text|32|#F580B1}}
                    {{Cl|CASE}} {{Text|46|#F580B1}} {{Text|<nowiki>'periods are fine.</nowiki>|#919191}}
                        r1$ = r1$ + {{Text|<nowiki>"."</nowiki>|#FFB100}}
                    {{Cl|CASE}} {{Cl|IS}} < {{Text|48|#F580B1}}, {{Cl|IS}} > {{Text|90|#F580B1}}
                        a$ = {{Text|<nowiki>"Invalid value"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    {{Cl|CASE}} {{Cl|ELSE}}
                        r1$ = r1$ + {{Cl|CHR$}}(a)
                {{Cl|END}} {{Cl|SELECT}}
            {{Cl|NEXT}}
            r$ = r1$
            {{Text|<nowiki>'First look to see if we have an existing setting like this and if so, update it</nowiki>|#919191}}
            {{Cl|FOR}} i = {{Text|8|#F580B1}} {{Cl|TO}} UserDefineCount {{Text|<nowiki>'UserDefineCount 1-7 are reserved for automatic OS/BIT detection & version</nowiki>|#919191}}
                {{Cl|IF}} UserDefine({{Text|0|#F580B1}}, i) = l$ {{Cl|THEN}} UserDefine({{Text|1|#F580B1}}, i) = r$: {{Cl|GOTO}} finishedlinepp
            {{Cl|NEXT}}
            {{Text|<nowiki>'Otherwise create a new setting and set the initial value for it</nowiki>|#919191}}
            UserDefineCount = UserDefineCount + {{Text|1|#F580B1}}
            {{Cl|IF}} UserDefineCount > {{Cl|UBOUND}}(UserDefine, {{Text|2|#F580B1}}) {{Cl|THEN}}
                {{Cl|REDIM}} {{Cl|_PRESERVE}} UserDefine({{Text|1|#F580B1}}, {{Cl|UBOUND}}(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>|#919191}}
            {{Cl|END}} {{Cl|IF}}
            UserDefine({{Text|0|#F580B1}}, UserDefineCount) = l$
            UserDefine({{Text|1|#F580B1}}, UserDefineCount) = r$
            {{Cl|GOTO}} finishedlinepp
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>' We check for Unstable flags during the preprocessing step because it</nowiki>|#919191}}
        {{Text|<nowiki>' impacts what valid commands there are in all the other steps</nowiki>|#919191}}
        {{Cl|IF}} {{Cl|LEFT$}}(temp$, {{Text|10|#F580B1}}) = {{Text|<nowiki>"$UNSTABLE:"</nowiki>|#FFB100}} {{Cl|THEN}}
            token$ = {{Cl|UCASE$}}({{Cl|LTRIM$}}({{Cl|RTRIM$}}({{Cl|MID$ (function)|MID$}}(temp$, {{Text|11|#F580B1}}))))
            {{Cl|SELECT}} {{Cl|CASE}} token$
                {{Cl|CASE}} {{Text|<nowiki>"MIDI"</nowiki>|#FFB100}}
                    {{Cl|IF}} {{Cl|NOT}} UseMiniaudioBackend {{Cl|THEN}}
                        a$ = {{Text|<nowiki>"Midi is not supported with the old OpenAL audio backend."</nowiki>|#FFB100}}
                        {{Cl|GOTO}} errmes
                    {{Cl|END}} {{Cl|IF}}
                    unstableFlags(UNSTABLE_MIDI) = {{Text|-1|#F580B1}}
                {{Cl|CASE}} {{Text|<nowiki>"HTTP"</nowiki>|#FFB100}}
                    unstableFlags(UNSTABLE_HTTP) = {{Text|-1|#F580B1}}
                    {{Text|regUnstableHttp|#55FF55}}
                {{Cl|CASE}} {{Cl|ELSE}}
                    a$ = {{Text|<nowiki>"Unrecognized unstable flag "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(token$)
                    {{Cl|GOTO}} errmes
            {{Cl|END}} {{Cl|SELECT}}
        {{Cl|END}} {{Cl|IF}}
        cwholeline$ = wholeline$
        wholeline$ = {{Text|eleucase$|#55FF55}}(wholeline$) {{Text|<nowiki>'********REMOVE THIS LINE LATER********</nowiki>|#919191}}
        addmetadynamic = {{Text|0|#F580B1}}: addmetastatic = {{Text|0|#F580B1}}
        wholelinen = {{Text|numelements|#55FF55}}(wholeline$)
        {{Cl|IF}} wholelinen {{Cl|THEN}}
            wholelinei = {{Text|1|#F580B1}}
            {{Text|<nowiki>'skip line number?</nowiki>|#919191}}
            e$ = {{Text|getelement$|#55FF55}}(wholeline$, {{Text|1|#F580B1}})
            {{Cl|IF}} ({{Cl|ASC (function)|ASC}}(e$) >= {{Text|48|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|ASC (function)|ASC}}(e$) <= {{Text|59|#F580B1}}) {{Cl|OR (boolean)|OR}} {{Cl|ASC (function)|ASC}}(e$) = {{Text|46|#F580B1}} {{Cl|THEN}} wholelinei = {{Text|2|#F580B1}}: {{Cl|GOTO}} ppskpl
            {{Text|<nowiki>'skip 'POSSIBLE' line label?</nowiki>|#919191}}
            {{Cl|IF}} wholelinen >= {{Text|2|#F580B1}} {{Cl|THEN}}
                x2 = {{Cl|INSTR}}(wholeline$, sp + {{Text|<nowiki>":"</nowiki>|#FFB100}} + sp): x3 = x2 + {{Text|2|#F580B1}}
                {{Cl|IF}} x2 = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} {{Cl|RIGHT$}}(wholeline$, {{Text|2|#F580B1}}) = sp + {{Text|<nowiki>":"</nowiki>|#FFB100}} {{Cl|THEN}} x2 = {{Cl|LEN}}(wholeline$) - {{Text|1|#F580B1}}: x3 = x2 + {{Text|1|#F580B1}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} x2 {{Cl|THEN}}
                    e$ = {{Cl|LEFT$}}(wholeline$, x2 - {{Text|1|#F580B1}})
                    {{Cl|IF}} {{Text|validlabel|#55FF55}}(e$) {{Cl|THEN}}
                        wholeline$ = {{Cl|RIGHT$}}(wholeline$, {{Cl|LEN}}(wholeline$) - x3)
                        cwholeline$ = {{Cl|RIGHT$}}(cwholeline$, {{Cl|LEN}}(wholeline$) - x3)
                        wholelinen = {{Text|numelements|#55FF55}}(wholeline$)
                        {{Cl|GOTO}} ppskpl
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'valid</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'includes ":"</nowiki>|#919191}}
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'wholelinen>=2</nowiki>|#919191}}
            ppskpl:
            {{Cl|IF}} wholelinei <= wholelinen {{Cl|THEN}}
                {{Text|<nowiki>'----------------------------------------</nowiki>|#919191}}
                a$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                ca$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                ppblda:
                e$ = {{Text|getelement$|#55FF55}}(wholeline$, wholelinei)
                ce$ = {{Text|getelement$|#55FF55}}(cwholeline$, wholelinei)
                {{Cl|IF}} e$ = {{Text|<nowiki>":"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} e$ = {{Text|<nowiki>"ELSE"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} e$ = {{Text|<nowiki>"THEN"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} e$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} {{Cl|LEN}}(a$) {{Cl|THEN}}
                        {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"PP["</nowiki>|#FFB100}} + a$ + {{Text|<nowiki>"]"</nowiki>|#FFB100}}
                        n = {{Text|numelements|#55FF55}}(a$)
                        firstelement$ = {{Text|getelement|#55FF55}}(a$, {{Text|1|#F580B1}})
                        secondelement$ = {{Text|getelement|#55FF55}}(a$, {{Text|2|#F580B1}})
                        thirdelement$ = {{Text|getelement|#55FF55}}(a$, {{Text|3|#F580B1}})
                        {{Text|<nowiki>'========================================</nowiki>|#919191}}
                        {{Cl|IF}} n = {{Text|2|#F580B1}} {{Cl|AND (boolean)|AND}} firstelement$ = {{Text|<nowiki>"END"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} (secondelement$ = {{Text|<nowiki>"SUB"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} secondelement$ = {{Text|<nowiki>"FUNCTION"</nowiki>|#FFB100}}) {{Cl|THEN}}
                            closedsubfunc = {{Text|-1|#F580B1}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Text|<nowiki>'declare library</nowiki>|#919191}}
                        {{Cl|IF}} declaringlibrary {{Cl|THEN}}
                            {{Cl|IF}} firstelement$ = {{Text|<nowiki>"END"</nowiki>|#FFB100}} {{Cl|THEN}}
                                {{Cl|IF}} n <> {{Text|2|#F580B1}} {{Cl|OR (boolean)|OR}} secondelement$ <> {{Text|<nowiki>"DECLARE"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected END DECLARE"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                declaringlibrary = {{Text|0|#F580B1}}
                                {{Cl|GOTO}} finishedlinepp
                            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'end declare</nowiki>|#919191}}
                            declaringlibrary = {{Text|2|#F580B1}}
                            {{Cl|IF}} firstelement$ = {{Text|<nowiki>"SUB"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} firstelement$ = {{Text|<nowiki>"FUNCTION"</nowiki>|#FFB100}} {{Cl|THEN}} subfuncn = subfuncn - {{Text|1|#F580B1}}: {{Cl|GOTO}} declaresubfunc
                            a$ = {{Text|<nowiki>"Expected SUB/FUNCTION definition or END DECLARE (#2)"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                        {{Cl|END}} {{Cl|IF}}
                        {{Text|<nowiki>'UDT TYPE definition</nowiki>|#919191}}
                        {{Cl|IF}} definingtype {{Cl|THEN}}
                            i = definingtype
                            {{Cl|IF}} n >= {{Text|1|#F580B1}} {{Cl|THEN}}
                                {{Cl|IF}} firstelement$ = {{Text|<nowiki>"END"</nowiki>|#FFB100}} {{Cl|THEN}}
                                    {{Cl|IF}} n <> {{Text|2|#F580B1}} {{Cl|OR (boolean)|OR}} secondelement$ <> {{Text|<nowiki>"TYPE"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected END TYPE"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                    {{Cl|IF}} udtxnext(i) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"No elements defined in TYPE"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                    definingtype = {{Text|0|#F580B1}}
                                    {{Text|<nowiki>'create global buffer for SWAP space</nowiki>|#919191}}
                                    siz$ = {{Text|str2$|#55FF55}}(udtxsize(i) \ {{Text|8|#F580B1}})
                                    {{Text|WriteBufLine|#55FF55}} GlobTxtBuf, {{Text|<nowiki>"char *g_tmp_udt_"</nowiki>|#FFB100}} + {{Cl|RTRIM$}}(udtxname(i)) + {{Text|<nowiki>"=(char*)malloc("</nowiki>|#FFB100}} + siz$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                                    {{Text|<nowiki>'print "END TYPE";udtxsize(i);udtxbytealign(i)</nowiki>|#919191}}
                                    {{Cl|GOTO}} finishedlinepp
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                            {{Cl|IF}} n < {{Text|3|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected element-name AS type, AS type element-list, or END TYPE"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                            n$ = firstelement$
                            {{Cl|IF}} n$ <> {{Text|<nowiki>"AS"</nowiki>|#FFB100}} {{Cl|THEN}}
                                {{Text|<nowiki>'traditional variable-name AS type syntax, single-element</nowiki>|#919191}}
                                lasttypeelement = lasttypeelement + {{Text|1|#F580B1}}
                                i2 = lasttypeelement
                                {{Cl|WHILE}} i2 > {{Cl|UBOUND}}(udtenext): {{Text|increaseUDTArrays|#55FF55}}: {{Cl|WEND}}
                                udtenext(i2) = {{Text|0|#F580B1}}
                                ii = {{Text|2|#F580B1}}
                                udtearrayelements(i2) = {{Text|0|#F580B1}}
                                {{Cl|IF}} ii >= n {{Cl|OR (boolean)|OR}} {{Text|getelement$|#55FF55}}(a$, ii) <> {{Text|<nowiki>"AS"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected element-name AS type, AS type element-list, or END TYPE"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                t$ = {{Text|getelements$|#55FF55}}(a$, ii + {{Text|1|#F580B1}}, n)
                                {{Cl|IF}} t$ = {{Cl|RTRIM$}}(udtxname(definingtype)) {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid self-reference"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                typ = {{Text|typname2typ|#55FF55}}(t$)
                                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                {{Cl|IF}} typ = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Undefined type"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                typsize = typname2typsize
                                {{Cl|IF}} {{Text|validname|#55FF55}}(n$) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid name"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                udtename(i2) = n$
                                udtecname(i2) = {{Text|getelement$|#55FF55}}(ca$, {{Text|1|#F580B1}})
                                NormalTypeBlock:
                                typeDefinitions$ = typeDefinitions$ + {{Cl|MKL$}}(i2) + {{Cl|MKL$}}({{Cl|LEN}}(n$)) + n$
                                udtetype(i2) = typ
                                udtetypesize(i2) = typsize
                                hashname$ = n$
                                {{Text|<nowiki>'check for name conflicts (any similar reserved or element from current UDT)</nowiki>|#919191}}
                                hashchkflags = HASHFLAG_RESERVED + HASHFLAG_UDTELEMENT
                                hashres = {{Text|HashFind|#55FF55}}(hashname$, hashchkflags, hashresflags, hashresref)
                                {{Cl|DO}} {{Cl|WHILE}} hashres
                                    {{Cl|IF}} hashresflags {{Cl|AND (boolean)|AND}} HASHFLAG_UDTELEMENT {{Cl|THEN}}
                                        {{Cl|IF}} hashresref = i {{Cl|THEN}} a$ = {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + hashname$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Cl|IF}} hashresflags {{Cl|AND (boolean)|AND}} HASHFLAG_RESERVED {{Cl|THEN}}
                                        {{Cl|IF}} hashresflags {{Cl|AND (boolean)|AND}} (HASHFLAG_TYPE + HASHFLAG_CUSTOMSYNTAX + HASHFLAG_OPERATOR + HASHFLAG_XELEMENTNAME) {{Cl|THEN}} a$ = {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + hashname$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Cl|IF}} hashres <> {{Text|1|#F580B1}} {{Cl|THEN}} hashres = {{Text|HashFindCont|#55FF55}}(hashresflags, hashresref) {{Cl|ELSE}} hashres = {{Text|0|#F580B1}}
                                {{Cl|LOOP}}
                                {{Text|<nowiki>'add to hash table</nowiki>|#919191}}
                                {{Text|HashAdd|#55FF55}} hashname$, HASHFLAG_UDTELEMENT, i
                                {{Text|<nowiki>'Calculate element's size</nowiki>|#919191}}
                                {{Cl|IF}} typ {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
                                    u = typ {{Cl|AND}} {{Text|511|#F580B1}}
                                    udtesize(i2) = udtxsize(u)
                                    {{Cl|IF}} udtxbytealign(u) {{Cl|THEN}} udtxbytealign(i) = {{Text|1|#F580B1}}: udtebytealign(i2) = {{Text|1|#F580B1}}
                                    {{Cl|IF}} udtxvariable(u) {{Cl|THEN}} udtxvariable(i) = {{Text|-1|#F580B1}}
                                {{Cl|ELSE}}
                                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}}
                                        {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                            udtesize(i2) = OFFSETTYPE {{Cl|AND}} {{Text|511|#F580B1}}
                                            udtxvariable(i) = {{Text|-1|#F580B1}}
                                        {{Cl|ELSE}}
                                            udtesize(i2) = typsize * {{Text|8|#F580B1}}
                                        {{Cl|END}} {{Cl|IF}}
                                        udtxbytealign(i) = {{Text|1|#F580B1}}: udtebytealign(i2) = {{Text|1|#F580B1}}
                                    {{Cl|ELSE}}
                                        udtesize(i2) = typ {{Cl|AND}} {{Text|511|#F580B1}}
                                        {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) = {{Text|0|#F580B1}} {{Cl|THEN}} udtxbytealign(i) = {{Text|1|#F580B1}}: udtebytealign(i2) = {{Text|1|#F580B1}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|<nowiki>'Increase block size</nowiki>|#919191}}
                                {{Cl|IF}} udtebytealign(i2) {{Cl|THEN}}
                                    {{Cl|IF}} udtxsize(i) {{Cl|MOD}} {{Text|8|#F580B1}} {{Cl|THEN}}
                                        udtxsize(i) = udtxsize(i) + ({{Text|8|#F580B1}} - (udtxsize(i) {{Cl|MOD}} {{Text|8|#F580B1}}))
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                udtxsize(i) = udtxsize(i) + udtesize(i2)
                                {{Text|<nowiki>'Link element to previous element</nowiki>|#919191}}
                                {{Cl|IF}} udtxnext(i) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    udtxnext(i) = i2
                                {{Cl|ELSE}}
                                    udtenext(i2 - {{Text|1|#F580B1}}) = i2
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|<nowiki>'print "+"+rtrim$(udtename(i2));udtetype(i2);udtesize(i2);udtebytealign(i2);udtxsize(i)</nowiki>|#919191}}
                                {{Cl|IF}} newAsTypeBlockSyntax {{Cl|THEN}} {{Cl|RETURN}}
                                {{Cl|GOTO}} finishedlinepp
                            {{Cl|ELSE}}
                                {{Text|<nowiki>'new AS type variable-list syntax, multiple elements</nowiki>|#919191}}
                                ii = {{Text|2|#F580B1}}
                                {{Cl|IF}} ii >= n {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected element-name AS type, AS type element-list, or END TYPE"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                previousElement$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                                t$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                                lastElement$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                                buildTypeName:
                                lastElement$ = {{Text|getelement$|#55FF55}}(a$, ii)
                                {{Cl|IF}} lastElement$ <> {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} lastElement$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
                                    n$ = lastElement$
                                    cn$ = {{Text|getelement$|#55FF55}}(ca$, ii)
                                    {{Cl|IF}} {{Cl|LEN}}(previousElement$) {{Cl|THEN}} t$ = t$ + previousElement$ + {{Text|<nowiki>" "</nowiki>|#FFB100}}
                                    previousElement$ = n$
                                    lastElement$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                                    ii = ii + {{Text|1|#F580B1}}
                                    {{Cl|GOTO}} buildTypeName
                                {{Cl|END}} {{Cl|IF}}
                                t$ = {{Cl|RTRIM$}}(t$)
                                {{Cl|IF}} t$ = {{Cl|RTRIM$}}(udtxname(definingtype)) {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid self-reference"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                typ = {{Text|typname2typ|#55FF55}}(t$)
                                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                {{Cl|IF}} typ = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Undefined type"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                typsize = typname2typsize
                                previousElement$ = lastElement$
                                nexttypeelement:
                                lasttypeelement = lasttypeelement + {{Text|1|#F580B1}}
                                i2 = lasttypeelement
                                {{Cl|WHILE}} i2 > {{Cl|UBOUND}}(udtenext): {{Text|increaseUDTArrays|#55FF55}}: {{Cl|WEND}}
                                udtenext(i2) = {{Text|0|#F580B1}}
                                udtearrayelements(i2) = {{Text|0|#F580B1}}
                                udtename(i2) = n$
                                udtecname(i2) = cn$
                                {{Cl|IF}} {{Text|validname|#55FF55}}(n$) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid name"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                newAsTypeBlockSyntax = {{Text|-1|#F580B1}}
                                {{Cl|GOSUB}} NormalTypeBlock
                                newAsTypeBlockSyntax = {{Text|0|#F580B1}}
                                getNextElement:
                                ii = ii + {{Text|1|#F580B1}}
                                lastElement$ = {{Text|getelement$|#55FF55}}(a$, ii)
                                {{Cl|IF}} lastElement$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} finishedlinepp
                                {{Cl|IF}} ii = n {{Cl|AND (boolean)|AND}} lastElement$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected element-name"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                {{Cl|IF}} lastElement$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}}
                                    {{Cl|IF}} previousElement$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected element-name"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                    previousElement$ = lastElement$
                                    {{Cl|GOTO}} getNextElement
                                {{Cl|END}} {{Cl|IF}}
                                n$ = lastElement$
                                {{Cl|IF}} previousElement$ <> {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ,"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                previousElement$ = lastElement$
                                cn$ = {{Text|getelement$|#55FF55}}(ca$, ii)
                                {{Cl|GOTO}} nexttypeelement
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'definingtype</nowiki>|#919191}}
                        {{Cl|IF}} definingtype {{Cl|AND (boolean)|AND}} n >= {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected END TYPE"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                        {{Cl|IF}} n >= {{Text|1|#F580B1}} {{Cl|THEN}}
                            {{Cl|IF}} firstelement$ = {{Text|<nowiki>"TYPE"</nowiki>|#FFB100}} {{Cl|THEN}}
                                {{Cl|IF}} n <> {{Text|2|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected TYPE typename"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                lasttype = lasttype + {{Text|1|#F580B1}}
                                typeDefinitions$ = typeDefinitions$ + {{Cl|MKL$}}({{Text|-1|#F580B1}}) + {{Cl|MKL$}}(lasttype)
                                definingtype = lasttype
                                i = definingtype
                                {{Cl|WHILE}} i > {{Cl|UBOUND}}(udtenext): {{Text|increaseUDTArrays|#55FF55}}: {{Cl|WEND}}
                                {{Cl|IF}} {{Text|validname|#55FF55}}(secondelement$) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid name"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                typeDefinitions$ = typeDefinitions$ + {{Cl|MKL$}}({{Cl|LEN}}(secondelement$)) + secondelement$
                                udtxname(i) = secondelement$
                                udtxcname(i) = {{Text|getelement|#55FF55}}(ca$, {{Text|2|#F580B1}})
                                udtxnext(i) = {{Text|0|#F580B1}}
                                udtxsize(i) = {{Text|0|#F580B1}}
                                udtxvariable(i) = {{Text|0|#F580B1}}
                                hashname$ = secondelement$
                                hashflags = HASHFLAG_UDT
                                {{Text|<nowiki>'check for name conflicts (any similar reserved/sub/function/UDT name)</nowiki>|#919191}}
                                hashchkflags = HASHFLAG_RESERVED + HASHFLAG_SUB + HASHFLAG_FUNCTION + HASHFLAG_UDT
                                hashres = {{Text|HashFind|#55FF55}}(hashname$, hashchkflags, hashresflags, hashresref)
                                {{Cl|DO}} {{Cl|WHILE}} hashres
                                    allow = {{Text|0|#F580B1}}
                                    {{Cl|IF}} hashresflags {{Cl|AND (boolean)|AND}} (HASHFLAG_SUB + HASHFLAG_FUNCTION) {{Cl|THEN}}
                                        allow = {{Text|1|#F580B1}}
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Cl|IF}} hashresflags {{Cl|AND (boolean)|AND}} HASHFLAG_RESERVED {{Cl|THEN}}
                                        {{Cl|IF}} (hashresflags {{Cl|AND (boolean)|AND}} (HASHFLAG_TYPE + HASHFLAG_OPERATOR + HASHFLAG_CUSTOMSYNTAX + HASHFLAG_XTYPENAME)) = {{Text|0|#F580B1}} {{Cl|THEN}} allow = {{Text|1|#F580B1}}
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Cl|IF}} allow = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + hashname$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                    {{Cl|IF}} hashres <> {{Text|1|#F580B1}} {{Cl|THEN}} hashres = {{Text|HashFindCont|#55FF55}}(hashresflags, hashresref) {{Cl|ELSE}} hashres = {{Text|0|#F580B1}}
                                {{Cl|LOOP}}
                                {{Text|<nowiki>'add to hash table</nowiki>|#919191}}
                                {{Text|HashAdd|#55FF55}} hashname$, hashflags, i
                                {{Cl|GOTO}} finishedlinepp
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} n >= {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} firstelement$ = {{Text|<nowiki>"CONST"</nowiki>|#FFB100}} {{Cl|THEN}}
                            {{Text|<nowiki>'l$ = "CONST"</nowiki>|#919191}}
                            {{Text|<nowiki>'DEF... do not change type, the expression is stored in a suitable type</nowiki>|#919191}}
                            {{Text|<nowiki>'based on its value if type isn't forced/specified</nowiki>|#919191}}
                            {{Cl|IF}} subfuncn > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} closedsubfunc <> {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Statement cannot be placed between SUB/FUNCTIONs"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                            {{Text|<nowiki>'convert periods to _046_</nowiki>|#919191}}
                            i2 = {{Cl|INSTR}}(a$, sp + {{Text|<nowiki>"."</nowiki>|#FFB100}} + sp)
                            {{Cl|IF}} i2 {{Cl|THEN}}
                                {{Cl|DO}}
                                    a$ = {{Cl|LEFT$}}(a$, i2 - {{Text|1|#F580B1}}) + fix046$ + {{Cl|RIGHT$}}(a$, {{Cl|LEN}}(a$) - i2 - {{Text|2|#F580B1}})
                                    ca$ = {{Cl|LEFT$}}(ca$, i2 - {{Text|1|#F580B1}}) + fix046$ + {{Cl|RIGHT$}}(ca$, {{Cl|LEN}}(ca$) - i2 - {{Text|2|#F580B1}})
                                    i2 = {{Cl|INSTR}}(a$, sp + {{Text|<nowiki>"."</nowiki>|#FFB100}} + sp)
                                {{Cl|LOOP}} {{Cl|UNTIL}} i2 = {{Text|0|#F580B1}}
                                n = {{Text|numelements|#55FF55}}(a$)
                                firstelement$ = {{Text|getelement|#55FF55}}(a$, {{Text|1|#F580B1}}): secondelement$ = {{Text|getelement|#55FF55}}(a$, {{Text|2|#F580B1}}): thirdelement$ = {{Text|getelement|#55FF55}}(a$, {{Text|3|#F580B1}})
                            {{Cl|END}} {{Cl|IF}}
                            {{Cl|IF}} n < {{Text|3|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected CONST name = value/expression"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                            i = {{Text|2|#F580B1}}
                            constdefpendingpp:
                            pending = {{Text|0|#F580B1}}
                            n$ = {{Text|getelement$|#55FF55}}(ca$, i): i = i + {{Text|1|#F580B1}}
                            typeoverride = {{Text|0|#F580B1}}
                            s$ = {{Text|removesymbol$|#55FF55}}(n$)
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Cl|IF}} s$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
                                typeoverride = {{Text|typname2typ|#55FF55}}(s$)
                                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                {{Cl|IF}} typeoverride {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid constant type"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                {{Cl|IF}} typeoverride = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid constant type"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                            {{Cl|END}} {{Cl|IF}}
                            {{Cl|IF}} {{Text|getelement$|#55FF55}}(a$, i) <> {{Text|<nowiki>"="</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ="</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                            i = i + {{Text|1|#F580B1}}
                            {{Text|<nowiki>'get expression</nowiki>|#919191}}
                            e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                            readable_e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                            B = {{Text|0|#F580B1}}
                            {{Cl|FOR}} i2 = i {{Cl|TO}} n
                                e2$ = {{Text|getelement$|#55FF55}}(ca$, i2)
                                {{Cl|IF}} e2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} B = B + {{Text|1|#F580B1}}
                                {{Cl|IF}} e2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} B = B - {{Text|1|#F580B1}}
                                {{Cl|IF}} e2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} B = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    pending = {{Text|1|#F580B1}}
                                    i = i2 + {{Text|1|#F580B1}}
                                    {{Cl|IF}} i > n - {{Text|2|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected CONST ... , name = value/expression"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                    {{Cl|EXIT}} {{Cl|FOR}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Cl|IF}} {{Cl|LEN}}(e$) = {{Text|0|#F580B1}} {{Cl|THEN}} e$ = e2$ {{Cl|ELSE}} e$ = e$ + sp + e2$
                                e3$ = e2$
                                {{Cl|IF}} {{Cl|LEN}}(e2$) > {{Text|1|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|ASC (function)|ASC}}(e2$, {{Text|1|#F580B1}}) = {{Text|34|#F580B1}} {{Cl|THEN}}
                                        removeComma = {{Cl|_INSTRREV}}(e2$, {{Text|<nowiki>","</nowiki>|#FFB100}})
                                        e3$ = {{Cl|LEFT$}}(e2$, removeComma - {{Text|1|#F580B1}})
                                    {{Cl|ELSE}}
                                        removeComma = {{Cl|INSTR}}(e2$, {{Text|<nowiki>","</nowiki>|#FFB100}})
                                        e3$ = {{Cl|MID$ (function)|MID$}}(e2$, removeComma + {{Text|1|#F580B1}})
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Cl|IF}} {{Cl|LEN}}(readable_e$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    readable_e$ = e3$
                                {{Cl|ELSE}}
                                    readable_e$ = readable_e$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} + e3$
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|NEXT}}
                            {{Text|<nowiki>'intercept current expression and pass it through Evaluate_Expression$</nowiki>|#919191}}
                            {{Text|<nowiki>'(unless it is a literal string)</nowiki>|#919191}}
                            {{Cl|IF}} {{Cl|LEFT$}}(readable_e$, {{Text|1|#F580B1}}) <> {{Cl|CHR$}}({{Text|34|#F580B1}}) {{Cl|THEN}}
                                temp1$ = {{Cl|_TRIM$}}({{Text|Evaluate_Expression$|#55FF55}}(readable_e$))
                                {{Cl|IF}} {{Cl|LEFT$}}(temp1$, {{Text|5|#F580B1}}) <> {{Text|<nowiki>"ERROR"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} e$ <> temp1$ {{Cl|THEN}}
                                    e$ = {{Text|lineformat|#55FF55}}(temp1$) {{Text|<nowiki>'retrieve parseable format</nowiki>|#919191}}
                                {{Cl|ELSE}}
                                    {{Cl|IF}} temp1$ = {{Text|<nowiki>"ERROR - Division By Zero"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = temp1$: {{Cl|GOTO}} errmes
                                    {{Cl|IF}} {{Cl|INSTR}}(temp1$, {{Text|<nowiki>"Improper operations"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        a$ = {{Text|<nowiki>"Invalid CONST expression.14"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                            {{Text|<nowiki>'Proceed as usual</nowiki>|#919191}}
                            e$ = {{Text|fixoperationorder|#55FF55}}(e$)
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            e$ = {{Text|evaluateconst|#55FF55}}(e$, t)
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}} {{Text|<nowiki>'string type</nowiki>|#919191}}
                                {{Cl|IF}} typeoverride {{Cl|THEN}}
                                    {{Cl|IF}} (typeoverride {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Type mismatch"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|ELSE}} {{Text|<nowiki>'not a string type</nowiki>|#919191}}
                                {{Cl|IF}} typeoverride {{Cl|THEN}}
                                    {{Cl|IF}} typeoverride {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}} a$ = {{Text|<nowiki>"Type mismatch"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                {{Cl|END}} {{Cl|IF}}
                                {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISFLOAT {{Cl|THEN}}
                                    constval## = {{Cl|_CV}}({{Cl|_FLOAT}}, e$)
                                    constval&& = constval##
                                    constval~&& = constval&&
                                {{Cl|ELSE}}
                                    {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISUNSIGNED) {{Cl|AND (boolean)|AND}} (t {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|64|#F580B1}} {{Cl|THEN}}
                                        constval~&& = {{Cl|_CV}}({{Cl|_UNSIGNED}} {{Cl|_INTEGER64}}, e$)
                                        constval&& = constval~&&
                                        constval## = constval&&
                                    {{Cl|ELSE}}
                                        constval&& = {{Cl|_CV}}({{Cl|_INTEGER64}}, e$)
                                        constval## = constval&&
                                        constval~&& = constval&&
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|<nowiki>'override type?</nowiki>|#919191}}
                                {{Cl|IF}} typeoverride {{Cl|THEN}}
                                    {{Text|<nowiki>'range check required here (noted in todo)</nowiki>|#919191}}
                                    t = typeoverride
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'not a string type</nowiki>|#919191}}
                            constlast = constlast + {{Text|1|#F580B1}}
                            {{Cl|IF}} constlast > constmax {{Cl|THEN}}
                                constmax = constmax * {{Text|2|#F580B1}}
                                {{Cl|REDIM}} {{Cl|_PRESERVE}} constname(constmax) {{Cl|AS}} {{Cl|STRING}}
                                {{Cl|REDIM}} {{Cl|_PRESERVE}} constcname(constmax) {{Cl|AS}} {{Cl|STRING}}
                                {{Cl|REDIM}} {{Cl|_PRESERVE}} constnamesymbol(constmax) {{Cl|AS}} {{Cl|STRING}} {{Text|<nowiki>'optional name symbol</nowiki>|#919191}}
                                {{Cl|REDIM}} {{Cl|_PRESERVE}} consttype(constmax) {{Cl|AS}} {{Cl|LONG}} {{Text|<nowiki>'variable type number</nowiki>|#919191}}
                                {{Cl|REDIM}} {{Cl|_PRESERVE}} constinteger(constmax) {{Cl|AS}} {{Cl|_INTEGER64}}
                                {{Cl|REDIM}} {{Cl|_PRESERVE}} constuinteger(constmax) {{Cl|AS}} {{Cl|_UNSIGNED}} {{Cl|_INTEGER64}}
                                {{Cl|REDIM}} {{Cl|_PRESERVE}} constfloat(constmax) {{Cl|AS}} {{Cl|_FLOAT}}
                                {{Cl|REDIM}} {{Cl|_PRESERVE}} conststring(constmax) {{Cl|AS}} {{Cl|STRING}}
                                {{Cl|REDIM}} {{Cl|_PRESERVE}} constsubfunc(constmax) {{Cl|AS}} {{Cl|LONG}}
                                {{Cl|REDIM}} {{Cl|_PRESERVE}} constdefined(constmax) {{Cl|AS}} {{Cl|LONG}}
                            {{Cl|END}} {{Cl|IF}}
                            i2 = constlast
                            constsubfunc(i2) = subfuncn
                            {{Text|<nowiki>'IF subfunc = "" THEN constlastshared = i2</nowiki>|#919191}}
                            {{Cl|IF}} {{Text|validname|#55FF55}}(n$) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid name"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                            constname(i2) = {{Cl|UCASE$}}(n$)
                            hashname$ = n$
                            {{Text|<nowiki>'check for name conflicts (any similar: reserved, sub, function, constant)</nowiki>|#919191}}
                            allow = {{Text|0|#F580B1}}
                            const_recheck:
                            hashchkflags = HASHFLAG_RESERVED + HASHFLAG_SUB + HASHFLAG_FUNCTION + HASHFLAG_CONSTANT
                            hashres = {{Text|HashFind|#55FF55}}(hashname$, hashchkflags, hashresflags, hashresref)
                            {{Cl|DO}} {{Cl|WHILE}} hashres
                                {{Cl|IF}} hashresflags {{Cl|AND (boolean)|AND}} HASHFLAG_CONSTANT {{Cl|THEN}}
                                    {{Cl|IF}} constsubfunc(hashresref) = subfuncn {{Cl|THEN}}
                                        {{Text|<nowiki>'If merely redefining a CONST with same value</nowiki>|#919191}}
                                        {{Text|<nowiki>'just issue a warning instead of an error</nowiki>|#919191}}
                                        issueWarning = {{Text|0|#F580B1}}
                                        {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                                            {{Cl|IF}} conststring(hashresref) = e$ {{Cl|THEN}} issueWarning = {{Text|-1|#F580B1}}: thisconstval$ = e$
                                        {{Cl|ELSE}}
                                            {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISFLOAT {{Cl|THEN}}
                                                {{Cl|IF}} constfloat(hashresref) = constval## {{Cl|THEN}} issueWarning = {{Text|-1|#F580B1}}: thisconstval$ = {{Cl|STR$}}(constval##)
                                            {{Cl|ELSE}}
                                                {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISUNSIGNED {{Cl|THEN}}
                                                    {{Cl|IF}} constuinteger(hashresref) = constval~&& {{Cl|THEN}} issueWarning = {{Text|-1|#F580B1}}: thisconstval$ = {{Cl|STR$}}(constval~&&)
                                                {{Cl|ELSE}}
                                                    {{Cl|IF}} constinteger(hashresref) = constval&& {{Cl|THEN}} issueWarning = {{Text|-1|#F580B1}}: thisconstval$ = {{Cl|STR$}}(constval&&)
                                                {{Cl|END}} {{Cl|IF}}
                                            {{Cl|END}} {{Cl|IF}}
                                        {{Cl|END}} {{Cl|IF}}
                                        {{Cl|IF}} issueWarning {{Cl|THEN}}
                                            {{Cl|IF}} {{Cl|NOT}} IgnoreWarnings {{Cl|THEN}}
                                                {{Text|addWarning|#55FF55}} linenumber, inclevel, inclinenumber(inclevel), incname$(inclevel), {{Text|<nowiki>"duplicate constant definition"</nowiki>|#FFB100}}, n$ + {{Text|<nowiki>" ="</nowiki>|#FFB100}} + thisconstval$
                                            {{Cl|END}} {{Cl|IF}}
                                            {{Cl|GOTO}} constAddDone
                                        {{Cl|ELSE}}
                                            a$ = {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + hashname$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Cl|IF}} hashresflags {{Cl|AND (boolean)|AND}} HASHFLAG_RESERVED {{Cl|THEN}}
                                    a$ = {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + hashname$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                {{Cl|END}} {{Cl|IF}}
                                {{Cl|IF}} hashresflags {{Cl|AND (boolean)|AND}} (HASHFLAG_SUB + HASHFLAG_FUNCTION) {{Cl|THEN}}
                                    {{Cl|IF}} ids(hashresref).internal_subfunc = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} {{Cl|RTRIM$}}(ids(hashresref).musthave) <> {{Text|<nowiki>"$"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + hashname$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}} a$ = {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + hashname$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                {{Cl|END}} {{Cl|IF}}
                                {{Cl|IF}} hashres <> {{Text|1|#F580B1}} {{Cl|THEN}} hashres = {{Text|HashFindCont|#55FF55}}(hashresflags, hashresref) {{Cl|ELSE}} hashres = {{Text|0|#F580B1}}
                            {{Cl|LOOP}}
                            {{Text|<nowiki>'add to hash table</nowiki>|#919191}}
                            {{Text|HashAdd|#55FF55}} hashname$, HASHFLAG_CONSTANT, i2
                            constdefined(i2) = {{Text|1|#F580B1}}
                            constcname(i2) = n$
                            constnamesymbol(i2) = {{Text|typevalue2symbol$|#55FF55}}(t)
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            consttype(i2) = t
                            {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                                conststring(i2) = e$
                            {{Cl|ELSE}}
                                {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISFLOAT {{Cl|THEN}}
                                    constfloat(i2) = constval##
                                {{Cl|ELSE}}
                                    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISUNSIGNED {{Cl|THEN}}
                                        constuinteger(i2) = constval~&&
                                    {{Cl|ELSE}}
                                        constinteger(i2) = constval&&
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                            constAddDone:
                            {{Cl|IF}} pending {{Cl|THEN}}
                                {{Text|<nowiki>'l$ = l$ + sp2 + ","</nowiki>|#919191}}
                                {{Cl|GOTO}} constdefpendingpp
                            {{Cl|END}} {{Cl|IF}}
                            {{Text|<nowiki>'layoutdone = 1: IF LEN(layout$) THEN layout$ = layout$ + sp + l$ ELSE layout$ = l$</nowiki>|#919191}}
                            {{Cl|GOTO}} finishedlinepp
                        {{Cl|END}} {{Cl|IF}}
                        {{Text|<nowiki>'DEFINE</nowiki>|#919191}}
                        d = {{Text|0|#F580B1}}
                        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"DEFINT"</nowiki>|#FFB100}} {{Cl|THEN}} d = {{Text|1|#F580B1}}
                        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"DEFLNG"</nowiki>|#FFB100}} {{Cl|THEN}} d = {{Text|1|#F580B1}}
                        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"DEFSNG"</nowiki>|#FFB100}} {{Cl|THEN}} d = {{Text|1|#F580B1}}
                        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"DEFDBL"</nowiki>|#FFB100}} {{Cl|THEN}} d = {{Text|1|#F580B1}}
                        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"DEFSTR"</nowiki>|#FFB100}} {{Cl|THEN}} d = {{Text|1|#F580B1}}
                        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"_DEFINE"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (firstelement$ = {{Text|<nowiki>"DEFINE"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}} d = {{Text|1|#F580B1}}
                        {{Cl|IF}} d {{Cl|THEN}}
                            predefining = {{Text|1|#F580B1}}: {{Cl|GOTO}} predefine
                            predefined: predefining = {{Text|0|#F580B1}}
                            {{Cl|GOTO}} finishedlinepp
                        {{Cl|END}} {{Cl|IF}}
                        {{Text|<nowiki>'declare library</nowiki>|#919191}}
                        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"DECLARE"</nowiki>|#FFB100}} {{Cl|THEN}}
                            {{Cl|IF}} secondelement$ = {{Text|<nowiki>"LIBRARY"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} secondelement$ = {{Text|<nowiki>"DYNAMIC"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} secondelement$ = {{Text|<nowiki>"CUSTOMTYPE"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} secondelement$ = {{Text|<nowiki>"STATIC"</nowiki>|#FFB100}} {{Cl|THEN}}
                                declaringlibrary = {{Text|1|#F580B1}}
                                indirectlibrary = {{Text|0|#F580B1}}
                                {{Cl|IF}} secondelement$ = {{Text|<nowiki>"CUSTOMTYPE"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} secondelement$ = {{Text|<nowiki>"DYNAMIC"</nowiki>|#FFB100}} {{Cl|THEN}} indirectlibrary = {{Text|1|#F580B1}}
                                {{Cl|GOTO}} finishedlinepp
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Text|<nowiki>'SUB/FUNCTION</nowiki>|#919191}}
                        dynamiclibrary = {{Text|0|#F580B1}}
                        declaresubfunc:
                        firstelement$ = {{Text|getelement$|#55FF55}}(a$, {{Text|1|#F580B1}})
                        sf = {{Text|0|#F580B1}}
                        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"FUNCTION"</nowiki>|#FFB100}} {{Cl|THEN}} sf = {{Text|1|#F580B1}}
                        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"SUB"</nowiki>|#FFB100}} {{Cl|THEN}} sf = {{Text|2|#F580B1}}
                        {{Cl|IF}} sf {{Cl|THEN}}
                            subfuncn = subfuncn + {{Text|1|#F580B1}}
                            closedsubfunc = {{Text|0|#F580B1}}
                            {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected name after SUB/FUNCTION"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                            {{Text|<nowiki>'convert periods to _046_</nowiki>|#919191}}
                            i2 = {{Cl|INSTR}}(a$, sp + {{Text|<nowiki>"."</nowiki>|#FFB100}} + sp)
                            {{Cl|IF}} i2 {{Cl|THEN}}
                                {{Cl|DO}}
                                    a$ = {{Cl|LEFT$}}(a$, i2 - {{Text|1|#F580B1}}) + fix046$ + {{Cl|RIGHT$}}(a$, {{Cl|LEN}}(a$) - i2 - {{Text|2|#F580B1}})
                                    ca$ = {{Cl|LEFT$}}(ca$, i2 - {{Text|1|#F580B1}}) + fix046$ + {{Cl|RIGHT$}}(ca$, {{Cl|LEN}}(ca$) - i2 - {{Text|2|#F580B1}})
                                    i2 = {{Cl|INSTR}}(a$, sp + {{Text|<nowiki>"."</nowiki>|#FFB100}} + sp)
                                {{Cl|LOOP}} {{Cl|UNTIL}} i2 = {{Text|0|#F580B1}}
                                n = {{Text|numelements|#55FF55}}(a$)
                                firstelement$ = {{Text|getelement|#55FF55}}(a$, {{Text|1|#F580B1}}): secondelement$ = {{Text|getelement|#55FF55}}(a$, {{Text|2|#F580B1}}): thirdelement$ = {{Text|getelement|#55FF55}}(a$, {{Text|3|#F580B1}})
                            {{Cl|END}} {{Cl|IF}}
                            n$ = {{Text|getelement$|#55FF55}}(ca$, {{Text|2|#F580B1}})
                            symbol$ = {{Text|removesymbol$|#55FF55}}(n$)
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Cl|IF}} sf = {{Text|2|#F580B1}} {{Cl|AND (boolean)|AND}} symbol$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Type symbols after a SUB name are invalid"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                            {{Text|<nowiki>'remove STATIC (which is ignored)</nowiki>|#919191}}
                            e$ = {{Text|getelement$|#55FF55}}(a$, n): {{Cl|IF}} e$ = {{Text|<nowiki>"STATIC"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Cl|LEFT$}}(a$, {{Cl|LEN}}(a$) - {{Text|7|#F580B1}}): ca$ = {{Cl|LEFT$}}(ca$, {{Cl|LEN}}(ca$) - {{Text|7|#F580B1}}): n = n - {{Text|1|#F580B1}}
                            {{Text|<nowiki>'check for ALIAS</nowiki>|#919191}}
                            aliasname$ = n$ {{Text|<nowiki>'use given name by default</nowiki>|#919191}}
                            {{Cl|IF}} n > {{Text|2|#F580B1}} {{Cl|THEN}}
                                e$ = {{Text|getelement$|#55FF55}}(a$, {{Text|3|#F580B1}})
                                {{Cl|IF}} e$ = {{Text|<nowiki>"ALIAS"</nowiki>|#FFB100}} {{Cl|THEN}}
                                    {{Cl|IF}} declaringlibrary = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"ALIAS can only be used with DECLARE LIBRARY"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                    {{Cl|IF}} n = {{Text|3|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ALIAS name-in-library"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                    e$ = {{Text|getelement$|#55FF55}}(ca$, {{Text|4|#F580B1}})
                                    {{Text|<nowiki>'strip string content (optional)</nowiki>|#919191}}
                                    {{Cl|IF}} {{Cl|LEFT$}}(e$, {{Text|1|#F580B1}}) = {{Cl|CHR$}}({{Text|34|#F580B1}}) {{Cl|THEN}}
                                        e$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - {{Text|1|#F580B1}})
                                        x = {{Cl|INSTR}}(e$, {{Cl|CHR$}}({{Text|34|#F580B1}})): {{Cl|IF}} x = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}): {{Cl|GOTO}} errmes
                                        e$ = {{Cl|LEFT$}}(e$, x - {{Text|1|#F580B1}})
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Text|<nowiki>'strip fix046$ (created by unquoted periods)</nowiki>|#919191}}
                                    {{Cl|DO}} {{Cl|WHILE}} {{Cl|INSTR}}(e$, fix046$)
                                        x = {{Cl|INSTR}}(e$, fix046$): e$ = {{Cl|LEFT$}}(e$, x - {{Text|1|#F580B1}}) + {{Text|<nowiki>"."</nowiki>|#FFB100}} + {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - x + {{Text|1|#F580B1}} - {{Cl|LEN}}(fix046$))
                                    {{Cl|LOOP}}
                                    {{Text|<nowiki>'validate alias name</nowiki>|#919191}}
                                    {{Cl|IF}} {{Cl|LEN}}(e$) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ALIAS name-in-library"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                    {{Cl|FOR}} x = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(e$)
                                        a = {{Cl|ASC (function)|ASC}}(e$, x)
                                        {{Cl|IF}} alphanumeric(a) = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} a <> ASC_FULLSTOP {{Cl|AND (boolean)|AND}} a <> ASC_COLON {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ALIAS name-in-library"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                    {{Cl|NEXT}}
                                    aliasname$ = e$
                                    {{Text|<nowiki>'remove ALIAS section from line</nowiki>|#919191}}
                                    {{Cl|IF}} n <= {{Text|4|#F580B1}} {{Cl|THEN}} a$ = {{Text|getelements|#55FF55}}(a$, {{Text|1|#F580B1}}, {{Text|2|#F580B1}})
                                    {{Cl|IF}} n >= {{Text|5|#F580B1}} {{Cl|THEN}} a$ = {{Text|getelements|#55FF55}}(a$, {{Text|1|#F580B1}}, {{Text|2|#F580B1}}) + sp + {{Text|getelements|#55FF55}}(a$, {{Text|5|#F580B1}}, n)
                                    {{Cl|IF}} n <= {{Text|4|#F580B1}} {{Cl|THEN}} ca$ = {{Text|getelements|#55FF55}}(ca$, {{Text|1|#F580B1}}, {{Text|2|#F580B1}})
                                    {{Cl|IF}} n >= {{Text|5|#F580B1}} {{Cl|THEN}} ca$ = {{Text|getelements|#55FF55}}(ca$, {{Text|1|#F580B1}}, {{Text|2|#F580B1}}) + sp + {{Text|getelements|#55FF55}}(ca$, {{Text|5|#F580B1}}, n)
                                    n = n - {{Text|2|#F580B1}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                            {{Cl|IF}} declaringlibrary {{Cl|THEN}}
                                {{Cl|IF}} indirectlibrary {{Cl|THEN}}
                                    aliasname$ = n$ {{Text|<nowiki>'override the alias name</nowiki>|#919191}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                            params = {{Text|0|#F580B1}}
                            params$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                            paramsize$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                            nele$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                            nelereq$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                            {{Cl|IF}} n > {{Text|2|#F580B1}} {{Cl|THEN}}
                                e$ = {{Text|getelement$|#55FF55}}(a$, {{Text|3|#F580B1}})
                                {{Cl|IF}} e$ <> {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ("</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                e$ = {{Text|getelement$|#55FF55}}(a$, n)
                                {{Cl|IF}} e$ <> {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected )"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                {{Cl|IF}} n < {{Text|4|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ( ... )"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                {{Cl|IF}} n = {{Text|4|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} nosfparams
                                B = {{Text|0|#F580B1}}
                                a2$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                                {{Cl|FOR}} i = {{Text|4|#F580B1}} {{Cl|TO}} n - {{Text|1|#F580B1}}
                                    e$ = {{Text|getelement$|#55FF55}}(a$, i)
                                    {{Cl|IF}} e$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} B = B + {{Text|1|#F580B1}}
                                    {{Cl|IF}} e$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} B = B - {{Text|1|#F580B1}}
                                    {{Cl|IF}} e$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} B = {{Text|0|#F580B1}} {{Cl|THEN}}
                                        {{Cl|IF}} i = n - {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected , ... )"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                        getlastparam:
                                        {{Cl|IF}} a2$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ... ,"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                        a2$ = {{Cl|LEFT$}}(a2$, {{Cl|LEN}}(a2$) - {{Text|1|#F580B1}})
                                        {{Text|<nowiki>'possible format: [BYVAL]a[%][(1)][AS][type]</nowiki>|#919191}}
                                        n2 = {{Text|numelements|#55FF55}}(a2$)
                                        array = {{Text|0|#F580B1}}
                                        t2$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                                        i2 = {{Text|1|#F580B1}}
                                        e$ = {{Text|getelement$|#55FF55}}(a2$, i2): i2 = i2 + {{Text|1|#F580B1}}
                                        byvalue = {{Text|0|#F580B1}}
                                        {{Cl|IF}} e$ = {{Text|<nowiki>"BYVAL"</nowiki>|#FFB100}} {{Cl|THEN}}
                                            {{Cl|IF}} declaringlibrary = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"BYVAL can currently only be used with DECLARE LIBRARY"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                            e$ = {{Text|getelement$|#55FF55}}(a2$, i2): i2 = i2 + {{Text|1|#F580B1}}: byvalue = {{Text|1|#F580B1}}
                                        {{Cl|END}} {{Cl|IF}}
                                        n2$ = e$
                                        symbol2$ = {{Text|removesymbol$|#55FF55}}(n2$)
                                        {{Cl|IF}} {{Text|validname|#55FF55}}(n2$) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid name"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                        m = {{Text|0|#F580B1}}
                                        {{Cl|FOR}} i2 = i2 {{Cl|TO}} n2
                                            e$ = {{Text|getelement$|#55FF55}}(a2$, i2)
                                            {{Cl|IF}} e$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}}
                                                {{Cl|IF}} m <> {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Syntax error - too many opening brackets"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                                m = {{Text|1|#F580B1}}
                                                array = {{Text|1|#F580B1}}
                                                {{Cl|GOTO}} gotaa
                                            {{Cl|END}} {{Cl|IF}}
                                            {{Cl|IF}} e$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}}
                                                {{Cl|IF}} m <> {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Syntax error - closing bracket without opening bracket"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                                m = {{Text|2|#F580B1}}
                                                {{Cl|GOTO}} gotaa
                                            {{Cl|END}} {{Cl|IF}}
                                            {{Cl|IF}} e$ = {{Text|<nowiki>"AS"</nowiki>|#FFB100}} {{Cl|THEN}}
                                                {{Cl|IF}} m <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} m <> {{Text|2|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Syntax error - check your brackets"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                                m = {{Text|3|#F580B1}}
                                                {{Cl|GOTO}} gotaa
                                            {{Cl|END}} {{Cl|IF}}
                                            {{Cl|IF}} m = {{Text|1|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} gotaa {{Text|<nowiki>'ignore contents of bracket</nowiki>|#919191}}
                                            {{Cl|IF}} m <> {{Text|3|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Syntax error - check your brackets"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                            {{Cl|IF}} t2$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} t2$ = e$ {{Cl|ELSE}} t2$ = t2$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} + e$
                                            gotaa:
                                        {{Cl|NEXT}} i2
                                        params = params + {{Text|1|#F580B1}}: {{Cl|IF}} params > {{Text|100|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"SUB/FUNCTION exceeds 100 parameter limit"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                        argnelereq = {{Text|0|#F580B1}}
                                        {{Cl|IF}} symbol2$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} t2$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Syntax error - check parameter types"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                        {{Cl|IF}} t2$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} e$ = {{Text|<nowiki>"AS"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected AS type"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                        {{Cl|IF}} t2$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} t2$ = symbol2$
                                        {{Cl|IF}} t2$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
                                            {{Cl|IF}} {{Cl|LEFT$}}(n2$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"_"</nowiki>|#FFB100}} {{Cl|THEN}} v = {{Text|27|#F580B1}} {{Cl|ELSE}} v = {{Cl|ASC (function)|ASC}}({{Cl|UCASE$}}(n2$)) - {{Text|64|#F580B1}}
                                            t2$ = defineaz(v)
                                        {{Cl|END}} {{Cl|IF}}
                                        paramsize = {{Text|0|#F580B1}}
                                        {{Cl|IF}} array = {{Text|1|#F580B1}} {{Cl|THEN}}
                                            t = {{Text|typname2typ|#55FF55}}(t2$)
                                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                            {{Cl|IF}} t = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Illegal SUB/FUNCTION parameter"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                            {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) {{Cl|THEN}} paramsize = typname2typsize
                                            t = t + ISARRAY
                                            {{Text|<nowiki>'check for recompilation override</nowiki>|#919191}}
                                            {{Cl|FOR}} i10 = {{Text|0|#F580B1}} {{Cl|TO}} sflistn
                                                {{Cl|IF}} sfidlist(i10) = idn + {{Text|1|#F580B1}} {{Cl|THEN}}
                                                    {{Cl|IF}} sfarglist(i10) = params {{Cl|THEN}}
                                                        argnelereq = sfelelist(i10)
                                                    {{Cl|END}} {{Cl|IF}}
                                                {{Cl|END}} {{Cl|IF}}
                                            {{Cl|NEXT}}
                                        {{Cl|ELSE}}
                                            t = {{Text|typname2typ|#55FF55}}(t2$)
                                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                            {{Cl|IF}} t = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Illegal SUB/FUNCTION parameter"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                            {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) {{Cl|THEN}} paramsize = typname2typsize
                                            {{Cl|IF}} byvalue {{Cl|THEN}}
                                                {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISPOINTER {{Cl|THEN}} t = t - ISPOINTER
                                            {{Cl|END}} {{Cl|IF}}
                                        {{Cl|END}} {{Cl|IF}}
                                        nelereq$ = nelereq$ + {{Cl|CHR$}}(argnelereq)
                                        {{Text|<nowiki>'consider changing 0 in following line too!</nowiki>|#919191}}
                                        nele$ = nele$ + {{Cl|CHR$}}({{Text|0|#F580B1}})
                                        paramsize$ = paramsize$ + {{Cl|MKL$}}(paramsize)
                                        params$ = params$ + {{Cl|MKL$}}(t)
                                        a2$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                                    {{Cl|ELSE}}
                                        a2$ = a2$ + e$ + sp
                                        {{Cl|IF}} i = n - {{Text|1|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} getlastparam
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|NEXT}} i
                            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'n>2</nowiki>|#919191}}
                            nosfparams:
                            {{Cl|IF}} sf = {{Text|1|#F580B1}} {{Cl|THEN}}
                                {{Text|<nowiki>'function</nowiki>|#919191}}
                                {{Text|clearid|#55FF55}}
                                id.n = n$
                                id.subfunc = {{Text|1|#F580B1}}
                                id.callname = {{Text|<nowiki>"FUNC_"</nowiki>|#FFB100}} + {{Cl|UCASE$}}(n$)
                                {{Cl|IF}} declaringlibrary {{Cl|THEN}}
                                    id.ccall = {{Text|1|#F580B1}}
                                    {{Cl|IF}} indirectlibrary = {{Text|0|#F580B1}} {{Cl|THEN}} id.callname = aliasname$
                                {{Cl|END}} {{Cl|IF}}
                                id.args = params
                                id.arg = params$
                                id.argsize = paramsize$
                                id.nele = nele$
                                id.nelereq = nelereq$
                                {{Cl|IF}} symbol$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
                                    id.ret = {{Text|typname2typ|#55FF55}}(symbol$)
                                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                {{Cl|ELSE}}
                                    {{Cl|IF}} {{Cl|LEFT$}}(n$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"_"</nowiki>|#FFB100}} {{Cl|THEN}} v = {{Text|27|#F580B1}} {{Cl|ELSE}} v = {{Cl|ASC (function)|ASC}}({{Cl|UCASE$}}(n$)) - {{Text|64|#F580B1}}
                                    symbol$ = defineaz(v)
                                    id.ret = {{Text|typname2typ|#55FF55}}(symbol$)
                                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                {{Cl|END}} {{Cl|IF}}
                                {{Cl|IF}} id.ret = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid FUNCTION return type"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                {{Cl|IF}} declaringlibrary {{Cl|THEN}}
                                    ctype$ = {{Text|typ2ctyp$|#55FF55}}(id.ret, {{Text|<nowiki>""</nowiki>|#FFB100}})
                                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                    {{Cl|IF}} ctype$ = {{Text|<nowiki>"qbs"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"char*"</nowiki>|#FFB100}}
                                    id.callname = {{Text|<nowiki>"(  "</nowiki>|#FFB100}} + ctype$ + {{Text|<nowiki>"  )"</nowiki>|#FFB100}} + {{Cl|RTRIM$}}(id.callname)
                                {{Cl|END}} {{Cl|IF}}
                                s$ = {{Cl|LEFT$}}(symbol$, {{Text|1|#F580B1}})
                                {{Cl|IF}} s$ <> {{Text|<nowiki>"~"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} s$ <> {{Text|<nowiki>"`"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} s$ <> {{Text|<nowiki>"%"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} s$ <> {{Text|<nowiki>"&"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} s$ <> {{Text|<nowiki>"!"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} s$ <> {{Text|<nowiki>"#"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} s$ <> {{Text|<nowiki>"$"</nowiki>|#FFB100}} {{Cl|THEN}}
                                    symbol$ = {{Text|type2symbol$|#55FF55}}(symbol$)
                                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                {{Cl|END}} {{Cl|IF}}
                                id.mayhave = symbol$
                                {{Cl|IF}} id.ret {{Cl|AND (boolean)|AND}} ISPOINTER {{Cl|THEN}}
                                    {{Cl|IF}} (id.ret {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}} {{Cl|THEN}} id.ret = id.ret - ISPOINTER
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|regid|#55FF55}}
                                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Cl|ELSE}}
                                {{Text|<nowiki>'sub</nowiki>|#919191}}
                                {{Text|clearid|#55FF55}}
                                id.n = n$
                                id.subfunc = {{Text|2|#F580B1}}
                                id.callname = {{Text|<nowiki>"SUB_"</nowiki>|#FFB100}} + {{Cl|UCASE$}}(n$)
                                {{Cl|IF}} declaringlibrary {{Cl|THEN}}
                                    id.ccall = {{Text|1|#F580B1}}
                                    {{Cl|IF}} indirectlibrary = {{Text|0|#F580B1}} {{Cl|THEN}} id.callname = aliasname$
                                {{Cl|END}} {{Cl|IF}}
                                id.args = params
                                id.arg = params$
                                id.argsize = paramsize$
                                id.nele = nele$
                                id.nelereq = nelereq$
                                {{Cl|IF}} {{Cl|UCASE$}}(n$) = {{Text|<nowiki>"_GL"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} params = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} UseGL = {{Text|0|#F580B1}} {{Cl|THEN}} reginternalsubfunc = {{Text|1|#F580B1}}: UseGL = {{Text|1|#F580B1}}: id.n = {{Text|<nowiki>"_GL"</nowiki>|#FFB100}}: DEPENDENCY(DEPENDENCY_GL) = {{Text|1|#F580B1}}
                                {{Text|regid|#55FF55}}
                                reginternalsubfunc = {{Text|0|#F580B1}}
                                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Text|<nowiki>'========================================</nowiki>|#919191}}
                        finishedlinepp:
                        firstLine = {{Text|0|#F580B1}}
                    {{Cl|END}} {{Cl|IF}}
                    a$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    ca$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    {{Cl|IF}} a$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = e$: ca$ = ce$ {{Cl|ELSE}} a$ = a$ + sp + e$: ca$ = ca$ + sp + ce$
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} wholelinei <= wholelinen {{Cl|THEN}} wholelinei = wholelinei + {{Text|1|#F580B1}}: {{Cl|GOTO}} ppblda
                {{Text|<nowiki>'----------------------------------------</nowiki>|#919191}}
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'wholelinei<=wholelinen</nowiki>|#919191}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'wholelinen</nowiki>|#919191}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'len(wholeline$)</nowiki>|#919191}}
    {{Text|<nowiki>'Include Manager #1</nowiki>|#919191}}
    {{Cl|IF}} {{Cl|LEN}}(addmetainclude$) {{Cl|THEN}}
        {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"Pre-pass:INCLUDE$-ing file:'"</nowiki>|#FFB100}} + addmetainclude$ + {{Text|<nowiki>"':On line"</nowiki>|#FFB100}}; linenumber
        a$ = addmetainclude$: addmetainclude$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Text|<nowiki>'read/clear message</nowiki>|#919191}}
        {{Cl|IF}} inclevel = {{Text|0|#F580B1}} {{Cl|THEN}}
            includingFromRoot = {{Text|0|#F580B1}}
            forceIncludingFile = {{Text|0|#F580B1}}
            forceInclude_prepass:
            {{Cl|IF}} forceIncludeFromRoot$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
                a$ = forceIncludeFromRoot$
                forceIncludeFromRoot$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                forceIncludingFile = {{Text|1|#F580B1}}
                includingFromRoot = {{Text|1|#F580B1}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} inclevel = {{Text|100|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Too many indwelling INCLUDE files"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
        {{Text|<nowiki>'1. Verify file exists (location is either (a)relative to source file or (b)absolute)</nowiki>|#919191}}
        fh = {{Text|99|#F580B1}} + inclevel + {{Text|1|#F580B1}}
        firstTryMethod = {{Text|1|#F580B1}}
        {{Cl|IF}} includingFromRoot <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} inclevel = {{Text|0|#F580B1}} {{Cl|THEN}} firstTryMethod = {{Text|2|#F580B1}}
        {{Cl|FOR}} try = firstTryMethod {{Cl|TO}} {{Text|2|#F580B1}} {{Text|<nowiki>'if including file from root, do not attempt including from relative location</nowiki>|#919191}}
            {{Cl|IF}} try = {{Text|1|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} inclevel = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} idemode {{Cl|THEN}} p$ = idepath$ + pathsep$ {{Cl|ELSE}} p$ = {{Text|getfilepath$|#55FF55}}(sourcefile$)
                {{Cl|ELSE}}
                    p$ = {{Text|getfilepath$|#55FF55}}(incname(inclevel))
                {{Cl|END}} {{Cl|IF}}
                f$ = p$ + a$
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} f$ = a$
            {{Cl|IF}} {{Cl|_FILEEXISTS}}(f$) {{Cl|THEN}}
                qberrorhappened = {{Text|-3|#F580B1}}
                {{Text|<nowiki>'We're using the faster LINE INPUT, which requires a BINARY open.</nowiki>|#919191}}
                {{Cl|OPEN}} f$ {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|BINARY}} {{Cl|OPEN|AS}} #fh
                {{Text|<nowiki>'And another line below edited</nowiki>|#919191}}
                qberrorhappened3:
                {{Cl|IF}} qberrorhappened = {{Text|-3|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}}
            {{Cl|END}} {{Cl|IF}}
            qberrorhappened = {{Text|0|#F580B1}}
        {{Cl|NEXT}}
        {{Cl|IF}} qberrorhappened <> {{Text|-3|#F580B1}} {{Cl|THEN}} qberrorhappened = {{Text|0|#F580B1}}: a$ = {{Text|<nowiki>"File "</nowiki>|#FFB100}} + a$ + {{Text|<nowiki>" not found"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
        inclevel = inclevel + {{Text|1|#F580B1}}: incname$(inclevel) = f$: inclinenumber(inclevel) = {{Text|0|#F580B1}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'fall through to next section...</nowiki>|#919191}}
    {{Text|<nowiki>'--------------------</nowiki>|#919191}}
    {{Cl|DO}} {{Cl|WHILE}} inclevel
        fh = {{Text|99|#F580B1}} + inclevel
        {{Text|<nowiki>'2. Feed next line</nowiki>|#919191}}
        {{Cl|IF}} {{Cl|EOF}}(fh) = {{Text|0|#F580B1}} {{Cl|THEN}}
            {{Cl|LINE INPUT (file statement)|LINE INPUT}} #fh, x$
            wholeline$ = x$
            inclinenumber(inclevel) = inclinenumber(inclevel) + {{Text|1|#F580B1}}
            {{Text|<nowiki>'create extended error string 'incerror$'</nowiki>|#919191}}
            errorLineInInclude = inclinenumber(inclevel)
            e$ = {{Text|<nowiki>" in line "</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(inclinenumber(inclevel)) + {{Text|<nowiki>" of "</nowiki>|#FFB100}} + incname$(inclevel) + {{Text|<nowiki>" included"</nowiki>|#FFB100}}
            {{Cl|IF}} inclevel > {{Text|1|#F580B1}} {{Cl|THEN}}
                e$ = e$ + {{Text|<nowiki>" (through "</nowiki>|#FFB100}}
                {{Cl|FOR}} x = {{Text|1|#F580B1}} {{Cl|TO}} inclevel - {{Text|1|#F580B1}} {{Cl|STEP}} {{Text|1|#F580B1}}
                    e$ = e$ + incname$(x)
                    {{Cl|IF}} x < inclevel - {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'a sep is req</nowiki>|#919191}}
                        {{Cl|IF}} x = inclevel - {{Text|2|#F580B1}} {{Cl|THEN}}
                            e$ = e$ + {{Text|<nowiki>" then "</nowiki>|#FFB100}}
                        {{Cl|ELSE}}
                            e$ = e$ + {{Text|<nowiki>", "</nowiki>|#FFB100}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|NEXT}}
                e$ = e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            incerror$ = e$
            linenumber = linenumber - {{Text|1|#F580B1}} {{Text|<nowiki>'lower official linenumber to counter later increment</nowiki>|#919191}}
            {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"Pre-pass:Feeding INCLUDE$ line:["</nowiki>|#FFB100}} + wholeline$ + {{Text|<nowiki>"]"</nowiki>|#FFB100}}
            {{Cl|IF}} idemode {{Cl|THEN}} sendc$ = {{Cl|CHR$}}({{Text|10|#F580B1}}) + wholeline$: {{Cl|GOTO}} sendcommand {{Text|<nowiki>'passback</nowiki>|#919191}}
            {{Cl|GOTO}} ideprepass
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'3. Close & return control</nowiki>|#919191}}
        {{Cl|CLOSE}} #fh
        inclevel = inclevel - {{Text|1|#F580B1}}
        {{Cl|IF}} forceIncludingFile = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} inclevel = {{Text|0|#F580B1}} {{Cl|THEN}}
            forceIncludingFile = {{Text|0|#F580B1}}
            {{Cl|GOTO}} forceIncludeCompleted_prepass
        {{Cl|END}} {{Cl|IF}}
    {{Cl|LOOP}}
    {{Text|<nowiki>'(end manager)</nowiki>|#919191}}
    {{Cl|IF}} idemode {{Cl|THEN}} {{Cl|GOTO}} ideret2
{{Cl|LOOP}}
{{Text|<nowiki>'add final line</nowiki>|#919191}}
{{Cl|IF}} lastLineReturn = {{Text|0|#F580B1}} {{Cl|THEN}}
    lastLineReturn = {{Text|1|#F580B1}}
    lastLine = {{Text|1|#F580B1}}
    wholeline$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
    {{Cl|GOTO}} prepassLastLine
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} definingtype {{Cl|THEN}} definingtype = {{Text|0|#F580B1}} {{Text|<nowiki>'ignore this error so that auto-formatting can be performed and catch it again later</nowiki>|#919191}}
{{Cl|IF}} declaringlibrary {{Cl|THEN}} declaringlibrary = {{Text|0|#F580B1}} {{Text|<nowiki>'ignore this error so that auto-formatting can be performed and catch it again later</nowiki>|#919191}}
totallinenumber = reallinenumber
{{Text|<nowiki>'IF idemode = 0 AND NOT QuietMode THEN PRINT "first pass finished.": PRINT "Translating code... "</nowiki>|#919191}}
{{Text|<nowiki>'prepass finished</nowiki>|#919191}}
lineinput3index = {{Text|1|#F580B1}} {{Text|<nowiki>'reset input line</nowiki>|#919191}}
{{Text|<nowiki>'ide specific</nowiki>|#919191}}
ide3:
addmetainclude$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Text|<nowiki>'reset stray meta-includes</nowiki>|#919191}}
{{Text|<nowiki>'reset altered variables</nowiki>|#919191}}
DataOffset = {{Text|0|#F580B1}}
inclevel = {{Text|0|#F580B1}}
subfuncn = {{Text|0|#F580B1}}
lastLineReturn = {{Text|0|#F580B1}}
lastLine = {{Text|0|#F580B1}}
firstLine = {{Text|1|#F580B1}}
UserDefineCount = {{Text|7|#F580B1}}
{{Cl|FOR}} i = {{Text|0|#F580B1}} {{Cl|TO}} constlast: constdefined(i) = {{Text|0|#F580B1}}: {{Cl|NEXT}} {{Text|<nowiki>'undefine constants</nowiki>|#919191}}
{{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} {{Text|27|#F580B1}}: defineaz(i) = {{Text|<nowiki>"SINGLE"</nowiki>|#FFB100}}: defineextaz(i) = {{Text|<nowiki>"!"</nowiki>|#FFB100}}: {{Cl|NEXT}}
{{Cl|DIM}} {{Cl|SHARED}} DataBinBuf: DataBinBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"data.bin"</nowiki>|#FFB100}})
{{Cl|DIM}} {{Cl|SHARED}} MainTxtBuf: MainTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"main.txt"</nowiki>|#FFB100}})
{{Cl|DIM}} {{Cl|SHARED}} DataTxtBuf: DataTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"maindata.txt"</nowiki>|#FFB100}})
{{Cl|DIM}} {{Cl|SHARED}} RegTxtBuf: RegTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"regsf.txt"</nowiki>|#FFB100}})
{{Cl|DIM}} {{Cl|SHARED}} FreeTxtBuf: FreeTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"mainfree.txt"</nowiki>|#FFB100}})
{{Cl|DIM}} {{Cl|SHARED}} RunTxtBuf: RunTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"runline.txt"</nowiki>|#FFB100}})
{{Cl|DIM}} {{Cl|SHARED}} ErrTxtBuf: ErrTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"mainerr.txt"</nowiki>|#FFB100}})
{{Text|<nowiki>'i. check the value of error_line</nowiki>|#919191}}
{{Text|<nowiki>'ii. jump to the appropriate label</nowiki>|#919191}}
errorlabels = {{Text|0|#F580B1}}
{{Text|WriteBufLine|#55FF55}} ErrTxtBuf, {{Text|<nowiki>"if (error_occurred){ error_occurred=0;"</nowiki>|#FFB100}}
{{Cl|DIM}} {{Cl|SHARED}} ChainTxtBuf: ChainTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"chain.txt"</nowiki>|#FFB100}})
{{Cl|DIM}} {{Cl|SHARED}} InpChainTxtBuf: InpChainTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"inpchain.txt"</nowiki>|#FFB100}})
{{Cl|DIM}} {{Cl|SHARED}} TimeTxtBuf: TimeTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"ontimer.txt"</nowiki>|#FFB100}})
{{Cl|DIM}} {{Cl|SHARED}} TimejTxtBuf: TimejTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"ontimerj.txt"</nowiki>|#FFB100}})
{{Text|<nowiki>'*****#26 used for locking qb64pe</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} KeyTxtBuf: KeyTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"onkey.txt"</nowiki>|#FFB100}})
{{Cl|DIM}} {{Cl|SHARED}} KeyjTxtBuf: KeyjTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"onkeyj.txt"</nowiki>|#FFB100}})
{{Cl|DIM}} {{Cl|SHARED}} StrigTxtBuf: StrigTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"onstrig.txt"</nowiki>|#FFB100}})
{{Cl|DIM}} {{Cl|SHARED}} StrigjTxtBuf: StrigjTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"onstrigj.txt"</nowiki>|#FFB100}})
gosubid = {{Text|1|#F580B1}}
{{Text|<nowiki>'to be included whenever return without a label is called</nowiki>|#919191}}
{{Text|<nowiki>'return [label] in QBASIC was not possible in a sub/function, but QB64 will support this</nowiki>|#919191}}
{{Text|<nowiki>'special codes will represent special return conditions:</nowiki>|#919191}}
{{Text|<nowiki>'0=return from main to calling sub/function/proc by return [NULL];</nowiki>|#919191}}
{{Text|<nowiki>'1... a global number representing a return point after a gosub</nowiki>|#919191}}
{{Text|<nowiki>'note: RETURN [label] should fail if a "return [NULL];" type return is required</nowiki>|#919191}}
{{Cl|DIM}} {{Cl|SHARED}} RetTxtBuf: RetTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"ret0.txt"</nowiki>|#FFB100}})
{{Text|WriteBufLine|#55FF55}} RetTxtBuf, {{Text|<nowiki>"if (next_return_point){"</nowiki>|#FFB100}}
{{Text|WriteBufLine|#55FF55}} RetTxtBuf, {{Text|<nowiki>"next_return_point--;"</nowiki>|#FFB100}}
{{Text|WriteBufLine|#55FF55}} RetTxtBuf, {{Text|<nowiki>"switch(return_point[next_return_point]){"</nowiki>|#FFB100}}
{{Text|WriteBufLine|#55FF55}} RetTxtBuf, {{Text|<nowiki>"case 0:"</nowiki>|#FFB100}}
{{Text|WriteBufLine|#55FF55}} RetTxtBuf, {{Text|<nowiki>"return;"</nowiki>|#FFB100}}
{{Text|WriteBufLine|#55FF55}} RetTxtBuf, {{Text|<nowiki>"break;"</nowiki>|#FFB100}}
continueline = {{Text|0|#F580B1}}
endifs = {{Text|0|#F580B1}}
lineelseused = {{Text|0|#F580B1}}
continuelinefrom = {{Text|0|#F580B1}}
linenumber = {{Text|0|#F580B1}}
reallinenumber = {{Text|0|#F580B1}}
declaringlibrary = {{Text|0|#F580B1}}
{{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"S_0:;"</nowiki>|#FFB100}} {{Text|<nowiki>'note: REQUIRED by run statement</nowiki>|#919191}}
{{Cl|IF}} UseGL {{Cl|THEN}} {{Text|gl_include_content|#55FF55}}
{{Text|<nowiki>'ide specific</nowiki>|#919191}}
{{Cl|IF}} idemode {{Cl|THEN}} {{Cl|GOTO}} ideret3
{{Cl|DO}}
    ide4:
    includeline:
    mainpassLastLine:
    {{Cl|IF}} lastLine <> {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} firstLine <> {{Text|0|#F580B1}} {{Cl|THEN}}
        lineBackup$ = a3$ {{Text|<nowiki>'backup the real first line (will be blank when lastline is set)</nowiki>|#919191}}
        forceIncludeFromRoot$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Cl|IF}} vWatchOn {{Cl|THEN}}
            addingvWatch = {{Text|1|#F580B1}}
            {{Cl|IF}} firstLine <> {{Text|0|#F580B1}} {{Cl|THEN}} forceIncludeFromRoot$ = {{Text|<nowiki>"internal\support\vwatch\vwatch.bi"</nowiki>|#FFB100}}
            {{Cl|IF}} lastLine <> {{Text|0|#F580B1}} {{Cl|THEN}} forceIncludeFromRoot$ = {{Text|<nowiki>"internal\support\vwatch\vwatch.bm"</nowiki>|#FFB100}}
        {{Cl|ELSE}}
            {{Text|<nowiki>'IF firstLine <> 0 THEN forceIncludeFromRoot$ = "internal\support\vwatch\vwatch_stub.bi"</nowiki>|#919191}}
            {{Cl|IF}} lastLine <> {{Text|0|#F580B1}} {{Cl|THEN}} forceIncludeFromRoot$ = {{Text|<nowiki>"internal\support\vwatch\vwatch_stub.bm"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        firstLine = {{Text|0|#F580B1}}: lastLine = {{Text|0|#F580B1}}
        {{Cl|IF}} {{Cl|LEN}}(forceIncludeFromRoot$) {{Cl|THEN}} {{Cl|GOTO}} forceInclude
        forceIncludeCompleted:
        addingvWatch = {{Text|0|#F580B1}}
        a3$ = lineBackup$
    {{Cl|END}} {{Cl|IF}}
    prepass = {{Text|0|#F580B1}}
    stringprocessinghappened = {{Text|0|#F580B1}}
    {{Cl|IF}} continuelinefrom {{Cl|THEN}}
        start = continuelinefrom
        continuelinefrom = {{Text|0|#F580B1}}
        {{Cl|GOTO}} contline
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'begin a new line</nowiki>|#919191}}
    impliedendif = {{Text|0|#F580B1}}
    THENGOTO = {{Text|0|#F580B1}}
    continueline = {{Text|0|#F580B1}}
    endifs = {{Text|0|#F580B1}}
    lineelseused = {{Text|0|#F580B1}}
    newif = {{Text|0|#F580B1}}
    {{Text|<nowiki>'apply metacommands from previous line</nowiki>|#919191}}
    {{Cl|IF}} addmetadynamic = {{Text|1|#F580B1}} {{Cl|THEN}} addmetadynamic = {{Text|0|#F580B1}}: DynamicMode = {{Text|1|#F580B1}}
    {{Cl|IF}} addmetastatic = {{Text|1|#F580B1}} {{Cl|THEN}} addmetastatic = {{Text|0|#F580B1}}: DynamicMode = {{Text|0|#F580B1}}
    {{Text|<nowiki>'a3$ is passed in idemode and when using $include</nowiki>|#919191}}
    {{Cl|IF}} idemode = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} inclevel = {{Text|0|#F580B1}} {{Cl|THEN}} a3$ = {{Text|lineinput3$|#55FF55}}
    {{Cl|IF}} a3$ = {{Cl|CHR$}}({{Text|13|#F580B1}}) {{Cl|THEN}} {{Cl|EXIT}} {{Cl|DO}}
    linenumber = linenumber + {{Text|1|#F580B1}}
    reallinenumber = reallinenumber + {{Text|1|#F580B1}}
    {{Cl|IF}} InValidLine(linenumber) {{Cl|THEN}}
        layoutok = {{Text|1|#F580B1}}
        layout$ = {{Cl|SPACE$}}(controllevel + {{Text|1|#F580B1}}) + {{Cl|LTRIM$}}({{Cl|RTRIM$}}(a3$))
        {{Cl|IF}} idemode {{Cl|GOTO}} ideret4 {{Cl|ELSE}} {{Cl|GOTO}} skipide4
    {{Cl|END}} {{Cl|IF}}
    layout = {{Text|<nowiki>""</nowiki>|#FFB100}}
    layoutok = {{Text|1|#F580B1}}
    {{Cl|IF}} idemode = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|NOT}} QuietMode {{Cl|THEN}}
        {{Text|<nowiki>'IF LEN(a3$) THEN</nowiki>|#919191}}
        {{Text|<nowiki>'    dotlinecount = dotlinecount + 1: IF dotlinecount >= 100 THEN dotlinecount = 0: PRINT ".";</nowiki>|#919191}}
        {{Text|<nowiki>'END IF</nowiki>|#919191}}
        maxprogresswidth = {{Text|50|#F580B1}} {{Text|<nowiki>'arbitrary</nowiki>|#919191}}
        percentage = {{Cl|INT}}(reallinenumber / totallinenumber * {{Text|100|#F580B1}})
        percentagechars = {{Cl|INT}}(maxprogresswidth * reallinenumber / totallinenumber)
        {{Cl|IF}} percentage <> prevpercentage {{Cl|AND (boolean)|AND}} percentagechars <> prevpercentagechars {{Cl|THEN}}
            prevpercentage = percentage
            prevpercentagechars = percentagechars
            {{Cl|IF}} ConsoleMode {{Cl|THEN}}
                {{Cl|PRINT}} {{Text|<nowiki>"["</nowiki>|#FFB100}} + {{Cl|STRING$}}(percentagechars, {{Text|<nowiki>"."</nowiki>|#FFB100}}) + {{Cl|SPACE$}}(maxprogresswidth - percentagechars) + {{Text|<nowiki>"]"</nowiki>|#FFB100}} + {{Cl|STR$}}(percentage) + {{Text|<nowiki>"%"</nowiki>|#FFB100}};
                {{Cl|IF}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|PRINT}} {{Cl|CHR$}}({{Text|27|#F580B1}}) + {{Text|<nowiki>"[A"</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    {{Cl|PRINT}} {{Cl|CHR$}}({{Text|13|#F580B1}});
                {{Cl|END}} {{Cl|IF}}
            {{Cl|ELSE}}
                {{Cl|LOCATE}} , {{Text|1|#F580B1}}
                {{Cl|PRINT}} {{Cl|STRING$}}(percentagechars, {{Text|219|#F580B1}}) + {{Cl|STRING$}}(maxprogresswidth - percentagechars, {{Text|176|#F580B1}}) + {{Cl|STR$}}(percentage) + {{Text|<nowiki>"%"</nowiki>|#FFB100}};
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    a3$ = {{Cl|LTRIM$}}({{Cl|RTRIM$}}(a3$))
    wholeline = a3$
    layoutoriginal$ = a3$
    layoutcomment$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Text|<nowiki>'clear any previous layout comment</nowiki>|#919191}}
    lhscontrollevel = controllevel
    linefragment = {{Text|<nowiki>"[INFORMATION UNAVAILABLE]"</nowiki>|#FFB100}}
    {{Cl|IF}} {{Cl|LEN}}(a3$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} finishednonexec
    {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"########"</nowiki>|#FFB100}} + a3$ + {{Text|<nowiki>"########"</nowiki>|#FFB100}}
    layoutdone = {{Text|1|#F580B1}} {{Text|<nowiki>'validates layout of any following goto finishednonexec/finishedline</nowiki>|#919191}}
    {{Text|<nowiki>'We've already figured out in the prepass which lines are invalidated by the precompiler</nowiki>|#919191}}
    {{Text|<nowiki>'No need to go over those lines again.</nowiki>|#919191}}
    {{Text|<nowiki>'IF InValidLine(linenumber) THEN goto skipide4 'layoutdone = 0: GOTO finishednonexec</nowiki>|#919191}}
    a3u$ = {{Cl|UCASE$}}(a3$)
    {{Text|<nowiki>'QB64 Metacommands</nowiki>|#919191}}
    {{Cl|IF}} {{Cl|ASC (function)|ASC}}(a3$) = {{Text|36|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'$</nowiki>|#919191}}
        {{Text|<nowiki>'precompiler commands should always be executed FIRST.</nowiki>|#919191}}
        {{Cl|IF}} a3u$ = {{Text|<nowiki>"$END IF"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} a3u$ = {{Text|<nowiki>"$ENDIF"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} DefineElse(ExecCounter) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"$END IF without $IF"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            DefineElse(ExecCounter) = {{Text|0|#F580B1}} {{Text|<nowiki>'We no longer have an $IF block at this level</nowiki>|#919191}}
            ExecCounter = ExecCounter - {{Text|1|#F580B1}}
            layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$End If"</nowiki>|#FFB100}})
            controltype(controllevel) = {{Text|0|#F580B1}}
            controllevel = controllevel - {{Text|1|#F580B1}}
            {{Cl|GOTO}} finishednonexec
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} {{Cl|LEFT$}}(a3u$, {{Text|4|#F580B1}}) = {{Text|<nowiki>"$IF "</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Text|<nowiki>'prevents code from being placed before 'CASE condition' in a SELECT CASE block</nowiki>|#919191}}
            {{Cl|IF}} SelectCaseCounter > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} SelectCaseHasCaseBlock(SelectCaseCounter) = {{Text|0|#F580B1}} {{Cl|THEN}}
                a$ = {{Text|<nowiki>"Expected CASE expression"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|END}} {{Cl|IF}}
            temp$ = {{Cl|LTRIM$}}({{Cl|MID$ (function)|MID$}}(a3u$, {{Text|4|#F580B1}})) {{Text|<nowiki>'strip off the $IF and extra spaces</nowiki>|#919191}}
            temp$ = {{Cl|RTRIM$}}({{Cl|LEFT$}}(temp$, {{Cl|LEN}}(temp$) - {{Text|4|#F580B1}})) {{Text|<nowiki>'and strip off the THEN and extra spaces</nowiki>|#919191}}
            temp = {{Text|0|#F580B1}}
            {{Cl|IF}} temp = {{Text|0|#F580B1}} {{Cl|THEN}} tempOp$ = {{Text|<nowiki>"<="</nowiki>|#FFB100}}: temp = {{Cl|INSTR}}(temp$, tempOp$)
            {{Cl|IF}} temp = {{Text|0|#F580B1}} {{Cl|THEN}} tempOp$ = {{Text|<nowiki>"=<"</nowiki>|#FFB100}}: temp = {{Cl|INSTR}}(temp$, tempOp$): tempOp$ = {{Text|<nowiki>"<="</nowiki>|#FFB100}}
            {{Cl|IF}} temp = {{Text|0|#F580B1}} {{Cl|THEN}} tempOp$ = {{Text|<nowiki>">="</nowiki>|#FFB100}}: temp = {{Cl|INSTR}}(temp$, tempOp$)
            {{Cl|IF}} temp = {{Text|0|#F580B1}} {{Cl|THEN}} tempOp$ = {{Text|<nowiki>"=>"</nowiki>|#FFB100}}: temp = {{Cl|INSTR}}(temp$, tempOp$): tempOp$ = {{Text|<nowiki>">="</nowiki>|#FFB100}}
            {{Cl|IF}} temp = {{Text|0|#F580B1}} {{Cl|THEN}} tempOp$ = {{Text|<nowiki>"<>"</nowiki>|#FFB100}}: temp = {{Cl|INSTR}}(temp$, tempOp$)
            {{Cl|IF}} temp = {{Text|0|#F580B1}} {{Cl|THEN}} tempOp$ = {{Text|<nowiki>"><"</nowiki>|#FFB100}}: temp = {{Cl|INSTR}}(temp$, tempOp$): tempOp$ = {{Text|<nowiki>"<>"</nowiki>|#FFB100}}
            {{Cl|IF}} temp = {{Text|0|#F580B1}} {{Cl|THEN}} tempOp$ = {{Text|<nowiki>"="</nowiki>|#FFB100}}: temp = {{Cl|INSTR}}(temp$, tempOp$)
            {{Cl|IF}} temp = {{Text|0|#F580B1}} {{Cl|THEN}} tempOp$ = {{Text|<nowiki>">"</nowiki>|#FFB100}}: temp = {{Cl|INSTR}}(temp$, tempOp$)
            {{Cl|IF}} temp = {{Text|0|#F580B1}} {{Cl|THEN}} tempOp$ = {{Text|<nowiki>"<"</nowiki>|#FFB100}}: temp = {{Cl|INSTR}}(temp$, tempOp$)
            ExecCounter = ExecCounter + {{Text|1|#F580B1}}
            ExecLevel(ExecCounter) = {{Text|-1|#F580B1}} {{Text|<nowiki>'default to a skip value</nowiki>|#919191}}
            DefineElse(ExecCounter) = {{Text|1|#F580B1}} {{Text|<nowiki>'1 says we have an $IF statement at this level</nowiki>|#919191}}
            result = {{Text|EvalPreIF|#55FF55}}(temp$, a$)
            {{Cl|IF}} a$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Cl|IF}} result <> {{Text|0|#F580B1}} {{Cl|THEN}}
                ExecLevel(ExecCounter) = ExecLevel(ExecCounter - {{Text|1|#F580B1}}) {{Text|<nowiki>'So we inherit the execlevel from above</nowiki>|#919191}}
                {{Cl|IF}} ExecLevel(ExecCounter) = {{Text|0|#F580B1}} {{Cl|THEN}} DefineElse(ExecCounter) = DefineElse(ExecCounter) {{Cl|OR}} {{Text|4|#F580B1}} {{Text|<nowiki>'Else if used and conditon found</nowiki>|#919191}}
            {{Cl|END}} {{Cl|IF}}
            controllevel = controllevel + {{Text|1|#F580B1}}
            controltype(controllevel) = {{Text|6|#F580B1}}
            {{Cl|IF}} temp = {{Text|0|#F580B1}} {{Cl|THEN}} layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$If "</nowiki>|#FFB100}}) + temp$ + {{Text|SCase$|#55FF55}}({{Text|<nowiki>" Then"</nowiki>|#FFB100}}): {{Cl|GOTO}} finishednonexec {{Text|<nowiki>'no = sign in the $IF statement, so we're going to assume the user is doing something like $IF flag</nowiki>|#919191}}
            l$ = {{Cl|RTRIM$}}({{Cl|LEFT$}}(temp$, temp - {{Text|1|#F580B1}})): r$ = {{Cl|LTRIM$}}({{Cl|MID$ (function)|MID$}}(temp$, temp + {{Cl|LEN}}(tempOp$)))
            layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$If "</nowiki>|#FFB100}}) + l$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} + tempOp$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} + r$ + {{Text|SCase$|#55FF55}}({{Text|<nowiki>" Then"</nowiki>|#FFB100}})
            {{Cl|GOTO}} finishednonexec
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} a3u$ = {{Text|<nowiki>"$ELSE"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} DefineElse(ExecCounter) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"$ELSE without $IF"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|IF}} DefineElse(ExecCounter) {{Cl|AND (boolean)|AND}} {{Text|2|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"$IF block already has $ELSE statement in it"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            DefineElse(ExecCounter) = DefineElse(ExecCounter) {{Cl|OR}} {{Text|2|#F580B1}} {{Text|<nowiki>'set the flag to declare an $ELSE already in this block</nowiki>|#919191}}
            {{Cl|IF}} DefineElse(ExecCounter) {{Cl|AND (boolean)|AND}} {{Text|4|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'If we executed code in a previous IF or ELSE IF statement, we can't do it here</nowiki>|#919191}}
                ExecLevel(ExecCounter) = {{Text|-1|#F580B1}} {{Text|<nowiki>'So we inherit the execlevel from above</nowiki>|#919191}}
            {{Cl|ELSE}}
                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>|#919191}}
            {{Cl|END}} {{Cl|IF}}
            layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$Else"</nowiki>|#FFB100}})
            lhscontrollevel = lhscontrollevel - {{Text|1|#F580B1}}
            {{Cl|GOTO}} finishednonexec
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} {{Cl|LEFT$}}(a3u$, {{Text|5|#F580B1}}) = {{Text|<nowiki>"$ELSE"</nowiki>|#FFB100}} {{Cl|THEN}}
            temp$ = {{Cl|LTRIM$}}({{Cl|MID$ (function)|MID$}}(a3u$, {{Text|6|#F580B1}}))
            {{Cl|IF}} {{Cl|LEFT$}}(temp$, {{Text|3|#F580B1}}) = {{Text|<nowiki>"IF "</nowiki>|#FFB100}} {{Cl|THEN}}
                {{Cl|IF}} DefineElse(ExecCounter) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"$ELSE IF without $IF"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|IF}} DefineElse(ExecCounter) {{Cl|AND (boolean)|AND}} {{Text|2|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"$ELSE IF cannot follow $ELSE"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|IF}} {{Cl|RIGHT$}}(temp$, {{Text|5|#F580B1}}) <> {{Text|<nowiki>" THEN"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"$ELSE IF without THEN"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                temp$ = {{Cl|LTRIM$}}({{Cl|MID$ (function)|MID$}}(temp$, {{Text|3|#F580B1}})) {{Text|<nowiki>'strip off the IF and extra spaces</nowiki>|#919191}}
                temp$ = {{Cl|RTRIM$}}({{Cl|LEFT$}}(temp$, {{Cl|LEN}}(temp$) - {{Text|4|#F580B1}})) {{Text|<nowiki>'and strip off the THEN and extra spaces</nowiki>|#919191}}
                {{Cl|IF}} DefineElse(ExecCounter) {{Cl|AND (boolean)|AND}} {{Text|4|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'If we executed code in a previous IF or ELSE IF statement, we can't do it here</nowiki>|#919191}}
                    ExecLevel(ExecCounter) = {{Text|-1|#F580B1}}
                {{Cl|ELSE}}
                    result = {{Text|EvalPreIF|#55FF55}}(temp$, a$)
                    {{Cl|IF}} a$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} errmes
                    {{Cl|IF}} result <> {{Text|0|#F580B1}} {{Cl|THEN}}
                        ExecLevel(ExecCounter) = ExecLevel(ExecCounter - {{Text|1|#F580B1}}) {{Text|<nowiki>'So we inherit the execlevel from above</nowiki>|#919191}}
                        {{Cl|IF}} ExecLevel(ExecCounter) = {{Text|0|#F580B1}} {{Cl|THEN}} DefineElse(ExecCounter) = DefineElse(ExecCounter) {{Cl|OR}} {{Text|4|#F580B1}} {{Text|<nowiki>'Else if used and conditon found</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                lhscontrollevel = lhscontrollevel - {{Text|1|#F580B1}}
                temp = {{Cl|INSTR}}(temp$, {{Text|<nowiki>"="</nowiki>|#FFB100}})
                {{Cl|IF}} temp = {{Text|0|#F580B1}} {{Cl|THEN}} layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$ElseIf "</nowiki>|#FFB100}}) + temp$ + {{Text|SCase$|#55FF55}}({{Text|<nowiki>" Then"</nowiki>|#FFB100}}): {{Cl|GOTO}} finishednonexec {{Text|<nowiki>'no = sign in the $IF statement, so we're going to assume the user is doing something like $IF flag</nowiki>|#919191}}
                l$ = {{Cl|RTRIM$}}({{Cl|LEFT$}}(temp$, temp - {{Text|1|#F580B1}})): r$ = {{Cl|LTRIM$}}({{Cl|MID$ (function)|MID$}}(temp$, temp + {{Text|1|#F580B1}}))
                layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$ElseIf "</nowiki>|#FFB100}}) + l$ + {{Text|<nowiki>" = "</nowiki>|#FFB100}} + r$ + {{Text|SCase$|#55FF55}}({{Text|<nowiki>" Then"</nowiki>|#FFB100}})
                {{Cl|GOTO}} finishednonexec
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} ExecLevel(ExecCounter) {{Cl|THEN}} {{Text|<nowiki>'don't check for any more metacommands except the one's which worth with the precompiler</nowiki>|#919191}}
            layoutdone = {{Text|0|#F580B1}}
            {{Cl|GOTO}} finishednonexec {{Text|<nowiki>'we don't check for anything inside lines that we've marked for skipping</nowiki>|#919191}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} {{Cl|LEFT$}}(a3u$, {{Text|5|#F580B1}}) = {{Text|<nowiki>"$LET "</nowiki>|#FFB100}} {{Cl|THEN}}
            temp$ = a3u$
            temp$ = {{Cl|LTRIM$}}({{Cl|MID$ (function)|MID$}}(temp$, {{Text|5|#F580B1}})) {{Text|<nowiki>'simply shorten our string to parse</nowiki>|#919191}}
            {{Text|<nowiki>'For starters, let's make certain that we have 3 elements to deal with</nowiki>|#919191}}
            temp = {{Cl|INSTR}}(temp$, {{Text|<nowiki>"="</nowiki>|#FFB100}}) {{Text|<nowiki>'without an = in there, we can't get a value from the left and right side</nowiki>|#919191}}
            l$ = {{Cl|RTRIM$}}({{Cl|LEFT$}}(temp$, temp - {{Text|1|#F580B1}})): r$ = {{Cl|LTRIM$}}({{Cl|MID$ (function)|MID$}}(temp$, temp + {{Text|1|#F580B1}}))
            layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$Let "</nowiki>|#FFB100}}) + l$ + {{Text|<nowiki>" = "</nowiki>|#FFB100}} + r$
            {{Text|<nowiki>'First look to see if we have an existing setting like this and if so, update it</nowiki>|#919191}}
            {{Cl|FOR}} i = {{Text|7|#F580B1}} {{Cl|TO}} UserDefineCount {{Text|<nowiki>'UserDefineCount 1-7 are reserved for automatic OS/BIT detection & version</nowiki>|#919191}}
                {{Cl|IF}} UserDefine({{Text|0|#F580B1}}, i) = l$ {{Cl|THEN}} UserDefine({{Text|1|#F580B1}}, i) = r$: {{Cl|GOTO}} finishednonexec
            {{Cl|NEXT}}
            {{Text|<nowiki>'Otherwise create a new setting and set the initial value for it</nowiki>|#919191}}
            UserDefineCount = UserDefineCount + {{Text|1|#F580B1}}
            {{Cl|IF}} UserDefineCount > {{Cl|UBOUND}}(UserDefine, {{Text|2|#F580B1}}) {{Cl|THEN}}
                {{Cl|REDIM}} {{Cl|_PRESERVE}} UserDefine({{Text|1|#F580B1}}, {{Cl|UBOUND}}(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>|#919191}}
            {{Cl|END}} {{Cl|IF}}
            UserDefine({{Text|0|#F580B1}}, UserDefineCount) = l$
            UserDefine({{Text|1|#F580B1}}, UserDefineCount) = r$
            {{Cl|GOTO}} finishednonexec
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} a3u$ = {{Text|<nowiki>"$COLOR:0"</nowiki>|#FFB100}} {{Cl|THEN}}
            layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$Color:0"</nowiki>|#FFB100}})
            {{Cl|IF}} qb64prefix_set {{Cl|THEN}}
                addmetainclude$ = {{Text|getfilepath$|#55FF55}}({{Cl|COMMAND$}}({{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}}
            {{Cl|ELSE}}
                addmetainclude$ = {{Text|getfilepath$|#55FF55}}({{Cl|COMMAND$}}({{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}}
            {{Cl|END}} {{Cl|IF}}
            layoutdone = {{Text|1|#F580B1}}
            {{Cl|GOTO}} finishednonexec
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} a3u$ = {{Text|<nowiki>"$COLOR:32"</nowiki>|#FFB100}} {{Cl|THEN}}
            layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$Color:32"</nowiki>|#FFB100}})
            {{Cl|IF}} qb64prefix_set {{Cl|THEN}}
                addmetainclude$ = {{Text|getfilepath$|#55FF55}}({{Cl|COMMAND$}}({{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}}
            {{Cl|ELSE}}
                addmetainclude$ = {{Text|getfilepath$|#55FF55}}({{Cl|COMMAND$}}({{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}}
            {{Cl|END}} {{Cl|IF}}
            layoutdone = {{Text|1|#F580B1}}
            {{Cl|GOTO}} finishednonexec
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} a3u$ = {{Text|<nowiki>"$NOPREFIX"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Text|<nowiki>'already set in prepass</nowiki>|#919191}}
            layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$NoPrefix"</nowiki>|#FFB100}})
            {{Cl|GOTO}} finishednonexec
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} a3u$ = {{Text|<nowiki>"$VIRTUALKEYBOARD:ON"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Text|<nowiki>'Deprecated; does nothing.</nowiki>|#919191}}
            layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$VirtualKeyboard:On"</nowiki>|#FFB100}})
            {{Text|addWarning|#55FF55}} linenumber, inclevel, inclinenumber(inclevel), incname$(inclevel), {{Text|<nowiki>"Deprecated feature"</nowiki>|#FFB100}}, {{Text|<nowiki>"$VirtualKeyboard"</nowiki>|#FFB100}}
            {{Cl|GOTO}} finishednonexec
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} a3u$ = {{Text|<nowiki>"$VIRTUALKEYBOARD:OFF"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Text|<nowiki>'Deprecated; does nothing.</nowiki>|#919191}}
            layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$VirtualKeyboard:Off"</nowiki>|#FFB100}})
            {{Text|addWarning|#55FF55}} linenumber, inclevel, inclinenumber(inclevel), incname$(inclevel), {{Text|<nowiki>"Deprecated feature"</nowiki>|#FFB100}}, {{Text|<nowiki>"$VirtualKeyboard"</nowiki>|#FFB100}}
            {{Cl|GOTO}} finishednonexec
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} a3u$ = {{Text|<nowiki>"$DEBUG"</nowiki>|#FFB100}} {{Cl|THEN}}
            layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$Debug"</nowiki>|#FFB100}})
            {{Cl|IF}} NoIDEMode {{Cl|THEN}}
                {{Text|addWarning|#55FF55}} linenumber, inclevel, inclinenumber(inclevel), incname$(inclevel), {{Text|<nowiki>"$Debug"</nowiki>|#FFB100}}, {{Text|<nowiki>"$Debug features only work from the IDE"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|GOTO}} finishednonexec
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} a3u$ = {{Text|<nowiki>"$CHECKING:OFF"</nowiki>|#FFB100}} {{Cl|THEN}}
            layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$Checking:Off"</nowiki>|#FFB100}})
            NoChecks = {{Text|1|#F580B1}}
            {{Cl|IF}} vWatchOn <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} NoIDEMode = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} inclevel = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Text|addWarning|#55FF55}} linenumber, inclevel, inclinenumber(inclevel), incname$(inclevel), {{Text|<nowiki>"$Debug"</nowiki>|#FFB100}}, {{Text|<nowiki>"$Debug features won't work in $Checking:Off blocks"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|GOTO}} finishednonexec
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} a3u$ = {{Text|<nowiki>"$CHECKING:ON"</nowiki>|#FFB100}} {{Cl|THEN}}
            layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$Checking:On"</nowiki>|#FFB100}})
            NoChecks = {{Text|0|#F580B1}}
            {{Cl|GOTO}} finishednonexec
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} a3u$ = {{Text|<nowiki>"$CONSOLE"</nowiki>|#FFB100}} {{Cl|THEN}}
            layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$Console"</nowiki>|#FFB100}})
            Console = {{Text|1|#F580B1}}
            {{Cl|GOTO}} finishednonexec
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} a3u$ = {{Text|<nowiki>"$CONSOLE:ONLY"</nowiki>|#FFB100}} {{Cl|THEN}}
            layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$Console:Only"</nowiki>|#FFB100}})
            DEPENDENCY(DEPENDENCY_CONSOLE_ONLY) = DEPENDENCY(DEPENDENCY_CONSOLE_ONLY) {{Cl|OR}} {{Text|1|#F580B1}}
            Console = {{Text|1|#F580B1}}
            {{Cl|IF}} prepass = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} NoChecks = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"do{"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub__dest(func__console());"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub__source(func__console());"</nowiki>|#FFB100}}
                {{Cl|GOTO}} finishedline2
            {{Cl|ELSE}}
                {{Cl|GOTO}} finishednonexec
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} a3u$ = {{Text|<nowiki>"$ASSERTS"</nowiki>|#FFB100}} {{Cl|THEN}}
            layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$Asserts"</nowiki>|#FFB100}})
            Asserts = {{Text|1|#F580B1}}
            {{Cl|GOTO}} finishednonexec
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} a3u$ = {{Text|<nowiki>"$ASSERTS:CONSOLE"</nowiki>|#FFB100}} {{Cl|THEN}}
            layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$Asserts:Console"</nowiki>|#FFB100}})
            Asserts = {{Text|1|#F580B1}}
            Console = {{Text|1|#F580B1}}
            {{Cl|GOTO}} finishednonexec
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} a3u$ = {{Text|<nowiki>"$SCREENHIDE"</nowiki>|#FFB100}} {{Cl|THEN}}
            layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$ScreenHide"</nowiki>|#FFB100}})
            ScreenHide = {{Text|1|#F580B1}}
            {{Cl|GOTO}} finishednonexec
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} a3u$ = {{Text|<nowiki>"$SCREENSHOW"</nowiki>|#FFB100}} {{Cl|THEN}}
            layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$ScreenShow"</nowiki>|#FFB100}})
            ScreenHide = {{Text|0|#F580B1}}
            {{Cl|GOTO}} finishednonexec
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} a3u$ = {{Text|<nowiki>"$RESIZE:OFF"</nowiki>|#FFB100}} {{Cl|THEN}}
            layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$Resize:Off"</nowiki>|#FFB100}})
            Resize = {{Text|0|#F580B1}}: Resize_Scale = {{Text|0|#F580B1}}
            {{Cl|GOTO}} finishednonexec
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} a3u$ = {{Text|<nowiki>"$RESIZE:ON"</nowiki>|#FFB100}} {{Cl|THEN}}
            layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$Resize:On"</nowiki>|#FFB100}})
            Resize = {{Text|1|#F580B1}}: Resize_Scale = {{Text|0|#F580B1}}
            {{Cl|GOTO}} finishednonexec
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} a3u$ = {{Text|<nowiki>"$RESIZE:STRETCH"</nowiki>|#FFB100}} {{Cl|THEN}}
            layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$Resize:Stretch"</nowiki>|#FFB100}})
            Resize = {{Text|1|#F580B1}}: Resize_Scale = {{Text|1|#F580B1}}
            {{Cl|GOTO}} finishednonexec
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} a3u$ = {{Text|<nowiki>"$RESIZE:SMOOTH"</nowiki>|#FFB100}} {{Cl|THEN}}
            layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$Resize:Smooth"</nowiki>|#FFB100}})
            Resize = {{Text|1|#F580B1}}: Resize_Scale = {{Text|2|#F580B1}}
            {{Cl|GOTO}} finishednonexec
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} {{Cl|LEFT$}}(a3u$, {{Text|12|#F580B1}}) = {{Text|<nowiki>"$VERSIONINFO"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Text|<nowiki>'Embed version info into the final binary (Windows only)</nowiki>|#919191}}
            FirstDelimiter = {{Cl|INSTR}}(a3u$, {{Text|<nowiki>":"</nowiki>|#FFB100}})
            SecondDelimiter = {{Cl|INSTR}}(FirstDelimiter + {{Text|1|#F580B1}}, a3u$, {{Text|<nowiki>"="</nowiki>|#FFB100}})
            {{Cl|IF}} FirstDelimiter = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} SecondDelimiter = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} SecondDelimiter = FirstDelimiter + {{Text|1|#F580B1}} {{Cl|THEN}}
                a$ = {{Text|<nowiki>"Expected $VERSIONINFO:key=value"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|END}} {{Cl|IF}}
            VersionInfoKey$ = {{Cl|LTRIM$}}({{Cl|RTRIM$}}({{Cl|MID$ (function)|MID$}}(a3u$, FirstDelimiter + {{Text|1|#F580B1}}, SecondDelimiter - FirstDelimiter - {{Text|1|#F580B1}})))
            VersionInfoValue$ = {{Text|StrReplace$|#55FF55}}({{Cl|LTRIM$}}({{Cl|RTRIM$}}({{Cl|MID$ (function)|MID$}}(a3$, SecondDelimiter + {{Text|1|#F580B1}}))), {{Cl|CHR$}}({{Text|34|#F580B1}}), {{Text|<nowiki>"'"</nowiki>|#FFB100}})
            {{Cl|SELECT}} {{Cl|CASE}} VersionInfoKey$
                {{Cl|CASE}} {{Text|<nowiki>"FILEVERSION#"</nowiki>|#FFB100}}
                    {{Cl|GOSUB}} ValidateVersion
                    viFileVersionNum$ = VersionInfoValue$
                    {{Cl|IF}} viFileVersion$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} viFileVersion$ = viFileVersionNum$
                    layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$VersionInfo:FILEVERSION#="</nowiki>|#FFB100}}) + VersionInfoValue$
                {{Cl|CASE}} {{Text|<nowiki>"PRODUCTVERSION#"</nowiki>|#FFB100}}
                    {{Cl|GOSUB}} ValidateVersion
                    viProductVersionNum$ = VersionInfoValue$
                    {{Cl|IF}} viProductVersion$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} viProductVersion$ = viProductVersionNum$
                    layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$VersionInfo:PRODUCTVERSION#="</nowiki>|#FFB100}}) + VersionInfoValue$
                {{Cl|CASE}} {{Text|<nowiki>"COMPANYNAME"</nowiki>|#FFB100}}
                    viCompanyName$ = VersionInfoValue$
                    layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$VersionInfo:"</nowiki>|#FFB100}}) + {{Text|<nowiki>"CompanyName="</nowiki>|#FFB100}} + VersionInfoValue$
                {{Cl|CASE}} {{Text|<nowiki>"FILEDESCRIPTION"</nowiki>|#FFB100}}
                    viFileDescription$ = VersionInfoValue$
                    layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$VersionInfo:"</nowiki>|#FFB100}}) + {{Text|<nowiki>"FileDescription="</nowiki>|#FFB100}} + VersionInfoValue$
                {{Cl|CASE}} {{Text|<nowiki>"FILEVERSION"</nowiki>|#FFB100}}
                    viFileVersion$ = VersionInfoValue$
                    layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$VersionInfo:"</nowiki>|#FFB100}}) + {{Text|<nowiki>"FileVersion="</nowiki>|#FFB100}} + VersionInfoValue$
                {{Cl|CASE}} {{Text|<nowiki>"INTERNALNAME"</nowiki>|#FFB100}}
                    viInternalName$ = VersionInfoValue$
                    layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$VersionInfo:"</nowiki>|#FFB100}}) + {{Text|<nowiki>"InternalName="</nowiki>|#FFB100}} + VersionInfoValue$
                {{Cl|CASE}} {{Text|<nowiki>"LEGALCOPYRIGHT"</nowiki>|#FFB100}}
                    viLegalCopyright$ = VersionInfoValue$
                    layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$VersionInfo:"</nowiki>|#FFB100}}) + {{Text|<nowiki>"LegalCopyright="</nowiki>|#FFB100}} + VersionInfoValue$
                {{Cl|CASE}} {{Text|<nowiki>"LEGALTRADEMARKS"</nowiki>|#FFB100}}
                    viLegalTrademarks$ = VersionInfoValue$
                    layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$VersionInfo:"</nowiki>|#FFB100}}) + {{Text|<nowiki>"LegalTrademarks="</nowiki>|#FFB100}} + VersionInfoValue$
                {{Cl|CASE}} {{Text|<nowiki>"ORIGINALFILENAME"</nowiki>|#FFB100}}
                    viOriginalFilename$ = VersionInfoValue$
                    layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$VersionInfo:"</nowiki>|#FFB100}}) + {{Text|<nowiki>"OriginalFilename="</nowiki>|#FFB100}} + VersionInfoValue$
                {{Cl|CASE}} {{Text|<nowiki>"PRODUCTNAME"</nowiki>|#FFB100}}
                    viProductName$ = VersionInfoValue$
                    layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$VersionInfo:"</nowiki>|#FFB100}}) + {{Text|<nowiki>"ProductName="</nowiki>|#FFB100}} + VersionInfoValue$
                {{Cl|CASE}} {{Text|<nowiki>"PRODUCTVERSION"</nowiki>|#FFB100}}
                    viProductVersion$ = VersionInfoValue$
                    layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$VersionInfo:"</nowiki>|#FFB100}}) + {{Text|<nowiki>"ProductVersion="</nowiki>|#FFB100}} + VersionInfoValue$
                {{Cl|CASE}} {{Text|<nowiki>"COMMENTS"</nowiki>|#FFB100}}
                    viComments$ = VersionInfoValue$
                    layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$VersionInfo:"</nowiki>|#FFB100}}) + {{Text|<nowiki>"Comments="</nowiki>|#FFB100}} + VersionInfoValue$
                {{Cl|CASE}} {{Text|<nowiki>"WEB"</nowiki>|#FFB100}}
                    viWeb$ = VersionInfoValue$
                    layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$VersionInfo:"</nowiki>|#FFB100}}) + {{Text|<nowiki>"Web="</nowiki>|#FFB100}} + VersionInfoValue$
                {{Cl|CASE}} {{Cl|ELSE}}
                    a$ = {{Text|<nowiki>"Invalid key. (Use FILEVERSION#, PRODUCTVERSION#, CompanyName, FileDescription, FileVersion, InternalName, LegalCopyright, LegalTrademarks, OriginalFilename, ProductName, ProductVersion, Comments or Web)"</nowiki>|#FFB100}}
                    {{Cl|GOTO}} errmes
            {{Cl|END}} {{Cl|SELECT}}
            VersionInfoSet = {{Text|-1|#F580B1}}
            {{Cl|GOTO}} finishednonexec
            ValidateVersion:
            {{Text|<nowiki>'Check if only numbers and commas (4 comma-separated values)</nowiki>|#919191}}
            {{Cl|IF}} {{Cl|LEN}}(VersionInfoValue$) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected $VERSIONINFO:"</nowiki>|#FFB100}} + VersionInfoKey$ + {{Text|<nowiki>"=#,#,#,# (4 comma-separated numeric values: major, minor, revision and build)"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            viCommas = {{Text|0|#F580B1}}
            {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(VersionInfoValue$)
                {{Cl|IF}} {{Cl|ASC (function)|ASC}}(VersionInfoValue$, i) = {{Text|44|#F580B1}} {{Cl|THEN}} viCommas = viCommas + {{Text|1|#F580B1}}
                {{Cl|IF}} {{Cl|INSTR}}({{Text|<nowiki>"0123456789,"</nowiki>|#FFB100}}, {{Cl|MID$ (function)|MID$}}(VersionInfoValue$, i, {{Text|1|#F580B1}})) = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} (i = {{Cl|LEN}}(VersionInfoValue$) {{Cl|AND (boolean)|AND}} viCommas <> {{Text|3|#F580B1}}) {{Cl|OR (boolean)|OR}} {{Cl|RIGHT$}}(VersionInfoValue$, {{Text|1|#F580B1}}) = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}}
                    a$ = {{Text|<nowiki>"Expected $VERSIONINFO:"</nowiki>|#FFB100}} + VersionInfoKey$ + {{Text|<nowiki>"=#,#,#,# (4 comma-separated numeric values: major, minor, revision and build)"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|END}} {{Cl|IF}}
            {{Cl|NEXT}}
            {{Cl|RETURN}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} {{Cl|LEFT$}}(a3u$, {{Text|8|#F580B1}}) = {{Text|<nowiki>"$EXEICON"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Text|<nowiki>'Basic syntax check. Multi-platform.</nowiki>|#919191}}
            {{Cl|IF}} ExeIconSet {{Cl|THEN}} a$ = {{Text|<nowiki>"$EXEICON already defined"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            FirstDelimiter = {{Cl|INSTR}}(a3u$, {{Text|<nowiki>"'"</nowiki>|#FFB100}})
            {{Cl|IF}} FirstDelimiter = {{Text|0|#F580B1}} {{Cl|THEN}}
                a$ = {{Text|<nowiki>"Expected $EXEICON:'filename'"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|ELSE}}
                SecondDelimiter = {{Cl|INSTR}}(FirstDelimiter + {{Text|1|#F580B1}}, a3u$, {{Text|<nowiki>"'"</nowiki>|#FFB100}})
                {{Cl|IF}} SecondDelimiter = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected $EXEICON:'filename'"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|END}} {{Cl|IF}}
            ExeIconFile$ = {{Cl|RTRIM$}}({{Cl|LTRIM$}}({{Cl|MID$ (function)|MID$}}(a3$, FirstDelimiter + {{Text|1|#F580B1}}, SecondDelimiter - FirstDelimiter - {{Text|1|#F580B1}})))
            {{Cl|IF}} {{Cl|LEN}}(ExeIconFile$) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected $EXEICON:'filename'"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$ExeIcon:'"</nowiki>|#FFB100}}) + ExeIconFile$ + {{Text|<nowiki>"'"</nowiki>|#FFB100}} + {{Cl|MID$ (function)|MID$}}(a3$, SecondDelimiter + {{Text|1|#F580B1}})
            IconPath$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Cl|IF}} {{Cl|LEFT$}}(ExeIconFile$, {{Text|2|#F580B1}}) = {{Text|<nowiki>"./"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} {{Cl|LEFT$}}(ExeIconFile$, {{Text|2|#F580B1}}) = {{Text|<nowiki>".\"</nowiki>|#FFB100}} {{Cl|THEN}}
                {{Text|<nowiki>'Relative to source file's folder</nowiki>|#919191}}
                {{Cl|IF}} NoIDEMode {{Cl|THEN}}
                    IconPath$ = path.source$
                    {{Cl|IF}} {{Cl|LEN}}(IconPath$) > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|RIGHT$}}(IconPath$, {{Text|1|#F580B1}}) <> pathsep$ {{Cl|THEN}} IconPath$ = IconPath$ + pathsep$
                {{Cl|ELSE}}
                    {{Cl|IF}} {{Cl|LEN}}(ideprogname) {{Cl|THEN}} IconPath$ = idepath$ + pathsep$
                {{Cl|END}} {{Cl|IF}}
                ExeIconFile$ = IconPath$ + {{Cl|MID$ (function)|MID$}}(ExeIconFile$, {{Text|3|#F580B1}})
            {{Cl|ELSEIF}} {{Cl|INSTR}}(ExeIconFile$, {{Text|<nowiki>"/"</nowiki>|#FFB100}}) {{Cl|OR (boolean)|OR}} {{Cl|INSTR}}(ExeIconFile$, {{Text|<nowiki>"\"</nowiki>|#FFB100}}) {{Cl|THEN}}
                {{Cl|FOR}} i = {{Cl|LEN}}(ExeIconFile$) {{Cl|TO}} {{Text|1|#F580B1}} {{Cl|STEP}} {{Text|-1|#F580B1}}
                    {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(ExeIconFile$, i, {{Text|1|#F580B1}}) = {{Text|<nowiki>"/"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} {{Cl|MID$ (function)|MID$}}(ExeIconFile$, i, {{Text|1|#F580B1}}) = {{Text|<nowiki>"\"</nowiki>|#FFB100}} {{Cl|THEN}}
                        IconPath$ = {{Cl|LEFT$}}(ExeIconFile$, i)
                        ExeIconFileOnly$ = {{Cl|MID$ (function)|MID$}}(ExeIconFile$, i + {{Text|1|#F580B1}})
                        {{Cl|IF}} {{Cl|_DIREXISTS}}(IconPath$) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"File '"</nowiki>|#FFB100}} + ExeIconFileOnly$ + {{Text|<nowiki>"' not found"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                        currentdir$ = {{Cl|_CWD$}}
                        {{Cl|CHDIR}} IconPath$
                        IconPath$ = {{Cl|_CWD$}}
                        {{Cl|CHDIR}} currentdir$
                        ExeIconFile$ = IconPath$ + pathsep$ + ExeIconFileOnly$
                        {{Cl|EXIT}} {{Cl|FOR}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|NEXT}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} {{Cl|_FILEEXISTS}}(ExeIconFile$) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"File '"</nowiki>|#FFB100}} + ExeIconFile$ + {{Text|<nowiki>"' not found"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            ExeIconSet = linenumber
            {{Text|SetDependency|#55FF55}} DEPENDENCY_ICON
            {{Cl|IF}} NoChecks = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"do{"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub__icon(NULL,NULL,0);"</nowiki>|#FFB100}}
            {{Cl|GOTO}} finishedline2
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} {{Cl|LEFT$}}(a3u$, {{Text|10|#F580B1}}) = {{Text|<nowiki>"$UNSTABLE:"</nowiki>|#FFB100}} {{Cl|THEN}}
            layout$ = {{Text|SCase|#55FF55}}({{Text|<nowiki>"$Unstable:"</nowiki>|#FFB100}})
            token$ = {{Cl|LTRIM$}}({{Cl|RTRIM$}}({{Cl|MID$ (function)|MID$}}(a3u$, {{Text|11|#F580B1}})))
            {{Cl|SELECT}} {{Cl|CASE}} token$
                {{Cl|CASE}} {{Text|<nowiki>"MIDI"</nowiki>|#FFB100}}
                    layout$ = layout$ + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Midi"</nowiki>|#FFB100}})
                {{Cl|CASE}} {{Text|<nowiki>"HTTP"</nowiki>|#FFB100}}
                    layout$ = layout$ + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Http"</nowiki>|#FFB100}})
            {{Cl|END}} {{Cl|SELECT}}
            {{Cl|GOTO}} finishednonexec
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} unstableFlags(UNSTABLE_MIDI) {{Cl|THEN}}
            {{Cl|IF}} {{Cl|LEFT$}}(a3u$, {{Text|15|#F580B1}}) = {{Text|<nowiki>"$MIDISOUNDFONT:"</nowiki>|#FFB100}} {{Cl|THEN}}
                {{Cl|IF}} MidiSoundFontSet {{Cl|THEN}}
                    a$ = {{Text|<nowiki>"$MIDISOUNDFONT already defined"</nowiki>|#FFB100}}
                    {{Cl|GOTO}} errmes
                {{Cl|END}} {{Cl|IF}}
                layout$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"$MidiSoundFont:"</nowiki>|#FFB100}})
                MidiSoundFont$ = {{Cl|LTRIM$}}({{Cl|RTRIM$}}({{Cl|MID$ (function)|MID$}}(a3$, {{Text|16|#F580B1}})))
                {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(MidiSoundFont$, {{Text|1|#F580B1}}, {{Text|1|#F580B1}}) = {{Cl|CHR$}}({{Text|34|#F580B1}}) {{Cl|THEN}}
                    {{Text|<nowiki>' We have a quoted filename, verify it is valid</nowiki>|#919191}}
                    {{Text|<nowiki>' We don't touch the filename in the formatting</nowiki>|#919191}}
                    layout$ = layout$ + MidiSoundFont$
                    {{Text|<nowiki>' Strip the leading quote</nowiki>|#919191}}
                    MidiSoundFont$ = {{Cl|MID$ (function)|MID$}}(MidiSoundFont$, {{Text|2|#F580B1}})
                    {{Text|<nowiki>' Verify that there is a quote character at the end</nowiki>|#919191}}
                    {{Cl|IF}} {{Cl|INSTR}}(MidiSoundFont$, {{Cl|CHR$}}({{Text|34|#F580B1}})) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>" character at the end of the file name"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    {{Text|<nowiki>' Verify there are no extra characters after end quote</nowiki>|#919191}}
                    {{Cl|IF}} {{Cl|INSTR}}(MidiSoundFont$, {{Cl|CHR$}}({{Text|34|#F580B1}})) <> {{Cl|LEN}}(MidiSoundFont$) {{Cl|THEN}} a$ = {{Text|<nowiki>"Unexpected characters after the quoted file name"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    MidiSoundFont$ = {{Cl|MID$ (function)|MID$}}(MidiSoundFont$, {{Text|1|#F580B1}}, {{Cl|LEN}}(MidiSoundFont$) - {{Text|1|#F580B1}})
                    {{Cl|IF}} {{Cl|NOT}} {{Cl|_FILEEXISTS}}(MidiSoundFont$) {{Cl|THEN}}
                        a$ = {{Text|<nowiki>"Soundfont file "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(MidiSoundFont$) + {{Text|<nowiki>" could not be found!"</nowiki>|#FFB100}}
                        {{Cl|GOTO}} errmes
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|ELSE}}
                    {{Text|<nowiki>' Constant values, only one for now</nowiki>|#919191}}
                    {{Cl|SELECT}} {{Cl|CASE}} {{Cl|UCASE$}}(MidiSoundFont$)
                        {{Cl|CASE}} {{Text|<nowiki>"DEFAULT"</nowiki>|#FFB100}}
                            layout$ = layout$ + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Default"</nowiki>|#FFB100}})
                            {{Text|<nowiki>' Clear MidiSoundFont$ to indicate the default should be used</nowiki>|#919191}}
                            MidiSoundFont$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                        {{Cl|CASE}} {{Cl|ELSE}}
                            a$ = {{Text|<nowiki>"Unrecognized Soundfont option "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(MidiSoundFont$)
                            {{Cl|GOTO}} errmes
                    {{Cl|END}} {{Cl|SELECT}}
                {{Cl|END}} {{Cl|IF}}
                MidiSoundFontSet = linenumber
                MidiSoundFontLine$ = layout$
                {{Cl|GOTO}} finishednonexec
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'QB64 Metacommands</nowiki>|#919191}}
    {{Cl|IF}} ExecLevel(ExecCounter) {{Cl|THEN}}
        layoutdone = {{Text|0|#F580B1}}
        {{Cl|GOTO}} finishednonexec {{Text|<nowiki>'we don't check for anything inside lines that we've marked for skipping</nowiki>|#919191}}
    {{Cl|END}} {{Cl|IF}}
    linedataoffset = DataOffset
    entireline$ = {{Text|lineformat|#55FF55}}(a3$): {{Cl|IF}} {{Cl|LEN}}(entireline$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} finishednonexec
    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
    u$ = {{Cl|UCASE$}}(entireline$)
    newif = {{Text|0|#F580B1}}
    {{Text|<nowiki>'Convert "CASE ELSE" to "CASE C-EL" to avoid confusing compiler</nowiki>|#919191}}
    {{Text|<nowiki>'note: CASE does not have to begin on a new line</nowiki>|#919191}}
    s = {{Text|1|#F580B1}}
    i = {{Cl|INSTR}}(s, u$, {{Text|<nowiki>"CASE"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"ELSE"</nowiki>|#FFB100}})
    {{Cl|DO}} {{Cl|WHILE}} i
        skip = {{Text|0|#F580B1}}
        {{Cl|IF}} i <> {{Text|1|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(u$, i - {{Text|1|#F580B1}}, {{Text|1|#F580B1}}) <> sp {{Cl|THEN}} skip = {{Text|1|#F580B1}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} i <> {{Cl|LEN}}(u$) - {{Text|8|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(u$, i + {{Text|9|#F580B1}}, {{Text|1|#F580B1}}) <> sp {{Cl|THEN}} skip = {{Text|1|#F580B1}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} skip = {{Text|0|#F580B1}} {{Cl|THEN}}
            {{Cl|MID$}}(entireline$, i) = {{Text|<nowiki>"CASE"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"C-EL"</nowiki>|#FFB100}}
            u$ = {{Cl|UCASE$}}(entireline$)
        {{Cl|END}} {{Cl|IF}}
        s = i + {{Text|9|#F580B1}}
        i = {{Cl|INSTR}}(s, u$, {{Text|<nowiki>"CASE"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"ELSE"</nowiki>|#FFB100}})
    {{Cl|LOOP}}
    n = {{Text|numelements|#55FF55}}(entireline$)
    {{Text|<nowiki>'line number?</nowiki>|#919191}}
    a = {{Cl|ASC (function)|ASC}}(entireline$)
    {{Cl|IF}} (a >= {{Text|48|#F580B1}} {{Cl|AND (boolean)|AND}} a <= {{Text|57|#F580B1}}) {{Cl|OR (boolean)|OR}} a = {{Text|46|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'numeric</nowiki>|#919191}}
        label$ = {{Text|getelement|#55FF55}}(entireline$, {{Text|1|#F580B1}})
        {{Cl|IF}} {{Text|validlabel|#55FF55}}(label$) {{Cl|THEN}}
            {{Cl|IF}} closedmain <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} subfunc = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Labels cannot be placed between SUB/FUNCTIONs"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            v = {{Text|HashFind|#55FF55}}(label$, HASHFLAG_LABEL, ignore, r)
            addlabchk100:
            {{Cl|IF}} v {{Cl|THEN}}
                s = Labels(r).{{Text|Scope|#55FF55}}
                {{Cl|IF}} s = subfuncn {{Cl|OR (boolean)|OR}} s = {{Text|-1|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'same scope?</nowiki>|#919191}}
                    {{Cl|IF}} s = {{Text|-1|#F580B1}} {{Cl|THEN}} Labels(r).{{Text|Scope|#55FF55}} = subfuncn {{Text|<nowiki>'acquire scope</nowiki>|#919191}}
                    {{Cl|IF}} Labels(r).State = {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Duplicate label ("</nowiki>|#FFB100}} + {{Cl|RTRIM$}}(Labels(r).cn) + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    {{Text|<nowiki>'aquire state 0 types</nowiki>|#919191}}
                    tlayout$ = {{Cl|RTRIM$}}(Labels(r).cn)
                    {{Cl|GOTO}} addlabaq100
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'same scope</nowiki>|#919191}}
                {{Cl|IF}} v = {{Text|2|#F580B1}} {{Cl|THEN}} v = {{Text|HashFindCont|#55FF55}}(ignore, r): {{Cl|GOTO}} addlabchk100
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'does not exist</nowiki>|#919191}}
            nLabels = nLabels + {{Text|1|#F580B1}}: {{Cl|IF}} nLabels > Labels_Ubound {{Cl|THEN}} Labels_Ubound = Labels_Ubound * {{Text|2|#F580B1}}: {{Cl|REDIM}} {{Cl|_PRESERVE}} Labels({{Text|1|#F580B1}} {{Cl|TO}} Labels_Ubound) {{Cl|AS}} Label_Type
            Labels(nLabels) = Empty_Label
            {{Text|HashAdd|#55FF55}} label$, HASHFLAG_LABEL, nLabels
            r = nLabels
            Labels(r).cn = tlayout$
            Labels(r).{{Text|Scope|#55FF55}} = subfuncn
            addlabaq100:
            Labels(r).State = {{Text|1|#F580B1}}
            Labels(r).Data_Offset = linedataoffset
            layout$ = tlayout$
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"LABEL_"</nowiki>|#FFB100}} + label$ + {{Text|<nowiki>":;"</nowiki>|#FFB100}}
            {{Cl|IF}} {{Cl|INSTR}}(label$, {{Text|<nowiki>"p"</nowiki>|#FFB100}}) {{Cl|THEN}} {{Cl|MID$}}(label$, {{Cl|INSTR}}(label$, {{Text|<nowiki>"p"</nowiki>|#FFB100}}), {{Text|1|#F580B1}}) = {{Text|<nowiki>"."</nowiki>|#FFB100}}
            {{Cl|IF}} {{Cl|RIGHT$}}(label$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"d"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} {{Cl|RIGHT$}}(label$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"s"</nowiki>|#FFB100}} {{Cl|THEN}} label$ = {{Cl|LEFT$}}(label$, {{Cl|LEN}}(label$) - {{Text|1|#F580B1}})
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"last_line="</nowiki>|#FFB100}} + label$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
            inclinenump$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Cl|IF}} inclinenumber(inclevel) {{Cl|THEN}}
                inclinenump$ = {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(inclinenumber(inclevel))
                thisincname$ = {{Text|getfilepath$|#55FF55}}(incname$(inclevel))
                thisincname$ = {{Cl|MID$ (function)|MID$}}(incname$(inclevel), {{Cl|LEN}}(thisincname$) + {{Text|1|#F580B1}})
                inclinenump$ = inclinenump$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + thisincname$ + {{Cl|CHR$}}({{Text|34|#F580B1}})
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} NoChecks = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} vWatchOn {{Cl|AND (boolean)|AND}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Cl|THEN}} temp$ = vWatchErrorCall$ {{Cl|ELSE}} temp$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if(qbevent){"</nowiki>|#FFB100}} + temp$ + {{Text|<nowiki>"evnt("</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(linenumber) + inclinenump$ + {{Text|<nowiki>");r=0;}"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} finishednonexec
            entireline$ = {{Text|getelements|#55FF55}}(entireline$, {{Text|2|#F580B1}}, n): u$ = {{Cl|UCASE$}}(entireline$): n = n - {{Text|1|#F580B1}}
            {{Text|<nowiki>'note: fall through, numeric labels can be followed by alphanumeric label</nowiki>|#919191}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'validlabel</nowiki>|#919191}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'numeric</nowiki>|#919191}}
    {{Text|<nowiki>'it wasn't a line number</nowiki>|#919191}}
    {{Text|<nowiki>'label?</nowiki>|#919191}}
    {{Text|<nowiki>'note: ignores possibility that this could be a single command SUB/FUNCTION (as in QBASIC?)</nowiki>|#919191}}
    {{Cl|IF}} n >= {{Text|2|#F580B1}} {{Cl|THEN}}
        x2 = {{Cl|INSTR}}(entireline$, sp + {{Text|<nowiki>":"</nowiki>|#FFB100}})
        {{Cl|IF}} x2 {{Cl|THEN}}
            {{Cl|IF}} x2 = {{Cl|LEN}}(entireline$) - {{Text|1|#F580B1}} {{Cl|THEN}} x3 = x2 + {{Text|1|#F580B1}} {{Cl|ELSE}} x3 = x2 + {{Text|2|#F580B1}}
            a$ = {{Cl|LEFT$}}(entireline$, x2 - {{Text|1|#F580B1}})
            CreatingLabel = {{Text|1|#F580B1}}
            {{Cl|IF}} {{Text|validlabel|#55FF55}}(a$) {{Cl|THEN}}
                {{Cl|IF}} {{Text|validname|#55FF55}}(a$) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid name"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|IF}} closedmain <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} subfunc = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Labels cannot be placed between SUB/FUNCTIONs"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                v = {{Text|HashFind|#55FF55}}(a$, HASHFLAG_LABEL, ignore, r)
                addlabchk:
                {{Cl|IF}} v {{Cl|THEN}}
                    s = Labels(r).{{Text|Scope|#55FF55}}
                    {{Cl|IF}} s = subfuncn {{Cl|OR (boolean)|OR}} s = {{Text|-1|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'same scope?</nowiki>|#919191}}
                        {{Cl|IF}} s = {{Text|-1|#F580B1}} {{Cl|THEN}} Labels(r).{{Text|Scope|#55FF55}} = subfuncn {{Text|<nowiki>'acquire scope</nowiki>|#919191}}
                        {{Cl|IF}} Labels(r).State = {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Duplicate label ("</nowiki>|#FFB100}} + {{Cl|RTRIM$}}(Labels(r).cn) + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                        {{Text|<nowiki>'aquire state 0 types</nowiki>|#919191}}
                        tlayout$ = {{Cl|RTRIM$}}(Labels(r).cn)
                        {{Cl|GOTO}} addlabaq
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'same scope</nowiki>|#919191}}
                    {{Cl|IF}} v = {{Text|2|#F580B1}} {{Cl|THEN}} v = {{Text|HashFindCont|#55FF55}}(ignore, r): {{Cl|GOTO}} addlabchk
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'does not exist</nowiki>|#919191}}
                nLabels = nLabels + {{Text|1|#F580B1}}: {{Cl|IF}} nLabels > Labels_Ubound {{Cl|THEN}} Labels_Ubound = Labels_Ubound * {{Text|2|#F580B1}}: {{Cl|REDIM}} {{Cl|_PRESERVE}} Labels({{Text|1|#F580B1}} {{Cl|TO}} Labels_Ubound) {{Cl|AS}} Label_Type
                Labels(nLabels) = Empty_Label
                {{Text|HashAdd|#55FF55}} a$, HASHFLAG_LABEL, nLabels
                r = nLabels
                Labels(r).cn = tlayout$
                Labels(r).{{Text|Scope|#55FF55}} = subfuncn
                addlabaq:
                Labels(r).State = {{Text|1|#F580B1}}
                Labels(r).Data_Offset = linedataoffset
                Labels(r).SourceLineNumber = linenumber
                {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + tlayout$ + {{Text|<nowiki>":"</nowiki>|#FFB100}} {{Cl|ELSE}} layout$ = tlayout$ + {{Text|<nowiki>":"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"LABEL_"</nowiki>|#FFB100}} + a$ + {{Text|<nowiki>":;"</nowiki>|#FFB100}}
                inclinenump$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                {{Cl|IF}} inclinenumber(inclevel) {{Cl|THEN}}
                    inclinenump$ = {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(inclinenumber(inclevel))
                    thisincname$ = {{Text|getfilepath$|#55FF55}}(incname$(inclevel))
                    thisincname$ = {{Cl|MID$ (function)|MID$}}(incname$(inclevel), {{Cl|LEN}}(thisincname$) + {{Text|1|#F580B1}})
                    inclinenump$ = inclinenump$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + thisincname$ + {{Cl|CHR$}}({{Text|34|#F580B1}})
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} NoChecks = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} vWatchOn {{Cl|AND (boolean)|AND}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Cl|THEN}} temp$ = vWatchErrorCall$ {{Cl|ELSE}} temp$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if(qbevent){"</nowiki>|#FFB100}} + temp$ + {{Text|<nowiki>"evnt("</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(linenumber) + inclinenump$ + {{Text|<nowiki>");r=0;}"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                entireline$ = {{Cl|RIGHT$}}(entireline$, {{Cl|LEN}}(entireline$) - x3): u$ = {{Cl|UCASE$}}(entireline$)
                n = {{Text|numelements|#55FF55}}(entireline$): {{Cl|IF}} n = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} finishednonexec
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'valid</nowiki>|#919191}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'includes sp+":"</nowiki>|#919191}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'n>=2</nowiki>|#919191}}
    {{Text|<nowiki>'remove leading ":"</nowiki>|#919191}}
    {{Cl|DO}} {{Cl|WHILE}} {{Cl|ASC (function)|ASC}}(u$) = {{Text|58|#F580B1}} {{Text|<nowiki>'":"</nowiki>|#919191}}
        {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp2 + {{Text|<nowiki>":"</nowiki>|#FFB100}} {{Cl|ELSE}} layout$ = {{Text|<nowiki>":"</nowiki>|#FFB100}}
        {{Cl|IF}} {{Cl|LEN}}(u$) = {{Text|1|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} finishednonexec
        entireline$ = {{Text|getelements|#55FF55}}(entireline$, {{Text|2|#F580B1}}, n): u$ = {{Cl|UCASE$}}(entireline$): n = n - {{Text|1|#F580B1}}
    {{Cl|LOOP}}
    {{Text|<nowiki>'ELSE at the beginning of a line</nowiki>|#919191}}
    {{Cl|IF}} {{Cl|ASC (function)|ASC}}(u$) = {{Text|69|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'"E"</nowiki>|#919191}}
        e1$ = {{Text|getelement|#55FF55}}(u$, {{Text|1|#F580B1}})
        {{Cl|IF}} e1$ = {{Text|<nowiki>"ELSE"</nowiki>|#FFB100}} {{Cl|THEN}}
            a$ = {{Text|<nowiki>"ELSE"</nowiki>|#FFB100}}
            {{Cl|IF}} n > {{Text|1|#F580B1}} {{Cl|THEN}} continuelinefrom = {{Text|2|#F580B1}}
            {{Cl|GOTO}} gotcommand
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} e1$ = {{Text|<nowiki>"ELSEIF"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} n < {{Text|3|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ... THEN"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|IF}} {{Text|getelement|#55FF55}}(u$, n) = {{Text|<nowiki>"THEN"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = entireline$: {{Cl|GOTO}} gotcommand
            {{Cl|FOR}} i = {{Text|3|#F580B1}} {{Cl|TO}} n - {{Text|1|#F580B1}}
                {{Cl|IF}} {{Text|getelement|#55FF55}}(u$, i) = {{Text|<nowiki>"THEN"</nowiki>|#FFB100}} {{Cl|THEN}}
                    a$ = {{Text|getelements|#55FF55}}(entireline$, {{Text|1|#F580B1}}, i)
                    continuelinefrom = i + {{Text|1|#F580B1}}
                    {{Cl|GOTO}} gotcommand
                {{Cl|END}} {{Cl|IF}}
            {{Cl|NEXT}}
            a$ = {{Text|<nowiki>"Expected THEN"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'"E"</nowiki>|#919191}}
    start = {{Text|1|#F580B1}}
    {{Cl|GOTO}} skipcontinit
    contline:
    n = {{Text|numelements|#55FF55}}(entireline$)
    u$ = {{Cl|UCASE$}}(entireline$)
    skipcontinit:
    {{Text|<nowiki>'jargon:</nowiki>|#919191}}
    {{Text|<nowiki>'lineelseused - counts how many line ELSEs can POSSIBLY follow</nowiki>|#919191}}
    {{Text|<nowiki>'endifs - how many C++ endifs "}" need to be added at the end of the line</nowiki>|#919191}}
    {{Text|<nowiki>'lineelseused - counts the number of indwelling ELSE statements on a line</nowiki>|#919191}}
    {{Text|<nowiki>'impliedendif - stops autoformat from adding "END IF"</nowiki>|#919191}}
    a$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
    {{Cl|FOR}} i = start {{Cl|TO}} n
        e$ = {{Text|getelement|#55FF55}}(u$, i)
        {{Cl|IF}} e$ = {{Text|<nowiki>":"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} i = start {{Cl|THEN}}
                layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp2 + {{Text|<nowiki>":"</nowiki>|#FFB100}} {{Cl|ELSE}} layout$ = {{Text|<nowiki>":"</nowiki>|#FFB100}}
                {{Cl|IF}} i <> n {{Cl|THEN}} continuelinefrom = i + {{Text|1|#F580B1}}
                {{Cl|GOTO}} finishednonexec
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} i <> n {{Cl|THEN}} continuelinefrom = i
            {{Cl|GOTO}} gotcommand
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'begin scanning an 'IF' statement</nowiki>|#919191}}
        {{Cl|IF}} e$ = {{Text|<nowiki>"IF"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} a$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} newif = {{Text|1|#F580B1}}
        {{Cl|IF}} e$ = {{Text|<nowiki>"THEN"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (e$ = {{Text|<nowiki>"GOTO"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} newif = {{Text|1|#F580B1}}) {{Cl|THEN}}
            {{Cl|IF}} newif = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"THEN without IF"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            newif = {{Text|0|#F580B1}}
            {{Cl|IF}} lineelseused > {{Text|0|#F580B1}} {{Cl|THEN}} lineelseused = lineelseused - {{Text|1|#F580B1}}
            {{Cl|IF}} e$ = {{Text|<nowiki>"GOTO"</nowiki>|#FFB100}} {{Cl|THEN}}
                {{Cl|IF}} i = n {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected IF expression GOTO label"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                i = i - {{Text|1|#F580B1}}
            {{Cl|END}} {{Cl|IF}}
            a$ = a$ + sp + e$ {{Text|<nowiki>'+"THEN"/"GOTO"</nowiki>|#919191}}
            {{Cl|IF}} i <> n {{Cl|THEN}} continuelinefrom = i + {{Text|1|#F580B1}}: endifs = endifs + {{Text|1|#F580B1}}
            {{Cl|GOTO}} gotcommand
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} e$ = {{Text|<nowiki>"ELSE"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} start = i {{Cl|THEN}}
                {{Cl|IF}} lineelseused >= {{Text|1|#F580B1}} {{Cl|THEN}}
                    {{Text|<nowiki>'note: more than one else used (in a row) on this line, so close first if with an 'END IF' first</nowiki>|#919191}}
                    {{Text|<nowiki>'note: parses 'END IF' then (after continuelinefrom) parses 'ELSE'</nowiki>|#919191}}
                    {{Text|<nowiki>'consider the following: (square brackets make reading easier)</nowiki>|#919191}}
                    {{Text|<nowiki>'eg. if a=1 then [if b=2 then c=2 else d=2] else e=3</nowiki>|#919191}}
                    impliedendif = {{Text|1|#F580B1}}: a$ = {{Text|<nowiki>"END"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"IF"</nowiki>|#FFB100}}
                    endifs = endifs - {{Text|1|#F580B1}}
                    continuelinefrom = i
                    lineelseused = lineelseused - {{Text|1|#F580B1}}
                    {{Cl|GOTO}} gotcommand
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'follow up previously encountered 'ELSE' by applying 'ELSE'</nowiki>|#919191}}
                a$ = {{Text|<nowiki>"ELSE"</nowiki>|#FFB100}}: continuelinefrom = i + {{Text|1|#F580B1}}
                lineelseused = lineelseused + {{Text|1|#F580B1}}
                {{Cl|GOTO}} gotcommand
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'start=i</nowiki>|#919191}}
            {{Text|<nowiki>'apply everything up to (but not including) 'ELSE'</nowiki>|#919191}}
            continuelinefrom = i
            {{Cl|GOTO}} gotcommand
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'"ELSE"</nowiki>|#919191}}
        e$ = {{Text|getelement|#55FF55}}(entireline$, i): {{Cl|IF}} a$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = e$ {{Cl|ELSE}} a$ = a$ + sp + e$
    {{Cl|NEXT}}
    {{Text|<nowiki>'we're reached the end of the line</nowiki>|#919191}}
    {{Cl|IF}} endifs > {{Text|0|#F580B1}} {{Cl|THEN}}
        endifs = endifs - {{Text|1|#F580B1}}
        impliedendif = {{Text|1|#F580B1}}: entireline$ = entireline$ + sp + {{Text|<nowiki>":"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"END"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"IF"</nowiki>|#FFB100}}: n = n + {{Text|3|#F580B1}}
        i = i + {{Text|1|#F580B1}} {{Text|<nowiki>'skip the ":" (i is now equal to n+2)</nowiki>|#919191}}
        continuelinefrom = i
        {{Cl|GOTO}} gotcommand
    {{Cl|END}} {{Cl|IF}}
    gotcommand:
    dynscope = {{Text|0|#F580B1}}
    ca$ = a$
    a$ = {{Text|eleucase$|#55FF55}}(ca$) {{Text|<nowiki>'***REVISE THIS SECTION LATER***</nowiki>|#919191}}
    layoutdone = {{Text|0|#F580B1}}
    linefragment = a$
    {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, a$
    n = {{Text|numelements|#55FF55}}(a$)
    {{Cl|IF}} n = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} finishednonexec
    {{Text|<nowiki>'convert non-UDT dimensioned periods to _046_</nowiki>|#919191}}
    {{Cl|IF}} {{Cl|INSTR}}(ca$, sp + {{Text|<nowiki>"."</nowiki>|#FFB100}} + sp) {{Cl|THEN}}
        a3$ = {{Text|getelement|#55FF55}}(ca$, {{Text|1|#F580B1}})
        except = {{Text|0|#F580B1}}
        aa$ = a3$ + sp {{Text|<nowiki>'rebuilt a$ (always has a trailing spacer)</nowiki>|#919191}}
        lastfuse = {{Text|-1|#F580B1}}
        {{Cl|FOR}} x = {{Text|2|#F580B1}} {{Cl|TO}} n
            a2$ = {{Text|getelement|#55FF55}}(ca$, x)
            {{Cl|IF}} except = {{Text|1|#F580B1}} {{Cl|THEN}} except = {{Text|2|#F580B1}}: {{Cl|GOTO}} udtperiod {{Text|<nowiki>'skip element name</nowiki>|#919191}}
            {{Cl|IF}} a2$ = {{Text|<nowiki>"."</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} x <> n {{Cl|THEN}}
                {{Cl|IF}} except = {{Text|2|#F580B1}} {{Cl|THEN}} except = {{Text|1|#F580B1}}: {{Cl|GOTO}} udtperiod {{Text|<nowiki>'sub-element of UDT</nowiki>|#919191}}
                {{Cl|IF}} a3$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Text|<nowiki>'assume it was something like typevar(???).x and treat as a UDT</nowiki>|#919191}}
                    except = {{Text|1|#F580B1}}
                    {{Cl|GOTO}} udtperiod
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'find an ID of that type</nowiki>|#919191}}
                try = {{Text|findid|#55FF55}}({{Cl|UCASE$}}(a3$))
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Cl|DO}} {{Cl|WHILE}} try
                    {{Cl|IF}} ((id.t {{Cl|AND (boolean)|AND}} ISUDT) <> {{Text|0|#F580B1}}) {{Cl|OR (boolean)|OR}} ((id.arraytype {{Cl|AND (boolean)|AND}} ISUDT) <> {{Text|0|#F580B1}}) {{Cl|THEN}}
                        except = {{Text|1|#F580B1}}
                        {{Cl|GOTO}} udtperiod
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}({{Cl|UCASE$}}(a3$)) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Cl|LOOP}}
                {{Text|<nowiki>'not a udt; fuse lhs & rhs with _046_</nowiki>|#919191}}
                {{Cl|IF}} isalpha({{Cl|ASC (function)|ASC}}(a3$)) = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} lastfuse <> x - {{Text|2|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid '.'"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                aa$ = {{Cl|LEFT$}}(aa$, {{Cl|LEN}}(aa$) - {{Text|1|#F580B1}}) + fix046$
                lastfuse = x
                {{Cl|GOTO}} periodfused
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'"."</nowiki>|#919191}}
            except = {{Text|0|#F580B1}}
            udtperiod:
            aa$ = aa$ + a2$ + sp
            periodfused:
            a3$ = a2$
        {{Cl|NEXT}}
        a$ = {{Cl|LEFT$}}(aa$, {{Cl|LEN}}(aa$) - {{Text|1|#F580B1}})
        ca$ = a$
        a$ = {{Text|eleucase$|#55FF55}}(ca$)
        n = {{Text|numelements|#55FF55}}(a$)
    {{Cl|END}} {{Cl|IF}}
    arrayprocessinghappened = {{Text|0|#F580B1}}
    firstelement$ = {{Text|getelement|#55FF55}}(a$, {{Text|1|#F580B1}})
    secondelement$ = {{Text|getelement|#55FF55}}(a$, {{Text|2|#F580B1}})
    thirdelement$ = {{Text|getelement|#55FF55}}(a$, {{Text|3|#F580B1}})
    {{Text|<nowiki>'non-executable section</nowiki>|#919191}}
    {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"'"</nowiki>|#FFB100}} {{Cl|THEN}} layoutdone = {{Text|1|#F580B1}}: {{Cl|GOTO}} finishednonexec {{Text|<nowiki>'nop</nowiki>|#919191}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} n <= {{Text|2|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"DATA"</nowiki>|#FFB100}} {{Cl|THEN}}
            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Data"</nowiki>|#FFB100}})
            {{Cl|IF}} n = {{Text|2|#F580B1}} {{Cl|THEN}}
                e$ = {{Cl|SPACE$}}(({{Cl|LEN}}(secondelement$) - {{Text|1|#F580B1}}) \ {{Text|2|#F580B1}})
                {{Cl|FOR}} x = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(e$)
                    v1 = {{Cl|ASC (function)|ASC}}(secondelement$, x * {{Text|2|#F580B1}})
                    v2 = {{Cl|ASC (function)|ASC}}(secondelement$, x * {{Text|2|#F580B1}} + {{Text|1|#F580B1}})
                    {{Cl|IF}} v1 < {{Text|65|#F580B1}} {{Cl|THEN}} v1 = v1 - {{Text|48|#F580B1}} {{Cl|ELSE}} v1 = v1 - {{Text|55|#F580B1}}
                    {{Cl|IF}} v2 < {{Text|65|#F580B1}} {{Cl|THEN}} v2 = v2 - {{Text|48|#F580B1}} {{Cl|ELSE}} v2 = v2 - {{Text|55|#F580B1}}
                    {{Cl|ASC}}(e$, x) = v1 + v2 * {{Text|16|#F580B1}}
                {{Cl|NEXT}}
                l$ = l$ + sp + e$
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'n=2</nowiki>|#919191}}
            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
            {{Cl|GOTO}} finishednonexec
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'declare library</nowiki>|#919191}}
    {{Cl|IF}} declaringlibrary {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"END"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} n <> {{Text|2|#F580B1}} {{Cl|OR (boolean)|OR}} secondelement$ <> {{Text|<nowiki>"DECLARE"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected END DECLARE"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            declaringlibrary = {{Text|0|#F580B1}}
            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"End"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"Declare"</nowiki>|#FFB100}})
            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
            {{Cl|GOTO}} finishednonexec
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'end declare</nowiki>|#919191}}
        declaringlibrary = {{Text|2|#F580B1}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"SUB"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} firstelement$ = {{Text|<nowiki>"FUNCTION"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|GOTO}} declaresubfunc2
        {{Cl|END}} {{Cl|IF}}
        a$ = {{Text|<nowiki>"Expected SUB/FUNCTION definition or END DECLARE"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'declaringlibrary</nowiki>|#919191}}
    {{Text|<nowiki>'check TYPE declarations (created on prepass)</nowiki>|#919191}}
    {{Cl|IF}} definingtype {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"END"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} n <> {{Text|2|#F580B1}} {{Cl|OR (boolean)|OR}} secondelement$ <> {{Text|<nowiki>"TYPE"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected END TYPE"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            definingtype = {{Text|0|#F580B1}}
            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"End"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"Type"</nowiki>|#FFB100}})
            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
            {{Cl|GOTO}} finishednonexec
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'IF n < 3 THEN definingtypeerror = linenumber: a$ = "Expected element-name AS type or AS type element-list": GOTO errmes</nowiki>|#919191}}
        {{Cl|IF}} n < {{Text|3|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected element-name AS type or AS type element-list"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
        definingtype = {{Text|2|#F580B1}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"AS"</nowiki>|#FFB100}} {{Cl|THEN}}
            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"As"</nowiki>|#FFB100}})
            t$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            wordsInTypeName = {{Text|0|#F580B1}}
            {{Cl|DO}}
                nextElement$ = {{Text|getelement$|#55FF55}}(a$, {{Text|2|#F580B1}} + wordsInTypeName)
                {{Cl|IF}} nextElement$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Text|<nowiki>'element-list</nowiki>|#919191}}
                    wordsInTypeName = wordsInTypeName - {{Text|2|#F580B1}}
                    {{Cl|EXIT}} {{Cl|DO}}
                {{Cl|END}} {{Cl|IF}}
                wordsInTypeName = wordsInTypeName + {{Text|1|#F580B1}}
                {{Cl|IF}} wordsInTypeName = n - {{Text|2|#F580B1}} {{Cl|THEN}}
                    {{Text|<nowiki>'single element in line</nowiki>|#919191}}
                    wordsInTypeName = wordsInTypeName - {{Text|1|#F580B1}}
                    {{Cl|EXIT}} {{Cl|DO}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|LOOP}}
            t$ = {{Text|getelements$|#55FF55}}(a$, {{Text|2|#F580B1}}, {{Text|2|#F580B1}} + wordsInTypeName)
            typ = {{Text|typname2typ|#55FF55}}(t$)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Cl|IF}} typ = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Undefined type"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|IF}} typ {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
                {{Cl|IF}} {{Cl|UCASE$}}({{Cl|RTRIM$}}(t$)) = {{Text|<nowiki>"MEM"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} {{Cl|RTRIM$}}(udtxcname(typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}})) = {{Text|<nowiki>"_MEM"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|THEN}}
                    t$ = {{Cl|MID$ (function)|MID$}}({{Cl|RTRIM$}}(udtxcname(typ {{Cl|AND}} {{Text|511|#F580B1}})), {{Text|2|#F580B1}})
                {{Cl|ELSE}}
                    t$ = {{Cl|RTRIM$}}(udtxcname(typ {{Cl|AND}} {{Text|511|#F580B1}}))
                {{Cl|END}} {{Cl|IF}}
                l$ = l$ + sp + t$
            {{Cl|ELSE}}
                l$ = l$ + sp + {{Text|SCase2$|#55FF55}}(t$)
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'Now add each variable:</nowiki>|#919191}}
            {{Cl|FOR}} i = {{Text|3|#F580B1}} + wordsInTypeName {{Cl|TO}} n
                thisElement$ = {{Text|getelement$|#55FF55}}(ca$, i)
                {{Cl|IF}} thisElement$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}}
                    l$ = l$ + thisElement$
                {{Cl|ELSE}}
                    l$ = l$ + sp + thisElement$
                {{Cl|END}} {{Cl|IF}}
            {{Cl|NEXT}}
            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
        {{Cl|ELSE}}
            l$ = {{Text|getelement|#55FF55}}(ca$, {{Text|1|#F580B1}}) + sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"As"</nowiki>|#FFB100}})
            t$ = {{Text|getelements$|#55FF55}}(a$, {{Text|3|#F580B1}}, n)
            typ = {{Text|typname2typ|#55FF55}}(t$)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Cl|IF}} typ = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Undefined type"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|IF}} typ {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
                {{Cl|IF}} {{Cl|UCASE$}}({{Cl|RTRIM$}}(t$)) = {{Text|<nowiki>"MEM"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} {{Cl|RTRIM$}}(udtxcname(typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}})) = {{Text|<nowiki>"_MEM"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|THEN}}
                    t$ = {{Cl|MID$ (function)|MID$}}({{Cl|RTRIM$}}(udtxcname(typ {{Cl|AND}} {{Text|511|#F580B1}})), {{Text|2|#F580B1}})
                {{Cl|ELSE}}
                    t$ = {{Cl|RTRIM$}}(udtxcname(typ {{Cl|AND}} {{Text|511|#F580B1}}))
                {{Cl|END}} {{Cl|IF}}
                l$ = l$ + sp + t$
            {{Cl|ELSE}}
                l$ = l$ + sp + {{Text|SCase2$|#55FF55}}(t$)
            {{Cl|END}} {{Cl|IF}}
            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
        {{Cl|END}} {{Cl|IF}}
        {{Cl|GOTO}} finishednonexec
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'defining type</nowiki>|#919191}}
    {{Cl|IF}} firstelement$ = {{Text|<nowiki>"TYPE"</nowiki>|#FFB100}} {{Cl|THEN}}
        {{Cl|IF}} n <> {{Text|2|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected TYPE type-name"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
        l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Type"</nowiki>|#FFB100}}) + sp + {{Text|getelement|#55FF55}}(ca$, {{Text|2|#F580B1}})
        layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
        definingtype = {{Text|1|#F580B1}}
        definingtypeerror = linenumber
        {{Cl|GOTO}} finishednonexec
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'skip DECLARE SUB/FUNCTION</nowiki>|#919191}}
    {{Cl|IF}} n >= {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"DECLARE"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} secondelement$ = {{Text|<nowiki>"LIBRARY"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} secondelement$ = {{Text|<nowiki>"DYNAMIC"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} secondelement$ = {{Text|<nowiki>"CUSTOMTYPE"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} secondelement$ = {{Text|<nowiki>"STATIC"</nowiki>|#FFB100}} {{Cl|THEN}}
                declaringlibrary = {{Text|1|#F580B1}}
                dynamiclibrary = {{Text|0|#F580B1}}
                customtypelibrary = {{Text|0|#F580B1}}
                indirectlibrary = {{Text|0|#F580B1}}
                staticlinkedlibrary = {{Text|0|#F580B1}}
                x = {{Text|3|#F580B1}}
                l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Declare"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"Library"</nowiki>|#FFB100}})
                {{Cl|IF}} secondelement$ = {{Text|<nowiki>"DYNAMIC"</nowiki>|#FFB100}} {{Cl|THEN}}
                    e$ = {{Text|getelement$|#55FF55}}(a$, {{Text|3|#F580B1}}): {{Cl|IF}} e$ <> {{Text|<nowiki>"LIBRARY"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected DYNAMIC LIBRARY "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"..."</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}): {{Cl|GOTO}} errmes
                    dynamiclibrary = {{Text|1|#F580B1}}
                    x = {{Text|4|#F580B1}}
                    l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Declare"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"Dynamic"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"Library"</nowiki>|#FFB100}})
                    {{Cl|IF}} n = {{Text|3|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected DECLARE DYNAMIC LIBRARY "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"..."</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}): {{Cl|GOTO}} errmes
                    indirectlibrary = {{Text|1|#F580B1}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} secondelement$ = {{Text|<nowiki>"CUSTOMTYPE"</nowiki>|#FFB100}} {{Cl|THEN}}
                    e$ = {{Text|getelement$|#55FF55}}(a$, {{Text|3|#F580B1}}): {{Cl|IF}} e$ <> {{Text|<nowiki>"LIBRARY"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected CUSTOMTYPE LIBRARY"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    customtypelibrary = {{Text|1|#F580B1}}
                    x = {{Text|4|#F580B1}}
                    l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Declare"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"CustomType"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"Library"</nowiki>|#FFB100}})
                    indirectlibrary = {{Text|1|#F580B1}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} secondelement$ = {{Text|<nowiki>"STATIC"</nowiki>|#FFB100}} {{Cl|THEN}}
                    e$ = {{Text|getelement$|#55FF55}}(a$, {{Text|3|#F580B1}}): {{Cl|IF}} e$ <> {{Text|<nowiki>"LIBRARY"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected STATIC LIBRARY"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    x = {{Text|4|#F580B1}}
                    l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Declare"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"Static"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"Library"</nowiki>|#FFB100}})
                    staticlinkedlibrary = {{Text|1|#F580B1}}
                {{Cl|END}} {{Cl|IF}}
                sfdeclare = {{Text|0|#F580B1}}: sfheader = {{Text|0|#F580B1}}
                {{Cl|IF}} n >= x {{Cl|THEN}}
                    sfdeclare = {{Text|1|#F580B1}}
                    addlibrary:
                    libname$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    headername$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    {{Text|<nowiki>'assume library name in double quotes follows</nowiki>|#919191}}
                    {{Text|<nowiki>'assume library is in main qb64pe folder</nowiki>|#919191}}
                    x$ = {{Text|getelement$|#55FF55}}(ca$, x)
                    {{Cl|IF}} {{Cl|ASC (function)|ASC}}(x$) <> {{Text|34|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected LIBRARY "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"..."</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}): {{Cl|GOTO}} errmes
                    x$ = {{Cl|RIGHT$}}(x$, {{Cl|LEN}}(x$) - {{Text|1|#F580B1}})
                    z = {{Cl|INSTR}}(x$, {{Cl|CHR$}}({{Text|34|#F580B1}}))
                    {{Cl|IF}} z = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected LIBRARY "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"..."</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}): {{Cl|GOTO}} errmes
                    x$ = {{Cl|LEFT$}}(x$, z - {{Text|1|#F580B1}})
                    {{Cl|IF}} dynamiclibrary <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|LEN}}(x$) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected DECLARE DYNAMIC LIBRARY "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"..."</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}): {{Cl|GOTO}} errmes
                    {{Cl|IF}} customtypelibrary <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|LEN}}(x$) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected DECLARE CUSTOMTYPE LIBRARY "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"..."</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}): {{Cl|GOTO}} errmes
                    {{Text|<nowiki>'convert '\\' to '\'</nowiki>|#919191}}
                    {{Cl|WHILE}} {{Cl|INSTR}}(x$, {{Text|<nowiki>"\\"</nowiki>|#FFB100}})
                        z = {{Cl|INSTR}}(x$, {{Text|<nowiki>"\\"</nowiki>|#FFB100}})
                        x$ = {{Cl|LEFT$}}(x$, z - {{Text|1|#F580B1}}) + {{Cl|RIGHT$}}(x$, {{Cl|LEN}}(x$) - z)
                    {{Cl|WEND}}
                    autoformat_x$ = x$ {{Text|<nowiki>'used for autolayout purposes</nowiki>|#919191}}
                    {{Text|<nowiki>'Remove version number from library name</nowiki>|#919191}}
                    {{Text|<nowiki>'Eg. libname:1.0 becomes libname <-> 1.0 which later becomes libname.so.1.0</nowiki>|#919191}}
                    v$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    striplibver:
                    {{Cl|FOR}} z = {{Cl|LEN}}(x$) {{Cl|TO}} {{Text|1|#F580B1}} {{Cl|STEP}} {{Text|-1|#F580B1}}
                        a = {{Cl|ASC (function)|ASC}}(x$, z)
                        {{Cl|IF}} a = ASC_BACKSLASH {{Cl|OR (boolean)|OR}} a = ASC_FORWARDSLASH {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}}
                        {{Cl|IF}} a = ASC_FULLSTOP {{Cl|OR (boolean)|OR}} a = ASC_COLON {{Cl|THEN}}
                            {{Cl|IF}} {{Text|isuinteger|#55FF55}}({{Cl|RIGHT$}}(x$, {{Cl|LEN}}(x$) - z)) {{Cl|THEN}}
                                {{Cl|IF}} {{Cl|LEN}}(v$) {{Cl|THEN}} v$ = {{Cl|RIGHT$}}(x$, {{Cl|LEN}}(x$) - z) + {{Text|<nowiki>"."</nowiki>|#FFB100}} + v$ {{Cl|ELSE}} v$ = {{Cl|RIGHT$}}(x$, {{Cl|LEN}}(x$) - z)
                                x$ = {{Cl|LEFT$}}(x$, z - {{Text|1|#F580B1}})
                                {{Cl|IF}} a = ASC_COLON {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}}
                                {{Cl|GOTO}} striplibver
                            {{Cl|ELSE}}
                                {{Cl|EXIT}} {{Cl|FOR}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|NEXT}}
                    libver$ = v$
                    {{Cl|IF}} os$ = {{Text|<nowiki>"WIN"</nowiki>|#FFB100}} {{Cl|THEN}}
                        {{Text|<nowiki>'convert forward-slashes to back-slashes</nowiki>|#919191}}
                        {{Cl|DO}} {{Cl|WHILE}} {{Cl|INSTR}}(x$, {{Text|<nowiki>"/"</nowiki>|#FFB100}})
                            z = {{Cl|INSTR}}(x$, {{Text|<nowiki>"/"</nowiki>|#FFB100}})
                            x$ = {{Cl|LEFT$}}(x$, z - {{Text|1|#F580B1}}) + {{Text|<nowiki>"\"</nowiki>|#FFB100}} + {{Cl|RIGHT$}}(x$, {{Cl|LEN}}(x$) - z)
                        {{Cl|LOOP}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Cl|THEN}}
                        {{Text|<nowiki>'convert any back-slashes to forward-slashes</nowiki>|#919191}}
                        {{Cl|DO}} {{Cl|WHILE}} {{Cl|INSTR}}(x$, {{Text|<nowiki>"\"</nowiki>|#FFB100}})
                            z = {{Cl|INSTR}}(x$, {{Text|<nowiki>"\"</nowiki>|#FFB100}})
                            x$ = {{Cl|LEFT$}}(x$, z - {{Text|1|#F580B1}}) + {{Text|<nowiki>"/"</nowiki>|#FFB100}} + {{Cl|RIGHT$}}(x$, {{Cl|LEN}}(x$) - z)
                        {{Cl|LOOP}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|<nowiki>'Separate path from name</nowiki>|#919191}}
                    libpath$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    {{Cl|FOR}} z = {{Cl|LEN}}(x$) {{Cl|TO}} {{Text|1|#F580B1}} {{Cl|STEP}} {{Text|-1|#F580B1}}
                        a = {{Cl|ASC (function)|ASC}}(x$, z)
                        {{Cl|IF}} a = {{Text|47|#F580B1}} {{Cl|OR (boolean)|OR}} a = {{Text|92|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'\ or /</nowiki>|#919191}}
                            libpath$ = {{Cl|LEFT$}}(x$, z)
                            x$ = {{Cl|RIGHT$}}(x$, {{Cl|LEN}}(x$) - z)
                            {{Cl|EXIT}} {{Cl|FOR}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|NEXT}}
                    {{Text|<nowiki>'Accept ./ and .\ as a reference to the source file</nowiki>|#919191}}
                    {{Text|<nowiki>'folder, replacing it with the actual full path, if available</nowiki>|#919191}}
                    {{Cl|IF}} libpath$ = {{Text|<nowiki>"./"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} libpath$ = {{Text|<nowiki>".\"</nowiki>|#FFB100}} {{Cl|THEN}}
                        libpath$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                        {{Cl|IF}} NoIDEMode {{Cl|THEN}}
                            libpath$ = path.source$
                            {{Cl|IF}} {{Cl|LEN}}(libpath$) > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|RIGHT$}}(libpath$, {{Text|1|#F580B1}}) <> pathsep$ {{Cl|THEN}} libpath$ = libpath$ + pathsep$
                        {{Cl|ELSE}}
                            {{Cl|IF}} {{Cl|LEN}}(ideprogname) {{Cl|THEN}} libpath$ = idepath$ + pathsep$
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|<nowiki>'Create a path which can be used for inline code (uses \\ instead of \)</nowiki>|#919191}}
                    libpath_inline$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    {{Cl|FOR}} z = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(libpath$)
                        a = {{Cl|ASC (function)|ASC}}(libpath$, z)
                        libpath_inline$ = libpath_inline$ + {{Cl|CHR$}}(a)
                        {{Cl|IF}} a = {{Text|92|#F580B1}} {{Cl|THEN}} libpath_inline$ = libpath_inline$ + {{Text|<nowiki>"\"</nowiki>|#FFB100}}
                    {{Cl|NEXT}}
                    {{Cl|IF}} {{Cl|LEN}}(x$) {{Cl|THEN}}
                        {{Cl|IF}} dynamiclibrary = {{Text|0|#F580B1}} {{Cl|THEN}}
                            {{Text|<nowiki>'Static library</nowiki>|#919191}}
                            {{Cl|IF}} os$ = {{Text|<nowiki>"WIN"</nowiki>|#FFB100}} {{Cl|THEN}}
                                {{Text|<nowiki>'check for .lib</nowiki>|#919191}}
                                {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}(libpath$ + x$ + {{Text|<nowiki>".lib"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        libname$ = libpath$ + x$ + {{Text|<nowiki>".lib"</nowiki>|#FFB100}}
                                        inlinelibname$ = libpath_inline$ + x$ + {{Text|<nowiki>".lib"</nowiki>|#FFB100}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|<nowiki>'check for .a</nowiki>|#919191}}
                                {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}(libpath$ + x$ + {{Text|<nowiki>".a"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        libname$ = libpath$ + x$ + {{Text|<nowiki>".a"</nowiki>|#FFB100}}
                                        inlinelibname$ = libpath_inline$ + x$ + {{Text|<nowiki>".a"</nowiki>|#FFB100}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|<nowiki>'check for .o</nowiki>|#919191}}
                                {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}(libpath$ + x$ + {{Text|<nowiki>".o"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        libname$ = libpath$ + x$ + {{Text|<nowiki>".o"</nowiki>|#FFB100}}
                                        inlinelibname$ = libpath_inline$ + x$ + {{Text|<nowiki>".o"</nowiki>|#FFB100}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|<nowiki>'check for .lib</nowiki>|#919191}}
                                {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}(x$ + {{Text|<nowiki>".lib"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        libname$ = x$ + {{Text|<nowiki>".lib"</nowiki>|#FFB100}}
                                        inlinelibname$ = x$ + {{Text|<nowiki>".lib"</nowiki>|#FFB100}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|<nowiki>'check for .a</nowiki>|#919191}}
                                {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}(x$ + {{Text|<nowiki>".a"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        libname$ = x$ + {{Text|<nowiki>".a"</nowiki>|#FFB100}}
                                        inlinelibname$ = x$ + {{Text|<nowiki>".a"</nowiki>|#FFB100}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|<nowiki>'check for .o</nowiki>|#919191}}
                                {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}(x$ + {{Text|<nowiki>".o"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        libname$ = x$ + {{Text|<nowiki>".o"</nowiki>|#FFB100}}
                                        inlinelibname$ = x$ + {{Text|<nowiki>".o"</nowiki>|#FFB100}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'Windows</nowiki>|#919191}}
                            {{Cl|IF}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Cl|THEN}}
                                {{Cl|IF}} staticlinkedlibrary = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} MacOSX {{Cl|THEN}} {{Text|<nowiki>'dylib support</nowiki>|#919191}}
                                        {{Text|<nowiki>'check for .dylib (direct)</nowiki>|#919191}}
                                        {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                            {{Cl|IF}} {{Cl|_FILEEXISTS}}(libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>"."</nowiki>|#FFB100}} + libver$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                                libname$ = libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>"."</nowiki>|#FFB100}} + libver$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                                inlinelibname$ = libpath_inline$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>"."</nowiki>|#FFB100}} + libver$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                                {{Cl|IF}} {{Cl|LEN}}(libpath$) {{Cl|THEN}} mylibopt$ = mylibopt$ + {{Text|<nowiki>" -Wl,-rpath "</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} {{Cl|ELSE}} mylibopt$ = mylibopt$ + {{Text|<nowiki>" -Wl,-rpath ./ "</nowiki>|#FFB100}}
                                            {{Cl|END}} {{Cl|IF}}
                                        {{Cl|END}} {{Cl|IF}}
                                        {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                            {{Cl|IF}} {{Cl|_FILEEXISTS}}(libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                                libname$ = libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                                inlinelibname$ = libpath_inline$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                                {{Cl|IF}} {{Cl|LEN}}(libpath$) {{Cl|THEN}} mylibopt$ = mylibopt$ + {{Text|<nowiki>" -Wl,-rpath "</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} {{Cl|ELSE}} mylibopt$ = mylibopt$ + {{Text|<nowiki>" -Wl,-rpath ./ "</nowiki>|#FFB100}}
                                            {{Cl|END}} {{Cl|IF}}
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Text|<nowiki>'check for .so (direct)</nowiki>|#919191}}
                                    {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                        {{Cl|IF}} {{Cl|_FILEEXISTS}}(libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$) {{Cl|THEN}}
                                            libname$ = libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$
                                            inlinelibname$ = libpath_inline$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$
                                            {{Cl|IF}} {{Cl|LEN}}(libpath$) {{Cl|THEN}} mylibopt$ = mylibopt$ + {{Text|<nowiki>" -Wl,-rpath "</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} {{Cl|ELSE}} mylibopt$ = mylibopt$ + {{Text|<nowiki>" -Wl,-rpath ./ "</nowiki>|#FFB100}}
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                        {{Cl|IF}} {{Cl|_FILEEXISTS}}(libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                            libname$ = libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}
                                            inlinelibname$ = libpath_inline$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}
                                            {{Cl|IF}} {{Cl|LEN}}(libpath$) {{Cl|THEN}} mylibopt$ = mylibopt$ + {{Text|<nowiki>" -Wl,-rpath "</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} {{Cl|ELSE}} mylibopt$ = mylibopt$ + {{Text|<nowiki>" -Wl,-rpath ./ "</nowiki>|#FFB100}}
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|<nowiki>'check for .a (direct)</nowiki>|#919191}}
                                {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}(libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".a"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        libname$ = libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".a"</nowiki>|#FFB100}}
                                        inlinelibname$ = libpath_inline$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".a"</nowiki>|#FFB100}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|<nowiki>'check for .o (direct)</nowiki>|#919191}}
                                {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}(libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".o"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        libname$ = libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".o"</nowiki>|#FFB100}}
                                        inlinelibname$ = libpath_inline$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".o"</nowiki>|#FFB100}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Cl|IF}} staticlinkedlibrary = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Text|<nowiki>'check for .so (usr/lib64)</nowiki>|#919191}}
                                    {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                        {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/lib64/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$) {{Cl|THEN}}
                                            libname$ = {{Text|<nowiki>"/usr/lib64/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$
                                            inlinelibname$ = {{Text|<nowiki>"/usr/lib64/"</nowiki>|#FFB100}} + libpath_inline$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$
                                            {{Cl|IF}} {{Cl|LEN}}(libpath$) {{Cl|THEN}} mylibopt$ = mylibopt$ + {{Text|<nowiki>" -Wl,-rpath /usr/lib64/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} {{Cl|ELSE}} mylibopt$ = mylibopt$ + {{Text|<nowiki>" -Wl,-rpath /usr/lib64/ "</nowiki>|#FFB100}}
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                        {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/lib64/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                            libname$ = {{Text|<nowiki>"/usr/lib64/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}
                                            inlinelibname$ = {{Text|<nowiki>"/usr/lib64/"</nowiki>|#FFB100}} + libpath_inline$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}
                                            {{Cl|IF}} {{Cl|LEN}}(libpath$) {{Cl|THEN}} mylibopt$ = mylibopt$ + {{Text|<nowiki>" -Wl,-rpath /usr/lib64/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} {{Cl|ELSE}} mylibopt$ = mylibopt$ + {{Text|<nowiki>" -Wl,-rpath /usr/lib64/ "</nowiki>|#FFB100}}
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|<nowiki>'check for .a (usr/lib64)</nowiki>|#919191}}
                                {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/lib64/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".a"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        libname$ = {{Text|<nowiki>"/usr/lib64/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".a"</nowiki>|#FFB100}}
                                        inlinelibname$ = {{Text|<nowiki>"/usr/lib64/"</nowiki>|#FFB100}} + libpath_inline$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".a"</nowiki>|#FFB100}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Cl|IF}} staticlinkedlibrary = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} MacOSX {{Cl|THEN}} {{Text|<nowiki>'dylib support</nowiki>|#919191}}
                                        {{Text|<nowiki>'check for .dylib (usr/lib)</nowiki>|#919191}}
                                        {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                            {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>"."</nowiki>|#FFB100}} + libver$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                                libname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>"."</nowiki>|#FFB100}} + libver$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                                inlinelibname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + libpath_inline$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>"."</nowiki>|#FFB100}} + libver$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                                {{Cl|IF}} {{Cl|LEN}}(libpath$) {{Cl|THEN}} mylibopt$ = mylibopt$ + {{Text|<nowiki>" -Wl,-rpath /usr/lib/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} {{Cl|ELSE}} mylibopt$ = mylibopt$ + {{Text|<nowiki>" -Wl,-rpath /usr/lib/ "</nowiki>|#FFB100}}
                                            {{Cl|END}} {{Cl|IF}}
                                        {{Cl|END}} {{Cl|IF}}
                                        {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                            {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                                libname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                                inlinelibname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + libpath_inline$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                                {{Cl|IF}} {{Cl|LEN}}(libpath$) {{Cl|THEN}} mylibopt$ = mylibopt$ + {{Text|<nowiki>" -Wl,-rpath /usr/lib/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} {{Cl|ELSE}} mylibopt$ = mylibopt$ + {{Text|<nowiki>" -Wl,-rpath /usr/lib/ "</nowiki>|#FFB100}}
                                            {{Cl|END}} {{Cl|IF}}
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Text|<nowiki>'check for .so (usr/lib)</nowiki>|#919191}}
                                    {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                        {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$) {{Cl|THEN}}
                                            libname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$
                                            inlinelibname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + libpath_inline$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$
                                            {{Cl|IF}} {{Cl|LEN}}(libpath$) {{Cl|THEN}} mylibopt$ = mylibopt$ + {{Text|<nowiki>" -Wl,-rpath /usr/lib/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} {{Cl|ELSE}} mylibopt$ = mylibopt$ + {{Text|<nowiki>" -Wl,-rpath /usr/lib/ "</nowiki>|#FFB100}}
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                        {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                            libname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}
                                            inlinelibname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + libpath_inline$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}
                                            {{Cl|IF}} {{Cl|LEN}}(libpath$) {{Cl|THEN}} mylibopt$ = mylibopt$ + {{Text|<nowiki>" -Wl,-rpath /usr/lib/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} {{Cl|ELSE}} mylibopt$ = mylibopt$ + {{Text|<nowiki>" -Wl,-rpath /usr/lib/ "</nowiki>|#FFB100}}
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|<nowiki>'check for .a (usr/lib)</nowiki>|#919191}}
                                {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".a"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        libname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".a"</nowiki>|#FFB100}}
                                        inlinelibname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + libpath_inline$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".a"</nowiki>|#FFB100}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|<nowiki>'--------------------------(without path)------------------------------</nowiki>|#919191}}
                                {{Cl|IF}} staticlinkedlibrary = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} MacOSX {{Cl|THEN}} {{Text|<nowiki>'dylib support</nowiki>|#919191}}
                                        {{Text|<nowiki>'check for .dylib (direct)</nowiki>|#919191}}
                                        {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                            {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>"."</nowiki>|#FFB100}} + libver$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                                libname$ = {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>"."</nowiki>|#FFB100}} + libver$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                                inlinelibname$ = {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>"."</nowiki>|#FFB100}} + libver$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                                mylibopt$ = mylibopt$ + {{Text|<nowiki>" -Wl,-rpath ./ "</nowiki>|#FFB100}}
                                            {{Cl|END}} {{Cl|IF}}
                                        {{Cl|END}} {{Cl|IF}}
                                        {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                            {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                                libname$ = {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                                inlinelibname$ = {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                                mylibopt$ = mylibopt$ + {{Text|<nowiki>" -Wl,-rpath ./ "</nowiki>|#FFB100}}
                                            {{Cl|END}} {{Cl|IF}}
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Text|<nowiki>'check for .so (direct)</nowiki>|#919191}}
                                    {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                        {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$) {{Cl|THEN}}
                                            libname$ = {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$
                                            inlinelibname$ = {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$
                                            mylibopt$ = mylibopt$ + {{Text|<nowiki>" -Wl,-rpath ./ "</nowiki>|#FFB100}}
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                        {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                            libname$ = {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}
                                            inlinelibname$ = {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}
                                            mylibopt$ = mylibopt$ + {{Text|<nowiki>" -Wl,-rpath ./ "</nowiki>|#FFB100}}
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|<nowiki>'check for .a (direct)</nowiki>|#919191}}
                                {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".a"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        libname$ = {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".a"</nowiki>|#FFB100}}
                                        inlinelibname$ = {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".a"</nowiki>|#FFB100}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|<nowiki>'check for .o (direct)</nowiki>|#919191}}
                                {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".o"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        libname$ = {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".o"</nowiki>|#FFB100}}
                                        inlinelibname$ = {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".o"</nowiki>|#FFB100}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Cl|IF}} staticlinkedlibrary = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Text|<nowiki>'check for .so (usr/lib64)</nowiki>|#919191}}
                                    {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                        {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/lib64/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$) {{Cl|THEN}}
                                            libname$ = {{Text|<nowiki>"/usr/lib64/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$
                                            inlinelibname$ = {{Text|<nowiki>"/usr/lib64/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$
                                            mylibopt$ = mylibopt$ + {{Text|<nowiki>" -Wl,-rpath /usr/lib64/ "</nowiki>|#FFB100}}
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                        {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/lib64/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                            libname$ = {{Text|<nowiki>"/usr/lib64/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}
                                            inlinelibname$ = {{Text|<nowiki>"/usr/lib64/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}
                                            mylibopt$ = mylibopt$ + {{Text|<nowiki>" -Wl,-rpath /usr/lib64/ "</nowiki>|#FFB100}}
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|<nowiki>'check for .a (usr/lib64)</nowiki>|#919191}}
                                {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/lib64/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".a"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        libname$ = {{Text|<nowiki>"/usr/lib64/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".a"</nowiki>|#FFB100}}
                                        inlinelibname$ = {{Text|<nowiki>"/usr/lib64/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".a"</nowiki>|#FFB100}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Cl|IF}} staticlinkedlibrary = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} MacOSX {{Cl|THEN}} {{Text|<nowiki>'dylib support</nowiki>|#919191}}
                                        {{Text|<nowiki>'check for .dylib (usr/lib)</nowiki>|#919191}}
                                        {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                            {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>"."</nowiki>|#FFB100}} + libver$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                                libname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>"."</nowiki>|#FFB100}} + libver$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                                inlinelibname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>"."</nowiki>|#FFB100}} + libver$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                            {{Cl|END}} {{Cl|IF}}
                                        {{Cl|END}} {{Cl|IF}}
                                        {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                            {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                                libname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                                inlinelibname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                                mylibopt$ = mylibopt$ + {{Text|<nowiki>" -Wl,-rpath /usr/lib/ "</nowiki>|#FFB100}}
                                            {{Cl|END}} {{Cl|IF}}
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Text|<nowiki>'check for .so (usr/lib)</nowiki>|#919191}}
                                    {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                        {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$) {{Cl|THEN}}
                                            libname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$
                                            inlinelibname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                        {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                            libname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}
                                            inlinelibname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}
                                            mylibopt$ = mylibopt$ + {{Text|<nowiki>" -Wl,-rpath /usr/lib/ "</nowiki>|#FFB100}}
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|<nowiki>'check for .a (usr/lib)</nowiki>|#919191}}
                                {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".a"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        libname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".a"</nowiki>|#FFB100}}
                                        inlinelibname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".a"</nowiki>|#FFB100}}
                                        mylibopt$ = mylibopt$ + {{Text|<nowiki>" -Wl,-rpath /usr/lib/ "</nowiki>|#FFB100}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'Linux</nowiki>|#919191}}
                            {{Text|<nowiki>'check for header</nowiki>|#919191}}
                            {{Cl|IF}} {{Cl|LEN}}(headername$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                {{Cl|IF}} os$ = {{Text|<nowiki>"WIN"</nowiki>|#FFB100}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}(libpath$ + x$ + {{Text|<nowiki>".h"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        headername$ = libpath_inline$ + x$ + {{Text|<nowiki>".h"</nowiki>|#FFB100}}
                                        {{Cl|IF}} customtypelibrary = {{Text|0|#F580B1}} {{Cl|THEN}} sfdeclare = {{Text|0|#F580B1}}
                                        sfheader = {{Text|1|#F580B1}}
                                        {{Cl|GOTO}} GotHeader
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}(libpath$ + x$ + {{Text|<nowiki>".hpp"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        headername$ = libpath_inline$ + x$ + {{Text|<nowiki>".hpp"</nowiki>|#FFB100}}
                                        {{Cl|IF}} customtypelibrary = {{Text|0|#F580B1}} {{Cl|THEN}} sfdeclare = {{Text|0|#F580B1}}
                                        sfheader = {{Text|1|#F580B1}}
                                        {{Cl|GOTO}} GotHeader
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Text|<nowiki>'--------------------------(without path)------------------------------</nowiki>|#919191}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}(x$ + {{Text|<nowiki>".h"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        headername$ = x$ + {{Text|<nowiki>".h"</nowiki>|#FFB100}}
                                        {{Cl|IF}} customtypelibrary = {{Text|0|#F580B1}} {{Cl|THEN}} sfdeclare = {{Text|0|#F580B1}}
                                        sfheader = {{Text|1|#F580B1}}
                                        {{Cl|GOTO}} GotHeader
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}(x$ + {{Text|<nowiki>".hpp"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        headername$ = x$ + {{Text|<nowiki>".hpp"</nowiki>|#FFB100}}
                                        {{Cl|IF}} customtypelibrary = {{Text|0|#F580B1}} {{Cl|THEN}} sfdeclare = {{Text|0|#F580B1}}
                                        sfheader = {{Text|1|#F580B1}}
                                        {{Cl|GOTO}} GotHeader
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'Windows</nowiki>|#919191}}
                                {{Cl|IF}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}(libpath$ + x$ + {{Text|<nowiki>".h"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        headername$ = libpath_inline$ + x$ + {{Text|<nowiki>".h"</nowiki>|#FFB100}}
                                        {{Cl|IF}} customtypelibrary = {{Text|0|#F580B1}} {{Cl|THEN}} sfdeclare = {{Text|0|#F580B1}}
                                        sfheader = {{Text|1|#F580B1}}
                                        {{Cl|GOTO}} GotHeader
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}(libpath$ + x$ + {{Text|<nowiki>".hpp"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        headername$ = libpath_inline$ + x$ + {{Text|<nowiki>".hpp"</nowiki>|#FFB100}}
                                        {{Cl|IF}} customtypelibrary = {{Text|0|#F580B1}} {{Cl|THEN}} sfdeclare = {{Text|0|#F580B1}}
                                        sfheader = {{Text|1|#F580B1}}
                                        {{Cl|GOTO}} GotHeader
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/include/"</nowiki>|#FFB100}} + libpath$ + x$ + {{Text|<nowiki>".h"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        headername$ = {{Text|<nowiki>"/usr/include/"</nowiki>|#FFB100}} + libpath_inline$ + x$ + {{Text|<nowiki>".h"</nowiki>|#FFB100}}
                                        {{Cl|IF}} customtypelibrary = {{Text|0|#F580B1}} {{Cl|THEN}} sfdeclare = {{Text|0|#F580B1}}
                                        sfheader = {{Text|1|#F580B1}}
                                        {{Cl|GOTO}} GotHeader
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/include/"</nowiki>|#FFB100}} + libpath$ + x$ + {{Text|<nowiki>".hpp"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        headername$ = {{Text|<nowiki>"/usr/include/"</nowiki>|#FFB100}} + libpath_inline$ + x$ + {{Text|<nowiki>".hpp"</nowiki>|#FFB100}}
                                        {{Cl|IF}} customtypelibrary = {{Text|0|#F580B1}} {{Cl|THEN}} sfdeclare = {{Text|0|#F580B1}}
                                        sfheader = {{Text|1|#F580B1}}
                                        {{Cl|GOTO}} GotHeader
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Text|<nowiki>'--------------------------(without path)------------------------------</nowiki>|#919191}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}(x$ + {{Text|<nowiki>".h"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        headername$ = x$ + {{Text|<nowiki>".h"</nowiki>|#FFB100}}
                                        {{Cl|IF}} customtypelibrary = {{Text|0|#F580B1}} {{Cl|THEN}} sfdeclare = {{Text|0|#F580B1}}
                                        sfheader = {{Text|1|#F580B1}}
                                        {{Cl|GOTO}} GotHeader
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}(x$ + {{Text|<nowiki>".hpp"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        headername$ = x$ + {{Text|<nowiki>".hpp"</nowiki>|#FFB100}}
                                        {{Cl|IF}} customtypelibrary = {{Text|0|#F580B1}} {{Cl|THEN}} sfdeclare = {{Text|0|#F580B1}}
                                        sfheader = {{Text|1|#F580B1}}
                                        {{Cl|GOTO}} GotHeader
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/include/"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".h"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        headername$ = {{Text|<nowiki>"/usr/include/"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".h"</nowiki>|#FFB100}}
                                        {{Cl|IF}} customtypelibrary = {{Text|0|#F580B1}} {{Cl|THEN}} sfdeclare = {{Text|0|#F580B1}}
                                        sfheader = {{Text|1|#F580B1}}
                                        {{Cl|GOTO}} GotHeader
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/include/"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".hpp"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        headername$ = {{Text|<nowiki>"/usr/include/"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".hpp"</nowiki>|#FFB100}}
                                        {{Cl|IF}} customtypelibrary = {{Text|0|#F580B1}} {{Cl|THEN}} sfdeclare = {{Text|0|#F580B1}}
                                        sfheader = {{Text|1|#F580B1}}
                                        {{Cl|GOTO}} GotHeader
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'Linux</nowiki>|#919191}}
                                GotHeader:
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|ELSE}}
                            {{Text|<nowiki>'dynamic library</nowiki>|#919191}}
                            {{Cl|IF}} os$ = {{Text|<nowiki>"WIN"</nowiki>|#FFB100}} {{Cl|THEN}}
                                {{Text|<nowiki>'check for .dll (direct)</nowiki>|#919191}}
                                {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}(libpath$ + x$ + {{Text|<nowiki>".dll"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        libname$ = libpath$ + x$ + {{Text|<nowiki>".dll"</nowiki>|#FFB100}}
                                        inlinelibname$ = libpath_inline$ + x$ + {{Text|<nowiki>".dll"</nowiki>|#FFB100}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|<nowiki>'check for .dll (system32)</nowiki>|#919191}}
                                {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Cl|ENVIRON$}}({{Text|<nowiki>"SYSTEMROOT"</nowiki>|#FFB100}}) + {{Text|<nowiki>"\System32\"</nowiki>|#FFB100}} + libpath$ + x$ + {{Text|<nowiki>".dll"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        libname$ = libpath$ + x$ + {{Text|<nowiki>".dll"</nowiki>|#FFB100}}
                                        inlinelibname$ = libpath_inline$ + x$ + {{Text|<nowiki>".dll"</nowiki>|#FFB100}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|<nowiki>'--------------------------(without path)------------------------------</nowiki>|#919191}}
                                {{Text|<nowiki>'check for .dll (direct)</nowiki>|#919191}}
                                {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}(x$ + {{Text|<nowiki>".dll"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        libname$ = x$ + {{Text|<nowiki>".dll"</nowiki>|#FFB100}}
                                        inlinelibname$ = x$ + {{Text|<nowiki>".dll"</nowiki>|#FFB100}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|<nowiki>'check for .dll (system32)</nowiki>|#919191}}
                                {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Cl|ENVIRON$}}({{Text|<nowiki>"SYSTEMROOT"</nowiki>|#FFB100}}) + {{Text|<nowiki>"\System32\"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".dll"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        libname$ = x$ + {{Text|<nowiki>".dll"</nowiki>|#FFB100}}
                                        inlinelibname$ = x$ + {{Text|<nowiki>".dll"</nowiki>|#FFB100}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'Windows</nowiki>|#919191}}
                            {{Cl|IF}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Cl|THEN}}
                                {{Text|<nowiki>'Note: STATIC libraries (.a/.o) cannot be loaded as dynamic objects</nowiki>|#919191}}
                                {{Cl|IF}} MacOSX {{Cl|THEN}} {{Text|<nowiki>'dylib support</nowiki>|#919191}}
                                    {{Text|<nowiki>'check for .dylib (direct)</nowiki>|#919191}}
                                    {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                        {{Cl|IF}} {{Cl|_FILEEXISTS}}(libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>"."</nowiki>|#FFB100}} + libver$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                            libname$ = libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>"."</nowiki>|#FFB100}} + libver$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                            inlinelibname$ = libpath_inline$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>"."</nowiki>|#FFB100}} + libver$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                            {{Cl|IF}} {{Cl|LEFT$}}(libpath$, {{Text|1|#F580B1}}) <> {{Text|<nowiki>"/"</nowiki>|#FFB100}} {{Cl|THEN}} libname$ = {{Text|<nowiki>"./"</nowiki>|#FFB100}} + libname$: inlinelibname$ = {{Text|<nowiki>"./"</nowiki>|#FFB100}} + inlinelibname$
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                        {{Cl|IF}} {{Cl|_FILEEXISTS}}(libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                            libname$ = libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                            inlinelibname$ = libpath_inline$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                            {{Cl|IF}} {{Cl|LEFT$}}(libpath$, {{Text|1|#F580B1}}) <> {{Text|<nowiki>"/"</nowiki>|#FFB100}} {{Cl|THEN}} libname$ = {{Text|<nowiki>"./"</nowiki>|#FFB100}} + libname$: inlinelibname$ = {{Text|<nowiki>"./"</nowiki>|#FFB100}} + inlinelibname$
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|<nowiki>'check for .so (direct)</nowiki>|#919191}}
                                {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}(libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$) {{Cl|THEN}}
                                        libname$ = libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$
                                        inlinelibname$ = libpath_inline$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$
                                        {{Cl|IF}} {{Cl|LEFT$}}(libpath$, {{Text|1|#F580B1}}) <> {{Text|<nowiki>"/"</nowiki>|#FFB100}} {{Cl|THEN}} libname$ = {{Text|<nowiki>"./"</nowiki>|#FFB100}} + libname$: inlinelibname$ = {{Text|<nowiki>"./"</nowiki>|#FFB100}} + inlinelibname$
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}(libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        libname$ = libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}
                                        inlinelibname$ = libpath_inline$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}
                                        {{Cl|IF}} {{Cl|LEFT$}}(libpath$, {{Text|1|#F580B1}}) <> {{Text|<nowiki>"/"</nowiki>|#FFB100}} {{Cl|THEN}} libname$ = {{Text|<nowiki>"./"</nowiki>|#FFB100}} + libname$: inlinelibname$ = {{Text|<nowiki>"./"</nowiki>|#FFB100}} + inlinelibname$
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|<nowiki>'check for .so (usr/lib64)</nowiki>|#919191}}
                                {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/lib64/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$) {{Cl|THEN}}
                                        libname$ = {{Text|<nowiki>"/usr/lib64/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$
                                        inlinelibname$ = {{Text|<nowiki>"/usr/lib64/"</nowiki>|#FFB100}} + libpath_inline$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/lib64/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        libname$ = {{Text|<nowiki>"/usr/lib64/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}
                                        inlinelibname$ = {{Text|<nowiki>"/usr/lib64/"</nowiki>|#FFB100}} + libpath_inline$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Cl|IF}} MacOSX {{Cl|THEN}} {{Text|<nowiki>'dylib support</nowiki>|#919191}}
                                    {{Text|<nowiki>'check for .dylib (usr/lib)</nowiki>|#919191}}
                                    {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                        {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>"."</nowiki>|#FFB100}} + libver$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                            libname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>"."</nowiki>|#FFB100}} + libver$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                            inlinelibname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + libpath_inline$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>"."</nowiki>|#FFB100}} + libver$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                        {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                            libname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                            inlinelibname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + libpath_inline$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|<nowiki>'check for .so (usr/lib)</nowiki>|#919191}}
                                {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$) {{Cl|THEN}}
                                        libname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$
                                        inlinelibname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + libpath_inline$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        libname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + libpath$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}
                                        inlinelibname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + libpath_inline$ + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|<nowiki>'--------------------------(without path)------------------------------</nowiki>|#919191}}
                                {{Cl|IF}} MacOSX {{Cl|THEN}} {{Text|<nowiki>'dylib support</nowiki>|#919191}}
                                    {{Text|<nowiki>'check for .dylib (direct)</nowiki>|#919191}}
                                    {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                        {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>"."</nowiki>|#FFB100}} + libver$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                            libname$ = {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>"."</nowiki>|#FFB100}} + libver$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                            inlinelibname$ = {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>"."</nowiki>|#FFB100}} + libver$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                            libname$ = {{Text|<nowiki>"./"</nowiki>|#FFB100}} + libname$: inlinelibname$ = {{Text|<nowiki>"./"</nowiki>|#FFB100}} + inlinelibname$
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                        {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                            libname$ = {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                            inlinelibname$ = {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                            libname$ = {{Text|<nowiki>"./"</nowiki>|#FFB100}} + libname$: inlinelibname$ = {{Text|<nowiki>"./"</nowiki>|#FFB100}} + inlinelibname$
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|<nowiki>'check for .so (direct)</nowiki>|#919191}}
                                {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$) {{Cl|THEN}}
                                        libname$ = {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$
                                        inlinelibname$ = {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$
                                        libname$ = {{Text|<nowiki>"./"</nowiki>|#FFB100}} + libname$: inlinelibname$ = {{Text|<nowiki>"./"</nowiki>|#FFB100}} + inlinelibname$
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        libname$ = {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}
                                        inlinelibname$ = {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}
                                        libname$ = {{Text|<nowiki>"./"</nowiki>|#FFB100}} + libname$: inlinelibname$ = {{Text|<nowiki>"./"</nowiki>|#FFB100}} + inlinelibname$
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|<nowiki>'check for .so (usr/lib64)</nowiki>|#919191}}
                                {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/lib64/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$) {{Cl|THEN}}
                                        libname$ = {{Text|<nowiki>"/usr/lib64/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$
                                        inlinelibname$ = {{Text|<nowiki>"/usr/lib64/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/lib64/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        libname$ = {{Text|<nowiki>"/usr/lib64/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}
                                        inlinelibname$ = {{Text|<nowiki>"/usr/lib64/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Cl|IF}} MacOSX {{Cl|THEN}} {{Text|<nowiki>'dylib support</nowiki>|#919191}}
                                    {{Text|<nowiki>'check for .dylib (usr/lib)</nowiki>|#919191}}
                                    {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                        {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>"."</nowiki>|#FFB100}} + libver$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                            libname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>"."</nowiki>|#FFB100}} + libver$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                            inlinelibname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>"."</nowiki>|#FFB100}} + libver$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                        {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                            libname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                            inlinelibname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".dylib"</nowiki>|#FFB100}}
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|<nowiki>'check for .so (usr/lib)</nowiki>|#919191}}
                                {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$) {{Cl|THEN}}
                                        libname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$
                                        inlinelibname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so."</nowiki>|#FFB100}} + libver$
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|_FILEEXISTS}}({{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                        libname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}
                                        inlinelibname$ = {{Text|<nowiki>"/usr/lib/"</nowiki>|#FFB100}} + {{Text|<nowiki>"lib"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>".so"</nowiki>|#FFB100}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'Linux</nowiki>|#919191}}
                        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'Dynamic</nowiki>|#919191}}
                        {{Text|<nowiki>'library found?</nowiki>|#919191}}
                        {{Cl|IF}} dynamiclibrary <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"DYNAMIC LIBRARY not found"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                        {{Cl|IF}} {{Cl|LEN}}(libname$) = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|LEN}}(headername$) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"LIBRARY not found"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                        {{Text|<nowiki>'***actual method should cull redundant header and library entries***</nowiki>|#919191}}
                        {{Cl|IF}} dynamiclibrary = {{Text|0|#F580B1}} {{Cl|THEN}}
                            {{Text|<nowiki>'static</nowiki>|#919191}}
                            {{Cl|IF}} {{Cl|LEN}}(libname$) {{Cl|THEN}}
                                {{Cl|IF}} os$ = {{Text|<nowiki>"WIN"</nowiki>|#FFB100}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(libname$, {{Text|2|#F580B1}}, {{Text|1|#F580B1}}) = {{Text|<nowiki>":"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} {{Cl|LEFT$}}(libname$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"\"</nowiki>|#FFB100}} {{Cl|THEN}}
                                        mylib$ = mylib$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} + libname$ + {{Text|<nowiki>" "</nowiki>|#FFB100}}
                                    {{Cl|ELSE}}
                                        mylib$ = mylib$ + {{Text|<nowiki>" ..\..\"</nowiki>|#FFB100}} + libname$ + {{Text|<nowiki>" "</nowiki>|#FFB100}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Cl|IF}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|LEFT$}}(libname$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"/"</nowiki>|#FFB100}} {{Cl|THEN}}
                                        mylib$ = mylib$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} + libname$ + {{Text|<nowiki>" "</nowiki>|#FFB100}}
                                    {{Cl|ELSE}}
                                        mylib$ = mylib$ + {{Text|<nowiki>" ../../"</nowiki>|#FFB100}} + libname$ + {{Text|<nowiki>" "</nowiki>|#FFB100}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|ELSE}}
                            {{Text|<nowiki>'dynamic</nowiki>|#919191}}
                            {{Cl|IF}} {{Cl|LEN}}(headername$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'no header</nowiki>|#919191}}
                                {{Cl|IF}} subfuncn {{Cl|THEN}}
                                    f = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"A"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"maindata.txt"</nowiki>|#FFB100}})
                                {{Cl|ELSE}}
                                    f = DataTxtBuf
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|<nowiki>'make name a C-appropriate variable name</nowiki>|#919191}}
                                {{Text|<nowiki>'by converting everything except numbers and</nowiki>|#919191}}
                                {{Text|<nowiki>'letters to underscores</nowiki>|#919191}}
                                x2$ = x$
                                {{Cl|FOR}} x2 = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(x2$)
                                    {{Cl|IF}} {{Cl|ASC (function)|ASC}}(x2$, x2) < {{Text|48|#F580B1}} {{Cl|THEN}} {{Cl|ASC}}(x2$, x2) = {{Text|95|#F580B1}}
                                    {{Cl|IF}} {{Cl|ASC (function)|ASC}}(x2$, x2) > {{Text|57|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|ASC (function)|ASC}}(x2$, x2) < {{Text|65|#F580B1}} {{Cl|THEN}} {{Cl|ASC}}(x2$, x2) = {{Text|95|#F580B1}}
                                    {{Cl|IF}} {{Cl|ASC (function)|ASC}}(x2$, x2) > {{Text|90|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|ASC (function)|ASC}}(x2$, x2) < {{Text|97|#F580B1}} {{Cl|THEN}} {{Cl|ASC}}(x2$, x2) = {{Text|95|#F580B1}}
                                    {{Cl|IF}} {{Cl|ASC (function)|ASC}}(x2$, x2) > {{Text|122|#F580B1}} {{Cl|THEN}} {{Cl|ASC}}(x2$, x2) = {{Text|95|#F580B1}}
                                {{Cl|NEXT}}
                                DLLname$ = x2$
                                {{Cl|IF}} sfdeclare {{Cl|THEN}}
                                    {{Cl|IF}} os$ = {{Text|<nowiki>"WIN"</nowiki>|#FFB100}} {{Cl|THEN}}
                                        {{Text|WriteBufLine|#55FF55}} RegTxtBuf, {{Text|<nowiki>"HINSTANCE DLL_"</nowiki>|#FFB100}} + x2$ + {{Text|<nowiki>"=NULL;"</nowiki>|#FFB100}}
                                        {{Text|WriteBufLine|#55FF55}} f, {{Text|<nowiki>"if (!DLL_"</nowiki>|#FFB100}} + x2$ + {{Text|<nowiki>"){"</nowiki>|#FFB100}}
                                        {{Text|WriteBufLine|#55FF55}} f, {{Text|<nowiki>"DLL_"</nowiki>|#FFB100}} + x2$ + {{Text|<nowiki>"=LoadLibrary("</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + inlinelibname$ + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                                        {{Text|WriteBufLine|#55FF55}} f, {{Text|<nowiki>"if (!DLL_"</nowiki>|#FFB100}} + x2$ + {{Text|<nowiki>") error(259);"</nowiki>|#FFB100}}
                                        {{Text|WriteBufLine|#55FF55}} f, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Cl|IF}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Cl|THEN}}
                                        {{Text|WriteBufLine|#55FF55}} RegTxtBuf, {{Text|<nowiki>"void *DLL_"</nowiki>|#FFB100}} + x2$ + {{Text|<nowiki>"=NULL;"</nowiki>|#FFB100}}
                                        {{Text|WriteBufLine|#55FF55}} f, {{Text|<nowiki>"if (!DLL_"</nowiki>|#FFB100}} + x2$ + {{Text|<nowiki>"){"</nowiki>|#FFB100}}
                                        {{Text|WriteBufLine|#55FF55}} f, {{Text|<nowiki>"DLL_"</nowiki>|#FFB100}} + x2$ + {{Text|<nowiki>"=dlopen("</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + inlinelibname$ + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>",RTLD_LAZY);"</nowiki>|#FFB100}}
                                        {{Text|WriteBufLine|#55FF55}} f, {{Text|<nowiki>"if (!DLL_"</nowiki>|#FFB100}} + x2$ + {{Text|<nowiki>") error(259);"</nowiki>|#FFB100}}
                                        {{Text|WriteBufLine|#55FF55}} f, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'no header</nowiki>|#919191}}
                        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'dynamiclibrary</nowiki>|#919191}}
                        {{Cl|IF}} {{Cl|LEN}}(headername$) {{Cl|THEN}}
                            {{Cl|IF}} (os$ = {{Text|<nowiki>"WIN"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} ({{Cl|MID$ (function)|MID$}}(headername$, {{Text|2|#F580B1}}, {{Text|1|#F580B1}}) = {{Text|<nowiki>":"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} {{Cl|LEFT$}}(headername$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"\"</nowiki>|#FFB100}})) _
                            {{Cl|OR (boolean)|OR}} (os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} ({{Cl|LEFT$}}(headername$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"/"</nowiki>|#FFB100}})) {{Cl|THEN}}
                                {{Text|WriteBufLine|#55FF55}} RegTxtBuf, {{Text|<nowiki>"#include "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + headername$ + {{Cl|CHR$}}({{Text|34|#F580B1}})
                            {{Cl|ELSE}}
                                {{Text|WriteBufLine|#55FF55}} RegTxtBuf, {{Text|<nowiki>"#include "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"../../"</nowiki>|#FFB100}} + headername$ + {{Cl|CHR$}}({{Text|34|#F580B1}})
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                    l$ = l$ + sp + {{Cl|CHR$}}({{Text|34|#F580B1}}) + autoformat_x$ + {{Cl|CHR$}}({{Text|34|#F580B1}})
                    {{Cl|IF}} n > x {{Cl|THEN}}
                        {{Cl|IF}} dynamiclibrary {{Cl|THEN}} a$ = {{Text|<nowiki>"Cannot specify multiple DYNAMIC LIBRARY names in a single DECLARE statement"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                        x = x + {{Text|1|#F580B1}}: x2$ = {{Text|getelement$|#55FF55}}(a$, x): {{Cl|IF}} x2$ <> {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ,"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                        l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}}
                        x = x + {{Text|1|#F580B1}}: {{Cl|IF}} x > n {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected , ..."</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                        {{Cl|GOTO}} addlibrary
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'n>=x</nowiki>|#919191}}
                layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                {{Cl|GOTO}} finishednonexec
            {{Cl|END}} {{Cl|IF}}
            {{Cl|GOTO}} finishednonexec {{Text|<nowiki>'note: no layout required</nowiki>|#919191}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'begin SUB/FUNCTION</nowiki>|#919191}}
    {{Cl|IF}} n >= {{Text|1|#F580B1}} {{Cl|THEN}}
        dynamiclibrary = {{Text|0|#F580B1}}
        declaresubfunc2:
        sf = {{Text|0|#F580B1}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"FUNCTION"</nowiki>|#FFB100}} {{Cl|THEN}} sf = {{Text|1|#F580B1}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"SUB"</nowiki>|#FFB100}} {{Cl|THEN}} sf = {{Text|2|#F580B1}}
        {{Cl|IF}} sf {{Cl|THEN}}
            {{Cl|IF}} declaringlibrary = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} {{Cl|LEN}}(subfunc) {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected END SUB/FUNCTION before "</nowiki>|#FFB100}} + firstelement$: {{Cl|GOTO}} errmes
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected name after SUB/FUNCTION"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            e$ = {{Text|getelement$|#55FF55}}(ca$, {{Text|2|#F580B1}})
            symbol$ = {{Text|removesymbol$|#55FF55}}(e$) {{Text|<nowiki>'$,%,etc.</nowiki>|#919191}}
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Cl|IF}} sf = {{Text|2|#F580B1}} {{Cl|AND (boolean)|AND}} symbol$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Type symbols after a SUB name are invalid"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            try = {{Text|findid|#55FF55}}(e$)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Cl|DO}} {{Cl|WHILE}} try
                {{Cl|IF}} id.subfunc = sf {{Cl|THEN}} {{Cl|GOTO}} createsf
                {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(e$) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Cl|LOOP}}
            a$ = {{Text|<nowiki>"Unregistered SUB/FUNCTION encountered"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            createsf:
            {{Cl|IF}} {{Cl|UCASE$}}(e$) = {{Text|<nowiki>"_GL"</nowiki>|#FFB100}} {{Cl|THEN}} e$ = {{Text|<nowiki>"_GL"</nowiki>|#FFB100}}
            {{Cl|IF}} firstelement$ = {{Text|<nowiki>"SUB"</nowiki>|#FFB100}} {{Cl|THEN}}
                l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Sub"</nowiki>|#FFB100}}) + sp + e$ + symbol$
            {{Cl|ELSE}}
                l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Function"</nowiki>|#FFB100}}) + sp + e$ + symbol$
            {{Cl|END}} {{Cl|IF}}
            id2 = id
            targetid = currentid
            {{Text|<nowiki>'check for ALIAS</nowiki>|#919191}}
            aliasname$ = {{Cl|RTRIM$}}(id.cn)
            {{Cl|IF}} n > {{Text|2|#F580B1}} {{Cl|THEN}}
                ee$ = {{Text|getelement$|#55FF55}}(a$, {{Text|3|#F580B1}})
                {{Cl|IF}} ee$ = {{Text|<nowiki>"ALIAS"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} declaringlibrary = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"ALIAS can only be used with DECLARE LIBRARY"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    {{Cl|IF}} n = {{Text|3|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ALIAS name-in-library"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    ee$ = {{Text|getelement$|#55FF55}}(ca$, {{Text|4|#F580B1}})
                    {{Text|<nowiki>'strip string content (optional)</nowiki>|#919191}}
                    {{Cl|IF}} {{Cl|LEFT$}}(ee$, {{Text|1|#F580B1}}) = {{Cl|CHR$}}({{Text|34|#F580B1}}) {{Cl|THEN}}
                        ee$ = {{Cl|RIGHT$}}(ee$, {{Cl|LEN}}(ee$) - {{Text|1|#F580B1}})
                        x = {{Cl|INSTR}}(ee$, {{Cl|CHR$}}({{Text|34|#F580B1}})): {{Cl|IF}} x = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}): {{Cl|GOTO}} errmes
                        ee$ = {{Cl|LEFT$}}(ee$, x - {{Text|1|#F580B1}})
                        l$ = l$ + sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Alias"</nowiki>|#FFB100}}) + sp + CHR_QUOTE + ee$ + CHR_QUOTE
                    {{Cl|ELSE}}
                        l$ = l$ + sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Alias"</nowiki>|#FFB100}}) + sp + ee$
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|<nowiki>'strip fix046$ (created by unquoted periods)</nowiki>|#919191}}
                    {{Cl|DO}} {{Cl|WHILE}} {{Cl|INSTR}}(ee$, fix046$)
                        x = {{Cl|INSTR}}(ee$, fix046$): ee$ = {{Cl|LEFT$}}(ee$, x - {{Text|1|#F580B1}}) + {{Text|<nowiki>"."</nowiki>|#FFB100}} + {{Cl|RIGHT$}}(ee$, {{Cl|LEN}}(ee$) - x + {{Text|1|#F580B1}} - {{Cl|LEN}}(fix046$))
                    {{Cl|LOOP}}
                    aliasname$ = ee$
                    {{Text|<nowiki>'remove ALIAS section from line</nowiki>|#919191}}
                    {{Cl|IF}} n <= {{Text|4|#F580B1}} {{Cl|THEN}} a$ = {{Text|getelements|#55FF55}}(a$, {{Text|1|#F580B1}}, {{Text|2|#F580B1}})
                    {{Cl|IF}} n >= {{Text|5|#F580B1}} {{Cl|THEN}} a$ = {{Text|getelements|#55FF55}}(a$, {{Text|1|#F580B1}}, {{Text|2|#F580B1}}) + sp + {{Text|getelements|#55FF55}}(a$, {{Text|5|#F580B1}}, n)
                    {{Cl|IF}} n <= {{Text|4|#F580B1}} {{Cl|THEN}} ca$ = {{Text|getelements|#55FF55}}(ca$, {{Text|1|#F580B1}}, {{Text|2|#F580B1}})
                    {{Cl|IF}} n >= {{Text|5|#F580B1}} {{Cl|THEN}} ca$ = {{Text|getelements|#55FF55}}(ca$, {{Text|1|#F580B1}}, {{Text|2|#F580B1}}) + sp + {{Text|getelements|#55FF55}}(ca$, {{Text|5|#F580B1}}, n)
                    n = n - {{Text|2|#F580B1}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} declaringlibrary {{Cl|THEN}} {{Cl|GOTO}} declibjmp1
            {{Cl|IF}} closedmain = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|closemain|#55FF55}}
            {{Text|<nowiki>'check for open controls (copy #2)</nowiki>|#919191}}
            {{Cl|IF}} controllevel <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} controltype(controllevel) <> {{Text|6|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'It's OK for subs to be inside $IF blocks</nowiki>|#919191}}
                a$ = {{Text|<nowiki>"Unidentified open control block"</nowiki>|#FFB100}}
                {{Cl|SELECT}} {{Cl|CASE}} controltype(controllevel)
                    {{Cl|CASE}} {{Text|1|#F580B1}}: a$ = {{Text|<nowiki>"IF without END IF"</nowiki>|#FFB100}}
                    {{Cl|CASE}} {{Text|2|#F580B1}}: a$ = {{Text|<nowiki>"FOR without NEXT"</nowiki>|#FFB100}}
                    {{Cl|CASE}} {{Text|3|#F580B1}}, {{Text|4|#F580B1}}: a$ = {{Text|<nowiki>"DO without LOOP"</nowiki>|#FFB100}}
                    {{Cl|CASE}} {{Text|5|#F580B1}}: a$ = {{Text|<nowiki>"WHILE without WEND"</nowiki>|#FFB100}}
                    {{Cl|CASE}} {{Text|10|#F580B1}} {{Cl|TO}} {{Text|19|#F580B1}}: a$ = {{Text|<nowiki>"SELECT CASE without END SELECT"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|SELECT}}
                linenumber = controlref(controllevel)
                {{Cl|GOTO}} errmes
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} ideindentsubs {{Cl|THEN}}
                controllevel = controllevel + {{Text|1|#F580B1}}
                controltype(controllevel) = {{Text|32|#F580B1}}
                controlref(controllevel) = linenumber
            {{Cl|END}} {{Cl|IF}}
            subfunc = {{Cl|RTRIM$}}(id.callname) {{Text|<nowiki>'SUB_..."</nowiki>|#919191}}
            {{Cl|IF}} id.subfunc = {{Text|1|#F580B1}} {{Cl|THEN}} subfuncoriginalname$ = {{Text|<nowiki>"FUNCTION "</nowiki>|#FFB100}} {{Cl|ELSE}} subfuncoriginalname$ = {{Text|<nowiki>"SUB "</nowiki>|#FFB100}}
            subfuncoriginalname$ = subfuncoriginalname$ + {{Cl|RTRIM$}}(id.cn)
            subfuncn = subfuncn + {{Text|1|#F580B1}}
            closedsubfunc = {{Text|0|#F580B1}}
            subfuncid = targetid
            subfuncret$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            DataTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"data"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(subfuncn) + {{Text|<nowiki>".txt"</nowiki>|#FFB100}})
            FreeTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"free"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(subfuncn) + {{Text|<nowiki>".txt"</nowiki>|#FFB100}})
            RetTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"ret"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(subfuncn) + {{Text|<nowiki>".txt"</nowiki>|#FFB100}})
            defdatahandle = DataTxtBuf
            {{Text|WriteBufLine|#55FF55}} RetTxtBuf, {{Text|<nowiki>"if (next_return_point){"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} RetTxtBuf, {{Text|<nowiki>"next_return_point--;"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} RetTxtBuf, {{Text|<nowiki>"switch(return_point[next_return_point]){"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} RetTxtBuf, {{Text|<nowiki>"case 0:"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} RetTxtBuf, {{Text|<nowiki>"error(3);"</nowiki>|#FFB100}} {{Text|<nowiki>'return without gosub!</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} RetTxtBuf, {{Text|<nowiki>"break;"</nowiki>|#FFB100}}
            declibjmp1:
            {{Cl|IF}} declaringlibrary {{Cl|THEN}}
                {{Cl|IF}} sfdeclare = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} indirectlibrary = {{Text|0|#F580B1}} {{Cl|THEN}}
                    RegTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"regsf_ignore.txt"</nowiki>|#FFB100}})
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} sfdeclare = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} customtypelibrary = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} dynamiclibrary = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} indirectlibrary = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Text|WriteBufLine|#55FF55}} RegTxtBuf, {{Text|<nowiki>"#include "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"externtype"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(ResolveStaticFunctions + {{Text|1|#F580B1}}) + {{Text|<nowiki>".txt"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}})
                    fh = {{Cl|FREEFILE}}: {{Cl|OPEN}} tmpdir$ + {{Text|<nowiki>"externtype"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(ResolveStaticFunctions + {{Text|1|#F580B1}}) + {{Text|<nowiki>".txt"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|OUTPUT}} {{Cl|OPEN|AS}} #fh: {{Cl|CLOSE}} #fh
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} sf = {{Text|1|#F580B1}} {{Cl|THEN}}
                rettyp = id.ret
                t$ = {{Text|typ2ctyp$|#55FF55}}(id.ret, {{Text|<nowiki>""</nowiki>|#FFB100}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Cl|IF}} t$ = {{Text|<nowiki>"qbs"</nowiki>|#FFB100}} {{Cl|THEN}} t$ = {{Text|<nowiki>"qbs*"</nowiki>|#FFB100}}
                {{Cl|IF}} declaringlibrary {{Cl|THEN}}
                    {{Cl|IF}} rettyp {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                        t$ = {{Text|<nowiki>"char*"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} declaringlibrary <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} dynamiclibrary <> {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} os$ = {{Text|<nowiki>"WIN"</nowiki>|#FFB100}} {{Cl|THEN}}
                        {{Text|WriteBufRawData|#55FF55}} RegTxtBuf, {{Text|<nowiki>"typedef "</nowiki>|#FFB100}} + t$ + {{Text|<nowiki>" (CALLBACK* DLLCALL_"</nowiki>|#FFB100}} + {{Text|removecast$|#55FF55}}({{Cl|RTRIM$}}(id.callname)) + {{Text|<nowiki>")("</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Cl|THEN}}
                        {{Text|WriteBufRawData|#55FF55}} RegTxtBuf, {{Text|<nowiki>"typedef "</nowiki>|#FFB100}} + t$ + {{Text|<nowiki>" (*DLLCALL_"</nowiki>|#FFB100}} + {{Text|removecast$|#55FF55}}({{Cl|RTRIM$}}(id.callname)) + {{Text|<nowiki>")("</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|ELSEIF}} declaringlibrary <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} customtypelibrary <> {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Text|WriteBufRawData|#55FF55}} RegTxtBuf, {{Text|<nowiki>"typedef "</nowiki>|#FFB100}} + t$ + {{Text|<nowiki>" CUSTOMCALL_"</nowiki>|#FFB100}} + {{Text|removecast$|#55FF55}}({{Cl|RTRIM$}}(id.callname)) + {{Text|<nowiki>"("</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    {{Text|WriteBufRawData|#55FF55}} RegTxtBuf, t$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} + {{Text|removecast$|#55FF55}}({{Cl|RTRIM$}}(id.callname)) + {{Text|<nowiki>"("</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} declaringlibrary {{Cl|THEN}} {{Cl|GOTO}} declibjmp2
                {{Text|WriteBufRawData|#55FF55}} MainTxtBuf, t$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} + {{Text|removecast$|#55FF55}}({{Cl|RTRIM$}}(id.callname)) + {{Text|<nowiki>"("</nowiki>|#FFB100}}
                {{Text|<nowiki>'create variable to return result</nowiki>|#919191}}
                {{Text|<nowiki>'if type wasn't specified, define it</nowiki>|#919191}}
                {{Cl|IF}} symbol$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
                    a = {{Cl|ASC (function)|ASC}}({{Cl|UCASE$}}(e$)): {{Cl|IF}} a = {{Text|95|#F580B1}} {{Cl|THEN}} a = {{Text|91|#F580B1}}
                    a = a - {{Text|64|#F580B1}} {{Text|<nowiki>'so A=1, Z=27 and _=28</nowiki>|#919191}}
                    symbol$ = defineextaz(a)
                {{Cl|END}} {{Cl|IF}}
                reginternalvariable = {{Text|1|#F580B1}}
                ignore = {{Text|dim2|#55FF55}}(e$, symbol$, {{Text|0|#F580B1}}, {{Text|<nowiki>""</nowiki>|#FFB100}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                reginternalvariable = {{Text|0|#F580B1}}
                {{Text|<nowiki>'the following line stops the return variable from being free'd before being returned</nowiki>|#919191}}
                FreeTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"free"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(subfuncn) + {{Text|<nowiki>".txt"</nowiki>|#FFB100}})
                {{Text|<nowiki>'create return</nowiki>|#919191}}
                {{Cl|IF}} (rettyp {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}}
                    r$ = {{Text|refer$|#55FF55}}({{Text|str2$|#55FF55}}(currentid), id.t, {{Text|1|#F580B1}})
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    subfuncret$ = subfuncret$ + {{Text|<nowiki>"qbs_maketmp("</nowiki>|#FFB100}} + r$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                    subfuncret$ = subfuncret$ + {{Text|<nowiki>"return "</nowiki>|#FFB100}} + r$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    r$ = {{Text|refer$|#55FF55}}({{Text|str2$|#55FF55}}(currentid), id.t, {{Text|0|#F580B1}})
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    subfuncret$ = {{Text|<nowiki>"return "</nowiki>|#FFB100}} + r$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|ELSE}}
                {{Cl|IF}} declaringlibrary <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} dynamiclibrary <> {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} os$ = {{Text|<nowiki>"WIN"</nowiki>|#FFB100}} {{Cl|THEN}}
                        {{Text|WriteBufRawData|#55FF55}} RegTxtBuf, {{Text|<nowiki>"typedef void (CALLBACK* DLLCALL_"</nowiki>|#FFB100}} + {{Text|removecast$|#55FF55}}({{Cl|RTRIM$}}(id.callname)) + {{Text|<nowiki>")("</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Cl|THEN}}
                        {{Text|WriteBufRawData|#55FF55}} RegTxtBuf, {{Text|<nowiki>"typedef void (*DLLCALL_"</nowiki>|#FFB100}} + {{Text|removecast$|#55FF55}}({{Cl|RTRIM$}}(id.callname)) + {{Text|<nowiki>")("</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|ELSEIF}} declaringlibrary <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} customtypelibrary <> {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Text|WriteBufRawData|#55FF55}} RegTxtBuf, {{Text|<nowiki>"typedef void CUSTOMCALL_"</nowiki>|#FFB100}} + {{Text|removecast$|#55FF55}}({{Cl|RTRIM$}}(id.callname)) + {{Text|<nowiki>"("</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    {{Text|WriteBufRawData|#55FF55}} RegTxtBuf, {{Text|<nowiki>"void "</nowiki>|#FFB100}} + {{Text|removecast$|#55FF55}}({{Cl|RTRIM$}}(id.callname)) + {{Text|<nowiki>"("</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} declaringlibrary {{Cl|THEN}} {{Cl|GOTO}} declibjmp2
                {{Text|WriteBufRawData|#55FF55}} MainTxtBuf, {{Text|<nowiki>"void "</nowiki>|#FFB100}} + {{Text|removecast$|#55FF55}}({{Cl|RTRIM$}}(id.callname)) + {{Text|<nowiki>"("</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            declibjmp2:
            addstatic2layout = {{Text|0|#F580B1}}
            staticsf = {{Text|0|#F580B1}}
            e$ = {{Text|getelement$|#55FF55}}(a$, n)
            {{Cl|IF}} e$ = {{Text|<nowiki>"STATIC"</nowiki>|#FFB100}} {{Cl|THEN}}
                {{Cl|IF}} declaringlibrary {{Cl|THEN}} a$ = {{Text|<nowiki>"STATIC cannot be used in a library declaration"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                addstatic2layout = {{Text|1|#F580B1}}
                staticsf = {{Text|2|#F580B1}}
                a$ = {{Cl|LEFT$}}(a$, {{Cl|LEN}}(a$) - {{Text|7|#F580B1}}): n = n - {{Text|1|#F580B1}} {{Text|<nowiki>'remove STATIC</nowiki>|#919191}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'check items to pass</nowiki>|#919191}}
            params = {{Text|0|#F580B1}}
            AllowLocalName = {{Text|1|#F580B1}}
            {{Cl|IF}} n > {{Text|2|#F580B1}} {{Cl|THEN}}
                e$ = {{Text|getelement$|#55FF55}}(a$, {{Text|3|#F580B1}})
                {{Cl|IF}} e$ <> {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ("</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                e$ = {{Text|getelement$|#55FF55}}(a$, n)
                {{Cl|IF}} e$ <> {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected )"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                l$ = l$ + sp + {{Text|<nowiki>"("</nowiki>|#FFB100}}
                {{Cl|IF}} n = {{Text|4|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} nosfparams2
                {{Cl|IF}} n < {{Text|4|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ( ... )"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                B = {{Text|0|#F580B1}}
                a2$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                {{Cl|FOR}} i = {{Text|4|#F580B1}} {{Cl|TO}} n - {{Text|1|#F580B1}}
                    e$ = {{Text|getelement$|#55FF55}}(ca$, i)
                    {{Cl|IF}} e$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} B = B + {{Text|1|#F580B1}}
                    {{Cl|IF}} e$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} B = B - {{Text|1|#F580B1}}
                    {{Cl|IF}} e$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} B = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} i = n - {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected , ... )"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                        getlastparam2:
                        {{Cl|IF}} a2$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ... ,"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                        a2$ = {{Cl|LEFT$}}(a2$, {{Cl|LEN}}(a2$) - {{Text|1|#F580B1}})
                        {{Text|<nowiki>'possible format: [BYVAL]a[%][(1)][AS][type]</nowiki>|#919191}}
                        params = params + {{Text|1|#F580B1}}
                        glinkid = targetid
                        glinkarg = params
                        {{Cl|IF}} params > {{Text|1|#F580B1}} {{Cl|THEN}}
                            {{Text|WriteBufRawData|#55FF55}} RegTxtBuf, {{Text|<nowiki>","</nowiki>|#FFB100}}
                            {{Cl|IF}} declaringlibrary = {{Text|0|#F580B1}} {{Cl|THEN}}
                                {{Text|WriteBufRawData|#55FF55}} MainTxtBuf, {{Text|<nowiki>","</nowiki>|#FFB100}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                        n2 = {{Text|numelements|#55FF55}}(a2$)
                        array = {{Text|0|#F580B1}}
                        t2$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                        e$ = {{Text|getelement$|#55FF55}}(a2$, {{Text|1|#F580B1}})
                        byvalue = {{Text|0|#F580B1}}
                        {{Cl|IF}} {{Cl|UCASE$}}(e$) = {{Text|<nowiki>"BYVAL"</nowiki>|#FFB100}} {{Cl|THEN}}
                            {{Cl|IF}} declaringlibrary = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"BYVAL can only be used with DECLARE LIBRARY"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                            byvalue = {{Text|1|#F580B1}}: a2$ = {{Cl|RIGHT$}}(a2$, {{Cl|LEN}}(a2$) - {{Text|6|#F580B1}})
                            {{Cl|IF}} {{Cl|RIGHT$}}(l$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} l$ = l$ + sp2 + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"ByVal"</nowiki>|#FFB100}}) {{Cl|ELSE}} l$ = l$ + sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Byval"</nowiki>|#FFB100}})
                            n2 = {{Text|numelements|#55FF55}}(a2$): e$ = {{Text|getelement$|#55FF55}}(a2$, {{Text|1|#F580B1}})
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} {{Cl|RIGHT$}}(l$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} l$ = l$ + sp2 + e$ {{Cl|ELSE}} l$ = l$ + sp + e$
                        n2$ = e$
                        dimmethod = {{Text|0|#F580B1}}
                        symbol2$ = {{Text|removesymbol$|#55FF55}}(n2$)
                        {{Cl|IF}} {{Text|validname|#55FF55}}(n2$) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid name"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                        {{Cl|IF}} symbol2$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} dimmethod = {{Text|1|#F580B1}}
                        m = {{Text|0|#F580B1}}
                        {{Cl|FOR}} i2 = {{Text|2|#F580B1}} {{Cl|TO}} n2
                            e$ = {{Text|getelement$|#55FF55}}(a2$, i2)
                            {{Cl|IF}} e$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}}
                                {{Cl|IF}} m <> {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Syntax error - too many opening brackets"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                m = {{Text|1|#F580B1}}
                                array = {{Text|1|#F580B1}}
                                l$ = l$ + sp2 + {{Text|<nowiki>"("</nowiki>|#FFB100}}
                                {{Cl|GOTO}} gotaa2
                            {{Cl|END}} {{Cl|IF}}
                            {{Cl|IF}} e$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}}
                                {{Cl|IF}} m <> {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Syntax error - closing bracket without opening bracket"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                m = {{Text|2|#F580B1}}
                                l$ = l$ + sp2 + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                                {{Cl|GOTO}} gotaa2
                            {{Cl|END}} {{Cl|IF}}
                            {{Cl|IF}} {{Cl|UCASE$}}(e$) = {{Text|<nowiki>"AS"</nowiki>|#FFB100}} {{Cl|THEN}}
                                {{Cl|IF}} m <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} m <> {{Text|2|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Syntax error - check your brackets"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                m = {{Text|3|#F580B1}}
                                l$ = l$ + sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"As"</nowiki>|#FFB100}})
                                {{Cl|GOTO}} gotaa2
                            {{Cl|END}} {{Cl|IF}}
                            {{Cl|IF}} m = {{Text|1|#F580B1}} {{Cl|THEN}} l$ = l$ + sp + e$: {{Cl|GOTO}} gotaa2 {{Text|<nowiki>'ignore contents of option bracket telling how many dimensions (add to layout as is)</nowiki>|#919191}}
                            {{Cl|IF}} m <> {{Text|3|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Syntax error - check your brackets"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                            {{Cl|IF}} t2$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} t2$ = e$ {{Cl|ELSE}} t2$ = t2$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} + e$
                            gotaa2:
                        {{Cl|NEXT}} i2
                        {{Cl|IF}} m = {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Syntax error - check your brackets"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                        {{Cl|IF}} symbol2$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} t2$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Syntax error - check parameter types"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                        {{Cl|IF}} {{Cl|LEN}}(t2$) {{Cl|THEN}} {{Text|<nowiki>'add type-name after AS</nowiki>|#919191}}
                            t2$ = {{Cl|UCASE$}}(t2$)
                            t3$ = t2$
                            typ = {{Text|typname2typ|#55FF55}}(t3$)
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Cl|IF}} typ = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Undefined type"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                            {{Cl|IF}} typ {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
                                {{Cl|IF}} {{Cl|RTRIM$}}(udtxcname(typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}})) = {{Text|<nowiki>"_MEM"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} {{Cl|UCASE$}}(t3$) = {{Text|<nowiki>"MEM"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|THEN}}
                                    t3$ = {{Cl|MID$ (function)|MID$}}({{Cl|RTRIM$}}(udtxcname(typ {{Cl|AND}} {{Text|511|#F580B1}})), {{Text|2|#F580B1}})
                                {{Cl|ELSE}}
                                    t3$ = {{Cl|RTRIM$}}(udtxcname(typ {{Cl|AND}} {{Text|511|#F580B1}}))
                                {{Cl|END}} {{Cl|IF}}
                                l$ = l$ + sp + t3$
                            {{Cl|ELSE}}
                                {{Cl|FOR}} t3i = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(t3$)
                                    {{Cl|IF}} {{Cl|ASC (function)|ASC}}(t3$, t3i) = {{Text|32|#F580B1}} {{Cl|THEN}} {{Cl|ASC}}(t3$, t3i) = {{Cl|ASC (function)|ASC}}(sp)
                                {{Cl|NEXT}}
                                t3$ = {{Text|SCase2$|#55FF55}}(t3$)
                                l$ = l$ + sp + t3$
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} t2$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} t2$ = symbol2$
                        {{Cl|IF}} t2$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
                            {{Cl|IF}} {{Cl|LEFT$}}(n2$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"_"</nowiki>|#FFB100}} {{Cl|THEN}} v = {{Text|27|#F580B1}} {{Cl|ELSE}} v = {{Cl|ASC (function)|ASC}}({{Cl|UCASE$}}(n2$)) - {{Text|64|#F580B1}}
                            t2$ = defineaz(v)
                            dimmethod = {{Text|1|#F580B1}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} array = {{Text|1|#F580B1}} {{Cl|THEN}}
                            {{Cl|IF}} declaringlibrary {{Cl|THEN}} a$ = {{Text|<nowiki>"Arrays cannot be passed to a library"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                            dimsfarray = {{Text|1|#F580B1}}
                            {{Text|<nowiki>'note: id2.nele is currently 0</nowiki>|#919191}}
                            nelereq = {{Cl|ASC (function)|ASC}}({{Cl|MID$ (function)|MID$}}(id2.nelereq, params, {{Text|1|#F580B1}}))
                            {{Cl|IF}} nelereq {{Cl|THEN}}
                                nele = nelereq
                                {{Cl|MID$}}(id2.nele, params, {{Text|1|#F580B1}}) = {{Cl|CHR$}}(nele)
                                ids(targetid) = id2
                                ignore = {{Text|dim2|#55FF55}}(n2$, t2$, dimmethod, {{Text|str2$|#55FF55}}(nele))
                                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Cl|ELSE}}
                                nele = {{Text|1|#F580B1}}
                                {{Cl|MID$}}(id2.nele, params, {{Text|1|#F580B1}}) = {{Cl|CHR$}}(nele)
                                ids(targetid) = id2
                                ignore = {{Text|dim2|#55FF55}}(n2$, t2$, dimmethod, {{Text|<nowiki>"?"</nowiki>|#FFB100}})
                                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Cl|END}} {{Cl|IF}}
                            dimsfarray = {{Text|0|#F580B1}}
                            r$ = {{Text|refer$|#55FF55}}({{Text|str2$|#55FF55}}(currentid), id.t, {{Text|1|#F580B1}})
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Text|WriteBufRawData|#55FF55}} RegTxtBuf, {{Text|<nowiki>"ptrszint*"</nowiki>|#FFB100}} + r$
                            {{Text|WriteBufRawData|#55FF55}} MainTxtBuf, {{Text|<nowiki>"ptrszint*"</nowiki>|#FFB100}} + r$
                        {{Cl|ELSE}}
                            {{Cl|IF}} declaringlibrary {{Cl|THEN}}
                                {{Text|<nowiki>'is it a udt?</nowiki>|#919191}}
                                {{Cl|FOR}} xx = {{Text|1|#F580B1}} {{Cl|TO}} lasttype
                                    {{Cl|IF}} t2$ = {{Cl|RTRIM$}}(udtxname(xx)) {{Cl|THEN}}
                                        {{Text|WriteBufLine|#55FF55}} RegTxtBuf, {{Text|<nowiki>"void*"</nowiki>|#FFB100}}
                                        {{Cl|GOTO}} decudt
                                    {{Cl|ELSEIF}} {{Cl|RTRIM$}}(udtxname(xx)) = {{Text|<nowiki>"_MEM"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} t2$ = {{Text|<nowiki>"MEM"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|THEN}}
                                        {{Text|WriteBufLine|#55FF55}} RegTxtBuf, {{Text|<nowiki>"void*"</nowiki>|#FFB100}}
                                        {{Cl|GOTO}} decudt
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|NEXT}}
                                t$ = {{Text|typ2ctyp$|#55FF55}}({{Text|0|#F580B1}}, t2$)
                                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                {{Cl|IF}} t$ = {{Text|<nowiki>"qbs"</nowiki>|#FFB100}} {{Cl|THEN}}
                                    t$ = {{Text|<nowiki>"char*"</nowiki>|#FFB100}}
                                    {{Cl|IF}} byvalue = {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"STRINGs cannot be passed using BYVAL"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                    byvalue = {{Text|1|#F580B1}} {{Text|<nowiki>'use t$ as is</nowiki>|#919191}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Cl|IF}} byvalue {{Cl|THEN}} {{Text|WriteBufRawData|#55FF55}} RegTxtBuf, t$ {{Cl|ELSE}} {{Text|WriteBufRawData|#55FF55}} RegTxtBuf, t$ + {{Text|<nowiki>"*"</nowiki>|#FFB100}}
                                decudt:
                                {{Cl|GOTO}} declibjmp3
                            {{Cl|END}} {{Cl|IF}}
                            dimsfarray = {{Text|1|#F580B1}}
                            ignore = {{Text|dim2|#55FF55}}(n2$, t2$, dimmethod, {{Text|<nowiki>""</nowiki>|#FFB100}})
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            dimsfarray = {{Text|0|#F580B1}}
                            t$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                            typ = id.t {{Text|<nowiki>'the typ of the ID created by dim2</nowiki>|#919191}}
                            t$ = {{Text|typ2ctyp$|#55FF55}}(typ, {{Text|<nowiki>""</nowiki>|#FFB100}})
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Cl|IF}} t$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Cannot find C type to return array data"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                            {{Text|<nowiki>'searchpoint</nowiki>|#919191}}
                            {{Text|<nowiki>'get the name of the variable</nowiki>|#919191}}
                            r$ = {{Text|refer$|#55FF55}}({{Text|str2$|#55FF55}}(currentid), id.t, {{Text|1|#F580B1}})
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Text|WriteBufRawData|#55FF55}} RegTxtBuf, t$ + {{Text|<nowiki>"*"</nowiki>|#FFB100}} + r$
                            {{Text|WriteBufRawData|#55FF55}} MainTxtBuf, t$ + {{Text|<nowiki>"*"</nowiki>|#FFB100}} + r$
                            {{Cl|IF}} t$ = {{Text|<nowiki>"qbs"</nowiki>|#FFB100}} {{Cl|THEN}}
                                u$ = {{Text|str2$|#55FF55}}({{Text|uniquenumber|#55FF55}})
                                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"qbs*oldstr"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>"=NULL;"</nowiki>|#FFB100}}
                                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if("</nowiki>|#FFB100}} + r$ + {{Text|<nowiki>"->tmp||"</nowiki>|#FFB100}} + r$ + {{Text|<nowiki>"->fixed||"</nowiki>|#FFB100}} + r$ + {{Text|<nowiki>"->readonly){"</nowiki>|#FFB100}}
                                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"oldstr"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>"="</nowiki>|#FFB100}} + r$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if (oldstr"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>"->cmem_descriptor){"</nowiki>|#FFB100}}
                                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, r$ + {{Text|<nowiki>"=qbs_new_cmem(oldstr"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>"->len,0);"</nowiki>|#FFB100}}
                                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"}else{"</nowiki>|#FFB100}}
                                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, r$ + {{Text|<nowiki>"=qbs_new(oldstr"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>"->len,0);"</nowiki>|#FFB100}}
                                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"memcpy("</nowiki>|#FFB100}} + r$ + {{Text|<nowiki>"->chr,oldstr"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>"->chr,oldstr"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>"->len);"</nowiki>|#FFB100}}
                                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                                {{Text|WriteBufLine|#55FF55}} FreeTxtBuf, {{Text|<nowiki>"if(oldstr"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>"){"</nowiki>|#FFB100}}
                                {{Text|WriteBufLine|#55FF55}} FreeTxtBuf, {{Text|<nowiki>"if(oldstr"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>"->fixed)qbs_set(oldstr"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + r$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                                {{Text|WriteBufLine|#55FF55}} FreeTxtBuf, {{Text|<nowiki>"qbs_free("</nowiki>|#FFB100}} + r$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                                {{Text|WriteBufLine|#55FF55}} FreeTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                        declibjmp3:
                        {{Cl|IF}} i <> n - {{Text|1|#F580B1}} {{Cl|THEN}} l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}}
                        a2$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    {{Cl|ELSE}}
                        a2$ = a2$ + e$ + sp
                        {{Cl|IF}} i = n - {{Text|1|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} getlastparam2
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|NEXT}} i
                nosfparams2:
                l$ = l$ + sp2 + {{Text|<nowiki>")"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'n>2</nowiki>|#919191}}
            AllowLocalName = {{Text|0|#F580B1}}
            {{Cl|IF}} addstatic2layout {{Cl|THEN}} l$ = l$ + sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Static"</nowiki>|#FFB100}})
            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
            {{Text|WriteBufLine|#55FF55}} RegTxtBuf, {{Text|<nowiki>");"</nowiki>|#FFB100}}
            {{Cl|IF}} declaringlibrary {{Cl|THEN}} {{Cl|GOTO}} declibjmp4
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"){"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs *tqbs;"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"ptrszint tmp_long;"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"int32 tmp_fileno;"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"uint32 qbs_tmp_base=qbs_tmp_list_nexti;"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"uint8 *tmp_mem_static_pointer=mem_static_pointer;"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"uint32 tmp_cmem_sp=cmem_sp;"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"#include "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"data"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(subfuncn) + {{Text|<nowiki>".txt"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}})
            {{Text|<nowiki>'create new _MEM lock for this scope</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"mem_lock *sf_mem_lock;"</nowiki>|#FFB100}} {{Text|<nowiki>'MUST not be static for recursion reasons</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"new_mem_lock();"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sf_mem_lock=mem_lock_tmp;"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sf_mem_lock->type=3;"</nowiki>|#FFB100}}
            {{Cl|IF}} vWatchOn = {{Text|1|#F580B1}} {{Cl|THEN}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*__LONG_VWATCH_SUBLEVEL=*__LONG_VWATCH_SUBLEVEL+ 1 ;"</nowiki>|#FFB100}}
                {{Cl|IF}} subfunc <> {{Text|<nowiki>"SUB_VWATCH"</nowiki>|#FFB100}} {{Cl|THEN}}
                    inclinenump$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    {{Cl|IF}} inclinenumber(inclevel) {{Cl|THEN}}
                        thisincname$ = {{Text|getfilepath$|#55FF55}}(incname$(inclevel))
                        thisincname$ = {{Cl|MID$ (function)|MID$}}(incname$(inclevel), {{Cl|LEN}}(thisincname$) + {{Text|1|#F580B1}})
                        inclinenump$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} + thisincname$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Cl|STR$}}(inclinenumber(inclevel)) + {{Text|<nowiki>") "</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_set(__STRING_VWATCH_SUBNAME,qbs_new_txt_len("</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + inclinenump$ + subfuncoriginalname$ + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}({{Cl|LEN}}(inclinenump$ + subfuncoriginalname$)) + {{Text|<nowiki>"));"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_cleanup(qbs_tmp_base,0);"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_set(__STRING_VWATCH_INTERNALSUBNAME,qbs_new_txt_len("</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + subfunc + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}({{Cl|LEN}}(subfunc)) + {{Text|<nowiki>"));"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_cleanup(qbs_tmp_base,0);"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*__LONG_VWATCH_LINENUMBER=-2; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (new_error) goto exit_subfunc;"</nowiki>|#FFB100}}
            {{Text|<nowiki>'statementn = statementn + 1</nowiki>|#919191}}
            {{Text|<nowiki>'if nochecks=0 then WriteBufLine MainTxtBuf, "S_" + str2$(statementn) + ":;"</nowiki>|#919191}}
            dimstatic = staticsf
            declibjmp4:
            {{Cl|IF}} declaringlibrary {{Cl|THEN}}
                {{Cl|IF}} customtypelibrary {{Cl|THEN}}
                    callname$ = {{Text|removecast$|#55FF55}}({{Cl|RTRIM$}}(id2.callname))
                    {{Text|WriteBufLine|#55FF55}} RegTxtBuf, {{Text|<nowiki>"CUSTOMCALL_"</nowiki>|#FFB100}} + callname$ + {{Text|<nowiki>" *"</nowiki>|#FFB100}} + callname$ + {{Text|<nowiki>"=NULL;"</nowiki>|#FFB100}}
                    {{Cl|IF}} subfuncn {{Cl|THEN}}
                        f = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"A"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"maindata.txt"</nowiki>|#FFB100}})
                    {{Cl|ELSE}}
                        f = DataTxtBuf
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|WriteBufLine|#55FF55}} f, callname$ + {{Text|<nowiki>"=(CUSTOMCALL_"</nowiki>|#FFB100}} + callname$ + {{Text|<nowiki>"*)&"</nowiki>|#FFB100}} + aliasname$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                    {{Text|<nowiki>'if no header exists to make the external function available, the function definition must be found</nowiki>|#919191}}
                    {{Cl|IF}} sfheader = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} sfdeclare <> {{Text|0|#F580B1}} {{Cl|THEN}}
                        ResolveStaticFunctions = ResolveStaticFunctions + {{Text|1|#F580B1}}
                        {{Text|<nowiki>'expand array if necessary</nowiki>|#919191}}
                        {{Cl|IF}} ResolveStaticFunctions > {{Cl|UBOUND}}(ResolveStaticFunction_Name) {{Cl|THEN}}
                            {{Cl|REDIM}} {{Cl|_PRESERVE}} ResolveStaticFunction_Name({{Text|1|#F580B1}} {{Cl|TO}} ResolveStaticFunctions + {{Text|100|#F580B1}}) {{Cl|AS}} {{Cl|STRING}}
                            {{Cl|REDIM}} {{Cl|_PRESERVE}} ResolveStaticFunction_File({{Text|1|#F580B1}} {{Cl|TO}} ResolveStaticFunctions + {{Text|100|#F580B1}}) {{Cl|AS}} {{Cl|STRING}}
                            {{Cl|REDIM}} {{Cl|_PRESERVE}} ResolveStaticFunction_Method({{Text|1|#F580B1}} {{Cl|TO}} ResolveStaticFunctions + {{Text|100|#F580B1}}) {{Cl|AS}} {{Cl|LONG}}
                        {{Cl|END}} {{Cl|IF}}
                        ResolveStaticFunction_File(ResolveStaticFunctions) = libname$
                        ResolveStaticFunction_Name(ResolveStaticFunctions) = aliasname$
                        ResolveStaticFunction_Method(ResolveStaticFunctions) = {{Text|1|#F580B1}}
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'sfheader=0</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} dynamiclibrary {{Cl|THEN}}
                    {{Cl|IF}} sfdeclare {{Cl|THEN}}
                        {{Text|WriteBufLine|#55FF55}} RegTxtBuf, {{Text|<nowiki>"DLLCALL_"</nowiki>|#FFB100}} + {{Text|removecast$|#55FF55}}({{Cl|RTRIM$}}(id2.callname)) + {{Text|<nowiki>" "</nowiki>|#FFB100}} + {{Text|removecast$|#55FF55}}({{Cl|RTRIM$}}(id2.callname)) + {{Text|<nowiki>"=NULL;"</nowiki>|#FFB100}}
                        {{Cl|IF}} subfuncn {{Cl|THEN}}
                            f = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"A"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"maindata.txt"</nowiki>|#FFB100}})
                        {{Cl|ELSE}}
                            f = DataTxtBuf
                        {{Cl|END}} {{Cl|IF}}
                        {{Text|WriteBufLine|#55FF55}} f, {{Text|<nowiki>"if (!"</nowiki>|#FFB100}} + {{Text|removecast$|#55FF55}}({{Cl|RTRIM$}}(id2.callname)) + {{Text|<nowiki>"){"</nowiki>|#FFB100}}
                        {{Cl|IF}} os$ = {{Text|<nowiki>"WIN"</nowiki>|#FFB100}} {{Cl|THEN}}
                            {{Text|WriteBufLine|#55FF55}} f, {{Text|removecast$|#55FF55}}({{Cl|RTRIM$}}(id2.callname)) + {{Text|<nowiki>"=(DLLCALL_"</nowiki>|#FFB100}} + {{Text|removecast$|#55FF55}}({{Cl|RTRIM$}}(id2.callname)) + {{Text|<nowiki>")GetProcAddress(DLL_"</nowiki>|#FFB100}} + DLLname$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + aliasname$ + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                            {{Text|WriteBufLine|#55FF55}} f, {{Text|<nowiki>"if (!"</nowiki>|#FFB100}} + {{Text|removecast$|#55FF55}}({{Cl|RTRIM$}}(id2.callname)) + {{Text|<nowiki>") error(260);"</nowiki>|#FFB100}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Cl|THEN}}
                            {{Text|WriteBufLine|#55FF55}} f, {{Text|removecast$|#55FF55}}({{Cl|RTRIM$}}(id2.callname)) + {{Text|<nowiki>"=(DLLCALL_"</nowiki>|#FFB100}} + {{Text|removecast$|#55FF55}}({{Cl|RTRIM$}}(id2.callname)) + {{Text|<nowiki>")dlsym(DLL_"</nowiki>|#FFB100}} + DLLname$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + aliasname$ + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                            {{Text|WriteBufLine|#55FF55}} f, {{Text|<nowiki>"if (dlerror()) error(260);"</nowiki>|#FFB100}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Text|WriteBufLine|#55FF55}} f, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'sfdeclare</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'dynamic</nowiki>|#919191}}
                {{Cl|IF}} sfdeclare = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} customtypelibrary = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} dynamiclibrary = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} indirectlibrary = {{Text|0|#F580B1}} {{Cl|THEN}}
                    ResolveStaticFunctions = ResolveStaticFunctions + {{Text|1|#F580B1}}
                    {{Text|<nowiki>'expand array if necessary</nowiki>|#919191}}
                    {{Cl|IF}} ResolveStaticFunctions > {{Cl|UBOUND}}(ResolveStaticFunction_Name) {{Cl|THEN}}
                        {{Cl|REDIM}} {{Cl|_PRESERVE}} ResolveStaticFunction_Name({{Text|1|#F580B1}} {{Cl|TO}} ResolveStaticFunctions + {{Text|100|#F580B1}}) {{Cl|AS}} {{Cl|STRING}}
                        {{Cl|REDIM}} {{Cl|_PRESERVE}} ResolveStaticFunction_File({{Text|1|#F580B1}} {{Cl|TO}} ResolveStaticFunctions + {{Text|100|#F580B1}}) {{Cl|AS}} {{Cl|STRING}}
                        {{Cl|REDIM}} {{Cl|_PRESERVE}} ResolveStaticFunction_Method({{Text|1|#F580B1}} {{Cl|TO}} ResolveStaticFunctions + {{Text|100|#F580B1}}) {{Cl|AS}} {{Cl|LONG}}
                    {{Cl|END}} {{Cl|IF}}
                    ResolveStaticFunction_File(ResolveStaticFunctions) = libname$
                    ResolveStaticFunction_Name(ResolveStaticFunctions) = aliasname$
                    ResolveStaticFunction_Method(ResolveStaticFunctions) = {{Text|2|#F580B1}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} sfdeclare = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} indirectlibrary = {{Text|0|#F580B1}} {{Cl|THEN}}
                    RegTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"A"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"regsf.txt"</nowiki>|#FFB100}})
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'declaring library</nowiki>|#919191}}
            {{Cl|GOTO}} finishednonexec
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'END SUB/FUNCTION</nowiki>|#919191}}
    {{Cl|IF}} n = {{Text|2|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"END"</nowiki>|#FFB100}} {{Cl|THEN}}
            sf = {{Text|0|#F580B1}}
            {{Cl|IF}} secondelement$ = {{Text|<nowiki>"FUNCTION"</nowiki>|#FFB100}} {{Cl|THEN}} sf = {{Text|1|#F580B1}}
            {{Cl|IF}} secondelement$ = {{Text|<nowiki>"SUB"</nowiki>|#FFB100}} {{Cl|THEN}} sf = {{Text|2|#F580B1}}
            {{Cl|IF}} sf {{Cl|THEN}}
                {{Cl|IF}} {{Cl|LEN}}(subfunc) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"END "</nowiki>|#FFB100}} + secondelement$ + {{Text|<nowiki>" without "</nowiki>|#FFB100}} + secondelement$: {{Cl|GOTO}} errmes
                {{Text|<nowiki>'check for open controls (copy #3)</nowiki>|#919191}}
                {{Cl|IF}} controllevel <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} controltype(controllevel) <> {{Text|6|#F580B1}} {{Cl|AND (boolean)|AND}} controltype(controllevel) <> {{Text|32|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'It's OK for subs to be inside $IF blocks</nowiki>|#919191}}
                    a$ = {{Text|<nowiki>"Unidentified open control block"</nowiki>|#FFB100}}
                    {{Cl|SELECT}} {{Cl|CASE}} controltype(controllevel)
                        {{Cl|CASE}} {{Text|1|#F580B1}}: a$ = {{Text|<nowiki>"IF without END IF"</nowiki>|#FFB100}}
                        {{Cl|CASE}} {{Text|2|#F580B1}}: a$ = {{Text|<nowiki>"FOR without NEXT"</nowiki>|#FFB100}}
                        {{Cl|CASE}} {{Text|3|#F580B1}}, {{Text|4|#F580B1}}: a$ = {{Text|<nowiki>"DO without LOOP"</nowiki>|#FFB100}}
                        {{Cl|CASE}} {{Text|5|#F580B1}}: a$ = {{Text|<nowiki>"WHILE without WEND"</nowiki>|#FFB100}}
                        {{Cl|CASE}} {{Text|10|#F580B1}} {{Cl|TO}} {{Text|19|#F580B1}}: a$ = {{Text|<nowiki>"SELECT CASE without END SELECT"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|SELECT}}
                    linenumber = controlref(controllevel)
                    {{Cl|GOTO}} errmes
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} controltype(controllevel) = {{Text|32|#F580B1}} {{Cl|AND (boolean)|AND}} ideindentsubs {{Cl|THEN}}
                    controltype(controllevel) = {{Text|0|#F580B1}}
                    controllevel = controllevel - {{Text|1|#F580B1}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} {{Cl|LEFT$}}(subfunc, {{Text|4|#F580B1}}) = {{Text|<nowiki>"SUB_"</nowiki>|#FFB100}} {{Cl|THEN}} secondelement$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Sub"</nowiki>|#FFB100}}) {{Cl|ELSE}} secondelement$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Function"</nowiki>|#FFB100}})
                l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"End"</nowiki>|#FFB100}}) + sp + secondelement$
                layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                {{Cl|IF}} vWatchOn = {{Text|1|#F580B1}} {{Cl|THEN}}
                    {{Text|vWatchVariable|#55FF55}} {{Text|<nowiki>""</nowiki>|#FFB100}}, {{Text|1|#F580B1}}
                {{Cl|END}} {{Cl|IF}}
                staticarraylist = {{Text|<nowiki>""</nowiki>|#FFB100}}: staticarraylistn = {{Text|0|#F580B1}} {{Text|<nowiki>'remove previously listed arrays</nowiki>|#919191}}
                dimstatic = {{Text|0|#F580B1}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"exit_subfunc:;"</nowiki>|#FFB100}}
                {{Cl|IF}} vWatchOn = {{Text|1|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} NoChecks = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Text|vWatchAddLabel|#55FF55}} linenumber, {{Text|0|#F580B1}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*__LONG_VWATCH_LINENUMBER= "</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(linenumber) + {{Text|<nowiki>"; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"</nowiki>|#FFB100}}
                        {{Text|vWatchAddLabel|#55FF55}} {{Text|0|#F580B1}}, {{Text|-1|#F580B1}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*__LONG_VWATCH_SUBLEVEL=*__LONG_VWATCH_SUBLEVEL- 1 ;"</nowiki>|#FFB100}}
                    {{Cl|IF}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} firstLineNumberLabelvWatch > {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"goto VWATCH_SKIPSETNEXTLINE;"</nowiki>|#FFB100}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"VWATCH_SETNEXTLINE:;"</nowiki>|#FFB100}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"switch (*__LONG_VWATCH_GOTO) {"</nowiki>|#FFB100}}
                        {{Cl|FOR}} i = firstLineNumberLabelvWatch {{Cl|TO}} lastLineNumberLabelvWatch
                            {{Cl|WHILE}} i > {{Cl|LEN}}(vWatchUsedLabels)
                                vWatchUsedLabels = vWatchUsedLabels + {{Cl|SPACE$}}({{Text|1000|#F580B1}})
                                vWatchUsedSkipLabels = vWatchUsedSkipLabels + {{Cl|SPACE$}}({{Text|1000|#F580B1}})
                            {{Cl|WEND}}
                            {{Cl|IF}} {{Cl|ASC (function)|ASC}}(vWatchUsedLabels, i) = {{Text|1|#F580B1}} {{Cl|THEN}}
                                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"    case "</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(i) + {{Text|<nowiki>":"</nowiki>|#FFB100}}
                                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"        goto VWATCH_LABEL_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(i) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"        break;"</nowiki>|#FFB100}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|NEXT}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"    default:"</nowiki>|#FFB100}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"        *__LONG_VWATCH_GOTO=*__LONG_VWATCH_LINENUMBER;"</nowiki>|#FFB100}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"        goto VWATCH_SETNEXTLINE;"</nowiki>|#FFB100}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"VWATCH_SKIPLINE:;"</nowiki>|#FFB100}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"switch (*__LONG_VWATCH_GOTO) {"</nowiki>|#FFB100}}
                        {{Cl|FOR}} i = firstLineNumberLabelvWatch {{Cl|TO}} lastLineNumberLabelvWatch
                            {{Cl|IF}} {{Cl|ASC (function)|ASC}}(vWatchUsedSkipLabels, i) = {{Text|1|#F580B1}} {{Cl|THEN}}
                                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"    case -"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(i) + {{Text|<nowiki>":"</nowiki>|#FFB100}}
                                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"        goto VWATCH_SKIPLABEL_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(i) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"        break;"</nowiki>|#FFB100}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|NEXT}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"VWATCH_SKIPSETNEXTLINE:;"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                    firstLineNumberLabelvWatch = {{Text|0|#F580B1}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'release _MEM lock for this scope</nowiki>|#919191}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"free_mem_lock(sf_mem_lock);"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"#include "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"free"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(subfuncn) + {{Text|<nowiki>".txt"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}})
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if ((tmp_mem_static_pointer>=mem_static)&&(tmp_mem_static_pointer<=mem_static_limit)) mem_static_pointer=tmp_mem_static_pointer; else mem_static_pointer=mem_static;"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"cmem_sp=tmp_cmem_sp;"</nowiki>|#FFB100}}
                {{Cl|IF}} subfuncret$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, subfuncret$
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}} {{Text|<nowiki>'skeleton sub</nowiki>|#919191}}
                {{Text|<nowiki>'ret???.txt</nowiki>|#919191}}
                {{Text|WriteBufLine|#55FF55}} RetTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}} {{Text|<nowiki>'end case</nowiki>|#919191}}
                {{Text|WriteBufLine|#55FF55}} RetTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} RetTxtBuf, {{Text|<nowiki>"error(3);"</nowiki>|#FFB100}} {{Text|<nowiki>'no valid return possible</nowiki>|#919191}}
                subfunc = {{Text|<nowiki>""</nowiki>|#FFB100}}
                closedsubfunc = {{Text|-1|#F580B1}}
                {{Text|<nowiki>'unshare temp. shared variables</nowiki>|#919191}}
                {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} idn
                    {{Cl|IF}} ids(i).share {{Cl|AND (boolean)|AND}} {{Text|2|#F580B1}} {{Cl|THEN}} ids(i).share = ids(i).share - {{Text|2|#F580B1}}
                {{Cl|NEXT}}
                {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} revertmaymusthaven
                    x = revertmaymusthave(i)
                    {{Cl|SWAP}} ids(x).musthave, ids(x).mayhave
                {{Cl|NEXT}}
                revertmaymusthaven = {{Text|0|#F580B1}}
                {{Text|<nowiki>'undeclare constants in sub/function's scope</nowiki>|#919191}}
                {{Text|<nowiki>'constlast = constlastshared</nowiki>|#919191}}
                {{Cl|GOTO}} finishednonexec
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} n >= {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} firstelement$ = {{Text|<nowiki>"CONST"</nowiki>|#FFB100}} {{Cl|THEN}}
        l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Const"</nowiki>|#FFB100}})
        {{Text|<nowiki>'DEF... do not change type, the expression is stored in a suitable type</nowiki>|#919191}}
        {{Text|<nowiki>'based on its value if type isn't forced/specified</nowiki>|#919191}}
        {{Cl|IF}} n < {{Text|3|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected CONST name = value/expression"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
        i = {{Text|2|#F580B1}}
        constdefpending:
        pending = {{Text|0|#F580B1}}
        n$ = {{Text|getelement$|#55FF55}}(ca$, i): i = i + {{Text|1|#F580B1}}
        l$ = l$ + sp + n$ + sp + {{Text|<nowiki>"="</nowiki>|#FFB100}}
        typeoverride = {{Text|0|#F580B1}}
        s$ = {{Text|removesymbol$|#55FF55}}(n$)
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
        {{Cl|IF}} s$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
            typeoverride = {{Text|typname2typ|#55FF55}}(s$)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Cl|IF}} typeoverride {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid constant type"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|IF}} typeoverride = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid constant type"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} {{Text|getelement$|#55FF55}}(a$, i) <> {{Text|<nowiki>"="</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ="</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
        i = i + {{Text|1|#F580B1}}
        {{Text|<nowiki>'get expression</nowiki>|#919191}}
        e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        B = {{Text|0|#F580B1}}
        {{Cl|FOR}} i2 = i {{Cl|TO}} n
            e2$ = {{Text|getelement$|#55FF55}}(ca$, i2)
            {{Cl|IF}} e2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} B = B + {{Text|1|#F580B1}}
            {{Cl|IF}} e2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} B = B - {{Text|1|#F580B1}}
            {{Cl|IF}} e2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} B = {{Text|0|#F580B1}} {{Cl|THEN}}
                pending = {{Text|1|#F580B1}}
                i = i2 + {{Text|1|#F580B1}}
                {{Cl|IF}} i > n - {{Text|2|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected CONST ... , name = value/expression"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|EXIT}} {{Cl|FOR}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} {{Cl|LEN}}(e$) = {{Text|0|#F580B1}} {{Cl|THEN}} e$ = e2$ {{Cl|ELSE}} e$ = e$ + sp + e2$
        {{Cl|NEXT}}
        e$ = {{Text|fixoperationorder|#55FF55}}(e$)
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
        l$ = l$ + sp + tlayout$
        {{Text|<nowiki>'Note: Actual CONST definition handled in prepass</nowiki>|#919191}}
        {{Text|<nowiki>'Set CONST as defined</nowiki>|#919191}}
        hashname$ = n$
        hashchkflags = HASHFLAG_CONSTANT
        hashres = {{Text|HashFind|#55FF55}}(hashname$, hashchkflags, hashresflags, hashresref)
        {{Cl|DO}} {{Cl|WHILE}} hashres
            {{Cl|IF}} constsubfunc(hashresref) = subfuncn {{Cl|THEN}} constdefined(hashresref) = {{Text|1|#F580B1}}: {{Cl|EXIT}} {{Cl|DO}}
            {{Cl|IF}} hashres <> {{Text|1|#F580B1}} {{Cl|THEN}} hashres = {{Text|HashFindCont|#55FF55}}(hashresflags, hashresref) {{Cl|ELSE}} hashres = {{Text|0|#F580B1}}
        {{Cl|LOOP}}
        {{Cl|IF}} pending {{Cl|THEN}} l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}}: {{Cl|GOTO}} constdefpending
        layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
        {{Cl|GOTO}} finishednonexec
    {{Cl|END}} {{Cl|IF}}
    predefine:
    {{Cl|IF}} n >= {{Text|2|#F580B1}} {{Cl|THEN}}
        asreq = {{Text|0|#F580B1}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"DEFINT"</nowiki>|#FFB100}} {{Cl|THEN}} l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"DefInt"</nowiki>|#FFB100}}): a$ = a$ + sp + {{Text|<nowiki>"AS"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"INTEGER"</nowiki>|#FFB100}}: n = n + {{Text|2|#F580B1}}: {{Cl|GOTO}} definetype
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"DEFLNG"</nowiki>|#FFB100}} {{Cl|THEN}} l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"DefLng"</nowiki>|#FFB100}}): a$ = a$ + sp + {{Text|<nowiki>"AS"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"LONG"</nowiki>|#FFB100}}: n = n + {{Text|2|#F580B1}}: {{Cl|GOTO}} definetype
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"DEFSNG"</nowiki>|#FFB100}} {{Cl|THEN}} l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"DefSng"</nowiki>|#FFB100}}): a$ = a$ + sp + {{Text|<nowiki>"AS"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"SINGLE"</nowiki>|#FFB100}}: n = n + {{Text|2|#F580B1}}: {{Cl|GOTO}} definetype
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"DEFDBL"</nowiki>|#FFB100}} {{Cl|THEN}} l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"DefDbl"</nowiki>|#FFB100}}): a$ = a$ + sp + {{Text|<nowiki>"AS"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"DOUBLE"</nowiki>|#FFB100}}: n = n + {{Text|2|#F580B1}}: {{Cl|GOTO}} definetype
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"DEFSTR"</nowiki>|#FFB100}} {{Cl|THEN}} l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"DefStr"</nowiki>|#FFB100}}): a$ = a$ + sp + {{Text|<nowiki>"AS"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"STRING"</nowiki>|#FFB100}}: n = n + {{Text|2|#F580B1}}: {{Cl|GOTO}} definetype
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"_DEFINE"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (firstelement$ = {{Text|<nowiki>"DEFINE"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}}
            asreq = {{Text|1|#F580B1}}
            {{Cl|IF}} firstelement$ = {{Text|<nowiki>"_DEFINE"</nowiki>|#FFB100}} {{Cl|THEN}} l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"_Define"</nowiki>|#FFB100}}) {{Cl|ELSE}} l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Define"</nowiki>|#FFB100}})
            definetype:
            {{Text|<nowiki>'get type from rhs</nowiki>|#919191}}
            typ$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            typ2$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            t$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Cl|FOR}} i = n {{Cl|TO}} {{Text|2|#F580B1}} {{Cl|STEP}} {{Text|-1|#F580B1}}
                t$ = {{Text|getelement$|#55FF55}}(a$, i)
                {{Cl|IF}} t$ = {{Text|<nowiki>"AS"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}}
                typ$ = t$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} + typ$
                typ2$ = t$ + sp + typ2$
            {{Cl|NEXT}}
            typ$ = {{Cl|RTRIM$}}(typ$)
            {{Cl|IF}} t$ <> {{Text|<nowiki>"AS"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = qb64prefix$ + {{Text|<nowiki>"DEFINE: Expected ... AS ..."</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|IF}} i = n {{Cl|OR (boolean)|OR}} i = {{Text|2|#F580B1}} {{Cl|THEN}} a$ = qb64prefix$ + {{Text|<nowiki>"DEFINE: Expected ... AS ..."</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            n = i - {{Text|1|#F580B1}}
            {{Text|<nowiki>'the data is from element 2 to element n</nowiki>|#919191}}
            i = {{Text|2|#F580B1}} - {{Text|1|#F580B1}}
            definenext:
            {{Text|<nowiki>'expects an alphabet letter or underscore</nowiki>|#919191}}
            i = i + {{Text|1|#F580B1}}: e$ = {{Text|getelement$|#55FF55}}(a$, i): E = {{Cl|ASC (function)|ASC}}({{Cl|UCASE$}}(e$))
            {{Cl|IF}} {{Cl|LEN}}(e$) > {{Text|1|#F580B1}} {{Cl|THEN}} a$ = qb64prefix$ + {{Text|<nowiki>"DEFINE: Expected an alphabet letter or the underscore character (_)"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|IF}} E <> {{Text|95|#F580B1}} {{Cl|AND (boolean)|AND}} (E > {{Text|90|#F580B1}} {{Cl|OR (boolean)|OR}} E < {{Text|65|#F580B1}}) {{Cl|THEN}} a$ = qb64prefix$ + {{Text|<nowiki>"DEFINE: Expected an alphabet letter or the underscore character (_)"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|IF}} E = {{Text|95|#F580B1}} {{Cl|THEN}} E = {{Text|27|#F580B1}} {{Cl|ELSE}} E = E - {{Text|64|#F580B1}}
            defineaz(E) = typ$
            defineextaz(E) = {{Text|type2symbol|#55FF55}}(typ$)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            firste = E
            l$ = l$ + sp + e$
            {{Cl|IF}} i = n {{Cl|THEN}}
                {{Cl|IF}} predefining = {{Text|1|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} predefined
                {{Cl|IF}} asreq {{Cl|THEN}} l$ = l$ + sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"As"</nowiki>|#FFB100}}) + sp + typ2$
                layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                {{Cl|GOTO}} finishednonexec
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'expects "-" or ","</nowiki>|#919191}}
            i = i + {{Text|1|#F580B1}}: e$ = {{Text|getelement$|#55FF55}}(a$, i)
            {{Cl|IF}} e$ <> {{Text|<nowiki>"-"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} e$ <> {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}} a$ = qb64prefix$ + {{Text|<nowiki>"DEFINE: Expected - or ,"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|IF}} e$ = {{Text|<nowiki>"-"</nowiki>|#FFB100}} {{Cl|THEN}}
                l$ = l$ + sp2 + {{Text|<nowiki>"-"</nowiki>|#FFB100}}
                {{Cl|IF}} i = n {{Cl|THEN}} a$ = qb64prefix$ + {{Text|<nowiki>"DEFINE: Syntax incomplete"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Text|<nowiki>'expects an alphabet letter or underscore</nowiki>|#919191}}
                i = i + {{Text|1|#F580B1}}: e$ = {{Text|getelement$|#55FF55}}(a$, i): E = {{Cl|ASC (function)|ASC}}({{Cl|UCASE$}}(e$))
                {{Cl|IF}} {{Cl|LEN}}(e$) > {{Text|1|#F580B1}} {{Cl|THEN}} a$ = qb64prefix$ + {{Text|<nowiki>"DEFINE: Expected an alphabet letter or the underscore character (_)"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|IF}} E <> {{Text|95|#F580B1}} {{Cl|AND (boolean)|AND}} (E > {{Text|90|#F580B1}} {{Cl|OR (boolean)|OR}} E < {{Text|65|#F580B1}}) {{Cl|THEN}} a$ = qb64prefix$ + {{Text|<nowiki>"DEFINE: Expected an alphabet letter or the underscore character (_)"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|IF}} E = {{Text|95|#F580B1}} {{Cl|THEN}} E = {{Text|27|#F580B1}} {{Cl|ELSE}} E = E - {{Text|64|#F580B1}}
                {{Cl|IF}} firste > E {{Cl|THEN}} {{Cl|SWAP}} E, firste
                {{Cl|FOR}} e2 = firste {{Cl|TO}} E
                    defineaz(e2) = typ$
                    defineextaz(e2) = {{Text|type2symbol|#55FF55}}(typ$)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Cl|NEXT}}
                l$ = l$ + sp2 + e$
                {{Cl|IF}} i = n {{Cl|THEN}}
                    {{Cl|IF}} predefining = {{Text|1|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} predefined
                    {{Cl|IF}} asreq {{Cl|THEN}} l$ = l$ + sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"As"</nowiki>|#FFB100}}) + sp + typ2$
                    layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                    {{Cl|GOTO}} finishednonexec
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'expects ","</nowiki>|#919191}}
                i = i + {{Text|1|#F580B1}}: e$ = {{Text|getelement$|#55FF55}}(a$, i)
                {{Cl|IF}} e$ <> {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}} a$ = qb64prefix$ + {{Text|<nowiki>"DEFINE: Expected ,"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|END}} {{Cl|IF}}
            l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}}
            {{Cl|GOTO}} definenext
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'_DEFINE</nowiki>|#919191}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'2</nowiki>|#919191}}
    {{Cl|IF}} predefining = {{Text|1|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} predefined
    {{Cl|IF}} closedmain <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} subfunc = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Statement cannot be placed between SUB/FUNCTIONs"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
    {{Text|<nowiki>'executable section:</nowiki>|#919191}}
    statementn = statementn + {{Text|1|#F580B1}}
    {{Cl|IF}} n >= {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"NEXT"</nowiki>|#FFB100}} {{Cl|THEN}}
            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Next"</nowiki>|#FFB100}})
            {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} simplenext
            v$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Cl|FOR}} i = {{Text|2|#F580B1}} {{Cl|TO}} n
                a2$ = {{Text|getelement|#55FF55}}(ca$, i)
                {{Cl|IF}} a2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}}
                    lastnextele:
                    e$ = {{Text|fixoperationorder|#55FF55}}(v$)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    {{Cl|IF}} {{Cl|LEN}}(l$) = {{Text|4|#F580B1}} {{Cl|THEN}} l$ = l$ + sp + tlayout$ {{Cl|ELSE}} l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp + tlayout$
                    e$ = {{Text|evaluate|#55FF55}}(e$, typ)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}}
                        {{Text|getid|#55FF55}} {{Cl|VAL}}(e$)
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                        {{Cl|IF}} (id.t {{Cl|AND (boolean)|AND}} ISPOINTER) {{Cl|THEN}}
                            {{Cl|IF}} (id.t {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                {{Cl|IF}} (id.t {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} (id.t {{Cl|AND (boolean)|AND}} ISARRAY) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                        {{Cl|GOTO}} fornextfoundvar2
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                    a$ = {{Text|<nowiki>"Unsupported variable after NEXT"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    fornextfoundvar2:
                    simplenext:
                    {{Cl|IF}} controltype(controllevel) <> {{Text|2|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"NEXT without FOR"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    {{Cl|IF}} n <> {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} controlvalue(controllevel) <> currentid {{Cl|THEN}} a$ = {{Text|<nowiki>"Incorrect variable after NEXT"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"fornext_continue_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(controlid(controllevel)) + {{Text|<nowiki>":;"</nowiki>|#FFB100}}
                    {{Cl|IF}} vWatchOn = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} NoChecks = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Text|vWatchAddLabel|#55FF55}} linenumber, {{Text|0|#F580B1}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*__LONG_VWATCH_LINENUMBER= "</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(linenumber) + {{Text|<nowiki>"; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"fornext_exit_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(controlid(controllevel)) + {{Text|<nowiki>":;"</nowiki>|#FFB100}}
                    controllevel = controllevel - {{Text|1|#F580B1}}
                    {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}}
                    v$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    {{Cl|IF}} {{Cl|LEN}}(v$) {{Cl|THEN}} v$ = v$ + sp + a2$ {{Cl|ELSE}} v$ = a2$
                    {{Cl|IF}} i = n {{Cl|THEN}} {{Cl|GOTO}} lastnextele
                {{Cl|END}} {{Cl|IF}}
            {{Cl|NEXT}}
            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
            {{Cl|GOTO}} finishednonexec {{Text|<nowiki>'***no error causing code, event checking done by FOR***</nowiki>|#919191}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} n >= {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"WHILE"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} NoChecks = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"S_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(statementn) + {{Text|<nowiki>":;"</nowiki>|#FFB100}}: dynscope = {{Text|1|#F580B1}}
            {{Text|<nowiki>'prevents code from being placed before 'CASE condition' in a SELECT CASE block</nowiki>|#919191}}
            {{Cl|IF}} SelectCaseCounter > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} SelectCaseHasCaseBlock(SelectCaseCounter) = {{Text|0|#F580B1}} {{Cl|THEN}}
                a$ = {{Text|<nowiki>"Expected CASE expression"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|END}} {{Cl|IF}}
            controllevel = controllevel + {{Text|1|#F580B1}}
            controlref(controllevel) = linenumber
            controltype(controllevel) = {{Text|5|#F580B1}}
            controlid(controllevel) = {{Text|uniquenumber|#55FF55}}
            {{Cl|IF}} n >= {{Text|2|#F580B1}} {{Cl|THEN}}
                e$ = {{Text|fixoperationorder|#55FF55}}({{Text|getelements$|#55FF55}}(ca$, {{Text|2|#F580B1}}, n))
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"While"</nowiki>|#FFB100}}) + sp + tlayout$
                layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                e$ = {{Text|evaluate|#55FF55}}(e$, typ)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer$|#55FF55}}(e$, typ, {{Text|0|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Cl|IF}} stringprocessinghappened {{Cl|THEN}} e$ = cleanupstringprocessingcall$ + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} a$ = {{Text|<nowiki>"WHILE ERROR! Cannot accept a STRING type."</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|IF}} NoChecks = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} vWatchOn = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Text|vWatchAddLabel|#55FF55}} linenumber, {{Text|0|#F580B1}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*__LONG_VWATCH_LINENUMBER= "</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(linenumber) + {{Text|<nowiki>"; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"while(("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")||new_error){"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                a$ = {{Text|<nowiki>"WHILE ERROR! Expected expression after WHILE."</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|END}} {{Cl|IF}}
            {{Cl|GOTO}} finishedline
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"WEND"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} controltype(controllevel) <> {{Text|5|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"WEND without WHILE"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"ww_continue_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(controlid(controllevel)) + {{Text|<nowiki>":;"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"ww_exit_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(controlid(controllevel)) + {{Text|<nowiki>":;"</nowiki>|#FFB100}}
            controllevel = controllevel - {{Text|1|#F580B1}}
            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Wend"</nowiki>|#FFB100}})
            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
            {{Cl|GOTO}} finishednonexec {{Text|<nowiki>'***no error causing code, event checking done by WHILE***</nowiki>|#919191}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} n >= {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"DO"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} NoChecks = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"S_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(statementn) + {{Text|<nowiki>":;"</nowiki>|#FFB100}}: dynscope = {{Text|1|#F580B1}}
            {{Text|<nowiki>'prevents code from being placed before 'CASE condition' in a SELECT CASE block</nowiki>|#919191}}
            {{Cl|IF}} SelectCaseCounter > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} SelectCaseHasCaseBlock(SelectCaseCounter) = {{Text|0|#F580B1}} {{Cl|THEN}}
                a$ = {{Text|<nowiki>"Expected CASE expression"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|END}} {{Cl|IF}}
            controllevel = controllevel + {{Text|1|#F580B1}}
            controlref(controllevel) = linenumber
            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Do"</nowiki>|#FFB100}})
            {{Cl|IF}} n >= {{Text|2|#F580B1}} {{Cl|THEN}}
                whileuntil = {{Text|0|#F580B1}}
                {{Cl|IF}} secondelement$ = {{Text|<nowiki>"WHILE"</nowiki>|#FFB100}} {{Cl|THEN}} whileuntil = {{Text|1|#F580B1}}: l$ = l$ + sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"While"</nowiki>|#FFB100}})
                {{Cl|IF}} secondelement$ = {{Text|<nowiki>"UNTIL"</nowiki>|#FFB100}} {{Cl|THEN}} whileuntil = {{Text|2|#F580B1}}: l$ = l$ + sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Until"</nowiki>|#FFB100}})
                {{Cl|IF}} whileuntil = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"DO ERROR! Expected WHILE or UNTIL after DO."</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|IF}} whileuntil > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} n = {{Text|2|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Condition expected after WHILE/UNTIL"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                e$ = {{Text|fixoperationorder|#55FF55}}({{Text|getelements$|#55FF55}}(ca$, {{Text|3|#F580B1}}, n))
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                l$ = l$ + sp + tlayout$
                e$ = {{Text|evaluate|#55FF55}}(e$, typ)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer$|#55FF55}}(e$, typ, {{Text|0|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Cl|IF}} stringprocessinghappened {{Cl|THEN}} e$ = cleanupstringprocessingcall$ + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} a$ = {{Text|<nowiki>"DO ERROR! Cannot accept a STRING type."</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|IF}} whileuntil = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"while(("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")||new_error){"</nowiki>|#FFB100}} {{Cl|ELSE}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"while((!("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"))||new_error){"</nowiki>|#FFB100}}
                {{Cl|IF}} NoChecks = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} vWatchOn = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Text|vWatchAddLabel|#55FF55}} linenumber, {{Text|0|#F580B1}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*__LONG_VWATCH_LINENUMBER= "</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(linenumber) + {{Text|<nowiki>"; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                controltype(controllevel) = {{Text|4|#F580B1}}
            {{Cl|ELSE}}
                controltype(controllevel) = {{Text|3|#F580B1}}
                {{Cl|IF}} vWatchOn = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} NoChecks = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Text|vWatchAddLabel|#55FF55}} linenumber, {{Text|0|#F580B1}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"do{*__LONG_VWATCH_LINENUMBER= "</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(linenumber) + {{Text|<nowiki>"; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"do{"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            controlid(controllevel) = {{Text|uniquenumber|#55FF55}}
            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
            {{Cl|GOTO}} finishedline
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} n >= {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"LOOP"</nowiki>|#FFB100}} {{Cl|THEN}}
            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Loop"</nowiki>|#FFB100}})
            {{Cl|IF}} controltype(controllevel) <> {{Text|3|#F580B1}} {{Cl|AND (boolean)|AND}} controltype(controllevel) <> {{Text|4|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"PROGRAM FLOW ERROR!"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|IF}} n >= {{Text|2|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} NoChecks = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"S_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(statementn) + {{Text|<nowiki>":;"</nowiki>|#FFB100}}: dynscope = {{Text|1|#F580B1}}
                {{Cl|IF}} controltype(controllevel) = {{Text|4|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"PROGRAM FLOW ERROR!"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                whileuntil = {{Text|0|#F580B1}}
                {{Cl|IF}} secondelement$ = {{Text|<nowiki>"WHILE"</nowiki>|#FFB100}} {{Cl|THEN}} whileuntil = {{Text|1|#F580B1}}: l$ = l$ + sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"While"</nowiki>|#FFB100}})
                {{Cl|IF}} secondelement$ = {{Text|<nowiki>"UNTIL"</nowiki>|#FFB100}} {{Cl|THEN}} whileuntil = {{Text|2|#F580B1}}: l$ = l$ + sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Until"</nowiki>|#FFB100}})
                {{Cl|IF}} whileuntil = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"LOOP ERROR! Expected WHILE or UNTIL after LOOP."</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|IF}} whileuntil > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} n = {{Text|2|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Condition expected after WHILE/UNTIL"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                e$ = {{Text|fixoperationorder|#55FF55}}({{Text|getelements$|#55FF55}}(ca$, {{Text|3|#F580B1}}, n))
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                l$ = l$ + sp + tlayout$
                e$ = {{Text|evaluate|#55FF55}}(e$, typ)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer$|#55FF55}}(e$, typ, {{Text|0|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Cl|IF}} stringprocessinghappened {{Cl|THEN}} e$ = cleanupstringprocessingcall$ + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} a$ = {{Text|<nowiki>"LOOP ERROR! Cannot accept a STRING type."</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"dl_continue_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(controlid(controllevel)) + {{Text|<nowiki>":;"</nowiki>|#FFB100}}
                {{Cl|IF}} NoChecks = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} vWatchOn = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Text|vWatchAddLabel|#55FF55}} linenumber, {{Text|0|#F580B1}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*__LONG_VWATCH_LINENUMBER= "</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(linenumber) + {{Text|<nowiki>"; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} whileuntil = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}while(("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")&&(!new_error));"</nowiki>|#FFB100}} {{Cl|ELSE}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}while((!("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"))&&(!new_error));"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"dl_continue_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(controlid(controllevel)) + {{Text|<nowiki>":;"</nowiki>|#FFB100}}
                {{Cl|IF}} NoChecks = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} vWatchOn = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Text|vWatchAddLabel|#55FF55}} linenumber, {{Text|0|#F580B1}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*__LONG_VWATCH_LINENUMBER= "</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(linenumber) + {{Text|<nowiki>"; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} controltype(controllevel) = {{Text|4|#F580B1}} {{Cl|THEN}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}while(1);"</nowiki>|#FFB100}} {{Text|<nowiki>'infinite loop!</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"dl_exit_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(controlid(controllevel)) + {{Text|<nowiki>":;"</nowiki>|#FFB100}}
            controllevel = controllevel - {{Text|1|#F580B1}}
            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
            {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} finishednonexec {{Text|<nowiki>'***no error causing code, event checking done by DO***</nowiki>|#919191}}
            {{Cl|GOTO}} finishedline
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} n >= {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"FOR"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} NoChecks = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"S_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(statementn) + {{Text|<nowiki>":;"</nowiki>|#FFB100}}: dynscope = {{Text|1|#F580B1}}
            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"For"</nowiki>|#FFB100}})
            {{Text|<nowiki>'prevents code from being placed before 'CASE condition' in a SELECT CASE block</nowiki>|#919191}}
            {{Cl|IF}} SelectCaseCounter > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} SelectCaseHasCaseBlock(SelectCaseCounter) = {{Text|0|#F580B1}} {{Cl|THEN}}
                a$ = {{Text|<nowiki>"Expected CASE expression"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|END}} {{Cl|IF}}
            controllevel = controllevel + {{Text|1|#F580B1}}
            controlref(controllevel) = linenumber
            controltype(controllevel) = {{Text|2|#F580B1}}
            controlid(controllevel) = {{Text|uniquenumber|#55FF55}}
            v$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            startvalue$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            p3$ = {{Text|<nowiki>"1"</nowiki>|#FFB100}}: stepused = {{Text|0|#F580B1}}
            p2$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            mode = {{Text|0|#F580B1}}
            E = {{Text|0|#F580B1}}
            {{Cl|FOR}} i = {{Text|2|#F580B1}} {{Cl|TO}} n
                e$ = {{Text|getelement$|#55FF55}}(a$, i)
                {{Cl|IF}} e$ = {{Text|<nowiki>"="</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} mode <> {{Text|0|#F580B1}} {{Cl|THEN}} E = {{Text|1|#F580B1}}: {{Cl|EXIT}} {{Cl|FOR}}
                    mode = {{Text|1|#F580B1}}
                    v$ = {{Text|getelements$|#55FF55}}(ca$, {{Text|2|#F580B1}}, i - {{Text|1|#F580B1}})
                    equpos = i
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} e$ = {{Text|<nowiki>"TO"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} mode <> {{Text|1|#F580B1}} {{Cl|THEN}} E = {{Text|1|#F580B1}}: {{Cl|EXIT}} {{Cl|FOR}}
                    mode = {{Text|2|#F580B1}}
                    startvalue$ = {{Text|getelements$|#55FF55}}(ca$, equpos + {{Text|1|#F580B1}}, i - {{Text|1|#F580B1}})
                    topos = i
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} e$ = {{Text|<nowiki>"STEP"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} mode <> {{Text|2|#F580B1}} {{Cl|THEN}} E = {{Text|1|#F580B1}}: {{Cl|EXIT}} {{Cl|FOR}}
                    mode = {{Text|3|#F580B1}}
                    stepused = {{Text|1|#F580B1}}
                    p2$ = {{Text|getelements$|#55FF55}}(ca$, topos + {{Text|1|#F580B1}}, i - {{Text|1|#F580B1}})
                    p3$ = {{Text|getelements$|#55FF55}}(ca$, i + {{Text|1|#F580B1}}, n)
                    {{Cl|EXIT}} {{Cl|FOR}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|NEXT}}
            {{Cl|IF}} mode < {{Text|2|#F580B1}} {{Cl|THEN}} E = {{Text|1|#F580B1}}
            {{Cl|IF}} p2$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} p2$ = {{Text|getelements$|#55FF55}}(ca$, topos + {{Text|1|#F580B1}}, n)
            {{Cl|IF}} {{Cl|LEN}}(v$) = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} {{Cl|LEN}}(startvalue$) = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} {{Cl|LEN}}(p2$) = {{Text|0|#F580B1}} {{Cl|THEN}} E = {{Text|1|#F580B1}}
            {{Cl|IF}} E <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} mode < {{Text|3|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected FOR name = start TO end"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|IF}} E {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected FOR name = start TO end STEP increment"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            e$ = {{Text|fixoperationorder|#55FF55}}(v$)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            l$ = l$ + sp + tlayout$
            e$ = {{Text|evaluate|#55FF55}}(e$, typ)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}}
                {{Text|getid|#55FF55}} {{Cl|VAL}}(e$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Cl|IF}} (id.t {{Cl|AND (boolean)|AND}} ISPOINTER) {{Cl|THEN}}
                    {{Cl|IF}} (id.t {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} (id.t {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) = {{Text|0|#F580B1}} {{Cl|THEN}}
                            {{Cl|IF}} (id.t {{Cl|AND (boolean)|AND}} ISARRAY) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                {{Cl|GOTO}} fornextfoundvar
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            a$ = {{Text|<nowiki>"Unsupported variable used in FOR statement"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            fornextfoundvar:
            controlvalue(controllevel) = currentid
            v$ = e$
            {{Text|<nowiki>'find C++ datatype to match variable</nowiki>|#919191}}
            {{Text|<nowiki>'markup to cater for greater range/accuracy</nowiki>|#919191}}
            ctype$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            ctyp = typ - ISPOINTER
            bits = typ {{Cl|AND}} {{Text|511|#F580B1}}
            {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}}
                {{Cl|IF}} bits = {{Text|32|#F580B1}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"double"</nowiki>|#FFB100}}: ctyp = {{Text|64&|#F580B1}} + ISFLOAT
                {{Cl|IF}} bits = {{Text|64|#F580B1}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"long double"</nowiki>|#FFB100}}: ctyp = {{Text|256&|#F580B1}} + ISFLOAT
                {{Cl|IF}} bits = {{Text|256|#F580B1}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"long double"</nowiki>|#FFB100}}: ctyp = {{Text|256&|#F580B1}} + ISFLOAT
            {{Cl|ELSE}}
                {{Cl|IF}} bits = {{Text|8|#F580B1}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"int16"</nowiki>|#FFB100}}: ctyp = {{Text|16&|#F580B1}}
                {{Cl|IF}} bits = {{Text|16|#F580B1}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"int32"</nowiki>|#FFB100}}: ctyp = {{Text|32&|#F580B1}}
                {{Cl|IF}} bits = {{Text|32|#F580B1}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"int64"</nowiki>|#FFB100}}: ctyp = {{Text|64&|#F580B1}}
                {{Cl|IF}} bits = {{Text|64|#F580B1}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"int64"</nowiki>|#FFB100}}: ctyp = {{Text|64&|#F580B1}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} ctype$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Unsupported variable used in FOR statement"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            u$ = {{Text|str2|#55FF55}}({{Text|uniquenumber|#55FF55}})
            {{Cl|IF}} subfunc = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"static "</nowiki>|#FFB100}} + ctype$ + {{Text|<nowiki>" fornext_value"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"static "</nowiki>|#FFB100}} + ctype$ + {{Text|<nowiki>" fornext_finalvalue"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"static "</nowiki>|#FFB100}} + ctype$ + {{Text|<nowiki>" fornext_step"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"static uint8 fornext_step_negative"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, ctype$ + {{Text|<nowiki>" fornext_value"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, ctype$ + {{Text|<nowiki>" fornext_finalvalue"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, ctype$ + {{Text|<nowiki>" fornext_step"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"uint8 fornext_step_negative"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'calculate start</nowiki>|#919191}}
            e$ = {{Text|fixoperationorder$|#55FF55}}(startvalue$)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            l$ = l$ + sp + {{Text|<nowiki>"="</nowiki>|#FFB100}} + sp + tlayout$
            e$ = {{Text|evaluatetotyp$|#55FF55}}(e$, ctyp)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"fornext_value"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>"="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
            {{Text|<nowiki>'final</nowiki>|#919191}}
            e$ = {{Text|fixoperationorder$|#55FF55}}(p2$)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            l$ = l$ + sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"To"</nowiki>|#FFB100}}) + sp + tlayout$
            e$ = {{Text|evaluatetotyp|#55FF55}}(e$, ctyp)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"fornext_finalvalue"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>"="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
            {{Text|<nowiki>'step</nowiki>|#919191}}
            e$ = {{Text|fixoperationorder$|#55FF55}}(p3$)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Cl|IF}} stepused = {{Text|1|#F580B1}} {{Cl|THEN}} l$ = l$ + sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Step"</nowiki>|#FFB100}}) + sp + tlayout$
            e$ = {{Text|evaluatetotyp|#55FF55}}(e$, ctyp)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Cl|IF}} NoChecks = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} vWatchOn = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Text|vWatchAddLabel|#55FF55}} linenumber, {{Text|0|#F580B1}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*__LONG_VWATCH_LINENUMBER= "</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(linenumber) + {{Text|<nowiki>"; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"fornext_step"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>"="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (fornext_step"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>"<0) fornext_step_negative"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>"=1; else fornext_step_negative"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>"=0;"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (new_error) goto fornext_error"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"goto fornext_entrylabel"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"while(1){"</nowiki>|#FFB100}}
            typbak = typ
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"fornext_value"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>"=fornext_step"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>"+("</nowiki>|#FFB100}} + {{Text|refer$|#55FF55}}(v$, typ, {{Text|0|#F580B1}}) + {{Text|<nowiki>");"</nowiki>|#FFB100}}
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            typ = typbak
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"fornext_entrylabel"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>":"</nowiki>|#FFB100}}
            {{Text|setrefer|#55FF55}} v$, typ, {{Text|<nowiki>"fornext_value"</nowiki>|#FFB100}} + u$, {{Text|1|#F580B1}}
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (fornext_step_negative"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>"){"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (fornext_value"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>"<fornext_finalvalue"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>") break;"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}else{"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (fornext_value"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>">fornext_finalvalue"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>") break;"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"fornext_error"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>":;"</nowiki>|#FFB100}}
            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
            {{Cl|GOTO}} finishedline
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"ELSE"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Text|<nowiki>'Routine to add error checking for ELSE so we'll no longer be able to do things like the following:</nowiki>|#919191}}
            {{Text|<nowiki>'IF x = 1 THEN</nowiki>|#919191}}
            {{Text|<nowiki>'    SELECT CASE s</nowiki>|#919191}}
            {{Text|<nowiki>'        CASE 1</nowiki>|#919191}}
            {{Text|<nowiki>'    END SELECT ELSE y = 2</nowiki>|#919191}}
            {{Text|<nowiki>'END IF</nowiki>|#919191}}
            {{Text|<nowiki>'Notice the ELSE with the SELECT CASE?  Before this patch, commands like those were considered valid QB64 code.</nowiki>|#919191}}
            temp$ = {{Cl|UCASE$}}({{Cl|LTRIM$}}({{Cl|RTRIM$}}(wholeline)))
            {{Text|<nowiki>'IF NoIDEMode THEN</nowiki>|#919191}}
            {{Cl|DO}} {{Cl|WHILE}} {{Cl|INSTR}}(temp$, {{Cl|CHR$}}({{Text|9|#F580B1}}))
                {{Cl|ASC}}(temp$, {{Cl|INSTR}}(temp$, {{Cl|CHR$}}({{Text|9|#F580B1}}))) = {{Text|32|#F580B1}}
            {{Cl|LOOP}}
            {{Text|<nowiki>'END IF</nowiki>|#919191}}
            goodelse = {{Text|0|#F580B1}} {{Text|<nowiki>'a check to see if it's a good else</nowiki>|#919191}}
            {{Cl|IF}} {{Cl|LEFT$}}(temp$, {{Text|2|#F580B1}}) = {{Text|<nowiki>"IF"</nowiki>|#FFB100}} {{Cl|THEN}} goodelse = {{Text|-1|#F580B1}}: {{Cl|GOTO}} skipelsecheck {{Text|<nowiki>'If we have an IF, the else is probably good</nowiki>|#919191}}
            {{Cl|IF}} {{Cl|LEFT$}}(temp$, {{Text|4|#F580B1}}) = {{Text|<nowiki>"ELSE"</nowiki>|#FFB100}} {{Cl|THEN}} goodelse = {{Text|-1|#F580B1}}: {{Cl|GOTO}} skipelsecheck {{Text|<nowiki>'If it's an else by itself,then we'll call it good too at this point and let the rest of the syntax checking check for us</nowiki>|#919191}}
            {{Cl|DO}}
                spacelocation = {{Cl|INSTR}}(temp$, {{Text|<nowiki>" "</nowiki>|#FFB100}})
                {{Cl|IF}} spacelocation {{Cl|THEN}} temp$ = {{Cl|LEFT$}}(temp$, spacelocation - {{Text|1|#F580B1}}) + {{Cl|MID$ (function)|MID$}}(temp$, spacelocation + {{Text|1|#F580B1}})
            {{Cl|LOOP}} {{Cl|UNTIL}} spacelocation = {{Text|0|#F580B1}}
            {{Cl|IF}} {{Cl|INSTR}}(temp$, {{Text|<nowiki>":ELSE"</nowiki>|#FFB100}}) {{Cl|OR (boolean)|OR}} {{Cl|INSTR}}(temp$, {{Text|<nowiki>":IF"</nowiki>|#FFB100}}) {{Cl|THEN}} goodelse = {{Text|-1|#F580B1}}: {{Cl|GOTO}} skipelsecheck {{Text|<nowiki>'I personally don't like the idea of a :ELSE statement, but this checks for that and validates it as well.  YUCK!  (I suppose this might be useful if there's a label where the ELSE is, like thisline: ELSE</nowiki>|#919191}}
            count = {{Text|0|#F580B1}}
            {{Cl|DO}}
                count = count + {{Text|1|#F580B1}}
                {{Cl|SELECT}} {{Cl|CASE}} {{Cl|MID$}}(temp$, count, {{Text|1|#F580B1}})
                    {{Cl|CASE}} {{Cl|IS}} = {{Text|<nowiki>"1"</nowiki>|#FFB100}}, {{Text|<nowiki>"2"</nowiki>|#FFB100}}, {{Text|<nowiki>"3"</nowiki>|#FFB100}}, {{Text|<nowiki>"4"</nowiki>|#FFB100}}, {{Text|<nowiki>"5"</nowiki>|#FFB100}}, {{Text|<nowiki>"6"</nowiki>|#FFB100}}, {{Text|<nowiki>"7"</nowiki>|#FFB100}}, {{Text|<nowiki>"8"</nowiki>|#FFB100}}, {{Text|<nowiki>"9"</nowiki>|#FFB100}}, {{Text|<nowiki>"0"</nowiki>|#FFB100}}, {{Text|<nowiki>":"</nowiki>|#FFB100}}
                    {{Cl|CASE}} {{Cl|ELSE}}: {{Cl|EXIT}} {{Cl|DO}}
                {{Cl|END}} {{Cl|SELECT}}
            {{Cl|LOOP}} {{Cl|UNTIL}} count >= {{Cl|LEN}}(temp$)
            {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(temp$, count, {{Text|4|#F580B1}}) = {{Text|<nowiki>"ELSE"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} {{Cl|MID$ (function)|MID$}}(temp$, count, {{Text|2|#F580B1}}) = {{Text|<nowiki>"IF"</nowiki>|#FFB100}} {{Cl|THEN}} goodelse = {{Text|-1|#F580B1}} {{Text|<nowiki>'We only had numbers before our else</nowiki>|#919191}}
            {{Cl|IF}} {{Cl|NOT}} goodelse {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid Syntax for ELSE"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            skipelsecheck:
            {{Text|<nowiki>'End of ELSE Error checking</nowiki>|#919191}}
            {{Cl|FOR}} i = controllevel {{Cl|TO}} {{Text|1|#F580B1}} {{Cl|STEP}} {{Text|-1|#F580B1}}
                t = controltype(i)
                {{Cl|IF}} t = {{Text|1|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} controlstate(controllevel) = {{Text|2|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"IF-THEN already contains an ELSE statement"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}else{"</nowiki>|#FFB100}}
                    controlstate(controllevel) = {{Text|2|#F580B1}}
                    {{Cl|IF}} lineelseused = {{Text|0|#F580B1}} {{Cl|THEN}} lhscontrollevel = lhscontrollevel - {{Text|1|#F580B1}}
                    l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Else"</nowiki>|#FFB100}})
                    layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                    {{Cl|GOTO}} finishednonexec {{Text|<nowiki>'***no error causing code, event checking done by IF***</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|NEXT}}
            a$ = {{Text|<nowiki>"ELSE without IF"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} n >= {{Text|3|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"ELSEIF"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} NoChecks = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"S_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(statementn) + {{Text|<nowiki>":;"</nowiki>|#FFB100}}: dynscope = {{Text|1|#F580B1}}
                {{Cl|IF}} vWatchOn = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Text|vWatchAddLabel|#55FF55}} linenumber, {{Text|0|#F580B1}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*__LONG_VWATCH_LINENUMBER= "</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(linenumber) + {{Text|<nowiki>"; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|FOR}} i = controllevel {{Cl|TO}} {{Text|1|#F580B1}} {{Cl|STEP}} {{Text|-1|#F580B1}}
                t = controltype(i)
                {{Cl|IF}} t = {{Text|1|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} controlstate(controllevel) = {{Text|2|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"ELSEIF invalid after ELSE"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    controlstate(controllevel) = {{Text|1|#F580B1}}
                    controlvalue(controllevel) = controlvalue(controllevel) + {{Text|1|#F580B1}}
                    e$ = {{Text|getelement$|#55FF55}}(a$, n)
                    {{Cl|IF}} e$ <> {{Text|<nowiki>"THEN"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ELSEIF expression THEN"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}else{"</nowiki>|#FFB100}}
                    e$ = {{Text|fixoperationorder$|#55FF55}}({{Text|getelements$|#55FF55}}(ca$, {{Text|2|#F580B1}}, n - {{Text|1|#F580B1}}))
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"ElseIf"</nowiki>|#FFB100}}) + sp + tlayout$ + sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Then"</nowiki>|#FFB100}})
                    layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                    e$ = {{Text|evaluate|#55FF55}}(e$, typ)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer$|#55FF55}}(e$, typ, {{Text|0|#F580B1}})
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    {{Cl|IF}} typ {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                        a$ = {{Text|<nowiki>"Expected ELSEIF LEN(stringexpression) THEN"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} stringprocessinghappened {{Cl|THEN}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if ("</nowiki>|#FFB100}} + cleanupstringprocessingcall$ + e$ + {{Text|<nowiki>")){"</nowiki>|#FFB100}}
                    {{Cl|ELSE}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if ("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"){"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                    lhscontrollevel = lhscontrollevel - {{Text|1|#F580B1}}
                    {{Cl|GOTO}} finishedline
                {{Cl|END}} {{Cl|IF}}
            {{Cl|NEXT}}
            a$ = {{Text|<nowiki>"ELSEIF without IF"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} n >= {{Text|3|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"IF"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} NoChecks = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"S_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(statementn) + {{Text|<nowiki>":;"</nowiki>|#FFB100}}: dynscope = {{Text|1|#F580B1}}
                {{Cl|IF}} vWatchOn = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Text|vWatchAddLabel|#55FF55}} linenumber, {{Text|0|#F580B1}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*__LONG_VWATCH_LINENUMBER= "</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(linenumber) + {{Text|<nowiki>"; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'prevents code from being placed before 'CASE condition' in a SELECT CASE block</nowiki>|#919191}}
            {{Cl|IF}} SelectCaseCounter > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} SelectCaseHasCaseBlock(SelectCaseCounter) = {{Text|0|#F580B1}} {{Cl|THEN}}
                a$ = {{Text|<nowiki>"Expected CASE expression"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|END}} {{Cl|IF}}
            e$ = {{Text|getelement|#55FF55}}(a$, n)
            iftype = {{Text|0|#F580B1}}
            {{Cl|IF}} e$ = {{Text|<nowiki>"THEN"</nowiki>|#FFB100}} {{Cl|THEN}} iftype = {{Text|1|#F580B1}}
            {{Cl|IF}} e$ = {{Text|<nowiki>"GOTO"</nowiki>|#FFB100}} {{Cl|THEN}} iftype = {{Text|2|#F580B1}}
            {{Cl|IF}} iftype = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected IF expression THEN/GOTO"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            controllevel = controllevel + {{Text|1|#F580B1}}
            controlref(controllevel) = linenumber
            controltype(controllevel) = {{Text|1|#F580B1}}
            controlvalue(controllevel) = {{Text|0|#F580B1}} {{Text|<nowiki>'number of extra closing } required at END IF</nowiki>|#919191}}
            controlstate(controllevel) = {{Text|0|#F580B1}}
            e$ = {{Text|fixoperationorder$|#55FF55}}({{Text|getelements|#55FF55}}(ca$, {{Text|2|#F580B1}}, n - {{Text|1|#F580B1}}))
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"If"</nowiki>|#FFB100}}) + sp + tlayout$
            e$ = {{Text|evaluate|#55FF55}}(e$, typ)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer$|#55FF55}}(e$, typ, {{Text|0|#F580B1}})
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Cl|IF}} typ {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                a$ = {{Text|<nowiki>"Expected IF LEN(stringexpression) THEN"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} stringprocessinghappened {{Cl|THEN}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (("</nowiki>|#FFB100}} + cleanupstringprocessingcall$ + e$ + {{Text|<nowiki>"))||new_error){"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")||new_error){"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} iftype = {{Text|1|#F580B1}} {{Cl|THEN}} l$ = l$ + sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Then"</nowiki>|#FFB100}}) {{Text|<nowiki>'note: 'GOTO' will be added when iftype=2</nowiki>|#919191}}
            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) = {{Text|0|#F580B1}} {{Cl|THEN}} layout$ = l$ {{Cl|ELSE}} layout$ = layout$ + sp + l$
            {{Cl|IF}} iftype = {{Text|2|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'IF ... GOTO</nowiki>|#919191}}
                {{Cl|GOTO}} finishedline
            {{Cl|END}} {{Cl|IF}}
            THENGOTO = {{Text|1|#F580B1}} {{Text|<nowiki>'possible: IF a=1 THEN 10</nowiki>|#919191}}
            {{Cl|GOTO}} finishedline2
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'ENDIF</nowiki>|#919191}}
    {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} {{Text|getelement|#55FF55}}(a$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"ENDIF"</nowiki>|#FFB100}} {{Cl|THEN}}
        {{Cl|IF}} controltype(controllevel) <> {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"END IF without IF"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
        layoutdone = {{Text|1|#F580B1}}
        {{Cl|IF}} impliedendif = {{Text|0|#F580B1}} {{Cl|THEN}}
            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"End If"</nowiki>|#FFB100}})
            {{Cl|IF}} {{Cl|LEN}}(layout$) = {{Text|0|#F580B1}} {{Cl|THEN}} layout$ = l$ {{Cl|ELSE}} layout$ = layout$ + sp + l$
        {{Cl|END}} {{Cl|IF}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
        {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} controlvalue(controllevel)
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
        {{Cl|NEXT}}
        controllevel = controllevel - {{Text|1|#F580B1}}
        {{Cl|GOTO}} finishednonexec {{Text|<nowiki>'***no error causing code, event checking done by IF***</nowiki>|#919191}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'END IF</nowiki>|#919191}}
    {{Cl|IF}} n = {{Text|2|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} {{Text|getelement|#55FF55}}(a$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"END"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} {{Text|getelement|#55FF55}}(a$, {{Text|2|#F580B1}}) = {{Text|<nowiki>"IF"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} controltype(controllevel) <> {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"END IF without IF"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            layoutdone = {{Text|1|#F580B1}}
            {{Cl|IF}} impliedendif = {{Text|0|#F580B1}} {{Cl|THEN}}
                l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"End"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"If"</nowiki>|#FFB100}})
                {{Cl|IF}} {{Cl|LEN}}(layout$) = {{Text|0|#F580B1}} {{Cl|THEN}} layout$ = l$ {{Cl|ELSE}} layout$ = layout$ + sp + l$
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} NoChecks = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} vWatchOn = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Text|vWatchAddLabel|#55FF55}} linenumber, {{Text|0|#F580B1}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*__LONG_VWATCH_LINENUMBER= "</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(linenumber) + {{Text|<nowiki>"; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
            {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} controlvalue(controllevel)
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
            {{Cl|NEXT}}
            controllevel = controllevel - {{Text|1|#F580B1}}
            {{Cl|GOTO}} finishednonexec {{Text|<nowiki>'***no error causing code, event checking done by IF***</nowiki>|#919191}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'SELECT CASE</nowiki>|#919191}}
    {{Cl|IF}} n >= {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"SELECT"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} NoChecks = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"S_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(statementn) + {{Text|<nowiki>":;"</nowiki>|#FFB100}}: dynscope = {{Text|1|#F580B1}}
                {{Cl|IF}} vWatchOn = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Text|vWatchAddLabel|#55FF55}} linenumber, {{Text|0|#F580B1}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*__LONG_VWATCH_LINENUMBER= "</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(linenumber) + {{Text|<nowiki>"; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'prevents code from being placed before 'CASE condition' in a SELECT CASE block</nowiki>|#919191}}
            {{Cl|IF}} SelectCaseCounter > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} SelectCaseHasCaseBlock(SelectCaseCounter) = {{Text|0|#F580B1}} {{Cl|THEN}}
                a$ = {{Text|<nowiki>"Expected CASE expression"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|END}} {{Cl|IF}}
            SelectCaseCounter = SelectCaseCounter + {{Text|1|#F580B1}}
            {{Cl|IF}} {{Cl|UBOUND}}(EveryCaseSet) <= SelectCaseCounter {{Cl|THEN}} {{Cl|REDIM}} {{Cl|_PRESERVE}} EveryCaseSet(SelectCaseCounter)
            {{Cl|IF}} {{Cl|UBOUND}}(SelectCaseHasCaseBlock) <= SelectCaseCounter {{Cl|THEN}} {{Cl|REDIM}} {{Cl|_PRESERVE}} SelectCaseHasCaseBlock(SelectCaseCounter)
            SelectCaseHasCaseBlock(SelectCaseCounter) = {{Text|0|#F580B1}}
            {{Cl|IF}} secondelement$ = {{Text|<nowiki>"EVERYCASE"</nowiki>|#FFB100}} {{Cl|THEN}}
                EveryCaseSet(SelectCaseCounter) = {{Text|-1|#F580B1}}
                {{Cl|IF}} n = {{Text|2|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected SELECT CASE expression"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                e$ = {{Text|fixoperationorder|#55FF55}}({{Text|getelements$|#55FF55}}(ca$, {{Text|3|#F580B1}}, n))
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Select EveryCase "</nowiki>|#FFB100}}) + tlayout$
            {{Cl|ELSE}}
                EveryCaseSet(SelectCaseCounter) = {{Text|0|#F580B1}}
                {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|OR (boolean)|OR}} secondelement$ <> {{Text|<nowiki>"CASE"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected CASE or EVERYCASE"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|IF}} n = {{Text|2|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected SELECT CASE expression"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                e$ = {{Text|fixoperationorder|#55FF55}}({{Text|getelements$|#55FF55}}(ca$, {{Text|3|#F580B1}}, n))
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Select Case "</nowiki>|#FFB100}}) + tlayout$
            {{Cl|END}} {{Cl|IF}}
            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
            e$ = {{Text|evaluate|#55FF55}}(e$, typ)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            u = {{Text|uniquenumber|#55FF55}}
            controllevel = controllevel + {{Text|1|#F580B1}}
            controlvalue(controllevel) = {{Text|0|#F580B1}} {{Text|<nowiki>'id</nowiki>|#919191}}
            t$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}}
                t = {{Text|0|#F580B1}}
                {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISUDT) = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} (typ {{Cl|AND (boolean)|AND}} ISARRAY) = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} (typ {{Cl|AND (boolean)|AND}} ISREFERENCE) <> {{Text|0|#F580B1}} {{Cl|THEN}}
                    controlvalue(controllevel) = {{Cl|VAL}}(e$)
                {{Cl|ELSE}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer|#55FF55}}(e$, typ, {{Text|0|#F580B1}})
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"static qbs *sc_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(u) + {{Text|<nowiki>"=qbs_new(0,0);"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_set(sc_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(u) + {{Text|<nowiki>","</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                    {{Cl|IF}} stringprocessinghappened {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, cleanupstringprocessingcall$ + {{Text|<nowiki>"0);"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|ELSE}}
                {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) > {{Text|64|#F580B1}} {{Cl|THEN}} t = {{Text|3|#F580B1}}: t$ = {{Text|<nowiki>"long double"</nowiki>|#FFB100}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|32|#F580B1}} {{Cl|THEN}} t = {{Text|4|#F580B1}}: t$ = {{Text|<nowiki>"float"</nowiki>|#FFB100}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|64|#F580B1}} {{Cl|THEN}} t = {{Text|5|#F580B1}}: t$ = {{Text|<nowiki>"double"</nowiki>|#FFB100}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISUDT) = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} (typ {{Cl|AND (boolean)|AND}} ISARRAY) = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} (typ {{Cl|AND (boolean)|AND}} ISREFERENCE) <> {{Text|0|#F580B1}} {{Cl|THEN}}
                        controlvalue(controllevel) = {{Cl|VAL}}(e$)
                    {{Cl|ELSE}}
                        {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer|#55FF55}}(e$, typ, {{Text|0|#F580B1}})
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"static "</nowiki>|#FFB100}} + t$ + {{Text|<nowiki>" sc_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(u) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sc_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(u) + {{Text|<nowiki>"="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                        {{Cl|IF}} stringprocessinghappened {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, cleanupstringprocessingcall$ + {{Text|<nowiki>"0);"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|ELSE}}
                    {{Text|<nowiki>'non-float</nowiki>|#919191}}
                    t = {{Text|1|#F580B1}}: t$ = {{Text|<nowiki>"int64"</nowiki>|#FFB100}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISUNSIGNED) {{Cl|THEN}}
                        {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) <= {{Text|32|#F580B1}} {{Cl|THEN}} t = {{Text|7|#F580B1}}: t$ = {{Text|<nowiki>"uint32"</nowiki>|#FFB100}}
                        {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) > {{Text|32|#F580B1}} {{Cl|THEN}} t = {{Text|2|#F580B1}}: t$ = {{Text|<nowiki>"uint64"</nowiki>|#FFB100}}
                    {{Cl|ELSE}}
                        {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) <= {{Text|32|#F580B1}} {{Cl|THEN}} t = {{Text|6|#F580B1}}: t$ = {{Text|<nowiki>"int32"</nowiki>|#FFB100}}
                        {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) > {{Text|32|#F580B1}} {{Cl|THEN}} t = {{Text|1|#F580B1}}: t$ = {{Text|<nowiki>"int64"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISUDT) = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} (typ {{Cl|AND (boolean)|AND}} ISARRAY) = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} (typ {{Cl|AND (boolean)|AND}} ISREFERENCE) <> {{Text|0|#F580B1}} {{Cl|THEN}}
                        controlvalue(controllevel) = {{Cl|VAL}}(e$)
                    {{Cl|ELSE}}
                        {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer|#55FF55}}(e$, typ, {{Text|0|#F580B1}})
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"static "</nowiki>|#FFB100}} + t$ + {{Text|<nowiki>" sc_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(u) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sc_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(u) + {{Text|<nowiki>"="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                        {{Cl|IF}} stringprocessinghappened {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, cleanupstringprocessingcall$ + {{Text|<nowiki>"0);"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            controlref(controllevel) = linenumber
            controltype(controllevel) = {{Text|10|#F580B1}} + t
            controlid(controllevel) = u
            {{Cl|IF}} EveryCaseSet(SelectCaseCounter) {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"int32 sc_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(controlid(controllevel)) + {{Text|<nowiki>"_var;"</nowiki>|#FFB100}}
            {{Cl|IF}} EveryCaseSet(SelectCaseCounter) {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sc_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(controlid(controllevel)) + {{Text|<nowiki>"_var=0;"</nowiki>|#FFB100}}
            {{Cl|GOTO}} finishedline
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'END SELECT</nowiki>|#919191}}
    {{Cl|IF}} n = {{Text|2|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"END"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} secondelement$ = {{Text|<nowiki>"SELECT"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Text|<nowiki>'complete current case if necessary</nowiki>|#919191}}
            {{Text|<nowiki>'18=CASE (awaiting END SELECT/CASE/CASE ELSE)</nowiki>|#919191}}
            {{Text|<nowiki>'19=CASE ELSE (awaiting END SELECT)</nowiki>|#919191}}
            {{Cl|IF}} controltype(controllevel) = {{Text|18|#F580B1}} {{Cl|THEN}}
                everycasenewcase = everycasenewcase + {{Text|1|#F580B1}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sc_ec_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(everycasenewcase) + {{Text|<nowiki>"_end:;"</nowiki>|#FFB100}}
                controllevel = controllevel - {{Text|1|#F580B1}}
                {{Cl|IF}} EveryCaseSet(SelectCaseCounter) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"goto sc_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(controlid(controllevel)) + {{Text|<nowiki>"_end;"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} controltype(controllevel) = {{Text|19|#F580B1}} {{Cl|THEN}}
                controllevel = controllevel - {{Text|1|#F580B1}}
                {{Cl|IF}} EveryCaseSet(SelectCaseCounter) {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"} /* End of SELECT EVERYCASE ELSE */"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sc_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(controlid(controllevel)) + {{Text|<nowiki>"_end:;"</nowiki>|#FFB100}}
            {{Cl|IF}} controltype(controllevel) < {{Text|10|#F580B1}} {{Cl|OR (boolean)|OR}} controltype(controllevel) > {{Text|17|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"END SELECT without SELECT CASE"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|IF}} NoChecks = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} vWatchOn = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Text|vWatchAddLabel|#55FF55}} linenumber, {{Text|0|#F580B1}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*__LONG_VWATCH_LINENUMBER= "</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(linenumber) + {{Text|<nowiki>"; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} SelectCaseCounter > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} SelectCaseHasCaseBlock(SelectCaseCounter) = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Text|<nowiki>'warn user of empty SELECT CASE block</nowiki>|#919191}}
                {{Cl|IF}} {{Cl|NOT}} IgnoreWarnings {{Cl|THEN}}
                    {{Text|addWarning|#55FF55}} linenumber, inclevel, inclinenumber(inclevel), incname$(inclevel), {{Text|<nowiki>"empty SELECT CASE block"</nowiki>|#FFB100}}, {{Text|<nowiki>""</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            controllevel = controllevel - {{Text|1|#F580B1}}
            SelectCaseCounter = SelectCaseCounter - {{Text|1|#F580B1}}
            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"End"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"Select"</nowiki>|#FFB100}})
            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
            {{Cl|GOTO}} finishednonexec {{Text|<nowiki>'***no error causing code, event checking done by SELECT CASE***</nowiki>|#919191}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'prevents code from being placed before 'CASE condition' in a SELECT CASE block</nowiki>|#919191}}
    {{Cl|IF}} n >= {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} firstelement$ <> {{Text|<nowiki>"CASE"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} SelectCaseCounter > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} SelectCaseHasCaseBlock(SelectCaseCounter) = {{Text|0|#F580B1}} {{Cl|THEN}}
        a$ = {{Text|<nowiki>"Expected CASE expression"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'CASE</nowiki>|#919191}}
    {{Cl|IF}} n >= {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"CASE"</nowiki>|#FFB100}} {{Cl|THEN}}
            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Case"</nowiki>|#FFB100}})
            {{Text|<nowiki>'complete current case if necessary</nowiki>|#919191}}
            {{Text|<nowiki>'18=CASE (awaiting END SELECT/CASE/CASE ELSE)</nowiki>|#919191}}
            {{Text|<nowiki>'19=CASE ELSE (awaiting END SELECT)</nowiki>|#919191}}
            {{Cl|IF}} controltype(controllevel) = {{Text|19|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected END SELECT"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|IF}} controltype(controllevel) = {{Text|18|#F580B1}} {{Cl|THEN}}
                lhscontrollevel = lhscontrollevel - {{Text|1|#F580B1}}
                controllevel = controllevel - {{Text|1|#F580B1}}
                everycasenewcase = everycasenewcase + {{Text|1|#F580B1}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sc_ec_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(everycasenewcase) + {{Text|<nowiki>"_end:;"</nowiki>|#FFB100}}
                {{Cl|IF}} EveryCaseSet(SelectCaseCounter) = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"goto sc_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(controlid(controllevel)) + {{Text|<nowiki>"_end;"</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sc_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(controlid(controllevel)) + {{Text|<nowiki>"_var=-1;"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                {{Text|<nowiki>'following line fixes problem related to RESUME after error</nowiki>|#919191}}
                {{Text|<nowiki>'statementn = statementn + 1</nowiki>|#919191}}
                {{Text|<nowiki>'if nochecks=0 then WriteBufLine MainTxtBuf, "S_" + str2$(statementn) + ":;"</nowiki>|#919191}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} controltype(controllevel) <> {{Text|6|#F580B1}} {{Cl|AND (boolean)|AND}} (controltype(controllevel) < {{Text|10|#F580B1}} {{Cl|OR (boolean)|OR}} controltype(controllevel) > {{Text|17|#F580B1}}) {{Cl|THEN}} a$ = {{Text|<nowiki>"CASE without SELECT CASE"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected CASE expression"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            SelectCaseHasCaseBlock(SelectCaseCounter) = {{Text|-1|#F580B1}}
            {{Text|<nowiki>'upgrade:</nowiki>|#919191}}
            {{Text|<nowiki>'#1: variables can be referred to directly by storing an id in 'controlref'</nowiki>|#919191}}
            {{Text|<nowiki>'    (but not if part of an array etc.)</nowiki>|#919191}}
            {{Text|<nowiki>'DIM controlvalue(1000) AS LONG</nowiki>|#919191}}
            {{Text|<nowiki>'#2: more types will be available</nowiki>|#919191}}
            {{Text|<nowiki>'    +SINGLE</nowiki>|#919191}}
            {{Text|<nowiki>'    +DOUBLE</nowiki>|#919191}}
            {{Text|<nowiki>'    -LONG DOUBLE</nowiki>|#919191}}
            {{Text|<nowiki>'    +INT32</nowiki>|#919191}}
            {{Text|<nowiki>'    +UINT32</nowiki>|#919191}}
            {{Text|<nowiki>'14=SELECT CASE float ...</nowiki>|#919191}}
            {{Text|<nowiki>'15=SELECT CASE double</nowiki>|#919191}}
            {{Text|<nowiki>'16=SELECT CASE int32</nowiki>|#919191}}
            {{Text|<nowiki>'17=SELECT CASE uint32</nowiki>|#919191}}
            {{Text|<nowiki>'10=SELECT CASE qbs (awaiting END SELECT/CASE)</nowiki>|#919191}}
            {{Text|<nowiki>'11=SELECT CASE int64 (awaiting END SELECT/CASE)</nowiki>|#919191}}
            {{Text|<nowiki>'12=SELECT CASE uint64 (awaiting END SELECT/CASE)</nowiki>|#919191}}
            {{Text|<nowiki>'13=SELECT CASE LONG double (awaiting END SELECT/CASE/CASE ELSE)</nowiki>|#919191}}
            {{Text|<nowiki>'14=SELECT CASE float ...</nowiki>|#919191}}
            {{Text|<nowiki>'15=SELECT CASE double</nowiki>|#919191}}
            {{Text|<nowiki>'16=SELECT CASE int32</nowiki>|#919191}}
            {{Text|<nowiki>'17=SELECT CASE uint32</nowiki>|#919191}}
            {{Text|<nowiki>'    bits = targettyp AND 511</nowiki>|#919191}}
            {{Text|<nowiki>'                                IF bits <= 16 THEN e$ = "qbr_float_to_long(" + e$ + ")"</nowiki>|#919191}}
            {{Text|<nowiki>'                                IF bits > 16 AND bits < 32 THEN e$ = "qbr_double_to_long(" + e$ + ")"</nowiki>|#919191}}
            {{Text|<nowiki>'                                IF bits >= 32 THEN e$ = "qbr(" + e$ + ")"</nowiki>|#919191}}
            t = controltype(controllevel) - {{Text|10|#F580B1}}
            {{Text|<nowiki>'get required type cast, and float options</nowiki>|#919191}}
            flt = {{Text|0|#F580B1}}
            {{Cl|IF}} t = {{Text|0|#F580B1}} {{Cl|THEN}} tc$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Cl|IF}} t = {{Text|1|#F580B1}} {{Cl|THEN}} tc$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Cl|IF}} t = {{Text|2|#F580B1}} {{Cl|THEN}} tc$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Cl|IF}} t = {{Text|3|#F580B1}} {{Cl|THEN}} tc$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: flt = {{Text|1|#F580B1}}
            {{Cl|IF}} t = {{Text|4|#F580B1}} {{Cl|THEN}} tc$ = {{Text|<nowiki>"(float)"</nowiki>|#FFB100}}: flt = {{Text|1|#F580B1}}
            {{Cl|IF}} t = {{Text|5|#F580B1}} {{Cl|THEN}} tc$ = {{Text|<nowiki>"(double)"</nowiki>|#FFB100}}: flt = {{Text|1|#F580B1}}
            {{Cl|IF}} t = {{Text|6|#F580B1}} {{Cl|THEN}} tc$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Cl|IF}} t = {{Text|7|#F580B1}} {{Cl|THEN}} tc$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            n$ = {{Text|<nowiki>"sc_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(controlid(controllevel))
            cv = controlvalue(controllevel)
            {{Cl|IF}} cv {{Cl|THEN}}
                n$ = {{Text|refer$|#55FF55}}({{Text|str2$|#55FF55}}(cv), {{Text|0|#F580B1}}, {{Text|0|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'CASE ELSE</nowiki>|#919191}}
            {{Cl|IF}} n = {{Text|2|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} {{Text|getelement$|#55FF55}}(a$, {{Text|2|#F580B1}}) = {{Text|<nowiki>"C-EL"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} EveryCaseSet(SelectCaseCounter) {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (sc_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(controlid(controllevel)) + {{Text|<nowiki>"_var==0) {"</nowiki>|#FFB100}}
                    controllevel = controllevel + {{Text|1|#F580B1}}: controltype(controllevel) = {{Text|19|#F580B1}}
                    controlref(controllevel) = controlref(controllevel - {{Text|1|#F580B1}})
                    l$ = l$ + sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Else"</nowiki>|#FFB100}})
                    layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                    {{Cl|GOTO}} finishednonexec {{Text|<nowiki>'***no error causing code, event checking done by SELECT CASE***</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} NoChecks = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"S_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(statementn) + {{Text|<nowiki>":;"</nowiki>|#FFB100}}: dynscope = {{Text|1|#F580B1}}
                {{Cl|IF}} vWatchOn = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Text|vWatchAddLabel|#55FF55}} linenumber, {{Text|0|#F580B1}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*__LONG_VWATCH_LINENUMBER= "</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(linenumber) + {{Text|<nowiki>"; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            f12$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            nexp = {{Text|0|#F580B1}}
            B = {{Text|0|#F580B1}}
            e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Cl|FOR}} i = {{Text|2|#F580B1}} {{Cl|TO}} n
                e2$ = {{Text|getelement$|#55FF55}}(ca$, i)
                {{Cl|IF}} e2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} B = B + {{Text|1|#F580B1}}
                {{Cl|IF}} e2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} B = B - {{Text|1|#F580B1}}
                {{Cl|IF}} i = n {{Cl|THEN}} e$ = e$ + sp + e2$
                {{Cl|IF}} i = n {{Cl|OR (boolean)|OR}} (e2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} B = {{Text|0|#F580B1}}) {{Cl|THEN}}
                    {{Cl|IF}} nexp <> {{Text|0|#F580B1}} {{Cl|THEN}} l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}}: f12$ = f12$ + {{Text|<nowiki>"||"</nowiki>|#FFB100}}
                    {{Cl|IF}} e$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected expression"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    e$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - {{Text|1|#F580B1}})
                    {{Text|<nowiki>'TYPE 1? ... TO ...</nowiki>|#919191}}
                    n2 = {{Text|numelements|#55FF55}}(e$)
                    b2 = {{Text|0|#F580B1}}
                    el$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: er$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    usedto = {{Text|0|#F580B1}}
                    {{Cl|FOR}} i2 = {{Text|1|#F580B1}} {{Cl|TO}} n2
                        e3$ = {{Text|getelement$|#55FF55}}(e$, i2)
                        {{Cl|IF}} e3$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} b2 = b2 + {{Text|1|#F580B1}}
                        {{Cl|IF}} e3$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} b2 = b2 - {{Text|1|#F580B1}}
                        {{Cl|IF}} b2 = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|UCASE$}}(e3$) = {{Text|<nowiki>"TO"</nowiki>|#FFB100}} {{Cl|THEN}}
                            usedto = {{Text|1|#F580B1}}
                        {{Cl|ELSE}}
                            {{Cl|IF}} usedto = {{Text|0|#F580B1}} {{Cl|THEN}} el$ = el$ + sp + e3$ {{Cl|ELSE}} er$ = er$ + sp + e3$
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|NEXT}}
                    {{Cl|IF}} usedto = {{Text|1|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} el$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} er$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected expression TO expression"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                        el$ = {{Cl|RIGHT$}}(el$, {{Cl|LEN}}(el$) - {{Text|1|#F580B1}}): er$ = {{Cl|RIGHT$}}(er$, {{Cl|LEN}}(er$) - {{Text|1|#F580B1}})
                        {{Text|<nowiki>'evaluate each side</nowiki>|#919191}}
                        {{Cl|FOR}} i2 = {{Text|1|#F580B1}} {{Cl|TO}} {{Text|2|#F580B1}}
                            {{Cl|IF}} i2 = {{Text|1|#F580B1}} {{Cl|THEN}} e$ = el$ {{Cl|ELSE}} e$ = er$
                            e$ = {{Text|fixoperationorder|#55FF55}}(e$)
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Cl|IF}} i2 = {{Text|1|#F580B1}} {{Cl|THEN}} l$ = l$ + sp + tlayout$ {{Cl|ELSE}} l$ = l$ + sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"To"</nowiki>|#FFB100}}) + sp + tlayout$
                            e$ = {{Text|evaluate|#55FF55}}(e$, typ)
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer|#55FF55}}(e$, typ, {{Text|0|#F580B1}})
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Cl|IF}} t = {{Text|0|#F580B1}} {{Cl|THEN}}
                                {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected string expression"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                {{Cl|IF}} i2 = {{Text|1|#F580B1}} {{Cl|THEN}} f12$ = f12$ + {{Text|<nowiki>"(qbs_greaterorequal("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")&&qbs_lessorequal("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>","</nowiki>|#FFB100}}
                                {{Cl|IF}} i2 = {{Text|2|#F580B1}} {{Cl|THEN}} f12$ = f12$ + e$ + {{Text|<nowiki>"))"</nowiki>|#FFB100}}
                            {{Cl|ELSE}}
                                {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected numeric expression"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                {{Text|<nowiki>'round to integer?</nowiki>|#919191}}
                                {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}}
                                    {{Cl|IF}} t = {{Text|1|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"qbr("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                                    {{Cl|IF}} t = {{Text|2|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"qbr_longdouble_to_uint64("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                                    {{Cl|IF}} t = {{Text|6|#F580B1}} {{Cl|OR (boolean)|OR}} t = {{Text|7|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"qbr_double_to_long("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|<nowiki>'cast result?</nowiki>|#919191}}
                                {{Cl|IF}} {{Cl|LEN}}(tc$) {{Cl|THEN}} e$ = tc$ + {{Text|<nowiki>"("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                                {{Cl|IF}} i2 = {{Text|1|#F580B1}} {{Cl|THEN}} f12$ = f12$ + {{Text|<nowiki>"(("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>">=("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"))&&("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"<=("</nowiki>|#FFB100}}
                                {{Cl|IF}} i2 = {{Text|2|#F580B1}} {{Cl|THEN}} f12$ = f12$ + e$ + {{Text|<nowiki>")))"</nowiki>|#FFB100}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|NEXT}}
                        {{Cl|GOTO}} addedexp
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|<nowiki>'10=SELECT CASE qbs (awaiting END SELECT/CASE)</nowiki>|#919191}}
                    {{Text|<nowiki>'11=SELECT CASE int64 (awaiting END SELECT/CASE)</nowiki>|#919191}}
                    {{Text|<nowiki>'12=SELECT CASE uint64 (awaiting END SELECT/CASE)</nowiki>|#919191}}
                    {{Text|<nowiki>'13=SELECT CASE LONG double (awaiting END SELECT/CASE/CASE ELSE)</nowiki>|#919191}}
                    {{Text|<nowiki>'14=SELECT CASE float ...</nowiki>|#919191}}
                    {{Text|<nowiki>'15=SELECT CASE double</nowiki>|#919191}}
                    {{Text|<nowiki>'16=SELECT CASE int32</nowiki>|#919191}}
                    {{Text|<nowiki>'17=SELECT CASE uint32</nowiki>|#919191}}
                    {{Text|<nowiki>'    bits = targettyp AND 511</nowiki>|#919191}}
                    {{Text|<nowiki>'                                IF bits <= 16 THEN e$ = "qbr_float_to_long(" + e$ + ")"</nowiki>|#919191}}
                    {{Text|<nowiki>'                                IF bits > 16 AND bits < 32 THEN e$ = "qbr_double_to_long(" + e$ + ")"</nowiki>|#919191}}
                    {{Text|<nowiki>'                                IF bits >= 32 THEN e$ = "qbr(" + e$ + ")"</nowiki>|#919191}}
                    o$ = {{Text|<nowiki>"=="</nowiki>|#FFB100}} {{Text|<nowiki>'used by type 3</nowiki>|#919191}}
                    {{Text|<nowiki>'TYPE 2?</nowiki>|#919191}}
                    x$ = {{Text|getelement$|#55FF55}}(e$, {{Text|1|#F580B1}})
                    {{Cl|IF}} {{Text|isoperator|#55FF55}}(x$) {{Cl|THEN}} {{Text|<nowiki>'non-standard usage correction</nowiki>|#919191}}
                        {{Cl|IF}} x$ = {{Text|<nowiki>"="</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} x$ = {{Text|<nowiki>"<>"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} x$ = {{Text|<nowiki>">"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} x$ = {{Text|<nowiki>"<"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} x$ = {{Text|<nowiki>">="</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} x$ = {{Text|<nowiki>"<="</nowiki>|#FFB100}} {{Cl|THEN}}
                            e$ = {{Text|<nowiki>"IS"</nowiki>|#FFB100}} + sp + e$
                            x$ = {{Text|<nowiki>"IS"</nowiki>|#FFB100}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} {{Cl|UCASE$}}(x$) = {{Text|<nowiki>"IS"</nowiki>|#FFB100}} {{Cl|THEN}}
                        n2 = {{Text|numelements|#55FF55}}(e$)
                        {{Cl|IF}} n2 < {{Text|3|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected IS =,<>,>,<,>=,<= expression"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                        o$ = {{Text|getelement$|#55FF55}}(e$, {{Text|2|#F580B1}})
                        o2$ = o$
                        o = {{Text|0|#F580B1}}
                        {{Cl|IF}} o$ = {{Text|<nowiki>"="</nowiki>|#FFB100}} {{Cl|THEN}} o$ = {{Text|<nowiki>"=="</nowiki>|#FFB100}}: o = {{Text|1|#F580B1}}
                        {{Cl|IF}} o$ = {{Text|<nowiki>"<>"</nowiki>|#FFB100}} {{Cl|THEN}} o$ = {{Text|<nowiki>"!="</nowiki>|#FFB100}}: o = {{Text|1|#F580B1}}
                        {{Cl|IF}} o$ = {{Text|<nowiki>">"</nowiki>|#FFB100}} {{Cl|THEN}} o = {{Text|1|#F580B1}}
                        {{Cl|IF}} o$ = {{Text|<nowiki>"<"</nowiki>|#FFB100}} {{Cl|THEN}} o = {{Text|1|#F580B1}}
                        {{Cl|IF}} o$ = {{Text|<nowiki>">="</nowiki>|#FFB100}} {{Cl|THEN}} o = {{Text|1|#F580B1}}
                        {{Cl|IF}} o$ = {{Text|<nowiki>"<="</nowiki>|#FFB100}} {{Cl|THEN}} o = {{Text|1|#F580B1}}
                        {{Cl|IF}} o <> {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected IS =,<>,>,<,>=,<= expression"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                        l$ = l$ + sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Is"</nowiki>|#FFB100}}) + sp + o2$
                        e$ = {{Text|getelements$|#55FF55}}(e$, {{Text|3|#F580B1}}, n2)
                        {{Text|<nowiki>'fall through to type 3 using modified e$ & o$</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|<nowiki>'TYPE 3? simple expression</nowiki>|#919191}}
                    e$ = {{Text|fixoperationorder|#55FF55}}(e$)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    l$ = l$ + sp + tlayout$
                    e$ = {{Text|evaluate|#55FF55}}(e$, typ)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer|#55FF55}}(e$, typ, {{Text|0|#F580B1}})
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    {{Cl|IF}} t = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Text|<nowiki>'string comparison</nowiki>|#919191}}
                        {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected string expression"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                        {{Cl|IF}} o$ = {{Text|<nowiki>"=="</nowiki>|#FFB100}} {{Cl|THEN}} o$ = {{Text|<nowiki>"qbs_equal"</nowiki>|#FFB100}}
                        {{Cl|IF}} o$ = {{Text|<nowiki>"!="</nowiki>|#FFB100}} {{Cl|THEN}} o$ = {{Text|<nowiki>"qbs_notequal"</nowiki>|#FFB100}}
                        {{Cl|IF}} o$ = {{Text|<nowiki>">"</nowiki>|#FFB100}} {{Cl|THEN}} o$ = {{Text|<nowiki>"qbs_greaterthan"</nowiki>|#FFB100}}
                        {{Cl|IF}} o$ = {{Text|<nowiki>"<"</nowiki>|#FFB100}} {{Cl|THEN}} o$ = {{Text|<nowiki>"qbs_lessthan"</nowiki>|#FFB100}}
                        {{Cl|IF}} o$ = {{Text|<nowiki>">="</nowiki>|#FFB100}} {{Cl|THEN}} o$ = {{Text|<nowiki>"qbs_greaterorequal"</nowiki>|#FFB100}}
                        {{Cl|IF}} o$ = {{Text|<nowiki>"<="</nowiki>|#FFB100}} {{Cl|THEN}} o$ = {{Text|<nowiki>"qbs_lessorequal"</nowiki>|#FFB100}}
                        f12$ = f12$ + o$ + {{Text|<nowiki>"("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                    {{Cl|ELSE}}
                        {{Text|<nowiki>'numeric</nowiki>|#919191}}
                        {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected numeric expression"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                        {{Text|<nowiki>'round to integer?</nowiki>|#919191}}
                        {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}}
                            {{Cl|IF}} t = {{Text|1|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"qbr("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                            {{Cl|IF}} t = {{Text|2|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"qbr_longdouble_to_uint64("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                            {{Cl|IF}} t = {{Text|6|#F580B1}} {{Cl|OR (boolean)|OR}} t = {{Text|7|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"qbr_double_to_long("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Text|<nowiki>'cast result?</nowiki>|#919191}}
                        {{Cl|IF}} {{Cl|LEN}}(tc$) {{Cl|THEN}} e$ = tc$ + {{Text|<nowiki>"("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                        f12$ = f12$ + {{Text|<nowiki>"("</nowiki>|#FFB100}} + n$ + o$ + {{Text|<nowiki>"("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"))"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                    addedexp:
                    e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    nexp = nexp + {{Text|1|#F580B1}}
                {{Cl|ELSE}}
                    e$ = e$ + sp + e2$
                {{Cl|END}} {{Cl|IF}}
            {{Cl|NEXT}}
            {{Cl|IF}} stringprocessinghappened {{Cl|THEN}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (("</nowiki>|#FFB100}} + cleanupstringprocessingcall$ + f12$ + {{Text|<nowiki>"))||new_error){"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (("</nowiki>|#FFB100}} + f12$ + {{Text|<nowiki>")||new_error){"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
            controllevel = controllevel + {{Text|1|#F580B1}}
            controlref(controllevel) = controlref(controllevel - {{Text|1|#F580B1}})
            controltype(controllevel) = {{Text|18|#F580B1}}
            {{Cl|GOTO}} finishedline
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'static scope commands:</nowiki>|#919191}}
    {{Cl|IF}} NoChecks = {{Text|0|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} vWatchOn = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Cl|THEN}}
            {{Text|vWatchAddLabel|#55FF55}} linenumber, {{Text|0|#F580B1}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"do{*__LONG_VWATCH_LINENUMBER= "</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(linenumber) + {{Text|<nowiki>"; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"</nowiki>|#FFB100}}
        {{Cl|ELSE}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"do{"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'WriteBufLine MainTxtBuf, "S_" + str2$(statementn) + ":;"</nowiki>|#919191}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} n > {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"PALETTE"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} secondelement$ = {{Text|<nowiki>"USING"</nowiki>|#FFB100}} {{Cl|THEN}}
                l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Palette"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"Using"</nowiki>|#FFB100}} + sp)
                {{Cl|IF}} n < {{Text|3|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected PALETTE USING array-name"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Text|<nowiki>'check array</nowiki>|#919191}}
                e$ = {{Text|getelement$|#55FF55}}(ca$, {{Text|3|#F580B1}})
                {{Cl|IF}} {{Text|FindArray|#55FF55}}(e$) {{Cl|THEN}}
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    z = {{Text|1|#F580B1}}
                    t = id.arraytype
                    {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) <> {{Text|16|#F580B1}} {{Cl|AND (boolean)|AND}} (t {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) <> {{Text|32|#F580B1}} {{Cl|THEN}} z = {{Text|0|#F580B1}}
                    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISFLOAT {{Cl|THEN}} z = {{Text|0|#F580B1}}
                    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISOFFSETINBITS {{Cl|THEN}} z = {{Text|0|#F580B1}}
                    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}} z = {{Text|0|#F580B1}}
                    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}} z = {{Text|0|#F580B1}}
                    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISUNSIGNED {{Cl|THEN}} z = {{Text|0|#F580B1}}
                    {{Cl|IF}} z = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Array must be of type INTEGER or LONG"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    bits = t {{Cl|AND}} {{Text|511|#F580B1}}
                    {{Cl|GOTO}} pu_gotarray
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                a$ = {{Text|<nowiki>"Expected PALETTE USING array-name"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                pu_gotarray:
                {{Text|<nowiki>'add () if index not specified</nowiki>|#919191}}
                {{Cl|IF}} n = {{Text|3|#F580B1}} {{Cl|THEN}}
                    e$ = e$ + sp + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    {{Cl|IF}} n = {{Text|4|#F580B1}} {{Cl|OR (boolean)|OR}} {{Text|getelement$|#55FF55}}(a$, {{Text|4|#F580B1}}) <> {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} {{Text|getelement$|#55FF55}}(a$, n) <> {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected PALETTE USING array-name(...)"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    e$ = e$ + sp + {{Text|getelements$|#55FF55}}(ca$, {{Text|4|#F580B1}}, n)
                {{Cl|END}} {{Cl|IF}}
                e$ = {{Text|fixoperationorder$|#55FF55}}(e$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                l$ = l$ + tlayout$
                e$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|-2|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_paletteusing("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bits) + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                {{Cl|GOTO}} finishedline
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'using</nowiki>|#919191}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'palette</nowiki>|#919191}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'n>1</nowiki>|#919191}}
    {{Cl|IF}} firstelement$ = {{Text|<nowiki>"KEY"</nowiki>|#FFB100}} {{Cl|THEN}}
        {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected KEY ..."</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
        l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"KEY"</nowiki>|#FFB100}}) + sp
        {{Cl|IF}} secondelement$ = {{Text|<nowiki>"OFF"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} n > {{Text|2|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected KEY OFF only"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            l$ = l$ + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Off"</nowiki>|#FFB100}}): layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"key_off();"</nowiki>|#FFB100}}
            {{Cl|GOTO}} finishedline
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} secondelement$ = {{Text|<nowiki>"ON"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} n > {{Text|2|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected KEY ON only"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            l$ = l$ + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"On"</nowiki>|#FFB100}}): layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"key_on();"</nowiki>|#FFB100}}
            {{Cl|GOTO}} finishedline
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} secondelement$ = {{Text|<nowiki>"LIST"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} n > {{Text|2|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected KEY LIST only"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            l$ = l$ + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"List"</nowiki>|#FFB100}}): layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"key_list();"</nowiki>|#FFB100}}
            {{Cl|GOTO}} finishedline
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'search for comma to indicate assignment</nowiki>|#919191}}
        B = {{Text|0|#F580B1}}: e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Cl|FOR}} i = {{Text|2|#F580B1}} {{Cl|TO}} n
            e2$ = {{Text|getelement|#55FF55}}(ca$, i)
            {{Cl|IF}} e2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} B = B + {{Text|1|#F580B1}}
            {{Cl|IF}} e2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} B = B - {{Text|1|#F580B1}}
            {{Cl|IF}} e2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} B = {{Text|0|#F580B1}} {{Cl|THEN}}
                i = i + {{Text|1|#F580B1}}: {{Cl|GOTO}} key_assignment
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} {{Cl|LEN}}(e$) {{Cl|THEN}} e$ = e$ + sp + e2$ {{Cl|ELSE}} e$ = e2$
        {{Cl|NEXT}}
        {{Text|<nowiki>'assume KEY(x) ON/OFF/STOP and handle as a sub</nowiki>|#919191}}
        {{Cl|GOTO}} key_fallthrough
        key_assignment:
        {{Text|<nowiki>'KEY x, "string"</nowiki>|#919191}}
        {{Text|<nowiki>'index</nowiki>|#919191}}
        e$ = {{Text|fixoperationorder|#55FF55}}(e$)
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
        l$ = l$ + tlayout$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp
        e$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|32&|#F580B1}})
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
        {{Text|WriteBufRawData|#55FF55}} MainTxtBuf, {{Text|<nowiki>"key_assign("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>","</nowiki>|#FFB100}}
        {{Text|<nowiki>'string</nowiki>|#919191}}
        e$ = {{Text|getelements$|#55FF55}}(ca$, i, n)
        e$ = {{Text|fixoperationorder|#55FF55}}(e$)
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
        l$ = l$ + tlayout$
        e$ = {{Text|evaluatetotyp|#55FF55}}(e$, ISSTRING)
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, e$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
        layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
        {{Cl|GOTO}} finishedline
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'KEY</nowiki>|#919191}}
    key_fallthrough:
    {{Cl|IF}} firstelement$ = {{Text|<nowiki>"FIELD"</nowiki>|#FFB100}} {{Cl|THEN}}
        {{Text|<nowiki>'get filenumber</nowiki>|#919191}}
        B = {{Text|0|#F580B1}}: e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Cl|FOR}} i = {{Text|2|#F580B1}} {{Cl|TO}} n
            e2$ = {{Text|getelement|#55FF55}}(ca$, i)
            {{Cl|IF}} e2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} B = B + {{Text|1|#F580B1}}
            {{Cl|IF}} e2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} B = B - {{Text|1|#F580B1}}
            {{Cl|IF}} e2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} B = {{Text|0|#F580B1}} {{Cl|THEN}}
                i = i + {{Text|1|#F580B1}}: {{Cl|GOTO}} fieldgotfn
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} {{Cl|LEN}}(e$) {{Cl|THEN}} e$ = e$ + sp + e2$ {{Cl|ELSE}} e$ = e2$
        {{Cl|NEXT}}
        {{Cl|GOTO}} fielderror
        fieldgotfn:
        {{Cl|IF}} e$ = {{Text|<nowiki>"#"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} {{Cl|LEN}}(e$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} fielderror
        {{Cl|IF}} {{Cl|LEFT$}}(e$, {{Text|2|#F580B1}}) = {{Text|<nowiki>"#"</nowiki>|#FFB100}} + sp {{Cl|THEN}} e$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - {{Text|2|#F580B1}}): l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Field"</nowiki>|#FFB100}}) + sp + {{Text|<nowiki>"#"</nowiki>|#FFB100}} + sp2 {{Cl|ELSE}} l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Field"</nowiki>|#FFB100}}) + sp
        e$ = {{Text|fixoperationorder|#55FF55}}(e$)
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
        l$ = l$ + tlayout$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp
        e$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|32&|#F580B1}})
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"field_new("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
        fieldnext:
        {{Text|<nowiki>'get fieldwidth</nowiki>|#919191}}
        {{Cl|IF}} i > n {{Cl|THEN}} {{Cl|GOTO}} fielderror
        B = {{Text|0|#F580B1}}: e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Cl|FOR}} i = i {{Cl|TO}} n
            e2$ = {{Text|getelement|#55FF55}}(ca$, i)
            {{Cl|IF}} e2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} B = B + {{Text|1|#F580B1}}
            {{Cl|IF}} e2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} B = B - {{Text|1|#F580B1}}
            {{Cl|IF}} {{Cl|UCASE$}}(e2$) = {{Text|<nowiki>"AS"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} B = {{Text|0|#F580B1}} {{Cl|THEN}}
                i = i + {{Text|1|#F580B1}}: {{Cl|GOTO}} fieldgotfw
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} {{Cl|LEN}}(e$) {{Cl|THEN}} e$ = e$ + sp + e2$ {{Cl|ELSE}} e$ = e2$
        {{Cl|NEXT}}
        {{Cl|GOTO}} fielderror
        fieldgotfw:
        {{Cl|IF}} {{Cl|LEN}}(e$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} fielderror
        e$ = {{Text|fixoperationorder|#55FF55}}(e$)
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
        l$ = l$ + tlayout$ + sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"As"</nowiki>|#FFB100}}) + sp
        sizee$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|32&|#F580B1}})
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
        {{Text|<nowiki>'get variable name</nowiki>|#919191}}
        {{Cl|IF}} i > n {{Cl|THEN}} {{Cl|GOTO}} fielderror
        B = {{Text|0|#F580B1}}: e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Cl|FOR}} i = i {{Cl|TO}} n
            e2$ = {{Text|getelement|#55FF55}}(ca$, i)
            {{Cl|IF}} e2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} B = B + {{Text|1|#F580B1}}
            {{Cl|IF}} e2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} B = B - {{Text|1|#F580B1}}
            {{Cl|IF}} (i = n {{Cl|OR (boolean)|OR}} e2$ = {{Text|<nowiki>","</nowiki>|#FFB100}}) {{Cl|AND (boolean)|AND}} B = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} e2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}} i = i - {{Text|1|#F580B1}}
                {{Cl|IF}} i = n {{Cl|THEN}}
                    {{Cl|IF}} {{Cl|LEN}}(e$) {{Cl|THEN}} e$ = e$ + sp + e2$ {{Cl|ELSE}} e$ = e2$
                {{Cl|END}} {{Cl|IF}}
                {{Cl|GOTO}} fieldgotfname
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} {{Cl|LEN}}(e$) {{Cl|THEN}} e$ = e$ + sp + e2$ {{Cl|ELSE}} e$ = e2$
        {{Cl|NEXT}}
        {{Cl|GOTO}} fielderror
        fieldgotfname:
        {{Cl|IF}} {{Cl|LEN}}(e$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} fielderror
        {{Text|<nowiki>'evaluate it to check it is a STRING</nowiki>|#919191}}
        e$ = {{Text|fixoperationorder|#55FF55}}(e$)
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
        l$ = l$ + tlayout$
        e$ = {{Text|evaluate|#55FF55}}(e$, typ)
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
        {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} fielderror
        {{Cl|IF}} typ {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH {{Cl|THEN}} a$ = {{Text|<nowiki>"Fixed length strings cannot be used in a FIELD statement"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
        {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISREFERENCE) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} fielderror
        e$ = {{Text|refer|#55FF55}}(e$, typ, {{Text|0|#F580B1}})
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"field_add("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + sizee$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
        {{Cl|IF}} i < n {{Cl|THEN}}
            i = i + {{Text|1|#F580B1}}
            e$ = {{Text|getelement|#55FF55}}(a$, i)
            {{Cl|IF}} e$ <> {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ,"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp
            i = i + {{Text|1|#F580B1}}
            {{Cl|GOTO}} fieldnext
        {{Cl|END}} {{Cl|IF}}
        layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
        {{Cl|GOTO}} finishedline
        fielderror: a$ = {{Text|<nowiki>"Expected FIELD #filenumber, characters AS variable$, ..."</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'1=IF (awaiting END IF)</nowiki>|#919191}}
    {{Text|<nowiki>'2=FOR (awaiting NEXT)</nowiki>|#919191}}
    {{Text|<nowiki>'3=DO (awaiting LOOP [UNTIL|WHILE param])</nowiki>|#919191}}
    {{Text|<nowiki>'4=DO WHILE/UNTIL (awaiting LOOP)</nowiki>|#919191}}
    {{Text|<nowiki>'5=WHILE (awaiting WEND)</nowiki>|#919191}}
    {{Cl|IF}} n = {{Text|2|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"EXIT"</nowiki>|#FFB100}} {{Cl|THEN}}
            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Exit"</nowiki>|#FFB100}}) + sp
            {{Cl|IF}} secondelement$ = {{Text|<nowiki>"DO"</nowiki>|#FFB100}} {{Cl|THEN}}
                {{Text|<nowiki>'scan backwards until previous control level reached</nowiki>|#919191}}
                l$ = l$ + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Do"</nowiki>|#FFB100}})
                {{Cl|FOR}} i = controllevel {{Cl|TO}} {{Text|1|#F580B1}} {{Cl|STEP}} {{Text|-1|#F580B1}}
                    t = controltype(i)
                    {{Cl|IF}} t = {{Text|3|#F580B1}} {{Cl|OR (boolean)|OR}} t = {{Text|4|#F580B1}} {{Cl|THEN}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"goto dl_exit_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(controlid(i)) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                        layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                        {{Cl|GOTO}} finishedline
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|NEXT}}
                a$ = {{Text|<nowiki>"EXIT DO without DO"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} secondelement$ = {{Text|<nowiki>"FOR"</nowiki>|#FFB100}} {{Cl|THEN}}
                {{Text|<nowiki>'scan backwards until previous control level reached</nowiki>|#919191}}
                l$ = l$ + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"For"</nowiki>|#FFB100}})
                {{Cl|FOR}} i = controllevel {{Cl|TO}} {{Text|1|#F580B1}} {{Cl|STEP}} {{Text|-1|#F580B1}}
                    t = controltype(i)
                    {{Cl|IF}} t = {{Text|2|#F580B1}} {{Cl|THEN}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"goto fornext_exit_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(controlid(i)) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                        layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                        {{Cl|GOTO}} finishedline
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|NEXT}}
                a$ = {{Text|<nowiki>"EXIT FOR without FOR"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} secondelement$ = {{Text|<nowiki>"WHILE"</nowiki>|#FFB100}} {{Cl|THEN}}
                {{Text|<nowiki>'scan backwards until previous control level reached</nowiki>|#919191}}
                l$ = l$ + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"While"</nowiki>|#FFB100}})
                {{Cl|FOR}} i = controllevel {{Cl|TO}} {{Text|1|#F580B1}} {{Cl|STEP}} {{Text|-1|#F580B1}}
                    t = controltype(i)
                    {{Cl|IF}} t = {{Text|5|#F580B1}} {{Cl|THEN}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"goto ww_exit_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(controlid(i)) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                        layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                        {{Cl|GOTO}} finishedline
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|NEXT}}
                a$ = {{Text|<nowiki>"EXIT WHILE without WHILE"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} secondelement$ = {{Text|<nowiki>"SELECT"</nowiki>|#FFB100}} {{Cl|THEN}}
                {{Text|<nowiki>'scan backwards until previous control level reached</nowiki>|#919191}}
                l$ = l$ + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Select"</nowiki>|#FFB100}})
                {{Cl|FOR}} i = controllevel {{Cl|TO}} {{Text|1|#F580B1}} {{Cl|STEP}} {{Text|-1|#F580B1}}
                    t = controltype(i)
                    {{Cl|IF}} t = {{Text|18|#F580B1}} {{Cl|OR (boolean)|OR}} t = {{Text|19|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'CASE/CASE ELSE</nowiki>|#919191}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"goto sc_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(controlid(i - {{Text|1|#F580B1}})) + {{Text|<nowiki>"_end;"</nowiki>|#FFB100}}
                        layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                        {{Cl|GOTO}} finishedline
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|NEXT}}
                a$ = {{Text|<nowiki>"EXIT SELECT without SELECT"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} secondelement$ = {{Text|<nowiki>"CASE"</nowiki>|#FFB100}} {{Cl|THEN}}
                {{Text|<nowiki>'scan backwards until previous control level reached</nowiki>|#919191}}
                l$ = l$ + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Case"</nowiki>|#FFB100}})
                {{Cl|FOR}} i = controllevel {{Cl|TO}} {{Text|1|#F580B1}} {{Cl|STEP}} {{Text|-1|#F580B1}}
                    t = controltype(i)
                    {{Cl|IF}} t = {{Text|18|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'CASE</nowiki>|#919191}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"goto sc_ec_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(everycasenewcase + {{Text|1|#F580B1}}) + {{Text|<nowiki>"_end;"</nowiki>|#FFB100}}
                        layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                        {{Cl|GOTO}} finishedline
                    {{Cl|ELSEIF}} t = {{Text|19|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'CASE ELSE</nowiki>|#919191}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"goto sc_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(controlid(i - {{Text|1|#F580B1}})) + {{Text|<nowiki>"_end;"</nowiki>|#FFB100}}
                        layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                        {{Cl|GOTO}} finishedline
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|NEXT}}
                a$ = {{Text|<nowiki>"EXIT CASE without CASE"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} n >= {{Text|2|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"ON"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} secondelement$ = {{Text|<nowiki>"STRIG"</nowiki>|#FFB100}} {{Cl|THEN}}
            DEPENDENCY(DEPENDENCY_DEVICEINPUT) = {{Text|1|#F580B1}}
            i = {{Text|3|#F580B1}}
            {{Cl|IF}} i > n {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ("</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            a2$ = {{Text|getelement$|#55FF55}}(ca$, i): i = i + {{Text|1|#F580B1}}
            {{Cl|IF}} a2$ <> {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ("</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"On"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"Strig"</nowiki>|#FFB100}} + sp2 + {{Text|<nowiki>"("</nowiki>|#FFB100}})
            {{Cl|IF}} i > n {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ..."</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            B = {{Text|0|#F580B1}}
            x = {{Text|0|#F580B1}}
            e2$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            e3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Cl|FOR}} i = i {{Cl|TO}} n
                e$ = {{Text|getelement$|#55FF55}}(ca$, i)
                a = {{Cl|ASC (function)|ASC}}(e$)
                {{Cl|IF}} a = {{Text|40|#F580B1}} {{Cl|THEN}} B = B + {{Text|1|#F580B1}}
                {{Cl|IF}} a = {{Text|41|#F580B1}} {{Cl|THEN}} B = B - {{Text|1|#F580B1}}
                {{Cl|IF}} B = {{Text|-1|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} onstriggotarg
                {{Cl|IF}} a = {{Text|44|#F580B1}} {{Cl|AND (boolean)|AND}} B = {{Text|0|#F580B1}} {{Cl|THEN}}
                    x = x + {{Text|1|#F580B1}}
                    {{Cl|IF}} x > {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected )"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    {{Cl|IF}} e2$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ... ,"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    e3$ = e2$
                    e2$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    {{Cl|IF}} {{Cl|LEN}}(e2$) {{Cl|THEN}} e2$ = e2$ + sp + e$ {{Cl|ELSE}} e2$ = e$
                {{Cl|END}} {{Cl|IF}}
            {{Cl|NEXT}}
            a$ = {{Text|<nowiki>"Expected )"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            onstriggotarg:
            {{Cl|IF}} e2$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ... )"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Text|WriteBufRawData|#55FF55}} MainTxtBuf, {{Text|<nowiki>"onstrig_setup("</nowiki>|#FFB100}}
            {{Text|<nowiki>'sort scanned results</nowiki>|#919191}}
            {{Cl|IF}} {{Cl|LEN}}(e3$) {{Cl|THEN}}
                optI$ = e3$
                optController$ = e2$
                optPassed$ = {{Text|<nowiki>"1"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                optI$ = e2$
                optController$ = {{Text|<nowiki>"0"</nowiki>|#FFB100}}
                optPassed$ = {{Text|<nowiki>"0"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'i</nowiki>|#919191}}
            e$ = {{Text|fixoperationorder$|#55FF55}}(optI$): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            l$ = l$ + sp2 + tlayout$
            e$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|32&|#F580B1}}): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Text|WriteBufRawData|#55FF55}} MainTxtBuf, e$ + {{Text|<nowiki>","</nowiki>|#FFB100}}
            {{Text|<nowiki>'controller , passed</nowiki>|#919191}}
            {{Cl|IF}} optPassed$ = {{Text|<nowiki>"1"</nowiki>|#FFB100}} {{Cl|THEN}}
                e$ = {{Text|fixoperationorder$|#55FF55}}(optController$): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp + tlayout$
                e$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|32&|#F580B1}}): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Cl|ELSE}}
                e$ = optController$
            {{Cl|END}} {{Cl|IF}}
            {{Text|WriteBufRawData|#55FF55}} MainTxtBuf, e$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + optPassed$ + {{Text|<nowiki>","</nowiki>|#FFB100}}
            l$ = l$ + sp2 + {{Text|<nowiki>")"</nowiki>|#FFB100}} + sp {{Text|<nowiki>'close brackets</nowiki>|#919191}}
            i = i + {{Text|1|#F580B1}}
            {{Cl|IF}} i > n {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected GOSUB/sub-name"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            a2$ = {{Text|getelement$|#55FF55}}(a$, i): i = i + {{Text|1|#F580B1}}
            onstrigid = onstrigid + {{Text|1|#F580B1}}
            {{Text|WriteBufRawData|#55FF55}} MainTxtBuf, {{Text|str2$|#55FF55}}(onstrigid) + {{Text|<nowiki>","</nowiki>|#FFB100}}
            {{Cl|IF}} a2$ = {{Text|<nowiki>"GOSUB"</nowiki>|#FFB100}} {{Cl|THEN}}
                {{Cl|IF}} i > n {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected linenumber/label"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                a2$ = {{Text|getelement$|#55FF55}}(ca$, i): i = i + {{Text|1|#F580B1}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"0);"</nowiki>|#FFB100}}
                {{Cl|IF}} {{Text|validlabel|#55FF55}}(a2$) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid label"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                v = {{Text|HashFind|#55FF55}}(a2$, HASHFLAG_LABEL, ignore, r)
                x = {{Text|1|#F580B1}}
                labchk60z:
                {{Cl|IF}} v {{Cl|THEN}}
                    s = Labels(r).{{Text|Scope|#55FF55}}
                    {{Cl|IF}} s = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} s = {{Text|-1|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'main scope?</nowiki>|#919191}}
                        {{Cl|IF}} s = {{Text|-1|#F580B1}} {{Cl|THEN}} Labels(r).{{Text|Scope|#55FF55}} = {{Text|0|#F580B1}} {{Text|<nowiki>'acquire scope</nowiki>|#919191}}
                        x = {{Text|0|#F580B1}} {{Text|<nowiki>'already defined</nowiki>|#919191}}
                        tlayout$ = {{Cl|RTRIM$}}(Labels(r).cn)
                        Labels(r).Scope_Restriction = subfuncn
                        Labels(r).Error_Line = linenumber
                    {{Cl|ELSE}}
                        {{Cl|IF}} v = {{Text|2|#F580B1}} {{Cl|THEN}} v = {{Text|HashFindCont|#55FF55}}(ignore, r): {{Cl|GOTO}} labchk60z
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} x {{Cl|THEN}}
                    {{Text|<nowiki>'does not exist</nowiki>|#919191}}
                    nLabels = nLabels + {{Text|1|#F580B1}}: {{Cl|IF}} nLabels > Labels_Ubound {{Cl|THEN}} Labels_Ubound = Labels_Ubound * {{Text|2|#F580B1}}: {{Cl|REDIM}} {{Cl|_PRESERVE}} Labels({{Text|1|#F580B1}} {{Cl|TO}} Labels_Ubound) {{Cl|AS}} Label_Type
                    Labels(nLabels) = Empty_Label
                    {{Text|HashAdd|#55FF55}} a2$, HASHFLAG_LABEL, nLabels
                    r = nLabels
                    Labels(r).State = {{Text|0|#F580B1}}
                    Labels(r).cn = tlayout$
                    Labels(r).{{Text|Scope|#55FF55}} = {{Text|0|#F580B1}}
                    Labels(r).Error_Line = linenumber
                    Labels(r).Scope_Restriction = subfuncn
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'x</nowiki>|#919191}}
                l$ = l$ + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"GoSub"</nowiki>|#FFB100}}) + sp + tlayout$
                {{Text|WriteBufLine|#55FF55}} StrigjTxtBuf, {{Text|<nowiki>"if(strig_event_id=="</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(onstrigid) + {{Text|<nowiki>")goto LABEL_"</nowiki>|#FFB100}} + a2$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} StrigTxtBuf, {{Text|<nowiki>"case "</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(onstrigid) + {{Text|<nowiki>":"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} StrigTxtBuf, {{Text|<nowiki>"strig_event_occurred++;"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} StrigTxtBuf, {{Text|<nowiki>"strig_event_id="</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(onstrigid) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} StrigTxtBuf, {{Text|<nowiki>"strig_event_occurred++;"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} StrigTxtBuf, {{Text|<nowiki>"return_point[next_return_point++]=0;"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} StrigTxtBuf, {{Text|<nowiki>"if (next_return_point>=return_points) more_return_points();"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} StrigTxtBuf, {{Text|<nowiki>"QBMAIN(NULL);"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} StrigTxtBuf, {{Text|<nowiki>"break;"</nowiki>|#FFB100}}
                {{Cl|IF}} {{Cl|LEN}}(layout$) = {{Text|0|#F580B1}} {{Cl|THEN}} layout$ = l$ {{Cl|ELSE}} layout$ = layout$ + sp + l$
                layoutdone = {{Text|1|#F580B1}}
                {{Cl|GOTO}} finishedline
            {{Cl|ELSE}}
                {{Text|<nowiki>'establish whether sub a2$ exists using try</nowiki>|#919191}}
                x = {{Text|0|#F580B1}}
                try = {{Text|findid|#55FF55}}(a2$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Cl|DO}} {{Cl|WHILE}} try
                    {{Cl|IF}} id.subfunc = {{Text|2|#F580B1}} {{Cl|THEN}} x = {{Text|1|#F580B1}}: {{Cl|EXIT}} {{Cl|DO}}
                    {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(a2$) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Cl|LOOP}}
                {{Cl|IF}} x = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected GOSUB/sub"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                l$ = l$ + {{Cl|RTRIM$}}(id.cn)
                {{Text|WriteBufLine|#55FF55}} StrigTxtBuf, {{Text|<nowiki>"case "</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(onstrigid) + {{Text|<nowiki>":"</nowiki>|#FFB100}}
                {{Text|WriteBufRawData|#55FF55}} StrigTxtBuf, {{Cl|RTRIM$}}(id.callname) + {{Text|<nowiki>"("</nowiki>|#FFB100}}
                {{Cl|IF}} id.args > {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"SUB requires more than one argument"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|IF}} i > n {{Cl|THEN}}
                    {{Cl|IF}} id.args = {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected argument after SUB"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"0);"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} StrigTxtBuf, {{Text|<nowiki>");"</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    {{Cl|IF}} id.args = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"SUB has no arguments"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    t = {{Cl|CVL}}(id.arg)
                    B = t {{Cl|AND}} {{Text|511|#F580B1}}
                    {{Cl|IF}} B = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} (t {{Cl|AND (boolean)|AND}} ISARRAY) <> {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} (t {{Cl|AND (boolean)|AND}} ISFLOAT) <> {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} (t {{Cl|AND (boolean)|AND}} ISSTRING) <> {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} (t {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) <> {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Only SUB arguments of integer-type allowed"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    {{Cl|IF}} B = {{Text|8|#F580B1}} {{Cl|THEN}} ct$ = {{Text|<nowiki>"int8"</nowiki>|#FFB100}}
                    {{Cl|IF}} B = {{Text|16|#F580B1}} {{Cl|THEN}} ct$ = {{Text|<nowiki>"int16"</nowiki>|#FFB100}}
                    {{Cl|IF}} B = {{Text|32|#F580B1}} {{Cl|THEN}} ct$ = {{Text|<nowiki>"int32"</nowiki>|#FFB100}}
                    {{Cl|IF}} B = {{Text|64|#F580B1}} {{Cl|THEN}} ct$ = {{Text|<nowiki>"int64"</nowiki>|#FFB100}}
                    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISOFFSET {{Cl|THEN}} ct$ = {{Text|<nowiki>"ptrszint"</nowiki>|#FFB100}}
                    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISUNSIGNED {{Cl|THEN}} ct$ = {{Text|<nowiki>"u"</nowiki>|#FFB100}} + ct$
                    {{Text|WriteBufLine|#55FF55}} StrigTxtBuf, {{Text|<nowiki>"("</nowiki>|#FFB100}} + ct$ + {{Text|<nowiki>"*)&i64);"</nowiki>|#FFB100}}
                    e$ = {{Text|getelements$|#55FF55}}(ca$, i, n)
                    e$ = {{Text|fixoperationorder$|#55FF55}}(e$)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    l$ = l$ + sp + tlayout$
                    e$ = {{Text|evaluatetotyp|#55FF55}}(e$, INTEGER64TYPE - ISPOINTER)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, e$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|WriteBufLine|#55FF55}} StrigTxtBuf, {{Text|<nowiki>"break;"</nowiki>|#FFB100}}
                {{Cl|IF}} {{Cl|LEN}}(layout$) = {{Text|0|#F580B1}} {{Cl|THEN}} layout$ = l$ {{Cl|ELSE}} layout$ = layout$ + sp + l$
                layoutdone = {{Text|1|#F580B1}}
                {{Cl|GOTO}} finishedline
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} n >= {{Text|2|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"ON"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} secondelement$ = {{Text|<nowiki>"TIMER"</nowiki>|#FFB100}} {{Cl|THEN}}
            i = {{Text|3|#F580B1}}
            {{Cl|IF}} i > n {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ("</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            a2$ = {{Text|getelement$|#55FF55}}(ca$, i): i = i + {{Text|1|#F580B1}}
            {{Cl|IF}} a2$ <> {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ("</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"On"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"Timer"</nowiki>|#FFB100}} + sp2 + {{Text|<nowiki>"("</nowiki>|#FFB100}})
            {{Cl|IF}} i > n {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ..."</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            B = {{Text|0|#F580B1}}
            x = {{Text|0|#F580B1}}
            e2$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            e3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Cl|FOR}} i = i {{Cl|TO}} n
                e$ = {{Text|getelement$|#55FF55}}(ca$, i)
                a = {{Cl|ASC (function)|ASC}}(e$)
                {{Cl|IF}} a = {{Text|40|#F580B1}} {{Cl|THEN}} B = B + {{Text|1|#F580B1}}
                {{Cl|IF}} a = {{Text|41|#F580B1}} {{Cl|THEN}} B = B - {{Text|1|#F580B1}}
                {{Cl|IF}} B = {{Text|-1|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} ontimgotarg
                {{Cl|IF}} a = {{Text|44|#F580B1}} {{Cl|AND (boolean)|AND}} B = {{Text|0|#F580B1}} {{Cl|THEN}}
                    x = x + {{Text|1|#F580B1}}
                    {{Cl|IF}} x > {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected )"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    {{Cl|IF}} e2$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ... ,"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    e3$ = e2$
                    e2$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    {{Cl|IF}} {{Cl|LEN}}(e2$) {{Cl|THEN}} e2$ = e2$ + sp + e$ {{Cl|ELSE}} e2$ = e$
                {{Cl|END}} {{Cl|IF}}
            {{Cl|NEXT}}
            a$ = {{Text|<nowiki>"Expected )"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            ontimgotarg:
            {{Cl|IF}} e2$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ... )"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Text|WriteBufRawData|#55FF55}} MainTxtBuf, {{Text|<nowiki>"ontimer_setup("</nowiki>|#FFB100}}
            {{Text|<nowiki>'i</nowiki>|#919191}}
            {{Cl|IF}} {{Cl|LEN}}(e3$) {{Cl|THEN}}
                e$ = {{Text|fixoperationorder$|#55FF55}}(e3$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                l$ = l$ + sp2 + tlayout$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp
                e$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|32&|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Text|WriteBufRawData|#55FF55}} MainTxtBuf, e$ + {{Text|<nowiki>","</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                {{Text|WriteBufRawData|#55FF55}} MainTxtBuf, {{Text|<nowiki>"0,"</nowiki>|#FFB100}}
                l$ = l$ + sp2
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'sec</nowiki>|#919191}}
            e$ = {{Text|fixoperationorder$|#55FF55}}(e2$)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            l$ = l$ + tlayout$ + sp2 + {{Text|<nowiki>")"</nowiki>|#FFB100}} + sp
            e$ = {{Text|evaluatetotyp|#55FF55}}(e$, DOUBLETYPE - ISPOINTER)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Text|WriteBufRawData|#55FF55}} MainTxtBuf, e$ + {{Text|<nowiki>","</nowiki>|#FFB100}}
            i = i + {{Text|1|#F580B1}}
            {{Cl|IF}} i > n {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected GOSUB/sub-name"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            a2$ = {{Text|getelement$|#55FF55}}(a$, i): i = i + {{Text|1|#F580B1}}
            ontimerid = ontimerid + {{Text|1|#F580B1}}
            {{Text|WriteBufRawData|#55FF55}} MainTxtBuf, {{Text|str2$|#55FF55}}(ontimerid) + {{Text|<nowiki>","</nowiki>|#FFB100}}
            {{Cl|IF}} a2$ = {{Text|<nowiki>"GOSUB"</nowiki>|#FFB100}} {{Cl|THEN}}
                {{Cl|IF}} i > n {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected linenumber/label"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                a2$ = {{Text|getelement$|#55FF55}}(ca$, i): i = i + {{Text|1|#F580B1}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"0);"</nowiki>|#FFB100}}
                {{Cl|IF}} {{Text|validlabel|#55FF55}}(a2$) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid label"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                v = {{Text|HashFind|#55FF55}}(a2$, HASHFLAG_LABEL, ignore, r)
                x = {{Text|1|#F580B1}}
                labchk60:
                {{Cl|IF}} v {{Cl|THEN}}
                    s = Labels(r).{{Text|Scope|#55FF55}}
                    {{Cl|IF}} s = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} s = {{Text|-1|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'main scope?</nowiki>|#919191}}
                        {{Cl|IF}} s = {{Text|-1|#F580B1}} {{Cl|THEN}} Labels(r).{{Text|Scope|#55FF55}} = {{Text|0|#F580B1}} {{Text|<nowiki>'acquire scope</nowiki>|#919191}}
                        x = {{Text|0|#F580B1}} {{Text|<nowiki>'already defined</nowiki>|#919191}}
                        tlayout$ = {{Cl|RTRIM$}}(Labels(r).cn)
                        Labels(r).Scope_Restriction = subfuncn
                        Labels(r).Error_Line = linenumber
                    {{Cl|ELSE}}
                        {{Cl|IF}} v = {{Text|2|#F580B1}} {{Cl|THEN}} v = {{Text|HashFindCont|#55FF55}}(ignore, r): {{Cl|GOTO}} labchk60
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} x {{Cl|THEN}}
                    {{Text|<nowiki>'does not exist</nowiki>|#919191}}
                    nLabels = nLabels + {{Text|1|#F580B1}}: {{Cl|IF}} nLabels > Labels_Ubound {{Cl|THEN}} Labels_Ubound = Labels_Ubound * {{Text|2|#F580B1}}: {{Cl|REDIM}} {{Cl|_PRESERVE}} Labels({{Text|1|#F580B1}} {{Cl|TO}} Labels_Ubound) {{Cl|AS}} Label_Type
                    Labels(nLabels) = Empty_Label
                    {{Text|HashAdd|#55FF55}} a2$, HASHFLAG_LABEL, nLabels
                    r = nLabels
                    Labels(r).State = {{Text|0|#F580B1}}
                    Labels(r).cn = tlayout$
                    Labels(r).{{Text|Scope|#55FF55}} = {{Text|0|#F580B1}}
                    Labels(r).Error_Line = linenumber
                    Labels(r).Scope_Restriction = subfuncn
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'x</nowiki>|#919191}}
                l$ = l$ + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"GoSub"</nowiki>|#FFB100}}) + sp + tlayout$
                {{Text|WriteBufLine|#55FF55}} TimejTxtBuf, {{Text|<nowiki>"if(timer_event_id=="</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(ontimerid) + {{Text|<nowiki>")goto LABEL_"</nowiki>|#FFB100}} + a2$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} TimeTxtBuf, {{Text|<nowiki>"case "</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(ontimerid) + {{Text|<nowiki>":"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} TimeTxtBuf, {{Text|<nowiki>"timer_event_occurred++;"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} TimeTxtBuf, {{Text|<nowiki>"timer_event_id="</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(ontimerid) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} TimeTxtBuf, {{Text|<nowiki>"timer_event_occurred++;"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} TimeTxtBuf, {{Text|<nowiki>"return_point[next_return_point++]=0;"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} TimeTxtBuf, {{Text|<nowiki>"if (next_return_point>=return_points) more_return_points();"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} TimeTxtBuf, {{Text|<nowiki>"QBMAIN(NULL);"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} TimeTxtBuf, {{Text|<nowiki>"break;"</nowiki>|#FFB100}}
                {{Text|<nowiki>'call validlabel (to validate the label) [see goto]</nowiki>|#919191}}
                {{Text|<nowiki>'increment ontimerid</nowiki>|#919191}}
                {{Text|<nowiki>'use ontimerid to generate the jumper routine</nowiki>|#919191}}
                {{Text|<nowiki>'etc.</nowiki>|#919191}}
                {{Cl|IF}} {{Cl|LEN}}(layout$) = {{Text|0|#F580B1}} {{Cl|THEN}} layout$ = l$ {{Cl|ELSE}} layout$ = layout$ + sp + l$
                layoutdone = {{Text|1|#F580B1}}
                {{Cl|GOTO}} finishedline
            {{Cl|ELSE}}
                {{Text|<nowiki>'establish whether sub a2$ exists using try</nowiki>|#919191}}
                x = {{Text|0|#F580B1}}
                try = {{Text|findid|#55FF55}}(a2$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Cl|DO}} {{Cl|WHILE}} try
                    {{Cl|IF}} id.subfunc = {{Text|2|#F580B1}} {{Cl|THEN}} x = {{Text|1|#F580B1}}: {{Cl|EXIT}} {{Cl|DO}}
                    {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(a2$) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Cl|LOOP}}
                {{Cl|IF}} x = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected GOSUB/sub"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                l$ = l$ + {{Cl|RTRIM$}}(id.cn)
                {{Text|WriteBufLine|#55FF55}} TimeTxtBuf, {{Text|<nowiki>"case "</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(ontimerid) + {{Text|<nowiki>":"</nowiki>|#FFB100}}
                {{Text|WriteBufRawData|#55FF55}} TimeTxtBuf, {{Cl|RTRIM$}}(id.callname) + {{Text|<nowiki>"("</nowiki>|#FFB100}}
                {{Cl|IF}} id.args > {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"SUB requires more than one argument"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|IF}} i > n {{Cl|THEN}}
                    {{Cl|IF}} id.args = {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected argument after SUB"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"0);"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} TimeTxtBuf, {{Text|<nowiki>");"</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    {{Cl|IF}} id.args = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"SUB has no arguments"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    t = {{Cl|CVL}}(id.arg)
                    B = t {{Cl|AND}} {{Text|511|#F580B1}}
                    {{Cl|IF}} B = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} (t {{Cl|AND (boolean)|AND}} ISARRAY) <> {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} (t {{Cl|AND (boolean)|AND}} ISFLOAT) <> {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} (t {{Cl|AND (boolean)|AND}} ISSTRING) <> {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} (t {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) <> {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Only SUB arguments of integer-type allowed"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    {{Cl|IF}} B = {{Text|8|#F580B1}} {{Cl|THEN}} ct$ = {{Text|<nowiki>"int8"</nowiki>|#FFB100}}
                    {{Cl|IF}} B = {{Text|16|#F580B1}} {{Cl|THEN}} ct$ = {{Text|<nowiki>"int16"</nowiki>|#FFB100}}
                    {{Cl|IF}} B = {{Text|32|#F580B1}} {{Cl|THEN}} ct$ = {{Text|<nowiki>"int32"</nowiki>|#FFB100}}
                    {{Cl|IF}} B = {{Text|64|#F580B1}} {{Cl|THEN}} ct$ = {{Text|<nowiki>"int64"</nowiki>|#FFB100}}
                    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISOFFSET {{Cl|THEN}} ct$ = {{Text|<nowiki>"ptrszint"</nowiki>|#FFB100}}
                    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISUNSIGNED {{Cl|THEN}} ct$ = {{Text|<nowiki>"u"</nowiki>|#FFB100}} + ct$
                    {{Text|WriteBufLine|#55FF55}} TimeTxtBuf, {{Text|<nowiki>"("</nowiki>|#FFB100}} + ct$ + {{Text|<nowiki>"*)&i64);"</nowiki>|#FFB100}}
                    e$ = {{Text|getelements$|#55FF55}}(ca$, i, n)
                    e$ = {{Text|fixoperationorder$|#55FF55}}(e$)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    l$ = l$ + sp + tlayout$
                    e$ = {{Text|evaluatetotyp|#55FF55}}(e$, INTEGER64TYPE - ISPOINTER)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, e$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|WriteBufLine|#55FF55}} TimeTxtBuf, {{Text|<nowiki>"break;"</nowiki>|#FFB100}}
                {{Cl|IF}} {{Cl|LEN}}(layout$) = {{Text|0|#F580B1}} {{Cl|THEN}} layout$ = l$ {{Cl|ELSE}} layout$ = layout$ + sp + l$
                layoutdone = {{Text|1|#F580B1}}
                {{Cl|GOTO}} finishedline
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} n >= {{Text|2|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"ON"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} secondelement$ = {{Text|<nowiki>"KEY"</nowiki>|#FFB100}} {{Cl|THEN}}
            i = {{Text|3|#F580B1}}
            {{Cl|IF}} i > n {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ("</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            a2$ = {{Text|getelement$|#55FF55}}(ca$, i): i = i + {{Text|1|#F580B1}}
            {{Cl|IF}} a2$ <> {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ("</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"On"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"Key"</nowiki>|#FFB100}} + sp2 + {{Text|<nowiki>"("</nowiki>|#FFB100}})
            {{Cl|IF}} i > n {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ..."</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            B = {{Text|0|#F580B1}}
            x = {{Text|0|#F580B1}}
            e2$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Cl|FOR}} i = i {{Cl|TO}} n
                e$ = {{Text|getelement$|#55FF55}}(ca$, i)
                a = {{Cl|ASC (function)|ASC}}(e$)
                {{Cl|IF}} a = {{Text|40|#F580B1}} {{Cl|THEN}} B = B + {{Text|1|#F580B1}}
                {{Cl|IF}} a = {{Text|41|#F580B1}} {{Cl|THEN}} B = B - {{Text|1|#F580B1}}
                {{Cl|IF}} B = {{Text|-1|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}}
                {{Cl|IF}} {{Cl|LEN}}(e2$) {{Cl|THEN}} e2$ = e2$ + sp + e$ {{Cl|ELSE}} e2$ = e$
            {{Cl|NEXT}}
            {{Cl|IF}} i = n + {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected )"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|IF}} e2$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ... )"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            e$ = {{Text|fixoperationorder$|#55FF55}}(e2$)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            l$ = l$ + tlayout$ + sp2 + {{Text|<nowiki>")"</nowiki>|#FFB100}} + sp
            e$ = {{Text|evaluatetotyp|#55FF55}}(e$, DOUBLETYPE - ISPOINTER)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Text|WriteBufRawData|#55FF55}} MainTxtBuf, {{Text|<nowiki>"onkey_setup("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>","</nowiki>|#FFB100}}
            i = i + {{Text|1|#F580B1}}
            {{Cl|IF}} i > n {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected GOSUB/sub-name"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            a2$ = {{Text|getelement$|#55FF55}}(a$, i): i = i + {{Text|1|#F580B1}}
            onkeyid = onkeyid + {{Text|1|#F580B1}}
            {{Text|WriteBufRawData|#55FF55}} MainTxtBuf, {{Text|str2$|#55FF55}}(onkeyid) + {{Text|<nowiki>","</nowiki>|#FFB100}}
            {{Cl|IF}} a2$ = {{Text|<nowiki>"GOSUB"</nowiki>|#FFB100}} {{Cl|THEN}}
                {{Cl|IF}} i > n {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected linenumber/label"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                a2$ = {{Text|getelement$|#55FF55}}(ca$, i): i = i + {{Text|1|#F580B1}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"0);"</nowiki>|#FFB100}}
                {{Cl|IF}} {{Text|validlabel|#55FF55}}(a2$) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid label"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                v = {{Text|HashFind|#55FF55}}(a2$, HASHFLAG_LABEL, ignore, r)
                x = {{Text|1|#F580B1}}
                labchk61:
                {{Cl|IF}} v {{Cl|THEN}}
                    s = Labels(r).{{Text|Scope|#55FF55}}
                    {{Cl|IF}} s = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} s = {{Text|-1|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'main scope?</nowiki>|#919191}}
                        {{Cl|IF}} s = {{Text|-1|#F580B1}} {{Cl|THEN}} Labels(r).{{Text|Scope|#55FF55}} = {{Text|0|#F580B1}} {{Text|<nowiki>'acquire scope</nowiki>|#919191}}
                        x = {{Text|0|#F580B1}} {{Text|<nowiki>'already defined</nowiki>|#919191}}
                        tlayout$ = {{Cl|RTRIM$}}(Labels(r).cn)
                        Labels(r).Scope_Restriction = subfuncn
                        Labels(r).Error_Line = linenumber
                    {{Cl|ELSE}}
                        {{Cl|IF}} v = {{Text|2|#F580B1}} {{Cl|THEN}} v = {{Text|HashFindCont|#55FF55}}(ignore, r): {{Cl|GOTO}} labchk61
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} x {{Cl|THEN}}
                    {{Text|<nowiki>'does not exist</nowiki>|#919191}}
                    nLabels = nLabels + {{Text|1|#F580B1}}: {{Cl|IF}} nLabels > Labels_Ubound {{Cl|THEN}} Labels_Ubound = Labels_Ubound * {{Text|2|#F580B1}}: {{Cl|REDIM}} {{Cl|_PRESERVE}} Labels({{Text|1|#F580B1}} {{Cl|TO}} Labels_Ubound) {{Cl|AS}} Label_Type
                    Labels(nLabels) = Empty_Label
                    {{Text|HashAdd|#55FF55}} a2$, HASHFLAG_LABEL, nLabels
                    r = nLabels
                    Labels(r).State = {{Text|0|#F580B1}}
                    Labels(r).cn = tlayout$
                    Labels(r).{{Text|Scope|#55FF55}} = {{Text|0|#F580B1}}
                    Labels(r).Error_Line = linenumber
                    Labels(r).Scope_Restriction = subfuncn
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'x</nowiki>|#919191}}
                l$ = l$ + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"GoSub"</nowiki>|#FFB100}}) + sp + tlayout$
                {{Text|WriteBufLine|#55FF55}} KeyjTxtBuf, {{Text|<nowiki>"if(key_event_id=="</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(onkeyid) + {{Text|<nowiki>")goto LABEL_"</nowiki>|#FFB100}} + a2$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} KeyTxtBuf, {{Text|<nowiki>"case "</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(onkeyid) + {{Text|<nowiki>":"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} KeyTxtBuf, {{Text|<nowiki>"key_event_occurred++;"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} KeyTxtBuf, {{Text|<nowiki>"key_event_id="</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(onkeyid) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} KeyTxtBuf, {{Text|<nowiki>"key_event_occurred++;"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} KeyTxtBuf, {{Text|<nowiki>"return_point[next_return_point++]=0;"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} KeyTxtBuf, {{Text|<nowiki>"if (next_return_point>=return_points) more_return_points();"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} KeyTxtBuf, {{Text|<nowiki>"QBMAIN(NULL);"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} KeyTxtBuf, {{Text|<nowiki>"break;"</nowiki>|#FFB100}}
                {{Cl|IF}} {{Cl|LEN}}(layout$) = {{Text|0|#F580B1}} {{Cl|THEN}} layout$ = l$ {{Cl|ELSE}} layout$ = layout$ + sp + l$
                layoutdone = {{Text|1|#F580B1}}
                {{Cl|GOTO}} finishedline
            {{Cl|ELSE}}
                {{Text|<nowiki>'establish whether sub a2$ exists using try</nowiki>|#919191}}
                x = {{Text|0|#F580B1}}
                try = {{Text|findid|#55FF55}}(a2$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Cl|DO}} {{Cl|WHILE}} try
                    {{Cl|IF}} id.subfunc = {{Text|2|#F580B1}} {{Cl|THEN}} x = {{Text|1|#F580B1}}: {{Cl|EXIT}} {{Cl|DO}}
                    {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(a2$) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Cl|LOOP}}
                {{Cl|IF}} x = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected GOSUB/sub"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                l$ = l$ + {{Cl|RTRIM$}}(id.cn)
                {{Text|WriteBufLine|#55FF55}} KeyTxtBuf, {{Text|<nowiki>"case "</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(onkeyid) + {{Text|<nowiki>":"</nowiki>|#FFB100}}
                {{Text|WriteBufRawData|#55FF55}} KeyTxtBuf, {{Cl|RTRIM$}}(id.callname) + {{Text|<nowiki>"("</nowiki>|#FFB100}}
                {{Cl|IF}} id.args > {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"SUB requires more than one argument"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|IF}} i > n {{Cl|THEN}}
                    {{Cl|IF}} id.args = {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected argument after SUB"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"0);"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} KeyTxtBuf, {{Text|<nowiki>");"</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    {{Cl|IF}} id.args = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"SUB has no arguments"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    t = {{Cl|CVL}}(id.arg)
                    B = t {{Cl|AND}} {{Text|511|#F580B1}}
                    {{Cl|IF}} B = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} (t {{Cl|AND (boolean)|AND}} ISARRAY) <> {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} (t {{Cl|AND (boolean)|AND}} ISFLOAT) <> {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} (t {{Cl|AND (boolean)|AND}} ISSTRING) <> {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} (t {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) <> {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Only SUB arguments of integer-type allowed"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    {{Cl|IF}} B = {{Text|8|#F580B1}} {{Cl|THEN}} ct$ = {{Text|<nowiki>"int8"</nowiki>|#FFB100}}
                    {{Cl|IF}} B = {{Text|16|#F580B1}} {{Cl|THEN}} ct$ = {{Text|<nowiki>"int16"</nowiki>|#FFB100}}
                    {{Cl|IF}} B = {{Text|32|#F580B1}} {{Cl|THEN}} ct$ = {{Text|<nowiki>"int32"</nowiki>|#FFB100}}
                    {{Cl|IF}} B = {{Text|64|#F580B1}} {{Cl|THEN}} ct$ = {{Text|<nowiki>"int64"</nowiki>|#FFB100}}
                    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISOFFSET {{Cl|THEN}} ct$ = {{Text|<nowiki>"ptrszint"</nowiki>|#FFB100}}
                    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISUNSIGNED {{Cl|THEN}} ct$ = {{Text|<nowiki>"u"</nowiki>|#FFB100}} + ct$
                    {{Text|WriteBufLine|#55FF55}} KeyTxtBuf, {{Text|<nowiki>"("</nowiki>|#FFB100}} + ct$ + {{Text|<nowiki>"*)&i64);"</nowiki>|#FFB100}}
                    e$ = {{Text|getelements$|#55FF55}}(ca$, i, n)
                    e$ = {{Text|fixoperationorder$|#55FF55}}(e$)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    l$ = l$ + sp + tlayout$
                    e$ = {{Text|evaluatetotyp|#55FF55}}(e$, INTEGER64TYPE - ISPOINTER)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, e$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|WriteBufLine|#55FF55}} KeyTxtBuf, {{Text|<nowiki>"break;"</nowiki>|#FFB100}}
                {{Cl|IF}} {{Cl|LEN}}(layout$) = {{Text|0|#F580B1}} {{Cl|THEN}} layout$ = l$ {{Cl|ELSE}} layout$ = layout$ + sp + l$
                layoutdone = {{Text|1|#F580B1}}
                {{Cl|GOTO}} finishedline
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'SHARED (SUB)</nowiki>|#919191}}
    {{Cl|IF}} n >= {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"SHARED"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected SHARED ..."</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            i = {{Text|2|#F580B1}}
            {{Cl|IF}} subfuncn = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"SHARED must be used within a SUB/FUNCTION"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Shared"</nowiki>|#FFB100}})
            subfuncshr:
            {{Text|<nowiki>'get variable name</nowiki>|#919191}}
            n$ = {{Text|getelement$|#55FF55}}(ca$, i): i = i + {{Text|1|#F580B1}}
            {{Cl|IF}} n$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected SHARED variable-name or SHARED AS type variable-list"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|IF}} {{Cl|UCASE$}}(n$) <> {{Text|<nowiki>"AS"</nowiki>|#FFB100}} {{Cl|THEN}}
                {{Text|<nowiki>'traditional dim syntax for SHARED</nowiki>|#919191}}
                newSharedSyntax = {{Text|0|#F580B1}}
                s$ = {{Text|removesymbol|#55FF55}}(n$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                l2$ = s$ {{Text|<nowiki>'either symbol or nothing</nowiki>|#919191}}
                {{Text|<nowiki>'array?</nowiki>|#919191}}
                a = {{Text|0|#F580B1}}
                {{Cl|IF}} {{Text|getelement$|#55FF55}}(a$, i) = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} {{Text|getelement$|#55FF55}}(a$, i + {{Text|1|#F580B1}}) <> {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ()"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    i = i + {{Text|2|#F580B1}}
                    a = {{Text|1|#F580B1}}
                    l2$ = l2$ + sp2 + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp2 + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                method = {{Text|1|#F580B1}}
                {{Text|<nowiki>'specific type?</nowiki>|#919191}}
                t$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                ts$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                t3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                {{Cl|IF}} {{Text|getelement$|#55FF55}}(a$, i) = {{Text|<nowiki>"AS"</nowiki>|#FFB100}} {{Cl|THEN}}
                    l2$ = l2$ + sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"As"</nowiki>|#FFB100}})
                    getshrtyp:
                    i = i + {{Text|1|#F580B1}}
                    t2$ = {{Text|getelement$|#55FF55}}(a$, i)
                    {{Cl|IF}} t2$ <> {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} t2$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
                        {{Cl|IF}} t$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} t$ = t2$ {{Cl|ELSE}} t$ = t$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} + t2$
                        {{Cl|IF}} t3$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} t3$ = t2$ {{Cl|ELSE}} t3$ = t3$ + sp + t2$
                        {{Cl|GOTO}} getshrtyp
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} t$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected AS type"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    t = {{Text|typname2typ|#55FF55}}(t$)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISINCONVENTIONALMEMORY {{Cl|THEN}} t = t - ISINCONVENTIONALMEMORY
                    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISPOINTER {{Cl|THEN}} t = t - ISPOINTER
                    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISREFERENCE {{Cl|THEN}} t = t - ISREFERENCE
                    tsize = typname2typsize
                    method = {{Text|0|#F580B1}}
                    {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISUDT) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        ts$ = {{Text|type2symbol$|#55FF55}}(t$)
                        l2$ = l2$ + sp + {{Text|SCase2$|#55FF55}}(t3$)
                    {{Cl|ELSE}}
                        t3$ = {{Cl|RTRIM$}}(udtxcname(t {{Cl|AND}} {{Text|511|#F580B1}}))
                        {{Cl|IF}} {{Cl|RTRIM$}}(udtxcname(t {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}})) = {{Text|<nowiki>"_MEM"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} {{Cl|UCASE$}}(t$) = {{Text|<nowiki>"MEM"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|THEN}}
                            t3$ = {{Cl|MID$ (function)|MID$}}({{Cl|RTRIM$}}(udtxcname(t {{Cl|AND}} {{Text|511|#F580B1}})), {{Text|2|#F580B1}})
                        {{Cl|END}} {{Cl|IF}}
                        l2$ = l2$ + sp + t3$
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'as</nowiki>|#919191}}
                {{Cl|IF}} {{Cl|LEN}}(s$) <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|LEN}}(t$) <> {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected symbol or AS type after variable name"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Text|<nowiki>'no symbol of type specified, apply default</nowiki>|#919191}}
                {{Cl|IF}} s$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} t$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} {{Cl|LEFT$}}(n$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"_"</nowiki>|#FFB100}} {{Cl|THEN}} v = {{Text|27|#F580B1}} {{Cl|ELSE}} v = {{Cl|ASC (function)|ASC}}({{Cl|UCASE$}}(n$)) - {{Text|64|#F580B1}}
                    s$ = defineextaz(v)
                {{Cl|END}} {{Cl|IF}}
                NormalSharedBlock:
                {{Text|<nowiki>'switch to main module</nowiki>|#919191}}
                oldsubfunc$ = subfunc$
                subfunc$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                defdatahandle = GlobTxtBuf
                DataTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"A"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"maindata.txt"</nowiki>|#FFB100}})
                FreeTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"A"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"mainfree.txt"</nowiki>|#FFB100}})
                {{Text|<nowiki>'use 'try' to locate the variable (if it already exists)</nowiki>|#919191}}
                n2$ = n$ + s$ + ts$ {{Text|<nowiki>'note: either ts$ or s$ will exist unless it is a UDT</nowiki>|#919191}}
                try = {{Text|findid|#55FF55}}(n2$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Cl|DO}} {{Cl|WHILE}} try
                    {{Cl|IF}} a {{Cl|THEN}}
                        {{Text|<nowiki>'an array</nowiki>|#919191}}
                        {{Cl|IF}} id.arraytype {{Cl|THEN}}
                            {{Cl|IF}} {{Cl|LEN}}(t$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} shrfound
                            t2 = id.arraytype: t2size = id.tsize
                            {{Cl|IF}} t2 {{Cl|AND (boolean)|AND}} ISINCONVENTIONALMEMORY {{Cl|THEN}} t2 = t2 - ISINCONVENTIONALMEMORY
                            {{Cl|IF}} t2 {{Cl|AND (boolean)|AND}} ISPOINTER {{Cl|THEN}} t2 = t2 - ISPOINTER
                            {{Cl|IF}} t2 {{Cl|AND (boolean)|AND}} ISREFERENCE {{Cl|THEN}} t2 = t2 - ISREFERENCE
                            {{Cl|IF}} t = t2 {{Cl|AND (boolean)|AND}} tsize = t2size {{Cl|THEN}} {{Cl|GOTO}} shrfound
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|ELSE}}
                        {{Text|<nowiki>'not an array</nowiki>|#919191}}
                        {{Cl|IF}} id.t {{Cl|THEN}}
                            {{Cl|IF}} {{Cl|LEN}}(t$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} shrfound
                            t2 = id.t: t2size = id.tsize
                            {{Cl|IF}} t2 {{Cl|AND (boolean)|AND}} ISINCONVENTIONALMEMORY {{Cl|THEN}} t2 = t2 - ISINCONVENTIONALMEMORY
                            {{Cl|IF}} t2 {{Cl|AND (boolean)|AND}} ISPOINTER {{Cl|THEN}} t2 = t2 - ISPOINTER
                            {{Cl|IF}} t2 {{Cl|AND (boolean)|AND}} ISREFERENCE {{Cl|THEN}} t2 = t2 - ISREFERENCE
                            {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"SHARED:comparing:"</nowiki>|#FFB100}}; t; t2, tsize; t2size
                            {{Cl|IF}} t = t2 {{Cl|AND (boolean)|AND}} tsize = t2size {{Cl|THEN}} {{Cl|GOTO}} shrfound
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(n2$) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Cl|LOOP}}
                {{Text|<nowiki>'unknown variable</nowiki>|#919191}}
                {{Cl|IF}} a {{Cl|THEN}} a$ = {{Text|<nowiki>"Array '"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"' not defined"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Text|<nowiki>'create variable</nowiki>|#919191}}
                {{Cl|IF}} {{Cl|LEN}}(s$) {{Cl|THEN}} typ$ = s$ {{Cl|ELSE}} typ$ = t$
                {{Cl|IF}} optionexplicit {{Cl|THEN}} a$ = {{Text|<nowiki>"Variable '"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"' ("</nowiki>|#FFB100}} + {{Text|symbol2fulltypename$|#55FF55}}(typ$) + {{Text|<nowiki>") not defined"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                bypassNextVariable = {{Text|-1|#F580B1}}
                retval = {{Text|dim2|#55FF55}}(n$, typ$, method, {{Text|<nowiki>""</nowiki>|#FFB100}})
                {{Text|manageVariableList|#55FF55}} {{Text|<nowiki>""</nowiki>|#FFB100}}, vWatchNewVariable$, {{Text|0|#F580B1}}, {{Text|2|#F580B1}}
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Text|<nowiki>'note: variable created!</nowiki>|#919191}}
                shrfound:
                {{Cl|IF}} newSharedSyntax = {{Text|0|#F580B1}} {{Cl|THEN}}
                    l$ = l$ + sp + {{Cl|RTRIM$}}(id.cn) + l2$
                {{Cl|ELSE}}
                    {{Cl|IF}} sharedAsLayoutAdded = {{Text|0|#F580B1}} {{Cl|THEN}}
                        sharedAsLayoutAdded = {{Text|-1|#F580B1}}
                        l$ = l$ + l2$ + sp$ + {{Cl|RTRIM$}}(id.cn) + l3$
                    {{Cl|ELSE}}
                        l$ = l$ + sp$ + {{Cl|RTRIM$}}(id.cn) + l3$
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                ids(currentid).share = ids(currentid).share {{Cl|OR}} {{Text|2|#F580B1}} {{Text|<nowiki>'set as temporarily shared</nowiki>|#919191}}
                {{Text|<nowiki>'method must apply to the current sub/function regardless of how the variable was defined in 'main'</nowiki>|#919191}}
                lmay = {{Cl|LEN}}({{Cl|RTRIM$}}(id.mayhave)): lmust = {{Cl|LEN}}({{Cl|RTRIM$}}(id.musthave))
                {{Cl|IF}} lmay <> {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} lmust <> {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} (method = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} lmust = {{Text|0|#F580B1}}) {{Cl|OR (boolean)|OR}} (method = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} lmay = {{Text|0|#F580B1}}) {{Cl|THEN}}
                        revertmaymusthaven = revertmaymusthaven + {{Text|1|#F580B1}}
                        revertmaymusthave(revertmaymusthaven) = currentid
                        {{Cl|SWAP}} ids(currentid).musthave, ids(currentid).mayhave
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'switch back to sub/func</nowiki>|#919191}}
                subfunc$ = oldsubfunc$
                DataTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"A"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"data"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(subfuncn) + {{Text|<nowiki>".txt"</nowiki>|#FFB100}})
                FreeTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"A"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"free"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(subfuncn) + {{Text|<nowiki>".txt"</nowiki>|#FFB100}})
                defdatahandle = DataTxtBuf
                {{Cl|IF}} newSharedSyntax {{Cl|THEN}} {{Cl|RETURN}}
                {{Cl|IF}} {{Text|getelement$|#55FF55}}(a$, i) = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}} i = i + {{Text|1|#F580B1}}: l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}}: {{Cl|GOTO}} subfuncshr
                {{Cl|IF}} {{Text|getelement$|#55FF55}}(a$, i) <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ,"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                {{Cl|GOTO}} finishedline
            {{Cl|ELSE}}
                {{Text|<nowiki>'new dim syntax for SHARED!</nowiki>|#919191}}
                i = i - {{Text|1|#F580B1}} {{Text|<nowiki>'relocate back to "AS"</nowiki>|#919191}}
                {{Text|<nowiki>'estabilish the data type:</nowiki>|#919191}}
                t$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                ts$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                t3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                n$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                previousElement$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                l2$ = sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"As"</nowiki>|#FFB100}})
                sharedAsLayoutAdded = {{Text|0|#F580B1}}
                getshrtyp2:
                i = i + {{Text|1|#F580B1}}
                t2$ = {{Text|getelement$|#55FF55}}(a$, i)
                {{Cl|IF}} t2$ <> {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} t2$ <> {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} t2$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Text|<nowiki>'get first variable name</nowiki>|#919191}}
                    n$ = {{Text|getelement$|#55FF55}}(ca$, i)
                    {{Cl|IF}} {{Cl|LEN}}(previousElement$) {{Cl|THEN}}
                        {{Cl|IF}} t$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} t$ = previousElement$ {{Cl|ELSE}} t$ = t$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} + previousElement$
                        {{Cl|IF}} t3$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} t3$ = previousElement$ {{Cl|ELSE}} t3$ = t3$ + sp + previousElement$
                    {{Cl|END}} {{Cl|IF}}
                    previousElement$ = t2$
                    {{Cl|GOTO}} getshrtyp2
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} t$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected SHARED AS type variable-list or SHARED variable-name AS type"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                t = {{Text|typname2typ|#55FF55}}(t$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISINCONVENTIONALMEMORY {{Cl|THEN}} t = t - ISINCONVENTIONALMEMORY
                {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISPOINTER {{Cl|THEN}} t = t - ISPOINTER
                {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISREFERENCE {{Cl|THEN}} t = t - ISREFERENCE
                tsize = typname2typsize
                method = {{Text|0|#F580B1}}
                {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISUDT) = {{Text|0|#F580B1}} {{Cl|THEN}}
                    ts$ = {{Text|type2symbol$|#55FF55}}(t$)
                    l2$ = l2$ + sp + {{Text|SCase2$|#55FF55}}(t3$)
                {{Cl|ELSE}}
                    t3$ = {{Cl|RTRIM$}}(udtxcname(t {{Cl|AND}} {{Text|511|#F580B1}}))
                    {{Cl|IF}} {{Cl|RTRIM$}}(udtxcname(t {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}})) = {{Text|<nowiki>"_MEM"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} {{Cl|UCASE$}}(t$) = {{Text|<nowiki>"MEM"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|THEN}}
                        t3$ = {{Cl|MID$ (function)|MID$}}({{Cl|RTRIM$}}(udtxcname(t {{Cl|AND}} {{Text|511|#F580B1}})), {{Text|2|#F580B1}})
                    {{Cl|END}} {{Cl|IF}}
                    l2$ = l2$ + sp + t3$
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                subfuncshr2:
                s$ = {{Text|removesymbol|#55FF55}}(n$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Cl|IF}} s$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
                    a$ = {{Text|<nowiki>"Cannot use type symbol with SHARED AS type variable-list ("</nowiki>|#FFB100}} + s$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                    {{Cl|GOTO}} errmes
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'array?</nowiki>|#919191}}
                a = {{Text|0|#F580B1}}
                l3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                {{Cl|IF}} {{Text|getelement$|#55FF55}}(a$, i) = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} {{Text|getelement$|#55FF55}}(a$, i + {{Text|1|#F580B1}}) <> {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ()"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    i = i + {{Text|2|#F580B1}}
                    a = {{Text|1|#F580B1}}
                    l3$ = sp2 + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp2 + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                newSharedSyntax = {{Text|-1|#F580B1}}
                {{Cl|GOSUB}} NormalSharedBlock
                newSharedSyntax = {{Text|0|#F580B1}}
                {{Cl|IF}} {{Text|getelement$|#55FF55}}(a$, i) = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}}
                    i = i + {{Text|1|#F580B1}}
                    l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}}
                    {{Text|<nowiki>'get next variable name</nowiki>|#919191}}
                    n$ = {{Text|getelement$|#55FF55}}(ca$, i): i = i + {{Text|1|#F580B1}}
                    {{Cl|GOTO}} subfuncshr2
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} {{Text|getelement$|#55FF55}}(a$, i) <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ,"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                {{Cl|GOTO}} finishedline
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'EXIT SUB/FUNCTION</nowiki>|#919191}}
    {{Cl|IF}} n = {{Text|2|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"EXIT"</nowiki>|#FFB100}} {{Cl|THEN}}
            sf = {{Text|0|#F580B1}}
            {{Cl|IF}} secondelement$ = {{Text|<nowiki>"FUNCTION"</nowiki>|#FFB100}} {{Cl|THEN}} sf = {{Text|1|#F580B1}}
            {{Cl|IF}} secondelement$ = {{Text|<nowiki>"SUB"</nowiki>|#FFB100}} {{Cl|THEN}} sf = {{Text|2|#F580B1}}
            {{Cl|IF}} sf {{Cl|THEN}}
                {{Cl|IF}} {{Cl|LEN}}(subfunc) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"EXIT "</nowiki>|#FFB100}} + secondelement$ + {{Text|<nowiki>" must be used within a "</nowiki>|#FFB100}} + secondelement$: {{Cl|GOTO}} errmes
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"goto exit_subfunc;"</nowiki>|#FFB100}}
                {{Cl|IF}} {{Cl|LEFT$}}(subfunc, {{Text|4|#F580B1}}) = {{Text|<nowiki>"SUB_"</nowiki>|#FFB100}} {{Cl|THEN}} secondelement$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Sub"</nowiki>|#FFB100}}) {{Cl|ELSE}} secondelement$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Function"</nowiki>|#FFB100}})
                l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Exit"</nowiki>|#FFB100}}) + sp + secondelement$
                layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                {{Cl|GOTO}} finishedline
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'_ECHO checking</nowiki>|#919191}}
    {{Cl|IF}} firstelement$ = {{Text|<nowiki>"_ECHO"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (firstelement$ = {{Text|<nowiki>"ECHO"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}}
        {{Cl|IF}} Console = {{Text|0|#F580B1}} {{Cl|THEN}}
            a$ = qb64prefix$ + {{Text|<nowiki>"ECHO requires $CONSOLE or $CONSOLE:ONLY to be set first"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'ASC statement (fully inline)</nowiki>|#919191}}
    {{Cl|IF}} n >= {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"ASC"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} {{Text|getelement$|#55FF55}}(a$, {{Text|2|#F580B1}}) <> {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ( after ASC"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Text|<nowiki>'calculate 3 parts</nowiki>|#919191}}
            useposition = {{Text|0|#F580B1}}
            part = {{Text|1|#F580B1}}
            i = {{Text|3|#F580B1}}
            a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            stringvariable$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            position$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            B = {{Text|0|#F580B1}}
            {{Cl|DO}}
                {{Cl|IF}} i > n {{Cl|THEN}} {{Text|<nowiki>'got part 3</nowiki>|#919191}}
                    {{Cl|IF}} part <> {{Text|3|#F580B1}} {{Cl|OR (boolean)|OR}} {{Cl|LEN}}(a3$) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ASC ( ... , ... ) = ..."</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    expression$ = a3$
                    {{Cl|EXIT}} {{Cl|DO}}
                {{Cl|END}} {{Cl|IF}}
                a2$ = {{Text|getelement$|#55FF55}}(ca$, i)
                {{Cl|IF}} a2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} B = B + {{Text|1|#F580B1}}
                {{Cl|IF}} a2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} B = B - {{Text|1|#F580B1}}
                {{Cl|IF}} B = {{Text|-1|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} part = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'eg. ASC(a$)=65</nowiki>|#919191}}
                        {{Cl|IF}} {{Text|getelement$|#55FF55}}(a$, i + {{Text|1|#F580B1}}) <> {{Text|<nowiki>"="</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ="</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                        stringvariable$ = a3$
                        position$ = {{Text|<nowiki>"1"</nowiki>|#FFB100}}
                        part = {{Text|3|#F580B1}}: a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: i = i + {{Text|1|#F580B1}}: {{Cl|GOTO}} ascgotpart
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} part = {{Text|2|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'eg. ASC(a$,i)=65</nowiki>|#919191}}
                        {{Cl|IF}} {{Text|getelement$|#55FF55}}(a$, i + {{Text|1|#F580B1}}) <> {{Text|<nowiki>"="</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ="</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                        useposition = {{Text|1|#F580B1}}
                        position$ = a3$
                        part = {{Text|3|#F580B1}}: a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: i = i + {{Text|1|#F580B1}}: {{Cl|GOTO}} ascgotpart
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|<nowiki>'fall through, already in part 3</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} a2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} B = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} part = {{Text|1|#F580B1}} {{Cl|THEN}} stringvariable$ = a3$: part = {{Text|2|#F580B1}}: a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: {{Cl|GOTO}} ascgotpart
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} {{Cl|LEN}}(a3$) {{Cl|THEN}} a3$ = a3$ + sp + a2$ {{Cl|ELSE}} a3$ = a2$
                ascgotpart:
                i = i + {{Text|1|#F580B1}}
            {{Cl|LOOP}}
            {{Cl|IF}} {{Cl|LEN}}(stringvariable$) = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} {{Cl|LEN}}(position$) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ASC ( ... , ... ) = ..."</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Text|<nowiki>'validate stringvariable$</nowiki>|#919191}}
            stringvariable$ = {{Text|fixoperationorder$|#55FF55}}(stringvariable$)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Asc"</nowiki>|#FFB100}}) + sp2 + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp2 + tlayout$
            e$ = {{Text|evaluate|#55FF55}}(stringvariable$, sourcetyp)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ASC ( string-variable , ..."</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            stringvariable$ = {{Text|evaluatetotyp|#55FF55}}(stringvariable$, ISSTRING)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Cl|IF}} position$ = {{Text|<nowiki>"1"</nowiki>|#FFB100}} {{Cl|THEN}}
                {{Cl|IF}} useposition {{Cl|THEN}} l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"1"</nowiki>|#FFB100}} + sp2 + {{Text|<nowiki>")"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"="</nowiki>|#FFB100}} {{Cl|ELSE}} l$ = l$ + sp2 + {{Text|<nowiki>")"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"="</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tqbs="</nowiki>|#FFB100}} + stringvariable$ + {{Text|<nowiki>"; if (!new_error){"</nowiki>|#FFB100}}
                e$ = {{Text|fixoperationorder$|#55FF55}}(expression$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                l$ = l$ + sp + tlayout$
                e$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|32&|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_long="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"; if (!new_error){"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (tqbs->len){tqbs->chr[0]=tmp_long;}else{error(5);}"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}}"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tqbs="</nowiki>|#FFB100}} + stringvariable$ + {{Text|<nowiki>"; if (!new_error){"</nowiki>|#FFB100}}
                e$ = {{Text|fixoperationorder$|#55FF55}}(position$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp + tlayout$ + sp2 + {{Text|<nowiki>")"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"="</nowiki>|#FFB100}}
                e$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|32&|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_fileno="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"; if (!new_error){"</nowiki>|#FFB100}}
                e$ = {{Text|fixoperationorder$|#55FF55}}(expression$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                l$ = l$ + sp + tlayout$
                e$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|32&|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_long="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"; if (!new_error){"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if ((tmp_fileno>0)&&(tmp_fileno<=tqbs->len)){tqbs->chr[tmp_fileno-1]=tmp_long;}else{error(5);}"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}}}"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
            {{Cl|GOTO}} finishedline
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'MID$ statement</nowiki>|#919191}}
    {{Cl|IF}} n >= {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"MID$"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} {{Text|getelement$|#55FF55}}(a$, {{Text|2|#F580B1}}) <> {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ( after MID$"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Text|<nowiki>'calculate 4 parts</nowiki>|#919191}}
            length$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            part = {{Text|1|#F580B1}}
            i = {{Text|3|#F580B1}}
            a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            stringvariable$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            start$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            B = {{Text|0|#F580B1}}
            {{Cl|DO}}
                {{Cl|IF}} i > n {{Cl|THEN}}
                    {{Cl|IF}} part <> {{Text|4|#F580B1}} {{Cl|OR (boolean)|OR}} a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected MID$(...)=..."</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    stringexpression$ = a3$
                    {{Cl|EXIT}} {{Cl|DO}}
                {{Cl|END}} {{Cl|IF}}
                a2$ = {{Text|getelement$|#55FF55}}(ca$, i)
                {{Cl|IF}} a2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} B = B + {{Text|1|#F580B1}}
                {{Cl|IF}} a2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} B = B - {{Text|1|#F580B1}}
                {{Cl|IF}} B = {{Text|-1|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} part = {{Text|2|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} {{Text|getelement$|#55FF55}}(a$, i + {{Text|1|#F580B1}}) <> {{Text|<nowiki>"="</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected = after )"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                        start$ = a3$: part = {{Text|4|#F580B1}}: a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: i = i + {{Text|1|#F580B1}}: {{Cl|GOTO}} midgotpart
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} part = {{Text|3|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} {{Text|getelement$|#55FF55}}(a$, i + {{Text|1|#F580B1}}) <> {{Text|<nowiki>"="</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected = after )"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                        {{Cl|IF}} a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Omit , before ) if omitting length in MID$ statement"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                        length$ = a3$: part = {{Text|4|#F580B1}}: a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: i = i + {{Text|1|#F580B1}}: {{Cl|GOTO}} midgotpart
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} a2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} B = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} part = {{Text|1|#F580B1}} {{Cl|THEN}} stringvariable$ = a3$: part = {{Text|2|#F580B1}}: a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: {{Cl|GOTO}} midgotpart
                    {{Cl|IF}} part = {{Text|2|#F580B1}} {{Cl|THEN}} start$ = a3$: part = {{Text|3|#F580B1}}: a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: {{Cl|GOTO}} midgotpart
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} {{Cl|LEN}}(a3$) {{Cl|THEN}} a3$ = a3$ + sp + a2$ {{Cl|ELSE}} a3$ = a2$
                midgotpart:
                i = i + {{Text|1|#F580B1}}
            {{Cl|LOOP}}
            {{Cl|IF}} stringvariable$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Syntax error - first parameter must be a string variable/array-element"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|IF}} start$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Syntax error - second parameter not optional"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Text|<nowiki>'check if it is a valid source string</nowiki>|#919191}}
            stringvariable$ = {{Text|fixoperationorder$|#55FF55}}(stringvariable$)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Mid$"</nowiki>|#FFB100}}) + sp2 + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp2 + tlayout$
            e$ = {{Text|evaluate|#55FF55}}(stringvariable$, sourcetyp)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"MID$ expects a string variable/array-element as its first argument"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            stringvariable$ = {{Text|evaluatetotyp|#55FF55}}(stringvariable$, ISSTRING)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            start$ = {{Text|fixoperationorder$|#55FF55}}(start$)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp + tlayout$
            start$ = {{Text|evaluatetotyp|#55FF55}}((start$), {{Text|32&|#F580B1}})
            stringexpression$ = {{Text|fixoperationorder$|#55FF55}}(stringexpression$)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            l2$ = tlayout$
            stringexpression$ = {{Text|evaluatetotyp|#55FF55}}(stringexpression$, ISSTRING)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Cl|IF}} {{Cl|LEN}}(length$) {{Cl|THEN}}
                length$ = {{Text|fixoperationorder$|#55FF55}}(length$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp + tlayout$
                length$ = {{Text|evaluatetotyp|#55FF55}}(length$, {{Text|32&|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_mid("</nowiki>|#FFB100}} + stringvariable$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + start$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + length$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + stringexpression$ + {{Text|<nowiki>",1);"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_mid("</nowiki>|#FFB100}} + stringvariable$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + start$ + {{Text|<nowiki>",0,"</nowiki>|#FFB100}} + stringexpression$ + {{Text|<nowiki>",0);"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            l$ = l$ + sp2 + {{Text|<nowiki>")"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"="</nowiki>|#FFB100}} + sp + l2$
            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
            {{Cl|GOTO}} finishedline
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} n >= {{Text|2|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"ERASE"</nowiki>|#FFB100}} {{Cl|THEN}}
            i = {{Text|2|#F580B1}}
            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Erase"</nowiki>|#FFB100}})
            erasenextarray:
            var$ = {{Text|getelement$|#55FF55}}(ca$, i)
            x$ = var$: ls$ = {{Text|removesymbol|#55FF55}}(x$)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Cl|IF}} {{Text|FindArray|#55FF55}}(var$) {{Cl|THEN}}
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                l$ = l$ + sp + {{Cl|RTRIM$}}(id.cn) + ls$
                {{Text|<nowiki>'erase the array</nowiki>|#919191}}
                clearerase:
                n$ = {{Cl|RTRIM$}}(id.callname)
                bytesperelement$ = {{Text|str2|#55FF55}}((id.arraytype {{Cl|AND}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}})
                {{Cl|IF}} id.arraytype {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}} bytesperelement$ = {{Text|str2|#55FF55}}(id.tsize)
                {{Cl|IF}} id.arraytype {{Cl|AND (boolean)|AND}} ISOFFSETINBITS {{Cl|THEN}} bytesperelement$ = {{Text|str2|#55FF55}}((id.arraytype {{Cl|AND}} {{Text|511|#F580B1}})) + {{Text|<nowiki>"/8+1"</nowiki>|#FFB100}}
                {{Cl|IF}} id.arraytype {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
                    bytesperelement$ = {{Text|str2|#55FF55}}(udtxsize(id.arraytype {{Cl|AND}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}})
                {{Cl|END}} {{Cl|IF}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[2]&1){"</nowiki>|#FFB100}} {{Text|<nowiki>'array is defined</nowiki>|#919191}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[2]&2){"</nowiki>|#FFB100}} {{Text|<nowiki>'array is static</nowiki>|#919191}}
                {{Cl|IF}} (id.arraytype {{Cl|AND (boolean)|AND}} ISSTRING) <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} (id.arraytype {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Text|WriteBufRawData|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_long="</nowiki>|#FFB100}}
                    {{Cl|FOR}} i2 = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|ABS}}(id.arrayelements)
                        {{Cl|IF}} i2 <> {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufRawData|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*"</nowiki>|#FFB100}}
                        {{Text|WriteBufRawData|#55FF55}} MainTxtBuf, n$ + {{Text|<nowiki>"["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(i2 * {{Text|4|#F580B1}} - {{Text|4|#F580B1}} + {{Text|5|#F580B1}}) + {{Text|<nowiki>"]"</nowiki>|#FFB100}}
                    {{Cl|NEXT}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>";"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"while(tmp_long--){"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"((qbs*)(((uint64*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]))[tmp_long]))->len=0;"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    {{Text|<nowiki>'numeric</nowiki>|#919191}}
                    {{Text|<nowiki>'clear array</nowiki>|#919191}}
                    {{Text|WriteBufRawData|#55FF55}} MainTxtBuf, {{Text|<nowiki>"memset((void*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]),0,"</nowiki>|#FFB100}}
                    {{Cl|FOR}} i2 = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|ABS}}(id.arrayelements)
                        {{Cl|IF}} i2 <> {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufRawData|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*"</nowiki>|#FFB100}}
                        {{Text|WriteBufRawData|#55FF55}} MainTxtBuf, n$ + {{Text|<nowiki>"["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(i2 * {{Text|4|#F580B1}} - {{Text|4|#F580B1}} + {{Text|5|#F580B1}}) + {{Text|<nowiki>"]"</nowiki>|#FFB100}}
                    {{Cl|NEXT}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*"</nowiki>|#FFB100}} + bytesperelement$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}else{"</nowiki>|#FFB100}} {{Text|<nowiki>'array is dynamic</nowiki>|#919191}}
                {{Text|<nowiki>'1. free memory & any allocated strings</nowiki>|#919191}}
                {{Cl|IF}} (id.arraytype {{Cl|AND (boolean)|AND}} ISSTRING) <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} (id.arraytype {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Text|<nowiki>'free strings</nowiki>|#919191}}
                    {{Text|WriteBufRawData|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_long="</nowiki>|#FFB100}}
                    {{Cl|FOR}} i2 = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|ABS}}(id.arrayelements)
                        {{Cl|IF}} i2 <> {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufRawData|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*"</nowiki>|#FFB100}}
                        {{Text|WriteBufRawData|#55FF55}} MainTxtBuf, n$ + {{Text|<nowiki>"["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(i2 * {{Text|4|#F580B1}} - {{Text|4|#F580B1}} + {{Text|5|#F580B1}}) + {{Text|<nowiki>"]"</nowiki>|#FFB100}}
                    {{Cl|NEXT}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>";"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"while(tmp_long--){"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_free((qbs*)(((uint64*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]))[tmp_long]));"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                    {{Text|<nowiki>'free memory</nowiki>|#919191}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"free((void*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]));"</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    {{Text|<nowiki>'free memory</nowiki>|#919191}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[2]&4){"</nowiki>|#FFB100}} {{Text|<nowiki>'cmem array</nowiki>|#919191}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"cmem_dynamic_free((uint8*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]));"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}else{"</nowiki>|#FFB100}} {{Text|<nowiki>'non-cmem array</nowiki>|#919191}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"free((void*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]));"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'2. set array (and its elements) as undefined</nowiki>|#919191}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, n$ + {{Text|<nowiki>"[2]^=1;"</nowiki>|#FFB100}} {{Text|<nowiki>'remove defined flag, keeping other flags (such as cmem)</nowiki>|#919191}}
                {{Text|<nowiki>'set dimensions as undefined</nowiki>|#919191}}
                {{Cl|FOR}} i2 = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|ABS}}(id.arrayelements)
                    B = i2 * {{Text|4|#F580B1}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, n$ + {{Text|<nowiki>"["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(B) + {{Text|<nowiki>"]=2147483647;"</nowiki>|#FFB100}} {{Text|<nowiki>'base</nowiki>|#919191}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, n$ + {{Text|<nowiki>"["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(B + {{Text|1|#F580B1}}) + {{Text|<nowiki>"]=0;"</nowiki>|#FFB100}} {{Text|<nowiki>'num. index</nowiki>|#919191}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, n$ + {{Text|<nowiki>"["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(B + {{Text|2|#F580B1}}) + {{Text|<nowiki>"]=0;"</nowiki>|#FFB100}} {{Text|<nowiki>'multiplier</nowiki>|#919191}}
                {{Cl|NEXT}}
                {{Cl|IF}} (id.arraytype {{Cl|AND (boolean)|AND}} ISSTRING) <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} (id.arraytype {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, n$ + {{Text|<nowiki>"[0]=(ptrszint)&nothingstring;"</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, n$ + {{Text|<nowiki>"[0]=(ptrszint)nothingvalue;"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}} {{Text|<nowiki>'static/dynamic</nowiki>|#919191}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}} {{Text|<nowiki>'array is defined</nowiki>|#919191}}
                {{Cl|IF}} clearerasereturn = {{Text|1|#F580B1}} {{Cl|THEN}} clearerasereturn = {{Text|0|#F580B1}}: {{Cl|GOTO}} clearerasereturned
                {{Cl|GOTO}} erasedarray
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            a$ = {{Text|<nowiki>"Undefined array passed to ERASE"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            erasedarray:
            {{Cl|IF}} i < n {{Cl|THEN}}
                i = i + {{Text|1|#F580B1}}: n$ = {{Text|getelement$|#55FF55}}(a$, i): {{Cl|IF}} n$ <> {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ,"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}}
                i = i + {{Text|1|#F580B1}}: {{Cl|IF}} i > n {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected , ..."</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|GOTO}} erasenextarray
            {{Cl|END}} {{Cl|IF}}
            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
            {{Cl|GOTO}} finishedline
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'DIM/REDIM/STATIC</nowiki>|#919191}}
    {{Cl|IF}} n >= {{Text|2|#F580B1}} {{Cl|THEN}}
        dimoption = {{Text|0|#F580B1}}: redimoption = {{Text|0|#F580B1}}: commonoption = {{Text|0|#F580B1}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"DIM"</nowiki>|#FFB100}} {{Cl|THEN}} l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Dim"</nowiki>|#FFB100}}): dimoption = {{Text|1|#F580B1}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"REDIM"</nowiki>|#FFB100}} {{Cl|THEN}}
            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"ReDim"</nowiki>|#FFB100}})
            dimoption = {{Text|2|#F580B1}}: redimoption = {{Text|1|#F580B1}}
            {{Cl|IF}} secondelement$ = {{Text|<nowiki>"_PRESERVE"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (secondelement$ = {{Text|<nowiki>"PRESERVE"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}}
                redimoption = {{Text|2|#F580B1}}
                {{Cl|IF}} secondelement$ = {{Text|<nowiki>"_PRESERVE"</nowiki>|#FFB100}} {{Cl|THEN}}
                    l$ = l$ + sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"_Preserve"</nowiki>|#FFB100}})
                {{Cl|ELSE}}
                    l$ = l$ + sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Preserve"</nowiki>|#FFB100}})
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} n = {{Text|2|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected REDIM "</nowiki>|#FFB100}} + qb64prefix$ + {{Text|<nowiki>"PRESERVE ..."</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"STATIC"</nowiki>|#FFB100}} {{Cl|THEN}} l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Static"</nowiki>|#FFB100}}): dimoption = {{Text|3|#F580B1}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"COMMON"</nowiki>|#FFB100}} {{Cl|THEN}} l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Common"</nowiki>|#FFB100}}): dimoption = {{Text|1|#F580B1}}: commonoption = {{Text|1|#F580B1}}
        {{Cl|IF}} dimoption {{Cl|THEN}}
            {{Cl|IF}} dimoption = {{Text|3|#F580B1}} {{Cl|AND (boolean)|AND}} subfuncn = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"STATIC must be used within a SUB/FUNCTION"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|IF}} commonoption = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} subfuncn <> {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"COMMON cannot be used within a SUB/FUNCTION"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            i = {{Text|2|#F580B1}}
            {{Cl|IF}} redimoption = {{Text|2|#F580B1}} {{Cl|THEN}} i = {{Text|3|#F580B1}}
            {{Cl|IF}} dimoption <> {{Text|3|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'shared cannot be static</nowiki>|#919191}}
                a2$ = {{Text|getelement|#55FF55}}(a$, i)
                {{Cl|IF}} a2$ = {{Text|<nowiki>"SHARED"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} subfuncn <> {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"DIM/REDIM SHARED invalid within a SUB/FUNCTION"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    dimshared = {{Text|1|#F580B1}}
                    i = i + {{Text|1|#F580B1}}
                    l$ = l$ + sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Shared"</nowiki>|#FFB100}})
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} dimoption = {{Text|3|#F580B1}} {{Cl|THEN}} dimstatic = {{Text|1|#F580B1}}: AllowLocalName = {{Text|1|#F580B1}}
            {{Text|<nowiki>'look for new dim syntax: DIM AS variabletype var1, var2, etc....</nowiki>|#919191}}
            e$ = {{Text|getelement$|#55FF55}}(a$, i)
            {{Cl|IF}} e$ <> {{Text|<nowiki>"AS"</nowiki>|#FFB100}} {{Cl|THEN}}
                {{Text|<nowiki>'no "AS", so this is the traditional dim syntax</nowiki>|#919191}}
                dimnext:
                newDimSyntax = {{Text|0|#F580B1}}
                notype = {{Text|0|#F580B1}}
                listarray = {{Text|0|#F580B1}}
                {{Text|<nowiki>'old chain code</nowiki>|#919191}}
                {{Text|<nowiki>'chaincommonarray=0</nowiki>|#919191}}
                varname$ = {{Text|getelement|#55FF55}}(ca$, i): i = i + {{Text|1|#F580B1}}
                {{Cl|IF}} varname$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected "</nowiki>|#FFB100}} + firstelement$ + {{Text|<nowiki>" variable-name or "</nowiki>|#FFB100}} + firstelement$ + {{Text|<nowiki>" AS type variable-list"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Text|<nowiki>'get the next element</nowiki>|#919191}}
                {{Cl|IF}} i >= n + {{Text|1|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|ELSE}} e$ = {{Text|getelement|#55FF55}}(a$, i): i = i + {{Text|1|#F580B1}}
                {{Text|<nowiki>'check if next element is a ( to create an array</nowiki>|#919191}}
                elements$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                {{Cl|IF}} e$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}}
                    B = {{Text|1|#F580B1}}
                    {{Cl|FOR}} i = i {{Cl|TO}} n
                        e$ = {{Text|getelement|#55FF55}}(ca$, i)
                        {{Cl|IF}} e$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} B = B + {{Text|1|#F580B1}}
                        {{Cl|IF}} e$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} B = B - {{Text|1|#F580B1}}
                        {{Cl|IF}} B = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}}
                        {{Cl|IF}} {{Cl|LEN}}(elements$) {{Cl|THEN}} elements$ = elements$ + sp + e$ {{Cl|ELSE}} elements$ = e$
                    {{Cl|NEXT}}
                    {{Cl|IF}} B <> {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected )"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    i = i + {{Text|1|#F580B1}} {{Text|<nowiki>'set i to point to the next element</nowiki>|#919191}}
                    {{Cl|IF}} commonoption {{Cl|THEN}} elements$ = {{Text|<nowiki>"?"</nowiki>|#FFB100}}
                    {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"DIM2:array:elements$:["</nowiki>|#FFB100}} + elements$ + {{Text|<nowiki>"]"</nowiki>|#FFB100}}
                    {{Text|<nowiki>'arrayname() means list array to it will automatically be static when it is formally dimensioned later</nowiki>|#919191}}
                    {{Text|<nowiki>'note: listed arrays are always created in dynamic memory, but their contents are not erased</nowiki>|#919191}}
                    {{Text|<nowiki>'      this differs from static arrays from SUB...STATIC and the unique QB64 method -> STATIC arrayname(100)</nowiki>|#919191}}
                    {{Cl|IF}} dimoption = {{Text|3|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'STATIC used</nowiki>|#919191}}
                        {{Cl|IF}} {{Cl|LEN}}(elements$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'nothing between brackets</nowiki>|#919191}}
                            listarray = {{Text|1|#F580B1}} {{Text|<nowiki>'add to static list</nowiki>|#919191}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|<nowiki>'last element was ")"</nowiki>|#919191}}
                    {{Text|<nowiki>'get next element</nowiki>|#919191}}
                    {{Cl|IF}} i >= n + {{Text|1|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|ELSE}} e$ = {{Text|getelement|#55FF55}}(a$, i): i = i + {{Text|1|#F580B1}}
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'e$="("</nowiki>|#919191}}
                d$ = e$
                dimmethod = {{Text|0|#F580B1}}
                appendname$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Text|<nowiki>'the symbol to append to name returned by dim2</nowiki>|#919191}}
                appendtype$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Text|<nowiki>'eg. sp+AS+spINTEGER</nowiki>|#919191}}
                dim2typepassback$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                {{Text|<nowiki>'does varname have an appended symbol?</nowiki>|#919191}}
                s$ = {{Text|removesymbol$|#55FF55}}(varname$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Cl|IF}} {{Text|validname|#55FF55}}(varname$) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid variable name"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|IF}} s$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
                    typ$ = s$
                    dimmethod = {{Text|1|#F580B1}}
                    appendname$ = typ$
                    {{Cl|GOTO}} dimgottyp
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} d$ = {{Text|<nowiki>"AS"</nowiki>|#FFB100}} {{Cl|THEN}}
                    appendtype$ = sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"As"</nowiki>|#FFB100}})
                    typ$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    {{Cl|FOR}} i = i {{Cl|TO}} n
                        d$ = {{Text|getelement|#55FF55}}(a$, i)
                        {{Cl|IF}} d$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}} i = i + {{Text|1|#F580B1}}: {{Cl|EXIT}} {{Cl|FOR}}
                        typ$ = typ$ + d$ + {{Text|<nowiki>" "</nowiki>|#FFB100}}
                        appendtype$ = appendtype$ + sp + d$
                        d$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    {{Cl|NEXT}}
                    appendtype$ = {{Text|SCase2$|#55FF55}}(appendtype$) {{Text|<nowiki>'capitalise default types (udt override this later if necessary)</nowiki>|#919191}}
                    typ$ = {{Cl|RTRIM$}}(typ$)
                    {{Cl|GOTO}} dimgottyp
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'auto-define type based on name</nowiki>|#919191}}
                notype = {{Text|1|#F580B1}}
                {{Cl|IF}} {{Cl|LEFT$}}(varname$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"_"</nowiki>|#FFB100}} {{Cl|THEN}} v = {{Text|27|#F580B1}} {{Cl|ELSE}} v = {{Cl|ASC (function)|ASC}}({{Cl|UCASE$}}(varname$)) - {{Text|64|#F580B1}}
                typ$ = defineaz(v)
                dimmethod = {{Text|1|#F580B1}}
                {{Cl|GOTO}} dimgottyp
                dimgottyp:
                {{Cl|IF}} d$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} d$ <> {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"DIM: Expected ,"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Text|<nowiki>'In QBASIC, if no type info is given it can refer to an expeicit/formally defined array</nowiki>|#919191}}
                {{Cl|IF}} notype <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} dimoption <> {{Text|3|#F580B1}} {{Cl|AND (boolean)|AND}} dimoption <> {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'not DIM or STATIC which only create new content</nowiki>|#919191}}
                    {{Cl|IF}} {{Cl|LEN}}(elements$) {{Cl|THEN}} {{Text|<nowiki>'an array</nowiki>|#919191}}
                        {{Cl|IF}} {{Text|FindArray|#55FF55}}(varname$) {{Cl|THEN}}
                            {{Cl|IF}} {{Cl|LEN}}({{Cl|RTRIM$}}(id.mayhave)) {{Cl|THEN}} {{Text|<nowiki>'explict/formally defined</nowiki>|#919191}}
                                typ$ = {{Text|id2fulltypename$|#55FF55}} {{Text|<nowiki>'adopt type</nowiki>|#919191}}
                                dimmethod = {{Text|0|#F580B1}} {{Text|<nowiki>'set as formally defined</nowiki>|#919191}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                NormalDimBlock:
                {{Cl|IF}} dimoption = {{Text|3|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|LEN}}(elements$) {{Cl|THEN}} {{Text|<nowiki>'eg. STATIC a(100)</nowiki>|#919191}}
                    {{Text|<nowiki>'does a conflicting array exist? (use findarray) if so again this should lead to duplicate definition</nowiki>|#919191}}
                    typ2$ = {{Text|symbol2fulltypename$|#55FF55}}(typ$)
                    t = {{Text|typname2typ|#55FF55}}(typ2$): ts = typname2typsize
                    {{Text|<nowiki>'try name without any extension</nowiki>|#919191}}
                    {{Cl|IF}} {{Text|FindArray|#55FF55}}(varname$) {{Cl|THEN}} {{Text|<nowiki>'name without any symbol</nowiki>|#919191}}
                        {{Cl|IF}} id.insubfuncn = subfuncn {{Cl|THEN}} {{Text|<nowiki>'global cannot conflict with static</nowiki>|#919191}}
                            {{Cl|IF}} {{Cl|LEN}}({{Cl|RTRIM$}}(id.musthave)) {{Cl|THEN}}
                                {{Text|<nowiki>'if types match then fail</nowiki>|#919191}}
                                {{Cl|IF}} (id.arraytype {{Cl|AND (boolean)|AND}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) = (t {{Cl|AND (boolean)|AND}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) {{Cl|THEN}}
                                    {{Cl|IF}} ts = id.tsize {{Cl|THEN}}
                                        a$ = {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + varname$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|ELSE}}
                                {{Cl|IF}} dimmethod = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    a$ = {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + varname$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes {{Text|<nowiki>'explicit over explicit</nowiki>|#919191}}
                                {{Cl|ELSE}}
                                    {{Text|<nowiki>'if types match then fail</nowiki>|#919191}}
                                    {{Cl|IF}} (id.arraytype {{Cl|AND (boolean)|AND}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) = (t {{Cl|AND (boolean)|AND}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) {{Cl|THEN}}
                                        {{Cl|IF}} ts = id.tsize {{Cl|THEN}}
                                            a$ = {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + varname$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|<nowiki>'add extension (if possible)</nowiki>|#919191}}
                    {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISUDT) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        s2$ = {{Text|type2symbol$|#55FF55}}(typ2$)
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                        {{Cl|IF}} {{Text|FindArray|#55FF55}}(varname$ + s2$) {{Cl|THEN}}
                            {{Cl|IF}} id.insubfuncn = subfuncn {{Cl|THEN}} {{Text|<nowiki>'global cannot conflict with static</nowiki>|#919191}}
                                {{Cl|IF}} {{Cl|LEN}}({{Cl|RTRIM$}}(id.musthave)) {{Cl|THEN}}
                                    {{Text|<nowiki>'if types match then fail</nowiki>|#919191}}
                                    {{Cl|IF}} (id.arraytype {{Cl|AND (boolean)|AND}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) = (t {{Cl|AND (boolean)|AND}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) {{Cl|THEN}}
                                        {{Cl|IF}} ts = id.tsize {{Cl|THEN}}
                                            a$ = {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + varname$ + s2$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|ELSE}}
                                    {{Cl|IF}} dimmethod = {{Text|0|#F580B1}} {{Cl|THEN}}
                                        a$ = {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + varname$ + s2$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes {{Text|<nowiki>'explicit over explicit</nowiki>|#919191}}
                                    {{Cl|ELSE}}
                                        {{Text|<nowiki>'if types match then fail</nowiki>|#919191}}
                                        {{Cl|IF}} (id.arraytype {{Cl|AND (boolean)|AND}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) = (t {{Cl|AND (boolean)|AND}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) {{Cl|THEN}}
                                            {{Cl|IF}} ts = id.tsize {{Cl|THEN}}
                                                a$ = {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + varname$ + s2$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                            {{Cl|END}} {{Cl|IF}}
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'not a UDT</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} listarray {{Cl|THEN}} {{Text|<nowiki>'eg. STATIC a()</nowiki>|#919191}}
                    {{Text|<nowiki>'note: list is cleared by END SUB/FUNCTION</nowiki>|#919191}}
                    {{Text|<nowiki>'is a conflicting array already listed? if so this should cause a duplicate definition error</nowiki>|#919191}}
                    {{Text|<nowiki>'check for conflict within list:</nowiki>|#919191}}
                    xi = {{Text|1|#F580B1}}
                    {{Cl|FOR}} x = {{Text|1|#F580B1}} {{Cl|TO}} staticarraylistn
                        varname2$ = {{Text|getelement$|#55FF55}}(staticarraylist, xi): xi = xi + {{Text|1|#F580B1}}
                        typ2$ = {{Text|getelement$|#55FF55}}(staticarraylist, xi): xi = xi + {{Text|1|#F580B1}}
                        dimmethod2 = {{Cl|VAL}}({{Text|getelement$|#55FF55}}(staticarraylist, xi)): xi = xi + {{Text|1|#F580B1}}
                        {{Text|<nowiki>'check if they are similar</nowiki>|#919191}}
                        {{Cl|IF}} {{Cl|UCASE$}}(varname$) = {{Cl|UCASE$}}(varname2$) {{Cl|THEN}}
                            {{Cl|IF}} dimmethod2 = {{Text|1|#F580B1}} {{Cl|THEN}}
                                {{Text|<nowiki>'old using symbol</nowiki>|#919191}}
                                {{Cl|IF}} {{Text|symbol2fulltypename$|#55FF55}}(typ$) = typ2$ {{Cl|THEN}} a$ = {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + varname$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                            {{Cl|ELSE}}
                                {{Text|<nowiki>'old using AS</nowiki>|#919191}}
                                {{Cl|IF}} dimmethod = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    a$ = {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + varname$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                {{Cl|ELSE}}
                                    {{Cl|IF}} {{Text|symbol2fulltypename$|#55FF55}}(typ$) = typ2$ {{Cl|THEN}} a$ = {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + varname$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|NEXT}}
                    {{Text|<nowiki>'does a conflicting array exist? (use findarray) if so again this should lead to duplicate definition</nowiki>|#919191}}
                    typ2$ = {{Text|symbol2fulltypename$|#55FF55}}(typ$)
                    t = {{Text|typname2typ|#55FF55}}(typ2$): ts = typname2typsize
                    {{Text|<nowiki>'try name without any extension</nowiki>|#919191}}
                    {{Cl|IF}} {{Text|FindArray|#55FF55}}(varname$) {{Cl|THEN}} {{Text|<nowiki>'name without any symbol</nowiki>|#919191}}
                        {{Cl|IF}} id.insubfuncn = subfuncn {{Cl|THEN}} {{Text|<nowiki>'global cannot conflict with static</nowiki>|#919191}}
                            {{Cl|IF}} {{Cl|LEN}}({{Cl|RTRIM$}}(id.musthave)) {{Cl|THEN}}
                                {{Text|<nowiki>'if types match then fail</nowiki>|#919191}}
                                {{Cl|IF}} (id.arraytype {{Cl|AND (boolean)|AND}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) = (t {{Cl|AND (boolean)|AND}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) {{Cl|THEN}}
                                    {{Cl|IF}} ts = id.tsize {{Cl|THEN}}
                                        a$ = {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + varname$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|ELSE}}
                                {{Cl|IF}} dimmethod = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    a$ = {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + varname$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes {{Text|<nowiki>'explicit over explicit</nowiki>|#919191}}
                                {{Cl|ELSE}}
                                    {{Text|<nowiki>'if types match then fail</nowiki>|#919191}}
                                    {{Cl|IF}} (id.arraytype {{Cl|AND (boolean)|AND}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) = (t {{Cl|AND (boolean)|AND}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) {{Cl|THEN}}
                                        {{Cl|IF}} ts = id.tsize {{Cl|THEN}}
                                            a$ = {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + varname$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|<nowiki>'add extension (if possible)</nowiki>|#919191}}
                    {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISUDT) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        s2$ = {{Text|type2symbol$|#55FF55}}(typ2$)
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                        {{Cl|IF}} {{Text|FindArray|#55FF55}}(varname$ + s2$) {{Cl|THEN}}
                            {{Cl|IF}} id.insubfuncn = subfuncn {{Cl|THEN}} {{Text|<nowiki>'global cannot conflict with static</nowiki>|#919191}}
                                {{Cl|IF}} {{Cl|LEN}}({{Cl|RTRIM$}}(id.musthave)) {{Cl|THEN}}
                                    {{Text|<nowiki>'if types match then fail</nowiki>|#919191}}
                                    {{Cl|IF}} (id.arraytype {{Cl|AND (boolean)|AND}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) = (t {{Cl|AND (boolean)|AND}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) {{Cl|THEN}}
                                        {{Cl|IF}} ts = id.tsize {{Cl|THEN}}
                                            a$ = {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + varname$ + s2$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|ELSE}}
                                    {{Cl|IF}} dimmethod = {{Text|0|#F580B1}} {{Cl|THEN}}
                                        a$ = {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + varname$ + s2$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes {{Text|<nowiki>'explicit over explicit</nowiki>|#919191}}
                                    {{Cl|ELSE}}
                                        {{Text|<nowiki>'if types match then fail</nowiki>|#919191}}
                                        {{Cl|IF}} (id.arraytype {{Cl|AND (boolean)|AND}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) = (t {{Cl|AND (boolean)|AND}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) {{Cl|THEN}}
                                            {{Cl|IF}} ts = id.tsize {{Cl|THEN}}
                                                a$ = {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + varname$ + s2$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                            {{Cl|END}} {{Cl|IF}}
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'not a UDT</nowiki>|#919191}}
                    {{Text|<nowiki>'note: static list arrays cannot be created until they are formally [or informally] (RE)DIM'd later</nowiki>|#919191}}
                    {{Cl|IF}} {{Cl|LEN}}(staticarraylist) {{Cl|THEN}} staticarraylist = staticarraylist + sp
                    staticarraylist = staticarraylist + varname$ + sp + {{Text|symbol2fulltypename$|#55FF55}}(typ$) + sp + {{Text|str2|#55FF55}}(dimmethod)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    staticarraylistn = staticarraylistn + {{Text|1|#F580B1}}
                    l$ = l$ + sp + varname$ + appendname$ + sp2 + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp2 + {{Text|<nowiki>")"</nowiki>|#FFB100}} + appendtype$
                    {{Text|<nowiki>'note: none of the following code is run, dim2 call is also skipped</nowiki>|#919191}}
                {{Cl|ELSE}}
                    olddimstatic = dimstatic
                    {{Text|<nowiki>'check if varname is on the static list</nowiki>|#919191}}
                    {{Cl|IF}} {{Cl|LEN}}(elements$) {{Cl|THEN}} {{Text|<nowiki>'it's an array</nowiki>|#919191}}
                        {{Cl|IF}} subfuncn {{Cl|THEN}} {{Text|<nowiki>'it's in a sub/function</nowiki>|#919191}}
                            xi = {{Text|1|#F580B1}}
                            {{Cl|FOR}} x = {{Text|1|#F580B1}} {{Cl|TO}} staticarraylistn
                                varname2$ = {{Text|getelement$|#55FF55}}(staticarraylist, xi): xi = xi + {{Text|1|#F580B1}}
                                typ2$ = {{Text|getelement$|#55FF55}}(staticarraylist, xi): xi = xi + {{Text|1|#F580B1}}
                                dimmethod2 = {{Cl|VAL}}({{Text|getelement$|#55FF55}}(staticarraylist, xi)): xi = xi + {{Text|1|#F580B1}}
                                {{Text|<nowiki>'check if they are similar</nowiki>|#919191}}
                                {{Cl|IF}} {{Cl|UCASE$}}(varname$) = {{Cl|UCASE$}}(varname2$) {{Cl|THEN}}
                                    {{Cl|IF}} {{Text|symbol2fulltypename$|#55FF55}}(typ$) = typ2$ {{Cl|THEN}}
                                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                        {{Cl|IF}} dimmethod = dimmethod2 {{Cl|THEN}}
                                            {{Text|<nowiki>'match found!</nowiki>|#919191}}
                                            varname$ = varname2$
                                            dimstatic = {{Text|3|#F580B1}}
                                            {{Cl|IF}} dimoption = {{Text|3|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Array already listed as STATIC"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'typ</nowiki>|#919191}}
                                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'varname</nowiki>|#919191}}
                            {{Cl|NEXT}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|<nowiki>'COMMON exception</nowiki>|#919191}}
                    {{Text|<nowiki>'note: COMMON alone does not imply SHARED</nowiki>|#919191}}
                    {{Text|<nowiki>'      if either(or both) COMMON & later DIM have SHARED, variable becomes shared</nowiki>|#919191}}
                    {{Cl|IF}} commonoption {{Cl|THEN}}
                        {{Cl|IF}} {{Cl|LEN}}(elements$) {{Cl|THEN}}
                            {{Text|<nowiki>'add array to list</nowiki>|#919191}}
                            {{Cl|IF}} {{Cl|LEN}}(commonarraylist) {{Cl|THEN}} commonarraylist = commonarraylist + sp
                            {{Text|<nowiki>'note: dimmethod distinguishes between a%(...) vs a(...) AS INTEGER</nowiki>|#919191}}
                            commonarraylist = commonarraylist + varname$ + sp + {{Text|symbol2fulltypename$|#55FF55}}(typ$) + sp + {{Text|str2|#55FF55}}(dimmethod) + sp + {{Text|str2|#55FF55}}(dimshared)
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            commonarraylistn = commonarraylistn + {{Text|1|#F580B1}}
                            {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"common listed:"</nowiki>|#FFB100}} + varname$ + sp + {{Text|symbol2fulltypename$|#55FF55}}(typ$) + sp + {{Text|str2|#55FF55}}(dimmethod) + sp + {{Text|str2|#55FF55}}(dimshared)
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            x = {{Text|0|#F580B1}}
                            v$ = varname$
                            {{Cl|IF}} dimmethod = {{Text|1|#F580B1}} {{Cl|THEN}} v$ = v$ + typ$
                            try = {{Text|findid|#55FF55}}(v$)
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Cl|DO}} {{Cl|WHILE}} try
                                {{Cl|IF}} id.arraytype {{Cl|THEN}}
                                    t = {{Text|typname2typ|#55FF55}}(typ$)
                                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                    s = typname2typsize
                                    match = {{Text|1|#F580B1}}
                                    {{Text|<nowiki>'note: dimmethod 2 is already matched</nowiki>|#919191}}
                                    {{Cl|IF}} dimmethod = {{Text|0|#F580B1}} {{Cl|THEN}}
                                        t2 = id.arraytype
                                        s2 = id.tsize
                                        {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISFLOAT) <> (t2 {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}} match = {{Text|0|#F580B1}}
                                        {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISUNSIGNED) <> (t2 {{Cl|AND (boolean)|AND}} ISUNSIGNED) {{Cl|THEN}} match = {{Text|0|#F580B1}}
                                        {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISSTRING) <> (t2 {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} match = {{Text|0|#F580B1}}
                                        {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) <> (t2 {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) {{Cl|THEN}} match = {{Text|0|#F580B1}}
                                        {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) <> (t2 {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) {{Cl|THEN}} match = {{Text|0|#F580B1}}
                                        {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISUDT) <> (t2 {{Cl|AND (boolean)|AND}} ISUDT) {{Cl|THEN}} match = {{Text|0|#F580B1}}
                                        {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) <> (t2 {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) {{Cl|THEN}} match = {{Text|0|#F580B1}}
                                        {{Cl|IF}} s <> s2 {{Cl|THEN}} match = {{Text|0|#F580B1}}
                                        {{Text|<nowiki>'check for implicit/explicit declaration match</nowiki>|#919191}}
                                        oldmethod = {{Text|0|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}({{Cl|RTRIM$}}(id.musthave)) {{Cl|THEN}} oldmethod = {{Text|1|#F580B1}}
                                        {{Cl|IF}} oldmethod <> dimmethod {{Cl|THEN}} match = {{Text|0|#F580B1}}
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Cl|IF}} match {{Cl|THEN}}
                                        x = currentid
                                        {{Cl|IF}} dimshared {{Cl|THEN}} ids(x).share = {{Text|1|#F580B1}} {{Text|<nowiki>'share if necessary</nowiki>|#919191}}
                                        tlayout$ = {{Cl|RTRIM$}}(id.cn) + sp + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp2 + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                                        {{Cl|IF}} dimmethod = {{Text|0|#F580B1}} {{Cl|THEN}}
                                            {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
                                                dim2typepassback$ = {{Cl|RTRIM$}}(udtxcname(t {{Cl|AND}} {{Text|511|#F580B1}}))
                                                {{Cl|IF}} {{Cl|UCASE$}}(typ$) = {{Text|<nowiki>"MEM"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|RTRIM$}}(udtxcname(t {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}})) = {{Text|<nowiki>"_MEM"</nowiki>|#FFB100}} {{Cl|THEN}}
                                                    dim2typepassback$ = {{Cl|MID$ (function)|MID$}}({{Cl|RTRIM$}}(udtxcname(t {{Cl|AND}} {{Text|511|#F580B1}})), {{Text|2|#F580B1}})
                                                {{Cl|END}} {{Cl|IF}}
                                            {{Cl|ELSE}}
                                                dim2typepassback$ = typ$
                                                {{Cl|DO}} {{Cl|WHILE}} {{Cl|INSTR}}(dim2typepassback$, {{Text|<nowiki>" "</nowiki>|#FFB100}})
                                                    {{Cl|ASC}}(dim2typepassback$, {{Cl|INSTR}}(dim2typepassback$, {{Text|<nowiki>" "</nowiki>|#FFB100}})) = {{Cl|ASC (function)|ASC}}(sp)
                                                {{Cl|LOOP}}
                                                dim2typepassback$ = {{Text|SCase2$|#55FF55}}(dim2typepassback$)
                                            {{Cl|END}} {{Cl|IF}}
                                        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'method 0</nowiki>|#919191}}
                                        {{Cl|EXIT}} {{Cl|DO}}
                                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'match</nowiki>|#919191}}
                                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'arraytype</nowiki>|#919191}}
                                {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(v$) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
                                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Cl|LOOP}}
                            {{Cl|IF}} x = {{Text|0|#F580B1}} {{Cl|THEN}} x = idn + {{Text|1|#F580B1}}
                            {{Text|<nowiki>'note: the following code only adds include directives, everything else is defered</nowiki>|#919191}}
                            ChainTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"A"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"chain.txt"</nowiki>|#FFB100}})
                            {{Text|<nowiki>'include directive</nowiki>|#919191}}
                            {{Text|WriteBufLine|#55FF55}} ChainTxtBuf, {{Text|<nowiki>"#include "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"chain"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(x) + {{Text|<nowiki>".txt"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}})
                            {{Text|<nowiki>'create/clear include file</nowiki>|#919191}}
                            ChainTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"chain"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(x) + {{Text|<nowiki>".txt"</nowiki>|#FFB100}})
                            ChainTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"A"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"inpchain.txt"</nowiki>|#FFB100}})
                            {{Text|<nowiki>'include directive</nowiki>|#919191}}
                            {{Text|WriteBufLine|#55FF55}} ChainTxtBuf, {{Text|<nowiki>"#include "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"inpchain"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(x) + {{Text|<nowiki>".txt"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}})
                            {{Text|<nowiki>'create/clear include file</nowiki>|#919191}}
                            ChainTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"inpchain"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(x) + {{Text|<nowiki>".txt"</nowiki>|#FFB100}})
                            {{Text|<nowiki>'note: elements$="?"</nowiki>|#919191}}
                            {{Cl|IF}} x <> idn + {{Text|1|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} skipdim {{Text|<nowiki>'array already exists</nowiki>|#919191}}
                            {{Cl|GOTO}} dimcommonarray
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|<nowiki>'is varname on common list?</nowiki>|#919191}}
                    {{Text|<nowiki>'******</nowiki>|#919191}}
                    {{Cl|IF}} {{Cl|LEN}}(elements$) {{Cl|THEN}} {{Text|<nowiki>'it's an array</nowiki>|#919191}}
                        {{Cl|IF}} subfuncn = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'not in a sub/function</nowiki>|#919191}}
                            {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"common checking:"</nowiki>|#FFB100}} + varname$
                            xi = {{Text|1|#F580B1}}
                            {{Cl|FOR}} x = {{Text|1|#F580B1}} {{Cl|TO}} commonarraylistn
                                varname2$ = {{Text|getelement$|#55FF55}}(commonarraylist, xi): xi = xi + {{Text|1|#F580B1}}
                                typ2$ = {{Text|getelement$|#55FF55}}(commonarraylist, xi): xi = xi + {{Text|1|#F580B1}}
                                dimmethod2 = {{Cl|VAL}}({{Text|getelement$|#55FF55}}(commonarraylist, xi)): xi = xi + {{Text|1|#F580B1}}
                                dimshared2 = {{Cl|VAL}}({{Text|getelement$|#55FF55}}(commonarraylist, xi)): xi = xi + {{Text|1|#F580B1}}
                                {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"common checking against:"</nowiki>|#FFB100}} + varname2$ + sp + typ2$ + sp + {{Text|str2|#55FF55}}(dimmethod2) + sp + {{Text|str2|#55FF55}}(dimshared2)
                                {{Text|<nowiki>'check if they are similar</nowiki>|#919191}}
                                {{Cl|IF}} varname$ = varname2$ {{Cl|THEN}}
                                    {{Cl|IF}} {{Text|symbol2fulltypename$|#55FF55}}(typ$) = typ2$ {{Cl|THEN}}
                                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                        {{Cl|IF}} dimmethod = dimmethod2 {{Cl|THEN}}
                                            {{Text|<nowiki>'match found!</nowiki>|#919191}}
                                            {{Text|<nowiki>'enforce shared status (if necessary)</nowiki>|#919191}}
                                            {{Cl|IF}} dimshared2 {{Cl|THEN}} dimshared = dimshared {{Cl|OR}} {{Text|2|#F580B1}} {{Text|<nowiki>'temp force SHARED</nowiki>|#919191}}
                                            {{Text|<nowiki>'old chain code</nowiki>|#919191}}
                                            {{Text|<nowiki>'chaincommonarray=x</nowiki>|#919191}}
                                        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'method</nowiki>|#919191}}
                                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'typ</nowiki>|#919191}}
                                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'varname</nowiki>|#919191}}
                            {{Cl|NEXT}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                    dimcommonarray:
                    retval = {{Text|dim2|#55FF55}}(varname$, typ$, dimmethod, elements$)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    skipdim:
                    {{Cl|IF}} dimshared >= {{Text|2|#F580B1}} {{Cl|THEN}} dimshared = dimshared - {{Text|2|#F580B1}}
                    {{Text|<nowiki>'non-array COMMON variable</nowiki>|#919191}}
                    {{Cl|IF}} commonoption <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|LEN}}(elements$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Text|<nowiki>'CHAIN.TXT (save)</nowiki>|#919191}}
                        use_global_byte_elements = {{Text|1|#F580B1}}
                        {{Text|<nowiki>'switch output from main.txt to chain.txt</nowiki>|#919191}}
                        MainTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"A"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"chain.txt"</nowiki>|#FFB100}})
                        l2$ = tlayout$
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"int32val=1;"</nowiki>|#FFB100}} {{Text|<nowiki>'simple variable</nowiki>|#919191}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_put(FF,NULL,byte_element((uint64)&int32val,4,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}}
                        t = id.t
                        bits = t {{Cl|AND}} {{Text|511|#F580B1}}
                        {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}} bits = udtxsize(t {{Cl|AND}} {{Text|511|#F580B1}})
                        {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                            {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH {{Cl|THEN}}
                                bits = id.tsize * {{Text|8|#F580B1}}
                            {{Cl|ELSE}}
                                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"int64val=__STRING_"</nowiki>|#FFB100}} + {{Cl|RTRIM$}}(id.n) + {{Text|<nowiki>"->len*8;"</nowiki>|#FFB100}}
                                bits = {{Text|0|#F580B1}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} bits {{Cl|THEN}}
                            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"int64val="</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(bits) + {{Text|<nowiki>";"</nowiki>|#FFB100}} {{Text|<nowiki>'size in bits</nowiki>|#919191}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_put(FF,NULL,byte_element((uint64)&int64val,8,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}}
                        {{Text|<nowiki>'put the variable</nowiki>|#919191}}
                        e$ = {{Cl|RTRIM$}}(id.n)
                        {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISUDT) = {{Text|0|#F580B1}} {{Cl|THEN}}
                            {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH {{Cl|THEN}}
                                e$ = e$ + {{Text|<nowiki>"$"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(id.tsize)
                            {{Cl|ELSE}}
                                e$ = e$ + {{Text|typevalue2symbol$|#55FF55}}(t)
                                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                        e$ = {{Text|evaluatetotyp|#55FF55}}({{Text|fixoperationorder$|#55FF55}}(e$), {{Text|-4|#F580B1}})
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_put(FF,NULL,"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>",0);"</nowiki>|#FFB100}}
                        tlayout$ = l2$
                        {{Text|<nowiki>'revert output to main.txt</nowiki>|#919191}}
                        MainTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"A"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"main.txt"</nowiki>|#FFB100}})
                        {{Text|<nowiki>'INPCHAIN.TXT (load)</nowiki>|#919191}}
                        {{Text|<nowiki>'switch output from main.txt to chain.txt</nowiki>|#919191}}
                        MainTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"A"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"inpchain.txt"</nowiki>|#FFB100}})
                        l2$ = tlayout$
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (int32val==1){"</nowiki>|#FFB100}}
                        {{Text|<nowiki>'get the size in bits</nowiki>|#919191}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_get(FF,NULL,byte_element((uint64)&int64val,8,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}}
                        {{Text|<nowiki>'***assume correct size***</nowiki>|#919191}}
                        e$ = {{Cl|RTRIM$}}(id.n)
                        t = id.t
                        {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISUDT) = {{Text|0|#F580B1}} {{Cl|THEN}}
                            {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH {{Cl|THEN}}
                                e$ = e$ + {{Text|<nowiki>"$"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(id.tsize)
                            {{Cl|ELSE}}
                                e$ = e$ + {{Text|typevalue2symbol$|#55FF55}}(t)
                                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                            {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tqbs=qbs_new(int64val>>3,1);"</nowiki>|#FFB100}}
                                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_set(__STRING_"</nowiki>|#FFB100}} + {{Cl|RTRIM$}}(id.n) + {{Text|<nowiki>",tqbs);"</nowiki>|#FFB100}}
                                {{Text|<nowiki>'now that the string is the correct size, the following GET command will work correctly...</nowiki>|#919191}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                        e$ = {{Text|evaluatetotyp|#55FF55}}({{Text|fixoperationorder$|#55FF55}}(e$), {{Text|-4|#F580B1}})
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_get(FF,NULL,"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>",0);"</nowiki>|#FFB100}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_get(FF,NULL,byte_element((uint64)&int32val,4,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}} {{Text|<nowiki>'get next command</nowiki>|#919191}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                        tlayout$ = l2$
                        {{Text|<nowiki>'revert output to main.txt</nowiki>|#919191}}
                        MainTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"A"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"main.txt"</nowiki>|#FFB100}})
                        use_global_byte_elements = {{Text|0|#F580B1}}
                    {{Cl|END}} {{Cl|IF}}
                    commonarraylisted:
                    {{Cl|IF}} {{Cl|LEN}}(appendtype$) > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} newDimSyntax = {{Text|-1|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} {{Cl|LEN}}(dim2typepassback$) {{Cl|THEN}} appendtype$ = sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"As"</nowiki>|#FFB100}}) + sp + dim2typepassback$
                        {{Cl|IF}} newDimSyntaxTypePassBack = {{Text|0|#F580B1}} {{Cl|THEN}}
                            newDimSyntaxTypePassBack = {{Text|-1|#F580B1}}
                            l$ = l$ + appendtype$
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                    n2 = {{Text|numelements|#55FF55}}(tlayout$)
                    l$ = l$ + sp + {{Text|getelement$|#55FF55}}(tlayout$, {{Text|1|#F580B1}}) + appendname$
                    {{Cl|IF}} n2 > {{Text|1|#F580B1}} {{Cl|THEN}}
                        l$ = l$ + sp2 + {{Text|getelements$|#55FF55}}(tlayout$, {{Text|2|#F580B1}}, n2)
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} {{Cl|LEN}}(appendtype$) > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} newDimSyntax = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} {{Cl|LEN}}(dim2typepassback$) {{Cl|THEN}} appendtype$ = sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"As"</nowiki>|#FFB100}}) + sp + dim2typepassback$
                        l$ = l$ + appendtype$
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|<nowiki>'modify first element name to include symbol</nowiki>|#919191}}
                    dimstatic = olddimstatic
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'listarray=0</nowiki>|#919191}}
                {{Cl|IF}} newDimSyntax {{Cl|THEN}} {{Cl|RETURN}}
                {{Cl|IF}} d$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}} l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}}: {{Cl|GOTO}} dimnext
                dimoption = {{Text|0|#F580B1}}
                dimshared = {{Text|0|#F580B1}}
                redimoption = {{Text|0|#F580B1}}
                {{Cl|IF}} dimstatic = {{Text|1|#F580B1}} {{Cl|THEN}} dimstatic = {{Text|0|#F580B1}}
                AllowLocalName = {{Text|0|#F580B1}}
                layoutdone = {{Text|1|#F580B1}}
                {{Cl|IF}} {{Cl|LEN}}(layout$) = {{Text|0|#F580B1}} {{Cl|THEN}} layout$ = l$ {{Cl|ELSE}} layout$ = layout$ + sp + l$
                {{Cl|GOTO}} finishedline
            {{Cl|ELSE}}
                {{Text|<nowiki>'yes, this is the new dim syntax.</nowiki>|#919191}}
                i = i + {{Text|1|#F580B1}} {{Text|<nowiki>'skip "AS"</nowiki>|#919191}}
                newDimSyntaxTypePassBack = {{Text|0|#F580B1}}
                {{Text|<nowiki>'estabilish the data type:</nowiki>|#919191}}
                appendname$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                appendtype$ = sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"As"</nowiki>|#FFB100}})
                typ$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                varname$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                previousElement$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                {{Cl|FOR}} i = i {{Cl|TO}} n
                    d$ = {{Text|getelement|#55FF55}}(a$, i)
                    {{Cl|IF}} d$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} d$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}}
                    varname$ = {{Text|getelement|#55FF55}}(ca$, i)
                    {{Cl|IF}} {{Cl|LEN}}(previousElement$) {{Cl|THEN}}
                        typ$ = typ$ + previousElement$ + {{Text|<nowiki>" "</nowiki>|#FFB100}}
                        appendtype$ = appendtype$ + sp + previousElement$
                    {{Cl|END}} {{Cl|IF}}
                    previousElement$ = d$
                    d$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                {{Cl|NEXT}}
                appendtype$ = {{Text|SCase2$|#55FF55}}(appendtype$) {{Text|<nowiki>'capitalise default types (udt override this later if necessary)</nowiki>|#919191}}
                typ$ = {{Cl|RTRIM$}}(typ$)
                dimnext2:
                notype = {{Text|0|#F580B1}}
                listarray = {{Text|0|#F580B1}}
                {{Cl|IF}} typ$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} varname$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected "</nowiki>|#FFB100}} + firstelement$ + {{Text|<nowiki>" AS type variable-list or "</nowiki>|#FFB100}} + firstelement$ + {{Text|<nowiki>" variable-name AS type"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Text|<nowiki>'get the next element</nowiki>|#919191}}
                {{Cl|IF}} i >= n + {{Text|1|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|ELSE}} e$ = {{Text|getelement|#55FF55}}(a$, i): i = i + {{Text|1|#F580B1}}
                {{Text|<nowiki>'check if next element is a ( to create an array</nowiki>|#919191}}
                elements$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                {{Cl|IF}} e$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}}
                    B = {{Text|1|#F580B1}}
                    {{Cl|FOR}} i = i {{Cl|TO}} n
                        e$ = {{Text|getelement|#55FF55}}(ca$, i)
                        {{Cl|IF}} e$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} B = B + {{Text|1|#F580B1}}
                        {{Cl|IF}} e$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} B = B - {{Text|1|#F580B1}}
                        {{Cl|IF}} B = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}}
                        {{Cl|IF}} {{Cl|LEN}}(elements$) {{Cl|THEN}} elements$ = elements$ + sp + e$ {{Cl|ELSE}} elements$ = e$
                    {{Cl|NEXT}}
                    {{Cl|IF}} B <> {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected )"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    i = i + {{Text|1|#F580B1}} {{Text|<nowiki>'set i to point to the next element</nowiki>|#919191}}
                    {{Cl|IF}} commonoption {{Cl|THEN}} elements$ = {{Text|<nowiki>"?"</nowiki>|#FFB100}}
                    {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"DIM2:array:elements$:["</nowiki>|#FFB100}} + elements$ + {{Text|<nowiki>"]"</nowiki>|#FFB100}}
                    {{Text|<nowiki>'arrayname() means list array to it will automatically be static when it is formally dimensioned later</nowiki>|#919191}}
                    {{Text|<nowiki>'note: listed arrays are always created in dynamic memory, but their contents are not erased</nowiki>|#919191}}
                    {{Text|<nowiki>'      this differs from static arrays from SUB...STATIC and the unique QB64 method -> STATIC arrayname(100)</nowiki>|#919191}}
                    {{Cl|IF}} dimoption = {{Text|3|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'STATIC used</nowiki>|#919191}}
                        {{Cl|IF}} {{Cl|LEN}}(elements$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'nothing between brackets</nowiki>|#919191}}
                            listarray = {{Text|1|#F580B1}} {{Text|<nowiki>'add to static list</nowiki>|#919191}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|<nowiki>'last element was ")"</nowiki>|#919191}}
                    {{Text|<nowiki>'get next element</nowiki>|#919191}}
                    {{Cl|IF}} i >= n + {{Text|1|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|ELSE}} e$ = {{Text|getelement|#55FF55}}(a$, i): i = i + {{Text|1|#F580B1}}
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'e$="("</nowiki>|#919191}}
                d$ = e$
                dimmethod = {{Text|0|#F580B1}}
                dim2typepassback$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                {{Text|<nowiki>'does varname have an appended symbol?</nowiki>|#919191}}
                s$ = {{Text|removesymbol$|#55FF55}}(varname$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Cl|IF}} {{Text|validname|#55FF55}}(varname$) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid variable name"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|IF}} s$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
                    a$ = {{Text|<nowiki>"Cannot use type symbol with "</nowiki>|#FFB100}} + firstelement$ + {{Text|<nowiki>" AS type variable-list ("</nowiki>|#FFB100}} + s$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                    {{Cl|GOTO}} errmes
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} d$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} d$ <> {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"DIM: Expected ,"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                newDimSyntax = {{Text|-1|#F580B1}}
                {{Cl|GOSUB}} NormalDimBlock
                newDimSyntax = {{Text|0|#F580B1}}
                {{Cl|IF}} d$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}}
                    l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}}
                    varname$ = {{Text|getelement|#55FF55}}(ca$, i): i = i + {{Text|1|#F580B1}}
                    {{Cl|GOTO}} dimnext2
                {{Cl|END}} {{Cl|IF}}
                dimoption = {{Text|0|#F580B1}}
                dimshared = {{Text|0|#F580B1}}
                redimoption = {{Text|0|#F580B1}}
                {{Cl|IF}} dimstatic = {{Text|1|#F580B1}} {{Cl|THEN}} dimstatic = {{Text|0|#F580B1}}
                AllowLocalName = {{Text|0|#F580B1}}
                layoutdone = {{Text|1|#F580B1}}
                {{Cl|IF}} {{Cl|LEN}}(layout$) = {{Text|0|#F580B1}} {{Cl|THEN}} layout$ = l$ {{Cl|ELSE}} layout$ = layout$ + sp + l$
                {{Cl|GOTO}} finishedline
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'THEN [GOTO] linenumber?</nowiki>|#919191}}
    {{Cl|IF}} THENGOTO = {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|THEN}}
            l$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            a = {{Cl|ASC (function)|ASC}}({{Cl|LEFT$}}(firstelement$, {{Text|1|#F580B1}}))
            {{Cl|IF}} a = {{Text|46|#F580B1}} {{Cl|OR (boolean)|OR}} (a >= {{Text|48|#F580B1}} {{Cl|AND (boolean)|AND}} a <= {{Text|57|#F580B1}}) {{Cl|THEN}} a2$ = ca$: {{Cl|GOTO}} THENGOTO
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'goto</nowiki>|#919191}}
    {{Cl|IF}} n = {{Text|2|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} {{Text|getelement$|#55FF55}}(a$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"GOTO"</nowiki>|#FFB100}} {{Cl|THEN}}
            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"GoTo"</nowiki>|#FFB100}})
            a2$ = {{Text|getelement$|#55FF55}}(ca$, {{Text|2|#F580B1}})
            THENGOTO:
            {{Cl|IF}} {{Text|validlabel|#55FF55}}(a2$) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid label!"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            v = {{Text|HashFind|#55FF55}}(a2$, HASHFLAG_LABEL, ignore, r)
            x = {{Text|1|#F580B1}}
            labchk2:
            {{Cl|IF}} v {{Cl|THEN}}
                s = Labels(r).{{Text|Scope|#55FF55}}
                {{Cl|IF}} s = subfuncn {{Cl|OR (boolean)|OR}} s = {{Text|-1|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'same scope?</nowiki>|#919191}}
                    {{Cl|IF}} s = {{Text|-1|#F580B1}} {{Cl|THEN}} Labels(r).{{Text|Scope|#55FF55}} = subfuncn {{Text|<nowiki>'acquire scope</nowiki>|#919191}}
                    x = {{Text|0|#F580B1}} {{Text|<nowiki>'already defined</nowiki>|#919191}}
                    tlayout$ = {{Cl|RTRIM$}}(Labels(r).cn)
                {{Cl|ELSE}}
                    {{Cl|IF}} v = {{Text|2|#F580B1}} {{Cl|THEN}} v = {{Text|HashFindCont|#55FF55}}(ignore, r): {{Cl|GOTO}} labchk2
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} x {{Cl|THEN}}
                {{Text|<nowiki>'does not exist</nowiki>|#919191}}
                nLabels = nLabels + {{Text|1|#F580B1}}: {{Cl|IF}} nLabels > Labels_Ubound {{Cl|THEN}} Labels_Ubound = Labels_Ubound * {{Text|2|#F580B1}}: {{Cl|REDIM}} {{Cl|_PRESERVE}} Labels({{Text|1|#F580B1}} {{Cl|TO}} Labels_Ubound) {{Cl|AS}} Label_Type
                Labels(nLabels) = Empty_Label
                {{Text|HashAdd|#55FF55}} a2$, HASHFLAG_LABEL, nLabels
                r = nLabels
                Labels(r).State = {{Text|0|#F580B1}}
                Labels(r).cn = tlayout$
                Labels(r).{{Text|Scope|#55FF55}} = subfuncn
                Labels(r).Error_Line = linenumber
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'x</nowiki>|#919191}}
            {{Cl|IF}} {{Cl|LEN}}(l$) {{Cl|THEN}} l$ = l$ + sp + tlayout$ {{Cl|ELSE}} l$ = tlayout$
            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"goto LABEL_"</nowiki>|#FFB100}} + a2$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
            {{Cl|GOTO}} finishedline
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"_CONTINUE"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (firstelement$ = {{Text|<nowiki>"CONTINUE"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}}
            {{Cl|IF}} firstelement$ = {{Text|<nowiki>"_CONTINUE"</nowiki>|#FFB100}} {{Cl|THEN}} l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"_Continue"</nowiki>|#FFB100}}) {{Cl|ELSE}} l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Continue"</nowiki>|#FFB100}})
            {{Text|<nowiki>'scan backwards until previous control level reached</nowiki>|#919191}}
            {{Cl|FOR}} i = controllevel {{Cl|TO}} {{Text|1|#F580B1}} {{Cl|STEP}} {{Text|-1|#F580B1}}
                t = controltype(i)
                {{Cl|IF}} t = {{Text|2|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'for...next</nowiki>|#919191}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"goto fornext_continue_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(controlid(i)) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                    layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                    {{Cl|GOTO}} finishedline
                {{Cl|ELSEIF}} t = {{Text|3|#F580B1}} {{Cl|OR (boolean)|OR}} t = {{Text|4|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'do...loop</nowiki>|#919191}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"goto dl_continue_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(controlid(i)) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                    layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                    {{Cl|GOTO}} finishedline
                {{Cl|ELSEIF}} t = {{Text|5|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'while...wend</nowiki>|#919191}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"goto ww_continue_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(controlid(i)) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                    layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                    {{Cl|GOTO}} finishedline
                {{Cl|END}} {{Cl|IF}}
            {{Cl|NEXT}}
            a$ = qb64prefix$ + {{Text|<nowiki>"CONTINUE outside DO..LOOP/FOR..NEXT/WHILE..WEND block"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} firstelement$ = {{Text|<nowiki>"CHAIN"</nowiki>|#FFB100}} {{Cl|THEN}}
        {{Cl|IF}} vWatchOn {{Cl|THEN}}
            {{Text|addWarning|#55FF55}} linenumber, inclevel, inclinenumber(inclevel), incname$(inclevel), {{Text|<nowiki>"Feature incompatible with $Debug mode"</nowiki>|#FFB100}}, {{Text|<nowiki>"CHAIN"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} firstelement$ = {{Text|<nowiki>"RUN"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|<nowiki>'RUN</nowiki>|#919191}}
        {{Cl|IF}} vWatchOn {{Cl|THEN}}
            {{Text|addWarning|#55FF55}} linenumber, inclevel, inclinenumber(inclevel), incname$(inclevel), {{Text|<nowiki>"Feature incompatible with $Debug mode"</nowiki>|#FFB100}}, {{Text|<nowiki>"RUN"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Run"</nowiki>|#FFB100}})
        {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|THEN}}
            {{Text|<nowiki>'no parameters</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_run_init();"</nowiki>|#FFB100}} {{Text|<nowiki>'note: called first to free up screen-locked image handles</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_clear(NULL,NULL,NULL,NULL);"</nowiki>|#FFB100}} {{Text|<nowiki>'use functionality of CLEAR</nowiki>|#919191}}
            {{Cl|IF}} {{Cl|LEN}}(subfunc$) {{Cl|THEN}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"QBMAIN(NULL);"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"goto S_0;"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|ELSE}}
            {{Text|<nowiki>'parameter passed</nowiki>|#919191}}
            e$ = {{Text|getelements$|#55FF55}}(ca$, {{Text|2|#F580B1}}, n)
            e$ = {{Text|fixoperationorder$|#55FF55}}(e$)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            l2$ = tlayout$
            ignore$ = {{Text|evaluate|#55FF55}}(e$, typ)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Cl|IF}} n = {{Text|2|#F580B1}} {{Cl|AND (boolean)|AND}} ((typ {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}}) {{Cl|THEN}}
                {{Text|<nowiki>'assume it's a label or line number</nowiki>|#919191}}
                lbl$ = {{Text|getelement$|#55FF55}}(ca$, {{Text|2|#F580B1}})
                {{Cl|IF}} {{Text|validlabel|#55FF55}}(lbl$) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid label!"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes {{Text|<nowiki>'invalid label</nowiki>|#919191}}
                v = {{Text|HashFind|#55FF55}}(lbl$, HASHFLAG_LABEL, ignore, r)
                x = {{Text|1|#F580B1}}
                labchk501:
                {{Cl|IF}} v {{Cl|THEN}}
                    s = Labels(r).{{Text|Scope|#55FF55}}
                    {{Cl|IF}} s = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} s = {{Text|-1|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'main scope?</nowiki>|#919191}}
                        {{Cl|IF}} s = {{Text|-1|#F580B1}} {{Cl|THEN}} Labels(r).{{Text|Scope|#55FF55}} = {{Text|0|#F580B1}} {{Text|<nowiki>'acquire scope</nowiki>|#919191}}
                        x = {{Text|0|#F580B1}} {{Text|<nowiki>'already defined</nowiki>|#919191}}
                        tlayout$ = {{Cl|RTRIM$}}(Labels(r).cn)
                        Labels(r).Scope_Restriction = subfuncn
                        Labels(r).Error_Line = linenumber
                    {{Cl|ELSE}}
                        {{Cl|IF}} v = {{Text|2|#F580B1}} {{Cl|THEN}} v = {{Text|HashFindCont|#55FF55}}(ignore, r): {{Cl|GOTO}} labchk501
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} x {{Cl|THEN}}
                    {{Text|<nowiki>'does not exist</nowiki>|#919191}}
                    nLabels = nLabels + {{Text|1|#F580B1}}: {{Cl|IF}} nLabels > Labels_Ubound {{Cl|THEN}} Labels_Ubound = Labels_Ubound * {{Text|2|#F580B1}}: {{Cl|REDIM}} {{Cl|_PRESERVE}} Labels({{Text|1|#F580B1}} {{Cl|TO}} Labels_Ubound) {{Cl|AS}} Label_Type
                    Labels(nLabels) = Empty_Label
                    {{Text|HashAdd|#55FF55}} lbl$, HASHFLAG_LABEL, nLabels
                    r = nLabels
                    Labels(r).State = {{Text|0|#F580B1}}
                    Labels(r).cn = tlayout$
                    Labels(r).{{Text|Scope|#55FF55}} = {{Text|0|#F580B1}}
                    Labels(r).Error_Line = linenumber
                    Labels(r).Scope_Restriction = subfuncn
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'x</nowiki>|#919191}}
                l$ = l$ + sp + tlayout$
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_run_init();"</nowiki>|#FFB100}} {{Text|<nowiki>'note: called first to free up screen-locked image handles</nowiki>|#919191}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_clear(NULL,NULL,NULL,NULL);"</nowiki>|#FFB100}} {{Text|<nowiki>'use functionality of CLEAR</nowiki>|#919191}}
                {{Cl|IF}} {{Cl|LEN}}(subfunc$) {{Cl|THEN}}
                    {{Text|WriteBufLine|#55FF55}} RunTxtBuf, {{Text|<nowiki>"if (run_from_line=="</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(nextrunlineindex) + {{Text|<nowiki>"){run_from_line=0;goto LABEL_"</nowiki>|#FFB100}} + lbl$ + {{Text|<nowiki>";}"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"run_from_line="</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(nextrunlineindex) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                    nextrunlineindex = nextrunlineindex + {{Text|1|#F580B1}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"QBMAIN(NULL);"</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"goto LABEL_"</nowiki>|#FFB100}} + lbl$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|ELSE}}
                {{Text|<nowiki>'assume it's a string containing a filename to execute</nowiki>|#919191}}
                e$ = {{Text|evaluatetotyp|#55FF55}}(e$, ISSTRING)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_run("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                l$ = l$ + sp + l2$
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'isstring</nowiki>|#919191}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'n=1</nowiki>|#919191}}
        layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
        {{Cl|GOTO}} finishedline
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'run</nowiki>|#919191}}
    {{Cl|IF}} firstelement$ = {{Text|<nowiki>"END"</nowiki>|#FFB100}} {{Cl|THEN}}
        l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"End"</nowiki>|#FFB100}})
        {{Cl|IF}} n > {{Text|1|#F580B1}} {{Cl|THEN}}
            e$ = {{Text|getelements$|#55FF55}}(ca$, {{Text|2|#F580B1}}, n)
            e$ = {{Text|fixoperationorder$|#55FF55}}(e$): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            l2$ = tlayout$
            e$ = {{Text|evaluatetotyp|#55FF55}}(e$, ISINTEGER64): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            inclinenump$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Cl|IF}} inclinenumber(inclevel) {{Cl|THEN}}
                inclinenump$ = {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(inclinenumber(inclevel))
                thisincname$ = {{Text|getfilepath$|#55FF55}}(incname$(inclevel))
                thisincname$ = {{Cl|MID$ (function)|MID$}}(incname$(inclevel), {{Cl|LEN}}(thisincname$) + {{Text|1|#F580B1}})
                inclinenump$ = inclinenump$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + thisincname$ + {{Cl|CHR$}}({{Text|34|#F580B1}})
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} vWatchOn {{Cl|AND (boolean)|AND}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Cl|THEN}} temp$ = vWatchErrorCall$ {{Cl|ELSE}} temp$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if(qbevent){"</nowiki>|#FFB100}} + temp$ + {{Text|<nowiki>"evnt("</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(linenumber) + inclinenump$ + {{Text|<nowiki>");}"</nowiki>|#FFB100}} {{Text|<nowiki>'non-resumable error check (cannot exit without handling errors)</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"exit_code="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
            l$ = l$ + sp + l2$
        {{Cl|END}} {{Cl|IF}}
        {{Text|xend|#55FF55}}
        layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
        {{Cl|GOTO}} finishedline
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} firstelement$ = {{Text|<nowiki>"SYSTEM"</nowiki>|#FFB100}} {{Cl|THEN}}
        l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"System"</nowiki>|#FFB100}})
        {{Cl|IF}} n > {{Text|1|#F580B1}} {{Cl|THEN}}
            e$ = {{Text|getelements$|#55FF55}}(ca$, {{Text|2|#F580B1}}, n)
            e$ = {{Text|fixoperationorder$|#55FF55}}(e$): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            l2$ = tlayout$
            e$ = {{Text|evaluatetotyp|#55FF55}}(e$, ISINTEGER64): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            inclinenump$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Cl|IF}} inclinenumber(inclevel) {{Cl|THEN}}
                inclinenump$ = {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(inclinenumber(inclevel))
                thisincname$ = {{Text|getfilepath$|#55FF55}}(incname$(inclevel))
                thisincname$ = {{Cl|MID$ (function)|MID$}}(incname$(inclevel), {{Cl|LEN}}(thisincname$) + {{Text|1|#F580B1}})
                inclinenump$ = inclinenump$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + thisincname$ + {{Cl|CHR$}}({{Text|34|#F580B1}})
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} vWatchOn = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} NoChecks = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Cl|THEN}} temp$ = vWatchErrorCall$ {{Cl|ELSE}} temp$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if(qbevent){"</nowiki>|#FFB100}} + temp$ + {{Text|<nowiki>"evnt("</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(linenumber) + inclinenump$ + {{Text|<nowiki>");}"</nowiki>|#FFB100}} {{Text|<nowiki>'non-resumable error check (cannot exit without handling errors)</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"exit_code="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
            l$ = l$ + sp + l2$
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} vWatchOn = {{Text|1|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Text|vWatchAddLabel|#55FF55}} linenumber, {{Text|0|#F580B1}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*__LONG_VWATCH_LINENUMBER= 0; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (sub_gl_called) error(271);"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"close_program=1;"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"end();"</nowiki>|#FFB100}}
        layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
        {{Cl|GOTO}} finishedline
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} n >= {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"STOP"</nowiki>|#FFB100}} {{Cl|THEN}}
            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Stop"</nowiki>|#FFB100}})
            {{Cl|IF}} n > {{Text|1|#F580B1}} {{Cl|THEN}}
                e$ = {{Text|getelements$|#55FF55}}(ca$, {{Text|2|#F580B1}}, n)
                e$ = {{Text|fixoperationorder$|#55FF55}}(e$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Stop"</nowiki>|#FFB100}}) + sp + tlayout$
                e$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|64|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Text|<nowiki>'note: this value is currently ignored but evaluated for checking reasons</nowiki>|#919191}}
            {{Cl|END}} {{Cl|IF}}
            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
            {{Cl|IF}} vWatchOn = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} NoChecks = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*__LONG_VWATCH_LINENUMBER=-3; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars); if (*__LONG_VWATCH_GOTO>0) goto VWATCH_SETNEXTLINE; if (*__LONG_VWATCH_GOTO<0) goto VWATCH_SKIPLINE;"</nowiki>|#FFB100}}
                {{Text|vWatchAddLabel|#55FF55}} linenumber, {{Text|0|#F580B1}}
            {{Cl|ELSE}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"close_program=1;"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"end();"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|GOTO}} finishedline
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} n = {{Text|2|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"GOSUB"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Text|xgosub|#55FF55}} ca$
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Text|<nowiki>'note: layout implemented in xgosub</nowiki>|#919191}}
            {{Cl|GOTO}} finishedline
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} n >= {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"RETURN"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|THEN}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"#include "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"ret"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(subfuncn) + {{Text|<nowiki>".txt"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}})
                l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Return"</nowiki>|#FFB100}})
                layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                {{Cl|GOTO}} finishedline
            {{Cl|ELSE}}
                {{Text|<nowiki>'label/linenumber follows</nowiki>|#919191}}
                {{Cl|IF}} subfuncn <> {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"RETURN linelabel/linenumber invalid within a SUB/FUNCTION"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|IF}} n > {{Text|2|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected linelabel/linenumber after RETURN"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (!next_return_point) error(3);"</nowiki>|#FFB100}} {{Text|<nowiki>'check return point available</nowiki>|#919191}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"next_return_point--;"</nowiki>|#FFB100}} {{Text|<nowiki>'destroy return point</nowiki>|#919191}}
                a2$ = {{Text|getelement$|#55FF55}}(ca$, {{Text|2|#F580B1}})
                {{Cl|IF}} {{Text|validlabel|#55FF55}}(a2$) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid label!"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                v = {{Text|HashFind|#55FF55}}(a2$, HASHFLAG_LABEL, ignore, r)
                x = {{Text|1|#F580B1}}
                labchk505:
                {{Cl|IF}} v {{Cl|THEN}}
                    s = Labels(r).{{Text|Scope|#55FF55}}
                    {{Cl|IF}} s = subfuncn {{Cl|OR (boolean)|OR}} s = {{Text|-1|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'same scope?</nowiki>|#919191}}
                        {{Cl|IF}} s = {{Text|-1|#F580B1}} {{Cl|THEN}} Labels(r).{{Text|Scope|#55FF55}} = subfuncn {{Text|<nowiki>'acquire scope</nowiki>|#919191}}
                        x = {{Text|0|#F580B1}} {{Text|<nowiki>'already defined</nowiki>|#919191}}
                        tlayout$ = {{Cl|RTRIM$}}(Labels(r).cn)
                    {{Cl|ELSE}}
                        {{Cl|IF}} v = {{Text|2|#F580B1}} {{Cl|THEN}} v = {{Text|HashFindCont|#55FF55}}(ignore, r): {{Cl|GOTO}} labchk505
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} x {{Cl|THEN}}
                    {{Text|<nowiki>'does not exist</nowiki>|#919191}}
                    nLabels = nLabels + {{Text|1|#F580B1}}: {{Cl|IF}} nLabels > Labels_Ubound {{Cl|THEN}} Labels_Ubound = Labels_Ubound * {{Text|2|#F580B1}}: {{Cl|REDIM}} {{Cl|_PRESERVE}} Labels({{Text|1|#F580B1}} {{Cl|TO}} Labels_Ubound) {{Cl|AS}} Label_Type
                    Labels(nLabels) = Empty_Label
                    {{Text|HashAdd|#55FF55}} a2$, HASHFLAG_LABEL, nLabels
                    r = nLabels
                    Labels(r).State = {{Text|0|#F580B1}}
                    Labels(r).cn = tlayout$
                    Labels(r).{{Text|Scope|#55FF55}} = subfuncn
                    Labels(r).Error_Line = linenumber
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'x</nowiki>|#919191}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"goto LABEL_"</nowiki>|#FFB100}} + a2$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Return"</nowiki>|#FFB100}}) + sp + tlayout$
                layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                {{Cl|GOTO}} finishedline
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} n >= {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"RESUME"</nowiki>|#FFB100}} {{Cl|THEN}}
            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Resume"</nowiki>|#FFB100}})
            {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|THEN}}
                resumeprev:
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (!error_handling){error(20);}else{error_retry=1; qbevent=1; error_handling=0; error_err=0; return;}"</nowiki>|#FFB100}}
                layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                {{Cl|GOTO}} finishedline
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} n > {{Text|2|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Too many parameters"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            s$ = {{Text|getelement$|#55FF55}}(ca$, {{Text|2|#F580B1}})
            {{Cl|IF}} {{Cl|UCASE$}}(s$) = {{Text|<nowiki>"NEXT"</nowiki>|#FFB100}} {{Cl|THEN}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (!error_handling){error(20);}else{error_handling=0; error_err=0; return;}"</nowiki>|#FFB100}}
                l$ = l$ + sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Next"</nowiki>|#FFB100}})
                layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                {{Cl|GOTO}} finishedline
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} s$ = {{Text|<nowiki>"0"</nowiki>|#FFB100}} {{Cl|THEN}} l$ = l$ + sp + {{Text|<nowiki>"0"</nowiki>|#FFB100}}: {{Cl|GOTO}} resumeprev
            {{Cl|IF}} {{Text|validlabel|#55FF55}}(s$) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid label passed to RESUME"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            v = {{Text|HashFind|#55FF55}}(s$, HASHFLAG_LABEL, ignore, r)
            x = {{Text|1|#F580B1}}
            labchk506:
            {{Cl|IF}} v {{Cl|THEN}}
                s = Labels(r).{{Text|Scope|#55FF55}}
                {{Cl|IF}} s = subfuncn {{Cl|OR (boolean)|OR}} s = {{Text|-1|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'same scope?</nowiki>|#919191}}
                    {{Cl|IF}} s = {{Text|-1|#F580B1}} {{Cl|THEN}} Labels(r).{{Text|Scope|#55FF55}} = subfuncn {{Text|<nowiki>'acquire scope</nowiki>|#919191}}
                    x = {{Text|0|#F580B1}} {{Text|<nowiki>'already defined</nowiki>|#919191}}
                    tlayout$ = {{Cl|RTRIM$}}(Labels(r).cn)
                {{Cl|ELSE}}
                    {{Cl|IF}} v = {{Text|2|#F580B1}} {{Cl|THEN}} v = {{Text|HashFindCont|#55FF55}}(ignore, r): {{Cl|GOTO}} labchk506
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} x {{Cl|THEN}}
                {{Text|<nowiki>'does not exist</nowiki>|#919191}}
                nLabels = nLabels + {{Text|1|#F580B1}}: {{Cl|IF}} nLabels > Labels_Ubound {{Cl|THEN}} Labels_Ubound = Labels_Ubound * {{Text|2|#F580B1}}: {{Cl|REDIM}} {{Cl|_PRESERVE}} Labels({{Text|1|#F580B1}} {{Cl|TO}} Labels_Ubound) {{Cl|AS}} Label_Type
                Labels(nLabels) = Empty_Label
                {{Text|HashAdd|#55FF55}} s$, HASHFLAG_LABEL, nLabels
                r = nLabels
                Labels(r).State = {{Text|0|#F580B1}}
                Labels(r).cn = tlayout$
                Labels(r).{{Text|Scope|#55FF55}} = subfuncn
                Labels(r).Error_Line = linenumber
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'x</nowiki>|#919191}}
            l$ = l$ + sp + tlayout$
            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (!error_handling){error(20);}else{error_handling=0; error_err=0; goto LABEL_"</nowiki>|#FFB100}} + s$ + {{Text|<nowiki>";}"</nowiki>|#FFB100}}
            {{Cl|GOTO}} finishedline
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} n = {{Text|4|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} {{Text|getelements|#55FF55}}(a$, {{Text|1|#F580B1}}, {{Text|3|#F580B1}}) = {{Text|<nowiki>"ON"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"ERROR"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"GOTO"</nowiki>|#FFB100}} {{Cl|THEN}}
            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"On"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"Error"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"GoTo"</nowiki>|#FFB100}})
            lbl$ = {{Text|getelement$|#55FF55}}(ca$, {{Text|4|#F580B1}})
            {{Cl|IF}} lbl$ = {{Text|<nowiki>"0"</nowiki>|#FFB100}} {{Cl|THEN}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"error_goto_line=0;"</nowiki>|#FFB100}}
                l$ = l$ + sp + {{Text|<nowiki>"0"</nowiki>|#FFB100}}
                layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                {{Cl|GOTO}} finishedline
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} {{Text|validlabel|#55FF55}}(lbl$) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid label"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            v = {{Text|HashFind|#55FF55}}(lbl$, HASHFLAG_LABEL, ignore, r)
            x = {{Text|1|#F580B1}}
            labchk6:
            {{Cl|IF}} v {{Cl|THEN}}
                s = Labels(r).{{Text|Scope|#55FF55}}
                {{Cl|IF}} s = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} s = {{Text|-1|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'main scope?</nowiki>|#919191}}
                    {{Cl|IF}} s = {{Text|-1|#F580B1}} {{Cl|THEN}} Labels(r).{{Text|Scope|#55FF55}} = {{Text|0|#F580B1}} {{Text|<nowiki>'acquire scope</nowiki>|#919191}}
                    x = {{Text|0|#F580B1}} {{Text|<nowiki>'already defined</nowiki>|#919191}}
                    tlayout$ = {{Cl|RTRIM$}}(Labels(r).cn)
                    Labels(r).Scope_Restriction = subfuncn
                    Labels(r).Error_Line = linenumber
                {{Cl|ELSE}}
                    {{Cl|IF}} v = {{Text|2|#F580B1}} {{Cl|THEN}} v = {{Text|HashFindCont|#55FF55}}(ignore, r): {{Cl|GOTO}} labchk6
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} x {{Cl|THEN}}
                {{Text|<nowiki>'does not exist</nowiki>|#919191}}
                nLabels = nLabels + {{Text|1|#F580B1}}: {{Cl|IF}} nLabels > Labels_Ubound {{Cl|THEN}} Labels_Ubound = Labels_Ubound * {{Text|2|#F580B1}}: {{Cl|REDIM}} {{Cl|_PRESERVE}} Labels({{Text|1|#F580B1}} {{Cl|TO}} Labels_Ubound) {{Cl|AS}} Label_Type
                Labels(nLabels) = Empty_Label
                {{Text|HashAdd|#55FF55}} lbl$, HASHFLAG_LABEL, nLabels
                r = nLabels
                Labels(r).State = {{Text|0|#F580B1}}
                Labels(r).cn = tlayout$
                Labels(r).{{Text|Scope|#55FF55}} = {{Text|0|#F580B1}}
                Labels(r).Error_Line = linenumber
                Labels(r).Scope_Restriction = subfuncn
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'x</nowiki>|#919191}}
            l$ = l$ + sp + tlayout$
            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
            errorlabels = errorlabels + {{Text|1|#F580B1}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"error_goto_line="</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(errorlabels) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} ErrTxtBuf, {{Text|<nowiki>"if (error_goto_line=="</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(errorlabels) + {{Text|<nowiki>"){error_handling=1; goto LABEL_"</nowiki>|#FFB100}} + lbl$ + {{Text|<nowiki>";}"</nowiki>|#FFB100}}
            {{Cl|GOTO}} finishedline
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} n >= {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"RESTORE"</nowiki>|#FFB100}} {{Cl|THEN}}
            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Restore"</nowiki>|#FFB100}})
            {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|THEN}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"data_offset=0;"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                {{Cl|IF}} n > {{Text|2|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Syntax error - too many parameters (expected RESTORE label/line number)"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                lbl$ = {{Text|getelement$|#55FF55}}(ca$, {{Text|2|#F580B1}})
                {{Cl|IF}} {{Text|validlabel|#55FF55}}(lbl$) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid label"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Text|<nowiki>'rule: a RESTORE label has no scope, therefore, only one instance of that label may exist</nowiki>|#919191}}
                {{Text|<nowiki>'how: enforced by a post check for duplicates</nowiki>|#919191}}
                v = {{Text|HashFind|#55FF55}}(lbl$, HASHFLAG_LABEL, ignore, r)
                x = {{Text|1|#F580B1}}
                {{Cl|IF}} v {{Cl|THEN}} {{Text|<nowiki>'already defined</nowiki>|#919191}}
                    x = {{Text|0|#F580B1}}
                    tlayout$ = {{Cl|RTRIM$}}(Labels(r).cn)
                    Labels(r).Data_Referenced = {{Text|1|#F580B1}} {{Text|<nowiki>'make sure the data referenced flag is set</nowiki>|#919191}}
                    {{Cl|IF}} Labels(r).Error_Line = {{Text|0|#F580B1}} {{Cl|THEN}} Labels(r).Error_Line = linenumber
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} x {{Cl|THEN}}
                    nLabels = nLabels + {{Text|1|#F580B1}}: {{Cl|IF}} nLabels > Labels_Ubound {{Cl|THEN}} Labels_Ubound = Labels_Ubound * {{Text|2|#F580B1}}: {{Cl|REDIM}} {{Cl|_PRESERVE}} Labels({{Text|1|#F580B1}} {{Cl|TO}} Labels_Ubound) {{Cl|AS}} Label_Type
                    Labels(nLabels) = Empty_Label
                    {{Text|HashAdd|#55FF55}} lbl$, HASHFLAG_LABEL, nLabels
                    r = nLabels
                    Labels(r).State = {{Text|0|#F580B1}}
                    Labels(r).cn = tlayout$
                    Labels(r).{{Text|Scope|#55FF55}} = {{Text|-1|#F580B1}} {{Text|<nowiki>'modifyable scope</nowiki>|#919191}}
                    Labels(r).Error_Line = linenumber
                    Labels(r).Data_Referenced = {{Text|1|#F580B1}}
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'x</nowiki>|#919191}}
                l$ = l$ + sp + tlayout$
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"data_offset=data_at_LABEL_"</nowiki>|#FFB100}} + lbl$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
            {{Cl|GOTO}} finishedline
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'ON ... GOTO/GOSUB</nowiki>|#919191}}
    {{Cl|IF}} n >= {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"ON"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Text|xongotogosub|#55FF55}} a$, ca$, n
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Cl|GOTO}} finishedline
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'(_MEM) _MEMPUT _MEMGET</nowiki>|#919191}}
    {{Cl|IF}} n >= {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"_MEMGET"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (firstelement$ = {{Text|<nowiki>"MEMGET"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}}
            {{Text|<nowiki>'get expressions</nowiki>|#919191}}
            e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            B = {{Text|0|#F580B1}}
            ne = {{Text|0|#F580B1}}
            {{Cl|FOR}} i2 = {{Text|2|#F580B1}} {{Cl|TO}} n
                e2$ = {{Text|getelement$|#55FF55}}(ca$, i2)
                {{Cl|IF}} e2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} B = B + {{Text|1|#F580B1}}
                {{Cl|IF}} e2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} B = B - {{Text|1|#F580B1}}
                {{Cl|IF}} e2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} B = {{Text|0|#F580B1}} {{Cl|THEN}}
                    ne = ne + {{Text|1|#F580B1}}
                    {{Cl|IF}} ne = {{Text|1|#F580B1}} {{Cl|THEN}} blk$ = e$: e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    {{Cl|IF}} ne = {{Text|2|#F580B1}} {{Cl|THEN}} offs$ = e$: e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    {{Cl|IF}} ne = {{Text|3|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Syntax error - too many parameters (Expected "</nowiki>|#FFB100}} + qb64prefix$ + {{Text|<nowiki>"MEMGET mem-reference, offset, variable)"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|ELSE}}
                    {{Cl|IF}} {{Cl|LEN}}(e$) = {{Text|0|#F580B1}} {{Cl|THEN}} e$ = e2$ {{Cl|ELSE}} e$ = e$ + sp + e2$
                {{Cl|END}} {{Cl|IF}}
            {{Cl|NEXT}}
            var$ = e$
            {{Cl|IF}} e$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} ne <> {{Text|2|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected "</nowiki>|#FFB100}} + qb64prefix$ + {{Text|<nowiki>"MEMGET mem-reference, offset, variable"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|IF}} firstelement$ = {{Text|<nowiki>"_MEMGET"</nowiki>|#FFB100}} {{Cl|THEN}} l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"_MemGet"</nowiki>|#FFB100}}) + sp {{Cl|ELSE}} l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"MemGet"</nowiki>|#FFB100}}) + sp
            e$ = {{Text|fixoperationorder$|#55FF55}}(blk$): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            l$ = l$ + tlayout$
            test$ = {{Text|evaluate|#55FF55}}(e$, typ): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISUDT) = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) <> {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected "</nowiki>|#FFB100}} + qb64prefix$ + {{Text|<nowiki>"MEM type"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            blkoffs$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|-6|#F580B1}})
            {{Text|<nowiki>'            IF typ AND ISREFERENCE THEN e$ = refer(e$, typ, 0)</nowiki>|#919191}}
            {{Text|<nowiki>'WriteBufLine MainTxtBuf, blkoffs$ '???</nowiki>|#919191}}
            e$ = {{Text|fixoperationorder$|#55FF55}}(offs$): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp + tlayout$
            e$ = {{Text|evaluatetotyp|#55FF55}}(e$, OFFSETTYPE - ISPOINTER): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            offs$ = e$
            {{Text|<nowiki>'WriteBufLine MainTxtBuf, e$ '???</nowiki>|#919191}}
            e$ = {{Text|fixoperationorder$|#55FF55}}(var$): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp + tlayout$
            varsize$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|-5|#F580B1}}): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            varoffs$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|-6|#F580B1}}): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Text|<nowiki>'WriteBufLine MainTxtBuf, varoffs$ '???</nowiki>|#919191}}
            {{Text|<nowiki>'WriteBufLine MainTxtBuf, varsize$ '???</nowiki>|#919191}}
            {{Text|<nowiki>'what do we do next</nowiki>|#919191}}
            {{Text|<nowiki>'need to know offset of variable and its size</nowiki>|#919191}}
            {{Text|<nowiki>'known sizes will be handled by designated command casts, otherwise use memmove</nowiki>|#919191}}
            s = {{Text|0|#F580B1}}
            {{Cl|IF}} varsize$ = {{Text|<nowiki>"1"</nowiki>|#FFB100}} {{Cl|THEN}} s = {{Text|1|#F580B1}}: st$ = {{Text|<nowiki>"int8"</nowiki>|#FFB100}}
            {{Cl|IF}} varsize$ = {{Text|<nowiki>"2"</nowiki>|#FFB100}} {{Cl|THEN}} s = {{Text|2|#F580B1}}: st$ = {{Text|<nowiki>"int16"</nowiki>|#FFB100}}
            {{Cl|IF}} varsize$ = {{Text|<nowiki>"4"</nowiki>|#FFB100}} {{Cl|THEN}} s = {{Text|4|#F580B1}}: st$ = {{Text|<nowiki>"int32"</nowiki>|#FFB100}}
            {{Cl|IF}} varsize$ = {{Text|<nowiki>"8"</nowiki>|#FFB100}} {{Cl|THEN}} s = {{Text|8|#F580B1}}: st$ = {{Text|<nowiki>"int64"</nowiki>|#FFB100}}
            {{Cl|IF}} NoChecks {{Cl|THEN}}
                {{Text|<nowiki>'fast version:</nowiki>|#919191}}
                {{Cl|IF}} s {{Cl|THEN}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*("</nowiki>|#FFB100}} + st$ + {{Text|<nowiki>"*)"</nowiki>|#FFB100}} + varoffs$ + {{Text|<nowiki>"=*("</nowiki>|#FFB100}} + st$ + {{Text|<nowiki>"*)("</nowiki>|#FFB100}} + offs$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"memmove("</nowiki>|#FFB100}} + varoffs$ + {{Text|<nowiki>",(void*)"</nowiki>|#FFB100}} + offs$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + varsize$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|ELSE}}
                {{Text|<nowiki>'safe version:</nowiki>|#919191}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_long="</nowiki>|#FFB100}} + offs$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Text|<nowiki>'is mem block init?</nowiki>|#919191}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if ( ((mem_block*)("</nowiki>|#FFB100}} + blkoffs$ + {{Text|<nowiki>"))->lock_offset ){"</nowiki>|#FFB100}}
                {{Text|<nowiki>'are region and id valid?</nowiki>|#919191}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if ("</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_long < ((mem_block*)("</nowiki>|#FFB100}} + blkoffs$ + {{Text|<nowiki>"))->offset  ||"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"(tmp_long+("</nowiki>|#FFB100}} + varsize$ + {{Text|<nowiki>")) > ( ((mem_block*)("</nowiki>|#FFB100}} + blkoffs$ + {{Text|<nowiki>"))->offset + ((mem_block*)("</nowiki>|#FFB100}} + blkoffs$ + {{Text|<nowiki>"))->size)  ||"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"((mem_lock*)((mem_block*)("</nowiki>|#FFB100}} + blkoffs$ + {{Text|<nowiki>"))->lock_offset)->id != ((mem_block*)("</nowiki>|#FFB100}} + blkoffs$ + {{Text|<nowiki>"))->lock_id  ){"</nowiki>|#FFB100}}
                {{Text|<nowiki>'diagnose error</nowiki>|#919191}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if ("</nowiki>|#FFB100}} + {{Text|<nowiki>"((mem_lock*)((mem_block*)("</nowiki>|#FFB100}} + blkoffs$ + {{Text|<nowiki>"))->lock_offset)->id != ((mem_block*)("</nowiki>|#FFB100}} + blkoffs$ + {{Text|<nowiki>"))->lock_id"</nowiki>|#FFB100}} + {{Text|<nowiki>") error(308); else error(300);"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}else{"</nowiki>|#FFB100}}
                {{Cl|IF}} s {{Cl|THEN}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*("</nowiki>|#FFB100}} + st$ + {{Text|<nowiki>"*)"</nowiki>|#FFB100}} + varoffs$ + {{Text|<nowiki>"=*("</nowiki>|#FFB100}} + st$ + {{Text|<nowiki>"*)tmp_long;"</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"memmove("</nowiki>|#FFB100}} + varoffs$ + {{Text|<nowiki>",(void*)tmp_long,"</nowiki>|#FFB100}} + varsize$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}else error(309);"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
            {{Cl|GOTO}} finishedline
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} n >= {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"_MEMPUT"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (firstelement$ = {{Text|<nowiki>"MEMPUT"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}}
            {{Text|<nowiki>'get expressions</nowiki>|#919191}}
            typ$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            B = {{Text|0|#F580B1}}
            ne = {{Text|0|#F580B1}}
            {{Cl|FOR}} i2 = {{Text|2|#F580B1}} {{Cl|TO}} n
                e2$ = {{Text|getelement$|#55FF55}}(ca$, i2)
                {{Cl|IF}} e2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} B = B + {{Text|1|#F580B1}}
                {{Cl|IF}} e2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} B = B - {{Text|1|#F580B1}}
                {{Cl|IF}} (e2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} {{Cl|UCASE$}}(e2$) = {{Text|<nowiki>"AS"</nowiki>|#FFB100}}) {{Cl|AND (boolean)|AND}} B = {{Text|0|#F580B1}} {{Cl|THEN}}
                    ne = ne + {{Text|1|#F580B1}}
                    {{Cl|IF}} ne = {{Text|1|#F580B1}} {{Cl|THEN}} blk$ = e$: e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    {{Cl|IF}} ne = {{Text|2|#F580B1}} {{Cl|THEN}} offs$ = e$: e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    {{Cl|IF}} ne = {{Text|3|#F580B1}} {{Cl|THEN}} var$ = e$: e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    {{Cl|IF}} ({{Cl|UCASE$}}(e2$) = {{Text|<nowiki>"AS"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} ne <> {{Text|3|#F580B1}}) {{Cl|OR (boolean)|OR}} (ne = {{Text|3|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|UCASE$}}(e2$) <> {{Text|<nowiki>"AS"</nowiki>|#FFB100}}) {{Cl|OR (boolean)|OR}} ne = {{Text|4|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected _MEMPUT mem-reference,offset,variable|value[AS type]"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|ELSE}}
                    {{Cl|IF}} {{Cl|LEN}}(e$) = {{Text|0|#F580B1}} {{Cl|THEN}} e$ = e2$ {{Cl|ELSE}} e$ = e$ + sp + e2$
                {{Cl|END}} {{Cl|IF}}
            {{Cl|NEXT}}
            {{Cl|IF}} ne < {{Text|2|#F580B1}} {{Cl|OR (boolean)|OR}} e$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected "</nowiki>|#FFB100}} + qb64prefix$ + {{Text|<nowiki>"MEMPUT mem-reference, offset, variable|value[AS type]"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|IF}} ne = {{Text|2|#F580B1}} {{Cl|THEN}} var$ = e$ {{Cl|ELSE}} typ$ = {{Cl|UCASE$}}(e$)
            {{Cl|IF}} firstelement$ = {{Text|<nowiki>"_MEMPUT"</nowiki>|#FFB100}} {{Cl|THEN}} l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"_MemPut"</nowiki>|#FFB100}}) + sp {{Cl|ELSE}} l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"MemPut"</nowiki>|#FFB100}}) + sp
            e$ = {{Text|fixoperationorder$|#55FF55}}(blk$): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            l$ = l$ + tlayout$
            test$ = {{Text|evaluate|#55FF55}}(e$, typ): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISUDT) = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) <> {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected "</nowiki>|#FFB100}} + qb64prefix$ + {{Text|<nowiki>"MEM type"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            blkoffs$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|-6|#F580B1}})
            e$ = {{Text|fixoperationorder$|#55FF55}}(offs$): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp + tlayout$
            e$ = {{Text|evaluatetotyp|#55FF55}}(e$, OFFSETTYPE - ISPOINTER): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            offs$ = e$
            {{Cl|IF}} ne = {{Text|2|#F580B1}} {{Cl|THEN}}
                e$ = {{Text|fixoperationorder$|#55FF55}}(var$): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp + tlayout$
                test$ = {{Text|evaluate|#55FF55}}(e$, t): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISREFERENCE) = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} (t {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"g_tmp_str="</nowiki>|#FFB100}} + test$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                    varsize$ = {{Text|<nowiki>"g_tmp_str->len"</nowiki>|#FFB100}}
                    varoffs$ = {{Text|<nowiki>"g_tmp_str->chr"</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    varsize$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|-5|#F580B1}}): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    varoffs$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|-6|#F580B1}}): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'known sizes will be handled by designated command casts, otherwise use memmove</nowiki>|#919191}}
                s = {{Text|0|#F580B1}}
                {{Cl|IF}} varsize$ = {{Text|<nowiki>"1"</nowiki>|#FFB100}} {{Cl|THEN}} s = {{Text|1|#F580B1}}: st$ = {{Text|<nowiki>"int8"</nowiki>|#FFB100}}
                {{Cl|IF}} varsize$ = {{Text|<nowiki>"2"</nowiki>|#FFB100}} {{Cl|THEN}} s = {{Text|2|#F580B1}}: st$ = {{Text|<nowiki>"int16"</nowiki>|#FFB100}}
                {{Cl|IF}} varsize$ = {{Text|<nowiki>"4"</nowiki>|#FFB100}} {{Cl|THEN}} s = {{Text|4|#F580B1}}: st$ = {{Text|<nowiki>"int32"</nowiki>|#FFB100}}
                {{Cl|IF}} varsize$ = {{Text|<nowiki>"8"</nowiki>|#FFB100}} {{Cl|THEN}} s = {{Text|8|#F580B1}}: st$ = {{Text|<nowiki>"int64"</nowiki>|#FFB100}}
                {{Cl|IF}} NoChecks {{Cl|THEN}}
                    {{Text|<nowiki>'fast version:</nowiki>|#919191}}
                    {{Cl|IF}} s {{Cl|THEN}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*("</nowiki>|#FFB100}} + st$ + {{Text|<nowiki>"*)("</nowiki>|#FFB100}} + offs$ + {{Text|<nowiki>")=*("</nowiki>|#FFB100}} + st$ + {{Text|<nowiki>"*)"</nowiki>|#FFB100}} + varoffs$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                    {{Cl|ELSE}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"memmove((void*)"</nowiki>|#FFB100}} + offs$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + varoffs$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + varsize$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|ELSE}}
                    {{Text|<nowiki>'safe version:</nowiki>|#919191}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_long="</nowiki>|#FFB100}} + offs$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                    {{Text|<nowiki>'is mem block init?</nowiki>|#919191}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if ( ((mem_block*)("</nowiki>|#FFB100}} + blkoffs$ + {{Text|<nowiki>"))->lock_offset ){"</nowiki>|#FFB100}}
                    {{Text|<nowiki>'are region and id valid?</nowiki>|#919191}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if ("</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_long < ((mem_block*)("</nowiki>|#FFB100}} + blkoffs$ + {{Text|<nowiki>"))->offset  ||"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"(tmp_long+("</nowiki>|#FFB100}} + varsize$ + {{Text|<nowiki>")) > ( ((mem_block*)("</nowiki>|#FFB100}} + blkoffs$ + {{Text|<nowiki>"))->offset + ((mem_block*)("</nowiki>|#FFB100}} + blkoffs$ + {{Text|<nowiki>"))->size)  ||"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"((mem_lock*)((mem_block*)("</nowiki>|#FFB100}} + blkoffs$ + {{Text|<nowiki>"))->lock_offset)->id != ((mem_block*)("</nowiki>|#FFB100}} + blkoffs$ + {{Text|<nowiki>"))->lock_id  ){"</nowiki>|#FFB100}}
                    {{Text|<nowiki>'diagnose error</nowiki>|#919191}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if ("</nowiki>|#FFB100}} + {{Text|<nowiki>"((mem_lock*)((mem_block*)("</nowiki>|#FFB100}} + blkoffs$ + {{Text|<nowiki>"))->lock_offset)->id != ((mem_block*)("</nowiki>|#FFB100}} + blkoffs$ + {{Text|<nowiki>"))->lock_id"</nowiki>|#FFB100}} + {{Text|<nowiki>") error(308); else error(300);"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}else{"</nowiki>|#FFB100}}
                    {{Cl|IF}} s {{Cl|THEN}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*("</nowiki>|#FFB100}} + st$ + {{Text|<nowiki>"*)tmp_long=*("</nowiki>|#FFB100}} + st$ + {{Text|<nowiki>"*)"</nowiki>|#FFB100}} + varoffs$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                    {{Cl|ELSE}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"memmove((void*)tmp_long,"</nowiki>|#FFB100}} + varoffs$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + varsize$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}else error(309);"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|ELSE}}
                {{Text|<nowiki>'... AS type method</nowiki>|#919191}}
                {{Text|<nowiki>'FUNCTION typname2typ& (t2$)</nowiki>|#919191}}
                {{Text|<nowiki>'typname2typsize = 0 'the default</nowiki>|#919191}}
                t = {{Text|typname2typ|#55FF55}}(typ$)
                {{Cl|IF}} t = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid type"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) <> {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} (t {{Cl|AND (boolean)|AND}} ISUDT) <> {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} (t {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} a$ = qb64prefix$ + {{Text|<nowiki>"MEMPUT requires numeric type"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISPOINTER) {{Cl|THEN}} t = t - ISPOINTER
                {{Text|<nowiki>'attempt conversion...</nowiki>|#919191}}
                e$ = {{Text|fixoperationorder$|#55FF55}}(var$): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp + tlayout$ + sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"As"</nowiki>|#FFB100}}) + sp + typ$
                e$ = {{Text|evaluatetotyp|#55FF55}}(e$, t): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                st$ = {{Text|typ2ctyp$|#55FF55}}(t, {{Text|<nowiki>""</nowiki>|#FFB100}})
                varsize$ = {{Text|str2|#55FF55}}((t {{Cl|AND}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}})
                {{Cl|IF}} NoChecks {{Cl|THEN}}
                    {{Text|<nowiki>'fast version:</nowiki>|#919191}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*("</nowiki>|#FFB100}} + st$ + {{Text|<nowiki>"*)("</nowiki>|#FFB100}} + offs$ + {{Text|<nowiki>")="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    {{Text|<nowiki>'safe version:</nowiki>|#919191}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_long="</nowiki>|#FFB100}} + offs$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                    {{Text|<nowiki>'is mem block init?</nowiki>|#919191}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if ( ((mem_block*)("</nowiki>|#FFB100}} + blkoffs$ + {{Text|<nowiki>"))->lock_offset ){"</nowiki>|#FFB100}}
                    {{Text|<nowiki>'are region and id valid?</nowiki>|#919191}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if ("</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_long < ((mem_block*)("</nowiki>|#FFB100}} + blkoffs$ + {{Text|<nowiki>"))->offset  ||"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"(tmp_long+("</nowiki>|#FFB100}} + varsize$ + {{Text|<nowiki>")) > ( ((mem_block*)("</nowiki>|#FFB100}} + blkoffs$ + {{Text|<nowiki>"))->offset + ((mem_block*)("</nowiki>|#FFB100}} + blkoffs$ + {{Text|<nowiki>"))->size)  ||"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"((mem_lock*)((mem_block*)("</nowiki>|#FFB100}} + blkoffs$ + {{Text|<nowiki>"))->lock_offset)->id != ((mem_block*)("</nowiki>|#FFB100}} + blkoffs$ + {{Text|<nowiki>"))->lock_id  ){"</nowiki>|#FFB100}}
                    {{Text|<nowiki>'diagnose error</nowiki>|#919191}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if ("</nowiki>|#FFB100}} + {{Text|<nowiki>"((mem_lock*)((mem_block*)("</nowiki>|#FFB100}} + blkoffs$ + {{Text|<nowiki>"))->lock_offset)->id != ((mem_block*)("</nowiki>|#FFB100}} + blkoffs$ + {{Text|<nowiki>"))->lock_id"</nowiki>|#FFB100}} + {{Text|<nowiki>") error(308); else error(300);"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}else{"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*("</nowiki>|#FFB100}} + st$ + {{Text|<nowiki>"*)tmp_long="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}else error(309);"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
            {{Cl|GOTO}} finishedline
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} n >= {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"_MEMFILL"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (firstelement$ = {{Text|<nowiki>"MEMFILL"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}}
            {{Text|<nowiki>'get expressions</nowiki>|#919191}}
            typ$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            B = {{Text|0|#F580B1}}
            ne = {{Text|0|#F580B1}}
            {{Cl|FOR}} i2 = {{Text|2|#F580B1}} {{Cl|TO}} n
                e2$ = {{Text|getelement$|#55FF55}}(ca$, i2)
                {{Cl|IF}} e2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} B = B + {{Text|1|#F580B1}}
                {{Cl|IF}} e2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} B = B - {{Text|1|#F580B1}}
                {{Cl|IF}} (e2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} {{Cl|UCASE$}}(e2$) = {{Text|<nowiki>"AS"</nowiki>|#FFB100}}) {{Cl|AND (boolean)|AND}} B = {{Text|0|#F580B1}} {{Cl|THEN}}
                    ne = ne + {{Text|1|#F580B1}}
                    {{Cl|IF}} ne = {{Text|1|#F580B1}} {{Cl|THEN}} blk$ = e$: e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    {{Cl|IF}} ne = {{Text|2|#F580B1}} {{Cl|THEN}} offs$ = e$: e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    {{Cl|IF}} ne = {{Text|3|#F580B1}} {{Cl|THEN}} bytes$ = e$: e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    {{Cl|IF}} ne = {{Text|4|#F580B1}} {{Cl|THEN}} var$ = e$: e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    {{Cl|IF}} ({{Cl|UCASE$}}(e2$) = {{Text|<nowiki>"AS"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} ne <> {{Text|4|#F580B1}}) {{Cl|OR (boolean)|OR}} (ne = {{Text|4|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|UCASE$}}(e2$) <> {{Text|<nowiki>"AS"</nowiki>|#FFB100}}) {{Cl|OR (boolean)|OR}} ne = {{Text|5|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected _MEMFILL mem-reference,offset,bytes,variable|value[AS type]"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|ELSE}}
                    {{Cl|IF}} {{Cl|LEN}}(e$) = {{Text|0|#F580B1}} {{Cl|THEN}} e$ = e2$ {{Cl|ELSE}} e$ = e$ + sp + e2$
                {{Cl|END}} {{Cl|IF}}
            {{Cl|NEXT}}
            {{Cl|IF}} ne < {{Text|3|#F580B1}} {{Cl|OR (boolean)|OR}} e$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected "</nowiki>|#FFB100}} + qb64prefix$ + {{Text|<nowiki>"MEMFILL mem-reference, offset, bytes, variable|value[AS type]"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|IF}} ne = {{Text|3|#F580B1}} {{Cl|THEN}} var$ = e$ {{Cl|ELSE}} typ$ = {{Cl|UCASE$}}(e$)
            {{Cl|IF}} firstelement$ = {{Text|<nowiki>"_MEMFILL"</nowiki>|#FFB100}} {{Cl|THEN}} l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"_MemFill"</nowiki>|#FFB100}}) + sp {{Cl|ELSE}} l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"MemFill"</nowiki>|#FFB100}}) + sp
            e$ = {{Text|fixoperationorder$|#55FF55}}(blk$): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            l$ = l$ + tlayout$
            test$ = {{Text|evaluate|#55FF55}}(e$, typ): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISUDT) = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) <> {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected "</nowiki>|#FFB100}} + qb64prefix$ + {{Text|<nowiki>"MEM type"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            blkoffs$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|-6|#F580B1}})
            e$ = {{Text|fixoperationorder$|#55FF55}}(offs$): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp + tlayout$
            e$ = {{Text|evaluatetotyp|#55FF55}}(e$, OFFSETTYPE - ISPOINTER): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            offs$ = e$
            e$ = {{Text|fixoperationorder$|#55FF55}}(bytes$): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp + tlayout$
            e$ = {{Text|evaluatetotyp|#55FF55}}(e$, OFFSETTYPE - ISPOINTER): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            bytes$ = e$
            {{Cl|IF}} ne = {{Text|3|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'no AS</nowiki>|#919191}}
                e$ = {{Text|fixoperationorder$|#55FF55}}(var$): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp + tlayout$
                test$ = {{Text|evaluate|#55FF55}}(e$, t)
                {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISREFERENCE) = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} (t {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_long=(ptrszint)"</nowiki>|#FFB100}} + test$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                    varsize$ = {{Text|<nowiki>"((qbs*)tmp_long)->len"</nowiki>|#FFB100}}
                    varoffs$ = {{Text|<nowiki>"((qbs*)tmp_long)->chr"</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    varsize$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|-5|#F580B1}}): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    varoffs$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|-6|#F580B1}}): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} NoChecks {{Cl|THEN}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub__memfill_nochecks("</nowiki>|#FFB100}} + offs$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + bytes$ + {{Text|<nowiki>",(ptrszint)"</nowiki>|#FFB100}} + varoffs$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + varsize$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub__memfill((mem_block*)"</nowiki>|#FFB100}} + blkoffs$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + offs$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + bytes$ + {{Text|<nowiki>",(ptrszint)"</nowiki>|#FFB100}} + varoffs$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + varsize$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|ELSE}}
                {{Text|<nowiki>'... AS type method</nowiki>|#919191}}
                t = {{Text|typname2typ|#55FF55}}(typ$)
                {{Cl|IF}} t = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Invalid type"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) <> {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} (t {{Cl|AND (boolean)|AND}} ISUDT) <> {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} (t {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} a$ = qb64prefix$ + {{Text|<nowiki>"MEMFILL requires numeric type"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISPOINTER) {{Cl|THEN}} t = t - ISPOINTER
                {{Text|<nowiki>'attempt conversion...</nowiki>|#919191}}
                e$ = {{Text|fixoperationorder$|#55FF55}}(var$): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp + tlayout$ + sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"As"</nowiki>|#FFB100}}) + sp + typ$
                e$ = {{Text|evaluatetotyp|#55FF55}}(e$, t): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                c$ = {{Text|<nowiki>"sub__memfill_"</nowiki>|#FFB100}}
                {{Cl|IF}} NoChecks {{Cl|THEN}} c$ = {{Text|<nowiki>"sub__memfill_nochecks_"</nowiki>|#FFB100}}
                {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISOFFSET {{Cl|THEN}}
                    c$ = c$ + {{Text|<nowiki>"OFFSET"</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISFLOAT {{Cl|THEN}}
                        {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|32|#F580B1}} {{Cl|THEN}} c$ = c$ + {{Text|<nowiki>"SINGLE"</nowiki>|#FFB100}}
                        {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|64|#F580B1}} {{Cl|THEN}} c$ = c$ + {{Text|<nowiki>"DOUBLE"</nowiki>|#FFB100}}
                        {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|256|#F580B1}} {{Cl|THEN}} c$ = c$ + {{Text|<nowiki>"FLOAT"</nowiki>|#FFB100}} {{Text|<nowiki>'padded variable</nowiki>|#919191}}
                    {{Cl|ELSE}}
                        c$ = c$ + {{Text|str2|#55FF55}}((t {{Cl|AND}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}})
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                c$ = c$ + {{Text|<nowiki>"("</nowiki>|#FFB100}}
                {{Cl|IF}} NoChecks = {{Text|0|#F580B1}} {{Cl|THEN}} c$ = c$ + {{Text|<nowiki>"(mem_block*)"</nowiki>|#FFB100}} + blkoffs$ + {{Text|<nowiki>","</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, c$ + offs$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + bytes$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
            {{Cl|GOTO}} finishedline
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'note: ABSOLUTE cannot be used without CALL</nowiki>|#919191}}
    cispecial = {{Text|0|#F580B1}}
    {{Cl|IF}} n > {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"INTERRUPT"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} firstelement$ = {{Text|<nowiki>"INTERRUPTX"</nowiki>|#FFB100}} {{Cl|THEN}}
            a$ = {{Text|<nowiki>"CALL"</nowiki>|#FFB100}} + sp + firstelement$ + sp + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp + {{Text|getelements$|#55FF55}}(a$, {{Text|2|#F580B1}}, n) + sp + {{Text|<nowiki>")"</nowiki>|#FFB100}}
            ca$ = {{Text|<nowiki>"CALL"</nowiki>|#FFB100}} + sp + firstelement$ + sp + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp + {{Text|getelements$|#55FF55}}(ca$, {{Text|2|#F580B1}}, n) + sp + {{Text|<nowiki>")"</nowiki>|#FFB100}}
            n = n + {{Text|3|#F580B1}}
            firstelement$ = {{Text|<nowiki>"CALL"</nowiki>|#FFB100}}
            cispecial = {{Text|1|#F580B1}}
            {{Text|<nowiki>'fall through</nowiki>|#919191}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    usecall = {{Text|0|#F580B1}}
    {{Cl|IF}} firstelement$ = {{Text|<nowiki>"CALL"</nowiki>|#FFB100}} {{Cl|THEN}}
        usecall = {{Text|1|#F580B1}}
        {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected CALL sub-name [(...)]"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
        cn$ = {{Text|getelement$|#55FF55}}(ca$, {{Text|2|#F580B1}}): n$ = {{Cl|UCASE$}}(cn$)
        {{Cl|IF}} n > {{Text|2|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} n <= {{Text|4|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected CALL sub-name (...)"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|IF}} {{Text|getelement$|#55FF55}}(a$, {{Text|3|#F580B1}}) <> {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} {{Text|getelement$|#55FF55}}(a$, n) <> {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected CALL sub-name (...)"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            a$ = n$ + sp + {{Text|getelements$|#55FF55}}(a$, {{Text|4|#F580B1}}, n - {{Text|1|#F580B1}})
            ca$ = cn$ + sp + {{Text|getelements$|#55FF55}}(ca$, {{Text|4|#F580B1}}, n - {{Text|1|#F580B1}})
            {{Cl|IF}} n$ = {{Text|<nowiki>"INTERRUPT"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} n$ = {{Text|<nowiki>"INTERRUPTX"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|<nowiki>'assume CALL INTERRUPT[X] request</nowiki>|#919191}}
                {{Text|<nowiki>'print "CI: call interrupt command reached":sleep 1</nowiki>|#919191}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"INTERRUPT"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|WriteBufRawData|#55FF55}} MainTxtBuf, {{Text|<nowiki>"call_interrupt("</nowiki>|#FFB100}} {{Cl|ELSE}} {{Text|WriteBufRawData|#55FF55}} MainTxtBuf, {{Text|<nowiki>"call_interruptx("</nowiki>|#FFB100}}
                argn = {{Text|0|#F580B1}}
                n = {{Text|numelements|#55FF55}}(a$)
                B = {{Text|0|#F580B1}}
                e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                {{Cl|FOR}} i = {{Text|2|#F580B1}} {{Cl|TO}} n
                    e2$ = {{Text|getelement$|#55FF55}}(ca$, i)
                    {{Cl|IF}} e2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} B = B + {{Text|1|#F580B1}}
                    {{Cl|IF}} e2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} B = B - {{Text|1|#F580B1}}
                    {{Cl|IF}} (e2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} B = {{Text|0|#F580B1}}) {{Cl|OR (boolean)|OR}} i = n {{Cl|THEN}}
                        {{Cl|IF}} i = n {{Cl|THEN}}
                            {{Cl|IF}} e$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} e$ = e2$ {{Cl|ELSE}} e$ = e$ + sp + e2$
                        {{Cl|END}} {{Cl|IF}}
                        argn = argn + {{Text|1|#F580B1}}
                        {{Cl|IF}} argn = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'interrupt number</nowiki>|#919191}}
                            e$ = {{Text|fixoperationorder$|#55FF55}}(e$)
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Call"</nowiki>|#FFB100}}) + sp + n$ + sp2 + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp2 + tlayout$
                            {{Cl|IF}} cispecial = {{Text|1|#F580B1}} {{Cl|THEN}} l$ = n$ + sp + tlayout$
                            e$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|64&|#F580B1}})
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Text|<nowiki>'print "CI: evaluated interrupt number as ["+e$+"]":sleep 1</nowiki>|#919191}}
                            {{Text|WriteBufRawData|#55FF55}} MainTxtBuf, e$
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} argn = {{Text|2|#F580B1}} {{Cl|OR (boolean)|OR}} argn = {{Text|3|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'inregs, outregs</nowiki>|#919191}}
                            e$ = {{Text|fixoperationorder$|#55FF55}}(e$)
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp + tlayout$
                            e2$ = e$
                            e$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|-2|#F580B1}}) {{Text|<nowiki>'offset+size</nowiki>|#919191}}
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Text|<nowiki>'print "CI: evaluated in/out regs ["+e2$+"] as ["+e$+"]":sleep 1</nowiki>|#919191}}
                            {{Text|WriteBufRawData|#55FF55}} MainTxtBuf, {{Text|<nowiki>","</nowiki>|#FFB100}} + e$
                        {{Cl|END}} {{Cl|IF}}
                        e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    {{Cl|ELSE}}
                        {{Cl|IF}} e$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} e$ = e2$ {{Cl|ELSE}} e$ = e$ + sp + e2$
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|NEXT}}
                {{Cl|IF}} argn <> {{Text|3|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected CALL INTERRUPT (interrupt-no, inregs, outregs)"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>");"</nowiki>|#FFB100}}
                {{Cl|IF}} cispecial = {{Text|0|#F580B1}} {{Cl|THEN}} l$ = l$ + sp2 + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                {{Text|<nowiki>'print "CI: done":sleep 1</nowiki>|#919191}}
                {{Cl|GOTO}} finishedline
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'call interrupt</nowiki>|#919191}}
            {{Text|<nowiki>'call to CALL ABSOLUTE beyond reasonable doubt</nowiki>|#919191}}
            {{Cl|IF}} n$ = {{Text|<nowiki>"ABSOLUTE"</nowiki>|#FFB100}} {{Cl|THEN}}
                l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Call"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"Absolute"</nowiki>|#FFB100}} + sp2 + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp2)
                argn = {{Text|0|#F580B1}}
                n = {{Text|numelements|#55FF55}}(a$)
                B = {{Text|0|#F580B1}}
                e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                {{Cl|FOR}} i = {{Text|2|#F580B1}} {{Cl|TO}} n
                    e2$ = {{Text|getelement$|#55FF55}}(ca$, i)
                    {{Cl|IF}} e2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} B = B + {{Text|1|#F580B1}}
                    {{Cl|IF}} e2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} B = B - {{Text|1|#F580B1}}
                    {{Cl|IF}} (e2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} B = {{Text|0|#F580B1}}) {{Cl|OR (boolean)|OR}} i = n {{Cl|THEN}}
                        {{Cl|IF}} i < n {{Cl|THEN}}
                            {{Cl|IF}} e$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected expression before , or )"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                            {{Text|<nowiki>'1. variable or value?</nowiki>|#919191}}
                            e$ = {{Text|fixoperationorder$|#55FF55}}(e$)
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            l$ = l$ + tlayout$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp
                            ignore$ = {{Text|evaluate|#55FF55}}(e$, typ)
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISPOINTER) <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} (typ {{Cl|AND (boolean)|AND}} ISREFERENCE) <> {{Text|0|#F580B1}} {{Cl|THEN}}
                                {{Text|<nowiki>'assume standard variable</nowiki>|#919191}}
                                {{Text|<nowiki>'assume not string/array/udt/etc</nowiki>|#919191}}
                                e$ = {{Text|<nowiki>"VARPTR"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp + e$ + sp + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                                e$ = {{Text|evaluatetotyp|#55FF55}}(e$, UINTEGERTYPE - ISPOINTER)
                                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Cl|ELSE}}
                                {{Text|<nowiki>'assume not string</nowiki>|#919191}}
                                {{Text|<nowiki>'single, double or integer64?</nowiki>|#919191}}
                                {{Cl|IF}} typ {{Cl|AND (boolean)|AND}} ISFLOAT {{Cl|THEN}}
                                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|32|#F580B1}} {{Cl|THEN}}
                                        e$ = {{Text|evaluatetotyp|#55FF55}}(e$, SINGLETYPE - ISPOINTER)
                                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                        v$ = {{Text|<nowiki>"pass"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}({{Text|uniquenumber|#55FF55}})
                                        {{Text|WriteBufLine|#55FF55}} defdatahandle, {{Text|<nowiki>"float *"</nowiki>|#FFB100}} + v$ + {{Text|<nowiki>"=NULL;"</nowiki>|#FFB100}}
                                        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if("</nowiki>|#FFB100}} + v$ + {{Text|<nowiki>"==NULL){"</nowiki>|#FFB100}}
                                        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"cmem_sp-=4;"</nowiki>|#FFB100}}
                                        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, v$ + {{Text|<nowiki>"=(float*)(dblock+cmem_sp);"</nowiki>|#FFB100}}
                                        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if (cmem_sp<qbs_cmem_sp) error(257);"</nowiki>|#FFB100}}
                                        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                                        e$ = {{Text|<nowiki>"(uint16)(((uint8*)&(*"</nowiki>|#FFB100}} + v$ + {{Text|<nowiki>"="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"))-((uint8*)dblock))"</nowiki>|#FFB100}}
                                    {{Cl|ELSE}}
                                        e$ = {{Text|evaluatetotyp|#55FF55}}(e$, DOUBLETYPE - ISPOINTER)
                                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                        v$ = {{Text|<nowiki>"pass"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}({{Text|uniquenumber|#55FF55}})
                                        {{Text|WriteBufLine|#55FF55}} defdatahandle, {{Text|<nowiki>"double *"</nowiki>|#FFB100}} + v$ + {{Text|<nowiki>"=NULL;"</nowiki>|#FFB100}}
                                        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if("</nowiki>|#FFB100}} + v$ + {{Text|<nowiki>"==NULL){"</nowiki>|#FFB100}}
                                        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"cmem_sp-=8;"</nowiki>|#FFB100}}
                                        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, v$ + {{Text|<nowiki>"=(double*)(dblock+cmem_sp);"</nowiki>|#FFB100}}
                                        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if (cmem_sp<qbs_cmem_sp) error(257);"</nowiki>|#FFB100}}
                                        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                                        e$ = {{Text|<nowiki>"(uint16)(((uint8*)&(*"</nowiki>|#FFB100}} + v$ + {{Text|<nowiki>"="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"))-((uint8*)dblock))"</nowiki>|#FFB100}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|ELSE}}
                                    e$ = {{Text|evaluatetotyp|#55FF55}}(e$, INTEGER64TYPE - ISPOINTER)
                                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                    v$ = {{Text|<nowiki>"pass"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}({{Text|uniquenumber|#55FF55}})
                                    {{Text|WriteBufLine|#55FF55}} defdatahandle, {{Text|<nowiki>"int64 *"</nowiki>|#FFB100}} + v$ + {{Text|<nowiki>"=NULL;"</nowiki>|#FFB100}}
                                    {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if("</nowiki>|#FFB100}} + v$ + {{Text|<nowiki>"==NULL){"</nowiki>|#FFB100}}
                                    {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"cmem_sp-=8;"</nowiki>|#FFB100}}
                                    {{Text|WriteBufLine|#55FF55}} DataTxtBuf, v$ + {{Text|<nowiki>"=(int64*)(dblock+cmem_sp);"</nowiki>|#FFB100}}
                                    {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if (cmem_sp<qbs_cmem_sp) error(257);"</nowiki>|#FFB100}}
                                    {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                                    e$ = {{Text|<nowiki>"(uint16)(((uint8*)&(*"</nowiki>|#FFB100}} + v$ + {{Text|<nowiki>"="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"))-((uint8*)dblock))"</nowiki>|#FFB100}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"call_absolute_offsets["</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(argn) + {{Text|<nowiki>"]="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                        {{Cl|ELSE}}
                            {{Cl|IF}} e$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} e$ = e2$ {{Cl|ELSE}} e$ = e$ + sp + e2$
                            e$ = {{Text|fixoperationorder|#55FF55}}(e$)
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            l$ = l$ + tlayout$ + sp2 + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                            e$ = {{Text|evaluatetotyp|#55FF55}}(e$, UINTEGERTYPE - ISPOINTER)
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"call_absolute("</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(argn) + {{Text|<nowiki>","</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                        {{Cl|END}} {{Cl|IF}}
                        argn = argn + {{Text|1|#F580B1}}
                        e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    {{Cl|ELSE}}
                        {{Cl|IF}} e$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} e$ = e2$ {{Cl|ELSE}} e$ = e$ + sp + e2$
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|NEXT}}
                layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                {{Cl|GOTO}} finishedline
            {{Cl|END}} {{Cl|IF}}
        {{Cl|ELSE}} {{Text|<nowiki>'n>2</nowiki>|#919191}}
            a$ = n$
            ca$ = cn$
            usecall = {{Text|2|#F580B1}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'n>2</nowiki>|#919191}}
        n = {{Text|numelements|#55FF55}}(a$)
        firstelement$ = {{Text|getelement$|#55FF55}}(a$, {{Text|1|#F580B1}})
        {{Text|<nowiki>'valid SUB name</nowiki>|#919191}}
        validsub = {{Text|0|#F580B1}}
        findidsecondarg = {{Text|<nowiki>""</nowiki>|#FFB100}}: {{Cl|IF}} n >= {{Text|2|#F580B1}} {{Cl|THEN}} findidsecondarg = {{Text|getelement$|#55FF55}}(a$, {{Text|2|#F580B1}})
        try = {{Text|findid|#55FF55}}(firstelement$)
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
        {{Cl|DO}} {{Cl|WHILE}} try
            {{Cl|IF}} id.subfunc = {{Text|2|#F580B1}} {{Cl|THEN}} validsub = {{Text|1|#F580B1}}: {{Cl|EXIT}} {{Cl|DO}}
            {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}}
                findidsecondarg = {{Text|<nowiki>""</nowiki>|#FFB100}}: {{Cl|IF}} n >= {{Text|2|#F580B1}} {{Cl|THEN}} findidsecondarg = {{Text|getelement$|#55FF55}}(a$, {{Text|2|#F580B1}})
                findanotherid = {{Text|1|#F580B1}}
                try = {{Text|findid|#55FF55}}(firstelement$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Cl|ELSE}}
                try = {{Text|0|#F580B1}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|LOOP}}
        {{Cl|IF}} validsub = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected CALL sub-name [(...)]"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'sub?</nowiki>|#919191}}
    {{Cl|IF}} n >= {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"?"</nowiki>|#FFB100}} {{Cl|THEN}} firstelement$ = {{Text|<nowiki>"PRINT"</nowiki>|#FFB100}}
        findidsecondarg = {{Text|<nowiki>""</nowiki>|#FFB100}}: {{Cl|IF}} n >= {{Text|2|#F580B1}} {{Cl|THEN}} findidsecondarg = {{Text|getelement$|#55FF55}}(a$, {{Text|2|#F580B1}})
        try = {{Text|findid|#55FF55}}(firstelement$)
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
        {{Cl|DO}} {{Cl|WHILE}} try
            {{Cl|IF}} id.subfunc = {{Text|2|#F580B1}} {{Cl|THEN}}
                {{Text|<nowiki>'check symbol</nowiki>|#919191}}
                s$ = {{Text|removesymbol$|#55FF55}}(firstelement$ + {{Text|<nowiki>""</nowiki>|#FFB100}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Cl|IF}} {{Cl|ASC (function)|ASC}}(id.musthave) = {{Text|36|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'="$"</nowiki>|#919191}}
                    {{Cl|IF}} s$ <> {{Text|<nowiki>"$"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} notsubcall {{Text|<nowiki>'missing musthave "$"</nowiki>|#919191}}
                {{Cl|ELSE}}
                    {{Cl|IF}} {{Cl|LEN}}(s$) {{Cl|THEN}} {{Cl|GOTO}} notsubcall {{Text|<nowiki>'unrequired symbol added</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'check for variable assignment</nowiki>|#919191}}
                {{Cl|IF}} n > {{Text|1|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} {{Cl|ASC (function)|ASC}}(id.specialformat) <> {{Text|61|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'<>"="</nowiki>|#919191}}
                        {{Cl|IF}} {{Cl|ASC (function)|ASC}}({{Text|getelement$|#55FF55}}(a$, {{Text|2|#F580B1}})) = {{Text|61|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} notsubcall {{Text|<nowiki>'assignment, not sub call</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'check for array assignment</nowiki>|#919191}}
                {{Cl|IF}} n > {{Text|2|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} firstelement$ <> {{Text|<nowiki>"PRINT"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} firstelement$ <> {{Text|<nowiki>"LPRINT"</nowiki>|#FFB100}} {{Cl|THEN}}
                        {{Cl|IF}} {{Text|getelement$|#55FF55}}(a$, {{Text|2|#F580B1}}) = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}}
                            B = {{Text|1|#F580B1}}
                            {{Cl|FOR}} i = {{Text|3|#F580B1}} {{Cl|TO}} n
                                e$ = {{Text|getelement$|#55FF55}}(a$, i)
                                {{Cl|IF}} e$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} B = B + {{Text|1|#F580B1}}
                                {{Cl|IF}} e$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}}
                                    B = B - {{Text|1|#F580B1}}
                                    {{Cl|IF}} B = {{Text|0|#F580B1}} {{Cl|THEN}}
                                        {{Cl|IF}} i = n {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}}
                                        {{Cl|IF}} {{Text|getelement$|#55FF55}}(a$, i + {{Text|1|#F580B1}}) = {{Text|<nowiki>"="</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} notsubcall
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|NEXT}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'generate error on driect _GL call</nowiki>|#919191}}
                {{Cl|IF}} firstelement$ = {{Text|<nowiki>"_GL"</nowiki>|#FFB100}} {{Cl|THEN}}
                    a$ = {{Text|<nowiki>"Cannot call SUB _GL directly"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} firstelement$ = {{Text|<nowiki>"VWATCH"</nowiki>|#FFB100}} {{Cl|THEN}}
                    a$ = {{Text|<nowiki>"Cannot call SUB VWATCH directly"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} firstelement$ = {{Text|<nowiki>"OPEN"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Text|<nowiki>'gwbasic or qbasic version?</nowiki>|#919191}}
                    B = {{Text|0|#F580B1}}
                    {{Cl|FOR}} x = {{Text|2|#F580B1}} {{Cl|TO}} n
                        a2$ = {{Text|getelement$|#55FF55}}(a$, x)
                        {{Cl|IF}} a2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} B = B + {{Text|1|#F580B1}}
                        {{Cl|IF}} a2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} B = B - {{Text|1|#F580B1}}
                        {{Cl|IF}} a2$ = {{Text|<nowiki>"FOR"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} a2$ = {{Text|<nowiki>"AS"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}} {{Text|<nowiki>'qb style open verified</nowiki>|#919191}}
                        {{Cl|IF}} B = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} a2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|<nowiki>'the gwbasic version includes a comma after the first string expression</nowiki>|#919191}}
                            findanotherid = {{Text|1|#F580B1}}
                            try = {{Text|findid|#55FF55}}(firstelement$) {{Text|<nowiki>'id of sub_open_gwbasic</nowiki>|#919191}}
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Cl|EXIT}} {{Cl|FOR}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|NEXT}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'IF findid(firstelement$) THEN</nowiki>|#919191}}
                {{Text|<nowiki>'IF id.subfunc = 2 THEN</nowiki>|#919191}}
                {{Cl|IF}} firstelement$ = {{Text|<nowiki>"CLOSE"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} firstelement$ = {{Text|<nowiki>"RESET"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} firstelement$ = {{Text|<nowiki>"RESET"</nowiki>|#FFB100}} {{Cl|THEN}}
                        {{Cl|IF}} n > {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Syntax error - RESET takes no parameters"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                        l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Reset"</nowiki>|#FFB100}})
                    {{Cl|ELSE}}
                        l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Close"</nowiki>|#FFB100}})
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|THEN}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_close(NULL,0);"</nowiki>|#FFB100}} {{Text|<nowiki>'closes all files</nowiki>|#919191}}
                    {{Cl|ELSE}}
                        l$ = l$ + sp
                        B = {{Text|0|#F580B1}}
                        s = {{Text|0|#F580B1}}
                        a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                        {{Cl|FOR}} x = {{Text|2|#F580B1}} {{Cl|TO}} n
                            a2$ = {{Text|getelement$|#55FF55}}(ca$, x)
                            {{Cl|IF}} a2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} B = B + {{Text|1|#F580B1}}
                            {{Cl|IF}} a2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} B = B - {{Text|1|#F580B1}}
                            {{Cl|IF}} a2$ = {{Text|<nowiki>"#"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} B = {{Text|0|#F580B1}} {{Cl|THEN}}
                                {{Cl|IF}} s = {{Text|0|#F580B1}} {{Cl|THEN}} s = {{Text|1|#F580B1}} {{Cl|ELSE}} a$ = {{Text|<nowiki>"Unexpected #"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                l$ = l$ + {{Text|<nowiki>"#"</nowiki>|#FFB100}} + sp2
                                {{Cl|GOTO}} closenexta
                            {{Cl|END}} {{Cl|IF}}
                            {{Cl|IF}} a2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} B = {{Text|0|#F580B1}} {{Cl|THEN}}
                                {{Cl|IF}} s = {{Text|2|#F580B1}} {{Cl|THEN}}
                                    e$ = {{Text|fixoperationorder$|#55FF55}}(a3$)
                                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                    l$ = l$ + tlayout$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp
                                    e$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|64&|#F580B1}})
                                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_close("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>",1);"</nowiki>|#FFB100}}
                                    a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                                    s = {{Text|0|#F580B1}}
                                    {{Cl|GOTO}} closenexta
                                {{Cl|ELSE}}
                                    a$ = {{Text|<nowiki>"Expected expression before ,"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                            s = {{Text|2|#F580B1}}
                            {{Cl|IF}} a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a3$ = a2$ {{Cl|ELSE}} a3$ = a3$ + sp + a2$
                            closenexta:
                        {{Cl|NEXT}}
                        {{Cl|IF}} s = {{Text|2|#F580B1}} {{Cl|THEN}}
                            e$ = {{Text|fixoperationorder$|#55FF55}}(a3$)
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            l$ = l$ + tlayout$
                            e$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|64&|#F580B1}})
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_close("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>",1);"</nowiki>|#FFB100}}
                        {{Cl|ELSE}}
                            l$ = {{Cl|LEFT$}}(l$, {{Cl|LEN}}(l$) - {{Text|1|#F580B1}})
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                    layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                    {{Cl|GOTO}} finishedline
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'close</nowiki>|#919191}}
                {{Text|<nowiki>'data, restore, read</nowiki>|#919191}}
                {{Cl|IF}} firstelement$ = {{Text|<nowiki>"READ"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|<nowiki>'file input</nowiki>|#919191}}
                    {{Text|xread|#55FF55}} ca$, n
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    {{Text|<nowiki>'note: layout done in xread sub</nowiki>|#919191}}
                    {{Cl|GOTO}} finishedline
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'read</nowiki>|#919191}}
                lineinput = {{Text|0|#F580B1}}
                {{Cl|IF}} n >= {{Text|2|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} firstelement$ = {{Text|<nowiki>"LINE"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} secondelement$ = {{Text|<nowiki>"INPUT"</nowiki>|#FFB100}} {{Cl|THEN}}
                        lineinput = {{Text|1|#F580B1}}
                        a$ = {{Cl|RIGHT$}}(a$, {{Cl|LEN}}(a$) - {{Text|5|#F580B1}}): ca$ = {{Cl|RIGHT$}}(ca$, {{Cl|LEN}}(ca$) - {{Text|5|#F580B1}}): n = n - {{Text|1|#F580B1}} {{Text|<nowiki>'remove "LINE"</nowiki>|#919191}}
                        firstelement$ = {{Text|<nowiki>"INPUT"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} firstelement$ = {{Text|<nowiki>"INPUT"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|<nowiki>'file input</nowiki>|#919191}}
                    {{Cl|IF}} n > {{Text|1|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} {{Text|getelement$|#55FF55}}(a$, {{Text|2|#F580B1}}) = {{Text|<nowiki>"#"</nowiki>|#FFB100}} {{Cl|THEN}}
                            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Input"</nowiki>|#FFB100}}) + sp + {{Text|<nowiki>"#"</nowiki>|#FFB100}}: {{Cl|IF}} lineinput {{Cl|THEN}} l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Line"</nowiki>|#FFB100}}) + sp + l$
                            u$ = {{Text|str2$|#55FF55}}({{Text|uniquenumber|#55FF55}})
                            {{Text|<nowiki>'which file?</nowiki>|#919191}}
                            {{Cl|IF}} n = {{Text|2|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected # ... , ..."</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                            a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                            B = {{Text|0|#F580B1}}
                            {{Cl|FOR}} i = {{Text|3|#F580B1}} {{Cl|TO}} n
                                a2$ = {{Text|getelement$|#55FF55}}(ca$, i)
                                {{Cl|IF}} a2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} B = B + {{Text|1|#F580B1}}
                                {{Cl|IF}} a2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} B = B - {{Text|1|#F580B1}}
                                {{Cl|IF}} a2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} B = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected # ... , ..."</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                    {{Cl|GOTO}} inputgotfn
                                {{Cl|END}} {{Cl|IF}}
                                {{Cl|IF}} a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a3$ = a2$ {{Cl|ELSE}} a3$ = a3$ + sp + a2$
                            {{Cl|NEXT}}
                            inputgotfn:
                            e$ = {{Text|fixoperationorder$|#55FF55}}(a3$)
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            l$ = l$ + sp2 + tlayout$
                            e$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|64&|#F580B1}})
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_fileno="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (new_error) goto skip"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                            i = i + {{Text|1|#F580B1}}
                            {{Cl|IF}} i > n {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected , ..."</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                            a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                            B = {{Text|0|#F580B1}}
                            {{Cl|FOR}} i = i {{Cl|TO}} n
                                a2$ = {{Text|getelement$|#55FF55}}(ca$, i)
                                {{Cl|IF}} a2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} B = B + {{Text|1|#F580B1}}
                                {{Cl|IF}} a2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} B = B - {{Text|1|#F580B1}}
                                {{Cl|IF}} i = n {{Cl|THEN}}
                                    {{Cl|IF}} a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a3$ = a2$ {{Cl|ELSE}} a3$ = a3$ + sp + a2$
                                    a2$ = {{Text|<nowiki>","</nowiki>|#FFB100}}: B = {{Text|0|#F580B1}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Cl|IF}} a2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} B = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected , ..."</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                    e$ = {{Text|fixoperationorder$|#55FF55}}(a3$)
                                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                    l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp + tlayout$
                                    e$ = {{Text|evaluate|#55FF55}}(e$, t)
                                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                    {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISREFERENCE) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected variable-name"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                    {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}}
                                        e$ = {{Text|refer|#55FF55}}(e$, t, {{Text|0|#F580B1}})
                                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                        {{Cl|IF}} lineinput {{Cl|THEN}}
                                            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_file_line_input_string(tmp_fileno,"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                                            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (new_error) goto skip"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                                        {{Cl|ELSE}}
                                            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_file_input_string(tmp_fileno,"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                                            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (new_error) goto skip"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                                        {{Cl|END}} {{Cl|IF}}
                                        stringprocessinghappened = {{Text|1|#F580B1}}
                                    {{Cl|ELSE}}
                                        {{Cl|IF}} lineinput {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected string-variable"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                        {{Text|<nowiki>'numeric variable</nowiki>|#919191}}
                                        {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISFLOAT) <> {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} (t {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) <> {{Text|64|#F580B1}} {{Cl|THEN}}
                                            {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) {{Cl|THEN}}
                                                {{Text|setrefer|#55FF55}} e$, t, {{Text|<nowiki>"((int64)func_file_input_float(tmp_fileno,"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(t) + {{Text|<nowiki>"))"</nowiki>|#FFB100}}, {{Text|1|#F580B1}}
                                                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                            {{Cl|ELSE}}
                                                {{Text|setrefer|#55FF55}} e$, t, {{Text|<nowiki>"func_file_input_float(tmp_fileno,"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(t) + {{Text|<nowiki>")"</nowiki>|#FFB100}}, {{Text|1|#F580B1}}
                                                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                            {{Cl|END}} {{Cl|IF}}
                                        {{Cl|ELSE}}
                                            {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISUNSIGNED {{Cl|THEN}}
                                                {{Text|setrefer|#55FF55}} e$, t, {{Text|<nowiki>"func_file_input_uint64(tmp_fileno)"</nowiki>|#FFB100}}, {{Text|1|#F580B1}}
                                                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                            {{Cl|ELSE}}
                                                {{Text|setrefer|#55FF55}} e$, t, {{Text|<nowiki>"func_file_input_int64(tmp_fileno)"</nowiki>|#FFB100}}, {{Text|1|#F580B1}}
                                                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                            {{Cl|END}} {{Cl|IF}}
                                        {{Cl|END}} {{Cl|IF}}
                                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (new_error) goto skip"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Cl|IF}} i = n {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}}
                                    {{Cl|IF}} lineinput {{Cl|THEN}} a$ = {{Text|<nowiki>"Too many variables"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                    a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: a2$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Cl|IF}} a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a3$ = a2$ {{Cl|ELSE}} a3$ = a3$ + sp + a2$
                            {{Cl|NEXT}}
                            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"skip"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>":"</nowiki>|#FFB100}}
                            {{Cl|IF}} stringprocessinghappened {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, cleanupstringprocessingcall$ + {{Text|<nowiki>"0);"</nowiki>|#FFB100}}
                            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                            {{Cl|GOTO}} finishedline
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'input#</nowiki>|#919191}}
                {{Cl|IF}} firstelement$ = {{Text|<nowiki>"INPUT"</nowiki>|#FFB100}} {{Cl|THEN}}
                    l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Input"</nowiki>|#FFB100}}): {{Cl|IF}} lineinput {{Cl|THEN}} l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Line"</nowiki>|#FFB100}}) + sp + l$
                    commaneeded = {{Text|0|#F580B1}}
                    i = {{Text|2|#F580B1}}
                    newline = {{Text|1|#F580B1}}: {{Cl|IF}} {{Text|getelement$|#55FF55}}(a$, i) = {{Text|<nowiki>";"</nowiki>|#FFB100}} {{Cl|THEN}} newline = {{Text|0|#F580B1}}: i = i + {{Text|1|#F580B1}}: l$ = l$ + sp + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                    a2$ = {{Text|getelement$|#55FF55}}(ca$, i)
                    {{Cl|IF}} {{Cl|LEFT$}}(a2$, {{Text|1|#F580B1}}) = {{Cl|CHR$}}({{Text|34|#F580B1}}) {{Cl|THEN}}
                        e$ = {{Text|fixoperationorder$|#55FF55}}(a2$): l$ = l$ + sp + tlayout$
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_print(qbs_new_txt_len("</nowiki>|#FFB100}} + a2$ + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}}
                        i = i + {{Text|1|#F580B1}}
                        {{Text|<nowiki>'MUST be followed by a ; or ,</nowiki>|#919191}}
                        a2$ = {{Text|getelement$|#55FF55}}(ca$, i)
                        i = i + {{Text|1|#F580B1}}
                        l$ = l$ + sp2 + a2$
                        {{Cl|IF}} a2$ = {{Text|<nowiki>";"</nowiki>|#FFB100}} {{Cl|THEN}}
                            {{Cl|IF}} lineinput {{Cl|THEN}} {{Cl|GOTO}} finishedpromptstring
                            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_print(qbs_new_txt("</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"? "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}}
                            {{Cl|GOTO}} finishedpromptstring
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} a2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}}
                            {{Cl|GOTO}} finishedpromptstring
                        {{Cl|END}} {{Cl|IF}}
                        a$ = {{Text|<nowiki>"Syntax error - Reference: INPUT [;] "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"[Question or statement text]"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"{,|;} variable[, ...] or INPUT ; variable[, ...]"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|<nowiki>'there was no promptstring, so print a ?</nowiki>|#919191}}
                    {{Cl|IF}} lineinput = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_print(qbs_new_txt("</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"? "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}}
                    finishedpromptstring:
                    numvar = {{Text|0|#F580B1}}
                    {{Cl|FOR}} i = i {{Cl|TO}} n
                        {{Cl|IF}} commaneeded = {{Text|1|#F580B1}} {{Cl|THEN}}
                            a2$ = {{Text|getelement$|#55FF55}}(ca$, i)
                            {{Cl|IF}} a2$ <> {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Syntax error - comma expected"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                        {{Cl|ELSE}}
                            B = {{Text|0|#F580B1}}
                            e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                            {{Cl|FOR}} i2 = i {{Cl|TO}} n
                                e2$ = {{Text|getelement$|#55FF55}}(ca$, i2)
                                {{Cl|IF}} e2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} B = B + {{Text|1|#F580B1}}
                                {{Cl|IF}} e2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} B = B - {{Text|1|#F580B1}}
                                {{Cl|IF}} e2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} B = {{Text|0|#F580B1}} {{Cl|THEN}} i2 = i2 - {{Text|1|#F580B1}}: {{Cl|EXIT}} {{Cl|FOR}}
                                e$ = e$ + sp + e2$
                            {{Cl|NEXT}}
                            i = i2: {{Cl|IF}} i > n {{Cl|THEN}} i = n
                            {{Cl|IF}} e$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected variable"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                            e$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - {{Text|1|#F580B1}})
                            e$ = {{Text|fixoperationorder$|#55FF55}}(e$)
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            l$ = l$ + sp + tlayout$: {{Cl|IF}} i <> n {{Cl|THEN}} l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}}
                            e$ = {{Text|evaluate|#55FF55}}(e$, t)
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISREFERENCE) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected variable"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                            {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}}
                                e$ = {{Text|refer|#55FF55}}(e$, t, {{Text|0|#F580B1}})
                                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                numvar = numvar + {{Text|1|#F580B1}}
                                {{Cl|IF}} lineinput {{Cl|THEN}}
                                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_input_variabletypes["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(numvar) + {{Text|<nowiki>"]=ISSTRING+512;"</nowiki>|#FFB100}}
                                {{Cl|ELSE}}
                                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_input_variabletypes["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(numvar) + {{Text|<nowiki>"]=ISSTRING;"</nowiki>|#FFB100}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_input_variableoffsets["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(numvar) + {{Text|<nowiki>"]="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                                {{Cl|GOTO}} gotinputvar
                            {{Cl|END}} {{Cl|IF}}
                            {{Cl|IF}} lineinput {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected string variable"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                            {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISARRAY) {{Cl|THEN}}
                                {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) {{Cl|THEN}}
                                    a$ = {{Text|<nowiki>"INPUT cannot handle BIT array elements"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                            e$ = {{Text|<nowiki>"&("</nowiki>|#FFB100}} + {{Text|refer|#55FF55}}(e$, t, {{Text|0|#F580B1}}) + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Text|<nowiki>'remove assumed/unnecessary flags</nowiki>|#919191}}
                            {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISPOINTER) {{Cl|THEN}} t = t - ISPOINTER
                            {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISINCONVENTIONALMEMORY) {{Cl|THEN}} t = t - ISINCONVENTIONALMEMORY
                            {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} t = t - ISREFERENCE
                            {{Text|<nowiki>'IF (t AND ISOFFSETINBITS) THEN</nowiki>|#919191}}
                            {{Text|<nowiki>'numvar = numvar + 1</nowiki>|#919191}}
                            {{Text|<nowiki>'consider storing the bit offset in unused bits of t</nowiki>|#919191}}
                            {{Text|<nowiki>'WriteBufLine MainTxtBuf, "qbs_input_variabletypes[" + str2(numvar) + "]=" + str2(t) + ";"</nowiki>|#919191}}
                            {{Text|<nowiki>'WriteBufLine MainTxtBuf, "qbs_input_variableoffsets[" + str2(numvar) + "]=" + refer(ref$, typ, 1) + ";"</nowiki>|#919191}}
                            {{Text|<nowiki>'GOTO gotinputvar</nowiki>|#919191}}
                            {{Text|<nowiki>'END IF</nowiki>|#919191}}
                            {{Text|<nowiki>'assume it is a regular variable</nowiki>|#919191}}
                            numvar = numvar + {{Text|1|#F580B1}}
                            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_input_variabletypes["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(numvar) + {{Text|<nowiki>"]="</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(t) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_input_variableoffsets["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(numvar) + {{Text|<nowiki>"]="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                            {{Cl|GOTO}} gotinputvar
                        {{Cl|END}} {{Cl|IF}}
                        gotinputvar:
                        commaneeded = commaneeded + {{Text|1|#F580B1}}: {{Cl|IF}} commaneeded = {{Text|2|#F580B1}} {{Cl|THEN}} commaneeded = {{Text|0|#F580B1}}
                    {{Cl|NEXT}}
                    {{Cl|IF}} numvar = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Syntax error - Reference: INPUT [;] "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"[Question or statement text]"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"{,|;} variable[, ...] or INPUT ; variable[, ...]"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    {{Cl|IF}} lineinput = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} numvar > {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Too many variables"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    {{Cl|IF}} vWatchOn = {{Text|1|#F580B1}} {{Cl|THEN}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*__LONG_VWATCH_LINENUMBER= -4; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_input("</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(numvar) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(newline) + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (stop_program) end();"</nowiki>|#FFB100}}
                    {{Cl|IF}} vWatchOn = {{Text|1|#F580B1}} {{Cl|THEN}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*__LONG_VWATCH_LINENUMBER= -5; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, cleanupstringprocessingcall$ + {{Text|<nowiki>"0);"</nowiki>|#FFB100}}
                    layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                    {{Cl|GOTO}} finishedline
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} firstelement$ = {{Text|<nowiki>"WRITE"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|<nowiki>'file write</nowiki>|#919191}}
                    {{Cl|IF}} n > {{Text|1|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} {{Text|getelement$|#55FF55}}(a$, {{Text|2|#F580B1}}) = {{Text|<nowiki>"#"</nowiki>|#FFB100}} {{Cl|THEN}}
                            {{Text|xfilewrite|#55FF55}} ca$, n
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Cl|GOTO}} finishedline
                        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'#</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'n>1</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'"write"</nowiki>|#919191}}
                {{Cl|IF}} firstelement$ = {{Text|<nowiki>"WRITE"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|<nowiki>'write</nowiki>|#919191}}
                    {{Text|xwrite|#55FF55}} ca$, n
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    {{Cl|GOTO}} finishedline
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'"write"</nowiki>|#919191}}
                {{Cl|IF}} firstelement$ = {{Text|<nowiki>"PRINT"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|<nowiki>'file print</nowiki>|#919191}}
                    {{Cl|IF}} n > {{Text|1|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} {{Text|getelement$|#55FF55}}(a$, {{Text|2|#F580B1}}) = {{Text|<nowiki>"#"</nowiki>|#FFB100}} {{Cl|THEN}}
                            {{Text|xfileprint|#55FF55}} a$, ca$, n
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            l$ = tlayout$
                            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                            {{Cl|GOTO}} finishedline
                        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'#</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'n>1</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'"print"</nowiki>|#919191}}
                {{Cl|IF}} firstelement$ = {{Text|<nowiki>"PRINT"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} firstelement$ = {{Text|<nowiki>"LPRINT"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} secondelement$ <> {{Text|<nowiki>"USING"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|<nowiki>'check to see if we need to auto-add semicolons</nowiki>|#919191}}
                        elementon = {{Text|2|#F580B1}}
                        redosemi:
                        {{Cl|FOR}} i = elementon {{Cl|TO}} n - {{Text|1|#F580B1}}
                            nextchar$ = {{Text|getelement$|#55FF55}}(a$, i + {{Text|1|#F580B1}})
                            {{Cl|IF}} nextchar$ <> {{Text|<nowiki>";"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} nextchar$ <> {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} nextchar$ <> {{Text|<nowiki>"+"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} nextchar$ <> {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}}
                                temp1$ = {{Text|getelement$|#55FF55}}(a$, i)
                                beginpoint = {{Cl|INSTR}}(beginpoint, temp1$, {{Cl|CHR$}}({{Text|34|#F580B1}}))
                                endpoint = {{Cl|INSTR}}(beginpoint + {{Text|1|#F580B1}}, temp1$, {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>","</nowiki>|#FFB100}})
                                {{Cl|IF}} beginpoint <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} endpoint <> {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'if we have both positions</nowiki>|#919191}}
                                    {{Text|<nowiki>'Quote without semicolon check (like PRINT "abc"123)</nowiki>|#919191}}
                                    textlength = endpoint - beginpoint - {{Text|1|#F580B1}}
                                    textvalue$ = {{Cl|MID$ (function)|MID$}}(temp1$, endpoint + {{Text|2|#F580B1}}, {{Cl|LEN}}({{Cl|LTRIM$}}({{Cl|STR$}}(textlength))))
                                    {{Cl|IF}} {{Cl|VAL}}(textvalue$) = textlength {{Cl|THEN}}
                                        {{Text|insertelements|#55FF55}} a$, i, {{Text|<nowiki>";"</nowiki>|#FFB100}}
                                        {{Text|insertelements|#55FF55}} ca$, i, {{Text|<nowiki>";"</nowiki>|#FFB100}}
                                        n = n + {{Text|1|#F580B1}}
                                        elementon = i + {{Text|2|#F580B1}} {{Text|<nowiki>'just a easy way to reduce redundant calls to the routine</nowiki>|#919191}}
                                        {{Cl|GOTO}} redosemi
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Cl|IF}} temp1$ <> {{Text|<nowiki>"USING"</nowiki>|#FFB100}} {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|LEFT$}}({{Cl|LTRIM$}}(nextchar$), {{Text|1|#F580B1}}) = {{Cl|CHR$}}({{Text|34|#F580B1}}) {{Cl|THEN}}
                                        {{Cl|IF}} temp1$ <> {{Text|<nowiki>";"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} temp1$ <> {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} temp1$ <> {{Text|<nowiki>"+"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} temp1$ <> {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}}
                                            {{Text|insertelements|#55FF55}} a$, i, {{Text|<nowiki>";"</nowiki>|#FFB100}}
                                            {{Text|insertelements|#55FF55}} ca$, i, {{Text|<nowiki>";"</nowiki>|#FFB100}}
                                            n = n + {{Text|1|#F580B1}}
                                            elementon = i + {{Text|2|#F580B1}} {{Text|<nowiki>'just a easy way to reduce redundant calls to the routine</nowiki>|#919191}}
                                            {{Cl|GOTO}} redosemi
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|NEXT}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|xprint|#55FF55}} a$, ca$, n
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    l$ = tlayout$
                    layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                    {{Cl|GOTO}} finishedline
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} firstelement$ = {{Text|<nowiki>"CLEAR"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} subfunc$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"CLEAR cannot be used inside a SUB/FUNCTION"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'LSET/RSET</nowiki>|#919191}}
                {{Cl|IF}} firstelement$ = {{Text|<nowiki>"LSET"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} firstelement$ = {{Text|<nowiki>"RSET"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected "</nowiki>|#FFB100}} + firstelement$ + {{Text|<nowiki>" ..."</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    {{Cl|IF}} firstelement$ = {{Text|<nowiki>"LSET"</nowiki>|#FFB100}} {{Cl|THEN}} l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"LSet"</nowiki>|#FFB100}}) {{Cl|ELSE}} l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"RSet"</nowiki>|#FFB100}})
                    dest$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    source$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    part = {{Text|1|#F580B1}}
                    i = {{Text|2|#F580B1}}
                    a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    B = {{Text|0|#F580B1}}
                    {{Cl|DO}}
                        {{Cl|IF}} i > n {{Cl|THEN}}
                            {{Cl|IF}} part <> {{Text|2|#F580B1}} {{Cl|OR (boolean)|OR}} a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected LSET/RSET stringvariable=string"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                            source$ = a3$
                            {{Cl|EXIT}} {{Cl|DO}}
                        {{Cl|END}} {{Cl|IF}}
                        a2$ = {{Text|getelement$|#55FF55}}(ca$, i)
                        {{Cl|IF}} a2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} B = B + {{Text|1|#F580B1}}
                        {{Cl|IF}} a2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} B = B - {{Text|1|#F580B1}}
                        {{Cl|IF}} a2$ = {{Text|<nowiki>"="</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} B = {{Text|0|#F580B1}} {{Cl|THEN}}
                            {{Cl|IF}} part = {{Text|1|#F580B1}} {{Cl|THEN}} dest$ = a3$: part = {{Text|2|#F580B1}}: a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: {{Cl|GOTO}} lrsetgotpart
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} {{Cl|LEN}}(a3$) {{Cl|THEN}} a3$ = a3$ + sp + a2$ {{Cl|ELSE}} a3$ = a2$
                        lrsetgotpart:
                        i = i + {{Text|1|#F580B1}}
                    {{Cl|LOOP}}
                    {{Cl|IF}} dest$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected LSET/RSET stringvariable=string"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    {{Text|<nowiki>'check if it is a valid source string</nowiki>|#919191}}
                    f$ = {{Text|fixoperationorder$|#55FF55}}(dest$)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    l$ = l$ + sp + tlayout$ + sp + {{Text|<nowiki>"="</nowiki>|#FFB100}}
                    e$ = {{Text|evaluate|#55FF55}}(f$, sourcetyp)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"LSET/RSET expects a string variable/array-element as its first argument"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    dest$ = {{Text|evaluatetotyp|#55FF55}}(f$, ISSTRING)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    source$ = {{Text|fixoperationorder$|#55FF55}}(source$)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    l$ = l$ + sp + tlayout$
                    layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                    source$ = {{Text|evaluatetotyp|#55FF55}}(source$, ISSTRING)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    {{Cl|IF}} firstelement$ = {{Text|<nowiki>"LSET"</nowiki>|#FFB100}} {{Cl|THEN}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_lset("</nowiki>|#FFB100}} + dest$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + source$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                    {{Cl|ELSE}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_rset("</nowiki>|#FFB100}} + dest$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + source$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|GOTO}} finishedline
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'SWAP</nowiki>|#919191}}
                {{Cl|IF}} firstelement$ = {{Text|<nowiki>"SWAP"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} n < {{Text|4|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected SWAP ... , ..."</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    B = {{Text|0|#F580B1}}
                    ele = {{Text|1|#F580B1}}
                    e1$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    e2$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    {{Cl|FOR}} i = {{Text|2|#F580B1}} {{Cl|TO}} n
                        e$ = {{Text|getelement$|#55FF55}}(ca$, i)
                        {{Cl|IF}} e$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} B = B + {{Text|1|#F580B1}}
                        {{Cl|IF}} e$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} B = B - {{Text|1|#F580B1}}
                        {{Cl|IF}} e$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} B = {{Text|0|#F580B1}} {{Cl|THEN}}
                            {{Cl|IF}} ele = {{Text|2|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected SWAP ... , ..."</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                            ele = {{Text|2|#F580B1}}
                        {{Cl|ELSE}}
                            {{Cl|IF}} ele = {{Text|1|#F580B1}} {{Cl|THEN}} e1$ = e1$ + sp + e$ {{Cl|ELSE}} e2$ = e2$ + sp + e$
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|NEXT}}
                    {{Cl|IF}} e2$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected SWAP ... , ..."</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    e1$ = {{Cl|RIGHT$}}(e1$, {{Cl|LEN}}(e1$) - {{Text|1|#F580B1}}): e2$ = {{Cl|RIGHT$}}(e2$, {{Cl|LEN}}(e2$) - {{Text|1|#F580B1}})
                    e1$ = {{Text|fixoperationorder|#55FF55}}(e1$)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    e1l$ = tlayout$
                    e2$ = {{Text|fixoperationorder|#55FF55}}(e2$)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    e2l$ = tlayout$
                    e1$ = {{Text|evaluate|#55FF55}}(e1$, e1typ): e2$ = {{Text|evaluate|#55FF55}}(e2$, e2typ)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    {{Cl|IF}} (e1typ {{Cl|AND (boolean)|AND}} ISREFERENCE) = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} (e2typ {{Cl|AND (boolean)|AND}} ISREFERENCE) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected variable"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    layoutdone = {{Text|1|#F580B1}}
                    l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Swap"</nowiki>|#FFB100}}) + sp + e1l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp + e2l$
                    {{Cl|IF}} {{Cl|LEN}}(layout$) = {{Text|0|#F580B1}} {{Cl|THEN}} layout$ = l$ {{Cl|ELSE}} layout$ = layout$ + sp + l$
                    {{Text|<nowiki>'swap strings?</nowiki>|#919191}}
                    {{Cl|IF}} (e1typ {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}}
                        {{Cl|IF}} (e2typ {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Type mismatch"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                        e1$ = {{Text|refer|#55FF55}}(e1$, e1typ, {{Text|0|#F580B1}}): e2$ = {{Text|refer|#55FF55}}(e2$, e2typ, {{Text|0|#F580B1}})
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"swap_string("</nowiki>|#FFB100}} + e1$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + e2$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                        {{Cl|GOTO}} finishedline
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|<nowiki>'swap UDT?</nowiki>|#919191}}
                    {{Text|<nowiki>'note: entire UDTs, unlike thier elements cannot be swapped like standard variables</nowiki>|#919191}}
                    {{Text|<nowiki>'      as UDT sizes may vary, and to avoid a malloc operation, QB64 should allocate a buffer</nowiki>|#919191}}
                    {{Text|<nowiki>'      in global.txt for the purpose of swapping each UDT type</nowiki>|#919191}}
                    {{Cl|IF}} e1typ {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
                        a$ = e1$
                        {{Text|<nowiki>'retrieve ID</nowiki>|#919191}}
                        i = {{Cl|INSTR}}(a$, sp3)
                        {{Cl|IF}} i {{Cl|THEN}}
                            idnumber = {{Cl|VAL}}({{Cl|LEFT$}}(a$, i - {{Text|1|#F580B1}})): a$ = {{Cl|RIGHT$}}(a$, {{Cl|LEN}}(a$) - i)
                            {{Text|getid|#55FF55}} idnumber
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            u = {{Cl|VAL}}(a$)
                            i = {{Cl|INSTR}}(a$, sp3): a$ = {{Cl|RIGHT$}}(a$, {{Cl|LEN}}(a$) - i): E = {{Cl|VAL}}(a$)
                            i = {{Cl|INSTR}}(a$, sp3): o$ = {{Cl|RIGHT$}}(a$, {{Cl|LEN}}(a$) - i)
                            n$ = {{Text|<nowiki>"UDT_"</nowiki>|#FFB100}} + {{Cl|RTRIM$}}(id.n): {{Cl|IF}} id.t = {{Text|0|#F580B1}} {{Cl|THEN}} n$ = {{Text|<nowiki>"ARRAY_"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]"</nowiki>|#FFB100}}
                            {{Cl|IF}} E = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'not an element of UDT u</nowiki>|#919191}}
                                lhsscope$ = {{Text|scope$|#55FF55}}
                                e$ = e2$: t2 = e2typ
                                {{Cl|IF}} (t2 {{Cl|AND (boolean)|AND}} ISUDT) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected SWAP with similar user defined type"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                idnumber2 = {{Cl|VAL}}(e$)
                                {{Text|getid|#55FF55}} idnumber2
                                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                n2$ = {{Text|<nowiki>"UDT_"</nowiki>|#FFB100}} + {{Cl|RTRIM$}}(id.n): {{Cl|IF}} id.t = {{Text|0|#F580B1}} {{Cl|THEN}} n2$ = {{Text|<nowiki>"ARRAY_"</nowiki>|#FFB100}} + n2$ + {{Text|<nowiki>"[0]"</nowiki>|#FFB100}}
                                i = {{Cl|INSTR}}(e$, sp3): e$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - i): u2 = {{Cl|VAL}}(e$)
                                i = {{Cl|INSTR}}(e$, sp3): e$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - i): e2 = {{Cl|VAL}}(e$)
                                i = {{Cl|INSTR}}(e$, sp3): o2$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - i)
                                {{Text|<nowiki>'WARNING: u2 may need minor modifications based on e to see if they are the same</nowiki>|#919191}}
                                {{Cl|IF}} u <> u2 {{Cl|OR (boolean)|OR}} e2 <> {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected SWAP with similar user defined type"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                dst$ = {{Text|<nowiki>"(((char*)"</nowiki>|#FFB100}} + lhsscope$ + n$ + {{Text|<nowiki>")+("</nowiki>|#FFB100}} + o$ + {{Text|<nowiki>"))"</nowiki>|#FFB100}}
                                src$ = {{Text|<nowiki>"(((char*)"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + n2$ + {{Text|<nowiki>")+("</nowiki>|#FFB100}} + o2$ + {{Text|<nowiki>"))"</nowiki>|#FFB100}}
                                B = udtxsize(u) \ {{Text|8|#F580B1}}
                                siz$ = {{Text|str2$|#55FF55}}(B)
                                {{Cl|IF}} B = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"swap_8("</nowiki>|#FFB100}} + src$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + dst$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                                {{Cl|IF}} B = {{Text|2|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"swap_16("</nowiki>|#FFB100}} + src$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + dst$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                                {{Cl|IF}} B = {{Text|4|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"swap_32("</nowiki>|#FFB100}} + src$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + dst$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                                {{Cl|IF}} B = {{Text|8|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"swap_64("</nowiki>|#FFB100}} + src$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + dst$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                                {{Cl|IF}} B <> {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} B <> {{Text|2|#F580B1}} {{Cl|AND (boolean)|AND}} B <> {{Text|4|#F580B1}} {{Cl|AND (boolean)|AND}} B <> {{Text|8|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"swap_block("</nowiki>|#FFB100}} + src$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + dst$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + siz$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                                {{Cl|GOTO}} finishedline
                            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'e=0</nowiki>|#919191}}
                        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'i</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'isudt</nowiki>|#919191}}
                    {{Text|<nowiki>'cull irrelavent flags to make comparison possible</nowiki>|#919191}}
                    e1typc = e1typ
                    {{Cl|IF}} e1typc {{Cl|AND (boolean)|AND}} ISPOINTER {{Cl|THEN}} e1typc = e1typc - ISPOINTER
                    {{Cl|IF}} e1typc {{Cl|AND (boolean)|AND}} ISINCONVENTIONALMEMORY {{Cl|THEN}} e1typc = e1typc - ISINCONVENTIONALMEMORY
                    {{Cl|IF}} e1typc {{Cl|AND (boolean)|AND}} ISARRAY {{Cl|THEN}} e1typc = e1typc - ISARRAY
                    {{Cl|IF}} e1typc {{Cl|AND (boolean)|AND}} ISUNSIGNED {{Cl|THEN}} e1typc = e1typc - ISUNSIGNED
                    {{Cl|IF}} e1typc {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}} e1typc = e1typc - ISUDT
                    e2typc = e2typ
                    {{Cl|IF}} e2typc {{Cl|AND (boolean)|AND}} ISPOINTER {{Cl|THEN}} e2typc = e2typc - ISPOINTER
                    {{Cl|IF}} e2typc {{Cl|AND (boolean)|AND}} ISINCONVENTIONALMEMORY {{Cl|THEN}} e2typc = e2typc - ISINCONVENTIONALMEMORY
                    {{Cl|IF}} e2typc {{Cl|AND (boolean)|AND}} ISARRAY {{Cl|THEN}} e2typc = e2typc - ISARRAY
                    {{Cl|IF}} e2typc {{Cl|AND (boolean)|AND}} ISUNSIGNED {{Cl|THEN}} e2typc = e2typc - ISUNSIGNED
                    {{Cl|IF}} e2typc {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}} e2typc = e2typc - ISUDT
                    {{Cl|IF}} e1typc <> e2typc {{Cl|THEN}} a$ = {{Text|<nowiki>"Type mismatch"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    t = e1typ
                    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISOFFSETINBITS {{Cl|THEN}} a$ = {{Text|<nowiki>"Cannot SWAP bit-length variables"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                    B = t {{Cl|AND}} {{Text|511|#F580B1}}
                    t$ = {{Text|str2$|#55FF55}}(B): {{Cl|IF}} B > {{Text|64|#F580B1}} {{Cl|THEN}} t$ = {{Text|<nowiki>"longdouble"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"swap_"</nowiki>|#FFB100}} + t$ + {{Text|<nowiki>"(&"</nowiki>|#FFB100}} + {{Text|refer|#55FF55}}(e1$, e1typ, {{Text|0|#F580B1}}) + {{Text|<nowiki>",&"</nowiki>|#FFB100}} + {{Text|refer|#55FF55}}(e2$, e2typ, {{Text|0|#F580B1}}) + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                    {{Cl|GOTO}} finishedline
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} firstelement$ = {{Text|<nowiki>"OPTION"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} optionexplicit = {{Text|0|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>" or OPTION "</nowiki>|#FFB100}} + qb64prefix$ + {{Text|<nowiki>"EXPLICIT"</nowiki>|#FFB100}} {{Cl|ELSE}} e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    {{Cl|IF}} optionexplicitarray = {{Text|0|#F580B1}} {{Cl|THEN}} e$ = e$ + {{Text|<nowiki>" or OPTION "</nowiki>|#FFB100}} + qb64prefix$ + {{Text|<nowiki>"EXPLICITARRAY"</nowiki>|#FFB100}}
                    {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected OPTION BASE"</nowiki>|#FFB100}} + e$: {{Cl|GOTO}} errmes
                    e$ = {{Text|getelement$|#55FF55}}(a$, {{Text|2|#F580B1}})
                    {{Cl|SELECT}} {{Cl|CASE}} e$
                        {{Cl|CASE}} {{Text|<nowiki>"BASE"</nowiki>|#FFB100}}
                            l$ = {{Text|getelement$|#55FF55}}(a$, {{Text|3|#F580B1}})
                            {{Cl|IF}} l$ <> {{Text|<nowiki>"0"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} l$ <> {{Text|<nowiki>"1"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected OPTION BASE 0 or 1"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                            {{Cl|IF}} l$ = {{Text|<nowiki>"1"</nowiki>|#FFB100}} {{Cl|THEN}} optionbase = {{Text|1|#F580B1}} {{Cl|ELSE}} optionbase = {{Text|0|#F580B1}}
                            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Option"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"Base"</nowiki>|#FFB100}}) + sp + l$
                            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                            {{Cl|GOTO}} finishedline
                        {{Cl|CASE}} {{Text|<nowiki>"EXPLICIT"</nowiki>|#FFB100}}, {{Text|<nowiki>"_EXPLICIT"</nowiki>|#FFB100}}
                            {{Cl|IF}} e$ = {{Text|<nowiki>"EXPLICIT"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix$ = {{Text|<nowiki>"_"</nowiki>|#FFB100}} {{Cl|THEN}}
                                {{Cl|IF}} optionexplicit = {{Text|0|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>" or OPTION "</nowiki>|#FFB100}} + qb64prefix$ + {{Text|<nowiki>"EXPLICIT"</nowiki>|#FFB100}} {{Cl|ELSE}} e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                                {{Cl|IF}} optionexplicitarray = {{Text|0|#F580B1}} {{Cl|THEN}} e$ = e$ + {{Text|<nowiki>" or OPTION "</nowiki>|#FFB100}} + qb64prefix$ + {{Text|<nowiki>"EXPLICITARRAY"</nowiki>|#FFB100}}
                                a$ = {{Text|<nowiki>"Expected OPTION BASE"</nowiki>|#FFB100}} + e$: {{Cl|GOTO}} errmes
                            {{Cl|END}} {{Cl|IF}}
                            opex_desiredState = {{Text|-1|#F580B1}}
                            {{Cl|IF}} optionexplicit = {{Text|0|#F580B1}} {{Cl|THEN}}
                                {{Cl|IF}} opex_recompileAttempts = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    opex_recompileAttempts = opex_recompileAttempts + {{Text|1|#F580B1}}
                                    {{Cl|GOTO}} do_recompile
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Option"</nowiki>|#FFB100}}) + sp
                            {{Cl|IF}} e$ = {{Text|<nowiki>"EXPLICIT"</nowiki>|#FFB100}} {{Cl|THEN}} l$ = l$ + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Explicit"</nowiki>|#FFB100}}) {{Cl|ELSE}} l$ = l$ + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"_Explicit"</nowiki>|#FFB100}})
                            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                            {{Cl|GOTO}} finishedline
                        {{Cl|CASE}} {{Text|<nowiki>"EXPLICITARRAY"</nowiki>|#FFB100}}, {{Text|<nowiki>"_EXPLICITARRAY"</nowiki>|#FFB100}}
                            {{Cl|IF}} e$ = {{Text|<nowiki>"EXPLICITARRAY"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix$ = {{Text|<nowiki>"_"</nowiki>|#FFB100}} {{Cl|THEN}}
                                {{Cl|IF}} optionexplicit = {{Text|0|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>" or OPTION "</nowiki>|#FFB100}} + qb64prefix$ + {{Text|<nowiki>"EXPLICIT"</nowiki>|#FFB100}} {{Cl|ELSE}} e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                                {{Cl|IF}} optionexplicitarray = {{Text|0|#F580B1}} {{Cl|THEN}} e$ = e$ + {{Text|<nowiki>" or OPTION "</nowiki>|#FFB100}} + qb64prefix$ + {{Text|<nowiki>"EXPLICITARRAY"</nowiki>|#FFB100}}
                                a$ = {{Text|<nowiki>"Expected OPTION BASE"</nowiki>|#FFB100}} + e$: {{Cl|GOTO}} errmes
                            {{Cl|END}} {{Cl|IF}}
                            opexarray_desiredState = {{Text|-1|#F580B1}}
                            {{Cl|IF}} optionexplicitarray = {{Text|0|#F580B1}} {{Cl|THEN}}
                                {{Cl|IF}} opexarray_recompileAttempts = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    opexarray_recompileAttempts = opexarray_recompileAttempts + {{Text|1|#F580B1}}
                                    {{Cl|GOTO}} do_recompile
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Option"</nowiki>|#FFB100}}) + sp
                            {{Cl|IF}} e$ = {{Text|<nowiki>"EXPLICITARRAY"</nowiki>|#FFB100}} {{Cl|THEN}} l$ = l$ + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"ExplicitArray"</nowiki>|#FFB100}}) {{Cl|ELSE}} l$ = l$ + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"_ExplicitArray"</nowiki>|#FFB100}})
                            layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
                            {{Cl|GOTO}} finishedline
                        {{Cl|CASE}} {{Cl|ELSE}}
                            {{Cl|IF}} optionexplicit = {{Text|0|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>" or OPTION "</nowiki>|#FFB100}} + qb64prefix$ + {{Text|<nowiki>"EXPLICIT"</nowiki>|#FFB100}} {{Cl|ELSE}} e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                            {{Cl|IF}} optionexplicitarray = {{Text|0|#F580B1}} {{Cl|THEN}} e$ = e$ + {{Text|<nowiki>" or OPTION "</nowiki>|#FFB100}} + qb64prefix$ + {{Text|<nowiki>"EXPLICITARRAY"</nowiki>|#FFB100}}
                            a$ = {{Text|<nowiki>"Expected OPTION BASE"</nowiki>|#FFB100}} + e$: {{Cl|GOTO}} errmes
                    {{Cl|END}} {{Cl|SELECT}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'any other "unique" subs can be processed above</nowiki>|#919191}}
                id2 = id
                targetid = currentid
                {{Cl|IF}} {{Cl|RTRIM$}}(id2.callname) = {{Text|<nowiki>"sub_stub"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Command not implemented"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|IF}} n > {{Text|1|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} id2.args = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"SUB does not require any arguments"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                {{Cl|END}} {{Cl|IF}}
                {{Text|SetDependency|#55FF55}} id2.Dependency
                seperateargs_error = {{Text|0|#F580B1}}
                passedneeded = {{Text|seperateargs|#55FF55}}({{Text|getelements|#55FF55}}(a$, {{Text|2|#F580B1}}, n), {{Text|getelements|#55FF55}}(ca$, {{Text|2|#F580B1}}, n), passed&)
                {{Cl|IF}} seperateargs_error {{Cl|THEN}} a$ = seperateargs_error_message: {{Cl|GOTO}} errmes
                {{Text|<nowiki>'backup args to local string array space before calling evaluate</nowiki>|#919191}}
                {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} OptMax: separgs2(i) = {{Text|<nowiki>""</nowiki>|#FFB100}}: {{Cl|NEXT}} {{Text|<nowiki>'save space!</nowiki>|#919191}}
                {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} OptMax + {{Text|1|#F580B1}}: separgslayout2(i) = {{Text|<nowiki>""</nowiki>|#FFB100}}: {{Cl|NEXT}}
                {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} id2.args: separgs2(i) = separgs(i): {{Cl|NEXT}}
                {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} id2.args + {{Text|1|#F580B1}}: separgslayout2(i) = separgslayout(i): {{Cl|NEXT}}
                {{Cl|IF}} Debug {{Cl|THEN}}
                    {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"separgs:"</nowiki>|#FFB100}}: {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} id2.args: {{Cl|PRINT (file statement)|PRINT}} #9, i, separgs2(i): {{Cl|NEXT}}
                    {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"separgslayout:"</nowiki>|#FFB100}}: {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} id2.args + {{Text|1|#F580B1}}: {{Cl|PRINT (file statement)|PRINT}} #9, i, separgslayout2(i): {{Cl|NEXT}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'note: seperateargs finds the arguments to pass and sets passed& as necessary</nowiki>|#919191}}
                {{Text|<nowiki>'      FIXOPERTIONORDER is not called on these args yet</nowiki>|#919191}}
                {{Text|<nowiki>'      what we need it to do is build a second array of layout info at the same time</nowiki>|#919191}}
                {{Text|<nowiki>'  ref:DIM SHARED separgslayout(100) AS STRING</nowiki>|#919191}}
                {{Text|<nowiki>'  the above array stores what layout info (if any) goes BEFORE the arg in question</nowiki>|#919191}}
                {{Text|<nowiki>'      it has one extra index which is the arg after</nowiki>|#919191}}
                {{Cl|IF}} usecall {{Cl|THEN}}
                    {{Cl|IF}} id.internal_subfunc {{Cl|THEN}}
                        {{Cl|IF}} usecall = {{Text|1|#F580B1}} {{Cl|THEN}} l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Call"</nowiki>|#FFB100}}) + sp + {{Text|SCase$|#55FF55}}({{Cl|RTRIM$}}(id.cn)) + {{Cl|RTRIM$}}(id.musthave) + sp2 + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp2
                        {{Cl|IF}} usecall = {{Text|2|#F580B1}} {{Cl|THEN}} l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Call"</nowiki>|#FFB100}}) + sp + {{Text|SCase$|#55FF55}}({{Cl|RTRIM$}}(id.cn)) + {{Cl|RTRIM$}}(id.musthave) + sp {{Text|<nowiki>'sp at end for easy parsing</nowiki>|#919191}}
                    {{Cl|ELSE}}
                        {{Cl|IF}} usecall = {{Text|1|#F580B1}} {{Cl|THEN}} l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Call"</nowiki>|#FFB100}}) + sp + {{Cl|RTRIM$}}(id.cn) + {{Cl|RTRIM$}}(id.musthave) + sp2 + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp2
                        {{Cl|IF}} usecall = {{Text|2|#F580B1}} {{Cl|THEN}} l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Call"</nowiki>|#FFB100}}) + sp + {{Cl|RTRIM$}}(id.cn) + {{Cl|RTRIM$}}(id.musthave) + sp {{Text|<nowiki>'sp at end for easy parsing</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|ELSE}}
                    {{Cl|IF}} id.internal_subfunc {{Cl|THEN}}
                        l$ = {{Text|SCase$|#55FF55}}({{Cl|RTRIM$}}(id.cn)) + {{Cl|RTRIM$}}(id.musthave) + sp
                    {{Cl|ELSE}}
                        l$ = {{Cl|RTRIM$}}(id.cn) + {{Cl|RTRIM$}}(id.musthave) + sp
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                subcall$ = {{Cl|RTRIM$}}(id.callname) + {{Text|<nowiki>"("</nowiki>|#FFB100}}
                addedlayout = {{Text|0|#F580B1}}
                fieldcall = {{Text|0|#F580B1}}
                {{Text|<nowiki>'GET/PUT field exception</nowiki>|#919191}}
                {{Cl|IF}} {{Cl|RTRIM$}}(id2.callname) = {{Text|<nowiki>"sub_get"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} {{Cl|RTRIM$}}(id2.callname) = {{Text|<nowiki>"sub_put"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} passed {{Cl|AND (boolean)|AND}} {{Text|2|#F580B1}} {{Cl|THEN}}
                        {{Text|<nowiki>'regular GET/PUT call with variable provided</nowiki>|#919191}}
                        passed = passed - {{Text|2|#F580B1}} {{Text|<nowiki>'for complience with existing methods, remove 'passed' flag for the passing of a variable</nowiki>|#919191}}
                    {{Cl|ELSE}}
                        {{Text|<nowiki>'FIELD GET/PUT call with variable omited</nowiki>|#919191}}
                        {{Cl|IF}} {{Cl|RTRIM$}}(id2.callname) = {{Text|<nowiki>"sub_get"</nowiki>|#FFB100}} {{Cl|THEN}}
                            fieldcall = {{Text|1|#F580B1}}
                            subcall$ = {{Text|<nowiki>"field_get("</nowiki>|#FFB100}}
                        {{Cl|ELSE}}
                            fieldcall = {{Text|2|#F580B1}}
                            subcall$ = {{Text|<nowiki>"field_put("</nowiki>|#FFB100}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'field exception</nowiki>|#919191}}
                {{Cl|IF}} {{Cl|RTRIM$}}(id2.callname) = {{Text|<nowiki>"sub_timer"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} {{Cl|RTRIM$}}(id2.callname) = {{Text|<nowiki>"sub_key"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|<nowiki>'spacing exception</nowiki>|#919191}}
                    {{Cl|IF}} usecall = {{Text|0|#F580B1}} {{Cl|THEN}}
                        l$ = {{Cl|LEFT$}}(l$, {{Cl|LEN}}(l$) - {{Text|1|#F580B1}}) + sp2
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} id2.args
                    targettyp = {{Cl|CVL}}({{Cl|MID$ (function)|MID$}}(id2.arg, {{Text|-3|#F580B1}} + i * {{Text|4|#F580B1}}, {{Text|4|#F580B1}}))
                    nele = {{Cl|ASC (function)|ASC}}({{Cl|MID$ (function)|MID$}}(id2.nele, i, {{Text|1|#F580B1}}))
                    nelereq = {{Cl|ASC (function)|ASC}}({{Cl|MID$ (function)|MID$}}(id2.nelereq, i, {{Text|1|#F580B1}}))
                    addlayout = {{Text|1|#F580B1}} {{Text|<nowiki>'omits option values in layout (eg. BINARY="2")</nowiki>|#919191}}
                    convertspacing = {{Text|0|#F580B1}} {{Text|<nowiki>'if an 'equation' is next, it will be preceeded by a space</nowiki>|#919191}}
                    x$ = separgslayout2$(i)
                    {{Cl|DO}} {{Cl|WHILE}} {{Cl|LEN}}(x$)
                        x = {{Cl|ASC (function)|ASC}}(x$)
                        {{Cl|IF}} x {{Cl|THEN}}
                            convertspacing = {{Text|0|#F580B1}}
                            x2$ = {{Cl|MID$ (function)|MID$}}(x$, {{Text|2|#F580B1}}, x)
                            x$ = {{Cl|RIGHT$}}(x$, {{Cl|LEN}}(x$) - x - {{Text|1|#F580B1}})
                            s = {{Text|0|#F580B1}}
                            an = {{Text|0|#F580B1}}
                            x3$ = {{Cl|RIGHT$}}(l$, {{Text|1|#F580B1}})
                            {{Cl|IF}} x3$ = sp {{Cl|THEN}} s = {{Text|1|#F580B1}}
                            {{Cl|IF}} x3$ = sp2 {{Cl|THEN}}
                                s = {{Text|2|#F580B1}}
                                {{Cl|IF}} alphanumeric({{Cl|ASC (function)|ASC}}({{Cl|RIGHT$}}(l$, {{Text|2|#F580B1}}))) {{Cl|THEN}} an = {{Text|1|#F580B1}}
                            {{Cl|ELSE}}
                                {{Cl|IF}} alphanumeric({{Cl|ASC (function)|ASC}}(x3$)) {{Cl|THEN}} an = {{Text|1|#F580B1}}
                            {{Cl|END}} {{Cl|IF}}
                            s1 = s
                            {{Cl|IF}} alphanumeric({{Cl|ASC (function)|ASC}}(x2$)) {{Cl|THEN}} convertspacing = {{Text|1|#F580B1}}
                            {{Cl|IF}} x2$ = {{Text|<nowiki>"LPRINT"</nowiki>|#FFB100}} {{Cl|THEN}}
                                {{Text|<nowiki>'x2$="LPRINT"</nowiki>|#919191}}
                                {{Text|<nowiki>'x$=CHR$(0)</nowiki>|#919191}}
                                {{Text|<nowiki>'x3$=[sp] from WIDTH[sp]</nowiki>|#919191}}
                                {{Text|<nowiki>'therefore...</nowiki>|#919191}}
                                {{Text|<nowiki>'s=1</nowiki>|#919191}}
                                {{Text|<nowiki>'an=0</nowiki>|#919191}}
                                {{Text|<nowiki>'convertspacing=1</nowiki>|#919191}}
                                {{Text|<nowiki>'if debug=1 then</nowiki>|#919191}}
                                {{Text|<nowiki>'print #9,"LPRINT:"</nowiki>|#919191}}
                                {{Text|<nowiki>'print #9,s</nowiki>|#919191}}
                                {{Text|<nowiki>'print #9,an</nowiki>|#919191}}
                                {{Text|<nowiki>'print #9,l$</nowiki>|#919191}}
                                {{Text|<nowiki>'print #9,x2$</nowiki>|#919191}}
                                {{Text|<nowiki>'end if</nowiki>|#919191}}
                            {{Cl|END}} {{Cl|IF}}
                            {{Cl|IF}} (an = {{Text|1|#F580B1}} {{Cl|OR (boolean)|OR}} addedlayout = {{Text|1|#F580B1}}) {{Cl|AND (boolean)|AND}} alphanumeric({{Cl|ASC (function)|ASC}}(x2$)) <> {{Text|0|#F580B1}} {{Cl|THEN}}
                                s = {{Text|1|#F580B1}} {{Text|<nowiki>'force space</nowiki>|#919191}}
                                x2$ = x2$ + sp2
                                {{Cl|GOTO}} customlaychar
                            {{Cl|END}} {{Cl|IF}}
                            {{Cl|IF}} x2$ = {{Text|<nowiki>"="</nowiki>|#FFB100}} {{Cl|THEN}}
                                s = {{Text|1|#F580B1}}
                                x2$ = x2$ + sp
                                {{Cl|GOTO}} customlaychar
                            {{Cl|END}} {{Cl|IF}}
                            {{Cl|IF}} x2$ = {{Text|<nowiki>"#"</nowiki>|#FFB100}} {{Cl|THEN}}
                                s = {{Text|1|#F580B1}}
                                x2$ = x2$ + sp2
                                {{Cl|GOTO}} customlaychar
                            {{Cl|END}} {{Cl|IF}}
                            {{Cl|IF}} x2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}} x2$ = x2$ + sp: {{Cl|GOTO}} customlaychar
                            {{Cl|IF}} x$ = {{Cl|CHR$}}({{Text|0|#F580B1}}) {{Cl|THEN}} {{Text|<nowiki>'substitution</nowiki>|#919191}}
                                {{Cl|IF}} x2$ = {{Text|<nowiki>"STEP"</nowiki>|#FFB100}} {{Cl|THEN}} x2$ = x2$ + sp2: {{Cl|GOTO}} customlaychar
                                x2$ = x2$ + sp: {{Cl|GOTO}} customlaychar
                            {{Cl|END}} {{Cl|IF}}
                            {{Text|<nowiki>'default solution sp2+?+sp2</nowiki>|#919191}}
                            x2$ = x2$ + sp2
                            customlaychar:
                            {{Cl|IF}} s = {{Text|0|#F580B1}} {{Cl|THEN}} s = {{Text|2|#F580B1}}
                            {{Cl|IF}} s <> s1 {{Cl|THEN}}
                                {{Cl|IF}} s1 {{Cl|THEN}} l$ = {{Cl|LEFT$}}(l$, {{Cl|LEN}}(l$) - {{Text|1|#F580B1}})
                                {{Cl|IF}} s = {{Text|1|#F580B1}} {{Cl|THEN}} l$ = l$ + sp
                                {{Cl|IF}} s = {{Text|2|#F580B1}} {{Cl|THEN}} l$ = l$ + sp2
                            {{Cl|END}} {{Cl|IF}}
                            {{Cl|IF}} ({{Cl|RTRIM$}}(id2.callname) = {{Text|<nowiki>"sub_timer"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} {{Cl|RTRIM$}}(id2.callname) = {{Text|<nowiki>"sub_key"</nowiki>|#FFB100}}) {{Cl|AND (boolean)|AND}} i = id2.args {{Cl|THEN}} {{Text|<nowiki>'spacing exception</nowiki>|#919191}}
                                {{Cl|IF}} x2$ <> {{Text|<nowiki>")"</nowiki>|#FFB100}} + sp2 {{Cl|THEN}}
                                    l$ = {{Cl|LEFT$}}(l$, {{Cl|LEN}}(l$) - {{Text|1|#F580B1}}) + sp
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                            l$ = l$ + x2$
                        {{Cl|ELSE}}
                            addlayout = {{Text|0|#F580B1}}
                            x$ = {{Cl|RIGHT$}}(x$, {{Cl|LEN}}(x$) - {{Text|1|#F580B1}})
                        {{Cl|END}} {{Cl|IF}}
                        addedlayout = {{Text|0|#F580B1}}
                    {{Cl|LOOP}}
                    {{Text|<nowiki>'---better sub syntax checking begins here---</nowiki>|#919191}}
                    {{Cl|IF}} targettyp = {{Text|-3|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} separgs2(i) = {{Text|<nowiki>"N-LL"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected array name"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                        {{Text|<nowiki>'names of numeric arrays have ( ) automatically appended (nothing else)</nowiki>|#919191}}
                        e$ = separgs2(i)
                        {{Cl|IF}} {{Cl|INSTR}}(e$, sp) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'one element only</nowiki>|#919191}}
                            try_string$ = e$
                            try = {{Text|findid|#55FF55}}(try_string$)
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Cl|DO}}
                                {{Cl|IF}} try {{Cl|THEN}}
                                    {{Cl|IF}} id.arraytype {{Cl|THEN}}
                                        {{Cl|IF}} (id.arraytype {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                            e$ = e$ + sp + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                                            {{Cl|EXIT}} {{Cl|DO}}
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Text|<nowiki>'---</nowiki>|#919191}}
                                    {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(try_string$) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
                                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'if try</nowiki>|#919191}}
                                {{Cl|IF}} try = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'add symbol?</nowiki>|#919191}}
                                    {{Cl|IF}} {{Cl|LEN}}({{Text|removesymbol$|#55FF55}}(try_string$)) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                        a = {{Cl|ASC (function)|ASC}}(try_string$)
                                        {{Cl|IF}} a >= {{Text|97|#F580B1}} {{Cl|AND (boolean)|AND}} a <= {{Text|122|#F580B1}} {{Cl|THEN}} a = a - {{Text|32|#F580B1}}
                                        {{Cl|IF}} a = {{Text|95|#F580B1}} {{Cl|THEN}} a = {{Text|91|#F580B1}}
                                        a = a - {{Text|64|#F580B1}}
                                        {{Cl|IF}} {{Cl|LEN}}(defineextaz(a)) {{Cl|THEN}} try_string$ = try_string$ + defineextaz(a): try = {{Text|findid|#55FF55}}(try_string$)
                                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'try=0</nowiki>|#919191}}
                            {{Cl|LOOP}} {{Cl|UNTIL}} try = {{Text|0|#F580B1}}
                        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'one element only</nowiki>|#919191}}
                        e$ = {{Text|fixoperationorder$|#55FF55}}(e$)
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                        {{Cl|IF}} convertspacing = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} addlayout = {{Text|1|#F580B1}} {{Cl|THEN}} l$ = {{Cl|LEFT$}}(l$, {{Cl|LEN}}(l$) - {{Text|1|#F580B1}}) + sp
                        {{Cl|IF}} addlayout {{Cl|THEN}} l$ = l$ + tlayout$: addedlayout = {{Text|1|#F580B1}}
                        e$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|-2|#F580B1}})
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                        {{Cl|GOTO}} sete
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'-3</nowiki>|#919191}}
                    {{Cl|IF}} targettyp = {{Text|-2|#F580B1}} {{Cl|THEN}}
                        e$ = {{Text|fixoperationorder$|#55FF55}}(e$)
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                        {{Cl|IF}} convertspacing = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} addlayout = {{Text|1|#F580B1}} {{Cl|THEN}} l$ = {{Cl|LEFT$}}(l$, {{Cl|LEN}}(l$) - {{Text|1|#F580B1}}) + sp
                        {{Cl|IF}} addlayout {{Cl|THEN}} l$ = l$ + tlayout$: addedlayout = {{Text|1|#F580B1}}
                        e$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|-2|#F580B1}})
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                        {{Cl|GOTO}} sete
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'-2</nowiki>|#919191}}
                    {{Cl|IF}} targettyp = {{Text|-4|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} fieldcall {{Cl|THEN}}
                            i = id2.args + {{Text|1|#F580B1}}
                            {{Cl|EXIT}} {{Cl|FOR}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} separgs2(i) = {{Text|<nowiki>"N-LL"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected variable name/array element"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                        e$ = {{Text|fixoperationorder$|#55FF55}}(separgs2(i))
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                        {{Cl|IF}} convertspacing = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} addlayout = {{Text|1|#F580B1}} {{Cl|THEN}} l$ = {{Cl|LEFT$}}(l$, {{Cl|LEN}}(l$) - {{Text|1|#F580B1}}) + sp
                        {{Cl|IF}} addlayout {{Cl|THEN}} l$ = l$ + tlayout$: addedlayout = {{Text|1|#F580B1}}
                        {{Text|<nowiki>'GET/PUT RANDOM-ACCESS override</nowiki>|#919191}}
                        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"GET"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} firstelement$ = {{Text|<nowiki>"PUT"</nowiki>|#FFB100}} {{Cl|THEN}}
                            e2$ = e$ {{Text|<nowiki>'backup</nowiki>|#919191}}
                            e$ = {{Text|evaluate|#55FF55}}(e$, sourcetyp)
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}}
                                {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Text|<nowiki>'replace name of sub to call</nowiki>|#919191}}
                                    subcall$ = {{Cl|RIGHT$}}(subcall$, {{Cl|LEN}}(subcall$) - {{Text|7|#F580B1}}) {{Text|<nowiki>'delete original name</nowiki>|#919191}}
                                    {{Text|<nowiki>'note: GET2 & PUT2 take differing input, following code is correct</nowiki>|#919191}}
                                    {{Cl|IF}} firstelement$ = {{Text|<nowiki>"GET"</nowiki>|#FFB100}} {{Cl|THEN}}
                                        subcall$ = {{Text|<nowiki>"sub_get2"</nowiki>|#FFB100}} + subcall$
                                        e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}}) {{Text|<nowiki>'pass a qbs pointer instead</nowiki>|#919191}}
                                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                        {{Cl|GOTO}} sete
                                    {{Cl|ELSE}}
                                        subcall$ = {{Text|<nowiki>"sub_put2"</nowiki>|#FFB100}} + subcall$
                                        {{Text|<nowiki>'no goto sete required, fall through</nowiki>|#919191}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                            e$ = e2$ {{Text|<nowiki>'restore</nowiki>|#919191}}
                        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'override</nowiki>|#919191}}
                        e$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|-4|#F580B1}})
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                        {{Cl|GOTO}} sete
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'-4</nowiki>|#919191}}
                    {{Cl|IF}} separgs2(i) = {{Text|<nowiki>"N-LL"</nowiki>|#FFB100}} {{Cl|THEN}}
                        e$ = {{Text|<nowiki>"NULL"</nowiki>|#FFB100}}
                    {{Cl|ELSE}}
                        e2$ = {{Text|fixoperationorder$|#55FF55}}(separgs2(i))
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                        {{Cl|IF}} convertspacing = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} addlayout = {{Text|1|#F580B1}} {{Cl|THEN}} l$ = {{Cl|LEFT$}}(l$, {{Cl|LEN}}(l$) - {{Text|1|#F580B1}}) + sp
                        {{Cl|IF}} addlayout {{Cl|THEN}} l$ = l$ + tlayout$: addedlayout = {{Text|1|#F580B1}}
                        e$ = {{Text|evaluate|#55FF55}}(e2$, sourcetyp)
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                        {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISOFFSET {{Cl|THEN}}
                            {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} ISOFFSET) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                {{Cl|IF}} id2.internal_subfunc = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Cannot convert _OFFSET type to other types"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} {{Cl|RTRIM$}}(id2.callname) = {{Text|<nowiki>"sub_paint"</nowiki>|#FFB100}} {{Cl|THEN}}
                            {{Cl|IF}} i = {{Text|3|#F580B1}} {{Cl|THEN}}
                                {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}}
                                    targettyp = ISSTRING
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} {{Cl|LEFT$}}(separgs2(i), {{Text|2|#F580B1}}) = {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp {{Cl|THEN}} dereference = {{Text|1|#F580B1}} {{Cl|ELSE}} dereference = {{Text|0|#F580B1}}
                        {{Text|<nowiki>'pass by reference</nowiki>|#919191}}
                        {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} ISPOINTER) {{Cl|THEN}}
                            {{Cl|IF}} dereference = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'check deferencing wasn't used</nowiki>|#919191}}
                                {{Text|<nowiki>'note: array pointer</nowiki>|#919191}}
                                {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} ISARRAY) {{Cl|THEN}}
                                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected arrayname()"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISARRAY) = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected arrayname()"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                    {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"sub:array reference:["</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"]"</nowiki>|#FFB100}}
                                    {{Text|<nowiki>'check arrays are of same type</nowiki>|#919191}}
                                    targettyp2 = targettyp: sourcetyp2 = sourcetyp
                                    targettyp2 = targettyp2 {{Cl|AND}} ({{Text|511|#F580B1}} + ISOFFSETINBITS + ISUDT + ISSTRING + ISFIXEDLENGTH + ISFLOAT)
                                    sourcetyp2 = sourcetyp2 {{Cl|AND}} ({{Text|511|#F580B1}} + ISOFFSETINBITS + ISUDT + ISSTRING + ISFIXEDLENGTH + ISFLOAT)
                                    {{Cl|IF}} sourcetyp2 <> targettyp2 {{Cl|THEN}} a$ = {{Text|<nowiki>"Incorrect array type passed to sub"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                    {{Text|<nowiki>'check arrayname was followed by '()'</nowiki>|#919191}}
                                    {{Cl|IF}} targettyp {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
                                        {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"sub:array reference:udt reference:["</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"]"</nowiki>|#FFB100}}
                                        {{Text|<nowiki>'get UDT info</nowiki>|#919191}}
                                        udtrefid = {{Cl|VAL}}(e$)
                                        {{Text|getid|#55FF55}} udtrefid
                                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                        udtrefi = {{Cl|INSTR}}(e$, sp3) {{Text|<nowiki>'end of id</nowiki>|#919191}}
                                        udtrefi2 = {{Cl|INSTR}}(udtrefi + {{Text|1|#F580B1}}, e$, sp3) {{Text|<nowiki>'end of u</nowiki>|#919191}}
                                        udtrefu = {{Cl|VAL}}({{Cl|MID$ (function)|MID$}}(e$, udtrefi + {{Text|1|#F580B1}}, udtrefi2 - udtrefi - {{Text|1|#F580B1}}))
                                        udtrefi3 = {{Cl|INSTR}}(udtrefi2 + {{Text|1|#F580B1}}, e$, sp3) {{Text|<nowiki>'skip e</nowiki>|#919191}}
                                        udtrefe = {{Cl|VAL}}({{Cl|MID$ (function)|MID$}}(e$, udtrefi2 + {{Text|1|#F580B1}}, udtrefi3 - udtrefi2 - {{Text|1|#F580B1}}))
                                        o$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - udtrefi3)
                                        {{Text|<nowiki>'note: most of the UDT info above is not required</nowiki>|#919191}}
                                        {{Cl|IF}} {{Cl|LEFT$}}(o$, {{Text|4|#F580B1}}) <> {{Text|<nowiki>"(0)*"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected arrayname()"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                    {{Cl|ELSE}}
                                        {{Cl|IF}} {{Cl|RIGHT$}}(e$, {{Text|2|#F580B1}}) <> sp3 + {{Text|<nowiki>"0"</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected arrayname()"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                    {{Cl|END}} {{Cl|IF}}
                                    idnum = {{Cl|VAL}}({{Cl|LEFT$}}(e$, {{Cl|INSTR}}(e$, sp3) - {{Text|1|#F580B1}}))
                                    {{Text|getid|#55FF55}} idnum
                                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                    {{Cl|IF}} targettyp {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH {{Cl|THEN}}
                                        targettypsize = {{Cl|CVL}}({{Cl|MID$ (function)|MID$}}(id2.argsize, i * {{Text|4|#F580B1}} - {{Text|4|#F580B1}} + {{Text|1|#F580B1}}, {{Text|4|#F580B1}}))
                                        {{Cl|IF}} id.tsize <> targettypsize {{Cl|THEN}} a$ = {{Text|<nowiki>"Incorrect array type passed to sub"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(sfcmemargs(targetid), i, {{Text|1|#F580B1}}) = {{Cl|CHR$}}({{Text|1|#F580B1}}) {{Cl|THEN}} {{Text|<nowiki>'cmem required?</nowiki>|#919191}}
                                        {{Cl|IF}} cmemlist(idnum) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                            cmemlist(idnum) = {{Text|1|#F580B1}}
                                            recompile = {{Text|1|#F580B1}}
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Cl|IF}} id.linkid = {{Text|0|#F580B1}} {{Cl|THEN}}
                                        {{Text|<nowiki>'if id.linkid is 0, it means the number of array elements is definietly</nowiki>|#919191}}
                                        {{Text|<nowiki>'known of the array being passed, this is not some "fake"/unknown array.</nowiki>|#919191}}
                                        {{Text|<nowiki>'using the numer of array elements of a fake array would be dangerous!</nowiki>|#919191}}
                                        {{Cl|IF}} nelereq = {{Text|0|#F580B1}} {{Cl|THEN}}
                                            {{Text|<nowiki>'only continue if the number of array elements required is unknown</nowiki>|#919191}}
                                            {{Text|<nowiki>'and it needs to be set</nowiki>|#919191}}
                                            {{Cl|IF}} id.arrayelements > {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'2009</nowiki>|#919191}}
                                                nelereq = id.arrayelements
                                                {{Cl|MID$}}(id2.nelereq, i, {{Text|1|#F580B1}}) = {{Cl|CHR$}}(nelereq)
                                            {{Cl|END}} {{Cl|IF}}
                                            {{Text|<nowiki>'print rtrim$(id2.n)+">nelereq=";nelereq</nowiki>|#919191}}
                                            ids(targetid) = id2
                                        {{Cl|ELSE}}
                                            {{Text|<nowiki>'the number of array elements required is known AND</nowiki>|#919191}}
                                            {{Text|<nowiki>'the number of elements in the array to be passed is known</nowiki>|#919191}}
                                            {{Cl|IF}} id.arrayelements <> nelereq {{Cl|THEN}} a$ = {{Text|<nowiki>"Passing arrays with a differing number of elements to a SUB/FUNCTION is not supported"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                    e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|1|#F580B1}})
                                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                    {{Cl|GOTO}} sete
                                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'target is an array</nowiki>|#919191}}
                                {{Text|<nowiki>'note: not an array...</nowiki>|#919191}}
                                {{Text|<nowiki>'target is not an array</nowiki>|#919191}}
                                {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}}
                                        idnum = {{Cl|VAL}}({{Cl|LEFT$}}(e$, {{Cl|INSTR}}(e$, sp3) - {{Text|1|#F580B1}})) {{Text|<nowiki>'id# of sourcetyp</nowiki>|#919191}}
                                        targettyp2 = targettyp: sourcetyp2 = sourcetyp
                                        {{Text|<nowiki>'get info about source/target</nowiki>|#919191}}
                                        arr = {{Text|0|#F580B1}}: {{Cl|IF}} (sourcetyp2 {{Cl|AND (boolean)|AND}} ISARRAY) {{Cl|THEN}} arr = {{Text|1|#F580B1}}
                                        passudtelement = {{Text|0|#F580B1}}: {{Cl|IF}} (targettyp2 {{Cl|AND (boolean)|AND}} ISUDT) = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} (sourcetyp2 {{Cl|AND (boolean)|AND}} ISUDT) <> {{Text|0|#F580B1}} {{Cl|THEN}} passudtelement = {{Text|1|#F580B1}}: sourcetyp2 = sourcetyp2 - ISUDT
                                        {{Text|<nowiki>'remove flags irrelevant for comparison... ISPOINTER,ISREFERENCE,ISINCONVENTIONALMEMORY,ISARRAY</nowiki>|#919191}}
                                        targettyp2 = targettyp2 {{Cl|AND}} ({{Text|511|#F580B1}} + ISOFFSETINBITS + ISUDT + ISFLOAT + ISSTRING)
                                        sourcetyp2 = sourcetyp2 {{Cl|AND}} ({{Text|511|#F580B1}} + ISOFFSETINBITS + ISUDT + ISFLOAT + ISSTRING)
                                        {{Text|<nowiki>'compare types</nowiki>|#919191}}
                                        {{Cl|IF}} sourcetyp2 = targettyp2 {{Cl|THEN}}
                                            {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
                                                {{Text|<nowiki>'udt/udt array</nowiki>|#919191}}
                                                {{Text|<nowiki>'get info</nowiki>|#919191}}
                                                udtrefid = {{Cl|VAL}}(e$)
                                                {{Text|getid|#55FF55}} udtrefid
                                                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                                udtrefi = {{Cl|INSTR}}(e$, sp3) {{Text|<nowiki>'end of id</nowiki>|#919191}}
                                                udtrefi2 = {{Cl|INSTR}}(udtrefi + {{Text|1|#F580B1}}, e$, sp3) {{Text|<nowiki>'end of u</nowiki>|#919191}}
                                                udtrefu = {{Cl|VAL}}({{Cl|MID$ (function)|MID$}}(e$, udtrefi + {{Text|1|#F580B1}}, udtrefi2 - udtrefi - {{Text|1|#F580B1}}))
                                                udtrefi3 = {{Cl|INSTR}}(udtrefi2 + {{Text|1|#F580B1}}, e$, sp3) {{Text|<nowiki>'skip e</nowiki>|#919191}}
                                                udtrefe = {{Cl|VAL}}({{Cl|MID$ (function)|MID$}}(e$, udtrefi2 + {{Text|1|#F580B1}}, udtrefi3 - udtrefi2 - {{Text|1|#F580B1}}))
                                                o$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - udtrefi3)
                                                {{Text|<nowiki>'note: most of the UDT info above is not required</nowiki>|#919191}}
                                                {{Cl|IF}} arr {{Cl|THEN}}
                                                    n$ = {{Text|scope$|#55FF55}} + {{Text|<nowiki>"ARRAY_UDT_"</nowiki>|#FFB100}} + {{Cl|RTRIM$}}(id.n) + {{Text|<nowiki>"[0]"</nowiki>|#FFB100}}
                                                {{Cl|ELSE}}
                                                    n$ = {{Text|scope$|#55FF55}} + {{Text|<nowiki>"UDT_"</nowiki>|#FFB100}} + {{Cl|RTRIM$}}(id.n)
                                                {{Cl|END}} {{Cl|IF}}
                                                e$ = {{Text|<nowiki>"(void*)( ((char*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")) + ("</nowiki>|#FFB100}} + o$ + {{Text|<nowiki>") )"</nowiki>|#FFB100}}
                                                {{Text|<nowiki>'convert void* to target type*</nowiki>|#919191}}
                                                {{Cl|IF}} passudtelement {{Cl|THEN}} e$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} + {{Text|typ2ctyp$|#55FF55}}(targettyp2 + (targettyp {{Cl|AND}} ISUNSIGNED), {{Text|<nowiki>""</nowiki>|#FFB100}}) + {{Text|<nowiki>"*)"</nowiki>|#FFB100}} + e$
                                                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                            {{Cl|ELSE}}
                                                {{Text|<nowiki>'not a udt</nowiki>|#919191}}
                                                {{Cl|IF}} arr {{Cl|THEN}}
                                                    {{Cl|IF}} (sourcetyp2 {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) {{Cl|THEN}} a$ = {{Text|<nowiki>"Cannot pass BIT array offsets"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                                    e$ = {{Text|<nowiki>"(&("</nowiki>|#FFB100}} + {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}}) + {{Text|<nowiki>"))"</nowiki>|#FFB100}}
                                                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                                {{Cl|ELSE}}
                                                    e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|1|#F580B1}})
                                                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                                {{Cl|END}} {{Cl|IF}}
                                                {{Text|<nowiki>'note: signed/unsigned mismatch requires casting</nowiki>|#919191}}
                                                {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISUNSIGNED) <> (targettyp {{Cl|AND (boolean)|AND}} ISUNSIGNED) {{Cl|THEN}}
                                                    e$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} + {{Text|typ2ctyp$|#55FF55}}(targettyp2 + (targettyp {{Cl|AND}} ISUNSIGNED), {{Text|<nowiki>""</nowiki>|#FFB100}}) + {{Text|<nowiki>"*)"</nowiki>|#FFB100}} + e$
                                                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                                                {{Cl|END}} {{Cl|IF}}
                                            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'udt?</nowiki>|#919191}}
                                            {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(sfcmemargs(targetid), i, {{Text|1|#F580B1}}) = {{Cl|CHR$}}({{Text|1|#F580B1}}) {{Cl|THEN}} {{Text|<nowiki>'cmem required?</nowiki>|#919191}}
                                                {{Cl|IF}} cmemlist(idnum) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                                    cmemlist(idnum) = {{Text|1|#F580B1}}
                                                    recompile = {{Text|1|#F580B1}}
                                                {{Cl|END}} {{Cl|IF}}
                                            {{Cl|END}} {{Cl|IF}}
                                            {{Cl|GOTO}} sete
                                        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'similar</nowiki>|#919191}}
                                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'reference</nowiki>|#919191}}
                                {{Cl|ELSE}} {{Text|<nowiki>'not a string</nowiki>|#919191}}
                                    {{Text|<nowiki>'its a string</nowiki>|#919191}}
                                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}}
                                        idnum = {{Cl|VAL}}({{Cl|LEFT$}}(e$, {{Cl|INSTR}}(e$, sp3) - {{Text|1|#F580B1}})) {{Text|<nowiki>'id# of sourcetyp</nowiki>|#919191}}
                                        {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(sfcmemargs(targetid), i, {{Text|1|#F580B1}}) = {{Cl|CHR$}}({{Text|1|#F580B1}}) {{Cl|THEN}} {{Text|<nowiki>'cmem required?</nowiki>|#919191}}
                                            {{Cl|IF}} cmemlist(idnum) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                                cmemlist(idnum) = {{Text|1|#F580B1}}
                                                recompile = {{Text|1|#F580B1}}
                                            {{Cl|END}} {{Cl|IF}}
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'reference</nowiki>|#919191}}
                                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'its a string</nowiki>|#919191}}
                            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'dereference check</nowiki>|#919191}}
                        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'target is a pointer</nowiki>|#919191}}
                        {{Text|<nowiki>'note: Target is not a pointer...</nowiki>|#919191}}
                        {{Text|<nowiki>'String-numeric mismatch?</nowiki>|#919191}}
                        {{Cl|IF}} targettyp {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                            {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                nth = i
                                {{Cl|IF}} ids(targetid).args = {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"String required for sub"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                a$ = {{Text|str_nth$|#55FF55}}(nth) + {{Text|<nowiki>" sub argument requires a string"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}} {{Cl|THEN}}
                            {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                                nth = i
                                {{Cl|IF}} ids(targetid).args = {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Number required for sub"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                a$ = {{Text|str_nth$|#55FF55}}(nth) + {{Text|<nowiki>" sub argument requires a number"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Text|<nowiki>'change to "non-pointer" value</nowiki>|#919191}}
                        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}}
                            e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} explicitreference = {{Text|0|#F580B1}} {{Cl|THEN}}
                            {{Cl|IF}} targettyp {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
                                nth = i
                                {{Cl|IF}} qb64prefix_set {{Cl|AND (boolean)|AND}} udtxcname(targettyp {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|<nowiki>"_MEM"</nowiki>|#FFB100}} {{Cl|THEN}}
                                    x$ = {{Text|<nowiki>"'"</nowiki>|#FFB100}} + {{Cl|MID$ (function)|MID$}}({{Cl|RTRIM$}}(udtxcname(targettyp {{Cl|AND}} {{Text|511|#F580B1}})), {{Text|2|#F580B1}}) + {{Text|<nowiki>"'"</nowiki>|#FFB100}}
                                {{Cl|ELSE}}
                                    x$ = {{Text|<nowiki>"'"</nowiki>|#FFB100}} + {{Cl|RTRIM$}}(udtxcname(targettyp {{Cl|AND}} {{Text|511|#F580B1}})) + {{Text|<nowiki>"'"</nowiki>|#FFB100}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Cl|IF}} ids(targetid).args = {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"TYPE "</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>" required for sub"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                                a$ = {{Text|str_nth$|#55FF55}}(nth) + {{Text|<nowiki>" sub argument requires TYPE "</nowiki>|#FFB100}} + x$: {{Cl|GOTO}} errmes
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|ELSE}}
                            {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}} a$ = {{Text|<nowiki>"Number required for sub"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
                        {{Cl|END}} {{Cl|IF}}
                        {{Text|<nowiki>'round to integer if required</nowiki>|#919191}}
                        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}}
                            {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} ISFLOAT) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                {{Text|<nowiki>'**32 rounding fix</nowiki>|#919191}}
                                bits = targettyp {{Cl|AND}} {{Text|511|#F580B1}}
                                {{Cl|IF}} bits <= {{Text|16|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"qbr_float_to_long("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                                {{Cl|IF}} bits > {{Text|16|#F580B1}} {{Cl|AND (boolean)|AND}} bits < {{Text|32|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"qbr_double_to_long("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                                {{Cl|IF}} bits >= {{Text|32|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"qbr("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} ISPOINTER) {{Cl|THEN}} {{Text|<nowiki>'pointer required</nowiki>|#919191}}
                            {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} {{Cl|GOTO}} sete {{Text|<nowiki>'no changes required</nowiki>|#919191}}
                            t$ = {{Text|typ2ctyp$|#55FF55}}(targettyp, {{Text|<nowiki>""</nowiki>|#FFB100}})
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                            v$ = {{Text|<nowiki>"pass"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}({{Text|uniquenumber|#55FF55}})
                            {{Text|<nowiki>'assume numeric type</nowiki>|#919191}}
                            {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(sfcmemargs(targetid), i, {{Text|1|#F580B1}}) = {{Cl|CHR$}}({{Text|1|#F580B1}}) {{Cl|THEN}} {{Text|<nowiki>'cmem required?</nowiki>|#919191}}
                                bytesreq = ((targettyp {{Cl|AND}} {{Text|511|#F580B1}}) + {{Text|7|#F580B1}}) \ {{Text|8|#F580B1}}
                                {{Text|WriteBufLine|#55FF55}} defdatahandle, t$ + {{Text|<nowiki>" *"</nowiki>|#FFB100}} + v$ + {{Text|<nowiki>"=NULL;"</nowiki>|#FFB100}}
                                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if("</nowiki>|#FFB100}} + v$ + {{Text|<nowiki>"==NULL){"</nowiki>|#FFB100}}
                                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"cmem_sp-="</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bytesreq) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, v$ + {{Text|<nowiki>"=("</nowiki>|#FFB100}} + t$ + {{Text|<nowiki>"*)(dblock+cmem_sp);"</nowiki>|#FFB100}}
                                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if (cmem_sp<qbs_cmem_sp) error(257);"</nowiki>|#FFB100}}
                                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                                e$ = {{Text|<nowiki>"&(*"</nowiki>|#FFB100}} + v$ + {{Text|<nowiki>"="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                            {{Cl|ELSE}}
                                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, t$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} + v$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                                e$ = {{Text|<nowiki>"&("</nowiki>|#FFB100}} + v$ + {{Text|<nowiki>"="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                            {{Cl|END}} {{Cl|IF}}
                            {{Cl|GOTO}} sete
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'not "NULL"</nowiki>|#919191}}
                    sete:
                    {{Cl|IF}} {{Cl|RTRIM$}}(id2.callname) = {{Text|<nowiki>"sub_paint"</nowiki>|#FFB100}} {{Cl|THEN}}
                        {{Cl|IF}} i = {{Text|3|#F580B1}} {{Cl|THEN}}
                            {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}}
                                e$ = {{Text|<nowiki>"(qbs*)"</nowiki>|#FFB100}} + e$
                            {{Cl|ELSE}}
                                e$ = {{Text|<nowiki>"(uint32)"</nowiki>|#FFB100}} + e$
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} id2.ccall {{Cl|THEN}}
                        {{Text|<nowiki>'if a forced cast from a returned ccall function is in e$, remove it</nowiki>|#919191}}
                        {{Cl|IF}} {{Cl|LEFT$}}(e$, {{Text|3|#F580B1}}) = {{Text|<nowiki>"(  "</nowiki>|#FFB100}} {{Cl|THEN}}
                            e$ = {{Text|removecast$|#55FF55}}(e$)
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} targettyp {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                            e$ = {{Text|<nowiki>"(char*)("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")->chr"</nowiki>|#FFB100}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} {{Cl|LTRIM$}}({{Cl|RTRIM$}}(e$)) = {{Text|<nowiki>"0"</nowiki>|#FFB100}} {{Cl|THEN}} e$ = {{Text|<nowiki>"NULL"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} i <> {{Text|1|#F580B1}} {{Cl|THEN}} subcall$ = subcall$ + {{Text|<nowiki>","</nowiki>|#FFB100}}
                    subcall$ = subcall$ + e$
                {{Cl|NEXT}}
                {{Text|<nowiki>'note: i=id.args+1</nowiki>|#919191}}
                x$ = separgslayout2$(i)
                {{Cl|DO}} {{Cl|WHILE}} {{Cl|LEN}}(x$)
                    x = {{Cl|ASC (function)|ASC}}(x$)
                    {{Cl|IF}} x {{Cl|THEN}}
                        x2$ = {{Cl|MID$ (function)|MID$}}(x$, {{Text|2|#F580B1}}, x)
                        x$ = {{Cl|RIGHT$}}(x$, {{Cl|LEN}}(x$) - x - {{Text|1|#F580B1}})
                        s = {{Text|0|#F580B1}}
                        an = {{Text|0|#F580B1}}
                        x3$ = {{Cl|RIGHT$}}(l$, {{Text|1|#F580B1}})
                        {{Cl|IF}} x3$ = sp {{Cl|THEN}} s = {{Text|1|#F580B1}}
                        {{Cl|IF}} x3$ = sp2 {{Cl|THEN}}
                            s = {{Text|2|#F580B1}}
                            {{Cl|IF}} alphanumeric({{Cl|ASC (function)|ASC}}({{Cl|RIGHT$}}(l$, {{Text|2|#F580B1}}))) {{Cl|THEN}} an = {{Text|1|#F580B1}}
                            {{Text|<nowiki>'if asc(right$(l$,2))=34 then an=1</nowiki>|#919191}}
                        {{Cl|ELSE}}
                            {{Cl|IF}} alphanumeric({{Cl|ASC (function)|ASC}}(x3$)) {{Cl|THEN}} an = {{Text|1|#F580B1}}
                            {{Text|<nowiki>'if asc(x3$)=34 then an=1</nowiki>|#919191}}
                        {{Cl|END}} {{Cl|IF}}
                        s1 = s
                        {{Cl|IF}} (an = {{Text|1|#F580B1}} {{Cl|OR (boolean)|OR}} addedlayout = {{Text|1|#F580B1}}) {{Cl|AND (boolean)|AND}} alphanumeric({{Cl|ASC (function)|ASC}}(x2$)) <> {{Text|0|#F580B1}} {{Cl|THEN}}
                            s = {{Text|1|#F580B1}} {{Text|<nowiki>'force space</nowiki>|#919191}}
                            x2$ = x2$ + sp2
                            {{Cl|GOTO}} customlaychar2
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} x2$ = {{Text|<nowiki>"="</nowiki>|#FFB100}} {{Cl|THEN}}
                            s = {{Text|1|#F580B1}}
                            x2$ = x2$ + sp
                            {{Cl|GOTO}} customlaychar2
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} x2$ = {{Text|<nowiki>"#"</nowiki>|#FFB100}} {{Cl|THEN}}
                            s = {{Text|1|#F580B1}}
                            x2$ = x2$ + sp2
                            {{Cl|GOTO}} customlaychar2
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} x2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}} x2$ = x2$ + sp: {{Cl|GOTO}} customlaychar2
                        {{Cl|IF}} x$ = {{Cl|CHR$}}({{Text|0|#F580B1}}) {{Cl|THEN}} {{Text|<nowiki>'substitution</nowiki>|#919191}}
                            {{Cl|IF}} x2$ = {{Text|<nowiki>"STEP"</nowiki>|#FFB100}} {{Cl|THEN}} x2$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Step"</nowiki>|#FFB100}}) + sp2: {{Cl|GOTO}} customlaychar2
                            x2$ = x2$ + sp: {{Cl|GOTO}} customlaychar2
                        {{Cl|END}} {{Cl|IF}}
                        {{Text|<nowiki>'default solution sp2+?+sp2</nowiki>|#919191}}
                        x2$ = x2$ + sp2
                        customlaychar2:
                        {{Cl|IF}} s = {{Text|0|#F580B1}} {{Cl|THEN}} s = {{Text|2|#F580B1}}
                        {{Cl|IF}} s <> s1 {{Cl|THEN}}
                            {{Cl|IF}} s1 {{Cl|THEN}} l$ = {{Cl|LEFT$}}(l$, {{Cl|LEN}}(l$) - {{Text|1|#F580B1}})
                            {{Cl|IF}} s = {{Text|1|#F580B1}} {{Cl|THEN}} l$ = l$ + sp
                            {{Cl|IF}} s = {{Text|2|#F580B1}} {{Cl|THEN}} l$ = l$ + sp2
                        {{Cl|END}} {{Cl|IF}}
                        l$ = l$ + x2$
                    {{Cl|ELSE}}
                        addlayout = {{Text|0|#F580B1}}
                        x$ = {{Cl|RIGHT$}}(x$, {{Cl|LEN}}(x$) - {{Text|1|#F580B1}})
                    {{Cl|END}} {{Cl|IF}}
                    addedlayout = {{Text|0|#F580B1}}
                {{Cl|LOOP}}
                {{Cl|IF}} passedneeded {{Cl|THEN}}
                    subcall$ = subcall$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(passed&)
                {{Cl|END}} {{Cl|IF}}
                subcall$ = subcall$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                {{Cl|IF}} firstelement$ = {{Text|<nowiki>"SLEEP"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} vWatchOn = {{Text|1|#F580B1}} {{Cl|THEN}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*__LONG_VWATCH_LINENUMBER= -4; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, subcall$
                {{Cl|IF}} firstelement$ = {{Text|<nowiki>"SLEEP"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} vWatchOn = {{Text|1|#F580B1}} {{Cl|THEN}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*__LONG_VWATCH_LINENUMBER= -5; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                subcall$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                {{Cl|IF}} stringprocessinghappened {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, cleanupstringprocessingcall$ + {{Text|<nowiki>"0);"</nowiki>|#FFB100}}
                layoutdone = {{Text|1|#F580B1}}
                x$ = {{Cl|RIGHT$}}(l$, {{Text|1|#F580B1}}): {{Cl|IF}} x$ = sp {{Cl|OR (boolean)|OR}} x$ = sp2 {{Cl|THEN}} l$ = {{Cl|LEFT$}}(l$, {{Cl|LEN}}(l$) - {{Text|1|#F580B1}})
                {{Cl|IF}} usecall = {{Text|1|#F580B1}} {{Cl|THEN}} l$ = l$ + sp2 + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"SUB layout:["</nowiki>|#FFB100}} + l$ + {{Text|<nowiki>"]"</nowiki>|#FFB100}}
                {{Cl|IF}} {{Cl|LEN}}(layout$) = {{Text|0|#F580B1}} {{Cl|THEN}} layout$ = l$ {{Cl|ELSE}} layout$ = layout$ + sp + l$
                {{Cl|GOTO}} finishedline
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}}
                findidsecondarg = {{Text|<nowiki>""</nowiki>|#FFB100}}: {{Cl|IF}} n >= {{Text|2|#F580B1}} {{Cl|THEN}} findidsecondarg = {{Text|getelement$|#55FF55}}(a$, {{Text|2|#F580B1}})
                findanotherid = {{Text|1|#F580B1}}
                try = {{Text|findid|#55FF55}}(firstelement$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Cl|ELSE}}
                try = {{Text|0|#F580B1}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|LOOP}}
    {{Cl|END}} {{Cl|IF}}
    notsubcall:
    {{Cl|IF}} n >= {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} firstelement$ = {{Text|<nowiki>"LET"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Syntax error - Reference: LET variable = expression (tip: LET is entirely optional)"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            ca$ = {{Cl|RIGHT$}}(ca$, {{Cl|LEN}}(ca$) - {{Text|4|#F580B1}})
            n = n - {{Text|1|#F580B1}}
            l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Let"</nowiki>|#FFB100}})
            {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
            {{Text|<nowiki>'note: layoutdone=1 will be set later</nowiki>|#919191}}
            {{Cl|GOTO}} letused
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'LET ???=???</nowiki>|#919191}}
    {{Cl|IF}} n >= {{Text|3|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} {{Cl|INSTR}}(a$, sp + {{Text|<nowiki>"="</nowiki>|#FFB100}} + sp) {{Cl|THEN}}
            letused:
            {{Text|assign|#55FF55}} ca$, n
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            layoutdone = {{Text|1|#F580B1}}
            {{Cl|IF}} {{Cl|LEN}}(layout$) = {{Text|0|#F580B1}} {{Cl|THEN}} layout$ = tlayout$ {{Cl|ELSE}} layout$ = layout$ + sp + tlayout$
            {{Cl|GOTO}} finishedline
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'>=3</nowiki>|#919191}}
    {{Cl|IF}} {{Cl|RIGHT$}}(a$, {{Text|2|#F580B1}}) = sp + {{Text|<nowiki>"="</nowiki>|#FFB100}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Expected ... = expression"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
    {{Text|<nowiki>'Syntax error</nowiki>|#919191}}
    a$ = {{Text|<nowiki>"Syntax error"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
    finishedline:
    THENGOTO = {{Text|0|#F580B1}}
    finishedline2:
    {{Cl|IF}} inputfunctioncalled {{Cl|THEN}}
        inputfunctioncalled = {{Text|0|#F580B1}}
        {{Cl|IF}} vWatchOn = {{Text|1|#F580B1}} {{Cl|THEN}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*__LONG_VWATCH_LINENUMBER= -5; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} arrayprocessinghappened = {{Text|1|#F580B1}} {{Cl|THEN}} arrayprocessinghappened = {{Text|0|#F580B1}}
    inclinenump$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
    {{Cl|IF}} inclinenumber(inclevel) {{Cl|THEN}}
        inclinenump$ = {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(inclinenumber(inclevel))
        thisincname$ = {{Text|getfilepath$|#55FF55}}(incname$(inclevel))
        thisincname$ = {{Cl|MID$ (function)|MID$}}(incname$(inclevel), {{Cl|LEN}}(thisincname$) + {{Text|1|#F580B1}})
        inclinenump$ = inclinenump$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + thisincname$ + {{Cl|CHR$}}({{Text|34|#F580B1}})
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} NoChecks = {{Text|0|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} vWatchOn {{Cl|AND (boolean)|AND}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Cl|THEN}} temp$ = vWatchErrorCall$ {{Cl|ELSE}} temp$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Cl|IF}} dynscope {{Cl|THEN}}
            dynscope = {{Text|0|#F580B1}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if(qbevent){"</nowiki>|#FFB100}} + temp$ + {{Text|<nowiki>"evnt("</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(linenumber) + inclinenump$ + {{Text|<nowiki>");if(r)goto S_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(statementn) + {{Text|<nowiki>";}"</nowiki>|#FFB100}}
        {{Cl|ELSE}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if(!qbevent)break;"</nowiki>|#FFB100}} + temp$ + {{Text|<nowiki>"evnt("</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(linenumber) + inclinenump$ + {{Text|<nowiki>");}while(r);"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    finishednonexec:
    firstLine = {{Text|0|#F580B1}}
    {{Cl|IF}} layoutdone = {{Text|0|#F580B1}} {{Cl|THEN}} layoutok = {{Text|0|#F580B1}} {{Text|<nowiki>'invalidate layout if not handled</nowiki>|#919191}}
    {{Cl|IF}} continuelinefrom = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'note: manager #2 requires this condition</nowiki>|#919191}}
        {{Text|<nowiki>'Include Manager #2 '***</nowiki>|#919191}}
        {{Cl|IF}} {{Cl|LEN}}(addmetainclude$) {{Cl|THEN}}
            {{Cl|IF}} inclevel = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Text|<nowiki>'backup line formatting</nowiki>|#919191}}
                layoutcomment_backup$ = layoutcomment$
                layoutok_backup = layoutok
                layout_backup$ = layout$
            {{Cl|END}} {{Cl|IF}}
            a$ = addmetainclude$: addmetainclude$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Text|<nowiki>'read/clear message</nowiki>|#919191}}
            {{Cl|IF}} inclevel = {{Text|0|#F580B1}} {{Cl|THEN}}
                includingFromRoot = {{Text|0|#F580B1}}
                forceIncludingFile = {{Text|0|#F580B1}}
                forceInclude:
                {{Cl|IF}} forceIncludeFromRoot$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
                    a$ = forceIncludeFromRoot$
                    forceIncludeFromRoot$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    forceIncludingFile = {{Text|1|#F580B1}}
                    includingFromRoot = {{Text|1|#F580B1}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} inclevel = {{Text|100|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Too many indwelling INCLUDE files"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Text|<nowiki>'1. Verify file exists (location is either (a)relative to source file or (b)absolute)</nowiki>|#919191}}
            fh = {{Text|99|#F580B1}} + inclevel + {{Text|1|#F580B1}}
            firstTryMethod = {{Text|1|#F580B1}}
            {{Cl|IF}} includingFromRoot <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} inclevel = {{Text|0|#F580B1}} {{Cl|THEN}} firstTryMethod = {{Text|2|#F580B1}}
            {{Cl|FOR}} try = firstTryMethod {{Cl|TO}} {{Text|2|#F580B1}} {{Text|<nowiki>'if including file from root, do not attempt including from relative location</nowiki>|#919191}}
                {{Cl|IF}} try = {{Text|1|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} inclevel = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} idemode {{Cl|THEN}} p$ = idepath$ + pathsep$ {{Cl|ELSE}} p$ = {{Text|getfilepath$|#55FF55}}(sourcefile$)
                    {{Cl|ELSE}}
                        p$ = {{Text|getfilepath$|#55FF55}}(incname(inclevel))
                    {{Cl|END}} {{Cl|IF}}
                    f$ = p$ + a$
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} f$ = a$
                {{Cl|IF}} {{Cl|_FILEEXISTS}}(f$) {{Cl|THEN}}
                    qberrorhappened = {{Text|-2|#F580B1}} {{Text|<nowiki>'***</nowiki>|#919191}}
                    {{Cl|OPEN}} f$ {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|BINARY}} {{Cl|OPEN|AS}} #fh
                    qberrorhappened2: {{Text|<nowiki>'***</nowiki>|#919191}}
                    {{Cl|IF}} qberrorhappened = {{Text|-2|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}} {{Text|<nowiki>'***</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}}
                qberrorhappened = {{Text|0|#F580B1}}
            {{Cl|NEXT}}
            {{Cl|IF}} qberrorhappened <> {{Text|-2|#F580B1}} {{Cl|THEN}} qberrorhappened = {{Text|0|#F580B1}}: a$ = {{Text|<nowiki>"File "</nowiki>|#FFB100}} + a$ + {{Text|<nowiki>" not found"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            inclevel = inclevel + {{Text|1|#F580B1}}: incname$(inclevel) = f$: inclinenumber(inclevel) = {{Text|0|#F580B1}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'fall through to next section...</nowiki>|#919191}}
        {{Text|<nowiki>'--------------------</nowiki>|#919191}}
        {{Cl|DO}} {{Cl|WHILE}} inclevel
            fh = {{Text|99|#F580B1}} + inclevel
            {{Text|<nowiki>'2. Feed next line</nowiki>|#919191}}
            {{Cl|IF}} {{Cl|EOF}}(fh) = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Cl|LINE INPUT (file statement)|LINE INPUT}} #fh, x$
                a3$ = x$
                continuelinefrom = {{Text|0|#F580B1}}
                inclinenumber(inclevel) = inclinenumber(inclevel) + {{Text|1|#F580B1}}
                {{Text|<nowiki>'create extended error string 'incerror$'</nowiki>|#919191}}
                errorLineInInclude = inclinenumber(inclevel)
                e$ = {{Text|<nowiki>" in line "</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(inclinenumber(inclevel)) + {{Text|<nowiki>" of "</nowiki>|#FFB100}} + incname$(inclevel) + {{Text|<nowiki>" included"</nowiki>|#FFB100}}
                {{Cl|IF}} inclevel > {{Text|1|#F580B1}} {{Cl|THEN}}
                    e$ = e$ + {{Text|<nowiki>" (through "</nowiki>|#FFB100}}
                    {{Cl|FOR}} x = {{Text|1|#F580B1}} {{Cl|TO}} inclevel - {{Text|1|#F580B1}} {{Cl|STEP}} {{Text|1|#F580B1}}
                        e$ = e$ + incname$(x)
                        {{Cl|IF}} x < inclevel - {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'a sep is req</nowiki>|#919191}}
                            {{Cl|IF}} x = inclevel - {{Text|2|#F580B1}} {{Cl|THEN}}
                                e$ = e$ + {{Text|<nowiki>" then "</nowiki>|#FFB100}}
                            {{Cl|ELSE}}
                                e$ = e$ + {{Text|<nowiki>", "</nowiki>|#FFB100}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|NEXT}}
                    e$ = e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                incerror$ = e$
                linenumber = linenumber - {{Text|1|#F580B1}} {{Text|<nowiki>'lower official linenumber to counter later increment</nowiki>|#919191}}
                {{Cl|IF}} idemode {{Cl|THEN}} sendc$ = {{Cl|CHR$}}({{Text|10|#F580B1}}) + a3$: {{Cl|GOTO}} sendcommand {{Text|<nowiki>'passback</nowiki>|#919191}}
                {{Cl|GOTO}} includeline
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'3. Close & return control</nowiki>|#919191}}
            {{Cl|CLOSE}} #fh
            inclevel = inclevel - {{Text|1|#F580B1}}
            {{Cl|IF}} inclevel = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} forceIncludingFile = {{Text|1|#F580B1}} {{Cl|THEN}}
                    forceIncludingFile = {{Text|0|#F580B1}}
                    {{Cl|GOTO}} forceIncludeCompleted
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'restore line formatting</nowiki>|#919191}}
                layoutok = layoutok_backup
                layout$ = layout_backup$
                layoutcomment$ = layoutcomment_backup$
            {{Cl|END}} {{Cl|IF}}
        {{Cl|LOOP}} {{Text|<nowiki>'fall through to next section...</nowiki>|#919191}}
        {{Text|<nowiki>'(end manager)</nowiki>|#919191}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'continuelinefrom=0</nowiki>|#919191}}
    {{Cl|IF}} Debug {{Cl|THEN}}
        {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"[layout check]"</nowiki>|#FFB100}}
        {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"["</nowiki>|#FFB100}} + layoutoriginal$ + {{Text|<nowiki>"]"</nowiki>|#FFB100}}
        {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"["</nowiki>|#FFB100}} + layout$ + {{Text|<nowiki>"]"</nowiki>|#FFB100}}
        {{Cl|PRINT (file statement)|PRINT}} #9, layoutok
        {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"[end layout check]"</nowiki>|#FFB100}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} idemode {{Cl|THEN}}
        {{Cl|IF}} continuelinefrom <> {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} ide4 {{Text|<nowiki>'continue processing other commands on line</nowiki>|#919191}}
        {{Cl|IF}} {{Cl|LEN}}(layoutcomment$) {{Cl|THEN}}
            {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + layoutcomment$ {{Cl|ELSE}} layout$ = layoutcomment$
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} layoutok = {{Text|0|#F580B1}} {{Cl|THEN}}
            layout$ = layoutoriginal$
        {{Cl|ELSE}}
            {{Text|<nowiki>'reverse '046' changes present in autolayout</nowiki>|#919191}}
            {{Text|<nowiki>'replace fix046$ with .</nowiki>|#919191}}
            i = {{Cl|INSTR}}(layout$, fix046$)
            {{Cl|DO}} {{Cl|WHILE}} i
                layout$ = {{Cl|LEFT$}}(layout$, i - {{Text|1|#F580B1}}) + {{Text|<nowiki>"."</nowiki>|#FFB100}} + {{Cl|RIGHT$}}(layout$, {{Cl|LEN}}(layout$) - (i + {{Cl|LEN}}(fix046$) - {{Text|1|#F580B1}}))
                i = {{Cl|INSTR}}(layout$, fix046$)
            {{Cl|LOOP}}
        {{Cl|END}} {{Cl|IF}}
        x = lhscontrollevel: {{Cl|IF}} controllevel < lhscontrollevel {{Cl|THEN}} x = controllevel
        {{Cl|IF}} definingtype = {{Text|2|#F580B1}} {{Cl|THEN}} x = x + {{Text|1|#F580B1}}
        {{Cl|IF}} definingtype > {{Text|0|#F580B1}} {{Cl|THEN}} definingtype = {{Text|2|#F580B1}}
        {{Cl|IF}} declaringlibrary = {{Text|2|#F580B1}} {{Cl|THEN}} x = x + {{Text|1|#F580B1}}
        {{Cl|IF}} declaringlibrary > {{Text|0|#F580B1}} {{Cl|THEN}} declaringlibrary = {{Text|2|#F580B1}}
        layout$ = {{Cl|SPACE$}}(x) + layout$
        {{Cl|IF}} linecontinuation {{Cl|THEN}} layout$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Cl|GOTO}} ideret4 {{Text|<nowiki>'return control to IDE</nowiki>|#919191}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'layout is not currently used by the compiler (as appose to the IDE), if it was it would be used here</nowiki>|#919191}}
    skipide4:
{{Cl|LOOP}}
{{Text|<nowiki>'add final line</nowiki>|#919191}}
{{Cl|IF}} lastLineReturn = {{Text|0|#F580B1}} {{Cl|THEN}}
    lastLineReturn = {{Text|1|#F580B1}}
    lastLine = {{Text|1|#F580B1}}
    wholeline$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
    {{Cl|GOTO}} mainpassLastLine
{{Cl|END}} {{Cl|IF}}
ide5:
linenumber = {{Text|0|#F580B1}}
{{Cl|IF}} closedmain = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|closemain|#55FF55}}
{{Cl|IF}} definingtype {{Cl|THEN}} linenumber = definingtypeerror: a$ = {{Text|<nowiki>"TYPE without END TYPE"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
{{Text|<nowiki>'check for open controls (copy #1)</nowiki>|#919191}}
{{Cl|IF}} controllevel {{Cl|THEN}}
    a$ = {{Text|<nowiki>"Unidentified open control block"</nowiki>|#FFB100}}
    {{Cl|SELECT}} {{Cl|CASE}} controltype(controllevel)
        {{Cl|CASE}} {{Text|1|#F580B1}}: a$ = {{Text|<nowiki>"IF without END IF"</nowiki>|#FFB100}}
        {{Cl|CASE}} {{Text|2|#F580B1}}: a$ = {{Text|<nowiki>"FOR without NEXT"</nowiki>|#FFB100}}
        {{Cl|CASE}} {{Text|3|#F580B1}}, {{Text|4|#F580B1}}: a$ = {{Text|<nowiki>"DO without LOOP"</nowiki>|#FFB100}}
        {{Cl|CASE}} {{Text|5|#F580B1}}: a$ = {{Text|<nowiki>"WHILE without WEND"</nowiki>|#FFB100}}
        {{Cl|CASE}} {{Text|6|#F580B1}}: a$ = {{Text|<nowiki>"$IF without $END IF"</nowiki>|#FFB100}}
        {{Cl|CASE}} {{Text|10|#F580B1}} {{Cl|TO}} {{Text|19|#F580B1}}: a$ = {{Text|<nowiki>"SELECT CASE without END SELECT"</nowiki>|#FFB100}}
        {{Cl|CASE}} {{Text|32|#F580B1}}: a$ = {{Text|<nowiki>"SUB/FUNCTION without END SUB/FUNCTION"</nowiki>|#FFB100}}
    {{Cl|END}} {{Cl|SELECT}}
    linenumber = controlref(controllevel)
    {{Cl|GOTO}} errmes
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} ideindentsubs = {{Text|0|#F580B1}} {{Cl|THEN}}
    {{Cl|IF}} {{Cl|LEN}}(subfunc) {{Cl|THEN}} a$ = {{Text|<nowiki>"SUB/FUNCTION without END SUB/FUNCTION"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
{{Cl|END}} {{Cl|IF}}
{{Text|<nowiki>'close the error handler (cannot be put in 'closemain' because subs/functions can also add error jumps to this file)</nowiki>|#919191}}
{{Text|WriteBufLine|#55FF55}} ErrTxtBuf, {{Text|<nowiki>"exit(99);"</nowiki>|#FFB100}} {{Text|<nowiki>'in theory this line should never be run!</nowiki>|#919191}}
{{Text|WriteBufLine|#55FF55}} ErrTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}} {{Text|<nowiki>'close error jump handler</nowiki>|#919191}}
{{Text|<nowiki>'create CLEAR method "CLEAR"</nowiki>|#919191}}
MainTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"clear.txt"</nowiki>|#FFB100}})
{{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} idn
    {{Cl|IF}} ids(i).staticscope {{Cl|THEN}} {{Text|<nowiki>'static scope?</nowiki>|#919191}}
        subfunc = {{Cl|RTRIM$}}(ids(i).insubfunc) {{Text|<nowiki>'set static scope</nowiki>|#919191}}
        {{Cl|GOTO}} clearstaticscope
    {{Cl|END}} {{Cl|IF}}
    a = {{Cl|ASC (function)|ASC}}(ids(i).insubfunc)
    {{Cl|IF}} a = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} a = {{Text|32|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'global scope?</nowiki>|#919191}}
        subfunc = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Text|<nowiki>'set global scope</nowiki>|#919191}}
        clearstaticscope:
        {{Cl|IF}} ids(i).arraytype {{Cl|THEN}} {{Text|<nowiki>'an array</nowiki>|#919191}}
            {{Text|getid|#55FF55}} i
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Cl|IF}} id.arrayelements = {{Text|-1|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} clearerasereturned {{Text|<nowiki>'cannot erase non-existant array</nowiki>|#919191}}
            {{Cl|IF}} {{Cl|INSTR}}(vWatchVariableExclusions$, {{Text|<nowiki>"@"</nowiki>|#FFB100}} + {{Cl|RTRIM$}}(id.callname) + {{Text|<nowiki>"@"</nowiki>|#FFB100}}) > {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Cl|GOTO}} clearerasereturned
            {{Cl|END}} {{Cl|IF}}
            clearerasereturn = {{Text|1|#F580B1}}: {{Cl|GOTO}} clearerase
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'array</nowiki>|#919191}}
        {{Cl|IF}} ids(i).t {{Cl|THEN}} {{Text|<nowiki>'non-array variable</nowiki>|#919191}}
            {{Text|getid|#55FF55}} i
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            bytes$ = {{Text|variablesize$|#55FF55}}({{Text|-1|#F580B1}})
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Text|<nowiki>'create a reference</nowiki>|#919191}}
            typ = id.t + ISREFERENCE
            {{Cl|IF}} typ {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
                e$ = {{Text|str2|#55FF55}}(i) + sp3 + {{Text|str2|#55FF55}}(typ {{Cl|AND}} {{Text|511|#F580B1}}) + sp3 + {{Text|<nowiki>"0"</nowiki>|#FFB100}} + sp3 + {{Text|<nowiki>"0"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                e$ = {{Text|str2|#55FF55}}(i)
            {{Cl|END}} {{Cl|IF}}
            e$ = {{Text|refer$|#55FF55}}(e$, typ, {{Text|1|#F580B1}})
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Cl|IF}} typ {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                {{Cl|IF}} typ {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH {{Cl|THEN}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"memset((void*)("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"->chr),0,"</nowiki>|#FFB100}} + bytes$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                    {{Cl|GOTO}} cleared
                {{Cl|ELSE}}
                    {{Cl|IF}} {{Cl|INSTR}}(vWatchVariableExclusions$, {{Text|<nowiki>"@"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"@"</nowiki>|#FFB100}}) = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|LEFT$}}(e$, {{Text|12|#F580B1}}) <> {{Text|<nowiki>"_SUB_VWATCH_"</nowiki>|#FFB100}} {{Cl|THEN}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, e$ + {{Text|<nowiki>"->len=0;"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|GOTO}} cleared
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} typ {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
                {{Cl|IF}} udtxvariable(typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) {{Cl|THEN}}
                    {{Text|<nowiki>'this next procedure resets values of UDT variables with variable-length strings</nowiki>|#919191}}
                    {{Text|clear_udt_with_varstrings|#55FF55}} e$, typ {{Cl|AND}} {{Text|511|#F580B1}}, MainTxtBuf, {{Text|0|#F580B1}}
                {{Cl|ELSE}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"memset((void*)"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>",0,"</nowiki>|#FFB100}} + bytes$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|ELSE}}
                {{Cl|IF}} {{Cl|INSTR}}(vWatchVariableExclusions$, {{Text|<nowiki>"@"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"@"</nowiki>|#FFB100}}) = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|LEFT$}}(e$, {{Text|12|#F580B1}}) <> {{Text|<nowiki>"_SUB_VWATCH_"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"=0;"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|GOTO}} cleared
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'non-array variable</nowiki>|#919191}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'scope</nowiki>|#919191}}
    cleared:
    clearerasereturned:
{{Cl|NEXT}}
{{Cl|IF}} Debug {{Cl|THEN}}
    {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"finished making program!"</nowiki>|#FFB100}}
    {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"recompile="</nowiki>|#FFB100}}; recompile
{{Cl|END}} {{Cl|IF}}
{{Text|<nowiki>'Set cmem flags for subs/functions requiring data passed in cmem</nowiki>|#919191}}
{{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} idn
    {{Cl|IF}} cmemlist(i) {{Cl|THEN}} {{Text|<nowiki>'must be in cmem</nowiki>|#919191}}
        {{Text|getid|#55FF55}} i
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
        {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"recompiling cmem sf! checking:"</nowiki>|#FFB100}}; {{Cl|RTRIM$}}(id.n)
        {{Cl|IF}} id.sfid {{Cl|THEN}} {{Text|<nowiki>'it is an argument of a sub/function</nowiki>|#919191}}
            {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"recompiling cmem sf! It's a sub/func arg!"</nowiki>|#FFB100}}
            i2 = id.sfid
            x = id.sfarg
            {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"recompiling cmem sf! values:"</nowiki>|#FFB100}}; i2; x
            {{Text|<nowiki>'check if cmem flag is set, if not then set it & force recompile</nowiki>|#919191}}
            {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(sfcmemargs(i2), x, {{Text|1|#F580B1}}) <> {{Cl|CHR$}}({{Text|1|#F580B1}}) {{Cl|THEN}}
                {{Cl|MID$}}(sfcmemargs(i2), x, {{Text|1|#F580B1}}) = {{Cl|CHR$}}({{Text|1|#F580B1}})
                {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"recompiling cmem sf! setting:"</nowiki>|#FFB100}}; i2; x
                recompile = {{Text|1|#F580B1}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
{{Cl|NEXT}} i
unresolved = {{Text|0|#F580B1}}
{{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} idn
    {{Text|getid|#55FF55}} i
    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
    {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"checking id named:"</nowiki>|#FFB100}}; id.n
    {{Cl|IF}} id.subfunc {{Cl|THEN}}
        {{Cl|FOR}} i2 = {{Text|1|#F580B1}} {{Cl|TO}} id.args
            t = {{Cl|CVL}}({{Cl|MID$ (function)|MID$}}(id.arg, i2 * {{Text|4|#F580B1}} - {{Text|3|#F580B1}}, {{Text|4|#F580B1}}))
            {{Cl|IF}} t > {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISPOINTER) {{Cl|THEN}}
                    {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISARRAY) {{Cl|THEN}}
                        {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"checking argument "</nowiki>|#FFB100}}; i2; {{Text|<nowiki>" of "</nowiki>|#FFB100}}; id.args
                        nele = {{Cl|ASC (function)|ASC}}({{Cl|MID$ (function)|MID$}}(id.nele, i2, {{Text|1|#F580B1}}))
                        nelereq = {{Cl|ASC (function)|ASC}}({{Cl|MID$ (function)|MID$}}(id.nelereq, i2, {{Text|1|#F580B1}}))
                        {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"nele="</nowiki>|#FFB100}}; nele
                        {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"nelereq="</nowiki>|#FFB100}}; nelereq
                        {{Cl|IF}} nele <> nelereq {{Cl|THEN}}
                            {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"mismatch detected!"</nowiki>|#FFB100}}
                            unresolved = unresolved + {{Text|1|#F580B1}}
                            sflistn = sflistn + {{Text|1|#F580B1}}
                            sfidlist(sflistn) = i
                            sfarglist(sflistn) = i2
                            sfelelist(sflistn) = nelereq {{Text|<nowiki>'0 means still unknown</nowiki>|#919191}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|NEXT}}
    {{Cl|END}} {{Cl|IF}}
{{Cl|NEXT}}
{{Text|<nowiki>'is recompilation required to resolve this?</nowiki>|#919191}}
{{Cl|IF}} unresolved > {{Text|0|#F580B1}} {{Cl|THEN}}
    {{Cl|IF}} lastunresolved = {{Text|-1|#F580B1}} {{Cl|THEN}}
        {{Text|<nowiki>'first pass</nowiki>|#919191}}
        recompile = {{Text|1|#F580B1}}
        {{Cl|IF}} Debug {{Cl|THEN}}
            {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"recompiling to resolve array elements (first time)"</nowiki>|#FFB100}}
            {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"sflistn="</nowiki>|#FFB100}}; sflistn
            {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"oldsflistn="</nowiki>|#FFB100}}; oldsflistn
        {{Cl|END}} {{Cl|IF}}
    {{Cl|ELSE}}
        {{Text|<nowiki>'not first pass</nowiki>|#919191}}
        {{Cl|IF}} unresolved < lastunresolved {{Cl|THEN}}
            recompile = {{Text|1|#F580B1}}
            {{Cl|IF}} Debug {{Cl|THEN}}
                {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"recompiling to resolve array elements (not first time)"</nowiki>|#FFB100}}
                {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"sflistn="</nowiki>|#FFB100}}; sflistn
                {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"oldsflistn="</nowiki>|#FFB100}}; oldsflistn
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
{{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'unresolved</nowiki>|#919191}}
lastunresolved = unresolved
{{Text|<nowiki>'IDEA!</nowiki>|#919191}}
{{Text|<nowiki>'have a flag to record if anything gets resolved in a pass</nowiki>|#919191}}
{{Text|<nowiki>'if not then it's time to stop</nowiki>|#919191}}
{{Text|<nowiki>'the problem is the same amount of new problems may be created by a</nowiki>|#919191}}
{{Text|<nowiki>'resolve as those that get fixed</nowiki>|#919191}}
{{Text|<nowiki>'also/or.. could it be that previous fixes are overridden in a recompile</nowiki>|#919191}}
{{Text|<nowiki>'          by a new fix? if so, it would give these effects</nowiki>|#919191}}
{{Text|<nowiki>'could recompilation resolve this?</nowiki>|#919191}}
{{Text|<nowiki>'IF sflistn <> -1 THEN</nowiki>|#919191}}
{{Text|<nowiki>'IF sflistn <> oldsflistn THEN</nowiki>|#919191}}
{{Text|<nowiki>'recompile = 1</nowiki>|#919191}}
{{Text|<nowiki>'</nowiki>|#919191}}
{{Text|<nowiki>'if debug then</nowiki>|#919191}}
{{Text|<nowiki>'print #9,"recompile set to 1 to resolve array elements"</nowiki>|#919191}}
{{Text|<nowiki>'print #9,"sflistn=";sflistn</nowiki>|#919191}}
{{Text|<nowiki>'print #9,"oldsflistn=";oldsflistn</nowiki>|#919191}}
{{Text|<nowiki>'end if</nowiki>|#919191}}
{{Text|<nowiki>'</nowiki>|#919191}}
{{Text|<nowiki>'END IF</nowiki>|#919191}}
{{Text|<nowiki>'END IF</nowiki>|#919191}}
{{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"Beginning COMMON array list check..."</nowiki>|#FFB100}}
xi = {{Text|1|#F580B1}}
{{Cl|FOR}} x = {{Text|1|#F580B1}} {{Cl|TO}} commonarraylistn
    varname$ = {{Text|getelement$|#55FF55}}(commonarraylist, xi): xi = xi + {{Text|1|#F580B1}}
    typ$ = {{Text|getelement$|#55FF55}}(commonarraylist, xi): xi = xi + {{Text|1|#F580B1}}
    dimmethod2 = {{Cl|VAL}}({{Text|getelement$|#55FF55}}(commonarraylist, xi)): xi = xi + {{Text|1|#F580B1}}
    dimshared2 = {{Cl|VAL}}({{Text|getelement$|#55FF55}}(commonarraylist, xi)): xi = xi + {{Text|1|#F580B1}}
    {{Text|<nowiki>'find the array ID (try method)</nowiki>|#919191}}
    t = {{Text|typname2typ|#55FF55}}(typ$)
    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
    {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISUDT) = {{Text|0|#F580B1}} {{Cl|THEN}} varname$ = varname$ + {{Text|type2symbol$|#55FF55}}(typ$)
    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
    {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"Checking for array '"</nowiki>|#FFB100}} + varname$ + {{Text|<nowiki>"'..."</nowiki>|#FFB100}}
    try = {{Text|findid|#55FF55}}(varname$)
    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
    {{Cl|DO}} {{Cl|WHILE}} try
        {{Cl|IF}} id.arraytype {{Cl|THEN}} {{Cl|GOTO}} foundcommonarray2
        {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(varname$) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
    {{Cl|LOOP}}
    foundcommonarray2:
    {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"Found array '"</nowiki>|#FFB100}} + varname$ + {{Text|<nowiki>"!"</nowiki>|#FFB100}}
    {{Cl|IF}} id.arrayelements = {{Text|-1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} arrayelementslist(currentid) <> {{Text|0|#F580B1}} {{Cl|THEN}} recompile = {{Text|1|#F580B1}}
        {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"Recompiling to resolve elements of:"</nowiki>|#FFB100}} + varname$
    {{Cl|END}} {{Cl|IF}}
{{Cl|NEXT}}
{{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"Finished COMMON array list check!"</nowiki>|#FFB100}}
{{Cl|IF}} vWatchDesiredState <> vWatchOn {{Cl|THEN}}
    vWatchRecompileAttempts = vWatchRecompileAttempts + {{Text|1|#F580B1}}
    recompile = {{Text|1|#F580B1}}
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} recompile {{Cl|THEN}}
    do_recompile:
    {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"Recompile required!"</nowiki>|#FFB100}}
    recompile = {{Text|0|#F580B1}}
    {{Cl|IF}} idemode {{Cl|THEN}} iderecompile = {{Text|1|#F580B1}}
    {{Cl|FOR}} closeall = {{Text|1|#F580B1}} {{Cl|TO}} {{Text|255|#F580B1}}: {{Cl|CLOSE}} closeall: {{Cl|NEXT}}
    {{Cl|OPEN}} tmpdir$ + {{Text|<nowiki>"temp.bin"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|OUTPUT}} {{Cl|OPEN#File_ACCESS_and_LOCK_Permissions|LOCK}} {{Cl|OPEN#File_ACCESS_and_LOCK_Permissions|WRITE}} {{Cl|OPEN|AS}} #26 {{Text|<nowiki>'relock</nowiki>|#919191}}
    {{Cl|GOTO}} recompile
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"Beginning label check..."</nowiki>|#FFB100}}
{{Cl|FOR}} r = {{Text|1|#F580B1}} {{Cl|TO}} nLabels
    {{Cl|IF}} Labels(r).Scope_Restriction {{Cl|THEN}}
        a$ = {{Cl|RTRIM$}}(Labels(r).cn)
        ignore = {{Text|validlabel|#55FF55}}(a$)
        v = {{Text|HashFind|#55FF55}}(a$, HASHFLAG_LABEL, ignore, r2)
        addlabchk7:
        {{Cl|IF}} v {{Cl|THEN}}
            {{Cl|IF}} Labels(r2).{{Text|Scope|#55FF55}} = Labels(r).Scope_Restriction {{Cl|THEN}}
                linenumber = Labels(r).Error_Line: a$ = {{Text|<nowiki>"Common label within a SUB/FUNCTION"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} v = {{Text|2|#F580B1}} {{Cl|THEN}} v = {{Text|HashFindCont|#55FF55}}(ignore, r2): {{Cl|GOTO}} addlabchk7
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'v</nowiki>|#919191}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'restriction</nowiki>|#919191}}
    {{Text|<nowiki>'check for undefined labels</nowiki>|#919191}}
    {{Cl|IF}} Labels(r).State = {{Text|0|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} {{Cl|INSTR}}(PossibleSubNameLabels$, sp + {{Cl|UCASE$}}({{Cl|RTRIM$}}(Labels(r).cn)) + sp) {{Cl|THEN}}
            {{Cl|IF}} {{Cl|INSTR}}(SubNameLabels$, sp + {{Cl|UCASE$}}({{Cl|RTRIM$}}(Labels(r).cn)) + sp) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'not already added</nowiki>|#919191}}
                SubNameLabels$ = SubNameLabels$ + {{Cl|UCASE$}}({{Cl|RTRIM$}}(Labels(r).cn)) + sp
                {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"Recompiling to resolve label:"</nowiki>|#FFB100}}; {{Cl|RTRIM$}}(Labels(r).cn)
                {{Cl|GOTO}} do_recompile
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        linenumber = Labels(r).Error_Line: a$ = {{Text|<nowiki>"Label '"</nowiki>|#FFB100}} + {{Cl|RTRIM$}}(Labels(r).cn) + {{Text|<nowiki>"' not defined"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} Labels(r).Data_Referenced {{Cl|THEN}}
        {{Text|<nowiki>'check for ambiguous RESTORE reference</nowiki>|#919191}}
        x = {{Text|0|#F580B1}}
        a$ = {{Cl|RTRIM$}}(Labels(r).cn)
        ignore = {{Text|validlabel|#55FF55}}(a$)
        v = {{Text|HashFind|#55FF55}}(a$, HASHFLAG_LABEL, ignore, r2)
        addlabchk4:
        {{Cl|IF}} v {{Cl|THEN}}
            x = x + {{Text|1|#F580B1}}
            {{Cl|IF}} v = {{Text|2|#F580B1}} {{Cl|THEN}} v = {{Text|HashFindCont|#55FF55}}(ignore, r2): {{Cl|GOTO}} addlabchk4
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'v</nowiki>|#919191}}
        {{Cl|IF}} x <> {{Text|1|#F580B1}} {{Cl|THEN}} linenumber = Labels(r).Error_Line: a$ = {{Text|<nowiki>"Ambiguous DATA label"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
        {{Text|<nowiki>'add global data offset variable</nowiki>|#919191}}
        {{Text|WriteBufLine|#55FF55}} GlobTxtBuf, {{Text|<nowiki>"ptrszint data_at_LABEL_"</nowiki>|#FFB100}} + a$ + {{Text|<nowiki>"="</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(Labels(r).Data_Offset) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'data referenced</nowiki>|#919191}}
{{Cl|NEXT}}
{{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"Finished check!"</nowiki>|#FFB100}}
{{Text|<nowiki>'if targettyp=-4 or targettyp=-5 then '? -> byte_element(offset,element size in bytes)</nowiki>|#919191}}
{{Text|<nowiki>' IF (sourcetyp AND ISREFERENCE) = 0 THEN a$ = "Expected variable name/array element": GOTO errmes</nowiki>|#919191}}
{{Text|<nowiki>'create include files for COMMON arrays</nowiki>|#919191}}
{{Text|<nowiki>'return to 'main'</nowiki>|#919191}}
subfunc$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
defdatahandle = GlobTxtBuf
DataTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"A"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"maindata.txt"</nowiki>|#FFB100}})
FreeTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"A"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"mainfree.txt"</nowiki>|#FFB100}})
{{Cl|IF}} Console {{Cl|THEN}}
    {{Text|WriteBufLine|#55FF55}} GlobTxtBuf, {{Text|<nowiki>"int32 console=1;"</nowiki>|#FFB100}}
{{Cl|ELSE}}
    {{Text|WriteBufLine|#55FF55}} GlobTxtBuf, {{Text|<nowiki>"int32 console=0;"</nowiki>|#FFB100}}
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} ScreenHide {{Cl|THEN}}
    {{Text|WriteBufLine|#55FF55}} GlobTxtBuf, {{Text|<nowiki>"int32 screen_hide_startup=1;"</nowiki>|#FFB100}}
{{Cl|ELSE}}
    {{Text|WriteBufLine|#55FF55}} GlobTxtBuf, {{Text|<nowiki>"int32 screen_hide_startup=0;"</nowiki>|#FFB100}}
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} Asserts {{Cl|THEN}}
    {{Text|WriteBufLine|#55FF55}} GlobTxtBuf, {{Text|<nowiki>"int32 asserts=1;"</nowiki>|#FFB100}}
{{Cl|ELSE}}
    {{Text|WriteBufLine|#55FF55}} GlobTxtBuf, {{Text|<nowiki>"int32 asserts=0;"</nowiki>|#FFB100}}
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} vWatchOn {{Cl|THEN}}
    {{Text|WriteBufLine|#55FF55}} GlobTxtBuf, {{Text|<nowiki>"int32 vwatch=-1;"</nowiki>|#FFB100}}
{{Cl|ELSE}}
    {{Text|WriteBufLine|#55FF55}} GlobTxtBuf, {{Text|<nowiki>"int32 vwatch=0;"</nowiki>|#FFB100}}
{{Cl|END}} {{Cl|IF}}
bh = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"A"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"dyninfo.txt"</nowiki>|#FFB100}})
{{Cl|IF}} Resize {{Cl|THEN}}
    {{Text|WriteBufLine|#55FF55}} bh, {{Text|<nowiki>"ScreenResize=1;"</nowiki>|#FFB100}}
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} Resize_Scale {{Cl|THEN}}
    {{Text|WriteBufLine|#55FF55}} bh, {{Text|<nowiki>"ScreenResizeScale="</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(Resize_Scale) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} vWatchOn = {{Text|1|#F580B1}} {{Cl|THEN}}
    {{Text|vWatchVariable|#55FF55}} {{Text|<nowiki>""</nowiki>|#FFB100}}, {{Text|1|#F580B1}}
{{Cl|END}} {{Cl|IF}}
{{Text|<nowiki>'DATA_finalize</nowiki>|#919191}}
{{Text|WriteBufLine|#55FF55}} GlobTxtBuf, {{Text|<nowiki>"ptrszint data_size="</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(DataOffset) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
{{Cl|IF}} DataOffset = {{Text|0|#F580B1}} {{Cl|THEN}}
    {{Text|WriteBufLine|#55FF55}} GlobTxtBuf, {{Text|<nowiki>"uint8 *data=(uint8*)calloc(1,1);"</nowiki>|#FFB100}}
{{Cl|ELSE}}
    {{Cl|IF}} inline_DATA = {{Text|0|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} os$ = {{Text|<nowiki>"WIN"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} OS_BITS = {{Text|32|#F580B1}} {{Cl|THEN}}
                x$ = {{Cl|CHR$}}({{Text|0|#F580B1}}): {{Text|WriteBufRawData|#55FF55}} DataBinBuf, x$
                {{Text|WriteBufLine|#55FF55}} GlobTxtBuf, {{Text|<nowiki>"extern "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"C"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"{"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} GlobTxtBuf, {{Text|<nowiki>"extern char *binary_internal_temp"</nowiki>|#FFB100}} + tempfolderindexstr2$ + {{Text|<nowiki>"_data_bin_start;"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} GlobTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} GlobTxtBuf, {{Text|<nowiki>"uint8 *data=(uint8*)&binary_internal_temp"</nowiki>|#FFB100}} + tempfolderindexstr2$ + {{Text|<nowiki>"_data_bin_start;"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                x$ = {{Cl|CHR$}}({{Text|0|#F580B1}}): {{Text|WriteBufRawData|#55FF55}} DataBinBuf, x$
                {{Text|WriteBufLine|#55FF55}} GlobTxtBuf, {{Text|<nowiki>"extern "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"C"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"{"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} GlobTxtBuf, {{Text|<nowiki>"extern char *_binary_internal_temp"</nowiki>|#FFB100}} + tempfolderindexstr2$ + {{Text|<nowiki>"_data_bin_start;"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} GlobTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} GlobTxtBuf, {{Text|<nowiki>"uint8 *data=(uint8*)&_binary_internal_temp"</nowiki>|#FFB100}} + tempfolderindexstr2$ + {{Text|<nowiki>"_data_bin_start;"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Cl|THEN}}
            x$ = {{Cl|CHR$}}({{Text|0|#F580B1}}): {{Text|WriteBufRawData|#55FF55}} DataBinBuf, x$
            {{Text|WriteBufLine|#55FF55}} GlobTxtBuf, {{Text|<nowiki>"extern "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"C"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"{"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} GlobTxtBuf, {{Text|<nowiki>"extern char *_binary_internal_temp"</nowiki>|#FFB100}} + tempfolderindexstr2$ + {{Text|<nowiki>"_data_bin_start;"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} GlobTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} GlobTxtBuf, {{Text|<nowiki>"uint8 *data=(uint8*)&_binary_internal_temp"</nowiki>|#FFB100}} + tempfolderindexstr2$ + {{Text|<nowiki>"_data_bin_start;"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|ELSE}}
        {{Text|<nowiki>'inline data</nowiki>|#919191}}
        ff = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"B"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"data.bin"</nowiki>|#FFB100}})
        x$ = {{Text|ReadBufRawData$|#55FF55}}(ff, {{Text|GetBufLen&|#55FF55}}(ff))
        x2$ = {{Text|<nowiki>"uint8 inline_data[]={"</nowiki>|#FFB100}}
        {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(x$)
            x2$ = x2$ + inlinedatastr$({{Cl|ASC (function)|ASC}}(x$, i))
        {{Cl|NEXT}}
        x2$ = x2$ + {{Text|<nowiki>"0};"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} GlobTxtBuf, x2$
        {{Text|WriteBufLine|#55FF55}} GlobTxtBuf, {{Text|<nowiki>"uint8 *data=&inline_data[0];"</nowiki>|#FFB100}}
        x$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: x2$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
    {{Cl|END}} {{Cl|IF}}
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"Beginning generation of code for saving/sharing common array data..."</nowiki>|#FFB100}}
use_global_byte_elements = {{Text|1|#F580B1}}
ncommontmp = {{Text|0|#F580B1}}
xi = {{Text|1|#F580B1}}
{{Cl|FOR}} x = {{Text|1|#F580B1}} {{Cl|TO}} commonarraylistn
    varname$ = {{Text|getelement$|#55FF55}}(commonarraylist, xi): xi = xi + {{Text|1|#F580B1}}
    typ$ = {{Text|getelement$|#55FF55}}(commonarraylist, xi): xi = xi + {{Text|1|#F580B1}}
    dimmethod2 = {{Cl|VAL}}({{Text|getelement$|#55FF55}}(commonarraylist, xi)): xi = xi + {{Text|1|#F580B1}}
    dimshared2 = {{Cl|VAL}}({{Text|getelement$|#55FF55}}(commonarraylist, xi)): xi = xi + {{Text|1|#F580B1}}
    {{Text|<nowiki>'find the array ID (try method)</nowiki>|#919191}}
    purevarname$ = varname$
    t = {{Text|typname2typ|#55FF55}}(typ$)
    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
    {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISUDT) = {{Text|0|#F580B1}} {{Cl|THEN}} varname$ = varname$ + {{Text|type2symbol$|#55FF55}}(typ$)
    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
    try = {{Text|findid|#55FF55}}(varname$)
    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
    {{Cl|DO}} {{Cl|WHILE}} try
        {{Cl|IF}} id.arraytype {{Cl|THEN}} {{Cl|GOTO}} foundcommonarray
        {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(varname$) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
    {{Cl|LOOP}}
    a$ = {{Text|<nowiki>"COMMON array unlocatable"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes {{Text|<nowiki>'should never happen</nowiki>|#919191}}
    foundcommonarray:
    {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"Found common array '"</nowiki>|#FFB100}} + varname$ + {{Text|<nowiki>"'!"</nowiki>|#FFB100}}
    i = currentid
    arraytype = id.arraytype
    arrayelements = id.arrayelements
    e$ = {{Cl|RTRIM$}}(id.n)
    {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISUDT) = {{Text|0|#F580B1}} {{Cl|THEN}} e$ = e$ + {{Text|typevalue2symbol$|#55FF55}}(t)
    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
    n$ = e$
    n2$ = {{Cl|RTRIM$}}(id.callname)
    tsize = id.tsize
    {{Text|<nowiki>'select command</nowiki>|#919191}}
    command = {{Text|3|#F580B1}} {{Text|<nowiki>'fixed length elements</nowiki>|#919191}}
    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
        {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Cl|THEN}}
            command = {{Text|4|#F580B1}} {{Text|<nowiki>'var-len elements</nowiki>|#919191}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'if...</nowiki>|#919191}}
    {{Text|<nowiki>'i) array elements are still undefined (ie. arrayelements=-1) pass the input content along</nowiki>|#919191}}
    {{Text|<nowiki>'  if any existed or an array-placeholder</nowiki>|#919191}}
    {{Text|<nowiki>'ii) if the array's elements were defined, any input content would have been loaded so the</nowiki>|#919191}}
    {{Text|<nowiki>'    array (in whatever state it currently is) should be passed. If it is currently erased</nowiki>|#919191}}
    {{Text|<nowiki>'    then it should be passed as a placeholder</nowiki>|#919191}}
    {{Cl|IF}} arrayelements = {{Text|-1|#F580B1}} {{Cl|THEN}}
        {{Text|<nowiki>'load array (copies the array, if any, into a buffer for later)</nowiki>|#919191}}
        MainTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"inpchain"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(i) + {{Text|<nowiki>".txt"</nowiki>|#FFB100}})
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (int32val==2){"</nowiki>|#FFB100}} {{Text|<nowiki>'array place-holder</nowiki>|#919191}}
        {{Text|<nowiki>'create buffer to store array as-is in global.txt</nowiki>|#919191}}
        x$ = {{Text|str2$|#55FF55}}({{Text|uniquenumber|#55FF55}})
        x1$ = {{Text|<nowiki>"chainarraybuf"</nowiki>|#FFB100}} + x$
        x2$ = {{Text|<nowiki>"chainarraybufsiz"</nowiki>|#FFB100}} + x$
        {{Text|WriteBufLine|#55FF55}} GlobTxtBuf, {{Text|<nowiki>"static uint8 *"</nowiki>|#FFB100}} + x1$ + {{Text|<nowiki>"=(uint8*)malloc(1);"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} GlobTxtBuf, {{Text|<nowiki>"static int64 "</nowiki>|#FFB100}} + x2$ + {{Text|<nowiki>"=0;"</nowiki>|#FFB100}}
        {{Text|<nowiki>'read next command</nowiki>|#919191}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_get(FF,NULL,byte_element((uint64)&int32val,4,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}}
        {{Cl|IF}} command = {{Text|3|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (int32val==3){"</nowiki>|#FFB100}} {{Text|<nowiki>'fixed-length-element array</nowiki>|#919191}}
        {{Cl|IF}} command = {{Text|4|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (int32val==4){"</nowiki>|#FFB100}} {{Text|<nowiki>'var-length-element array</nowiki>|#919191}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, x2$ + {{Text|<nowiki>"+=4; "</nowiki>|#FFB100}} + x1$ + {{Text|<nowiki>"=(uint8*)realloc("</nowiki>|#FFB100}} + x1$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + x2$ + {{Text|<nowiki>"); *(int32*)("</nowiki>|#FFB100}} + x1$ + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + x2$ + {{Text|<nowiki>"-4)=int32val;"</nowiki>|#FFB100}}
        {{Cl|IF}} command = {{Text|3|#F580B1}} {{Cl|THEN}}
            {{Text|<nowiki>'read size in bits of one element, convert it to bytes</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_get(FF,NULL,byte_element((uint64)&int64val,8,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, x2$ + {{Text|<nowiki>"+=8; "</nowiki>|#FFB100}} + x1$ + {{Text|<nowiki>"=(uint8*)realloc("</nowiki>|#FFB100}} + x1$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + x2$ + {{Text|<nowiki>"); *(int64*)("</nowiki>|#FFB100}} + x1$ + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + x2$ + {{Text|<nowiki>"-8)=int64val;"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"bytes=int64val>>3;"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'com=3</nowiki>|#919191}}
        {{Cl|IF}} command = {{Text|4|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"bytes=1;"</nowiki>|#FFB100}} {{Text|<nowiki>'bytes used to calculate number of elements</nowiki>|#919191}}
        {{Text|<nowiki>'read number of dimensions</nowiki>|#919191}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_get(FF,NULL,byte_element((uint64)&int32val,4,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, x2$ + {{Text|<nowiki>"+=4; "</nowiki>|#FFB100}} + x1$ + {{Text|<nowiki>"=(uint8*)realloc("</nowiki>|#FFB100}} + x1$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + x2$ + {{Text|<nowiki>"); *(int32*)("</nowiki>|#FFB100}} + x1$ + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + x2$ + {{Text|<nowiki>"-4)=int32val;"</nowiki>|#FFB100}}
        {{Text|<nowiki>'read size of dimensions & calculate the size of the array in bytes</nowiki>|#919191}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"while(int32val--){"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_get(FF,NULL,byte_element((uint64)&int64val,8,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}} {{Text|<nowiki>'lbound</nowiki>|#919191}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, x2$ + {{Text|<nowiki>"+=8; "</nowiki>|#FFB100}} + x1$ + {{Text|<nowiki>"=(uint8*)realloc("</nowiki>|#FFB100}} + x1$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + x2$ + {{Text|<nowiki>"); *(int64*)("</nowiki>|#FFB100}} + x1$ + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + x2$ + {{Text|<nowiki>"-8)=int64val;"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_get(FF,NULL,byte_element((uint64)&int64val2,8,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}} {{Text|<nowiki>'ubound</nowiki>|#919191}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, x2$ + {{Text|<nowiki>"+=8; "</nowiki>|#FFB100}} + x1$ + {{Text|<nowiki>"=(uint8*)realloc("</nowiki>|#FFB100}} + x1$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + x2$ + {{Text|<nowiki>"); *(int64*)("</nowiki>|#FFB100}} + x1$ + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + x2$ + {{Text|<nowiki>"-8)=int64val2;"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"bytes*=(int64val2-int64val+1);"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
        {{Cl|IF}} command = {{Text|3|#F580B1}} {{Cl|THEN}}
            {{Text|<nowiki>'read the array data</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, x2$ + {{Text|<nowiki>"+=bytes; "</nowiki>|#FFB100}} + x1$ + {{Text|<nowiki>"=(uint8*)realloc("</nowiki>|#FFB100}} + x1$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + x2$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_get(FF,NULL,byte_element((uint64)("</nowiki>|#FFB100}} + x1$ + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + x2$ + {{Text|<nowiki>"-bytes),bytes,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'com=3</nowiki>|#919191}}
        {{Cl|IF}} command = {{Text|4|#F580B1}} {{Cl|THEN}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"bytei=0;"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"while(bytei<bytes){"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_get(FF,NULL,byte_element((uint64)&int64val,8,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}} {{Text|<nowiki>'get size</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, x2$ + {{Text|<nowiki>"+=8; "</nowiki>|#FFB100}} + x1$ + {{Text|<nowiki>"=(uint8*)realloc("</nowiki>|#FFB100}} + x1$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + x2$ + {{Text|<nowiki>"); *(int64*)("</nowiki>|#FFB100}} + x1$ + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + x2$ + {{Text|<nowiki>"-8)=int64val;"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, x2$ + {{Text|<nowiki>"+=(int64val>>3); "</nowiki>|#FFB100}} + x1$ + {{Text|<nowiki>"=(uint8*)realloc("</nowiki>|#FFB100}} + x1$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + x2$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_get(FF,NULL,byte_element((uint64)("</nowiki>|#FFB100}} + x1$ + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + x2$ + {{Text|<nowiki>"-(int64val>>3)),(int64val>>3),"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"bytei++;"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'get next command</nowiki>|#919191}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_get(FF,NULL,byte_element((uint64)&int32val,4,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}} {{Text|<nowiki>'command=3 or 4</nowiki>|#919191}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}} {{Text|<nowiki>'array place-holder</nowiki>|#919191}}
        {{Text|<nowiki>'save array (saves the buffered data, if any, for later)</nowiki>|#919191}}
        MainTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"chain"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(i) + {{Text|<nowiki>".txt"</nowiki>|#FFB100}})
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"int32val=2;"</nowiki>|#FFB100}} {{Text|<nowiki>'placeholder</nowiki>|#919191}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_put(FF,NULL,byte_element((uint64)&int32val,4,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_put(FF,NULL,byte_element((uint64)"</nowiki>|#FFB100}} + x1$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + x2$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}}
    {{Cl|ELSE}}
        {{Text|<nowiki>'note: arrayelements<>-1</nowiki>|#919191}}
        {{Text|<nowiki>'load array</nowiki>|#919191}}
        MainTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"inpchain"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(i) + {{Text|<nowiki>".txt"</nowiki>|#FFB100}})
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (int32val==2){"</nowiki>|#FFB100}} {{Text|<nowiki>'array place-holder</nowiki>|#919191}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_get(FF,NULL,byte_element((uint64)&int32val,4,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}}
        {{Cl|IF}} command = {{Text|3|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (int32val==3){"</nowiki>|#FFB100}} {{Text|<nowiki>'fixed-length-element array</nowiki>|#919191}}
        {{Cl|IF}} command = {{Text|4|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (int32val==4){"</nowiki>|#FFB100}} {{Text|<nowiki>'var-length-element array</nowiki>|#919191}}
        {{Cl|IF}} command = {{Text|3|#F580B1}} {{Cl|THEN}}
            {{Text|<nowiki>'get size in bits</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_get(FF,NULL,byte_element((uint64)&int64val,8,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}}
            {{Text|<nowiki>'***assume correct***</nowiki>|#919191}}
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'get number of elements</nowiki>|#919191}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_get(FF,NULL,byte_element((uint64)&int32val,4,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}}
        {{Text|<nowiki>'***assume correct***</nowiki>|#919191}}
        e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Cl|IF}} command = {{Text|4|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"bytes=1;"</nowiki>|#FFB100}} {{Text|<nowiki>'bytes counts the number of total elements</nowiki>|#919191}}
        {{Cl|FOR}} x2 = {{Text|1|#F580B1}} {{Cl|TO}} arrayelements
            {{Text|<nowiki>'create 'secret' variables to assist in passing common arrays</nowiki>|#919191}}
            {{Cl|IF}} x2 > ncommontmp {{Cl|THEN}}
                ncommontmp = ncommontmp + {{Text|1|#F580B1}}
                {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"Calling DIM2(...)..."</nowiki>|#FFB100}}
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                retval = {{Text|dim2|#55FF55}}({{Text|<nowiki>"___RESERVED_COMMON_LBOUND"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(ncommontmp), {{Text|<nowiki>"_INTEGER64"</nowiki>|#FFB100}}, {{Text|0|#F580B1}}, {{Text|<nowiki>""</nowiki>|#FFB100}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                retval = {{Text|dim2|#55FF55}}({{Text|<nowiki>"___RESERVED_COMMON_UBOUND"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(ncommontmp), {{Text|<nowiki>"_INTEGER64"</nowiki>|#FFB100}}, {{Text|0|#F580B1}}, {{Text|<nowiki>""</nowiki>|#FFB100}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"Finished calling DIM2(...)!"</nowiki>|#FFB100}}
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Cl|END}} {{Cl|IF}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_get(FF,NULL,byte_element((uint64)&int64val,8,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*__INTEGER64____RESERVED_COMMON_LBOUND"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(x2) + {{Text|<nowiki>"=int64val;"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_get(FF,NULL,byte_element((uint64)&int64val2,8,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*__INTEGER64____RESERVED_COMMON_UBOUND"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(x2) + {{Text|<nowiki>"=int64val2;"</nowiki>|#FFB100}}
            {{Cl|IF}} command = {{Text|4|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"bytes*=(int64val2-int64val+1);"</nowiki>|#FFB100}}
            {{Cl|IF}} x2 > {{Text|1|#F580B1}} {{Cl|THEN}} e$ = e$ + sp + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp
            e$ = e$ + {{Text|<nowiki>"___RESERVED_COMMON_LBOUND"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(x2) + sp + {{Text|<nowiki>"TO"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"___RESERVED_COMMON_UBOUND"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(x2)
        {{Cl|NEXT}}
        {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"Calling DIM2("</nowiki>|#FFB100}} + purevarname$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + typ$ + {{Text|<nowiki>",0,"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")..."</nowiki>|#FFB100}}
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
        {{Text|<nowiki>'Note: purevarname$ is simply varname$ without the type symbol after it</nowiki>|#919191}}
        redimoption = {{Text|1|#F580B1}}
        retval = {{Text|dim2|#55FF55}}(purevarname$, typ$, {{Text|0|#F580B1}}, e$)
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
        redimoption = {{Text|0|#F580B1}}
        {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"Finished calling DIM2("</nowiki>|#FFB100}} + purevarname$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + typ$ + {{Text|<nowiki>",0,"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")!"</nowiki>|#FFB100}}
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
        {{Cl|IF}} command = {{Text|3|#F580B1}} {{Cl|THEN}}
            {{Text|<nowiki>'use get to load in the array data</nowiki>|#919191}}
            varname$ = varname$ + sp + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp + {{Text|<nowiki>")"</nowiki>|#FFB100}}
            e$ = {{Text|evaluatetotyp|#55FF55}}({{Text|fixoperationorder$|#55FF55}}(varname$), {{Text|-4|#F580B1}})
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_get(FF,NULL,"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>",0);"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} command = {{Text|4|#F580B1}} {{Cl|THEN}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"bytei=0;"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"while(bytei<bytes){"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_get(FF,NULL,byte_element((uint64)&int64val,8,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}} {{Text|<nowiki>'get size</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tqbs=((qbs*)(((uint64*)("</nowiki>|#FFB100}} + n2$ + {{Text|<nowiki>"[0]))[bytei]));"</nowiki>|#FFB100}} {{Text|<nowiki>'get element</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_set(tqbs,qbs_new(int64val>>3,1));"</nowiki>|#FFB100}} {{Text|<nowiki>'change string size</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_get(FF,NULL,byte_element((uint64)tqbs->chr,int64val>>3,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}} {{Text|<nowiki>'get size</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"bytei++;"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'get next command</nowiki>|#919191}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_get(FF,NULL,byte_element((uint64)&int32val,4,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
        {{Text|<nowiki>'save array</nowiki>|#919191}}
        MainTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"chain"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(i) + {{Text|<nowiki>".txt"</nowiki>|#FFB100}})
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"int32val=2;"</nowiki>|#FFB100}} {{Text|<nowiki>'placeholder</nowiki>|#919191}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_put(FF,NULL,byte_element((uint64)&int32val,4,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if ("</nowiki>|#FFB100}} + n2$ + {{Text|<nowiki>"[2]&1){"</nowiki>|#FFB100}} {{Text|<nowiki>'don't add unless defined</nowiki>|#919191}}
        {{Cl|IF}} command = {{Text|3|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"int32val=3;"</nowiki>|#FFB100}}
        {{Cl|IF}} command = {{Text|4|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"int32val=4;"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_put(FF,NULL,byte_element((uint64)&int32val,4,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}}
        {{Cl|IF}} command = {{Text|3|#F580B1}} {{Cl|THEN}}
            {{Text|<nowiki>'size of each element in bits</nowiki>|#919191}}
            bits = t {{Cl|AND}} {{Text|511|#F580B1}}
            {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}} bits = udtxsize(t {{Cl|AND}} {{Text|511|#F580B1}})
            {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}} bits = tsize * {{Text|8|#F580B1}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"int64val="</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(bits) + {{Text|<nowiki>";"</nowiki>|#FFB100}} {{Text|<nowiki>'size in bits</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_put(FF,NULL,byte_element((uint64)&int64val,8,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'com=3</nowiki>|#919191}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"int32val="</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(arrayelements) + {{Text|<nowiki>";"</nowiki>|#FFB100}} {{Text|<nowiki>'number of dimensions</nowiki>|#919191}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_put(FF,NULL,byte_element((uint64)&int32val,4,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}}
        {{Cl|IF}} command = {{Text|3|#F580B1}} {{Cl|THEN}}
            {{Cl|FOR}} x2 = {{Text|1|#F580B1}} {{Cl|TO}} arrayelements
                {{Text|<nowiki>'simulate calls to lbound/ubound</nowiki>|#919191}}
                e$ = {{Text|<nowiki>"LBOUND"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp + n$ + sp + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp + {{Text|str2$|#55FF55}}(x2) + sp + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                e$ = {{Text|evaluatetotyp|#55FF55}}({{Text|fixoperationorder$|#55FF55}}(e$), {{Text|64|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"int64val="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_put(FF,NULL,byte_element((uint64)&int64val,8,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}}
                e$ = {{Text|<nowiki>"UBOUND"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp + n$ + sp + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp + {{Text|str2$|#55FF55}}(x2) + sp + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                e$ = {{Text|evaluatetotyp|#55FF55}}({{Text|fixoperationorder$|#55FF55}}(e$), {{Text|64|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"int64val="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_put(FF,NULL,byte_element((uint64)&int64val,8,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}}
            {{Cl|NEXT}}
            {{Text|<nowiki>'array data</nowiki>|#919191}}
            e$ = {{Text|evaluatetotyp|#55FF55}}({{Text|fixoperationorder$|#55FF55}}(n$ + sp + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp + {{Text|<nowiki>")"</nowiki>|#FFB100}}), {{Text|-4|#F580B1}})
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_put(FF,NULL,"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>",0);"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'com=3</nowiki>|#919191}}
        {{Cl|IF}} command = {{Text|4|#F580B1}} {{Cl|THEN}}
            {{Text|<nowiki>'store LBOUND/UBOUND values and calculate number of total elements/strings</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"bytes=1;"</nowiki>|#FFB100}} {{Text|<nowiki>'note: bytes is actually the total number of elements</nowiki>|#919191}}
            {{Cl|FOR}} x2 = {{Text|1|#F580B1}} {{Cl|TO}} arrayelements
                e$ = {{Text|<nowiki>"LBOUND"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp + n$ + sp + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp + {{Text|str2$|#55FF55}}(x2) + sp + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                e$ = {{Text|evaluatetotyp|#55FF55}}({{Text|fixoperationorder$|#55FF55}}(e$), {{Text|64|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"int64val="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_put(FF,NULL,byte_element((uint64)&int64val,8,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}}
                e$ = {{Text|<nowiki>"UBOUND"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp + n$ + sp + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp + {{Text|str2$|#55FF55}}(x2) + sp + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                e$ = {{Text|evaluatetotyp|#55FF55}}({{Text|fixoperationorder$|#55FF55}}(e$), {{Text|64|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|GOTO}} errmes
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"int64val2="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_put(FF,NULL,byte_element((uint64)&int64val2,8,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"bytes*=(int64val2-int64val+1);"</nowiki>|#FFB100}}
            {{Cl|NEXT}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"bytei=0;"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"while(bytei<bytes){"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tqbs=((qbs*)(((uint64*)("</nowiki>|#FFB100}} + n2$ + {{Text|<nowiki>"[0]))[bytei]));"</nowiki>|#FFB100}} {{Text|<nowiki>'get element</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"int64val=tqbs->len; int64val<<=3;"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_put(FF,NULL,byte_element((uint64)&int64val,8,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}} {{Text|<nowiki>'size of element</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_put(FF,NULL,byte_element((uint64)tqbs->chr,tqbs->len,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>"),0);"</nowiki>|#FFB100}} {{Text|<nowiki>'element data</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"bytei++;"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'com=4</nowiki>|#919191}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}} {{Text|<nowiki>'don't add unless defined</nowiki>|#919191}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'id.arrayelements=-1</nowiki>|#919191}}
{{Cl|NEXT}}
use_global_byte_elements = {{Text|0|#F580B1}}
{{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"Finished generation of code for saving/sharing common array data!"</nowiki>|#FFB100}}
{{Cl|FOR}} closeall = {{Text|1|#F580B1}} {{Cl|TO}} {{Text|255|#F580B1}}: {{Cl|CLOSE}} closeall: {{Cl|NEXT}}
{{Cl|OPEN}} tmpdir$ + {{Text|<nowiki>"temp.bin"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|OUTPUT}} {{Cl|OPEN#File_ACCESS_and_LOCK_Permissions|LOCK}} {{Cl|OPEN#File_ACCESS_and_LOCK_Permissions|WRITE}} {{Cl|OPEN|AS}} #26 {{Text|<nowiki>'relock</nowiki>|#919191}}
compilelog$ = tmpdir$ + {{Text|<nowiki>"compilelog.txt"</nowiki>|#FFB100}}
{{Cl|OPEN}} compilelog$ {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|OUTPUT}} {{Cl|OPEN|AS}} #1: {{Cl|CLOSE}} #1 {{Text|<nowiki>'Clear log</nowiki>|#919191}}
{{Cl|IF}} idemode = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|NOT}} QuietMode {{Cl|THEN}}
    {{Cl|IF}} ConsoleMode {{Cl|THEN}}
        {{Cl|PRINT}} {{Text|<nowiki>"["</nowiki>|#FFB100}} + {{Cl|STRING$}}(maxprogresswidth, {{Text|<nowiki>"."</nowiki>|#FFB100}}) + {{Text|<nowiki>"] 100%"</nowiki>|#FFB100}}
    {{Cl|ELSE}}
        {{Cl|LOCATE}} , {{Text|1|#F580B1}}
        {{Cl|PRINT}} {{Cl|STRING$}}(maxprogresswidth, {{Text|219|#F580B1}}) + {{Text|<nowiki>" 100%"</nowiki>|#FFB100}}
    {{Cl|END}} {{Cl|IF}}
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} {{Cl|NOT}} IgnoreWarnings {{Cl|THEN}}
    totalUnusedVariables = {{Text|0|#F580B1}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} totalVariablesCreated
        {{Cl|IF}} usedVariableList(i).used = {{Text|0|#F580B1}} {{Cl|THEN}}
            totalUnusedVariables = totalUnusedVariables + {{Text|1|#F580B1}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|NEXT}}
    {{Cl|IF}} totalUnusedVariables > {{Text|0|#F580B1}} {{Cl|THEN}}
        maxVarNameLen = {{Text|0|#F580B1}}
        {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} totalVariablesCreated
            {{Cl|IF}} usedVariableList(i).used = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} {{Cl|LEN}}(usedVariableList(i).name) > maxVarNameLen {{Cl|THEN}} maxVarNameLen = {{Cl|LEN}}(usedVariableList(i).name)
            {{Cl|END}} {{Cl|IF}}
        {{Cl|NEXT}}
        header$ = {{Text|<nowiki>"unused variable"</nowiki>|#FFB100}} {{Text|<nowiki>'s (" + LTRIM$(STR$(totalUnusedVariables)) + ")"</nowiki>|#919191}}
        {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} totalVariablesCreated
            {{Cl|IF}} usedVariableList(i).used = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Text|addWarning|#55FF55}} usedVariableList(i).linenumber, usedVariableList(i).includeLevel, usedVariableList(i).includedLine, usedVariableList(i).includedFile, header$, usedVariableList(i).name + {{Cl|SPACE$}}((maxVarNameLen + {{Text|1|#F580B1}}) - {{Cl|LEN}}(usedVariableList(i).name)) + {{Text|<nowiki>"  "</nowiki>|#FFB100}} + usedVariableList(i).varType
            {{Cl|END}} {{Cl|IF}}
        {{Cl|NEXT}}
    {{Cl|END}} {{Cl|IF}}
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} idemode {{Cl|THEN}} {{Cl|GOTO}} ideret5
ide6:
{{Cl|IF}} idemode = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} No_C_Compile_Mode = {{Text|0|#F580B1}} {{Cl|THEN}}
    {{Cl|IF}} {{Cl|NOT}} QuietMode {{Cl|THEN}}
        {{Cl|PRINT}}
        {{Cl|IF}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|PRINT}} {{Text|<nowiki>"Compiling C++ code into executable..."</nowiki>|#FFB100}}
        {{Cl|ELSE}}
            {{Cl|PRINT}} {{Text|<nowiki>"Compiling C++ code into EXE..."</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>' Fixup the output path if either we got an `-o` argument, or we're relative to `_StartDir$`</nowiki>|#919191}}
    {{Cl|IF}} {{Cl|LEN}}(outputfile_cmd$) {{Cl|OR (boolean)|OR}} OutputIsRelativeToStartDir {{Cl|THEN}}
        {{Cl|IF}} {{Cl|LEN}}(outputfile_cmd$) {{Cl|THEN}}
            {{Text|<nowiki>'resolve relative path for output file</nowiki>|#919191}}
            path.out$ = {{Text|getfilepath$|#55FF55}}(outputfile_cmd$)
            f$ = {{Cl|MID$ (function)|MID$}}(outputfile_cmd$, {{Cl|LEN}}(path.out$) + {{Text|1|#F580B1}})
            {{Cl|IF}} {{Cl|UCASE$}}({{Text|GetFileExtension$|#55FF55}}(f$)) = {{Text|<nowiki>"EXE"</nowiki>|#FFB100}} {{Cl|THEN}}
                file$ = {{Text|RemoveFileExtension$|#55FF55}}(f$)
            {{Cl|ELSE}}
                file$ = f$
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} {{Cl|LEN}}(path.out$) {{Cl|OR (boolean)|OR}} OutputIsRelativeToStartDir {{Cl|THEN}}
            currentdir$ = {{Cl|_CWD$}}
            {{Cl|IF}} OutputIsRelativeToStartDir {{Cl|THEN}}
                {{Text|<nowiki>' This CHDIR makes the next CHDIR relative to _STARTDIR$</nowiki>|#919191}}
                {{Text|<nowiki>' We do this if the provided source file was also relative to _STARTDIR$</nowiki>|#919191}}
                {{Cl|CHDIR}} {{Cl|_STARTDIR$}}
                {{Text|<nowiki>' If there was no provided path then that is the same as the</nowiki>|#919191}}
                {{Text|<nowiki>' output file being directly in _STARTDIR$. Assigning it here</nowiki>|#919191}}
                {{Text|<nowiki>' is perfectly fine and avoids failing the error check below</nowiki>|#919191}}
                {{Text|<nowiki>' with a blank string.</nowiki>|#919191}}
                {{Cl|IF}} {{Cl|LEN}}(path.out$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                    path.out$ = {{Cl|_STARTDIR$}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} {{Cl|_DIREXISTS}}(path.out$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Cl|PRINT}}
                {{Cl|PRINT}} {{Text|<nowiki>"Can't create output executable - path not found: "</nowiki>|#FFB100}} + path.out$
                {{Cl|IF}} ConsoleMode {{Cl|THEN}} {{Cl|SYSTEM}} {{Text|1|#F580B1}}
                {{Cl|END}} {{Text|1|#F580B1}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|CHDIR}} path.out$
            path.out$ = {{Cl|_CWD$}}
            {{Cl|CHDIR}} currentdir$
            {{Cl|IF}} {{Cl|RIGHT$}}(path.out$, {{Text|1|#F580B1}}) <> pathsep$ {{Cl|THEN}} path.out$ = path.out$ + pathsep$
            path.exe$ = path.out$
            SaveExeWithSource = {{Text|-1|#F580B1}} {{Text|<nowiki>'Override the global setting if an output file was specified</nowiki>|#919191}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    t.path.exe$ = path.exe$
    {{Cl|IF}} {{Cl|_FILEEXISTS}}(path.exe$ + file$ + extension$) {{Cl|THEN}}
        E = {{Text|0|#F580B1}}
        {{Cl|ON}} {{Cl|ERROR}} {{Cl|GOTO}} qberror_test
        {{Cl|KILL}} path.exe$ + file$ + extension$
        {{Cl|ON}} {{Cl|ERROR}} {{Cl|GOTO}} qberror
        {{Cl|IF}} E = {{Text|1|#F580B1}} {{Cl|THEN}}
            a$ = {{Text|<nowiki>"CANNOT CREATE "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + file$ + extension$ + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>" BECAUSE THE FILE IS ALREADY IN USE!"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    path.exe$ = t.path.exe$
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} ExeIconSet {{Cl|THEN}}
    linenumber = ExeIconSet {{Text|<nowiki>'on error, this allows reporting the linenumber where $EXEICON was used</nowiki>|#919191}}
    wholeline = {{Text|<nowiki>" $EXEICON:'"</nowiki>|#FFB100}} + ExeIconFile$ + {{Text|<nowiki>"'"</nowiki>|#FFB100}}
    {{Text|<nowiki>' Copy icon file into temp directory with known name</nowiki>|#919191}}
    {{Text|<nowiki>' This solves the problem of the resource file needing an absolute path</nowiki>|#919191}}
    {{Cl|ON}} {{Cl|ERROR}} {{Cl|GOTO}} qberror_test
    {{Cl|DIM}} errNo {{Cl|AS}} {{Cl|LONG}}
    errNo = {{Text|CopyFile&|#55FF55}}(ExeIconFile$, tmpdir$ + {{Text|<nowiki>"icon.ico"</nowiki>|#FFB100}})
    {{Cl|IF}} errNo <> {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Error copying "</nowiki>|#FFB100}} + {{Text|QuotedFilename$|#55FF55}}(ExeIconFile$) + {{Text|<nowiki>" to temp directory"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
    {{Cl|ON}} {{Cl|ERROR}} {{Cl|GOTO}} qberror
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} VersionInfoSet {{Cl|THEN}}
    ManiBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + file$ + extension$ + {{Text|<nowiki>".manifest"</nowiki>|#FFB100}})
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"<?xml version="</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"1.0"</nowiki>|#FFB100}}) + {{Text|<nowiki>" encoding="</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"UTF-8"</nowiki>|#FFB100}}) + {{Text|<nowiki>" standalone="</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"yes"</nowiki>|#FFB100}}) + {{Text|<nowiki>"?>"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"<assembly xmlns="</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"urn:schemas-microsoft-com:asm.v1"</nowiki>|#FFB100}}) + {{Text|<nowiki>" manifestVersion="</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"1.0"</nowiki>|#FFB100}}) + {{Text|<nowiki>">"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"<assemblyIdentity"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"    version="</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"1.0.0.0"</nowiki>|#FFB100}})
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"    processorArchitecture="</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"*"</nowiki>|#FFB100}})
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"    name="</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(viCompanyName$ + {{Text|<nowiki>"."</nowiki>|#FFB100}} + viProductName$ + {{Text|<nowiki>"."</nowiki>|#FFB100}} + viProductName$)
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"    type="</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"win32"</nowiki>|#FFB100}})
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"/>"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"<description>"</nowiki>|#FFB100}} + viFileDescription$ + {{Text|<nowiki>"</description>"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"<dependency>"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"    <dependentAssembly>"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"        <assemblyIdentity"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"            type="</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"win32"</nowiki>|#FFB100}})
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"            name="</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"Microsoft.Windows.Common-Controls"</nowiki>|#FFB100}})
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"            version="</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"6.0.0.0"</nowiki>|#FFB100}})
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"            processorArchitecture="</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"*"</nowiki>|#FFB100}})
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"            publicKeyToken="</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"6595b64144ccf1df"</nowiki>|#FFB100}})
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"            language="</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"*"</nowiki>|#FFB100}})
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"        />"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"    </dependentAssembly>"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"</dependency>"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"</assembly>"</nowiki>|#FFB100}}
    ManiBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"manifest.h"</nowiki>|#FFB100}})
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"#ifndef RESOURCE_H"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"#define  RESOURCE_H"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"#ifdef    __cplusplus"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"extern "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"C"</nowiki>|#FFB100}}) + {{Text|<nowiki>" {"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"#endif"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"#ifdef    __cplusplus"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"#endif"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"#endif    /* RESOURCE_H */"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"#define CREATEPROCESS_MANIFEST_RESOURCE_ID 1 /*Defined manifest file*/"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} ManiBuf, {{Text|<nowiki>"#define RT_MANIFEST                      24"</nowiki>|#FFB100}}
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} VersionInfoSet {{Cl|OR (boolean)|OR}} ExeIconSet {{Cl|THEN}}
    IconRcBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"O"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"icon.rc"</nowiki>|#FFB100}})
    {{Cl|IF}} ExeIconSet {{Cl|THEN}}
        {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>"0 ICON "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"icon.ico"</nowiki>|#FFB100}})
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} VersionInfoSet {{Cl|THEN}}
        {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>"#include "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"manifest.h"</nowiki>|#FFB100}})
        {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>"CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(file$ + extension$ + {{Text|<nowiki>".manifest"</nowiki>|#FFB100}})
        {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>"1 VERSIONINFO"</nowiki>|#FFB100}}
        {{Cl|IF}} {{Cl|LEN}}(viFileVersionNum$) {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>"FILEVERSION    "</nowiki>|#FFB100}} + viFileVersionNum$
        {{Cl|IF}} {{Cl|LEN}}(viProductVersionNum$) {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>"PRODUCTVERSION  "</nowiki>|#FFB100}} + viProductVersionNum$
        {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>"BEGIN"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>"    BLOCK "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"StringFileInfo"</nowiki>|#FFB100}})
        {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>"    BEGIN"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>"        BLOCK "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"040904E4"</nowiki>|#FFB100}})
        {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>"        BEGIN"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>"            VALUE "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"CompanyName"</nowiki>|#FFB100}}) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(viCompanyName$ + {{Text|<nowiki>"\0"</nowiki>|#FFB100}})
        {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>"            VALUE "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"FileDescription"</nowiki>|#FFB100}}) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(viFileDescription$ + {{Text|<nowiki>"\0"</nowiki>|#FFB100}})
        {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>"            VALUE "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"FileVersion"</nowiki>|#FFB100}}) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(viFileVersion$ + {{Text|<nowiki>"\0"</nowiki>|#FFB100}})
        {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>"            VALUE "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"InternalName"</nowiki>|#FFB100}}) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(viInternalName$ + {{Text|<nowiki>"\0"</nowiki>|#FFB100}})
        {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>"            VALUE "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"LegalCopyright"</nowiki>|#FFB100}}) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(viLegalCopyright$ + {{Text|<nowiki>"\0"</nowiki>|#FFB100}})
        {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>"            VALUE "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"LegalTrademarks"</nowiki>|#FFB100}}) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(viLegalTrademarks$ + {{Text|<nowiki>"\0"</nowiki>|#FFB100}})
        {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>"            VALUE "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"OriginalFilename"</nowiki>|#FFB100}}) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(viOriginalFilename$ + {{Text|<nowiki>"\0"</nowiki>|#FFB100}})
        {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>"            VALUE "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"ProductName"</nowiki>|#FFB100}}) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(viProductName$ + {{Text|<nowiki>"\0"</nowiki>|#FFB100}})
        {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>"            VALUE "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"ProductVersion"</nowiki>|#FFB100}}) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(viProductVersion$ + {{Text|<nowiki>"\0"</nowiki>|#FFB100}})
        {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>"            VALUE "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"Comments"</nowiki>|#FFB100}}) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(viComments$ + {{Text|<nowiki>"\0"</nowiki>|#FFB100}})
        {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>"            VALUE "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"Web"</nowiki>|#FFB100}}) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(viWeb$ + {{Text|<nowiki>"\0"</nowiki>|#FFB100}})
        {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>"        END"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>"    END"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>"    BLOCK "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"VarFileInfo"</nowiki>|#FFB100}})
        {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>"    BEGIN"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>"            VALUE "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"Translation"</nowiki>|#FFB100}}) + {{Text|<nowiki>", 0x409, 0x04E4"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>"    END"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} IconRcBuf, {{Text|<nowiki>"END"</nowiki>|#FFB100}}
    {{Cl|END}} {{Cl|IF}}
{{Cl|END}} {{Cl|IF}}
{{Text|<nowiki>'Write out all buffered files, all remaining</nowiki>|#919191}}
{{Text|<nowiki>'actions are performed on the disk based files</nowiki>|#919191}}
{{Text|WriteBuffers|#55FF55}} {{Text|<nowiki>""</nowiki>|#FFB100}}
{{Cl|IF}} MidiSoundFontSet {{Cl|THEN}}
    linenumber = MidiSoundFontSet
    wholeline = MidiSoundFontLine$
    {{Cl|IF}} MidiSoundFont$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
        MidiSoundFont$ = {{Text|<nowiki>"internal/support/default_soundfont.sf2"</nowiki>|#FFB100}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|ON}} {{Cl|ERROR}} {{Cl|GOTO}} qberror_test
    errNo = {{Text|CopyFile&|#55FF55}}(MidiSoundFont$, tmpdir$ + {{Text|<nowiki>"soundfont.sf2"</nowiki>|#FFB100}})
    {{Cl|IF}} errNo <> {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Error copying "</nowiki>|#FFB100}} + {{Text|QuotedFilename$|#55FF55}}(MidiSoundFont$) + {{Text|<nowiki>" to temp directory"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
    {{Cl|ON}} {{Cl|ERROR}} {{Cl|GOTO}} qberror
{{Cl|END}} {{Cl|IF}}
{{Text|<nowiki>'Update dependencies</nowiki>|#919191}}
o$ = {{Cl|LCASE$}}(os$)
win = {{Text|0|#F580B1}}: {{Cl|IF}} os$ = {{Text|<nowiki>"WIN"</nowiki>|#FFB100}} {{Cl|THEN}} win = {{Text|1|#F580B1}}
lnx = {{Text|0|#F580B1}}: {{Cl|IF}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Cl|THEN}} lnx = {{Text|1|#F580B1}}
mac = {{Text|0|#F580B1}}: {{Cl|IF}} MacOSX {{Cl|THEN}} mac = {{Text|1|#F580B1}}: o$ = {{Text|<nowiki>"osx"</nowiki>|#FFB100}}
ver$ = Version$ {{Text|<nowiki>'eg. "0.123"</nowiki>|#919191}}
libs$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
makedeps$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
make$ = {{Text|GetMakeExecutable$|#55FF55}}
localpath$ = {{Text|<nowiki>"internal\c\"</nowiki>|#FFB100}}
{{Cl|IF}} DEPENDENCY(DEPENDENCY_GL) {{Cl|THEN}} makedeps$ = makedeps$ + {{Text|<nowiki>" DEP_GL=y"</nowiki>|#FFB100}}
{{Cl|IF}} DEPENDENCY(DEPENDENCY_SCREENIMAGE) {{Cl|THEN}} makedeps$ = makedeps$ + {{Text|<nowiki>" DEP_SCREENIMAGE=y"</nowiki>|#FFB100}}
{{Cl|IF}} DEPENDENCY(DEPENDENCY_IMAGE_CODEC) {{Cl|THEN}} makedeps$ = makedeps$ + {{Text|<nowiki>" DEP_IMAGE_CODEC=y"</nowiki>|#FFB100}}
{{Cl|IF}} DEPENDENCY(DEPENDENCY_CONSOLE_ONLY) {{Cl|THEN}} makedeps$ = makedeps$ + {{Text|<nowiki>" DEP_CONSOLE_ONLY=y"</nowiki>|#FFB100}}
{{Cl|IF}} DEPENDENCY(DEPENDENCY_SOCKETS) {{Cl|THEN}} makedeps$ = makedeps$ + {{Text|<nowiki>" DEP_SOCKETS=y"</nowiki>|#FFB100}}
{{Cl|IF}} DEPENDENCY(DEPENDENCY_PRINTER) {{Cl|THEN}} makedeps$ = makedeps$ + {{Text|<nowiki>" DEP_PRINTER=y"</nowiki>|#FFB100}}
{{Cl|IF}} DEPENDENCY(DEPENDENCY_ICON) {{Cl|THEN}} makedeps$ = makedeps$ + {{Text|<nowiki>" DEP_ICON=y"</nowiki>|#FFB100}}
{{Cl|IF}} DEPENDENCY(DEPENDENCY_SCREENIMAGE) {{Cl|THEN}} makedeps$ = makedeps$ + {{Text|<nowiki>" DEP_SCREENIMAGE=y"</nowiki>|#FFB100}}
{{Cl|IF}} DEPENDENCY(DEPENDENCY_LOADFONT) {{Cl|THEN}} makedeps$ = makedeps$ + {{Text|<nowiki>" DEP_FONT=y"</nowiki>|#FFB100}}
{{Cl|IF}} DEPENDENCY(DEPENDENCY_DEVICEINPUT) {{Cl|THEN}} makedeps$ = makedeps$ + {{Text|<nowiki>" DEP_DEVICEINPUT=y"</nowiki>|#FFB100}}
{{Cl|IF}} DEPENDENCY(DEPENDENCY_ZLIB) {{Cl|THEN}} makedeps$ = makedeps$ + {{Text|<nowiki>" DEP_ZLIB=y"</nowiki>|#FFB100}}
{{Cl|IF}} inline_DATA = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} DataOffset {{Cl|THEN}} makedeps$ = makedeps$ + {{Text|<nowiki>" DEP_DATA=y"</nowiki>|#FFB100}}
{{Cl|IF}} Console {{Cl|THEN}} makedeps$ = makedeps$ + {{Text|<nowiki>" DEP_CONSOLE=y"</nowiki>|#FFB100}}
{{Cl|IF}} ExeIconSet {{Cl|OR (boolean)|OR}} VersionInfoSet {{Cl|THEN}} makedeps$ = makedeps$ + {{Text|<nowiki>" DEP_ICON_RC=y"</nowiki>|#FFB100}}
{{Cl|IF}} {{Cl|NOT}} UseMiniaudioBackend {{Cl|THEN}}
    {{Cl|IF}} DEPENDENCY(DEPENDENCY_AUDIO_DECODE) {{Cl|THEN}} makedeps$ = makedeps$ + {{Text|<nowiki>" DEP_AUDIO_DECODE=y"</nowiki>|#FFB100}}
    {{Cl|IF}} DEPENDENCY(DEPENDENCY_AUDIO_CONVERSION) {{Cl|THEN}} makedeps$ = makedeps$ + {{Text|<nowiki>" DEP_AUDIO_CONVERSION=y"</nowiki>|#FFB100}}
    {{Cl|IF}} DEPENDENCY(DEPENDENCY_AUDIO_OUT) {{Cl|THEN}} makedeps$ = makedeps$ + {{Text|<nowiki>" DEP_AUDIO_OUT=y"</nowiki>|#FFB100}}
{{Cl|ELSE}}
    {{Cl|IF}} DEPENDENCY(DEPENDENCY_AUDIO_DECODE) {{Cl|OR (boolean)|OR}} DEPENDENCY(DEPENDENCY_AUDIO_CONVERSION) {{Cl|OR (boolean)|OR}} DEPENDENCY(DEPENDENCY_AUDIO_OUT) {{Cl|THEN}}
        makedeps$ = makedeps$ + {{Text|<nowiki>" DEP_AUDIO_MINIAUDIO=y"</nowiki>|#FFB100}}
    {{Cl|END}} {{Cl|IF}}
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} unstableFlags(UNSTABLE_HTTP) {{Cl|AND (boolean)|AND}} DEPENDENCY(DEPENDENCY_SOCKETS) <> {{Text|0|#F580B1}} {{Cl|THEN}}
    makedeps$ = makedeps$ + {{Text|<nowiki>" DEP_HTTP=y"</nowiki>|#FFB100}}
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} MidiSoundFontSet {{Cl|THEN}} makedeps$ = makedeps$ + {{Text|<nowiki>" DEP_AUDIO_DECODE_MIDI=y"</nowiki>|#FFB100}}
{{Cl|IF}} tempfolderindex > {{Text|1|#F580B1}} {{Cl|THEN}} makedeps$ = makedeps$ + {{Text|<nowiki>" TEMP_ID="</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(tempfolderindex)
CxxFlagsExtra$ = ExtraCppFlags
CxxLibsExtra$ = ExtraLinkerFlags
{{Text|<nowiki>' If debugging then use `-Og` rather than `-O2`</nowiki>|#919191}}
{{Cl|IF}} OptimizeCppProgram {{Cl|THEN}}
    {{Cl|IF}} Include_GDB_Debugging_Info {{Cl|THEN}}
        CxxFlagsExtra$ = CxxFlagsExtra$ + {{Text|<nowiki>" -Og"</nowiki>|#FFB100}}
    {{Cl|ELSE}}
        CxxFlagsExtra$ = CxxFlagsExtra$ + {{Text|<nowiki>" -O2"</nowiki>|#FFB100}}
    {{Cl|END}} {{Cl|IF}}
{{Cl|ELSE}}
    {{Cl|IF}} Include_GDB_Debugging_Info {{Cl|THEN}}
        CxxFlagsExtra$ = CxxFlagsExtra$ + {{Text|<nowiki>" -g"</nowiki>|#FFB100}}
    {{Cl|END}} {{Cl|IF}}
{{Cl|END}} {{Cl|IF}}
CxxLibsExtra$ = CxxLibsExtra$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} + mylib$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} + mylibopt$
{{Text|<nowiki>' Make and the shell don't like certain characters in the file name, so we</nowiki>|#919191}}
{{Text|<nowiki>' escape them to get them to handle them properly</nowiki>|#919191}}
escapedExe$ = {{Text|StrReplace$|#55FF55}}(path.exe$ + file$ + extension$, {{Text|<nowiki>" "</nowiki>|#FFB100}}, {{Text|<nowiki>"\ "</nowiki>|#FFB100}})
escapedExe$ = {{Text|StrReplace$|#55FF55}}(escapedExe$, {{Cl|CHR$}}({{Text|34|#F580B1}}), {{Text|<nowiki>"\"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}))
escapedExe$ = {{Text|StrReplace$|#55FF55}}(escapedExe$, {{Text|<nowiki>"$"</nowiki>|#FFB100}}, {{Text|<nowiki>"$$"</nowiki>|#FFB100}})
makeline$ = make$ + makedeps$ + {{Text|<nowiki>" EXE="</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(escapedExe$)
makeline$ = makeline$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"CXXFLAGS_EXTRA="</nowiki>|#FFB100}} + CxxFlagsExtra$)
makeline$ = makeline$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"CFLAGS_EXTRA="</nowiki>|#FFB100}} + CxxFlagsExtra$)
makeline$ = makeline$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|<nowiki>"CXXLIBS_EXTRA="</nowiki>|#FFB100}} + CxxLibsExtra$)
makeline$ = makeline$ + {{Text|<nowiki>" -j"</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}({{Text|str2$|#55FF55}}(MaxParallelProcesses))
{{Cl|IF}} {{Cl|NOT}} StripDebugSymbols {{Cl|THEN}}
    makeline$ = makeline$ + {{Text|<nowiki>" STRIP_SYMBOLS=n"</nowiki>|#FFB100}}
{{Cl|END}} {{Cl|IF}}
{{Text|<nowiki>' We avoid generating the license file if the user picked the "No Exe" option</nowiki>|#919191}}
{{Cl|IF}} GenerateLicenseFile {{Cl|AND (boolean)|AND}} {{Cl|NOT}} NoExeSaved {{Cl|THEN}}
    makeline$ = makeline$ + {{Text|<nowiki>" GENERATE_LICENSE=y"</nowiki>|#FFB100}}
{{Cl|END}} {{Cl|IF}}
{{Text|<nowiki>'Clear nm output from previous runs</nowiki>|#919191}}
{{Cl|FOR}} x = {{Text|1|#F580B1}} {{Cl|TO}} ResolveStaticFunctions
    {{Cl|IF}} {{Cl|LEN}}(ResolveStaticFunction_File(x)) {{Cl|THEN}}
        s$ = {{Text|MakeNMOutputFilename$|#55FF55}}(ResolveStaticFunction_File(x), {{Text|0|#F580B1}})
        {{Cl|IF}} {{Cl|_FILEEXISTS}}(s$) {{Cl|THEN}} {{Cl|KILL}} s$: {{Text|ClearBuffers|#55FF55}} s$
        s$ = {{Text|MakeNMOutputFilename$|#55FF55}}(ResolveStaticFunction_File(x), {{Text|1|#F580B1}})
        {{Cl|IF}} {{Cl|_FILEEXISTS}}(s$) {{Cl|THEN}} {{Cl|KILL}} s$: {{Text|ClearBuffers|#55FF55}} s$
    {{Cl|END}} {{Cl|IF}}
{{Cl|NEXT}} x
{{Text|<nowiki>' Delete existing qbx.o file, it ensures that it always gets rebuilt</nowiki>|#919191}}
{{Cl|ON}} {{Cl|ERROR}} {{Cl|GOTO}} qberror_test
{{Cl|IF}} tempfolderindex > {{Text|1|#F580B1}} {{Cl|THEN}}
    {{Cl|KILL}} {{Text|<nowiki>"internal/c/qbx"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(tempfolderindex) + {{Text|<nowiki>".o"</nowiki>|#FFB100}}
{{Cl|ELSE}}
    {{Cl|KILL}} {{Text|<nowiki>"internal/c/qbx.o"</nowiki>|#FFB100}}
{{Cl|END}} {{Cl|IF}}
{{Cl|ON}} {{Cl|ERROR}} {{Cl|GOTO}} qberror
{{Cl|IF}} os$ = {{Text|<nowiki>"WIN"</nowiki>|#FFB100}} {{Cl|THEN}}
    makeline$ = makeline$ + {{Text|<nowiki>" OS=win"</nowiki>|#FFB100}}
    {{Text|<nowiki>'resolve static function definitions and add to global.txt</nowiki>|#919191}}
    {{Cl|FOR}} x = {{Text|1|#F580B1}} {{Cl|TO}} ResolveStaticFunctions
        nm_output_file$ = {{Text|MakeNMOutputFilename$|#55FF55}}(ResolveStaticFunction_File(x), {{Text|0|#F580B1}})
        nm_output_file_dynamic$ = {{Text|MakeNMOutputFilename$|#55FF55}}(ResolveStaticFunction_File(x), {{Text|1|#F580B1}})
        {{Cl|IF}} {{Cl|LEN}}(ResolveStaticFunction_File(x)) {{Cl|THEN}}
            n = {{Text|0|#F580B1}}
            {{Cl|IF}} {{Cl|NOT}} {{Cl|_FILEEXISTS}}(nm_output_file$) {{Cl|THEN}}
                {{Cl|SHELL}} {{Cl|_HIDE}} {{Text|<nowiki>"cmd /c internal\c\c_compiler\bin\nm.exe "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(ResolveStaticFunction_File(x)) + {{Text|<nowiki>" --demangle -g >"</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(nm_output_file$)
            {{Cl|END}} {{Cl|IF}}
            s$ = {{Text|<nowiki>" "</nowiki>|#FFB100}} + ResolveStaticFunction_Name(x) + {{Text|<nowiki>"("</nowiki>|#FFB100}}
            fh = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"I"</nowiki>|#FFB100}}, nm_output_file$)
            {{Cl|DO}} {{Cl|UNTIL}} {{Text|EndOfBuf%|#55FF55}}(fh)
                a$ = {{Text|ReadBufLine$|#55FF55}}(fh)
                {{Cl|IF}} {{Cl|LEN}}(a$) {{Cl|THEN}}
                    {{Text|<nowiki>'search for SPACE+functionname+LEFTBRACKET</nowiki>|#919191}}
                    x1 = {{Cl|INSTR}}(a$, s$)
                    {{Cl|IF}} x1 {{Cl|THEN}}
                        {{Cl|IF}} ResolveStaticFunction_Method(x) = {{Text|1|#F580B1}} {{Cl|THEN}}
                            x1 = x1 + {{Text|1|#F580B1}}
                            x2 = {{Cl|INSTR}}(x1, a$, {{Text|<nowiki>")"</nowiki>|#FFB100}})
                            fh2 = {{Cl|FREEFILE}}
                            {{Cl|OPEN}} tmpdir$ + {{Text|<nowiki>"global.txt"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|APPEND}} {{Cl|OPEN|AS}} #fh2
                            {{Cl|PRINT (file statement)|PRINT}} #fh2, {{Text|<nowiki>"extern void "</nowiki>|#FFB100}} + {{Cl|MID$ (function)|MID$}}(a$, x1, x2 - x1 + {{Text|1|#F580B1}}) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                            {{Cl|CLOSE}} #fh2
                        {{Cl|END}} {{Cl|IF}}
                        n = n + {{Text|1|#F580B1}}
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'x1</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'<>""</nowiki>|#919191}}
            {{Cl|LOOP}}
            {{Cl|IF}} n > {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Unable to resolve multiple instances of sub/function '"</nowiki>|#FFB100}} + ResolveStaticFunction_Name(x) + {{Text|<nowiki>"' in '"</nowiki>|#FFB100}} + ResolveStaticFunction_File(x) + {{Text|<nowiki>"'"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|IF}} n = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'attempt to locate simple function name without brackets</nowiki>|#919191}}
                s$ = {{Text|<nowiki>" "</nowiki>|#FFB100}} + ResolveStaticFunction_Name(x)
                fh = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"I"</nowiki>|#FFB100}}, nm_output_file$)
                {{Cl|DO}} {{Cl|UNTIL}} {{Text|EndOfBuf%|#55FF55}}(fh)
                    a$ = {{Text|ReadBufLine$|#55FF55}}(fh)
                    {{Cl|IF}} {{Cl|LEN}}(a$) {{Cl|THEN}}
                        {{Text|<nowiki>'search for SPACE+functionname</nowiki>|#919191}}
                        x1 = {{Cl|INSTR}}(a$, s$)
                        {{Cl|IF}} {{Cl|RIGHT$}}(a$, {{Cl|LEN}}(s$)) = s$ {{Cl|THEN}}
                            fh2 = {{Cl|FREEFILE}}
                            {{Cl|IF}} ResolveStaticFunction_Method(x) = {{Text|1|#F580B1}} {{Cl|THEN}}
                                {{Cl|OPEN}} tmpdir$ + {{Text|<nowiki>"global.txt"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|APPEND}} {{Cl|OPEN|AS}} #fh2
                                {{Cl|PRINT (file statement)|PRINT}} #fh2, {{Text|<nowiki>"extern "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"C"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"{"</nowiki>|#FFB100}}
                                {{Cl|PRINT (file statement)|PRINT}} #fh2, {{Text|<nowiki>"extern void "</nowiki>|#FFB100}} + s$ + {{Text|<nowiki>"(void);"</nowiki>|#FFB100}}
                                {{Cl|PRINT (file statement)|PRINT}} #fh2, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                            {{Cl|ELSE}}
                                {{Cl|OPEN}} tmpdir$ + {{Text|<nowiki>"externtype"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(x) + {{Text|<nowiki>".txt"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|OUTPUT}} {{Cl|OPEN|AS}} #fh2
                                {{Cl|PRINT (file statement)|PRINT}} #fh2, {{Text|<nowiki>"extern "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"C"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>" "</nowiki>|#FFB100}}
                            {{Cl|END}} {{Cl|IF}}
                            {{Cl|CLOSE}} #fh2
                            n = n + {{Text|1|#F580B1}}
                            {{Cl|EXIT}} {{Cl|DO}}
                        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'x1</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'<>""</nowiki>|#919191}}
                {{Cl|LOOP}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} n = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'a C++ dynamic object library?</nowiki>|#919191}}
                {{Cl|IF}} {{Cl|NOT}} {{Cl|_FILEEXISTS}}(nm_output_file_dynamic$) {{Cl|THEN}}
                    {{Cl|SHELL}} {{Cl|_HIDE}} {{Text|<nowiki>"cmd /c internal\c\c_compiler\bin\nm.exe "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(ResolveStaticFunction_File(x)) + {{Text|<nowiki>" -D --demangle -g >"</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(nm_output_file_dynamic$)
                {{Cl|END}} {{Cl|IF}}
                s$ = {{Text|<nowiki>" "</nowiki>|#FFB100}} + ResolveStaticFunction_Name(x) + {{Text|<nowiki>"("</nowiki>|#FFB100}}
                fh = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"I"</nowiki>|#FFB100}}, nm_output_file$)
                {{Cl|DO}} {{Cl|UNTIL}} {{Text|EndOfBuf%|#55FF55}}(fh)
                    a$ = {{Text|ReadBufLine$|#55FF55}}(fh)
                    {{Cl|IF}} {{Cl|LEN}}(a$) {{Cl|THEN}}
                        {{Text|<nowiki>'search for SPACE+functionname+LEFTBRACKET</nowiki>|#919191}}
                        x1 = {{Cl|INSTR}}(a$, s$)
                        {{Cl|IF}} x1 {{Cl|THEN}}
                            {{Cl|IF}} ResolveStaticFunction_Method(x) = {{Text|1|#F580B1}} {{Cl|THEN}}
                                x1 = x1 + {{Text|1|#F580B1}}
                                x2 = {{Cl|INSTR}}(x1, a$, {{Text|<nowiki>")"</nowiki>|#FFB100}})
                                fh2 = {{Cl|FREEFILE}}
                                {{Cl|OPEN}} tmpdir$ + {{Text|<nowiki>"global.txt"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|APPEND}} {{Cl|OPEN|AS}} #fh2
                                {{Cl|PRINT (file statement)|PRINT}} #fh2, {{Text|<nowiki>"extern void "</nowiki>|#FFB100}} + {{Cl|MID$ (function)|MID$}}(a$, x1, x2 - x1 + {{Text|1|#F580B1}}) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                                {{Cl|CLOSE}} #fh2
                            {{Cl|END}} {{Cl|IF}}
                            n = n + {{Text|1|#F580B1}}
                        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'x1</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'<>""</nowiki>|#919191}}
                {{Cl|LOOP}}
                {{Cl|IF}} n > {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Unable to resolve multiple instances of sub/function '"</nowiki>|#FFB100}} + ResolveStaticFunction_Name(x) + {{Text|<nowiki>"' in '"</nowiki>|#FFB100}} + ResolveStaticFunction_File(x) + {{Text|<nowiki>"'"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} n = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'a C dynamic object library?</nowiki>|#919191}}
                s$ = {{Text|<nowiki>" "</nowiki>|#FFB100}} + ResolveStaticFunction_Name(x)
                fh = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"I"</nowiki>|#FFB100}}, nm_output_file_dynamic$)
                {{Cl|DO}} {{Cl|UNTIL}} {{Text|EndOfBuf%|#55FF55}}(fh)
                    a$ = {{Text|ReadBufLine$|#55FF55}}(fh)
                    {{Cl|IF}} {{Cl|LEN}}(a$) {{Cl|THEN}}
                        {{Text|<nowiki>'search for SPACE+functionname</nowiki>|#919191}}
                        x1 = {{Cl|INSTR}}(a$, s$)
                        {{Cl|IF}} {{Cl|RIGHT$}}(a$, {{Cl|LEN}}(s$)) = s$ {{Cl|THEN}}
                            fh2 = {{Cl|FREEFILE}}
                            {{Cl|IF}} ResolveStaticFunction_Method(x) = {{Text|1|#F580B1}} {{Cl|THEN}}
                                {{Cl|OPEN}} tmpdir$ + {{Text|<nowiki>"global.txt"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|APPEND}} {{Cl|OPEN|AS}} #fh2
                                {{Cl|PRINT (file statement)|PRINT}} #fh2, {{Text|<nowiki>"extern "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"C"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"{"</nowiki>|#FFB100}}
                                {{Cl|PRINT (file statement)|PRINT}} #fh2, {{Text|<nowiki>"extern void "</nowiki>|#FFB100}} + s$ + {{Text|<nowiki>"(void);"</nowiki>|#FFB100}}
                                {{Cl|PRINT (file statement)|PRINT}} #fh2, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                            {{Cl|ELSE}}
                                {{Cl|OPEN}} tmpdir$ + {{Text|<nowiki>"externtype"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(x) + {{Text|<nowiki>".txt"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|OUTPUT}} {{Cl|OPEN|AS}} #fh2
                                {{Cl|PRINT (file statement)|PRINT}} #fh2, {{Text|<nowiki>"extern "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"C"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>" "</nowiki>|#FFB100}}
                            {{Cl|END}} {{Cl|IF}}
                            {{Cl|CLOSE}} #fh2
                            n = n + {{Text|1|#F580B1}}
                            {{Cl|EXIT}} {{Cl|DO}}
                        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'x1</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'<>""</nowiki>|#919191}}
                {{Cl|LOOP}}
                {{Cl|IF}} n = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Could not find sub/function '"</nowiki>|#FFB100}} + ResolveStaticFunction_Name(x) + {{Text|<nowiki>"' in '"</nowiki>|#FFB100}} + ResolveStaticFunction_File(x) + {{Text|<nowiki>"'"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|NEXT}}
    {{Cl|IF}} No_C_Compile_Mode = {{Text|0|#F580B1}} {{Cl|THEN}}
        {{Cl|SHELL}} {{Cl|_HIDE}} {{Text|<nowiki>"cmd /c "</nowiki>|#FFB100}} + makeline$ + {{Text|<nowiki>" 1>> "</nowiki>|#FFB100}} + compilelog$ + {{Text|<nowiki>" 2>&1"</nowiki>|#FFB100}}
        {{Cl|IF}} idemode {{Cl|THEN}}
            {{Text|<nowiki>'Restore fg/bg colors</nowiki>|#919191}}
            dummy = {{Text|DarkenFGBG|#55FF55}}({{Text|0|#F580B1}})
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    ffh = {{Cl|FREEFILE}}
    {{Cl|OPEN}} tmpdir$ + {{Text|<nowiki>"debug_win.bat"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|OUTPUT}} {{Cl|OPEN|AS}} #ffh
    {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"@echo off"</nowiki>|#FFB100}}
    {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"cd %0\..\"</nowiki>|#FFB100}}
    {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"cd ../.."</nowiki>|#FFB100}}
    {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"echo C++ Debugging: "</nowiki>|#FFB100}} + file$ + extension$ + {{Text|<nowiki>" using gdb.exe"</nowiki>|#FFB100}}
    {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"echo Debugger commands:"</nowiki>|#FFB100}}
    {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"echo After the debugger launches type 'run' to start your program"</nowiki>|#FFB100}}
    {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"echo After your program crashes type 'list' to find where the problem is and fix/report it"</nowiki>|#FFB100}}
    {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"echo Type 'quit' to exit"</nowiki>|#FFB100}}
    {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"echo (the GDB debugger has many other useful commands, this advice is for beginners)"</nowiki>|#FFB100}}
    {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"pause"</nowiki>|#FFB100}}
    {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"internal\c\c_compiler\bin\gdb.exe "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + path.exe$ + file$ + extension$ + {{Cl|CHR$}}({{Text|34|#F580B1}})
    {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"pause"</nowiki>|#FFB100}}
    {{Cl|CLOSE}} ffh
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Cl|THEN}}
    {{Cl|IF}} {{Cl|INSTR}}({{Cl|_OS$}}, {{Text|<nowiki>"[MACOSX]"</nowiki>|#FFB100}}) {{Cl|THEN}}
        makeline$ = makeline$ + {{Text|<nowiki>" OS=osx"</nowiki>|#FFB100}}
    {{Cl|ELSE}}
        makeline$ = makeline$ + {{Text|<nowiki>" OS=lnx"</nowiki>|#FFB100}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|FOR}} x = {{Text|1|#F580B1}} {{Cl|TO}} ResolveStaticFunctions
        nm_output_file$ = {{Text|MakeNMOutputFilename$|#55FF55}}(ResolveStaticFunction_File(x), {{Text|0|#F580B1}})
        nm_output_file_dynamic$ = {{Text|MakeNMOutputFilename$|#55FF55}}(ResolveStaticFunction_File(x), {{Text|1|#F580B1}})
        {{Cl|IF}} {{Cl|LEN}}(ResolveStaticFunction_File(x)) {{Cl|THEN}}
            n = {{Text|0|#F580B1}}
            {{Cl|IF}} {{Cl|NOT}} {{Cl|_FILEEXISTS}}(nm_output_file$) {{Cl|THEN}}
                {{Cl|IF}} MacOSX = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|SHELL}} {{Cl|_HIDE}} {{Text|<nowiki>"nm "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(ResolveStaticFunction_File(x)) + {{Text|<nowiki>" --demangle -g >"</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(nm_output_file$) + {{Text|<nowiki>" 2>"</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(tmpdir$ + {{Text|<nowiki>"nm_error.txt"</nowiki>|#FFB100}})
                {{Cl|IF}} MacOSX {{Cl|THEN}} {{Cl|SHELL}} {{Cl|_HIDE}} {{Text|<nowiki>"nm "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(ResolveStaticFunction_File(x)) + {{Text|<nowiki>" >"</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(nm_output_file$) + {{Text|<nowiki>" 2>"</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(tmpdir$ + {{Text|<nowiki>"nm_error.txt"</nowiki>|#FFB100}})
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} MacOSX = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'C++ name demangling not supported in MacOSX</nowiki>|#919191}}
                s$ = {{Text|<nowiki>" "</nowiki>|#FFB100}} + ResolveStaticFunction_Name(x) + {{Text|<nowiki>"("</nowiki>|#FFB100}}
                fh = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"I"</nowiki>|#FFB100}}, nm_output_file$)
                {{Cl|DO}} {{Cl|UNTIL}} {{Text|EndOfBuf%|#55FF55}}(fh)
                    a$ = {{Text|ReadBufLine$|#55FF55}}(fh)
                    {{Cl|IF}} {{Cl|LEN}}(a$) {{Cl|THEN}}
                        {{Text|<nowiki>'search for SPACE+functionname+LEFTBRACKET</nowiki>|#919191}}
                        x1 = {{Cl|INSTR}}(a$, s$)
                        {{Cl|IF}} x1 {{Cl|THEN}}
                            {{Cl|IF}} ResolveStaticFunction_Method(x) = {{Text|1|#F580B1}} {{Cl|THEN}}
                                x1 = x1 + {{Text|1|#F580B1}}
                                x2 = {{Cl|INSTR}}(x1, a$, {{Text|<nowiki>")"</nowiki>|#FFB100}})
                                fh2 = {{Cl|FREEFILE}}
                                {{Cl|OPEN}} tmpdir$ + {{Text|<nowiki>"global.txt"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|APPEND}} {{Cl|OPEN|AS}} #fh2
                                {{Cl|PRINT (file statement)|PRINT}} #fh2, {{Text|<nowiki>"extern void "</nowiki>|#FFB100}} + {{Cl|MID$ (function)|MID$}}(a$, x1, x2 - x1 + {{Text|1|#F580B1}}) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                                {{Cl|CLOSE}} #fh2
                            {{Cl|END}} {{Cl|IF}}
                            n = n + {{Text|1|#F580B1}}
                        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'x1</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'<>""</nowiki>|#919191}}
                {{Cl|LOOP}}
                {{Cl|IF}} n > {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Unable to resolve multiple instances of sub/function '"</nowiki>|#FFB100}} + ResolveStaticFunction_Name(x) + {{Text|<nowiki>"' in '"</nowiki>|#FFB100}} + ResolveStaticFunction_File(x) + {{Text|<nowiki>"'"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'macosx=0</nowiki>|#919191}}
            {{Cl|IF}} n = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'attempt to locate simple function name without brackets</nowiki>|#919191}}
                s$ = {{Text|<nowiki>" "</nowiki>|#FFB100}} + ResolveStaticFunction_Name(x): s2$ = s$
                {{Cl|IF}} MacOSX {{Cl|THEN}} s$ = {{Text|<nowiki>" _"</nowiki>|#FFB100}} + ResolveStaticFunction_Name(x) {{Text|<nowiki>'search for C mangled name</nowiki>|#919191}}
                fh = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"I"</nowiki>|#FFB100}}, nm_output_file$)
                {{Cl|DO}} {{Cl|UNTIL}} {{Text|EndOfBuf%|#55FF55}}(fh)
                    a$ = {{Text|ReadBufLine$|#55FF55}}(fh)
                    {{Cl|IF}} {{Cl|LEN}}(a$) {{Cl|THEN}}
                        {{Text|<nowiki>'search for SPACE+functionname</nowiki>|#919191}}
                        x1 = {{Cl|INSTR}}(a$, s$)
                        {{Cl|IF}} {{Cl|RIGHT$}}(a$, {{Cl|LEN}}(s$)) = s$ {{Cl|THEN}}
                            fh2 = {{Cl|FREEFILE}}
                            {{Cl|IF}} ResolveStaticFunction_Method(x) = {{Text|1|#F580B1}} {{Cl|THEN}}
                                {{Cl|OPEN}} tmpdir$ + {{Text|<nowiki>"global.txt"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|APPEND}} {{Cl|OPEN|AS}} #fh2
                                {{Cl|PRINT (file statement)|PRINT}} #fh2, {{Text|<nowiki>"extern "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"C"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"{"</nowiki>|#FFB100}}
                                {{Cl|PRINT (file statement)|PRINT}} #fh2, {{Text|<nowiki>"extern void "</nowiki>|#FFB100}} + s2$ + {{Text|<nowiki>"(void);"</nowiki>|#FFB100}}
                                {{Cl|PRINT (file statement)|PRINT}} #fh2, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                            {{Cl|ELSE}}
                                {{Cl|OPEN}} tmpdir$ + {{Text|<nowiki>"externtype"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(x) + {{Text|<nowiki>".txt"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|OUTPUT}} {{Cl|OPEN|AS}} #fh2
                                {{Cl|PRINT (file statement)|PRINT}} #fh2, {{Text|<nowiki>"extern "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"C"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>" "</nowiki>|#FFB100}}
                            {{Cl|END}} {{Cl|IF}}
                            {{Cl|CLOSE}} #fh2
                            n = n + {{Text|1|#F580B1}}
                            {{Cl|EXIT}} {{Cl|DO}}
                        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'x1</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'<>""</nowiki>|#919191}}
                {{Cl|LOOP}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} n = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'a C++ dynamic object library?</nowiki>|#919191}}
                {{Cl|IF}} MacOSX {{Cl|THEN}} {{Cl|GOTO}} macosx_libfind_failed
                {{Cl|IF}} {{Cl|NOT}} {{Cl|_FILEEXISTS}}(nm_output_file_dynamic$) {{Cl|THEN}}
                    {{Cl|SHELL}} {{Cl|_HIDE}} {{Text|<nowiki>"nm "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(ResolveStaticFunction_File(x)) + {{Text|<nowiki>" -D --demangle -g >"</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(nm_output_file_dynamic$) + {{Text|<nowiki>" 2>"</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(tmpdir$ + {{Text|<nowiki>"nm_error.txt"</nowiki>|#FFB100}})
                {{Cl|END}} {{Cl|IF}}
                s$ = {{Text|<nowiki>" "</nowiki>|#FFB100}} + ResolveStaticFunction_Name(x) + {{Text|<nowiki>"("</nowiki>|#FFB100}}
                fh = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"I"</nowiki>|#FFB100}}, nm_output_file$)
                {{Cl|DO}} {{Cl|UNTIL}} {{Text|EndOfBuf%|#55FF55}}(fh)
                    a$ = {{Text|ReadBufLine$|#55FF55}}(fh)
                    {{Cl|IF}} {{Cl|LEN}}(a$) {{Cl|THEN}}
                        {{Text|<nowiki>'search for SPACE+functionname+LEFTBRACKET</nowiki>|#919191}}
                        x1 = {{Cl|INSTR}}(a$, s$)
                        {{Cl|IF}} x1 {{Cl|THEN}}
                            {{Cl|IF}} ResolveStaticFunction_Method(x) = {{Text|1|#F580B1}} {{Cl|THEN}}
                                x1 = x1 + {{Text|1|#F580B1}}
                                x2 = {{Cl|INSTR}}(x1, a$, {{Text|<nowiki>")"</nowiki>|#FFB100}})
                                fh2 = {{Cl|FREEFILE}}
                                {{Cl|OPEN}} tmpdir$ + {{Text|<nowiki>"global.txt"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|APPEND}} {{Cl|OPEN|AS}} #fh2
                                {{Cl|PRINT (file statement)|PRINT}} #fh2, {{Text|<nowiki>"extern void "</nowiki>|#FFB100}} + {{Cl|MID$ (function)|MID$}}(a$, x1, x2 - x1 + {{Text|1|#F580B1}}) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                                {{Cl|CLOSE}} #fh2
                            {{Cl|END}} {{Cl|IF}}
                            n = n + {{Text|1|#F580B1}}
                        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'x1</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'<>""</nowiki>|#919191}}
                {{Cl|LOOP}}
                {{Cl|IF}} n > {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Unable to resolve multiple instances of sub/function '"</nowiki>|#FFB100}} + ResolveStaticFunction_Name(x) + {{Text|<nowiki>"' in '"</nowiki>|#FFB100}} + ResolveStaticFunction_File(x) + {{Text|<nowiki>"'"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} n = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'a C dynamic object library?</nowiki>|#919191}}
                s$ = {{Text|<nowiki>" "</nowiki>|#FFB100}} + ResolveStaticFunction_Name(x)
                fh = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"I"</nowiki>|#FFB100}}, nm_output_file_dynamic$)
                {{Cl|DO}} {{Cl|UNTIL}} {{Text|EndOfBuf%|#55FF55}}(fh)
                    a$ = {{Text|ReadBufLine$|#55FF55}}(fh)
                    {{Cl|IF}} {{Cl|LEN}}(a$) {{Cl|THEN}}
                        {{Text|<nowiki>'search for SPACE+functionname</nowiki>|#919191}}
                        x1 = {{Cl|INSTR}}(a$, s$)
                        {{Cl|IF}} {{Cl|RIGHT$}}(a$, {{Cl|LEN}}(s$)) = s$ {{Cl|THEN}}
                            fh2 = {{Cl|FREEFILE}}
                            {{Cl|IF}} ResolveStaticFunction_Method(x) = {{Text|1|#F580B1}} {{Cl|THEN}}
                                {{Cl|OPEN}} tmpdir$ + {{Text|<nowiki>"global.txt"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|APPEND}} {{Cl|OPEN|AS}} #fh2
                                {{Cl|PRINT (file statement)|PRINT}} #fh2, {{Text|<nowiki>"extern "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"C"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"{"</nowiki>|#FFB100}}
                                {{Cl|PRINT (file statement)|PRINT}} #fh2, {{Text|<nowiki>"extern void "</nowiki>|#FFB100}} + s$ + {{Text|<nowiki>"(void);"</nowiki>|#FFB100}}
                                {{Cl|PRINT (file statement)|PRINT}} #fh2, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                            {{Cl|ELSE}}
                                {{Cl|OPEN}} tmpdir$ + {{Text|<nowiki>"externtype"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(x) + {{Text|<nowiki>".txt"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|OUTPUT}} {{Cl|OPEN|AS}} #fh2
                                {{Cl|PRINT (file statement)|PRINT}} #fh2, {{Text|<nowiki>"extern "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"C"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>" "</nowiki>|#FFB100}}
                            {{Cl|END}} {{Cl|IF}}
                            {{Cl|CLOSE}} #fh2
                            n = n + {{Text|1|#F580B1}}
                            {{Cl|EXIT}} {{Cl|DO}}
                        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'x1</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'<>""</nowiki>|#919191}}
                {{Cl|LOOP}}
                macosx_libfind_failed:
                {{Cl|IF}} n = {{Text|0|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"Could not find sub/function '"</nowiki>|#FFB100}} + ResolveStaticFunction_Name(x) + {{Text|<nowiki>"' in '"</nowiki>|#FFB100}} + ResolveStaticFunction_File(x) + {{Text|<nowiki>"'"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|NEXT}}
    {{Cl|IF}} {{Cl|INSTR}}({{Cl|_OS$}}, {{Text|<nowiki>"[MACOSX]"</nowiki>|#FFB100}}) {{Cl|THEN}}
        ffh = {{Cl|FREEFILE}}
        {{Cl|OPEN}} tmpdir$ + {{Text|<nowiki>"recompile_osx.command"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|OUTPUT}} {{Cl|OPEN|AS}} #ffh
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"cd "</nowiki>|#FFB100}} + CHR_QUOTE + {{Text|<nowiki>"$(dirname "</nowiki>|#FFB100}} + CHR_QUOTE + {{Text|<nowiki>"$0"</nowiki>|#FFB100}} + CHR_QUOTE + {{Text|<nowiki>")"</nowiki>|#FFB100}} + CHR_QUOTE + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"echo "</nowiki>|#FFB100}} + CHR_QUOTE + {{Text|<nowiki>"Recompiling..."</nowiki>|#FFB100}} + CHR_QUOTE + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"cd ../c"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, makeline$ + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"read -p "</nowiki>|#FFB100}} + CHR_QUOTE + {{Text|<nowiki>"Press ENTER to exit..."</nowiki>|#FFB100}} + CHR_QUOTE + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|CLOSE}} ffh
        {{Cl|SHELL}} {{Cl|_HIDE}} {{Text|<nowiki>"chmod +x "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(tmpdir$ + {{Text|<nowiki>"recompile_osx.command"</nowiki>|#FFB100}})
        ffh = {{Cl|FREEFILE}}
        {{Cl|OPEN}} tmpdir$ + {{Text|<nowiki>"debug_osx.command"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|OUTPUT}} {{Cl|OPEN|AS}} #ffh
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"cd "</nowiki>|#FFB100}} + CHR_QUOTE + {{Text|<nowiki>"$(dirname "</nowiki>|#FFB100}} + CHR_QUOTE + {{Text|<nowiki>"$0"</nowiki>|#FFB100}} + CHR_QUOTE + {{Text|<nowiki>")"</nowiki>|#FFB100}} + CHR_QUOTE + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"Pause()"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"{"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"OLDCONFIG=`stty -g`"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"stty -icanon -echo min 1 time 0"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"dd count=1 2>/dev/null"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"stty $OLDCONFIG"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"}"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"echo "</nowiki>|#FFB100}} + CHR_QUOTE + {{Text|<nowiki>"C++ Debugging: "</nowiki>|#FFB100}} + file$ + extension$ + {{Text|<nowiki>" using GDB"</nowiki>|#FFB100}} + CHR_QUOTE + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"echo "</nowiki>|#FFB100}} + CHR_QUOTE + {{Text|<nowiki>"Debugger commands:"</nowiki>|#FFB100}} + CHR_QUOTE + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"echo "</nowiki>|#FFB100}} + CHR_QUOTE + {{Text|<nowiki>"After the debugger launches type 'run' to start your program"</nowiki>|#FFB100}} + CHR_QUOTE + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"echo "</nowiki>|#FFB100}} + CHR_QUOTE + {{Text|<nowiki>"After your program crashes type 'list' to find where the problem is and fix/report it"</nowiki>|#FFB100}} + CHR_QUOTE + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"echo "</nowiki>|#FFB100}} + CHR_QUOTE + {{Text|<nowiki>"(the GDB debugger has many other useful commands, this advice is for beginners)"</nowiki>|#FFB100}} + CHR_QUOTE + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"gdb "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + path.exe$ + file$ + extension$ + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"Pause"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|CLOSE}} ffh
        {{Cl|SHELL}} {{Cl|_HIDE}} {{Text|<nowiki>"chmod +x "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(tmpdir$ + {{Text|<nowiki>"debug_osx.command"</nowiki>|#FFB100}})
    {{Cl|ELSE}}
        ffh = {{Cl|FREEFILE}}
        {{Cl|OPEN}} tmpdir$ + {{Text|<nowiki>"recompile_lnx.sh"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|OUTPUT}} {{Cl|OPEN|AS}} #ffh
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"#!/bin/sh"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"Pause()"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"{"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"OLDCONFIG=`stty -g`"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"stty -icanon -echo min 1 time 0"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"dd count=1 2>/dev/null"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"stty $OLDCONFIG"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"}"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"echo "</nowiki>|#FFB100}} + CHR_QUOTE + {{Text|<nowiki>"Recompiling..."</nowiki>|#FFB100}} + CHR_QUOTE + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"cd ../c"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, makeline$ + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"echo "</nowiki>|#FFB100}} + CHR_QUOTE + {{Text|<nowiki>"Press ENTER to exit..."</nowiki>|#FFB100}} + CHR_QUOTE + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"Pause"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|CLOSE}} ffh
        {{Cl|SHELL}} {{Cl|_HIDE}} {{Text|<nowiki>"chmod +x "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(tmpdir$ + {{Text|<nowiki>"recompile_lnx.sh"</nowiki>|#FFB100}})
        ffh = {{Cl|FREEFILE}}
        {{Cl|OPEN}} tmpdir$ + {{Text|<nowiki>"debug_lnx.sh"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|OUTPUT}} {{Cl|OPEN|AS}} #ffh
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"#!/bin/sh"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"Pause()"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"{"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"OLDCONFIG=`stty -g`"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"stty -icanon -echo min 1 time 0"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"dd count=1 2>/dev/null"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"stty $OLDCONFIG"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"}"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"echo "</nowiki>|#FFB100}} + CHR_QUOTE + {{Text|<nowiki>"C++ Debugging: "</nowiki>|#FFB100}} + file$ + extension$ + {{Text|<nowiki>" using GDB"</nowiki>|#FFB100}} + CHR_QUOTE + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"echo "</nowiki>|#FFB100}} + CHR_QUOTE + {{Text|<nowiki>"Debugger commands:"</nowiki>|#FFB100}} + CHR_QUOTE + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"echo "</nowiki>|#FFB100}} + CHR_QUOTE + {{Text|<nowiki>"After the debugger launches type 'run' to start your program"</nowiki>|#FFB100}} + CHR_QUOTE + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"echo "</nowiki>|#FFB100}} + CHR_QUOTE + {{Text|<nowiki>"After your program crashes type 'list' to find where the problem is and fix/report it"</nowiki>|#FFB100}} + CHR_QUOTE + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"echo "</nowiki>|#FFB100}} + CHR_QUOTE + {{Text|<nowiki>"(the GDB debugger has many other useful commands, this advice is for beginners)"</nowiki>|#FFB100}} + CHR_QUOTE + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"gdb "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + path.exe$ + file$ + extension$ + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ffh, {{Text|<nowiki>"Pause"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|CLOSE}} ffh
        {{Cl|SHELL}} {{Cl|_HIDE}} {{Text|<nowiki>"chmod +x "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(tmpdir$ + {{Text|<nowiki>"debug_lnx.sh"</nowiki>|#FFB100}})
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} No_C_Compile_Mode = {{Text|0|#F580B1}} {{Cl|THEN}}
        {{Cl|SHELL}} {{Cl|_HIDE}} makeline$ + {{Text|<nowiki>" 1>> "</nowiki>|#FFB100}} + compilelog$ + {{Text|<nowiki>" 2>&1"</nowiki>|#FFB100}}
        {{Cl|IF}} idemode {{Cl|THEN}}
            {{Text|<nowiki>'Restore fg/bg colors</nowiki>|#919191}}
            dummy = {{Text|DarkenFGBG|#55FF55}}({{Text|0|#F580B1}})
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} {{Cl|INSTR}}({{Cl|_OS$}}, {{Text|<nowiki>"[MACOSX]"</nowiki>|#FFB100}}) {{Cl|THEN}}
        ff = {{Cl|FREEFILE}}
        {{Cl|IF}} path.exe$ = {{Text|<nowiki>"./"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} path.exe$ = {{Text|<nowiki>"../../"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} path.exe$ = {{Text|<nowiki>"..\..\"</nowiki>|#FFB100}} {{Cl|THEN}} path.exe$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Cl|OPEN}} path.exe$ + file$ + extension$ + {{Text|<nowiki>"_start.command"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|OUTPUT}} {{Cl|OPEN|AS}} #ff
        {{Cl|PRINT (file statement)|PRINT}} #ff, {{Text|<nowiki>"cd "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"$(dirname "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"$0"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>")"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ff, {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ff, {{Text|<nowiki>"./"</nowiki>|#FFB100}} + file$ + extension$ + {{Text|<nowiki>" &"</nowiki>|#FFB100}};
        {{Cl|PRINT (file statement)|PRINT}} #ff, {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ff, {{Text|<nowiki>"osascript -e 'tell application "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"Terminal"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>" to close (every window whose name contains "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + file$ + extension$ + {{Text|<nowiki>"_start.command"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>")' &"</nowiki>|#FFB100}};
        {{Cl|PRINT (file statement)|PRINT}} #ff, {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ff, {{Text|<nowiki>"osascript -e 'if (count the windows of application "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"Terminal"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>") is 0 then tell application "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"Terminal"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>" to quit' &"</nowiki>|#FFB100}};
        {{Cl|PRINT (file statement)|PRINT}} #ff, {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|PRINT (file statement)|PRINT}} #ff, {{Text|<nowiki>"exit"</nowiki>|#FFB100}};
        {{Cl|PRINT (file statement)|PRINT}} #ff, {{Cl|CHR$}}({{Text|10|#F580B1}});
        {{Cl|CLOSE}} #ff
        {{Cl|SHELL}} {{Cl|_HIDE}} {{Text|<nowiki>"chmod +x "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(path.exe$ + file$ + extension$ + {{Text|<nowiki>"_start.command"</nowiki>|#FFB100}})
    {{Cl|END}} {{Cl|IF}}
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} No_C_Compile_Mode {{Cl|THEN}} compfailed = {{Text|0|#F580B1}}: {{Cl|GOTO}} No_C_Compile
{{Cl|IF}} path.exe$ = {{Text|<nowiki>"../../"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} path.exe$ = {{Text|<nowiki>"..\..\"</nowiki>|#FFB100}} {{Cl|THEN}} path.exe$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
{{Cl|IF}} {{Cl|_FILEEXISTS}}(path.exe$ + file$ + extension$) {{Cl|THEN}}
    compfailed = {{Text|0|#F580B1}}
    lastBinaryGenerated$ = path.exe$ + file$ + extension$
{{Cl|ELSE}}
    compfailed = {{Text|1|#F580B1}} {{Text|<nowiki>'detect compilation failure</nowiki>|#919191}}
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} compfailed {{Cl|THEN}}
    {{Cl|IF}} idemode {{Cl|THEN}}
        idemessage$ = {{Text|<nowiki>"C++ Compilation failed "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|0|#F580B1}}) + {{Text|<nowiki>"(Check "</nowiki>|#FFB100}} + {{Cl|_TRIM$}}(compilelog$) + {{Text|<nowiki>")"</nowiki>|#FFB100}}
        {{Cl|GOTO}} ideerror
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} compfailed {{Cl|THEN}}
        {{Cl|PRINT}} {{Text|<nowiki>"ERROR: C++ compilation failed."</nowiki>|#FFB100}}
        {{Cl|PRINT}} {{Text|<nowiki>"Check "</nowiki>|#FFB100}} + compilelog$ + {{Text|<nowiki>" for details."</nowiki>|#FFB100}}
    {{Cl|END}} {{Cl|IF}}
{{Cl|ELSE}}
    {{Cl|IF}} idemode = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|NOT}} QuietMode {{Cl|THEN}} {{Cl|PRINT}} {{Text|<nowiki>"Output: "</nowiki>|#FFB100}}; lastBinaryGenerated$
{{Cl|END}} {{Cl|IF}}
Skip_Build:
{{Cl|IF}} idemode {{Cl|THEN}} {{Cl|GOTO}} ideret6
No_C_Compile:
{{Cl|IF}} (compfailed <> {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} warningsissued <> {{Text|0|#F580B1}}) {{Cl|AND (boolean)|AND}} ConsoleMode = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|END}} {{Text|1|#F580B1}}
{{Cl|IF}} compfailed <> {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|SYSTEM}} {{Text|1|#F580B1}}
{{Cl|SYSTEM}} {{Text|0|#F580B1}}
qberror_test:
E = {{Text|1|#F580B1}}
{{Cl|RESUME}} {{Cl|NEXT}}
qberror:
{{Text|<nowiki>'_CONSOLE ON</nowiki>|#919191}}
{{Text|<nowiki>'_ECHO "A QB error has occurred (and you have compiled in debugging support)."</nowiki>|#919191}}
{{Text|<nowiki>'_ECHO "Some key information (qb64pe.bas):"</nowiki>|#919191}}
{{Text|<nowiki>'_ECHO "Error" + STR$(ERR)</nowiki>|#919191}}
{{Text|<nowiki>'_ECHO "Description: " + _ERRORMESSAGE$</nowiki>|#919191}}
{{Text|<nowiki>'_ECHO "Line" + STR$(_ERRORLINE)</nowiki>|#919191}}
{{Text|<nowiki>'IF _INCLERRORLINE THEN</nowiki>|#919191}}
{{Text|<nowiki>'    _ECHO "Included line" + STR$(_INCLERRORLINE)</nowiki>|#919191}}
{{Text|<nowiki>'    _ECHO "Included file " + _INCLERRORFILE$</nowiki>|#919191}}
{{Text|<nowiki>'END IF</nowiki>|#919191}}
{{Text|<nowiki>'_ECHO ""</nowiki>|#919191}}
{{Text|<nowiki>'_ECHO "Loaded source file details:"</nowiki>|#919191}}
{{Text|<nowiki>'_ECHO "ideerror =" + STR$(ideerror) + "; qberrorhappened =" + STR$(qberrorhappened) + "; qberrorhappenedvalue =" + STR$(qberrorhappenedvalue) + "; linenumber =" + STR$(linenumber)</nowiki>|#919191}}
{{Text|<nowiki>'_ECHO "ca$ = {" + ca$ + "}, idecommand$ = {" + idecommand$ + "}"</nowiki>|#919191}}
{{Text|<nowiki>'_ECHO "linefragment = {" + linefragment+ "}"</nowiki>|#919191}}
{{Cl|IF}} Debug {{Cl|THEN}} {{Text|<nowiki>'A more in-your-face error handler</nowiki>|#919191}}
    {{Cl|IF}} ConsoleMode {{Cl|THEN}}
        {{Cl|PRINT}}
    {{Cl|ELSE}}
        {{Cl|_AUTODISPLAY}}
        {{Cl|SCREEN}} {{Cl|_NEWIMAGE}}({{Text|80|#F580B1}}, {{Text|25|#F580B1}}, {{Text|0|#F580B1}}), , {{Text|0|#F580B1}}, {{Text|0|#F580B1}}
        {{Cl|COLOR}} {{Text|7|#F580B1}}, {{Text|0|#F580B1}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|_CONTROLCHR}} {{Cl|OFF}}
    {{Cl|PRINT}} {{Text|<nowiki>"A QB error has occurred (and you have compiled in debugging support)."</nowiki>|#FFB100}}
    {{Cl|PRINT}} {{Text|<nowiki>"Some key information (qb64pe.bas):"</nowiki>|#FFB100}}
    {{Cl|PRINT}} {{Text|<nowiki>"Error"</nowiki>|#FFB100}}; {{Cl|ERR}}
    {{Cl|PRINT}} {{Text|<nowiki>"Description: "</nowiki>|#FFB100}}; {{Cl|_ERRORMESSAGE$}}
    {{Cl|PRINT}} {{Text|<nowiki>"Line"</nowiki>|#FFB100}}; {{Cl|_ERRORLINE}}
    {{Cl|IF}} {{Cl|_INCLERRORLINE}} {{Cl|THEN}}
        {{Cl|PRINT}} {{Text|<nowiki>"Included line"</nowiki>|#FFB100}}; {{Cl|_INCLERRORLINE}}
        {{Cl|PRINT}} {{Text|<nowiki>"Included file "</nowiki>|#FFB100}}; {{Cl|_INCLERRORFILE$}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|PRINT}}
    {{Cl|PRINT}} {{Text|<nowiki>"Loaded source file details:"</nowiki>|#FFB100}}
    {{Cl|PRINT}} {{Text|<nowiki>"ideerror ="</nowiki>|#FFB100}}; ideerror; {{Text|<nowiki>"qberrorhappened ="</nowiki>|#FFB100}}; qberrorhappened; {{Text|<nowiki>"qberrorhappenedvalue ="</nowiki>|#FFB100}}; qberrorhappenedvalue; {{Text|<nowiki>"linenumber ="</nowiki>|#FFB100}}; linenumber
    {{Cl|PRINT}} {{Text|<nowiki>"ca$ = {"</nowiki>|#FFB100}}; ca$; {{Text|<nowiki>"}, idecommand$ = {"</nowiki>|#FFB100}}; idecommand$; {{Text|<nowiki>"}"</nowiki>|#FFB100}}
    {{Cl|PRINT}} {{Text|<nowiki>"linefragment = {"</nowiki>|#FFB100}}; linefragment; {{Text|<nowiki>"}"</nowiki>|#FFB100}}
    {{Cl|END}}
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} ideerror {{Cl|THEN}} {{Text|<nowiki>'error happened inside the IDE</nowiki>|#919191}}
    fh = {{Cl|FREEFILE}}
    {{Cl|OPEN}} {{Text|<nowiki>"internal\temp\ideerror.txt"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|APPEND}} {{Cl|OPEN|AS}} #fh
    {{Cl|PRINT (file statement)|PRINT}} #fh, {{Cl|DATE$}}; {{Cl|TIME$}}; {{Text|<nowiki>"--------------------"</nowiki>|#FFB100}}
    {{Cl|PRINT (file statement)|PRINT}} #fh, {{Cl|ERR}}
    {{Cl|PRINT (file statement)|PRINT}} #fh, {{Cl|_ERRORMESSAGE$}}
    {{Cl|PRINT (file statement)|PRINT}} #fh, {{Cl|_ERRORLINE}}
    {{Cl|PRINT (file statement)|PRINT}} #fh, {{Cl|_INCLERRORLINE}}
    {{Cl|PRINT (file statement)|PRINT}} #fh, {{Cl|_INCLERRORFILE$}}
    {{Cl|CLOSE}} #fh
    sendc$ = {{Cl|CHR$}}({{Text|255|#F580B1}}) {{Text|<nowiki>'a runtime error has occurred</nowiki>|#919191}}
    {{Cl|RESUME}} sendcommand {{Text|<nowiki>'allow IDE to handle error recovery</nowiki>|#919191}}
{{Cl|END}} {{Cl|IF}}
qberrorhappenedvalue = qberrorhappened
qberrorhappened = {{Text|1|#F580B1}}
{{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"QB ERROR!"</nowiki>|#FFB100}}
{{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"ERR="</nowiki>|#FFB100}}; {{Cl|ERR}}
{{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"ERL="</nowiki>|#FFB100}}; {{Cl|ERL}}
{{Cl|IF}} idemode {{Cl|AND (boolean)|AND}} qberrorhappenedvalue >= {{Text|0|#F580B1}} {{Cl|THEN}}
    {{Text|<nowiki>'real qb error occurred</nowiki>|#919191}}
    ideerrorline = linenumber
    idemessage$ = {{Text|<nowiki>"Compiler error (check for syntax errors) ("</nowiki>|#FFB100}} + {{Cl|_ERRORMESSAGE$}} + {{Text|<nowiki>":"</nowiki>|#FFB100}}
    {{Cl|IF}} {{Cl|ERR}} {{Cl|THEN}} idemessage$ = idemessage$ + {{Text|str2$|#55FF55}}({{Cl|ERR}}) + {{Text|<nowiki>"-"</nowiki>|#FFB100}}
    {{Cl|IF}} {{Cl|_ERRORLINE}} {{Cl|THEN}} idemessage$ = idemessage$ + {{Text|str2$|#55FF55}}({{Cl|_ERRORLINE}})
    {{Cl|IF}} {{Cl|_INCLERRORLINE}} {{Cl|THEN}} idemessage$ = idemessage$ + {{Text|<nowiki>"-"</nowiki>|#FFB100}} + {{Cl|_INCLERRORFILE$}} + {{Text|<nowiki>"-"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}({{Cl|_INCLERRORLINE}})
    idemessage$ = idemessage$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
    {{Cl|IF}} inclevel > {{Text|0|#F580B1}} {{Cl|THEN}} idemessage$ = idemessage$ + incerror$
    {{Cl|RESUME}} ideerror
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} qberrorhappenedvalue >= {{Text|0|#F580B1}} {{Cl|THEN}}
    a$ = {{Text|<nowiki>"UNEXPECTED INTERNAL COMPILER ERROR!"</nowiki>|#FFB100}}: {{Cl|GOTO}} errmes {{Text|<nowiki>'internal comiler error</nowiki>|#919191}}
{{Cl|END}} {{Cl|IF}}
qberrorcode = {{Cl|ERR}}
qberrorline = {{Cl|ERL}}
{{Cl|IF}} qberrorhappenedvalue = {{Text|-1|#F580B1}} {{Cl|THEN}} {{Cl|RESUME}} qberrorhappened1
{{Cl|IF}} qberrorhappenedvalue = {{Text|-2|#F580B1}} {{Cl|THEN}} {{Cl|RESUME}} qberrorhappened2
{{Cl|IF}} qberrorhappenedvalue = {{Text|-3|#F580B1}} {{Cl|THEN}} {{Cl|RESUME}} qberrorhappened3
{{Cl|END}}
errmes: {{Text|<nowiki>'set a$ to message</nowiki>|#919191}}
{{Cl|IF}} Error_Happened {{Cl|THEN}} a$ = Error_Message: Error_Happened = {{Text|0|#F580B1}}
layout$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: layoutok = {{Text|0|#F580B1}} {{Text|<nowiki>'invalidate layout</nowiki>|#919191}}
{{Cl|IF}} forceIncludingFile {{Cl|THEN}} {{Text|<nowiki>'If we're to the point where we're adding the automatic QB64 includes, we don't need to report the $INCLUDE information</nowiki>|#919191}}
    {{Cl|IF}} {{Cl|INSTR}}(a$, {{Text|<nowiki>"END SUB/FUNCTION before"</nowiki>|#FFB100}}) {{Cl|THEN}} a$ = {{Text|<nowiki>"SUB without END SUB"</nowiki>|#FFB100}} {{Text|<nowiki>'Just a simple rewrite of the error message to be less confusing for SUB/FUNCTIONs</nowiki>|#919191}}
{{Cl|ELSE}} {{Text|<nowiki>'We want to let the user know which module the error occurred in</nowiki>|#919191}}
    {{Cl|IF}} inclevel > {{Text|0|#F580B1}} {{Cl|THEN}} a$ = a$ + incerror$
{{Cl|END}} {{Cl|IF}}
{{Cl|IF}} idemode {{Cl|THEN}}
    ideerrorline = linenumber
    idemessage$ = a$
    {{Cl|GOTO}} ideerror {{Text|<nowiki>'infinitely preferable to RESUME</nowiki>|#919191}}
{{Cl|END}} {{Cl|IF}}
{{Text|<nowiki>'non-ide mode output</nowiki>|#919191}}
{{Cl|PRINT}}
{{Cl|IF}} {{Cl|NOT}} MonochromeLoggingMode {{Cl|THEN}}
    {{Cl|IF}} {{Cl|INSTR}}({{Cl|_OS$}}, {{Text|<nowiki>"WIN"</nowiki>|#FFB100}}) {{Cl|THEN}}
        {{Cl|COLOR}} {{Text|4|#F580B1}}
    {{Cl|ELSE}}
        {{Cl|COLOR}} {{Text|9|#F580B1}}
    {{Cl|END}} {{Cl|IF}}
{{Cl|END}} {{Cl|IF}}
{{Cl|PRINT}} a$
{{Cl|IF}} {{Cl|NOT}} MonochromeLoggingMode {{Cl|THEN}} {{Cl|COLOR}} {{Text|7|#F580B1}}
{{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(linefragment)
    {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(linefragment, i, {{Text|1|#F580B1}}) = sp$ {{Cl|THEN}} {{Cl|MID$}}(linefragment, i, {{Text|1|#F580B1}}) = {{Text|<nowiki>" "</nowiki>|#FFB100}}
{{Cl|NEXT}}
{{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(wholeline)
    {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(wholeline, i, {{Text|1|#F580B1}}) = sp$ {{Cl|THEN}} {{Cl|MID$}}(wholeline, i, {{Text|1|#F580B1}}) = {{Text|<nowiki>" "</nowiki>|#FFB100}}
{{Cl|NEXT}}
{{Cl|PRINT}} {{Text|<nowiki>"Caused by (or after):"</nowiki>|#FFB100}} + linefragment
{{Cl|IF}} {{Cl|NOT}} MonochromeLoggingMode {{Cl|THEN}} {{Cl|COLOR}} {{Text|8|#F580B1}}
{{Cl|PRINT}} {{Text|<nowiki>"LINE "</nowiki>|#FFB100}};
{{Cl|IF}} {{Cl|NOT}} MonochromeLoggingMode {{Cl|THEN}} {{Cl|COLOR}} {{Text|15|#F580B1}}
{{Cl|PRINT}} {{Text|str2|#55FF55}}(linenumber) + {{Text|<nowiki>":"</nowiki>|#FFB100}};
{{Cl|IF}} {{Cl|NOT}} MonochromeLoggingMode {{Cl|THEN}} {{Cl|COLOR}} {{Text|7|#F580B1}}
{{Cl|PRINT}} wholeline
{{Cl|IF}} ConsoleMode {{Cl|THEN}} {{Cl|SYSTEM}} {{Text|1|#F580B1}}
{{Cl|END}} {{Text|1|#F580B1}}
{{Cl|FUNCTION}} {{Text|ParseCMDLineArgs$|#55FF55}} ()
    {{Text|<nowiki>'Recall that COMMAND$ is a concatenation of argv[] elements, so we don't have</nowiki>|#919191}}
    {{Text|<nowiki>'to worry about more than one space between things (unless they used quotes,</nowiki>|#919191}}
    {{Text|<nowiki>'in which case they're simply asking for trouble).</nowiki>|#919191}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|_COMMANDCOUNT}}
        token$ = {{Cl|COMMAND$}}(i)
        {{Cl|IF}} {{Cl|LCASE$}}(token$) = {{Text|<nowiki>"/?"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} {{Cl|LCASE$}}(token$) = {{Text|<nowiki>"--help"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} {{Cl|LCASE$}}(token$) = {{Text|<nowiki>"/help"</nowiki>|#FFB100}} {{Cl|THEN}} token$ = {{Text|<nowiki>"-?"</nowiki>|#FFB100}}
        {{Cl|SELECT}} {{Cl|CASE}} {{Cl|LCASE$}}({{Cl|LEFT$}}(token$, {{Text|2|#F580B1}}))
            {{Cl|CASE}} {{Text|<nowiki>"-?"</nowiki>|#FFB100}} {{Text|<nowiki>'Command-line help</nowiki>|#919191}}
                {{Cl|_DEST}} {{Cl|_CONSOLE}}
                {{Cl|IF}} qb64versionprinted = {{Text|0|#F580B1}} {{Cl|THEN}} qb64versionprinted = {{Text|-1|#F580B1}}: {{Cl|PRINT}} {{Text|<nowiki>"QB64-PE Compiler V"</nowiki>|#FFB100}} + Version$
                {{Cl|PRINT}}
                {{Cl|PRINT}} {{Text|<nowiki>"Usage: qb64pe [switches] <file>"</nowiki>|#FFB100}}
                {{Cl|PRINT}}
                {{Cl|PRINT}} {{Text|<nowiki>"Options:"</nowiki>|#FFB100}}
                {{Cl|PRINT}} {{Text|<nowiki>"  <file>                  Source file to load"</nowiki>|#FFB100}} {{Text|<nowiki>'                                '80 columns</nowiki>|#919191}}
                {{Cl|PRINT}} {{Text|<nowiki>"  -v                      Print version"</nowiki>|#FFB100}}
                {{Cl|PRINT}} {{Text|<nowiki>"  -c                      Compile instead of edit"</nowiki>|#FFB100}}
                {{Cl|PRINT}} {{Text|<nowiki>"  -o <output file>        Write output executable to <output file>"</nowiki>|#FFB100}}
                {{Cl|PRINT}} {{Text|<nowiki>"  -x                      Compile instead of edit and output the result to the"</nowiki>|#FFB100}}
                {{Cl|PRINT}} {{Text|<nowiki>"                            console"</nowiki>|#FFB100}}
                {{Cl|PRINT}} {{Text|<nowiki>"  -w                      Show warnings"</nowiki>|#FFB100}}
                {{Cl|PRINT}} {{Text|<nowiki>"  -q                      Quiet mode (does not inhibit warnings or errors)"</nowiki>|#FFB100}}
                {{Cl|PRINT}} {{Text|<nowiki>"  -m                      Do not colorize compiler output (monochrome mode)"</nowiki>|#FFB100}}
                {{Cl|PRINT}} {{Text|<nowiki>"  -e                      Enable OPTION _EXPLICIT, making variable declaration"</nowiki>|#FFB100}}
                {{Cl|PRINT}} {{Text|<nowiki>"                            mandatory (per-compilation; doesn't affect the"</nowiki>|#FFB100}}
                {{Cl|PRINT}} {{Text|<nowiki>"                            source file or global settings)"</nowiki>|#FFB100}}
                {{Cl|PRINT}} {{Text|<nowiki>"  -s[:switch=true/false]  View/edit compiler settings"</nowiki>|#FFB100}}
                {{Cl|PRINT}} {{Text|<nowiki>"  -l:<line number>        Start the IDE at the specified line number"</nowiki>|#FFB100}}
                {{Cl|PRINT}} {{Text|<nowiki>"  -p                      Purge all pre-compiled content first"</nowiki>|#FFB100}}
                {{Cl|PRINT}} {{Text|<nowiki>"  -z                      Generate C code without compiling to executable"</nowiki>|#FFB100}}
                {{Cl|PRINT}} {{Text|<nowiki>"  -f[:setting=value]      compiler settings to use"</nowiki>|#FFB100}}
                {{Cl|PRINT}}
                {{Cl|SYSTEM}}
            {{Cl|CASE}} {{Text|<nowiki>"-v"</nowiki>|#FFB100}} {{Text|<nowiki>' Print version</nowiki>|#919191}}
                {{Cl|_DEST}} {{Cl|_CONSOLE}}
                {{Cl|IF}} qb64versionprinted = {{Text|0|#F580B1}} {{Cl|THEN}} qb64versionprinted = {{Text|-1|#F580B1}}: {{Cl|PRINT}} {{Text|<nowiki>"QB64-PE Compiler V"</nowiki>|#FFB100}} + Version$
                {{Cl|SYSTEM}}
            {{Cl|CASE}} {{Text|<nowiki>"-u"</nowiki>|#FFB100}} {{Text|<nowiki>'Invoke "Update all pages" to populate internal/help files (hidden build option)</nowiki>|#919191}}
                Help_Recaching = {{Text|2|#F580B1}}: Help_IgnoreCache = {{Text|1|#F580B1}}
                {{Cl|IF}} {{Text|ideupdatehelpbox|#55FF55}} {{Cl|THEN}}
                    {{Cl|_DEST}} {{Cl|_CONSOLE}}
                    {{Cl|PRINT}} {{Text|<nowiki>"Update failed: Can't make connection to Wiki."</nowiki>|#FFB100}}
                    {{Cl|SYSTEM}} {{Text|1|#F580B1}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|SYSTEM}}
            {{Cl|CASE}} {{Text|<nowiki>"-c"</nowiki>|#FFB100}} {{Text|<nowiki>'Compile instead of edit</nowiki>|#919191}}
                NoIDEMode = {{Text|1|#F580B1}}
                cmdlineswitch = {{Text|-1|#F580B1}}
            {{Cl|CASE}} {{Text|<nowiki>"-o"</nowiki>|#FFB100}} {{Text|<nowiki>'Specify an output file</nowiki>|#919191}}
                {{Cl|IF}} {{Cl|LEN}}({{Cl|COMMAND$}}(i + {{Text|1|#F580B1}})) > {{Text|0|#F580B1}} {{Cl|THEN}} outputfile_cmd$ = {{Cl|COMMAND$}}(i + {{Text|1|#F580B1}}): i = i + {{Text|1|#F580B1}}
                cmdlineswitch = {{Text|-1|#F580B1}}
            {{Cl|CASE}} {{Text|<nowiki>"-x"</nowiki>|#FFB100}} {{Text|<nowiki>'Use the console</nowiki>|#919191}}
                ConsoleMode = {{Text|1|#F580B1}}
                NoIDEMode = {{Text|1|#F580B1}} {{Text|<nowiki>'Implies -c</nowiki>|#919191}}
                cmdlineswitch = {{Text|-1|#F580B1}}
            {{Cl|CASE}} {{Text|<nowiki>"-w"</nowiki>|#FFB100}} {{Text|<nowiki>'Show warnings</nowiki>|#919191}}
                ShowWarnings = {{Text|-1|#F580B1}}
                cmdlineswitch = {{Text|-1|#F580B1}}
            {{Cl|CASE}} {{Text|<nowiki>"-q"</nowiki>|#FFB100}} {{Text|<nowiki>'Quiet mode</nowiki>|#919191}}
                QuietMode = {{Text|-1|#F580B1}}
                cmdlineswitch = {{Text|-1|#F580B1}}
            {{Cl|CASE}} {{Text|<nowiki>"-m"</nowiki>|#FFB100}} {{Text|<nowiki>'Monochrome mode</nowiki>|#919191}}
                MonochromeLoggingMode = {{Text|-1|#F580B1}}
                cmdlineswitch = {{Text|-1|#F580B1}}
            {{Cl|CASE}} {{Text|<nowiki>"-e"</nowiki>|#FFB100}} {{Text|<nowiki>'Option Explicit</nowiki>|#919191}}
                optionexplicit_cmd = {{Text|-1|#F580B1}}
                cmdlineswitch = {{Text|-1|#F580B1}}
            {{Cl|CASE}} {{Text|<nowiki>"-s"</nowiki>|#FFB100}} {{Text|<nowiki>'Settings</nowiki>|#919191}}
                settingsMode = {{Text|-1|#F580B1}}
                {{Cl|_DEST}} {{Cl|_CONSOLE}}
                {{Cl|IF}} qb64versionprinted = {{Text|0|#F580B1}} {{Cl|THEN}} qb64versionprinted = {{Text|-1|#F580B1}}: {{Cl|PRINT}} {{Text|<nowiki>"QB64-PE Compiler V"</nowiki>|#FFB100}} + Version$
                {{Cl|SELECT}} {{Cl|CASE}} {{Cl|LCASE$}}({{Cl|MID$ (function)|MID$}}(token$, {{Text|3|#F580B1}}))
                    {{Cl|CASE}} {{Text|<nowiki>""</nowiki>|#FFB100}}
                        {{Cl|PRINT}} {{Text|<nowiki>"debuginfo    = "</nowiki>|#FFB100}};
                        {{Cl|IF}} idedebuginfo {{Cl|THEN}} {{Cl|PRINT}} {{Text|<nowiki>"true"</nowiki>|#FFB100}} {{Cl|ELSE}} {{Cl|PRINT}} {{Text|<nowiki>"false"</nowiki>|#FFB100}}
                        {{Cl|PRINT}} {{Text|<nowiki>"exewithsource = "</nowiki>|#FFB100}};
                        {{Cl|IF}} SaveExeWithSource {{Cl|THEN}} {{Cl|PRINT}} {{Text|<nowiki>"true"</nowiki>|#FFB100}} {{Cl|ELSE}} {{Cl|PRINT}} {{Text|<nowiki>"false"</nowiki>|#FFB100}}
                        {{Cl|SYSTEM}}
                    {{Cl|CASE}} {{Text|<nowiki>":exewithsource"</nowiki>|#FFB100}}
                        {{Cl|PRINT}} {{Text|<nowiki>"exewithsource = "</nowiki>|#FFB100}};
                        {{Cl|IF}} SaveExeWithSource {{Cl|THEN}} {{Cl|PRINT}} {{Text|<nowiki>"true"</nowiki>|#FFB100}} {{Cl|ELSE}} {{Cl|PRINT}} {{Text|<nowiki>"false"</nowiki>|#FFB100}}
                        {{Cl|SYSTEM}}
                    {{Cl|CASE}} {{Text|<nowiki>":exewithsource=true"</nowiki>|#FFB100}}
                        {{Text|WriteConfigSetting|#55FF55}} generalSettingsSection$, {{Text|<nowiki>"SaveExeWithSource"</nowiki>|#FFB100}}, {{Text|<nowiki>"True"</nowiki>|#FFB100}}
                        {{Cl|PRINT}} {{Text|<nowiki>"exewithsource = true"</nowiki>|#FFB100}}
                        SaveExeWithSource = {{Text|-1|#F580B1}}
                    {{Cl|CASE}} {{Text|<nowiki>":exewithsource=false"</nowiki>|#FFB100}}
                        {{Text|WriteConfigSetting|#55FF55}} generalSettingsSection$, {{Text|<nowiki>"SaveExeWithSource"</nowiki>|#FFB100}}, {{Text|<nowiki>"False"</nowiki>|#FFB100}}
                        {{Cl|PRINT}} {{Text|<nowiki>"exewithsource = false"</nowiki>|#FFB100}}
                        SaveExeWithSource = {{Text|0|#F580B1}}
                    {{Cl|CASE}} {{Text|<nowiki>":debuginfo"</nowiki>|#FFB100}}
                        {{Cl|PRINT}} {{Text|<nowiki>"debuginfo = "</nowiki>|#FFB100}};
                        {{Cl|IF}} idedebuginfo {{Cl|THEN}} {{Cl|PRINT}} {{Text|<nowiki>"true"</nowiki>|#FFB100}} {{Cl|ELSE}} {{Cl|PRINT}} {{Text|<nowiki>"false"</nowiki>|#FFB100}}
                        {{Cl|SYSTEM}}
                    {{Cl|CASE}} {{Text|<nowiki>":debuginfo=true"</nowiki>|#FFB100}}
                        {{Cl|PRINT}} {{Text|<nowiki>"debuginfo = true"</nowiki>|#FFB100}}
                        {{Text|WriteConfigSetting|#55FF55}} generalSettingsSection$, {{Text|<nowiki>"DebugInfo"</nowiki>|#FFB100}}, {{Text|<nowiki>"True"</nowiki>|#FFB100}} + DebugInfoIniWarning$
                        idedebuginfo = {{Text|-1|#F580B1}}
                        Include_GDB_Debugging_Info = idedebuginfo
                        {{Text|PurgeTemporaryBuildFiles|#55FF55}} (os$), (MacOSX)
                    {{Cl|CASE}} {{Text|<nowiki>":debuginfo=false"</nowiki>|#FFB100}}
                        {{Cl|PRINT}} {{Text|<nowiki>"debuginfo = false"</nowiki>|#FFB100}}
                        {{Text|WriteConfigSetting|#55FF55}} generalSettingsSection$, {{Text|<nowiki>"DebugInfo"</nowiki>|#FFB100}}, {{Text|<nowiki>"False"</nowiki>|#FFB100}} + DebugInfoIniWarning$
                        idedebuginfo = {{Text|0|#F580B1}}
                        Include_GDB_Debugging_Info = idedebuginfo
                        {{Text|PurgeTemporaryBuildFiles|#55FF55}} (os$), (MacOSX)
                    {{Cl|CASE}} {{Cl|ELSE}}
                        {{Cl|PRINT}} {{Text|<nowiki>"Invalid settings switch: "</nowiki>|#FFB100}}; token$
                        {{Cl|PRINT}}
                        {{Cl|PRINT}} {{Text|<nowiki>"Valid switches:"</nowiki>|#FFB100}}
                        {{Cl|PRINT}} {{Text|<nowiki>"    -s:debuginfo=true/false    (Embed C++ debug info into .EXE)"</nowiki>|#FFB100}}
                        {{Cl|PRINT}} {{Text|<nowiki>"    -s:exewithsource=true/false (Save .EXE in the source folder)"</nowiki>|#FFB100}}
                        {{Cl|SYSTEM}} {{Text|1|#F580B1}}
                {{Cl|END}} {{Cl|SELECT}}
                {{Cl|_DEST}} {{Text|0|#F580B1}}
            {{Cl|CASE}} {{Text|<nowiki>"-l"</nowiki>|#FFB100}} {{Text|<nowiki>'goto line (ide mode only); -l:<line number></nowiki>|#919191}}
                {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(token$, {{Text|3|#F580B1}}, {{Text|1|#F580B1}}) = {{Text|<nowiki>":"</nowiki>|#FFB100}} {{Cl|THEN}} ideStartAtLine = {{Cl|VAL}}({{Cl|MID$ (function)|MID$}}(token$, {{Text|4|#F580B1}}))
                cmdlineswitch = {{Text|-1|#F580B1}}
            {{Cl|CASE}} {{Text|<nowiki>"-p"</nowiki>|#FFB100}} {{Text|<nowiki>'Purge</nowiki>|#919191}}
                {{Text|PurgeTemporaryBuildFiles|#55FF55}} (os$), (MacOSX)
                cmdlineswitch = {{Text|-1|#F580B1}}
            {{Cl|CASE}} {{Text|<nowiki>"-z"</nowiki>|#FFB100}} {{Text|<nowiki>'Not compiling C code</nowiki>|#919191}}
                No_C_Compile_Mode = {{Text|1|#F580B1}}
                ConsoleMode = {{Text|1|#F580B1}} {{Text|<nowiki>'Implies -x</nowiki>|#919191}}
                NoIDEMode = {{Text|1|#F580B1}} {{Text|<nowiki>'Implies -c</nowiki>|#919191}}
                cmdlineswitch = {{Text|-1|#F580B1}}
            {{Cl|CASE}} {{Text|<nowiki>"-f"</nowiki>|#FFB100}} {{Text|<nowiki>'temporary setting</nowiki>|#919191}}
                token$ = {{Cl|MID$ (function)|MID$}}(token$, {{Text|3|#F580B1}})
                {{Cl|SELECT}} {{Cl|CASE}} {{Cl|LCASE$}}({{Cl|LEFT$}}(token$, {{Cl|INSTR}}(token$, {{Text|<nowiki>"="</nowiki>|#FFB100}}) - {{Text|1|#F580B1}}))
                    {{Cl|CASE}} {{Text|<nowiki>":useminiaudio"</nowiki>|#FFB100}}
                        {{Cl|IF}} {{Cl|NOT}} {{Text|ParseBooleanSetting&|#55FF55}}(token$, UseMiniaudioBackend) {{Cl|THEN}} {{Text|PrintTemporarySettingsHelpAndExit|#55FF55}} {{Text|InvalidSettingError$|#55FF55}}(token$)
                    {{Cl|CASE}} {{Text|<nowiki>":optimizecppprogram"</nowiki>|#FFB100}}
                        {{Cl|IF}} {{Cl|NOT}} {{Text|ParseBooleanSetting&|#55FF55}}(token$, OptimizeCppProgram) {{Cl|THEN}} {{Text|PrintTemporarySettingsHelpAndExit|#55FF55}} {{Text|InvalidSettingError$|#55FF55}}(token$)
                    {{Cl|CASE}} {{Text|<nowiki>":stripdebugsymbols"</nowiki>|#FFB100}}
                        {{Cl|IF}} {{Cl|NOT}} {{Text|ParseBooleanSetting&|#55FF55}}(token$, StripDebugSymbols) {{Cl|THEN}} {{Text|PrintTemporarySettingsHelpAndExit|#55FF55}} {{Text|InvalidSettingError$|#55FF55}}(token$)
                    {{Cl|CASE}} {{Text|<nowiki>":extracppflags"</nowiki>|#FFB100}}
                        {{Cl|IF}} {{Cl|NOT}} {{Text|ParseStringSetting&|#55FF55}}(token$, ExtraCppFlags) {{Cl|THEN}} {{Text|PrintTemporarySettingsHelpAndExit|#55FF55}} {{Text|InvalidSettingError$|#55FF55}}(token$)
                    {{Cl|CASE}} {{Text|<nowiki>":extralinkerflags"</nowiki>|#FFB100}}
                        {{Cl|IF}} {{Cl|NOT}} {{Text|ParseStringSetting&|#55FF55}}(token$, ExtraLinkerFlags) {{Cl|THEN}} {{Text|PrintTemporarySettingsHelpAndExit|#55FF55}} {{Text|InvalidSettingError$|#55FF55}}(token$)
                    {{Cl|CASE}} {{Text|<nowiki>":maxcompilerprocesses"</nowiki>|#FFB100}}
                        {{Cl|IF}} {{Cl|NOT}} {{Text|ParseLongSetting&|#55FF55}}(token$, MaxParallelProcesses) {{Cl|THEN}} {{Text|PrintTemporarySettingsHelpAndExit|#55FF55}} {{Text|InvalidSettingError$|#55FF55}}(token$)
                        {{Cl|IF}} MaxParallelProcesses = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|PrintTemporarySettingsHelpAndExit|#55FF55}} {{Text|<nowiki>"MaxCompilerProcesses must be more than zero"</nowiki>|#FFB100}}
                    {{Cl|CASE}} {{Text|<nowiki>":generatelicensefile"</nowiki>|#FFB100}}
                        {{Cl|IF}} {{Cl|NOT}} {{Text|ParseBooleanSetting&|#55FF55}}(token$, GenerateLicenseFile) {{Cl|THEN}} {{Text|PrintTemporarySettingsHelpAndExit|#55FF55}} {{Text|InvalidSettingError$|#55FF55}}(token$)
                    {{Cl|CASE}} {{Cl|ELSE}}
                        {{Text|PrintTemporarySettingsHelpAndExit|#55FF55}} {{Text|<nowiki>""</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|SELECT}}
            {{Cl|CASE}} {{Cl|ELSE}} {{Text|<nowiki>'Something we don't recognise, assume it's a filename</nowiki>|#919191}}
                {{Cl|IF}} PassedFileName$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} PassedFileName$ = token$
        {{Cl|END}} {{Cl|SELECT}}
    {{Cl|NEXT}} i
    {{Cl|IF}} {{Cl|LEN}}(PassedFileName$) {{Cl|THEN}}
        {{Text|ParseCMDLineArgs$|#55FF55}} = PassedFileName$
    {{Cl|ELSE}}
        {{Cl|IF}} cmdlineswitch = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} settingsMode = {{Text|-1|#F580B1}} {{Cl|THEN}} {{Cl|SYSTEM}}
    {{Cl|END}} {{Cl|IF}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|InvalidSettingError$|#55FF55}} (token$)
    {{Text|InvalidSettingError$|#55FF55}} = {{Text|<nowiki>"Invalid temporary setting switch: "</nowiki>|#FFB100}} + {{Text|AddQuotes$|#55FF55}}(token$)
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|SUB}} {{Text|PrintTemporarySettingsHelpAndExit|#55FF55}} (errstr$)
    {{Cl|_DEST}} {{Cl|_CONSOLE}}
    {{Cl|PRINT}} {{Text|<nowiki>"QB64-PE Compiler V"</nowiki>|#FFB100}} + Version$
    {{Cl|IF}} errstr$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
        {{Cl|PRINT}} {{Text|<nowiki>"Error: "</nowiki>|#FFB100}}; errstr$
    {{Cl|END}} {{Cl|IF}}
    {{Cl|PRINT}}
    {{Cl|PRINT}} {{Text|<nowiki>"Note: Defaults can be changed by IDE settings"</nowiki>|#FFB100}}
    {{Cl|PRINT}}
    {{Cl|PRINT}} {{Text|<nowiki>"Valid settings:"</nowiki>|#FFB100}}
    {{Cl|PRINT}} {{Text|<nowiki>"    -f:UseMiniAudio=[true|false]        (Use Miniaudio Audio backend, default true)"</nowiki>|#FFB100}}
    {{Cl|PRINT}} {{Text|<nowiki>"    -f:OptimizeCppProgram=[true|false]  (Use C++ Optimization flag, default false)"</nowiki>|#FFB100}}
    {{Cl|PRINT}} {{Text|<nowiki>"    -f:StripDebugSymbols=[true|false]    (Stirp C++ debug symbols, default true)"</nowiki>|#FFB100}}
    {{Cl|PRINT}} {{Text|<nowiki>"    -f:ExtraCppFlags=[string]            (Extra flags to pass to the C++ compiler)"</nowiki>|#FFB100}}
    {{Cl|PRINT}} {{Text|<nowiki>"    -f:ExtraLinkerFlags=[string]        (Extra flags to pass at link time)"</nowiki>|#FFB100}}
    {{Cl|PRINT}} {{Text|<nowiki>"    -f:MaxCompilerProcesses=[integer]    (Max C++ compiler processes to start in parallel)"</nowiki>|#FFB100}}
    {{Cl|PRINT}} {{Text|<nowiki>"    -f:GenerateLicenseFile=[true|false]  (Produce a license.txt file for the program)"</nowiki>|#FFB100}}
    {{Cl|SYSTEM}}
{{Cl|END}} {{Cl|SUB}}
{{Cl|FUNCTION}} {{Text|ParseBooleanSetting&|#55FF55}} (token$, setting {{Cl|AS}} {{Cl|_UNSIGNED}} {{Cl|LONG}})
    {{Cl|DIM}} equals {{Cl|AS}} {{Cl|LONG}}
    {{Cl|DIM}} value {{Cl|AS}} {{Cl|STRING}}
    equals = {{Cl|INSTR}}(token$, {{Text|<nowiki>"="</nowiki>|#FFB100}})
    {{Cl|IF}} equals = {{Text|-1|#F580B1}} {{Cl|THEN}} {{Text|ParseBooleanSetting&|#55FF55}} = {{Text|0|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    value = {{Cl|LCASE$}}({{Cl|MID$ (function)|MID$}}(token$, equals + {{Text|1|#F580B1}}))
    {{Cl|SELECT}} {{Cl|CASE}} value
        {{Cl|CASE}} {{Text|<nowiki>"true"</nowiki>|#FFB100}}, {{Text|<nowiki>"on"</nowiki>|#FFB100}}, {{Text|<nowiki>"yes"</nowiki>|#FFB100}}
            setting = {{Text|-1|#F580B1}}
            {{Text|ParseBooleanSetting&|#55FF55}} = {{Text|-1|#F580B1}}
        {{Cl|CASE}} {{Text|<nowiki>"false"</nowiki>|#FFB100}}, {{Text|<nowiki>"off"</nowiki>|#FFB100}}, {{Text|<nowiki>"no"</nowiki>|#FFB100}}
            setting = {{Text|0|#F580B1}}
            {{Text|ParseBooleanSetting&|#55FF55}} = {{Text|-1|#F580B1}}
        {{Cl|CASE}} {{Cl|ELSE}}
            {{Text|ParseBooleanSetting&|#55FF55}} = {{Text|0|#F580B1}}
    {{Cl|END}} {{Cl|SELECT}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|ParseLongSetting&|#55FF55}} (token$, setting {{Cl|AS}} {{Cl|_UNSIGNED}} {{Cl|LONG}})
    {{Cl|DIM}} equals {{Cl|AS}} {{Cl|LONG}}
    equals = {{Cl|INSTR}}(token$, {{Text|<nowiki>"="</nowiki>|#FFB100}})
    {{Cl|IF}} equals = {{Text|-1|#F580B1}} {{Cl|THEN}} {{Text|ParseLongSetting&|#55FF55}} = {{Text|0|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    setting = {{Cl|VAL}}({{Cl|MID$ (function)|MID$}}(token$, equals + {{Text|1|#F580B1}}))
    {{Text|ParseLongSetting&|#55FF55}} = {{Text|-1|#F580B1}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|ParseStringSetting&|#55FF55}} (token$, setting {{Cl|AS}} {{Cl|STRING}})
    {{Cl|DIM}} equals {{Cl|AS}} {{Cl|LONG}}
    equals = {{Cl|INSTR}}(token$, {{Text|<nowiki>"="</nowiki>|#FFB100}})
    {{Cl|IF}} equals = {{Text|-1|#F580B1}} {{Cl|THEN}} {{Text|ParseStringSetting&|#55FF55}} = {{Text|0|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    setting = {{Cl|MID$ (function)|MID$}}(token$, equals + {{Text|1|#F580B1}})
    {{Text|ParseStringSetting&|#55FF55}} = {{Text|-1|#F580B1}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|Type2MemTypeValue|#55FF55}} (t1)
    t = {{Text|0|#F580B1}}
    {{Cl|IF}} t1 {{Cl|AND (boolean)|AND}} ISARRAY {{Cl|THEN}} t = t + {{Text|65536|#F580B1}}
    {{Cl|IF}} t1 {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
        {{Cl|IF}} (t1 {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|1|#F580B1}} {{Cl|THEN}}
            t = t + {{Text|4096|#F580B1}} {{Text|<nowiki>'_MEM type</nowiki>|#919191}}
        {{Cl|ELSE}}
            t = t + {{Text|32768|#F580B1}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|ELSE}}
        {{Cl|IF}} t1 {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
            t = t + {{Text|512|#F580B1}} {{Text|<nowiki>'string</nowiki>|#919191}}
        {{Cl|ELSE}}
            {{Cl|IF}} t1 {{Cl|AND (boolean)|AND}} ISFLOAT {{Cl|THEN}}
                t = t + {{Text|256|#F580B1}} {{Text|<nowiki>'float</nowiki>|#919191}}
            {{Cl|ELSE}}
                t = t + {{Text|128|#F580B1}} {{Text|<nowiki>'integer</nowiki>|#919191}}
                {{Cl|IF}} t1 {{Cl|AND (boolean)|AND}} ISUNSIGNED {{Cl|THEN}} t = t + {{Text|1024|#F580B1}}
                {{Cl|IF}} t1 {{Cl|AND (boolean)|AND}} ISOFFSET {{Cl|THEN}} t = t + {{Text|8192|#F580B1}} {{Text|<nowiki>'offset type</nowiki>|#919191}}
            {{Cl|END}} {{Cl|IF}}
            t1s = (t1 {{Cl|AND}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}}
            {{Cl|IF}} t1s = {{Text|1|#F580B1}} {{Cl|THEN}} t = t + t1s
            {{Cl|IF}} t1s = {{Text|2|#F580B1}} {{Cl|THEN}} t = t + t1s
            {{Cl|IF}} t1s = {{Text|4|#F580B1}} {{Cl|THEN}} t = t + t1s
            {{Cl|IF}} t1s = {{Text|8|#F580B1}} {{Cl|THEN}} t = t + t1s
            {{Cl|IF}} t1s = {{Text|16|#F580B1}} {{Cl|THEN}} t = t + t1s
            {{Cl|IF}} t1s = {{Text|32|#F580B1}} {{Cl|THEN}} t = t + t1s
            {{Cl|IF}} t1s = {{Text|64|#F580B1}} {{Cl|THEN}} t = t + t1s
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|Type2MemTypeValue|#55FF55}} = t
{{Cl|END}} {{Cl|FUNCTION}}
{{Text|<nowiki>'udt is non-zero if this is an array of udt's, to allow examining each udt element</nowiki>|#919191}}
{{Cl|FUNCTION}} {{Text|allocarray|#55FF55}} (n2$, elements$, elementsize, udt)
    dimsharedlast = dimshared: dimshared = {{Text|0|#F580B1}}
    {{Cl|IF}} autoarray = {{Text|1|#F580B1}} {{Cl|THEN}} autoarray = {{Text|0|#F580B1}}: autoary = {{Text|1|#F580B1}} {{Text|<nowiki>'clear global value & set local value</nowiki>|#919191}}
    f12$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
    {{Text|<nowiki>'changelog:</nowiki>|#919191}}
    {{Text|<nowiki>'added 4 to [2] to indicate cmem array where appropriate</nowiki>|#919191}}
    e$ = elements$: n$ = n2$
    {{Cl|IF}} elementsize = {{Text|-2147483647|#F580B1}} {{Cl|THEN}} stringarray = {{Text|1|#F580B1}}: elementsize = {{Text|8|#F580B1}}
    {{Cl|IF}} {{Cl|ASC (function)|ASC}}(e$) = {{Text|63|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'?</nowiki>|#919191}}
        l$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp2 + {{Text|<nowiki>")"</nowiki>|#FFB100}}
        undefined = {{Text|-1|#F580B1}}
        nume = {{Text|1|#F580B1}}
        {{Cl|IF}} {{Cl|LEN}}(e$) = {{Text|1|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} undefinedarray
        undefined = {{Text|1|#F580B1}}
        nume = {{Cl|VAL}}({{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - {{Text|1|#F580B1}}))
        {{Cl|GOTO}} undefinedarray
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'work out how many elements there are (critical to later calculations)</nowiki>|#919191}}
    nume = {{Text|1|#F580B1}}
    n = {{Text|numelements|#55FF55}}(e$)
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} n
        e2$ = {{Text|getelement|#55FF55}}(e$, i)
        {{Cl|IF}} e2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} b = b + {{Text|1|#F580B1}}
        {{Cl|IF}} b = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} e2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}} nume = nume + {{Text|1|#F580B1}}
        {{Cl|IF}} e2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} b = b - {{Text|1|#F580B1}}
    {{Cl|NEXT}}
    {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"numelements count:"</nowiki>|#FFB100}}; nume
    descstatic = {{Text|0|#F580B1}}
    {{Cl|IF}} arraydesc {{Cl|THEN}}
        {{Cl|IF}} id.arrayelements <> nume {{Cl|THEN}}
            {{Cl|IF}} id.arrayelements = {{Text|-1|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'unknown</nowiki>|#919191}}
                {{Cl|IF}} arrayelementslist(currentid) <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} nume <> arrayelementslist(currentid) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot change the number of elements an array has!"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|IF}} nume = {{Text|1|#F580B1}} {{Cl|THEN}} id.arrayelements = {{Text|1|#F580B1}}: ids(currentid).arrayelements = {{Text|1|#F580B1}} {{Text|<nowiki>'lucky guess!</nowiki>|#919191}}
                arrayelementslist(currentid) = nume
            {{Cl|ELSE}}
                {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot change the number of elements an array has!"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} id.staticarray {{Cl|THEN}} descstatic = {{Text|1|#F580B1}}
    {{Cl|END}} {{Cl|IF}}
    l$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp2
    cr$ = {{Cl|CHR$}}({{Text|13|#F580B1}}) + {{Cl|CHR$}}({{Text|10|#F580B1}})
    sd$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
    constdimensions = {{Text|1|#F580B1}}
    ei = {{Text|4|#F580B1}} + nume * {{Text|4|#F580B1}} - {{Text|4|#F580B1}}
    cure = {{Text|1|#F580B1}}
    e3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: e3base$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} n
        e2$ = {{Text|getelement|#55FF55}}(e$, i)
        {{Cl|IF}} e2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} b = b + {{Text|1|#F580B1}}
        {{Cl|IF}} (e2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} b = {{Text|0|#F580B1}}) {{Cl|OR (boolean)|OR}} i = n {{Cl|THEN}}
            {{Cl|IF}} i = n {{Cl|THEN}} e3$ = e3$ + sp + e2$
            e3$ = {{Cl|RIGHT$}}(e3$, {{Cl|LEN}}(e3$) - {{Text|1|#F580B1}})
            {{Cl|IF}} e3base$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} e3base$ = {{Cl|RIGHT$}}(e3base$, {{Cl|LEN}}(e3base$) - {{Text|1|#F580B1}})
            {{Text|<nowiki>'PRINT e3base$ + "[TO]" + e3$</nowiki>|#919191}}
            {{Text|<nowiki>'set the base</nowiki>|#919191}}
            basegiven = {{Text|1|#F580B1}}
            {{Cl|IF}} e3base$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} e3base$ = {{Text|str2$|#55FF55}}(optionbase + {{Text|0|#F580B1}}): basegiven = {{Text|0|#F580B1}}
            constequation = {{Text|1|#F580B1}}
            e3base$ = {{Text|fixoperationorder$|#55FF55}}(e3base$)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|IF}} basegiven {{Cl|THEN}} l$ = l$ + tlayout$ + sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"To"</nowiki>|#FFB100}}) + sp
            e3base$ = {{Text|evaluatetotyp$|#55FF55}}(e3base$, {{Text|64&|#F580B1}})
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|IF}} constequation = {{Text|0|#F580B1}} {{Cl|THEN}} constdimensions = {{Text|0|#F580B1}}
            sd$ = sd$ + n$ + {{Text|<nowiki>"["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(ei) + {{Text|<nowiki>"]="</nowiki>|#FFB100}} + e3base$ + {{Text|<nowiki>";"</nowiki>|#FFB100}} + cr$
            {{Text|<nowiki>'set the number of indexes</nowiki>|#919191}}
            constequation = {{Text|1|#F580B1}}
            e3$ = {{Text|fixoperationorder$|#55FF55}}(e3$)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            l$ = l$ + tlayout$ + sp2
            {{Cl|IF}} i = n {{Cl|THEN}} l$ = l$ + {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|ELSE}} l$ = l$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp
            e3$ = {{Text|evaluatetotyp$|#55FF55}}(e3$, {{Text|64&|#F580B1}})
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|IF}} constequation = {{Text|0|#F580B1}} {{Cl|THEN}} constdimensions = {{Text|0|#F580B1}}
            ei = ei + {{Text|1|#F580B1}}
            sd$ = sd$ + n$ + {{Text|<nowiki>"["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(ei) + {{Text|<nowiki>"]=("</nowiki>|#FFB100}} + e3$ + {{Text|<nowiki>")-"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(ei - {{Text|1|#F580B1}}) + {{Text|<nowiki>"]+1;"</nowiki>|#FFB100}} + cr$
            ei = ei + {{Text|1|#F580B1}}
            {{Text|<nowiki>'calc muliplier</nowiki>|#919191}}
            {{Cl|IF}} cure = {{Text|1|#F580B1}} {{Cl|THEN}}
                {{Text|<nowiki>'set only for the purpose of the calculating correct multipliers</nowiki>|#919191}}
                sd$ = sd$ + n$ + {{Text|<nowiki>"["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(ei) + {{Text|<nowiki>"]=1;"</nowiki>|#FFB100}} + cr$
            {{Cl|ELSE}}
                sd$ = sd$ + n$ + {{Text|<nowiki>"["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(ei) + {{Text|<nowiki>"]="</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(ei + {{Text|4|#F580B1}}) + {{Text|<nowiki>"]*"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(ei + {{Text|3|#F580B1}}) + {{Text|<nowiki>"];"</nowiki>|#FFB100}} + cr$
            {{Cl|END}} {{Cl|IF}}
            ei = ei + {{Text|1|#F580B1}}
            ei = ei + {{Text|1|#F580B1}} {{Text|<nowiki>'skip reserved</nowiki>|#919191}}
            ei = ei - {{Text|8|#F580B1}}
            cure = cure + {{Text|1|#F580B1}}
            e3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: e3base$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Cl|GOTO}} aanexte
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} e2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} b = b - {{Text|1|#F580B1}}
        {{Cl|IF}} {{Cl|UCASE$}}(e2$) = {{Text|<nowiki>"TO"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} b = {{Text|0|#F580B1}} {{Cl|THEN}}
            e3base$ = e3$
            e3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Cl|ELSE}}
            e3$ = e3$ + sp + e2$
        {{Cl|END}} {{Cl|IF}}
        aanexte:
    {{Cl|NEXT}}
    sd$ = {{Cl|LEFT$}}(sd$, {{Cl|LEN}}(sd$) - {{Text|2|#F580B1}})
    undefinedarray:
    {{Text|<nowiki>'calc cmem</nowiki>|#919191}}
    cmem = {{Text|0|#F580B1}}
    {{Cl|IF}} arraydesc = {{Text|0|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} cmemlist(idn + {{Text|1|#F580B1}}) {{Cl|THEN}} cmem = {{Text|1|#F580B1}}
    {{Cl|ELSE}}
        {{Cl|IF}} cmemlist(arraydesc) {{Cl|THEN}} cmem = {{Text|1|#F580B1}}
    {{Cl|END}} {{Cl|IF}}
    staticarray = constdimensions
    {{Cl|IF}} subfuncn <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} dimstatic = {{Text|0|#F580B1}} {{Cl|THEN}} staticarray = {{Text|0|#F580B1}} {{Text|<nowiki>'arrays in SUBS/FUNCTIONS are DYNAMIC</nowiki>|#919191}}
    {{Cl|IF}} dimstatic = {{Text|3|#F580B1}} {{Cl|THEN}} staticarray = {{Text|0|#F580B1}} {{Text|<nowiki>'STATIC arrayname() listed arrays keep thier values but are dynamic in memory</nowiki>|#919191}}
    {{Cl|IF}} DynamicMode {{Cl|THEN}} staticarray = {{Text|0|#F580B1}}
    {{Cl|IF}} redimoption {{Cl|THEN}} staticarray = {{Text|0|#F580B1}}
    {{Cl|IF}} dimoption = {{Text|3|#F580B1}} {{Cl|THEN}} staticarray = {{Text|0|#F580B1}} {{Text|<nowiki>'STATIC a(100) arrays are still dynamic</nowiki>|#919191}}
    {{Cl|IF}} arraydesc {{Cl|THEN}}
        {{Cl|IF}} staticarray = {{Text|1|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} descstatic {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot redefine a static array!"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            staticarray = {{Text|0|#F580B1}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    bytesperelement$ = {{Text|str2|#55FF55}}(elementsize)
    {{Cl|IF}} elementsize < {{Text|0|#F580B1}} {{Cl|THEN}}
        elementsize = -elementsize
        bytesperelement$ = {{Text|str2|#55FF55}}(elementsize) + {{Text|<nowiki>"/8+1"</nowiki>|#FFB100}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'Begin creation of array descriptor (if array has not been defined yet)</nowiki>|#919191}}
    {{Cl|IF}} arraydesc = {{Text|0|#F580B1}} {{Cl|THEN}}
        {{Text|WriteBufLine|#55FF55}} defdatahandle, {{Text|<nowiki>"ptrszint *"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"=NULL;"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if (!"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"){"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"=(ptrszint*)mem_static_malloc("</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}({{Text|4|#F580B1}} * nume + {{Text|4|#F580B1}} + {{Text|1|#F580B1}}) + {{Text|<nowiki>"*ptrsz);"</nowiki>|#FFB100}} {{Text|<nowiki>'+1 is for the lock</nowiki>|#919191}}
        {{Text|<nowiki>'create _MEM lock</nowiki>|#919191}}
        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"new_mem_lock();"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"mem_lock_tmp->type=4;"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"((ptrszint*)"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}({{Text|4|#F580B1}} * nume + {{Text|4|#F580B1}} + {{Text|1|#F580B1}} - {{Text|1|#F580B1}}) + {{Text|<nowiki>"]=(ptrszint)mem_lock_tmp;"</nowiki>|#FFB100}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'generate sizestr$ & elesizestr$ (both are used in various places in following code)</nowiki>|#919191}}
    sizestr$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} nume
        {{Cl|IF}} i <> {{Text|1|#F580B1}} {{Cl|THEN}} sizestr$ = sizestr$ + {{Text|<nowiki>"*"</nowiki>|#FFB100}}
        sizestr$ = sizestr$ + n$ + {{Text|<nowiki>"["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(i * {{Text|4|#F580B1}} - {{Text|4|#F580B1}} + {{Text|5|#F580B1}}) + {{Text|<nowiki>"]"</nowiki>|#FFB100}}
    {{Cl|NEXT}}
    elesizestr$ = sizestr$ {{Text|<nowiki>'elements in entire array</nowiki>|#919191}}
    sizestr$ = sizestr$ + {{Text|<nowiki>"*"</nowiki>|#FFB100}} + bytesperelement$ {{Text|<nowiki>'bytes in entire array</nowiki>|#919191}}
    {{Text|<nowiki>'------------------STATIC ARRAY CREATION--------------------------------</nowiki>|#919191}}
    {{Cl|IF}} staticarray {{Cl|THEN}}
        {{Text|<nowiki>'STATIC memory</nowiki>|#919191}}
        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, sd$ {{Text|<nowiki>'setup new array dimension ranges</nowiki>|#919191}}
        {{Text|<nowiki>'Example of sd$ for DIM a(10):</nowiki>|#919191}}
        {{Text|<nowiki>'__ARRAY_SINGLE_A[4]= 0 ;</nowiki>|#919191}}
        {{Text|<nowiki>'__ARRAY_SINGLE_A[5]=( 10 )-__ARRAY_SINGLE_A[4]+1;</nowiki>|#919191}}
        {{Text|<nowiki>'__ARRAY_SINGLE_A[6]=1;</nowiki>|#919191}}
        {{Cl|IF}} cmem {{Cl|AND (boolean)|AND}} stringarray = {{Text|0|#F580B1}} {{Cl|THEN}}
            {{Text|<nowiki>'Note: A string array's pointers are always stored in 64bit memory</nowiki>|#919191}}
            {{Text|<nowiki>'(static)CONVENTINAL memory</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"[0]=(ptrszint)cmem_static_pointer;"</nowiki>|#FFB100}}
            {{Text|<nowiki>'alloc mem & check if static memory boundry has oversteped dynamic memory boundry</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if ((cmem_static_pointer+=(("</nowiki>|#FFB100}} + sizestr$ + {{Text|<nowiki>")+15)&-16)>cmem_dynamic_base) error(257);"</nowiki>|#FFB100}}
            {{Text|<nowiki>'64K check</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if (("</nowiki>|#FFB100}} + sizestr$ + {{Text|<nowiki>")>65536) error(257);"</nowiki>|#FFB100}}
            {{Text|<nowiki>'clear array</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"memset((void*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]),0,"</nowiki>|#FFB100}} + sizestr$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
            {{Text|<nowiki>'set flags</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"[2]=1+2+4;"</nowiki>|#FFB100}} {{Text|<nowiki>'init+static+cmem</nowiki>|#919191}}
        {{Cl|ELSE}}
            {{Text|<nowiki>'64BIT MEMORY</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"[0]=(ptrszint)mem_static_malloc("</nowiki>|#FFB100}} + sizestr$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
            {{Cl|IF}} stringarray {{Cl|THEN}}
                {{Text|<nowiki>'Init string pointers in the array</nowiki>|#919191}}
                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"tmp_long="</nowiki>|#FFB100}} + elesizestr$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"while(tmp_long--){"</nowiki>|#FFB100}}
                {{Cl|IF}} cmem {{Cl|THEN}}
                    {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"((uint64*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]))[tmp_long]=(uint64)qbs_new_cmem(0,0);"</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"((uint64*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]))[tmp_long]=(uint64)qbs_new(0,0);"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                {{Text|<nowiki>'clear array</nowiki>|#919191}}
                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"memset((void*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]),0,"</nowiki>|#FFB100}} + sizestr$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"[2]=1+2;"</nowiki>|#FFB100}} {{Text|<nowiki>'init+static</nowiki>|#919191}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} udt > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} udtxvariable(udt) {{Cl|THEN}}
            {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"tmp_long="</nowiki>|#FFB100}} + elesizestr$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"while(tmp_long--){"</nowiki>|#FFB100}}
            {{Text|initialise_array_udt_varstrings|#55FF55}} n$, udt, {{Text|0|#F580B1}}, bytesperelement$, acc$
            {{Text|WriteBufLine|#55FF55}} DataTxtBuf, acc$
            {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'Close static array desc</nowiki>|#919191}}
        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
        {{Text|allocarray|#55FF55}} = nume + {{Text|65536|#F580B1}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'------------------END OF STATIC ARRAY CREATION-------------------------</nowiki>|#919191}}
    {{Text|<nowiki>'------------------DYNAMIC ARRAY CREATION-------------------------------</nowiki>|#919191}}
    {{Cl|IF}} staticarray = {{Text|0|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} undefined = {{Text|0|#F580B1}} {{Cl|THEN}}
            {{Text|<nowiki>'Generate error if array is static</nowiki>|#919191}}
            f12$ = f12$ + CRLF + {{Text|<nowiki>"if ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[2]&2){"</nowiki>|#FFB100}} {{Text|<nowiki>'static array</nowiki>|#919191}}
            f12$ = f12$ + CRLF + {{Text|<nowiki>"error(10);"</nowiki>|#FFB100}} {{Text|<nowiki>'cannot redefine a static array!</nowiki>|#919191}}
            f12$ = f12$ + CRLF + {{Text|<nowiki>"}else{"</nowiki>|#FFB100}}
            {{Text|<nowiki>'Note: Array is either undefined or dynamically defined at this point</nowiki>|#919191}}
            {{Text|<nowiki>'REDIM (not DIM) must be used to redefine an array</nowiki>|#919191}}
            {{Cl|IF}} redimoption = {{Text|0|#F580B1}} {{Cl|THEN}}
                f12$ = f12$ + CRLF + {{Text|<nowiki>"if ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[2]&1){"</nowiki>|#FFB100}} {{Text|<nowiki>'array is defined</nowiki>|#919191}}
                f12$ = f12$ + CRLF + {{Text|<nowiki>"if (!error_occurred) error(10);"</nowiki>|#FFB100}} {{Text|<nowiki>'cannot redefine an array without using REDIM!</nowiki>|#919191}}
                f12$ = f12$ + CRLF + {{Text|<nowiki>"}else{"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                {{Text|<nowiki>'--------ERASE EXISTING ARRAY IF NECESSARY--------</nowiki>|#919191}}
                {{Text|<nowiki>'IMPORTANT: If array is not going to be preserved, it should be cleared before</nowiki>|#919191}}
                {{Text|<nowiki>'          creating the new array for memory considerations</nowiki>|#919191}}
                {{Text|<nowiki>'refresh lock ID (_MEM)</nowiki>|#919191}}
                f12$ = f12$ + CRLF + {{Text|<nowiki>"((mem_lock*)((ptrszint*)"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}({{Text|4|#F580B1}} * nume + {{Text|4|#F580B1}} + {{Text|1|#F580B1}} - {{Text|1|#F580B1}}) + {{Text|<nowiki>"])->id=(++mem_lock_id);"</nowiki>|#FFB100}}
                {{Cl|IF}} redimoption = {{Text|2|#F580B1}} {{Cl|THEN}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"static int32 preserved_elements;"</nowiki>|#FFB100}} {{Text|<nowiki>'must be put here for scope considerations</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'If array is defined, it must be destroyed first</nowiki>|#919191}}
                f12$ = f12$ + CRLF + {{Text|<nowiki>"if ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[2]&1){"</nowiki>|#FFB100}} {{Text|<nowiki>'array is defined</nowiki>|#919191}}
                {{Cl|IF}} redimoption = {{Text|2|#F580B1}} {{Cl|THEN}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"preserved_elements="</nowiki>|#FFB100}} + elesizestr$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                    {{Cl|GOTO}} skiperase
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'Note: pointers to strings must be freed before array can be freed</nowiki>|#919191}}
                {{Cl|IF}} stringarray {{Cl|THEN}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"tmp_long="</nowiki>|#FFB100}} + elesizestr$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"while(tmp_long--) qbs_free((qbs*)((uint64*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]))[tmp_long]);"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'As must any variable length strings in UDT's</nowiki>|#919191}}
                {{Cl|IF}} udt > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} udtxvariable(udt) {{Cl|THEN}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"tmp_long="</nowiki>|#FFB100}} + elesizestr$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"while(tmp_long--) {"</nowiki>|#FFB100}}
                    {{Text|free_array_udt_varstrings|#55FF55}} n$, udt, {{Text|0|#F580B1}}, bytesperelement$, acc$
                    f12$ = f12$ + acc$ + {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'Free array's memory</nowiki>|#919191}}
                {{Cl|IF}} stringarray {{Cl|THEN}}
                    {{Text|<nowiki>'Note: String arrays are never in cmem</nowiki>|#919191}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"free((void*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]));"</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    {{Text|<nowiki>'Note: Array may be in cmem!</nowiki>|#919191}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"if ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[2]&4){"</nowiki>|#FFB100}} {{Text|<nowiki>'array is in cmem</nowiki>|#919191}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"cmem_dynamic_free((uint8*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]));"</nowiki>|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"}else{"</nowiki>|#FFB100}} {{Text|<nowiki>'not in cmem</nowiki>|#919191}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"free((void*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]));"</nowiki>|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                skiperase:
                f12$ = f12$ + CRLF + {{Text|<nowiki>"}"</nowiki>|#FFB100}} {{Text|<nowiki>'array was defined</nowiki>|#919191}}
                {{Cl|IF}} redimoption = {{Text|2|#F580B1}} {{Cl|THEN}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"else preserved_elements=0;"</nowiki>|#FFB100}} {{Text|<nowiki>'if array wasn't defined, no elements are preserved</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'--------ERASED ARRAY AS NECESSARY--------</nowiki>|#919191}}
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'redim specified</nowiki>|#919191}}
            {{Text|<nowiki>'--------CREATE ARRAY & CLEAN-UP CODE--------</nowiki>|#919191}}
            {{Text|<nowiki>'Overwrite existing array dimension sizes/ranges</nowiki>|#919191}}
            f12$ = f12$ + CRLF + sd$
            {{Cl|IF}} stringarray {{Cl|OR (boolean)|OR}} ((udt > {{Text|0|#F580B1}}) {{Cl|AND (boolean)|AND}} udtxvariable(udt)) {{Cl|THEN}}
                {{Text|<nowiki>'Note: String and variable-length udt arrays are always created in 64bit memory</nowiki>|#919191}}
                {{Cl|IF}} redimoption = {{Text|2|#F580B1}} {{Cl|THEN}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"if (preserved_elements){"</nowiki>|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"static ptrszint tmp_long2;"</nowiki>|#FFB100}}
                    {{Text|<nowiki>'free any qbs strings which will be lost in the realloc</nowiki>|#919191}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"tmp_long2="</nowiki>|#FFB100}} + elesizestr$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"if (tmp_long2<preserved_elements){"</nowiki>|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"for(tmp_long=tmp_long2;tmp_long<preserved_elements;tmp_long++) {"</nowiki>|#FFB100}}
                    {{Cl|IF}} stringarray {{Cl|THEN}}
                        f12$ = f12$ + CRLF + {{Text|<nowiki>"qbs_free((qbs*)((uint64*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]))[tmp_long]);"</nowiki>|#FFB100}}
                    {{Cl|ELSE}}
                        acc$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                        {{Text|free_array_udt_varstrings|#55FF55}} n$, udt, {{Text|0|#F580B1}}, bytesperelement$, acc$
                        f12$ = f12$ + acc$
                    {{Cl|END}} {{Cl|IF}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"}}"</nowiki>|#FFB100}}
                    {{Text|<nowiki>'reallocate the array</nowiki>|#919191}}
                    f12$ = f12$ + CRLF + n$ + {{Text|<nowiki>"[0]=(ptrszint)realloc((void*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]),tmp_long2*"</nowiki>|#FFB100}} + bytesperelement$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"if (!"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]) error(257);"</nowiki>|#FFB100}} {{Text|<nowiki>'not enough memory</nowiki>|#919191}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"if (preserved_elements<tmp_long2){"</nowiki>|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"for(tmp_long=preserved_elements;tmp_long<tmp_long2;tmp_long++){"</nowiki>|#FFB100}}
                    {{Cl|IF}} stringarray {{Cl|THEN}}
                        f12$ = f12$ + CRLF + {{Text|<nowiki>"if ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[2]&4){"</nowiki>|#FFB100}} {{Text|<nowiki>'array is in cmem</nowiki>|#919191}}
                        f12$ = f12$ + CRLF + {{Text|<nowiki>"((uint64*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]))[tmp_long]=(uint64)qbs_new_cmem(0,0);"</nowiki>|#FFB100}}
                        f12$ = f12$ + CRLF + {{Text|<nowiki>"}else{"</nowiki>|#FFB100}} {{Text|<nowiki>'not in cmem</nowiki>|#919191}}
                        f12$ = f12$ + CRLF + {{Text|<nowiki>"((uint64*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]))[tmp_long]=(uint64)qbs_new(0,0);"</nowiki>|#FFB100}}
                        f12$ = f12$ + CRLF + {{Text|<nowiki>"}"</nowiki>|#FFB100}} {{Text|<nowiki>'not in cmem</nowiki>|#919191}}
                    {{Cl|ELSE}}
                        acc$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                        {{Text|initialise_array_udt_varstrings|#55FF55}} n$, udt, {{Text|0|#F580B1}}, bytesperelement$, acc$
                        f12$ = f12$ + acc$
                    {{Cl|END}} {{Cl|IF}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"}else{"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'1. Create array</nowiki>|#919191}}
                f12$ = f12$ + CRLF + n$ + {{Text|<nowiki>"[0]=(ptrszint)malloc("</nowiki>|#FFB100}} + sizestr$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                f12$ = f12$ + CRLF + {{Text|<nowiki>"if (!"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]) error(257);"</nowiki>|#FFB100}} {{Text|<nowiki>'not enough memory</nowiki>|#919191}}
                f12$ = f12$ + CRLF + n$ + {{Text|<nowiki>"[2]|=1;"</nowiki>|#FFB100}} {{Text|<nowiki>'ADD initialized flag</nowiki>|#919191}}
                f12$ = f12$ + CRLF + {{Text|<nowiki>"tmp_long="</nowiki>|#FFB100}} + elesizestr$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Text|<nowiki>'init individual strings</nowiki>|#919191}}
                {{Cl|IF}} stringarray {{Cl|THEN}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"if ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[2]&4){"</nowiki>|#FFB100}} {{Text|<nowiki>'array is in cmem</nowiki>|#919191}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"while(tmp_long--) ((uint64*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]))[tmp_long]=(uint64)qbs_new_cmem(0,0);"</nowiki>|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"}else{"</nowiki>|#FFB100}} {{Text|<nowiki>'not in cmem</nowiki>|#919191}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"while(tmp_long--) ((uint64*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]))[tmp_long]=(uint64)qbs_new(0,0);"</nowiki>|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"}"</nowiki>|#FFB100}} {{Text|<nowiki>'not in cmem</nowiki>|#919191}}
                {{Cl|ELSE}} {{Text|<nowiki>'initialise udt's</nowiki>|#919191}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"while(tmp_long--){"</nowiki>|#FFB100}}
                    acc$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    {{Text|initialise_array_udt_varstrings|#55FF55}} n$, udt, {{Text|0|#F580B1}}, bytesperelement$, acc$
                    f12$ = f12$ + acc$ + {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} redimoption = {{Text|2|#F580B1}} {{Cl|THEN}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'2. Generate "clean up" code (called when EXITING A SUB/FUNCTION)</nowiki>|#919191}}
                {{Cl|IF}} arraydesc = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'only add for first declaration of the array</nowiki>|#919191}}
                    {{Text|WriteBufLine|#55FF55}} FreeTxtBuf, {{Text|<nowiki>"if ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[2]&1){"</nowiki>|#FFB100}} {{Text|<nowiki>'initialized?</nowiki>|#919191}}
                    {{Text|WriteBufLine|#55FF55}} FreeTxtBuf, {{Text|<nowiki>"tmp_long="</nowiki>|#FFB100}} + elesizestr$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                    {{Cl|IF}} udt > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} udtxvariable(udt) {{Cl|THEN}}
                        {{Text|WriteBufLine|#55FF55}} FreeTxtBuf, {{Text|<nowiki>"while(tmp_long--) {"</nowiki>|#FFB100}}
                        acc$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                        {{Text|free_array_udt_varstrings|#55FF55}} n$, udt, {{Text|0|#F580B1}}, bytesperelement$, acc$
                        {{Text|WriteBufLine|#55FF55}} FreeTxtBuf, acc$ + {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                    {{Cl|ELSE}}
                        {{Text|WriteBufLine|#55FF55}} FreeTxtBuf, {{Text|<nowiki>"while(tmp_long--) qbs_free((qbs*)((uint64*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]))[tmp_long]);"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|WriteBufLine|#55FF55}} FreeTxtBuf, {{Text|<nowiki>"free((void*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]));"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} FreeTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                    {{Text|<nowiki>'free lock (_MEM)</nowiki>|#919191}}
                    {{Text|WriteBufLine|#55FF55}} FreeTxtBuf, {{Text|<nowiki>"free_mem_lock( (mem_lock*)((ptrszint*)"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}({{Text|4|#F580B1}} * nume + {{Text|4|#F580B1}} + {{Text|1|#F580B1}} - {{Text|1|#F580B1}}) + {{Text|<nowiki>"] );"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|ELSE}} {{Text|<nowiki>'not string/var-udt array</nowiki>|#919191}}
                {{Text|<nowiki>'1. Create array</nowiki>|#919191}}
                f12$ = f12$ + CRLF + {{Text|<nowiki>"if ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[2]&4){"</nowiki>|#FFB100}} {{Text|<nowiki>'array will be in cmem</nowiki>|#919191}}
                {{Cl|IF}} redimoption = {{Text|2|#F580B1}} {{Cl|THEN}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"if (preserved_elements){"</nowiki>|#FFB100}}
                    {{Text|<nowiki>'reallocation method</nowiki>|#919191}}
                    {{Text|<nowiki>'backup data</nowiki>|#919191}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"memcpy(redim_preserve_cmem_buffer,(void*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]),preserved_elements*"</nowiki>|#FFB100}} + bytesperelement$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                    {{Text|<nowiki>'free old array</nowiki>|#919191}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"cmem_dynamic_free((uint8*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]));"</nowiki>|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"tmp_long="</nowiki>|#FFB100}} + elesizestr$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                    f12$ = f12$ + CRLF + n$ + {{Text|<nowiki>"[0]=(ptrszint)cmem_dynamic_malloc(tmp_long*"</nowiki>|#FFB100}} + bytesperelement$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"memcpy((void*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]),redim_preserve_cmem_buffer,preserved_elements*"</nowiki>|#FFB100}} + bytesperelement$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"if (preserved_elements<tmp_long) ZeroMemory(((uint8*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]))+preserved_elements*"</nowiki>|#FFB100}} + bytesperelement$ + {{Text|<nowiki>",(tmp_long*"</nowiki>|#FFB100}} + bytesperelement$ + {{Text|<nowiki>")-(preserved_elements*"</nowiki>|#FFB100}} + bytesperelement$ + {{Text|<nowiki>"));"</nowiki>|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"}else{"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'standard cmem method</nowiki>|#919191}}
                f12$ = f12$ + CRLF + n$ + {{Text|<nowiki>"[0]=(ptrszint)cmem_dynamic_malloc("</nowiki>|#FFB100}} + sizestr$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                {{Text|<nowiki>'clear array</nowiki>|#919191}}
                f12$ = f12$ + CRLF + {{Text|<nowiki>"memset((void*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]),0,"</nowiki>|#FFB100}} + sizestr$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                {{Cl|IF}} redimoption = {{Text|2|#F580B1}} {{Cl|THEN}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                f12$ = f12$ + CRLF + {{Text|<nowiki>"}else{"</nowiki>|#FFB100}} {{Text|<nowiki>'not in cmem</nowiki>|#919191}}
                {{Cl|IF}} redimoption = {{Text|2|#F580B1}} {{Cl|THEN}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"if (preserved_elements){"</nowiki>|#FFB100}}
                    {{Text|<nowiki>'reallocation method</nowiki>|#919191}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"tmp_long="</nowiki>|#FFB100}} + elesizestr$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                    f12$ = f12$ + CRLF + n$ + {{Text|<nowiki>"[0]=(ptrszint)realloc((void*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]),tmp_long*"</nowiki>|#FFB100}} + bytesperelement$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"if (!"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]) error(257);"</nowiki>|#FFB100}} {{Text|<nowiki>'not enough memory</nowiki>|#919191}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"if (preserved_elements<tmp_long) ZeroMemory(((uint8*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]))+preserved_elements*"</nowiki>|#FFB100}} + bytesperelement$ + {{Text|<nowiki>",(tmp_long*"</nowiki>|#FFB100}} + bytesperelement$ + {{Text|<nowiki>")-(preserved_elements*"</nowiki>|#FFB100}} + bytesperelement$ + {{Text|<nowiki>"));"</nowiki>|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"}else{"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'standard allocation method</nowiki>|#919191}}
                f12$ = f12$ + CRLF + n$ + {{Text|<nowiki>"[0]=(ptrszint)calloc("</nowiki>|#FFB100}} + sizestr$ + {{Text|<nowiki>",1);"</nowiki>|#FFB100}}
                f12$ = f12$ + CRLF + {{Text|<nowiki>"if (!"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]) error(257);"</nowiki>|#FFB100}} {{Text|<nowiki>'not enough memory</nowiki>|#919191}}
                {{Cl|IF}} redimoption = {{Text|2|#F580B1}} {{Cl|THEN}}
                    f12$ = f12$ + CRLF + {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                f12$ = f12$ + CRLF + {{Text|<nowiki>"}"</nowiki>|#FFB100}} {{Text|<nowiki>'not in cmem</nowiki>|#919191}}
                f12$ = f12$ + CRLF + n$ + {{Text|<nowiki>"[2]|=1;"</nowiki>|#FFB100}} {{Text|<nowiki>'ADD initialized flag</nowiki>|#919191}}
                {{Text|<nowiki>'2. Generate "clean up" code (called when EXITING A SUB/FUNCTION)</nowiki>|#919191}}
                {{Cl|IF}} arraydesc = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'only add for first declaration of the array</nowiki>|#919191}}
                    {{Text|WriteBufLine|#55FF55}} FreeTxtBuf, {{Text|<nowiki>"if ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[2]&1){"</nowiki>|#FFB100}} {{Text|<nowiki>'initialized?</nowiki>|#919191}}
                    {{Text|WriteBufLine|#55FF55}} FreeTxtBuf, {{Text|<nowiki>"if ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[2]&4){"</nowiki>|#FFB100}} {{Text|<nowiki>'array is in cmem</nowiki>|#919191}}
                    {{Text|WriteBufLine|#55FF55}} FreeTxtBuf, {{Text|<nowiki>"cmem_dynamic_free((uint8*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]));"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} FreeTxtBuf, {{Text|<nowiki>"}else{"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} FreeTxtBuf, {{Text|<nowiki>"free((void*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]));"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} FreeTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}} {{Text|<nowiki>'cmem</nowiki>|#919191}}
                    {{Text|WriteBufLine|#55FF55}} FreeTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}} {{Text|<nowiki>'init</nowiki>|#919191}}
                    {{Text|<nowiki>'free lock (_MEM)</nowiki>|#919191}}
                    {{Text|WriteBufLine|#55FF55}} FreeTxtBuf, {{Text|<nowiki>"free_mem_lock( (mem_lock*)((ptrszint*)"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}({{Text|4|#F580B1}} * nume + {{Text|4|#F580B1}} + {{Text|1|#F580B1}} - {{Text|1|#F580B1}}) + {{Text|<nowiki>"] );"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'not string array</nowiki>|#919191}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'undefined=0</nowiki>|#919191}}
        {{Text|<nowiki>'----FINISH ARRAY DESCRIPTOR IF DEFINING FOR THE FIRST TIME----</nowiki>|#919191}}
        {{Cl|IF}} arraydesc = {{Text|0|#F580B1}} {{Cl|THEN}}
            {{Text|<nowiki>'Note: Array is init as undefined (& possibly a cmem flag)</nowiki>|#919191}}
            {{Cl|IF}} cmem {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"[2]=4;"</nowiki>|#FFB100}} {{Cl|ELSE}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"[2]=0;"</nowiki>|#FFB100}}
            {{Text|<nowiki>'set dimensions as undefined</nowiki>|#919191}}
            {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} nume
                b = i * {{Text|4|#F580B1}}
                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(b) + {{Text|<nowiki>"]=2147483647;"</nowiki>|#FFB100}} {{Text|<nowiki>'base</nowiki>|#919191}}
                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(b + {{Text|1|#F580B1}}) + {{Text|<nowiki>"]=0;"</nowiki>|#FFB100}} {{Text|<nowiki>'num. index</nowiki>|#919191}}
                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(b + {{Text|2|#F580B1}}) + {{Text|<nowiki>"]=0;"</nowiki>|#FFB100}} {{Text|<nowiki>'multiplier</nowiki>|#919191}}
            {{Cl|NEXT}}
            {{Cl|IF}} stringarray {{Cl|THEN}}
                {{Text|<nowiki>'set array's data offset to the offset of the offset to nothingstring</nowiki>|#919191}}
                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"[0]=(ptrszint)&nothingstring;"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                {{Text|<nowiki>'set array's data offset to "nothing"</nowiki>|#919191}}
                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"[0]=(ptrszint)nothingvalue;"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}} {{Text|<nowiki>'close array descriptor</nowiki>|#919191}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'arraydesc = 0</nowiki>|#919191}}
        {{Cl|IF}} undefined = {{Text|0|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} redimoption = {{Text|0|#F580B1}} {{Cl|THEN}} f12$ = f12$ + CRLF + {{Text|<nowiki>"}"</nowiki>|#FFB100}} {{Text|<nowiki>'if REDIM not specified the above is conditional</nowiki>|#919191}}
            f12$ = f12$ + CRLF + {{Text|<nowiki>"}"</nowiki>|#FFB100}} {{Text|<nowiki>'not static</nowiki>|#919191}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'undefined=0</nowiki>|#919191}}
        {{Text|allocarray|#55FF55}} = nume
        {{Cl|IF}} undefined = {{Text|-1|#F580B1}} {{Cl|THEN}} {{Text|allocarray|#55FF55}} = {{Text|-1|#F580B1}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} autoary = {{Text|0|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} dimoption = {{Text|3|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'STATIC a(100) puts creation code in main</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} DataTxtBuf, f12$
        {{Cl|ELSE}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, f12$
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'[8] offset of data</nowiki>|#919191}}
    {{Text|<nowiki>'[8] reserved (could be used to store a bit offset)</nowiki>|#919191}}
    {{Text|<nowiki>'(the following repeats depending on the number of elements)</nowiki>|#919191}}
    {{Text|<nowiki>'[4] base-offset</nowiki>|#919191}}
    {{Text|<nowiki>'[4] number of indexes</nowiki>|#919191}}
    {{Text|<nowiki>'[4] multiplier (the last multiplier doesn't actually exist)</nowiki>|#919191}}
    {{Text|<nowiki>'[4] reserved</nowiki>|#919191}}
    dimshared = dimsharedlast
    tlayout$ = l$
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|arrayreference$|#55FF55}} (indexes$, typ)
    arrayprocessinghappened = {{Text|1|#F580B1}}
    {{Text|<nowiki>'*returns an array reference: idnumber | index$</nowiki>|#919191}}
    {{Text|<nowiki>'*does not take into consideration the type of the array</nowiki>|#919191}}
    {{Text|<nowiki>'*expects array id to be passed in the global id structure</nowiki>|#919191}}
    idnumber$ = {{Text|str2|#55FF55}}(currentid)
    {{Cl|DIM}} id2 {{Cl|AS}} idstruct
    id2 = id
    a$ = indexes$
    typ = id2.arraytype + ISARRAY + ISREFERENCE
    n$ = {{Cl|RTRIM$}}(id2.callname)
    {{Cl|IF}} a$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|<nowiki>'no indexes passed eg. a()</nowiki>|#919191}}
        r$ = {{Text|<nowiki>"0"</nowiki>|#FFB100}}
        {{Cl|GOTO}} gotarrayindex
    {{Cl|END}} {{Cl|IF}}
    n = {{Text|numelements|#55FF55}}(a$)
    {{Text|<nowiki>'find number of elements supplied</nowiki>|#919191}}
    elements = {{Text|1|#F580B1}}
    b = {{Text|0|#F580B1}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} n
        a = {{Cl|ASC (function)|ASC}}({{Text|getelement|#55FF55}}(a$, i))
        {{Cl|IF}} a = {{Text|40|#F580B1}} {{Cl|THEN}} b = b + {{Text|1|#F580B1}}
        {{Cl|IF}} a = {{Text|41|#F580B1}} {{Cl|THEN}} b = b - {{Text|1|#F580B1}}
        {{Cl|IF}} a = {{Text|44|#F580B1}} {{Cl|AND (boolean)|AND}} b = {{Text|0|#F580B1}} {{Cl|THEN}} elements = elements + {{Text|1|#F580B1}}
    {{Cl|NEXT}}
    {{Cl|IF}} id2.arrayelements = {{Text|-1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} arrayelementslist(currentid) <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} elements <> arrayelementslist(currentid) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot change the number of elements an array has!"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} elements = {{Text|1|#F580B1}} {{Cl|THEN}} id2.arrayelements = {{Text|1|#F580B1}}: ids(currentid).arrayelements = {{Text|1|#F580B1}} {{Text|<nowiki>'lucky guess</nowiki>|#919191}}
        arrayelementslist(currentid) = elements
    {{Cl|ELSE}}
        {{Cl|IF}} elements <> id2.arrayelements {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot change the number of elements an array has!"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    curarg = {{Text|1|#F580B1}}
    firsti = {{Text|1|#F580B1}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} n
        l$ = {{Text|getelement|#55FF55}}(a$, i)
        {{Cl|IF}} l$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} b = b + {{Text|1|#F580B1}}
        {{Cl|IF}} l$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} b = b - {{Text|1|#F580B1}}
        {{Cl|IF}} (l$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} b = {{Text|0|#F580B1}}) {{Cl|OR (boolean)|OR}} (i = n) {{Cl|THEN}}
            {{Cl|IF}} i = n {{Cl|THEN}}
                {{Cl|IF}} l$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Array index missing"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                e$ = {{Text|evaluatetotyp|#55FF55}}({{Text|getelements$|#55FF55}}(a$, firsti, i), {{Text|64&|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|ELSE}}
                e$ = {{Text|evaluatetotyp|#55FF55}}({{Text|getelements$|#55FF55}}(a$, firsti, i - {{Text|1|#F580B1}}), {{Text|64&|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} e$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Array index missing"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            argi = (elements - curarg) * {{Text|4|#F580B1}} + {{Text|4|#F580B1}}
            {{Cl|IF}} curarg = {{Text|1|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} NoChecks = {{Text|0|#F580B1}} {{Cl|THEN}}
                    r$ = r$ + {{Text|<nowiki>"array_check(("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")-"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(argi) + {{Text|<nowiki>"],"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(argi + {{Text|1|#F580B1}}) + {{Text|<nowiki>"])+"</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    r$ = r$ + {{Text|<nowiki>"("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")-"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(argi) + {{Text|<nowiki>"]+"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|ELSE}}
                {{Cl|IF}} NoChecks = {{Text|0|#F580B1}} {{Cl|THEN}}
                    r$ = r$ + {{Text|<nowiki>"array_check(("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")-"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(argi) + {{Text|<nowiki>"],"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(argi + {{Text|1|#F580B1}}) + {{Text|<nowiki>"])*"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(argi + {{Text|2|#F580B1}}) + {{Text|<nowiki>"]+"</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    r$ = r$ + {{Text|<nowiki>"(("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")-"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(argi) + {{Text|<nowiki>"])*"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(argi + {{Text|2|#F580B1}}) + {{Text|<nowiki>"]+"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            firsti = i + {{Text|1|#F580B1}}
            curarg = curarg + {{Text|1|#F580B1}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|NEXT}}
    r$ = {{Cl|LEFT$}}(r$, {{Cl|LEN}}(r$) - {{Text|1|#F580B1}}) {{Text|<nowiki>'remove trailing +</nowiki>|#919191}}
    gotarrayindex:
    r$ = idnumber$ + sp3 + r$
    {{Text|arrayreference$|#55FF55}} = r$
    {{Text|<nowiki>'PRINT "arrayreference returning:" + r$</nowiki>|#919191}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|SUB}} {{Text|assign|#55FF55}} (a$, n)
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} n
        c = {{Cl|ASC (function)|ASC}}({{Text|getelement$|#55FF55}}(a$, i))
        {{Cl|IF}} c = {{Text|40|#F580B1}} {{Cl|THEN}} b = b + {{Text|1|#F580B1}} {{Text|<nowiki>'(</nowiki>|#919191}}
        {{Cl|IF}} c = {{Text|41|#F580B1}} {{Cl|THEN}} b = b - {{Text|1|#F580B1}} {{Text|<nowiki>')</nowiki>|#919191}}
        {{Cl|IF}} c = {{Text|61|#F580B1}} {{Cl|AND (boolean)|AND}} b = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'=</nowiki>|#919191}}
            {{Cl|IF}} i = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected ... ="</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
            {{Cl|IF}} i = n {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected = ..."</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
            a2$ = {{Text|fixoperationorder|#55FF55}}({{Text|getelements$|#55FF55}}(a$, {{Text|1|#F580B1}}, i - {{Text|1|#F580B1}}))
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
            l$ = tlayout$ + sp + {{Text|<nowiki>"="</nowiki>|#FFB100}} + sp
            {{Text|<nowiki>'note: evaluating a2$ will fail if it is setting a function's return value without this check (as the function, not the return-variable) will be found by evaluate)</nowiki>|#919191}}
            {{Cl|IF}} i = {{Text|2|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'lhs has only 1 element</nowiki>|#919191}}
                try = {{Text|findid|#55FF55}}(a2$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                {{Cl|DO}} {{Cl|WHILE}} try
                    {{Cl|IF}} id.t {{Cl|THEN}}
                        {{Cl|IF}} subfuncn = id.insubfuncn {{Cl|THEN}} {{Text|<nowiki>'avoid global before local</nowiki>|#919191}}
                            {{Cl|IF}} (id.t {{Cl|AND (boolean)|AND}} ISUDT) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                {{Text|makeidrefer|#55FF55}} a2$, typ
                                {{Cl|GOTO}} assignsimplevariable
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(a2$) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                {{Cl|LOOP}}
            {{Cl|END}} {{Cl|IF}}
            a2$ = {{Text|evaluate$|#55FF55}}(a2$, typ): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
            assignsimplevariable:
            {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISREFERENCE) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected variable ="</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
            {{Text|setrefer|#55FF55}} a2$, typ, {{Text|getelements$|#55FF55}}(a$, i + {{Text|1|#F580B1}}, n), {{Text|0|#F580B1}}
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
            tlayout$ = l$ + tlayout$
            {{Cl|EXIT}} {{Cl|SUB}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'=,b=0</nowiki>|#919191}}
    {{Cl|NEXT}}
    {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected ="</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
{{Cl|END}} {{Cl|SUB}}
{{Cl|SUB}} {{Text|clearid|#55FF55}}
    id = cleariddata
{{Cl|END}} {{Cl|SUB}}
{{Cl|SUB}} {{Text|vWatchVariable|#55FF55}} (this$, action {{Cl|AS}} {{Cl|_BYTE}})
    {{Cl|STATIC}} totalLocalVariables {{Cl|AS}} {{Cl|LONG}}, localVariablesList$
    {{Cl|STATIC}} totalMainModuleVariables {{Cl|AS}} {{Cl|LONG}}, mainModuleVariablesList$
    {{Cl|SELECT}} {{Cl|CASE}} action
        {{Cl|CASE}} {{Text|-1|#F580B1}} {{Text|<nowiki>'reset</nowiki>|#919191}}
            totalLocalVariables = {{Text|0|#F580B1}}
            localVariablesList$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            totalMainModuleVariables = {{Text|0|#F580B1}}
            mainModuleVariablesList$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Cl|CASE}} {{Text|0|#F580B1}} {{Text|<nowiki>'add</nowiki>|#919191}}
            {{Cl|IF}} {{Cl|INSTR}}(vWatchVariableExclusions$, {{Text|<nowiki>"@"</nowiki>|#FFB100}} + this$ + {{Text|<nowiki>"@"</nowiki>|#FFB100}}) > {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} {{Cl|LEFT$}}(this$, {{Text|12|#F580B1}}) = {{Text|<nowiki>"_SUB_VWATCH_"</nowiki>|#FFB100}} {{Cl|THEN}}
                {{Cl|EXIT}} {{Cl|SUB}}
            {{Cl|END}} {{Cl|IF}}
            vWatchNewVariable$ = this$
            {{Cl|IF}} subfunc = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
                totalMainModuleVariables = totalMainModuleVariables + {{Text|1|#F580B1}}
                mainModuleVariablesList$ = mainModuleVariablesList$ + {{Text|<nowiki>"vwatch_global_vars["</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(totalMainModuleVariables - {{Text|1|#F580B1}}) + {{Text|<nowiki>"] = &"</nowiki>|#FFB100}} + this$ + {{Text|<nowiki>";"</nowiki>|#FFB100}} + CRLF
                {{Text|manageVariableList|#55FF55}} id.cn, this$, totalMainModuleVariables - {{Text|1|#F580B1}}, {{Text|0|#F580B1}}
            {{Cl|ELSE}}
                totalLocalVariables = totalLocalVariables + {{Text|1|#F580B1}}
                localVariablesList$ = localVariablesList$ + {{Text|<nowiki>"vwatch_local_vars["</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(totalLocalVariables - {{Text|1|#F580B1}}) + {{Text|<nowiki>"] = &"</nowiki>|#FFB100}} + this$ + {{Text|<nowiki>";"</nowiki>|#FFB100}} + CRLF
                {{Text|manageVariableList|#55FF55}} id.cn, this$, totalLocalVariables - {{Text|1|#F580B1}}, {{Text|0|#F580B1}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|CASE}} {{Text|1|#F580B1}} {{Text|<nowiki>'dump to data[].txt & reset</nowiki>|#919191}}
            {{Cl|IF}} subfunc = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
                {{Cl|IF}} totalMainModuleVariables > {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"void *vwatch_local_vars[0];"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} GlobTxtBuf, {{Text|<nowiki>"void *vwatch_global_vars["</nowiki>|#FFB100}} + {{Cl|STR$}}(totalMainModuleVariables) + {{Text|<nowiki>"];"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} DataTxtBuf, mainModuleVariablesList$
                {{Cl|ELSE}}
                    {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"void *vwatch_local_vars[0];"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} GlobTxtBuf, {{Text|<nowiki>"void *vwatch_global_vars[0];"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                mainModuleVariablesList$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                totalMainModuleVariables = {{Text|0|#F580B1}}
            {{Cl|ELSE}}
                {{Cl|IF}} subfunc <> {{Text|<nowiki>"SUB_VWATCH"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} totalLocalVariables > {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"void *vwatch_local_vars["</nowiki>|#FFB100}} + {{Cl|STR$}}(totalLocalVariables) + {{Text|<nowiki>"];"</nowiki>|#FFB100}}
                        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, localVariablesList$
                    {{Cl|ELSE}}
                        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"void *vwatch_local_vars[0];"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|ELSE}}
                    {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"void *vwatch_local_vars[0];"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                localVariablesList$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                totalLocalVariables = {{Text|0|#F580B1}}
            {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|SELECT}}
{{Cl|END}} {{Cl|SUB}}
{{Cl|SUB}} {{Text|vWatchAddLabel|#55FF55}} (this {{Cl|AS}} {{Cl|LONG}}, lastLine {{Cl|AS}} {{Cl|_BYTE}})
    {{Cl|STATIC}} prevLabel {{Cl|AS}} {{Cl|LONG}}, prevSkip {{Cl|AS}} {{Cl|LONG}}
    {{Cl|IF}} lastLine = {{Text|0|#F580B1}} {{Cl|THEN}}
        {{Cl|WHILE}} this > {{Cl|LEN}}(vWatchUsedLabels)
            vWatchUsedLabels = vWatchUsedLabels + {{Cl|SPACE$}}({{Text|1000|#F580B1}})
            vWatchUsedSkipLabels = vWatchUsedSkipLabels + {{Cl|SPACE$}}({{Text|1000|#F580B1}})
        {{Cl|WEND}}
        {{Cl|IF}} firstLineNumberLabelvWatch = {{Text|0|#F580B1}} {{Cl|THEN}}
            firstLineNumberLabelvWatch = this
        {{Cl|ELSE}}
            {{Cl|IF}} prevSkip <> prevLabel {{Cl|THEN}}
                {{Cl|ASC}}(vWatchUsedSkipLabels, prevLabel) = {{Text|1|#F580B1}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"VWATCH_SKIPLABEL_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(prevLabel) + {{Text|<nowiki>":;"</nowiki>|#FFB100}}
                prevSkip = prevLabel
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} prevLabel <> this {{Cl|THEN}}
            {{Cl|ASC}}(vWatchUsedLabels, this) = {{Text|1|#F580B1}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"VWATCH_LABEL_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(this) + {{Text|<nowiki>":;"</nowiki>|#FFB100}}
            prevLabel = this
            lastLineNumberLabelvWatch = this
        {{Cl|END}} {{Cl|IF}}
    {{Cl|ELSE}}
        {{Cl|IF}} prevSkip <> prevLabel {{Cl|THEN}}
            {{Cl|ASC}}(vWatchUsedSkipLabels, prevLabel) = {{Text|1|#F580B1}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"VWATCH_SKIPLABEL_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(prevLabel) + {{Text|<nowiki>":;"</nowiki>|#FFB100}}
            prevSkip = prevLabel
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
{{Cl|END}} {{Cl|SUB}}
{{Cl|SUB}} {{Text|closemain|#55FF55}}
    {{Text|xend|#55FF55}}
    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"return;"</nowiki>|#FFB100}}
    {{Cl|IF}} vWatchOn {{Cl|AND (boolean)|AND}} firstLineNumberLabelvWatch > {{Text|0|#F580B1}} {{Cl|THEN}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"VWATCH_SETNEXTLINE:;"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"switch (*__LONG_VWATCH_GOTO) {"</nowiki>|#FFB100}}
        {{Cl|FOR}} i = firstLineNumberLabelvWatch {{Cl|TO}} lastLineNumberLabelvWatch
            {{Cl|IF}} {{Cl|ASC (function)|ASC}}(vWatchUsedLabels, i) = {{Text|1|#F580B1}} {{Cl|THEN}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"    case "</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(i) + {{Text|<nowiki>":"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"        goto VWATCH_LABEL_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(i) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"        break;"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|NEXT}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"    default:"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"        *__LONG_VWATCH_GOTO=*__LONG_VWATCH_LINENUMBER;"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"        goto VWATCH_SETNEXTLINE;"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"VWATCH_SKIPLINE:;"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"switch (*__LONG_VWATCH_GOTO) {"</nowiki>|#FFB100}}
        {{Cl|FOR}} i = firstLineNumberLabelvWatch {{Cl|TO}} lastLineNumberLabelvWatch
            {{Cl|IF}} {{Cl|ASC (function)|ASC}}(vWatchUsedSkipLabels, i) = {{Text|1|#F580B1}} {{Cl|THEN}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"    case -"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(i) + {{Text|<nowiki>":"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"        goto VWATCH_SKIPLABEL_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(i) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"        break;"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|NEXT}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} RetTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}} {{Text|<nowiki>'end case</nowiki>|#919191}}
    {{Text|WriteBufLine|#55FF55}} RetTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} RetTxtBuf, {{Text|<nowiki>"error(3);"</nowiki>|#FFB100}} {{Text|<nowiki>'no valid return possible</nowiki>|#919191}}
    closedmain = {{Text|1|#F580B1}}
    firstLineNumberLabelvWatch = {{Text|0|#F580B1}}
{{Cl|END}} {{Cl|SUB}}
{{Cl|FUNCTION}} {{Text|countelements|#55FF55}} (a$)
    n = {{Text|numelements|#55FF55}}(a$)
    c = {{Text|1|#F580B1}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} n
        e$ = {{Text|getelement$|#55FF55}}(a$, i)
        {{Cl|IF}} e$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} b = b + {{Text|1|#F580B1}}
        {{Cl|IF}} e$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} b = b - {{Text|1|#F580B1}}
        {{Cl|IF}} b < {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Unexpected ) encountered"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} e$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} b = {{Text|0|#F580B1}} {{Cl|THEN}} c = c + {{Text|1|#F580B1}}
    {{Cl|NEXT}}
    {{Text|countelements|#55FF55}} = c
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|dim2|#55FF55}} (varname$, typ2$, method, elements$)
    {{Text|<nowiki>'notes: (DO NOT REMOVE THESE IMPORTANT USAGE NOTES)</nowiki>|#919191}}
    {{Text|<nowiki>'</nowiki>|#919191}}
    {{Text|<nowiki>'(shared)dimsfarray: Creates an ID only (no C++ code)</nowiki>|#919191}}
    {{Text|<nowiki>'                    Adds an index/'link' to the sub/function's argument</nowiki>|#919191}}
    {{Text|<nowiki>'                        ID.sfid=glinkid</nowiki>|#919191}}
    {{Text|<nowiki>'                        ID.sfarg=glinkarg</nowiki>|#919191}}
    {{Text|<nowiki>'                    Sets arrayelements=-1 'unknown' (if elements$="?") otherwise val(elements$)</nowiki>|#919191}}
    {{Text|<nowiki>'                    ***Does not refer to arrayelementslist()***</nowiki>|#919191}}
    {{Text|<nowiki>'</nowiki>|#919191}}
    {{Text|<nowiki>'(argument)method: 0 being created by a DIM name AS type</nowiki>|#919191}}
    {{Text|<nowiki>'                  1 being created by a DIM name+symbol</nowiki>|#919191}}
    {{Text|<nowiki>'                  or automatically without the use of DIM</nowiki>|#919191}}
    {{Text|<nowiki>'</nowiki>|#919191}}
    {{Text|<nowiki>'elements$="?": (see also dimsfarray for that special case)</nowiki>|#919191}}
    {{Text|<nowiki>'              Checks arrayelementslist() and;</nowiki>|#919191}}
    {{Text|<nowiki>'              if unknown(=0), creates an ID only</nowiki>|#919191}}
    {{Text|<nowiki>'              if known, creates a DYNAMIC array's C++ initialization code so it can be used later</nowiki>|#919191}}
    typ$ = typ2$
    {{Text|dim2|#55FF55}} = {{Text|1|#F580B1}} {{Text|<nowiki>'success</nowiki>|#919191}}
    {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"dim2 called"</nowiki>|#FFB100}}, method
    cvarname$ = varname$
    l$ = cvarname$
    varname$ = {{Cl|UCASE$}}(varname$)
    {{Cl|IF}} dimsfarray = {{Text|1|#F580B1}} {{Cl|THEN}} f = {{Text|0|#F580B1}} {{Cl|ELSE}} f = {{Text|1|#F580B1}}
    {{Cl|IF}} dimstatic <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} dimshared = {{Text|0|#F580B1}} {{Cl|THEN}}
        {{Text|<nowiki>'name will have include the sub/func name in its scope</nowiki>|#919191}}
        {{Text|<nowiki>'variable/array will be created in main on startup</nowiki>|#919191}}
        defdatahandle = GlobTxtBuf
        DataTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"A"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"maindata.txt"</nowiki>|#FFB100}})
        FreeTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"A"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"mainfree.txt"</nowiki>|#FFB100}})
    {{Cl|END}} {{Cl|IF}}
    scope2$ = module$ + {{Text|<nowiki>"_"</nowiki>|#FFB100}} + subfunc$ + {{Text|<nowiki>"_"</nowiki>|#FFB100}}
    {{Text|<nowiki>'Note: when REDIMing a SHARED array in dynamic memory scope2$ must be modified</nowiki>|#919191}}
    {{Cl|IF}} {{Cl|LEN}}(typ$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"DIM2: No type specified!"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Text|<nowiki>'UDT</nowiki>|#919191}}
    {{Text|<nowiki>'is it a udt?</nowiki>|#919191}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} lasttype
        {{Cl|IF}} typ$ = {{Cl|RTRIM$}}(udtxname(i)) {{Cl|OR (boolean)|OR}} (typ$ = {{Text|<nowiki>"MEM"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} {{Cl|RTRIM$}}(udtxname(i)) = {{Text|<nowiki>"_MEM"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}}
            dim2typepassback$ = {{Cl|RTRIM$}}(udtxcname(i))
            {{Cl|IF}} typ$ = {{Text|<nowiki>"MEM"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} {{Cl|RTRIM$}}(udtxname(i)) = {{Text|<nowiki>"_MEM"</nowiki>|#FFB100}} {{Cl|THEN}}
                dim2typepassback$ = {{Cl|MID$ (function)|MID$}}({{Cl|RTRIM$}}(udtxcname(i)), {{Text|2|#F580B1}})
            {{Cl|END}} {{Cl|IF}}
            n$ = {{Text|<nowiki>"UDT_"</nowiki>|#FFB100}} + varname$
            {{Text|<nowiki>'array of UDTs</nowiki>|#919191}}
            {{Cl|IF}} elements$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
                arraydesc = {{Text|0|#F580B1}}
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}}
                    try = {{Text|findid|#55FF55}}(varname$)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|DO}} {{Cl|WHILE}} try
                        {{Cl|IF}} (id.arraytype) {{Cl|THEN}}
                            l$ = {{Cl|RTRIM$}}(id.cn)
                            arraydesc = currentid: scope2$ = {{Text|scope$|#55FF55}}
                            {{Cl|EXIT}} {{Cl|DO}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(varname$) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|LOOP}}
                {{Cl|END}} {{Cl|IF}}
                n$ = scope2$ + {{Text|<nowiki>"ARRAY_"</nowiki>|#FFB100}} + n$
                bits = udtxsize(i)
                {{Cl|IF}} udtxbytealign(i) {{Cl|THEN}}
                    {{Cl|IF}} bits {{Cl|MOD}} {{Text|8|#F580B1}} {{Cl|THEN}} bits = bits + {{Text|8|#F580B1}} - (bits {{Cl|MOD}} {{Text|8|#F580B1}})
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} {{Cl|LEN}}(elements$) = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|ASC (function)|ASC}}(elements$) = {{Text|63|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'"?"</nowiki>|#919191}}
                        E = arrayelementslist(idn + {{Text|1|#F580B1}}): {{Cl|IF}} E {{Cl|THEN}} elements$ = elements$ + {{Text|str2$|#55FF55}}(E) {{Text|<nowiki>'eg. "?3" for a 3 dimensional array</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}}
                    nume = {{Text|allocarray|#55FF55}}(n$, elements$, -bits, i)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    l$ = l$ + sp + tlayout$
                    {{Cl|IF}} arraydesc {{Cl|THEN}} {{Cl|GOTO}} dim2exitfunc
                    {{Text|clearid|#55FF55}}
                {{Cl|ELSE}}
                    {{Text|clearid|#55FF55}}
                    {{Cl|IF}} elements$ = {{Text|<nowiki>"?"</nowiki>|#FFB100}} {{Cl|THEN}}
                        nume = {{Text|-1|#F580B1}}
                        id.linkid = glinkid
                        id.linkarg = glinkarg
                    {{Cl|ELSE}}
                        nume = {{Cl|VAL}}(elements$)
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                id.arraytype = UDTTYPE + i
                {{Cl|IF}} cmemlist(idn + {{Text|1|#F580B1}}) {{Cl|THEN}} id.arraytype = id.arraytype + ISINCONVENTIONALMEMORY
                id.n = cvarname$
                {{Cl|IF}} nume > {{Text|65536|#F580B1}} {{Cl|THEN}} nume = nume - {{Text|65536|#F580B1}}: id.staticarray = {{Text|1|#F580B1}}
                id.arrayelements = nume
                id.callname = n$
                {{Text|regid|#55FF55}}
                {{Text|vWatchVariable|#55FF55}} n$, {{Text|0|#F580B1}}
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|GOTO}} dim2exitfunc
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'not an array of UDTs</nowiki>|#919191}}
            bits = udtxsize(i): bytes = bits \ {{Text|8|#F580B1}}
            {{Cl|IF}} bits {{Cl|MOD}} {{Text|8|#F580B1}} {{Cl|THEN}}
                bytes = bytes + {{Text|1|#F580B1}}
            {{Cl|END}} {{Cl|IF}}
            n$ = scope2$ + n$
            {{Cl|IF}} f {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} defdatahandle, {{Text|<nowiki>"void *"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"=NULL;"</nowiki>|#FFB100}}
            {{Text|clearid|#55FF55}}
            id.n = cvarname$
            id.t = UDTTYPE + i
            {{Cl|IF}} cmemlist(idn + {{Text|1|#F580B1}}) {{Cl|THEN}}
                id.t = id.t + ISINCONVENTIONALMEMORY
                {{Cl|IF}} f {{Cl|THEN}}
                    {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"==NULL){"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"cmem_sp-="</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bytes) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if (cmem_sp<qbs_cmem_sp) error(257);"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"=(void*)(dblock+cmem_sp);"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"memset("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>",0,"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bytes) + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|ELSE}}
                {{Cl|IF}} f {{Cl|THEN}}
                    {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"==NULL){"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"=(void*)mem_static_malloc("</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(bytes) + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"memset("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>",0,"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bytes) + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                    {{Cl|IF}} udtxvariable(i) {{Cl|THEN}}
                        {{Text|initialise_udt_varstrings|#55FF55}} n$, i, DataTxtBuf, {{Text|0|#F580B1}}
                        {{Text|free_udt_varstrings|#55FF55}} n$, i, FreeTxtBuf, {{Text|0|#F580B1}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            id.callname = n$
            {{Text|regid|#55FF55}}
            {{Text|vWatchVariable|#55FF55}} n$, {{Text|0|#F580B1}}
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|GOTO}} dim2exitfunc
        {{Cl|END}} {{Cl|IF}}
    {{Cl|NEXT}} i
    {{Text|<nowiki>'it isn't a udt</nowiki>|#919191}}
    typ$ = {{Text|symbol2fulltypename$|#55FF55}}(typ$)
    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Text|<nowiki>'check if _UNSIGNED was specified</nowiki>|#919191}}
    unsgn = {{Text|0|#F580B1}}
    {{Cl|IF}} {{Cl|LEFT$}}(typ$, {{Text|10|#F580B1}}) = {{Text|<nowiki>"_UNSIGNED "</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} ({{Cl|LEFT$}}(typ$, {{Text|9|#F580B1}}) = {{Text|<nowiki>"UNSIGNED "</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}}
        unsgn = {{Text|1|#F580B1}}
        typ$ = {{Cl|MID$ (function)|MID$}}(typ$, {{Cl|INSTR}}(typ$, {{Cl|CHR$}}({{Text|32|#F580B1}})) + {{Text|1|#F580B1}})
        {{Cl|IF}} {{Cl|LEN}}(typ$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected more type information after "</nowiki>|#FFB100}} + qb64prefix$ + {{Text|<nowiki>"UNSIGNED!"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    n$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Text|<nowiki>'n$ is assumed to be "" after branching into the code for each type</nowiki>|#919191}}
    {{Cl|IF}} {{Cl|LEFT$}}(typ$, {{Text|6|#F580B1}}) = {{Text|<nowiki>"STRING"</nowiki>|#FFB100}} {{Cl|THEN}}
        {{Cl|IF}} {{Cl|LEN}}(typ$) > {{Text|6|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} {{Cl|LEFT$}}(typ$, {{Text|9|#F580B1}}) <> {{Text|<nowiki>"STRING * "</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected STRING * number/constant"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            c$ = {{Cl|RIGHT$}}(typ$, {{Cl|LEN}}(typ$) - {{Text|9|#F580B1}})
            {{Text|<nowiki>'constant check 2011</nowiki>|#919191}}
            hashfound = {{Text|0|#F580B1}}
            hashname$ = c$
            hashchkflags = HASHFLAG_CONSTANT
            hashres = {{Text|HashFindRev|#55FF55}}(hashname$, hashchkflags, hashresflags, hashresref)
            {{Cl|DO}} {{Cl|WHILE}} hashres
                {{Cl|IF}} constsubfunc(hashresref) = subfuncn {{Cl|OR (boolean)|OR}} constsubfunc(hashresref) = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} constdefined(hashresref) {{Cl|THEN}}
                        hashfound = {{Text|1|#F580B1}}
                        {{Cl|EXIT}} {{Cl|DO}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} hashres <> {{Text|1|#F580B1}} {{Cl|THEN}} hashres = {{Text|HashFindCont|#55FF55}}(hashresflags, hashresref) {{Cl|ELSE}} hashres = {{Text|0|#F580B1}}
            {{Cl|LOOP}}
            {{Cl|IF}} hashfound {{Cl|THEN}}
                i2 = hashresref
                t = consttype(i2)
                {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected STRING * numeric-constant"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Text|<nowiki>'convert value to general formats</nowiki>|#919191}}
                {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISFLOAT {{Cl|THEN}}
                    v## = constfloat(i2)
                    v&& = v##
                    v~&& = v&&
                {{Cl|ELSE}}
                    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISUNSIGNED {{Cl|THEN}}
                        v~&& = constuinteger(i2)
                        v&& = v~&&
                        v## = v&&
                    {{Cl|ELSE}}
                        v&& = constinteger(i2)
                        v## = v&&
                        v~&& = v&&
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} v&& < {{Text|1|#F580B1}} {{Cl|OR (boolean)|OR}} v&& > {{Text|9999999999|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"STRING * out-of-range constant"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                bytes = v&&
                dim2typepassback$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"String * "</nowiki>|#FFB100}}) + constcname(i2)
                {{Cl|GOTO}} constantlenstr
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} {{Text|isuinteger|#55FF55}}(c$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Number/Constant expected after *"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|IF}} {{Cl|LEN}}(c$) > {{Text|10|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Too many characters in number after *"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            bytes = {{Cl|VAL}}(c$)
            {{Cl|IF}} bytes = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot create a fixed string of length 0"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            constantlenstr:
            n$ = {{Text|<nowiki>"STRING"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bytes) + {{Text|<nowiki>"_"</nowiki>|#FFB100}} + varname$
            {{Text|<nowiki>'array of fixed length strings</nowiki>|#919191}}
            {{Cl|IF}} elements$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
                arraydesc = {{Text|0|#F580B1}}
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}}
                    try = {{Text|findid|#55FF55}}(varname$ + {{Text|<nowiki>"$"</nowiki>|#FFB100}})
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|DO}} {{Cl|WHILE}} try
                        {{Cl|IF}} (id.arraytype) {{Cl|THEN}}
                            l$ = {{Cl|RTRIM$}}(id.cn)
                            arraydesc = currentid: scope2$ = {{Text|scope$|#55FF55}}
                            {{Cl|EXIT}} {{Cl|DO}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(varname$ + {{Text|<nowiki>"$"</nowiki>|#FFB100}}) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|LOOP}}
                {{Cl|END}} {{Cl|IF}}
                n$ = scope2$ + {{Text|<nowiki>"ARRAY_"</nowiki>|#FFB100}} + n$
                {{Text|<nowiki>'nume = allocarray(n$, elements$, bytes)</nowiki>|#919191}}
                {{Text|<nowiki>'IF arraydesc THEN goto dim2exitfunc 'id already exists!</nowiki>|#919191}}
                {{Text|<nowiki>'clearid</nowiki>|#919191}}
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} {{Cl|LEN}}(elements$) = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|ASC (function)|ASC}}(elements$) = {{Text|63|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'"?"</nowiki>|#919191}}
                        E = arrayelementslist(idn + {{Text|1|#F580B1}}): {{Cl|IF}} E {{Cl|THEN}} elements$ = elements$ + {{Text|str2$|#55FF55}}(E) {{Text|<nowiki>'eg. "?3" for a 3 dimensional array</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}}
                    nume = {{Text|allocarray|#55FF55}}(n$, elements$, bytes, {{Text|0|#F580B1}})
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    l$ = l$ + sp + tlayout$
                    {{Cl|IF}} arraydesc {{Cl|THEN}} {{Cl|GOTO}} dim2exitfunc
                    {{Text|clearid|#55FF55}}
                {{Cl|ELSE}}
                    {{Text|clearid|#55FF55}}
                    {{Cl|IF}} elements$ = {{Text|<nowiki>"?"</nowiki>|#FFB100}} {{Cl|THEN}}
                        nume = {{Text|-1|#F580B1}}
                        id.linkid = glinkid
                        id.linkarg = glinkarg
                    {{Cl|ELSE}}
                        nume = {{Cl|VAL}}(elements$)
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                id.arraytype = STRINGTYPE + ISFIXEDLENGTH
                {{Cl|IF}} cmemlist(idn + {{Text|1|#F580B1}}) {{Cl|THEN}} id.arraytype = id.arraytype + ISINCONVENTIONALMEMORY
                id.n = cvarname$
                {{Cl|IF}} nume > {{Text|65536|#F580B1}} {{Cl|THEN}} nume = nume - {{Text|65536|#F580B1}}: id.staticarray = {{Text|1|#F580B1}}
                id.arrayelements = nume
                id.callname = n$
                id.tsize = bytes
                {{Cl|IF}} method = {{Text|0|#F580B1}} {{Cl|THEN}}
                    id.mayhave = {{Text|<nowiki>"$"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bytes)
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} method = {{Text|1|#F580B1}} {{Cl|THEN}}
                    id.musthave = {{Text|<nowiki>"$"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bytes)
                {{Cl|END}} {{Cl|IF}}
                {{Text|regid|#55FF55}}
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Text|vWatchVariable|#55FF55}} n$, {{Text|0|#F580B1}}
                {{Cl|GOTO}} dim2exitfunc
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'standard fixed length string</nowiki>|#919191}}
            n$ = scope2$ + n$
            {{Cl|IF}} f {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} defdatahandle, {{Text|<nowiki>"qbs *"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"=NULL;"</nowiki>|#FFB100}}
            {{Cl|IF}} f {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} FreeTxtBuf, {{Text|<nowiki>"qbs_free("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>");"</nowiki>|#FFB100}} {{Text|<nowiki>'so descriptor can be freed</nowiki>|#919191}}
            {{Text|clearid|#55FF55}}
            id.n = cvarname$
            id.t = STRINGTYPE + ISFIXEDLENGTH
            {{Cl|IF}} cmemlist(idn + {{Text|1|#F580B1}}) {{Cl|THEN}}
                id.t = id.t + ISINCONVENTIONALMEMORY
                {{Cl|IF}} f {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"==NULL){"</nowiki>|#FFB100}}
                {{Cl|IF}} f {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"cmem_sp-="</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bytes) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Cl|IF}} f {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if (cmem_sp<qbs_cmem_sp) error(257);"</nowiki>|#FFB100}}
                {{Cl|IF}} f {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"=qbs_new_fixed((uint8*)(dblock+cmem_sp),"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bytes) + {{Text|<nowiki>",0);"</nowiki>|#FFB100}}
                {{Cl|IF}} f {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"memset("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"->chr,0,"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bytes) + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                {{Cl|IF}} f {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                {{Cl|IF}} f {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"==NULL){"</nowiki>|#FFB100}}
                o$ = {{Text|<nowiki>"(uint8*)mem_static_malloc("</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(bytes) + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                {{Cl|IF}} f {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"=qbs_new_fixed("</nowiki>|#FFB100}} + o$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(bytes) + {{Text|<nowiki>",0);"</nowiki>|#FFB100}}
                {{Cl|IF}} f {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"memset("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"->chr,0,"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(bytes) + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                {{Cl|IF}} f {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            id.tsize = bytes
            {{Cl|IF}} method = {{Text|0|#F580B1}} {{Cl|THEN}}
                id.mayhave = {{Text|<nowiki>"$"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bytes)
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} method = {{Text|1|#F580B1}} {{Cl|THEN}}
                id.musthave = {{Text|<nowiki>"$"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bytes)
            {{Cl|END}} {{Cl|IF}}
            id.callname = n$
            {{Text|regid|#55FF55}}
            {{Text|vWatchVariable|#55FF55}} n$, {{Text|0|#F580B1}}
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|GOTO}} dim2exitfunc
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'variable length string processing</nowiki>|#919191}}
        n$ = {{Text|<nowiki>"STRING_"</nowiki>|#FFB100}} + varname$
        {{Text|<nowiki>'array of variable length strings</nowiki>|#919191}}
        {{Cl|IF}} elements$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
            arraydesc = {{Text|0|#F580B1}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}}
                try = {{Text|findid|#55FF55}}(varname$ + {{Text|<nowiki>"$"</nowiki>|#FFB100}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|DO}} {{Cl|WHILE}} try
                    {{Cl|IF}} (id.arraytype) {{Cl|THEN}}
                        l$ = {{Cl|RTRIM$}}(id.cn)
                        arraydesc = currentid: scope2$ = {{Text|scope$|#55FF55}}
                        {{Cl|EXIT}} {{Cl|DO}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(varname$ + {{Text|<nowiki>"$"</nowiki>|#FFB100}}) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|LOOP}}
            {{Cl|END}} {{Cl|IF}}
            n$ = scope2$ + {{Text|<nowiki>"ARRAY_"</nowiki>|#FFB100}} + n$
            {{Text|<nowiki>'nume = allocarray(n$, elements$, -2147483647) '-2147483647=STRING</nowiki>|#919191}}
            {{Text|<nowiki>'IF arraydesc THEN goto dim2exitfunc 'id already exists!</nowiki>|#919191}}
            {{Text|<nowiki>'clearid</nowiki>|#919191}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} {{Cl|LEN}}(elements$) = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|ASC (function)|ASC}}(elements$) = {{Text|63|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'"?"</nowiki>|#919191}}
                    E = arrayelementslist(idn + {{Text|1|#F580B1}}): {{Cl|IF}} E {{Cl|THEN}} elements$ = elements$ + {{Text|str2$|#55FF55}}(E) {{Text|<nowiki>'eg. "?3" for a 3 dimensional array</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}}
                nume = {{Text|allocarray|#55FF55}}(n$, elements$, {{Text|-2147483647|#F580B1}}, {{Text|0|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                l$ = l$ + sp + tlayout$
                {{Cl|IF}} arraydesc {{Cl|THEN}} {{Cl|GOTO}} dim2exitfunc
                {{Text|clearid|#55FF55}}
            {{Cl|ELSE}}
                {{Text|clearid|#55FF55}}
                {{Cl|IF}} elements$ = {{Text|<nowiki>"?"</nowiki>|#FFB100}} {{Cl|THEN}}
                    nume = {{Text|-1|#F580B1}}
                    id.linkid = glinkid
                    id.linkarg = glinkarg
                {{Cl|ELSE}}
                    nume = {{Cl|VAL}}(elements$)
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            id.n = cvarname$
            id.arraytype = STRINGTYPE
            {{Cl|IF}} cmemlist(idn + {{Text|1|#F580B1}}) {{Cl|THEN}} id.arraytype = id.arraytype + ISINCONVENTIONALMEMORY
            {{Cl|IF}} nume > {{Text|65536|#F580B1}} {{Cl|THEN}} nume = nume - {{Text|65536|#F580B1}}: id.staticarray = {{Text|1|#F580B1}}
            id.arrayelements = nume
            id.callname = n$
            {{Cl|IF}} method = {{Text|0|#F580B1}} {{Cl|THEN}}
                id.mayhave = {{Text|<nowiki>"$"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} method = {{Text|1|#F580B1}} {{Cl|THEN}}
                id.musthave = {{Text|<nowiki>"$"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|regid|#55FF55}}
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Text|vWatchVariable|#55FF55}} n$, {{Text|0|#F580B1}}
            {{Cl|GOTO}} dim2exitfunc
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'standard variable length string</nowiki>|#919191}}
        n$ = scope2$ + n$
        {{Text|clearid|#55FF55}}
        id.n = cvarname$
        id.t = STRINGTYPE
        {{Cl|IF}} cmemlist(idn + {{Text|1|#F580B1}}) {{Cl|THEN}}
            {{Cl|IF}} f {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} defdatahandle, {{Text|<nowiki>"qbs *"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"=NULL;"</nowiki>|#FFB100}}
            {{Cl|IF}} f {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if (!"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"=qbs_new_cmem(0,0);"</nowiki>|#FFB100}}
            id.t = id.t + ISINCONVENTIONALMEMORY
        {{Cl|ELSE}}
            {{Cl|IF}} f {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} defdatahandle, {{Text|<nowiki>"qbs *"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"=NULL;"</nowiki>|#FFB100}}
            {{Cl|IF}} f {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if (!"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"=qbs_new(0,0);"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} f {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} FreeTxtBuf, {{Text|<nowiki>"qbs_free("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
        {{Cl|IF}} method = {{Text|0|#F580B1}} {{Cl|THEN}}
            id.mayhave = {{Text|<nowiki>"$"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} method = {{Text|1|#F580B1}} {{Cl|THEN}}
            id.musthave = {{Text|<nowiki>"$"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        id.callname = n$
        {{Text|regid|#55FF55}}
        {{Text|vWatchVariable|#55FF55}} n$, {{Text|0|#F580B1}}
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|GOTO}} dim2exitfunc
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} {{Cl|LEFT$}}(typ$, {{Text|4|#F580B1}}) = {{Text|<nowiki>"_BIT"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} ({{Cl|LEFT$}}(typ$, {{Text|3|#F580B1}}) = {{Text|<nowiki>"BIT"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}}
        {{Cl|IF}} ({{Cl|LEFT$}}(typ$, {{Text|4|#F580B1}}) = {{Text|<nowiki>"_BIT"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} {{Cl|LEN}}(typ$) > {{Text|4|#F580B1}}) {{Cl|OR (boolean)|OR}} ({{Cl|LEFT$}}(typ$, {{Text|3|#F580B1}}) = {{Text|<nowiki>"BIT"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} {{Cl|LEN}}(typ$) > {{Text|3|#F580B1}}) {{Cl|THEN}}
            {{Cl|IF}} {{Cl|LEFT$}}(typ$, {{Text|7|#F580B1}}) <> {{Text|<nowiki>"_BIT * "</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} {{Cl|LEFT$}}(typ$, {{Text|6|#F580B1}}) <> {{Text|<nowiki>"BIT * "</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected "</nowiki>|#FFB100}} + qb64prefix$ + {{Text|<nowiki>"BIT * number"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            c$ = {{Cl|MID$ (function)|MID$}}(typ$, {{Cl|INSTR}}(typ$, {{Text|<nowiki>" * "</nowiki>|#FFB100}}) + {{Text|3|#F580B1}})
            {{Cl|IF}} {{Text|isuinteger|#55FF55}}(c$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Number expected after *"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|IF}} {{Cl|LEN}}(c$) > {{Text|2|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot create a bit variable of size > 64 bits"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            bits = {{Cl|VAL}}(c$)
            {{Cl|IF}} bits = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot create a bit variable of size 0 bits"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|IF}} bits > {{Text|64|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot create a bit variable of size > 64 bits"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|ELSE}}
            bits = {{Text|1|#F580B1}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} bits <= {{Text|32|#F580B1}} {{Cl|THEN}} ct$ = {{Text|<nowiki>"int32"</nowiki>|#FFB100}} {{Cl|ELSE}} ct$ = {{Text|<nowiki>"int64"</nowiki>|#FFB100}}
        {{Cl|IF}} unsgn {{Cl|THEN}} n$ = {{Text|<nowiki>"U"</nowiki>|#FFB100}}: ct$ = {{Text|<nowiki>"u"</nowiki>|#FFB100}} + ct$
        n$ = n$ + {{Text|<nowiki>"BIT"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bits) + {{Text|<nowiki>"_"</nowiki>|#FFB100}} + varname$
        {{Text|<nowiki>'array of bit-length variables</nowiki>|#919191}}
        {{Cl|IF}} elements$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} bits > {{Text|63|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot create a bit array of size > 63 bits"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            arraydesc = {{Text|0|#F580B1}}
            cmps$ = varname$: {{Cl|IF}} unsgn {{Cl|THEN}} cmps$ = cmps$ + {{Text|<nowiki>"~"</nowiki>|#FFB100}}
            cmps$ = cmps$ + {{Text|<nowiki>"`"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bits)
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}}
                try = {{Text|findid|#55FF55}}(cmps$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|DO}} {{Cl|WHILE}} try
                    {{Cl|IF}} (id.arraytype) {{Cl|THEN}}
                        l$ = {{Cl|RTRIM$}}(id.cn)
                        arraydesc = currentid: scope2$ = {{Text|scope$|#55FF55}}
                        {{Cl|EXIT}} {{Cl|DO}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(cmps$) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|LOOP}}
            {{Cl|END}} {{Cl|IF}}
            n$ = scope2$ + {{Text|<nowiki>"ARRAY_"</nowiki>|#FFB100}} + n$
            {{Text|<nowiki>'nume = allocarray(n$, elements$, -bits) 'passing a negative element size signifies bits not bytes</nowiki>|#919191}}
            {{Text|<nowiki>'IF arraydesc THEN goto dim2exitfunc 'id already exists!</nowiki>|#919191}}
            {{Text|<nowiki>'clearid</nowiki>|#919191}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} {{Cl|LEN}}(elements$) = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|ASC (function)|ASC}}(elements$) = {{Text|63|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'"?"</nowiki>|#919191}}
                    E = arrayelementslist(idn + {{Text|1|#F580B1}}): {{Cl|IF}} E {{Cl|THEN}} elements$ = elements$ + {{Text|str2$|#55FF55}}(E) {{Text|<nowiki>'eg. "?3" for a 3 dimensional array</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}}
                nume = {{Text|allocarray|#55FF55}}(n$, elements$, -bits, {{Text|0|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                l$ = l$ + sp + tlayout$
                {{Cl|IF}} arraydesc {{Cl|THEN}} {{Cl|GOTO}} dim2exitfunc
                {{Text|clearid|#55FF55}}
            {{Cl|ELSE}}
                {{Text|clearid|#55FF55}}
                {{Cl|IF}} elements$ = {{Text|<nowiki>"?"</nowiki>|#FFB100}} {{Cl|THEN}}
                    nume = {{Text|-1|#F580B1}}
                    id.linkid = glinkid
                    id.linkarg = glinkarg
                {{Cl|ELSE}}
                    nume = {{Cl|VAL}}(elements$)
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            id.n = cvarname$
            id.arraytype = BITTYPE - {{Text|1|#F580B1}} + bits
            {{Cl|IF}} unsgn {{Cl|THEN}} id.arraytype = id.arraytype + ISUNSIGNED
            {{Cl|IF}} cmemlist(idn + {{Text|1|#F580B1}}) {{Cl|THEN}} id.arraytype = id.arraytype + ISINCONVENTIONALMEMORY
            {{Cl|IF}} nume > {{Text|65536|#F580B1}} {{Cl|THEN}} nume = nume - {{Text|65536|#F580B1}}: id.staticarray = {{Text|1|#F580B1}}
            id.arrayelements = nume
            id.callname = n$
            {{Cl|IF}} method = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} unsgn {{Cl|THEN}} id.mayhave = {{Text|<nowiki>"~`"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bits) {{Cl|ELSE}} id.mayhave = {{Text|<nowiki>"`"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bits)
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} method = {{Text|1|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} unsgn {{Cl|THEN}} id.musthave = {{Text|<nowiki>"~`"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bits) {{Cl|ELSE}} id.musthave = {{Text|<nowiki>"`"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bits)
            {{Cl|END}} {{Cl|IF}}
            {{Text|regid|#55FF55}}
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Text|vWatchVariable|#55FF55}} n$, {{Text|0|#F580B1}}
            {{Cl|GOTO}} dim2exitfunc
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'standard bit-length variable</nowiki>|#919191}}
        n$ = scope2$ + n$
        {{Text|WriteBufLine|#55FF55}} defdatahandle, ct$ + {{Text|<nowiki>" *"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"=NULL;"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"==NULL){"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"cmem_sp-=4;"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if (cmem_sp<qbs_cmem_sp) error(257);"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"=("</nowiki>|#FFB100}} + ct$ + {{Text|<nowiki>"*)(dblock+cmem_sp);"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"*"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"=0;"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
        {{Text|clearid|#55FF55}}
        id.n = cvarname$
        id.t = BITTYPE - {{Text|1|#F580B1}} + bits + ISINCONVENTIONALMEMORY: {{Cl|IF}} unsgn {{Cl|THEN}} id.t = id.t + ISUNSIGNED
        {{Cl|IF}} method = {{Text|0|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} unsgn {{Cl|THEN}} id.mayhave = {{Text|<nowiki>"~`"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bits) {{Cl|ELSE}} id.mayhave = {{Text|<nowiki>"`"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bits)
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} method = {{Text|1|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} unsgn {{Cl|THEN}} id.musthave = {{Text|<nowiki>"~`"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bits) {{Cl|ELSE}} id.musthave = {{Text|<nowiki>"`"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bits)
        {{Cl|END}} {{Cl|IF}}
        id.callname = n$
        {{Text|regid|#55FF55}}
        {{Text|vWatchVariable|#55FF55}} n$, {{Text|0|#F580B1}}
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|GOTO}} dim2exitfunc
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} typ$ = {{Text|<nowiki>"_BYTE"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (typ$ = {{Text|<nowiki>"BYTE"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}}
        ct$ = {{Text|<nowiki>"int8"</nowiki>|#FFB100}}
        {{Cl|IF}} unsgn {{Cl|THEN}} n$ = {{Text|<nowiki>"U"</nowiki>|#FFB100}}: ct$ = {{Text|<nowiki>"u"</nowiki>|#FFB100}} + ct$
        n$ = n$ + {{Text|<nowiki>"BYTE_"</nowiki>|#FFB100}} + varname$
        {{Cl|IF}} elements$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
            arraydesc = {{Text|0|#F580B1}}
            cmps$ = varname$: {{Cl|IF}} unsgn {{Cl|THEN}} cmps$ = cmps$ + {{Text|<nowiki>"~"</nowiki>|#FFB100}}
            cmps$ = cmps$ + {{Text|<nowiki>"%%"</nowiki>|#FFB100}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}}
                try = {{Text|findid|#55FF55}}(cmps$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|DO}} {{Cl|WHILE}} try
                    {{Cl|IF}} (id.arraytype) {{Cl|THEN}}
                        l$ = {{Cl|RTRIM$}}(id.cn)
                        arraydesc = currentid: scope2$ = {{Text|scope$|#55FF55}}
                        {{Cl|EXIT}} {{Cl|DO}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(cmps$) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|LOOP}}
            {{Cl|END}} {{Cl|IF}}
            n$ = scope2$ + {{Text|<nowiki>"ARRAY_"</nowiki>|#FFB100}} + n$
            {{Text|<nowiki>'nume = allocarray(n$, elements$, 1)</nowiki>|#919191}}
            {{Text|<nowiki>'IF arraydesc THEN goto dim2exitfunc</nowiki>|#919191}}
            {{Text|<nowiki>'clearid</nowiki>|#919191}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} {{Cl|LEN}}(elements$) = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|ASC (function)|ASC}}(elements$) = {{Text|63|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'"?"</nowiki>|#919191}}
                    E = arrayelementslist(idn + {{Text|1|#F580B1}}): {{Cl|IF}} E {{Cl|THEN}} elements$ = elements$ + {{Text|str2$|#55FF55}}(E) {{Text|<nowiki>'eg. "?3" for a 3 dimensional array</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}}
                nume = {{Text|allocarray|#55FF55}}(n$, elements$, {{Text|1|#F580B1}}, {{Text|0|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                l$ = l$ + sp + tlayout$
                {{Cl|IF}} arraydesc {{Cl|THEN}} {{Cl|GOTO}} dim2exitfunc
                {{Text|clearid|#55FF55}}
            {{Cl|ELSE}}
                {{Text|clearid|#55FF55}}
                {{Cl|IF}} elements$ = {{Text|<nowiki>"?"</nowiki>|#FFB100}} {{Cl|THEN}}
                    nume = {{Text|-1|#F580B1}}
                    id.linkid = glinkid
                    id.linkarg = glinkarg
                {{Cl|ELSE}}
                    nume = {{Cl|VAL}}(elements$)
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            id.arraytype = BYTETYPE: {{Cl|IF}} unsgn {{Cl|THEN}} id.arraytype = id.arraytype + ISUNSIGNED
            {{Cl|IF}} cmemlist(idn + {{Text|1|#F580B1}}) {{Cl|THEN}} id.arraytype = id.arraytype + ISINCONVENTIONALMEMORY
            {{Cl|IF}} nume > {{Text|65536|#F580B1}} {{Cl|THEN}} nume = nume - {{Text|65536|#F580B1}}: id.staticarray = {{Text|1|#F580B1}}
            id.arrayelements = nume
            id.callname = n$
        {{Cl|ELSE}}
            n$ = scope2$ + n$
            {{Text|clearid|#55FF55}}
            id.t = BYTETYPE: {{Cl|IF}} unsgn {{Cl|THEN}} id.t = id.t + ISUNSIGNED
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} defdatahandle, ct$ + {{Text|<nowiki>" *"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"=NULL;"</nowiki>|#FFB100}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"==NULL){"</nowiki>|#FFB100}}
            {{Cl|IF}} cmemlist(idn + {{Text|1|#F580B1}}) {{Cl|THEN}}
                id.t = id.t + ISINCONVENTIONALMEMORY
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"cmem_sp-=1;"</nowiki>|#FFB100}}
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"=("</nowiki>|#FFB100}} + ct$ + {{Text|<nowiki>"*)(dblock+cmem_sp);"</nowiki>|#FFB100}}
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if (cmem_sp<qbs_cmem_sp) error(257);"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"=("</nowiki>|#FFB100}} + ct$ + {{Text|<nowiki>"*)mem_static_malloc(1);"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"*"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"=0;"</nowiki>|#FFB100}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        id.n = cvarname$
        {{Cl|IF}} method = {{Text|0|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} unsgn {{Cl|THEN}} id.mayhave = {{Text|<nowiki>"~%%"</nowiki>|#FFB100}} {{Cl|ELSE}} id.mayhave = {{Text|<nowiki>"%%"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} method = {{Text|1|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} unsgn {{Cl|THEN}} id.musthave = {{Text|<nowiki>"~%%"</nowiki>|#FFB100}} {{Cl|ELSE}} id.musthave = {{Text|<nowiki>"%%"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        id.callname = n$
        {{Text|regid|#55FF55}}
        {{Text|vWatchVariable|#55FF55}} n$, {{Text|0|#F580B1}}
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|GOTO}} dim2exitfunc
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} typ$ = {{Text|<nowiki>"INTEGER"</nowiki>|#FFB100}} {{Cl|THEN}}
        ct$ = {{Text|<nowiki>"int16"</nowiki>|#FFB100}}
        {{Cl|IF}} unsgn {{Cl|THEN}} n$ = {{Text|<nowiki>"U"</nowiki>|#FFB100}}: ct$ = {{Text|<nowiki>"u"</nowiki>|#FFB100}} + ct$
        n$ = n$ + {{Text|<nowiki>"INTEGER_"</nowiki>|#FFB100}} + varname$
        {{Cl|IF}} elements$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
            arraydesc = {{Text|0|#F580B1}}
            cmps$ = varname$: {{Cl|IF}} unsgn {{Cl|THEN}} cmps$ = cmps$ + {{Text|<nowiki>"~"</nowiki>|#FFB100}}
            cmps$ = cmps$ + {{Text|<nowiki>"%"</nowiki>|#FFB100}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}}
                try = {{Text|findid|#55FF55}}(cmps$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|DO}} {{Cl|WHILE}} try
                    {{Cl|IF}} (id.arraytype) {{Cl|THEN}}
                        l$ = {{Cl|RTRIM$}}(id.cn)
                        arraydesc = currentid: scope2$ = {{Text|scope$|#55FF55}}
                        {{Cl|EXIT}} {{Cl|DO}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(cmps$) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|LOOP}}
            {{Cl|END}} {{Cl|IF}}
            n$ = scope2$ + {{Text|<nowiki>"ARRAY_"</nowiki>|#FFB100}} + n$
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} {{Cl|LEN}}(elements$) = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|ASC (function)|ASC}}(elements$) = {{Text|63|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'"?"</nowiki>|#919191}}
                    E = arrayelementslist(idn + {{Text|1|#F580B1}}): {{Cl|IF}} E {{Cl|THEN}} elements$ = elements$ + {{Text|str2$|#55FF55}}(E) {{Text|<nowiki>'eg. "?3" for a 3 dimensional array</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}}
                nume = {{Text|allocarray|#55FF55}}(n$, elements$, {{Text|2|#F580B1}}, {{Text|0|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                l$ = l$ + sp + tlayout$
                {{Cl|IF}} arraydesc {{Cl|THEN}} {{Cl|GOTO}} dim2exitfunc
                {{Text|clearid|#55FF55}}
            {{Cl|ELSE}}
                {{Text|clearid|#55FF55}}
                {{Cl|IF}} elements$ = {{Text|<nowiki>"?"</nowiki>|#FFB100}} {{Cl|THEN}}
                    nume = {{Text|-1|#F580B1}}
                    id.linkid = glinkid
                    id.linkarg = glinkarg
                {{Cl|ELSE}}
                    nume = {{Cl|VAL}}(elements$)
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            id.arraytype = INTEGERTYPE: {{Cl|IF}} unsgn {{Cl|THEN}} id.arraytype = id.arraytype + ISUNSIGNED
            {{Cl|IF}} cmemlist(idn + {{Text|1|#F580B1}}) {{Cl|THEN}} id.arraytype = id.arraytype + ISINCONVENTIONALMEMORY
            {{Cl|IF}} nume > {{Text|65536|#F580B1}} {{Cl|THEN}} nume = nume - {{Text|65536|#F580B1}}: id.staticarray = {{Text|1|#F580B1}}
            id.arrayelements = nume
            id.callname = n$
        {{Cl|ELSE}}
            n$ = scope2$ + n$
            {{Text|clearid|#55FF55}}
            id.t = INTEGERTYPE: {{Cl|IF}} unsgn {{Cl|THEN}} id.t = id.t + ISUNSIGNED
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} defdatahandle, ct$ + {{Text|<nowiki>" *"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"=NULL;"</nowiki>|#FFB100}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"==NULL){"</nowiki>|#FFB100}}
            {{Cl|IF}} cmemlist(idn + {{Text|1|#F580B1}}) {{Cl|THEN}}
                id.t = id.t + ISINCONVENTIONALMEMORY
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"cmem_sp-=2;"</nowiki>|#FFB100}}
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"=("</nowiki>|#FFB100}} + ct$ + {{Text|<nowiki>"*)(dblock+cmem_sp);"</nowiki>|#FFB100}}
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if (cmem_sp<qbs_cmem_sp) error(257);"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"=("</nowiki>|#FFB100}} + ct$ + {{Text|<nowiki>"*)mem_static_malloc(2);"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"*"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"=0;"</nowiki>|#FFB100}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        id.n = cvarname$
        {{Cl|IF}} method = {{Text|0|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} unsgn {{Cl|THEN}} id.mayhave = {{Text|<nowiki>"~%"</nowiki>|#FFB100}} {{Cl|ELSE}} id.mayhave = {{Text|<nowiki>"%"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} method = {{Text|1|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} unsgn {{Cl|THEN}} id.musthave = {{Text|<nowiki>"~%"</nowiki>|#FFB100}} {{Cl|ELSE}} id.musthave = {{Text|<nowiki>"%"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        id.callname = n$
        {{Text|regid|#55FF55}}
        {{Text|vWatchVariable|#55FF55}} n$, {{Text|0|#F580B1}}
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|GOTO}} dim2exitfunc
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} typ$ = {{Text|<nowiki>"_OFFSET"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (typ$ = {{Text|<nowiki>"OFFSET"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}}
        ct$ = {{Text|<nowiki>"ptrszint"</nowiki>|#FFB100}}
        {{Cl|IF}} unsgn {{Cl|THEN}} n$ = {{Text|<nowiki>"U"</nowiki>|#FFB100}}: ct$ = {{Text|<nowiki>"u"</nowiki>|#FFB100}} + ct$
        n$ = n$ + {{Text|<nowiki>"OFFSET_"</nowiki>|#FFB100}} + varname$
        {{Cl|IF}} elements$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
            arraydesc = {{Text|0|#F580B1}}
            cmps$ = varname$: {{Cl|IF}} unsgn {{Cl|THEN}} cmps$ = cmps$ + {{Text|<nowiki>"~"</nowiki>|#FFB100}}
            cmps$ = cmps$ + {{Text|<nowiki>"%&"</nowiki>|#FFB100}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}}
                try = {{Text|findid|#55FF55}}(cmps$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|DO}} {{Cl|WHILE}} try
                    {{Cl|IF}} (id.arraytype) {{Cl|THEN}}
                        l$ = {{Cl|RTRIM$}}(id.cn)
                        arraydesc = currentid: scope2$ = {{Text|scope$|#55FF55}}
                        {{Cl|EXIT}} {{Cl|DO}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(cmps$) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|LOOP}}
            {{Cl|END}} {{Cl|IF}}
            n$ = scope2$ + {{Text|<nowiki>"ARRAY_"</nowiki>|#FFB100}} + n$
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} {{Cl|LEN}}(elements$) = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|ASC (function)|ASC}}(elements$) = {{Text|63|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'"?"</nowiki>|#919191}}
                    E = arrayelementslist(idn + {{Text|1|#F580B1}}): {{Cl|IF}} E {{Cl|THEN}} elements$ = elements$ + {{Text|str2$|#55FF55}}(E) {{Text|<nowiki>'eg. "?3" for a 3 dimensional array</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}}
                nume = {{Text|allocarray|#55FF55}}(n$, elements$, OS_BITS \ {{Text|8|#F580B1}}, {{Text|0|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                l$ = l$ + sp + tlayout$
                {{Cl|IF}} arraydesc {{Cl|THEN}} {{Cl|GOTO}} dim2exitfunc
                {{Text|clearid|#55FF55}}
            {{Cl|ELSE}}
                {{Text|clearid|#55FF55}}
                {{Cl|IF}} elements$ = {{Text|<nowiki>"?"</nowiki>|#FFB100}} {{Cl|THEN}}
                    nume = {{Text|-1|#F580B1}}
                    id.linkid = glinkid
                    id.linkarg = glinkarg
                {{Cl|ELSE}}
                    nume = {{Cl|VAL}}(elements$)
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            id.arraytype = OFFSETTYPE: {{Cl|IF}} unsgn {{Cl|THEN}} id.arraytype = id.arraytype + ISUNSIGNED
            {{Cl|IF}} cmemlist(idn + {{Text|1|#F580B1}}) {{Cl|THEN}} id.arraytype = id.arraytype + ISINCONVENTIONALMEMORY
            {{Cl|IF}} nume > {{Text|65536|#F580B1}} {{Cl|THEN}} nume = nume - {{Text|65536|#F580B1}}: id.staticarray = {{Text|1|#F580B1}}
            id.arrayelements = nume
            id.callname = n$
        {{Cl|ELSE}}
            n$ = scope2$ + n$
            {{Text|clearid|#55FF55}}
            id.t = OFFSETTYPE: {{Cl|IF}} unsgn {{Cl|THEN}} id.t = id.t + ISUNSIGNED
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} defdatahandle, ct$ + {{Text|<nowiki>" *"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"=NULL;"</nowiki>|#FFB100}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"==NULL){"</nowiki>|#FFB100}}
            {{Cl|IF}} cmemlist(idn + {{Text|1|#F580B1}}) {{Cl|THEN}}
                id.t = id.t + ISINCONVENTIONALMEMORY
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"cmem_sp-="</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(OS_BITS \ {{Text|8|#F580B1}}) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"=("</nowiki>|#FFB100}} + ct$ + {{Text|<nowiki>"*)(dblock+cmem_sp);"</nowiki>|#FFB100}}
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if (cmem_sp<qbs_cmem_sp) error(257);"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"=("</nowiki>|#FFB100}} + ct$ + {{Text|<nowiki>"*)mem_static_malloc("</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(OS_BITS \ {{Text|8|#F580B1}}) + {{Text|<nowiki>");"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"*"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"=0;"</nowiki>|#FFB100}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        id.n = cvarname$
        {{Cl|IF}} method = {{Text|0|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} unsgn {{Cl|THEN}} id.mayhave = {{Text|<nowiki>"~%&"</nowiki>|#FFB100}} {{Cl|ELSE}} id.mayhave = {{Text|<nowiki>"%&"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} method = {{Text|1|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} unsgn {{Cl|THEN}} id.musthave = {{Text|<nowiki>"~%&"</nowiki>|#FFB100}} {{Cl|ELSE}} id.musthave = {{Text|<nowiki>"%&"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        id.callname = n$
        {{Text|regid|#55FF55}}
        {{Text|vWatchVariable|#55FF55}} n$, {{Text|0|#F580B1}}
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|GOTO}} dim2exitfunc
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} typ$ = {{Text|<nowiki>"LONG"</nowiki>|#FFB100}} {{Cl|THEN}}
        ct$ = {{Text|<nowiki>"int32"</nowiki>|#FFB100}}
        {{Cl|IF}} unsgn {{Cl|THEN}} n$ = {{Text|<nowiki>"U"</nowiki>|#FFB100}}: ct$ = {{Text|<nowiki>"u"</nowiki>|#FFB100}} + ct$
        n$ = n$ + {{Text|<nowiki>"LONG_"</nowiki>|#FFB100}} + varname$
        {{Cl|IF}} elements$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
            arraydesc = {{Text|0|#F580B1}}
            cmps$ = varname$: {{Cl|IF}} unsgn {{Cl|THEN}} cmps$ = cmps$ + {{Text|<nowiki>"~"</nowiki>|#FFB100}}
            cmps$ = cmps$ + {{Text|<nowiki>"&"</nowiki>|#FFB100}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}}
                try = {{Text|findid|#55FF55}}(cmps$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|DO}} {{Cl|WHILE}} try
                    {{Cl|IF}} (id.arraytype) {{Cl|THEN}}
                        l$ = {{Cl|RTRIM$}}(id.cn)
                        arraydesc = currentid: scope2$ = {{Text|scope$|#55FF55}}
                        {{Cl|EXIT}} {{Cl|DO}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(cmps$) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|LOOP}}
            {{Cl|END}} {{Cl|IF}}
            n$ = scope2$ + {{Text|<nowiki>"ARRAY_"</nowiki>|#FFB100}} + n$
            {{Text|<nowiki>'nume = allocarray(n$, elements$, 4)</nowiki>|#919191}}
            {{Text|<nowiki>'IF arraydesc THEN goto dim2exitfunc</nowiki>|#919191}}
            {{Text|<nowiki>'clearid</nowiki>|#919191}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} {{Cl|LEN}}(elements$) = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|ASC (function)|ASC}}(elements$) = {{Text|63|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'"?"</nowiki>|#919191}}
                    E = arrayelementslist(idn + {{Text|1|#F580B1}}): {{Cl|IF}} E {{Cl|THEN}} elements$ = elements$ + {{Text|str2$|#55FF55}}(E) {{Text|<nowiki>'eg. "?3" for a 3 dimensional array</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}}
                nume = {{Text|allocarray|#55FF55}}(n$, elements$, {{Text|4|#F580B1}}, {{Text|0|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                l$ = l$ + sp + tlayout$
                {{Cl|IF}} arraydesc {{Cl|THEN}} {{Cl|GOTO}} dim2exitfunc
                {{Text|clearid|#55FF55}}
            {{Cl|ELSE}}
                {{Text|clearid|#55FF55}}
                {{Cl|IF}} elements$ = {{Text|<nowiki>"?"</nowiki>|#FFB100}} {{Cl|THEN}}
                    nume = {{Text|-1|#F580B1}}
                    id.linkid = glinkid
                    id.linkarg = glinkarg
                {{Cl|ELSE}}
                    nume = {{Cl|VAL}}(elements$)
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            id.arraytype = LONGTYPE: {{Cl|IF}} unsgn {{Cl|THEN}} id.arraytype = id.arraytype + ISUNSIGNED
            {{Cl|IF}} cmemlist(idn + {{Text|1|#F580B1}}) {{Cl|THEN}} id.arraytype = id.arraytype + ISINCONVENTIONALMEMORY
            {{Cl|IF}} nume > {{Text|65536|#F580B1}} {{Cl|THEN}} nume = nume - {{Text|65536|#F580B1}}: id.staticarray = {{Text|1|#F580B1}}
            id.arrayelements = nume
            id.callname = n$
        {{Cl|ELSE}}
            n$ = scope2$ + n$
            {{Text|clearid|#55FF55}}
            id.t = LONGTYPE: {{Cl|IF}} unsgn {{Cl|THEN}} id.t = id.t + ISUNSIGNED
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} defdatahandle, ct$ + {{Text|<nowiki>" *"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"=NULL;"</nowiki>|#FFB100}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"==NULL){"</nowiki>|#FFB100}}
            {{Cl|IF}} cmemlist(idn + {{Text|1|#F580B1}}) {{Cl|THEN}}
                id.t = id.t + ISINCONVENTIONALMEMORY
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"cmem_sp-=4;"</nowiki>|#FFB100}}
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"=("</nowiki>|#FFB100}} + ct$ + {{Text|<nowiki>"*)(dblock+cmem_sp);"</nowiki>|#FFB100}}
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if (cmem_sp<qbs_cmem_sp) error(257);"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"=("</nowiki>|#FFB100}} + ct$ + {{Text|<nowiki>"*)mem_static_malloc(4);"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"*"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"=0;"</nowiki>|#FFB100}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        id.n = cvarname$
        {{Cl|IF}} method = {{Text|0|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} unsgn {{Cl|THEN}} id.mayhave = {{Text|<nowiki>"~&"</nowiki>|#FFB100}} {{Cl|ELSE}} id.mayhave = {{Text|<nowiki>"&"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} method = {{Text|1|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} unsgn {{Cl|THEN}} id.musthave = {{Text|<nowiki>"~&"</nowiki>|#FFB100}} {{Cl|ELSE}} id.musthave = {{Text|<nowiki>"&"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        id.callname = n$
        {{Text|regid|#55FF55}}
        {{Text|vWatchVariable|#55FF55}} n$, {{Text|0|#F580B1}}
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|GOTO}} dim2exitfunc
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} typ$ = {{Text|<nowiki>"_INTEGER64"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (typ$ = {{Text|<nowiki>"INTEGER64"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}}
        ct$ = {{Text|<nowiki>"int64"</nowiki>|#FFB100}}
        {{Cl|IF}} unsgn {{Cl|THEN}} n$ = {{Text|<nowiki>"U"</nowiki>|#FFB100}}: ct$ = {{Text|<nowiki>"u"</nowiki>|#FFB100}} + ct$
        n$ = n$ + {{Text|<nowiki>"INTEGER64_"</nowiki>|#FFB100}} + varname$
        {{Cl|IF}} elements$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
            arraydesc = {{Text|0|#F580B1}}
            cmps$ = varname$: {{Cl|IF}} unsgn {{Cl|THEN}} cmps$ = cmps$ + {{Text|<nowiki>"~"</nowiki>|#FFB100}}
            cmps$ = cmps$ + {{Text|<nowiki>"&&"</nowiki>|#FFB100}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}}
                try = {{Text|findid|#55FF55}}(cmps$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|DO}} {{Cl|WHILE}} try
                    {{Cl|IF}} (id.arraytype) {{Cl|THEN}}
                        l$ = {{Cl|RTRIM$}}(id.cn)
                        arraydesc = currentid: scope2$ = {{Text|scope$|#55FF55}}
                        {{Cl|EXIT}} {{Cl|DO}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(cmps$) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|LOOP}}
            {{Cl|END}} {{Cl|IF}}
            n$ = scope2$ + {{Text|<nowiki>"ARRAY_"</nowiki>|#FFB100}} + n$
            {{Text|<nowiki>'nume = allocarray(n$, elements$, 8)</nowiki>|#919191}}
            {{Text|<nowiki>'IF arraydesc THEN goto dim2exitfunc</nowiki>|#919191}}
            {{Text|<nowiki>'clearid</nowiki>|#919191}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} {{Cl|LEN}}(elements$) = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|ASC (function)|ASC}}(elements$) = {{Text|63|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'"?"</nowiki>|#919191}}
                    E = arrayelementslist(idn + {{Text|1|#F580B1}}): {{Cl|IF}} E {{Cl|THEN}} elements$ = elements$ + {{Text|str2$|#55FF55}}(E) {{Text|<nowiki>'eg. "?3" for a 3 dimensional array</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}}
                nume = {{Text|allocarray|#55FF55}}(n$, elements$, {{Text|8|#F580B1}}, {{Text|0|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                l$ = l$ + sp + tlayout$
                {{Cl|IF}} arraydesc {{Cl|THEN}} {{Cl|GOTO}} dim2exitfunc
                {{Text|clearid|#55FF55}}
            {{Cl|ELSE}}
                {{Text|clearid|#55FF55}}
                {{Cl|IF}} elements$ = {{Text|<nowiki>"?"</nowiki>|#FFB100}} {{Cl|THEN}}
                    nume = {{Text|-1|#F580B1}}
                    id.linkid = glinkid
                    id.linkarg = glinkarg
                {{Cl|ELSE}}
                    nume = {{Cl|VAL}}(elements$)
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            id.arraytype = INTEGER64TYPE: {{Cl|IF}} unsgn {{Cl|THEN}} id.arraytype = id.arraytype + ISUNSIGNED
            {{Cl|IF}} cmemlist(idn + {{Text|1|#F580B1}}) {{Cl|THEN}} id.arraytype = id.arraytype + ISINCONVENTIONALMEMORY
            {{Cl|IF}} nume > {{Text|65536|#F580B1}} {{Cl|THEN}} nume = nume - {{Text|65536|#F580B1}}: id.staticarray = {{Text|1|#F580B1}}
            id.arrayelements = nume
            id.callname = n$
        {{Cl|ELSE}}
            n$ = scope2$ + n$
            {{Text|clearid|#55FF55}}
            id.t = INTEGER64TYPE: {{Cl|IF}} unsgn {{Cl|THEN}} id.t = id.t + ISUNSIGNED
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} defdatahandle, ct$ + {{Text|<nowiki>" *"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"=NULL;"</nowiki>|#FFB100}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"==NULL){"</nowiki>|#FFB100}}
            {{Cl|IF}} cmemlist(idn + {{Text|1|#F580B1}}) {{Cl|THEN}}
                id.t = id.t + ISINCONVENTIONALMEMORY
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"cmem_sp-=8;"</nowiki>|#FFB100}}
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"=("</nowiki>|#FFB100}} + ct$ + {{Text|<nowiki>"*)(dblock+cmem_sp);"</nowiki>|#FFB100}}
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if (cmem_sp<qbs_cmem_sp) error(257);"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"=("</nowiki>|#FFB100}} + ct$ + {{Text|<nowiki>"*)mem_static_malloc(8);"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"*"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"=0;"</nowiki>|#FFB100}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        id.n = cvarname$
        {{Cl|IF}} method = {{Text|0|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} unsgn {{Cl|THEN}} id.mayhave = {{Text|<nowiki>"~&&"</nowiki>|#FFB100}} {{Cl|ELSE}} id.mayhave = {{Text|<nowiki>"&&"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} method = {{Text|1|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} unsgn {{Cl|THEN}} id.musthave = {{Text|<nowiki>"~&&"</nowiki>|#FFB100}} {{Cl|ELSE}} id.musthave = {{Text|<nowiki>"&&"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        id.callname = n$
        {{Text|regid|#55FF55}}
        {{Text|vWatchVariable|#55FF55}} n$, {{Text|0|#F580B1}}
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|GOTO}} dim2exitfunc
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} unsgn = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Type cannot be unsigned"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} typ$ = {{Text|<nowiki>"SINGLE"</nowiki>|#FFB100}} {{Cl|THEN}}
        ct$ = {{Text|<nowiki>"float"</nowiki>|#FFB100}}
        n$ = n$ + {{Text|<nowiki>"SINGLE_"</nowiki>|#FFB100}} + varname$
        {{Cl|IF}} elements$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
            arraydesc = {{Text|0|#F580B1}}
            cmps$ = varname$ + {{Text|<nowiki>"!"</nowiki>|#FFB100}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}}
                try = {{Text|findid|#55FF55}}(cmps$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|DO}} {{Cl|WHILE}} try
                    {{Cl|IF}} (id.arraytype) {{Cl|THEN}}
                        l$ = {{Cl|RTRIM$}}(id.cn)
                        arraydesc = currentid: scope2$ = {{Text|scope$|#55FF55}}
                        {{Cl|EXIT}} {{Cl|DO}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(cmps$) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|LOOP}}
            {{Cl|END}} {{Cl|IF}}
            n$ = scope2$ + {{Text|<nowiki>"ARRAY_"</nowiki>|#FFB100}} + n$
            {{Text|<nowiki>'nume = allocarray(n$, elements$, 4)</nowiki>|#919191}}
            {{Text|<nowiki>'IF arraydesc THEN goto dim2exitfunc</nowiki>|#919191}}
            {{Text|<nowiki>'clearid</nowiki>|#919191}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} {{Cl|LEN}}(elements$) = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|ASC (function)|ASC}}(elements$) = {{Text|63|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'"?"</nowiki>|#919191}}
                    E = arrayelementslist(idn + {{Text|1|#F580B1}}): {{Cl|IF}} E {{Cl|THEN}} elements$ = elements$ + {{Text|str2$|#55FF55}}(E) {{Text|<nowiki>'eg. "?3" for a 3 dimensional array</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}}
                nume = {{Text|allocarray|#55FF55}}(n$, elements$, {{Text|4|#F580B1}}, {{Text|0|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                l$ = l$ + sp + tlayout$
                {{Cl|IF}} arraydesc {{Cl|THEN}} {{Cl|GOTO}} dim2exitfunc
                {{Text|clearid|#55FF55}}
            {{Cl|ELSE}}
                {{Text|clearid|#55FF55}}
                {{Cl|IF}} elements$ = {{Text|<nowiki>"?"</nowiki>|#FFB100}} {{Cl|THEN}}
                    nume = {{Text|-1|#F580B1}}
                    id.linkid = glinkid
                    id.linkarg = glinkarg
                {{Cl|ELSE}}
                    nume = {{Cl|VAL}}(elements$)
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            id.arraytype = SINGLETYPE
            {{Cl|IF}} cmemlist(idn + {{Text|1|#F580B1}}) {{Cl|THEN}} id.arraytype = id.arraytype + ISINCONVENTIONALMEMORY
            {{Cl|IF}} nume > {{Text|65536|#F580B1}} {{Cl|THEN}} nume = nume - {{Text|65536|#F580B1}}: id.staticarray = {{Text|1|#F580B1}}
            id.arrayelements = nume
            id.callname = n$
        {{Cl|ELSE}}
            n$ = scope2$ + n$
            {{Text|clearid|#55FF55}}
            id.t = SINGLETYPE
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} defdatahandle, ct$ + {{Text|<nowiki>" *"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"=NULL;"</nowiki>|#FFB100}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"==NULL){"</nowiki>|#FFB100}}
            {{Cl|IF}} cmemlist(idn + {{Text|1|#F580B1}}) {{Cl|THEN}}
                id.t = id.t + ISINCONVENTIONALMEMORY
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"cmem_sp-=4;"</nowiki>|#FFB100}}
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"=("</nowiki>|#FFB100}} + ct$ + {{Text|<nowiki>"*)(dblock+cmem_sp);"</nowiki>|#FFB100}}
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if (cmem_sp<qbs_cmem_sp) error(257);"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"=("</nowiki>|#FFB100}} + ct$ + {{Text|<nowiki>"*)mem_static_malloc(4);"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"*"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"=0;"</nowiki>|#FFB100}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        id.n = cvarname$
        {{Cl|IF}} method = {{Text|0|#F580B1}} {{Cl|THEN}}
            id.mayhave = {{Text|<nowiki>"!"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} method = {{Text|1|#F580B1}} {{Cl|THEN}}
            id.musthave = {{Text|<nowiki>"!"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        id.callname = n$
        {{Text|regid|#55FF55}}
        {{Text|vWatchVariable|#55FF55}} n$, {{Text|0|#F580B1}}
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|GOTO}} dim2exitfunc
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} typ$ = {{Text|<nowiki>"DOUBLE"</nowiki>|#FFB100}} {{Cl|THEN}}
        ct$ = {{Text|<nowiki>"double"</nowiki>|#FFB100}}
        n$ = n$ + {{Text|<nowiki>"DOUBLE_"</nowiki>|#FFB100}} + varname$
        {{Cl|IF}} elements$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
            arraydesc = {{Text|0|#F580B1}}
            cmps$ = varname$ + {{Text|<nowiki>"#"</nowiki>|#FFB100}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}}
                try = {{Text|findid|#55FF55}}(cmps$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|DO}} {{Cl|WHILE}} try
                    {{Cl|IF}} (id.arraytype) {{Cl|THEN}}
                        l$ = {{Cl|RTRIM$}}(id.cn)
                        arraydesc = currentid: scope2$ = {{Text|scope$|#55FF55}}
                        {{Cl|EXIT}} {{Cl|DO}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(cmps$) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|LOOP}}
            {{Cl|END}} {{Cl|IF}}
            n$ = scope2$ + {{Text|<nowiki>"ARRAY_"</nowiki>|#FFB100}} + n$
            {{Text|<nowiki>'nume = allocarray(n$, elements$, 8)</nowiki>|#919191}}
            {{Text|<nowiki>'IF arraydesc THEN goto dim2exitfunc</nowiki>|#919191}}
            {{Text|<nowiki>'clearid</nowiki>|#919191}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} {{Cl|LEN}}(elements$) = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|ASC (function)|ASC}}(elements$) = {{Text|63|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'"?"</nowiki>|#919191}}
                    E = arrayelementslist(idn + {{Text|1|#F580B1}}): {{Cl|IF}} E {{Cl|THEN}} elements$ = elements$ + {{Text|str2$|#55FF55}}(E) {{Text|<nowiki>'eg. "?3" for a 3 dimensional array</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}}
                nume = {{Text|allocarray|#55FF55}}(n$, elements$, {{Text|8|#F580B1}}, {{Text|0|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                l$ = l$ + sp + tlayout$
                {{Cl|IF}} arraydesc {{Cl|THEN}} {{Cl|GOTO}} dim2exitfunc
                {{Text|clearid|#55FF55}}
            {{Cl|ELSE}}
                {{Text|clearid|#55FF55}}
                {{Cl|IF}} elements$ = {{Text|<nowiki>"?"</nowiki>|#FFB100}} {{Cl|THEN}}
                    nume = {{Text|-1|#F580B1}}
                    id.linkid = glinkid
                    id.linkarg = glinkarg
                {{Cl|ELSE}}
                    nume = {{Cl|VAL}}(elements$)
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            id.arraytype = DOUBLETYPE
            {{Cl|IF}} cmemlist(idn + {{Text|1|#F580B1}}) {{Cl|THEN}} id.arraytype = id.arraytype + ISINCONVENTIONALMEMORY
            {{Cl|IF}} nume > {{Text|65536|#F580B1}} {{Cl|THEN}} nume = nume - {{Text|65536|#F580B1}}: id.staticarray = {{Text|1|#F580B1}}
            id.arrayelements = nume
            id.callname = n$
        {{Cl|ELSE}}
            n$ = scope2$ + n$
            {{Text|clearid|#55FF55}}
            id.t = DOUBLETYPE
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} defdatahandle, ct$ + {{Text|<nowiki>" *"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"=NULL;"</nowiki>|#FFB100}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"==NULL){"</nowiki>|#FFB100}}
            {{Cl|IF}} cmemlist(idn + {{Text|1|#F580B1}}) {{Cl|THEN}}
                id.t = id.t + ISINCONVENTIONALMEMORY
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"cmem_sp-=8;"</nowiki>|#FFB100}}
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"=("</nowiki>|#FFB100}} + ct$ + {{Text|<nowiki>"*)(dblock+cmem_sp);"</nowiki>|#FFB100}}
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if (cmem_sp<qbs_cmem_sp) error(257);"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"=("</nowiki>|#FFB100}} + ct$ + {{Text|<nowiki>"*)mem_static_malloc(8);"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"*"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"=0;"</nowiki>|#FFB100}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        id.n = cvarname$
        {{Cl|IF}} method = {{Text|0|#F580B1}} {{Cl|THEN}}
            id.mayhave = {{Text|<nowiki>"#"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} method = {{Text|1|#F580B1}} {{Cl|THEN}}
            id.musthave = {{Text|<nowiki>"#"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        id.callname = n$
        {{Text|regid|#55FF55}}
        {{Text|vWatchVariable|#55FF55}} n$, {{Text|0|#F580B1}}
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|GOTO}} dim2exitfunc
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} typ$ = {{Text|<nowiki>"_FLOAT"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (typ$ = {{Text|<nowiki>"FLOAT"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}}
        ct$ = {{Text|<nowiki>"long double"</nowiki>|#FFB100}}
        n$ = n$ + {{Text|<nowiki>"FLOAT_"</nowiki>|#FFB100}} + varname$
        {{Cl|IF}} elements$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
            arraydesc = {{Text|0|#F580B1}}
            cmps$ = varname$ + {{Text|<nowiki>"##"</nowiki>|#FFB100}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}}
                try = {{Text|findid|#55FF55}}(cmps$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|DO}} {{Cl|WHILE}} try
                    {{Cl|IF}} (id.arraytype) {{Cl|THEN}}
                        l$ = {{Cl|RTRIM$}}(id.cn)
                        arraydesc = currentid: scope2$ = {{Text|scope$|#55FF55}}
                        {{Cl|EXIT}} {{Cl|DO}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(cmps$) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|LOOP}}
            {{Cl|END}} {{Cl|IF}}
            n$ = scope2$ + {{Text|<nowiki>"ARRAY_"</nowiki>|#FFB100}} + n$
            {{Text|<nowiki>'nume = allocarray(n$, elements$, 32)</nowiki>|#919191}}
            {{Text|<nowiki>'IF arraydesc THEN goto dim2exitfunc</nowiki>|#919191}}
            {{Text|<nowiki>'clearid</nowiki>|#919191}}
            {{Cl|IF}} f = {{Text|1|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} {{Cl|LEN}}(elements$) = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|ASC (function)|ASC}}(elements$) = {{Text|63|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'"?"</nowiki>|#919191}}
                    E = arrayelementslist(idn + {{Text|1|#F580B1}}): {{Cl|IF}} E {{Cl|THEN}} elements$ = elements$ + {{Text|str2$|#55FF55}}(E) {{Text|<nowiki>'eg. "?3" for a 3 dimensional array</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}}
                nume = {{Text|allocarray|#55FF55}}(n$, elements$, {{Text|32|#F580B1}}, {{Text|0|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                l$ = l$ + sp + tlayout$
                {{Cl|IF}} arraydesc {{Cl|THEN}} {{Cl|GOTO}} dim2exitfunc
                {{Text|clearid|#55FF55}}
            {{Cl|ELSE}}
                {{Text|clearid|#55FF55}}
                {{Cl|IF}} elements$ = {{Text|<nowiki>"?"</nowiki>|#FFB100}} {{Cl|THEN}}
                    nume = {{Text|-1|#F580B1}}
                    id.linkid = glinkid
                    id.linkarg = glinkarg
                {{Cl|ELSE}}
                    nume = {{Cl|VAL}}(elements$)
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            id.arraytype = FLOATTYPE
            {{Cl|IF}} cmemlist(idn + {{Text|1|#F580B1}}) {{Cl|THEN}} id.arraytype = id.arraytype + ISINCONVENTIONALMEMORY
            {{Cl|IF}} nume > {{Text|65536|#F580B1}} {{Cl|THEN}} nume = nume - {{Text|65536|#F580B1}}: id.staticarray = {{Text|1|#F580B1}}
            id.arrayelements = nume
            id.callname = n$
        {{Cl|ELSE}}
            n$ = scope2$ + n$
            {{Text|clearid|#55FF55}}
            id.t = FLOATTYPE
            {{Cl|IF}} f {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} defdatahandle, ct$ + {{Text|<nowiki>" *"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"=NULL;"</nowiki>|#FFB100}}
            {{Cl|IF}} f {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"==NULL){"</nowiki>|#FFB100}}
            {{Cl|IF}} cmemlist(idn + {{Text|1|#F580B1}}) {{Cl|THEN}}
                id.t = id.t + ISINCONVENTIONALMEMORY
                {{Cl|IF}} f {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"cmem_sp-=32;"</nowiki>|#FFB100}}
                {{Cl|IF}} f {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"=("</nowiki>|#FFB100}} + ct$ + {{Text|<nowiki>"*)(dblock+cmem_sp);"</nowiki>|#FFB100}}
                {{Cl|IF}} f {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if (cmem_sp<qbs_cmem_sp) error(257);"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                {{Cl|IF}} f {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, n$ + {{Text|<nowiki>"=("</nowiki>|#FFB100}} + ct$ + {{Text|<nowiki>"*)mem_static_malloc(32);"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} f {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"*"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"=0;"</nowiki>|#FFB100}}
            {{Cl|IF}} f {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        id.n = cvarname$
        {{Cl|IF}} method = {{Text|0|#F580B1}} {{Cl|THEN}}
            id.mayhave = {{Text|<nowiki>"##"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} method = {{Text|1|#F580B1}} {{Cl|THEN}}
            id.musthave = {{Text|<nowiki>"##"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        id.callname = n$
        {{Text|regid|#55FF55}}
        {{Text|vWatchVariable|#55FF55}} n$, {{Text|0|#F580B1}}
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|GOTO}} dim2exitfunc
    {{Cl|END}} {{Cl|IF}}
    {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Unknown type"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    dim2exitfunc:
    bypassNextVariable = {{Text|0|#F580B1}}
    {{Cl|IF}} dimsfarray {{Cl|THEN}}
        ids(idn).sfid = glinkid
        ids(idn).sfarg = glinkarg
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'restore STATIC state</nowiki>|#919191}}
    {{Cl|IF}} dimstatic <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} dimshared = {{Text|0|#F580B1}} {{Cl|THEN}}
        DataTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"A"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"data"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(subfuncn) + {{Text|<nowiki>".txt"</nowiki>|#FFB100}})
        FreeTxtBuf = {{Text|OpenBuffer%|#55FF55}}({{Text|<nowiki>"A"</nowiki>|#FFB100}}, tmpdir$ + {{Text|<nowiki>"free"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(subfuncn) + {{Text|<nowiki>".txt"</nowiki>|#FFB100}})
        defdatahandle = DataTxtBuf
    {{Cl|END}} {{Cl|IF}}
    tlayout$ = l$
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|udtreference$|#55FF55}} (o$, a$, typ {{Cl|AS}} {{Cl|LONG}})
    {{Text|<nowiki>'UDT REFERENCE FORMAT</nowiki>|#919191}}
    {{Text|<nowiki>'idno|udtno|udtelementno|byteoffset</nowiki>|#919191}}
    {{Text|<nowiki>'    ^udt of the element, not of the id</nowiki>|#919191}}
    obak$ = o$
    {{Text|<nowiki>'PRINT "called udtreference!"</nowiki>|#919191}}
    r$ = {{Text|str2$|#55FF55}}(currentid) + sp3
    o = {{Text|0|#F580B1}} {{Text|<nowiki>'the fixed/known part of the offset</nowiki>|#919191}}
    incmem = {{Text|0|#F580B1}}
    {{Cl|IF}} id.t {{Cl|THEN}}
        u = id.t {{Cl|AND}} {{Text|511|#F580B1}}
        {{Cl|IF}} id.t {{Cl|AND (boolean)|AND}} ISINCONVENTIONALMEMORY {{Cl|THEN}} incmem = {{Text|1|#F580B1}}
    {{Cl|ELSE}}
        u = id.arraytype {{Cl|AND}} {{Text|511|#F580B1}}
        {{Cl|IF}} id.arraytype {{Cl|AND (boolean)|AND}} ISINCONVENTIONALMEMORY {{Cl|THEN}} incmem = {{Text|1|#F580B1}}
    {{Cl|END}} {{Cl|IF}}
    E = {{Text|0|#F580B1}}
    n = {{Text|numelements|#55FF55}}(a$)
    {{Cl|IF}} n = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} fulludt
    i = {{Text|1|#F580B1}}
    udtfindelenext:
    {{Cl|IF}} {{Text|getelement$|#55FF55}}(a$, i) <> {{Text|<nowiki>"."</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected ."</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    i = i + {{Text|1|#F580B1}}
    n$ = {{Text|getelement$|#55FF55}}(a$, i)
    nsym$ = {{Text|removesymbol|#55FF55}}(n$): {{Cl|IF}} {{Cl|LEN}}(nsym$) {{Cl|THEN}} ntyp = {{Text|typname2typ|#55FF55}}(nsym$): ntypsize = typname2typsize
    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} n$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected .elementname"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    udtfindele:
    {{Cl|IF}} E = {{Text|0|#F580B1}} {{Cl|THEN}} E = udtxnext(u) {{Cl|ELSE}} E = udtenext(E)
    {{Cl|IF}} E = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Element not defined"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    n2$ = {{Cl|RTRIM$}}(udtename(E))
    {{Cl|IF}} udtebytealign(E) {{Cl|THEN}}
        {{Cl|IF}} o {{Cl|MOD}} {{Text|8|#F580B1}} {{Cl|THEN}} o = o + ({{Text|8|#F580B1}} - (o {{Cl|MOD}} {{Text|8|#F580B1}}))
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} n$ <> n2$ {{Cl|THEN}}
        {{Text|<nowiki>'increment fixed offset</nowiki>|#919191}}
        o = o + udtesize(E)
        {{Cl|GOTO}} udtfindele
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'check symbol after element's name (if given) is correct</nowiki>|#919191}}
    {{Cl|IF}} {{Cl|LEN}}(nsym$) {{Cl|THEN}}
        {{Cl|IF}} udtetype(E) {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid symbol after user defined type"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} ntyp <> udtetype(E) {{Cl|OR (boolean)|OR}} ntypsize <> udtetypesize(E) {{Cl|THEN}}
            {{Cl|IF}} nsym$ = {{Text|<nowiki>"$"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} ((udtetype(E) {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) <> {{Text|0|#F580B1}}) {{Cl|THEN}} {{Cl|GOTO}} correctsymbol
            {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Incorrect symbol after element name"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    correctsymbol:
    {{Text|<nowiki>'Move into another UDT structure?</nowiki>|#919191}}
    {{Cl|IF}} i <> n {{Cl|THEN}}
        {{Cl|IF}} (udtetype(E) {{Cl|AND (boolean)|AND}} ISUDT) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected user defined type"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        u = udtetype(E) {{Cl|AND}} {{Text|511|#F580B1}}
        E = {{Text|0|#F580B1}}
        i = i + {{Text|1|#F580B1}}
        {{Cl|GOTO}} udtfindelenext
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'Change e reference to u | 0 reference?</nowiki>|#919191}}
    {{Cl|IF}} udtetype(E) {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
        u = udtetype(E) {{Cl|AND}} {{Text|511|#F580B1}}
        E = {{Text|0|#F580B1}}
    {{Cl|END}} {{Cl|IF}}
    fulludt:
    r$ = r$ + {{Text|str2$|#55FF55}}(u) + sp3 + {{Text|str2$|#55FF55}}(E) + sp3
    {{Cl|IF}} o {{Cl|MOD}} {{Text|8|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"QB64 cannot handle bit offsets within user defined types"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    o = o \ {{Text|8|#F580B1}}
    {{Cl|IF}} o$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
        {{Cl|IF}} o <> {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'dont add an unnecessary 0</nowiki>|#919191}}
            o$ = o$ + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(o)
        {{Cl|END}} {{Cl|IF}}
    {{Cl|ELSE}}
        o$ = {{Text|str2$|#55FF55}}(o)
    {{Cl|END}} {{Cl|IF}}
    r$ = r$ + o$
    {{Text|udtreference$|#55FF55}} = r$
    typ = udtetype(E) + ISUDT + ISREFERENCE
    {{Text|<nowiki>'full udt override:</nowiki>|#919191}}
    {{Cl|IF}} E = {{Text|0|#F580B1}} {{Cl|THEN}}
        typ = u + ISUDT + ISREFERENCE
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} obak$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} typ = typ + ISARRAY
    {{Cl|IF}} incmem {{Cl|THEN}} typ = typ + ISINCONVENTIONALMEMORY
    {{Text|<nowiki>'print "UDTREF:"+r$+","+str2$(typ)</nowiki>|#919191}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|evaluate$|#55FF55}} (a2$, typ {{Cl|AS}} {{Cl|LONG}})
    {{Cl|DIM}} block({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|STRING}}
    {{Cl|DIM}} evaledblock({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|INTEGER}}
    {{Cl|DIM}} blocktype({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|LONG}}
    {{Text|<nowiki>'typ IS A RETURN VALUE</nowiki>|#919191}}
    {{Text|<nowiki>'''DIM cli(15) AS INTEGER</nowiki>|#919191}}
    a$ = a2$
    typ = {{Text|-1|#F580B1}}
    {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"evaluating:["</nowiki>|#FFB100}} + a2$ + {{Text|<nowiki>"]"</nowiki>|#FFB100}}
    {{Cl|IF}} a2$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Syntax error"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Text|<nowiki>'''cl$ = classify(a$)</nowiki>|#919191}}
    blockn = {{Text|0|#F580B1}}
    n = {{Text|numelements|#55FF55}}(a$)
    b = {{Text|0|#F580B1}} {{Text|<nowiki>'bracketting level</nowiki>|#919191}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} n
        reevaluate:
        l$ = {{Text|getelement|#55FF55}}(a$, i)
        {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"#*#*#* reevaluating:"</nowiki>|#FFB100}} + l$, i
        {{Cl|IF}} i <> n {{Cl|THEN}} nextl$ = {{Text|getelement|#55FF55}}(a$, i + {{Text|1|#F580B1}}) {{Cl|ELSE}} nextl$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Text|<nowiki>'''getclass cl$, i, cli()</nowiki>|#919191}}
        {{Cl|IF}} b = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'don't evaluate anything within brackets</nowiki>|#919191}}
            {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, l$
            l2$ = l$ {{Text|<nowiki>'pure version of l$</nowiki>|#919191}}
            {{Cl|FOR}} try_method = {{Text|1|#F580B1}} {{Cl|TO}} {{Text|4|#F580B1}}
                l$ = l2$
                {{Cl|IF}} try_method = {{Text|2|#F580B1}} {{Cl|OR (boolean)|OR}} try_method = {{Text|4|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    dtyp$ = {{Text|removesymbol|#55FF55}}(l$): {{Cl|IF}} Error_Happened {{Cl|THEN}} dtyp$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: Error_Happened = {{Text|0|#F580B1}}
                    {{Cl|IF}} {{Cl|LEN}}(dtyp$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} {{Text|isoperator|#55FF55}}(l$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                            {{Cl|IF}} {{Text|isvalidvariable|#55FF55}}(l$) {{Cl|THEN}}
                                {{Cl|IF}} {{Cl|LEFT$}}(l$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"_"</nowiki>|#FFB100}} {{Cl|THEN}} v = {{Text|27|#F580B1}} {{Cl|ELSE}} v = {{Cl|ASC (function)|ASC}}({{Cl|UCASE$}}(l$)) - {{Text|64|#F580B1}}
                                l$ = l$ + defineextaz(v)
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|ELSE}}
                        l$ = l2$
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                try = {{Text|findid|#55FF55}}(l$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|DO}} {{Cl|WHILE}} try
                    {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, try
                    {{Text|<nowiki>'is l$ an array?</nowiki>|#919191}}
                    {{Cl|IF}} nextl$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}}
                        {{Cl|IF}} id.arraytype {{Cl|THEN}}
                            {{Cl|IF}} (subfuncn = id.insubfuncn {{Cl|AND (boolean)|AND}} try_method <= {{Text|2|#F580B1}}) {{Cl|OR (boolean)|OR}} try_method >= {{Text|3|#F580B1}} {{Cl|THEN}}
                                arrayid = currentid
                                constequation = {{Text|0|#F580B1}}
                                i2 = i + {{Text|2|#F580B1}}
                                b2 = {{Text|0|#F580B1}}
                                evalnextele3:
                                l2$ = {{Text|getelement|#55FF55}}(a$, i2)
                                {{Cl|IF}} l2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} b2 = b2 + {{Text|1|#F580B1}}
                                {{Cl|IF}} l2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}}
                                    b2 = b2 - {{Text|1|#F580B1}}
                                    {{Cl|IF}} b2 = {{Text|-1|#F580B1}} {{Cl|THEN}}
                                        c$ = {{Text|arrayreference|#55FF55}}({{Text|getelements$|#55FF55}}(a$, i + {{Text|2|#F580B1}}, i2 - {{Text|1|#F580B1}}), typ2)
                                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                                        i = i2
                                        {{Text|<nowiki>'UDT</nowiki>|#919191}}
                                        {{Cl|IF}} typ2 {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
                                            {{Text|<nowiki>'print "arrayref returned:"+c$</nowiki>|#919191}}
                                            {{Text|getid|#55FF55}} arrayid
                                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                                            o$ = {{Cl|RIGHT$}}(c$, {{Cl|LEN}}(c$) - {{Cl|INSTR}}(c$, sp3))
                                            {{Text|<nowiki>'change o$ to a byte offset if necessary</nowiki>|#919191}}
                                            u = typ2 {{Cl|AND}} {{Text|511|#F580B1}}
                                            s = udtxsize(u)
                                            {{Cl|IF}} udtxbytealign(u) {{Cl|THEN}}
                                                {{Cl|IF}} s {{Cl|MOD}} {{Text|8|#F580B1}} {{Cl|THEN}} s = s + ({{Text|8|#F580B1}} - (s {{Cl|MOD}} {{Text|8|#F580B1}})) {{Text|<nowiki>'round up to nearest byte</nowiki>|#919191}}
                                                s = s \ {{Text|8|#F580B1}}
                                            {{Cl|END}} {{Cl|IF}}
                                            o$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} + o$ + {{Text|<nowiki>")*"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(s)
                                            {{Text|<nowiki>'print "calling evaludt with o$:"+o$</nowiki>|#919191}}
                                            {{Cl|GOTO}} evaludt
                                        {{Cl|END}} {{Cl|IF}}
                                        {{Cl|GOTO}} evalednextele3
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                                i2 = i2 + {{Text|1|#F580B1}}
                                {{Cl|GOTO}} evalnextele3
                                evalednextele3:
                                blockn = blockn + {{Text|1|#F580B1}}
                                block(blockn) = c$
                                evaledblock(blockn) = {{Text|2|#F580B1}}
                                blocktype(blockn) = typ2
                                {{Cl|IF}} (typ2 {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} stringprocessinghappened = {{Text|1|#F580B1}}
                                {{Cl|GOTO}} evaled
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|ELSE}}
                        {{Text|<nowiki>'not followed by "("</nowiki>|#919191}}
                        {{Text|<nowiki>'is l$ a simple variable?</nowiki>|#919191}}
                        {{Cl|IF}} id.t <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} (id.t {{Cl|AND (boolean)|AND}} ISUDT) = {{Text|0|#F580B1}} {{Cl|THEN}}
                            {{Cl|IF}} (subfuncn = id.insubfuncn {{Cl|AND (boolean)|AND}} try_method <= {{Text|2|#F580B1}}) {{Cl|OR (boolean)|OR}} try_method >= {{Text|3|#F580B1}} {{Cl|THEN}}
                                constequation = {{Text|0|#F580B1}}
                                blockn = blockn + {{Text|1|#F580B1}}
                                {{Text|makeidrefer|#55FF55}} block(blockn), blocktype(blockn)
                                {{Cl|IF}} (blocktype(blockn) {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} stringprocessinghappened = {{Text|1|#F580B1}}
                                evaledblock(blockn) = {{Text|2|#F580B1}}
                                {{Cl|GOTO}} evaled
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Text|<nowiki>'is l$ a UDT?</nowiki>|#919191}}
                        {{Cl|IF}} id.t {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
                            {{Cl|IF}} (subfuncn = id.insubfuncn {{Cl|AND (boolean)|AND}} try_method <= {{Text|2|#F580B1}}) {{Cl|OR (boolean)|OR}} try_method >= {{Text|3|#F580B1}} {{Cl|THEN}}
                                constequation = {{Text|0|#F580B1}}
                                o$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                                evaludt:
                                b2 = {{Text|0|#F580B1}}
                                i3 = i + {{Text|1|#F580B1}}
                                {{Cl|FOR}} i2 = i3 {{Cl|TO}} n
                                    e2$ = {{Text|getelement|#55FF55}}(a$, i2)
                                    {{Cl|IF}} e2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} b2 = b2 + {{Text|1|#F580B1}}
                                    {{Cl|IF}} b2 = {{Text|0|#F580B1}} {{Cl|THEN}}
                                        {{Cl|IF}} e2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} {{Text|isoperator|#55FF55}}(e2$) {{Cl|THEN}}
                                            i4 = i2 - {{Text|1|#F580B1}}
                                            {{Cl|GOTO}} gotudt
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Cl|IF}} e2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} b2 = b2 - {{Text|1|#F580B1}}
                                {{Cl|NEXT}}
                                i4 = n
                                gotudt:
                                {{Cl|IF}} i4 < i3 {{Cl|THEN}} e$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|ELSE}} e$ = {{Text|getelements$|#55FF55}}(a$, i3, i4)
                                {{Text|<nowiki>'PRINT "UDTREFERENCE:";l$; e$</nowiki>|#919191}}
                                e$ = {{Text|udtreference|#55FF55}}(o$, e$, typ2)
                                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                                i = i4
                                blockn = blockn + {{Text|1|#F580B1}}
                                block(blockn) = e$
                                evaledblock(blockn) = {{Text|2|#F580B1}}
                                blocktype(blockn) = typ2
                                {{Text|<nowiki>'is the following next necessary?</nowiki>|#919191}}
                                {{Text|<nowiki>'IF (typ2 AND ISSTRING) THEN stringprocessinghappened = 1</nowiki>|#919191}}
                                {{Cl|GOTO}} evaled
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'"(" or no "("</nowiki>|#919191}}
                    {{Text|<nowiki>'is l$ a function?</nowiki>|#919191}}
                    {{Cl|IF}} id.subfunc = {{Text|1|#F580B1}} {{Cl|THEN}}
                        constequation = {{Text|0|#F580B1}}
                        {{Cl|IF}} {{Text|getelement|#55FF55}}(a$, i + {{Text|1|#F580B1}}) = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}}
                            i2 = i + {{Text|2|#F580B1}}
                            b2 = {{Text|0|#F580B1}}
                            args = {{Text|1|#F580B1}}
                            evalnextele:
                            l2$ = {{Text|getelement|#55FF55}}(a$, i2)
                            {{Cl|IF}} l2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} b2 = b2 + {{Text|1|#F580B1}}
                            {{Cl|IF}} l2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}}
                                b2 = b2 - {{Text|1|#F580B1}}
                                {{Cl|IF}} b2 = {{Text|-1|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} i2 = i + {{Text|2|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected (...)"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                                    c$ = {{Text|evaluatefunc|#55FF55}}({{Text|getelements$|#55FF55}}(a$, i + {{Text|2|#F580B1}}, i2 - {{Text|1|#F580B1}}), args, typ2)
                                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                                    i = i2
                                    {{Cl|GOTO}} evalednextele
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                            {{Cl|IF}} l2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} b2 = {{Text|0|#F580B1}} {{Cl|THEN}} args = args + {{Text|1|#F580B1}}
                            i2 = i2 + {{Text|1|#F580B1}}
                            {{Cl|GOTO}} evalnextele
                        {{Cl|ELSE}}
                            {{Text|<nowiki>'no brackets</nowiki>|#919191}}
                            c$ = {{Text|evaluatefunc|#55FF55}}({{Text|<nowiki>""</nowiki>|#FFB100}}, {{Text|0|#F580B1}}, typ2)
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                        {{Cl|END}} {{Cl|IF}}
                        evalednextele:
                        blockn = blockn + {{Text|1|#F580B1}}
                        block(blockn) = c$
                        evaledblock(blockn) = {{Text|2|#F580B1}}
                        blocktype(blockn) = typ2
                        {{Cl|IF}} (typ2 {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} stringprocessinghappened = {{Text|1|#F580B1}}
                        {{Cl|GOTO}} evaled
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(l$) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|LOOP}}
            {{Cl|NEXT}} {{Text|<nowiki>'try method (1-4)</nowiki>|#919191}}
            {{Text|<nowiki>'assume l$ an undefined array?</nowiki>|#919191}}
            {{Cl|IF}} i <> n {{Cl|THEN}}
                {{Cl|IF}} {{Text|getelement$|#55FF55}}(a$, i + {{Text|1|#F580B1}}) = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} {{Text|isoperator|#55FF55}}(l$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} {{Text|isvalidvariable|#55FF55}}(l$) {{Cl|THEN}}
                            {{Cl|IF}} Debug {{Cl|THEN}}
                                {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"**************"</nowiki>|#FFB100}}
                                {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"about to auto-create array:"</nowiki>|#FFB100}} + l$, i
                                {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"**************"</nowiki>|#FFB100}}
                            {{Cl|END}} {{Cl|IF}}
                            dtyp$ = {{Text|removesymbol|#55FF55}}(l$)
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                            {{Text|<nowiki>'count the number of elements</nowiki>|#919191}}
                            nume = {{Text|1|#F580B1}}
                            b2 = {{Text|0|#F580B1}}
                            {{Cl|FOR}} i2 = i + {{Text|2|#F580B1}} {{Cl|TO}} n
                                e$ = {{Text|getelement|#55FF55}}(a$, i2)
                                {{Cl|IF}} e$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} b2 = b2 + {{Text|1|#F580B1}}
                                {{Cl|IF}} b2 = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} e$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}} nume = nume + {{Text|1|#F580B1}}
                                {{Cl|IF}} e$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} b2 = b2 - {{Text|1|#F580B1}}
                                {{Cl|IF}} b2 = {{Text|-1|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}}
                            {{Cl|NEXT}}
                            fakee$ = {{Text|<nowiki>"10"</nowiki>|#FFB100}}: {{Cl|FOR}} i2 = {{Text|2|#F580B1}} {{Cl|TO}} nume: fakee$ = fakee$ + sp + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"10"</nowiki>|#FFB100}}: {{Cl|NEXT}}
                            {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"evaluate:creating undefined array using dim2("</nowiki>|#FFB100}} + l$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + dtyp$ + {{Text|<nowiki>",1,"</nowiki>|#FFB100}} + fakee$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                            {{Cl|IF}} optionexplicit {{Cl|OR (boolean)|OR}} optionexplicitarray {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Array '"</nowiki>|#FFB100}} + l$ + {{Text|<nowiki>"' ("</nowiki>|#FFB100}} + {{Text|symbol2fulltypename$|#55FF55}}(dtyp$) + {{Text|<nowiki>") not defined"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                            olddimstatic = dimstatic
                            method = {{Text|1|#F580B1}}
                            {{Cl|IF}} subfuncn {{Cl|THEN}}
                                autoarray = {{Text|1|#F580B1}} {{Text|<nowiki>'move dimensioning of auto array to data???.txt from inline</nowiki>|#919191}}
                                {{Text|<nowiki>'static array declared by STATIC name()?</nowiki>|#919191}}
                                {{Text|<nowiki>'check if varname is on the static list</nowiki>|#919191}}
                                xi = {{Text|1|#F580B1}}
                                {{Cl|FOR}} x = {{Text|1|#F580B1}} {{Cl|TO}} staticarraylistn
                                    varname2$ = {{Text|getelement$|#55FF55}}(staticarraylist, xi): xi = xi + {{Text|1|#F580B1}}
                                    typ2$ = {{Text|getelement$|#55FF55}}(staticarraylist, xi): xi = xi + {{Text|1|#F580B1}}
                                    dimmethod2 = {{Cl|VAL}}({{Text|getelement$|#55FF55}}(staticarraylist, xi)): xi = xi + {{Text|1|#F580B1}}
                                    {{Text|<nowiki>'check if they are similar</nowiki>|#919191}}
                                    {{Cl|IF}} {{Cl|UCASE$}}(l$) = {{Cl|UCASE$}}(varname2$) {{Cl|THEN}}
                                        l3$ = l2$: s$ = {{Text|removesymbol|#55FF55}}(l3$)
                                        {{Cl|IF}} {{Text|symbol2fulltypename$|#55FF55}}(dtyp$) = typ2$ {{Cl|OR (boolean)|OR}} (dimmethod2 = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} s$ = {{Text|<nowiki>""</nowiki>|#FFB100}}) {{Cl|THEN}}
                                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                                            {{Text|<nowiki>'adopt properties</nowiki>|#919191}}
                                            l$ = varname2$
                                            dtyp$ = typ2$
                                            method = dimmethod2
                                            dimstatic = {{Text|3|#F580B1}}
                                        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'typ</nowiki>|#919191}}
                                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'varname</nowiki>|#919191}}
                                {{Cl|NEXT}}
                            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'subfuncn</nowiki>|#919191}}
                            bypassNextVariable = {{Text|-1|#F580B1}}
                            ignore = {{Text|dim2|#55FF55}}(l$, dtyp$, method, fakee$)
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                            dimstatic = olddimstatic
                            {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"#*#*#* dim2 has returned!!!"</nowiki>|#FFB100}}
                            {{Cl|GOTO}} reevaluate
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            l$ = l2$ {{Text|<nowiki>'restore l$</nowiki>|#919191}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'b=0</nowiki>|#919191}}
        {{Cl|IF}} l$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} b = {{Text|0|#F580B1}} {{Cl|THEN}} i1 = i + {{Text|1|#F580B1}}
            b = b + {{Text|1|#F580B1}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} b = {{Text|0|#F580B1}} {{Cl|THEN}}
            blockn = blockn + {{Text|1|#F580B1}}
            block(blockn) = l$
            evaledblock(blockn) = {{Text|0|#F580B1}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} l$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}}
            b = b - {{Text|1|#F580B1}}
            {{Cl|IF}} b = {{Text|0|#F580B1}} {{Cl|THEN}}
                c$ = {{Text|evaluate|#55FF55}}({{Text|getelements$|#55FF55}}(a$, i1, i - {{Text|1|#F580B1}}), typ2)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|IF}} (typ2 {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} stringprocessinghappened = {{Text|1|#F580B1}}
                blockn = blockn + {{Text|1|#F580B1}}
                {{Cl|IF}} (typ2 {{Cl|AND (boolean)|AND}} ISPOINTER) {{Cl|THEN}}
                    block(blockn) = c$
                {{Cl|ELSE}}
                    block(blockn) = {{Text|<nowiki>"("</nowiki>|#FFB100}} + c$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                evaledblock(blockn) = {{Text|1|#F580B1}}
                blocktype(blockn) = typ2
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        evaled:
    {{Cl|NEXT}}
    r$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Text|<nowiki>'return value</nowiki>|#919191}}
    {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"evaluated blocks:"</nowiki>|#FFB100}};
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} blockn
        {{Cl|IF}} i <> blockn {{Cl|THEN}}
            {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, block(i) + {{Cl|CHR$}}({{Text|219|#F580B1}});
        {{Cl|ELSE}}
            {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, block(i)
        {{Cl|END}} {{Cl|IF}}
    {{Cl|NEXT}}
    {{Text|<nowiki>'identify any referencable values</nowiki>|#919191}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} blockn
        {{Cl|IF}} {{Text|isoperator|#55FF55}}(block(i)) = {{Text|0|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} evaledblock(i) = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Text|<nowiki>'a number?</nowiki>|#919191}}
                c = {{Cl|ASC (function)|ASC}}({{Cl|LEFT$}}(block(i), {{Text|1|#F580B1}}))
                {{Cl|IF}} c = {{Text|45|#F580B1}} {{Cl|OR (boolean)|OR}} (c >= {{Text|48|#F580B1}} {{Cl|AND (boolean)|AND}} c <= {{Text|57|#F580B1}}) {{Cl|THEN}}
                    num$ = block(i)
                    {{Text|<nowiki>'a float?</nowiki>|#919191}}
                    f = {{Text|0|#F580B1}}
                    x = {{Cl|INSTR}}(num$, {{Text|<nowiki>"E"</nowiki>|#FFB100}})
                    {{Cl|IF}} x {{Cl|THEN}}
                        f = {{Text|1|#F580B1}}: blocktype(i) = SINGLETYPE - ISPOINTER
                    {{Cl|ELSE}}
                        x = {{Cl|INSTR}}(num$, {{Text|<nowiki>"D"</nowiki>|#FFB100}})
                        {{Cl|IF}} x {{Cl|THEN}}
                            f = {{Text|2|#F580B1}}: blocktype(i) = DOUBLETYPE - ISPOINTER
                        {{Cl|ELSE}}
                            x = {{Cl|INSTR}}(num$, {{Text|<nowiki>"F"</nowiki>|#FFB100}})
                            {{Cl|IF}} x {{Cl|THEN}}
                                f = {{Text|3|#F580B1}}: blocktype(i) = FLOATTYPE - ISPOINTER
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} f {{Cl|THEN}}
                        {{Text|<nowiki>'float</nowiki>|#919191}}
                        {{Cl|IF}} f = {{Text|2|#F580B1}} {{Cl|OR (boolean)|OR}} f = {{Text|3|#F580B1}} {{Cl|THEN}} {{Cl|MID$}}(num$, x, {{Text|1|#F580B1}}) = {{Text|<nowiki>"E"</nowiki>|#FFB100}} {{Text|<nowiki>'D,F invalid in C++</nowiki>|#919191}}
                        {{Cl|IF}} f = {{Text|3|#F580B1}} {{Cl|THEN}} num$ = num$ + {{Text|<nowiki>"L"</nowiki>|#FFB100}} {{Text|<nowiki>'otherwise number is rounded to a double</nowiki>|#919191}}
                    {{Cl|ELSE}}
                        {{Text|<nowiki>'integer</nowiki>|#919191}}
                        blocktype(i) = {{Text|typname2typ|#55FF55}}({{Text|removesymbol$|#55FF55}}(num$))
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                        {{Cl|IF}} blocktype(i) {{Cl|AND (boolean)|AND}} ISPOINTER {{Cl|THEN}} blocktype(i) = blocktype(i) - ISPOINTER
                        {{Cl|IF}} (blocktype(i) {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) > {{Text|32|#F580B1}} {{Cl|THEN}}
                            {{Cl|IF}} blocktype(i) {{Cl|AND (boolean)|AND}} ISUNSIGNED {{Cl|THEN}} num$ = num$ + {{Text|<nowiki>"ull"</nowiki>|#FFB100}} {{Cl|ELSE}} num$ = num$ + {{Text|<nowiki>"ll"</nowiki>|#FFB100}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                    block(i) = {{Text|<nowiki>" "</nowiki>|#FFB100}} + num$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} {{Text|<nowiki>'pad with spaces to avoid C++ computation errors</nowiki>|#919191}}
                    evaledblock(i) = {{Text|1|#F580B1}}
                    {{Cl|GOTO}} evaledblock
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'number?</nowiki>|#919191}}
                {{Text|<nowiki>'fc = ASC(LEFT$(block(i), 1))</nowiki>|#919191}}
                {{Text|<nowiki>'IF fc = 45 OR (fc >= 48 AND fc <= 57) THEN '- or 0-9</nowiki>|#919191}}
                {{Text|<nowiki>''it's a number</nowiki>|#919191}}
                {{Text|<nowiki>''check for an extension, if none, assume integer</nowiki>|#919191}}
                {{Text|<nowiki>'blocktype(i) = INTEGER64TYPE - ISPOINTER</nowiki>|#919191}}
                {{Text|<nowiki>'tblock$ = " " + block(i)</nowiki>|#919191}}
                {{Text|<nowiki>'IF RIGHT$(tblock$, 2) = "##" THEN blocktype(i) = FLOATTYPE - ISPOINTER: block(i) = LEFT$(block(i), LEN(block$(i)) - 2): GOTO evfltnum</nowiki>|#919191}}
                {{Text|<nowiki>'IF RIGHT$(tblock$, 1) = "#" THEN blocktype(i) = DOUBLETYPE - ISPOINTER: block(i) = LEFT$(block(i), LEN(block$(i)) - 1): GOTO evfltnum</nowiki>|#919191}}
                {{Text|<nowiki>'IF RIGHT$(tblock$, 1) = "!" THEN blocktype(i) = SINGLETYPE - ISPOINTER: block(i) = LEFT$(block(i), LEN(block$(i)) - 1): GOTO evfltnum</nowiki>|#919191}}
                {{Text|<nowiki>'</nowiki>|#919191}}
                {{Text|<nowiki>''C++ 32bit unsigned to signed 64bit</nowiki>|#919191}}
                {{Text|<nowiki>'IF INSTR(block(i),".")=0 THEN</nowiki>|#919191}}
                {{Text|<nowiki>'</nowiki>|#919191}}
                {{Text|<nowiki>'negated=0</nowiki>|#919191}}
                {{Text|<nowiki>'if left$(block(i),1)="-" then block(i)=right$(block(i),len(block(i))-1):negated=1</nowiki>|#919191}}
                {{Text|<nowiki>'</nowiki>|#919191}}
                {{Text|<nowiki>'if left$(block(i),2)="0x" then 'hex</nowiki>|#919191}}
                {{Text|<nowiki>'if len(block(i))=10 then</nowiki>|#919191}}
                {{Text|<nowiki>'if block(i)>="0x80000000" and block(i)<="0xFFFFFFFF" then block(i)="(int64)"+block(i): goto evnum</nowiki>|#919191}}
                {{Text|<nowiki>'end if</nowiki>|#919191}}
                {{Text|<nowiki>'if len(block(i))>10 then block(i)=block(i)+"ll": goto evnum</nowiki>|#919191}}
                {{Text|<nowiki>'goto evnum</nowiki>|#919191}}
                {{Text|<nowiki>'end if</nowiki>|#919191}}
                {{Text|<nowiki>'</nowiki>|#919191}}
                {{Text|<nowiki>'if left$(block(i),1)="0" then 'octal</nowiki>|#919191}}
                {{Text|<nowiki>'if len(block(i))=12 then</nowiki>|#919191}}
                {{Text|<nowiki>'if block(i)>="020000000000" and block(i)<="037777777777" then block(i)="(int64)"+block(i): goto evnum</nowiki>|#919191}}
                {{Text|<nowiki>'if block(i)>"037777777777" then block(i)=block(i)+"ll": goto evnum</nowiki>|#919191}}
                {{Text|<nowiki>'end if</nowiki>|#919191}}
                {{Text|<nowiki>'if len(block(i))>12 then block(i)=block(i)+"ll": goto evnum</nowiki>|#919191}}
                {{Text|<nowiki>'goto evnum</nowiki>|#919191}}
                {{Text|<nowiki>'end if</nowiki>|#919191}}
                {{Text|<nowiki>'</nowiki>|#919191}}
                {{Text|<nowiki>''decimal</nowiki>|#919191}}
                {{Text|<nowiki>'if len(block(i))=10 then</nowiki>|#919191}}
                {{Text|<nowiki>'if block(i)>="2147483648" and block(i)<="4294967295" then block(i)="(int64)"+block(i): goto evnum</nowiki>|#919191}}
                {{Text|<nowiki>'if block(i)>"4294967295" then block(i)=block(i)+"ll": goto evnum</nowiki>|#919191}}
                {{Text|<nowiki>'end if</nowiki>|#919191}}
                {{Text|<nowiki>'if len(block(i))>10 then block(i)=block(i)+"ll"</nowiki>|#919191}}
                {{Text|<nowiki>'</nowiki>|#919191}}
                {{Text|<nowiki>'evnum:</nowiki>|#919191}}
                {{Text|<nowiki>'</nowiki>|#919191}}
                {{Text|<nowiki>'if negated=1 then block(i)="-"+block(i)</nowiki>|#919191}}
                {{Text|<nowiki>'</nowiki>|#919191}}
                {{Text|<nowiki>'END IF</nowiki>|#919191}}
                {{Text|<nowiki>'</nowiki>|#919191}}
                {{Text|<nowiki>'evfltnum:</nowiki>|#919191}}
                {{Text|<nowiki>'</nowiki>|#919191}}
                {{Text|<nowiki>'block(i) = " " + block(i)+" "</nowiki>|#919191}}
                {{Text|<nowiki>'evaledblock(i) = 1</nowiki>|#919191}}
                {{Text|<nowiki>'GOTO evaledblock</nowiki>|#919191}}
                {{Text|<nowiki>'END IF</nowiki>|#919191}}
                {{Text|<nowiki>'a typed string in ""</nowiki>|#919191}}
                {{Cl|IF}} {{Cl|LEFT$}}(block(i), {{Text|1|#F580B1}}) = {{Cl|CHR$}}({{Text|34|#F580B1}}) {{Cl|THEN}}
                    {{Cl|IF}} {{Cl|RIGHT$}}(block(i), {{Text|1|#F580B1}}) <> {{Cl|CHR$}}({{Text|34|#F580B1}}) {{Cl|THEN}}
                        block(i) = {{Text|<nowiki>"qbs_new_txt_len("</nowiki>|#FFB100}} + block(i) + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                    {{Cl|ELSE}}
                        block(i) = {{Text|<nowiki>"qbs_new_txt("</nowiki>|#FFB100}} + block(i) + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                    blocktype(i) = ISSTRING
                    evaledblock(i) = {{Text|1|#F580B1}}
                    stringprocessinghappened = {{Text|1|#F580B1}}
                    {{Cl|GOTO}} evaledblock
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'create variable</nowiki>|#919191}}
                {{Cl|IF}} {{Text|isvalidvariable|#55FF55}}(block(i)) {{Cl|THEN}}
                    x$ = block(i)
                    typ$ = {{Text|removesymbol$|#55FF55}}(x$)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Text|<nowiki>'add symbol extension if none given</nowiki>|#919191}}
                    {{Cl|IF}} {{Cl|LEN}}(typ$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} {{Cl|LEFT$}}(x$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"_"</nowiki>|#FFB100}} {{Cl|THEN}} v = {{Text|27|#F580B1}} {{Cl|ELSE}} v = {{Cl|ASC (function)|ASC}}({{Cl|UCASE$}}(x$)) - {{Text|64|#F580B1}}
                        typ$ = defineextaz(v)
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|<nowiki>'check that it hasn't just been created within this loop (a=b+b)</nowiki>|#919191}}
                    try = {{Text|findid|#55FF55}}(x$ + typ$)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|DO}} {{Cl|WHILE}} try
                        {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, try
                        {{Cl|IF}} id.t <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} (id.t {{Cl|AND (boolean)|AND}} ISUDT) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'is x$ a simple variable?</nowiki>|#919191}}
                            {{Cl|GOTO}} simplevarfound
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(x$ + typ$) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|LOOP}}
                    {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"CREATING VARIABLE:"</nowiki>|#FFB100}} + x$
                    {{Cl|IF}} optionexplicit {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Variable '"</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>"' ("</nowiki>|#FFB100}} + {{Text|symbol2fulltypename$|#55FF55}}(typ$) + {{Text|<nowiki>") not defined"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    bypassNextVariable = {{Text|-1|#F580B1}}
                    retval = {{Text|dim2|#55FF55}}(x$, typ$, {{Text|1|#F580B1}}, {{Text|<nowiki>""</nowiki>|#FFB100}})
                    {{Text|manageVariableList|#55FF55}} {{Text|<nowiki>""</nowiki>|#FFB100}}, vWatchNewVariable$, {{Text|0|#F580B1}}, {{Text|3|#F580B1}}
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    simplevarfound:
                    constequation = {{Text|0|#F580B1}}
                    {{Text|makeidrefer|#55FF55}} block(i), blocktype(i)
                    {{Cl|IF}} (blocktype(i) {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} stringprocessinghappened = {{Text|1|#F580B1}}
                    {{Cl|IF}} blockn = {{Text|1|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} (blocktype(i) {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} {{Cl|GOTO}} returnpointer
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|<nowiki>'reference value</nowiki>|#919191}}
                    block(i) = {{Text|refer|#55FF55}}(block(i), blocktype(i), {{Text|0|#F580B1}}): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    evaledblock(i) = {{Text|1|#F580B1}}
                    {{Cl|GOTO}} evaledblock
                {{Cl|END}} {{Cl|IF}}
                {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid expression"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|ELSE}}
                {{Cl|IF}} (blocktype(i) {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}}
                    {{Cl|IF}} blockn = {{Text|1|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} returnpointer
                    {{Text|<nowiki>'if blocktype(i) and ISUDT then PRINT "UDT passed to refer by evaluate"</nowiki>|#919191}}
                    block(i) = {{Text|refer|#55FF55}}(block(i), blocktype(i), {{Text|0|#F580B1}})
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        evaledblock:
    {{Cl|NEXT}}
    {{Text|<nowiki>'return a POINTER if possible</nowiki>|#919191}}
    {{Cl|IF}} blockn = {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} evaledblock({{Text|1|#F580B1}}) {{Cl|THEN}}
            {{Cl|IF}} (blocktype({{Text|1|#F580B1}}) {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}}
                returnpointer:
                {{Cl|IF}} (blocktype({{Text|1|#F580B1}}) {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} stringprocessinghappened = {{Text|1|#F580B1}}
                {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"evaluated reference:"</nowiki>|#FFB100}} + block({{Text|1|#F580B1}})
                typ = blocktype({{Text|1|#F580B1}})
                {{Text|evaluate$|#55FF55}} = block({{Text|1|#F580B1}})
                {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'it cannot be returned as a pointer</nowiki>|#919191}}
    {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"applying operators:"</nowiki>|#FFB100}};
    {{Cl|IF}} typ = {{Text|-1|#F580B1}} {{Cl|THEN}}
        typ = blocktype({{Text|1|#F580B1}}) {{Text|<nowiki>'init typ with first blocktype</nowiki>|#919191}}
        {{Cl|IF}} {{Text|isoperator|#55FF55}}(block({{Text|1|#F580B1}})) {{Cl|THEN}} {{Text|<nowiki>'but what if it starts with a UNARY operator?</nowiki>|#919191}}
            typ = blocktype({{Text|2|#F580B1}}) {{Text|<nowiki>'init typ with second blocktype</nowiki>|#919191}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    nonop = {{Text|0|#F580B1}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} blockn
        {{Cl|IF}} evaledblock(i) = {{Text|0|#F580B1}} {{Cl|THEN}}
            isop = {{Text|isoperator|#55FF55}}(block(i))
            {{Cl|IF}} isop {{Cl|THEN}}
                nonop = {{Text|0|#F580B1}}
                constequation = {{Text|0|#F580B1}}
                {{Text|<nowiki>'operator found</nowiki>|#919191}}
                o$ = block(i)
                u = {{Text|operatorusage|#55FF55}}(o$, typ, i$, lhstyp, rhstyp, result)
                {{Cl|IF}} u <> {{Text|5|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'not unary</nowiki>|#919191}}
                    nonop = {{Text|1|#F580B1}}
                    {{Cl|IF}} i = {{Text|1|#F580B1}} {{Cl|OR (boolean)|OR}} evaledblock(i - {{Text|1|#F580B1}}) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} i = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} blockn = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} o$ = {{Text|<nowiki>"-"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected variable/value after '"</nowiki>|#FFB100}} + {{Cl|UCASE$}}(o$) + {{Text|<nowiki>"'"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}} {{Text|<nowiki>'guess - is neg in this case</nowiki>|#919191}}
                        {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected variable/value before '"</nowiki>|#FFB100}} + {{Cl|UCASE$}}(o$) + {{Text|<nowiki>"'"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} i = blockn {{Cl|OR (boolean)|OR}} evaledblock(i + {{Text|1|#F580B1}}) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected variable/value after '"</nowiki>|#FFB100}} + {{Cl|UCASE$}}(o$) + {{Text|<nowiki>"'"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Text|<nowiki>'lhstyp & rhstyp bit-field values</nowiki>|#919191}}
                {{Text|<nowiki>'1=integeral</nowiki>|#919191}}
                {{Text|<nowiki>'2=floating point</nowiki>|#919191}}
                {{Text|<nowiki>'4=string</nowiki>|#919191}}
                {{Text|<nowiki>'8=bool *only used for result</nowiki>|#919191}}
                oldtyp = typ
                newtyp = blocktype(i + {{Text|1|#F580B1}})
                {{Text|<nowiki>'IF block(i - 1) = "6" THEN</nowiki>|#919191}}
                {{Text|<nowiki>'PRINT o$</nowiki>|#919191}}
                {{Text|<nowiki>'PRINT oldtyp AND ISFLOAT</nowiki>|#919191}}
                {{Text|<nowiki>'PRINT blocktype(i - 1) AND ISFLOAT</nowiki>|#919191}}
                {{Text|<nowiki>'END</nowiki>|#919191}}
                {{Text|<nowiki>'END IF</nowiki>|#919191}}
                {{Text|<nowiki>'numeric->string is illegal!</nowiki>|#919191}}
                {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} (newtyp {{Cl|AND (boolean)|AND}} ISSTRING) <> {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot convert number to string"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'Offset protection: Override conversion rules for operator as necessary</nowiki>|#919191}}
                offsetmode = {{Text|0|#F580B1}}
                offsetcvi = {{Text|0|#F580B1}}
                {{Cl|IF}} (oldtyp {{Cl|AND (boolean)|AND}} ISOFFSET) <> {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} (newtyp {{Cl|AND (boolean)|AND}} ISOFFSET) <> {{Text|0|#F580B1}} {{Cl|THEN}}
                    offsetmode = {{Text|2|#F580B1}}
                    {{Cl|IF}} newtyp {{Cl|AND (boolean)|AND}} ISOFFSET {{Cl|THEN}}
                        {{Cl|IF}} (newtyp {{Cl|AND (boolean)|AND}} ISUNSIGNED) = {{Text|0|#F580B1}} {{Cl|THEN}} offsetmode = {{Text|1|#F580B1}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} oldtyp {{Cl|AND (boolean)|AND}} ISOFFSET {{Cl|THEN}}
                        {{Cl|IF}} (oldtyp {{Cl|AND (boolean)|AND}} ISUNSIGNED) = {{Text|0|#F580B1}} {{Cl|THEN}} offsetmode = {{Text|1|#F580B1}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|<nowiki>'depending on the operater we may do things differently</nowiki>|#919191}}
                    {{Text|<nowiki>'the default method is convert both sides to integer first</nowiki>|#919191}}
                    {{Text|<nowiki>'but these operators are different: * / ^</nowiki>|#919191}}
                    {{Cl|IF}} o$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} o$ = {{Text|<nowiki>"/"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} o$ = {{Text|<nowiki>"^"</nowiki>|#FFB100}} {{Cl|THEN}}
                        {{Cl|IF}} o$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} o$ = {{Text|<nowiki>"^"</nowiki>|#FFB100}} {{Cl|THEN}}
                            {{Text|<nowiki>'for mult, if either side is a float cast integers to 'long double's first</nowiki>|#919191}}
                            {{Cl|IF}} (newtyp {{Cl|AND (boolean)|AND}} ISFLOAT) <> {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} (oldtyp {{Cl|AND (boolean)|AND}} ISFLOAT) <> {{Text|0|#F580B1}} {{Cl|THEN}}
                                offsetcvi = {{Text|1|#F580B1}}
                                {{Cl|IF}} (oldtyp {{Cl|AND (boolean)|AND}} ISFLOAT) = {{Text|0|#F580B1}} {{Cl|THEN}} lhstyp = {{Text|2|#F580B1}}
                                {{Cl|IF}} (newtyp {{Cl|AND (boolean)|AND}} ISFLOAT) = {{Text|0|#F580B1}} {{Cl|THEN}} rhstyp = {{Text|2|#F580B1}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} o$ = {{Text|<nowiki>"/"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} o$ = {{Text|<nowiki>"^"</nowiki>|#FFB100}} {{Cl|THEN}}
                            {{Text|<nowiki>'for division or exponentials, to prevent integer division cast integers to 'long double's</nowiki>|#919191}}
                            offsetcvi = {{Text|1|#F580B1}}
                            {{Cl|IF}} (oldtyp {{Cl|AND (boolean)|AND}} ISFLOAT) = {{Text|0|#F580B1}} {{Cl|THEN}} lhstyp = {{Text|2|#F580B1}}
                            {{Cl|IF}} (newtyp {{Cl|AND (boolean)|AND}} ISFLOAT) = {{Text|0|#F580B1}} {{Cl|THEN}} rhstyp = {{Text|2|#F580B1}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|ELSE}}
                        {{Cl|IF}} lhstyp {{Cl|AND (boolean)|AND}} {{Text|2|#F580B1}} {{Cl|THEN}} lhstyp = {{Text|1|#F580B1}} {{Text|<nowiki>'force lhs and rhs to be integer values</nowiki>|#919191}}
                        {{Cl|IF}} rhstyp {{Cl|AND (boolean)|AND}} {{Text|2|#F580B1}} {{Cl|THEN}} rhstyp = {{Text|1|#F580B1}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} result = {{Text|2|#F580B1}} {{Cl|THEN}} result = {{Text|1|#F580B1}} {{Text|<nowiki>'force integer result</nowiki>|#919191}}
                    {{Text|<nowiki>'note: result=1 just sets typ&=64 if typ is a float</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'STEP 1: convert oldtyp and/or newtyp if required for the operator</nowiki>|#919191}}
                {{Text|<nowiki>'convert lhs</nowiki>|#919191}}
                {{Cl|IF}} (oldtyp {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}}
                    {{Cl|IF}} (lhstyp {{Cl|AND (boolean)|AND}} {{Text|4|#F580B1}}) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot convert string to number"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|ELSE}}
                    {{Text|<nowiki>'oldtyp is numeric</nowiki>|#919191}}
                    {{Cl|IF}} lhstyp = {{Text|4|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot convert number to string"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|IF}} (oldtyp {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}}
                        {{Cl|IF}} (lhstyp {{Cl|AND (boolean)|AND}} {{Text|2|#F580B1}}) = {{Text|0|#F580B1}} {{Cl|THEN}}
                            {{Text|<nowiki>'convert float to int</nowiki>|#919191}}
                            block(i - {{Text|1|#F580B1}}) = {{Text|<nowiki>"qbr("</nowiki>|#FFB100}} + block(i - {{Text|1|#F580B1}}) + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                            oldtyp = {{Text|64&|#F580B1}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|ELSE}}
                        {{Text|<nowiki>'oldtyp is an int</nowiki>|#919191}}
                        {{Cl|IF}} (lhstyp {{Cl|AND (boolean)|AND}} {{Text|1|#F580B1}}) = {{Text|0|#F580B1}} {{Cl|THEN}}
                            {{Text|<nowiki>'convert int to float</nowiki>|#919191}}
                            block(i - {{Text|1|#F580B1}}) = {{Text|<nowiki>"((long double)("</nowiki>|#FFB100}} + block(i - {{Text|1|#F580B1}}) + {{Text|<nowiki>"))"</nowiki>|#FFB100}}
                            oldtyp = {{Text|256&|#F580B1}} + ISFLOAT
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'convert rhs</nowiki>|#919191}}
                {{Cl|IF}} (newtyp {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}}
                    {{Cl|IF}} (rhstyp {{Cl|AND (boolean)|AND}} {{Text|4|#F580B1}}) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot convert string to number"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|ELSE}}
                    {{Text|<nowiki>'newtyp is numeric</nowiki>|#919191}}
                    {{Cl|IF}} rhstyp = {{Text|4|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot convert number to string"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|IF}} (newtyp {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}}
                        {{Cl|IF}} (rhstyp {{Cl|AND (boolean)|AND}} {{Text|2|#F580B1}}) = {{Text|0|#F580B1}} {{Cl|THEN}}
                            {{Text|<nowiki>'convert float to int</nowiki>|#919191}}
                            block(i + {{Text|1|#F580B1}}) = {{Text|<nowiki>"qbr("</nowiki>|#FFB100}} + block(i + {{Text|1|#F580B1}}) + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                            newtyp = {{Text|64&|#F580B1}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|ELSE}}
                        {{Text|<nowiki>'newtyp is an int</nowiki>|#919191}}
                        {{Cl|IF}} (rhstyp {{Cl|AND (boolean)|AND}} {{Text|1|#F580B1}}) = {{Text|0|#F580B1}} {{Cl|THEN}}
                            {{Text|<nowiki>'convert int to float</nowiki>|#919191}}
                            block(i + {{Text|1|#F580B1}}) = {{Text|<nowiki>"((long double)("</nowiki>|#FFB100}} + block(i + {{Text|1|#F580B1}}) + {{Text|<nowiki>"))"</nowiki>|#FFB100}}
                            newtyp = {{Text|256&|#F580B1}} + ISFLOAT
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'Reduce floating point values to common base for comparison?</nowiki>|#919191}}
                {{Cl|IF}} isop = {{Text|7|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'comparitive operator</nowiki>|#919191}}
                    {{Text|<nowiki>'Corrects problems encountered such as:</nowiki>|#919191}}
                    {{Text|<nowiki>'    S = 2.1</nowiki>|#919191}}
                    {{Text|<nowiki>'    IF S = 2.1 THEN PRINT "OK" ELSE PRINT "ERROR S PRINTS AS"; S; "BUT IS SEEN BY QB64 AS..."</nowiki>|#919191}}
                    {{Text|<nowiki>'    IF S < 2.1 THEN PRINT "LESS THAN 2.1"</nowiki>|#919191}}
                    {{Text|<nowiki>'concerns:</nowiki>|#919191}}
                    {{Text|<nowiki>'1. Return value from TIMER will be reduced to a SINGLE in direct comparisons</nowiki>|#919191}}
                    {{Text|<nowiki>'solution: assess, and only apply to SINGLE variables/arrays</nowiki>|#919191}}
                    {{Text|<nowiki>'2. Comparison of a double higher/lower than single range may fail</nowiki>|#919191}}
                    {{Text|<nowiki>'solution: out of range values convert to +/-1.#INF, making comparison still possible</nowiki>|#919191}}
                    {{Cl|IF}} (oldtyp {{Cl|AND (boolean)|AND}} ISFLOAT) <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} (newtyp {{Cl|AND (boolean)|AND}} ISFLOAT) <> {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'both floating point</nowiki>|#919191}}
                        s1 = oldtyp {{Cl|AND}} {{Text|511|#F580B1}}: s2 = newtyp {{Cl|AND}} {{Text|511|#F580B1}}
                        {{Cl|IF}} s2 < s1 {{Cl|THEN}} s1 = s2
                        {{Cl|IF}} s1 = {{Text|32|#F580B1}} {{Cl|THEN}}
                            block(i - {{Text|1|#F580B1}}) = {{Text|<nowiki>"((float)("</nowiki>|#FFB100}} + block(i - {{Text|1|#F580B1}}) + {{Text|<nowiki>"))"</nowiki>|#FFB100}}: oldtyp = {{Text|32&|#F580B1}} + ISFLOAT
                            block(i + {{Text|1|#F580B1}}) = {{Text|<nowiki>"((float)("</nowiki>|#FFB100}} + block(i + {{Text|1|#F580B1}}) + {{Text|<nowiki>"))"</nowiki>|#FFB100}}: newtyp = {{Text|32&|#F580B1}} + ISFLOAT
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} s1 = {{Text|64|#F580B1}} {{Cl|THEN}}
                            block(i - {{Text|1|#F580B1}}) = {{Text|<nowiki>"((double)("</nowiki>|#FFB100}} + block(i - {{Text|1|#F580B1}}) + {{Text|<nowiki>"))"</nowiki>|#FFB100}}: oldtyp = {{Text|64&|#F580B1}} + ISFLOAT
                            block(i + {{Text|1|#F580B1}}) = {{Text|<nowiki>"((double)("</nowiki>|#FFB100}} + block(i + {{Text|1|#F580B1}}) + {{Text|<nowiki>"))"</nowiki>|#FFB100}}: newtyp = {{Text|64&|#F580B1}} + ISFLOAT
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'both floating point</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'comparitive operator</nowiki>|#919191}}
                typ = newtyp
                {{Text|<nowiki>'STEP 2: markup typ</nowiki>|#919191}}
                {{Text|<nowiki>'        if either side is a float, markup typ to largest float</nowiki>|#919191}}
                {{Text|<nowiki>'        if either side is integer, markup typ</nowiki>|#919191}}
                {{Text|<nowiki>'Note: A markup is a GUESS of what the return type will be,</nowiki>|#919191}}
                {{Text|<nowiki>'      'result' can override this markup</nowiki>|#919191}}
                {{Cl|IF}} (oldtyp {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} (newtyp {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} (oldtyp {{Cl|AND (boolean)|AND}} ISFLOAT) <> {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} (newtyp {{Cl|AND (boolean)|AND}} ISFLOAT) <> {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Text|<nowiki>'float</nowiki>|#919191}}
                        b = {{Text|0|#F580B1}}: {{Cl|IF}} (oldtyp {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}} b = oldtyp {{Cl|AND}} {{Text|511|#F580B1}}
                        {{Cl|IF}} (newtyp {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}}
                            b2 = newtyp {{Cl|AND}} {{Text|511|#F580B1}}: {{Cl|IF}} b2 > b {{Cl|THEN}} b = b2
                        {{Cl|END}} {{Cl|IF}}
                        typ = ISFLOAT + b
                    {{Cl|ELSE}}
                        {{Text|<nowiki>'integer</nowiki>|#919191}}
                        {{Text|<nowiki>'***THIS IS THE IDEAL MARKUP FOR A 64-BIT SYSTEM***</nowiki>|#919191}}
                        {{Text|<nowiki>'In reality 32-bit C++ only marks-up to 32-bit integers</nowiki>|#919191}}
                        b = oldtyp {{Cl|AND}} {{Text|511|#F580B1}}: b2 = newtyp {{Cl|AND}} {{Text|511|#F580B1}}: {{Cl|IF}} b2 > b {{Cl|THEN}} b = b2
                        typ = {{Text|64&|#F580B1}}
                        {{Cl|IF}} b = {{Text|64|#F580B1}} {{Cl|THEN}}
                            {{Cl|IF}} (oldtyp {{Cl|AND (boolean)|AND}} ISUNSIGNED) <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} (newtyp {{Cl|AND (boolean)|AND}} ISUNSIGNED) <> {{Text|0|#F580B1}} {{Cl|THEN}} typ = {{Text|64&|#F580B1}} + ISUNSIGNED
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} result = {{Text|1|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISFLOAT) <> {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} (typ {{Cl|AND (boolean)|AND}} ISSTRING) <> {{Text|0|#F580B1}} {{Cl|THEN}} typ = {{Text|64|#F580B1}} {{Text|<nowiki>'otherwise keep markuped integer type</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} result = {{Text|2|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISFLOAT) = {{Text|0|#F580B1}} {{Cl|THEN}} typ = ISFLOAT + {{Text|256|#F580B1}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} result = {{Text|4|#F580B1}} {{Cl|THEN}}
                    typ = ISSTRING
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} result = {{Text|8|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'bool</nowiki>|#919191}}
                    typ = {{Text|32|#F580B1}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'Offset protection: Force result to be an offset type with correct signage</nowiki>|#919191}}
                {{Cl|IF}} offsetmode {{Cl|THEN}}
                    {{Cl|IF}} result <> {{Text|8|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'boolean comparison results are allowed</nowiki>|#919191}}
                        typ = OFFSETTYPE - ISPOINTER: {{Cl|IF}} offsetmode = {{Text|2|#F580B1}} {{Cl|THEN}} typ = typ + ISUNSIGNED
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'override typ=ISFLOAT+256 to typ=ISFLOAT+64 for ^ operator's result</nowiki>|#919191}}
                {{Cl|IF}} u = {{Text|2|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} i$ = {{Text|<nowiki>"pow2"</nowiki>|#FFB100}} {{Cl|THEN}}
                        {{Cl|IF}} offsetmode {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Operator '^' cannot be used with an _OFFSET"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                        {{Text|<nowiki>'QB-like conversion of math functions returning floating point values</nowiki>|#919191}}
                        {{Text|<nowiki>'reassess oldtype & newtype</nowiki>|#919191}}
                        b = oldtyp {{Cl|AND}} {{Text|511|#F580B1}}
                        {{Cl|IF}} oldtyp {{Cl|AND (boolean)|AND}} ISFLOAT {{Cl|THEN}}
                            {{Text|<nowiki>'no change to b</nowiki>|#919191}}
                        {{Cl|ELSE}}
                            {{Cl|IF}} b > {{Text|16|#F580B1}} {{Cl|THEN}} b = {{Text|64|#F580B1}} {{Text|<nowiki>'larger than INTEGER? return DOUBLE</nowiki>|#919191}}
                            {{Cl|IF}} b > {{Text|32|#F580B1}} {{Cl|THEN}} b = {{Text|256|#F580B1}} {{Text|<nowiki>'larger than LONG? return FLOAT</nowiki>|#919191}}
                            {{Cl|IF}} b <= {{Text|16|#F580B1}} {{Cl|THEN}} b = {{Text|32|#F580B1}}
                        {{Cl|END}} {{Cl|IF}}
                        b2 = newtyp {{Cl|AND}} {{Text|511|#F580B1}}
                        {{Cl|IF}} newtyp {{Cl|AND (boolean)|AND}} ISFLOAT {{Cl|THEN}}
                            {{Cl|IF}} b2 > b {{Cl|THEN}} b = b2
                        {{Cl|ELSE}}
                            b3 = {{Text|32|#F580B1}}
                            {{Cl|IF}} b2 > {{Text|16|#F580B1}} {{Cl|THEN}} b3 = {{Text|64|#F580B1}} {{Text|<nowiki>'larger than INTEGER? return DOUBLE</nowiki>|#919191}}
                            {{Cl|IF}} b2 > {{Text|32|#F580B1}} {{Cl|THEN}} b3 = {{Text|256|#F580B1}} {{Text|<nowiki>'larger than LONG? return FLOAT</nowiki>|#919191}}
                            {{Cl|IF}} b3 > b {{Cl|THEN}} b = b3
                        {{Cl|END}} {{Cl|IF}}
                        typ = ISFLOAT + b
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'pow2</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'u=2</nowiki>|#919191}}
                {{Text|<nowiki>'STEP 3: apply operator appropriately</nowiki>|#919191}}
                {{Cl|IF}} u = {{Text|5|#F580B1}} {{Cl|THEN}}
                    block(i + {{Text|1|#F580B1}}) = i$ + {{Text|<nowiki>"("</nowiki>|#FFB100}} + block(i + {{Text|1|#F580B1}}) + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                    block(i) = {{Text|<nowiki>""</nowiki>|#FFB100}}: i = i + {{Text|1|#F580B1}}: {{Cl|GOTO}} operatorapplied
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'binary operators</nowiki>|#919191}}
                {{Cl|IF}} u = {{Text|1|#F580B1}} {{Cl|THEN}}
                    block(i + {{Text|1|#F580B1}}) = block(i - {{Text|1|#F580B1}}) + i$ + block(i + {{Text|1|#F580B1}})
                    block(i - {{Text|1|#F580B1}}) = {{Text|<nowiki>""</nowiki>|#FFB100}}: block(i) = {{Text|<nowiki>""</nowiki>|#FFB100}}: i = i + {{Text|1|#F580B1}}: {{Cl|GOTO}} operatorapplied
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} u = {{Text|2|#F580B1}} {{Cl|THEN}}
                    block(i + {{Text|1|#F580B1}}) = i$ + {{Text|<nowiki>"("</nowiki>|#FFB100}} + block(i - {{Text|1|#F580B1}}) + {{Text|<nowiki>","</nowiki>|#FFB100}} + block(i + {{Text|1|#F580B1}}) + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                    block(i - {{Text|1|#F580B1}}) = {{Text|<nowiki>""</nowiki>|#FFB100}}: block(i) = {{Text|<nowiki>""</nowiki>|#FFB100}}: i = i + {{Text|1|#F580B1}}: {{Cl|GOTO}} operatorapplied
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} u = {{Text|3|#F580B1}} {{Cl|THEN}}
                    block(i + {{Text|1|#F580B1}}) = {{Text|<nowiki>"-("</nowiki>|#FFB100}} + block(i - {{Text|1|#F580B1}}) + i$ + block(i + {{Text|1|#F580B1}}) + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                    block(i - {{Text|1|#F580B1}}) = {{Text|<nowiki>""</nowiki>|#FFB100}}: block(i) = {{Text|<nowiki>""</nowiki>|#FFB100}}: i = i + {{Text|1|#F580B1}}: {{Cl|GOTO}} operatorapplied
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} u = {{Text|4|#F580B1}} {{Cl|THEN}}
                    block(i + {{Text|1|#F580B1}}) = {{Text|<nowiki>"~"</nowiki>|#FFB100}} + block(i - {{Text|1|#F580B1}}) + i$ + block(i + {{Text|1|#F580B1}})
                    block(i - {{Text|1|#F580B1}}) = {{Text|<nowiki>""</nowiki>|#FFB100}}: block(i) = {{Text|<nowiki>""</nowiki>|#FFB100}}: i = i + {{Text|1|#F580B1}}: {{Cl|GOTO}} operatorapplied
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'...more?...</nowiki>|#919191}}
                {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"ERROR: Operator could not be applied correctly!"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}} {{Text|<nowiki>'<--should never happen!</nowiki>|#919191}}
                operatorapplied:
                {{Cl|IF}} offsetcvi {{Cl|THEN}} block(i) = {{Text|<nowiki>"qbr("</nowiki>|#FFB100}} + block(i) + {{Text|<nowiki>")"</nowiki>|#FFB100}}: offsetcvi = {{Text|0|#F580B1}}
                offsetmode = {{Text|0|#F580B1}}
            {{Cl|ELSE}}
                nonop = nonop + {{Text|1|#F580B1}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|ELSE}}
            nonop = nonop + {{Text|1|#F580B1}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} nonop > {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected operator in equation"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|NEXT}}
    {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>""</nowiki>|#FFB100}}
    {{Text|<nowiki>'join blocks</nowiki>|#919191}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} blockn
        r$ = r$ + block(i)
    {{Cl|NEXT}}
    {{Cl|IF}} Debug {{Cl|THEN}}
        {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"evaluated:"</nowiki>|#FFB100}} + r$ + {{Text|<nowiki>" AS TYPE:"</nowiki>|#FFB100}};
        {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"[ISSTRING]"</nowiki>|#FFB100}};
        {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"[ISFLOAT]"</nowiki>|#FFB100}};
        {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISUNSIGNED) {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"[ISUNSIGNED]"</nowiki>|#FFB100}};
        {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISPOINTER) {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"[ISPOINTER]"</nowiki>|#FFB100}};
        {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"[ISFIXEDLENGTH]"</nowiki>|#FFB100}};
        {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISINCONVENTIONALMEMORY) {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"[ISINCONVENTIONALMEMORY]"</nowiki>|#FFB100}};
        {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"(size in bits="</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(typ {{Cl|AND}} {{Text|511|#F580B1}}) + {{Text|<nowiki>")"</nowiki>|#FFB100}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|evaluate$|#55FF55}} = r$
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|evaluatefunc$|#55FF55}} (a2$, args {{Cl|AS}} {{Cl|LONG}}, typ {{Cl|AS}} {{Cl|LONG}})
    a$ = a2$
    {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"evaluatingfunction:"</nowiki>|#FFB100}} + {{Cl|RTRIM$}}(id.n) + {{Text|<nowiki>":"</nowiki>|#FFB100}} + a$
    {{Cl|DIM}} id2 {{Cl|AS}} idstruct
    id2 = id
    n$ = {{Cl|RTRIM$}}(id2.n)
    typ = id2.ret
    targetid = currentid
    {{Cl|IF}} {{Cl|RTRIM$}}(id2.callname) = {{Text|<nowiki>"func_stub"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Command not implemented"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} {{Cl|RTRIM$}}(id2.callname) = {{Text|<nowiki>"func_input"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} args = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} inputfunctioncalled = {{Text|0|#F580B1}} {{Cl|THEN}}
        inputfunctioncalled = {{Text|-1|#F580B1}}
        {{Cl|IF}} vWatchOn = {{Text|1|#F580B1}} {{Cl|THEN}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*__LONG_VWATCH_LINENUMBER= -4; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|SetDependency|#55FF55}} id2.Dependency
    argCount = {{Text|countFunctionElements|#55FF55}}(a$)
    {{Cl|REDIM}} providedArgs(argCount)
    passomit = {{Text|0|#F580B1}}
    hasOptionalFirstArg = {{Text|0|#F580B1}}
    firstOptionalArgument = {{Text|0|#F580B1}}
    f$ = {{Cl|RTRIM$}}(id2.specialformat)
    {{Cl|IF}} {{Cl|LEN}}(f$) {{Cl|THEN}} {{Text|<nowiki>'special format given</nowiki>|#919191}}
        {{Cl|FOR}} fi = {{Text|1|#F580B1}} {{Cl|TO}} argCount
            providedArgs(fi) = {{Text|hasFunctionElement|#55FF55}}(a$, fi)
        {{Cl|NEXT}}
        {{Text|<nowiki>' Special case for the INSTR and _INSTRREV format, which have an optional argument at the beginning</nowiki>|#919191}}
        {{Cl|IF}} f$ = {{Text|<nowiki>"[?],?,?"</nowiki>|#FFB100}} {{Cl|THEN}}
            hasOptionalFirstArg = {{Text|-1|#F580B1}}
            {{Cl|IF}} {{Cl|UBOUND}}(providedArgs) = {{Text|2|#F580B1}} {{Cl|THEN}}
                {{Cl|REDIM}} {{Cl|_PRESERVE}} providedArgs({{Text|3|#F580B1}})
                providedArgs({{Text|3|#F580B1}}) = providedArgs({{Text|2|#F580B1}})
                providedArgs({{Text|2|#F580B1}}) = providedArgs({{Text|1|#F580B1}})
                providedArgs({{Text|1|#F580B1}}) = {{Text|0|#F580B1}} {{Text|<nowiki>' The first argument was not provided</nowiki>|#919191}}
                skipFirstArg = {{Text|-1|#F580B1}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} {{Cl|NOT}} {{Text|isValidArgSet|#55FF55}}(id2.specialformat, providedArgs(), firstOptionalArgument) {{Cl|THEN}}
            {{Cl|IF}} {{Cl|LEN}}(id2.hr_syntax) > {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Incorrect number of arguments - Reference: "</nowiki>|#FFB100}} + id2.hr_syntax
            {{Cl|ELSE}}
                {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Incorrect number of arguments passed to function"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
        passomit = {{Text|1|#F580B1}} {{Text|<nowiki>'pass omit flags param to function</nowiki>|#919191}}
    {{Cl|ELSE}} {{Text|<nowiki>'no special format given</nowiki>|#919191}}
        {{Cl|FOR}} fi = {{Text|1|#F580B1}} {{Cl|TO}} argCount
            providedArgs(fi) = {{Text|-1|#F580B1}}
        {{Cl|NEXT}}
        {{Cl|IF}} n$ = {{Text|<nowiki>"ASC"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} args = {{Text|2|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} skipargnumchk
        {{Cl|IF}} id2.overloaded = {{Text|-1|#F580B1}} {{Cl|AND (boolean)|AND}} (args >= id2.minargs {{Cl|AND (boolean)|AND}} args <= id2.args) {{Cl|THEN}} {{Cl|GOTO}} skipargnumchk
        {{Cl|IF}} id2.args <> args {{Cl|THEN}}
            {{Cl|IF}} {{Cl|LEN}}(id2.hr_syntax) > {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Incorrect number of arguments - Reference: "</nowiki>|#FFB100}} + id2.hr_syntax
            {{Cl|ELSE}}
                {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Incorrect number of arguments passed to function"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    skipargnumchk:
    r$ = {{Cl|RTRIM$}}(id2.callname) + {{Text|<nowiki>"("</nowiki>|#FFB100}}
    {{Cl|IF}} id2.args <> {{Text|0|#F580B1}} {{Cl|THEN}}
        curarg = {{Text|1|#F580B1}}
        firsti = {{Text|1|#F580B1}}
        {{Text|<nowiki>' The first optional argument is missing and not included in the</nowiki>|#919191}}
        {{Text|<nowiki>' argument list</nowiki>|#919191}}
        {{Cl|IF}} skipFirstArg {{Cl|THEN}}
            r$ = r$ + {{Text|<nowiki>"NULL,"</nowiki>|#FFB100}}
            curarg = {{Text|2|#F580B1}}
        {{Cl|END}} {{Cl|IF}}
        n = {{Text|numelements|#55FF55}}(a$)
        {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} n
            l$ = {{Text|getelement|#55FF55}}(a$, i)
            {{Cl|IF}} l$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} b = b + {{Text|1|#F580B1}}
            {{Cl|IF}} l$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} b = b - {{Text|1|#F580B1}}
            {{Cl|IF}} (l$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} b = {{Text|0|#F580B1}}) {{Cl|OR (boolean)|OR}} (i = n) {{Cl|THEN}}
                {{Cl|IF}} {{Cl|NOT}} providedArgs(curarg) {{Cl|THEN}}
                    {{Cl|IF}} i = n {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Last function argument cannot be empty"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    r$ = r$ + {{Text|<nowiki>"NULL,"</nowiki>|#FFB100}}
                    firsti = i + {{Text|1|#F580B1}}
                    curarg = curarg + {{Text|1|#F580B1}}
                    {{Cl|_CONTINUE}}
                {{Cl|END}} {{Cl|IF}}
                targettyp = {{Cl|CVL}}({{Cl|MID$ (function)|MID$}}(id2.arg, curarg * {{Text|4|#F580B1}} - {{Text|4|#F580B1}} + {{Text|1|#F580B1}}, {{Text|4|#F580B1}}))
                nele = {{Cl|ASC (function)|ASC}}({{Cl|MID$ (function)|MID$}}(id2.nele, curarg, {{Text|1|#F580B1}}))
                nelereq = {{Cl|ASC (function)|ASC}}({{Cl|MID$ (function)|MID$}}(id2.nelereq, curarg, {{Text|1|#F580B1}}))
                {{Cl|IF}} i = n {{Cl|THEN}}
                    e$ = {{Text|getelements$|#55FF55}}(a$, firsti, i)
                {{Cl|ELSE}}
                    e$ = {{Text|getelements$|#55FF55}}(a$, firsti, i - {{Text|1|#F580B1}})
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} {{Cl|LEFT$}}(e$, {{Text|2|#F580B1}}) = {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp {{Cl|THEN}} dereference = {{Text|1|#F580B1}} {{Cl|ELSE}} dereference = {{Text|0|#F580B1}}
                {{Text|<nowiki>'*special case CVI,CVL,CVS,CVD,_CV (part #1)</nowiki>|#919191}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"_CV"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (n$ = {{Text|<nowiki>"CV"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}}
                    {{Cl|IF}} curarg = {{Text|1|#F580B1}} {{Cl|THEN}}
                        cvtype$ = {{Text|type2symbol$|#55FF55}}(e$)
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                        e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                        {{Cl|GOTO}} dontevaluate
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'*special case MKI,MKL,MKS,MKD,_MK (part #1)</nowiki>|#919191}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"_MK"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (n$ = {{Text|<nowiki>"MK"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}}
                    {{Cl|IF}} {{Cl|RTRIM$}}(id2.musthave) = {{Text|<nowiki>"$"</nowiki>|#FFB100}} {{Cl|THEN}}
                        {{Cl|IF}} curarg = {{Text|1|#F580B1}} {{Cl|THEN}}
                            mktype$ = {{Text|type2symbol$|#55FF55}}(e$)
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                            {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"_MK:["</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"]:["</nowiki>|#FFB100}} + mktype$ + {{Text|<nowiki>"]"</nowiki>|#FFB100}}
                            e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                            {{Cl|GOTO}} dontevaluate
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"UBOUND"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} n$ = {{Text|<nowiki>"LBOUND"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} curarg = {{Text|1|#F580B1}} {{Cl|THEN}}
                        {{Text|<nowiki>'perform a "fake" evaluation of the array</nowiki>|#919191}}
                        e$ = e$ + sp + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                        e$ = {{Text|evaluate|#55FF55}}(e$, sourcetyp)
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected array-name"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISARRAY) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected array-name"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                        {{Text|<nowiki>'make a note of the array's index for later</nowiki>|#919191}}
                        ulboundarray$ = e$
                        ulboundarraytyp = sourcetyp
                        e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                        r$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                        {{Cl|GOTO}} dontevaluate
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'*special case: INPUT$ function</nowiki>|#919191}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"INPUT"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} {{Cl|RTRIM$}}(id2.musthave) = {{Text|<nowiki>"$"</nowiki>|#FFB100}} {{Cl|THEN}}
                        {{Cl|IF}} curarg = {{Text|2|#F580B1}} {{Cl|THEN}}
                            {{Cl|IF}} {{Cl|LEFT$}}(e$, {{Text|2|#F580B1}}) = {{Text|<nowiki>"#"</nowiki>|#FFB100}} + sp {{Cl|THEN}} e$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - {{Text|2|#F580B1}})
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'*special case*</nowiki>|#919191}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"ASC"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} curarg = {{Text|2|#F580B1}} {{Cl|THEN}}
                        e$ = {{Text|evaluatetotyp$|#55FF55}}(e$, {{Text|32&|#F580B1}})
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                        typ& = LONGTYPE - ISPOINTER
                        r$ = r$ + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                        {{Cl|GOTO}} evalfuncspecial
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'WriteBufLine MainTxtBuf, "n$="; n$</nowiki>|#919191}}
                {{Text|<nowiki>'WriteBufLine MainTxtBuf, "curarg="; curarg</nowiki>|#919191}}
                {{Text|<nowiki>'WriteBufLine MainTxtBuf, "e$="; e$</nowiki>|#919191}}
                {{Text|<nowiki>'WriteBufLine MainTxtBuf, "r$="; r$</nowiki>|#919191}}
                {{Text|<nowiki>'*special case*</nowiki>|#919191}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"_MEMGET"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (n$ = {{Text|<nowiki>"MEMGET"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}}
                    {{Cl|IF}} curarg = {{Text|1|#F580B1}} {{Cl|THEN}}
                        memget_blk$ = e$
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} curarg = {{Text|2|#F580B1}} {{Cl|THEN}}
                        memget_offs$ = e$
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} curarg = {{Text|3|#F580B1}} {{Cl|THEN}}
                        e$ = {{Cl|UCASE$}}(e$)
                        {{Cl|IF}} {{Cl|INSTR}}(e$, sp + {{Text|<nowiki>"*"</nowiki>|#FFB100}} + sp) {{Cl|THEN}} {{Text|<nowiki>'multiplier will have an appended %,& or && symbol</nowiki>|#919191}}
                            {{Cl|IF}} {{Cl|RIGHT$}}(e$, {{Text|2|#F580B1}}) = {{Text|<nowiki>"&&"</nowiki>|#FFB100}} {{Cl|THEN}}
                                e$ = {{Cl|LEFT$}}(e$, {{Cl|LEN}}(e$) - {{Text|2|#F580B1}})
                            {{Cl|ELSE}}
                                {{Cl|IF}} {{Cl|RIGHT$}}(e$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"&"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} {{Cl|RIGHT$}}(e$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"%"</nowiki>|#FFB100}} {{Cl|THEN}} e$ = {{Cl|LEFT$}}(e$, {{Cl|LEN}}(e$) - {{Text|1|#F580B1}})
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                        t = {{Text|typname2typ|#55FF55}}(e$)
                        {{Cl|IF}} t = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid TYPE name"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                        {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISOFFSETINBITS {{Cl|THEN}} {{Text|Give_Error|#55FF55}} qb64prefix$ + {{Text|<nowiki>"BIT TYPE unsupported"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                        memget_size = typname2typsize
                        {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                            {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected STRING * ..."</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                            memget_ctyp$ = {{Text|<nowiki>"qbs*"</nowiki>|#FFB100}}
                        {{Cl|ELSE}}
                            {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
                                memget_size = udtxsize(t {{Cl|AND}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}}
                                memget_ctyp$ = {{Text|<nowiki>"void*"</nowiki>|#FFB100}}
                            {{Cl|ELSE}}
                                memget_size = (t {{Cl|AND}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}}
                                memget_ctyp$ = {{Text|typ2ctyp$|#55FF55}}(t, {{Text|<nowiki>""</nowiki>|#FFB100}})
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Text|<nowiki>'assume checking off</nowiki>|#919191}}
                        offs$ = {{Text|evaluatetotyp|#55FF55}}(memget_offs$, OFFSETTYPE - ISPOINTER)
                        blkoffs$ = {{Text|evaluatetotyp|#55FF55}}(memget_blk$, {{Text|-6|#F580B1}})
                        {{Cl|IF}} NoChecks = {{Text|0|#F580B1}} {{Cl|THEN}}
                            {{Text|<nowiki>'change offs$ to be the return of the safe version</nowiki>|#919191}}
                            offs$ = {{Text|<nowiki>"func__memget((mem_block*)"</nowiki>|#FFB100}} + blkoffs$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + offs$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(memget_size) + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                            r$ = {{Text|<nowiki>"qbs_new_txt_len((char*)"</nowiki>|#FFB100}} + offs$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(memget_size) + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                        {{Cl|ELSE}}
                            {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
                                r$ = {{Text|<nowiki>"((void*)+"</nowiki>|#FFB100}} + offs$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                                t = ISUDT + ISPOINTER + (t {{Cl|AND}} {{Text|511|#F580B1}})
                            {{Cl|ELSE}}
                                r$ = {{Text|<nowiki>"*("</nowiki>|#FFB100}} + memget_ctyp$ + {{Text|<nowiki>"*)("</nowiki>|#FFB100}} + offs$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                                {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISPOINTER {{Cl|THEN}} t = t - ISPOINTER
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                        typ& = t
                        {{Cl|GOTO}} evalfuncspecial
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'------------------------------------------------------------------------------------------------------------</nowiki>|#919191}}
                e2$ = e$
                e$ = {{Text|evaluate|#55FF55}}(e$, sourcetyp)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Text|<nowiki>'------------------------------------------------------------------------------------------------------------</nowiki>|#919191}}
                {{Text|<nowiki>' a740g: ROR & ROL support</nowiki>|#919191}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"_ROR"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (n$ = {{Text|<nowiki>"ROR"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|OR (boolean)|OR}} n$ = {{Text|<nowiki>"_ROL"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (n$ = {{Text|<nowiki>"ROL"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}}
                    rotlr_n$ = {{Cl|LCASE$}}({{Cl|RIGHT$}}(n$, {{Text|3|#F580B1}})) {{Text|<nowiki>' Get the last 3 characters and convert to lower case. We'll need this to construct the C call</nowiki>|#919191}}
                    {{Cl|IF}} curarg = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>' First paramater</nowiki>|#919191}}
                        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|OR (boolean)|OR}} (sourcetyp {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|OR (boolean)|OR}} (sourcetyp {{Cl|AND (boolean)|AND}} ISOFFSET) {{Cl|OR (boolean)|OR}} (sourcetyp {{Cl|AND (boolean)|AND}} ISUDT) {{Cl|THEN}} {{Text|<nowiki>' Bad parameters types</nowiki>|#919191}}
                            {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected non-floating-point value"</nowiki>|#FFB100}}
                            {{Cl|EXIT}} {{Cl|FUNCTION}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE {{Cl|THEN}} e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}}) {{Text|<nowiki>' This gets the C-style dereferencing syntax for an identifier (I think XD)</nowiki>|#919191}}
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                        {{Text|<nowiki>' Establish which function (if any!) should be used</nowiki>|#919191}}
                        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|8|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>' sourcetyp is the type of data (bits can be examined to get more details)</nowiki>|#919191}}
                            e$ = {{Text|<nowiki>"func__"</nowiki>|#FFB100}} + rotlr_n$ + {{Text|<nowiki>"8("</nowiki>|#FFB100}} + e$
                            typ& = UBYTETYPE - ISPOINTER {{Text|<nowiki>' We force the return type here. This is passed back up to the caller</nowiki>|#919191}}
                        {{Cl|ELSEIF}} (sourcetyp {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|16|#F580B1}} {{Cl|THEN}}
                            e$ = {{Text|<nowiki>"func__"</nowiki>|#FFB100}} + rotlr_n$ + {{Text|<nowiki>"16("</nowiki>|#FFB100}} + e$
                            typ& = UINTEGERTYPE - ISPOINTER
                        {{Cl|ELSEIF}} (sourcetyp {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|32|#F580B1}} {{Cl|THEN}}
                            e$ = {{Text|<nowiki>"func__"</nowiki>|#FFB100}} + rotlr_n$ + {{Text|<nowiki>"32("</nowiki>|#FFB100}} + e$
                            typ& = ULONGTYPE - ISPOINTER
                        {{Cl|ELSEIF}} (sourcetyp {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|64|#F580B1}} {{Cl|THEN}}
                            e$ = {{Text|<nowiki>"func__"</nowiki>|#FFB100}} + rotlr_n$ + {{Text|<nowiki>"64("</nowiki>|#FFB100}} + e$
                            typ& = UINTEGER64TYPE - ISPOINTER
                        {{Cl|ELSE}}
                            {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Unknown data size"</nowiki>|#FFB100}}
                            {{Cl|EXIT}} {{Cl|FUNCTION}}
                        {{Cl|END}} {{Cl|IF}}
                        r$ = e$ {{Text|<nowiki>' Save whatever syntax he have so far</nowiki>|#919191}}
                        e$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Text|<nowiki>' This must be cleared so that it is not repeated when we get to parameter 2</nowiki>|#919191}}
                        {{Cl|GOTO}} dontevaluate {{Text|<nowiki>' Don't evaluate until we get the second parameter</nowiki>|#919191}}
                    {{Cl|ELSEIF}} curarg = {{Text|2|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>' Second parameter</nowiki>|#919191}}
                        {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE {{Cl|THEN}} e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                        r$ = r$ + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                        {{Cl|GOTO}} evalfuncspecial {{Text|<nowiki>' Evaluate now that we have everything</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'***special case***</nowiki>|#919191}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"_MEM"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (n$ = {{Text|<nowiki>"MEM"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}}
                    {{Cl|IF}} curarg = {{Text|1|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} args = {{Text|1|#F580B1}} {{Cl|THEN}}
                            targettyp = {{Text|-7|#F580B1}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} args = {{Text|2|#F580B1}} {{Cl|THEN}}
                            r$ = {{Cl|RTRIM$}}(id2.callname) + {{Text|<nowiki>"_at_offset"</nowiki>|#FFB100}} + {{Cl|RIGHT$}}(r$, {{Cl|LEN}}(r$) - {{Cl|LEN}}({{Cl|RTRIM$}}(id2.callname)))
                            {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISOFFSET) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected _MEM(_OFFSET-value,...)"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'*special case*</nowiki>|#919191}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"_OFFSET"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (n$ = {{Text|<nowiki>"OFFSET"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Text|Give_Error|#55FF55}} qb64prefix$ + {{Text|<nowiki>"OFFSET expects the name of a variable/array"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISARRAY) {{Cl|THEN}}
                        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} qb64prefix$ + {{Text|<nowiki>"OFFSET cannot reference _BIT type arrays"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|END}} {{Cl|IF}}
                    r$ = {{Text|<nowiki>"((uptrszint)("</nowiki>|#FFB100}} + {{Text|evaluatetotyp$|#55FF55}}(e2$, {{Text|-6|#F580B1}}) + {{Text|<nowiki>"))"</nowiki>|#FFB100}}
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    typ& = UOFFSETTYPE - ISPOINTER
                    {{Cl|GOTO}} evalfuncspecial
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'_OFFSET</nowiki>|#919191}}
                {{Text|<nowiki>'*_OFFSET exceptions*</nowiki>|#919191}}
                {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISOFFSET {{Cl|THEN}}
                    {{Cl|IF}} n$ = {{Text|<nowiki>"MKSMBF"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} {{Cl|RTRIM$}}(id2.musthave) = {{Text|<nowiki>"$"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot convert _OFFSET type to other types"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|IF}} n$ = {{Text|<nowiki>"MKDMBF"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} {{Cl|RTRIM$}}(id2.musthave) = {{Text|<nowiki>"$"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot convert _OFFSET type to other types"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'*special case*</nowiki>|#919191}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"ENVIRON"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                        {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE {{Cl|THEN}} e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                        {{Cl|GOTO}} dontevaluate
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'*special case*</nowiki>|#919191}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"LEN"</nowiki>|#FFB100}} {{Cl|THEN}}
                    typ& = LONGTYPE - ISPOINTER
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Text|<nowiki>'could be a string expression</nowiki>|#919191}}
                        {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                            r$ = {{Text|<nowiki>"((int32)("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")->len)"</nowiki>|#FFB100}}
                            {{Cl|GOTO}} evalfuncspecial
                        {{Cl|END}} {{Cl|IF}}
                        {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"String expression or variable name required in LEN statement"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|END}} {{Cl|IF}}
                    r$ = {{Text|evaluatetotyp$|#55FF55}}(e2$, {{Text|-5|#F580B1}}) {{Text|<nowiki>'use evaluatetotyp to get 'element' size</nowiki>|#919191}}
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|GOTO}} evalfuncspecial
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'*special case*</nowiki>|#919191}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"_BIN"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (n$ = {{Text|<nowiki>"BIN"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}}
                    {{Cl|IF}} {{Cl|RTRIM$}}(id2.musthave) = {{Text|<nowiki>"$"</nowiki>|#FFB100}} {{Cl|THEN}}
                        bits = sourcetyp {{Cl|AND}} {{Text|511|#F580B1}}
                        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected numeric value"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                        wasref = {{Text|0|#F580B1}}
                        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}}): wasref = {{Text|1|#F580B1}}
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                        bits = sourcetyp {{Cl|AND}} {{Text|511|#F580B1}}
                        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) {{Cl|THEN}}
                            e$ = {{Text|<nowiki>"func__bin("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(bits) + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                        {{Cl|ELSE}}
                            {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}}
                                e$ = {{Text|<nowiki>"func__bin_float("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                            {{Cl|ELSE}}
                                {{Cl|IF}} bits = {{Text|64|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} wasref = {{Text|0|#F580B1}} {{Cl|THEN}} bits = {{Text|0|#F580B1}}
                                {{Cl|END}} {{Cl|IF}}
                                e$ = {{Text|<nowiki>"func__bin("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(bits) + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                        typ& = STRINGTYPE - ISPOINTER
                        r$ = e$
                        {{Cl|GOTO}} evalfuncspecial
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'*special case*</nowiki>|#919191}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"OCT"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} {{Cl|RTRIM$}}(id2.musthave) = {{Text|<nowiki>"$"</nowiki>|#FFB100}} {{Cl|THEN}}
                        bits = sourcetyp {{Cl|AND}} {{Text|511|#F580B1}}
                        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected numeric value"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                        wasref = {{Text|0|#F580B1}}
                        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}}): wasref = {{Text|1|#F580B1}}
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                        bits = sourcetyp {{Cl|AND}} {{Text|511|#F580B1}}
                        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) {{Cl|THEN}}
                            e$ = {{Text|<nowiki>"func_oct("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(bits) + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                        {{Cl|ELSE}}
                            {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}}
                                e$ = {{Text|<nowiki>"func_oct_float("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                            {{Cl|ELSE}}
                                {{Cl|IF}} bits = {{Text|64|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} wasref = {{Text|0|#F580B1}} {{Cl|THEN}} bits = {{Text|0|#F580B1}}
                                {{Cl|END}} {{Cl|IF}}
                                e$ = {{Text|<nowiki>"func_oct("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(bits) + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                        typ& = STRINGTYPE - ISPOINTER
                        r$ = e$
                        {{Cl|GOTO}} evalfuncspecial
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'*special case*</nowiki>|#919191}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"HEX"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} {{Cl|RTRIM$}}(id2.musthave) = {{Text|<nowiki>"$"</nowiki>|#FFB100}} {{Cl|THEN}}
                        bits = sourcetyp {{Cl|AND}} {{Text|511|#F580B1}}
                        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected numeric value"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                        wasref = {{Text|0|#F580B1}}
                        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}}): wasref = {{Text|1|#F580B1}}
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                        bits = sourcetyp {{Cl|AND}} {{Text|511|#F580B1}}
                        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) {{Cl|THEN}}
                            chars = (bits + {{Text|3|#F580B1}}) \ {{Text|4|#F580B1}}
                            e$ = {{Text|<nowiki>"func_hex("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(chars) + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                        {{Cl|ELSE}}
                            {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}}
                                e$ = {{Text|<nowiki>"func_hex_float("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                            {{Cl|ELSE}}
                                {{Cl|IF}} bits = {{Text|8|#F580B1}} {{Cl|THEN}} chars = {{Text|2|#F580B1}}
                                {{Cl|IF}} bits = {{Text|16|#F580B1}} {{Cl|THEN}} chars = {{Text|4|#F580B1}}
                                {{Cl|IF}} bits = {{Text|32|#F580B1}} {{Cl|THEN}} chars = {{Text|8|#F580B1}}
                                {{Cl|IF}} bits = {{Text|64|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} wasref = {{Text|1|#F580B1}} {{Cl|THEN}} chars = {{Text|16|#F580B1}} {{Cl|ELSE}} chars = {{Text|0|#F580B1}}
                                {{Cl|END}} {{Cl|IF}}
                                e$ = {{Text|<nowiki>"func_hex("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(chars) + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                        typ& = STRINGTYPE - ISPOINTER
                        r$ = e$
                        {{Cl|GOTO}} evalfuncspecial
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'*special case*</nowiki>|#919191}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"EXP"</nowiki>|#FFB100}} {{Cl|THEN}}
                    bits = sourcetyp {{Cl|AND}} {{Text|511|#F580B1}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected numeric value"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    bits = sourcetyp {{Cl|AND}} {{Text|511|#F580B1}}
                    typ& = SINGLETYPE - ISPOINTER
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}}
                        {{Cl|IF}} bits = {{Text|32|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"func_exp_single("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|ELSE}} e$ = {{Text|<nowiki>"func_exp_float("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: typ& = FLOATTYPE - ISPOINTER
                    {{Cl|ELSE}}
                        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) {{Cl|THEN}}
                            e$ = {{Text|<nowiki>"func_exp_float("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: typ& = FLOATTYPE - ISPOINTER
                        {{Cl|ELSE}}
                            {{Cl|IF}} bits <= {{Text|16|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"func_exp_single("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|ELSE}} e$ = {{Text|<nowiki>"func_exp_float("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: typ& = FLOATTYPE - ISPOINTER
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                    r$ = e$
                    {{Cl|GOTO}} evalfuncspecial
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'*special case*</nowiki>|#919191}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"INT"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected numeric value"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Text|<nowiki>'establish which function (if any!) should be used</nowiki>|#919191}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}} e$ = {{Text|<nowiki>"floor("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|ELSE}} e$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                    r$ = e$
                    typ& = sourcetyp
                    {{Cl|GOTO}} evalfuncspecial
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'*special case*</nowiki>|#919191}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"FIX"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected numeric value"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Text|<nowiki>'establish which function (if any!) should be used</nowiki>|#919191}}
                    bits = sourcetyp {{Cl|AND}} {{Text|511|#F580B1}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}}
                        {{Cl|IF}} bits > {{Text|64|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"func_fix_float("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|ELSE}} e$ = {{Text|<nowiki>"func_fix_double("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                    {{Cl|ELSE}}
                        e$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                    r$ = e$
                    typ& = sourcetyp
                    {{Cl|GOTO}} evalfuncspecial
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'*special case*</nowiki>|#919191}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"_ROUND"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (n$ = {{Text|<nowiki>"ROUND"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected numeric value"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Text|<nowiki>'establish which function (if any!) should be used</nowiki>|#919191}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}}
                        bits = sourcetyp {{Cl|AND}} {{Text|511|#F580B1}}
                        {{Cl|IF}} bits > {{Text|64|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"func_round_float("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|ELSE}} e$ = {{Text|<nowiki>"func_round_double("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                    {{Cl|ELSE}}
                        e$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                    r$ = e$
                    typ& = {{Text|64&|#F580B1}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISOFFSET) {{Cl|THEN}}
                        {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISUNSIGNED {{Cl|THEN}} typ& = UOFFSETTYPE - ISPOINTER {{Cl|ELSE}} typ& = OFFSETTYPE - ISPOINTER
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|GOTO}} evalfuncspecial
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'*special case*</nowiki>|#919191}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"CDBL"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISOFFSET) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot convert _OFFSET type to other types"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected numeric value"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Text|<nowiki>'establish which function (if any!) should be used</nowiki>|#919191}}
                    bits = sourcetyp {{Cl|AND}} {{Text|511|#F580B1}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}}
                        {{Cl|IF}} bits > {{Text|64|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"func_cdbl_float("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                    {{Cl|ELSE}}
                        e$ = {{Text|<nowiki>"((double)("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"))"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                    r$ = e$
                    typ& = DOUBLETYPE - ISPOINTER
                    {{Cl|GOTO}} evalfuncspecial
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'*special case*</nowiki>|#919191}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"CSNG"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISOFFSET) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot convert _OFFSET type to other types"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected numeric value"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Text|<nowiki>'establish which function (if any!) should be used</nowiki>|#919191}}
                    bits = sourcetyp {{Cl|AND}} {{Text|511|#F580B1}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}}
                        {{Cl|IF}} bits = {{Text|64|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"func_csng_double("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                        {{Cl|IF}} bits > {{Text|64|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"func_csng_float("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                    {{Cl|ELSE}}
                        e$ = {{Text|<nowiki>"((double)("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"))"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                    r$ = e$
                    typ& = SINGLETYPE - ISPOINTER
                    {{Cl|GOTO}} evalfuncspecial
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'*special case*</nowiki>|#919191}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"CLNG"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISOFFSET) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot convert _OFFSET type to other types"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected numeric value"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Text|<nowiki>'establish which function (if any!) should be used</nowiki>|#919191}}
                    bits = sourcetyp {{Cl|AND}} {{Text|511|#F580B1}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}}
                        {{Cl|IF}} bits > {{Text|64|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"func_clng_float("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|ELSE}} e$ = {{Text|<nowiki>"func_clng_double("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                    {{Cl|ELSE}} {{Text|<nowiki>'integer</nowiki>|#919191}}
                        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISUNSIGNED) {{Cl|THEN}}
                            {{Cl|IF}} bits = {{Text|32|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"func_clng_ulong("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                            {{Cl|IF}} bits > {{Text|32|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"func_clng_uint64("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                        {{Cl|ELSE}} {{Text|<nowiki>'signed</nowiki>|#919191}}
                            {{Cl|IF}} bits > {{Text|32|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"func_clng_int64("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                    r$ = e$
                    typ& = {{Text|32&|#F580B1}}
                    {{Cl|GOTO}} evalfuncspecial
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'*special case*</nowiki>|#919191}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"CINT"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISOFFSET) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot convert _OFFSET type to other types"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected numeric value"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Text|<nowiki>'establish which function (if any!) should be used</nowiki>|#919191}}
                    bits = sourcetyp {{Cl|AND}} {{Text|511|#F580B1}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}}
                        {{Cl|IF}} bits > {{Text|64|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"func_cint_float("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|ELSE}} e$ = {{Text|<nowiki>"func_cint_double("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                    {{Cl|ELSE}} {{Text|<nowiki>'integer</nowiki>|#919191}}
                        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISUNSIGNED) {{Cl|THEN}}
                            {{Cl|IF}} bits > {{Text|15|#F580B1}} {{Cl|AND (boolean)|AND}} bits <= {{Text|32|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"func_cint_ulong("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                            {{Cl|IF}} bits > {{Text|32|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"func_cint_uint64("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                        {{Cl|ELSE}} {{Text|<nowiki>'signed</nowiki>|#919191}}
                            {{Cl|IF}} bits > {{Text|16|#F580B1}} {{Cl|AND (boolean)|AND}} bits <= {{Text|32|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"func_cint_long("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                            {{Cl|IF}} bits > {{Text|32|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"func_cint_int64("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                    r$ = e$
                    typ& = {{Text|16&|#F580B1}}
                    {{Cl|GOTO}} evalfuncspecial
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'*special case MKI,MKL,MKS,MKD,_MK (part #2)</nowiki>|#919191}}
                mktype = {{Text|0|#F580B1}}
                size = {{Text|0|#F580B1}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"MKI"</nowiki>|#FFB100}} {{Cl|THEN}} mktype = {{Text|1|#F580B1}}: mktype$ = {{Text|<nowiki>"%"</nowiki>|#FFB100}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"MKL"</nowiki>|#FFB100}} {{Cl|THEN}} mktype = {{Text|2|#F580B1}}: mktype$ = {{Text|<nowiki>"&"</nowiki>|#FFB100}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"MKS"</nowiki>|#FFB100}} {{Cl|THEN}} mktype = {{Text|3|#F580B1}}: mktype$ = {{Text|<nowiki>"!"</nowiki>|#FFB100}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"MKD"</nowiki>|#FFB100}} {{Cl|THEN}} mktype = {{Text|4|#F580B1}}: mktype$ = {{Text|<nowiki>"#"</nowiki>|#FFB100}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"_MK"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (n$ = {{Text|<nowiki>"MK"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}} mktype = {{Text|-1|#F580B1}}
                {{Cl|IF}} mktype {{Cl|THEN}}
                    {{Cl|IF}} mktype <> {{Text|-1|#F580B1}} {{Cl|OR (boolean)|OR}} curarg = {{Text|2|#F580B1}} {{Cl|THEN}}
                        {{Text|<nowiki>'IF (sourcetyp AND ISOFFSET) THEN Give_Error "Cannot convert " + qb64prefix$ + "OFFSET type to other types": EXIT FUNCTION</nowiki>|#919191}}
                        {{Text|<nowiki>'both _MK and trad. process the following</nowiki>|#919191}}
                        qtyp& = {{Text|0|#F580B1}}
                        {{Cl|IF}} mktype$ = {{Text|<nowiki>"%%"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"b"</nowiki>|#FFB100}}: qtyp& = BYTETYPE - ISPOINTER
                        {{Cl|IF}} mktype$ = {{Text|<nowiki>"~%%"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"ub"</nowiki>|#FFB100}}: qtyp& = UBYTETYPE - ISPOINTER
                        {{Cl|IF}} mktype$ = {{Text|<nowiki>"%"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"i"</nowiki>|#FFB100}}: qtyp& = INTEGERTYPE - ISPOINTER
                        {{Cl|IF}} mktype$ = {{Text|<nowiki>"~%"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"ui"</nowiki>|#FFB100}}: qtyp& = UINTEGERTYPE - ISPOINTER
                        {{Cl|IF}} mktype$ = {{Text|<nowiki>"&"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"l"</nowiki>|#FFB100}}: qtyp& = LONGTYPE - ISPOINTER
                        {{Cl|IF}} mktype$ = {{Text|<nowiki>"~&"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"ul"</nowiki>|#FFB100}}: qtyp& = ULONGTYPE - ISPOINTER
                        {{Cl|IF}} mktype$ = {{Text|<nowiki>"&&"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"i64"</nowiki>|#FFB100}}: qtyp& = INTEGER64TYPE - ISPOINTER
                        {{Cl|IF}} mktype$ = {{Text|<nowiki>"~&&"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"ui64"</nowiki>|#FFB100}}: qtyp& = UINTEGER64TYPE - ISPOINTER
                        {{Cl|IF}} mktype$ = {{Text|<nowiki>"!"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"s"</nowiki>|#FFB100}}: qtyp& = SINGLETYPE - ISPOINTER
                        {{Cl|IF}} mktype$ = {{Text|<nowiki>"#"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"d"</nowiki>|#FFB100}}: qtyp& = DOUBLETYPE - ISPOINTER
                        {{Cl|IF}} mktype$ = {{Text|<nowiki>"##"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"f"</nowiki>|#FFB100}}: qtyp& = FLOATTYPE - ISPOINTER
                        {{Cl|IF}} mktype$ = {{Text|<nowiki>"%&"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"o"</nowiki>|#FFB100}}: qtyp& = OFFSETTYPE - ISPOINTER
                        {{Cl|IF}} mktype$ = {{Text|<nowiki>"~%&"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"uo"</nowiki>|#FFB100}}: qtyp& = UOFFSETTYPE - ISPOINTER
                        {{Cl|IF}} {{Cl|LEFT$}}(mktype$, {{Text|2|#F580B1}}) = {{Text|<nowiki>"~`"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"ubit"</nowiki>|#FFB100}}: qtyp& = UINTEGER64TYPE - ISPOINTER: size = {{Cl|VAL}}({{Cl|RIGHT$}}(mktype$, {{Cl|LEN}}(mktype$) - {{Text|2|#F580B1}}))
                        {{Cl|IF}} {{Cl|LEFT$}}(mktype$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"`"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"bit"</nowiki>|#FFB100}}: qtyp& = INTEGER64TYPE - ISPOINTER: size = {{Cl|VAL}}({{Cl|RIGHT$}}(mktype$, {{Cl|LEN}}(mktype$) - {{Text|1|#F580B1}}))
                        {{Cl|IF}} qtyp& = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} qb64prefix$ + {{Text|<nowiki>"MK only accepts numeric types"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                        {{Cl|IF}} size {{Cl|THEN}}
                            r$ = ctype$ + {{Text|<nowiki>"2string("</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(size) + {{Text|<nowiki>","</nowiki>|#FFB100}}
                        {{Cl|ELSE}}
                            r$ = ctype$ + {{Text|<nowiki>"2string("</nowiki>|#FFB100}}
                        {{Cl|END}} {{Cl|IF}}
                        nocomma = {{Text|1|#F580B1}}
                        targettyp = qtyp&
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'*special case CVI,CVL,CVS,CVD,_CV (part #2)</nowiki>|#919191}}
                cvtype = {{Text|0|#F580B1}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"CVI"</nowiki>|#FFB100}} {{Cl|THEN}} cvtype = {{Text|1|#F580B1}}: cvtype$ = {{Text|<nowiki>"%"</nowiki>|#FFB100}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"CVL"</nowiki>|#FFB100}} {{Cl|THEN}} cvtype = {{Text|2|#F580B1}}: cvtype$ = {{Text|<nowiki>"&"</nowiki>|#FFB100}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"CVS"</nowiki>|#FFB100}} {{Cl|THEN}} cvtype = {{Text|3|#F580B1}}: cvtype$ = {{Text|<nowiki>"!"</nowiki>|#FFB100}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"CVD"</nowiki>|#FFB100}} {{Cl|THEN}} cvtype = {{Text|4|#F580B1}}: cvtype$ = {{Text|<nowiki>"#"</nowiki>|#FFB100}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"_CV"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (n$ = {{Text|<nowiki>"CV"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}} cvtype = {{Text|-1|#F580B1}}
                {{Cl|IF}} cvtype {{Cl|THEN}}
                    {{Cl|IF}} cvtype <> {{Text|-1|#F580B1}} {{Cl|OR (boolean)|OR}} curarg = {{Text|2|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} n$ + {{Text|<nowiki>" requires a STRING argument"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                        typ& = {{Text|0|#F580B1}}
                        {{Cl|IF}} cvtype$ = {{Text|<nowiki>"%%"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"b"</nowiki>|#FFB100}}: typ& = BYTETYPE - ISPOINTER
                        {{Cl|IF}} cvtype$ = {{Text|<nowiki>"~%%"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"ub"</nowiki>|#FFB100}}: typ& = UBYTETYPE - ISPOINTER
                        {{Cl|IF}} cvtype$ = {{Text|<nowiki>"%"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"i"</nowiki>|#FFB100}}: typ& = INTEGERTYPE - ISPOINTER
                        {{Cl|IF}} cvtype$ = {{Text|<nowiki>"~%"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"ui"</nowiki>|#FFB100}}: typ& = UINTEGERTYPE - ISPOINTER
                        {{Cl|IF}} cvtype$ = {{Text|<nowiki>"&"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"l"</nowiki>|#FFB100}}: typ& = LONGTYPE - ISPOINTER
                        {{Cl|IF}} cvtype$ = {{Text|<nowiki>"~&"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"ul"</nowiki>|#FFB100}}: typ& = ULONGTYPE - ISPOINTER
                        {{Cl|IF}} cvtype$ = {{Text|<nowiki>"&&"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"i64"</nowiki>|#FFB100}}: typ& = INTEGER64TYPE - ISPOINTER
                        {{Cl|IF}} cvtype$ = {{Text|<nowiki>"~&&"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"ui64"</nowiki>|#FFB100}}: typ& = UINTEGER64TYPE - ISPOINTER
                        {{Cl|IF}} cvtype$ = {{Text|<nowiki>"!"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"s"</nowiki>|#FFB100}}: typ& = SINGLETYPE - ISPOINTER
                        {{Cl|IF}} cvtype$ = {{Text|<nowiki>"#"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"d"</nowiki>|#FFB100}}: typ& = DOUBLETYPE - ISPOINTER
                        {{Cl|IF}} cvtype$ = {{Text|<nowiki>"##"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"f"</nowiki>|#FFB100}}: typ& = FLOATTYPE - ISPOINTER
                        {{Cl|IF}} cvtype$ = {{Text|<nowiki>"%&"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"o"</nowiki>|#FFB100}}: typ& = OFFSETTYPE - ISPOINTER
                        {{Cl|IF}} cvtype$ = {{Text|<nowiki>"~%&"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"uo"</nowiki>|#FFB100}}: typ& = UOFFSETTYPE - ISPOINTER
                        {{Cl|IF}} {{Cl|LEFT$}}(cvtype$, {{Text|2|#F580B1}}) = {{Text|<nowiki>"~`"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"ubit"</nowiki>|#FFB100}}: typ& = UINTEGER64TYPE - ISPOINTER: size = {{Cl|VAL}}({{Cl|RIGHT$}}(cvtype$, {{Cl|LEN}}(cvtype$) - {{Text|2|#F580B1}}))
                        {{Cl|IF}} {{Cl|LEFT$}}(cvtype$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"`"</nowiki>|#FFB100}} {{Cl|THEN}} ctype$ = {{Text|<nowiki>"bit"</nowiki>|#FFB100}}: typ& = INTEGER64TYPE - ISPOINTER: size = {{Cl|VAL}}({{Cl|RIGHT$}}(cvtype$, {{Cl|LEN}}(cvtype$) - {{Text|1|#F580B1}}))
                        {{Cl|IF}} typ& = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} qb64prefix$ + {{Text|<nowiki>"CV cannot return STRING type!"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                        {{Cl|IF}} ctype$ = {{Text|<nowiki>"bit"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} ctype$ = {{Text|<nowiki>"ubit"</nowiki>|#FFB100}} {{Cl|THEN}}
                            r$ = {{Text|<nowiki>"string2"</nowiki>|#FFB100}} + ctype$ + {{Text|<nowiki>"("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(size) + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                        {{Cl|ELSE}}
                            r$ = {{Text|<nowiki>"string2"</nowiki>|#FFB100}} + ctype$ + {{Text|<nowiki>"("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|GOTO}} evalfuncspecial
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'*special case</nowiki>|#919191}}
                {{Cl|IF}} {{Cl|RTRIM$}}(id2.n) = {{Text|<nowiki>"STRING"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} curarg = {{Text|2|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}}
                            {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                            sourcetyp = {{Text|64&|#F580B1}}
                            e$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"->chr[0])"</nowiki>|#FFB100}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'*special case</nowiki>|#919191}}
                {{Cl|IF}} {{Cl|RTRIM$}}(id2.n) = {{Text|<nowiki>"SADD"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"SADD only accepts variable-length string variables"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) {{Cl|THEN}}
                        {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"SADD only accepts variable-length string variables"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISINCONVENTIONALMEMORY) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        recompile = {{Text|1|#F580B1}}
                        cmemlist({{Cl|VAL}}(e$)) = {{Text|1|#F580B1}}
                        r$ = {{Text|<nowiki>"[CONVENTIONAL_MEMORY_REQUIRED]"</nowiki>|#FFB100}}
                        typ& = {{Text|64&|#F580B1}}
                        {{Cl|GOTO}} evalfuncspecial
                    {{Cl|END}} {{Cl|IF}}
                    r$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    r$ = {{Text|<nowiki>"((unsigned short)("</nowiki>|#FFB100}} + r$ + {{Text|<nowiki>"->chr-&cmem[1280]))"</nowiki>|#FFB100}}
                    typ& = {{Text|64&|#F580B1}}
                    {{Cl|GOTO}} evalfuncspecial
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'*special case</nowiki>|#919191}}
                {{Cl|IF}} {{Cl|RTRIM$}}(id2.n) = {{Text|<nowiki>"VARPTR"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected reference to a variable/array"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} {{Cl|RTRIM$}}(id2.musthave) = {{Text|<nowiki>"$"</nowiki>|#FFB100}} {{Cl|THEN}}
                        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISINCONVENTIONALMEMORY) = {{Text|0|#F580B1}} {{Cl|THEN}}
                            recompile = {{Text|1|#F580B1}}
                            cmemlist({{Cl|VAL}}(e$)) = {{Text|1|#F580B1}}
                            r$ = {{Text|<nowiki>"[CONVENTIONAL_MEMORY_REQUIRED]"</nowiki>|#FFB100}}
                            typ& = ISSTRING
                            {{Cl|GOTO}} evalfuncspecial
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISARRAY) {{Cl|THEN}}
                            {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"VARPTR$ only accepts variable-length string arrays"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                            {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"VARPTR$ only accepts variable-length string arrays"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Text|<nowiki>'must be a simple variable</nowiki>|#919191}}
                        {{Text|<nowiki>'!assuming it is in cmem in DBLOCK</nowiki>|#919191}}
                        r$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|1|#F580B1}})
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}}
                            {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISARRAY) {{Cl|THEN}} r$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                            r$ = r$ + {{Text|<nowiki>"->cmem_descriptor_offset"</nowiki>|#FFB100}}
                            t = {{Text|3|#F580B1}}
                        {{Cl|ELSE}}
                            r$ = {{Text|<nowiki>"((unsigned short)(((uint8*)"</nowiki>|#FFB100}} + r$ + {{Text|<nowiki>")-&cmem[1280]))"</nowiki>|#FFB100}}
                            {{Text|<nowiki>'*top bit on=unsigned</nowiki>|#919191}}
                            {{Text|<nowiki>'*second top bit on=bit-value (lower bits indicate the size)</nowiki>|#919191}}
                            {{Text|<nowiki>'BYTE=1</nowiki>|#919191}}
                            {{Text|<nowiki>'INTEGER=2</nowiki>|#919191}}
                            {{Text|<nowiki>'STRING=3</nowiki>|#919191}}
                            {{Text|<nowiki>'SINGLE=4</nowiki>|#919191}}
                            {{Text|<nowiki>'INT64=5</nowiki>|#919191}}
                            {{Text|<nowiki>'FLOAT=6</nowiki>|#919191}}
                            {{Text|<nowiki>'DOUBLE=8</nowiki>|#919191}}
                            {{Text|<nowiki>'LONG=20</nowiki>|#919191}}
                            {{Text|<nowiki>'BIT=64+n</nowiki>|#919191}}
                            t = {{Text|0|#F580B1}}
                            {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISUNSIGNED) {{Cl|THEN}} t = t + {{Text|128|#F580B1}}
                            {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) {{Cl|THEN}}
                                t = t + {{Text|64|#F580B1}}
                                t = t + (sourcetyp {{Cl|AND}} {{Text|63|#F580B1}})
                            {{Cl|ELSE}}
                                bits = sourcetyp {{Cl|AND}} {{Text|511|#F580B1}}
                                {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}}
                                    {{Cl|IF}} bits = {{Text|32|#F580B1}} {{Cl|THEN}} t = t + {{Text|4|#F580B1}}
                                    {{Cl|IF}} bits = {{Text|64|#F580B1}} {{Cl|THEN}} t = t + {{Text|8|#F580B1}}
                                    {{Cl|IF}} bits = {{Text|256|#F580B1}} {{Cl|THEN}} t = t + {{Text|6|#F580B1}}
                                {{Cl|ELSE}}
                                    {{Cl|IF}} bits = {{Text|8|#F580B1}} {{Cl|THEN}} t = t + {{Text|1|#F580B1}}
                                    {{Cl|IF}} bits = {{Text|16|#F580B1}} {{Cl|THEN}} t = t + {{Text|2|#F580B1}}
                                    {{Cl|IF}} bits = {{Text|32|#F580B1}} {{Cl|THEN}} t = t + {{Text|20|#F580B1}}
                                    {{Cl|IF}} bits = {{Text|64|#F580B1}} {{Cl|THEN}} t = t + {{Text|5|#F580B1}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                        r$ = {{Text|<nowiki>"func_varptr_helper("</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(t) + {{Text|<nowiki>","</nowiki>|#FFB100}} + r$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                        typ& = ISSTRING
                        {{Cl|GOTO}} evalfuncspecial
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'end of varptr$</nowiki>|#919191}}
                    {{Text|<nowiki>'VARPTR</nowiki>|#919191}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISINCONVENTIONALMEMORY) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        recompile = {{Text|1|#F580B1}}
                        cmemlist({{Cl|VAL}}(e$)) = {{Text|1|#F580B1}}
                        r$ = {{Text|<nowiki>"[CONVENTIONAL_MEMORY_REQUIRED]"</nowiki>|#FFB100}}
                        typ& = {{Text|64&|#F580B1}}
                        {{Cl|GOTO}} evalfuncspecial
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISARRAY) {{Cl|THEN}}
                        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"VARPTR cannot reference _BIT type arrays"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                        {{Text|<nowiki>'string array?</nowiki>|#919191}}
                        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}}
                            {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) {{Cl|THEN}}
                                {{Text|getid|#55FF55}} {{Cl|VAL}}(e$)
                                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                                m = id.tsize
                                index$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - {{Cl|INSTR}}(e$, sp3))
                                typ = {{Text|64&|#F580B1}}
                                r$ = {{Text|<nowiki>"(("</nowiki>|#FFB100}} + index$ + {{Text|<nowiki>")*"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(m) + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                                {{Cl|GOTO}} evalfuncspecial
                            {{Cl|ELSE}}
                                {{Text|<nowiki>'return the offset of the string's descriptor</nowiki>|#919191}}
                                r$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
                                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                                r$ = r$ + {{Text|<nowiki>"->cmem_descriptor_offset"</nowiki>|#FFB100}}
                                typ = {{Text|64&|#F580B1}}
                                {{Cl|GOTO}} evalfuncspecial
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
                            e$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - {{Cl|INSTR}}(e$, sp3)) {{Text|<nowiki>'skip idnumber</nowiki>|#919191}}
                            e$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - {{Cl|INSTR}}(e$, sp3)) {{Text|<nowiki>'skip u</nowiki>|#919191}}
                            o$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - {{Cl|INSTR}}(e$, sp3)) {{Text|<nowiki>'skip e</nowiki>|#919191}}
                            typ = {{Text|64&|#F580B1}}
                            r$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} + o$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                            {{Cl|GOTO}} evalfuncspecial
                        {{Cl|END}} {{Cl|IF}}
                        {{Text|<nowiki>'non-UDT array</nowiki>|#919191}}
                        m = (sourcetyp {{Cl|AND}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}} {{Text|<nowiki>'calculate size multiplier</nowiki>|#919191}}
                        index$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - {{Cl|INSTR}}(e$, sp3))
                        typ = {{Text|64&|#F580B1}}
                        r$ = {{Text|<nowiki>"(("</nowiki>|#FFB100}} + index$ + {{Text|<nowiki>")*"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(m) + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                        {{Cl|GOTO}} evalfuncspecial
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|<nowiki>'not an array</nowiki>|#919191}}
                    {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
                        r$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|1|#F580B1}})
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                        e$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - {{Cl|INSTR}}(e$, sp3)) {{Text|<nowiki>'skip idnumber</nowiki>|#919191}}
                        e$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - {{Cl|INSTR}}(e$, sp3)) {{Text|<nowiki>'skip u</nowiki>|#919191}}
                        o$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - {{Cl|INSTR}}(e$, sp3)) {{Text|<nowiki>'skip e</nowiki>|#919191}}
                        typ = {{Text|64&|#F580B1}}
                        {{Text|<nowiki>'if sub/func arg, may not be in DBLOCK</nowiki>|#919191}}
                        {{Text|getid|#55FF55}} {{Cl|VAL}}(e$)
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                        {{Cl|IF}} id.sfarg {{Cl|THEN}} {{Text|<nowiki>'could be in DBLOCK</nowiki>|#919191}}
                            {{Text|<nowiki>'note: segment could be the closest segment to UDT element or the base of DBLOCK</nowiki>|#919191}}
                            r$ = {{Text|<nowiki>"varptr_dblock_check(((uint8*)"</nowiki>|#FFB100}} + r$ + {{Text|<nowiki>")+("</nowiki>|#FFB100}} + o$ + {{Text|<nowiki>"))"</nowiki>|#FFB100}}
                        {{Cl|ELSE}} {{Text|<nowiki>'definitely in DBLOCK</nowiki>|#919191}}
                            {{Text|<nowiki>'give offset relative to DBLOCK</nowiki>|#919191}}
                            r$ = {{Text|<nowiki>"((unsigned short)(((uint8*)"</nowiki>|#FFB100}} + r$ + {{Text|<nowiki>") - &cmem[1280] + ("</nowiki>|#FFB100}} + o$ + {{Text|<nowiki>") ))"</nowiki>|#FFB100}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|GOTO}} evalfuncspecial
                    {{Cl|END}} {{Cl|IF}}
                    typ = {{Text|64&|#F580B1}}
                    r$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|1|#F580B1}})
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}}
                        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) {{Cl|THEN}}
                            {{Text|<nowiki>'if sub/func arg, may not be in DBLOCK</nowiki>|#919191}}
                            {{Text|getid|#55FF55}} {{Cl|VAL}}(e$)
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                            {{Cl|IF}} id.sfarg {{Cl|THEN}} {{Text|<nowiki>'could be in DBLOCK</nowiki>|#919191}}
                                r$ = {{Text|<nowiki>"varptr_dblock_check("</nowiki>|#FFB100}} + r$ + {{Text|<nowiki>"->chr)"</nowiki>|#FFB100}}
                            {{Cl|ELSE}} {{Text|<nowiki>'definitely in DBLOCK</nowiki>|#919191}}
                                r$ = {{Text|<nowiki>"((unsigned short)("</nowiki>|#FFB100}} + r$ + {{Text|<nowiki>"->chr-&cmem[1280]))"</nowiki>|#FFB100}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|ELSE}}
                            r$ = r$ + {{Text|<nowiki>"->cmem_descriptor_offset"</nowiki>|#FFB100}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|GOTO}} evalfuncspecial
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|<nowiki>'single, simple variable</nowiki>|#919191}}
                    {{Text|<nowiki>'if sub/func arg, may not be in DBLOCK</nowiki>|#919191}}
                    {{Text|getid|#55FF55}} {{Cl|VAL}}(e$)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|IF}} id.sfarg {{Cl|THEN}} {{Text|<nowiki>'could be in DBLOCK</nowiki>|#919191}}
                        r$ = {{Text|<nowiki>"varptr_dblock_check((uint8*)"</nowiki>|#FFB100}} + r$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                    {{Cl|ELSE}} {{Text|<nowiki>'definitely in DBLOCK</nowiki>|#919191}}
                        r$ = {{Text|<nowiki>"((unsigned short)(((uint8*)"</nowiki>|#FFB100}} + r$ + {{Text|<nowiki>")-&cmem[1280]))"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|GOTO}} evalfuncspecial
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'*special case*</nowiki>|#919191}}
                {{Cl|IF}} {{Cl|RTRIM$}}(id2.n) = {{Text|<nowiki>"VARSEG"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected reference to a variable/array"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISINCONVENTIONALMEMORY) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        recompile = {{Text|1|#F580B1}}
                        cmemlist({{Cl|VAL}}(e$)) = {{Text|1|#F580B1}}
                        r$ = {{Text|<nowiki>"[CONVENTIONAL_MEMORY_REQUIRED]"</nowiki>|#FFB100}}
                        typ& = {{Text|64&|#F580B1}}
                        {{Cl|GOTO}} evalfuncspecial
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|<nowiki>'array?</nowiki>|#919191}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISARRAY) {{Cl|THEN}}
                        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Cl|THEN}}
                            {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}}
                                r$ = {{Text|<nowiki>"80"</nowiki>|#FFB100}}
                                typ = {{Text|64&|#F580B1}}
                                {{Cl|GOTO}} evalfuncspecial
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                        typ = {{Text|64&|#F580B1}}
                        r$ = {{Text|<nowiki>"( ( ((ptrszint)("</nowiki>|#FFB100}} + {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|1|#F580B1}}) + {{Text|<nowiki>"[0])) - ((ptrszint)(&cmem[0])) ) /16)"</nowiki>|#FFB100}}
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                        {{Cl|GOTO}} evalfuncspecial
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|<nowiki>'single variable/(var-len)string/udt? (usually stored in DBLOCK)</nowiki>|#919191}}
                    typ = {{Text|64&|#F580B1}}
                    {{Text|<nowiki>'if sub/func arg, may not be in DBLOCK</nowiki>|#919191}}
                    {{Text|getid|#55FF55}} {{Cl|VAL}}(e$)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|IF}} id.sfarg <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
                            r$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|1|#F580B1}})
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                            e$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - {{Cl|INSTR}}(e$, sp3)) {{Text|<nowiki>'skip idnumber</nowiki>|#919191}}
                            e$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - {{Cl|INSTR}}(e$, sp3)) {{Text|<nowiki>'skip u</nowiki>|#919191}}
                            o$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - {{Cl|INSTR}}(e$, sp3)) {{Text|<nowiki>'skip e</nowiki>|#919191}}
                            r$ = {{Text|<nowiki>"varseg_dblock_check(((uint8*)"</nowiki>|#FFB100}} + r$ + {{Text|<nowiki>")+("</nowiki>|#FFB100}} + o$ + {{Text|<nowiki>"))"</nowiki>|#FFB100}}
                        {{Cl|ELSE}}
                            r$ = {{Text|<nowiki>"varseg_dblock_check((uint8*)"</nowiki>|#FFB100}} + {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|1|#F580B1}}) + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|ELSE}}
                        {{Text|<nowiki>'can be assumed to be in DBLOCK</nowiki>|#919191}}
                        r$ = {{Text|<nowiki>"80"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|GOTO}} evalfuncspecial
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'varseg</nowiki>|#919191}}
                {{Text|<nowiki>'note: this code has already been called...</nowiki>|#919191}}
                {{Text|<nowiki>'------------------------------------------------------------------------------------------------------------</nowiki>|#919191}}
                {{Text|<nowiki>'e2$ = e$</nowiki>|#919191}}
                {{Text|<nowiki>'e$ = evaluate(e$, sourcetyp)</nowiki>|#919191}}
                {{Text|<nowiki>'------------------------------------------------------------------------------------------------------------</nowiki>|#919191}}
                {{Text|<nowiki>'note: this comment makes no sense...</nowiki>|#919191}}
                {{Text|<nowiki>'any numeric variable, but it must be type-speficied</nowiki>|#919191}}
                {{Cl|IF}} targettyp = {{Text|-2|#F580B1}} {{Cl|THEN}}
                    e$ = {{Text|evaluatetotyp|#55FF55}}(e2$, {{Text|-2|#F580B1}})
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|GOTO}} dontevaluate
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'-2</nowiki>|#919191}}
                {{Cl|IF}} targettyp = {{Text|-7|#F580B1}} {{Cl|THEN}}
                    e$ = {{Text|evaluatetotyp|#55FF55}}(e2$, {{Text|-7|#F580B1}})
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|GOTO}} dontevaluate
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'-7</nowiki>|#919191}}
                {{Cl|IF}} targettyp = {{Text|-8|#F580B1}} {{Cl|THEN}}
                    e$ = {{Text|evaluatetotyp|#55FF55}}(e2$, {{Text|-8|#F580B1}})
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|GOTO}} dontevaluate
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'-8</nowiki>|#919191}}
                {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISOFFSET {{Cl|THEN}}
                    {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} ISOFFSET) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} id2.internal_subfunc = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot convert _OFFSET type to other types"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'note: this is used for functions like STR(...) which accept all types...</nowiki>|#919191}}
                explicitreference = {{Text|0|#F580B1}}
                {{Cl|IF}} targettyp = {{Text|-1|#F580B1}} {{Cl|THEN}}
                    explicitreference = {{Text|1|#F580B1}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Number required for function"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    targettyp = sourcetyp
                    {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} ISPOINTER) {{Cl|THEN}} targettyp = targettyp - ISPOINTER
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'pointer?</nowiki>|#919191}}
                {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} ISPOINTER) {{Cl|THEN}}
                    {{Cl|IF}} dereference = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'check deferencing wasn't used</nowiki>|#919191}}
                        {{Text|<nowiki>'note: array pointer</nowiki>|#919191}}
                        {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} ISARRAY) {{Cl|THEN}}
                            {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected arrayname()"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                            {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISARRAY) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected arrayname()"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                            {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"evaluatefunc:array reference:["</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"]"</nowiki>|#FFB100}}
                            {{Text|<nowiki>'check arrays are of same type</nowiki>|#919191}}
                            targettyp2 = targettyp: sourcetyp2 = sourcetyp
                            targettyp2 = targettyp2 {{Cl|AND}} ({{Text|511|#F580B1}} + ISOFFSETINBITS + ISUDT + ISSTRING + ISFIXEDLENGTH + ISFLOAT)
                            sourcetyp2 = sourcetyp2 {{Cl|AND}} ({{Text|511|#F580B1}} + ISOFFSETINBITS + ISUDT + ISSTRING + ISFIXEDLENGTH + ISFLOAT)
                            {{Cl|IF}} sourcetyp2 <> targettyp2 {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Incorrect array type passed to function"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                            {{Text|<nowiki>'check arrayname was followed by '()'</nowiki>|#919191}}
                            {{Cl|IF}} targettyp {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
                                {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"evaluatefunc:array reference:udt reference:["</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"]"</nowiki>|#FFB100}}
                                {{Text|<nowiki>'get UDT info</nowiki>|#919191}}
                                udtrefid = {{Cl|VAL}}(e$)
                                {{Text|getid|#55FF55}} udtrefid
                                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                                udtrefi = {{Cl|INSTR}}(e$, sp3) {{Text|<nowiki>'end of id</nowiki>|#919191}}
                                udtrefi2 = {{Cl|INSTR}}(udtrefi + {{Text|1|#F580B1}}, e$, sp3) {{Text|<nowiki>'end of u</nowiki>|#919191}}
                                udtrefu = {{Cl|VAL}}({{Cl|MID$ (function)|MID$}}(e$, udtrefi + {{Text|1|#F580B1}}, udtrefi2 - udtrefi - {{Text|1|#F580B1}}))
                                udtrefi3 = {{Cl|INSTR}}(udtrefi2 + {{Text|1|#F580B1}}, e$, sp3) {{Text|<nowiki>'skip e</nowiki>|#919191}}
                                udtrefe = {{Cl|VAL}}({{Cl|MID$ (function)|MID$}}(e$, udtrefi2 + {{Text|1|#F580B1}}, udtrefi3 - udtrefi2 - {{Text|1|#F580B1}}))
                                o$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - udtrefi3)
                                {{Text|<nowiki>'note: most of the UDT info above is not required</nowiki>|#919191}}
                                {{Cl|IF}} {{Cl|LEFT$}}(o$, {{Text|4|#F580B1}}) <> {{Text|<nowiki>"(0)*"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected arrayname()"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                            {{Cl|ELSE}}
                                {{Cl|IF}} {{Cl|RIGHT$}}(e$, {{Text|2|#F580B1}}) <> sp3 + {{Text|<nowiki>"0"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected arrayname()"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                            {{Cl|END}} {{Cl|IF}}
                            idnum = {{Cl|VAL}}({{Cl|LEFT$}}(e$, {{Cl|INSTR}}(e$, sp3) - {{Text|1|#F580B1}}))
                            {{Text|getid|#55FF55}} idnum
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                            {{Cl|IF}} targettyp {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH {{Cl|THEN}}
                                targettypsize = {{Cl|CVL}}({{Cl|MID$ (function)|MID$}}(id2.argsize, curarg * {{Text|4|#F580B1}} - {{Text|4|#F580B1}} + {{Text|1|#F580B1}}, {{Text|4|#F580B1}}))
                                {{Cl|IF}} id.tsize <> targettypsize {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Incorrect array type passed to function"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                            {{Cl|END}} {{Cl|IF}}
                            {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(sfcmemargs(targetid), curarg, {{Text|1|#F580B1}}) = {{Cl|CHR$}}({{Text|1|#F580B1}}) {{Cl|THEN}} {{Text|<nowiki>'cmem required?</nowiki>|#919191}}
                                {{Cl|IF}} cmemlist(idnum) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    cmemlist(idnum) = {{Text|1|#F580B1}}
                                    recompile = {{Text|1|#F580B1}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                            {{Cl|IF}} id.linkid = {{Text|0|#F580B1}} {{Cl|THEN}}
                                {{Text|<nowiki>'if id.linkid is 0, it means the number of array elements is definietly</nowiki>|#919191}}
                                {{Text|<nowiki>'known of the array being passed, this is not some "fake"/unknown array.</nowiki>|#919191}}
                                {{Text|<nowiki>'using the numer of array elements of a fake array would be dangerous!</nowiki>|#919191}}
                                {{Cl|IF}} nelereq = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Text|<nowiki>'only continue if the number of array elements required is unknown</nowiki>|#919191}}
                                    {{Text|<nowiki>'and it needs to be set</nowiki>|#919191}}
                                    {{Cl|IF}} id.arrayelements <> {{Text|-1|#F580B1}} {{Cl|THEN}}
                                        nelereq = id.arrayelements
                                        {{Cl|MID$}}(id2.nelereq, curarg, {{Text|1|#F580B1}}) = {{Cl|CHR$}}(nelereq)
                                    {{Cl|END}} {{Cl|IF}}
                                    ids(targetid) = id2
                                {{Cl|ELSE}}
                                    {{Text|<nowiki>'the number of array elements required is known AND</nowiki>|#919191}}
                                    {{Text|<nowiki>'the number of elements in the array to be passed is known</nowiki>|#919191}}
                                    {{Text|<nowiki>'REMOVE FOR TESTING PURPOSES ONLY!!! SHOULD BE UNREM'd!</nowiki>|#919191}}
                                    {{Text|<nowiki>'print id.arrayelements,nelereq</nowiki>|#919191}}
                                    {{Text|<nowiki>'            1      ,  2</nowiki>|#919191}}
                                    {{Cl|IF}} id.arrayelements <> nelereq {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Passing arrays with a differing number of elements to a SUB/FUNCTION is not supported"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                            e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|1|#F580B1}})
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                            {{Cl|GOTO}} dontevaluate
                        {{Cl|END}} {{Cl|IF}}
                        {{Text|<nowiki>'note: not an array...</nowiki>|#919191}}
                        {{Text|<nowiki>'target is not an array</nowiki>|#919191}}
                        {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}} {{Cl|THEN}}
                            {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}}
                                idnum = {{Cl|VAL}}({{Cl|LEFT$}}(e$, {{Cl|INSTR}}(e$, sp3) - {{Text|1|#F580B1}})) {{Text|<nowiki>'id# of sourcetyp</nowiki>|#919191}}
                                targettyp2 = targettyp: sourcetyp2 = sourcetyp
                                {{Text|<nowiki>'get info about source/target</nowiki>|#919191}}
                                arr = {{Text|0|#F580B1}}: {{Cl|IF}} (sourcetyp2 {{Cl|AND (boolean)|AND}} ISARRAY) {{Cl|THEN}} arr = {{Text|1|#F580B1}}
                                passudtelement = {{Text|0|#F580B1}}: {{Cl|IF}} (targettyp2 {{Cl|AND (boolean)|AND}} ISUDT) = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} (sourcetyp2 {{Cl|AND (boolean)|AND}} ISUDT) <> {{Text|0|#F580B1}} {{Cl|THEN}} passudtelement = {{Text|1|#F580B1}}: sourcetyp2 = sourcetyp2 - ISUDT
                                {{Text|<nowiki>'remove flags irrelevant for comparison... ISPOINTER,ISREFERENCE,ISINCONVENTIONALMEMORY,ISARRAY</nowiki>|#919191}}
                                targettyp2 = targettyp2 {{Cl|AND}} ({{Text|511|#F580B1}} + ISOFFSETINBITS + ISUDT + ISFLOAT + ISSTRING)
                                sourcetyp2 = sourcetyp2 {{Cl|AND}} ({{Text|511|#F580B1}} + ISOFFSETINBITS + ISUDT + ISFLOAT + ISSTRING)
                                {{Text|<nowiki>'compare types</nowiki>|#919191}}
                                {{Cl|IF}} sourcetyp2 = targettyp2 {{Cl|THEN}}
                                    {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
                                        {{Text|<nowiki>'udt/udt array</nowiki>|#919191}}
                                        {{Text|<nowiki>'get info</nowiki>|#919191}}
                                        udtrefid = {{Cl|VAL}}(e$)
                                        {{Text|getid|#55FF55}} udtrefid
                                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                                        udtrefi = {{Cl|INSTR}}(e$, sp3) {{Text|<nowiki>'end of id</nowiki>|#919191}}
                                        udtrefi2 = {{Cl|INSTR}}(udtrefi + {{Text|1|#F580B1}}, e$, sp3) {{Text|<nowiki>'end of u</nowiki>|#919191}}
                                        udtrefu = {{Cl|VAL}}({{Cl|MID$ (function)|MID$}}(e$, udtrefi + {{Text|1|#F580B1}}, udtrefi2 - udtrefi - {{Text|1|#F580B1}}))
                                        udtrefi3 = {{Cl|INSTR}}(udtrefi2 + {{Text|1|#F580B1}}, e$, sp3) {{Text|<nowiki>'skip e</nowiki>|#919191}}
                                        udtrefe = {{Cl|VAL}}({{Cl|MID$ (function)|MID$}}(e$, udtrefi2 + {{Text|1|#F580B1}}, udtrefi3 - udtrefi2 - {{Text|1|#F580B1}}))
                                        o$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - udtrefi3)
                                        {{Text|<nowiki>'note: most of the UDT info above is not required</nowiki>|#919191}}
                                        {{Cl|IF}} arr {{Cl|THEN}}
                                            n2$ = {{Text|scope$|#55FF55}} + {{Text|<nowiki>"ARRAY_UDT_"</nowiki>|#FFB100}} + {{Cl|RTRIM$}}(id.n) + {{Text|<nowiki>"[0]"</nowiki>|#FFB100}}
                                        {{Cl|ELSE}}
                                            n2$ = {{Text|scope$|#55FF55}} + {{Text|<nowiki>"UDT_"</nowiki>|#FFB100}} + {{Cl|RTRIM$}}(id.n)
                                        {{Cl|END}} {{Cl|IF}}
                                        e$ = {{Text|<nowiki>"(void*)( ((char*)("</nowiki>|#FFB100}} + n2$ + {{Text|<nowiki>")) + ("</nowiki>|#FFB100}} + o$ + {{Text|<nowiki>") )"</nowiki>|#FFB100}}
                                        {{Text|<nowiki>'convert void* to target type*</nowiki>|#919191}}
                                        {{Cl|IF}} passudtelement {{Cl|THEN}} e$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} + {{Text|typ2ctyp$|#55FF55}}(targettyp2 + (targettyp {{Cl|AND}} ISUNSIGNED), {{Text|<nowiki>""</nowiki>|#FFB100}}) + {{Text|<nowiki>"*)"</nowiki>|#FFB100}} + e$
                                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                                    {{Cl|ELSE}}
                                        {{Text|<nowiki>'not a udt</nowiki>|#919191}}
                                        {{Cl|IF}} arr {{Cl|THEN}}
                                            {{Cl|IF}} (sourcetyp2 {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot pass BIT array offsets"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                                            e$ = {{Text|<nowiki>"(&("</nowiki>|#FFB100}} + {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}}) + {{Text|<nowiki>"))"</nowiki>|#FFB100}}
                                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                                        {{Cl|ELSE}}
                                            e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|1|#F580B1}})
                                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                                        {{Cl|END}} {{Cl|IF}}
                                        {{Text|<nowiki>'note: signed/unsigned mismatch requires casting</nowiki>|#919191}}
                                        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISUNSIGNED) <> (targettyp {{Cl|AND (boolean)|AND}} ISUNSIGNED) {{Cl|THEN}}
                                            e$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} + {{Text|typ2ctyp$|#55FF55}}(targettyp2 + (targettyp {{Cl|AND}} ISUNSIGNED), {{Text|<nowiki>""</nowiki>|#FFB100}}) + {{Text|<nowiki>"*)"</nowiki>|#FFB100}} + e$
                                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'udt?</nowiki>|#919191}}
                                    {{Text|<nowiki>'force recompile if target needs to be in cmem and the source is not</nowiki>|#919191}}
                                    {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(sfcmemargs(targetid), curarg, {{Text|1|#F580B1}}) = {{Cl|CHR$}}({{Text|1|#F580B1}}) {{Cl|THEN}} {{Text|<nowiki>'cmem required?</nowiki>|#919191}}
                                        {{Cl|IF}} cmemlist(idnum) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                            cmemlist(idnum) = {{Text|1|#F580B1}}
                                            recompile = {{Text|1|#F580B1}}
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Cl|GOTO}} dontevaluate
                                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'similar</nowiki>|#919191}}
                                {{Text|<nowiki>'IF sourcetyp2 = targettyp2 THEN</nowiki>|#919191}}
                                {{Text|<nowiki>'IF arr THEN</nowiki>|#919191}}
                                {{Text|<nowiki>'IF (sourcetyp2 AND ISOFFSETINBITS) THEN Give_Error "Cannot pass BIT array offsets yet": EXIT FUNCTION</nowiki>|#919191}}
                                {{Text|<nowiki>'e$ = "(&(" + refer(e$, sourcetyp, 0) + "))"</nowiki>|#919191}}
                                {{Text|<nowiki>'ELSE</nowiki>|#919191}}
                                {{Text|<nowiki>'e$ = refer(e$, sourcetyp, 1)</nowiki>|#919191}}
                                {{Text|<nowiki>'END IF</nowiki>|#919191}}
                                {{Text|<nowiki>'GOTO dontevaluate</nowiki>|#919191}}
                                {{Text|<nowiki>'END IF</nowiki>|#919191}}
                            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'source is a reference</nowiki>|#919191}}
                        {{Cl|ELSE}} {{Text|<nowiki>'string</nowiki>|#919191}}
                            {{Text|<nowiki>'its a string</nowiki>|#919191}}
                            {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}}
                                idnum = {{Cl|VAL}}({{Cl|LEFT$}}(e$, {{Cl|INSTR}}(e$, sp3) - {{Text|1|#F580B1}})) {{Text|<nowiki>'id# of sourcetyp</nowiki>|#919191}}
                                {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(sfcmemargs(targetid), curarg, {{Text|1|#F580B1}}) = {{Cl|CHR$}}({{Text|1|#F580B1}}) {{Cl|THEN}} {{Text|<nowiki>'cmem required?</nowiki>|#919191}}
                                    {{Cl|IF}} cmemlist(idnum) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                        cmemlist(idnum) = {{Text|1|#F580B1}}
                                        recompile = {{Text|1|#F580B1}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'reference</nowiki>|#919191}}
                        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'string</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'dereference was not used</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'pointer</nowiki>|#919191}}
                {{Text|<nowiki>'note: Target is not a pointer...</nowiki>|#919191}}
                {{Text|<nowiki>'IF (targettyp AND ISSTRING) = 0 THEN</nowiki>|#919191}}
                {{Text|<nowiki>'IF (sourcetyp AND ISREFERENCE) THEN</nowiki>|#919191}}
                {{Text|<nowiki>'targettyp2 = targettyp: sourcetyp2 = sourcetyp - ISREFERENCE</nowiki>|#919191}}
                {{Text|<nowiki>'IF (sourcetyp2 AND ISINCONVENTIONALMEMORY) THEN sourcetyp2 = sourcetyp2 - ISINCONVENTIONALMEMORY</nowiki>|#919191}}
                {{Text|<nowiki>'IF sourcetyp2 = targettyp2 THEN e$ = refer(e$, sourcetyp, 1): GOTO dontevaluate</nowiki>|#919191}}
                {{Text|<nowiki>'END IF</nowiki>|#919191}}
                {{Text|<nowiki>'END IF</nowiki>|#919191}}
                {{Text|<nowiki>'END IF</nowiki>|#919191}}
                {{Text|<nowiki>'String-numeric mismatch?</nowiki>|#919191}}
                {{Cl|IF}} targettyp {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        nth = curarg
                        {{Cl|IF}} skipFirstArg {{Cl|THEN}} nth = nth - {{Text|1|#F580B1}}
                        {{Cl|IF}} ids(targetid).args = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"String required for function"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                        {{Text|Give_Error|#55FF55}} {{Text|str_nth$|#55FF55}}(nth) + {{Text|<nowiki>" function argument requires a string"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                        nth = curarg
                        {{Cl|IF}} skipFirstArg {{Cl|THEN}} nth = nth - {{Text|1|#F580B1}}
                        {{Cl|IF}} ids(targetid).args = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Number required for function"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                        {{Text|Give_Error|#55FF55}} {{Text|str_nth$|#55FF55}}(nth) + {{Text|<nowiki>" function argument requires a number"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'change to "non-pointer" value</nowiki>|#919191}}
                {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}}
                    e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} explicitreference = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} targettyp {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
                        nth = curarg
                        {{Cl|IF}} skipFirstArg {{Cl|THEN}} nth = nth - {{Text|1|#F580B1}}
                        {{Cl|IF}} qb64prefix_set {{Cl|AND (boolean)|AND}} udtxcname(targettyp {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|<nowiki>"_MEM"</nowiki>|#FFB100}} {{Cl|THEN}}
                            x$ = {{Text|<nowiki>"'"</nowiki>|#FFB100}} + {{Cl|MID$ (function)|MID$}}({{Cl|RTRIM$}}(udtxcname(targettyp {{Cl|AND}} {{Text|511|#F580B1}})), {{Text|2|#F580B1}}) + {{Text|<nowiki>"'"</nowiki>|#FFB100}}
                        {{Cl|ELSE}}
                            x$ = {{Text|<nowiki>"'"</nowiki>|#FFB100}} + {{Cl|RTRIM$}}(udtxcname(targettyp {{Cl|AND}} {{Text|511|#F580B1}})) + {{Text|<nowiki>"'"</nowiki>|#FFB100}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} ids(targetid).args = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"TYPE "</nowiki>|#FFB100}} + x$ + {{Text|<nowiki>" required for function"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                        {{Text|Give_Error|#55FF55}} {{Text|str_nth$|#55FF55}}(nth) + {{Text|<nowiki>" function argument requires TYPE "</nowiki>|#FFB100}} + x$: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|ELSE}}
                    {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Number required for function"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'round to integer if required</nowiki>|#919191}}
                {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}}
                    {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} ISFLOAT) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Text|<nowiki>'**32 rounding fix</nowiki>|#919191}}
                        bits = targettyp {{Cl|AND}} {{Text|511|#F580B1}}
                        {{Cl|IF}} bits <= {{Text|16|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"qbr_float_to_long("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                        {{Cl|IF}} bits > {{Text|16|#F580B1}} {{Cl|AND (boolean)|AND}} bits < {{Text|32|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"qbr_double_to_long("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                        {{Cl|IF}} bits >= {{Text|32|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"qbr("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} explicitreference {{Cl|THEN}}
                    {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) {{Cl|THEN}}
                        {{Text|<nowiki>'integer value can fit inside int64</nowiki>|#919191}}
                        e$ = {{Text|<nowiki>"(int64)("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                    {{Cl|ELSE}}
                        {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}}
                            {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|32|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"(float)("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                            {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|64|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"(double)("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                            {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|256|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"(long double)("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                        {{Cl|ELSE}}
                            {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} ISUNSIGNED) {{Cl|THEN}}
                                {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|8|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"(uint8)("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                                {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|16|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"(uint16)("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                                {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|32|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"(uint32)("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                                {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|64|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"(uint64)("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                            {{Cl|ELSE}}
                                {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|8|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"(int8)("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                                {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|16|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"(int16)("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                                {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|32|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"(int32)("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                                {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|64|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"(int64)("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'float?</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'offset in bits?</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'explicit?</nowiki>|#919191}}
                {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} ISPOINTER) {{Cl|THEN}} {{Text|<nowiki>'pointer required</nowiki>|#919191}}
                    {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} {{Cl|GOTO}} dontevaluate {{Text|<nowiki>'no changes required</nowiki>|#919191}}
                    {{Text|<nowiki>'20090703</nowiki>|#919191}}
                    t$ = {{Text|typ2ctyp$|#55FF55}}(targettyp, {{Text|<nowiki>""</nowiki>|#FFB100}})
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    v$ = {{Text|<nowiki>"pass"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}({{Text|uniquenumber|#55FF55}})
                    {{Text|<nowiki>'assume numeric type</nowiki>|#919191}}
                    {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(sfcmemargs(targetid), curarg, {{Text|1|#F580B1}}) = {{Cl|CHR$}}({{Text|1|#F580B1}}) {{Cl|THEN}} {{Text|<nowiki>'cmem required?</nowiki>|#919191}}
                        bytesreq = ((targettyp {{Cl|AND}} {{Text|511|#F580B1}}) + {{Text|7|#F580B1}}) \ {{Text|8|#F580B1}}
                        {{Text|WriteBufLine|#55FF55}} defdatahandle, t$ + {{Text|<nowiki>" *"</nowiki>|#FFB100}} + v$ + {{Text|<nowiki>"=NULL;"</nowiki>|#FFB100}}
                        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if("</nowiki>|#FFB100}} + v$ + {{Text|<nowiki>"==NULL){"</nowiki>|#FFB100}}
                        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"cmem_sp-="</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bytesreq) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, v$ + {{Text|<nowiki>"=("</nowiki>|#FFB100}} + t$ + {{Text|<nowiki>"*)(dblock+cmem_sp);"</nowiki>|#FFB100}}
                        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if (cmem_sp<qbs_cmem_sp) error(257);"</nowiki>|#FFB100}}
                        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                        e$ = {{Text|<nowiki>"&(*"</nowiki>|#FFB100}} + v$ + {{Text|<nowiki>"="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                    {{Cl|ELSE}}
                        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, t$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} + v$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                        e$ = {{Text|<nowiki>"&("</nowiki>|#FFB100}} + v$ + {{Text|<nowiki>"="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|GOTO}} dontevaluate
                {{Cl|END}} {{Cl|IF}}
                dontevaluate:
                {{Cl|IF}} id2.ccall {{Cl|THEN}}
                    {{Text|<nowiki>'if a forced cast from a returned ccall function is in e$, remove it</nowiki>|#919191}}
                    {{Cl|IF}} {{Cl|LEFT$}}(e$, {{Text|3|#F580B1}}) = {{Text|<nowiki>"(  "</nowiki>|#FFB100}} {{Cl|THEN}}
                        e$ = {{Text|removecast$|#55FF55}}(e$)
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} targettyp {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                        e$ = {{Text|<nowiki>"(char*)("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")->chr"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} {{Cl|LTRIM$}}({{Cl|RTRIM$}}(e$)) = {{Text|<nowiki>"0"</nowiki>|#FFB100}} {{Cl|THEN}} e$ = {{Text|<nowiki>"NULL"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                r$ = r$ + e$
                {{Text|<nowiki>'***special case****</nowiki>|#919191}}
                {{Cl|IF}} n$ = {{Text|<nowiki>"_MEM"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (n$ = {{Text|<nowiki>"MEM"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}}
                    {{Cl|IF}} args = {{Text|1|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} curarg = {{Text|1|#F580B1}} {{Cl|THEN}} r$ = r$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|GOTO}} evalfuncspecial
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} args = {{Text|2|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} curarg = {{Text|2|#F580B1}} {{Cl|THEN}} r$ = r$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|GOTO}} evalfuncspecial
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} i <> n {{Cl|AND (boolean)|AND}} nocomma = {{Text|0|#F580B1}} {{Cl|THEN}} r$ = r$ + {{Text|<nowiki>","</nowiki>|#FFB100}}
                nocomma = {{Text|0|#F580B1}}
                firsti = i + {{Text|1|#F580B1}}
                curarg = curarg + {{Text|1|#F580B1}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|NEXT}}
        {{Text|<nowiki>' Add on any extra optional arguments that were not provided</nowiki>|#919191}}
        {{Text|<nowiki>'</nowiki>|#919191}}
        {{Text|<nowiki>' Overloaded functions do not require the omited arguments to be provided</nowiki>|#919191}}
        {{Cl|IF}} curarg <= id2.args {{Cl|AND (boolean)|AND}} {{Cl|NOT}} id2.overloaded {{Cl|THEN}}
            {{Cl|FOR}} i = curarg {{Cl|TO}} id2.args
                {{Cl|IF}} i = {{Text|1|#F580B1}} {{Cl|THEN}} r$ = r$ + {{Text|<nowiki>"NULL"</nowiki>|#FFB100}} {{Cl|ELSE}} r$ = r$ + {{Text|<nowiki>",NULL"</nowiki>|#FFB100}}
            {{Cl|NEXT}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} n$ = {{Text|<nowiki>"UBOUND"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} n$ = {{Text|<nowiki>"LBOUND"</nowiki>|#FFB100}} {{Cl|THEN}}
        {{Cl|IF}} r$ = {{Text|<nowiki>",NULL"</nowiki>|#FFB100}} {{Cl|THEN}} r$ = {{Text|<nowiki>",1"</nowiki>|#FFB100}} {{Text|<nowiki>' FIXME: ??????</nowiki>|#919191}}
        {{Cl|IF}} n$ = {{Text|<nowiki>"UBOUND"</nowiki>|#FFB100}} {{Cl|THEN}} r2$ = {{Text|<nowiki>"func_ubound("</nowiki>|#FFB100}} {{Cl|ELSE}} r2$ = {{Text|<nowiki>"func_lbound("</nowiki>|#FFB100}}
        e$ = {{Text|refer$|#55FF55}}(ulboundarray$, sourcetyp, {{Text|1|#F580B1}})
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Text|<nowiki>'note: ID contins refer'ed array info</nowiki>|#919191}}
        arrayelements = id.arrayelements {{Text|<nowiki>'2009</nowiki>|#919191}}
        {{Cl|IF}} arrayelements = {{Text|-1|#F580B1}} {{Cl|THEN}} arrayelements = {{Text|1|#F580B1}} {{Text|<nowiki>'2009</nowiki>|#919191}}
        r$ = r2$ + e$ + r$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(arrayelements) + {{Text|<nowiki>")"</nowiki>|#FFB100}}
        typ& = INTEGER64TYPE - ISPOINTER
        {{Cl|GOTO}} evalfuncspecial
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} passomit {{Cl|THEN}}
        r$ = r$ + {{Text|<nowiki>",0"</nowiki>|#FFB100}}
        {{Cl|IF}} hasOptionalFirstArg {{Cl|THEN}}
            {{Cl|IF}} providedArgs({{Text|1|#F580B1}}) {{Cl|THEN}} r$ = r$ + {{Text|<nowiki>"|1"</nowiki>|#FFB100}}
        {{Cl|ELSE}}
            {{Cl|FOR}} i = firstOptionalArgument {{Cl|TO}} {{Cl|UBOUND}}(providedArgs)
                {{Cl|IF}} providedArgs(i) {{Cl|THEN}} r$ = r$ + {{Text|<nowiki>"|"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}({{Cl|_SHL}}({{Text|1|#F580B1}}, i - firstOptionalArgument))
            {{Cl|NEXT}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    r$ = r$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
    evalfuncspecial:
    {{Cl|IF}} n$ = {{Text|<nowiki>"ABS"</nowiki>|#FFB100}} {{Cl|THEN}} typ& = sourcetyp {{Text|<nowiki>'ABS Note: ABS() returns argument #1's type</nowiki>|#919191}}
    {{Text|<nowiki>'QB-like conversion of math functions returning floating point values</nowiki>|#919191}}
    {{Cl|IF}} n$ = {{Text|<nowiki>"SIN"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} n$ = {{Text|<nowiki>"COS"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} n$ = {{Text|<nowiki>"TAN"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} n$ = {{Text|<nowiki>"ATN"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} n$ = {{Text|<nowiki>"SQR"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} n$ = {{Text|<nowiki>"LOG"</nowiki>|#FFB100}} {{Cl|THEN}}
        b = sourcetyp {{Cl|AND}} {{Text|511|#F580B1}}
        {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISFLOAT {{Cl|THEN}}
            {{Text|<nowiki>'Default is FLOATTYPE</nowiki>|#919191}}
            {{Cl|IF}} b = {{Text|64|#F580B1}} {{Cl|THEN}} typ& = DOUBLETYPE - ISPOINTER
            {{Cl|IF}} b = {{Text|32|#F580B1}} {{Cl|THEN}} typ& = SINGLETYPE - ISPOINTER
        {{Cl|ELSE}}
            {{Text|<nowiki>'Default is FLOATTYPE</nowiki>|#919191}}
            {{Cl|IF}} b <= {{Text|32|#F580B1}} {{Cl|THEN}} typ& = DOUBLETYPE - ISPOINTER
            {{Cl|IF}} b <= {{Text|16|#F580B1}} {{Cl|THEN}} typ& = SINGLETYPE - ISPOINTER
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} id2.ret = ISUDT + ({{Text|1|#F580B1}}) {{Cl|THEN}}
        {{Text|<nowiki>'***special case***</nowiki>|#919191}}
        v$ = {{Text|<nowiki>"func"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}({{Text|uniquenumber|#55FF55}})
        {{Text|WriteBufLine|#55FF55}} defdatahandle, {{Text|<nowiki>"mem_block "</nowiki>|#FFB100}} + v$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
        r$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} + v$ + {{Text|<nowiki>"="</nowiki>|#FFB100}} + r$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} id2.ccall {{Cl|THEN}}
        {{Cl|IF}} {{Cl|LEFT$}}(r$, {{Text|11|#F580B1}}) = {{Text|<nowiki>"(  char*  )"</nowiki>|#FFB100}} {{Cl|THEN}}
            r$ = {{Text|<nowiki>"qbs_new_txt("</nowiki>|#FFB100}} + r$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"evaluatefunc:out:"</nowiki>|#FFB100}}; r$
    {{Text|evaluatefunc$|#55FF55}} = r$
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|variablesize$|#55FF55}} (i {{Cl|AS}} {{Cl|LONG}}) {{Text|<nowiki>'ID or -1 (if ID already 'loaded')</nowiki>|#919191}}
    {{Text|<nowiki>'Note: assumes whole bytes, no bit offsets/sizes</nowiki>|#919191}}
    {{Cl|IF}} i <> {{Text|-1|#F580B1}} {{Cl|THEN}} {{Text|getid|#55FF55}} i
    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Text|<nowiki>'find base size from type</nowiki>|#919191}}
    t = id.t: {{Cl|IF}} t = {{Text|0|#F580B1}} {{Cl|THEN}} t = id.arraytype
    bytes = (t {{Cl|AND}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}}
    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}} {{Text|<nowiki>'correct size for UDTs</nowiki>|#919191}}
        u = t {{Cl|AND}} {{Text|511|#F580B1}}
        bytes = udtxsize(u) \ {{Text|8|#F580B1}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}} {{Text|<nowiki>'correct size for strings</nowiki>|#919191}}
        {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH {{Cl|THEN}}
            bytes = id.tsize
        {{Cl|ELSE}}
            {{Cl|IF}} id.arraytype {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot determine size of variable-length string array"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Text|variablesize$|#55FF55}} = {{Text|scope$|#55FF55}} + {{Text|<nowiki>"STRING_"</nowiki>|#FFB100}} + {{Cl|RTRIM$}}(id.n) + {{Text|<nowiki>"->len"</nowiki>|#FFB100}}
            {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} id.arraytype {{Cl|THEN}} {{Text|<nowiki>'multiply size for arrays</nowiki>|#919191}}
        n$ = {{Cl|RTRIM$}}(id.callname)
        s$ = {{Text|str2|#55FF55}}(bytes) + {{Text|<nowiki>"*("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[2]&1)"</nowiki>|#FFB100}} {{Text|<nowiki>'note: multiplying by 0 if array not currently defined (affects dynamic arrays)</nowiki>|#919191}}
        arrayelements = id.arrayelements: {{Cl|IF}} arrayelements = {{Text|-1|#F580B1}} {{Cl|THEN}} arrayelements = {{Text|1|#F580B1}} {{Text|<nowiki>'2009</nowiki>|#919191}}
        {{Cl|FOR}} i2 = {{Text|1|#F580B1}} {{Cl|TO}} arrayelements
            s$ = s$ + {{Text|<nowiki>"*"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(i2 * {{Text|4|#F580B1}} - {{Text|4|#F580B1}} + {{Text|5|#F580B1}}) + {{Text|<nowiki>"]"</nowiki>|#FFB100}}
        {{Cl|NEXT}}
        {{Text|variablesize$|#55FF55}} = {{Text|<nowiki>"("</nowiki>|#FFB100}} + s$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|variablesize$|#55FF55}} = {{Text|str2|#55FF55}}(bytes)
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|evaluatetotyp$|#55FF55}} (a2$, targettyp {{Cl|AS}} {{Cl|LONG}})
    {{Text|<nowiki>'note: 'evaluatetotyp' no longer performs 'fixoperationorder' on a2$ (in many cases, this has already been done)</nowiki>|#919191}}
    a$ = a2$
    e$ = {{Text|evaluate|#55FF55}}(a$, sourcetyp)
    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Text|<nowiki>'Offset protection:</nowiki>|#919191}}
    {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISOFFSET {{Cl|THEN}}
        {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} ISOFFSET) = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} targettyp >= {{Text|0|#F580B1}} {{Cl|THEN}}
            {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot convert _OFFSET type to other types"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'-5 size</nowiki>|#919191}}
    {{Text|<nowiki>'-6 offset</nowiki>|#919191}}
    {{Cl|IF}} targettyp = {{Text|-4|#F580B1}} {{Cl|OR (boolean)|OR}} targettyp = {{Text|-5|#F580B1}} {{Cl|OR (boolean)|OR}} targettyp = {{Text|-6|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'? -> byte_element(offset,element size in bytes)</nowiki>|#919191}}
        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected variable name/array element"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Variable/element cannot be BIT aligned"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Text|<nowiki>' print "-4: evaluated as ["+e$+"]":sleep 1</nowiki>|#919191}}
        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISUDT) {{Cl|THEN}} {{Text|<nowiki>'User Defined Type -> byte_element(offset,bytes)</nowiki>|#919191}}
            {{Cl|IF}} udtxvariable(sourcetyp {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"UDT must have fixed size"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            idnumber = {{Cl|VAL}}(e$)
            i = {{Cl|INSTR}}(e$, sp3): e$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - i)
            u = {{Cl|VAL}}(e$) {{Text|<nowiki>'closest parent</nowiki>|#919191}}
            i = {{Cl|INSTR}}(e$, sp3): e$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - i)
            E = {{Cl|VAL}}(e$)
            i = {{Cl|INSTR}}(e$, sp3): e$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - i)
            o$ = e$
            {{Text|getid|#55FF55}} idnumber
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            n$ = {{Text|<nowiki>"UDT_"</nowiki>|#FFB100}} + {{Cl|RTRIM$}}(id.n)
            {{Cl|IF}} id.arraytype {{Cl|THEN}}
                n$ = {{Text|<nowiki>"ARRAY_"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]"</nowiki>|#FFB100}}
                {{Text|<nowiki>'whole array reference examplename()?</nowiki>|#919191}}
                {{Cl|IF}} {{Cl|LEFT$}}(o$, {{Text|3|#F580B1}}) = {{Text|<nowiki>"(0)"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Text|<nowiki>'use -2 type method</nowiki>|#919191}}
                    {{Cl|GOTO}} method2usealludt
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            dst$ = {{Text|<nowiki>"(((char*)"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + n$ + {{Text|<nowiki>")+("</nowiki>|#FFB100}} + o$ + {{Text|<nowiki>"))"</nowiki>|#FFB100}}
            {{Text|<nowiki>'determine size of element</nowiki>|#919191}}
            {{Cl|IF}} E = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'no specific element, use size of entire type</nowiki>|#919191}}
                bytes$ = {{Text|str2|#55FF55}}(udtxsize(u) \ {{Text|8|#F580B1}})
            {{Cl|ELSE}} {{Text|<nowiki>'a specific element</nowiki>|#919191}}
                {{Cl|IF}} (udtetype(E) {{Cl|AND (boolean)|AND}} ISSTRING) > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} (udtetype(E) {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} (targettyp = {{Text|-5|#F580B1}}) {{Cl|THEN}}
                    {{Text|evaluatetotyp$|#55FF55}} = {{Text|<nowiki>"(*(qbs**)"</nowiki>|#FFB100}} + dst$ + {{Text|<nowiki>")->len"</nowiki>|#FFB100}}
                    {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|ELSEIF}} (udtetype(E) {{Cl|AND (boolean)|AND}} ISSTRING) > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} (udtetype(E) {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} (targettyp = {{Text|-4|#F580B1}}) {{Cl|THEN}}
                    dst$ = {{Text|<nowiki>"(*((qbs**)((char*)"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + n$ + {{Text|<nowiki>"+("</nowiki>|#FFB100}} + o$ + {{Text|<nowiki>"))))->chr"</nowiki>|#FFB100}}
                    bytes$ = {{Text|<nowiki>"(*((qbs**)((char*)"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + n$ + {{Text|<nowiki>"+("</nowiki>|#FFB100}} + o$ + {{Text|<nowiki>"))))->len"</nowiki>|#FFB100}}
                    {{Text|evaluatetotyp$|#55FF55}} = {{Text|<nowiki>"byte_element((uint64)"</nowiki>|#FFB100}} + dst$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + bytes$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                    {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|END}} {{Cl|IF}}
                bytes$ = {{Text|str2|#55FF55}}(udtesize(E) \ {{Text|8|#F580B1}})
            {{Cl|END}} {{Cl|IF}}
            {{Text|evaluatetotyp$|#55FF55}} = {{Text|<nowiki>"byte_element((uint64)"</nowiki>|#FFB100}} + dst$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + bytes$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>")"</nowiki>|#FFB100}}
            {{Cl|IF}} targettyp = {{Text|-5|#F580B1}} {{Cl|THEN}} {{Text|evaluatetotyp$|#55FF55}} = bytes$
            {{Cl|IF}} targettyp = {{Text|-6|#F580B1}} {{Cl|THEN}} {{Text|evaluatetotyp$|#55FF55}} = dst$
            {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISARRAY) {{Cl|THEN}} {{Text|<nowiki>'Array reference -> byte_element(offset,bytes)</nowiki>|#919191}}
            {{Text|<nowiki>'whole array reference examplename()?</nowiki>|#919191}}
            {{Cl|IF}} {{Cl|RIGHT$}}(e$, {{Text|2|#F580B1}}) = sp3 + {{Text|<nowiki>"0"</nowiki>|#FFB100}} {{Cl|THEN}}
                {{Text|<nowiki>'use -2 type method</nowiki>|#919191}}
                {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot pass array of variable-length strings"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|GOTO}} method2useall
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'assume a specific element</nowiki>|#919191}}
            {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH {{Cl|THEN}}
                    idnumber = {{Cl|VAL}}(e$)
                    {{Text|getid|#55FF55}} idnumber
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    bytes$ = {{Text|str2|#55FF55}}(id.tsize)
                    e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Text|evaluatetotyp$|#55FF55}} = {{Text|<nowiki>"byte_element((uint64)"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"->chr,"</nowiki>|#FFB100}} + bytes$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                    {{Cl|IF}} targettyp = {{Text|-5|#F580B1}} {{Cl|THEN}} {{Text|evaluatetotyp$|#55FF55}} = bytes$
                    {{Cl|IF}} targettyp = {{Text|-6|#F580B1}} {{Cl|THEN}} {{Text|evaluatetotyp$|#55FF55}} = e$ + {{Text|<nowiki>"->chr"</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Text|evaluatetotyp$|#55FF55}} = {{Text|<nowiki>"byte_element((uint64)"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"->chr,"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"->len,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                    {{Cl|IF}} targettyp = {{Text|-5|#F580B1}} {{Cl|THEN}} {{Text|evaluatetotyp$|#55FF55}} = e$ + {{Text|<nowiki>"->len"</nowiki>|#FFB100}}
                    {{Cl|IF}} targettyp = {{Text|-6|#F580B1}} {{Cl|THEN}} {{Text|evaluatetotyp$|#55FF55}} = e$ + {{Text|<nowiki>"->chr"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|END}} {{Cl|IF}}
            e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            e$ = {{Text|<nowiki>"(&("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"))"</nowiki>|#FFB100}}
            bytes$ = {{Text|str2|#55FF55}}((sourcetyp {{Cl|AND}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}})
            {{Text|evaluatetotyp$|#55FF55}} = {{Text|<nowiki>"byte_element((uint64)"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + bytes$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>")"</nowiki>|#FFB100}}
            {{Cl|IF}} targettyp = {{Text|-5|#F580B1}} {{Cl|THEN}} {{Text|evaluatetotyp$|#55FF55}} = bytes$
            {{Cl|IF}} targettyp = {{Text|-6|#F580B1}} {{Cl|THEN}} {{Text|evaluatetotyp$|#55FF55}} = e$
            {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}} {{Text|<nowiki>'String -> byte_element(offset,bytes)</nowiki>|#919191}}
            {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH {{Cl|THEN}}
                idnumber = {{Cl|VAL}}(e$)
                {{Text|getid|#55FF55}} idnumber
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                bytes$ = {{Text|str2|#55FF55}}(id.tsize)
                e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|ELSE}}
                e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                bytes$ = e$ + {{Text|<nowiki>"->len"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|evaluatetotyp$|#55FF55}} = {{Text|<nowiki>"byte_element((uint64)"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"->chr,"</nowiki>|#FFB100}} + bytes$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>")"</nowiki>|#FFB100}}
            {{Cl|IF}} targettyp = {{Text|-5|#F580B1}} {{Cl|THEN}} {{Text|evaluatetotyp$|#55FF55}} = bytes$
            {{Cl|IF}} targettyp = {{Text|-6|#F580B1}} {{Cl|THEN}} {{Text|evaluatetotyp$|#55FF55}} = e$ + {{Text|<nowiki>"->chr"</nowiki>|#FFB100}}
            {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'Standard variable -> byte_element(offset,bytes)</nowiki>|#919191}}
        e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|1|#F580B1}}) {{Text|<nowiki>'get the variable's formal name</nowiki>|#919191}}
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        size = (sourcetyp {{Cl|AND}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}} {{Text|<nowiki>'calculate its size in bytes</nowiki>|#919191}}
        {{Text|evaluatetotyp$|#55FF55}} = {{Text|<nowiki>"byte_element((uint64)"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(size) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>")"</nowiki>|#FFB100}}
        {{Cl|IF}} targettyp = {{Text|-5|#F580B1}} {{Cl|THEN}} {{Text|evaluatetotyp$|#55FF55}} = {{Text|str2|#55FF55}}(size)
        {{Cl|IF}} targettyp = {{Text|-6|#F580B1}} {{Cl|THEN}} {{Text|evaluatetotyp$|#55FF55}} = e$
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'-4, -5, -6</nowiki>|#919191}}
    {{Cl|IF}} targettyp = {{Text|-8|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'? -> _MEM structure helper {offset, fullsize, typeval, elementsize, sf_mem_lock|???}</nowiki>|#919191}}
        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected variable name/array element"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Variable/element cannot be BIT aligned"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISUDT) {{Cl|THEN}} {{Text|<nowiki>'User Defined Type -> byte_element(offset,bytes)</nowiki>|#919191}}
            idnumber = {{Cl|VAL}}(e$)
            i = {{Cl|INSTR}}(e$, sp3): e$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - i)
            u = {{Cl|VAL}}(e$) {{Text|<nowiki>'closest parent</nowiki>|#919191}}
            i = {{Cl|INSTR}}(e$, sp3): e$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - i)
            E = {{Cl|VAL}}(e$)
            i = {{Cl|INSTR}}(e$, sp3): e$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - i)
            o$ = e$
            {{Text|getid|#55FF55}} idnumber
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            n$ = {{Text|<nowiki>"UDT_"</nowiki>|#FFB100}} + {{Cl|RTRIM$}}(id.n)
            {{Cl|IF}} id.arraytype {{Cl|THEN}}
                n$ = {{Text|<nowiki>"ARRAY_"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]"</nowiki>|#FFB100}}
                {{Text|<nowiki>'whole array reference examplename()?</nowiki>|#919191}}
                {{Cl|IF}} {{Cl|LEFT$}}(o$, {{Text|3|#F580B1}}) = {{Text|<nowiki>"(0)"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Text|<nowiki>'use -7 type method</nowiki>|#919191}}
                    {{Cl|GOTO}} method2usealludt__7
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'determine size of element</nowiki>|#919191}}
            {{Cl|IF}} E = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'no specific element, use size of entire type</nowiki>|#919191}}
                bytes$ = {{Text|str2|#55FF55}}(udtxsize(u) \ {{Text|8|#F580B1}})
                t1 = ISUDT + udtetype(u)
            {{Cl|ELSE}} {{Text|<nowiki>'a specific element</nowiki>|#919191}}
                bytes$ = {{Text|str2|#55FF55}}(udtesize(E) \ {{Text|8|#F580B1}})
                t1 = udtetype(E)
            {{Cl|END}} {{Cl|IF}}
            dst$ = {{Text|<nowiki>"(((char*)"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + n$ + {{Text|<nowiki>")+("</nowiki>|#FFB100}} + o$ + {{Text|<nowiki>"))"</nowiki>|#FFB100}}
            {{Text|<nowiki>'evaluatetotyp$ = "byte_element((uint64)" + dst$ + "," + bytes$ + "," + NewByteElement$ + ")"</nowiki>|#919191}}
            {{Text|<nowiki>'IF targettyp = -5 THEN evaluatetotyp$ = bytes$</nowiki>|#919191}}
            {{Text|<nowiki>'IF targettyp = -6 THEN evaluatetotyp$ = dst$</nowiki>|#919191}}
            t = {{Text|Type2MemTypeValue|#55FF55}}(t1)
            {{Text|evaluatetotyp$|#55FF55}} = {{Text|<nowiki>"(ptrszint)"</nowiki>|#FFB100}} + dst$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + bytes$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(t) + {{Text|<nowiki>","</nowiki>|#FFB100}} + bytes$ + {{Text|<nowiki>",sf_mem_lock"</nowiki>|#FFB100}}
            {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISARRAY) {{Cl|THEN}} {{Text|<nowiki>'Array reference -> byte_element(offset,bytes)</nowiki>|#919191}}
            {{Text|<nowiki>'whole array reference examplename()?</nowiki>|#919191}}
            {{Cl|IF}} {{Cl|RIGHT$}}(e$, {{Text|2|#F580B1}}) = sp3 + {{Text|<nowiki>"0"</nowiki>|#FFB100}} {{Cl|THEN}}
                {{Text|<nowiki>'use -7 type method</nowiki>|#919191}}
                {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot pass array of variable-length strings"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|GOTO}} method2useall__7
            {{Cl|END}} {{Cl|IF}}
            idnumber = {{Cl|VAL}}(e$)
            {{Text|getid|#55FF55}} idnumber
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            n$ = {{Cl|RTRIM$}}(id.callname)
            lk$ = {{Text|<nowiki>"(mem_lock*)((ptrszint*)"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}({{Text|4|#F580B1}} * id.arrayelements + {{Text|4|#F580B1}} + {{Text|1|#F580B1}} - {{Text|1|#F580B1}}) + {{Text|<nowiki>"]"</nowiki>|#FFB100}}
            {{Text|<nowiki>'assume a specific element</nowiki>|#919191}}
            {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH {{Cl|THEN}}
                    bytes$ = {{Text|str2|#55FF55}}(id.tsize)
                    e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Text|<nowiki>'evaluatetotyp$ = "byte_element((uint64)" + e$ + "->chr," + bytes$ + "," + NewByteElement$ + ")"</nowiki>|#919191}}
                    {{Text|<nowiki>'IF targettyp = -5 THEN evaluatetotyp$ = bytes$</nowiki>|#919191}}
                    {{Text|<nowiki>'IF targettyp = -6 THEN evaluatetotyp$ = e$ + "->chr"</nowiki>|#919191}}
                    t = {{Text|Type2MemTypeValue|#55FF55}}(sourcetyp)
                    {{Text|evaluatetotyp$|#55FF55}} = {{Text|<nowiki>"(ptrszint)"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"->chr,"</nowiki>|#FFB100}} + bytes$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(t) + {{Text|<nowiki>","</nowiki>|#FFB100}} + bytes$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + lk$
                {{Cl|ELSE}}
                    {{Text|Give_Error|#55FF55}} qb64prefix$ + {{Text|<nowiki>"MEMELEMENT cannot reference variable-length strings"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|END}} {{Cl|IF}}
            e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            e$ = {{Text|<nowiki>"(&("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"))"</nowiki>|#FFB100}}
            bytes$ = {{Text|str2|#55FF55}}((sourcetyp {{Cl|AND}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}})
            {{Text|<nowiki>'evaluatetotyp$ = "byte_element((uint64)" + e$ + "," + bytes$ + "," + NewByteElement$ + ")"</nowiki>|#919191}}
            {{Text|<nowiki>'IF targettyp = -5 THEN evaluatetotyp$ = bytes$</nowiki>|#919191}}
            {{Text|<nowiki>'IF targettyp = -6 THEN evaluatetotyp$ = e$</nowiki>|#919191}}
            t = {{Text|Type2MemTypeValue|#55FF55}}(sourcetyp)
            {{Text|evaluatetotyp$|#55FF55}} = {{Text|<nowiki>"(ptrszint)"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + bytes$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(t) + {{Text|<nowiki>","</nowiki>|#FFB100}} + bytes$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + lk$
            {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'isarray</nowiki>|#919191}}
        {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}} {{Text|<nowiki>'String -> byte_element(offset,bytes)</nowiki>|#919191}}
            {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH {{Cl|THEN}}
                idnumber = {{Cl|VAL}}(e$)
                {{Text|getid|#55FF55}} idnumber
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                bytes$ = {{Text|str2|#55FF55}}(id.tsize)
                e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|ELSE}}
                {{Text|Give_Error|#55FF55}} qb64prefix$ + {{Text|<nowiki>"MEMELEMENT cannot reference variable-length strings"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'evaluatetotyp$ = "byte_element((uint64)" + e$ + "->chr," + bytes$ + "," + NewByteElement$ + ")"</nowiki>|#919191}}
            {{Text|<nowiki>'IF targettyp = -5 THEN evaluatetotyp$ = bytes$</nowiki>|#919191}}
            {{Text|<nowiki>'IF targettyp = -6 THEN evaluatetotyp$ = e$ + "->chr"</nowiki>|#919191}}
            t = {{Text|Type2MemTypeValue|#55FF55}}(sourcetyp)
            {{Text|evaluatetotyp$|#55FF55}} = {{Text|<nowiki>"(ptrszint)"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"->chr,"</nowiki>|#FFB100}} + bytes$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(t) + {{Text|<nowiki>","</nowiki>|#FFB100}} + bytes$ + {{Text|<nowiki>",sf_mem_lock"</nowiki>|#FFB100}}
            {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'Standard variable -> byte_element(offset,bytes)</nowiki>|#919191}}
        e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|1|#F580B1}}) {{Text|<nowiki>'get the variable's formal name</nowiki>|#919191}}
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        size = (sourcetyp {{Cl|AND}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}} {{Text|<nowiki>'calculate its size in bytes</nowiki>|#919191}}
        {{Text|<nowiki>'evaluatetotyp$ = "byte_element((uint64)" + e$ + "," + str2(size) + "," + NewByteElement$ + ")"</nowiki>|#919191}}
        {{Text|<nowiki>'IF targettyp = -5 THEN evaluatetotyp$ = str2(size)</nowiki>|#919191}}
        {{Text|<nowiki>'IF targettyp = -6 THEN evaluatetotyp$ = e$</nowiki>|#919191}}
        t = {{Text|Type2MemTypeValue|#55FF55}}(sourcetyp)
        {{Text|evaluatetotyp$|#55FF55}} = {{Text|<nowiki>"(ptrszint)"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(size) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(t) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(size) + {{Text|<nowiki>",sf_mem_lock"</nowiki>|#FFB100}}
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'-8</nowiki>|#919191}}
    {{Cl|IF}} targettyp = {{Text|-7|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'? -> _MEM structure helper {offset, fullsize, typeval, elementsize, sf_mem_lock|???}</nowiki>|#919191}}
        method2useall__7:
        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected variable name/array element"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Variable/element cannot be BIT aligned"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Text|<nowiki>'User Defined Type</nowiki>|#919191}}
        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISUDT) {{Cl|THEN}}
            {{Text|<nowiki>'          print "CI: -2 type from a UDT":sleep 1</nowiki>|#919191}}
            idnumber = {{Cl|VAL}}(e$)
            i = {{Cl|INSTR}}(e$, sp3): e$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - i)
            u = {{Cl|VAL}}(e$) {{Text|<nowiki>'closest parent</nowiki>|#919191}}
            i = {{Cl|INSTR}}(e$, sp3): e$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - i)
            E = {{Cl|VAL}}(e$)
            i = {{Cl|INSTR}}(e$, sp3): e$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - i)
            o$ = e$
            {{Text|getid|#55FF55}} idnumber
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            n$ = {{Text|<nowiki>"UDT_"</nowiki>|#FFB100}} + {{Cl|RTRIM$}}(id.n): {{Cl|IF}} id.arraytype {{Cl|THEN}} n$ = {{Text|<nowiki>"ARRAY_"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]"</nowiki>|#FFB100}}
            method2usealludt__7:
            bytes$ = {{Text|variablesize$|#55FF55}}({{Text|-1|#F580B1}}) + {{Text|<nowiki>"-("</nowiki>|#FFB100}} + o$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            dst$ = {{Text|<nowiki>"(((char*)"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + n$ + {{Text|<nowiki>")+("</nowiki>|#FFB100}} + o$ + {{Text|<nowiki>"))"</nowiki>|#FFB100}}
            {{Text|<nowiki>'evaluatetotyp$ = "byte_element((uint64)" + dst$ + "," + bytes$ + "," + NewByteElement$ + ")"</nowiki>|#919191}}
            {{Text|<nowiki>'note: myudt.myelement results in a size of 1 because it is a continuous run of no consistent granularity</nowiki>|#919191}}
            {{Cl|IF}} E <> {{Text|0|#F580B1}} {{Cl|THEN}} size = {{Text|1|#F580B1}} {{Cl|ELSE}} size = udtxsize(u) \ {{Text|8|#F580B1}}
            t = {{Text|Type2MemTypeValue|#55FF55}}(sourcetyp)
            {{Text|evaluatetotyp$|#55FF55}} = {{Text|<nowiki>"(ptrszint)"</nowiki>|#FFB100}} + dst$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + bytes$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(t) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(size) + {{Text|<nowiki>",sf_mem_lock"</nowiki>|#FFB100}}
            {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'Array reference</nowiki>|#919191}}
        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISARRAY) {{Cl|THEN}}
            {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Text|Give_Error|#55FF55}} qb64prefix$ + {{Text|<nowiki>"MEM cannot reference variable-length strings"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            idnumber = {{Cl|VAL}}(e$)
            {{Text|getid|#55FF55}} idnumber
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            n$ = {{Cl|RTRIM$}}(id.callname)
            lk$ = {{Text|<nowiki>"(mem_lock*)((ptrszint*)"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")["</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}({{Text|4|#F580B1}} * id.arrayelements + {{Text|4|#F580B1}} + {{Text|1|#F580B1}} - {{Text|1|#F580B1}}) + {{Text|<nowiki>"]"</nowiki>|#FFB100}}
            tsize = id.tsize {{Text|<nowiki>'used later to determine element size of fixed length strings</nowiki>|#919191}}
            {{Text|<nowiki>'note: array references consist of idnumber|unmultiplied-element-index</nowiki>|#919191}}
            index$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - {{Cl|INSTR}}(e$, sp3)) {{Text|<nowiki>'get element index</nowiki>|#919191}}
            bytes$ = {{Text|variablesize$|#55FF55}}({{Text|-1|#F580B1}})
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                e$ = {{Text|<nowiki>"(("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")->chr)"</nowiki>|#FFB100}} {{Text|<nowiki>'[2013] handle fixed string arrays differently because they are already pointers</nowiki>|#919191}}
            {{Cl|ELSE}}
                e$ = {{Text|<nowiki>"(&("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"))"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'          print "CI: array: e$["+e$+"], bytes$["+bytes$+"]":sleep 1</nowiki>|#919191}}
            {{Text|<nowiki>'calculate size of elements</nowiki>|#919191}}
            {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                bytes = tsize
            {{Cl|ELSE}}
                bytes = (sourcetyp {{Cl|AND}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}}
            {{Cl|END}} {{Cl|IF}}
            bytes$ = bytes$ + {{Text|<nowiki>"-("</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bytes) + {{Text|<nowiki>"*("</nowiki>|#FFB100}} + index$ + {{Text|<nowiki>"))"</nowiki>|#FFB100}}
            t = {{Text|Type2MemTypeValue|#55FF55}}(sourcetyp)
            {{Text|evaluatetotyp$|#55FF55}} = {{Text|<nowiki>"(ptrszint)"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + bytes$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(t) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bytes) + {{Text|<nowiki>","</nowiki>|#FFB100}} + lk$
            {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'String</nowiki>|#919191}}
        {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
            {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} qb64prefix$ + {{Text|<nowiki>"MEM cannot reference variable-length strings"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            idnumber = {{Cl|VAL}}(e$)
            {{Text|getid|#55FF55}} idnumber: {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            bytes$ = {{Text|str2|#55FF55}}(id.tsize)
            e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}}): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            t = {{Text|Type2MemTypeValue|#55FF55}}(sourcetyp)
            {{Text|evaluatetotyp$|#55FF55}} = {{Text|<nowiki>"(ptrszint)"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"->chr,"</nowiki>|#FFB100}} + bytes$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(t) + {{Text|<nowiki>","</nowiki>|#FFB100}} + bytes$ + {{Text|<nowiki>",sf_mem_lock"</nowiki>|#FFB100}}
            {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'Standard variable -> byte_element(offset,bytes)</nowiki>|#919191}}
        e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|1|#F580B1}}) {{Text|<nowiki>'get the variable's formal name</nowiki>|#919191}}
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        size = (sourcetyp {{Cl|AND}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}} {{Text|<nowiki>'calculate its size in bytes</nowiki>|#919191}}
        t = {{Text|Type2MemTypeValue|#55FF55}}(sourcetyp)
        {{Text|evaluatetotyp$|#55FF55}} = {{Text|<nowiki>"(ptrszint)"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(size) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(t) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(size) + {{Text|<nowiki>",sf_mem_lock"</nowiki>|#FFB100}}
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'-7 _MEM structure helper</nowiki>|#919191}}
    {{Cl|IF}} targettyp = {{Text|-2|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'? -> byte_element(offset,max possible bytes)</nowiki>|#919191}}
        method2useall:
        {{Text|<nowiki>' print "CI: eval2typ detected target type of -2 for ["+a2$+"] evaluated as ["+e$+"]":sleep 1</nowiki>|#919191}}
        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected variable name/array element"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Variable/element cannot be BIT aligned"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Text|<nowiki>'User Defined Type -> byte_element(offset,bytes)</nowiki>|#919191}}
        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISUDT) {{Cl|THEN}}
            {{Text|<nowiki>'          print "CI: -2 type from a UDT":sleep 1</nowiki>|#919191}}
            idnumber = {{Cl|VAL}}(e$)
            i = {{Cl|INSTR}}(e$, sp3): e$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - i)
            u = {{Cl|VAL}}(e$) {{Text|<nowiki>'closest parent</nowiki>|#919191}}
            i = {{Cl|INSTR}}(e$, sp3): e$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - i)
            E = {{Cl|VAL}}(e$)
            i = {{Cl|INSTR}}(e$, sp3): e$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - i)
            o$ = e$
            {{Text|getid|#55FF55}} idnumber
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            n$ = {{Text|<nowiki>"UDT_"</nowiki>|#FFB100}} + {{Cl|RTRIM$}}(id.n): {{Cl|IF}} id.arraytype {{Cl|THEN}} n$ = {{Text|<nowiki>"ARRAY_"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]"</nowiki>|#FFB100}}
            method2usealludt:
            bytes$ = {{Text|variablesize$|#55FF55}}({{Text|-1|#F580B1}}) + {{Text|<nowiki>"-("</nowiki>|#FFB100}} + o$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            dst$ = {{Text|<nowiki>"(((char*)"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + n$ + {{Text|<nowiki>")+("</nowiki>|#FFB100}} + o$ + {{Text|<nowiki>"))"</nowiki>|#FFB100}}
            {{Text|evaluatetotyp$|#55FF55}} = {{Text|<nowiki>"byte_element((uint64)"</nowiki>|#FFB100}} + dst$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + bytes$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>")"</nowiki>|#FFB100}}
            {{Cl|IF}} targettyp = {{Text|-5|#F580B1}} {{Cl|THEN}} {{Text|evaluatetotyp$|#55FF55}} = bytes$
            {{Cl|IF}} targettyp = {{Text|-6|#F580B1}} {{Cl|THEN}} {{Text|evaluatetotyp$|#55FF55}} = dst$
            {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'Array reference -> byte_element(offset,bytes)</nowiki>|#919191}}
        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISARRAY) {{Cl|THEN}}
            {{Text|<nowiki>'array of variable length strings (special case, can only refer to single element)</nowiki>|#919191}}
            {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Cl|THEN}}
                    e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Text|evaluatetotyp$|#55FF55}} = {{Text|<nowiki>"byte_element((uint64)"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"->chr,"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"->len,"</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                    {{Cl|IF}} targettyp = {{Text|-5|#F580B1}} {{Cl|THEN}} {{Text|evaluatetotyp$|#55FF55}} = e$ + {{Text|<nowiki>"->len"</nowiki>|#FFB100}}
                    {{Cl|IF}} targettyp = {{Text|-6|#F580B1}} {{Cl|THEN}} {{Text|evaluatetotyp$|#55FF55}} = e$ + {{Text|<nowiki>"->chr"</nowiki>|#FFB100}}
                    {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            idnumber = {{Cl|VAL}}(e$)
            {{Text|getid|#55FF55}} idnumber
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            tsize = id.tsize {{Text|<nowiki>'used later to determine element size of fixed length strings</nowiki>|#919191}}
            {{Text|<nowiki>'note: array references consist of idnumber|unmultiplied-element-index</nowiki>|#919191}}
            index$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - {{Cl|INSTR}}(e$, sp3)) {{Text|<nowiki>'get element index</nowiki>|#919191}}
            bytes$ = {{Text|variablesize$|#55FF55}}({{Text|-1|#F580B1}})
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            e$ = {{Text|<nowiki>"(&("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"))"</nowiki>|#FFB100}}
            {{Text|<nowiki>'          print "CI: array: e$["+e$+"], bytes$["+bytes$+"]":sleep 1</nowiki>|#919191}}
            {{Text|<nowiki>'calculate size of elements</nowiki>|#919191}}
            {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                bytes = tsize
            {{Cl|ELSE}}
                bytes = (sourcetyp {{Cl|AND}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}}
            {{Cl|END}} {{Cl|IF}}
            bytes$ = bytes$ + {{Text|<nowiki>"-("</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bytes) + {{Text|<nowiki>"*("</nowiki>|#FFB100}} + index$ + {{Text|<nowiki>"))"</nowiki>|#FFB100}}
            {{Text|evaluatetotyp$|#55FF55}} = {{Text|<nowiki>"byte_element((uint64)"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + bytes$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>")"</nowiki>|#FFB100}}
            {{Cl|IF}} targettyp = {{Text|-5|#F580B1}} {{Cl|THEN}} {{Text|evaluatetotyp$|#55FF55}} = bytes$
            {{Cl|IF}} targettyp = {{Text|-6|#F580B1}} {{Cl|THEN}} {{Text|evaluatetotyp$|#55FF55}} = e$
            {{Text|<nowiki>'          print "CI: array ->["+"byte_element((uint64)" + e$ + "," + bytes$+ ","+NewByteElement$+")"+"]":sleep 1</nowiki>|#919191}}
            {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'String -> byte_element(offset,bytes)</nowiki>|#919191}}
        {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
            {{Cl|IF}} sourcetyp {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH {{Cl|THEN}}
                idnumber = {{Cl|VAL}}(e$)
                {{Text|getid|#55FF55}} idnumber
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                bytes$ = {{Text|str2|#55FF55}}(id.tsize)
                e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|ELSE}}
                e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                bytes$ = e$ + {{Text|<nowiki>"->len"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|evaluatetotyp$|#55FF55}} = {{Text|<nowiki>"byte_element((uint64)"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>"->chr,"</nowiki>|#FFB100}} + bytes$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>")"</nowiki>|#FFB100}}
            {{Cl|IF}} targettyp = {{Text|-5|#F580B1}} {{Cl|THEN}} {{Text|evaluatetotyp$|#55FF55}} = bytes$
            {{Cl|IF}} targettyp = {{Text|-6|#F580B1}} {{Cl|THEN}} {{Text|evaluatetotyp$|#55FF55}} = e$ + {{Text|<nowiki>"->chr"</nowiki>|#FFB100}}
            {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'Standard variable -> byte_element(offset,bytes)</nowiki>|#919191}}
        e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|1|#F580B1}}) {{Text|<nowiki>'get the variable's formal name</nowiki>|#919191}}
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        size = (sourcetyp {{Cl|AND}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}} {{Text|<nowiki>'calculate its size in bytes</nowiki>|#919191}}
        {{Text|evaluatetotyp$|#55FF55}} = {{Text|<nowiki>"byte_element((uint64)"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(size) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|NewByteElement$|#55FF55}} + {{Text|<nowiki>")"</nowiki>|#FFB100}}
        {{Cl|IF}} targettyp = {{Text|-5|#F580B1}} {{Cl|THEN}} {{Text|evaluatetotyp$|#55FF55}} = {{Text|str2|#55FF55}}(size)
        {{Cl|IF}} targettyp = {{Text|-6|#F580B1}} {{Cl|THEN}} {{Text|evaluatetotyp$|#55FF55}} = e$
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'-2 byte_element(offset,bytes)</nowiki>|#919191}}
    {{Text|<nowiki>'string?</nowiki>|#919191}}
    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) <> (targettyp {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}}
        {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Illegal string-number conversion"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}}
        {{Text|evaluatetotyp$|#55FF55}} = e$
        {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}}
            {{Text|evaluatetotyp$|#55FF55}} = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'pointer required?</nowiki>|#919191}}
    {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} ISPOINTER) {{Cl|THEN}}
        {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"evaluatetotyp received a request for a pointer (unsupported)"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Text|<nowiki>'...</nowiki>|#919191}}
        {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid pointer"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'change to "non-pointer" value</nowiki>|#919191}}
    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}}
        e$ = {{Text|refer|#55FF55}}(e$, sourcetyp, {{Text|0|#F580B1}})
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'check if successful</nowiki>|#919191}}
    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISPOINTER) {{Cl|THEN}}
        {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"evaluatetotyp couldn't convert pointer type!"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'round to integer if required</nowiki>|#919191}}
    {{Cl|IF}} (sourcetyp {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}}
        {{Cl|IF}} (targettyp {{Cl|AND (boolean)|AND}} ISFLOAT) = {{Text|0|#F580B1}} {{Cl|THEN}}
            bits = targettyp {{Cl|AND}} {{Text|511|#F580B1}}
            {{Text|<nowiki>'**32 rounding fix</nowiki>|#919191}}
            {{Cl|IF}} bits <= {{Text|16|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"qbr_float_to_long("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
            {{Cl|IF}} bits > {{Text|16|#F580B1}} {{Cl|AND (boolean)|AND}} bits < {{Text|32|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"qbr_double_to_long("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
            {{Cl|IF}} bits >= {{Text|32|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"qbr("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|evaluatetotyp$|#55FF55}} = e$
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|findid&|#55FF55}} (n2$)
    n$ = {{Cl|UCASE$}}(n2$) {{Text|<nowiki>'case insensitive</nowiki>|#919191}}
    {{Text|<nowiki>'return all strings as 'not found'</nowiki>|#919191}}
    {{Cl|IF}} {{Cl|ASC (function)|ASC}}(n$) = {{Text|34|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} noid
    {{Text|<nowiki>'if findidsecondarg was set, it will be used for finding the name of a sub (not a func or variable)</nowiki>|#919191}}
    secondarg$ = findidsecondarg: findidsecondarg = {{Text|<nowiki>""</nowiki>|#FFB100}}
    {{Text|<nowiki>'if findanotherid was set, findid will continue scan from last index, otherwise, it will begin a new search</nowiki>|#919191}}
    findanother = findanotherid: findanotherid = {{Text|0|#F580B1}}
    {{Cl|IF}} findanother <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} findidinternal <> {{Text|2|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"FINDID() ERROR: Invalid repeat search requested!"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}} {{Text|<nowiki>'cannot continue search, no more indexes left!</nowiki>|#919191}}
    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Text|<nowiki>'(the above should never happen)</nowiki>|#919191}}
    {{Text|findid&|#55FF55}} = {{Text|2|#F580B1}} {{Text|<nowiki>'2=not finished searching all indexes</nowiki>|#919191}}
    {{Text|<nowiki>'seperate symbol from name (if a symbol has been added), this is the only way symbols can be passed to findid</nowiki>|#919191}}
    i = {{Text|0|#F580B1}}
    i = {{Cl|INSTR}}(n$, {{Text|<nowiki>"~"</nowiki>|#FFB100}}): {{Cl|IF}} i {{Cl|THEN}} {{Cl|GOTO}} gotsc
    i = {{Cl|INSTR}}(n$, {{Text|<nowiki>"`"</nowiki>|#FFB100}}): {{Cl|IF}} i {{Cl|THEN}} {{Cl|GOTO}} gotsc
    i = {{Cl|INSTR}}(n$, {{Text|<nowiki>"%"</nowiki>|#FFB100}}): {{Cl|IF}} i {{Cl|THEN}} {{Cl|GOTO}} gotsc
    i = {{Cl|INSTR}}(n$, {{Text|<nowiki>"&"</nowiki>|#FFB100}}): {{Cl|IF}} i {{Cl|THEN}} {{Cl|GOTO}} gotsc
    i = {{Cl|INSTR}}(n$, {{Text|<nowiki>"!"</nowiki>|#FFB100}}): {{Cl|IF}} i {{Cl|THEN}} {{Cl|GOTO}} gotsc
    i = {{Cl|INSTR}}(n$, {{Text|<nowiki>"#"</nowiki>|#FFB100}}): {{Cl|IF}} i {{Cl|THEN}} {{Cl|GOTO}} gotsc
    i = {{Cl|INSTR}}(n$, {{Text|<nowiki>"$"</nowiki>|#FFB100}}): {{Cl|IF}} i {{Cl|THEN}} {{Cl|GOTO}} gotsc
    gotsc:
    {{Cl|IF}} i {{Cl|THEN}}
        sc$ = {{Cl|RIGHT$}}(n$, {{Cl|LEN}}(n$) - i + {{Text|1|#F580B1}}): n$ = {{Cl|LEFT$}}(n$, i - {{Text|1|#F580B1}})
        {{Cl|IF}} sc$ = {{Text|<nowiki>"`"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} sc$ = {{Text|<nowiki>"~`"</nowiki>|#FFB100}} {{Cl|THEN}} sc$ = sc$ + {{Text|<nowiki>"1"</nowiki>|#FFB100}} {{Text|<nowiki>'clarify abbreviated 1 bit reference</nowiki>|#919191}}
    {{Cl|ELSE}}
        {{Text|<nowiki>'''    'no symbol passed, so check what symbol could be assumed under the current DEF...</nowiki>|#919191}}
        {{Text|<nowiki>'''    v = ASC(n$): IF v = 95 THEN v = 27 ELSE v = v - 64</nowiki>|#919191}}
        {{Text|<nowiki>'''    IF v >= 1 AND v <= 27 THEN 'safeguard against n$ not being a standard name</nowiki>|#919191}}
        {{Text|<nowiki>'''        couldhavesc$ = defineextaz(v)</nowiki>|#919191}}
        {{Text|<nowiki>'''        IF couldhavesc$ = "`" OR couldhavesc$ = "~`" THEN couldhavesc$ = couldhavesc$ + "1" 'clarify abbreviated 1 bit reference</nowiki>|#919191}}
        {{Text|<nowiki>'''    END IF 'safeguard</nowiki>|#919191}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'optimizations for later comparisons</nowiki>|#919191}}
    insf$ = subfunc + {{Cl|SPACE$}}({{Text|256|#F580B1}} - {{Cl|LEN}}(subfunc))
    secondarg$ = secondarg$ + {{Cl|SPACE$}}({{Text|256|#F580B1}} - {{Cl|LEN}}(secondarg$))
    {{Cl|IF}} {{Cl|LEN}}(sc$) {{Cl|THEN}} scpassed = {{Text|1|#F580B1}}: sc$ = sc$ + {{Cl|SPACE$}}({{Text|8|#F580B1}} - {{Cl|LEN}}(sc$)) {{Cl|ELSE}} scpassed = {{Text|0|#F580B1}}
    {{Text|<nowiki>'''IF LEN(couldhavesc$) THEN couldhavesc$ = couldhavesc$ + SPACE$(8 - LEN(couldhavesc$)): couldhavescpassed = 1 ELSE couldhavescpassed = 0</nowiki>|#919191}}
    {{Cl|IF}} {{Cl|LEN}}(n$) < {{Text|256|#F580B1}} {{Cl|THEN}} n$ = n$ + {{Cl|SPACE$}}({{Text|256|#F580B1}} - {{Cl|LEN}}(n$))
    {{Text|<nowiki>'FUNCTION HashFind (a$, searchflags, resultflags, resultreference)</nowiki>|#919191}}
    {{Text|<nowiki>'(0,1,2)z=hashfind[rev]("RUMI",Hashflag_label,resflag,resref)</nowiki>|#919191}}
    {{Text|<nowiki>'0=doesn't exist</nowiki>|#919191}}
    {{Text|<nowiki>'1=found, no more items to scan</nowiki>|#919191}}
    {{Text|<nowiki>'2=found, more items still to scan</nowiki>|#919191}}
    {{Text|<nowiki>'NEW HASH SYSTEM</nowiki>|#919191}}
    n$ = {{Cl|RTRIM$}}(n$)
    {{Cl|IF}} findanother {{Cl|THEN}}
        hashretry:
        z = {{Text|HashFindCont|#55FF55}}(unrequired, i)
    {{Cl|ELSE}}
        z = {{Text|HashFind|#55FF55}}(n$, {{Text|1|#F580B1}}, unrequired, i)
    {{Cl|END}} {{Cl|IF}}
    findidinternal = z
    {{Cl|IF}} z = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} noid
    {{Text|findid|#55FF55}} = z
    {{Text|<nowiki>'continue from previous position?</nowiki>|#919191}}
    {{Text|<nowiki>''IF findanother THEN start = findidinternal ELSE start = idn</nowiki>|#919191}}
    {{Text|<nowiki>''FOR i = start TO 1 STEP -1</nowiki>|#919191}}
    {{Text|<nowiki>''    findidinternal = i - 1</nowiki>|#919191}}
    {{Text|<nowiki>''    IF findidinternal = 0 THEN findid& = 1 '1=found id, but no more to search</nowiki>|#919191}}
    {{Text|<nowiki>''    IF ids(i).n = n$ THEN 'same name?</nowiki>|#919191}}
    {{Text|<nowiki>'in scope?</nowiki>|#919191}}
    {{Cl|IF}} ids(i).subfunc = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} ids(i).share = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'scope check required (not a shared variable or the name of a sub/function)</nowiki>|#919191}}
        {{Cl|IF}} ids(i).insubfunc <> insf$ {{Cl|THEN}} {{Cl|GOTO}} findidnomatch
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'some subs require a second argument (eg. PUT #, DEF SEG, etc.)</nowiki>|#919191}}
    {{Cl|IF}} ids(i).subfunc = {{Text|2|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} {{Cl|ASC (function)|ASC}}(ids(i).secondargmustbe) <> {{Text|32|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'exists?</nowiki>|#919191}}
            {{Cl|IF}} {{Cl|RTRIM$}}(secondarg$) = {{Cl|UCASE$}}({{Cl|RTRIM$}}(ids(i).secondargmustbe)) {{Cl|THEN}}
            {{Cl|ELSEIF}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|LEFT$}}(ids(i).secondargmustbe, {{Text|1|#F580B1}}) = {{Text|<nowiki>"_"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} {{Cl|LEFT$}}(secondarg$, {{Text|1|#F580B1}}) <> {{Text|<nowiki>"_"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} {{Cl|RTRIM$}}(secondarg$) = {{Cl|UCASE$}}({{Cl|MID$ (function)|MID$}}({{Cl|RTRIM$}}(ids(i).secondargmustbe), {{Text|2|#F580B1}})) {{Cl|THEN}}
            {{Cl|ELSE}}
                {{Cl|GOTO}} findidnomatch
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} {{Cl|ASC (function)|ASC}}(ids(i).secondargcantbe) <> {{Text|32|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'exists?</nowiki>|#919191}}
            {{Cl|IF}} {{Cl|RTRIM$}}(secondarg$) <> {{Cl|UCASE$}}({{Cl|RTRIM$}}(ids(i).secondargcantbe)) {{Cl|THEN}}
            {{Cl|ELSEIF}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|LEFT$}}(ids(i).secondargcantbe, {{Text|1|#F580B1}}) = {{Text|<nowiki>"_"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} {{Cl|LEFT$}}(secondarg$, {{Text|1|#F580B1}}) <> {{Text|<nowiki>"_"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} {{Cl|RTRIM$}}(secondarg$) <> {{Cl|UCASE$}}({{Cl|MID$ (function)|MID$}}({{Cl|RTRIM$}}(ids(i).secondargcantbe), {{Text|2|#F580B1}})) {{Cl|THEN}}
            {{Cl|ELSE}}
                {{Cl|GOTO}} findidnomatch
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'second sub argument possible</nowiki>|#919191}}
    {{Text|<nowiki>'must have symbol?</nowiki>|#919191}}
    {{Text|<nowiki>'typically for variables defined automatically or by a symbol and not the full type name</nowiki>|#919191}}
    imusthave = {{Cl|CVI}}(ids(i).musthave) {{Text|<nowiki>'speed up checks of first 2 characters</nowiki>|#919191}}
    amusthave = imusthave {{Cl|AND}} {{Text|255|#F580B1}} {{Text|<nowiki>'speed up checks of first character</nowiki>|#919191}}
    {{Cl|IF}} amusthave <> {{Text|32|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} scpassed {{Cl|THEN}}
            {{Cl|IF}} sc$ = ids(i).musthave {{Cl|THEN}} {{Cl|GOTO}} findidok
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'''    IF couldhavescpassed THEN</nowiki>|#919191}}
        {{Text|<nowiki>'''        IF couldhavesc$ = ids(i).musthave THEN GOTO findidok</nowiki>|#919191}}
        {{Text|<nowiki>'''    END IF</nowiki>|#919191}}
        {{Text|<nowiki>'Q: why is the above triple-commented?</nowiki>|#919191}}
        {{Text|<nowiki>'A: because if something must have a symbol to refer to it, then a could-have is</nowiki>|#919191}}
        {{Text|<nowiki>'  not sufficient, and it could mask shared variables in global scope</nowiki>|#919191}}
        {{Text|<nowiki>'note: symbol defined fixed length strings cannot be referred to by $ without an extension</nowiki>|#919191}}
        {{Text|<nowiki>'note: sc$ and couldhavesc$ are already changed from ` to `1 to match stored musthave</nowiki>|#919191}}
        {{Cl|GOTO}} findidnomatch
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'may have symbol?</nowiki>|#919191}}
    {{Text|<nowiki>'typically for variables formally dim'd</nowiki>|#919191}}
    {{Text|<nowiki>'note: couldhavesc$ needn't be considered for mayhave checks</nowiki>|#919191}}
    {{Cl|IF}} scpassed {{Cl|THEN}} {{Text|<nowiki>'symbol was passed, so it must match the mayhave symbol</nowiki>|#919191}}
        imayhave = {{Cl|CVI}}(ids(i).mayhave) {{Text|<nowiki>'speed up checks of first 2 characters</nowiki>|#919191}}
        amayhave = imayhave {{Cl|AND}} {{Text|255|#F580B1}} {{Text|<nowiki>'speed up checks of first character</nowiki>|#919191}}
        {{Cl|IF}} amayhave = {{Text|32|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} findidnomatch {{Text|<nowiki>'it cannot have the symbol passed (nb. musthave symbols have already been ok'd)</nowiki>|#919191}}
        {{Text|<nowiki>'note: variable length strings are not a problem here, as they can only have one possible extension</nowiki>|#919191}}
        {{Cl|IF}} amayhave = {{Text|36|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'"$"</nowiki>|#919191}}
            {{Cl|IF}} imayhave <> {{Text|8228|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'"$ "</nowiki>|#919191}}
                {{Text|<nowiki>'it is a fixed length string</nowiki>|#919191}}
                {{Cl|IF}} {{Cl|CVI}}(sc$) = {{Text|8228|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} findidok {{Text|<nowiki>'allow myvariable$ to become myvariable$10</nowiki>|#919191}}
                {{Text|<nowiki>'allow later comparison to verify if extension is correct</nowiki>|#919191}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} sc$ <> ids(i).mayhave {{Cl|THEN}} {{Cl|GOTO}} findidnomatch
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'scpassed</nowiki>|#919191}}
    {{Text|<nowiki>'return id</nowiki>|#919191}}
    findidok:
    id = ids(i)
    t = id.t
    temp$ = {{Text|refer$|#55FF55}}({{Text|str2$|#55FF55}}(i), t, {{Text|1|#F580B1}})
    {{Text|manageVariableList|#55FF55}} {{Text|<nowiki>""</nowiki>|#FFB100}}, temp$, {{Text|0|#F580B1}}, {{Text|1|#F580B1}}
    currentid = i
    {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Text|<nowiki>'END IF 'same name</nowiki>|#919191}}
    findidnomatch:
    {{Text|<nowiki>'NEXT</nowiki>|#919191}}
    {{Cl|IF}} z = {{Text|2|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} hashretry
    {{Text|<nowiki>'totally unclassifiable</nowiki>|#919191}}
    noid:
    {{Text|findid&|#55FF55}} = {{Text|0|#F580B1}}
    currentid = {{Text|-1|#F580B1}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|FindArray|#55FF55}} (secure$)
    {{Text|FindArray|#55FF55}} = {{Text|-1|#F580B1}}
    n$ = secure$
    {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"func findarray:in:"</nowiki>|#FFB100}} + n$
    {{Cl|IF}} alphanumeric({{Cl|ASC (function)|ASC}}(n$)) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|FindArray|#55FF55}} = {{Text|0|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Text|<nowiki>'establish whether n$ includes an extension</nowiki>|#919191}}
    i = {{Cl|INSTR}}(n$, {{Text|<nowiki>"~"</nowiki>|#FFB100}}): {{Cl|IF}} i {{Cl|THEN}} sc$ = {{Cl|RIGHT$}}(n$, {{Cl|LEN}}(n$) - i + {{Text|1|#F580B1}}): n$ = {{Cl|LEFT$}}(n$, i - {{Text|1|#F580B1}}): {{Cl|GOTO}} gotsc2
    i = {{Cl|INSTR}}(n$, {{Text|<nowiki>"`"</nowiki>|#FFB100}}): {{Cl|IF}} i {{Cl|THEN}} sc$ = {{Cl|RIGHT$}}(n$, {{Cl|LEN}}(n$) - i + {{Text|1|#F580B1}}): n$ = {{Cl|LEFT$}}(n$, i - {{Text|1|#F580B1}}): {{Cl|GOTO}} gotsc2
    i = {{Cl|INSTR}}(n$, {{Text|<nowiki>"%"</nowiki>|#FFB100}}): {{Cl|IF}} i {{Cl|THEN}} sc$ = {{Cl|RIGHT$}}(n$, {{Cl|LEN}}(n$) - i + {{Text|1|#F580B1}}): n$ = {{Cl|LEFT$}}(n$, i - {{Text|1|#F580B1}}): {{Cl|GOTO}} gotsc2
    i = {{Cl|INSTR}}(n$, {{Text|<nowiki>"&"</nowiki>|#FFB100}}): {{Cl|IF}} i {{Cl|THEN}} sc$ = {{Cl|RIGHT$}}(n$, {{Cl|LEN}}(n$) - i + {{Text|1|#F580B1}}): n$ = {{Cl|LEFT$}}(n$, i - {{Text|1|#F580B1}}): {{Cl|GOTO}} gotsc2
    i = {{Cl|INSTR}}(n$, {{Text|<nowiki>"!"</nowiki>|#FFB100}}): {{Cl|IF}} i {{Cl|THEN}} sc$ = {{Cl|RIGHT$}}(n$, {{Cl|LEN}}(n$) - i + {{Text|1|#F580B1}}): n$ = {{Cl|LEFT$}}(n$, i - {{Text|1|#F580B1}}): {{Cl|GOTO}} gotsc2
    i = {{Cl|INSTR}}(n$, {{Text|<nowiki>"#"</nowiki>|#FFB100}}): {{Cl|IF}} i {{Cl|THEN}} sc$ = {{Cl|RIGHT$}}(n$, {{Cl|LEN}}(n$) - i + {{Text|1|#F580B1}}): n$ = {{Cl|LEFT$}}(n$, i - {{Text|1|#F580B1}}): {{Cl|GOTO}} gotsc2
    i = {{Cl|INSTR}}(n$, {{Text|<nowiki>"$"</nowiki>|#FFB100}}): {{Cl|IF}} i {{Cl|THEN}} sc$ = {{Cl|RIGHT$}}(n$, {{Cl|LEN}}(n$) - i + {{Text|1|#F580B1}}): n$ = {{Cl|LEFT$}}(n$, i - {{Text|1|#F580B1}}): {{Cl|GOTO}} gotsc2
    gotsc2:
    n2$ = n$ + sc$
    {{Cl|IF}} sc$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
        {{Text|<nowiki>'has an extension</nowiki>|#919191}}
        {{Text|<nowiki>'note! findid must unambiguify ` to `5 or $ to $10 where applicable</nowiki>|#919191}}
        try = {{Text|findid|#55FF55}}(n2$): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|DO}} {{Cl|WHILE}} try
            {{Cl|IF}} id.arraytype {{Cl|THEN}}
                {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(n2$) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|LOOP}}
    {{Cl|ELSE}}
        {{Text|<nowiki>'no extension</nowiki>|#919191}}
        {{Text|<nowiki>'1. pass as is, without any extension (local)</nowiki>|#919191}}
        try = {{Text|findid|#55FF55}}(n2$): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|DO}} {{Cl|WHILE}} try
            {{Cl|IF}} id.arraytype {{Cl|THEN}}
                {{Cl|IF}} subfuncn = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|IF}} id.insubfuncn = subfuncn {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(n2$) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|LOOP}}
        {{Text|<nowiki>'2. that failed, so apply the _define'd extension and pass (local)</nowiki>|#919191}}
        a = {{Cl|ASC (function)|ASC}}({{Cl|UCASE$}}(n$)): {{Cl|IF}} a = {{Text|95|#F580B1}} {{Cl|THEN}} a = {{Text|91|#F580B1}}
        a = a - {{Text|64|#F580B1}} {{Text|<nowiki>'so A=1, Z=27 and _=28</nowiki>|#919191}}
        n2$ = n$ + defineextaz(a)
        try = {{Text|findid|#55FF55}}(n2$): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|DO}} {{Cl|WHILE}} try
            {{Cl|IF}} id.arraytype {{Cl|THEN}}
                {{Cl|IF}} subfuncn = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|IF}} id.insubfuncn = subfuncn {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(n2$) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|LOOP}}
        {{Text|<nowiki>'3. pass as is, without any extension (global)</nowiki>|#919191}}
        n2$ = n$
        try = {{Text|findid|#55FF55}}(n2$): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|DO}} {{Cl|WHILE}} try
            {{Cl|IF}} id.arraytype {{Cl|THEN}}
                {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(n2$) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|LOOP}}
        {{Text|<nowiki>'4. that failed, so apply the _define'd extension and pass (global)</nowiki>|#919191}}
        a = {{Cl|ASC (function)|ASC}}({{Cl|UCASE$}}(n$)): {{Cl|IF}} a = {{Text|95|#F580B1}} {{Cl|THEN}} a = {{Text|91|#F580B1}}
        a = a - {{Text|64|#F580B1}} {{Text|<nowiki>'so A=1, Z=27 and _=28</nowiki>|#919191}}
        n2$ = n$ + defineextaz(a)
        try = {{Text|findid|#55FF55}}(n2$): {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|DO}} {{Cl|WHILE}} try
            {{Cl|IF}} id.arraytype {{Cl|THEN}}
                {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(n2$) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|LOOP}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|FindArray|#55FF55}} = {{Text|0|#F580B1}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|fixoperationorder$|#55FF55}} (savea$)
    {{Cl|STATIC}} uboundlbound {{Cl|AS}} {{Cl|_BYTE}}
    a$ = savea$
    {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"fixoperationorder:in:"</nowiki>|#FFB100}} + a$
    fooindwel = fooindwel + {{Text|1|#F580B1}}
    n = {{Text|numelements|#55FF55}}(a$) {{Text|<nowiki>'n is maintained throughout function</nowiki>|#919191}}
    {{Cl|IF}} fooindwel = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'actions to take on initial call only</nowiki>|#919191}}
        uboundlbound = {{Text|0|#F580B1}}
        {{Text|<nowiki>'Quick check for duplicate binary operations</nowiki>|#919191}}
        uppercasea$ = {{Cl|UCASE$}}(a$) {{Text|<nowiki>'capitalize it once to reduce calls to ucase over and over</nowiki>|#919191}}
        {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} n - {{Text|1|#F580B1}}
            temp1$ = {{Text|getelement|#55FF55}}(uppercasea$, i)
            temp2$ = {{Text|getelement|#55FF55}}(uppercasea$, i + {{Text|1|#F580B1}})
            {{Cl|IF}} temp1$ = {{Text|<nowiki>"AND"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} temp2$ = {{Text|<nowiki>"AND"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Error: AND AND"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|IF}} temp1$ = {{Text|<nowiki>"OR"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} temp2$ = {{Text|<nowiki>"OR"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Error: OR OR"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|IF}} temp1$ = {{Text|<nowiki>"XOR"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} temp2$ = {{Text|<nowiki>"XOR"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Error: XOR XOR"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|IF}} temp1$ = {{Text|<nowiki>"IMP"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} temp2$ = {{Text|<nowiki>"IMP"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Error: IMP IMP"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|IF}} temp1$ = {{Text|<nowiki>"EQV"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} temp2$ = {{Text|<nowiki>"EQV"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Error: EQV EQV"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|NEXT}}
        {{Text|<nowiki>'----------------A. 'Quick' mismatched brackets check----------------</nowiki>|#919191}}
        b = {{Text|0|#F580B1}}
        a2$ = sp + a$ + sp
        b1$ = sp + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp
        b2$ = sp + {{Text|<nowiki>")"</nowiki>|#FFB100}} + sp
        i = {{Text|1|#F580B1}}
        findmmb:
        i1 = {{Cl|INSTR}}(i, a2$, b1$)
        i2 = {{Cl|INSTR}}(i, a2$, b2$)
        i3 = i1
        {{Cl|IF}} i2 {{Cl|THEN}}
            {{Cl|IF}} i1 = {{Text|0|#F580B1}} {{Cl|THEN}}
                i3 = i2
            {{Cl|ELSE}}
                {{Cl|IF}} i2 < i1 {{Cl|THEN}} i3 = i2
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} i3 {{Cl|THEN}}
            {{Cl|IF}} i3 = i1 {{Cl|THEN}} b = b + {{Text|1|#F580B1}}
            {{Cl|IF}} i3 = i2 {{Cl|THEN}} b = b - {{Text|1|#F580B1}}
            i = i3 + {{Text|2|#F580B1}}
            {{Cl|IF}} b < {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Missing ("</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|GOTO}} findmmb
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} b > {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Missing )"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Text|<nowiki>'----------------B. 'Quick' correction of over-use of +,- ----------------</nowiki>|#919191}}
        {{Text|<nowiki>'note: the results of this change are beneficial to foolayout</nowiki>|#919191}}
        a2$ = sp + a$ + sp
        {{Text|<nowiki>'rule 1: change ++ to +</nowiki>|#919191}}
        rule1:
        i = {{Cl|INSTR}}(a2$, sp + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + sp)
        {{Cl|IF}} i {{Cl|THEN}}
            a2$ = {{Cl|LEFT$}}(a2$, i + {{Text|2|#F580B1}}) + {{Cl|RIGHT$}}(a2$, {{Cl|LEN}}(a2$) - i - {{Text|4|#F580B1}})
            a$ = {{Cl|MID$ (function)|MID$}}(a2$, {{Text|2|#F580B1}}, {{Cl|LEN}}(a2$) - {{Text|2|#F580B1}})
            n = n - {{Text|1|#F580B1}}
            {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"fixoperationorder:+/-:"</nowiki>|#FFB100}} + a$
            {{Cl|GOTO}} rule1
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'rule 2: change -+ to -</nowiki>|#919191}}
        rule2:
        i = {{Cl|INSTR}}(a2$, sp + {{Text|<nowiki>"-"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + sp)
        {{Cl|IF}} i {{Cl|THEN}}
            a2$ = {{Cl|LEFT$}}(a2$, i + {{Text|2|#F580B1}}) + {{Cl|RIGHT$}}(a2$, {{Cl|LEN}}(a2$) - i - {{Text|4|#F580B1}})
            a$ = {{Cl|MID$ (function)|MID$}}(a2$, {{Text|2|#F580B1}}, {{Cl|LEN}}(a2$) - {{Text|2|#F580B1}})
            n = n - {{Text|1|#F580B1}}
            {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"fixoperationorder:+/-:"</nowiki>|#FFB100}} + a$
            {{Cl|GOTO}} rule2
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'rule 3: change anyoperator-- to anyoperator</nowiki>|#919191}}
        rule3:
        {{Cl|IF}} {{Cl|INSTR}}(a2$, sp + {{Text|<nowiki>"-"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"-"</nowiki>|#FFB100}} + sp) {{Cl|THEN}}
            {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} n - {{Text|2|#F580B1}}
                {{Cl|IF}} {{Text|isoperator|#55FF55}}({{Text|getelement|#55FF55}}(a$, i)) {{Cl|THEN}}
                    {{Cl|IF}} {{Text|getelement|#55FF55}}(a$, i + {{Text|1|#F580B1}}) = {{Text|<nowiki>"-"</nowiki>|#FFB100}} {{Cl|THEN}}
                        {{Cl|IF}} {{Text|getelement|#55FF55}}(a$, i + {{Text|2|#F580B1}}) = {{Text|<nowiki>"-"</nowiki>|#FFB100}} {{Cl|THEN}}
                            {{Text|removeelements|#55FF55}} a$, i + {{Text|1|#F580B1}}, i + {{Text|2|#F580B1}}, {{Text|0|#F580B1}}
                            a2$ = sp + a$ + sp
                            n = n - {{Text|2|#F580B1}}
                            {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"fixoperationorder:+/-:"</nowiki>|#FFB100}} + a$
                            {{Cl|GOTO}} rule3
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|NEXT}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'rule 3</nowiki>|#919191}}
        {{Text|<nowiki>'----------------C. 'Quick' location of negation----------------</nowiki>|#919191}}
        {{Text|<nowiki>'note: the results of this change are beneficial to foolayout</nowiki>|#919191}}
        {{Text|<nowiki>'for numbers...</nowiki>|#919191}}
        {{Text|<nowiki>'before: anyoperator,-,number</nowiki>|#919191}}
        {{Text|<nowiki>'after:  anyoperator,-number</nowiki>|#919191}}
        {{Text|<nowiki>'for variables...</nowiki>|#919191}}
        {{Text|<nowiki>'before: anyoperator,-,variable</nowiki>|#919191}}
        {{Text|<nowiki>'after:  anyoperator,CHR$(241),variable</nowiki>|#919191}}
        {{Text|<nowiki>'exception for numbers followed by ^... (they will be bracketed up along with the ^ later)</nowiki>|#919191}}
        {{Text|<nowiki>'before: anyoperator,-,number,^</nowiki>|#919191}}
        {{Text|<nowiki>'after:  anyoperator,CHR$(241),number,^</nowiki>|#919191}}
        {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} n - {{Text|1|#F580B1}}
            {{Cl|IF}} i > n - {{Text|1|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}} {{Text|<nowiki>'n changes, so manually exit if required</nowiki>|#919191}}
            {{Cl|IF}} {{Cl|ASC (function)|ASC}}({{Text|getelement|#55FF55}}(a$, i)) = {{Text|45|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'-</nowiki>|#919191}}
                neg = {{Text|0|#F580B1}}
                {{Cl|IF}} i = {{Text|1|#F580B1}} {{Cl|THEN}}
                    neg = {{Text|1|#F580B1}}
                {{Cl|ELSE}}
                    a2$ = {{Text|getelement|#55FF55}}(a$, i - {{Text|1|#F580B1}})
                    c = {{Cl|ASC (function)|ASC}}(a2$)
                    {{Cl|IF}} c = {{Text|40|#F580B1}} {{Cl|OR (boolean)|OR}} c = {{Text|44|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'(,</nowiki>|#919191}}
                        neg = {{Text|1|#F580B1}}
                    {{Cl|ELSE}}
                        {{Cl|IF}} {{Text|isoperator|#55FF55}}(a2$) {{Cl|THEN}} neg = {{Text|1|#F580B1}}
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'()</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'i=1</nowiki>|#919191}}
                {{Cl|IF}} neg = {{Text|1|#F580B1}} {{Cl|THEN}}
                    a2$ = {{Text|getelement|#55FF55}}(a$, i + {{Text|1|#F580B1}})
                    c = {{Cl|ASC (function)|ASC}}(a2$)
                    {{Cl|IF}} c >= {{Text|48|#F580B1}} {{Cl|AND (boolean)|AND}} c <= {{Text|57|#F580B1}} {{Cl|THEN}}
                        c2 = {{Text|0|#F580B1}}: {{Cl|IF}} i < n - {{Text|1|#F580B1}} {{Cl|THEN}} c2 = {{Cl|ASC (function)|ASC}}({{Text|getelement|#55FF55}}(a$, i + {{Text|2|#F580B1}}))
                        {{Cl|IF}} c2 <> {{Text|94|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'not ^</nowiki>|#919191}}
                            {{Text|<nowiki>'number...</nowiki>|#919191}}
                            i2 = {{Cl|INSTR}}(a2$, {{Text|<nowiki>","</nowiki>|#FFB100}})
                            {{Cl|IF}} i2 {{Cl|AND (boolean)|AND}} {{Cl|ASC (function)|ASC}}(a2$, i2 + {{Text|1|#F580B1}}) <> {{Text|38|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'&H/&O/&B values don't need the assumed negation</nowiki>|#919191}}
                                a2$ = {{Text|<nowiki>"-"</nowiki>|#FFB100}} + {{Cl|LEFT$}}(a2$, i2) + {{Text|<nowiki>"-"</nowiki>|#FFB100}} + {{Cl|RIGHT$}}(a2$, {{Cl|LEN}}(a2$) - i2)
                            {{Cl|ELSE}}
                                a2$ = {{Text|<nowiki>"-"</nowiki>|#FFB100}} + a2$
                            {{Cl|END}} {{Cl|IF}}
                            {{Text|removeelements|#55FF55}} a$, i, i + {{Text|1|#F580B1}}, {{Text|0|#F580B1}}
                            {{Text|insertelements|#55FF55}} a$, i - {{Text|1|#F580B1}}, a2$
                            n = n - {{Text|1|#F580B1}}
                            {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"fixoperationorder:negation:"</nowiki>|#FFB100}} + a$
                            {{Cl|GOTO}} negdone
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|<nowiki>'not a number (or for exceptions)...</nowiki>|#919191}}
                    {{Text|removeelements|#55FF55}} a$, i, i, {{Text|0|#F580B1}}
                    {{Text|insertelements|#55FF55}} a$, i - {{Text|1|#F580B1}}, {{Cl|CHR$}}({{Text|241|#F580B1}})
                    {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"fixoperationorder:negation:"</nowiki>|#FFB100}} + a$
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'isoperator</nowiki>|#919191}}
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'-</nowiki>|#919191}}
            negdone:
        {{Cl|NEXT}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'fooindwel=1</nowiki>|#919191}}
    {{Text|<nowiki>'----------------D. 'Quick' Add 'power of' with negation {}bracketing to bottom bracket level----------------</nowiki>|#919191}}
    pownegused = {{Text|0|#F580B1}}
    powneg:
    {{Cl|IF}} {{Cl|INSTR}}(a$, {{Text|<nowiki>"^"</nowiki>|#FFB100}} + sp + {{Cl|CHR$}}({{Text|241|#F580B1}})) {{Cl|THEN}} {{Text|<nowiki>'quick check</nowiki>|#919191}}
        b = {{Text|0|#F580B1}}
        b1 = {{Text|0|#F580B1}}
        {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} n
            a2$ = {{Text|getelement|#55FF55}}(a$, i)
            c = {{Cl|ASC (function)|ASC}}(a2$)
            {{Cl|IF}} c = {{Text|40|#F580B1}} {{Cl|THEN}} b = b + {{Text|1|#F580B1}}
            {{Cl|IF}} c = {{Text|41|#F580B1}} {{Cl|THEN}} b = b - {{Text|1|#F580B1}}
            {{Cl|IF}} b = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} b1 {{Cl|THEN}}
                    {{Cl|IF}} {{Text|isoperator|#55FF55}}(a2$) {{Cl|THEN}}
                        {{Cl|IF}} a2$ <> {{Text|<nowiki>"^"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} a2$ <> {{Cl|CHR$}}({{Text|241|#F580B1}}) {{Cl|THEN}}
                            {{Text|insertelements|#55FF55}} a$, i - {{Text|1|#F580B1}}, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                            {{Text|insertelements|#55FF55}} a$, b1, {{Text|<nowiki>"{"</nowiki>|#FFB100}}
                            n = n + {{Text|2|#F580B1}}
                            {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"fixoperationorder:^-:"</nowiki>|#FFB100}} + a$
                            {{Cl|GOTO}} powneg
                            pownegused = {{Text|1|#F580B1}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} c = {{Text|94|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'^</nowiki>|#919191}}
                    {{Cl|IF}} {{Text|getelement$|#55FF55}}(a$, i + {{Text|1|#F580B1}}) = {{Cl|CHR$}}({{Text|241|#F580B1}}) {{Cl|THEN}} b1 = i: i = i + {{Text|1|#F580B1}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'b=0</nowiki>|#919191}}
        {{Cl|NEXT}} i
        {{Cl|IF}} b1 {{Cl|THEN}}
            {{Text|insertelements|#55FF55}} a$, b1, {{Text|<nowiki>"{"</nowiki>|#FFB100}}
            a$ = a$ + sp + {{Text|<nowiki>"}"</nowiki>|#FFB100}}
            n = n + {{Text|2|#F580B1}}
            {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"fixoperationorder:^-:"</nowiki>|#FFB100}} + a$
            pownegused = {{Text|1|#F580B1}}
            {{Cl|GOTO}} powneg
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'quick check</nowiki>|#919191}}
    {{Text|<nowiki>'----------------E. Find lowest & highest operator level in bottom bracket level----------------</nowiki>|#919191}}
    NOT_recheck:
    lco = {{Text|255|#F580B1}}
    hco = {{Text|0|#F580B1}}
    b = {{Text|0|#F580B1}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} n
        a2$ = {{Text|getelement|#55FF55}}(a$, i)
        c = {{Cl|ASC (function)|ASC}}(a2$)
        {{Cl|IF}} c = {{Text|40|#F580B1}} {{Cl|OR (boolean)|OR}} c = {{Text|123|#F580B1}} {{Cl|THEN}} b = b + {{Text|1|#F580B1}}
        {{Cl|IF}} c = {{Text|41|#F580B1}} {{Cl|OR (boolean)|OR}} c = {{Text|125|#F580B1}} {{Cl|THEN}} b = b - {{Text|1|#F580B1}}
        {{Cl|IF}} b = {{Text|0|#F580B1}} {{Cl|THEN}}
            op = {{Text|isoperator|#55FF55}}(a2$)
            {{Cl|IF}} op {{Cl|THEN}}
                {{Cl|IF}} op < lco {{Cl|THEN}} lco = op
                {{Cl|IF}} op > hco {{Cl|THEN}} hco = op
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|NEXT}}
    {{Text|<nowiki>'----------------F. Add operator {}bracketting----------------</nowiki>|#919191}}
    {{Text|<nowiki>'apply bracketting only if required</nowiki>|#919191}}
    {{Cl|IF}} hco <> {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'operators were used</nowiki>|#919191}}
        {{Cl|IF}} lco <> hco {{Cl|THEN}}
            {{Text|<nowiki>'brackets needed</nowiki>|#919191}}
            {{Cl|IF}} lco = {{Text|6|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'NOT exception</nowiki>|#919191}}
                {{Text|<nowiki>'Step 1: Add brackets as follows ~~~ ( NOT ( ~~~ NOT ~~~ NOT ~~~ NOT ~~~ ))</nowiki>|#919191}}
                {{Text|<nowiki>'Step 2: Recheck line from beginning</nowiki>|#919191}}
                {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected NOT ..."</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                b = {{Text|0|#F580B1}}
                {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} n
                    a2$ = {{Text|getelement|#55FF55}}(a$, i)
                    c = {{Cl|ASC (function)|ASC}}(a2$)
                    {{Cl|IF}} c = {{Text|40|#F580B1}} {{Cl|OR (boolean)|OR}} c = {{Text|123|#F580B1}} {{Cl|THEN}} b = b + {{Text|1|#F580B1}}
                    {{Cl|IF}} c = {{Text|41|#F580B1}} {{Cl|OR (boolean)|OR}} c = {{Text|125|#F580B1}} {{Cl|THEN}} b = b - {{Text|1|#F580B1}}
                    {{Cl|IF}} b = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} {{Cl|UCASE$}}(a2$) = {{Text|<nowiki>"NOT"</nowiki>|#FFB100}} {{Cl|THEN}}
                            {{Cl|IF}} i = n {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected NOT ..."</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                            {{Cl|IF}} i = {{Text|1|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"NOT"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"{"</nowiki>|#FFB100}} + sp + {{Text|getelements$|#55FF55}}(a$, {{Text|2|#F580B1}}, n) + sp + {{Text|<nowiki>"}"</nowiki>|#FFB100}}: n = n + {{Text|2|#F580B1}}: {{Cl|GOTO}} lco_bracketting_done
                            a$ = {{Text|getelements$|#55FF55}}(a$, {{Text|1|#F580B1}}, i - {{Text|1|#F580B1}}) + sp + {{Text|<nowiki>"{"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"NOT"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"{"</nowiki>|#FFB100}} + sp + {{Text|getelements$|#55FF55}}(a$, i + {{Text|1|#F580B1}}, n) + sp + {{Text|<nowiki>"}"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"}"</nowiki>|#FFB100}}
                            n = n + {{Text|4|#F580B1}}
                            {{Cl|GOTO}} NOT_recheck
                        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'not</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'b=0</nowiki>|#919191}}
                {{Cl|NEXT}}
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'NOT exception</nowiki>|#919191}}
            n2 = n
            b = {{Text|0|#F580B1}}
            a3$ = {{Text|<nowiki>"{"</nowiki>|#FFB100}}
            n = {{Text|1|#F580B1}}
            {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} n2
                a2$ = {{Text|getelement|#55FF55}}(a$, i)
                c = {{Cl|ASC (function)|ASC}}(a2$)
                {{Cl|IF}} c = {{Text|40|#F580B1}} {{Cl|OR (boolean)|OR}} c = {{Text|123|#F580B1}} {{Cl|THEN}} b = b + {{Text|1|#F580B1}}
                {{Cl|IF}} c = {{Text|41|#F580B1}} {{Cl|OR (boolean)|OR}} c = {{Text|125|#F580B1}} {{Cl|THEN}} b = b - {{Text|1|#F580B1}}
                {{Cl|IF}} b = {{Text|0|#F580B1}} {{Cl|THEN}}
                    op = {{Text|isoperator|#55FF55}}(a2$)
                    {{Cl|IF}} op = lco {{Cl|THEN}}
                        {{Cl|IF}} i = {{Text|1|#F580B1}} {{Cl|THEN}}
                            a3$ = a2$ + sp + {{Text|<nowiki>"{"</nowiki>|#FFB100}}
                            n = {{Text|2|#F580B1}}
                        {{Cl|ELSE}}
                            {{Cl|IF}} i = n2 {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected variable/value after '"</nowiki>|#FFB100}} + {{Cl|UCASE$}}(a2$) + {{Text|<nowiki>"'"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                            a3$ = a3$ + sp + {{Text|<nowiki>"}"</nowiki>|#FFB100}} + sp + a2$ + sp + {{Text|<nowiki>"{"</nowiki>|#FFB100}}
                            n = n + {{Text|3|#F580B1}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|GOTO}} fixop0
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'b=0</nowiki>|#919191}}
                a3$ = a3$ + sp + a2$
                n = n + {{Text|1|#F580B1}}
                fixop0:
            {{Cl|NEXT}}
            a3$ = a3$ + sp + {{Text|<nowiki>"}"</nowiki>|#FFB100}}
            n = n + {{Text|1|#F580B1}}
            a$ = a3$
            lco_bracketting_done:
            {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"fixoperationorder:lco bracketing["</nowiki>|#FFB100}}; lco; {{Text|<nowiki>","</nowiki>|#FFB100}}; hco; {{Text|<nowiki>"]:"</nowiki>|#FFB100}} + a$
            {{Text|<nowiki>'--------(F)G. Remove indwelling {}bracketting from power-negation--------</nowiki>|#919191}}
            {{Cl|IF}} pownegused {{Cl|THEN}}
                b = {{Text|0|#F580B1}}
                i = {{Text|0|#F580B1}}
                {{Cl|DO}}
                    i = i + {{Text|1|#F580B1}}
                    {{Cl|IF}} i > n {{Cl|THEN}} {{Cl|EXIT}} {{Cl|DO}}
                    c = {{Cl|ASC (function)|ASC}}({{Text|getelement|#55FF55}}(a$, i))
                    {{Cl|IF}} c = {{Text|41|#F580B1}} {{Cl|OR (boolean)|OR}} c = {{Text|125|#F580B1}} {{Cl|THEN}} b = b - {{Text|1|#F580B1}}
                    {{Cl|IF}} (c = {{Text|123|#F580B1}} {{Cl|OR (boolean)|OR}} c = {{Text|125|#F580B1}}) {{Cl|AND (boolean)|AND}} b <> {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Text|removeelements|#55FF55}} a$, i, i, {{Text|0|#F580B1}}
                        n = n - {{Text|1|#F580B1}}
                        i = i - {{Text|1|#F580B1}}
                        {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"fixoperationorder:^- {} removed:"</nowiki>|#FFB100}} + a$
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} c = {{Text|40|#F580B1}} {{Cl|OR (boolean)|OR}} c = {{Text|123|#F580B1}} {{Cl|THEN}} b = b + {{Text|1|#F580B1}}
                {{Cl|LOOP}}
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'pownegused</nowiki>|#919191}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'lco <> hco</nowiki>|#919191}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'hco <> 0</nowiki>|#919191}}
    {{Text|<nowiki>'--------Bracketting of multiple NOT/negation unary operators--------</nowiki>|#919191}}
    {{Cl|IF}} {{Cl|LEFT$}}(a$, {{Text|4|#F580B1}}) = {{Cl|CHR$}}({{Text|241|#F580B1}}) + sp + {{Cl|CHR$}}({{Text|241|#F580B1}}) + sp {{Cl|THEN}}
        a$ = {{Cl|CHR$}}({{Text|241|#F580B1}}) + sp + {{Text|<nowiki>"{"</nowiki>|#FFB100}} + sp + {{Text|getelements$|#55FF55}}(a$, {{Text|2|#F580B1}}, n) + sp + {{Text|<nowiki>"}"</nowiki>|#FFB100}}: n = n + {{Text|2|#F580B1}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} {{Cl|UCASE$}}({{Cl|LEFT$}}(a$, {{Text|8|#F580B1}})) = {{Text|<nowiki>"NOT"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"NOT"</nowiki>|#FFB100}} + sp {{Cl|THEN}}
        a$ = {{Text|<nowiki>"NOT"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"{"</nowiki>|#FFB100}} + sp + {{Text|getelements$|#55FF55}}(a$, {{Text|2|#F580B1}}, n) + sp + {{Text|<nowiki>"}"</nowiki>|#FFB100}}: n = n + {{Text|2|#F580B1}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'----------------H. Identification/conversion of elements within bottom bracket level----------------</nowiki>|#919191}}
    {{Text|<nowiki>'actions performed:</nowiki>|#919191}}
    {{Text|<nowiki>'  ->builds f$(tlayout)</nowiki>|#919191}}
    {{Text|<nowiki>'  ->adds symbols to all numbers</nowiki>|#919191}}
    {{Text|<nowiki>'  ->evaluates constants to numbers</nowiki>|#919191}}
    f$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
    b = {{Text|0|#F580B1}}
    c = {{Text|0|#F580B1}}
    lastt = {{Text|0|#F580B1}}: lastti = {{Text|0|#F580B1}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} n
        f2$ = {{Text|getelement|#55FF55}}(a$, i)
        lastc = c
        c = {{Cl|ASC (function)|ASC}}(f2$)
        {{Cl|IF}} c = {{Text|40|#F580B1}} {{Cl|OR (boolean)|OR}} c = {{Text|123|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} c <> {{Text|40|#F580B1}} {{Cl|OR (boolean)|OR}} b <> {{Text|0|#F580B1}} {{Cl|THEN}} f2$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Text|<nowiki>'skip temporary & indwelling  brackets</nowiki>|#919191}}
            b = b + {{Text|1|#F580B1}}
            {{Cl|GOTO}} classdone
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} c = {{Text|41|#F580B1}} {{Cl|OR (boolean)|OR}} c = {{Text|125|#F580B1}} {{Cl|THEN}}
            b = b - {{Text|1|#F580B1}}
            {{Text|<nowiki>'check for "("+sp+")" after literal-string, operator, number or nothing</nowiki>|#919191}}
            {{Cl|IF}} b = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'must be within the lowest level</nowiki>|#919191}}
                {{Cl|IF}} c = {{Text|41|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} lastc = {{Text|40|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} lastti = i - {{Text|2|#F580B1}} {{Cl|OR (boolean)|OR}} lastti = {{Text|0|#F580B1}} {{Cl|THEN}}
                            {{Cl|IF}} lastt >= {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} lastt <= {{Text|3|#F580B1}} {{Cl|THEN}}
                                {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Unexpected ("</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} c <> {{Text|41|#F580B1}} {{Cl|OR (boolean)|OR}} b <> {{Text|0|#F580B1}} {{Cl|THEN}} f2$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Text|<nowiki>'skip temporary & indwelling  brackets</nowiki>|#919191}}
            {{Cl|GOTO}} classdone
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} b = {{Text|0|#F580B1}} {{Cl|THEN}}
            {{Text|<nowiki>'classifications/conversions:</nowiki>|#919191}}
            {{Text|<nowiki>'1. quoted string ("....)</nowiki>|#919191}}
            {{Text|<nowiki>'2. number</nowiki>|#919191}}
            {{Text|<nowiki>'3. operator</nowiki>|#919191}}
            {{Text|<nowiki>'4. constant</nowiki>|#919191}}
            {{Text|<nowiki>'5. variable/array/udt/function (note: nothing can share the same name as a function except a label)</nowiki>|#919191}}
            {{Text|<nowiki>'quoted string?</nowiki>|#919191}}
            {{Cl|IF}} c = {{Text|34|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'"</nowiki>|#919191}}
                lastt = {{Text|1|#F580B1}}: lastti = i
                {{Text|<nowiki>'convert \\ to \</nowiki>|#919191}}
                {{Text|<nowiki>'convert \??? to CHR$(&O???)</nowiki>|#919191}}
                x2 = {{Text|1|#F580B1}}
                x = {{Cl|INSTR}}(x2, f2$, {{Text|<nowiki>"\"</nowiki>|#FFB100}})
                {{Cl|DO}} {{Cl|WHILE}} x
                    c2 = {{Cl|ASC (function)|ASC}}(f2$, x + {{Text|1|#F580B1}})
                    {{Cl|IF}} c2 = {{Text|92|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'\\</nowiki>|#919191}}
                        f2$ = {{Cl|LEFT$}}(f2$, x) + {{Cl|RIGHT$}}(f2$, {{Cl|LEN}}(f2$) - x - {{Text|1|#F580B1}}) {{Text|<nowiki>'remove second \</nowiki>|#919191}}
                        x2 = x + {{Text|1|#F580B1}}
                    {{Cl|ELSE}}
                        {{Text|<nowiki>'octal triplet value</nowiki>|#919191}}
                        c3 = ({{Cl|ASC (function)|ASC}}(f2$, x + {{Text|3|#F580B1}}) - {{Text|48|#F580B1}}) + ({{Cl|ASC (function)|ASC}}(f2$, x + {{Text|2|#F580B1}}) - {{Text|48|#F580B1}}) * {{Text|8|#F580B1}} + ({{Cl|ASC (function)|ASC}}(f2$, x + {{Text|1|#F580B1}}) - {{Text|48|#F580B1}}) * {{Text|64|#F580B1}}
                        f2$ = {{Cl|LEFT$}}(f2$, x - {{Text|1|#F580B1}}) + {{Cl|CHR$}}(c3) + {{Cl|RIGHT$}}(f2$, {{Cl|LEN}}(f2$) - x - {{Text|3|#F580B1}})
                        x2 = x + {{Text|1|#F580B1}}
                    {{Cl|END}} {{Cl|IF}}
                    x = {{Cl|INSTR}}(x2, f2$, {{Text|<nowiki>"\"</nowiki>|#FFB100}})
                {{Cl|LOOP}}
                {{Text|<nowiki>'remove ',len' (if it exists)</nowiki>|#919191}}
                x = {{Cl|INSTR}}({{Text|2|#F580B1}}, f2$, {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>","</nowiki>|#FFB100}}): {{Cl|IF}} x {{Cl|THEN}} f2$ = {{Cl|LEFT$}}(f2$, x)
                {{Cl|GOTO}} classdone
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'number?</nowiki>|#919191}}
            {{Cl|IF}} (c >= {{Text|48|#F580B1}} {{Cl|AND (boolean)|AND}} c <= {{Text|57|#F580B1}}) {{Cl|OR (boolean)|OR}} c = {{Text|45|#F580B1}} {{Cl|THEN}}
                lastt = {{Text|2|#F580B1}}: lastti = i
                x = {{Cl|INSTR}}(f2$, {{Text|<nowiki>","</nowiki>|#FFB100}})
                {{Cl|IF}} x {{Cl|THEN}}
                    {{Text|removeelements|#55FF55}} a$, i, i, {{Text|0|#F580B1}}: {{Text|insertelements|#55FF55}} a$, i - {{Text|1|#F580B1}}, {{Cl|LEFT$}}(f2$, x - {{Text|1|#F580B1}})
                    f2$ = {{Cl|RIGHT$}}(f2$, {{Cl|LEN}}(f2$) - x)
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} x = {{Text|0|#F580B1}} {{Cl|THEN}}
                    c2 = {{Cl|ASC (function)|ASC}}(f2$, {{Cl|LEN}}(f2$))
                    {{Cl|IF}} c2 < {{Text|48|#F580B1}} {{Cl|OR (boolean)|OR}} c2 > {{Text|57|#F580B1}} {{Cl|THEN}}
                        x = {{Text|1|#F580B1}} {{Text|<nowiki>'extension given</nowiki>|#919191}}
                    {{Cl|ELSE}}
                        x = {{Cl|INSTR}}(f2$, {{Text|<nowiki>"`"</nowiki>|#FFB100}})
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'add appropriate integer symbol if none present</nowiki>|#919191}}
                {{Cl|IF}} x = {{Text|0|#F580B1}} {{Cl|THEN}}
                    f3$ = f2$
                    s$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    {{Cl|IF}} c = {{Text|45|#F580B1}} {{Cl|THEN}}
                        s$ = {{Text|<nowiki>"&&"</nowiki>|#FFB100}}
                        {{Cl|IF}} (f3$ < {{Text|<nowiki>"-2147483648"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} {{Cl|LEN}}(f3$) = {{Text|11|#F580B1}}) {{Cl|OR (boolean)|OR}} {{Cl|LEN}}(f3$) < {{Text|11|#F580B1}} {{Cl|THEN}} s$ = {{Text|<nowiki>"&"</nowiki>|#FFB100}}
                        {{Cl|IF}} (f3$ <= {{Text|<nowiki>"-32768"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} {{Cl|LEN}}(f3$) = {{Text|6|#F580B1}}) {{Cl|OR (boolean)|OR}} {{Cl|LEN}}(f3$) < {{Text|6|#F580B1}} {{Cl|THEN}} s$ = {{Text|<nowiki>"%"</nowiki>|#FFB100}}
                    {{Cl|ELSE}}
                        s$ = {{Text|<nowiki>"~&&"</nowiki>|#FFB100}}
                        {{Cl|IF}} (f3$ <= {{Text|<nowiki>"9223372036854775807"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} {{Cl|LEN}}(f3$) = {{Text|19|#F580B1}}) {{Cl|OR (boolean)|OR}} {{Cl|LEN}}(f3$) < {{Text|19|#F580B1}} {{Cl|THEN}} s$ = {{Text|<nowiki>"&&"</nowiki>|#FFB100}}
                        {{Cl|IF}} (f3$ <= {{Text|<nowiki>"2147483647"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} {{Cl|LEN}}(f3$) = {{Text|10|#F580B1}}) {{Cl|OR (boolean)|OR}} {{Cl|LEN}}(f3$) < {{Text|10|#F580B1}} {{Cl|THEN}} s$ = {{Text|<nowiki>"&"</nowiki>|#FFB100}}
                        {{Cl|IF}} (f3$ <= {{Text|<nowiki>"32767"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} {{Cl|LEN}}(f3$) = {{Text|5|#F580B1}}) {{Cl|OR (boolean)|OR}} {{Cl|LEN}}(f3$) < {{Text|5|#F580B1}} {{Cl|THEN}} s$ = {{Text|<nowiki>"%"</nowiki>|#FFB100}}
                    {{Cl|END}} {{Cl|IF}}
                    f3$ = f3$ + s$
                    {{Text|removeelements|#55FF55}} a$, i, i, {{Text|0|#F580B1}}: {{Text|insertelements|#55FF55}} a$, i - {{Text|1|#F580B1}}, f3$
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'x=0</nowiki>|#919191}}
                {{Cl|GOTO}} classdone
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'operator?</nowiki>|#919191}}
            {{Cl|IF}} {{Text|isoperator|#55FF55}}(f2$) {{Cl|THEN}}
                lastt = {{Text|3|#F580B1}}: lastti = i
                {{Cl|IF}} {{Cl|LEN}}(f2$) > {{Text|1|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} f2$ <> {{Text|SCase2$|#55FF55}}(f2$) {{Cl|THEN}}
                        f2$ = {{Text|SCase2$|#55FF55}}(f2$)
                        {{Text|removeelements|#55FF55}} a$, i, i, {{Text|0|#F580B1}}
                        {{Text|insertelements|#55FF55}} a$, i - {{Text|1|#F580B1}}, f2$
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'append negation</nowiki>|#919191}}
                {{Cl|IF}} f2$ = {{Cl|CHR$}}({{Text|241|#F580B1}}) {{Cl|THEN}} f$ = f$ + sp + {{Text|<nowiki>"-"</nowiki>|#FFB100}}: {{Cl|GOTO}} classdone_special
                {{Cl|GOTO}} classdone
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} alphanumeric(c) {{Cl|THEN}}
                lastt = {{Text|4|#F580B1}}: lastti = i
                {{Cl|IF}} i < n {{Cl|THEN}} nextc = {{Cl|ASC (function)|ASC}}({{Text|getelement|#55FF55}}(a$, i + {{Text|1|#F580B1}})) {{Cl|ELSE}} nextc = {{Text|0|#F580B1}}
                {{Text|<nowiki>' a constant?</nowiki>|#919191}}
                {{Cl|IF}} nextc <> {{Text|40|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'<>"(" (not an array)</nowiki>|#919191}}
                    {{Cl|IF}} lastc <> {{Text|46|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'<>"." (not an element of a UDT)</nowiki>|#919191}}
                        e$ = {{Cl|UCASE$}}(f2$)
                        es$ = {{Text|removesymbol$|#55FF55}}(e$)
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                        hashfound = {{Text|0|#F580B1}}
                        hashname$ = e$
                        hashchkflags = HASHFLAG_CONSTANT
                        hashres = {{Text|HashFindRev|#55FF55}}(hashname$, hashchkflags, hashresflags, hashresref)
                        {{Cl|DO}} {{Cl|WHILE}} hashres
                            {{Cl|IF}} constsubfunc(hashresref) = subfuncn {{Cl|OR (boolean)|OR}} constsubfunc(hashresref) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                {{Cl|IF}} constdefined(hashresref) {{Cl|THEN}}
                                    hashfound = {{Text|1|#F580B1}}
                                    {{Cl|EXIT}} {{Cl|DO}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                            {{Cl|IF}} hashres <> {{Text|1|#F580B1}} {{Cl|THEN}} hashres = {{Text|HashFindCont|#55FF55}}(hashresflags, hashresref) {{Cl|ELSE}} hashres = {{Text|0|#F580B1}}
                        {{Cl|LOOP}}
                        {{Cl|IF}} hashfound {{Cl|THEN}}
                            i2 = hashresref
                            {{Text|<nowiki>'FOR i2 = constlast TO 0 STEP -1</nowiki>|#919191}}
                            {{Text|<nowiki>'IF e$ = constname(i2) THEN</nowiki>|#919191}}
                            {{Text|<nowiki>'is a STATIC variable overriding this constant?</nowiki>|#919191}}
                            staticvariable = {{Text|0|#F580B1}}
                            try = {{Text|findid|#55FF55}}(e$ + es$)
                            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                            {{Cl|DO}} {{Cl|WHILE}} try
                                {{Cl|IF}} id.arraytype = {{Text|0|#F580B1}} {{Cl|THEN}} staticvariable = {{Text|1|#F580B1}}: {{Cl|EXIT}} {{Cl|DO}} {{Text|<nowiki>'if it's not an array, it's probably a static variable</nowiki>|#919191}}
                                {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(e$ + es$) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
                                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                            {{Cl|LOOP}}
                            {{Text|<nowiki>'add symbol and try again</nowiki>|#919191}}
                            {{Cl|IF}} staticvariable = {{Text|0|#F580B1}} {{Cl|THEN}}
                                {{Cl|IF}} {{Cl|LEN}}(es$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    a = {{Cl|ASC (function)|ASC}}({{Cl|UCASE$}}(e$)): {{Cl|IF}} a = {{Text|95|#F580B1}} {{Cl|THEN}} a = {{Text|91|#F580B1}}
                                    a = a - {{Text|64|#F580B1}} {{Text|<nowiki>'so A=1, Z=27 and _=28</nowiki>|#919191}}
                                    es2$ = defineextaz(a)
                                    try = {{Text|findid|#55FF55}}(e$ + es2$)
                                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                                    {{Cl|DO}} {{Cl|WHILE}} try
                                        {{Cl|IF}} id.arraytype = {{Text|0|#F580B1}} {{Cl|THEN}} staticvariable = {{Text|1|#F580B1}}: {{Cl|EXIT}} {{Cl|DO}} {{Text|<nowiki>'if it's not an array, it's probably a static variable</nowiki>|#919191}}
                                        {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(e$ + es2$) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
                                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                                    {{Cl|LOOP}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                            {{Cl|IF}} staticvariable = {{Text|0|#F580B1}} {{Cl|THEN}}
                                t = consttype(i2)
                                {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|LEN}}(es$) > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} es$ <> {{Text|<nowiki>"$"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Type mismatch"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                                    e$ = conststring(i2)
                                {{Cl|ELSE}} {{Text|<nowiki>'not a string</nowiki>|#919191}}
                                    {{Cl|IF}} {{Cl|LEN}}(es$) {{Cl|THEN}} et = {{Text|typname2typ|#55FF55}}(es$) {{Cl|ELSE}} et = {{Text|0|#F580B1}}
                                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                                    {{Cl|IF}} et {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Type mismatch"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                                    {{Text|<nowiki>'convert value to general formats</nowiki>|#919191}}
                                    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISFLOAT {{Cl|THEN}}
                                        v## = constfloat(i2)
                                        v&& = v##
                                        v~&& = v&&
                                    {{Cl|ELSE}}
                                        {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISUNSIGNED {{Cl|THEN}}
                                            v~&& = constuinteger(i2)
                                            v&& = v~&&
                                            v## = v&&
                                        {{Cl|ELSE}}
                                            v&& = constinteger(i2)
                                            v## = v&&
                                            v~&& = v&&
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Text|<nowiki>'apply type conversion if necessary</nowiki>|#919191}}
                                    {{Cl|IF}} et {{Cl|THEN}} t = et
                                    {{Text|<nowiki>'(todo: range checking)</nowiki>|#919191}}
                                    {{Text|<nowiki>'convert value into string for returning</nowiki>|#919191}}
                                    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISFLOAT {{Cl|THEN}}
                                        e$ = {{Cl|LTRIM$}}({{Cl|RTRIM$}}({{Cl|STR$}}(v##)))
                                    {{Cl|ELSE}}
                                        {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISUNSIGNED {{Cl|THEN}}
                                            e$ = {{Cl|LTRIM$}}({{Cl|RTRIM$}}({{Cl|STR$}}(v~&&)))
                                        {{Cl|ELSE}}
                                            e$ = {{Cl|LTRIM$}}({{Cl|RTRIM$}}({{Cl|STR$}}(v&&)))
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Text|<nowiki>'floats returned by str$ must be converted to qb64 standard format</nowiki>|#919191}}
                                    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISFLOAT {{Cl|THEN}}
                                        t2 = t {{Cl|AND}} {{Text|511|#F580B1}}
                                        {{Text|<nowiki>'find E,D or F</nowiki>|#919191}}
                                        s$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                                        {{Cl|IF}} {{Cl|INSTR}}(e$, {{Text|<nowiki>"E"</nowiki>|#FFB100}}) {{Cl|THEN}} s$ = {{Text|<nowiki>"E"</nowiki>|#FFB100}}
                                        {{Cl|IF}} {{Cl|INSTR}}(e$, {{Text|<nowiki>"D"</nowiki>|#FFB100}}) {{Cl|THEN}} s$ = {{Text|<nowiki>"D"</nowiki>|#FFB100}}
                                        {{Cl|IF}} {{Cl|INSTR}}(e$, {{Text|<nowiki>"F"</nowiki>|#FFB100}}) {{Cl|THEN}} s$ = {{Text|<nowiki>"F"</nowiki>|#FFB100}}
                                        {{Cl|IF}} {{Cl|LEN}}(s$) {{Cl|THEN}}
                                            {{Text|<nowiki>'E,D,F found</nowiki>|#919191}}
                                            x = {{Cl|INSTR}}(e$, s$)
                                            {{Text|<nowiki>'as incorrect type letter may have been returned by STR$, override it</nowiki>|#919191}}
                                            {{Cl|IF}} t2 = {{Text|32|#F580B1}} {{Cl|THEN}} s$ = {{Text|<nowiki>"E"</nowiki>|#FFB100}}
                                            {{Cl|IF}} t2 = {{Text|64|#F580B1}} {{Cl|THEN}} s$ = {{Text|<nowiki>"D"</nowiki>|#FFB100}}
                                            {{Cl|IF}} t2 = {{Text|256|#F580B1}} {{Cl|THEN}} s$ = {{Text|<nowiki>"F"</nowiki>|#FFB100}}
                                            {{Cl|MID$}}(e$, x, {{Text|1|#F580B1}}) = s$
                                            {{Cl|IF}} {{Cl|INSTR}}(e$, {{Text|<nowiki>"."</nowiki>|#FFB100}}) = {{Text|0|#F580B1}} {{Cl|THEN}} e$ = {{Cl|LEFT$}}(e$, x - {{Text|1|#F580B1}}) + {{Text|<nowiki>".0"</nowiki>|#FFB100}} + {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - x + {{Text|1|#F580B1}}): x = x + {{Text|2|#F580B1}}
                                            {{Cl|IF}} {{Cl|LEFT$}}(e$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"."</nowiki>|#FFB100}} {{Cl|THEN}} e$ = {{Text|<nowiki>"0"</nowiki>|#FFB100}} + e$
                                            {{Cl|IF}} {{Cl|LEFT$}}(e$, {{Text|2|#F580B1}}) = {{Text|<nowiki>"-."</nowiki>|#FFB100}} {{Cl|THEN}} e$ = {{Text|<nowiki>"-0"</nowiki>|#FFB100}} + {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - {{Text|1|#F580B1}})
                                            {{Cl|IF}} {{Cl|INSTR}}(e$, {{Text|<nowiki>"+"</nowiki>|#FFB100}}) = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|INSTR}}(e$, {{Text|<nowiki>"-"</nowiki>|#FFB100}}) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                                e$ = {{Cl|LEFT$}}(e$, x) + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - x)
                                            {{Cl|END}} {{Cl|IF}}
                                        {{Cl|ELSE}}
                                            {{Text|<nowiki>'E,D,F not found</nowiki>|#919191}}
                                            {{Cl|IF}} {{Cl|INSTR}}(e$, {{Text|<nowiki>"."</nowiki>|#FFB100}}) = {{Text|0|#F580B1}} {{Cl|THEN}} e$ = e$ + {{Text|<nowiki>".0"</nowiki>|#FFB100}}
                                            {{Cl|IF}} {{Cl|LEFT$}}(e$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"."</nowiki>|#FFB100}} {{Cl|THEN}} e$ = {{Text|<nowiki>"0"</nowiki>|#FFB100}} + e$
                                            {{Cl|IF}} {{Cl|LEFT$}}(e$, {{Text|2|#F580B1}}) = {{Text|<nowiki>"-."</nowiki>|#FFB100}} {{Cl|THEN}} e$ = {{Text|<nowiki>"-0"</nowiki>|#FFB100}} + {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - {{Text|1|#F580B1}})
                                            {{Cl|IF}} t2 = {{Text|32|#F580B1}} {{Cl|THEN}} e$ = e$ + {{Text|<nowiki>"E+0"</nowiki>|#FFB100}}
                                            {{Cl|IF}} t2 = {{Text|64|#F580B1}} {{Cl|THEN}} e$ = e$ + {{Text|<nowiki>"D+0"</nowiki>|#FFB100}}
                                            {{Cl|IF}} t2 = {{Text|256|#F580B1}} {{Cl|THEN}} e$ = e$ + {{Text|<nowiki>"F+0"</nowiki>|#FFB100}}
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|ELSE}}
                                        s$ = {{Text|typevalue2symbol$|#55FF55}}(t)
                                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                                        e$ = e$ + s$ {{Text|<nowiki>'simply append symbol to integer</nowiki>|#919191}}
                                    {{Cl|END}} {{Cl|IF}}
                                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'not a string</nowiki>|#919191}}
                                {{Text|removeelements|#55FF55}} a$, i, i, {{Text|0|#F580B1}}
                                {{Text|insertelements|#55FF55}} a$, i - {{Text|1|#F580B1}}, e$
                                {{Text|<nowiki>'alter f2$ here to original casing</nowiki>|#919191}}
                                f2$ = constcname(i2) + es$
                                {{Cl|GOTO}} classdone
                            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'not static</nowiki>|#919191}}
                            {{Text|<nowiki>'END IF 'same name</nowiki>|#919191}}
                            {{Text|<nowiki>'NEXT</nowiki>|#919191}}
                        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'hashfound</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'not udt element</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'not array</nowiki>|#919191}}
                {{Text|<nowiki>'variable/array/udt?</nowiki>|#919191}}
                u$ = f2$
                try_string$ = f2$
                try_string2$ = try_string$ {{Text|<nowiki>'pure version of try_string$</nowiki>|#919191}}
                {{Cl|FOR}} try_method = {{Text|1|#F580B1}} {{Cl|TO}} {{Text|4|#F580B1}}
                    try_string$ = try_string2$
                    {{Cl|IF}} try_method = {{Text|2|#F580B1}} {{Cl|OR (boolean)|OR}} try_method = {{Text|4|#F580B1}} {{Cl|THEN}}
                        dtyp$ = {{Text|removesymbol|#55FF55}}(try_string$)
                        {{Cl|IF}} {{Cl|LEN}}(dtyp$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                            {{Cl|IF}} {{Text|isoperator|#55FF55}}(try_string$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                {{Cl|IF}} {{Text|isvalidvariable|#55FF55}}(try_string$) {{Cl|THEN}}
                                    {{Cl|IF}} {{Cl|LEFT$}}(try_string$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"_"</nowiki>|#FFB100}} {{Cl|THEN}} v = {{Text|27|#F580B1}} {{Cl|ELSE}} v = {{Cl|ASC (function)|ASC}}({{Cl|UCASE$}}(try_string$)) - {{Text|64|#F580B1}}
                                    try_string$ = try_string$ + defineextaz(v)
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|ELSE}}
                            try_string$ = try_string2$
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                    try = {{Text|findid|#55FF55}}(try_string$)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|DO}} {{Cl|WHILE}} try
                        {{Cl|IF}} (subfuncn = id.insubfuncn {{Cl|AND (boolean)|AND}} try_method <= {{Text|2|#F580B1}}) {{Cl|OR (boolean)|OR}} try_method >= {{Text|3|#F580B1}} {{Cl|THEN}}
                            {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"found id matching "</nowiki>|#FFB100}} + f2$
                            {{Cl|IF}} nextc = {{Text|40|#F580B1}} {{Cl|OR (boolean)|OR}} uboundlbound <> {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'(</nowiki>|#919191}}
                                uboundlbound = {{Text|0|#F580B1}}
                                {{Text|<nowiki>'function or array?</nowiki>|#919191}}
                                {{Cl|IF}} id.arraytype <> {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} id.subfunc = {{Text|1|#F580B1}} {{Cl|THEN}}
                                    {{Text|<nowiki>'note: even if it's an array of UDTs, the bracketted index will follow immediately</nowiki>|#919191}}
                                    {{Text|<nowiki>'correct name</nowiki>|#919191}}
                                    f3$ = f2$
                                    s$ = {{Text|removesymbol$|#55FF55}}(f3$)
                                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                                    {{Cl|IF}} id.internal_subfunc {{Cl|THEN}}
                                        f2$ = {{Text|SCase$|#55FF55}}({{Cl|RTRIM$}}(id.cn)) + s$
                                        {{Cl|IF}} ({{Cl|UCASE$}}(f2$) = {{Text|<nowiki>"UBOUND"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} {{Cl|UCASE$}}(f2$) = {{Text|<nowiki>"LBOUND"</nowiki>|#FFB100}}) {{Cl|THEN}}
                                            uboundlbound = {{Text|2|#F580B1}}
                                        {{Cl|END}} {{Cl|IF}}
                                    {{Cl|ELSE}}
                                        f2$ = {{Cl|RTRIM$}}(id.cn) + s$
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Text|removeelements|#55FF55}} a$, i, i, {{Text|0|#F580B1}}
                                    {{Text|insertelements|#55FF55}} a$, i - {{Text|1|#F580B1}}, {{Cl|UCASE$}}(f2$)
                                    f$ = f$ + f2$ + sp + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp
                                    {{Text|<nowiki>'skip (but record with nothing inside them) brackets</nowiki>|#919191}}
                                    b2 = {{Text|1|#F580B1}} {{Text|<nowiki>'already in first bracket</nowiki>|#919191}}
                                    {{Cl|FOR}} i2 = i + {{Text|2|#F580B1}} {{Cl|TO}} n
                                        c2 = {{Cl|ASC (function)|ASC}}({{Text|getelement|#55FF55}}(a$, i2))
                                        {{Cl|IF}} c2 = {{Text|40|#F580B1}} {{Cl|THEN}} b2 = b2 + {{Text|1|#F580B1}}
                                        {{Cl|IF}} c2 = {{Text|41|#F580B1}} {{Cl|THEN}} b2 = b2 - {{Text|1|#F580B1}}
                                        {{Cl|IF}} b2 = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}} {{Text|<nowiki>'note: mismatched brackets check ensures this always succeeds</nowiki>|#919191}}
                                        f$ = f$ + sp
                                    {{Cl|NEXT}}
                                    {{Text|<nowiki>'adjust i accordingly</nowiki>|#919191}}
                                    i = i2
                                    f$ = f$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                                    {{Text|<nowiki>'jump to UDT section if array is of UDT type (and elements are referenced)</nowiki>|#919191}}
                                    {{Cl|IF}} id.arraytype {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
                                        {{Cl|IF}} i < n {{Cl|THEN}} nextc = {{Cl|ASC (function)|ASC}}({{Text|getelement|#55FF55}}(a$, i + {{Text|1|#F580B1}})) {{Cl|ELSE}} nextc = {{Text|0|#F580B1}}
                                        {{Cl|IF}} nextc = {{Text|46|#F580B1}} {{Cl|THEN}} t = id.arraytype: {{Cl|GOTO}} fooudt
                                    {{Cl|END}} {{Cl|IF}}
                                    f$ = f$ + sp
                                    {{Cl|GOTO}} classdone_special
                                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'id.arraytype</nowiki>|#919191}}
                            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'nextc "("</nowiki>|#919191}}
                            {{Cl|IF}} nextc <> {{Text|40|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'not "(" (this avoids confusing simple variables with arrays)</nowiki>|#919191}}
                                {{Cl|IF}} id.t <> {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} id.subfunc = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'simple variable or function (without parameters)</nowiki>|#919191}}
                                    {{Cl|IF}} id.t {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
                                        {{Text|<nowiki>'note: it may or may not be followed by a period (eg. if whole udt is being referred to)</nowiki>|#919191}}
                                        {{Text|<nowiki>'check if next item is a period</nowiki>|#919191}}
                                        {{Text|<nowiki>'correct name</nowiki>|#919191}}
                                        {{Cl|IF}} id.internal_subfunc {{Cl|THEN}}
                                            f2$ = {{Text|SCase$|#55FF55}}({{Cl|RTRIM$}}(id.cn)) + {{Text|removesymbol$|#55FF55}}(f2$)
                                        {{Cl|ELSE}}
                                            f2$ = {{Cl|RTRIM$}}(id.cn) + {{Text|removesymbol$|#55FF55}}(f2$)
                                        {{Cl|END}} {{Cl|IF}}
                                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                                        {{Text|removeelements|#55FF55}} a$, i, i, {{Text|0|#F580B1}}
                                        {{Text|insertelements|#55FF55}} a$, i - {{Text|1|#F580B1}}, {{Cl|UCASE$}}(f2$)
                                        f$ = f$ + f2$
                                        {{Cl|IF}} nextc <> {{Text|46|#F580B1}} {{Cl|THEN}} f$ = f$ + sp: {{Cl|GOTO}} classdone_special {{Text|<nowiki>'no sub-elements referenced</nowiki>|#919191}}
                                        t = id.t
                                        fooudt:
                                        f$ = f$ + sp + {{Text|<nowiki>"."</nowiki>|#FFB100}} + sp
                                        E = udtxnext(t {{Cl|AND}} {{Text|511|#F580B1}}) {{Text|<nowiki>'next element to check</nowiki>|#919191}}
                                        i = i + {{Text|2|#F580B1}}
                                        {{Text|<nowiki>'loop</nowiki>|#919191}}
                                        {{Text|<nowiki>'"." encountered, i must be an element</nowiki>|#919191}}
                                        {{Cl|IF}} i > n {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected .element"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                                        f2$ = {{Text|getelement|#55FF55}}(a$, i)
                                        s$ = {{Text|removesymbol$|#55FF55}}(f2$)
                                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                                        u$ = {{Cl|UCASE$}}(f2$) + {{Cl|SPACE$}}({{Text|256|#F580B1}} - {{Cl|LEN}}(f2$)) {{Text|<nowiki>'fast scanning</nowiki>|#919191}}
                                        {{Text|<nowiki>'is f$ the same as element e?</nowiki>|#919191}}
                                        fooudtnexte:
                                        {{Cl|IF}} udtename(E) = u$ {{Cl|THEN}}
                                            {{Text|<nowiki>'match found</nowiki>|#919191}}
                                            {{Text|<nowiki>'todo: check symbol(s$) matches element's type</nowiki>|#919191}}
                                            {{Text|<nowiki>'correct name</nowiki>|#919191}}
                                            f2$ = {{Cl|RTRIM$}}(udtecname(E)) + s$
                                            {{Text|removeelements|#55FF55}} a$, i, i, {{Text|0|#F580B1}}
                                            {{Text|insertelements|#55FF55}} a$, i - {{Text|1|#F580B1}}, {{Cl|UCASE$}}(f2$)
                                            f$ = f$ + f2$
                                            {{Cl|IF}} i = n {{Cl|THEN}} f$ = f$ + sp: {{Cl|GOTO}} classdone_special
                                            nextc = {{Cl|ASC (function)|ASC}}({{Text|getelement|#55FF55}}(a$, i + {{Text|1|#F580B1}}))
                                            {{Cl|IF}} nextc <> {{Text|46|#F580B1}} {{Cl|THEN}} f$ = f$ + sp: {{Cl|GOTO}} classdone_special {{Text|<nowiki>'no sub-elements referenced</nowiki>|#919191}}
                                            {{Text|<nowiki>'sub-element exists</nowiki>|#919191}}
                                            t = udtetype(E)
                                            {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISUDT) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid . after element"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                                            {{Cl|GOTO}} fooudt
                                        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'match found</nowiki>|#919191}}
                                        {{Text|<nowiki>'no, so check next element</nowiki>|#919191}}
                                        E = udtenext(E)
                                        {{Cl|IF}} E = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Element not defined"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                                        {{Cl|GOTO}} fooudtnexte
                                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'udt</nowiki>|#919191}}
                                    {{Text|<nowiki>'non array/udt based variable</nowiki>|#919191}}
                                    f3$ = f2$
                                    s$ = {{Text|removesymbol$|#55FF55}}(f3$)
                                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                                    {{Cl|IF}} id.internal_subfunc {{Cl|THEN}}
                                        f2$ = {{Text|SCase$|#55FF55}}({{Cl|RTRIM$}}(id.cn)) + s$
                                    {{Cl|ELSE}}
                                        f2$ = {{Cl|RTRIM$}}(id.cn) + s$
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Text|<nowiki>'change was is returned to uppercase</nowiki>|#919191}}
                                    {{Text|removeelements|#55FF55}} a$, i, i, {{Text|0|#F580B1}}
                                    {{Text|insertelements|#55FF55}} a$, i - {{Text|1|#F580B1}}, {{Cl|UCASE$}}(f2$)
                                    {{Cl|GOTO}} CouldNotClassify
                                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'id.t</nowiki>|#919191}}
                            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'nextc not "("</nowiki>|#919191}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} try = {{Text|2|#F580B1}} {{Cl|THEN}} findanotherid = {{Text|1|#F580B1}}: try = {{Text|findid|#55FF55}}(try_string$) {{Cl|ELSE}} try = {{Text|0|#F580B1}}
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|LOOP}}
                {{Cl|NEXT}} {{Text|<nowiki>'try method (1-4)</nowiki>|#919191}}
                CouldNotClassify:
                {{Text|<nowiki>'alphanumeric, but item name is unknown... is it an internal type? if so, use capitals</nowiki>|#919191}}
                f3$ = {{Cl|UCASE$}}(f2$)
                internaltype = {{Text|0|#F580B1}}
                {{Cl|IF}} f3$ = {{Text|<nowiki>"STRING"</nowiki>|#FFB100}} {{Cl|THEN}} internaltype = {{Text|1|#F580B1}}
                {{Cl|IF}} f3$ = {{Text|<nowiki>"_UNSIGNED"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (f3$ = {{Text|<nowiki>"UNSIGNED"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}} internaltype = {{Text|1|#F580B1}}
                {{Cl|IF}} f3$ = {{Text|<nowiki>"_BIT"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (f3$ = {{Text|<nowiki>"BIT"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}} internaltype = {{Text|1|#F580B1}}
                {{Cl|IF}} f3$ = {{Text|<nowiki>"_BYTE"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (f3$ = {{Text|<nowiki>"BYTE"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}} internaltype = {{Text|1|#F580B1}}
                {{Cl|IF}} f3$ = {{Text|<nowiki>"INTEGER"</nowiki>|#FFB100}} {{Cl|THEN}} internaltype = {{Text|1|#F580B1}}
                {{Cl|IF}} f3$ = {{Text|<nowiki>"LONG"</nowiki>|#FFB100}} {{Cl|THEN}} internaltype = {{Text|1|#F580B1}}
                {{Cl|IF}} f3$ = {{Text|<nowiki>"_INTEGER64"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (f3$ = {{Text|<nowiki>"INTEGER64"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}} internaltype = {{Text|1|#F580B1}}
                {{Cl|IF}} f3$ = {{Text|<nowiki>"SINGLE"</nowiki>|#FFB100}} {{Cl|THEN}} internaltype = {{Text|1|#F580B1}}
                {{Cl|IF}} f3$ = {{Text|<nowiki>"DOUBLE"</nowiki>|#FFB100}} {{Cl|THEN}} internaltype = {{Text|1|#F580B1}}
                {{Cl|IF}} f3$ = {{Text|<nowiki>"_FLOAT"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (f3$ = {{Text|<nowiki>"FLOAT"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}} internaltype = {{Text|1|#F580B1}}
                {{Cl|IF}} f3$ = {{Text|<nowiki>"_OFFSET"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (f3$ = {{Text|<nowiki>"OFFSET"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}} internaltype = {{Text|1|#F580B1}}
                {{Cl|IF}} internaltype = {{Text|1|#F580B1}} {{Cl|THEN}}
                    f2$ = {{Text|SCase2$|#55FF55}}(f3$)
                    {{Text|removeelements|#55FF55}} a$, i, i, {{Text|0|#F580B1}}
                    {{Text|insertelements|#55FF55}} a$, i - {{Text|1|#F580B1}}, f3$
                    {{Cl|GOTO}} classdone
                {{Cl|END}} {{Cl|IF}}
                {{Cl|GOTO}} classdone
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'alphanumeric</nowiki>|#919191}}
            classdone:
            f$ = f$ + f2$
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'b=0</nowiki>|#919191}}
        f$ = f$ + sp
        classdone_special:
    {{Cl|NEXT}}
    {{Cl|IF}} {{Cl|LEN}}(f$) {{Cl|THEN}} f$ = {{Cl|LEFT$}}(f$, {{Cl|LEN}}(f$) - {{Text|1|#F580B1}}) {{Text|<nowiki>'remove trailing 'sp'</nowiki>|#919191}}
    {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"fixoperationorder:identification:"</nowiki>|#FFB100}} + a$, n
    {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"fixoperationorder:identification(layout):"</nowiki>|#FFB100}} + f$, n
    {{Text|<nowiki>'----------------I. Pass (){}bracketed items (if any) to fixoperationorder & build return----------------</nowiki>|#919191}}
    {{Text|<nowiki>'note: items seperated by commas are done seperately</nowiki>|#919191}}
    ff$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
    b = {{Text|0|#F580B1}}
    b2 = {{Text|0|#F580B1}}
    p1 = {{Text|0|#F580B1}} {{Text|<nowiki>'where level 1 began</nowiki>|#919191}}
    aa$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
    n = {{Text|numelements|#55FF55}}(a$)
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} n
        openbracket = {{Text|0|#F580B1}}
        a2$ = {{Text|getelement|#55FF55}}(a$, i)
        c = {{Cl|ASC (function)|ASC}}(a2$)
        {{Cl|IF}} c = {{Text|40|#F580B1}} {{Cl|OR (boolean)|OR}} c = {{Text|123|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'({</nowiki>|#919191}}
            b = b + {{Text|1|#F580B1}}
            {{Cl|IF}} b = {{Text|1|#F580B1}} {{Cl|THEN}}
                p1 = i + {{Text|1|#F580B1}}
                aa$ = aa$ + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp
            {{Cl|END}} {{Cl|IF}}
            openbracket = {{Text|1|#F580B1}}
            {{Cl|GOTO}} foopass
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'({</nowiki>|#919191}}
        {{Cl|IF}} c = {{Text|44|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>',</nowiki>|#919191}}
            {{Cl|IF}} b = {{Text|1|#F580B1}} {{Cl|THEN}}
                {{Cl|GOTO}} foopassit
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} c = {{Text|41|#F580B1}} {{Cl|OR (boolean)|OR}} c = {{Text|125|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>')}</nowiki>|#919191}}
            {{Cl|IF}} uboundlbound {{Cl|THEN}} uboundlbound = uboundlbound - {{Text|1|#F580B1}}
            b = b - {{Text|1|#F580B1}}
            {{Cl|IF}} b = {{Text|0|#F580B1}} {{Cl|THEN}}
                foopassit:
                {{Cl|IF}} p1 <> i {{Cl|THEN}}
                    foo$ = {{Text|fixoperationorder|#55FF55}}({{Text|getelements|#55FF55}}(a$, p1, i - {{Text|1|#F580B1}}))
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|IF}} {{Cl|LEN}}(foo$) {{Cl|THEN}}
                        aa$ = aa$ + foo$ + sp
                        {{Cl|IF}} c = {{Text|125|#F580B1}} {{Cl|THEN}} ff$ = ff$ + tlayout$ + sp {{Cl|ELSE}} ff$ = ff$ + tlayout$ + sp2 {{Text|<nowiki>'spacing between ) } , varies</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} c = {{Text|44|#F580B1}} {{Cl|THEN}} aa$ = aa$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp: ff$ = ff$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + sp {{Cl|ELSE}} aa$ = aa$ + {{Text|<nowiki>")"</nowiki>|#FFB100}} + sp
                p1 = i + {{Text|1|#F580B1}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|GOTO}} foopass
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>')}</nowiki>|#919191}}
        {{Cl|IF}} b = {{Text|0|#F580B1}} {{Cl|THEN}} aa$ = aa$ + a2$ + sp
        foopass:
        f2$ = {{Text|getelementspecial|#55FF55}}(f$, i)
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} {{Cl|LEN}}(f2$) {{Cl|THEN}}
            {{Text|<nowiki>'use sp2 to join items connected by a period</nowiki>|#919191}}
            {{Cl|IF}} c = {{Text|46|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'"."</nowiki>|#919191}}
                {{Cl|IF}} i > {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} i < n {{Cl|THEN}} {{Text|<nowiki>'stupidity check</nowiki>|#919191}}
                    {{Cl|IF}} {{Cl|LEN}}(ff$) {{Cl|THEN}} {{Cl|MID$}}(ff$, {{Cl|LEN}}(ff$), {{Text|1|#F580B1}}) = sp2 {{Text|<nowiki>'convert last spacer to a sp2</nowiki>|#919191}}
                    ff$ = ff$ + {{Text|<nowiki>"."</nowiki>|#FFB100}} + sp2
                    {{Cl|GOTO}} fooloopnxt
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'spacing just before (</nowiki>|#919191}}
            {{Cl|IF}} openbracket {{Cl|THEN}}
                {{Text|<nowiki>'convert last spacer?</nowiki>|#919191}}
                {{Cl|IF}} i <> {{Text|1|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} {{Text|isoperator|#55FF55}}({{Text|getelement$|#55FF55}}(a$, i - {{Text|1|#F580B1}})) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Cl|MID$}}(ff$, {{Cl|LEN}}(ff$), {{Text|1|#F580B1}}) = sp2
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                ff$ = ff$ + f2$ + sp2
            {{Cl|ELSE}} {{Text|<nowiki>'not openbracket</nowiki>|#919191}}
                ff$ = ff$ + f2$ + sp
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'len(f2$)</nowiki>|#919191}}
        fooloopnxt:
    {{Cl|NEXT}}
    {{Cl|IF}} {{Cl|LEN}}(aa$) {{Cl|THEN}} aa$ = {{Cl|LEFT$}}(aa$, {{Cl|LEN}}(aa$) - {{Text|1|#F580B1}})
    {{Cl|IF}} {{Cl|LEN}}(ff$) {{Cl|THEN}} ff$ = {{Cl|LEFT$}}(ff$, {{Cl|LEN}}(ff$) - {{Text|1|#F580B1}})
    {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"fixoperationorder:return:"</nowiki>|#FFB100}} + aa$
    {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"fixoperationorder:layout:"</nowiki>|#FFB100}} + ff$
    tlayout$ = ff$
    {{Text|fixoperationorder$|#55FF55}} = aa$
    fooindwel = fooindwel - {{Text|1|#F580B1}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|getelementspecial$|#55FF55}} (savea$, elenum)
    a$ = savea$
    {{Cl|IF}} a$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}} {{Text|<nowiki>'no elements!</nowiki>|#919191}}
    n = {{Text|1|#F580B1}}
    p = {{Text|1|#F580B1}}
    getelementspecialnext:
    i = {{Cl|INSTR}}(p, a$, sp)
    {{Text|<nowiki>'avoid sp inside "..."</nowiki>|#919191}}
    i2 = {{Cl|INSTR}}(p, a$, {{Cl|CHR$}}({{Text|34|#F580B1}}))
    {{Cl|IF}} i2 < i {{Cl|AND (boolean)|AND}} i2 <> {{Text|0|#F580B1}} {{Cl|THEN}}
        i3 = {{Cl|INSTR}}(i2 + {{Text|1|#F580B1}}, a$, {{Cl|CHR$}}({{Text|34|#F580B1}})): {{Cl|IF}} i3 = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}): {{Cl|EXIT}} {{Cl|FUNCTION}}
        i = {{Cl|INSTR}}(i3, a$, sp)
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} elenum = n {{Cl|THEN}}
        {{Cl|IF}} i {{Cl|THEN}}
            {{Text|getelementspecial$|#55FF55}} = {{Cl|MID$ (function)|MID$}}(a$, p, i - p)
        {{Cl|ELSE}}
            {{Text|getelementspecial$|#55FF55}} = {{Cl|RIGHT$}}(a$, {{Cl|LEN}}(a$) - p + {{Text|1|#F580B1}})
        {{Cl|END}} {{Cl|IF}}
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} i = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}} {{Text|<nowiki>'no more elements!</nowiki>|#919191}}
    n = n + {{Text|1|#F580B1}}
    p = i + {{Text|1|#F580B1}}
    {{Cl|GOTO}} getelementspecialnext
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|SUB}} {{Text|getid|#55FF55}} (i {{Cl|AS}} {{Cl|LONG}})
    {{Cl|IF}} i = {{Text|-1|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"-1 passed to getid!"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
    id = ids(i)
    currentid = i
{{Cl|END}} {{Cl|SUB}}
{{Cl|FUNCTION}} {{Text|isoperator|#55FF55}} (a2$)
    a$ = {{Cl|UCASE$}}(a2$)
    l = {{Text|0|#F580B1}}
    l = l + {{Text|1|#F580B1}}: {{Cl|IF}} a$ = {{Text|<nowiki>"IMP"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} opfound
    l = l + {{Text|1|#F580B1}}: {{Cl|IF}} a$ = {{Text|<nowiki>"EQV"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} opfound
    l = l + {{Text|1|#F580B1}}: {{Cl|IF}} a$ = {{Text|<nowiki>"XOR"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} opfound
    l = l + {{Text|1|#F580B1}}: {{Cl|IF}} a$ = {{Text|<nowiki>"OR"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} opfound
    l = l + {{Text|1|#F580B1}}: {{Cl|IF}} a$ = {{Text|<nowiki>"AND"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} opfound
    l = l + {{Text|1|#F580B1}}: {{Cl|IF}} a$ = {{Text|<nowiki>"NOT"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} opfound
    l = l + {{Text|1|#F580B1}}
    {{Cl|IF}} a$ = {{Text|<nowiki>"="</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} opfound
    {{Cl|IF}} a$ = {{Text|<nowiki>">"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} opfound
    {{Cl|IF}} a$ = {{Text|<nowiki>"<"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} opfound
    {{Cl|IF}} a$ = {{Text|<nowiki>"<>"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} opfound
    {{Cl|IF}} a$ = {{Text|<nowiki>"<="</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} opfound
    {{Cl|IF}} a$ = {{Text|<nowiki>">="</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} opfound
    l = l + {{Text|1|#F580B1}}
    {{Cl|IF}} a$ = {{Text|<nowiki>"+"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} opfound
    {{Cl|IF}} a$ = {{Text|<nowiki>"-"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} opfound {{Text|<nowiki>'!CAREFUL! could be negation</nowiki>|#919191}}
    l = l + {{Text|1|#F580B1}}: {{Cl|IF}} a$ = {{Text|<nowiki>"MOD"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} opfound
    l = l + {{Text|1|#F580B1}}: {{Cl|IF}} a$ = {{Text|<nowiki>"\"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} opfound
    l = l + {{Text|1|#F580B1}}
    {{Cl|IF}} a$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} opfound
    {{Cl|IF}} a$ = {{Text|<nowiki>"/"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} opfound
    {{Text|<nowiki>'NEGATION LEVEL (MUST BE SET AFTER CALLING ISOPERATOR BY CONTEXT)</nowiki>|#919191}}
    l = l + {{Text|1|#F580B1}}: {{Cl|IF}} a$ = {{Cl|CHR$}}({{Text|241|#F580B1}}) {{Cl|THEN}} {{Cl|GOTO}} opfound
    l = l + {{Text|1|#F580B1}}: {{Cl|IF}} a$ = {{Text|<nowiki>"^"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} opfound
    {{Cl|EXIT}} {{Cl|FUNCTION}}
    opfound:
    {{Text|isoperator|#55FF55}} = l
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|isuinteger|#55FF55}} (i$)
    {{Cl|IF}} {{Cl|LEN}}(i$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} {{Cl|ASC (function)|ASC}}(i$, {{Text|1|#F580B1}}) = {{Text|48|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|LEN}}(i$) > {{Text|1|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|FOR}} c = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(i$)
        v = {{Cl|ASC (function)|ASC}}(i$, c)
        {{Cl|IF}} v < {{Text|48|#F580B1}} {{Cl|OR (boolean)|OR}} v > {{Text|57|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|NEXT}}
    {{Text|isuinteger|#55FF55}} = {{Text|-1|#F580B1}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|isvalidvariable|#55FF55}} (a$)
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(a$)
        c = {{Cl|ASC (function)|ASC}}(a$, i)
        t = {{Text|0|#F580B1}}
        {{Cl|IF}} c >= {{Text|48|#F580B1}} {{Cl|AND (boolean)|AND}} c <= {{Text|57|#F580B1}} {{Cl|THEN}} t = {{Text|1|#F580B1}} {{Text|<nowiki>'numeric</nowiki>|#919191}}
        {{Cl|IF}} c >= {{Text|65|#F580B1}} {{Cl|AND (boolean)|AND}} c <= {{Text|90|#F580B1}} {{Cl|THEN}} t = {{Text|2|#F580B1}} {{Text|<nowiki>'uppercase</nowiki>|#919191}}
        {{Cl|IF}} c >= {{Text|97|#F580B1}} {{Cl|AND (boolean)|AND}} c <= {{Text|122|#F580B1}} {{Cl|THEN}} t = {{Text|2|#F580B1}} {{Text|<nowiki>'lowercase</nowiki>|#919191}}
        {{Cl|IF}} c = {{Text|95|#F580B1}} {{Cl|THEN}} t = {{Text|2|#F580B1}} {{Text|<nowiki>'_ underscore</nowiki>|#919191}}
        {{Cl|IF}} t = {{Text|2|#F580B1}} {{Cl|OR (boolean)|OR}} (t = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} i > {{Text|1|#F580B1}}) {{Cl|THEN}}
            {{Text|<nowiki>'valid (continue)</nowiki>|#919191}}
        {{Cl|ELSE}}
            {{Cl|IF}} i = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|isvalidvariable|#55FF55}} = {{Text|0|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|EXIT}} {{Cl|FOR}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|NEXT}}
    {{Text|isvalidvariable|#55FF55}} = {{Text|1|#F580B1}}
    {{Cl|IF}} i > n {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}} {{Text|<nowiki>'i is always greater than n because n is undefined here. Why didn't I remove this line and the ones below it, which will never run? Cause I'm a coward. F.h.</nowiki>|#919191}}
    e$ = {{Cl|RIGHT$}}(a$, {{Cl|LEN}}(a$) - i - {{Text|1|#F580B1}})
    {{Cl|IF}} e$ = {{Text|<nowiki>"%%"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} e$ = {{Text|<nowiki>"~%%"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} e$ = {{Text|<nowiki>"%"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} e$ = {{Text|<nowiki>"~%"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} e$ = {{Text|<nowiki>"&"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} e$ = {{Text|<nowiki>"~&"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} e$ = {{Text|<nowiki>"&&"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} e$ = {{Text|<nowiki>"~&&"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} e$ = {{Text|<nowiki>"!"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} e$ = {{Text|<nowiki>"#"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} e$ = {{Text|<nowiki>"##"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} e$ = {{Text|<nowiki>"$"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} e$ = {{Text|<nowiki>"`"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} {{Cl|LEFT$}}(e$, {{Text|1|#F580B1}}) <> {{Text|<nowiki>"$"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} {{Cl|LEFT$}}(e$, {{Text|1|#F580B1}}) <> {{Text|<nowiki>"`"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|isvalidvariable|#55FF55}} = {{Text|0|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    e$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - {{Text|1|#F580B1}})
    {{Cl|IF}} {{Text|isuinteger|#55FF55}}(e$) {{Cl|THEN}} {{Text|isvalidvariable|#55FF55}} = {{Text|1|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Text|isvalidvariable|#55FF55}} = {{Text|0|#F580B1}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|lineformat$|#55FF55}} (a$)
    a2$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
    linecontinuation = {{Text|0|#F580B1}}
    continueline:
    a$ = a$ + {{Text|<nowiki>"  "</nowiki>|#FFB100}} {{Text|<nowiki>'add 2 extra spaces to make reading next char easier</nowiki>|#919191}}
    ca$ = a$
    a$ = {{Cl|UCASE$}}(a$)
    n = {{Cl|LEN}}(a$)
    i = {{Text|1|#F580B1}}
    lineformatnext:
    {{Cl|IF}} i >= n {{Cl|THEN}} {{Cl|GOTO}} lineformatdone
    c = {{Cl|ASC (function)|ASC}}(a$, i)
    c$ = {{Cl|CHR$}}(c) {{Text|<nowiki>'***remove later***</nowiki>|#919191}}
    {{Text|<nowiki>'----------------quoted string----------------</nowiki>|#919191}}
    {{Cl|IF}} c = {{Text|34|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'"</nowiki>|#919191}}
        a2$ = a2$ + sp + {{Cl|CHR$}}({{Text|34|#F580B1}})
        p1 = i + {{Text|1|#F580B1}}
        {{Cl|FOR}} i2 = i + {{Text|1|#F580B1}} {{Cl|TO}} n - {{Text|2|#F580B1}}
            c2 = {{Cl|ASC (function)|ASC}}(a$, i2)
            {{Cl|IF}} c2 = {{Text|34|#F580B1}} {{Cl|THEN}}
                a2$ = a2$ + {{Cl|MID$ (function)|MID$}}(ca$, p1, i2 - p1 + {{Text|1|#F580B1}}) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(i2 - (i + {{Text|1|#F580B1}}))
                i = i2 + {{Text|1|#F580B1}}
                {{Cl|EXIT}} {{Cl|FOR}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} c2 = {{Text|92|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'\</nowiki>|#919191}}
                a2$ = a2$ + {{Cl|MID$ (function)|MID$}}(ca$, p1, i2 - p1) + {{Text|<nowiki>"\\"</nowiki>|#FFB100}}
                p1 = i2 + {{Text|1|#F580B1}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} c2 < {{Text|32|#F580B1}} {{Cl|OR (boolean)|OR}} c2 > {{Text|126|#F580B1}} {{Cl|THEN}}
                o$ = {{Cl|OCT$}}(c2)
                {{Cl|IF}} {{Cl|LEN}}(o$) < {{Text|3|#F580B1}} {{Cl|THEN}}
                    o$ = {{Text|<nowiki>"0"</nowiki>|#FFB100}} + o$
                    {{Cl|IF}} {{Cl|LEN}}(o$) < {{Text|3|#F580B1}} {{Cl|THEN}} o$ = {{Text|<nowiki>"0"</nowiki>|#FFB100}} + o$
                {{Cl|END}} {{Cl|IF}}
                a2$ = a2$ + {{Cl|MID$ (function)|MID$}}(ca$, p1, i2 - p1) + {{Text|<nowiki>"\"</nowiki>|#FFB100}} + o$
                p1 = i2 + {{Text|1|#F580B1}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|NEXT}}
        {{Cl|IF}} i2 = n - {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'no closing "</nowiki>|#919191}}
            a2$ = a2$ + {{Cl|MID$ (function)|MID$}}(ca$, p1, (n - {{Text|2|#F580B1}}) - p1 + {{Text|1|#F580B1}}) + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}((n - {{Text|2|#F580B1}}) - (i + {{Text|1|#F580B1}}) + {{Text|1|#F580B1}})
            i = n - {{Text|1|#F580B1}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|GOTO}} lineformatnext
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'----------------number----------------</nowiki>|#919191}}
    firsti = i
    {{Cl|IF}} c = {{Text|46|#F580B1}} {{Cl|THEN}}
        c2$ = {{Cl|MID$ (function)|MID$}}(a$, i + {{Text|1|#F580B1}}, {{Text|1|#F580B1}}): c2 = {{Cl|ASC (function)|ASC}}(c2$)
        {{Cl|IF}} (c2 >= {{Text|48|#F580B1}} {{Cl|AND (boolean)|AND}} c2 <= {{Text|57|#F580B1}}) {{Cl|THEN}} {{Cl|GOTO}} lfnumber
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} (c >= {{Text|48|#F580B1}} {{Cl|AND (boolean)|AND}} c <= {{Text|57|#F580B1}}) {{Cl|THEN}} {{Text|<nowiki>'0-9</nowiki>|#919191}}
        lfnumber:
        {{Text|<nowiki>'handle 'IF a=1 THEN a=2 ELSE 100' by assuming numeric after ELSE to be a</nowiki>|#919191}}
        {{Cl|IF}} {{Cl|RIGHT$}}(a2$, {{Text|5|#F580B1}}) = sp + {{Text|<nowiki>"ELSE"</nowiki>|#FFB100}} {{Cl|THEN}}
            a2$ = a2$ + sp + {{Text|<nowiki>"GOTO"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'Number will be converted to the following format:</nowiki>|#919191}}
        {{Text|<nowiki>' 999999  .        99999  E        +        999</nowiki>|#919191}}
        {{Text|<nowiki>'[whole$][dp(0/1)][frac$][ed(1/2)][pm(1/-1)][ex$]</nowiki>|#919191}}
        {{Text|<nowiki>' 0                1              2        3    <-mode</nowiki>|#919191}}
        mode = {{Text|0|#F580B1}}
        whole$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        dp = {{Text|0|#F580B1}}
        frac$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        ed = {{Text|0|#F580B1}} {{Text|<nowiki>'E=1, D=2, F=3</nowiki>|#919191}}
        pm = {{Text|1|#F580B1}}
        ex$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        lfreadnumber:
        valid = {{Text|0|#F580B1}}
        {{Cl|IF}} c = {{Text|46|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} mode = {{Text|0|#F580B1}} {{Cl|THEN}} valid = {{Text|1|#F580B1}}: dp = {{Text|1|#F580B1}}: mode = {{Text|1|#F580B1}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} c >= {{Text|48|#F580B1}} {{Cl|AND (boolean)|AND}} c <= {{Text|57|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'0-9</nowiki>|#919191}}
            valid = {{Text|1|#F580B1}}
            {{Cl|IF}} mode = {{Text|0|#F580B1}} {{Cl|THEN}} whole$ = whole$ + c$
            {{Cl|IF}} mode = {{Text|1|#F580B1}} {{Cl|THEN}} frac$ = frac$ + c$
            {{Cl|IF}} mode = {{Text|2|#F580B1}} {{Cl|THEN}} mode = {{Text|3|#F580B1}}
            {{Cl|IF}} mode = {{Text|3|#F580B1}} {{Cl|THEN}} ex$ = ex$ + c$
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} c = {{Text|69|#F580B1}} {{Cl|OR (boolean)|OR}} c = {{Text|68|#F580B1}} {{Cl|OR (boolean)|OR}} c = {{Text|70|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'E,D,F</nowiki>|#919191}}
            {{Cl|IF}} mode < {{Text|2|#F580B1}} {{Cl|THEN}}
                valid = {{Text|1|#F580B1}}
                {{Cl|IF}} c = {{Text|69|#F580B1}} {{Cl|THEN}} ed = {{Text|1|#F580B1}}
                {{Cl|IF}} c = {{Text|68|#F580B1}} {{Cl|THEN}} ed = {{Text|2|#F580B1}}
                {{Cl|IF}} c = {{Text|70|#F580B1}} {{Cl|THEN}} ed = {{Text|3|#F580B1}}
                mode = {{Text|2|#F580B1}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} c = {{Text|43|#F580B1}} {{Cl|OR (boolean)|OR}} c = {{Text|45|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'+,-</nowiki>|#919191}}
            {{Cl|IF}} mode = {{Text|2|#F580B1}} {{Cl|THEN}}
                valid = {{Text|1|#F580B1}}
                {{Cl|IF}} c = {{Text|45|#F580B1}} {{Cl|THEN}} pm = {{Text|-1|#F580B1}}
                mode = {{Text|3|#F580B1}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} valid {{Cl|THEN}}
            {{Cl|IF}} i <= n {{Cl|THEN}} i = i + {{Text|1|#F580B1}}: c$ = {{Cl|MID$ (function)|MID$}}(a$, i, {{Text|1|#F580B1}}): c = {{Cl|ASC (function)|ASC}}(c$): {{Cl|GOTO}} lfreadnumber
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'cull leading 0s off whole$</nowiki>|#919191}}
        {{Cl|DO}} {{Cl|WHILE}} {{Cl|LEFT$}}(whole$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"0"</nowiki>|#FFB100}}: whole$ = {{Cl|RIGHT$}}(whole$, {{Cl|LEN}}(whole$) - {{Text|1|#F580B1}}): {{Cl|LOOP}}
        {{Text|<nowiki>'cull trailing 0s off frac$</nowiki>|#919191}}
        {{Cl|DO}} {{Cl|WHILE}} {{Cl|RIGHT$}}(frac$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"0"</nowiki>|#FFB100}}: frac$ = {{Cl|LEFT$}}(frac$, {{Cl|LEN}}(frac$) - {{Text|1|#F580B1}}): {{Cl|LOOP}}
        {{Text|<nowiki>'cull leading 0s off ex$</nowiki>|#919191}}
        {{Cl|DO}} {{Cl|WHILE}} {{Cl|LEFT$}}(ex$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"0"</nowiki>|#FFB100}}: ex$ = {{Cl|RIGHT$}}(ex$, {{Cl|LEN}}(ex$) - {{Text|1|#F580B1}}): {{Cl|LOOP}}
        {{Cl|IF}} dp <> {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} ed <> {{Text|0|#F580B1}} {{Cl|THEN}} float = {{Text|1|#F580B1}} {{Cl|ELSE}} float = {{Text|0|#F580B1}}
        extused = {{Text|1|#F580B1}}
        {{Cl|IF}} ed {{Cl|THEN}} e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: {{Cl|GOTO}} lffoundext {{Text|<nowiki>'no extensions valid after E/D/F specified</nowiki>|#919191}}
        {{Text|<nowiki>'3-character extensions</nowiki>|#919191}}
        {{Cl|IF}} i <= n - {{Text|2|#F580B1}} {{Cl|THEN}}
            e$ = {{Cl|MID$ (function)|MID$}}(a$, i, {{Text|3|#F580B1}})
            {{Cl|IF}} e$ = {{Text|<nowiki>"~%%"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} float = {{Text|0|#F580B1}} {{Cl|THEN}} i = i + {{Text|3|#F580B1}}: {{Cl|GOTO}} lffoundext
            {{Cl|IF}} e$ = {{Text|<nowiki>"~&&"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} float = {{Text|0|#F580B1}} {{Cl|THEN}} i = i + {{Text|3|#F580B1}}: {{Cl|GOTO}} lffoundext
            {{Cl|IF}} e$ = {{Text|<nowiki>"~%&"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} float = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot use _OFFSET symbols after numbers"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'2-character extensions</nowiki>|#919191}}
        {{Cl|IF}} i <= n - {{Text|1|#F580B1}} {{Cl|THEN}}
            e$ = {{Cl|MID$ (function)|MID$}}(a$, i, {{Text|2|#F580B1}})
            {{Cl|IF}} e$ = {{Text|<nowiki>"%%"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} float = {{Text|0|#F580B1}} {{Cl|THEN}} i = i + {{Text|2|#F580B1}}: {{Cl|GOTO}} lffoundext
            {{Cl|IF}} e$ = {{Text|<nowiki>"~%"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} float = {{Text|0|#F580B1}} {{Cl|THEN}} i = i + {{Text|2|#F580B1}}: {{Cl|GOTO}} lffoundext
            {{Cl|IF}} e$ = {{Text|<nowiki>"&&"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} float = {{Text|0|#F580B1}} {{Cl|THEN}} i = i + {{Text|2|#F580B1}}: {{Cl|GOTO}} lffoundext
            {{Cl|IF}} e$ = {{Text|<nowiki>"~&"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} float = {{Text|0|#F580B1}} {{Cl|THEN}} i = i + {{Text|2|#F580B1}}: {{Cl|GOTO}} lffoundext
            {{Cl|IF}} e$ = {{Text|<nowiki>"%&"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} float = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot use _OFFSET symbols after numbers"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|IF}} e$ = {{Text|<nowiki>"##"</nowiki>|#FFB100}} {{Cl|THEN}}
                i = i + {{Text|2|#F580B1}}
                ed = {{Text|3|#F580B1}}
                e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                {{Cl|GOTO}} lffoundext
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} e$ = {{Text|<nowiki>"~`"</nowiki>|#FFB100}} {{Cl|THEN}}
                i = i + {{Text|2|#F580B1}}
                {{Cl|GOTO}} lffoundbitext
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'1-character extensions</nowiki>|#919191}}
        {{Cl|IF}} i <= n {{Cl|THEN}}
            e$ = {{Cl|MID$ (function)|MID$}}(a$, i, {{Text|1|#F580B1}})
            {{Cl|IF}} e$ = {{Text|<nowiki>"%"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} float = {{Text|0|#F580B1}} {{Cl|THEN}} i = i + {{Text|1|#F580B1}}: {{Cl|GOTO}} lffoundext
            {{Cl|IF}} e$ = {{Text|<nowiki>"&"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} float = {{Text|0|#F580B1}} {{Cl|THEN}} i = i + {{Text|1|#F580B1}}: {{Cl|GOTO}} lffoundext
            {{Cl|IF}} e$ = {{Text|<nowiki>"!"</nowiki>|#FFB100}} {{Cl|THEN}}
                i = i + {{Text|1|#F580B1}}
                ed = {{Text|1|#F580B1}}
                e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                {{Cl|GOTO}} lffoundext
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} e$ = {{Text|<nowiki>"#"</nowiki>|#FFB100}} {{Cl|THEN}}
                i = i + {{Text|1|#F580B1}}
                ed = {{Text|2|#F580B1}}
                e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                {{Cl|GOTO}} lffoundext
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} e$ = {{Text|<nowiki>"`"</nowiki>|#FFB100}} {{Cl|THEN}}
                i = i + {{Text|1|#F580B1}}
                lffoundbitext:
                bitn$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                {{Cl|DO}} {{Cl|WHILE}} i <= n
                    c2 = {{Cl|ASC (function)|ASC}}({{Cl|MID$ (function)|MID$}}(a$, i, {{Text|1|#F580B1}}))
                    {{Cl|IF}} c2 >= {{Text|48|#F580B1}} {{Cl|AND (boolean)|AND}} c2 <= {{Text|57|#F580B1}} {{Cl|THEN}}
                        bitn$ = bitn$ + {{Cl|CHR$}}(c2)
                        i = i + {{Text|1|#F580B1}}
                    {{Cl|ELSE}}
                        {{Cl|EXIT}} {{Cl|DO}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|LOOP}}
                {{Cl|IF}} bitn$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} bitn$ = {{Text|<nowiki>"1"</nowiki>|#FFB100}}
                {{Text|<nowiki>'cull leading 0s off bitn$</nowiki>|#919191}}
                {{Cl|DO}} {{Cl|WHILE}} {{Cl|LEFT$}}(bitn$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"0"</nowiki>|#FFB100}}: bitn$ = {{Cl|RIGHT$}}(bitn$, {{Cl|LEN}}(bitn$) - {{Text|1|#F580B1}}): {{Cl|LOOP}}
                e$ = e$ + bitn$
                {{Cl|GOTO}} lffoundext
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} float {{Cl|THEN}} {{Text|<nowiki>'floating point types CAN be assumed</nowiki>|#919191}}
            {{Text|<nowiki>'calculate first significant digit offset & number of significant digits</nowiki>|#919191}}
            {{Cl|IF}} whole$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
                offset = {{Cl|LEN}}(whole$) - {{Text|1|#F580B1}}
                sigdigits = {{Cl|LEN}}(whole$) + {{Cl|LEN}}(frac$)
            {{Cl|ELSE}}
                {{Cl|IF}} frac$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
                    offset = {{Text|-1|#F580B1}}
                    sigdigits = {{Cl|LEN}}(frac$)
                    {{Cl|FOR}} i2 = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(frac$)
                        {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(frac$, i2, {{Text|1|#F580B1}}) <> {{Text|<nowiki>"0"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}}
                        offset = offset - {{Text|1|#F580B1}}
                        sigdigits = sigdigits - {{Text|1|#F580B1}}
                    {{Cl|NEXT}}
                {{Cl|ELSE}}
                    {{Text|<nowiki>'number is 0</nowiki>|#919191}}
                    offset = {{Text|0|#F580B1}}
                    sigdigits = {{Text|0|#F580B1}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            sigdig$ = {{Cl|RIGHT$}}(whole$ + frac$, sigdigits)
            {{Text|<nowiki>'SINGLE?</nowiki>|#919191}}
            {{Cl|IF}} sigdigits <= {{Text|7|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'QBASIC interprets anything with more than 7 sig. digits as a DOUBLE</nowiki>|#919191}}
                {{Cl|IF}} offset <= {{Text|38|#F580B1}} {{Cl|AND (boolean)|AND}} offset >= {{Text|-38|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'anything outside this range cannot be represented as a SINGLE</nowiki>|#919191}}
                    {{Cl|IF}} offset = {{Text|38|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} sigdig$ > {{Text|<nowiki>"3402823"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} lfxsingle
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} offset = {{Text|-38|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} sigdig$ < {{Text|<nowiki>"1175494"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} lfxsingle
                    {{Cl|END}} {{Cl|IF}}
                    ed = {{Text|1|#F580B1}}
                    e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    {{Cl|GOTO}} lffoundext
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            lfxsingle:
            {{Text|<nowiki>'DOUBLE?</nowiki>|#919191}}
            {{Cl|IF}} sigdigits <= {{Text|16|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'QB64 handles DOUBLES with 16-digit precision</nowiki>|#919191}}
                {{Cl|IF}} offset <= {{Text|308|#F580B1}} {{Cl|AND (boolean)|AND}} offset >= {{Text|-308|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'anything outside this range cannot be represented as a DOUBLE</nowiki>|#919191}}
                    {{Cl|IF}} offset = {{Text|308|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} sigdig$ > {{Text|<nowiki>"1797693134862315"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} lfxdouble
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} offset = {{Text|-308|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} sigdig$ < {{Text|<nowiki>"2225073858507201"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} lfxdouble
                    {{Cl|END}} {{Cl|IF}}
                    ed = {{Text|2|#F580B1}}
                    e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    {{Cl|GOTO}} lffoundext
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            lfxdouble:
            {{Text|<nowiki>'assume _FLOAT</nowiki>|#919191}}
            ed = {{Text|3|#F580B1}}
            e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: {{Cl|GOTO}} lffoundext
        {{Cl|END}} {{Cl|IF}}
        extused = {{Text|0|#F580B1}}
        e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        lffoundext:
        {{Text|<nowiki>'make sure a leading numberic character exists</nowiki>|#919191}}
        {{Cl|IF}} whole$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} whole$ = {{Text|<nowiki>"0"</nowiki>|#FFB100}}
        {{Text|<nowiki>'if a float, ensure frac$<>"" and dp=1</nowiki>|#919191}}
        {{Cl|IF}} float {{Cl|THEN}}
            dp = {{Text|1|#F580B1}}
            {{Cl|IF}} frac$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} frac$ = {{Text|<nowiki>"0"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'if ed is specified, make sure ex$ exists</nowiki>|#919191}}
        {{Cl|IF}} ed <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} ex$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} ex$ = {{Text|<nowiki>"0"</nowiki>|#FFB100}}
        a2$ = a2$ + sp
        a2$ = a2$ + whole$
        {{Cl|IF}} dp {{Cl|THEN}} a2$ = a2$ + {{Text|<nowiki>"."</nowiki>|#FFB100}} + frac$
        {{Cl|IF}} ed {{Cl|THEN}}
            {{Cl|IF}} ed = {{Text|1|#F580B1}} {{Cl|THEN}} a2$ = a2$ + {{Text|<nowiki>"E"</nowiki>|#FFB100}}
            {{Cl|IF}} ed = {{Text|2|#F580B1}} {{Cl|THEN}} a2$ = a2$ + {{Text|<nowiki>"D"</nowiki>|#FFB100}}
            {{Cl|IF}} ed = {{Text|3|#F580B1}} {{Cl|THEN}} a2$ = a2$ + {{Text|<nowiki>"F"</nowiki>|#FFB100}}
            {{Cl|IF}} pm = {{Text|-1|#F580B1}} {{Cl|AND (boolean)|AND}} ex$ <> {{Text|<nowiki>"0"</nowiki>|#FFB100}} {{Cl|THEN}} a2$ = a2$ + {{Text|<nowiki>"-"</nowiki>|#FFB100}} {{Cl|ELSE}} a2$ = a2$ + {{Text|<nowiki>"+"</nowiki>|#FFB100}}
            a2$ = a2$ + ex$
        {{Cl|END}} {{Cl|IF}}
        a2$ = a2$ + e$
        {{Cl|IF}} extused {{Cl|THEN}} a2$ = a2$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Cl|MID$ (function)|MID$}}(a$, firsti, i - firsti)
        {{Cl|GOTO}} lineformatnext
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'----------------(number)&H...----------------</nowiki>|#919191}}
    {{Text|<nowiki>'note: the final value, not the number of hex characters, sets the default type</nowiki>|#919191}}
    {{Cl|IF}} c = {{Text|38|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'&</nowiki>|#919191}}
        {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(a$, i + {{Text|1|#F580B1}}, {{Text|1|#F580B1}}) = {{Text|<nowiki>"H"</nowiki>|#FFB100}} {{Cl|THEN}}
            i = i + {{Text|2|#F580B1}}
            hx$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            lfreadhex:
            {{Cl|IF}} i <= n {{Cl|THEN}}
                c$ = {{Cl|MID$ (function)|MID$}}(a$, i, {{Text|1|#F580B1}}): c = {{Cl|ASC (function)|ASC}}(c$)
                {{Cl|IF}} (c >= {{Text|48|#F580B1}} {{Cl|AND (boolean)|AND}} c <= {{Text|57|#F580B1}}) {{Cl|OR (boolean)|OR}} (c >= {{Text|65|#F580B1}} {{Cl|AND (boolean)|AND}} c <= {{Text|70|#F580B1}}) {{Cl|THEN}} hx$ = hx$ + c$: i = i + {{Text|1|#F580B1}}: {{Cl|GOTO}} lfreadhex
            {{Cl|END}} {{Cl|IF}}
            fullhx$ = {{Text|<nowiki>"&H"</nowiki>|#FFB100}} + hx$
            {{Text|<nowiki>'cull leading 0s off hx$</nowiki>|#919191}}
            {{Cl|DO}} {{Cl|WHILE}} {{Cl|LEFT$}}(hx$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"0"</nowiki>|#FFB100}}: hx$ = {{Cl|RIGHT$}}(hx$, {{Cl|LEN}}(hx$) - {{Text|1|#F580B1}}): {{Cl|LOOP}}
            {{Cl|IF}} hx$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} hx$ = {{Text|<nowiki>"0"</nowiki>|#FFB100}}
            bitn$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Text|<nowiki>'3-character extensions</nowiki>|#919191}}
            {{Cl|IF}} i <= n - {{Text|2|#F580B1}} {{Cl|THEN}}
                e$ = {{Cl|MID$ (function)|MID$}}(a$, i, {{Text|3|#F580B1}})
                {{Cl|IF}} e$ = {{Text|<nowiki>"~%%"</nowiki>|#FFB100}} {{Cl|THEN}} i = i + {{Text|3|#F580B1}}: {{Cl|GOTO}} lfhxext
                {{Cl|IF}} e$ = {{Text|<nowiki>"~&&"</nowiki>|#FFB100}} {{Cl|THEN}} i = i + {{Text|3|#F580B1}}: {{Cl|GOTO}} lfhxext
                {{Cl|IF}} e$ = {{Text|<nowiki>"~%&"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot use _OFFSET symbols after numbers"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'2-character extensions</nowiki>|#919191}}
            {{Cl|IF}} i <= n - {{Text|1|#F580B1}} {{Cl|THEN}}
                e$ = {{Cl|MID$ (function)|MID$}}(a$, i, {{Text|2|#F580B1}})
                {{Cl|IF}} e$ = {{Text|<nowiki>"%%"</nowiki>|#FFB100}} {{Cl|THEN}} i = i + {{Text|2|#F580B1}}: {{Cl|GOTO}} lfhxext
                {{Cl|IF}} e$ = {{Text|<nowiki>"~%"</nowiki>|#FFB100}} {{Cl|THEN}} i = i + {{Text|2|#F580B1}}: {{Cl|GOTO}} lfhxext
                {{Cl|IF}} e$ = {{Text|<nowiki>"&&"</nowiki>|#FFB100}} {{Cl|THEN}} i = i + {{Text|2|#F580B1}}: {{Cl|GOTO}} lfhxext
                {{Cl|IF}} e$ = {{Text|<nowiki>"%&"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot use _OFFSET symbols after numbers"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|IF}} e$ = {{Text|<nowiki>"~&"</nowiki>|#FFB100}} {{Cl|THEN}} i = i + {{Text|2|#F580B1}}: {{Cl|GOTO}} lfhxext
                {{Cl|IF}} e$ = {{Text|<nowiki>"~`"</nowiki>|#FFB100}} {{Cl|THEN}}
                    i = i + {{Text|2|#F580B1}}
                    {{Cl|GOTO}} lfhxbitext
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'1-character extensions</nowiki>|#919191}}
            {{Cl|IF}} i <= n {{Cl|THEN}}
                e$ = {{Cl|MID$ (function)|MID$}}(a$, i, {{Text|1|#F580B1}})
                {{Cl|IF}} e$ = {{Text|<nowiki>"%"</nowiki>|#FFB100}} {{Cl|THEN}} i = i + {{Text|1|#F580B1}}: {{Cl|GOTO}} lfhxext
                {{Cl|IF}} e$ = {{Text|<nowiki>"&"</nowiki>|#FFB100}} {{Cl|THEN}} i = i + {{Text|1|#F580B1}}: {{Cl|GOTO}} lfhxext
                {{Cl|IF}} e$ = {{Text|<nowiki>"`"</nowiki>|#FFB100}} {{Cl|THEN}}
                    i = i + {{Text|1|#F580B1}}
                    lfhxbitext:
                    {{Cl|DO}} {{Cl|WHILE}} i <= n
                        c2 = {{Cl|ASC (function)|ASC}}({{Cl|MID$ (function)|MID$}}(a$, i, {{Text|1|#F580B1}}))
                        {{Cl|IF}} c2 >= {{Text|48|#F580B1}} {{Cl|AND (boolean)|AND}} c2 <= {{Text|57|#F580B1}} {{Cl|THEN}}
                            bitn$ = bitn$ + {{Cl|CHR$}}(c2)
                            i = i + {{Text|1|#F580B1}}
                        {{Cl|ELSE}}
                            {{Cl|EXIT}} {{Cl|DO}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|LOOP}}
                    {{Cl|IF}} bitn$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} bitn$ = {{Text|<nowiki>"1"</nowiki>|#FFB100}}
                    {{Text|<nowiki>'cull leading 0s off bitn$</nowiki>|#919191}}
                    {{Cl|DO}} {{Cl|WHILE}} {{Cl|LEFT$}}(bitn$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"0"</nowiki>|#FFB100}}: bitn$ = {{Cl|RIGHT$}}(bitn$, {{Cl|LEN}}(bitn$) - {{Text|1|#F580B1}}): {{Cl|LOOP}}
                    {{Cl|GOTO}} lfhxext
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'if no valid extension context was given, assume one</nowiki>|#919191}}
            {{Text|<nowiki>'note: leading 0s have been culled, so LEN(hx$) reflects its values size</nowiki>|#919191}}
            e$ = {{Text|<nowiki>"&&"</nowiki>|#FFB100}}
            {{Cl|IF}} {{Cl|LEN}}(hx$) <= {{Text|8|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"&"</nowiki>|#FFB100}} {{Text|<nowiki>'as in QBASIC, signed values must be used</nowiki>|#919191}}
            {{Cl|IF}} {{Cl|LEN}}(hx$) <= {{Text|4|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"%"</nowiki>|#FFB100}} {{Text|<nowiki>'as in QBASIC, signed values must be used</nowiki>|#919191}}
            {{Cl|GOTO}} lfhxext2
            lfhxext:
            fullhx$ = fullhx$ + e$ + bitn$
            lfhxext2:
            {{Text|<nowiki>'build 8-byte unsigned integer rep. of hx$</nowiki>|#919191}}
            {{Cl|IF}} {{Cl|LEN}}(hx$) > {{Text|16|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Overflow"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            v~&& = {{Text|0|#F580B1}}
            {{Cl|FOR}} i2 = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(hx$)
                v2 = {{Cl|ASC (function)|ASC}}({{Cl|MID$ (function)|MID$}}(hx$, i2, {{Text|1|#F580B1}}))
                {{Cl|IF}} v2 <= {{Text|57|#F580B1}} {{Cl|THEN}} v2 = v2 - {{Text|48|#F580B1}} {{Cl|ELSE}} v2 = v2 - {{Text|65|#F580B1}} + {{Text|10|#F580B1}}
                v~&& = v~&& * {{Text|16|#F580B1}} + v2
            {{Cl|NEXT}}
            finishhexoctbin:
            num$ = {{Text|str2u64$|#55FF55}}(v~&&) {{Text|<nowiki>'correct for unsigned values (overflow of unsigned can be checked later)</nowiki>|#919191}}
            {{Cl|IF}} {{Cl|LEFT$}}(e$, {{Text|1|#F580B1}}) <> {{Text|<nowiki>"~"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|<nowiki>'note: range checking will be performed later in fixop.order</nowiki>|#919191}}
                {{Text|<nowiki>'signed</nowiki>|#919191}}
                {{Cl|IF}} e$ = {{Text|<nowiki>"%%"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} v~&& > {{Text|127|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} v~&& > {{Text|255|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Overflow"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                        v~&& = (({{Cl|NOT}} v~&&) {{Cl|AND}} {{Text|255|#F580B1}}) + {{Text|1|#F580B1}}
                        num$ = {{Text|<nowiki>"-"</nowiki>|#FFB100}} + sp + {{Text|str2u64$|#55FF55}}(v~&&)
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} e$ = {{Text|<nowiki>"%"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} v~&& > {{Text|32767|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} v~&& > {{Text|65535|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Overflow"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                        v~&& = (({{Cl|NOT}} v~&&) {{Cl|AND}} {{Text|65535|#F580B1}}) + {{Text|1|#F580B1}}
                        num$ = {{Text|<nowiki>"-"</nowiki>|#FFB100}} + sp + {{Text|str2u64$|#55FF55}}(v~&&)
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} e$ = {{Text|<nowiki>"&"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} v~&& > {{Text|2147483647|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} v~&& > {{Text|4294967295|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Overflow"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                        v~&& = (({{Cl|NOT}} v~&&) {{Cl|AND}} {{Text|4294967295|#F580B1}}) + {{Text|1|#F580B1}}
                        num$ = {{Text|<nowiki>"-"</nowiki>|#FFB100}} + sp + {{Text|str2u64$|#55FF55}}(v~&&)
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} e$ = {{Text|<nowiki>"&&"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} v~&& > {{Text|9223372036854775807|#F580B1}} {{Cl|THEN}}
                        {{Text|<nowiki>'note: no error checking necessary</nowiki>|#919191}}
                        v~&& = ({{Cl|NOT}} v~&&) + {{Text|1|#F580B1}}
                        num$ = {{Text|<nowiki>"-"</nowiki>|#FFB100}} + sp + {{Text|str2u64$|#55FF55}}(v~&&)
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} e$ = {{Text|<nowiki>"`"</nowiki>|#FFB100}} {{Cl|THEN}}
                    vbitn = {{Cl|VAL}}(bitn$)
                    h~&& = {{Text|1|#F580B1}}: {{Cl|FOR}} i2 = {{Text|1|#F580B1}} {{Cl|TO}} vbitn - {{Text|1|#F580B1}}: h~&& = h~&& * {{Text|2|#F580B1}}: {{Cl|NEXT}}: h~&& = h~&& - {{Text|1|#F580B1}} {{Text|<nowiki>'build h~&&</nowiki>|#919191}}
                    {{Cl|IF}} v~&& > h~&& {{Cl|THEN}}
                        h~&& = {{Text|1|#F580B1}}: {{Cl|FOR}} i2 = {{Text|1|#F580B1}} {{Cl|TO}} vbitn: h~&& = h~&& * {{Text|2|#F580B1}}: {{Cl|NEXT}}: h~&& = h~&& - {{Text|1|#F580B1}} {{Text|<nowiki>'build h~&&</nowiki>|#919191}}
                        {{Cl|IF}} v~&& > h~&& {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Overflow"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                        v~&& = (({{Cl|NOT}} v~&&) {{Cl|AND}} h~&&) + {{Text|1|#F580B1}}
                        num$ = {{Text|<nowiki>"-"</nowiki>|#FFB100}} + sp + {{Text|str2u64$|#55FF55}}(v~&&)
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'<>"~"</nowiki>|#919191}}
            a2$ = a2$ + sp + num$ + e$ + bitn$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + fullhx$
            {{Cl|GOTO}} lineformatnext
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'----------------(number)&O...----------------</nowiki>|#919191}}
    {{Text|<nowiki>'note: the final value, not the number of oct characters, sets the default type</nowiki>|#919191}}
    {{Cl|IF}} c = {{Text|38|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'&</nowiki>|#919191}}
        {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(a$, i + {{Text|1|#F580B1}}, {{Text|1|#F580B1}}) = {{Text|<nowiki>"O"</nowiki>|#FFB100}} {{Cl|THEN}}
            i = i + {{Text|2|#F580B1}}
            {{Text|<nowiki>'note: to avoid mistakes, hx$ is used instead of 'ot$'</nowiki>|#919191}}
            hx$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            lfreadoct:
            {{Cl|IF}} i <= n {{Cl|THEN}}
                c$ = {{Cl|MID$ (function)|MID$}}(a$, i, {{Text|1|#F580B1}}): c = {{Cl|ASC (function)|ASC}}(c$)
                {{Cl|IF}} c >= {{Text|48|#F580B1}} {{Cl|AND (boolean)|AND}} c <= {{Text|55|#F580B1}} {{Cl|THEN}} hx$ = hx$ + c$: i = i + {{Text|1|#F580B1}}: {{Cl|GOTO}} lfreadoct
            {{Cl|END}} {{Cl|IF}}
            fullhx$ = {{Text|<nowiki>"&O"</nowiki>|#FFB100}} + hx$
            {{Text|<nowiki>'cull leading 0s off hx$</nowiki>|#919191}}
            {{Cl|DO}} {{Cl|WHILE}} {{Cl|LEFT$}}(hx$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"0"</nowiki>|#FFB100}}: hx$ = {{Cl|RIGHT$}}(hx$, {{Cl|LEN}}(hx$) - {{Text|1|#F580B1}}): {{Cl|LOOP}}
            {{Cl|IF}} hx$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} hx$ = {{Text|<nowiki>"0"</nowiki>|#FFB100}}
            bitn$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Text|<nowiki>'3-character extensions</nowiki>|#919191}}
            {{Cl|IF}} i <= n - {{Text|2|#F580B1}} {{Cl|THEN}}
                e$ = {{Cl|MID$ (function)|MID$}}(a$, i, {{Text|3|#F580B1}})
                {{Cl|IF}} e$ = {{Text|<nowiki>"~%%"</nowiki>|#FFB100}} {{Cl|THEN}} i = i + {{Text|3|#F580B1}}: {{Cl|GOTO}} lfotext
                {{Cl|IF}} e$ = {{Text|<nowiki>"~&&"</nowiki>|#FFB100}} {{Cl|THEN}} i = i + {{Text|3|#F580B1}}: {{Cl|GOTO}} lfotext
                {{Cl|IF}} e$ = {{Text|<nowiki>"~%&"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot use _OFFSET symbols after numbers"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'2-character extensions</nowiki>|#919191}}
            {{Cl|IF}} i <= n - {{Text|1|#F580B1}} {{Cl|THEN}}
                e$ = {{Cl|MID$ (function)|MID$}}(a$, i, {{Text|2|#F580B1}})
                {{Cl|IF}} e$ = {{Text|<nowiki>"%%"</nowiki>|#FFB100}} {{Cl|THEN}} i = i + {{Text|2|#F580B1}}: {{Cl|GOTO}} lfotext
                {{Cl|IF}} e$ = {{Text|<nowiki>"~%"</nowiki>|#FFB100}} {{Cl|THEN}} i = i + {{Text|2|#F580B1}}: {{Cl|GOTO}} lfotext
                {{Cl|IF}} e$ = {{Text|<nowiki>"&&"</nowiki>|#FFB100}} {{Cl|THEN}} i = i + {{Text|2|#F580B1}}: {{Cl|GOTO}} lfotext
                {{Cl|IF}} e$ = {{Text|<nowiki>"%&"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot use _OFFSET symbols after numbers"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|IF}} e$ = {{Text|<nowiki>"~&"</nowiki>|#FFB100}} {{Cl|THEN}} i = i + {{Text|2|#F580B1}}: {{Cl|GOTO}} lfotext
                {{Cl|IF}} e$ = {{Text|<nowiki>"~`"</nowiki>|#FFB100}} {{Cl|THEN}}
                    i = i + {{Text|2|#F580B1}}
                    {{Cl|GOTO}} lfotbitext
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'1-character extensions</nowiki>|#919191}}
            {{Cl|IF}} i <= n {{Cl|THEN}}
                e$ = {{Cl|MID$ (function)|MID$}}(a$, i, {{Text|1|#F580B1}})
                {{Cl|IF}} e$ = {{Text|<nowiki>"%"</nowiki>|#FFB100}} {{Cl|THEN}} i = i + {{Text|1|#F580B1}}: {{Cl|GOTO}} lfotext
                {{Cl|IF}} e$ = {{Text|<nowiki>"&"</nowiki>|#FFB100}} {{Cl|THEN}} i = i + {{Text|1|#F580B1}}: {{Cl|GOTO}} lfotext
                {{Cl|IF}} e$ = {{Text|<nowiki>"`"</nowiki>|#FFB100}} {{Cl|THEN}}
                    i = i + {{Text|1|#F580B1}}
                    lfotbitext:
                    bitn$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    {{Cl|DO}} {{Cl|WHILE}} i <= n
                        c2 = {{Cl|ASC (function)|ASC}}({{Cl|MID$ (function)|MID$}}(a$, i, {{Text|1|#F580B1}}))
                        {{Cl|IF}} c2 >= {{Text|48|#F580B1}} {{Cl|AND (boolean)|AND}} c2 <= {{Text|57|#F580B1}} {{Cl|THEN}}
                            bitn$ = bitn$ + {{Cl|CHR$}}(c2)
                            i = i + {{Text|1|#F580B1}}
                        {{Cl|ELSE}}
                            {{Cl|EXIT}} {{Cl|DO}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|LOOP}}
                    {{Cl|IF}} bitn$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} bitn$ = {{Text|<nowiki>"1"</nowiki>|#FFB100}}
                    {{Text|<nowiki>'cull leading 0s off bitn$</nowiki>|#919191}}
                    {{Cl|DO}} {{Cl|WHILE}} {{Cl|LEFT$}}(bitn$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"0"</nowiki>|#FFB100}}: bitn$ = {{Cl|RIGHT$}}(bitn$, {{Cl|LEN}}(bitn$) - {{Text|1|#F580B1}}): {{Cl|LOOP}}
                    {{Cl|GOTO}} lfotext
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'if no valid extension context was given, assume one</nowiki>|#919191}}
            {{Text|<nowiki>'note: leading 0s have been culled, so LEN(hx$) reflects its values size</nowiki>|#919191}}
            e$ = {{Text|<nowiki>"&&"</nowiki>|#FFB100}}
            {{Text|<nowiki>'37777777777</nowiki>|#919191}}
            {{Cl|IF}} {{Cl|LEN}}(hx$) <= {{Text|11|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} {{Cl|LEN}}(hx$) < {{Text|11|#F580B1}} {{Cl|OR (boolean)|OR}} {{Cl|ASC (function)|ASC}}({{Cl|LEFT$}}(hx$, {{Text|1|#F580B1}})) <= {{Text|51|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"&"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'177777</nowiki>|#919191}}
            {{Cl|IF}} {{Cl|LEN}}(hx$) <= {{Text|6|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} {{Cl|LEN}}(hx$) < {{Text|6|#F580B1}} {{Cl|OR (boolean)|OR}} {{Cl|LEFT$}}(hx$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"1"</nowiki>|#FFB100}} {{Cl|THEN}} e$ = {{Text|<nowiki>"%"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|GOTO}} lfotext2
            lfotext:
            fullhx$ = fullhx$ + e$ + bitn$
            lfotext2:
            {{Text|<nowiki>'build 8-byte unsigned integer rep. of hx$</nowiki>|#919191}}
            {{Text|<nowiki>'1777777777777777777777 (22 digits)</nowiki>|#919191}}
            {{Cl|IF}} {{Cl|LEN}}(hx$) > {{Text|22|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Overflow"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|IF}} {{Cl|LEN}}(hx$) = {{Text|22|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} {{Cl|LEFT$}}(hx$, {{Text|1|#F580B1}}) <> {{Text|<nowiki>"1"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Overflow"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'********change v& to v~&&********</nowiki>|#919191}}
            v~&& = {{Text|0|#F580B1}}
            {{Cl|FOR}} i2 = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(hx$)
                v2 = {{Cl|ASC (function)|ASC}}({{Cl|MID$ (function)|MID$}}(hx$, i2, {{Text|1|#F580B1}}))
                v2 = v2 - {{Text|48|#F580B1}}
                v~&& = v~&& * {{Text|8|#F580B1}} + v2
            {{Cl|NEXT}}
            {{Cl|GOTO}} finishhexoctbin
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'----------------(number)&B...----------------</nowiki>|#919191}}
    {{Text|<nowiki>'note: the final value, not the number of bin characters, sets the default type</nowiki>|#919191}}
    {{Cl|IF}} c = {{Text|38|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'&</nowiki>|#919191}}
        {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(a$, i + {{Text|1|#F580B1}}, {{Text|1|#F580B1}}) = {{Text|<nowiki>"B"</nowiki>|#FFB100}} {{Cl|THEN}}
            i = i + {{Text|2|#F580B1}}
            {{Text|<nowiki>'note: to avoid mistakes, hx$ is used instead of 'bi$'</nowiki>|#919191}}
            hx$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            lfreadbin:
            {{Cl|IF}} i <= n {{Cl|THEN}}
                c$ = {{Cl|MID$ (function)|MID$}}(a$, i, {{Text|1|#F580B1}}): c = {{Cl|ASC (function)|ASC}}(c$)
                {{Cl|IF}} c >= {{Text|48|#F580B1}} {{Cl|AND (boolean)|AND}} c <= {{Text|49|#F580B1}} {{Cl|THEN}} hx$ = hx$ + c$: i = i + {{Text|1|#F580B1}}: {{Cl|GOTO}} lfreadbin
            {{Cl|END}} {{Cl|IF}}
            fullhx$ = {{Text|<nowiki>"&B"</nowiki>|#FFB100}} + hx$
            {{Text|<nowiki>'cull leading 0s off hx$</nowiki>|#919191}}
            {{Cl|DO}} {{Cl|WHILE}} {{Cl|LEFT$}}(hx$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"0"</nowiki>|#FFB100}}: hx$ = {{Cl|RIGHT$}}(hx$, {{Cl|LEN}}(hx$) - {{Text|1|#F580B1}}): {{Cl|LOOP}}
            {{Cl|IF}} hx$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} hx$ = {{Text|<nowiki>"0"</nowiki>|#FFB100}}
            bitn$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Text|<nowiki>'3-character extensions</nowiki>|#919191}}
            {{Cl|IF}} i <= n - {{Text|2|#F580B1}} {{Cl|THEN}}
                e$ = {{Cl|MID$ (function)|MID$}}(a$, i, {{Text|3|#F580B1}})
                {{Cl|IF}} e$ = {{Text|<nowiki>"~%%"</nowiki>|#FFB100}} {{Cl|THEN}} i = i + {{Text|3|#F580B1}}: {{Cl|GOTO}} lfbiext
                {{Cl|IF}} e$ = {{Text|<nowiki>"~&&"</nowiki>|#FFB100}} {{Cl|THEN}} i = i + {{Text|3|#F580B1}}: {{Cl|GOTO}} lfbiext
                {{Cl|IF}} e$ = {{Text|<nowiki>"~%&"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot use _OFFSET symbols after numbers"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'2-character extensions</nowiki>|#919191}}
            {{Cl|IF}} i <= n - {{Text|1|#F580B1}} {{Cl|THEN}}
                e$ = {{Cl|MID$ (function)|MID$}}(a$, i, {{Text|2|#F580B1}})
                {{Cl|IF}} e$ = {{Text|<nowiki>"%%"</nowiki>|#FFB100}} {{Cl|THEN}} i = i + {{Text|2|#F580B1}}: {{Cl|GOTO}} lfbiext
                {{Cl|IF}} e$ = {{Text|<nowiki>"~%"</nowiki>|#FFB100}} {{Cl|THEN}} i = i + {{Text|2|#F580B1}}: {{Cl|GOTO}} lfbiext
                {{Cl|IF}} e$ = {{Text|<nowiki>"&&"</nowiki>|#FFB100}} {{Cl|THEN}} i = i + {{Text|2|#F580B1}}: {{Cl|GOTO}} lfbiext
                {{Cl|IF}} e$ = {{Text|<nowiki>"%&"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot use _OFFSET symbols after numbers"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|IF}} e$ = {{Text|<nowiki>"~&"</nowiki>|#FFB100}} {{Cl|THEN}} i = i + {{Text|2|#F580B1}}: {{Cl|GOTO}} lfbiext
                {{Cl|IF}} e$ = {{Text|<nowiki>"~`"</nowiki>|#FFB100}} {{Cl|THEN}}
                    i = i + {{Text|2|#F580B1}}
                    {{Cl|GOTO}} lfbibitext
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'1-character extensions</nowiki>|#919191}}
            {{Cl|IF}} i <= n {{Cl|THEN}}
                e$ = {{Cl|MID$ (function)|MID$}}(a$, i, {{Text|1|#F580B1}})
                {{Cl|IF}} e$ = {{Text|<nowiki>"%"</nowiki>|#FFB100}} {{Cl|THEN}} i = i + {{Text|1|#F580B1}}: {{Cl|GOTO}} lfbiext
                {{Cl|IF}} e$ = {{Text|<nowiki>"&"</nowiki>|#FFB100}} {{Cl|THEN}} i = i + {{Text|1|#F580B1}}: {{Cl|GOTO}} lfbiext
                {{Cl|IF}} e$ = {{Text|<nowiki>"`"</nowiki>|#FFB100}} {{Cl|THEN}}
                    i = i + {{Text|1|#F580B1}}
                    lfbibitext:
                    bitn$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    {{Cl|DO}} {{Cl|WHILE}} i <= n
                        c2 = {{Cl|ASC (function)|ASC}}({{Cl|MID$ (function)|MID$}}(a$, i, {{Text|1|#F580B1}}))
                        {{Cl|IF}} c2 >= {{Text|48|#F580B1}} {{Cl|AND (boolean)|AND}} c2 <= {{Text|57|#F580B1}} {{Cl|THEN}}
                            bitn$ = bitn$ + {{Cl|CHR$}}(c2)
                            i = i + {{Text|1|#F580B1}}
                        {{Cl|ELSE}}
                            {{Cl|EXIT}} {{Cl|DO}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|LOOP}}
                    {{Cl|IF}} bitn$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} bitn$ = {{Text|<nowiki>"1"</nowiki>|#FFB100}}
                    {{Text|<nowiki>'cull leading 0s off bitn$</nowiki>|#919191}}
                    {{Cl|DO}} {{Cl|WHILE}} {{Cl|LEFT$}}(bitn$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"0"</nowiki>|#FFB100}}: bitn$ = {{Cl|RIGHT$}}(bitn$, {{Cl|LEN}}(bitn$) - {{Text|1|#F580B1}}): {{Cl|LOOP}}
                    {{Cl|GOTO}} lfbiext
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'if no valid extension context was given, assume one</nowiki>|#919191}}
            {{Text|<nowiki>'note: leading 0s have been culled, so LEN(hx$) reflects its values size</nowiki>|#919191}}
            e$ = {{Text|<nowiki>"&&"</nowiki>|#FFB100}}
            {{Cl|IF}} {{Cl|LEN}}(hx$) <= {{Text|32|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"&"</nowiki>|#FFB100}}
            {{Cl|IF}} {{Cl|LEN}}(hx$) <= {{Text|16|#F580B1}} {{Cl|THEN}} e$ = {{Text|<nowiki>"%"</nowiki>|#FFB100}}
            {{Cl|GOTO}} lfbiext2
            lfbiext:
            fullhx$ = fullhx$ + e$ + bitn$
            lfbiext2:
            {{Text|<nowiki>'build 8-byte unsigned integer rep. of hx$</nowiki>|#919191}}
            {{Cl|IF}} {{Cl|LEN}}(hx$) > {{Text|64|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Overflow"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            v~&& = {{Text|0|#F580B1}}
            {{Cl|FOR}} i2 = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(hx$)
                v2 = {{Cl|ASC (function)|ASC}}({{Cl|MID$ (function)|MID$}}(hx$, i2, {{Text|1|#F580B1}}))
                v2 = v2 - {{Text|48|#F580B1}}
                v~&& = v~&& * {{Text|2|#F580B1}} + v2
            {{Cl|NEXT}}
            {{Cl|GOTO}} finishhexoctbin
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'----------------(number)&H??? error----------------</nowiki>|#919191}}
    {{Cl|IF}} c = {{Text|38|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected &H... or &O..."</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Text|<nowiki>'----------------variable/name----------------</nowiki>|#919191}}
    {{Text|<nowiki>'*trailing _ is treated as a seperate line extension*</nowiki>|#919191}}
    {{Cl|IF}} (c >= {{Text|65|#F580B1}} {{Cl|AND (boolean)|AND}} c <= {{Text|90|#F580B1}}) {{Cl|OR (boolean)|OR}} c = {{Text|95|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'A-Z(a-z) or _</nowiki>|#919191}}
        {{Cl|IF}} c = {{Text|95|#F580B1}} {{Cl|THEN}} p2 = {{Text|0|#F580B1}} {{Cl|ELSE}} p2 = i
        {{Cl|FOR}} i2 = i + {{Text|1|#F580B1}} {{Cl|TO}} n
            c2 = {{Cl|ASC (function)|ASC}}(a$, i2)
            {{Cl|IF}} {{Cl|NOT}} alphanumeric(c2) {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}}
            {{Cl|IF}} c2 <> {{Text|95|#F580B1}} {{Cl|THEN}} p2 = i2
        {{Cl|NEXT}}
        {{Cl|IF}} p2 {{Cl|THEN}} {{Text|<nowiki>'not just underscores!</nowiki>|#919191}}
            {{Text|<nowiki>'char is from i to p2</nowiki>|#919191}}
            n2 = p2 - i + {{Text|1|#F580B1}}
            a3$ = {{Cl|MID$ (function)|MID$}}(a$, i, n2)
            {{Text|<nowiki>'----(variable/name)rem----</nowiki>|#919191}}
            {{Cl|IF}} n2 = {{Text|3|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} a3$ = {{Text|<nowiki>"REM"</nowiki>|#FFB100}} {{Cl|THEN}}
                    i = i + n2
                    {{Cl|IF}} i < n {{Cl|THEN}}
                        c = {{Cl|ASC (function)|ASC}}(a$, i)
                        {{Cl|IF}} c = {{Text|46|#F580B1}} {{Cl|THEN}} a2$ = a2$ + sp + {{Cl|MID$ (function)|MID$}}(ca$, i - n2, n2): {{Cl|GOTO}} extcheck {{Text|<nowiki>'rem.Variable is a valid variable name in QB45</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|<nowiki>'note: In QBASIC 'IF cond THEN REM comment' counts as a single line IF statement, however use of ' instead of REM does not</nowiki>|#919191}}
                    {{Cl|IF}} {{Cl|UCASE$}}({{Cl|RIGHT$}}(a2$, {{Text|5|#F580B1}})) = sp + {{Text|<nowiki>"THEN"</nowiki>|#FFB100}} {{Cl|THEN}} a2$ = a2$ + sp + {{Text|<nowiki>"'"</nowiki>|#FFB100}} {{Text|<nowiki>'add nop</nowiki>|#919191}}
                    layoutcomment = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Rem"</nowiki>|#FFB100}})
                    {{Cl|GOTO}} comment
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'----(variable/name)data----</nowiki>|#919191}}
            {{Cl|IF}} n2 = {{Text|4|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} a3$ = {{Text|<nowiki>"DATA"</nowiki>|#FFB100}} {{Cl|THEN}}
                    x$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    i = i + n2
                    {{Cl|IF}} i < n {{Cl|THEN}}
                        c = {{Cl|ASC (function)|ASC}}(a$, i)
                        {{Cl|IF}} c = {{Text|46|#F580B1}} {{Cl|THEN}} a2$ = a2$ + sp + {{Cl|MID$ (function)|MID$}}(ca$, i - n2, n2): {{Cl|GOTO}} extcheck {{Text|<nowiki>'data.Variable is a valid variable name in QB45</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}}
                    scan = {{Text|0|#F580B1}}
                    speechmarks = {{Text|0|#F580B1}}
                    commanext = {{Text|0|#F580B1}}
                    finaldata = {{Text|0|#F580B1}}
                    e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    p1 = {{Text|0|#F580B1}}
                    p2 = {{Text|0|#F580B1}}
                    nextdatachr:
                    {{Cl|IF}} i < n {{Cl|THEN}}
                        c = {{Cl|ASC (function)|ASC}}(a$, i)
                        {{Cl|IF}} c = {{Text|9|#F580B1}} {{Cl|OR (boolean)|OR}} c = {{Text|32|#F580B1}} {{Cl|THEN}}
                            {{Cl|IF}} scan = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} skipwhitespace
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} c = {{Text|58|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'":"</nowiki>|#919191}}
                            {{Cl|IF}} speechmarks = {{Text|0|#F580B1}} {{Cl|THEN}} finaldata = {{Text|1|#F580B1}}: {{Cl|GOTO}} adddata
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} c = {{Text|44|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'","</nowiki>|#919191}}
                            {{Cl|IF}} speechmarks = {{Text|0|#F580B1}} {{Cl|THEN}}
                                adddata:
                                {{Cl|IF}} prepass = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} p1 {{Cl|THEN}}
                                        {{Text|<nowiki>'FOR i2 = p1 TO p2</nowiki>|#919191}}
                                        {{Text|<nowiki>'    DATA_add ASC(ca$, i2)</nowiki>|#919191}}
                                        {{Text|<nowiki>'NEXT</nowiki>|#919191}}
                                        x$ = x$ + {{Cl|MID$ (function)|MID$}}(ca$, p1, p2 - p1 + {{Text|1|#F580B1}})
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Text|<nowiki>'assume closing "</nowiki>|#919191}}
                                    {{Cl|IF}} speechmarks {{Cl|THEN}}
                                        {{Text|<nowiki>'DATA_add 34</nowiki>|#919191}}
                                        x$ = x$ + {{Cl|CHR$}}({{Text|34|#F580B1}})
                                    {{Cl|END}} {{Cl|IF}}
                                    {{Text|<nowiki>'append comma</nowiki>|#919191}}
                                    {{Text|<nowiki>'DATA_add 44</nowiki>|#919191}}
                                    x$ = x$ + {{Cl|CHR$}}({{Text|44|#F580B1}})
                                {{Cl|END}} {{Cl|IF}}
                                {{Cl|IF}} finaldata = {{Text|1|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} finisheddata
                                e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                                p1 = {{Text|0|#F580B1}}
                                p2 = {{Text|0|#F580B1}}
                                speechmarks = {{Text|0|#F580B1}}
                                scan = {{Text|0|#F580B1}}
                                commanext = {{Text|0|#F580B1}}
                                i = i + {{Text|1|#F580B1}}
                                {{Cl|GOTO}} nextdatachr
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'","</nowiki>|#919191}}
                        {{Cl|IF}} commanext = {{Text|1|#F580B1}} {{Cl|THEN}}
                            {{Cl|IF}} c <> {{Text|32|#F580B1}} {{Cl|AND (boolean)|AND}} c <> {{Text|9|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected , after quoted string in DATA statement"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Cl|IF}} c = {{Text|34|#F580B1}} {{Cl|THEN}}
                            {{Cl|IF}} speechmarks = {{Text|1|#F580B1}} {{Cl|THEN}}
                                commanext = {{Text|1|#F580B1}}
                                speechmarks = {{Text|0|#F580B1}}
                            {{Cl|END}} {{Cl|IF}}
                            {{Cl|IF}} scan = {{Text|0|#F580B1}} {{Cl|THEN}} speechmarks = {{Text|1|#F580B1}}
                        {{Cl|END}} {{Cl|IF}}
                        scan = {{Text|1|#F580B1}}
                        {{Cl|IF}} p1 = {{Text|0|#F580B1}} {{Cl|THEN}} p1 = i: p2 = i
                        {{Cl|IF}} c <> {{Text|9|#F580B1}} {{Cl|AND (boolean)|AND}} c <> {{Text|32|#F580B1}} {{Cl|THEN}} p2 = i
                        skipwhitespace:
                        i = i + {{Text|1|#F580B1}}: {{Cl|GOTO}} nextdatachr
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'i<n</nowiki>|#919191}}
                    finaldata = {{Text|1|#F580B1}}: {{Cl|GOTO}} adddata
                    finisheddata:
                    e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                    {{Cl|IF}} prepass = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Text|WriteBufRawData|#55FF55}} DataBinBuf, x$
                        DataOffset = DataOffset + {{Cl|LEN}}(x$)
                        e$ = {{Cl|SPACE$}}(({{Cl|LEN}}(x$) - {{Text|1|#F580B1}}) * {{Text|2|#F580B1}})
                        {{Cl|FOR}} ec = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(x$) - {{Text|1|#F580B1}}
                            {{Text|<nowiki>'2 chr hex encode each character</nowiki>|#919191}}
                            v1 = {{Cl|ASC (function)|ASC}}(x$, ec)
                            v2 = v1 \ {{Text|16|#F580B1}}: {{Cl|IF}} v2 <= {{Text|9|#F580B1}} {{Cl|THEN}} v2 = v2 + {{Text|48|#F580B1}} {{Cl|ELSE}} v2 = v2 + {{Text|55|#F580B1}}
                            v1 = v1 {{Cl|AND}} {{Text|15|#F580B1}}: {{Cl|IF}} v1 <= {{Text|9|#F580B1}} {{Cl|THEN}} v1 = v1 + {{Text|48|#F580B1}} {{Cl|ELSE}} v1 = v1 + {{Text|55|#F580B1}}
                            {{Cl|ASC}}(e$, ec * {{Text|2|#F580B1}} - {{Text|1|#F580B1}}) = v1
                            {{Cl|ASC}}(e$, ec * {{Text|2|#F580B1}}) = v2
                        {{Cl|NEXT}}
                    {{Cl|END}} {{Cl|IF}}
                    a2$ = a2$ + sp + {{Text|<nowiki>"DATA"</nowiki>|#FFB100}}: {{Cl|IF}} {{Cl|LEN}}(e$) {{Cl|THEN}} a2$ = a2$ + sp + {{Text|<nowiki>"_"</nowiki>|#FFB100}} + e$
                    {{Cl|GOTO}} lineformatnext
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            a2$ = a2$ + sp + {{Cl|MID$ (function)|MID$}}(ca$, i, n2)
            i = i + n2
            {{Text|<nowiki>'----(variable/name)extensions----</nowiki>|#919191}}
            extcheck:
            {{Cl|IF}} n2 > {{Text|40|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Identifier longer than 40 character limit"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            c3 = {{Cl|ASC (function)|ASC}}(a$, i)
            m = {{Text|0|#F580B1}}
            {{Cl|IF}} c3 = {{Text|126|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'"~"</nowiki>|#919191}}
                e2$ = {{Cl|MID$ (function)|MID$}}(a$, i + {{Text|1|#F580B1}}, {{Text|2|#F580B1}})
                {{Cl|IF}} e2$ = {{Text|<nowiki>"&&"</nowiki>|#FFB100}} {{Cl|THEN}} e2$ = {{Text|<nowiki>"~&&"</nowiki>|#FFB100}}: {{Cl|GOTO}} lfgetve
                {{Cl|IF}} e2$ = {{Text|<nowiki>"%%"</nowiki>|#FFB100}} {{Cl|THEN}} e2$ = {{Text|<nowiki>"~%%"</nowiki>|#FFB100}}: {{Cl|GOTO}} lfgetve
                {{Cl|IF}} e2$ = {{Text|<nowiki>"%&"</nowiki>|#FFB100}} {{Cl|THEN}} e2$ = {{Text|<nowiki>"~%&"</nowiki>|#FFB100}}: {{Cl|GOTO}} lfgetve
                e2$ = {{Cl|CHR$}}({{Cl|ASC (function)|ASC}}(e2$))
                {{Cl|IF}} e2$ = {{Text|<nowiki>"&"</nowiki>|#FFB100}} {{Cl|THEN}} e2$ = {{Text|<nowiki>"~&"</nowiki>|#FFB100}}: {{Cl|GOTO}} lfgetve
                {{Cl|IF}} e2$ = {{Text|<nowiki>"%"</nowiki>|#FFB100}} {{Cl|THEN}} e2$ = {{Text|<nowiki>"~%"</nowiki>|#FFB100}}: {{Cl|GOTO}} lfgetve
                {{Cl|IF}} e2$ = {{Text|<nowiki>"`"</nowiki>|#FFB100}} {{Cl|THEN}} m = {{Text|1|#F580B1}}: e2$ = {{Text|<nowiki>"~`"</nowiki>|#FFB100}}: {{Cl|GOTO}} lfgetve
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} c3 = {{Text|37|#F580B1}} {{Cl|THEN}}
                c4 = {{Cl|ASC (function)|ASC}}(a$, i + {{Text|1|#F580B1}})
                {{Cl|IF}} c4 = {{Text|37|#F580B1}} {{Cl|THEN}} e2$ = {{Text|<nowiki>"%%"</nowiki>|#FFB100}}: {{Cl|GOTO}} lfgetve
                {{Cl|IF}} c4 = {{Text|38|#F580B1}} {{Cl|THEN}} e2$ = {{Text|<nowiki>"%&"</nowiki>|#FFB100}}: {{Cl|GOTO}} lfgetve
                e2$ = {{Text|<nowiki>"%"</nowiki>|#FFB100}}: {{Cl|GOTO}} lfgetve
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} c3 = {{Text|38|#F580B1}} {{Cl|THEN}}
                c4 = {{Cl|ASC (function)|ASC}}(a$, i + {{Text|1|#F580B1}})
                {{Cl|IF}} c4 = {{Text|38|#F580B1}} {{Cl|THEN}} e2$ = {{Text|<nowiki>"&&"</nowiki>|#FFB100}}: {{Cl|GOTO}} lfgetve
                e2$ = {{Text|<nowiki>"&"</nowiki>|#FFB100}}: {{Cl|GOTO}} lfgetve
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} c3 = {{Text|33|#F580B1}} {{Cl|THEN}} e2$ = {{Text|<nowiki>"!"</nowiki>|#FFB100}}: {{Cl|GOTO}} lfgetve
            {{Cl|IF}} c3 = {{Text|35|#F580B1}} {{Cl|THEN}}
                c4 = {{Cl|ASC (function)|ASC}}(a$, i + {{Text|1|#F580B1}})
                {{Cl|IF}} c4 = {{Text|35|#F580B1}} {{Cl|THEN}} e2$ = {{Text|<nowiki>"##"</nowiki>|#FFB100}}: {{Cl|GOTO}} lfgetve
                e2$ = {{Text|<nowiki>"#"</nowiki>|#FFB100}}: {{Cl|GOTO}} lfgetve
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} c3 = {{Text|36|#F580B1}} {{Cl|THEN}} m = {{Text|1|#F580B1}}: e2$ = {{Text|<nowiki>"$"</nowiki>|#FFB100}}: {{Cl|GOTO}} lfgetve
            {{Cl|IF}} c3 = {{Text|96|#F580B1}} {{Cl|THEN}} m = {{Text|1|#F580B1}}: e2$ = {{Text|<nowiki>"`"</nowiki>|#FFB100}}: {{Cl|GOTO}} lfgetve
            {{Text|<nowiki>'(no symbol)</nowiki>|#919191}}
            {{Text|<nowiki>'cater for unusual names/labels (eg a.0b%)</nowiki>|#919191}}
            {{Cl|IF}} {{Cl|ASC (function)|ASC}}(a$, i) = {{Text|46|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'"."</nowiki>|#919191}}
                c2 = {{Cl|ASC (function)|ASC}}(a$, i + {{Text|1|#F580B1}})
                {{Cl|IF}} c2 >= {{Text|48|#F580B1}} {{Cl|AND (boolean)|AND}} c2 <= {{Text|57|#F580B1}} {{Cl|THEN}}
                    {{Text|<nowiki>'scan until no further alphanumerics</nowiki>|#919191}}
                    p2 = i + {{Text|1|#F580B1}}
                    {{Cl|FOR}} i2 = i + {{Text|2|#F580B1}} {{Cl|TO}} n
                        c = {{Cl|ASC (function)|ASC}}(a$, i2)
                        {{Cl|IF}} {{Cl|NOT}} alphanumeric(c) {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}}
                        {{Cl|IF}} c <> {{Text|95|#F580B1}} {{Cl|THEN}} p2 = i2 {{Text|<nowiki>'don't including trailing _</nowiki>|#919191}}
                    {{Cl|NEXT}}
                    a2$ = a2$ + sp + {{Text|<nowiki>"."</nowiki>|#FFB100}} + sp + {{Cl|MID$ (function)|MID$}}(ca$, i + {{Text|1|#F580B1}}, p2 - (i + {{Text|1|#F580B1}}) + {{Text|1|#F580B1}}) {{Text|<nowiki>'case sensitive</nowiki>|#919191}}
                    n2 = n2 + {{Text|1|#F580B1}} + (p2 - (i + {{Text|1|#F580B1}}) + {{Text|1|#F580B1}})
                    i = p2 + {{Text|1|#F580B1}}
                    {{Cl|GOTO}} extcheck {{Text|<nowiki>'it may have an extension or be continued with another "."</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|GOTO}} lineformatnext
            lfgetve:
            i = i + {{Cl|LEN}}(e2$)
            a2$ = a2$ + e2$
            {{Cl|IF}} m {{Cl|THEN}} {{Text|<nowiki>'allow digits after symbol</nowiki>|#919191}}
                lfgetvd:
                {{Cl|IF}} i < n {{Cl|THEN}}
                    c = {{Cl|ASC (function)|ASC}}(a$, i)
                    {{Cl|IF}} c >= {{Text|48|#F580B1}} {{Cl|AND (boolean)|AND}} c <= {{Text|57|#F580B1}} {{Cl|THEN}} a2$ = a2$ + {{Cl|CHR$}}(c): i = i + {{Text|1|#F580B1}}: {{Cl|GOTO}} lfgetvd
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'m</nowiki>|#919191}}
            {{Cl|GOTO}} lineformatnext
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'p2</nowiki>|#919191}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'variable/name</nowiki>|#919191}}
    {{Text|<nowiki>'----------------variable/name end----------------</nowiki>|#919191}}
    {{Text|<nowiki>'----------------spacing----------------</nowiki>|#919191}}
    {{Cl|IF}} c = {{Text|32|#F580B1}} {{Cl|OR (boolean)|OR}} c = {{Text|9|#F580B1}} {{Cl|THEN}} i = i + {{Text|1|#F580B1}}: {{Cl|GOTO}} lineformatnext
    {{Text|<nowiki>'----------------symbols----------------</nowiki>|#919191}}
    {{Text|<nowiki>'--------single characters--------</nowiki>|#919191}}
    {{Cl|IF}} lfsinglechar(c) {{Cl|THEN}}
        {{Cl|IF}} (c = {{Text|60|#F580B1}}) {{Cl|OR (boolean)|OR}} (c = {{Text|61|#F580B1}}) {{Cl|OR (boolean)|OR}} (c = {{Text|62|#F580B1}}) {{Cl|THEN}}
            count = {{Text|0|#F580B1}}
            {{Cl|DO}}
                count = count + {{Text|1|#F580B1}}
                {{Cl|IF}} i + count >= {{Cl|LEN}}(a$) - {{Text|2|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|DO}}
            {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|ASC (function)|ASC}}(a$, i + count) <> {{Text|32|#F580B1}}
            c2 = {{Cl|ASC (function)|ASC}}(a$, i + count)
            {{Cl|IF}} c = {{Text|60|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'<</nowiki>|#919191}}
                {{Cl|IF}} c2 = {{Text|61|#F580B1}} {{Cl|THEN}} a2$ = a2$ + sp + {{Text|<nowiki>"<="</nowiki>|#FFB100}}: i = i + count + {{Text|1|#F580B1}}: {{Cl|GOTO}} lineformatnext
                {{Cl|IF}} c2 = {{Text|62|#F580B1}} {{Cl|THEN}} a2$ = a2$ + sp + {{Text|<nowiki>"<>"</nowiki>|#FFB100}}: i = i + count + {{Text|1|#F580B1}}: {{Cl|GOTO}} lineformatnext
            {{Cl|ELSEIF}} c = {{Text|62|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'></nowiki>|#919191}}
                {{Cl|IF}} c2 = {{Text|61|#F580B1}} {{Cl|THEN}} a2$ = a2$ + sp + {{Text|<nowiki>">="</nowiki>|#FFB100}}: i = i + count + {{Text|1|#F580B1}}: {{Cl|GOTO}} lineformatnext
                {{Cl|IF}} c2 = {{Text|60|#F580B1}} {{Cl|THEN}} a2$ = a2$ + sp + {{Text|<nowiki>"<>"</nowiki>|#FFB100}}: i = i + count + {{Text|1|#F580B1}}: {{Cl|GOTO}} lineformatnext {{Text|<nowiki>'>< to <></nowiki>|#919191}}
            {{Cl|ELSEIF}} c = {{Text|61|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'=</nowiki>|#919191}}
                {{Cl|IF}} c2 = {{Text|62|#F580B1}} {{Cl|THEN}} a2$ = a2$ + sp + {{Text|<nowiki>">="</nowiki>|#FFB100}}: i = i + count + {{Text|1|#F580B1}}: {{Cl|GOTO}} lineformatnext {{Text|<nowiki>'=> to >=</nowiki>|#919191}}
                {{Cl|IF}} c2 = {{Text|60|#F580B1}} {{Cl|THEN}} a2$ = a2$ + sp + {{Text|<nowiki>"<="</nowiki>|#FFB100}}: i = i + count + {{Text|1|#F580B1}}: {{Cl|GOTO}} lineformatnext {{Text|<nowiki>'=< to <=</nowiki>|#919191}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} c = {{Text|36|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|LEN}}(a2$) {{Cl|THEN}} {{Cl|GOTO}} badusage {{Text|<nowiki>'$</nowiki>|#919191}}
        a2$ = a2$ + sp + {{Cl|CHR$}}(c)
        i = i + {{Text|1|#F580B1}}
        {{Cl|GOTO}} lineformatnext
    {{Cl|END}} {{Cl|IF}}
    badusage:
    {{Cl|IF}} c <> {{Text|39|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Unexpected character on line"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}} {{Text|<nowiki>'invalid symbol encountered</nowiki>|#919191}}
    {{Text|<nowiki>'----------------comment(')----------------</nowiki>|#919191}}
    layoutcomment = {{Text|<nowiki>"'"</nowiki>|#FFB100}}
    i = i + {{Text|1|#F580B1}}
    comment:
    {{Cl|IF}} i >= n {{Cl|THEN}} {{Cl|GOTO}} lineformatdone2
    c$ = {{Cl|RIGHT$}}(a$, {{Cl|LEN}}(a$) - i + {{Text|1|#F580B1}})
    cc$ = {{Cl|RIGHT$}}(ca$, {{Cl|LEN}}(ca$) - i + {{Text|1|#F580B1}})
    {{Cl|IF}} {{Cl|LEN}}(c$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} lineformatdone2
    layoutcomment$ = {{Cl|RTRIM$}}(layoutcomment$ + cc$)
    c$ = {{Cl|LTRIM$}}(c$)
    {{Cl|IF}} {{Cl|LEN}}(c$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} lineformatdone2
    ac = {{Cl|ASC (function)|ASC}}(c$)
    {{Text|<nowiki>'note: any non-whitespace character between the comment leader and the</nowiki>|#919191}}
    {{Text|<nowiki>'      first '$' renders this a plain comment</nowiki>|#919191}}
    {{Text|<nowiki>'    : the leading '$' does NOT have to be part of a valid metacommand.</nowiki>|#919191}}
    {{Text|<nowiki>'      E.g., REM $FOO $DYNAMIC is a valid metacommand line</nowiki>|#919191}}
    {{Cl|IF}} ac <> {{Text|36|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} lineformatdone2
    nocasec$ = {{Cl|LTRIM$}}({{Cl|RIGHT$}}(ca$, {{Cl|LEN}}(ca$) - i + {{Text|1|#F580B1}}))
    memmode = {{Text|0|#F580B1}}
    x = {{Text|1|#F580B1}}
    {{Cl|DO}}
        {{Text|<nowiki>'note: metacommands may appear on a line any number of times but only</nowiki>|#919191}}
        {{Text|<nowiki>'      the last appearance of $INCLUDE, and either $STATIC or $DYNAMIC,</nowiki>|#919191}}
        {{Text|<nowiki>'      is processed</nowiki>|#919191}}
        {{Text|<nowiki>'    : metacommands do not need to be terminated by word boundaries.</nowiki>|#919191}}
        {{Text|<nowiki>'      E.g., $STATICanychars$DYNAMIC is valid</nowiki>|#919191}}
        {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(c$, x, {{Text|7|#F580B1}}) = {{Text|<nowiki>"$STATIC"</nowiki>|#FFB100}} {{Cl|THEN}}
            memmode = {{Text|1|#F580B1}}
        {{Cl|ELSEIF}} {{Cl|MID$ (function)|MID$}}(c$, x, {{Text|8|#F580B1}}) = {{Text|<nowiki>"$DYNAMIC"</nowiki>|#FFB100}} {{Cl|THEN}}
            memmode = {{Text|2|#F580B1}}
        {{Cl|ELSEIF}} {{Cl|MID$ (function)|MID$}}(c$, x, {{Text|8|#F580B1}}) = {{Text|<nowiki>"$INCLUDE"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Text|<nowiki>'note: INCLUDE adds the file AFTER the line it is on has been processed</nowiki>|#919191}}
            {{Text|<nowiki>'skip spaces until :</nowiki>|#919191}}
            {{Cl|FOR}} xx = x + {{Text|8|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(c$)
                ac = {{Cl|ASC (function)|ASC}}({{Cl|MID$ (function)|MID$}}(c$, xx, {{Text|1|#F580B1}}))
                {{Cl|IF}} ac = {{Text|58|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}} {{Text|<nowiki>':</nowiki>|#919191}}
                {{Cl|IF}} ac <> {{Text|32|#F580B1}} {{Cl|AND (boolean)|AND}} ac <> {{Text|9|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected $INCLUDE:'filename'"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|NEXT}}
            x = xx
            {{Text|<nowiki>'skip spaces until '</nowiki>|#919191}}
            {{Cl|FOR}} xx = x + {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(c$)
                ac = {{Cl|ASC (function)|ASC}}({{Cl|MID$ (function)|MID$}}(c$, xx, {{Text|1|#F580B1}}))
                {{Cl|IF}} ac = {{Text|39|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}} {{Text|<nowiki>'character:'</nowiki>|#919191}}
                {{Cl|IF}} ac <> {{Text|32|#F580B1}} {{Cl|AND (boolean)|AND}} ac <> {{Text|9|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected $INCLUDE:'filename'"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|NEXT}}
            x = xx
            xx = {{Cl|INSTR}}(x + {{Text|1|#F580B1}}, c$, {{Text|<nowiki>"'"</nowiki>|#FFB100}})
            {{Cl|IF}} xx = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected $INCLUDE:'filename'"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            addmetainclude$ = {{Cl|MID$ (function)|MID$}}(nocasec$, x + {{Text|1|#F580B1}}, xx - x - {{Text|1|#F580B1}})
            {{Cl|IF}} addmetainclude$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected $INCLUDE:'filename'"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
        x = {{Cl|INSTR}}(x + {{Text|1|#F580B1}}, c$, {{Text|<nowiki>"$"</nowiki>|#FFB100}})
    {{Cl|LOOP}} {{Cl|WHILE}} x <> {{Text|0|#F580B1}}
    {{Cl|IF}} memmode = {{Text|1|#F580B1}} {{Cl|THEN}} addmetastatic = {{Text|1|#F580B1}}
    {{Cl|IF}} memmode = {{Text|2|#F580B1}} {{Cl|THEN}} addmetadynamic = {{Text|1|#F580B1}}
    {{Cl|GOTO}} lineformatdone2
    lineformatdone:
    {{Text|<nowiki>'line continuation?</nowiki>|#919191}}
    {{Text|<nowiki>'note: line continuation in idemode is illegal</nowiki>|#919191}}
    {{Cl|IF}} {{Cl|LEN}}(a2$) {{Cl|THEN}}
        {{Cl|IF}} {{Cl|RIGHT$}}(a2$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"_"</nowiki>|#FFB100}} {{Cl|THEN}}
            linecontinuation = {{Text|1|#F580B1}} {{Text|<nowiki>'avoids auto-format glitches</nowiki>|#919191}}
            layout$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Text|<nowiki>'remove _ from the end of the building string</nowiki>|#919191}}
            {{Cl|IF}} {{Cl|LEN}}(a2$) >= {{Text|2|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} {{Cl|RIGHT$}}(a2$, {{Text|2|#F580B1}}) = sp + {{Text|<nowiki>"_"</nowiki>|#FFB100}} {{Cl|THEN}} a2$ = {{Cl|LEFT$}}(a2$, {{Cl|LEN}}(a2$) - {{Text|1|#F580B1}})
            {{Cl|END}} {{Cl|IF}}
            a2$ = {{Cl|LEFT$}}(a2$, {{Cl|LEN}}(a2$) - {{Text|1|#F580B1}})
            {{Cl|IF}} inclevel {{Cl|THEN}}
                fh = {{Text|99|#F580B1}} + inclevel
                {{Cl|IF}} {{Cl|EOF}}(fh) {{Cl|THEN}} {{Cl|GOTO}} lineformatdone2
                {{Cl|LINE INPUT (file statement)|LINE INPUT}} #fh, a$
                inclinenumber(inclevel) = inclinenumber(inclevel) + {{Text|1|#F580B1}}
                {{Cl|GOTO}} includecont {{Text|<nowiki>'note: should not increase linenumber</nowiki>|#919191}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} idemode {{Cl|THEN}}
                idecommand$ = {{Cl|CHR$}}({{Text|100|#F580B1}})
                ignore = {{Text|ide|#55FF55}}({{Text|0|#F580B1}})
                ideerror = {{Text|0|#F580B1}}
                a$ = idereturn$
                {{Cl|IF}} a$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|GOTO}} lineformatdone2
            {{Cl|ELSE}}
                a$ = {{Text|lineinput3$|#55FF55}}
                {{Cl|IF}} a$ = {{Cl|CHR$}}({{Text|13|#F580B1}}) {{Cl|THEN}} {{Cl|GOTO}} lineformatdone2
            {{Cl|END}} {{Cl|IF}}
            linenumber = linenumber + {{Text|1|#F580B1}}
            includecont:
            contline = {{Text|1|#F580B1}}
            {{Cl|GOTO}} continueline
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    lineformatdone2:
    {{Cl|IF}} {{Cl|LEFT$}}(a2$, {{Text|1|#F580B1}}) = sp {{Cl|THEN}} a2$ = {{Cl|RIGHT$}}(a2$, {{Cl|LEN}}(a2$) - {{Text|1|#F580B1}})
    {{Text|<nowiki>'fix for trailing : error</nowiki>|#919191}}
    {{Cl|IF}} {{Cl|RIGHT$}}(a2$, {{Text|1|#F580B1}}) = {{Text|<nowiki>":"</nowiki>|#FFB100}} {{Cl|THEN}} a2$ = a2$ + sp + {{Text|<nowiki>"'"</nowiki>|#FFB100}} {{Text|<nowiki>'add nop</nowiki>|#919191}}
    {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"lineformat():return:"</nowiki>|#FFB100}} + a2$
    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Text|lineformat$|#55FF55}} = a2$
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|SUB}} {{Text|makeidrefer|#55FF55}} (ref$, typ {{Cl|AS}} {{Cl|LONG}})
    ref$ = {{Text|str2$|#55FF55}}(currentid)
    typ = id.t + ISREFERENCE
{{Cl|END}} {{Cl|SUB}}
{{Cl|FUNCTION}} {{Text|operatorusage|#55FF55}} (operator$, typ {{Cl|AS}} {{Cl|LONG}}, info$, lhs {{Cl|AS}} {{Cl|LONG}}, rhs {{Cl|AS}} {{Cl|LONG}}, result {{Cl|AS}} {{Cl|LONG}})
    lhs = {{Text|7|#F580B1}}: rhs = {{Text|7|#F580B1}}: result = {{Text|0|#F580B1}}
    {{Text|<nowiki>'return values</nowiki>|#919191}}
    {{Text|<nowiki>'1 = use info$ as the operator without any other changes</nowiki>|#919191}}
    {{Text|<nowiki>'2 = use the function returned in info$ to apply this operator</nowiki>|#919191}}
    {{Text|<nowiki>'    upon left and right side of equation</nowiki>|#919191}}
    {{Text|<nowiki>'3=  bracket left and right side with negation and change operator to info$</nowiki>|#919191}}
    {{Text|<nowiki>'4=  BINARY NOT l.h.s, then apply operator in info$</nowiki>|#919191}}
    {{Text|<nowiki>'5=  UNARY, bracket up rhs, apply operator info$ to left, rebracket again</nowiki>|#919191}}
    {{Text|<nowiki>'lhs & rhs bit-field values</nowiki>|#919191}}
    {{Text|<nowiki>'1=integeral</nowiki>|#919191}}
    {{Text|<nowiki>'2=floating point</nowiki>|#919191}}
    {{Text|<nowiki>'4=string</nowiki>|#919191}}
    {{Text|<nowiki>'8=bool</nowiki>|#919191}}
    {{Text|<nowiki>'string operator</nowiki>|#919191}}
    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}}
        lhs = {{Text|4|#F580B1}}: rhs = {{Text|4|#F580B1}}
        result = {{Text|4|#F580B1}}
        {{Cl|IF}} operator$ = {{Text|<nowiki>"+"</nowiki>|#FFB100}} {{Cl|THEN}} info$ = {{Text|<nowiki>"qbs_add"</nowiki>|#FFB100}}: {{Text|operatorusage|#55FF55}} = {{Text|2|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        result = {{Text|8|#F580B1}}
        {{Cl|IF}} operator$ = {{Text|<nowiki>"="</nowiki>|#FFB100}} {{Cl|THEN}} info$ = {{Text|<nowiki>"qbs_equal"</nowiki>|#FFB100}}: {{Text|operatorusage|#55FF55}} = {{Text|2|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} operator$ = {{Text|<nowiki>"<>"</nowiki>|#FFB100}} {{Cl|THEN}} info$ = {{Text|<nowiki>"qbs_notequal"</nowiki>|#FFB100}}: {{Text|operatorusage|#55FF55}} = {{Text|2|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} operator$ = {{Text|<nowiki>">"</nowiki>|#FFB100}} {{Cl|THEN}} info$ = {{Text|<nowiki>"qbs_greaterthan"</nowiki>|#FFB100}}: {{Text|operatorusage|#55FF55}} = {{Text|2|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} operator$ = {{Text|<nowiki>"<"</nowiki>|#FFB100}} {{Cl|THEN}} info$ = {{Text|<nowiki>"qbs_lessthan"</nowiki>|#FFB100}}: {{Text|operatorusage|#55FF55}} = {{Text|2|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} operator$ = {{Text|<nowiki>">="</nowiki>|#FFB100}} {{Cl|THEN}} info$ = {{Text|<nowiki>"qbs_greaterorequal"</nowiki>|#FFB100}}: {{Text|operatorusage|#55FF55}} = {{Text|2|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} operator$ = {{Text|<nowiki>"<="</nowiki>|#FFB100}} {{Cl|THEN}} info$ = {{Text|<nowiki>"qbs_lessorequal"</nowiki>|#FFB100}}: {{Text|operatorusage|#55FF55}} = {{Text|2|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"INVALID STRING OPERATOR!"</nowiki>|#FFB100}}: {{Cl|END}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'assume numeric operator</nowiki>|#919191}}
    lhs = {{Text|1|#F580B1}} + {{Text|2|#F580B1}}: rhs = {{Text|1|#F580B1}} + {{Text|2|#F580B1}}
    {{Cl|IF}} operator$ = {{Text|<nowiki>"^"</nowiki>|#FFB100}} {{Cl|THEN}} result = {{Text|2|#F580B1}}: info$ = {{Text|<nowiki>"pow2"</nowiki>|#FFB100}}: {{Text|operatorusage|#55FF55}} = {{Text|2|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} operator$ = {{Cl|CHR$}}({{Text|241|#F580B1}}) {{Cl|THEN}} info$ = {{Text|<nowiki>"-"</nowiki>|#FFB100}}: {{Text|operatorusage|#55FF55}} = {{Text|5|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} operator$ = {{Text|<nowiki>"/"</nowiki>|#FFB100}} {{Cl|THEN}}
        info$ = {{Text|<nowiki>"/ "</nowiki>|#FFB100}}: {{Text|operatorusage|#55FF55}} = {{Text|1|#F580B1}}
        {{Text|<nowiki>'for / division, either the lhs or the rhs must be a float to make</nowiki>|#919191}}
        {{Text|<nowiki>'c++ return a result in floating point form</nowiki>|#919191}}
        {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}}
            {{Text|<nowiki>'lhs is a float</nowiki>|#919191}}
            lhs = {{Text|2|#F580B1}}
            rhs = {{Text|1|#F580B1}} + {{Text|2|#F580B1}}
        {{Cl|ELSE}}
            {{Text|<nowiki>'lhs isn't a float!</nowiki>|#919191}}
            lhs = {{Text|1|#F580B1}} + {{Text|2|#F580B1}}
            rhs = {{Text|2|#F580B1}}
        {{Cl|END}} {{Cl|IF}}
        result = {{Text|2|#F580B1}}
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} operator$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} {{Cl|THEN}} info$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}}: {{Text|operatorusage|#55FF55}} = {{Text|1|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} operator$ = {{Text|<nowiki>"+"</nowiki>|#FFB100}} {{Cl|THEN}} info$ = {{Text|<nowiki>"+"</nowiki>|#FFB100}}: {{Text|operatorusage|#55FF55}} = {{Text|1|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} operator$ = {{Text|<nowiki>"-"</nowiki>|#FFB100}} {{Cl|THEN}} info$ = {{Text|<nowiki>"-"</nowiki>|#FFB100}}: {{Text|operatorusage|#55FF55}} = {{Text|1|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    result = {{Text|8|#F580B1}}
    {{Cl|IF}} operator$ = {{Text|<nowiki>"="</nowiki>|#FFB100}} {{Cl|THEN}} info$ = {{Text|<nowiki>"=="</nowiki>|#FFB100}}: {{Text|operatorusage|#55FF55}} = {{Text|3|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} operator$ = {{Text|<nowiki>">"</nowiki>|#FFB100}} {{Cl|THEN}} info$ = {{Text|<nowiki>">"</nowiki>|#FFB100}}: {{Text|operatorusage|#55FF55}} = {{Text|3|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} operator$ = {{Text|<nowiki>"<"</nowiki>|#FFB100}} {{Cl|THEN}} info$ = {{Text|<nowiki>"<"</nowiki>|#FFB100}}: {{Text|operatorusage|#55FF55}} = {{Text|3|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} operator$ = {{Text|<nowiki>"<>"</nowiki>|#FFB100}} {{Cl|THEN}} info$ = {{Text|<nowiki>"!="</nowiki>|#FFB100}}: {{Text|operatorusage|#55FF55}} = {{Text|3|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} operator$ = {{Text|<nowiki>"<="</nowiki>|#FFB100}} {{Cl|THEN}} info$ = {{Text|<nowiki>"<="</nowiki>|#FFB100}}: {{Text|operatorusage|#55FF55}} = {{Text|3|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} operator$ = {{Text|<nowiki>">="</nowiki>|#FFB100}} {{Cl|THEN}} info$ = {{Text|<nowiki>">="</nowiki>|#FFB100}}: {{Text|operatorusage|#55FF55}} = {{Text|3|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    lhs = {{Text|1|#F580B1}}: rhs = {{Text|1|#F580B1}}: result = {{Text|1|#F580B1}}
    operator$ = {{Cl|UCASE$}}(operator$)
    {{Cl|IF}} operator$ = {{Text|<nowiki>"MOD"</nowiki>|#FFB100}} {{Cl|THEN}} info$ = {{Text|<nowiki>"%"</nowiki>|#FFB100}}: {{Text|operatorusage|#55FF55}} = {{Text|1|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} operator$ = {{Text|<nowiki>"\"</nowiki>|#FFB100}} {{Cl|THEN}} info$ = {{Text|<nowiki>"/ "</nowiki>|#FFB100}}: {{Text|operatorusage|#55FF55}} = {{Text|1|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} operator$ = {{Text|<nowiki>"IMP"</nowiki>|#FFB100}} {{Cl|THEN}} info$ = {{Text|<nowiki>"|"</nowiki>|#FFB100}}: {{Text|operatorusage|#55FF55}} = {{Text|4|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} operator$ = {{Text|<nowiki>"EQV"</nowiki>|#FFB100}} {{Cl|THEN}} info$ = {{Text|<nowiki>"^"</nowiki>|#FFB100}}: {{Text|operatorusage|#55FF55}} = {{Text|4|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} operator$ = {{Text|<nowiki>"XOR"</nowiki>|#FFB100}} {{Cl|THEN}} info$ = {{Text|<nowiki>"^"</nowiki>|#FFB100}}: {{Text|operatorusage|#55FF55}} = {{Text|1|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} operator$ = {{Text|<nowiki>"OR"</nowiki>|#FFB100}} {{Cl|THEN}} info$ = {{Text|<nowiki>"|"</nowiki>|#FFB100}}: {{Text|operatorusage|#55FF55}} = {{Text|1|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} operator$ = {{Text|<nowiki>"AND"</nowiki>|#FFB100}} {{Cl|THEN}} info$ = {{Text|<nowiki>"&"</nowiki>|#FFB100}}: {{Text|operatorusage|#55FF55}} = {{Text|1|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    lhs = {{Text|7|#F580B1}}
    {{Cl|IF}} operator$ = {{Text|<nowiki>"NOT"</nowiki>|#FFB100}} {{Cl|THEN}} info$ = {{Text|<nowiki>"~"</nowiki>|#FFB100}}: {{Text|operatorusage|#55FF55}} = {{Text|5|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"INVALID NUMBERIC OPERATOR!"</nowiki>|#FFB100}}: {{Cl|END}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|refer$|#55FF55}} (a2$, typ {{Cl|AS}} {{Cl|LONG}}, method {{Cl|AS}} {{Cl|LONG}})
    typbak = typ
    {{Text|<nowiki>'method: 0 return an equation which calculates the value of the "variable"</nowiki>|#919191}}
    {{Text|<nowiki>'        1 return the C name of the variable, typ will be left unchanged</nowiki>|#919191}}
    a$ = a2$
    {{Text|<nowiki>'retrieve ID</nowiki>|#919191}}
    i = {{Cl|INSTR}}(a$, sp3)
    {{Cl|IF}} i {{Cl|THEN}}
        idnumber = {{Cl|VAL}}({{Cl|LEFT$}}(a$, i - {{Text|1|#F580B1}})): a$ = {{Cl|RIGHT$}}(a$, {{Cl|LEN}}(a$) - i)
    {{Cl|ELSE}}
        idnumber = {{Cl|VAL}}(a$)
    {{Cl|END}} {{Cl|IF}}
    {{Text|getid|#55FF55}} idnumber
    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Text|<nowiki>'UDT?</nowiki>|#919191}}
    {{Cl|IF}} typ {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
        {{Cl|IF}} method = {{Text|1|#F580B1}} {{Cl|THEN}}
            n$ = {{Text|<nowiki>"UDT_"</nowiki>|#FFB100}} + {{Cl|RTRIM$}}(id.n)
            {{Cl|IF}} id.t = {{Text|0|#F580B1}} {{Cl|THEN}} n$ = {{Text|<nowiki>"ARRAY_"</nowiki>|#FFB100}} + n$
            n$ = {{Text|scope$|#55FF55}} + n$
            {{Text|refer$|#55FF55}} = n$
            {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'print "UDTSUBSTRING[idX|u|e|o]:"+a$</nowiki>|#919191}}
        u = {{Cl|VAL}}(a$)
        i = {{Cl|INSTR}}(a$, sp3): a$ = {{Cl|RIGHT$}}(a$, {{Cl|LEN}}(a$) - i): E = {{Cl|VAL}}(a$)
        i = {{Cl|INSTR}}(a$, sp3): o$ = {{Cl|RIGHT$}}(a$, {{Cl|LEN}}(a$) - i)
        n$ = {{Text|<nowiki>"UDT_"</nowiki>|#FFB100}} + {{Cl|RTRIM$}}(id.n): {{Cl|IF}} id.t = {{Text|0|#F580B1}} {{Cl|THEN}} n$ = {{Text|<nowiki>"ARRAY_"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]"</nowiki>|#FFB100}}
        {{Cl|IF}} E = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"User defined types in expressions are invalid"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} typ {{Cl|AND (boolean)|AND}} ISOFFSETINBITS {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot resolve bit-length variables inside user defined types"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} typ {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
            {{Cl|IF}} typ {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH {{Cl|THEN}}
                o2$ = {{Text|<nowiki>"(((uint8*)"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + n$ + {{Text|<nowiki>")+("</nowiki>|#FFB100}} + o$ + {{Text|<nowiki>"))"</nowiki>|#FFB100}}
                r$ = {{Text|<nowiki>"qbs_new_fixed("</nowiki>|#FFB100}} + o2$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(udtetypesize(E)) + {{Text|<nowiki>",1)"</nowiki>|#FFB100}}
                typ = STRINGTYPE + ISFIXEDLENGTH {{Text|<nowiki>'ISPOINTER retained, it is still a pointer!</nowiki>|#919191}}
            {{Cl|ELSE}}
                r$ = {{Text|<nowiki>"*((qbs**)((char*)"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + n$ + {{Text|<nowiki>"+("</nowiki>|#FFB100}} + o$ + {{Text|<nowiki>")))"</nowiki>|#FFB100}}
                typ = STRINGTYPE
            {{Cl|END}} {{Cl|IF}}
        {{Cl|ELSE}}
            typ = typ - ISUDT - ISREFERENCE - ISPOINTER
            {{Cl|IF}} typ {{Cl|AND (boolean)|AND}} ISARRAY {{Cl|THEN}} typ = typ - ISARRAY
            t$ = {{Text|typ2ctyp$|#55FF55}}(typ, {{Text|<nowiki>""</nowiki>|#FFB100}})
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            o2$ = {{Text|<nowiki>"(((char*)"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + n$ + {{Text|<nowiki>")+("</nowiki>|#FFB100}} + o$ + {{Text|<nowiki>"))"</nowiki>|#FFB100}}
            r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|<nowiki>"("</nowiki>|#FFB100}} + t$ + {{Text|<nowiki>"*)"</nowiki>|#FFB100}} + o2$
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'print "REFER:"+r$+","+str2$(typ)</nowiki>|#919191}}
        {{Text|refer$|#55FF55}} = r$
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'array?</nowiki>|#919191}}
    {{Cl|IF}} id.arraytype {{Cl|THEN}}
        n$ = {{Cl|RTRIM$}}(id.callname)
        {{Cl|IF}} method = {{Text|1|#F580B1}} {{Cl|THEN}}
            {{Text|refer$|#55FF55}} = n$
            typ = typbak
            {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
        typ = typ - ISPOINTER - ISREFERENCE {{Text|<nowiki>'typ now looks like a regular value</nowiki>|#919191}}
        {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}}
            {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) {{Cl|THEN}}
                offset$ = {{Text|<nowiki>"&((uint8*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]))[("</nowiki>|#FFB100}} + a$ + {{Text|<nowiki>")*"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(id.tsize) + {{Text|<nowiki>"]"</nowiki>|#FFB100}}
                r$ = {{Text|<nowiki>"qbs_new_fixed("</nowiki>|#FFB100}} + offset$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(id.tsize) + {{Text|<nowiki>",1)"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                r$ = {{Text|<nowiki>"((qbs*)(((uint64*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]))["</nowiki>|#FFB100}} + a$ + {{Text|<nowiki>"]))"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            stringprocessinghappened = {{Text|1|#F580B1}}
            {{Text|refer$|#55FF55}} = r$
            {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) {{Cl|THEN}}
            {{Text|<nowiki>'IF (typ AND ISUNSIGNED) THEN r$ = "getubits_" ELSE r$ = "getbits_"</nowiki>|#919191}}
            {{Text|<nowiki>'r$ = r$ + str2(typ AND 511) + "("</nowiki>|#919191}}
            {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISUNSIGNED) {{Cl|THEN}} r$ = {{Text|<nowiki>"getubits"</nowiki>|#FFB100}} {{Cl|ELSE}} r$ = {{Text|<nowiki>"getbits"</nowiki>|#FFB100}}
            r$ = r$ + {{Text|<nowiki>"("</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(typ {{Cl|AND}} {{Text|511|#F580B1}}) + {{Text|<nowiki>","</nowiki>|#FFB100}}
            r$ = r$ + {{Text|<nowiki>"(uint8*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0])"</nowiki>|#FFB100}} + {{Text|<nowiki>","</nowiki>|#FFB100}}
            r$ = r$ + a$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
            {{Text|refer$|#55FF55}} = r$
            {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|ELSE}}
            t$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}}
                {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|32|#F580B1}} {{Cl|THEN}} t$ = {{Text|<nowiki>"float"</nowiki>|#FFB100}}
                {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|64|#F580B1}} {{Cl|THEN}} t$ = {{Text|<nowiki>"double"</nowiki>|#FFB100}}
                {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|256|#F580B1}} {{Cl|THEN}} t$ = {{Text|<nowiki>"long double"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISUNSIGNED) {{Cl|THEN}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|8|#F580B1}} {{Cl|THEN}} t$ = {{Text|<nowiki>"uint8"</nowiki>|#FFB100}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|16|#F580B1}} {{Cl|THEN}} t$ = {{Text|<nowiki>"uint16"</nowiki>|#FFB100}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|32|#F580B1}} {{Cl|THEN}} t$ = {{Text|<nowiki>"uint32"</nowiki>|#FFB100}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|64|#F580B1}} {{Cl|THEN}} t$ = {{Text|<nowiki>"uint64"</nowiki>|#FFB100}}
                    {{Cl|IF}} typ {{Cl|AND (boolean)|AND}} ISOFFSET {{Cl|THEN}} t$ = {{Text|<nowiki>"uptrszint"</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|8|#F580B1}} {{Cl|THEN}} t$ = {{Text|<nowiki>"int8"</nowiki>|#FFB100}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|16|#F580B1}} {{Cl|THEN}} t$ = {{Text|<nowiki>"int16"</nowiki>|#FFB100}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|32|#F580B1}} {{Cl|THEN}} t$ = {{Text|<nowiki>"int32"</nowiki>|#FFB100}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|64|#F580B1}} {{Cl|THEN}} t$ = {{Text|<nowiki>"int64"</nowiki>|#FFB100}}
                    {{Cl|IF}} typ {{Cl|AND (boolean)|AND}} ISOFFSET {{Cl|THEN}} t$ = {{Text|<nowiki>"ptrszint"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} t$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot find C type to return array data"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        r$ = {{Text|<nowiki>"(("</nowiki>|#FFB100}} + t$ + {{Text|<nowiki>"*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]))["</nowiki>|#FFB100}} + a$ + {{Text|<nowiki>"]"</nowiki>|#FFB100}}
        {{Text|refer$|#55FF55}} = r$
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'array</nowiki>|#919191}}
    {{Text|<nowiki>'variable?</nowiki>|#919191}}
    {{Cl|IF}} id.t {{Cl|THEN}}
        r$ = {{Cl|RTRIM$}}(id.n)
        t = id.t
        {{Text|<nowiki>'remove irrelavant flags</nowiki>|#919191}}
        {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISINCONVENTIONALMEMORY) {{Cl|THEN}} t = t - ISINCONVENTIONALMEMORY
        {{Text|<nowiki>'string?</nowiki>|#919191}}
        {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}}
            {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) {{Cl|THEN}}
                r$ = {{Text|scope$|#55FF55}} + {{Text|<nowiki>"STRING"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(id.tsize) + {{Text|<nowiki>"_"</nowiki>|#FFB100}} + r$: {{Cl|GOTO}} ref
            {{Cl|END}} {{Cl|IF}}
            r$ = {{Text|scope$|#55FF55}} + {{Text|<nowiki>"STRING_"</nowiki>|#FFB100}} + r$: {{Cl|GOTO}} ref
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'bit-length single variable?</nowiki>|#919191}}
        {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) {{Cl|THEN}}
            {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISUNSIGNED) {{Cl|THEN}}
                r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + {{Text|<nowiki>"UBIT"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(t {{Cl|AND}} {{Text|511|#F580B1}}) + {{Text|<nowiki>"_"</nowiki>|#FFB100}} + r$
            {{Cl|ELSE}}
                r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + {{Text|<nowiki>"BIT"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(t {{Cl|AND}} {{Text|511|#F580B1}}) + {{Text|<nowiki>"_"</nowiki>|#FFB100}} + r$
            {{Cl|END}} {{Cl|IF}}
            {{Cl|GOTO}} ref
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} t = BYTETYPE {{Cl|THEN}} r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + {{Text|<nowiki>"BYTE_"</nowiki>|#FFB100}} + r$: {{Cl|GOTO}} ref
        {{Cl|IF}} t = UBYTETYPE {{Cl|THEN}} r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + {{Text|<nowiki>"UBYTE_"</nowiki>|#FFB100}} + r$: {{Cl|GOTO}} ref
        {{Cl|IF}} t = INTEGERTYPE {{Cl|THEN}} r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + {{Text|<nowiki>"INTEGER_"</nowiki>|#FFB100}} + r$: {{Cl|GOTO}} ref
        {{Cl|IF}} t = UINTEGERTYPE {{Cl|THEN}} r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + {{Text|<nowiki>"UINTEGER_"</nowiki>|#FFB100}} + r$: {{Cl|GOTO}} ref
        {{Cl|IF}} t = LONGTYPE {{Cl|THEN}} r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + {{Text|<nowiki>"LONG_"</nowiki>|#FFB100}} + r$: {{Cl|GOTO}} ref
        {{Cl|IF}} t = ULONGTYPE {{Cl|THEN}} r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + {{Text|<nowiki>"ULONG_"</nowiki>|#FFB100}} + r$: {{Cl|GOTO}} ref
        {{Cl|IF}} t = INTEGER64TYPE {{Cl|THEN}} r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + {{Text|<nowiki>"INTEGER64_"</nowiki>|#FFB100}} + r$: {{Cl|GOTO}} ref
        {{Cl|IF}} t = UINTEGER64TYPE {{Cl|THEN}} r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + {{Text|<nowiki>"UINTEGER64_"</nowiki>|#FFB100}} + r$: {{Cl|GOTO}} ref
        {{Cl|IF}} t = SINGLETYPE {{Cl|THEN}} r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + {{Text|<nowiki>"SINGLE_"</nowiki>|#FFB100}} + r$: {{Cl|GOTO}} ref
        {{Cl|IF}} t = DOUBLETYPE {{Cl|THEN}} r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + {{Text|<nowiki>"DOUBLE_"</nowiki>|#FFB100}} + r$: {{Cl|GOTO}} ref
        {{Cl|IF}} t = FLOATTYPE {{Cl|THEN}} r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + {{Text|<nowiki>"FLOAT_"</nowiki>|#FFB100}} + r$: {{Cl|GOTO}} ref
        {{Cl|IF}} t = OFFSETTYPE {{Cl|THEN}} r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + {{Text|<nowiki>"OFFSET_"</nowiki>|#FFB100}} + r$: {{Cl|GOTO}} ref
        {{Cl|IF}} t = UOFFSETTYPE {{Cl|THEN}} r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + {{Text|<nowiki>"UOFFSET_"</nowiki>|#FFB100}} + r$: {{Cl|GOTO}} ref
        ref:
        {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} stringprocessinghappened = {{Text|1|#F580B1}}
        {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISPOINTER) {{Cl|THEN}} t = t - ISPOINTER
        typ = t
        {{Cl|IF}} method = {{Text|1|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} {{Cl|LEFT$}}(r$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"*"</nowiki>|#FFB100}} {{Cl|THEN}} r$ = {{Cl|RIGHT$}}(r$, {{Cl|LEN}}(r$) - {{Text|1|#F580B1}})
            typ = typbak
        {{Cl|END}} {{Cl|IF}}
        {{Text|refer$|#55FF55}} = r$
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'variable</nowiki>|#919191}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|SUB}} {{Text|regid|#55FF55}}
    idn = idn + {{Text|1|#F580B1}}
    {{Cl|IF}} idn > ids_max {{Cl|THEN}}
        ids_max = ids_max * {{Text|2|#F580B1}}
        {{Cl|REDIM}} {{Cl|_PRESERVE}} ids({{Text|1|#F580B1}} {{Cl|TO}} ids_max) {{Cl|AS}} idstruct
        {{Cl|REDIM}} {{Cl|_PRESERVE}} cmemlist({{Text|1|#F580B1}} {{Cl|TO}} ids_max + {{Text|1|#F580B1}}) {{Cl|AS}} {{Cl|INTEGER}}
        {{Cl|REDIM}} {{Cl|_PRESERVE}} sfcmemargs({{Text|1|#F580B1}} {{Cl|TO}} ids_max + {{Text|1|#F580B1}}) {{Cl|AS}} {{Cl|STRING}} * {{Text|100|#F580B1}}
        {{Cl|REDIM}} {{Cl|_PRESERVE}} arrayelementslist({{Text|1|#F580B1}} {{Cl|TO}} ids_max + {{Text|1|#F580B1}}) {{Cl|AS}} {{Cl|INTEGER}}
    {{Cl|END}} {{Cl|IF}}
    n$ = {{Cl|RTRIM$}}(id.n)
    {{Cl|IF}} reginternalsubfunc = {{Text|0|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} {{Text|validname|#55FF55}}(n$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid name"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'register case sensitive name if none given</nowiki>|#919191}}
    {{Cl|IF}} {{Cl|ASC (function)|ASC}}(id.cn) = {{Text|32|#F580B1}} {{Cl|THEN}}
        n$ = {{Cl|RTRIM$}}(id.n)
        id.n = {{Cl|UCASE$}}(n$)
        id.cn = n$
    {{Cl|END}} {{Cl|IF}}
    id.insubfunc = subfunc
    id.insubfuncn = subfuncn
    {{Text|<nowiki>'note: cannot be STATIC and SHARED at the same time</nowiki>|#919191}}
    {{Cl|IF}} dimshared {{Cl|THEN}}
        id.share = dimshared
    {{Cl|ELSE}}
        {{Cl|IF}} dimstatic {{Cl|THEN}} id.staticscope = {{Text|1|#F580B1}}
    {{Cl|END}} {{Cl|IF}}
    ids(idn) = id
    currentid = idn
    {{Text|<nowiki>'prepare hash flags and check for conflicts</nowiki>|#919191}}
    hashflags = {{Text|1|#F580B1}}
    {{Text|<nowiki>'sub/function?</nowiki>|#919191}}
    {{Text|<nowiki>'Note: QBASIC does not allow: Internal type names (INTEGER,LONG,...)</nowiki>|#919191}}
    {{Cl|IF}} id.subfunc {{Cl|THEN}}
        ids(currentid).internal_subfunc = reginternalsubfunc
        {{Cl|IF}} id.subfunc = {{Text|1|#F580B1}} {{Cl|THEN}} hashflags = hashflags + HASHFLAG_FUNCTION {{Cl|ELSE}} hashflags = hashflags + HASHFLAG_SUB
        {{Cl|IF}} reginternalsubfunc = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'allow internal definition of subs/functions without checks</nowiki>|#919191}}
            hashchkflags = HASHFLAG_RESERVED + HASHFLAG_CONSTANT
            {{Cl|IF}} id.subfunc = {{Text|1|#F580B1}} {{Cl|THEN}} hashchkflags = hashchkflags + HASHFLAG_FUNCTION {{Cl|ELSE}} hashchkflags = hashchkflags + HASHFLAG_SUB
            hashres = {{Text|HashFind|#55FF55}}(n$, hashchkflags, hashresflags, hashresref)
            {{Cl|DO}} {{Cl|WHILE}} hashres
                {{Cl|IF}} hashres {{Cl|THEN}}
                    {{Text|<nowiki>'Note: Numeric sub/function names like 'mid' do not clash with Internal string sub/function names</nowiki>|#919191}}
                    {{Text|<nowiki>'      like 'MID$' because MID$ always requires a '$'. For user defined string sub/function names</nowiki>|#919191}}
                    {{Text|<nowiki>'      the '$' would be optional so the rule should not be applied there.</nowiki>|#919191}}
                    allow = {{Text|0|#F580B1}}
                    {{Cl|IF}} hashresflags {{Cl|AND (boolean)|AND}} (HASHFLAG_FUNCTION + HASHFLAG_SUB) {{Cl|THEN}}
                        {{Cl|IF}} {{Cl|RTRIM$}}(ids(hashresref).musthave) = {{Text|<nowiki>"$"</nowiki>|#FFB100}} {{Cl|THEN}}
                            {{Cl|IF}} {{Cl|INSTR}}(ids(currentid).mayhave, {{Text|<nowiki>"$"</nowiki>|#FFB100}}) = {{Text|0|#F580B1}} {{Cl|THEN}} allow = {{Text|1|#F580B1}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} allow = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'hashres</nowiki>|#919191}}
                {{Cl|IF}} hashres <> {{Text|1|#F580B1}} {{Cl|THEN}} hashres = {{Text|HashFindCont|#55FF55}}(hashresflags, hashresref) {{Cl|ELSE}} hashres = {{Text|0|#F580B1}}
            {{Cl|LOOP}}
            {{Cl|IF}} idemode {{Cl|THEN}}
                {{Cl|IF}} {{Cl|INSTR}}(listOfCustomKeywords$, {{Text|<nowiki>"@"</nowiki>|#FFB100}} + {{Cl|UCASE$}}(n$) + {{Text|<nowiki>"@"</nowiki>|#FFB100}}) = {{Text|0|#F580B1}} {{Cl|THEN}}
                    listOfCustomKeywords$ = listOfCustomKeywords$ + {{Text|<nowiki>"@"</nowiki>|#FFB100}} + {{Cl|UCASE$}}(n$) + {{Text|<nowiki>"@"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'reginternalsubfunc = 0</nowiki>|#919191}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'variable?</nowiki>|#919191}}
    {{Cl|IF}} id.t {{Cl|THEN}}
        hashflags = hashflags + HASHFLAG_VARIABLE
        {{Cl|IF}} reginternalvariable = {{Text|0|#F580B1}} {{Cl|THEN}}
            allow = {{Text|0|#F580B1}}
            var_recheck:
            {{Cl|IF}} {{Cl|ASC (function)|ASC}}(id.musthave) = {{Text|32|#F580B1}} {{Cl|THEN}} astype2 = {{Text|1|#F580B1}} {{Text|<nowiki>'"AS type" declaration?</nowiki>|#919191}}
            scope2 = subfuncn
            hashchkflags = HASHFLAG_RESERVED + HASHFLAG_SUB + HASHFLAG_FUNCTION + HASHFLAG_CONSTANT + HASHFLAG_VARIABLE
            hashres = {{Text|HashFind|#55FF55}}(n$, hashchkflags, hashresflags, hashresref)
            {{Cl|DO}} {{Cl|WHILE}} hashres
                {{Text|<nowiki>'conflict with reserved word?</nowiki>|#919191}}
                {{Cl|IF}} hashresflags {{Cl|AND (boolean)|AND}} HASHFLAG_RESERVED {{Cl|THEN}}
                    musthave$ = {{Cl|RTRIM$}}(id.musthave)
                    {{Cl|IF}} {{Cl|INSTR}}(musthave$, {{Text|<nowiki>"$"</nowiki>|#FFB100}}) {{Cl|THEN}}
                        {{Text|<nowiki>'All reserved words can be used as variables in QBASIC if "$" is appended to the variable name!</nowiki>|#919191}}
                        {{Text|<nowiki>'(allow)</nowiki>|#919191}}
                    {{Cl|ELSE}}
                        {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}} {{Text|<nowiki>'Conflicts with reserved word</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'HASHFLAG_RESERVED</nowiki>|#919191}}
                {{Text|<nowiki>'conflict with sub/function?</nowiki>|#919191}}
                {{Cl|IF}} hashresflags {{Cl|AND (boolean)|AND}} (HASHFLAG_FUNCTION + HASHFLAG_SUB) {{Cl|THEN}}
                    {{Cl|IF}} ids(hashresref).internal_subfunc = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}} {{Text|<nowiki>'QBASIC doesn't allow a variable of the same name as a user-defined sub/func</nowiki>|#919191}}
                    {{Cl|IF}} {{Cl|RTRIM$}}(id.n) = {{Text|<nowiki>"WIDTH"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} ids(hashresref).subfunc = {{Text|2|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} varname_exception
                    musthave$ = {{Cl|RTRIM$}}(id.musthave)
                    {{Cl|IF}} {{Cl|LEN}}(musthave$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} {{Cl|RTRIM$}}(ids(hashresref).musthave) = {{Text|<nowiki>"$"</nowiki>|#FFB100}} {{Cl|THEN}}
                            {{Text|<nowiki>'a sub/func requiring "$" can co-exist with implicit numeric variables</nowiki>|#919191}}
                            {{Cl|IF}} {{Cl|INSTR}}(id.mayhave, {{Text|<nowiki>"$"</nowiki>|#FFB100}}) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
                        {{Cl|ELSE}}
                            {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}} {{Text|<nowiki>'Implicitly defined variables cannot conflict with sub/func names</nowiki>|#919191}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'len(musthave$)=0</nowiki>|#919191}}
                    {{Cl|IF}} {{Cl|INSTR}}(musthave$, {{Text|<nowiki>"$"</nowiki>|#FFB100}}) {{Cl|THEN}}
                        {{Cl|IF}} {{Cl|RTRIM$}}(ids(hashresref).musthave) = {{Text|<nowiki>"$"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}} {{Text|<nowiki>'A sub/function name already exists as a string</nowiki>|#919191}}
                        {{Text|<nowiki>'(allow)</nowiki>|#919191}}
                    {{Cl|ELSE}}
                        {{Cl|IF}} {{Cl|RTRIM$}}(ids(hashresref).musthave) <> {{Text|<nowiki>"$"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}} {{Text|<nowiki>'A non-"$" sub/func name already exists with this name</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'HASHFLAG_FUNCTION + HASHFLAG_SUB</nowiki>|#919191}}
                {{Text|<nowiki>'conflict with constant?</nowiki>|#919191}}
                {{Cl|IF}} hashresflags {{Cl|AND (boolean)|AND}} HASHFLAG_CONSTANT {{Cl|THEN}}
                    scope1 = constsubfunc(hashresref)
                    {{Cl|IF}} (scope1 = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} AllowLocalName = {{Text|0|#F580B1}}) {{Cl|OR (boolean)|OR}} scope1 = scope2 {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'conflict with variable?</nowiki>|#919191}}
                {{Cl|IF}} hashresflags {{Cl|AND (boolean)|AND}} HASHFLAG_VARIABLE {{Cl|THEN}}
                    astype1 = {{Text|0|#F580B1}}: {{Cl|IF}} {{Cl|ASC (function)|ASC}}(ids(hashresref).musthave) = {{Text|32|#F580B1}} {{Cl|THEN}} astype1 = {{Text|1|#F580B1}}
                    scope1 = ids(hashresref).insubfuncn
                    {{Cl|IF}} astype1 = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} astype2 = {{Text|1|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} scope1 = scope2 {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|<nowiki>'same type?</nowiki>|#919191}}
                    {{Cl|IF}} id.t = ids(hashresref).t {{Cl|THEN}}
                        {{Cl|IF}} id.tsize = ids(hashresref).tsize {{Cl|THEN}}
                            {{Cl|IF}} scope1 = scope2 {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|<nowiki>'will astype'd fixed STRING-variable mask a non-fixed string?</nowiki>|#919191}}
                    {{Cl|IF}} id.t {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH {{Cl|THEN}}
                        {{Cl|IF}} astype2 = {{Text|1|#F580B1}} {{Cl|THEN}}
                            {{Cl|IF}} ids(hashresref).t {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                                {{Cl|IF}} (ids(hashresref).t {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|IF}} scope1 = scope2 {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                varname_exception:
                {{Cl|IF}} hashres <> {{Text|1|#F580B1}} {{Cl|THEN}} hashres = {{Text|HashFindCont|#55FF55}}(hashresflags, hashresref) {{Cl|ELSE}} hashres = {{Text|0|#F580B1}}
            {{Cl|LOOP}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'reginternalvariable</nowiki>|#919191}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'variable</nowiki>|#919191}}
    {{Text|<nowiki>'array?</nowiki>|#919191}}
    {{Cl|IF}} id.arraytype {{Cl|THEN}}
        hashflags = hashflags + HASHFLAG_ARRAY
        allow = {{Text|0|#F580B1}}
        ary_recheck:
        scope2 = subfuncn
        {{Cl|IF}} {{Cl|ASC (function)|ASC}}(id.musthave) = {{Text|32|#F580B1}} {{Cl|THEN}} astype2 = {{Text|1|#F580B1}} {{Text|<nowiki>'"AS type" declaration?</nowiki>|#919191}}
        hashchkflags = HASHFLAG_RESERVED + HASHFLAG_SUB + HASHFLAG_FUNCTION + HASHFLAG_ARRAY
        hashres = {{Text|HashFind|#55FF55}}(n$, hashchkflags, hashresflags, hashresref)
        {{Cl|DO}} {{Cl|WHILE}} hashres
            {{Text|<nowiki>'conflict with reserved word?</nowiki>|#919191}}
            {{Cl|IF}} hashresflags {{Cl|AND (boolean)|AND}} HASHFLAG_RESERVED {{Cl|THEN}}
                musthave$ = {{Cl|RTRIM$}}(id.musthave)
                {{Cl|IF}} {{Cl|INSTR}}(musthave$, {{Text|<nowiki>"$"</nowiki>|#FFB100}}) {{Cl|THEN}}
                    {{Text|<nowiki>'All reserved words can be used as variables in QBASIC if "$" is appended to the variable name!</nowiki>|#919191}}
                    {{Text|<nowiki>'(allow)</nowiki>|#919191}}
                {{Cl|ELSE}}
                    {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}} {{Text|<nowiki>'Conflicts with reserved word</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'HASHFLAG_RESERVED</nowiki>|#919191}}
            {{Text|<nowiki>'conflict with sub/function?</nowiki>|#919191}}
            {{Cl|IF}} hashresflags {{Cl|AND (boolean)|AND}} (HASHFLAG_FUNCTION + HASHFLAG_SUB) {{Cl|THEN}}
                {{Cl|IF}} ids(hashresref).internal_subfunc = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}} {{Text|<nowiki>'QBASIC doesn't allow a variable of the same name as a user-defined sub/func</nowiki>|#919191}}
                {{Cl|IF}} {{Cl|RTRIM$}}(id.n) = {{Text|<nowiki>"WIDTH"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} ids(hashresref).subfunc = {{Text|2|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} arrayname_exception
                musthave$ = {{Cl|RTRIM$}}(id.musthave)
                {{Cl|IF}} {{Cl|LEN}}(musthave$) = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} {{Cl|RTRIM$}}(ids(hashresref).musthave) = {{Text|<nowiki>"$"</nowiki>|#FFB100}} {{Cl|THEN}}
                        {{Text|<nowiki>'a sub/func requiring "$" can co-exist with implicit numeric variables</nowiki>|#919191}}
                        {{Cl|IF}} {{Cl|INSTR}}(id.mayhave, {{Text|<nowiki>"$"</nowiki>|#FFB100}}) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
                    {{Cl|ELSE}}
                        {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}} {{Text|<nowiki>'Implicitly defined variables cannot conflict with sub/func names</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'len(musthave$)=0</nowiki>|#919191}}
                {{Cl|IF}} {{Cl|INSTR}}(musthave$, {{Text|<nowiki>"$"</nowiki>|#FFB100}}) {{Cl|THEN}}
                    {{Cl|IF}} {{Cl|RTRIM$}}(ids(hashresref).musthave) = {{Text|<nowiki>"$"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}} {{Text|<nowiki>'A sub/function name already exists as a string</nowiki>|#919191}}
                    {{Text|<nowiki>'(allow)</nowiki>|#919191}}
                {{Cl|ELSE}}
                    {{Cl|IF}} {{Cl|RTRIM$}}(ids(hashresref).musthave) <> {{Text|<nowiki>"$"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}} {{Text|<nowiki>'A non-"$" sub/func name already exists with this name</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'HASHFLAG_FUNCTION + HASHFLAG_SUB</nowiki>|#919191}}
            {{Text|<nowiki>'conflict with array?</nowiki>|#919191}}
            {{Cl|IF}} hashresflags {{Cl|AND (boolean)|AND}} HASHFLAG_ARRAY {{Cl|THEN}}
                astype1 = {{Text|0|#F580B1}}: {{Cl|IF}} {{Cl|ASC (function)|ASC}}(ids(hashresref).musthave) = {{Text|32|#F580B1}} {{Cl|THEN}} astype1 = {{Text|1|#F580B1}}
                scope1 = ids(hashresref).insubfuncn
                {{Cl|IF}} astype1 = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} astype2 = {{Text|1|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} scope1 = scope2 {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'same type?</nowiki>|#919191}}
                {{Cl|IF}} id.arraytype = ids(hashresref).arraytype {{Cl|THEN}}
                    {{Cl|IF}} id.tsize = ids(hashresref).tsize {{Cl|THEN}}
                        {{Cl|IF}} scope1 = scope2 {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'will astype'd fixed STRING-variable mask a non-fixed string?</nowiki>|#919191}}
                {{Cl|IF}} id.arraytype {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH {{Cl|THEN}}
                    {{Cl|IF}} astype2 = {{Text|1|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} ids(hashresref).arraytype {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                            {{Cl|IF}} (ids(hashresref).arraytype {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Cl|THEN}}
                                {{Cl|IF}} scope1 = scope2 {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Name already in use ("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            arrayname_exception:
            {{Cl|IF}} hashres <> {{Text|1|#F580B1}} {{Cl|THEN}} hashres = {{Text|HashFindCont|#55FF55}}(hashresflags, hashresref) {{Cl|ELSE}} hashres = {{Text|0|#F580B1}}
        {{Cl|LOOP}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'array</nowiki>|#919191}}
    {{Text|<nowiki>'add it to the hash table</nowiki>|#919191}}
    {{Text|HashAdd|#55FF55}} n$, hashflags, currentid
{{Cl|END}} {{Cl|SUB}}
{{Cl|SUB}} {{Text|reginternal|#55FF55}}
    reginternalsubfunc = {{Text|1|#F580B1}}
    {{Text|<nowiki>'</nowiki>|#919191}}{{Cm|$INCLUDE}}:{{Text|<nowiki>'subs_functions\subs_functions.bas'</nowiki>|#919191}}
    reginternalsubfunc = {{Text|0|#F580B1}}
{{Cl|END}} {{Cl|SUB}}
{{Cl|SUB}} {{Text|regUnstableHttp|#55FF55}}
    reginternalsubfunc = {{Text|1|#F580B1}}
    {{Text|clearid|#55FF55}}
    id.n = qb64prefix$ + {{Text|<nowiki>"StatusCode"</nowiki>|#FFB100}} {{Text|<nowiki>' Name in CaMeL case</nowiki>|#919191}}
    id.subfunc = {{Text|1|#F580B1}} {{Text|<nowiki>' 1 = function, 2 = sub</nowiki>|#919191}}
    id.callname = {{Text|<nowiki>"func__statusCode"</nowiki>|#FFB100}} {{Text|<nowiki>' C/C++ function name</nowiki>|#919191}}
    id.args = {{Text|1|#F580B1}}
    id.arg = {{Cl|MKL$}}(LONGTYPE - ISPOINTER)
    id.ret = LONGTYPE - ISPOINTER
    id.hr_syntax = {{Text|<nowiki>"_STATUSCODE(httpHandle&)"</nowiki>|#FFB100}} {{Text|<nowiki>' syntax help</nowiki>|#919191}}
    {{Text|regid|#55FF55}}
    {{Text|<nowiki>' If we're doing $NOPREFIX then we register it again with the underscore</nowiki>|#919191}}
    {{Cl|IF}} qb64prefix_set {{Cl|THEN}}
        id.n = {{Text|<nowiki>"_StatusCode"</nowiki>|#FFB100}}
        {{Text|regid|#55FF55}}
    {{Cl|END}} {{Cl|IF}}
    reginternalsubfunc = {{Text|0|#F580B1}}
{{Cl|END}} {{Cl|SUB}}
{{Cl|FUNCTION}} {{Text|symboltype|#55FF55}} (s$) {{Text|<nowiki>'returns type or 0(not a valid symbol)</nowiki>|#919191}}
    {{Text|<nowiki>'note: sets symboltype_size for fixed length strings</nowiki>|#919191}}
    {{Text|<nowiki>'created: 2011 (fast & comprehensive)</nowiki>|#919191}}
    {{Cl|IF}} {{Cl|LEN}}(s$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Text|<nowiki>'treat common cases first</nowiki>|#919191}}
    a = {{Cl|ASC (function)|ASC}}(s$)
    l = {{Cl|LEN}}(s$)
    {{Cl|IF}} a = {{Text|37|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'%</nowiki>|#919191}}
        {{Cl|IF}} l = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|symboltype|#55FF55}} = {{Text|16|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} l > {{Text|2|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} {{Cl|ASC (function)|ASC}}(s$, {{Text|2|#F580B1}}) = {{Text|37|#F580B1}} {{Cl|THEN}} {{Text|symboltype|#55FF55}} = {{Text|8|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} {{Cl|ASC (function)|ASC}}(s$, {{Text|2|#F580B1}}) = {{Text|38|#F580B1}} {{Cl|THEN}} {{Text|symboltype|#55FF55}} = OFFSETTYPE - ISPOINTER: {{Cl|EXIT}} {{Cl|FUNCTION}} {{Text|<nowiki>'%&</nowiki>|#919191}}
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} a = {{Text|38|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'&</nowiki>|#919191}}
        {{Cl|IF}} l = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|symboltype|#55FF55}} = {{Text|32|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} l > {{Text|2|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} {{Cl|ASC (function)|ASC}}(s$, {{Text|2|#F580B1}}) = {{Text|38|#F580B1}} {{Cl|THEN}} {{Text|symboltype|#55FF55}} = {{Text|64|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} a = {{Text|33|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'!</nowiki>|#919191}}
        {{Cl|IF}} l = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|symboltype|#55FF55}} = {{Text|32|#F580B1}} + ISFLOAT: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} a = {{Text|35|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'#</nowiki>|#919191}}
        {{Cl|IF}} l = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|symboltype|#55FF55}} = {{Text|64|#F580B1}} + ISFLOAT: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} l > {{Text|2|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} {{Cl|ASC (function)|ASC}}(s$, {{Text|2|#F580B1}}) = {{Text|35|#F580B1}} {{Cl|THEN}} {{Text|symboltype|#55FF55}} = {{Text|64|#F580B1}} + ISFLOAT: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} a = {{Text|36|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'$</nowiki>|#919191}}
        {{Cl|IF}} l = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|symboltype|#55FF55}} = ISSTRING: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} {{Text|isuinteger|#55FF55}}({{Cl|RIGHT$}}(s$, l - {{Text|1|#F580B1}})) {{Cl|THEN}}
            {{Cl|IF}} l >= ({{Text|1|#F580B1}} + {{Text|10|#F580B1}}) {{Cl|THEN}}
                {{Cl|IF}} l > ({{Text|1|#F580B1}} + {{Text|10|#F580B1}}) {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|IF}} s$ > {{Text|<nowiki>"$2147483647"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|END}} {{Cl|IF}}
            symboltype_size = {{Cl|VAL}}({{Cl|RIGHT$}}(s$, l - {{Text|1|#F580B1}}))
            {{Text|symboltype|#55FF55}} = ISSTRING + ISFIXEDLENGTH
            {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} a = {{Text|96|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'`</nowiki>|#919191}}
        {{Cl|IF}} l = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|symboltype|#55FF55}} = {{Text|1|#F580B1}} + ISOFFSETINBITS: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} {{Text|isuinteger|#55FF55}}({{Cl|RIGHT$}}(s$, l - {{Text|1|#F580B1}})) {{Cl|THEN}}
            {{Cl|IF}} l > {{Text|3|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            n = {{Cl|VAL}}({{Cl|RIGHT$}}(s$, l - {{Text|1|#F580B1}}))
            {{Cl|IF}} n > {{Text|64|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Text|symboltype|#55FF55}} = n + ISOFFSETINBITS: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} a = {{Text|126|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'~</nowiki>|#919191}}
        {{Cl|IF}} l = {{Text|1|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        a = {{Cl|ASC (function)|ASC}}(s$, {{Text|2|#F580B1}})
        {{Cl|IF}} a = {{Text|37|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'%</nowiki>|#919191}}
            {{Cl|IF}} l = {{Text|2|#F580B1}} {{Cl|THEN}} {{Text|symboltype|#55FF55}} = {{Text|16|#F580B1}} + ISUNSIGNED: {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|IF}} l > {{Text|3|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|IF}} {{Cl|ASC (function)|ASC}}(s$, {{Text|3|#F580B1}}) = {{Text|37|#F580B1}} {{Cl|THEN}} {{Text|symboltype|#55FF55}} = {{Text|8|#F580B1}} + ISUNSIGNED: {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|IF}} {{Cl|ASC (function)|ASC}}(s$, {{Text|3|#F580B1}}) = {{Text|38|#F580B1}} {{Cl|THEN}} {{Text|symboltype|#55FF55}} = UOFFSETTYPE - ISPOINTER: {{Cl|EXIT}} {{Cl|FUNCTION}} {{Text|<nowiki>'~%&</nowiki>|#919191}}
            {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} a = {{Text|38|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'&</nowiki>|#919191}}
            {{Cl|IF}} l = {{Text|2|#F580B1}} {{Cl|THEN}} {{Text|symboltype|#55FF55}} = {{Text|32|#F580B1}} + ISUNSIGNED: {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|IF}} l > {{Text|3|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|IF}} {{Cl|ASC (function)|ASC}}(s$, {{Text|3|#F580B1}}) = {{Text|38|#F580B1}} {{Cl|THEN}} {{Text|symboltype|#55FF55}} = {{Text|64|#F580B1}} + ISUNSIGNED: {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} a = {{Text|96|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'`</nowiki>|#919191}}
            {{Cl|IF}} l = {{Text|2|#F580B1}} {{Cl|THEN}} {{Text|symboltype|#55FF55}} = {{Text|1|#F580B1}} + ISOFFSETINBITS + ISUNSIGNED: {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|IF}} {{Text|isuinteger|#55FF55}}({{Cl|RIGHT$}}(s$, l - {{Text|2|#F580B1}})) {{Cl|THEN}}
                {{Cl|IF}} l > {{Text|4|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                n = {{Cl|VAL}}({{Cl|RIGHT$}}(s$, l - {{Text|2|#F580B1}}))
                {{Cl|IF}} n > {{Text|64|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Text|symboltype|#55FF55}} = n + ISOFFSETINBITS + ISUNSIGNED: {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'~</nowiki>|#919191}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|removesymbol$|#55FF55}} (varname$)
    i = {{Cl|INSTR}}(varname$, {{Text|<nowiki>"~"</nowiki>|#FFB100}}): {{Cl|IF}} i {{Cl|THEN}} {{Cl|GOTO}} foundsymbol
    i = {{Cl|INSTR}}(varname$, {{Text|<nowiki>"`"</nowiki>|#FFB100}}): {{Cl|IF}} i {{Cl|THEN}} {{Cl|GOTO}} foundsymbol
    i = {{Cl|INSTR}}(varname$, {{Text|<nowiki>"%"</nowiki>|#FFB100}}): {{Cl|IF}} i {{Cl|THEN}} {{Cl|GOTO}} foundsymbol
    i = {{Cl|INSTR}}(varname$, {{Text|<nowiki>"&"</nowiki>|#FFB100}}): {{Cl|IF}} i {{Cl|THEN}} {{Cl|GOTO}} foundsymbol
    i = {{Cl|INSTR}}(varname$, {{Text|<nowiki>"!"</nowiki>|#FFB100}}): {{Cl|IF}} i {{Cl|THEN}} {{Cl|GOTO}} foundsymbol
    i = {{Cl|INSTR}}(varname$, {{Text|<nowiki>"#"</nowiki>|#FFB100}}): {{Cl|IF}} i {{Cl|THEN}} {{Cl|GOTO}} foundsymbol
    i = {{Cl|INSTR}}(varname$, {{Text|<nowiki>"$"</nowiki>|#FFB100}}): {{Cl|IF}} i {{Cl|THEN}} {{Cl|GOTO}} foundsymbol
    {{Cl|EXIT}} {{Cl|FUNCTION}}
    foundsymbol:
    {{Cl|IF}} i = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected variable name before symbol"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    symbol$ = {{Cl|RIGHT$}}(varname$, {{Cl|LEN}}(varname$) - i + {{Text|1|#F580B1}})
    {{Cl|IF}} {{Text|symboltype|#55FF55}}(symbol$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid symbol"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Text|removesymbol$|#55FF55}} = symbol$
    varname$ = {{Cl|LEFT$}}(varname$, i - {{Text|1|#F580B1}})
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|scope$|#55FF55}}
    {{Cl|IF}} id.share {{Cl|THEN}} {{Text|scope$|#55FF55}} = module$ + {{Text|<nowiki>"__"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Text|scope$|#55FF55}} = module$ + {{Text|<nowiki>"_"</nowiki>|#FFB100}} + subfunc$ + {{Text|<nowiki>"_"</nowiki>|#FFB100}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|seperateargs|#55FF55}} (a$, ca$, pass&)
    pass& = {{Text|0|#F580B1}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} OptMax: separgs(i) = {{Text|<nowiki>""</nowiki>|#FFB100}}: {{Cl|NEXT}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} OptMax + {{Text|1|#F580B1}}: separgslayout(i) = {{Text|<nowiki>""</nowiki>|#FFB100}}: {{Cl|NEXT}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} OptMax
        Lev(i) = {{Text|0|#F580B1}}
        EntryLev(i) = {{Text|0|#F580B1}}
        DitchLev(i) = {{Text|0|#F580B1}}
        DontPass(i) = {{Text|0|#F580B1}}
        TempList(i) = {{Text|0|#F580B1}}
        PassRule(i) = {{Text|0|#F580B1}}
        LevelEntered(i) = {{Text|0|#F580B1}}
    {{Cl|NEXT}}
    {{Cl|DIM}} id2 {{Cl|AS}} idstruct
    id2 = id
    {{Cl|IF}} id2.args = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}} {{Text|<nowiki>'no arguments!</nowiki>|#919191}}
    s$ = id2.specialformat
    s$ = {{Cl|RTRIM$}}(s$)
    {{Text|<nowiki>'build a special format if none exists</nowiki>|#919191}}
    {{Cl|IF}} s$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
        {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} id2.args
            {{Cl|IF}} i <> {{Text|1|#F580B1}} {{Cl|THEN}} s$ = s$ + {{Text|<nowiki>",?"</nowiki>|#FFB100}} {{Cl|ELSE}} s$ = {{Text|<nowiki>"?"</nowiki>|#FFB100}}
        {{Cl|NEXT}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'note: dim'd arrays moved to global to prevent high recreation cost</nowiki>|#919191}}
    PassFlag = {{Text|1|#F580B1}}
    nextentrylevel = {{Text|0|#F580B1}}
    nextentrylevelset = {{Text|1|#F580B1}}
    level = {{Text|0|#F580B1}}
    lastt = {{Text|0|#F580B1}}
    ditchlevel = {{Text|0|#F580B1}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(s$)
        s2$ = {{Cl|MID$ (function)|MID$}}(s$, i, {{Text|1|#F580B1}})
        {{Cl|IF}} s2$ = {{Text|<nowiki>"["</nowiki>|#FFB100}} {{Cl|THEN}}
            level = level + {{Text|1|#F580B1}}
            LevelEntered(level) = {{Text|0|#F580B1}}
            {{Cl|GOTO}} nextsymbol
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} s2$ = {{Text|<nowiki>"]"</nowiki>|#FFB100}} {{Cl|THEN}}
            level = level - {{Text|1|#F580B1}}
            {{Cl|IF}} level < ditchlevel {{Cl|THEN}} ditchlevel = level
            {{Cl|GOTO}} nextsymbol
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} s2$ = {{Text|<nowiki>"{"</nowiki>|#FFB100}} {{Cl|THEN}}
            lastt = lastt + {{Text|1|#F580B1}}: Lev(lastt) = level: PassRule(lastt) = {{Text|0|#F580B1}}
            DitchLev(lastt) = ditchlevel: ditchlevel = level {{Text|<nowiki>'store & reset ditch level</nowiki>|#919191}}
            i = i + {{Text|1|#F580B1}}
            i2 = {{Cl|INSTR}}(i, s$, {{Text|<nowiki>"}"</nowiki>|#FFB100}})
            numopts = {{Text|0|#F580B1}}
            nextopt:
            numopts = numopts + {{Text|1|#F580B1}}
            i3 = {{Cl|INSTR}}(i + {{Text|1|#F580B1}}, s$, {{Text|<nowiki>"|"</nowiki>|#FFB100}})
            {{Cl|IF}} i3 <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} i3 < i2 {{Cl|THEN}}
                Opt(lastt, numopts) = {{Cl|MID$ (function)|MID$}}(s$, i, i3 - i)
                i = i3 + {{Text|1|#F580B1}}: {{Cl|GOTO}} nextopt
            {{Cl|END}} {{Cl|IF}}
            Opt(lastt, numopts) = {{Cl|MID$ (function)|MID$}}(s$, i, i2 - i)
            T(lastt) = numopts
            {{Text|<nowiki>'calculate words in each option</nowiki>|#919191}}
            {{Cl|FOR}} x = {{Text|1|#F580B1}} {{Cl|TO}} T(lastt)
                w = {{Text|1|#F580B1}}
                x2 = {{Text|1|#F580B1}}
                newword:
                {{Cl|IF}} {{Cl|INSTR}}(x2, {{Cl|RTRIM$}}(Opt(lastt, x)), {{Text|<nowiki>" "</nowiki>|#FFB100}}) {{Cl|THEN}} w = w + {{Text|1|#F580B1}}: x2 = {{Cl|INSTR}}(x2, {{Cl|RTRIM$}}(Opt(lastt, x)), {{Text|<nowiki>" "</nowiki>|#FFB100}}) + {{Text|1|#F580B1}}: {{Cl|GOTO}} newword
                OptWords(lastt, x) = w
            {{Cl|NEXT}}
            i = i2
            {{Text|<nowiki>'set entry level routine</nowiki>|#919191}}
            EntryLev(lastt) = level {{Text|<nowiki>'default level when continuing a previously entered level</nowiki>|#919191}}
            {{Cl|IF}} LevelEntered(level) = {{Text|0|#F580B1}} {{Cl|THEN}}
                EntryLev(lastt) = {{Text|0|#F580B1}}
                {{Cl|FOR}} i2 = {{Text|1|#F580B1}} {{Cl|TO}} level - {{Text|1|#F580B1}}
                    {{Cl|IF}} LevelEntered(i2) = {{Text|1|#F580B1}} {{Cl|THEN}} EntryLev(lastt) = i2
                {{Cl|NEXT}}
            {{Cl|END}} {{Cl|IF}}
            LevelEntered(level) = {{Text|1|#F580B1}}
            {{Cl|GOTO}} nextsymbol
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} s2$ = {{Text|<nowiki>"?"</nowiki>|#FFB100}} {{Cl|THEN}}
            lastt = lastt + {{Text|1|#F580B1}}: Lev(lastt) = level: PassRule(lastt) = {{Text|0|#F580B1}}
            DitchLev(lastt) = ditchlevel: ditchlevel = level {{Text|<nowiki>'store & reset ditch level</nowiki>|#919191}}
            T(lastt) = {{Text|0|#F580B1}}
            {{Text|<nowiki>'set entry level routine</nowiki>|#919191}}
            EntryLev(lastt) = level {{Text|<nowiki>'default level when continuing a previously entered level</nowiki>|#919191}}
            {{Cl|IF}} LevelEntered(level) = {{Text|0|#F580B1}} {{Cl|THEN}}
                EntryLev(lastt) = {{Text|0|#F580B1}}
                {{Cl|FOR}} i2 = {{Text|1|#F580B1}} {{Cl|TO}} level - {{Text|1|#F580B1}}
                    {{Cl|IF}} LevelEntered(i2) = {{Text|1|#F580B1}} {{Cl|THEN}} EntryLev(lastt) = i2
                {{Cl|NEXT}}
            {{Cl|END}} {{Cl|IF}}
            LevelEntered(level) = {{Text|1|#F580B1}}
            {{Cl|GOTO}} nextsymbol
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'assume "special" character (like ( ) , . - etc.)</nowiki>|#919191}}
        lastt = lastt + {{Text|1|#F580B1}}: Lev(lastt) = level: PassRule(lastt) = {{Text|0|#F580B1}}
        DitchLev(lastt) = ditchlevel: ditchlevel = level {{Text|<nowiki>'store & reset ditch level</nowiki>|#919191}}
        T(lastt) = {{Text|1|#F580B1}}: Opt(lastt, {{Text|1|#F580B1}}) = s2$: OptWords(lastt, {{Text|1|#F580B1}}) = {{Text|1|#F580B1}}: DontPass(lastt) = {{Text|1|#F580B1}}
        {{Text|<nowiki>'set entry level routine</nowiki>|#919191}}
        EntryLev(lastt) = level {{Text|<nowiki>'default level when continuing a previously entered level</nowiki>|#919191}}
        {{Cl|IF}} LevelEntered(level) = {{Text|0|#F580B1}} {{Cl|THEN}}
            EntryLev(lastt) = {{Text|0|#F580B1}}
            {{Cl|FOR}} i2 = {{Text|1|#F580B1}} {{Cl|TO}} level - {{Text|1|#F580B1}}
                {{Cl|IF}} LevelEntered(i2) = {{Text|1|#F580B1}} {{Cl|THEN}} EntryLev(lastt) = i2
            {{Cl|NEXT}}
        {{Cl|END}} {{Cl|IF}}
        LevelEntered(level) = {{Text|1|#F580B1}}
        {{Cl|GOTO}} nextsymbol
        nextsymbol:
    {{Cl|NEXT}}
    {{Cl|IF}} Debug {{Cl|THEN}}
        {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"--------SEPERATE ARGUMENTS REPORT #1:1--------"</nowiki>|#FFB100}}
        {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} lastt
            {{Cl|PRINT (file statement)|PRINT}} #9, i, {{Text|<nowiki>"OPT="</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Cl|RTRIM$}}(Opt(i, {{Text|1|#F580B1}})) + {{Cl|CHR$}}({{Text|34|#F580B1}})
            {{Cl|PRINT (file statement)|PRINT}} #9, i, {{Text|<nowiki>"OPTWORDS="</nowiki>|#FFB100}}; OptWords(i, {{Text|1|#F580B1}})
            {{Cl|PRINT (file statement)|PRINT}} #9, i, {{Text|<nowiki>"T="</nowiki>|#FFB100}}; T(i)
            {{Cl|PRINT (file statement)|PRINT}} #9, i, {{Text|<nowiki>"DONTPASS="</nowiki>|#FFB100}}; DontPass(i)
            {{Cl|PRINT (file statement)|PRINT}} #9, i, {{Text|<nowiki>"PASSRULE="</nowiki>|#FFB100}}; PassRule(i)
            {{Cl|PRINT (file statement)|PRINT}} #9, i, {{Text|<nowiki>"LEV="</nowiki>|#FFB100}}; Lev(i)
            {{Cl|PRINT (file statement)|PRINT}} #9, i, {{Text|<nowiki>"ENTRYLEV="</nowiki>|#FFB100}}; EntryLev(i)
        {{Cl|NEXT}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'Any symbols already have dontpass() set to 1</nowiki>|#919191}}
    {{Text|<nowiki>'This sets any {}blocks with only one option/word (eg. {PRINT}) at the lowest level to dontpass()=1</nowiki>|#919191}}
    {{Text|<nowiki>'because their content is manadatory and there is no choice as to which word to use</nowiki>|#919191}}
    {{Cl|FOR}} x = {{Text|1|#F580B1}} {{Cl|TO}} lastt
        {{Cl|IF}} Lev(x) = {{Text|0|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} T(x) = {{Text|1|#F580B1}} {{Cl|THEN}} DontPass(x) = {{Text|1|#F580B1}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|NEXT}}
    {{Cl|IF}} Debug {{Cl|THEN}}
        {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"--------SEPERATE ARGUMENTS REPORT #1:2--------"</nowiki>|#FFB100}}
        {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} lastt
            {{Cl|PRINT (file statement)|PRINT}} #9, i, {{Text|<nowiki>"OPT="</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Cl|RTRIM$}}(Opt(i, {{Text|1|#F580B1}})) + {{Cl|CHR$}}({{Text|34|#F580B1}})
            {{Cl|PRINT (file statement)|PRINT}} #9, i, {{Text|<nowiki>"OPTWORDS="</nowiki>|#FFB100}}; OptWords(i, {{Text|1|#F580B1}})
            {{Cl|PRINT (file statement)|PRINT}} #9, i, {{Text|<nowiki>"T="</nowiki>|#FFB100}}; T(i)
            {{Cl|PRINT (file statement)|PRINT}} #9, i, {{Text|<nowiki>"DONTPASS="</nowiki>|#FFB100}}; DontPass(i)
            {{Cl|PRINT (file statement)|PRINT}} #9, i, {{Text|<nowiki>"PASSRULE="</nowiki>|#FFB100}}; PassRule(i)
            {{Cl|PRINT (file statement)|PRINT}} #9, i, {{Text|<nowiki>"LEV="</nowiki>|#FFB100}}; Lev(i)
            {{Cl|PRINT (file statement)|PRINT}} #9, i, {{Text|<nowiki>"ENTRYLEV="</nowiki>|#FFB100}}; EntryLev(i)
        {{Cl|NEXT}}
    {{Cl|END}} {{Cl|IF}}
    x1 = {{Text|0|#F580B1}} {{Text|<nowiki>'the 'x' position of the beginning element of the current levelled block</nowiki>|#919191}}
    MustPassOpt = {{Text|0|#F580B1}} {{Text|<nowiki>'the 'x' position of the FIRST opt () in the block which must be passed</nowiki>|#919191}}
    MustPassOptNeedsFlag = {{Text|0|#F580B1}} {{Text|<nowiki>'{}blocks don't need a flag, ? blocks do</nowiki>|#919191}}
    {{Text|<nowiki>'Note: For something like [{HELLO}x] a choice between passing 'hello' or passing a flag to signify x was specified</nowiki>|#919191}}
    {{Text|<nowiki>'      has to be made, in such cases, a flag is preferable to wasting a full new int32 on 'hello'</nowiki>|#919191}}
    templistn = {{Text|0|#F580B1}}
    {{Cl|FOR}} l = {{Text|1|#F580B1}} {{Cl|TO}} {{Text|32767|#F580B1}}
        scannextlevel = {{Text|0|#F580B1}}
        {{Cl|FOR}} x = {{Text|1|#F580B1}} {{Cl|TO}} lastt
            {{Cl|IF}} Lev(x) > l {{Cl|THEN}} scannextlevel = {{Text|1|#F580B1}}
            {{Cl|IF}} x1 {{Cl|THEN}}
                {{Cl|IF}} EntryLev(x) < l {{Cl|THEN}} {{Text|<nowiki>'end of block reached</nowiki>|#919191}}
                    {{Cl|IF}} MustPassOpt {{Cl|THEN}}
                        {{Text|<nowiki>'If there's an opt () which must be passed that will be identified,</nowiki>|#919191}}
                        {{Text|<nowiki>'all the 1 option {}blocks can be assumed...</nowiki>|#919191}}
                        {{Cl|IF}} MustPassOptNeedsFlag {{Cl|THEN}}
                            {{Text|<nowiki>'The MustPassOpt requires a flag, so use the same flag for everything</nowiki>|#919191}}
                            {{Cl|FOR}} x2 = {{Text|1|#F580B1}} {{Cl|TO}} templistn
                                PassRule(TempList(x2)) = PassFlag
                            {{Cl|NEXT}}
                            PassFlag = PassFlag * {{Text|2|#F580B1}}
                        {{Cl|ELSE}}
                            {{Text|<nowiki>'The MustPassOpt is a {}block which doesn't need a flag, so everything else needs to</nowiki>|#919191}}
                            {{Text|<nowiki>'reference it</nowiki>|#919191}}
                            {{Cl|FOR}} x2 = {{Text|1|#F580B1}} {{Cl|TO}} templistn
                                {{Cl|IF}} TempList(x2) <> MustPassOpt {{Cl|THEN}} PassRule(TempList(x2)) = -MustPassOpt
                            {{Cl|NEXT}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|ELSE}}
                        {{Text|<nowiki>'if not, use a unique flag for everything in this block</nowiki>|#919191}}
                        {{Cl|FOR}} x2 = {{Text|1|#F580B1}} {{Cl|TO}} templistn: PassRule(TempList(x2)) = PassFlag: {{Cl|NEXT}}
                        {{Cl|IF}} templistn <> {{Text|0|#F580B1}} {{Cl|THEN}} PassFlag = PassFlag * {{Text|2|#F580B1}}
                    {{Cl|END}} {{Cl|IF}}
                    x1 = {{Text|0|#F580B1}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} Lev(x) = l {{Cl|THEN}} {{Text|<nowiki>'on same level</nowiki>|#919191}}
                {{Cl|IF}} EntryLev(x) < l {{Cl|THEN}} {{Text|<nowiki>'just (re)entered this level (not continuing along it)</nowiki>|#919191}}
                    x1 = x {{Text|<nowiki>'set x1 to the starting element of this level</nowiki>|#919191}}
                    MustPassOpt = {{Text|0|#F580B1}}
                    templistn = {{Text|0|#F580B1}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} x1 {{Cl|THEN}}
                {{Cl|IF}} Lev(x) = l {{Cl|THEN}} {{Text|<nowiki>'same level</nowiki>|#919191}}
                    {{Cl|IF}} T(x) <> {{Text|1|#F580B1}} {{Cl|THEN}}
                        {{Text|<nowiki>'It isn't a symbol or a {}block with only one option therefore this opt () must be passed</nowiki>|#919191}}
                        {{Cl|IF}} MustPassOpt = {{Text|0|#F580B1}} {{Cl|THEN}}
                            MustPassOpt = x {{Text|<nowiki>'Only record the first instance (it MAY require a flag)</nowiki>|#919191}}
                            {{Cl|IF}} T(x) = {{Text|0|#F580B1}} {{Cl|THEN}} MustPassOptNeedsFlag = {{Text|1|#F580B1}} {{Cl|ELSE}} MustPassOptNeedsFlag = {{Text|0|#F580B1}}
                        {{Cl|ELSE}}
                            {{Text|<nowiki>'Update current MustPassOpt to non-flag-based {}block if possible (to save flag usage)</nowiki>|#919191}}
                            {{Text|<nowiki>'(Consider [{A|B}?], where a flag is not required)</nowiki>|#919191}}
                            {{Cl|IF}} MustPassOptNeedsFlag = {{Text|1|#F580B1}} {{Cl|THEN}}
                                {{Cl|IF}} T(x) > {{Text|1|#F580B1}} {{Cl|THEN}}
                                    MustPassOpt = x: MustPassOptNeedsFlag = {{Text|0|#F580B1}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Text|<nowiki>'add to list</nowiki>|#919191}}
                        templistn = templistn + {{Text|1|#F580B1}}: TempList(templistn) = x
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} T(x) = {{Text|1|#F580B1}} {{Cl|THEN}}
                        {{Text|<nowiki>'It is a symbol or a {}block with only one option</nowiki>|#919191}}
                        {{Text|<nowiki>'a {}block with only one option MAY not need to be passed</nowiki>|#919191}}
                        {{Text|<nowiki>'depending on if anything else is in this block could make the existance of this opt () assumed</nowiki>|#919191}}
                        {{Text|<nowiki>'Note: Symbols which are not encapsulated inside a {}block never need to be passed</nowiki>|#919191}}
                        {{Text|<nowiki>'      Symbols already have dontpass() set to 1</nowiki>|#919191}}
                        {{Cl|IF}} DontPass(x) = {{Text|0|#F580B1}} {{Cl|THEN}} templistn = templistn + {{Text|1|#F580B1}}: TempList(templistn) = x: DontPass(x) = {{Text|1|#F580B1}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|NEXT}}
        {{Text|<nowiki>'scan last run (mostly just a copy of code from above)</nowiki>|#919191}}
        {{Cl|IF}} x1 {{Cl|THEN}}
            {{Cl|IF}} MustPassOpt {{Cl|THEN}}
                {{Text|<nowiki>'If there's an opt () which must be passed that will be identified,</nowiki>|#919191}}
                {{Text|<nowiki>'all the 1 option {}blocks can be assumed...</nowiki>|#919191}}
                {{Cl|IF}} MustPassOptNeedsFlag {{Cl|THEN}}
                    {{Text|<nowiki>'The MustPassOpt requires a flag, so use the same flag for everything</nowiki>|#919191}}
                    {{Cl|FOR}} x2 = {{Text|1|#F580B1}} {{Cl|TO}} templistn
                        PassRule(TempList(x2)) = PassFlag
                    {{Cl|NEXT}}
                    PassFlag = PassFlag * {{Text|2|#F580B1}}
                {{Cl|ELSE}}
                    {{Text|<nowiki>'The MustPassOpt is a {}block which doesn't need a flag, so everything else needs to</nowiki>|#919191}}
                    {{Text|<nowiki>'reference it</nowiki>|#919191}}
                    {{Cl|FOR}} x2 = {{Text|1|#F580B1}} {{Cl|TO}} templistn
                        {{Cl|IF}} TempList(x2) <> MustPassOpt {{Cl|THEN}} PassRule(TempList(x2)) = -MustPassOpt
                    {{Cl|NEXT}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|ELSE}}
                {{Text|<nowiki>'if not, use a unique flag for everything in this block</nowiki>|#919191}}
                {{Cl|FOR}} x2 = {{Text|1|#F580B1}} {{Cl|TO}} templistn: PassRule(TempList(x2)) = PassFlag: {{Cl|NEXT}}
                {{Cl|IF}} templistn <> {{Text|0|#F580B1}} {{Cl|THEN}} PassFlag = PassFlag * {{Text|2|#F580B1}}
            {{Cl|END}} {{Cl|IF}}
            x1 = {{Text|0|#F580B1}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} scannextlevel = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}}
    {{Cl|NEXT}}
    {{Cl|IF}} Debug {{Cl|THEN}}
        {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"--------SEPERATE ARGUMENTS REPORT #1:3--------"</nowiki>|#FFB100}}
        {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} lastt
            {{Cl|PRINT (file statement)|PRINT}} #9, i, {{Text|<nowiki>"OPT="</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Cl|RTRIM$}}(Opt(i, {{Text|1|#F580B1}})) + {{Cl|CHR$}}({{Text|34|#F580B1}})
            {{Cl|PRINT (file statement)|PRINT}} #9, i, {{Text|<nowiki>"OPTWORDS="</nowiki>|#FFB100}}; OptWords(i, {{Text|1|#F580B1}})
            {{Cl|PRINT (file statement)|PRINT}} #9, i, {{Text|<nowiki>"T="</nowiki>|#FFB100}}; T(i)
            {{Cl|PRINT (file statement)|PRINT}} #9, i, {{Text|<nowiki>"DONTPASS="</nowiki>|#FFB100}}; DontPass(i)
            {{Cl|PRINT (file statement)|PRINT}} #9, i, {{Text|<nowiki>"PASSRULE="</nowiki>|#FFB100}}; PassRule(i)
            {{Cl|PRINT (file statement)|PRINT}} #9, i, {{Text|<nowiki>"LEV="</nowiki>|#FFB100}}; Lev(i)
            {{Cl|PRINT (file statement)|PRINT}} #9, i, {{Text|<nowiki>"ENTRYLEV="</nowiki>|#FFB100}}; EntryLev(i)
        {{Cl|NEXT}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} lastt: separgs(i) = {{Text|<nowiki>"n-ll"</nowiki>|#FFB100}}: {{Cl|NEXT}}
    {{Text|<nowiki>'Consider: "?,[?]"</nowiki>|#919191}}
    {{Text|<nowiki>'Notes: The comma is mandatory but the second ? is entirely optional</nowiki>|#919191}}
    {{Text|<nowiki>'Consider: "[?[{B}?]{A}]?"</nowiki>|#919191}}
    {{Text|<nowiki>'Notes: As unlikely as the above is, it is still valid, but pivots on the outcome of {A} being present</nowiki>|#919191}}
    {{Text|<nowiki>'Consider: "[?]{A}"</nowiki>|#919191}}
    {{Text|<nowiki>'Consider: "[?{A}][?{B}][?{C}]?"</nowiki>|#919191}}
    {{Text|<nowiki>'Notes: The trick here is to realize {A} has greater priority than {B}, so all lines of enquiry must</nowiki>|#919191}}
    {{Text|<nowiki>'      be exhausted before considering {B}</nowiki>|#919191}}
    {{Text|<nowiki>'Use inquiry approach to solve format</nowiki>|#919191}}
    {{Text|<nowiki>'Each line of inquiry must be exhausted</nowiki>|#919191}}
    {{Text|<nowiki>'An expression ("?") simply means a branch where you can scan ahead</nowiki>|#919191}}
    Branches = {{Text|0|#F580B1}}
    {{Cl|DIM}} BranchFormatPos({{Text|1|#F580B1}} {{Cl|TO}} {{Text|100|#F580B1}}) {{Cl|AS}} {{Cl|LONG}}
    {{Cl|DIM}} BranchTaken({{Text|1|#F580B1}} {{Cl|TO}} {{Text|100|#F580B1}}) {{Cl|AS}} {{Cl|LONG}}
    {{Text|<nowiki>'1=taken (this usually involves moving up a level)</nowiki>|#919191}}
    {{Text|<nowiki>'0=not taken</nowiki>|#919191}}
    {{Cl|DIM}} BranchInputPos({{Text|1|#F580B1}} {{Cl|TO}} {{Text|100|#F580B1}}) {{Cl|AS}} {{Cl|LONG}}
    {{Cl|DIM}} BranchWithExpression({{Text|1|#F580B1}} {{Cl|TO}} {{Text|100|#F580B1}}) {{Cl|AS}} {{Cl|LONG}}
    {{Text|<nowiki>'non-zero=expression expected before next item for format item value represents</nowiki>|#919191}}
    {{Text|<nowiki>'0=no expression allowed before next item</nowiki>|#919191}}
    {{Cl|DIM}} BranchLevel({{Text|1|#F580B1}} {{Cl|TO}} {{Text|100|#F580B1}}) {{Cl|AS}} {{Cl|LONG}} {{Text|<nowiki>'Level before this branch was/wasn't taken</nowiki>|#919191}}
    n = {{Text|numelements|#55FF55}}(ca$)
    i = {{Text|1|#F580B1}} {{Text|<nowiki>'Position within ca$</nowiki>|#919191}}
    level = {{Text|0|#F580B1}}
    Expression = {{Text|0|#F580B1}}
    {{Cl|FOR}} x = {{Text|1|#F580B1}} {{Cl|TO}} lastt
        ContinueScan:
        {{Cl|IF}} DitchLev(x) < level {{Cl|THEN}} {{Text|<nowiki>'dropping down to a lower level</nowiki>|#919191}}
            {{Text|<nowiki>'we can only go as low as the 'ditch' will allow us, which will limit our options</nowiki>|#919191}}
            level = DitchLev(x)
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} EntryLev(x) <= level {{Cl|THEN}} {{Text|<nowiki>'possible to enter level</nowiki>|#919191}}
            {{Text|<nowiki>'But was this optional or were we forced to be on this level?</nowiki>|#919191}}
            {{Cl|IF}} EntryLev(x) < Lev(x) {{Cl|THEN}}
                optional = {{Text|1|#F580B1}}
                {{Cl|IF}} level > EntryLev(x) {{Cl|THEN}} optional = {{Text|0|#F580B1}}
            {{Cl|ELSE}}
                {{Text|<nowiki>'entrylev=lev</nowiki>|#919191}}
                optional = {{Text|0|#F580B1}}
            {{Cl|END}} {{Cl|IF}}
            t = T(x)
            {{Cl|IF}} t = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'A "?" expression</nowiki>|#919191}}
                {{Cl|IF}} Expression {{Cl|THEN}}
                    {{Text|<nowiki>'*********backtrack************</nowiki>|#919191}}
                    {{Text|<nowiki>'We are tracking an expression which we assumed would be present but was not</nowiki>|#919191}}
                    {{Cl|GOTO}} Backtrack
                    {{Text|<nowiki>'******************************</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} optional {{Cl|THEN}}
                    Branches = Branches + {{Text|1|#F580B1}}
                    BranchFormatPos(Branches) = x
                    BranchTaken(Branches) = {{Text|1|#F580B1}}
                    BranchInputPos(Branches) = i
                    BranchWithExpression(Branches) = {{Text|0|#F580B1}}
                    BranchLevel(Branches) = level
                    level = Lev(x)
                {{Cl|END}} {{Cl|IF}}
                Expression = x
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'A "?" expression</nowiki>|#919191}}
            {{Cl|IF}} t {{Cl|THEN}}
                currentlev = level
                {{Text|<nowiki>'Add new branch if new level will be entered</nowiki>|#919191}}
                {{Cl|IF}} optional {{Cl|THEN}}
                    Branches = Branches + {{Text|1|#F580B1}}
                    BranchFormatPos(Branches) = x
                    BranchTaken(Branches) = {{Text|1|#F580B1}}
                    BranchInputPos(Branches) = i
                    BranchWithExpression(Branches) = Expression
                    BranchLevel(Branches) = level
                {{Cl|END}} {{Cl|IF}}
                {{Text|<nowiki>'Scan for Opt () options</nowiki>|#919191}}
                i1 = i: i2 = i
                {{Cl|IF}} Expression {{Cl|THEN}} i2 = n
                {{Text|<nowiki>'Scan a$ for opt () x</nowiki>|#919191}}
                {{Text|<nowiki>'Note: Finding the closest opt option is necessary</nowiki>|#919191}}
                {{Text|<nowiki>'Note: This needs to be bracket sensitive</nowiki>|#919191}}
                OutOfRange = {{Text|2147483647|#F580B1}}
                position = OutOfRange
                which = {{Text|0|#F580B1}}
                removePrefix = {{Text|0|#F580B1}}
                {{Cl|IF}} i <= n {{Cl|THEN}} {{Text|<nowiki>'Past end of contect check</nowiki>|#919191}}
                    {{Cl|FOR}} o = {{Text|1|#F580B1}} {{Cl|TO}} t
                        words = OptWords(x, o)
                        b = {{Text|0|#F580B1}}
                        {{Cl|FOR}} i3 = i1 {{Cl|TO}} i2
                            {{Cl|IF}} i3 + words - {{Text|1|#F580B1}} <= n {{Cl|THEN}} {{Text|<nowiki>'enough elements exist</nowiki>|#919191}}
                                c$ = {{Text|getelement$|#55FF55}}(a$, i3)
                                {{Cl|IF}} b = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Text|<nowiki>'Build comparison string (spacing elements)</nowiki>|#919191}}
                                    {{Cl|FOR}} w = {{Text|2|#F580B1}} {{Cl|TO}} words
                                        c$ = c$ + {{Text|<nowiki>" "</nowiki>|#FFB100}} + {{Text|getelement$|#55FF55}}(a$, i3 + w - {{Text|1|#F580B1}})
                                    {{Cl|NEXT}} w
                                    {{Text|<nowiki>'Compare</nowiki>|#919191}}
                                    noPrefixMatch = {{Cl|LEFT$}}(Opt(x, o), {{Text|1|#F580B1}}) = {{Text|<nowiki>"_"</nowiki>|#FFB100}} {{Cl|AND}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|AND}} c$ = {{Cl|UCASE$}}({{Cl|MID$ (function)|MID$}}({{Cl|RTRIM$}}(Opt(x, o)), {{Text|2|#F580B1}}))
                                    {{Cl|IF}} c$ = {{Cl|UCASE$}}({{Cl|RTRIM$}}(Opt(x, o))) {{Cl|OR (boolean)|OR}} noPrefixMatch {{Cl|THEN}}
                                        {{Text|<nowiki>'Record Match</nowiki>|#919191}}
                                        {{Cl|IF}} i3 < position {{Cl|THEN}}
                                            position = i3
                                            which = o
                                            {{Cl|IF}} noPrefixMatch {{Cl|THEN}} removePrefix = {{Text|1|#F580B1}}
                                            bvalue = b
                                            {{Cl|EXIT}} {{Cl|FOR}} {{Text|<nowiki>'Exit the i3 loop</nowiki>|#919191}}
                                        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'position check</nowiki>|#919191}}
                                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'match</nowiki>|#919191}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Cl|IF}} {{Cl|ASC (function)|ASC}}(c$) = {{Text|44|#F580B1}} {{Cl|AND (boolean)|AND}} b = {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Cl|EXIT}} {{Cl|FOR}} {{Text|<nowiki>'Expressions cannot contain a "," in their base level</nowiki>|#919191}}
                                    {{Text|<nowiki>'Because this wasn't interceppted by the above code it isn't the Opt either</nowiki>|#919191}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Cl|IF}} {{Cl|ASC (function)|ASC}}(c$) = {{Text|40|#F580B1}} {{Cl|THEN}}
                                    b = b + {{Text|1|#F580B1}}
                                {{Cl|END}} {{Cl|IF}}
                                {{Cl|IF}} {{Cl|ASC (function)|ASC}}(c$) = {{Text|41|#F580B1}} {{Cl|THEN}}
                                    b = b - {{Text|1|#F580B1}}
                                    {{Cl|IF}} b = {{Text|-1|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}} {{Text|<nowiki>'Exited current bracketting level, making any following match invalid</nowiki>|#919191}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'enough elements exist</nowiki>|#919191}}
                        {{Cl|NEXT}} i3
                    {{Cl|NEXT}} o
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'Past end of contect check</nowiki>|#919191}}
                {{Cl|IF}} position <> OutOfRange {{Cl|THEN}} {{Text|<nowiki>'Found?</nowiki>|#919191}}
                    {{Text|<nowiki>'Found...</nowiki>|#919191}}
                    level = Lev(x) {{Text|<nowiki>'Adjust level</nowiki>|#919191}}
                    {{Cl|IF}} Expression {{Cl|THEN}}
                        {{Text|<nowiki>'Found...Expression...</nowiki>|#919191}}
                        {{Text|<nowiki>'Has an expression been provided?</nowiki>|#919191}}
                        {{Cl|IF}} position > i {{Cl|AND (boolean)|AND}} bvalue = {{Text|0|#F580B1}} {{Cl|THEN}}
                            {{Text|<nowiki>'Found...Expression...Provided...</nowiki>|#919191}}
                            separgs(Expression) = {{Text|getelements$|#55FF55}}(ca$, i, position - {{Text|1|#F580B1}})
                            Expression = {{Text|0|#F580B1}}
                            i = position
                        {{Cl|ELSE}}
                            {{Text|<nowiki>'Found...Expression...Omitted...</nowiki>|#919191}}
                            {{Text|<nowiki>'*********backtrack************</nowiki>|#919191}}
                            {{Cl|GOTO}} OptCheckBacktrack
                            {{Text|<nowiki>'******************************</nowiki>|#919191}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'Expression</nowiki>|#919191}}
                    i = i + OptWords(x, which)
                    separgslayout(x) = {{Cl|CHR$}}({{Cl|LEN}}({{Cl|RTRIM$}}(Opt(x, which))) - removePrefix) + {{Text|SCase$|#55FF55}}({{Cl|MID$ (function)|MID$}}({{Cl|RTRIM$}}(Opt(x, which)), removePrefix + {{Text|1|#F580B1}}))
                    separgs(x) = {{Cl|CHR$}}({{Text|0|#F580B1}}) + {{Text|str2|#55FF55}}(which)
                {{Cl|ELSE}}
                    {{Text|<nowiki>'Not Found...</nowiki>|#919191}}
                    {{Text|<nowiki>'*********backtrack************</nowiki>|#919191}}
                    OptCheckBacktrack:
                    {{Text|<nowiki>'Was this optional?</nowiki>|#919191}}
                    {{Cl|IF}} Lev(x) > EntryLev(x) {{Cl|THEN}} {{Text|<nowiki>'Optional Opt ()?</nowiki>|#919191}}
                        {{Text|<nowiki>'Not Found...Optional...</nowiki>|#919191}}
                        {{Text|<nowiki>'Simply don't enter the optional higher level and continue as normal</nowiki>|#919191}}
                        BranchTaken(Branches) = {{Text|0|#F580B1}}
                        level = currentlev {{Text|<nowiki>'We aren't entering the level after all, so our level should remain at the opt's entrylevel</nowiki>|#919191}}
                    {{Cl|ELSE}}
                        Backtrack:
                        {{Text|<nowiki>'Not Found...Mandatory...</nowiki>|#919191}}
                        {{Text|<nowiki>'1)Erase previous branches where both options have been tried</nowiki>|#919191}}
                        {{Cl|FOR}} branch = Branches {{Cl|TO}} {{Text|1|#F580B1}} {{Cl|STEP}} {{Text|-1|#F580B1}} {{Text|<nowiki>'Remove branches until last taken branch is found</nowiki>|#919191}}
                            {{Cl|IF}} BranchTaken(branch) {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}}
                            Branches = Branches - {{Text|1|#F580B1}} {{Text|<nowiki>'Remove branch (it has already been tried with both possible combinations)</nowiki>|#919191}}
                        {{Cl|NEXT}}
                        {{Cl|IF}} Branches = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'All options have been exhausted</nowiki>|#919191}}
                            seperateargs_error = {{Text|1|#F580B1}}
                            seperateargs_error_message = {{Text|<nowiki>"Syntax error"</nowiki>|#FFB100}}
                            {{Cl|IF}} {{Cl|LEN}}(id2.hr_syntax) > {{Text|0|#F580B1}} {{Cl|THEN}} seperateargs_error_message = seperateargs_error_message + {{Text|<nowiki>" - Reference: "</nowiki>|#FFB100}} + id2.hr_syntax
                            {{Cl|EXIT}} {{Cl|FUNCTION}}
                        {{Cl|END}} {{Cl|IF}}
                        {{Text|<nowiki>'2)Toggle taken branch to untaken and revert</nowiki>|#919191}}
                        BranchTaken(Branches) = {{Text|0|#F580B1}} {{Text|<nowiki>'toggle branch to untaken</nowiki>|#919191}}
                        Expression = BranchWithExpression(Branches)
                        i = BranchInputPos(Branches)
                        x = BranchFormatPos(Branches)
                        level = BranchLevel(Branches)
                        {{Text|<nowiki>'3)Erase any content created after revert position</nowiki>|#919191}}
                        {{Cl|IF}} Expression {{Cl|THEN}} separgs(Expression) = {{Text|<nowiki>"n-ll"</nowiki>|#FFB100}}
                        {{Cl|FOR}} x2 = x {{Cl|TO}} lastt
                            separgs(x2) = {{Text|<nowiki>"n-ll"</nowiki>|#FFB100}}
                            separgslayout(x2) = {{Text|<nowiki>""</nowiki>|#FFB100}}
                        {{Cl|NEXT}}
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'Optional Opt ()?</nowiki>|#919191}}
                    {{Text|<nowiki>'******************************</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'Found?</nowiki>|#919191}}
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'t</nowiki>|#919191}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'possible to enter level</nowiki>|#919191}}
    {{Cl|NEXT}} x
    {{Text|<nowiki>'Final expression?</nowiki>|#919191}}
    {{Cl|IF}} Expression {{Cl|THEN}}
        {{Cl|IF}} i <= n {{Cl|THEN}}
            separgs(Expression) = {{Text|getelements$|#55FF55}}(ca$, i, n)
            {{Text|<nowiki>'can this be an expression?</nowiki>|#919191}}
            {{Text|<nowiki>'check it passes bracketting and comma rules</nowiki>|#919191}}
            b = {{Text|0|#F580B1}}
            {{Cl|FOR}} i2 = i {{Cl|TO}} n
                c$ = {{Text|getelement$|#55FF55}}(a$, i2)
                {{Cl|IF}} {{Cl|ASC (function)|ASC}}(c$) = {{Text|44|#F580B1}} {{Cl|AND (boolean)|AND}} b = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Cl|GOTO}} Backtrack
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} {{Cl|ASC (function)|ASC}}(c$) = {{Text|40|#F580B1}} {{Cl|THEN}}
                    b = b + {{Text|1|#F580B1}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} {{Cl|ASC (function)|ASC}}(c$) = {{Text|41|#F580B1}} {{Cl|THEN}}
                    b = b - {{Text|1|#F580B1}}
                    {{Cl|IF}} b = {{Text|-1|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} Backtrack
                {{Cl|END}} {{Cl|IF}}
            {{Cl|NEXT}}
            {{Cl|IF}} b <> {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} Backtrack
            i = n + {{Text|1|#F580B1}} {{Text|<nowiki>'So it passes the test below</nowiki>|#919191}}
        {{Cl|ELSE}}
            {{Cl|GOTO}} Backtrack
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'Expression</nowiki>|#919191}}
    {{Cl|IF}} i <> n + {{Text|1|#F580B1}} {{Cl|THEN}} {{Cl|GOTO}} Backtrack {{Text|<nowiki>'Trailing content?</nowiki>|#919191}}
    {{Cl|IF}} Debug {{Cl|THEN}}
        {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"--------SEPERATE ARGUMENTS REPORT #2--------"</nowiki>|#FFB100}}
        {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} lastt
            {{Cl|PRINT (file statement)|PRINT}} #9, i, separgs(i)
        {{Cl|NEXT}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'  DIM PassRule(1 TO 100) AS LONG</nowiki>|#919191}}
    {{Text|<nowiki>'  '0 means no pass rule</nowiki>|#919191}}
    {{Text|<nowiki>'  'negative values refer to an opt () element</nowiki>|#919191}}
    {{Text|<nowiki>'  'positive values refer to a flag value</nowiki>|#919191}}
    {{Text|<nowiki>'  PassFlag = 1</nowiki>|#919191}}
    {{Cl|IF}} PassFlag <> {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|seperateargs|#55FF55}} = {{Text|1|#F580B1}} {{Text|<nowiki>'Return whether a 'passed' flags variable is required</nowiki>|#919191}}
    pass& = {{Text|0|#F580B1}} {{Text|<nowiki>'The 'passed' value (shared by argument reference)</nowiki>|#919191}}
    {{Text|<nowiki>'Note: The separgs() elements will be compacted to the C++ function arguments</nowiki>|#919191}}
    x = {{Text|1|#F580B1}} {{Text|<nowiki>'The new index to move compacted content to within separgs()</nowiki>|#919191}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} lastt
        {{Cl|IF}} DontPass(i) = {{Text|0|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} PassRule(i) > {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} separgs(i) <> {{Text|<nowiki>"n-ll"</nowiki>|#FFB100}} {{Cl|THEN}} pass& = pass& {{Cl|OR}} PassRule(i) {{Text|<nowiki>'build 'passed' flags</nowiki>|#919191}}
            {{Cl|END}} {{Cl|IF}}
            separgs(x) = separgs(i)
            separgslayout(x) = separgslayout(i)
            {{Cl|IF}} {{Cl|LEN}}(separgs(x)) {{Cl|THEN}}
                {{Cl|IF}} {{Cl|ASC (function)|ASC}}(separgs(x)) = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Text|<nowiki>'switch omit layout tag from item to layout info</nowiki>|#919191}}
                    separgs(x) = {{Cl|RIGHT$}}(separgs(x), {{Cl|LEN}}(separgs(x)) - {{Text|1|#F580B1}})
                    separgslayout(x) = separgslayout(x) + {{Cl|CHR$}}({{Text|0|#F580B1}})
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} separgs(x) = {{Text|<nowiki>"n-ll"</nowiki>|#FFB100}} {{Cl|THEN}} separgs(x) = {{Text|<nowiki>"N-LL"</nowiki>|#FFB100}}
            x = x + {{Text|1|#F580B1}}
        {{Cl|ELSE}}
            {{Text|<nowiki>'its gonna be skipped!</nowiki>|#919191}}
            {{Text|<nowiki>'add layout to the next one to be safe</nowiki>|#919191}}
            {{Text|<nowiki>'for syntax such as [{HELLO}] which uses a flag instead of being passed</nowiki>|#919191}}
            {{Cl|IF}} PassRule(i) > {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} separgs(i) <> {{Text|<nowiki>"n-ll"</nowiki>|#FFB100}} {{Cl|THEN}} pass& = pass& {{Cl|OR}} PassRule(i) {{Text|<nowiki>'build 'passed' flags</nowiki>|#919191}}
            {{Cl|END}} {{Cl|IF}}
            separgslayout(i + {{Text|1|#F580B1}}) = separgslayout(i) + separgslayout(i + {{Text|1|#F580B1}})
        {{Cl|END}} {{Cl|IF}}
    {{Cl|NEXT}}
    separgslayout(x) = separgslayout(i) {{Text|<nowiki>'set final layout</nowiki>|#919191}}
    {{Text|<nowiki>'x = x - 1</nowiki>|#919191}}
    {{Text|<nowiki>'PRINT "total arguments:"; x</nowiki>|#919191}}
    {{Text|<nowiki>'PRINT "pass omit (0/1):"; omit</nowiki>|#919191}}
    {{Text|<nowiki>'PRINT "pass&="; pass&</nowiki>|#919191}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|SUB}} {{Text|setrefer|#55FF55}} (a2$, typ2 {{Cl|AS}} {{Cl|LONG}}, e2$, method {{Cl|AS}} {{Cl|LONG}})
    a$ = a2$: typ = typ2: e$ = e2$
    {{Cl|IF}} method <> {{Text|1|#F580B1}} {{Cl|THEN}} e$ = {{Text|fixoperationorder$|#55FF55}}(e$)
    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
    tl$ = tlayout$
    {{Text|<nowiki>'method: 0 evaulatetotyp e$</nowiki>|#919191}}
    {{Text|<nowiki>'        1 skip evaluation of e$ and use as is</nowiki>|#919191}}
    {{Text|<nowiki>'*due to the complexity of setting a reference with a value/string</nowiki>|#919191}}
    {{Text|<nowiki>' this function handles the problem</nowiki>|#919191}}
    {{Text|<nowiki>'retrieve ID</nowiki>|#919191}}
    i = {{Cl|INSTR}}(a$, sp3)
    {{Cl|IF}} i {{Cl|THEN}}
        idnumber = {{Cl|VAL}}({{Cl|LEFT$}}(a$, i - {{Text|1|#F580B1}})): a$ = {{Cl|RIGHT$}}(a$, {{Cl|LEN}}(a$) - i)
    {{Cl|ELSE}}
        idnumber = {{Cl|VAL}}(a$)
    {{Cl|END}} {{Cl|IF}}
    {{Text|getid|#55FF55}} idnumber
    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
    {{Text|<nowiki>'UDT?</nowiki>|#919191}}
    {{Cl|IF}} typ {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
        {{Text|<nowiki>'print "setrefer-ing a UDT!"</nowiki>|#919191}}
        u = {{Cl|VAL}}(a$)
        i = {{Cl|INSTR}}(a$, sp3): a$ = {{Cl|RIGHT$}}(a$, {{Cl|LEN}}(a$) - i): E = {{Cl|VAL}}(a$)
        i = {{Cl|INSTR}}(a$, sp3): o$ = {{Cl|RIGHT$}}(a$, {{Cl|LEN}}(a$) - i)
        n$ = {{Text|<nowiki>"UDT_"</nowiki>|#FFB100}} + {{Cl|RTRIM$}}(id.n): {{Cl|IF}} id.t = {{Text|0|#F580B1}} {{Cl|THEN}} n$ = {{Text|<nowiki>"ARRAY_"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]"</nowiki>|#FFB100}}
        {{Cl|IF}} E <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} u = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'Setting _MEM type elements is not allowed!</nowiki>|#919191}}
            {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot set read-only element of _MEM TYPE"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} E = {{Text|0|#F580B1}} {{Cl|THEN}}
            {{Text|<nowiki>'use u and u's size</nowiki>|#919191}}
            {{Cl|IF}} method <> {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Unexpected internal code reference to UDT"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
            lhsscope$ = {{Text|scope$|#55FF55}}
            e$ = {{Text|evaluate|#55FF55}}(e$, t2)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
            {{Cl|IF}} (t2 {{Cl|AND (boolean)|AND}} ISUDT) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected = similar user defined type"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
            {{Cl|IF}} (t2 {{Cl|AND (boolean)|AND}} ISREFERENCE) = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} t2 {{Cl|AND (boolean)|AND}} ISPOINTER {{Cl|THEN}}
                    src$ = {{Text|<nowiki>"((char*)"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                    e2 = {{Text|0|#F580B1}}: u2 = t2 {{Cl|AND}} {{Text|511|#F580B1}}
                {{Cl|ELSE}}
                    src$ = {{Text|<nowiki>"((char*)&"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                    e2 = {{Text|0|#F580B1}}: u2 = t2 {{Cl|AND}} {{Text|511|#F580B1}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|GOTO}} directudt
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'****problem****</nowiki>|#919191}}
            idnumber2 = {{Cl|VAL}}(e$)
            {{Text|getid|#55FF55}} idnumber2
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
            n2$ = {{Text|<nowiki>"UDT_"</nowiki>|#FFB100}} + {{Cl|RTRIM$}}(id.n): {{Cl|IF}} id.t = {{Text|0|#F580B1}} {{Cl|THEN}} n2$ = {{Text|<nowiki>"ARRAY_"</nowiki>|#FFB100}} + n2$ + {{Text|<nowiki>"[0]"</nowiki>|#FFB100}}
            i = {{Cl|INSTR}}(e$, sp3): e$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - i): u2 = {{Cl|VAL}}(e$)
            i = {{Cl|INSTR}}(e$, sp3): e$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - i): e2 = {{Cl|VAL}}(e$)
            i = {{Cl|INSTR}}(e$, sp3): o2$ = {{Cl|RIGHT$}}(e$, {{Cl|LEN}}(e$) - i)
            {{Text|<nowiki>'WARNING: u2 may need minor modifications based on e to see if they are the same</nowiki>|#919191}}
            {{Text|<nowiki>'we have now established we have 2 pointers to similar data types!</nowiki>|#919191}}
            {{Text|<nowiki>'ASSUME BYTE TYPE!!!</nowiki>|#919191}}
            src$ = {{Text|<nowiki>"((char*)"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + n2$ + {{Text|<nowiki>")+("</nowiki>|#FFB100}} + o2$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
            directudt:
            {{Cl|IF}} u <> u2 {{Cl|OR (boolean)|OR}} e2 <> {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected = similar user defined type"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
            dst$ = {{Text|<nowiki>"((char*)"</nowiki>|#FFB100}} + lhsscope$ + n$ + {{Text|<nowiki>")+("</nowiki>|#FFB100}} + o$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
            {{Text|copy_full_udt|#55FF55}} dst$, src$, MainTxtBuf, {{Text|0|#F580B1}}, u
            {{Text|<nowiki>'print "setFULLUDTrefer!"</nowiki>|#919191}}
            tlayout$ = tl$
            {{Cl|EXIT}} {{Cl|SUB}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'e=0</nowiki>|#919191}}
        {{Cl|IF}} typ {{Cl|AND (boolean)|AND}} ISOFFSETINBITS {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot resolve bit-length variables inside user defined types"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
        {{Cl|IF}} typ {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
            {{Cl|IF}} typ {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH {{Cl|THEN}}
                o2$ = {{Text|<nowiki>"(((uint8*)"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + n$ + {{Text|<nowiki>")+("</nowiki>|#FFB100}} + o$ + {{Text|<nowiki>"))"</nowiki>|#FFB100}}
                r$ = {{Text|<nowiki>"qbs_new_fixed("</nowiki>|#FFB100}} + o2$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(udtetypesize(E)) + {{Text|<nowiki>",1)"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                r$ = {{Text|<nowiki>"*((qbs**)((char*)("</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + n$ + {{Text|<nowiki>")+("</nowiki>|#FFB100}} + o$ + {{Text|<nowiki>")))"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} method = {{Text|0|#F580B1}} {{Cl|THEN}} e$ = {{Text|evaluatetotyp|#55FF55}}(e$, STRINGTYPE - ISPOINTER)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_set("</nowiki>|#FFB100}} + r$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, cleanupstringprocessingcall$ + {{Text|<nowiki>"0);"</nowiki>|#FFB100}}
        {{Cl|ELSE}}
            typ = typ - ISUDT - ISREFERENCE - ISPOINTER
            {{Cl|IF}} typ {{Cl|AND (boolean)|AND}} ISARRAY {{Cl|THEN}} typ = typ - ISARRAY
            t$ = {{Text|typ2ctyp$|#55FF55}}(typ, {{Text|<nowiki>""</nowiki>|#FFB100}})
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
            o2$ = {{Text|<nowiki>"(((char*)"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + n$ + {{Text|<nowiki>")+("</nowiki>|#FFB100}} + o$ + {{Text|<nowiki>"))"</nowiki>|#FFB100}}
            r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|<nowiki>"("</nowiki>|#FFB100}} + t$ + {{Text|<nowiki>"*)"</nowiki>|#FFB100}} + o2$
            {{Cl|IF}} method = {{Text|0|#F580B1}} {{Cl|THEN}} e$ = {{Text|evaluatetotyp|#55FF55}}(e$, typ)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, r$ + {{Text|<nowiki>"="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'print "setUDTrefer:"+r$,e$</nowiki>|#919191}}
        tlayout$ = tl$
        {{Cl|IF}} {{Cl|LEFT$}}(r$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"*"</nowiki>|#FFB100}} {{Cl|THEN}} r$ = {{Cl|MID$ (function)|MID$}}(r$, {{Text|2|#F580B1}})
        {{Cl|EXIT}} {{Cl|SUB}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'array?</nowiki>|#919191}}
    {{Cl|IF}} id.arraytype {{Cl|THEN}}
        n$ = {{Cl|RTRIM$}}(id.callname)
        typ = typ - ISPOINTER - ISREFERENCE {{Text|<nowiki>'typ now looks like a regular value</nowiki>|#919191}}
        {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}}
            {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) {{Cl|THEN}}
                offset$ = {{Text|<nowiki>"&((uint8*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]))[tmp_long*"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(id.tsize) + {{Text|<nowiki>"]"</nowiki>|#FFB100}}
                r$ = {{Text|<nowiki>"qbs_new_fixed("</nowiki>|#FFB100}} + offset$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(id.tsize) + {{Text|<nowiki>",1)"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_long="</nowiki>|#FFB100}} + a$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Cl|IF}} method = {{Text|0|#F580B1}} {{Cl|THEN}}
                    l$ = {{Text|<nowiki>"if (!new_error) qbs_set("</nowiki>|#FFB100}} + r$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|evaluatetotyp|#55FF55}}(e$, typ) + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                {{Cl|ELSE}}
                    l$ = {{Text|<nowiki>"if (!new_error) qbs_set("</nowiki>|#FFB100}} + r$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, l$
            {{Cl|ELSE}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_long="</nowiki>|#FFB100}} + a$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Cl|IF}} method = {{Text|0|#F580B1}} {{Cl|THEN}}
                    l$ = {{Text|<nowiki>"if (!new_error) qbs_set( ((qbs*)(((uint64*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]))[tmp_long])),"</nowiki>|#FFB100}} + {{Text|evaluatetotyp|#55FF55}}(e$, typ) + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                {{Cl|ELSE}}
                    l$ = {{Text|<nowiki>"if (!new_error) qbs_set( ((qbs*)(((uint64*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]))[tmp_long])),"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, l$
            {{Cl|END}} {{Cl|IF}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, cleanupstringprocessingcall$ + {{Text|<nowiki>"0);"</nowiki>|#FFB100}}
            tlayout$ = tl$
            {{Cl|IF}} {{Cl|LEFT$}}(r$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"*"</nowiki>|#FFB100}} {{Cl|THEN}} r$ = {{Cl|MID$ (function)|MID$}}(r$, {{Text|2|#F580B1}})
            {{Cl|EXIT}} {{Cl|SUB}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) {{Cl|THEN}}
            {{Text|<nowiki>'r$ = "setbits_" + str2(typ AND 511) + "("</nowiki>|#919191}}
            r$ = {{Text|<nowiki>"setbits("</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(typ {{Cl|AND}} {{Text|511|#F580B1}}) + {{Text|<nowiki>","</nowiki>|#FFB100}}
            r$ = r$ + {{Text|<nowiki>"(uint8*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0])"</nowiki>|#FFB100}} + {{Text|<nowiki>",tmp_long,"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_long="</nowiki>|#FFB100}} + a$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
            {{Cl|IF}} method = {{Text|0|#F580B1}} {{Cl|THEN}}
                l$ = {{Text|<nowiki>"if (!new_error) "</nowiki>|#FFB100}} + r$ + {{Text|evaluatetotyp|#55FF55}}(e$, typ) + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
            {{Cl|ELSE}}
                l$ = {{Text|<nowiki>"if (!new_error) "</nowiki>|#FFB100}} + r$ + e$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, l$
            tlayout$ = tl$
            {{Cl|EXIT}} {{Cl|SUB}}
        {{Cl|ELSE}}
            t$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}}
                {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|32|#F580B1}} {{Cl|THEN}} t$ = {{Text|<nowiki>"float"</nowiki>|#FFB100}}
                {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|64|#F580B1}} {{Cl|THEN}} t$ = {{Text|<nowiki>"double"</nowiki>|#FFB100}}
                {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|256|#F580B1}} {{Cl|THEN}} t$ = {{Text|<nowiki>"long double"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISUNSIGNED) {{Cl|THEN}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|8|#F580B1}} {{Cl|THEN}} t$ = {{Text|<nowiki>"uint8"</nowiki>|#FFB100}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|16|#F580B1}} {{Cl|THEN}} t$ = {{Text|<nowiki>"uint16"</nowiki>|#FFB100}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|32|#F580B1}} {{Cl|THEN}} t$ = {{Text|<nowiki>"uint32"</nowiki>|#FFB100}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|64|#F580B1}} {{Cl|THEN}} t$ = {{Text|<nowiki>"uint64"</nowiki>|#FFB100}}
                    {{Cl|IF}} typ {{Cl|AND (boolean)|AND}} ISOFFSET {{Cl|THEN}} t$ = {{Text|<nowiki>"uptrszint"</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|8|#F580B1}} {{Cl|THEN}} t$ = {{Text|<nowiki>"int8"</nowiki>|#FFB100}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|16|#F580B1}} {{Cl|THEN}} t$ = {{Text|<nowiki>"int16"</nowiki>|#FFB100}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|32|#F580B1}} {{Cl|THEN}} t$ = {{Text|<nowiki>"int32"</nowiki>|#FFB100}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|64|#F580B1}} {{Cl|THEN}} t$ = {{Text|<nowiki>"int64"</nowiki>|#FFB100}}
                    {{Cl|IF}} typ {{Cl|AND (boolean)|AND}} ISOFFSET {{Cl|THEN}} t$ = {{Text|<nowiki>"ptrszint"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} t$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot find C type to return array data"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_long="</nowiki>|#FFB100}} + a$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
        {{Cl|IF}} method = {{Text|0|#F580B1}} {{Cl|THEN}}
            l$ = {{Text|<nowiki>"if (!new_error) (("</nowiki>|#FFB100}} + t$ + {{Text|<nowiki>"*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]))[tmp_long]="</nowiki>|#FFB100}} + {{Text|evaluatetotyp|#55FF55}}(e$, typ) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
        {{Cl|ELSE}}
            l$ = {{Text|<nowiki>"if (!new_error) (("</nowiki>|#FFB100}} + t$ + {{Text|<nowiki>"*)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]))[tmp_long]="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, l$
        tlayout$ = tl$
        {{Cl|EXIT}} {{Cl|SUB}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'array</nowiki>|#919191}}
    {{Text|<nowiki>'variable?</nowiki>|#919191}}
    {{Cl|IF}} id.t {{Cl|THEN}}
        r$ = {{Cl|RTRIM$}}(id.n)
        t = id.t
        {{Text|<nowiki>'remove irrelavant flags</nowiki>|#919191}}
        {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISINCONVENTIONALMEMORY) {{Cl|THEN}} t = t - ISINCONVENTIONALMEMORY
        typ = t
        {{Text|<nowiki>'string variable?</nowiki>|#919191}}
        {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}}
            {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) {{Cl|THEN}}
                r$ = {{Text|scope$|#55FF55}} + {{Text|<nowiki>"STRING"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(id.tsize) + {{Text|<nowiki>"_"</nowiki>|#FFB100}} + r$
            {{Cl|ELSE}}
                r$ = {{Text|scope$|#55FF55}} + {{Text|<nowiki>"STRING_"</nowiki>|#FFB100}} + r$
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} method = {{Text|0|#F580B1}} {{Cl|THEN}} e$ = {{Text|evaluatetotyp|#55FF55}}(e$, ISSTRING)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_set("</nowiki>|#FFB100}} + r$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, cleanupstringprocessingcall$ + {{Text|<nowiki>"0);"</nowiki>|#FFB100}}
            {{Cl|IF}} arrayprocessinghappened {{Cl|THEN}} arrayprocessinghappened = {{Text|0|#F580B1}}
            tlayout$ = tl$
            {{Cl|IF}} {{Cl|LEFT$}}(r$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"*"</nowiki>|#FFB100}} {{Cl|THEN}} r$ = {{Cl|MID$ (function)|MID$}}(r$, {{Text|2|#F580B1}})
            {{Cl|EXIT}} {{Cl|SUB}}
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'bit-length variable?</nowiki>|#919191}}
        {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) {{Cl|THEN}}
            b = t {{Cl|AND}} {{Text|511|#F580B1}}
            {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISUNSIGNED) {{Cl|THEN}}
                r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + {{Text|<nowiki>"UBIT"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(t {{Cl|AND}} {{Text|511|#F580B1}}) + {{Text|<nowiki>"_"</nowiki>|#FFB100}} + r$
                {{Cl|IF}} method = {{Text|0|#F580B1}} {{Cl|THEN}} e$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|64&|#F580B1}} + ISUNSIGNED)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                l$ = r$ + {{Text|<nowiki>"=("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")&"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bitmask(b)) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, l$
            {{Cl|ELSE}}
                r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + {{Text|<nowiki>"BIT"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(t {{Cl|AND}} {{Text|511|#F580B1}}) + {{Text|<nowiki>"_"</nowiki>|#FFB100}} + r$
                {{Cl|IF}} method = {{Text|0|#F580B1}} {{Cl|THEN}} e$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|64&|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                l$ = {{Text|<nowiki>"if (("</nowiki>|#FFB100}} + r$ + {{Text|<nowiki>"="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")&"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}({{Text|2|#F580B1}} ^ (b - {{Text|1|#F580B1}})) + {{Text|<nowiki>"){"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, l$
                {{Text|<nowiki>'signed bit is set</nowiki>|#919191}}
                l$ = r$ + {{Text|<nowiki>"|="</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bitmaskinv(b)) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, l$
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}else{"</nowiki>|#FFB100}}
                {{Text|<nowiki>'signed bit is not set</nowiki>|#919191}}
                l$ = r$ + {{Text|<nowiki>"&="</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bitmask(b)) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, l$
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} stringprocessinghappened {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, cleanupstringprocessingcall$ + {{Text|<nowiki>"0);"</nowiki>|#FFB100}}: stringprocessinghappened = {{Text|0|#F580B1}}
            {{Cl|IF}} arrayprocessinghappened {{Cl|THEN}} arrayprocessinghappened = {{Text|0|#F580B1}}
            tlayout$ = tl$
            {{Cl|IF}} {{Cl|LEFT$}}(r$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"*"</nowiki>|#FFB100}} {{Cl|THEN}} r$ = {{Cl|MID$ (function)|MID$}}(r$, {{Text|2|#F580B1}})
            {{Cl|EXIT}} {{Cl|SUB}}
        {{Cl|END}} {{Cl|IF}}
        {{Text|<nowiki>'standard variable?</nowiki>|#919191}}
        {{Cl|IF}} t = BYTETYPE {{Cl|THEN}} r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + {{Text|<nowiki>"BYTE_"</nowiki>|#FFB100}} + r$: {{Cl|GOTO}} sref
        {{Cl|IF}} t = UBYTETYPE {{Cl|THEN}} r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + {{Text|<nowiki>"UBYTE_"</nowiki>|#FFB100}} + r$: {{Cl|GOTO}} sref
        {{Cl|IF}} t = INTEGERTYPE {{Cl|THEN}} r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + {{Text|<nowiki>"INTEGER_"</nowiki>|#FFB100}} + r$: {{Cl|GOTO}} sref
        {{Cl|IF}} t = UINTEGERTYPE {{Cl|THEN}} r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + {{Text|<nowiki>"UINTEGER_"</nowiki>|#FFB100}} + r$: {{Cl|GOTO}} sref
        {{Cl|IF}} t = LONGTYPE {{Cl|THEN}} r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + {{Text|<nowiki>"LONG_"</nowiki>|#FFB100}} + r$: {{Cl|GOTO}} sref
        {{Cl|IF}} t = ULONGTYPE {{Cl|THEN}} r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + {{Text|<nowiki>"ULONG_"</nowiki>|#FFB100}} + r$: {{Cl|GOTO}} sref
        {{Cl|IF}} t = INTEGER64TYPE {{Cl|THEN}} r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + {{Text|<nowiki>"INTEGER64_"</nowiki>|#FFB100}} + r$: {{Cl|GOTO}} sref
        {{Cl|IF}} t = UINTEGER64TYPE {{Cl|THEN}} r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + {{Text|<nowiki>"UINTEGER64_"</nowiki>|#FFB100}} + r$: {{Cl|GOTO}} sref
        {{Cl|IF}} t = SINGLETYPE {{Cl|THEN}} r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + {{Text|<nowiki>"SINGLE_"</nowiki>|#FFB100}} + r$: {{Cl|GOTO}} sref
        {{Cl|IF}} t = DOUBLETYPE {{Cl|THEN}} r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + {{Text|<nowiki>"DOUBLE_"</nowiki>|#FFB100}} + r$: {{Cl|GOTO}} sref
        {{Cl|IF}} t = FLOATTYPE {{Cl|THEN}} r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + {{Text|<nowiki>"FLOAT_"</nowiki>|#FFB100}} + r$: {{Cl|GOTO}} sref
        {{Cl|IF}} t = OFFSETTYPE {{Cl|THEN}} r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + {{Text|<nowiki>"OFFSET_"</nowiki>|#FFB100}} + r$: {{Cl|GOTO}} sref
        {{Cl|IF}} t = UOFFSETTYPE {{Cl|THEN}} r$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} + {{Text|scope$|#55FF55}} + {{Text|<nowiki>"UOFFSET_"</nowiki>|#FFB100}} + r$: {{Cl|GOTO}} sref
        sref:
        t2 = t - ISPOINTER
        {{Cl|IF}} method = {{Text|0|#F580B1}} {{Cl|THEN}} e$ = {{Text|evaluatetotyp|#55FF55}}(e$, t2)
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
        l$ = r$ + {{Text|<nowiki>"="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, l$
        {{Cl|IF}} stringprocessinghappened {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, cleanupstringprocessingcall$ + {{Text|<nowiki>"0);"</nowiki>|#FFB100}}: stringprocessinghappened = {{Text|0|#F580B1}}
        {{Cl|IF}} arrayprocessinghappened {{Cl|THEN}} arrayprocessinghappened = {{Text|0|#F580B1}}
        tlayout$ = tl$
        {{Cl|IF}} {{Cl|LEFT$}}(r$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"*"</nowiki>|#FFB100}} {{Cl|THEN}} r$ = {{Cl|MID$ (function)|MID$}}(r$, {{Text|2|#F580B1}})
        {{Cl|EXIT}} {{Cl|SUB}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'variable</nowiki>|#919191}}
    tlayout$ = tl$
{{Cl|END}} {{Cl|SUB}}
{{Cl|FUNCTION}} {{Text|str2$|#55FF55}} (v {{Cl|AS}} {{Cl|LONG}})
    {{Text|str2$|#55FF55}} = {{Cl|_TRIM$}}({{Cl|STR$}}(v))
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|str2u64$|#55FF55}} (v~&&)
    {{Text|str2u64$|#55FF55}} = {{Cl|LTRIM$}}({{Cl|RTRIM$}}({{Cl|STR$}}(v~&&)))
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|str2i64$|#55FF55}} (v&&)
    {{Text|str2i64$|#55FF55}} = {{Cl|LTRIM$}}({{Cl|RTRIM$}}({{Cl|STR$}}(v&&)))
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|typ2ctyp$|#55FF55}} (t {{Cl|AS}} {{Cl|LONG}}, tstr {{Cl|AS}} {{Cl|STRING}})
    ctyp$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
    {{Text|<nowiki>'typ can be passed as either: (the unused value is ignored)</nowiki>|#919191}}
    {{Text|<nowiki>'i. as a typ value in t</nowiki>|#919191}}
    {{Text|<nowiki>'ii. as a typ symbol (eg. "~%") in tstr</nowiki>|#919191}}
    {{Text|<nowiki>'iii. as a typ name (eg. _UNSIGNED INTEGER) in tstr</nowiki>|#919191}}
    {{Cl|IF}} tstr$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
        {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISARRAY) {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}} {{Text|<nowiki>'cannot return array types</nowiki>|#919191}}
        {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} {{Text|typ2ctyp$|#55FF55}} = {{Text|<nowiki>"qbs"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        b = t {{Cl|AND}} {{Text|511|#F580B1}}
        {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISUDT) {{Cl|THEN}} {{Text|typ2ctyp$|#55FF55}} = {{Text|<nowiki>"void"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) {{Cl|THEN}}
            {{Cl|IF}} b <= {{Text|32|#F580B1}} {{Cl|THEN}} ctyp$ = {{Text|<nowiki>"int32"</nowiki>|#FFB100}} {{Cl|ELSE}} ctyp$ = {{Text|<nowiki>"int64"</nowiki>|#FFB100}}
            {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISUNSIGNED) {{Cl|THEN}} ctyp$ = {{Text|<nowiki>"u"</nowiki>|#FFB100}} + ctyp$
            {{Text|typ2ctyp$|#55FF55}} = ctyp$: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}}
            {{Cl|IF}} b = {{Text|32|#F580B1}} {{Cl|THEN}} ctyp$ = {{Text|<nowiki>"float"</nowiki>|#FFB100}}
            {{Cl|IF}} b = {{Text|64|#F580B1}} {{Cl|THEN}} ctyp$ = {{Text|<nowiki>"double"</nowiki>|#FFB100}}
            {{Cl|IF}} b = {{Text|256|#F580B1}} {{Cl|THEN}} ctyp$ = {{Text|<nowiki>"long double"</nowiki>|#FFB100}}
        {{Cl|ELSE}}
            {{Cl|IF}} b = {{Text|8|#F580B1}} {{Cl|THEN}} ctyp$ = {{Text|<nowiki>"int8"</nowiki>|#FFB100}}
            {{Cl|IF}} b = {{Text|16|#F580B1}} {{Cl|THEN}} ctyp$ = {{Text|<nowiki>"int16"</nowiki>|#FFB100}}
            {{Cl|IF}} b = {{Text|32|#F580B1}} {{Cl|THEN}} ctyp$ = {{Text|<nowiki>"int32"</nowiki>|#FFB100}}
            {{Cl|IF}} b = {{Text|64|#F580B1}} {{Cl|THEN}} ctyp$ = {{Text|<nowiki>"int64"</nowiki>|#FFB100}}
            {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISOFFSET {{Cl|THEN}} ctyp$ = {{Text|<nowiki>"ptrszint"</nowiki>|#FFB100}}
            {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISUNSIGNED) {{Cl|THEN}} ctyp$ = {{Text|<nowiki>"u"</nowiki>|#FFB100}} + ctyp$
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISOFFSET {{Cl|THEN}}
            ctyp$ = {{Text|<nowiki>"ptrszint"</nowiki>|#FFB100}}: {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISUNSIGNED) {{Cl|THEN}} ctyp$ = {{Text|<nowiki>"uptrszint"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        {{Text|typ2ctyp$|#55FF55}} = ctyp$: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    ts$ = tstr$
    {{Text|<nowiki>'is ts$ a symbol?</nowiki>|#919191}}
    {{Cl|IF}} ts$ = {{Text|<nowiki>"$"</nowiki>|#FFB100}} {{Cl|THEN}} ctyp$ = {{Text|<nowiki>"qbs"</nowiki>|#FFB100}}
    {{Cl|IF}} ts$ = {{Text|<nowiki>"!"</nowiki>|#FFB100}} {{Cl|THEN}} ctyp$ = {{Text|<nowiki>"float"</nowiki>|#FFB100}}
    {{Cl|IF}} ts$ = {{Text|<nowiki>"#"</nowiki>|#FFB100}} {{Cl|THEN}} ctyp$ = {{Text|<nowiki>"double"</nowiki>|#FFB100}}
    {{Cl|IF}} ts$ = {{Text|<nowiki>"##"</nowiki>|#FFB100}} {{Cl|THEN}} ctyp$ = {{Text|<nowiki>"long double"</nowiki>|#FFB100}}
    {{Cl|IF}} {{Cl|LEFT$}}(ts$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"~"</nowiki>|#FFB100}} {{Cl|THEN}} unsgn = {{Text|1|#F580B1}}: ts$ = {{Cl|RIGHT$}}(ts$, {{Cl|LEN}}(ts$) - {{Text|1|#F580B1}})
    {{Cl|IF}} {{Cl|LEFT$}}(ts$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"`"</nowiki>|#FFB100}} {{Cl|THEN}}
        n$ = {{Cl|RIGHT$}}(ts$, {{Cl|LEN}}(ts$) - {{Text|1|#F580B1}})
        b = {{Text|1|#F580B1}}
        {{Cl|IF}} n$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} {{Text|isuinteger|#55FF55}}(n$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid index after _BIT type"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            b = {{Cl|VAL}}(n$)
            {{Cl|IF}} b > {{Text|64|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid index after _BIT type"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} b <= {{Text|32|#F580B1}} {{Cl|THEN}} ctyp$ = {{Text|<nowiki>"int32"</nowiki>|#FFB100}} {{Cl|ELSE}} ctyp$ = {{Text|<nowiki>"int64"</nowiki>|#FFB100}}
        {{Cl|IF}} unsgn {{Cl|THEN}} ctyp$ = {{Text|<nowiki>"u"</nowiki>|#FFB100}} + ctyp$
        {{Text|typ2ctyp$|#55FF55}} = ctyp$: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} ts$ = {{Text|<nowiki>"%&"</nowiki>|#FFB100}} {{Cl|THEN}}
        {{Text|typ2ctyp$|#55FF55}} = {{Text|<nowiki>"ptrszint"</nowiki>|#FFB100}}: {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISUNSIGNED) {{Cl|THEN}} {{Text|typ2ctyp$|#55FF55}} = {{Text|<nowiki>"uptrszint"</nowiki>|#FFB100}}
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} ts$ = {{Text|<nowiki>"%%"</nowiki>|#FFB100}} {{Cl|THEN}} ctyp$ = {{Text|<nowiki>"int8"</nowiki>|#FFB100}}
    {{Cl|IF}} ts$ = {{Text|<nowiki>"%"</nowiki>|#FFB100}} {{Cl|THEN}} ctyp$ = {{Text|<nowiki>"int16"</nowiki>|#FFB100}}
    {{Cl|IF}} ts$ = {{Text|<nowiki>"&"</nowiki>|#FFB100}} {{Cl|THEN}} ctyp$ = {{Text|<nowiki>"int32"</nowiki>|#FFB100}}
    {{Cl|IF}} ts$ = {{Text|<nowiki>"&&"</nowiki>|#FFB100}} {{Cl|THEN}} ctyp$ = {{Text|<nowiki>"int64"</nowiki>|#FFB100}}
    {{Cl|IF}} ctyp$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
        {{Cl|IF}} unsgn {{Cl|THEN}} ctyp$ = {{Text|<nowiki>"u"</nowiki>|#FFB100}} + ctyp$
        {{Text|typ2ctyp$|#55FF55}} = ctyp$: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'is tstr$ a named type? (eg. 'LONG')</nowiki>|#919191}}
    s$ = {{Text|type2symbol$|#55FF55}}(tstr$)
    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} {{Cl|LEN}}(s$) {{Cl|THEN}}
        {{Text|typ2ctyp$|#55FF55}} = {{Text|typ2ctyp$|#55FF55}}({{Text|0|#F580B1}}, s$)
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid type"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|type2symbol$|#55FF55}} (typ$)
    t$ = typ$
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(t$)
        {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(t$, i, {{Text|1|#F580B1}}) = sp {{Cl|THEN}} {{Cl|MID$}}(t$, i, {{Text|1|#F580B1}}) = {{Text|<nowiki>" "</nowiki>|#FFB100}}
    {{Cl|NEXT}}
    e$ = {{Text|<nowiki>"Cannot convert type ("</nowiki>|#FFB100}} + typ$ + {{Text|<nowiki>") to symbol"</nowiki>|#FFB100}}
    t2$ = {{Text|<nowiki>"INTEGER"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"%"</nowiki>|#FFB100}}: {{Cl|IF}} t$ = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"LONG"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"&"</nowiki>|#FFB100}}: {{Cl|IF}} t$ = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"SINGLE"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"!"</nowiki>|#FFB100}}: {{Cl|IF}} t$ = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"DOUBLE"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"#"</nowiki>|#FFB100}}: {{Cl|IF}} t$ = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"_BYTE"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"%%"</nowiki>|#FFB100}}: {{Cl|IF}} t$ = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"BYTE"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"%%"</nowiki>|#FFB100}}: {{Cl|IF}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} t$ = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"_UNSIGNED LONG"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"~&"</nowiki>|#FFB100}}: {{Cl|IF}} t$ = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"UNSIGNED LONG"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"~&"</nowiki>|#FFB100}}: {{Cl|IF}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} t$ = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"_UNSIGNED INTEGER"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"~%"</nowiki>|#FFB100}}: {{Cl|IF}} t$ = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"UNSIGNED INTEGER"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"~%"</nowiki>|#FFB100}}: {{Cl|IF}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} t$ = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"_UNSIGNED _BYTE"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"~%%"</nowiki>|#FFB100}}: {{Cl|IF}} t$ = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"_UNSIGNED BYTE"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"~%%"</nowiki>|#FFB100}}: {{Cl|IF}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} t$ = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"UNSIGNED _BYTE"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"~%%"</nowiki>|#FFB100}}: {{Cl|IF}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} t$ = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"UNSIGNED BYTE"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"~%%"</nowiki>|#FFB100}}: {{Cl|IF}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} t$ = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"_UNSIGNED _OFFSET"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"~%&"</nowiki>|#FFB100}}: {{Cl|IF}} t$ = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"_UNSIGNED OFFSET"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"~%&"</nowiki>|#FFB100}}: {{Cl|IF}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} t$ = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"UNSIGNED _OFFSET"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"~%&"</nowiki>|#FFB100}}: {{Cl|IF}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} t$ = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"UNSIGNED OFFSET"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"~%&"</nowiki>|#FFB100}}: {{Cl|IF}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} t$ = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"_UNSIGNED _INTEGER64"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"~&&"</nowiki>|#FFB100}}: {{Cl|IF}} t$ = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"_UNSIGNED INTEGER64"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"~&&"</nowiki>|#FFB100}}: {{Cl|IF}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} t$ = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"UNSIGNED _INTEGER64"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"~&&"</nowiki>|#FFB100}}: {{Cl|IF}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} t$ = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"UNSIGNED INTEGER64"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"~&&"</nowiki>|#FFB100}}: {{Cl|IF}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} t$ = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"_INTEGER64"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"&&"</nowiki>|#FFB100}}: {{Cl|IF}} t$ = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"INTEGER64"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"&&"</nowiki>|#FFB100}}: {{Cl|IF}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} t$ = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"_OFFSET"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"%&"</nowiki>|#FFB100}}: {{Cl|IF}} t$ = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"OFFSET"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"%&"</nowiki>|#FFB100}}: {{Cl|IF}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} t$ = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"_FLOAT"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"##"</nowiki>|#FFB100}}: {{Cl|IF}} t$ = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"FLOAT"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"##"</nowiki>|#FFB100}}: {{Cl|IF}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} t$ = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    {{Text|<nowiki>' These can have a length after them, so LEFT$() is used</nowiki>|#919191}}
    t2$ = {{Text|<nowiki>"STRING"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"$"</nowiki>|#FFB100}}: {{Cl|IF}} {{Cl|LEFT$}}(t$, {{Cl|LEN}}(t2$)) = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"_UNSIGNED _BIT"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"~`1"</nowiki>|#FFB100}}: {{Cl|IF}} {{Cl|LEFT$}}(t$, {{Cl|LEN}}(t2$)) = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"_UNSIGNED BIT"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"~`1"</nowiki>|#FFB100}}: {{Cl|IF}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|LEFT$}}(t$, {{Cl|LEN}}(t2$)) = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"UNSIGNED _BIT"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"~`1"</nowiki>|#FFB100}}: {{Cl|IF}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|LEFT$}}(t$, {{Cl|LEN}}(t2$)) = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"UNSIGNED BIT"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"~`1"</nowiki>|#FFB100}}: {{Cl|IF}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|LEFT$}}(t$, {{Cl|LEN}}(t2$)) = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"_BIT"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"`1"</nowiki>|#FFB100}}: {{Cl|IF}} {{Cl|LEFT$}}(t$, {{Cl|LEN}}(t2$)) = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    t2$ = {{Text|<nowiki>"BIT"</nowiki>|#FFB100}}: s$ = {{Text|<nowiki>"`1"</nowiki>|#FFB100}}: {{Cl|IF}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|LEFT$}}(t$, {{Cl|LEN}}(t2$)) = t2$ {{Cl|THEN}} {{Cl|GOTO}} t2sfound
    {{Text|Give_Error|#55FF55}} e$: {{Cl|EXIT}} {{Cl|FUNCTION}}
    t2sfound:
    {{Text|type2symbol$|#55FF55}} = s$
    {{Cl|IF}} {{Cl|LEN}}(t2$) <> {{Cl|LEN}}(t$) {{Cl|THEN}}
        {{Cl|IF}} s$ <> {{Text|<nowiki>"$"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} s$ <> {{Text|<nowiki>"~`1"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} s$ <> {{Text|<nowiki>"`1"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} e$: {{Cl|EXIT}} {{Cl|FUNCTION}}
        t$ = {{Cl|RIGHT$}}(t$, {{Cl|LEN}}(t$) - {{Cl|LEN}}(t2$))
        {{Cl|IF}} {{Cl|LEFT$}}(t$, {{Text|3|#F580B1}}) <> {{Text|<nowiki>" * "</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} e$: {{Cl|EXIT}} {{Cl|FUNCTION}}
        t$ = {{Cl|RIGHT$}}(t$, {{Cl|LEN}}(t$) - {{Text|3|#F580B1}})
        {{Cl|IF}} {{Text|isuinteger|#55FF55}}(t$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} e$: {{Cl|EXIT}} {{Cl|FUNCTION}}
        v = {{Cl|VAL}}(t$)
        {{Cl|IF}} v = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} e$: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} s$ <> {{Text|<nowiki>"$"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} v > {{Text|64|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} e$: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} s$ = {{Text|<nowiki>"$"</nowiki>|#FFB100}} {{Cl|THEN}}
            s$ = s$ + {{Text|str2$|#55FF55}}(v)
        {{Cl|ELSE}}
            s$ = {{Cl|LEFT$}}(s$, {{Cl|LEN}}(s$) - {{Text|1|#F580B1}}) + {{Text|str2$|#55FF55}}(v)
        {{Cl|END}} {{Cl|IF}}
        {{Text|type2symbol$|#55FF55}} = s$
    {{Cl|END}} {{Cl|IF}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Text|<nowiki>'Strips away bits/indentifiers which make locating a variables source difficult</nowiki>|#919191}}
{{Cl|FUNCTION}} {{Text|typecomp|#55FF55}} (typ)
    typ2 = typ
    {{Cl|IF}} (typ2 {{Cl|AND (boolean)|AND}} ISINCONVENTIONALMEMORY) {{Cl|THEN}} typ2 = typ2 - ISINCONVENTIONALMEMORY
    {{Text|typecomp|#55FF55}} = typ2
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|typname2typ&|#55FF55}} (t2$)
    typname2typsize = {{Text|0|#F580B1}} {{Text|<nowiki>'the default</nowiki>|#919191}}
    t$ = t2$
    {{Text|<nowiki>'symbol?</nowiki>|#919191}}
    ts$ = t$
    {{Cl|IF}} ts$ = {{Text|<nowiki>"$"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|typname2typ&|#55FF55}} = STRINGTYPE: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} ts$ = {{Text|<nowiki>"!"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|typname2typ&|#55FF55}} = SINGLETYPE: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} ts$ = {{Text|<nowiki>"#"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|typname2typ&|#55FF55}} = DOUBLETYPE: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} ts$ = {{Text|<nowiki>"##"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|typname2typ&|#55FF55}} = FLOATTYPE: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Text|<nowiki>'fixed length string?</nowiki>|#919191}}
    {{Cl|IF}} {{Cl|LEFT$}}(ts$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"$"</nowiki>|#FFB100}} {{Cl|THEN}}
        n$ = {{Cl|RIGHT$}}(ts$, {{Cl|LEN}}(ts$) - {{Text|1|#F580B1}})
        {{Cl|IF}} {{Text|isuinteger|#55FF55}}(n$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid index after STRING * type"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        b = {{Cl|VAL}}(n$)
        {{Cl|IF}} b = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid index after STRING * type"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        typname2typsize = b
        {{Text|typname2typ&|#55FF55}} = STRINGTYPE + ISFIXEDLENGTH
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'unsigned?</nowiki>|#919191}}
    {{Cl|IF}} {{Cl|LEFT$}}(ts$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"~"</nowiki>|#FFB100}} {{Cl|THEN}} unsgn = {{Text|1|#F580B1}}: ts$ = {{Cl|RIGHT$}}(ts$, {{Cl|LEN}}(ts$) - {{Text|1|#F580B1}})
    {{Text|<nowiki>'bit-type?</nowiki>|#919191}}
    {{Cl|IF}} {{Cl|LEFT$}}(ts$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"`"</nowiki>|#FFB100}} {{Cl|THEN}}
        n$ = {{Cl|RIGHT$}}(ts$, {{Cl|LEN}}(ts$) - {{Text|1|#F580B1}})
        b = {{Text|1|#F580B1}}
        {{Cl|IF}} n$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} {{Text|isuinteger|#55FF55}}(n$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid index after _BIT type"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            b = {{Cl|VAL}}(n$)
            {{Cl|IF}} b > {{Text|64|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid index after _BIT type"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} unsgn {{Cl|THEN}} {{Text|typname2typ&|#55FF55}} = UBITTYPE + (b - {{Text|1|#F580B1}}) {{Cl|ELSE}} {{Text|typname2typ&|#55FF55}} = BITTYPE + (b - {{Text|1|#F580B1}})
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    t = {{Text|0|#F580B1}}
    {{Cl|IF}} ts$ = {{Text|<nowiki>"%%"</nowiki>|#FFB100}} {{Cl|THEN}} t = BYTETYPE
    {{Cl|IF}} ts$ = {{Text|<nowiki>"%"</nowiki>|#FFB100}} {{Cl|THEN}} t = INTEGERTYPE
    {{Cl|IF}} ts$ = {{Text|<nowiki>"&"</nowiki>|#FFB100}} {{Cl|THEN}} t = LONGTYPE
    {{Cl|IF}} ts$ = {{Text|<nowiki>"&&"</nowiki>|#FFB100}} {{Cl|THEN}} t = INTEGER64TYPE
    {{Cl|IF}} ts$ = {{Text|<nowiki>"%&"</nowiki>|#FFB100}} {{Cl|THEN}} t = OFFSETTYPE
    {{Cl|IF}} t {{Cl|THEN}}
        {{Cl|IF}} unsgn {{Cl|THEN}} t = t + ISUNSIGNED
        {{Text|typname2typ&|#55FF55}} = t: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'not a valid symbol</nowiki>|#919191}}
    {{Text|<nowiki>'type name?</nowiki>|#919191}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(t$)
        {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(t$, i, {{Text|1|#F580B1}}) = sp {{Cl|THEN}} {{Cl|MID$}}(t$, i, {{Text|1|#F580B1}}) = {{Text|<nowiki>" "</nowiki>|#FFB100}}
    {{Cl|NEXT}}
    {{Cl|IF}} t$ = {{Text|<nowiki>"STRING"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|typname2typ&|#55FF55}} = STRINGTYPE: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} {{Cl|LEFT$}}(t$, {{Text|9|#F580B1}}) = {{Text|<nowiki>"STRING * "</nowiki>|#FFB100}} {{Cl|THEN}}
        n$ = {{Cl|RIGHT$}}(t$, {{Cl|LEN}}(t$) - {{Text|9|#F580B1}})
        {{Text|<nowiki>'constant check 2011</nowiki>|#919191}}
        hashfound = {{Text|0|#F580B1}}
        hashname$ = n$
        hashchkflags = HASHFLAG_CONSTANT
        hashres = {{Text|HashFindRev|#55FF55}}(hashname$, hashchkflags, hashresflags, hashresref)
        {{Cl|DO}} {{Cl|WHILE}} hashres
            {{Cl|IF}} constsubfunc(hashresref) = subfuncn {{Cl|OR (boolean)|OR}} constsubfunc(hashresref) = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} constdefined(hashresref) {{Cl|THEN}}
                    hashfound = {{Text|1|#F580B1}}
                    {{Cl|EXIT}} {{Cl|DO}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} hashres <> {{Text|1|#F580B1}} {{Cl|THEN}} hashres = {{Text|HashFindCont|#55FF55}}(hashresflags, hashresref) {{Cl|ELSE}} hashres = {{Text|0|#F580B1}}
        {{Cl|LOOP}}
        {{Cl|IF}} hashfound {{Cl|THEN}}
            i2 = hashresref
            t = consttype(i2)
            {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected STRING * numeric-constant"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Text|<nowiki>'convert value to general formats</nowiki>|#919191}}
            {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISFLOAT {{Cl|THEN}}
                v## = constfloat(i2)
                v&& = v##
                v~&& = v&&
            {{Cl|ELSE}}
                {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISUNSIGNED {{Cl|THEN}}
                    v~&& = constuinteger(i2)
                    v&& = v~&&
                    v## = v&&
                {{Cl|ELSE}}
                    v&& = constinteger(i2)
                    v## = v&&
                    v~&& = v&&
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} v&& < {{Text|1|#F580B1}} {{Cl|OR (boolean)|OR}} v&& > {{Text|9999999999|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"STRING * out-of-range constant"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            b = v&&
            {{Cl|GOTO}} constantlenstr
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} {{Text|isuinteger|#55FF55}}(n$) = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} {{Cl|LEN}}(n$) > {{Text|10|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid number/constant after STRING * type"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        b = {{Cl|VAL}}(n$)
        {{Cl|IF}} b = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} {{Cl|LEN}}(n$) > {{Text|10|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid number after STRING * type"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        constantlenstr:
        typname2typsize = b
        {{Text|typname2typ&|#55FF55}} = STRINGTYPE + ISFIXEDLENGTH
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} t$ = {{Text|<nowiki>"SINGLE"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|typname2typ&|#55FF55}} = SINGLETYPE: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} t$ = {{Text|<nowiki>"DOUBLE"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|typname2typ&|#55FF55}} = DOUBLETYPE: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} t$ = {{Text|<nowiki>"_FLOAT"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (t$ = {{Text|<nowiki>"FLOAT"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}} {{Text|typname2typ&|#55FF55}} = FLOATTYPE: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} {{Cl|LEFT$}}(t$, {{Text|10|#F580B1}}) = {{Text|<nowiki>"_UNSIGNED "</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} ({{Cl|LEFT$}}(t$, {{Text|9|#F580B1}}) = {{Text|<nowiki>"UNSIGNED "</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}}
        u = {{Text|1|#F580B1}}
        t$ = {{Cl|MID$ (function)|MID$}}(t$, {{Cl|INSTR}}(t$, {{Cl|CHR$}}({{Text|32|#F580B1}})) + {{Text|1|#F580B1}})
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} {{Cl|LEFT$}}(t$, {{Text|4|#F580B1}}) = {{Text|<nowiki>"_BIT"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} ({{Cl|LEFT$}}(t$, {{Text|3|#F580B1}}) = {{Text|<nowiki>"BIT"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}}
        {{Cl|IF}} t$ = {{Text|<nowiki>"_BIT"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (t$ = {{Text|<nowiki>"BIT"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}}
            {{Cl|IF}} u {{Cl|THEN}} {{Text|typname2typ&|#55FF55}} = UBITTYPE {{Cl|ELSE}} {{Text|typname2typ&|#55FF55}} = BITTYPE
            {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} {{Cl|LEFT$}}(t$, {{Text|7|#F580B1}}) <> {{Text|<nowiki>"_BIT * "</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} {{Cl|LEFT$}}(t$, {{Text|6|#F580B1}}) <> {{Text|<nowiki>"BIT * "</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected "</nowiki>|#FFB100}} + qb64prefix$ + {{Text|<nowiki>"BIT * number"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} {{Cl|LEFT$}}(t$, {{Text|4|#F580B1}}) = {{Text|<nowiki>"_BIT"</nowiki>|#FFB100}} {{Cl|THEN}}
            n$ = {{Cl|RIGHT$}}(t$, {{Cl|LEN}}(t$) - {{Text|7|#F580B1}})
        {{Cl|ELSE}}
            n$ = {{Cl|RIGHT$}}(t$, {{Cl|LEN}}(t$) - {{Text|6|#F580B1}})
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} {{Text|isuinteger|#55FF55}}(n$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid size after "</nowiki>|#FFB100}} + qb64prefix$ + {{Text|<nowiki>"BIT *"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        b = {{Cl|VAL}}(n$)
        {{Cl|IF}} b = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} b > {{Text|64|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid size after "</nowiki>|#FFB100}} + qb64prefix$ + {{Text|<nowiki>"BIT *"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        t = BITTYPE - {{Text|1|#F580B1}} + b: {{Cl|IF}} u {{Cl|THEN}} t = t + ISUNSIGNED
        {{Text|typname2typ&|#55FF55}} = t
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    t = {{Text|0|#F580B1}}
    {{Cl|IF}} t$ = {{Text|<nowiki>"_BYTE"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (t$ = {{Text|<nowiki>"BYTE"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}} t = BYTETYPE
    {{Cl|IF}} t$ = {{Text|<nowiki>"INTEGER"</nowiki>|#FFB100}} {{Cl|THEN}} t = INTEGERTYPE
    {{Cl|IF}} t$ = {{Text|<nowiki>"LONG"</nowiki>|#FFB100}} {{Cl|THEN}} t = LONGTYPE
    {{Cl|IF}} t$ = {{Text|<nowiki>"_INTEGER64"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (t$ = {{Text|<nowiki>"INTEGER64"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}} t = INTEGER64TYPE
    {{Cl|IF}} t$ = {{Text|<nowiki>"_OFFSET"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} (t$ = {{Text|<nowiki>"OFFSET"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}}) {{Cl|THEN}} t = OFFSETTYPE
    {{Cl|IF}} t {{Cl|THEN}}
        {{Cl|IF}} u {{Cl|THEN}} t = t + ISUNSIGNED
        {{Text|typname2typ&|#55FF55}} = t
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} u {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}} {{Text|<nowiki>'_UNSIGNED (nothing)</nowiki>|#919191}}
    {{Text|<nowiki>'UDT?</nowiki>|#919191}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} lasttype
        {{Cl|IF}} t$ = {{Cl|RTRIM$}}(udtxname(i)) {{Cl|THEN}}
            {{Text|typname2typ&|#55FF55}} = ISUDT + ISPOINTER + i
            {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|ELSEIF}} {{Cl|RTRIM$}}(udtxname(i)) = {{Text|<nowiki>"_MEM"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} t$ = {{Text|<nowiki>"MEM"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|THEN}}
            {{Text|typname2typ&|#55FF55}} = ISUDT + ISPOINTER + i
            {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|NEXT}}
    {{Text|<nowiki>'return 0 (failed)</nowiki>|#919191}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|uniquenumber&|#55FF55}}
    uniquenumbern = uniquenumbern + {{Text|1|#F580B1}}
    {{Text|uniquenumber&|#55FF55}} = uniquenumbern
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|validlabel|#55FF55}} (LABEL2$)
    create = CreatingLabel: CreatingLabel = {{Text|0|#F580B1}}
    {{Text|validlabel|#55FF55}} = {{Text|0|#F580B1}}
    {{Cl|IF}} {{Cl|LEN}}(LABEL2$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
    clabel$ = LABEL2$
    label$ = {{Cl|UCASE$}}(LABEL2$)
    n = {{Text|numelements|#55FF55}}(label$)
    {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Text|<nowiki>'Note: Reserved words and internal sub/function names are invalid</nowiki>|#919191}}
        hashres = {{Text|HashFind|#55FF55}}(label$, HASHFLAG_RESERVED + HASHFLAG_SUB + HASHFLAG_FUNCTION, hashresflags, hashresref)
        {{Cl|DO}} {{Cl|WHILE}} hashres
            {{Cl|IF}} hashresflags {{Cl|AND (boolean)|AND}} (HASHFLAG_SUB + HASHFLAG_FUNCTION) {{Cl|THEN}}
                {{Cl|IF}} ids(hashresref).internal_subfunc {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|IF}} hashresflags {{Cl|AND (boolean)|AND}} HASHFLAG_SUB {{Cl|THEN}} {{Text|<nowiki>'could be a label or a sub call!</nowiki>|#919191}}
                    {{Text|<nowiki>'analyze format</nowiki>|#919191}}
                    {{Cl|IF}} {{Cl|ASC (function)|ASC}}(ids(hashresref).specialformat) = {{Text|32|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} ids(hashresref).args = {{Text|0|#F580B1}} {{Cl|THEN}} onecommandsub = {{Text|1|#F580B1}} {{Cl|ELSE}} onecommandsub = {{Text|0|#F580B1}}
                    {{Cl|ELSE}}
                        {{Cl|IF}} {{Cl|ASC (function)|ASC}}(ids(hashresref).specialformat) <> {{Text|91|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'"["</nowiki>|#919191}}
                            onecommandsub = {{Text|0|#F580B1}}
                        {{Cl|ELSE}}
                            onecommandsub = {{Text|1|#F580B1}}
                            a$ = {{Cl|RTRIM$}}(ids(hashresref).specialformat)
                            b = {{Text|1|#F580B1}}
                            {{Cl|FOR}} x = {{Text|2|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(a$)
                                a = {{Cl|ASC (function)|ASC}}(a$, x)
                                {{Cl|IF}} a = {{Text|91|#F580B1}} {{Cl|THEN}} b = b + {{Text|1|#F580B1}}
                                {{Cl|IF}} a = {{Text|93|#F580B1}} {{Cl|THEN}} b = b - {{Text|1|#F580B1}}
                                {{Cl|IF}} b = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} x <> {{Cl|LEN}}(a$) {{Cl|THEN}} onecommandsub = {{Text|0|#F580B1}}: {{Cl|EXIT}} {{Cl|FOR}}
                            {{Cl|NEXT}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} create <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} onecommandsub = {{Text|1|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} {{Cl|INSTR}}(SubNameLabels$, sp + {{Cl|UCASE$}}(label$) + sp) = {{Text|0|#F580B1}} {{Cl|THEN}} PossibleSubNameLabels$ = PossibleSubNameLabels$ + {{Cl|UCASE$}}(label$) + sp: {{Cl|EXIT}} {{Cl|FUNCTION}} {{Text|<nowiki>'treat as sub call</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'sub name</nowiki>|#919191}}
            {{Cl|ELSE}}
                {{Text|<nowiki>'reserved</nowiki>|#919191}}
                {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} hashres <> {{Text|1|#F580B1}} {{Cl|THEN}} hashres = {{Text|HashFindCont|#55FF55}}(hashresflags, hashresref) {{Cl|ELSE}} hashres = {{Text|0|#F580B1}}
        {{Cl|LOOP}}
        {{Text|<nowiki>'Numeric label?</nowiki>|#919191}}
        {{Text|<nowiki>'quasi numbers are possible, but:</nowiki>|#919191}}
        {{Text|<nowiki>'a) They may only have one decimal place</nowiki>|#919191}}
        {{Text|<nowiki>'b) They must be typed with the exact same characters to match</nowiki>|#919191}}
        t$ = label$
        {{Text|<nowiki>'numeric?</nowiki>|#919191}}
        a = {{Cl|ASC (function)|ASC}}(t$)
        {{Cl|IF}} (a >= {{Text|48|#F580B1}} {{Cl|AND (boolean)|AND}} a <= {{Text|57|#F580B1}}) {{Cl|OR (boolean)|OR}} a = {{Text|46|#F580B1}} {{Cl|THEN}}
            {{Text|<nowiki>'refer to original formatting if possible (eg. 1.10 not 1.1)</nowiki>|#919191}}
            x = {{Cl|INSTR}}(t$, {{Cl|CHR$}}({{Text|44|#F580B1}}))
            {{Cl|IF}} x {{Cl|THEN}}
                t$ = {{Cl|RIGHT$}}(t$, {{Cl|LEN}}(t$) - x)
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'note: The symbols ! and # are valid trailing symbols in QBASIC, regardless of the number's size,</nowiki>|#919191}}
            {{Text|<nowiki>'      so they are allowed in QB64 for compatibility reasons</nowiki>|#919191}}
            addsymbol$ = {{Text|removesymbol$|#55FF55}}(t$)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|IF}} {{Cl|LEN}}(addsymbol$) {{Cl|THEN}}
                {{Cl|IF}} {{Cl|INSTR}}(addsymbol$, {{Text|<nowiki>"$"</nowiki>|#FFB100}}) {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|IF}} addsymbol$ <> {{Text|<nowiki>"#"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} addsymbol$ <> {{Text|<nowiki>"!"</nowiki>|#FFB100}} {{Cl|THEN}} addsymbol$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} a = {{Text|46|#F580B1}} {{Cl|THEN}} dp = {{Text|1|#F580B1}}
            {{Cl|FOR}} x = {{Text|2|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(t$)
                a = {{Cl|ASC (function)|ASC}}({{Cl|MID$ (function)|MID$}}(t$, x, {{Text|1|#F580B1}}))
                {{Cl|IF}} a = {{Text|46|#F580B1}} {{Cl|THEN}} dp = dp + {{Text|1|#F580B1}}
                {{Cl|IF}} (a < {{Text|48|#F580B1}} {{Cl|OR (boolean)|OR}} a > {{Text|57|#F580B1}}) {{Cl|AND (boolean)|AND}} a <> {{Text|46|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}} {{Text|<nowiki>'not numeric</nowiki>|#919191}}
            {{Cl|NEXT}} x
            {{Cl|IF}} dp > {{Text|1|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}} {{Text|<nowiki>'too many decimal points</nowiki>|#919191}}
            {{Cl|IF}} dp = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|LEN}}(t$) = {{Text|1|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}} {{Text|<nowiki>'cant have '.' as a label</nowiki>|#919191}}
            tlayout$ = t$ + addsymbol$
            i = {{Cl|INSTR}}(t$, {{Text|<nowiki>"."</nowiki>|#FFB100}}): {{Cl|IF}} i {{Cl|THEN}} {{Cl|MID$}}(t$, i, {{Text|1|#F580B1}}) = {{Text|<nowiki>"p"</nowiki>|#FFB100}}
            {{Cl|IF}} addsymbol$ = {{Text|<nowiki>"#"</nowiki>|#FFB100}} {{Cl|THEN}} t$ = t$ + {{Text|<nowiki>"d"</nowiki>|#FFB100}}
            {{Cl|IF}} addsymbol$ = {{Text|<nowiki>"!"</nowiki>|#FFB100}} {{Cl|THEN}} t$ = t$ + {{Text|<nowiki>"s"</nowiki>|#FFB100}}
            {{Cl|IF}} {{Cl|LEN}}(t$) > {{Text|40|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
            LABEL2$ = t$
            {{Text|validlabel|#55FF55}} = {{Text|1|#F580B1}}
            {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'numeric</nowiki>|#919191}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'n=1</nowiki>|#919191}}
    {{Text|<nowiki>'Alpha-numeric label?</nowiki>|#919191}}
    {{Text|<nowiki>'Build label</nowiki>|#919191}}
    {{Text|<nowiki>'structure check (???.???.???.???)</nowiki>|#919191}}
    {{Cl|IF}} (n {{Cl|AND (boolean)|AND}} {{Text|1|#F580B1}}) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}} {{Text|<nowiki>'must be an odd number of elements</nowiki>|#919191}}
    {{Cl|FOR}} nx = {{Text|2|#F580B1}} {{Cl|TO}} n - {{Text|1|#F580B1}} {{Cl|STEP}} {{Text|2|#F580B1}}
        a$ = {{Text|getelement$|#55FF55}}(LABEL2$, nx)
        {{Cl|IF}} a$ <> {{Text|<nowiki>"."</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}} {{Text|<nowiki>'every 2nd element must be a period</nowiki>|#919191}}
    {{Cl|NEXT}}
    {{Text|<nowiki>'cannot begin with numeric</nowiki>|#919191}}
    c = {{Cl|ASC (function)|ASC}}(clabel$): {{Cl|IF}} c >= {{Text|48|#F580B1}} {{Cl|AND (boolean)|AND}} c <= {{Text|57|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Text|<nowiki>'elements check</nowiki>|#919191}}
    label3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
    {{Cl|FOR}} nx = {{Text|1|#F580B1}} {{Cl|TO}} n {{Cl|STEP}} {{Text|2|#F580B1}}
        label$ = {{Text|getelement$|#55FF55}}(clabel$, nx)
        {{Text|<nowiki>'alpha-numeric?</nowiki>|#919191}}
        {{Cl|FOR}} x = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(label$)
            {{Cl|IF}} alphanumeric({{Cl|ASC (function)|ASC}}(label$, x)) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|NEXT}}
        {{Text|<nowiki>'build label</nowiki>|#919191}}
        {{Cl|IF}} label3$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} label3$ = {{Cl|UCASE$}}(label$): tlayout$ = label$ {{Cl|ELSE}} label3$ = label3$ + fix046$ + {{Cl|UCASE$}}(label$): tlayout$ = tlayout$ + {{Text|<nowiki>"."</nowiki>|#FFB100}} + label$
    {{Cl|NEXT}} nx
    {{Text|validlabel|#55FF55}} = {{Text|1|#F580B1}}
    LABEL2$ = label3$
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|SUB}} {{Text|xend|#55FF55}}
    {{Cl|IF}} vWatchOn = {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Text|<nowiki>'check if closedmain = 0 in case a main module ends in an include.</nowiki>|#919191}}
        {{Cl|IF}} (inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} closedmain = {{Text|0|#F580B1}}) {{Cl|THEN}} {{Text|vWatchAddLabel|#55FF55}} {{Text|0|#F580B1}}, {{Text|-1|#F580B1}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"*__LONG_VWATCH_LINENUMBER= 0; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);"</nowiki>|#FFB100}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_end();"</nowiki>|#FFB100}}
{{Cl|END}} {{Cl|SUB}}
{{Cl|SUB}} {{Text|xfileprint|#55FF55}} (a$, ca$, n)
    u$ = {{Text|str2$|#55FF55}}({{Text|uniquenumber|#55FF55}})
    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tab_spc_cr_size=2;"</nowiki>|#FFB100}}
    {{Cl|IF}} n = {{Text|2|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected # ... , ..."</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
    a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
    b = {{Text|0|#F580B1}}
    {{Cl|FOR}} i = {{Text|3|#F580B1}} {{Cl|TO}} n
        a2$ = {{Text|getelement$|#55FF55}}(ca$, i)
        {{Cl|IF}} a2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} b = b + {{Text|1|#F580B1}}
        {{Cl|IF}} a2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} b = b - {{Text|1|#F580B1}}
        {{Cl|IF}} a2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} b = {{Text|0|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected # ... , ..."</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
            {{Cl|GOTO}} printgotfn
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a3$ = a2$ {{Cl|ELSE}} a3$ = a3$ + sp + a2$
    {{Cl|NEXT}}
    {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected # ... ,"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
    printgotfn:
    e$ = {{Text|fixoperationorder$|#55FF55}}(a3$)
    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
    l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Print"</nowiki>|#FFB100}}) + sp + {{Text|<nowiki>"#"</nowiki>|#FFB100}} + sp2 + tlayout$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}}
    e$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|64&|#F580B1}})
    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tab_fileno=tmp_fileno="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (new_error) goto skip"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
    i = i + {{Text|1|#F580B1}}
    {{Text|<nowiki>'PRINT USING? (file)</nowiki>|#919191}}
    {{Cl|IF}} n >= i {{Cl|THEN}}
        {{Cl|IF}} {{Text|getelement|#55FF55}}(a$, i) = {{Text|<nowiki>"USING"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Text|<nowiki>'get format string</nowiki>|#919191}}
            fpujump:
            l$ = l$ + sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Using"</nowiki>|#FFB100}})
            e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: b = {{Text|0|#F580B1}}: puformat$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Cl|FOR}} i = i + {{Text|1|#F580B1}} {{Cl|TO}} n
                a2$ = {{Text|getelement|#55FF55}}(ca$, i)
                {{Cl|IF}} a2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} b = b + {{Text|1|#F580B1}}
                {{Cl|IF}} a2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} b = b - {{Text|1|#F580B1}}
                {{Cl|IF}} b = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} a2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected PRINT USING #filenumber, formatstring ; ..."</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
                    {{Cl|IF}} a2$ = {{Text|<nowiki>";"</nowiki>|#FFB100}} {{Cl|THEN}}
                        e$ = {{Text|fixoperationorder$|#55FF55}}(e$)
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                        l$ = l$ + sp + tlayout$ + sp2 + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                        e$ = {{Text|evaluate|#55FF55}}(e$, typ)
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                        {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer|#55FF55}}(e$, typ, {{Text|0|#F580B1}})
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                        {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected PRINT USING #filenumber, formatstring ; ..."</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
                        puformat$ = e$
                        {{Cl|EXIT}} {{Cl|FOR}}
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>';</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'b</nowiki>|#919191}}
                {{Cl|IF}} {{Cl|LEN}}(e$) {{Cl|THEN}} e$ = e$ + sp + a2$ {{Cl|ELSE}} e$ = a2$
            {{Cl|NEXT}}
            {{Cl|IF}} puformat$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected PRINT USING #filenumber, formatstring ; ..."</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
            {{Cl|IF}} i = n {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected PRINT USING #filenumber, formatstring ; ..."</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
            {{Text|<nowiki>'create build string</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tqbs=qbs_new(0,0);"</nowiki>|#FFB100}}
            {{Text|<nowiki>'set format start/index variable</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_long=0;"</nowiki>|#FFB100}} {{Text|<nowiki>'scan format from beginning</nowiki>|#919191}}
            {{Text|<nowiki>'create string to hold format in for multiple references</nowiki>|#919191}}
            puf$ = {{Text|<nowiki>"print_using_format"</nowiki>|#FFB100}} + u$
            {{Cl|IF}} subfunc = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"static qbs *"</nowiki>|#FFB100}} + puf$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"qbs *"</nowiki>|#FFB100}} + puf$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, puf$ + {{Text|<nowiki>"=qbs_new(0,0); qbs_set("</nowiki>|#FFB100}} + puf$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + puformat$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (new_error) goto skip"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
            {{Text|<nowiki>'print expressions</nowiki>|#919191}}
            b = {{Text|0|#F580B1}}
            e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            last = {{Text|0|#F580B1}}
            {{Cl|FOR}} i = i + {{Text|1|#F580B1}} {{Cl|TO}} n
                a2$ = {{Text|getelement|#55FF55}}(ca$, i)
                {{Cl|IF}} a2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} b = b + {{Text|1|#F580B1}}
                {{Cl|IF}} a2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} b = b - {{Text|1|#F580B1}}
                {{Cl|IF}} b = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} a2$ = {{Text|<nowiki>";"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} a2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}}
                        fprintulast:
                        e$ = {{Text|fixoperationorder$|#55FF55}}(e$)
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                        {{Cl|IF}} last {{Cl|THEN}} l$ = l$ + sp + tlayout$ {{Cl|ELSE}} l$ = l$ + sp + tlayout$ + sp2 + a2$
                        e$ = {{Text|evaluate|#55FF55}}(e$, typ)
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                        {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer|#55FF55}}(e$, typ, {{Text|0|#F580B1}})
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                        {{Cl|IF}} typ {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                            {{Cl|IF}} {{Cl|LEFT$}}(e$, {{Text|9|#F580B1}}) = {{Text|<nowiki>"func_tab("</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} {{Cl|LEFT$}}(e$, {{Text|9|#F580B1}}) = {{Text|<nowiki>"func_spc("</nowiki>|#FFB100}} {{Cl|THEN}}
                                {{Text|<nowiki>'TAB/SPC exception</nowiki>|#919191}}
                                {{Text|<nowiki>'note: position in format-string must be maintained</nowiki>|#919191}}
                                {{Text|<nowiki>'-print any string up until now</nowiki>|#919191}}
                                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_file_print(tmp_fileno,tqbs,0,0,0);"</nowiki>|#FFB100}}
                                {{Text|<nowiki>'-print e$</nowiki>|#919191}}
                                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_set(tqbs,"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (new_error) goto skip_pu"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_file_print(tmp_fileno,tqbs,0,0,0);"</nowiki>|#FFB100}}
                                {{Text|<nowiki>'-set length of tqbs to 0</nowiki>|#919191}}
                                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tqbs->len=0;"</nowiki>|#FFB100}}
                            {{Cl|ELSE}}
                                {{Text|<nowiki>'regular string</nowiki>|#919191}}
                                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_long=print_using("</nowiki>|#FFB100}} + puf$ + {{Text|<nowiki>",tmp_long,tqbs,"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|ELSE}} {{Text|<nowiki>'not a string</nowiki>|#919191}}
                            {{Cl|IF}} typ {{Cl|AND (boolean)|AND}} ISFLOAT {{Cl|THEN}}
                                {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|32|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_long=print_using_single("</nowiki>|#FFB100}} + puf$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>",tmp_long,tqbs);"</nowiki>|#FFB100}}
                                {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|64|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_long=print_using_double("</nowiki>|#FFB100}} + puf$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>",tmp_long,tqbs);"</nowiki>|#FFB100}}
                                {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) > {{Text|64|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_long=print_using_float("</nowiki>|#FFB100}} + puf$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>",tmp_long,tqbs);"</nowiki>|#FFB100}}
                            {{Cl|ELSE}}
                                {{Cl|IF}} ((typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|64|#F580B1}}) {{Cl|AND (boolean)|AND}} (typ {{Cl|AND (boolean)|AND}} ISUNSIGNED) <> {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_long=print_using_uinteger64("</nowiki>|#FFB100}} + puf$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>",tmp_long,tqbs);"</nowiki>|#FFB100}}
                                {{Cl|ELSE}}
                                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_long=print_using_integer64("</nowiki>|#FFB100}} + puf$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>",tmp_long,tqbs);"</nowiki>|#FFB100}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'string/not string</nowiki>|#919191}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (new_error) goto skip_pu"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                        e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                        {{Cl|IF}} last {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}}
                        {{Cl|GOTO}} fprintunext
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} {{Cl|LEN}}(e$) {{Cl|THEN}} e$ = e$ + sp + a2$ {{Cl|ELSE}} e$ = a2$
                fprintunext:
            {{Cl|NEXT}}
            {{Cl|IF}} e$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a2$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: last = {{Text|1|#F580B1}}: {{Cl|GOTO}} fprintulast
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"skip_pu"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>":"</nowiki>|#FFB100}}
            {{Text|<nowiki>'check for errors</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (new_error){"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"g_tmp_long=new_error; new_error=0; sub_file_print(tmp_fileno,tqbs,0,0,0); new_error=g_tmp_long;"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}else{"</nowiki>|#FFB100}}
            {{Cl|IF}} a2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} a2$ = {{Text|<nowiki>";"</nowiki>|#FFB100}} {{Cl|THEN}} nl = {{Text|0|#F580B1}} {{Cl|ELSE}} nl = {{Text|1|#F580B1}} {{Text|<nowiki>'note: a2$ is set to the last element of a$</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_file_print(tmp_fileno,tqbs,0,0,"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(nl) + {{Text|<nowiki>");"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_free(tqbs);"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_free("</nowiki>|#FFB100}} + puf$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"skip"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>":"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, cleanupstringprocessingcall$ + {{Text|<nowiki>"0);"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tab_spc_cr_size=1;"</nowiki>|#FFB100}}
            tlayout$ = l$
            {{Cl|EXIT}} {{Cl|SUB}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'end of print using code</nowiki>|#919191}}
    {{Cl|IF}} i > n {{Cl|THEN}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_file_print(tmp_fileno,nothingstring,0,0,1);"</nowiki>|#FFB100}}
        {{Cl|GOTO}} printblankline
    {{Cl|END}} {{Cl|IF}}
    b = {{Text|0|#F580B1}}
    e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
    last = {{Text|0|#F580B1}}
    {{Cl|FOR}} i = i {{Cl|TO}} n
        a2$ = {{Text|getelement|#55FF55}}(ca$, i)
        {{Cl|IF}} a2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} b = b + {{Text|1|#F580B1}}
        {{Cl|IF}} a2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} b = b - {{Text|1|#F580B1}}
        {{Cl|IF}} b = {{Text|0|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} a2$ = {{Text|<nowiki>";"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} a2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} {{Cl|UCASE$}}(a2$) = {{Text|<nowiki>"USING"</nowiki>|#FFB100}} {{Cl|THEN}}
                printfilelast:
                {{Cl|IF}} {{Cl|UCASE$}}(a2$) = {{Text|<nowiki>"USING"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} e$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} gotofpu = {{Text|1|#F580B1}} {{Cl|ELSE}} {{Cl|GOTO}} fpujump
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} a2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}} usetab = {{Text|1|#F580B1}} {{Cl|ELSE}} usetab = {{Text|0|#F580B1}}
                {{Cl|IF}} last = {{Text|1|#F580B1}} {{Cl|THEN}} newline = {{Text|1|#F580B1}} {{Cl|ELSE}} newline = {{Text|0|#F580B1}}
                extraspace = {{Text|0|#F580B1}}
                {{Cl|IF}} {{Cl|LEN}}(e$) {{Cl|THEN}}
                    ebak$ = e$
                    pnrtnum = {{Text|0|#F580B1}}
                    printfilenumber:
                    e$ = {{Text|fixoperationorder$|#55FF55}}(e$)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                    {{Cl|IF}} pnrtnum = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} last {{Cl|THEN}} l$ = l$ + sp + tlayout$ {{Cl|ELSE}} l$ = l$ + sp + tlayout$ + sp2 + a2$
                    {{Cl|END}} {{Cl|IF}}
                    e$ = {{Text|evaluate|#55FF55}}(e$, typ)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        e$ = {{Text|<nowiki>"STR$"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp + ebak$ + sp + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                        extraspace = {{Text|1|#F580B1}}
                        pnrtnum = {{Text|1|#F580B1}}
                        {{Cl|GOTO}} printfilenumber {{Text|<nowiki>'force re-evaluation</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer|#55FF55}}(e$, typ, {{Text|0|#F580B1}})
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                    {{Text|<nowiki>'format: string, (1/0) extraspace, (1/0) tab, (1/0)begin a new line</nowiki>|#919191}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_file_print(tmp_fileno,"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Cl|STR$}}(extraspace) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Cl|STR$}}(usetab) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Cl|STR$}}(newline) + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                {{Cl|ELSE}} {{Text|<nowiki>'len(e$)=0</nowiki>|#919191}}
                    {{Cl|IF}} a2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}} l$ = l$ + sp + a2$
                    {{Cl|IF}} a2$ = {{Text|<nowiki>";"</nowiki>|#FFB100}} {{Cl|THEN}}
                        {{Cl|IF}} {{Cl|RIGHT$}}(l$, {{Text|1|#F580B1}}) <> {{Text|<nowiki>";"</nowiki>|#FFB100}} {{Cl|THEN}} l$ = l$ + sp + a2$ {{Text|<nowiki>'concat ;; to ;</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} usetab {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_file_print(tmp_fileno,nothingstring,0,1,0);"</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'len(e$)</nowiki>|#919191}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (new_error) goto skip"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                {{Cl|IF}} gotofpu {{Cl|THEN}} {{Cl|GOTO}} fpujump
                {{Cl|IF}} last {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}}
                {{Cl|GOTO}} printfilenext
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>', or ;</nowiki>|#919191}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'b=0</nowiki>|#919191}}
        {{Cl|IF}} e$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} e$ = e$ + sp + a2$ {{Cl|ELSE}} e$ = a2$
        printfilenext:
    {{Cl|NEXT}}
    {{Cl|IF}} e$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a2$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: last = {{Text|1|#F580B1}}: {{Cl|GOTO}} printfilelast
    printblankline:
    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"skip"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>":"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, cleanupstringprocessingcall$ + {{Text|<nowiki>"0);"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tab_spc_cr_size=1;"</nowiki>|#FFB100}}
    tlayout$ = l$
{{Cl|END}} {{Cl|SUB}}
{{Cl|SUB}} {{Text|xfilewrite|#55FF55}} (ca$, n)
    l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Write"</nowiki>|#FFB100}}) + sp + {{Text|<nowiki>"#"</nowiki>|#FFB100}}
    u$ = {{Text|str2$|#55FF55}}({{Text|uniquenumber|#55FF55}})
    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tab_spc_cr_size=2;"</nowiki>|#FFB100}}
    {{Cl|IF}} n = {{Text|2|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected # ..."</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
    a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
    b = {{Text|0|#F580B1}}
    {{Cl|FOR}} i = {{Text|3|#F580B1}} {{Cl|TO}} n
        a2$ = {{Text|getelement$|#55FF55}}(ca$, i)
        {{Cl|IF}} a2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} b = b + {{Text|1|#F580B1}}
        {{Cl|IF}} a2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} b = b - {{Text|1|#F580B1}}
        {{Cl|IF}} a2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} b = {{Text|0|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected # ... , ..."</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
            {{Cl|GOTO}} writegotfn
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a3$ = a2$ {{Cl|ELSE}} a3$ = a3$ + sp + a2$
    {{Cl|NEXT}}
    {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected # ... ,"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
    writegotfn:
    e$ = {{Text|fixoperationorder$|#55FF55}}(a3$)
    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
    l$ = l$ + sp2 + tlayout$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}}
    e$ = {{Text|evaluatetotyp|#55FF55}}(e$, {{Text|64&|#F580B1}})
    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tab_fileno=tmp_fileno="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (new_error) goto skip"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
    i = i + {{Text|1|#F580B1}}
    {{Cl|IF}} i > n {{Cl|THEN}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_file_print(tmp_fileno,nothingstring,0,0,1);"</nowiki>|#FFB100}}
        {{Cl|GOTO}} writeblankline
    {{Cl|END}} {{Cl|IF}}
    b = {{Text|0|#F580B1}}
    e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
    last = {{Text|0|#F580B1}}
    {{Cl|FOR}} i = i {{Cl|TO}} n
        a2$ = {{Text|getelement|#55FF55}}(ca$, i)
        {{Cl|IF}} a2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} b = b + {{Text|1|#F580B1}}
        {{Cl|IF}} a2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} b = b - {{Text|1|#F580B1}}
        {{Cl|IF}} b = {{Text|0|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} a2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}}
                writefilelast:
                {{Cl|IF}} last = {{Text|1|#F580B1}} {{Cl|THEN}} newline = {{Text|1|#F580B1}} {{Cl|ELSE}} newline = {{Text|0|#F580B1}}
                ebak$ = e$
                reevaled = {{Text|0|#F580B1}}
                writefilenumber:
                e$ = {{Text|fixoperationorder$|#55FF55}}(e$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                {{Cl|IF}} reevaled = {{Text|0|#F580B1}} {{Cl|THEN}}
                    l$ = l$ + sp + tlayout$
                    {{Cl|IF}} last = {{Text|0|#F580B1}} {{Cl|THEN}} l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                e$ = {{Text|evaluate|#55FF55}}(e$, typ)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                {{Cl|IF}} reevaled = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        e$ = {{Text|<nowiki>"LTRIM$"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"STR$"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp + ebak$ + sp + {{Text|<nowiki>")"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                        {{Cl|IF}} last = {{Text|0|#F580B1}} {{Cl|THEN}} e$ = e$ + sp + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + sp + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>",1"</nowiki>|#FFB100}}
                        reevaled = {{Text|1|#F580B1}}
                        {{Cl|GOTO}} writefilenumber {{Text|<nowiki>'force re-evaluation</nowiki>|#919191}}
                    {{Cl|ELSE}}
                        e$ = {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"\042"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>",1"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + sp + ebak$ + sp + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + sp + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"\042"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>",1"</nowiki>|#FFB100}}
                        {{Cl|IF}} last = {{Text|0|#F580B1}} {{Cl|THEN}} e$ = e$ + sp + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + sp + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>",1"</nowiki>|#FFB100}}
                        reevaled = {{Text|1|#F580B1}}
                        {{Cl|GOTO}} writefilenumber {{Text|<nowiki>'force re-evaluation</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer|#55FF55}}(e$, typ, {{Text|0|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                {{Text|<nowiki>'format: string, (1/0) extraspace, (1/0) tab, (1/0)begin a new line</nowiki>|#919191}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_file_print(tmp_fileno,"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>",0,0,"</nowiki>|#FFB100}} + {{Cl|STR$}}(newline) + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (new_error) goto skip"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                {{Cl|IF}} last {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}}
                {{Cl|GOTO}} writefilenext
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>',</nowiki>|#919191}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'b=0</nowiki>|#919191}}
        {{Cl|IF}} e$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} e$ = e$ + sp + a2$ {{Cl|ELSE}} e$ = a2$
        writefilenext:
    {{Cl|NEXT}}
    {{Cl|IF}} e$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a2$ = {{Text|<nowiki>","</nowiki>|#FFB100}}: last = {{Text|1|#F580B1}}: {{Cl|GOTO}} writefilelast
    writeblankline:
    {{Text|<nowiki>'WriteBufLine MainTxtBuf, "}"'new_error</nowiki>|#919191}}
    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"skip"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>":"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, cleanupstringprocessingcall$ + {{Text|<nowiki>"0);"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tab_spc_cr_size=1;"</nowiki>|#FFB100}}
    layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
{{Cl|END}} {{Cl|SUB}}
{{Cl|SUB}} {{Text|xgosub|#55FF55}} (ca$)
    a2$ = {{Text|getelement|#55FF55}}(ca$, {{Text|2|#F580B1}})
    {{Cl|IF}} {{Text|validlabel|#55FF55}}(a2$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid label"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
    v = {{Text|HashFind|#55FF55}}(a2$, HASHFLAG_LABEL, ignore, r)
    x = {{Text|1|#F580B1}}
    labchk200:
    {{Cl|IF}} v {{Cl|THEN}}
        s = Labels(r).{{Text|Scope|#55FF55}}
        {{Cl|IF}} s = subfuncn {{Cl|OR (boolean)|OR}} s = {{Text|-1|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'same scope?</nowiki>|#919191}}
            {{Cl|IF}} s = {{Text|-1|#F580B1}} {{Cl|THEN}} Labels(r).{{Text|Scope|#55FF55}} = subfuncn {{Text|<nowiki>'acquire scope</nowiki>|#919191}}
            x = {{Text|0|#F580B1}} {{Text|<nowiki>'already defined</nowiki>|#919191}}
            tlayout$ = {{Cl|RTRIM$}}(Labels(r).cn)
        {{Cl|ELSE}}
            {{Cl|IF}} v = {{Text|2|#F580B1}} {{Cl|THEN}} v = {{Text|HashFindCont|#55FF55}}(ignore, r): {{Cl|GOTO}} labchk200
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} x {{Cl|THEN}}
        {{Text|<nowiki>'does not exist</nowiki>|#919191}}
        nLabels = nLabels + {{Text|1|#F580B1}}: {{Cl|IF}} nLabels > Labels_Ubound {{Cl|THEN}} Labels_Ubound = Labels_Ubound * {{Text|2|#F580B1}}: {{Cl|REDIM}} {{Cl|_PRESERVE}} Labels({{Text|1|#F580B1}} {{Cl|TO}} Labels_Ubound) {{Cl|AS}} Label_Type
        Labels(nLabels) = Empty_Label
        {{Text|HashAdd|#55FF55}} a2$, HASHFLAG_LABEL, nLabels
        r = nLabels
        Labels(r).State = {{Text|0|#F580B1}}
        Labels(r).cn = tlayout$
        Labels(r).{{Text|Scope|#55FF55}} = subfuncn
        Labels(r).Error_Line = linenumber
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'x</nowiki>|#919191}}
    l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"GoSub"</nowiki>|#FFB100}}) + sp + tlayout$
    layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
    {{Text|<nowiki>'note: This code fragment also used by ON ... GOTO/GOSUB</nowiki>|#919191}}
    {{Text|<nowiki>'assume label is reachable (revise)</nowiki>|#919191}}
    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"return_point[next_return_point++]="</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(gosubid) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (next_return_point>=return_points) more_return_points();"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"goto LABEL_"</nowiki>|#FFB100}} + a2$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
    {{Text|<nowiki>'add return point jump</nowiki>|#919191}}
    {{Text|WriteBufLine|#55FF55}} RetTxtBuf, {{Text|<nowiki>"case "</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(gosubid) + {{Text|<nowiki>":"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} RetTxtBuf, {{Text|<nowiki>"goto RETURN_"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(gosubid) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} RetTxtBuf, {{Text|<nowiki>"break;"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"RETURN_"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(gosubid) + {{Text|<nowiki>":;"</nowiki>|#FFB100}}
    gosubid = gosubid + {{Text|1|#F580B1}}
{{Cl|END}} {{Cl|SUB}}
{{Cl|SUB}} {{Text|xongotogosub|#55FF55}} (a$, ca$, n)
    {{Cl|IF}} n < {{Text|4|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected ON expression GOTO/GOSUB label,label,..."</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
    l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"On"</nowiki>|#FFB100}})
    b = {{Text|0|#F580B1}}
    {{Cl|FOR}} i = {{Text|2|#F580B1}} {{Cl|TO}} n
        e2$ = {{Text|getelement$|#55FF55}}(a$, i)
        {{Cl|IF}} e2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} b = b + {{Text|1|#F580B1}}
        {{Cl|IF}} e2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} b = b - {{Text|1|#F580B1}}
        {{Cl|IF}} e2$ = {{Text|<nowiki>"GOTO"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} e2$ = {{Text|<nowiki>"GOSUB"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}}
    {{Cl|NEXT}}
    {{Cl|IF}} i >= n {{Cl|OR (boolean)|OR}} i = {{Text|2|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected ON expression GOTO/GOSUB label,label,..."</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
    e$ = {{Text|getelements$|#55FF55}}(ca$, {{Text|2|#F580B1}}, i - {{Text|1|#F580B1}})
    g = {{Text|0|#F580B1}}: {{Cl|IF}} e2$ = {{Text|<nowiki>"GOSUB"</nowiki>|#FFB100}} {{Cl|THEN}} g = {{Text|1|#F580B1}}
    e$ = {{Text|fixoperationorder|#55FF55}}(e$)
    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
    l$ = l$ + sp + tlayout$
    e$ = {{Text|evaluate|#55FF55}}(e$, typ)
    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer|#55FF55}}(e$, typ, {{Text|0|#F580B1}})
    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected numeric expression"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISFLOAT) {{Cl|THEN}}
        e$ = {{Text|<nowiki>"qbr_float_to_long("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}
    {{Cl|END}} {{Cl|IF}}
    l$ = l$ + sp + e2$
    u$ = {{Text|str2$|#55FF55}}({{Text|uniquenumber|#55FF55}})
    {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"static int32 ongo_"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>"=0;"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"ongo_"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>"="</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
    ln = {{Text|1|#F580B1}}
    labelwaslast = {{Text|0|#F580B1}}
    {{Cl|FOR}} i = i + {{Text|1|#F580B1}} {{Cl|TO}} n
        e$ = {{Text|getelement$|#55FF55}}(ca$, i)
        {{Cl|IF}} e$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}}
            l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}}
            {{Cl|IF}} i = n {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Trailing , invalid"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
            ln = ln + {{Text|1|#F580B1}}
            labelwaslast = {{Text|0|#F580B1}}
        {{Cl|ELSE}}
            {{Cl|IF}} labelwaslast {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected ,"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
            {{Cl|IF}} {{Text|validlabel|#55FF55}}(e$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid label!"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
            v = {{Text|HashFind|#55FF55}}(e$, HASHFLAG_LABEL, ignore, r)
            x = {{Text|1|#F580B1}}
            labchk507:
            {{Cl|IF}} v {{Cl|THEN}}
                s = Labels(r).{{Text|Scope|#55FF55}}
                {{Cl|IF}} s = subfuncn {{Cl|OR (boolean)|OR}} s = {{Text|-1|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'same scope?</nowiki>|#919191}}
                    {{Cl|IF}} s = {{Text|-1|#F580B1}} {{Cl|THEN}} Labels(r).{{Text|Scope|#55FF55}} = subfuncn {{Text|<nowiki>'acquire scope</nowiki>|#919191}}
                    x = {{Text|0|#F580B1}} {{Text|<nowiki>'already defined</nowiki>|#919191}}
                    tlayout$ = {{Cl|RTRIM$}}(Labels(r).cn)
                {{Cl|ELSE}}
                    {{Cl|IF}} v = {{Text|2|#F580B1}} {{Cl|THEN}} v = {{Text|HashFindCont|#55FF55}}(ignore, r): {{Cl|GOTO}} labchk507
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} x {{Cl|THEN}}
                {{Text|<nowiki>'does not exist</nowiki>|#919191}}
                nLabels = nLabels + {{Text|1|#F580B1}}: {{Cl|IF}} nLabels > Labels_Ubound {{Cl|THEN}} Labels_Ubound = Labels_Ubound * {{Text|2|#F580B1}}: {{Cl|REDIM}} {{Cl|_PRESERVE}} Labels({{Text|1|#F580B1}} {{Cl|TO}} Labels_Ubound) {{Cl|AS}} Label_Type
                Labels(nLabels) = Empty_Label
                {{Text|HashAdd|#55FF55}} e$, HASHFLAG_LABEL, nLabels
                r = nLabels
                Labels(r).State = {{Text|0|#F580B1}}
                Labels(r).cn = tlayout$
                Labels(r).{{Text|Scope|#55FF55}} = subfuncn
                Labels(r).Error_Line = linenumber
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'x</nowiki>|#919191}}
            l$ = l$ + sp + tlayout$
            {{Cl|IF}} g {{Cl|THEN}} {{Text|<nowiki>'gosub</nowiki>|#919191}}
                lb$ = e$
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (ongo_"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>"=="</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(ln) + {{Text|<nowiki>"){"</nowiki>|#FFB100}}
                {{Text|<nowiki>'note: This code fragment also used by ON ... GOTO/GOSUB</nowiki>|#919191}}
                {{Text|<nowiki>'assume label is reachable (revise)</nowiki>|#919191}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"return_point[next_return_point++]="</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(gosubid) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (next_return_point>=return_points) more_return_points();"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"goto LABEL_"</nowiki>|#FFB100}} + lb$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Text|<nowiki>'add return point jump</nowiki>|#919191}}
                {{Text|WriteBufLine|#55FF55}} RetTxtBuf, {{Text|<nowiki>"case "</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(gosubid) + {{Text|<nowiki>":"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} RetTxtBuf, {{Text|<nowiki>"goto RETURN_"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(gosubid) + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} RetTxtBuf, {{Text|<nowiki>"break;"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"RETURN_"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(gosubid) + {{Text|<nowiki>":;"</nowiki>|#FFB100}}
                gosubid = gosubid + {{Text|1|#F580B1}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"goto ongo_"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>"_skip;"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
            {{Cl|ELSE}} {{Text|<nowiki>'goto</nowiki>|#919191}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (ongo_"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>"=="</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(ln) + {{Text|<nowiki>") goto LABEL_"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            labelwaslast = {{Text|1|#F580B1}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|NEXT}}
    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (ongo_"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>"<0) error(5);"</nowiki>|#FFB100}}
    {{Cl|IF}} g = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"ongo_"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>"_skip:;"</nowiki>|#FFB100}}
    layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
{{Cl|END}} {{Cl|SUB}}
{{Cl|SUB}} {{Text|xprint|#55FF55}} (a$, ca$, n)
    u$ = {{Text|str2$|#55FF55}}({{Text|uniquenumber|#55FF55}})
    l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Print"</nowiki>|#FFB100}})
    {{Cl|IF}} {{Cl|ASC (function)|ASC}}(a$) = {{Text|76|#F580B1}} {{Cl|THEN}} lp = {{Text|1|#F580B1}}: lp$ = {{Text|<nowiki>"l"</nowiki>|#FFB100}}: l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"LPrint"</nowiki>|#FFB100}}): {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tab_LPRINT=1;"</nowiki>|#FFB100}}: DEPENDENCY(DEPENDENCY_PRINTER) = {{Text|1|#F580B1}} {{Text|<nowiki>'"L"</nowiki>|#919191}}
    {{Text|<nowiki>'PRINT USING?</nowiki>|#919191}}
    {{Cl|IF}} n >= {{Text|2|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} {{Text|getelement|#55FF55}}(a$, {{Text|2|#F580B1}}) = {{Text|<nowiki>"USING"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Text|<nowiki>'get format string</nowiki>|#919191}}
            i = {{Text|3|#F580B1}}
            pujump:
            l$ = l$ + sp + {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Using"</nowiki>|#FFB100}})
            e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: b = {{Text|0|#F580B1}}: puformat$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Cl|FOR}} i = i {{Cl|TO}} n
                a2$ = {{Text|getelement|#55FF55}}(ca$, i)
                {{Cl|IF}} a2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} b = b + {{Text|1|#F580B1}}
                {{Cl|IF}} a2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} b = b - {{Text|1|#F580B1}}
                {{Cl|IF}} b = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} a2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected PRINT USING formatstring ; ..."</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
                    {{Cl|IF}} a2$ = {{Text|<nowiki>";"</nowiki>|#FFB100}} {{Cl|THEN}}
                        e$ = {{Text|fixoperationorder$|#55FF55}}(e$)
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                        l$ = l$ + sp + tlayout$ + sp2 + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                        e$ = {{Text|evaluate|#55FF55}}(e$, typ)
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                        {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer|#55FF55}}(e$, typ, {{Text|0|#F580B1}})
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                        {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected PRINT USING formatstring ; ..."</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
                        puformat$ = e$
                        {{Cl|EXIT}} {{Cl|FOR}}
                    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>';</nowiki>|#919191}}
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'b</nowiki>|#919191}}
                {{Cl|IF}} {{Cl|LEN}}(e$) {{Cl|THEN}} e$ = e$ + sp + a2$ {{Cl|ELSE}} e$ = a2$
            {{Cl|NEXT}}
            {{Cl|IF}} puformat$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected PRINT USING formatstring ; ..."</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
            {{Cl|IF}} i = n {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected PRINT USING formatstring ; ..."</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
            {{Text|<nowiki>'create build string</nowiki>|#919191}}
            {{Cl|IF}} TQBSset = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tqbs=qbs_new(0,0);"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_set(tqbs,qbs_new_txt_len("</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>",0));"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|<nowiki>'set format start/index variable</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_long=0;"</nowiki>|#FFB100}} {{Text|<nowiki>'scan format from beginning</nowiki>|#919191}}
            {{Text|<nowiki>'create string to hold format in for multiple references</nowiki>|#919191}}
            puf$ = {{Text|<nowiki>"print_using_format"</nowiki>|#FFB100}} + u$
            {{Cl|IF}} subfunc = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"static qbs *"</nowiki>|#FFB100}} + puf$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"qbs *"</nowiki>|#FFB100}} + puf$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, puf$ + {{Text|<nowiki>"=qbs_new(0,0); qbs_set("</nowiki>|#FFB100}} + puf$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + puformat$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (new_error) goto skip_pu"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
            {{Text|<nowiki>'print expressions</nowiki>|#919191}}
            b = {{Text|0|#F580B1}}
            e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
            last = {{Text|0|#F580B1}}
            {{Cl|FOR}} i = i + {{Text|1|#F580B1}} {{Cl|TO}} n
                a2$ = {{Text|getelement|#55FF55}}(ca$, i)
                {{Cl|IF}} a2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} b = b + {{Text|1|#F580B1}}
                {{Cl|IF}} a2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} b = b - {{Text|1|#F580B1}}
                {{Cl|IF}} b = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} a2$ = {{Text|<nowiki>";"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} a2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}}
                        printulast:
                        e$ = {{Text|fixoperationorder$|#55FF55}}(e$)
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                        {{Cl|IF}} last {{Cl|THEN}} l$ = l$ + sp + tlayout$ {{Cl|ELSE}} l$ = l$ + sp + tlayout$ + sp2 + a2$
                        e$ = {{Text|evaluate|#55FF55}}(e$, typ)
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                        {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer|#55FF55}}(e$, typ, {{Text|0|#F580B1}})
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                        {{Cl|IF}} typ {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                            {{Cl|IF}} {{Cl|LEFT$}}(e$, {{Text|9|#F580B1}}) = {{Text|<nowiki>"func_tab("</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} {{Cl|LEFT$}}(e$, {{Text|9|#F580B1}}) = {{Text|<nowiki>"func_spc("</nowiki>|#FFB100}} {{Cl|THEN}}
                                {{Text|<nowiki>'TAB/SPC exception</nowiki>|#919191}}
                                {{Text|<nowiki>'note: position in format-string must be maintained</nowiki>|#919191}}
                                {{Text|<nowiki>'-print any string up until now</nowiki>|#919191}}
                                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_"</nowiki>|#FFB100}} + lp$ + {{Text|<nowiki>"print(tqbs,0);"</nowiki>|#FFB100}}
                                {{Text|<nowiki>'-print e$</nowiki>|#919191}}
                                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_set(tqbs,"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (new_error) goto skip_pu"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                                {{Cl|IF}} lp {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"lprint_makefit(tqbs);"</nowiki>|#FFB100}} {{Cl|ELSE}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"makefit(tqbs);"</nowiki>|#FFB100}}
                                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_"</nowiki>|#FFB100}} + lp$ + {{Text|<nowiki>"print(tqbs,0);"</nowiki>|#FFB100}}
                                {{Text|<nowiki>'-set length of tqbs to 0</nowiki>|#919191}}
                                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tqbs->len=0;"</nowiki>|#FFB100}}
                            {{Cl|ELSE}}
                                {{Text|<nowiki>'regular string</nowiki>|#919191}}
                                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_long=print_using("</nowiki>|#FFB100}} + puf$ + {{Text|<nowiki>",tmp_long,tqbs,"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|ELSE}} {{Text|<nowiki>'not a string</nowiki>|#919191}}
                            {{Cl|IF}} typ {{Cl|AND (boolean)|AND}} ISFLOAT {{Cl|THEN}}
                                {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|32|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_long=print_using_single("</nowiki>|#FFB100}} + puf$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>",tmp_long,tqbs);"</nowiki>|#FFB100}}
                                {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|64|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_long=print_using_double("</nowiki>|#FFB100}} + puf$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>",tmp_long,tqbs);"</nowiki>|#FFB100}}
                                {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) > {{Text|64|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_long=print_using_float("</nowiki>|#FFB100}} + puf$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>",tmp_long,tqbs);"</nowiki>|#FFB100}}
                            {{Cl|ELSE}}
                                {{Cl|IF}} ((typ {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) = {{Text|64|#F580B1}}) {{Cl|AND (boolean)|AND}} (typ {{Cl|AND (boolean)|AND}} ISUNSIGNED) <> {{Text|0|#F580B1}} {{Cl|THEN}}
                                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_long=print_using_uinteger64("</nowiki>|#FFB100}} + puf$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>",tmp_long,tqbs);"</nowiki>|#FFB100}}
                                {{Cl|ELSE}}
                                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tmp_long=print_using_integer64("</nowiki>|#FFB100}} + puf$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>",tmp_long,tqbs);"</nowiki>|#FFB100}}
                                {{Cl|END}} {{Cl|IF}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'string/not string</nowiki>|#919191}}
                        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (new_error) goto skip_pu"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                        e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                        {{Cl|IF}} last {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}}
                        {{Cl|GOTO}} printunext
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} {{Cl|LEN}}(e$) {{Cl|THEN}} e$ = e$ + sp + a2$ {{Cl|ELSE}} e$ = a2$
                printunext:
            {{Cl|NEXT}}
            {{Cl|IF}} e$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a2$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: last = {{Text|1|#F580B1}}: {{Cl|GOTO}} printulast
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"skip_pu"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>":"</nowiki>|#FFB100}}
            {{Text|<nowiki>'check for errors</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (new_error){"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"g_tmp_long=new_error; new_error=0; qbs_"</nowiki>|#FFB100}} + lp$ + {{Text|<nowiki>"print(tqbs,0); new_error=g_tmp_long;"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}else{"</nowiki>|#FFB100}}
            {{Cl|IF}} a2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} a2$ = {{Text|<nowiki>";"</nowiki>|#FFB100}} {{Cl|THEN}} nl = {{Text|0|#F580B1}} {{Cl|ELSE}} nl = {{Text|1|#F580B1}} {{Text|<nowiki>'note: a2$ is set to the last element of a$</nowiki>|#919191}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_"</nowiki>|#FFB100}} + lp$ + {{Text|<nowiki>"print(tqbs,"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(nl) + {{Text|<nowiki>");"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_free(tqbs);"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_free("</nowiki>|#FFB100}} + puf$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"skip"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>":"</nowiki>|#FFB100}}
            {{Text|WriteBufLine|#55FF55}} MainTxtBuf, cleanupstringprocessingcall$ + {{Text|<nowiki>"0);"</nowiki>|#FFB100}}
            {{Cl|IF}} lp {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tab_LPRINT=0;"</nowiki>|#FFB100}}
            tlayout$ = l$
            {{Cl|EXIT}} {{Cl|SUB}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'end of print using code</nowiki>|#919191}}
    b = {{Text|0|#F580B1}}
    e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
    last = {{Text|0|#F580B1}}
    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tqbs=qbs_new(0,0);"</nowiki>|#FFB100}} {{Text|<nowiki>'initialize the temp string</nowiki>|#919191}}
    TQBSset = {{Text|-1|#F580B1}} {{Text|<nowiki>'set the temporary flag so we don't create a temp string twice, in case USING comes after something</nowiki>|#919191}}
    {{Cl|FOR}} i = {{Text|2|#F580B1}} {{Cl|TO}} n
        a2$ = {{Text|getelement|#55FF55}}(ca$, i)
        {{Cl|IF}} a2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} b = b + {{Text|1|#F580B1}}
        {{Cl|IF}} a2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} b = b - {{Text|1|#F580B1}}
        {{Cl|IF}} b = {{Text|0|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} a2$ = {{Text|<nowiki>";"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} a2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} {{Cl|UCASE$}}(a2$) = {{Text|<nowiki>"USING"</nowiki>|#FFB100}} {{Cl|THEN}}
                printlast:
                {{Cl|IF}} {{Cl|UCASE$}}(a2$) = {{Text|<nowiki>"USING"</nowiki>|#FFB100}} {{Cl|THEN}}
                    {{Cl|IF}} e$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} gotopu = {{Text|1|#F580B1}} {{Cl|ELSE}} i = i + {{Text|1|#F580B1}}: {{Cl|GOTO}} pujump
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} {{Cl|LEN}}(e$) {{Cl|THEN}}
                    ebak$ = e$
                    pnrtnum = {{Text|0|#F580B1}}
                    printnumber:
                    e$ = {{Text|fixoperationorder$|#55FF55}}(e$)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                    {{Cl|IF}} pnrtnum = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} last {{Cl|THEN}} l$ = l$ + sp + tlayout$ {{Cl|ELSE}} l$ = l$ + sp + tlayout$ + sp2 + a2$
                    {{Cl|END}} {{Cl|IF}}
                    e$ = {{Text|evaluate|#55FF55}}(e$, typ)
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Text|<nowiki>'not a string expresion!</nowiki>|#919191}}
                        e$ = {{Text|<nowiki>"STR$"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp + ebak$ + sp + {{Text|<nowiki>")"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + sp + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>" "</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}})
                        pnrtnum = {{Text|1|#F580B1}}
                        {{Cl|GOTO}} printnumber
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer|#55FF55}}(e$, typ, {{Text|0|#F580B1}})
                    {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_set(tqbs,"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (new_error) goto skip"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                    {{Cl|IF}} lp {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"lprint_makefit(tqbs);"</nowiki>|#FFB100}} {{Cl|ELSE}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"makefit(tqbs);"</nowiki>|#FFB100}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_"</nowiki>|#FFB100}} + lp$ + {{Text|<nowiki>"print(tqbs,0);"</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    {{Cl|IF}} a2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}} l$ = l$ + sp + a2$
                    {{Cl|IF}} a2$ = {{Text|<nowiki>";"</nowiki>|#FFB100}} {{Cl|THEN}}
                        {{Cl|IF}} {{Cl|RIGHT$}}(l$, {{Text|1|#F580B1}}) <> {{Text|<nowiki>";"</nowiki>|#FFB100}} {{Cl|THEN}} l$ = l$ + sp + a2$ {{Text|<nowiki>'concat ;; to ;</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'len(e$)</nowiki>|#919191}}
                {{Cl|IF}} a2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tab();"</nowiki>|#FFB100}}
                e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                {{Cl|IF}} gotopu {{Cl|THEN}} i = i + {{Text|1|#F580B1}}: {{Cl|GOTO}} pujump
                {{Cl|IF}} last {{Cl|THEN}}
                    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_"</nowiki>|#FFB100}} + lp$ + {{Text|<nowiki>"print(nothingstring,1);"</nowiki>|#FFB100}} {{Text|<nowiki>'go to new line</nowiki>|#919191}}
                    {{Cl|EXIT}} {{Cl|FOR}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|GOTO}} printnext
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'a2$</nowiki>|#919191}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'b=0</nowiki>|#919191}}
        {{Cl|IF}} {{Cl|LEN}}(e$) {{Cl|THEN}} e$ = e$ + sp + a2$ {{Cl|ELSE}} e$ = a2$
        printnext:
    {{Cl|NEXT}}
    {{Cl|IF}} {{Cl|LEN}}(e$) {{Cl|THEN}} a2$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: last = {{Text|1|#F580B1}}: {{Cl|GOTO}} printlast
    {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_"</nowiki>|#FFB100}} + lp$ + {{Text|<nowiki>"print(nothingstring,1);"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"skip"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>":"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_free(tqbs);"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, cleanupstringprocessingcall$ + {{Text|<nowiki>"0);"</nowiki>|#FFB100}}
    {{Cl|IF}} lp {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"tab_LPRINT=0;"</nowiki>|#FFB100}}
    tlayout$ = l$
{{Cl|END}} {{Cl|SUB}}
{{Cl|SUB}} {{Text|xread|#55FF55}} (ca$, n)
    l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Read"</nowiki>|#FFB100}})
    {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected variable"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
    i = {{Text|2|#F580B1}}
    {{Cl|IF}} i > n {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected , ..."</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
    a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
    b = {{Text|0|#F580B1}}
    {{Cl|FOR}} i = i {{Cl|TO}} n
        a2$ = {{Text|getelement$|#55FF55}}(ca$, i)
        {{Cl|IF}} a2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} b = b + {{Text|1|#F580B1}}
        {{Cl|IF}} a2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} b = b - {{Text|1|#F580B1}}
        {{Cl|IF}} (a2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} b = {{Text|0|#F580B1}}) {{Cl|OR (boolean)|OR}} i = n {{Cl|THEN}}
            {{Cl|IF}} i = n {{Cl|THEN}}
                {{Cl|IF}} a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a3$ = a2$ {{Cl|ELSE}} a3$ = a3$ + sp + a2$
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected , ..."</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
            e$ = {{Text|fixoperationorder$|#55FF55}}(a3$)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
            l$ = l$ + sp + tlayout$: {{Cl|IF}} i <> n {{Cl|THEN}} l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}}
            e$ = {{Text|evaluate|#55FF55}}(e$, t)
            {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
            {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISREFERENCE) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected variable"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
            {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}}
                e$ = {{Text|refer|#55FF55}}(e$, t, {{Text|0|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"sub_read_string(data,&data_offset,data_size,"</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                stringprocessinghappened = {{Text|1|#F580B1}}
            {{Cl|ELSE}}
                {{Text|<nowiki>'numeric variable</nowiki>|#919191}}
                {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISFLOAT) <> {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} (t {{Cl|AND (boolean)|AND}} {{Text|511|#F580B1}}) <> {{Text|64|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) {{Cl|THEN}}
                        {{Text|setrefer|#55FF55}} e$, t, {{Text|<nowiki>"((int64)func_read_float(data,&data_offset,data_size,"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(t) + {{Text|<nowiki>"))"</nowiki>|#FFB100}}, {{Text|1|#F580B1}}
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                    {{Cl|ELSE}}
                        {{Text|setrefer|#55FF55}} e$, t, {{Text|<nowiki>"func_read_float(data,&data_offset,data_size,"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(t) + {{Text|<nowiki>")"</nowiki>|#FFB100}}, {{Text|1|#F580B1}}
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|ELSE}}
                    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISUNSIGNED {{Cl|THEN}}
                        {{Text|setrefer|#55FF55}} e$, t, {{Text|<nowiki>"func_read_uint64(data,&data_offset,data_size)"</nowiki>|#FFB100}}, {{Text|1|#F580B1}}
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                    {{Cl|ELSE}}
                        {{Text|setrefer|#55FF55}} e$, t, {{Text|<nowiki>"func_read_int64(data,&data_offset,data_size)"</nowiki>|#FFB100}}, {{Text|1|#F580B1}}
                        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'string/numeric</nowiki>|#919191}}
            {{Cl|IF}} i = n {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}}
            a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: a2$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} a3$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a3$ = a2$ {{Cl|ELSE}} a3$ = a3$ + sp + a2$
    {{Cl|NEXT}}
    {{Cl|IF}} stringprocessinghappened {{Cl|THEN}} {{Text|WriteBufLine|#55FF55}} MainTxtBuf, cleanupstringprocessingcall$ + {{Text|<nowiki>"0);"</nowiki>|#FFB100}}
    layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
{{Cl|END}} {{Cl|SUB}}
{{Cl|SUB}} {{Text|xwrite|#55FF55}} (ca$, n)
    l$ = {{Text|SCase$|#55FF55}}({{Text|<nowiki>"Write"</nowiki>|#FFB100}})
    u$ = {{Text|str2$|#55FF55}}({{Text|uniquenumber|#55FF55}})
    {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_print(nothingstring,1);"</nowiki>|#FFB100}}
        {{Cl|GOTO}} writeblankline2
    {{Cl|END}} {{Cl|IF}}
    b = {{Text|0|#F580B1}}
    e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
    last = {{Text|0|#F580B1}}
    {{Cl|FOR}} i = {{Text|2|#F580B1}} {{Cl|TO}} n
        a2$ = {{Text|getelement|#55FF55}}(ca$, i)
        {{Cl|IF}} a2$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} b = b + {{Text|1|#F580B1}}
        {{Cl|IF}} a2$ = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} b = b - {{Text|1|#F580B1}}
        {{Cl|IF}} b = {{Text|0|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} a2$ = {{Text|<nowiki>","</nowiki>|#FFB100}} {{Cl|THEN}}
                writelast:
                {{Cl|IF}} last = {{Text|1|#F580B1}} {{Cl|THEN}} newline = {{Text|1|#F580B1}} {{Cl|ELSE}} newline = {{Text|0|#F580B1}}
                ebak$ = e$
                reevaled = {{Text|0|#F580B1}}
                writechecked:
                e$ = {{Text|fixoperationorder$|#55FF55}}(e$)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                {{Cl|IF}} reevaled = {{Text|0|#F580B1}} {{Cl|THEN}}
                    l$ = l$ + sp + tlayout$
                    {{Cl|IF}} last = {{Text|0|#F580B1}} {{Cl|THEN}} l$ = l$ + sp2 + {{Text|<nowiki>","</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                e$ = {{Text|evaluate|#55FF55}}(e$, typ)
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                {{Cl|IF}} reevaled = {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISSTRING) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        e$ = {{Text|<nowiki>"LTRIM$"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"STR$"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"("</nowiki>|#FFB100}} + sp + ebak$ + sp + {{Text|<nowiki>")"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>")"</nowiki>|#FFB100}}
                        {{Cl|IF}} last = {{Text|0|#F580B1}} {{Cl|THEN}} e$ = e$ + sp + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + sp + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>",1"</nowiki>|#FFB100}}
                        reevaled = {{Text|1|#F580B1}}
                        {{Cl|GOTO}} writechecked {{Text|<nowiki>'force re-evaluation</nowiki>|#919191}}
                    {{Cl|ELSE}}
                        e$ = {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"\042"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>",1"</nowiki>|#FFB100}} + sp + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + sp + ebak$ + sp + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + sp + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>"\042"</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>",1"</nowiki>|#FFB100}}
                        {{Cl|IF}} last = {{Text|0|#F580B1}} {{Cl|THEN}} e$ = e$ + sp + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + sp + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>",1"</nowiki>|#FFB100}}
                        reevaled = {{Text|1|#F580B1}}
                        {{Cl|GOTO}} writechecked {{Text|<nowiki>'force re-evaluation</nowiki>|#919191}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} (typ {{Cl|AND (boolean)|AND}} ISREFERENCE) {{Cl|THEN}} e$ = {{Text|refer|#55FF55}}(e$, typ, {{Text|0|#F580B1}})
                {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
                {{Text|<nowiki>'format: string, (1/0) extraspace, (1/0) tab, (1/0)begin a new line</nowiki>|#919191}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"qbs_print("</nowiki>|#FFB100}} + e$ + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Cl|STR$}}(newline) + {{Text|<nowiki>");"</nowiki>|#FFB100}}
                {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"if (new_error) goto skip"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>";"</nowiki>|#FFB100}}
                e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
                {{Cl|IF}} last {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}}
                {{Cl|GOTO}} writenext
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>',</nowiki>|#919191}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'b=0</nowiki>|#919191}}
        {{Cl|IF}} e$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} e$ = e$ + sp + a2$ {{Cl|ELSE}} e$ = a2$
        writenext:
    {{Cl|NEXT}}
    {{Cl|IF}} e$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} a2$ = {{Text|<nowiki>","</nowiki>|#FFB100}}: last = {{Text|1|#F580B1}}: {{Cl|GOTO}} writelast
    writeblankline2:
    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, {{Text|<nowiki>"skip"</nowiki>|#FFB100}} + u$ + {{Text|<nowiki>":"</nowiki>|#FFB100}}
    {{Text|WriteBufLine|#55FF55}} MainTxtBuf, cleanupstringprocessingcall$ + {{Text|<nowiki>"0);"</nowiki>|#FFB100}}
    layoutdone = {{Text|1|#F580B1}}: {{Cl|IF}} {{Cl|LEN}}(layout$) {{Cl|THEN}} layout$ = layout$ + sp + l$ {{Cl|ELSE}} layout$ = l$
{{Cl|END}} {{Cl|SUB}}
{{Cl|FUNCTION}} {{Text|evaluateconst$|#55FF55}} (a2$, t {{Cl|AS}} {{Cl|LONG}})
    a$ = a2$
    {{Cl|IF}} Debug {{Cl|THEN}} {{Cl|PRINT (file statement)|PRINT}} #9, {{Text|<nowiki>"evaluateconst:in:"</nowiki>|#FFB100}} + a$
    {{Cl|DIM}} block({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|STRING}}
    {{Cl|DIM}} status({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|INTEGER}}
    {{Text|<nowiki>'0=unprocessed (can be "")</nowiki>|#919191}}
    {{Text|<nowiki>'1=processed</nowiki>|#919191}}
    {{Cl|DIM}} btype({{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|LONG}} {{Text|<nowiki>'for status=1 blocks</nowiki>|#919191}}
    {{Text|<nowiki>'put a$ into blocks</nowiki>|#919191}}
    n = {{Text|numelements|#55FF55}}(a$)
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} n
        block(i) = {{Text|getelement$|#55FF55}}(a$, i)
    {{Cl|NEXT}}
    evalconstevalbrack:
    {{Text|<nowiki>'find highest bracket level</nowiki>|#919191}}
    l = {{Text|0|#F580B1}}
    b = {{Text|0|#F580B1}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} n
        {{Cl|IF}} block(i) = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} b = b + {{Text|1|#F580B1}}
        {{Cl|IF}} block(i) = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} b = b - {{Text|1|#F580B1}}
        {{Cl|IF}} b > l {{Cl|THEN}} l = b
    {{Cl|NEXT}}
    {{Text|<nowiki>'if brackets exist, evaluate that item first</nowiki>|#919191}}
    {{Cl|IF}} l {{Cl|THEN}}
        b = {{Text|0|#F580B1}}
        e$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} n
            {{Cl|IF}} block(i) = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}}
                {{Cl|IF}} b = l {{Cl|THEN}} block(i) = {{Text|<nowiki>""</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FOR}}
                b = b - {{Text|1|#F580B1}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} b >= l {{Cl|THEN}}
                {{Cl|IF}} {{Cl|LEN}}(e$) = {{Text|0|#F580B1}} {{Cl|THEN}} e$ = block(i) {{Cl|ELSE}} e$ = e$ + sp + block(i)
                block(i) = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} block(i) = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}}
                b = b + {{Text|1|#F580B1}}
                {{Cl|IF}} b = l {{Cl|THEN}} i2 = i: block(i) = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|NEXT}} i
        status(i) = {{Text|1|#F580B1}}
        block(i) = {{Text|evaluateconst$|#55FF55}}(e$, btype(i))
        {{Cl|IF}} Error_Happened {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|GOTO}} evalconstevalbrack
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'l</nowiki>|#919191}}
    {{Text|<nowiki>'linear equation remains with some pre-calculated & non-pre-calc blocks</nowiki>|#919191}}
    {{Text|<nowiki>'problem: type QBASIC assumes and type required to store calc. value may</nowiki>|#919191}}
    {{Text|<nowiki>'        differ dramatically. in qbasic, this would have caused an overflow,</nowiki>|#919191}}
    {{Text|<nowiki>'        but in qb64 it MUST work. eg. 32767% * 32767%</nowiki>|#919191}}
    {{Text|<nowiki>'solution: all interger calc. will be performed using a signed _INTEGER64</nowiki>|#919191}}
    {{Text|<nowiki>'          all float calc. will be performed using a _FLOAT</nowiki>|#919191}}
    {{Text|<nowiki>'convert non-calc block numbers into binary form with QBASIC-like type</nowiki>|#919191}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} n
        {{Cl|IF}} status(i) = {{Text|0|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} {{Cl|LEN}}(block(i)) {{Cl|THEN}}
                a = {{Cl|ASC (function)|ASC}}(block(i))
                {{Cl|IF}} (a = {{Text|45|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|LEN}}(block(i)) > {{Text|1|#F580B1}}) {{Cl|OR (boolean)|OR}} (a >= {{Text|48|#F580B1}} {{Cl|AND (boolean)|AND}} a <= {{Text|57|#F580B1}}) {{Cl|THEN}} {{Text|<nowiki>'number?</nowiki>|#919191}}
                    {{Text|<nowiki>'integers</nowiki>|#919191}}
                    e$ = {{Cl|RIGHT$}}(block(i), {{Text|3|#F580B1}})
                    {{Cl|IF}} e$ = {{Text|<nowiki>"~&&"</nowiki>|#FFB100}} {{Cl|THEN}} btype(i) = UINTEGER64TYPE - ISPOINTER: {{Cl|GOTO}} gotconstblkityp
                    {{Cl|IF}} e$ = {{Text|<nowiki>"~%%"</nowiki>|#FFB100}} {{Cl|THEN}} btype(i) = UBYTETYPE - ISPOINTER: {{Cl|GOTO}} gotconstblkityp
                    e$ = {{Cl|RIGHT$}}(block(i), {{Text|2|#F580B1}})
                    {{Cl|IF}} e$ = {{Text|<nowiki>"&&"</nowiki>|#FFB100}} {{Cl|THEN}} btype(i) = INTEGER64TYPE - ISPOINTER: {{Cl|GOTO}} gotconstblkityp
                    {{Cl|IF}} e$ = {{Text|<nowiki>"%%"</nowiki>|#FFB100}} {{Cl|THEN}} btype(i) = BYTETYPE - ISPOINTER: {{Cl|GOTO}} gotconstblkityp
                    {{Cl|IF}} e$ = {{Text|<nowiki>"~%"</nowiki>|#FFB100}} {{Cl|THEN}} btype(i) = UINTEGERTYPE - ISPOINTER: {{Cl|GOTO}} gotconstblkityp
                    {{Cl|IF}} e$ = {{Text|<nowiki>"~&"</nowiki>|#FFB100}} {{Cl|THEN}} btype(i) = ULONGTYPE - ISPOINTER: {{Cl|GOTO}} gotconstblkityp
                    e$ = {{Cl|RIGHT$}}(block(i), {{Text|1|#F580B1}})
                    {{Cl|IF}} e$ = {{Text|<nowiki>"%"</nowiki>|#FFB100}} {{Cl|THEN}} btype(i) = INTEGERTYPE - ISPOINTER: {{Cl|GOTO}} gotconstblkityp
                    {{Cl|IF}} e$ = {{Text|<nowiki>"&"</nowiki>|#FFB100}} {{Cl|THEN}} btype(i) = LONGTYPE - ISPOINTER: {{Cl|GOTO}} gotconstblkityp
                    {{Text|<nowiki>'ubit-type?</nowiki>|#919191}}
                    {{Cl|IF}} {{Cl|INSTR}}(block(i), {{Text|<nowiki>"~`"</nowiki>|#FFB100}}) {{Cl|THEN}}
                        x = {{Cl|INSTR}}(block(i), {{Text|<nowiki>"~`"</nowiki>|#FFB100}})
                        {{Cl|IF}} x = {{Cl|LEN}}(block(i)) - {{Text|1|#F580B1}} {{Cl|THEN}} block(i) = block(i) + {{Text|<nowiki>"1"</nowiki>|#FFB100}}
                        btype(i) = UBITTYPE - ISPOINTER - {{Text|1|#F580B1}} + {{Cl|VAL}}({{Cl|RIGHT$}}(block(i), {{Cl|LEN}}(block(i)) - x - {{Text|1|#F580B1}}))
                        block(i) = {{Cl|_MK$}}({{Cl|_INTEGER64}}, {{Cl|VAL}}({{Cl|LEFT$}}(block(i), x - {{Text|1|#F580B1}})))
                        status(i) = {{Text|1|#F580B1}}
                        {{Cl|GOTO}} gotconstblktyp
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|<nowiki>'bit-type?</nowiki>|#919191}}
                    {{Cl|IF}} {{Cl|INSTR}}(block(i), {{Text|<nowiki>"`"</nowiki>|#FFB100}}) {{Cl|THEN}}
                        x = {{Cl|INSTR}}(block(i), {{Text|<nowiki>"`"</nowiki>|#FFB100}})
                        {{Cl|IF}} x = {{Cl|LEN}}(block(i)) {{Cl|THEN}} block(i) = block(i) + {{Text|<nowiki>"1"</nowiki>|#FFB100}}
                        btype(i) = BITTYPE - ISPOINTER - {{Text|1|#F580B1}} + {{Cl|VAL}}({{Cl|RIGHT$}}(block(i), {{Cl|LEN}}(block(i)) - x))
                        block(i) = {{Cl|_MK$}}({{Cl|_INTEGER64}}, {{Cl|VAL}}({{Cl|LEFT$}}(block(i), x - {{Text|1|#F580B1}})))
                        status(i) = {{Text|1|#F580B1}}
                        {{Cl|GOTO}} gotconstblktyp
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|<nowiki>'floats</nowiki>|#919191}}
                    {{Cl|IF}} {{Cl|INSTR}}(block(i), {{Text|<nowiki>"E"</nowiki>|#FFB100}}) {{Cl|THEN}}
                        block(i) = {{Cl|_MK$}}({{Cl|_FLOAT}}, {{Cl|VAL}}(block(i)))
                        btype(i) = SINGLETYPE - ISPOINTER
                        status(i) = {{Text|1|#F580B1}}
                        {{Cl|GOTO}} gotconstblktyp
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} {{Cl|INSTR}}(block(i), {{Text|<nowiki>"D"</nowiki>|#FFB100}}) {{Cl|THEN}}
                        block(i) = {{Cl|_MK$}}({{Cl|_FLOAT}}, {{Cl|VAL}}(block(i)))
                        btype(i) = DOUBLETYPE - ISPOINTER
                        status(i) = {{Text|1|#F580B1}}
                        {{Cl|GOTO}} gotconstblktyp
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} {{Cl|INSTR}}(block(i), {{Text|<nowiki>"F"</nowiki>|#FFB100}}) {{Cl|THEN}}
                        block(i) = {{Cl|_MK$}}({{Cl|_FLOAT}}, {{Cl|VAL}}(block(i)))
                        btype(i) = FLOATTYPE - ISPOINTER
                        status(i) = {{Text|1|#F580B1}}
                        {{Cl|GOTO}} gotconstblktyp
                    {{Cl|END}} {{Cl|IF}}
                    {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid CONST expression.1"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    gotconstblkityp:
                    block(i) = {{Cl|LEFT$}}(block(i), {{Cl|LEN}}(block(i)) - {{Cl|LEN}}(e$))
                    block(i) = {{Cl|_MK$}}({{Cl|_INTEGER64}}, {{Cl|VAL}}(block(i)))
                    status(i) = {{Text|1|#F580B1}}
                    gotconstblktyp:
                {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'a</nowiki>|#919191}}
                {{Cl|IF}} a = {{Text|34|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'string?</nowiki>|#919191}}
                    {{Text|<nowiki>'no changes need to be made to block(i) which is of format "CHARACTERS",size</nowiki>|#919191}}
                    btype(i) = STRINGTYPE - ISPOINTER
                    status(i) = {{Text|1|#F580B1}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'len<>0</nowiki>|#919191}}
        {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'status</nowiki>|#919191}}
    {{Cl|NEXT}}
    {{Text|<nowiki>'remove NULL blocks</nowiki>|#919191}}
    n2 = {{Text|0|#F580B1}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} n
        {{Cl|IF}} block(i) <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
            n2 = n2 + {{Text|1|#F580B1}}
            block(n2) = block(i)
            status(n2) = status(i)
            btype(n2) = btype(i)
        {{Cl|END}} {{Cl|IF}}
    {{Cl|NEXT}}
    n = n2
    {{Text|<nowiki>'only one block?</nowiki>|#919191}}
    {{Cl|IF}} n = {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} status({{Text|1|#F580B1}}) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid CONST expression.2"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        t = btype({{Text|1|#F580B1}})
        {{Text|evaluateconst$|#55FF55}} = block({{Text|1|#F580B1}})
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}} {{Text|<nowiki>'n=1</nowiki>|#919191}}
    {{Text|<nowiki>'evaluate equation (equation cannot contain any STRINGs)</nowiki>|#919191}}
    {{Text|<nowiki>'[negation/not][variable]</nowiki>|#919191}}
    e$ = block({{Text|1|#F580B1}})
    {{Cl|IF}} status({{Text|1|#F580B1}}) = {{Text|0|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} n <> {{Text|2|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid CONST expression.4"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} status({{Text|2|#F580B1}}) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid CONST expression.5"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} btype({{Text|2|#F580B1}}) {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid CONST expression.6"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        o$ = block({{Text|1|#F580B1}})
        {{Cl|IF}} o$ = {{Cl|CHR$}}({{Text|241|#F580B1}}) {{Cl|THEN}}
            {{Cl|IF}} btype({{Text|2|#F580B1}}) {{Cl|AND (boolean)|AND}} ISFLOAT {{Cl|THEN}}
                r## = -{{Cl|_CV}}({{Cl|_FLOAT}}, block({{Text|2|#F580B1}}))
                {{Text|evaluateconst$|#55FF55}} = {{Cl|_MK$}}({{Cl|_FLOAT}}, r##)
            {{Cl|ELSE}}
                r&& = -{{Cl|_CV}}({{Cl|_INTEGER64}}, block({{Text|2|#F580B1}}))
                {{Text|evaluateconst$|#55FF55}} = {{Cl|_MK$}}({{Cl|_INTEGER64}}, r&&)
            {{Cl|END}} {{Cl|IF}}
            t = btype({{Text|2|#F580B1}})
            {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} {{Cl|UCASE$}}(o$) = {{Text|<nowiki>"NOT"</nowiki>|#FFB100}} {{Cl|THEN}}
            {{Cl|IF}} btype({{Text|2|#F580B1}}) {{Cl|AND (boolean)|AND}} ISFLOAT {{Cl|THEN}}
                r&& = {{Cl|_CV}}({{Cl|_FLOAT}}, block({{Text|2|#F580B1}}))
            {{Cl|ELSE}}
                r&& = {{Cl|_CV}}({{Cl|_INTEGER64}}, block({{Text|2|#F580B1}}))
            {{Cl|END}} {{Cl|IF}}
            r&& = {{Cl|NOT}} r&&
            t = btype({{Text|2|#F580B1}})
            {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISFLOAT {{Cl|THEN}} t = LONGTYPE - ISPOINTER {{Text|<nowiki>'markdown to LONG</nowiki>|#919191}}
            {{Text|evaluateconst$|#55FF55}} = {{Cl|_MK$}}({{Cl|_INTEGER64}}, r&&)
            {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|IF}}
        {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid CONST expression.7"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'[variable][bool-operator][variable]...</nowiki>|#919191}}
    {{Text|<nowiki>'get first variable</nowiki>|#919191}}
    et = btype({{Text|1|#F580B1}})
    ev$ = block({{Text|1|#F580B1}})
    i = {{Text|2|#F580B1}}
    evalconstequ:
    {{Text|<nowiki>'get operator</nowiki>|#919191}}
    {{Cl|IF}} i >= n {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid CONST expression.8"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    o$ = {{Cl|UCASE$}}(block(i))
    i = i + {{Text|1|#F580B1}}
    {{Cl|IF}} {{Text|isoperator|#55FF55}}(o$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid CONST expression.9"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} i > n {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid CONST expression.10"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Text|<nowiki>'string/numeric mismatch?</nowiki>|#919191}}
    {{Cl|IF}} (btype(i) {{Cl|AND (boolean)|AND}} ISSTRING) <> (et {{Cl|AND (boolean)|AND}} ISSTRING) {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid CONST expression.11"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Text|<nowiki>' The left and right operands needs to have valid types. They might not if</nowiki>|#919191}}
    {{Text|<nowiki>' the user wrote something invalid like `1 OR OR 2`</nowiki>|#919191}}
    {{Cl|IF}} et = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid CONST expression.14"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} btype(i) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid CONST expression.15"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} et {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
        {{Cl|IF}} o$ <> {{Text|<nowiki>"+"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid CONST expression.12"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Text|<nowiki>'concat strings</nowiki>|#919191}}
        s1$ = {{Cl|RIGHT$}}(ev$, {{Cl|LEN}}(ev$) - {{Text|1|#F580B1}})
        s1$ = {{Cl|LEFT$}}(s1$, {{Cl|INSTR}}(s1$, {{Cl|CHR$}}({{Text|34|#F580B1}})) - {{Text|1|#F580B1}})
        s1size = {{Cl|VAL}}({{Cl|RIGHT$}}(ev$, {{Cl|LEN}}(ev$) - {{Cl|LEN}}(s1$) - {{Text|3|#F580B1}}))
        s2$ = {{Cl|RIGHT$}}(block(i), {{Cl|LEN}}(block(i)) - {{Text|1|#F580B1}})
        s2$ = {{Cl|LEFT$}}(s2$, {{Cl|INSTR}}(s2$, {{Cl|CHR$}}({{Text|34|#F580B1}})) - {{Text|1|#F580B1}})
        s2size = {{Cl|VAL}}({{Cl|RIGHT$}}(block(i), {{Cl|LEN}}(block(i)) - {{Cl|LEN}}(s2$) - {{Text|3|#F580B1}}))
        ev$ = {{Cl|CHR$}}({{Text|34|#F580B1}}) + s1$ + s2$ + {{Cl|CHR$}}({{Text|34|#F580B1}}) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(s1size + s2size)
        {{Cl|GOTO}} econstmarkedup
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'prepare left and right values</nowiki>|#919191}}
    {{Cl|IF}} et {{Cl|AND (boolean)|AND}} ISFLOAT {{Cl|THEN}}
        linteger = {{Text|0|#F580B1}}
        l## = {{Cl|_CV}}({{Cl|_FLOAT}}, ev$)
        l&& = l##
    {{Cl|ELSE}}
        linteger = {{Text|1|#F580B1}}
        l&& = {{Cl|_CV}}({{Cl|_INTEGER64}}, ev$)
        l## = l&&
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} btype(i) {{Cl|AND (boolean)|AND}} ISFLOAT {{Cl|THEN}}
        rinteger = {{Text|0|#F580B1}}
        r## = {{Cl|_CV}}({{Cl|_FLOAT}}, block(i))
        r&& = r##
    {{Cl|ELSE}}
        rinteger = {{Text|1|#F580B1}}
        r&& = {{Cl|_CV}}({{Cl|_INTEGER64}}, block(i))
        r## = r&&
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} linteger = {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} rinteger = {{Text|1|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} o$ = {{Text|<nowiki>"+"</nowiki>|#FFB100}} {{Cl|THEN}} r&& = l&& + r&&: {{Cl|GOTO}} econstmarkupi
        {{Cl|IF}} o$ = {{Text|<nowiki>"-"</nowiki>|#FFB100}} {{Cl|THEN}} r&& = l&& - r&&: {{Cl|GOTO}} econstmarkupi
        {{Cl|IF}} o$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} {{Cl|THEN}} r&& = l&& * r&&: {{Cl|GOTO}} econstmarkupi
        {{Cl|IF}} o$ = {{Text|<nowiki>"^"</nowiki>|#FFB100}} {{Cl|THEN}} r## = l&& ^ r&&: {{Cl|GOTO}} econstmarkupf
        {{Cl|IF}} o$ = {{Text|<nowiki>"/"</nowiki>|#FFB100}} {{Cl|THEN}} r## = l&& / r&&: {{Cl|GOTO}} econstmarkupf
        {{Cl|IF}} o$ = {{Text|<nowiki>"\"</nowiki>|#FFB100}} {{Cl|THEN}} r&& = l&& \ r&&: {{Cl|GOTO}} econstmarkupi
        {{Cl|IF}} o$ = {{Text|<nowiki>"MOD"</nowiki>|#FFB100}} {{Cl|THEN}} r&& = l&& {{Cl|MOD}} r&&: {{Cl|GOTO}} econstmarkupi
        {{Cl|IF}} o$ = {{Text|<nowiki>"="</nowiki>|#FFB100}} {{Cl|THEN}} r&& = l&& = r&&: {{Cl|GOTO}} econstmarkupi16
        {{Cl|IF}} o$ = {{Text|<nowiki>">"</nowiki>|#FFB100}} {{Cl|THEN}} r&& = l&& > r&&: {{Cl|GOTO}} econstmarkupi16
        {{Cl|IF}} o$ = {{Text|<nowiki>"<"</nowiki>|#FFB100}} {{Cl|THEN}} r&& = l&& < r&&: {{Cl|GOTO}} econstmarkupi16
        {{Cl|IF}} o$ = {{Text|<nowiki>">="</nowiki>|#FFB100}} {{Cl|THEN}} r&& = l&& >= r&&: {{Cl|GOTO}} econstmarkupi16
        {{Cl|IF}} o$ = {{Text|<nowiki>"<="</nowiki>|#FFB100}} {{Cl|THEN}} r&& = l&& <= r&&: {{Cl|GOTO}} econstmarkupi16
        {{Cl|IF}} o$ = {{Text|<nowiki>"<>"</nowiki>|#FFB100}} {{Cl|THEN}} r&& = l&& <> r&&: {{Cl|GOTO}} econstmarkupi16
        {{Cl|IF}} o$ = {{Text|<nowiki>"IMP"</nowiki>|#FFB100}} {{Cl|THEN}} r&& = l&& {{Cl|IMP}} r&&: {{Cl|GOTO}} econstmarkupi
        {{Cl|IF}} o$ = {{Text|<nowiki>"EQV"</nowiki>|#FFB100}} {{Cl|THEN}} r&& = l&& {{Cl|EQV}} r&&: {{Cl|GOTO}} econstmarkupi
        {{Cl|IF}} o$ = {{Text|<nowiki>"XOR"</nowiki>|#FFB100}} {{Cl|THEN}} r&& = l&& {{Cl|XOR}} r&&: {{Cl|GOTO}} econstmarkupi
        {{Cl|IF}} o$ = {{Text|<nowiki>"OR"</nowiki>|#FFB100}} {{Cl|THEN}} r&& = l&& {{Cl|OR}} r&&: {{Cl|GOTO}} econstmarkupi
        {{Cl|IF}} o$ = {{Text|<nowiki>"AND"</nowiki>|#FFB100}} {{Cl|THEN}} r&& = l&& {{Cl|AND}} r&&: {{Cl|GOTO}} econstmarkupi
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} o$ = {{Text|<nowiki>"+"</nowiki>|#FFB100}} {{Cl|THEN}} r## = l## + r##: {{Cl|GOTO}} econstmarkupf
    {{Cl|IF}} o$ = {{Text|<nowiki>"-"</nowiki>|#FFB100}} {{Cl|THEN}} r## = l## - r##: {{Cl|GOTO}} econstmarkupf
    {{Cl|IF}} o$ = {{Text|<nowiki>"*"</nowiki>|#FFB100}} {{Cl|THEN}} r## = l## * r##: {{Cl|GOTO}} econstmarkupf
    {{Cl|IF}} o$ = {{Text|<nowiki>"^"</nowiki>|#FFB100}} {{Cl|THEN}} r## = l## ^ r##: {{Cl|GOTO}} econstmarkupf
    {{Cl|IF}} o$ = {{Text|<nowiki>"/"</nowiki>|#FFB100}} {{Cl|THEN}} r## = l## / r##: {{Cl|GOTO}} econstmarkupf
    {{Cl|IF}} o$ = {{Text|<nowiki>"\"</nowiki>|#FFB100}} {{Cl|THEN}} r&& = l## \ r##: {{Cl|GOTO}} econstmarkupi32
    {{Cl|IF}} o$ = {{Text|<nowiki>"MOD"</nowiki>|#FFB100}} {{Cl|THEN}} r&& = l## {{Cl|MOD}} r##: {{Cl|GOTO}} econstmarkupi32
    {{Cl|IF}} o$ = {{Text|<nowiki>"="</nowiki>|#FFB100}} {{Cl|THEN}} r&& = l## = r##: {{Cl|GOTO}} econstmarkupi16
    {{Cl|IF}} o$ = {{Text|<nowiki>">"</nowiki>|#FFB100}} {{Cl|THEN}} r&& = l## > r##: {{Cl|GOTO}} econstmarkupi16
    {{Cl|IF}} o$ = {{Text|<nowiki>"<"</nowiki>|#FFB100}} {{Cl|THEN}} r&& = l## < r##: {{Cl|GOTO}} econstmarkupi16
    {{Cl|IF}} o$ = {{Text|<nowiki>">="</nowiki>|#FFB100}} {{Cl|THEN}} r&& = l## >= r##: {{Cl|GOTO}} econstmarkupi16
    {{Cl|IF}} o$ = {{Text|<nowiki>"<="</nowiki>|#FFB100}} {{Cl|THEN}} r&& = l## <= r##: {{Cl|GOTO}} econstmarkupi16
    {{Cl|IF}} o$ = {{Text|<nowiki>"<>"</nowiki>|#FFB100}} {{Cl|THEN}} r&& = l## <> r##: {{Cl|GOTO}} econstmarkupi16
    {{Cl|IF}} o$ = {{Text|<nowiki>"IMP"</nowiki>|#FFB100}} {{Cl|THEN}} r&& = l## {{Cl|IMP}} r##: {{Cl|GOTO}} econstmarkupi32
    {{Cl|IF}} o$ = {{Text|<nowiki>"EQV"</nowiki>|#FFB100}} {{Cl|THEN}} r&& = l## {{Cl|EQV}} r##: {{Cl|GOTO}} econstmarkupi32
    {{Cl|IF}} o$ = {{Text|<nowiki>"XOR"</nowiki>|#FFB100}} {{Cl|THEN}} r&& = l## {{Cl|XOR}} r##: {{Cl|GOTO}} econstmarkupi32
    {{Cl|IF}} o$ = {{Text|<nowiki>"OR"</nowiki>|#FFB100}} {{Cl|THEN}} r&& = l## {{Cl|OR}} r##: {{Cl|GOTO}} econstmarkupi32
    {{Cl|IF}} o$ = {{Text|<nowiki>"AND"</nowiki>|#FFB100}} {{Cl|THEN}} r&& = l## {{Cl|AND}} r##: {{Cl|GOTO}} econstmarkupi32
    {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Invalid CONST expression.13"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    econstmarkupi16:
    et = INTEGERTYPE - ISPOINTER
    ev$ = {{Cl|_MK$}}({{Cl|_INTEGER64}}, r&&)
    {{Cl|GOTO}} econstmarkedup
    econstmarkupi32:
    et = LONGTYPE - ISPOINTER
    ev$ = {{Cl|_MK$}}({{Cl|_INTEGER64}}, r&&)
    {{Cl|GOTO}} econstmarkedup
    econstmarkupi:
    {{Cl|IF}} et <> btype(i) {{Cl|THEN}}
        {{Text|<nowiki>'keep unsigned?</nowiki>|#919191}}
        u = {{Text|0|#F580B1}}: {{Cl|IF}} (et {{Cl|AND (boolean)|AND}} ISUNSIGNED) <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} (btype(i) {{Cl|AND (boolean)|AND}} ISUNSIGNED) <> {{Text|0|#F580B1}} {{Cl|THEN}} u = {{Text|1|#F580B1}}
        lb = et {{Cl|AND}} {{Text|511|#F580B1}}: rb = btype(i) {{Cl|AND}} {{Text|511|#F580B1}}
        ob = {{Text|0|#F580B1}}
        {{Cl|IF}} lb = rb {{Cl|THEN}}
            {{Cl|IF}} (et {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} (btype(i) {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) <> {{Text|0|#F580B1}} {{Cl|THEN}} ob = {{Text|1|#F580B1}}
            b = lb
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} lb > rb {{Cl|THEN}}
            {{Cl|IF}} (et {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) <> {{Text|0|#F580B1}} {{Cl|THEN}} ob = {{Text|1|#F580B1}}
            b = lb
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} lb < rb {{Cl|THEN}}
            {{Cl|IF}} (btype(i) {{Cl|AND (boolean)|AND}} ISOFFSETINBITS) <> {{Text|0|#F580B1}} {{Cl|THEN}} ob = {{Text|1|#F580B1}}
            b = rb
        {{Cl|END}} {{Cl|IF}}
        et = b
        {{Cl|IF}} ob {{Cl|THEN}} et = et + ISOFFSETINBITS
        {{Cl|IF}} u {{Cl|THEN}} et = et + ISUNSIGNED
    {{Cl|END}} {{Cl|IF}}
    ev$ = {{Cl|_MK$}}({{Cl|_INTEGER64}}, r&&)
    {{Cl|GOTO}} econstmarkedup
    econstmarkupf:
    lfb = {{Text|0|#F580B1}}: rfb = {{Text|0|#F580B1}}
    lib = {{Text|0|#F580B1}}: rib = {{Text|0|#F580B1}}
    {{Cl|IF}} et {{Cl|AND (boolean)|AND}} ISFLOAT {{Cl|THEN}} lfb = et {{Cl|AND}} {{Text|511|#F580B1}} {{Cl|ELSE}} lib = et {{Cl|AND}} {{Text|511|#F580B1}}
    {{Cl|IF}} btype(i) {{Cl|AND (boolean)|AND}} ISFLOAT {{Cl|THEN}} rfb = btype(i) {{Cl|AND}} {{Text|511|#F580B1}} {{Cl|ELSE}} rib = btype(i) {{Cl|AND}} {{Text|511|#F580B1}}
    f = {{Text|32|#F580B1}}
    {{Cl|IF}} lib > {{Text|16|#F580B1}} {{Cl|OR (boolean)|OR}} rib > {{Text|16|#F580B1}} {{Cl|THEN}} f = {{Text|64|#F580B1}}
    {{Cl|IF}} lfb > {{Text|32|#F580B1}} {{Cl|OR (boolean)|OR}} rfb > {{Text|32|#F580B1}} {{Cl|THEN}} f = {{Text|64|#F580B1}}
    {{Cl|IF}} lib > {{Text|32|#F580B1}} {{Cl|OR (boolean)|OR}} rib > {{Text|32|#F580B1}} {{Cl|THEN}} f = {{Text|256|#F580B1}}
    {{Cl|IF}} lfb > {{Text|64|#F580B1}} {{Cl|OR (boolean)|OR}} rfb > {{Text|64|#F580B1}} {{Cl|THEN}} f = {{Text|256|#F580B1}}
    et = ISFLOAT + f
    ev$ = {{Cl|_MK$}}({{Cl|_FLOAT}}, r##)
    econstmarkedup:
    i = i + {{Text|1|#F580B1}}
    {{Cl|IF}} i <= n {{Cl|THEN}} {{Cl|GOTO}} evalconstequ
    t = et
    {{Text|evaluateconst$|#55FF55}} = ev$
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|typevalue2symbol$|#55FF55}} (t)
    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
        {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Cannot convert expression type to symbol"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Text|typevalue2symbol$|#55FF55}} = {{Text|<nowiki>"$"</nowiki>|#FFB100}}
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    s$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISUNSIGNED {{Cl|THEN}} s$ = {{Text|<nowiki>"~"</nowiki>|#FFB100}}
    b = t {{Cl|AND}} {{Text|511|#F580B1}}
    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISOFFSETINBITS {{Cl|THEN}}
        {{Cl|IF}} b > {{Text|1|#F580B1}} {{Cl|THEN}} s$ = s$ + {{Text|<nowiki>"`"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}(b) {{Cl|ELSE}} s$ = s$ + {{Text|<nowiki>"`"</nowiki>|#FFB100}}
        {{Text|typevalue2symbol$|#55FF55}} = s$
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISFLOAT {{Cl|THEN}}
        {{Cl|IF}} b = {{Text|32|#F580B1}} {{Cl|THEN}} s$ = {{Text|<nowiki>"!"</nowiki>|#FFB100}}
        {{Cl|IF}} b = {{Text|64|#F580B1}} {{Cl|THEN}} s$ = {{Text|<nowiki>"#"</nowiki>|#FFB100}}
        {{Cl|IF}} b = {{Text|256|#F580B1}} {{Cl|THEN}} s$ = {{Text|<nowiki>"##"</nowiki>|#FFB100}}
        {{Text|typevalue2symbol$|#55FF55}} = s$
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} b = {{Text|8|#F580B1}} {{Cl|THEN}} s$ = s$ + {{Text|<nowiki>"%%"</nowiki>|#FFB100}}
    {{Cl|IF}} b = {{Text|16|#F580B1}} {{Cl|THEN}} s$ = s$ + {{Text|<nowiki>"%"</nowiki>|#FFB100}}
    {{Cl|IF}} b = {{Text|32|#F580B1}} {{Cl|THEN}} s$ = s$ + {{Text|<nowiki>"&"</nowiki>|#FFB100}}
    {{Cl|IF}} b = {{Text|64|#F580B1}} {{Cl|THEN}} s$ = s$ + {{Text|<nowiki>"&&"</nowiki>|#FFB100}}
    {{Text|typevalue2symbol$|#55FF55}} = s$
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|id2fulltypename$|#55FF55}}
    t = id.t
    {{Cl|IF}} t = {{Text|0|#F580B1}} {{Cl|THEN}} t = id.arraytype
    size = id.tsize
    bits = t {{Cl|AND}} {{Text|511|#F580B1}}
    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
        a$ = {{Cl|RTRIM$}}(udtxcname(t {{Cl|AND}} {{Text|511|#F580B1}}))
        {{Text|id2fulltypename$|#55FF55}} = a$: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
        {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH {{Cl|THEN}} a$ = {{Text|<nowiki>"STRING * "</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(size) {{Cl|ELSE}} a$ = {{Text|<nowiki>"STRING"</nowiki>|#FFB100}}
        {{Text|id2fulltypename$|#55FF55}} = a$: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISOFFSETINBITS {{Cl|THEN}}
        {{Cl|IF}} bits > {{Text|1|#F580B1}} {{Cl|THEN}} a$ = qb64prefix$ + {{Text|<nowiki>"BIT * "</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bits) {{Cl|ELSE}} a$ = qb64prefix$ + {{Text|<nowiki>"BIT"</nowiki>|#FFB100}}
        {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISUNSIGNED {{Cl|THEN}} a$ = qb64prefix$ + {{Text|<nowiki>"UNSIGNED "</nowiki>|#FFB100}} + a$
        {{Text|id2fulltypename$|#55FF55}} = a$: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISFLOAT {{Cl|THEN}}
        {{Cl|IF}} bits = {{Text|32|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"SINGLE"</nowiki>|#FFB100}}
        {{Cl|IF}} bits = {{Text|64|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"DOUBLE"</nowiki>|#FFB100}}
        {{Cl|IF}} bits = {{Text|256|#F580B1}} {{Cl|THEN}} a$ = qb64prefix$ + {{Text|<nowiki>"FLOAT"</nowiki>|#FFB100}}
    {{Cl|ELSE}} {{Text|<nowiki>'integer-based</nowiki>|#919191}}
        {{Cl|IF}} bits = {{Text|8|#F580B1}} {{Cl|THEN}} a$ = qb64prefix$ + {{Text|<nowiki>"BYTE"</nowiki>|#FFB100}}
        {{Cl|IF}} bits = {{Text|16|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"INTEGER"</nowiki>|#FFB100}}
        {{Cl|IF}} bits = {{Text|32|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"LONG"</nowiki>|#FFB100}}
        {{Cl|IF}} bits = {{Text|64|#F580B1}} {{Cl|THEN}} a$ = qb64prefix$ + {{Text|<nowiki>"INTEGER64"</nowiki>|#FFB100}}
        {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISUNSIGNED {{Cl|THEN}} a$ = qb64prefix$ + {{Text|<nowiki>"UNSIGNED "</nowiki>|#FFB100}} + a$
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISOFFSET {{Cl|THEN}}
        a$ = qb64prefix$ + {{Text|<nowiki>"OFFSET"</nowiki>|#FFB100}}
        {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISUNSIGNED {{Cl|THEN}} a$ = qb64prefix$ + {{Text|<nowiki>"UNSIGNED "</nowiki>|#FFB100}} + a$
    {{Cl|END}} {{Cl|IF}}
    {{Text|id2fulltypename$|#55FF55}} = a$
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|id2shorttypename$|#55FF55}}
    t = id.t
    {{Cl|IF}} t = {{Text|0|#F580B1}} {{Cl|THEN}} t = id.arraytype
    size = id.tsize
    bits = t {{Cl|AND}} {{Text|511|#F580B1}}
    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
        a$ = {{Cl|RTRIM$}}(udtxcname(t {{Cl|AND}} {{Text|511|#F580B1}}))
        {{Text|id2shorttypename$|#55FF55}} = a$: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
        {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH {{Cl|THEN}} a$ = {{Text|<nowiki>"STRING"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(size) {{Cl|ELSE}} a$ = {{Text|<nowiki>"STRING"</nowiki>|#FFB100}}
        {{Text|id2shorttypename$|#55FF55}} = a$: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISOFFSETINBITS {{Cl|THEN}}
        {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISUNSIGNED {{Cl|THEN}} a$ = {{Text|<nowiki>"_U"</nowiki>|#FFB100}} {{Cl|ELSE}} a$ = {{Text|<nowiki>"_"</nowiki>|#FFB100}}
        {{Cl|IF}} bits > {{Text|1|#F580B1}} {{Cl|THEN}} a$ = a$ + {{Text|<nowiki>"BIT"</nowiki>|#FFB100}} + {{Text|str2|#55FF55}}(bits) {{Cl|ELSE}} a$ = a$ + {{Text|<nowiki>"BIT1"</nowiki>|#FFB100}}
        {{Text|id2shorttypename$|#55FF55}} = a$: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISFLOAT {{Cl|THEN}}
        {{Cl|IF}} bits = {{Text|32|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"SINGLE"</nowiki>|#FFB100}}
        {{Cl|IF}} bits = {{Text|64|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"DOUBLE"</nowiki>|#FFB100}}
        {{Cl|IF}} bits = {{Text|256|#F580B1}} {{Cl|THEN}} a$ = {{Text|<nowiki>"_FLOAT"</nowiki>|#FFB100}}
    {{Cl|ELSE}} {{Text|<nowiki>'integer-based</nowiki>|#919191}}
        {{Cl|IF}} bits = {{Text|8|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISUNSIGNED) {{Cl|THEN}} a$ = {{Text|<nowiki>"_UBYTE"</nowiki>|#FFB100}} {{Cl|ELSE}} a$ = {{Text|<nowiki>"_BYTE"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} bits = {{Text|16|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISUNSIGNED) {{Cl|THEN}} a$ = {{Text|<nowiki>"UINTEGER"</nowiki>|#FFB100}} {{Cl|ELSE}} a$ = {{Text|<nowiki>"INTEGER"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} bits = {{Text|32|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISUNSIGNED) {{Cl|THEN}} a$ = {{Text|<nowiki>"ULONG"</nowiki>|#FFB100}} {{Cl|ELSE}} a$ = {{Text|<nowiki>"LONG"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} bits = {{Text|64|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} (t {{Cl|AND (boolean)|AND}} ISUNSIGNED) {{Cl|THEN}} a$ = {{Text|<nowiki>"_UINTEGER64"</nowiki>|#FFB100}} {{Cl|ELSE}} a$ = {{Text|<nowiki>"_INTEGER64"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|id2shorttypename$|#55FF55}} = a$
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|symbol2fulltypename$|#55FF55}} (s2$)
    {{Text|<nowiki>'note: accepts both symbols and type names</nowiki>|#919191}}
    s$ = s2$
    {{Cl|IF}} {{Cl|LEFT$}}(s$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"~"</nowiki>|#FFB100}} {{Cl|THEN}}
        u = {{Text|1|#F580B1}}
        {{Cl|IF}} {{Cl|LEN}}(typ$) = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected ~..."</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        s$ = {{Cl|RIGHT$}}(s$, {{Cl|LEN}}(s$) - {{Text|1|#F580B1}})
        u$ = qb64prefix$ + {{Text|<nowiki>"UNSIGNED "</nowiki>|#FFB100}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} s$ = {{Text|<nowiki>"%%"</nowiki>|#FFB100}} {{Cl|THEN}} t$ = u$ + qb64prefix$ + {{Text|<nowiki>"BYTE"</nowiki>|#FFB100}}: {{Cl|GOTO}} gotsym2typ
    {{Cl|IF}} s$ = {{Text|<nowiki>"%"</nowiki>|#FFB100}} {{Cl|THEN}} t$ = u$ + {{Text|<nowiki>"INTEGER"</nowiki>|#FFB100}}: {{Cl|GOTO}} gotsym2typ
    {{Cl|IF}} s$ = {{Text|<nowiki>"&"</nowiki>|#FFB100}} {{Cl|THEN}} t$ = u$ + {{Text|<nowiki>"LONG"</nowiki>|#FFB100}}: {{Cl|GOTO}} gotsym2typ
    {{Cl|IF}} s$ = {{Text|<nowiki>"&&"</nowiki>|#FFB100}} {{Cl|THEN}} t$ = u$ + qb64prefix$ + {{Text|<nowiki>"INTEGER64"</nowiki>|#FFB100}}: {{Cl|GOTO}} gotsym2typ
    {{Cl|IF}} s$ = {{Text|<nowiki>"%&"</nowiki>|#FFB100}} {{Cl|THEN}} t$ = u$ + qb64prefix$ + {{Text|<nowiki>"OFFSET"</nowiki>|#FFB100}}: {{Cl|GOTO}} gotsym2typ
    {{Cl|IF}} {{Cl|LEFT$}}(s$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"`"</nowiki>|#FFB100}} {{Cl|THEN}}
        {{Cl|IF}} {{Cl|LEN}}(s$) = {{Text|1|#F580B1}} {{Cl|THEN}}
            t$ = u$ + qb64prefix$ + {{Text|<nowiki>"BIT * 1"</nowiki>|#FFB100}}
            {{Cl|GOTO}} gotsym2typ
        {{Cl|END}} {{Cl|IF}}
        n$ = {{Cl|RIGHT$}}(s$, {{Cl|LEN}}(s$) - {{Text|1|#F580B1}})
        {{Cl|IF}} {{Text|isuinteger|#55FF55}}(n$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected number after symbol `"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        t$ = u$ + qb64prefix$ + {{Text|<nowiki>"BIT * "</nowiki>|#FFB100}} + n$
        {{Cl|GOTO}} gotsym2typ
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} u = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected type symbol after ~"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} s$ = {{Text|<nowiki>"!"</nowiki>|#FFB100}} {{Cl|THEN}} t$ = {{Text|<nowiki>"SINGLE"</nowiki>|#FFB100}}: {{Cl|GOTO}} gotsym2typ
    {{Cl|IF}} s$ = {{Text|<nowiki>"#"</nowiki>|#FFB100}} {{Cl|THEN}} t$ = {{Text|<nowiki>"DOUBLE"</nowiki>|#FFB100}}: {{Cl|GOTO}} gotsym2typ
    {{Cl|IF}} s$ = {{Text|<nowiki>"##"</nowiki>|#FFB100}} {{Cl|THEN}} t$ = qb64prefix$ + {{Text|<nowiki>"FLOAT"</nowiki>|#FFB100}}: {{Cl|GOTO}} gotsym2typ
    {{Cl|IF}} s$ = {{Text|<nowiki>"$"</nowiki>|#FFB100}} {{Cl|THEN}} t$ = {{Text|<nowiki>"STRING"</nowiki>|#FFB100}}: {{Cl|GOTO}} gotsym2typ
    {{Cl|IF}} {{Cl|LEFT$}}(s$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"$"</nowiki>|#FFB100}} {{Cl|THEN}}
        n$ = {{Cl|RIGHT$}}(s$, {{Cl|LEN}}(s$) - {{Text|1|#F580B1}})
        {{Cl|IF}} {{Text|isuinteger|#55FF55}}(n$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|Give_Error|#55FF55}} {{Text|<nowiki>"Expected number after symbol $"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        t$ = {{Text|<nowiki>"STRING * "</nowiki>|#FFB100}} + n$
        {{Cl|GOTO}} gotsym2typ
    {{Cl|END}} {{Cl|IF}}
    t$ = s$
    gotsym2typ:
    {{Cl|IF}} {{Cl|RIGHT$}}({{Text|<nowiki>" "</nowiki>|#FFB100}} + t$, {{Text|5|#F580B1}}) = {{Text|<nowiki>" _BIT"</nowiki>|#FFB100}} {{Cl|THEN}} t$ = t$ + {{Text|<nowiki>" * 1"</nowiki>|#FFB100}} {{Text|<nowiki>'clarify (_UNSIGNED) _BIT as (_UNSIGNED) _BIT * 1</nowiki>|#919191}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(t$)
        {{Cl|IF}} {{Cl|ASC (function)|ASC}}(t$, i) = {{Cl|ASC (function)|ASC}}(sp) {{Cl|THEN}} {{Cl|ASC}}(t$, i) = {{Text|32|#F580B1}}
    {{Cl|NEXT}}
    {{Text|symbol2fulltypename$|#55FF55}} = t$
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|SUB}} {{Text|lineinput3load|#55FF55}} (f$)
    {{Cl|OPEN}} f$ {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|BINARY}} {{Cl|OPEN|AS}} #1
    l = {{Cl|LOF}}({{Text|1|#F580B1}})
    lineinput3buffer$ = {{Cl|SPACE$}}(l)
    {{Cl|GET}} #1, , lineinput3buffer$
    {{Cl|IF}} {{Cl|LEN}}(lineinput3buffer$) {{Cl|THEN}} {{Cl|IF}} {{Cl|RIGHT$}}(lineinput3buffer$, {{Text|1|#F580B1}}) = {{Cl|CHR$}}({{Text|26|#F580B1}}) {{Cl|THEN}} lineinput3buffer$ = {{Cl|LEFT$}}(lineinput3buffer$, {{Cl|LEN}}(lineinput3buffer$) - {{Text|1|#F580B1}})
    {{Cl|CLOSE}} #1
    lineinput3index = {{Text|1|#F580B1}}
{{Cl|END}} {{Cl|SUB}}
{{Cl|FUNCTION}} {{Text|lineinput3$|#55FF55}}
    {{Text|<nowiki>'returns CHR$(13) if no more lines are available</nowiki>|#919191}}
    l = {{Cl|LEN}}(lineinput3buffer$)
    {{Cl|IF}} lineinput3index > l {{Cl|THEN}} {{Text|lineinput3$|#55FF55}} = {{Cl|CHR$}}({{Text|13|#F580B1}}): {{Cl|EXIT}} {{Cl|FUNCTION}}
    c13 = {{Cl|INSTR}}(lineinput3index, lineinput3buffer$, {{Cl|CHR$}}({{Text|13|#F580B1}}))
    c10 = {{Cl|INSTR}}(lineinput3index, lineinput3buffer$, {{Cl|CHR$}}({{Text|10|#F580B1}}))
    {{Cl|IF}} c10 = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} c13 = {{Text|0|#F580B1}} {{Cl|THEN}}
        {{Text|lineinput3$|#55FF55}} = {{Cl|MID$ (function)|MID$}}(lineinput3buffer$, lineinput3index, l - lineinput3index + {{Text|1|#F580B1}})
        lineinput3index = l + {{Text|1|#F580B1}}
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} c10 = {{Text|0|#F580B1}} {{Cl|THEN}} c10 = {{Text|2147483647|#F580B1}}
    {{Cl|IF}} c13 = {{Text|0|#F580B1}} {{Cl|THEN}} c13 = {{Text|2147483647|#F580B1}}
    {{Cl|IF}} c10 < c13 {{Cl|THEN}}
        {{Text|<nowiki>'10 before 13</nowiki>|#919191}}
        {{Text|lineinput3$|#55FF55}} = {{Cl|MID$ (function)|MID$}}(lineinput3buffer$, lineinput3index, c10 - lineinput3index)
        lineinput3index = c10 + {{Text|1|#F580B1}}
        {{Cl|IF}} lineinput3index <= l {{Cl|THEN}}
            {{Cl|IF}} {{Cl|ASC (function)|ASC}}({{Cl|MID$ (function)|MID$}}(lineinput3buffer$, lineinput3index, {{Text|1|#F580B1}})) = {{Text|13|#F580B1}} {{Cl|THEN}} lineinput3index = lineinput3index + {{Text|1|#F580B1}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|ELSE}}
        {{Text|<nowiki>'13 before 10</nowiki>|#919191}}
        {{Text|lineinput3$|#55FF55}} = {{Cl|MID$ (function)|MID$}}(lineinput3buffer$, lineinput3index, c13 - lineinput3index)
        lineinput3index = c13 + {{Text|1|#F580B1}}
        {{Cl|IF}} lineinput3index <= l {{Cl|THEN}}
            {{Cl|IF}} {{Cl|ASC (function)|ASC}}({{Cl|MID$ (function)|MID$}}(lineinput3buffer$, lineinput3index, {{Text|1|#F580B1}})) = {{Text|10|#F580B1}} {{Cl|THEN}} lineinput3index = lineinput3index + {{Text|1|#F580B1}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|eleucase$|#55FF55}} (a$)
    {{Text|<nowiki>'this function upper-cases all elements except for quoted strings</nowiki>|#919191}}
    {{Text|<nowiki>'check first element</nowiki>|#919191}}
    {{Cl|IF}} {{Cl|LEN}}(a$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
    i = {{Text|1|#F580B1}}
    {{Cl|IF}} {{Cl|ASC (function)|ASC}}(a$) = {{Text|34|#F580B1}} {{Cl|THEN}}
        i2 = {{Cl|INSTR}}(a$, sp)
        {{Cl|IF}} i2 = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|eleucase$|#55FF55}} = a$: {{Cl|EXIT}} {{Cl|FUNCTION}}
        a2$ = {{Cl|LEFT$}}(a$, i2 - {{Text|1|#F580B1}})
        i = i2
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'check other elements</nowiki>|#919191}}
    sp34$ = sp + {{Cl|CHR$}}({{Text|34|#F580B1}})
    {{Cl|IF}} i < {{Cl|LEN}}(a$) {{Cl|THEN}}
        {{Cl|DO}} {{Cl|WHILE}} {{Cl|INSTR}}(i, a$, sp34$)
            i2 = {{Cl|INSTR}}(i, a$, sp34$)
            a2$ = a2$ + {{Cl|UCASE$}}({{Cl|MID$ (function)|MID$}}(a$, i, i2 - i + {{Text|1|#F580B1}})) {{Text|<nowiki>'everything prior including spacer</nowiki>|#919191}}
            i3 = {{Cl|INSTR}}(i2 + {{Text|1|#F580B1}}, a$, sp): {{Cl|IF}} i3 = {{Text|0|#F580B1}} {{Cl|THEN}} i3 = {{Cl|LEN}}(a$) {{Cl|ELSE}} i3 = i3 - {{Text|1|#F580B1}}
            a2$ = a2$ + {{Cl|MID$ (function)|MID$}}(a$, i2 + {{Text|1|#F580B1}}, i3 - (i2 + {{Text|1|#F580B1}}) + {{Text|1|#F580B1}}) {{Text|<nowiki>'everything from " to before next spacer or end</nowiki>|#919191}}
            i = i3 + {{Text|1|#F580B1}}
            {{Cl|IF}} i > {{Cl|LEN}}(a$) {{Cl|THEN}} {{Cl|EXIT}} {{Cl|DO}}
        {{Cl|LOOP}}
    {{Cl|END}} {{Cl|IF}}
    a2$ = a2$ + {{Cl|UCASE$}}({{Cl|MID$ (function)|MID$}}(a$, i, {{Cl|LEN}}(a$) - i + {{Text|1|#F580B1}}))
    {{Text|eleucase$|#55FF55}} = a2$
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|SUB}} {{Text|SetDependency|#55FF55}} (requirement)
    {{Cl|IF}} requirement {{Cl|THEN}}
        DEPENDENCY(requirement) = {{Text|1|#F580B1}}
    {{Cl|END}} {{Cl|IF}}
{{Cl|END}} {{Cl|SUB}}
{{Text|<nowiki>'Steve Subs/Functins for _MATH support with CONST</nowiki>|#919191}}
{{Cl|FUNCTION}} {{Text|Evaluate_Expression$|#55FF55}} (e$)
    t$ = e$ {{Text|<nowiki>'So we preserve our original data, we parse a temp copy of it</nowiki>|#919191}}
    {{Text|PreParse|#55FF55}} t$
    {{Cl|IF}} {{Cl|LEFT$}}(t$, {{Text|5|#F580B1}}) = {{Text|<nowiki>"ERROR"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Evaluate_Expression$|#55FF55}} = t$: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Text|<nowiki>'Deal with brackets first</nowiki>|#919191}}
    exp$ = {{Text|<nowiki>"("</nowiki>|#FFB100}} + t$ + {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Text|<nowiki>'Starting and finishing brackets for our parse routine.</nowiki>|#919191}}
    {{Cl|DO}}
        Eval_E = {{Cl|INSTR}}(exp$, {{Text|<nowiki>")"</nowiki>|#FFB100}})
        {{Cl|IF}} Eval_E > {{Text|0|#F580B1}} {{Cl|THEN}}
            c = {{Text|0|#F580B1}}
            {{Cl|DO}} {{Cl|UNTIL}} Eval_E - c <= {{Text|0|#F580B1}}
                c = c + {{Text|1|#F580B1}}
                {{Cl|IF}} Eval_E {{Cl|THEN}}
                    {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(exp$, Eval_E - c, {{Text|1|#F580B1}}) = {{Text|<nowiki>"("</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|DO}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|LOOP}}
            s = Eval_E - c + {{Text|1|#F580B1}}
            {{Cl|IF}} s < {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|Evaluate_Expression$|#55FF55}} = {{Text|<nowiki>"ERROR -- BAD () Count"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            eval$ = {{Text|<nowiki>" "</nowiki>|#FFB100}} + {{Cl|MID$ (function)|MID$}}(exp$, s, Eval_E - s) + {{Text|<nowiki>" "</nowiki>|#FFB100}} {{Text|<nowiki>'pad with a space before and after so the parser can pick up the values properly.</nowiki>|#919191}}
            {{Text|ParseExpression|#55FF55}} eval$
            eval$ = {{Cl|LTRIM$}}({{Cl|RTRIM$}}(eval$))
            {{Cl|IF}} {{Cl|LEFT$}}(eval$, {{Text|5|#F580B1}}) = {{Text|<nowiki>"ERROR"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|Evaluate_Expression$|#55FF55}} = eval$: {{Cl|EXIT}} {{Cl|FUNCTION}}
            exp$ = {{Text|DWD|#55FF55}}({{Cl|LEFT$}}(exp$, s - {{Text|2|#F580B1}}) + eval$ + {{Cl|MID$ (function)|MID$}}(exp$, Eval_E + {{Text|1|#F580B1}}))
            {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(exp$, {{Text|1|#F580B1}}, {{Text|1|#F580B1}}) = {{Text|<nowiki>"N"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|MID$}}(exp$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"-"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|LOOP}} {{Cl|UNTIL}} Eval_E = {{Text|0|#F580B1}}
    c = {{Text|0|#F580B1}}
    {{Cl|DO}}
        c = c + {{Text|1|#F580B1}}
        {{Cl|SELECT}} {{Cl|CASE}} {{Cl|MID$}}(exp$, c, {{Text|1|#F580B1}})
            {{Cl|CASE}} {{Text|<nowiki>"0"</nowiki>|#FFB100}} {{Cl|TO}} {{Text|<nowiki>"9"</nowiki>|#FFB100}}, {{Text|<nowiki>"."</nowiki>|#FFB100}}, {{Text|<nowiki>"-"</nowiki>|#FFB100}} {{Text|<nowiki>'At this point, we should only have number values left.</nowiki>|#919191}}
            {{Cl|CASE}} {{Cl|ELSE}}: {{Text|Evaluate_Expression$|#55FF55}} = {{Text|<nowiki>"ERROR - Unknown Diagnosis: ("</nowiki>|#FFB100}} + exp$ + {{Text|<nowiki>") "</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|SELECT}}
    {{Cl|LOOP}} {{Cl|UNTIL}} c >= {{Cl|LEN}}(exp$)
    {{Text|Evaluate_Expression$|#55FF55}} = exp$
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|SUB}} {{Text|ParseExpression|#55FF55}} (exp$)
    {{Cl|DIM}} num({{Text|10|#F580B1}}) {{Cl|AS}} {{Cl|STRING}}
    {{Text|<nowiki>'PRINT exp$</nowiki>|#919191}}
    exp$ = {{Text|DWD|#55FF55}}(exp$)
    {{Text|<nowiki>'We should now have an expression with no () to deal with</nowiki>|#919191}}
    {{Cl|FOR}} J = {{Text|1|#F580B1}} {{Cl|TO}} {{Text|250|#F580B1}}
        lowest = {{Text|0|#F580B1}}
        {{Cl|DO}} {{Cl|UNTIL}} lowest = {{Cl|LEN}}(exp$)
            lowest = {{Cl|LEN}}(exp$): OpOn = {{Text|0|#F580B1}}
            {{Cl|FOR}} P = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|UBOUND}}(OName)
                {{Text|<nowiki>'Look for first valid operator</nowiki>|#919191}}
                {{Cl|IF}} J = PL(P) {{Cl|THEN}} {{Text|<nowiki>'Priority levels match</nowiki>|#919191}}
                    {{Cl|IF}} {{Cl|LEFT$}}(exp$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"-"</nowiki>|#FFB100}} {{Cl|THEN}} startAt = {{Text|2|#F580B1}} {{Cl|ELSE}} startAt = {{Text|1|#F580B1}}
                    op = {{Cl|INSTR}}(startAt, exp$, OName(P))
                    {{Cl|IF}} op = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|LEFT$}}(OName(P), {{Text|1|#F580B1}}) = {{Text|<nowiki>"_"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|THEN}}
                        {{Text|<nowiki>'try again without prefix</nowiki>|#919191}}
                        op = {{Cl|INSTR}}(startAt, exp$, {{Cl|MID$ (function)|MID$}}(OName(P), {{Text|2|#F580B1}}))
                        {{Cl|IF}} op > {{Text|0|#F580B1}} {{Cl|THEN}}
                            exp$ = {{Cl|LEFT$}}(exp$, op - {{Text|1|#F580B1}}) + {{Text|<nowiki>"_"</nowiki>|#FFB100}} + {{Cl|MID$ (function)|MID$}}(exp$, op)
                            lowest = lowest + {{Text|1|#F580B1}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} op > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} op < lowest {{Cl|THEN}} lowest = op: OpOn = P
                {{Cl|END}} {{Cl|IF}}
            {{Cl|NEXT}}
            {{Cl|IF}} OpOn = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|DO}} {{Text|<nowiki>'We haven't gotten to the proper PL for this OP to be processed yet.</nowiki>|#919191}}
            {{Cl|IF}} {{Cl|LEFT$}}(exp$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"-"</nowiki>|#FFB100}} {{Cl|THEN}} startAt = {{Text|2|#F580B1}} {{Cl|ELSE}} startAt = {{Text|1|#F580B1}}
            op = {{Cl|INSTR}}(startAt, exp$, OName(OpOn))
            numset = {{Text|0|#F580B1}}
            {{Text|<nowiki>'*** SPECIAL OPERATION RULESETS</nowiki>|#919191}}
            {{Cl|IF}} OName(OpOn) = {{Text|<nowiki>"-"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|<nowiki>'check for BOOLEAN operators before the -</nowiki>|#919191}}
                {{Cl|SELECT}} {{Cl|CASE}} {{Cl|MID$}}(exp$, op - {{Text|3|#F580B1}}, {{Text|3|#F580B1}})
                    {{Cl|CASE}} {{Text|<nowiki>"NOT"</nowiki>|#FFB100}}, {{Text|<nowiki>"XOR"</nowiki>|#FFB100}}, {{Text|<nowiki>"AND"</nowiki>|#FFB100}}, {{Text|<nowiki>"EQV"</nowiki>|#FFB100}}, {{Text|<nowiki>"IMP"</nowiki>|#FFB100}}
                        {{Cl|EXIT}} {{Cl|DO}} {{Text|<nowiki>'Not an operator, it's a negative</nowiki>|#919191}}
                {{Cl|END}} {{Cl|SELECT}}
                {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(exp$, op - {{Text|3|#F580B1}}, {{Text|2|#F580B1}}) = {{Text|<nowiki>"OR"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|DO}} {{Text|<nowiki>'Not an operator, it's a negative</nowiki>|#919191}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} op {{Cl|THEN}}
                c = {{Cl|LEN}}(OName(OpOn)) - {{Text|1|#F580B1}}
                {{Cl|DO}}
                    {{Cl|SELECT}} {{Cl|CASE}} {{Cl|MID$}}(exp$, op + c + {{Text|1|#F580B1}}, {{Text|1|#F580B1}})
                        {{Cl|CASE}} {{Text|<nowiki>"0"</nowiki>|#FFB100}}, {{Text|<nowiki>"1"</nowiki>|#FFB100}}, {{Text|<nowiki>"2"</nowiki>|#FFB100}}, {{Text|<nowiki>"3"</nowiki>|#FFB100}}, {{Text|<nowiki>"4"</nowiki>|#FFB100}}, {{Text|<nowiki>"5"</nowiki>|#FFB100}}, {{Text|<nowiki>"6"</nowiki>|#FFB100}}, {{Text|<nowiki>"7"</nowiki>|#FFB100}}, {{Text|<nowiki>"8"</nowiki>|#FFB100}}, {{Text|<nowiki>"9"</nowiki>|#FFB100}}, {{Text|<nowiki>"."</nowiki>|#FFB100}}, {{Text|<nowiki>"N"</nowiki>|#FFB100}}: numset = {{Text|-1|#F580B1}} {{Text|<nowiki>'Valid digit</nowiki>|#919191}}
                        {{Cl|CASE}} {{Text|<nowiki>"-"</nowiki>|#FFB100}} {{Text|<nowiki>'We need to check if it's a minus or a negative</nowiki>|#919191}}
                            {{Cl|IF}} OName(OpOn) = {{Text|<nowiki>"_PI"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} numset {{Cl|THEN}} {{Cl|EXIT}} {{Cl|DO}}
                        {{Cl|CASE}} {{Text|<nowiki>","</nowiki>|#FFB100}}: numset = {{Text|0|#F580B1}}
                        {{Cl|CASE}} {{Cl|ELSE}} {{Text|<nowiki>'Not a valid digit, we found our separator</nowiki>|#919191}}
                            {{Cl|EXIT}} {{Cl|DO}}
                    {{Cl|END}} {{Cl|SELECT}}
                    c = c + {{Text|1|#F580B1}}
                {{Cl|LOOP}} {{Cl|UNTIL}} op + c >= {{Cl|LEN}}(exp$)
                E = op + c
                c = {{Text|0|#F580B1}}
                {{Cl|DO}}
                    c = c + {{Text|1|#F580B1}}
                    {{Cl|SELECT}} {{Cl|CASE}} {{Cl|MID$}}(exp$, op - c, {{Text|1|#F580B1}})
                        {{Cl|CASE}} {{Text|<nowiki>"0"</nowiki>|#FFB100}}, {{Text|<nowiki>"1"</nowiki>|#FFB100}}, {{Text|<nowiki>"2"</nowiki>|#FFB100}}, {{Text|<nowiki>"3"</nowiki>|#FFB100}}, {{Text|<nowiki>"4"</nowiki>|#FFB100}}, {{Text|<nowiki>"5"</nowiki>|#FFB100}}, {{Text|<nowiki>"6"</nowiki>|#FFB100}}, {{Text|<nowiki>"7"</nowiki>|#FFB100}}, {{Text|<nowiki>"8"</nowiki>|#FFB100}}, {{Text|<nowiki>"9"</nowiki>|#FFB100}}, {{Text|<nowiki>"."</nowiki>|#FFB100}}, {{Text|<nowiki>"N"</nowiki>|#FFB100}} {{Text|<nowiki>'Valid digit</nowiki>|#919191}}
                        {{Cl|CASE}} {{Text|<nowiki>"-"</nowiki>|#FFB100}} {{Text|<nowiki>'We need to check if it's a minus or a negative</nowiki>|#919191}}
                            c1 = c
                            bad = {{Text|0|#F580B1}}
                            {{Cl|DO}}
                                c1 = c1 + {{Text|1|#F580B1}}
                                {{Cl|SELECT}} {{Cl|CASE}} {{Cl|MID$}}(exp$, op - c1, {{Text|1|#F580B1}})
                                    {{Cl|CASE}} {{Text|<nowiki>"0"</nowiki>|#FFB100}}, {{Text|<nowiki>"1"</nowiki>|#FFB100}}, {{Text|<nowiki>"2"</nowiki>|#FFB100}}, {{Text|<nowiki>"3"</nowiki>|#FFB100}}, {{Text|<nowiki>"4"</nowiki>|#FFB100}}, {{Text|<nowiki>"5"</nowiki>|#FFB100}}, {{Text|<nowiki>"6"</nowiki>|#FFB100}}, {{Text|<nowiki>"7"</nowiki>|#FFB100}}, {{Text|<nowiki>"8"</nowiki>|#FFB100}}, {{Text|<nowiki>"9"</nowiki>|#FFB100}}, {{Text|<nowiki>"."</nowiki>|#FFB100}}
                                        bad = {{Text|-1|#F580B1}}
                                        {{Cl|EXIT}} {{Cl|DO}} {{Text|<nowiki>'It's a minus sign</nowiki>|#919191}}
                                    {{Cl|CASE}} {{Cl|ELSE}}
                                        {{Text|<nowiki>'It's a negative sign and needs to count as part of our numbers</nowiki>|#919191}}
                                {{Cl|END}} {{Cl|SELECT}}
                            {{Cl|LOOP}} {{Cl|UNTIL}} op - c1 <= {{Text|0|#F580B1}}
                            {{Cl|IF}} bad {{Cl|THEN}} {{Cl|EXIT}} {{Cl|DO}} {{Text|<nowiki>'We found our seperator</nowiki>|#919191}}
                        {{Cl|CASE}} {{Cl|ELSE}} {{Text|<nowiki>'Not a valid digit, we found our separator</nowiki>|#919191}}
                            {{Cl|EXIT}} {{Cl|DO}}
                    {{Cl|END}} {{Cl|SELECT}}
                {{Cl|LOOP}} {{Cl|UNTIL}} op - c <= {{Text|0|#F580B1}}
                s = op - c
                num({{Text|1|#F580B1}}) = {{Cl|MID$ (function)|MID$}}(exp$, s + {{Text|1|#F580B1}}, op - s - {{Text|1|#F580B1}}) {{Text|<nowiki>'Get our first number</nowiki>|#919191}}
                num({{Text|2|#F580B1}}) = {{Cl|MID$ (function)|MID$}}(exp$, op + {{Cl|LEN}}(OName(OpOn)), E - op - {{Cl|LEN}}(OName(OpOn)) + {{Text|1|#F580B1}}) {{Text|<nowiki>'Get our second number</nowiki>|#919191}}
                {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(num({{Text|1|#F580B1}}), {{Text|1|#F580B1}}, {{Text|1|#F580B1}}) = {{Text|<nowiki>"N"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|MID$}}(num({{Text|1|#F580B1}}), {{Text|1|#F580B1}}) = {{Text|<nowiki>"-"</nowiki>|#FFB100}}
                {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(num({{Text|2|#F580B1}}), {{Text|1|#F580B1}}, {{Text|1|#F580B1}}) = {{Text|<nowiki>"N"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|MID$}}(num({{Text|2|#F580B1}}), {{Text|1|#F580B1}}) = {{Text|<nowiki>"-"</nowiki>|#FFB100}}
                {{Cl|IF}} num({{Text|1|#F580B1}}) = {{Text|<nowiki>"-"</nowiki>|#FFB100}} {{Cl|THEN}}
                    num({{Text|3|#F580B1}}) = {{Text|<nowiki>"N"</nowiki>|#FFB100}} + {{Text|EvaluateNumbers|#55FF55}}(OpOn, num())
                {{Cl|ELSE}}
                    num({{Text|3|#F580B1}}) = {{Text|EvaluateNumbers|#55FF55}}(OpOn, num())
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(num({{Text|3|#F580B1}}), {{Text|1|#F580B1}}, {{Text|1|#F580B1}}) = {{Text|<nowiki>"-"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|MID$}}(num({{Text|3|#F580B1}}), {{Text|1|#F580B1}}) = {{Text|<nowiki>"N"</nowiki>|#FFB100}}
                {{Cl|IF}} {{Cl|LEFT$}}(num({{Text|3|#F580B1}}), {{Text|5|#F580B1}}) = {{Text|<nowiki>"ERROR"</nowiki>|#FFB100}} {{Cl|THEN}} exp$ = num({{Text|3|#F580B1}}): {{Cl|EXIT}} {{Cl|SUB}}
                exp$ = {{Cl|LTRIM$}}({{Text|N2S|#55FF55}}({{Text|DWD|#55FF55}}({{Cl|LEFT$}}(exp$, s) + {{Cl|RTRIM$}}({{Cl|LTRIM$}}(num({{Text|3|#F580B1}}))) + {{Cl|MID$ (function)|MID$}}(exp$, E + {{Text|1|#F580B1}}))))
            {{Cl|END}} {{Cl|IF}}
            op = {{Text|0|#F580B1}}
        {{Cl|LOOP}}
    {{Cl|NEXT}}
{{Cl|END}} {{Cl|SUB}}
{{Cl|SUB}} {{Text|Set_OrderOfOperations|#55FF55}}
    {{Text|<nowiki>'PL sets our priortity level. 1 is highest to 65535 for the lowest.</nowiki>|#919191}}
    {{Text|<nowiki>'I used a range here so I could add in new priority levels as needed.</nowiki>|#919191}}
    {{Text|<nowiki>'OName ended up becoming the name of our commands, as I modified things.... Go figure!  LOL!</nowiki>|#919191}}
    {{Cl|REDIM}} OName({{Text|10000|#F580B1}}) {{Cl|AS}} {{Cl|STRING}}, PL({{Text|10000|#F580B1}}) {{Cl|AS}} {{Cl|INTEGER}}
    {{Text|<nowiki>'Constants get evaluated first, with a Priority Level of 1</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"C_UOF"</nowiki>|#FFB100}}: PL(i) = {{Text|5|#F580B1}} {{Text|<nowiki>'convert to unsigned offset</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"C_OF"</nowiki>|#FFB100}}: PL(i) = {{Text|5|#F580B1}} {{Text|<nowiki>'convert to offset</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"C_UBY"</nowiki>|#FFB100}}: PL(i) = {{Text|5|#F580B1}} {{Text|<nowiki>'convert to unsigned byte</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"C_BY"</nowiki>|#FFB100}}: PL(i) = {{Text|5|#F580B1}} {{Text|<nowiki>'convert to byte</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"C_UIN"</nowiki>|#FFB100}}: PL(i) = {{Text|5|#F580B1}} {{Text|<nowiki>'convert to unsigned integer</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"C_IN"</nowiki>|#FFB100}}: PL(i) = {{Text|5|#F580B1}} {{Text|<nowiki>'convert to integer</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"C_UIF"</nowiki>|#FFB100}}: PL(i) = {{Text|5|#F580B1}} {{Text|<nowiki>'convert to unsigned int64</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"C_IF"</nowiki>|#FFB100}}: PL(i) = {{Text|5|#F580B1}} {{Text|<nowiki>'convert to int64</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"C_ULO"</nowiki>|#FFB100}}: PL(i) = {{Text|5|#F580B1}} {{Text|<nowiki>'convert to unsigned long</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"C_LO"</nowiki>|#FFB100}}: PL(i) = {{Text|5|#F580B1}} {{Text|<nowiki>'convert to long</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"C_SI"</nowiki>|#FFB100}}: PL(i) = {{Text|5|#F580B1}} {{Text|<nowiki>'convert to single</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"C_FL"</nowiki>|#FFB100}}: PL(i) = {{Text|5|#F580B1}} {{Text|<nowiki>'convert to float</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"C_DO"</nowiki>|#FFB100}}: PL(i) = {{Text|5|#F580B1}} {{Text|<nowiki>'convert to double</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"C_UBI"</nowiki>|#FFB100}}: PL(i) = {{Text|5|#F580B1}} {{Text|<nowiki>'convert to unsigned bit</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"C_BI"</nowiki>|#FFB100}}: PL(i) = {{Text|5|#F580B1}} {{Text|<nowiki>'convert to bit</nowiki>|#919191}}
    {{Text|<nowiki>'Then Functions with PL 10</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}:: OName(i) = {{Text|<nowiki>"_PI"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"_ACOS"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"_ASIN"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"_ARCSEC"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"_ARCCSC"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"_ARCCOT"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"_SECH"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"_CSCH"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"_COTH"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"COS"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"SIN"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"TAN"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"LOG"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"EXP"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"ATN"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"_D2R"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"_D2G"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"_R2D"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"_R2G"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"_G2D"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"_G2R"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"ABS"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"SGN"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"INT"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"_ROUND"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"_CEIL"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"FIX"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"_SEC"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"_CSC"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"_COT"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"ASC"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"C_RG"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}} {{Text|<nowiki>'_RGB32 converted</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"C_RA"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}} {{Text|<nowiki>'_RGBA32 converted</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"_RGBA"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"_RGB"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"C_RX"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}} {{Text|<nowiki>'_RED32 converted</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"C_GR"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}} {{Text|<nowiki>' _GREEN32 converted</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"C_BL"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}} {{Text|<nowiki>'_BLUE32 converted</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"C_AL"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}} {{Text|<nowiki>'_ALPHA32 converted</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"_RED"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"_GREEN"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"_BLUE"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"_ALPHA"</nowiki>|#FFB100}}: PL(i) = {{Text|10|#F580B1}}
    {{Text|<nowiki>'Exponents with PL 20</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"^"</nowiki>|#FFB100}}: PL(i) = {{Text|20|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"SQR"</nowiki>|#FFB100}}: PL(i) = {{Text|20|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"ROOT"</nowiki>|#FFB100}}: PL(i) = {{Text|20|#F580B1}}
    {{Text|<nowiki>'Multiplication and Division PL 30</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"*"</nowiki>|#FFB100}}: PL(i) = {{Text|30|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"/"</nowiki>|#FFB100}}: PL(i) = {{Text|30|#F580B1}}
    {{Text|<nowiki>'Integer Division PL 40</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"\"</nowiki>|#FFB100}}: PL(i) = {{Text|40|#F580B1}}
    {{Text|<nowiki>'MOD PL 50</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"MOD"</nowiki>|#FFB100}}: PL(i) = {{Text|50|#F580B1}}
    {{Text|<nowiki>'Addition and Subtraction PL 60</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"+"</nowiki>|#FFB100}}: PL(i) = {{Text|60|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"-"</nowiki>|#FFB100}}: PL(i) = {{Text|60|#F580B1}}
    {{Text|<nowiki>'Relational Operators =, >, <, <>, <=, >=  PL 70</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"<>"</nowiki>|#FFB100}}: PL(i) = {{Text|70|#F580B1}} {{Text|<nowiki>'These next three are just reversed symbols as an attempt to help process a common typo</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"><"</nowiki>|#FFB100}}: PL(i) = {{Text|70|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"<="</nowiki>|#FFB100}}: PL(i) = {{Text|70|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>">="</nowiki>|#FFB100}}: PL(i) = {{Text|70|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"=<"</nowiki>|#FFB100}}: PL(i) = {{Text|70|#F580B1}} {{Text|<nowiki>'I personally can never keep these things straight.  Is it < = or = <...</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"=>"</nowiki>|#FFB100}}: PL(i) = {{Text|70|#F580B1}} {{Text|<nowiki>'Who knows, check both!</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>">"</nowiki>|#FFB100}}: PL(i) = {{Text|70|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"<"</nowiki>|#FFB100}}: PL(i) = {{Text|70|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"="</nowiki>|#FFB100}}: PL(i) = {{Text|70|#F580B1}}
    {{Text|<nowiki>'Logical Operations PL 80+</nowiki>|#919191}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"NOT"</nowiki>|#FFB100}}: PL(i) = {{Text|80|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"AND"</nowiki>|#FFB100}}: PL(i) = {{Text|90|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"OR"</nowiki>|#FFB100}}: PL(i) = {{Text|100|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"XOR"</nowiki>|#FFB100}}: PL(i) = {{Text|110|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"EQV"</nowiki>|#FFB100}}: PL(i) = {{Text|120|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>"IMP"</nowiki>|#FFB100}}: PL(i) = {{Text|130|#F580B1}}
    i = i + {{Text|1|#F580B1}}: OName(i) = {{Text|<nowiki>","</nowiki>|#FFB100}}: PL(i) = {{Text|1000|#F580B1}}
    {{Cl|REDIM}} {{Cl|_PRESERVE}} OName(i) {{Cl|AS}} {{Cl|STRING}}, PL(i) {{Cl|AS}} {{Cl|INTEGER}}
{{Cl|END}} {{Cl|SUB}}
{{Cl|FUNCTION}} {{Text|EvaluateNumbers$|#55FF55}} (p, num() {{Cl|AS}} {{Cl|STRING}})
    {{Cl|DIM}} n1 {{Cl|AS}} {{Cl|_FLOAT}}, n2 {{Cl|AS}} {{Cl|_FLOAT}}, n3 {{Cl|AS}} {{Cl|_FLOAT}}
    {{Text|<nowiki>'PRINT "EVALNUM:"; OName(p), num(1), num(2)</nowiki>|#919191}}
    {{Cl|IF}} {{Cl|_TRIM$}}(num({{Text|1|#F580B1}})) = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} num({{Text|1|#F580B1}}) = {{Text|<nowiki>"0"</nowiki>|#FFB100}}
    {{Cl|IF}} PL(p) >= {{Text|20|#F580B1}} {{Cl|AND (boolean)|AND}} ({{Cl|LEN}}({{Cl|_TRIM$}}(num({{Text|1|#F580B1}}))) = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} {{Cl|LEN}}({{Cl|_TRIM$}}(num({{Text|2|#F580B1}}))) = {{Text|0|#F580B1}}) {{Cl|THEN}}
        {{Text|EvaluateNumbers$|#55FF55}} = {{Text|<nowiki>"ERROR - Missing operand"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} {{Cl|INSTR}}(num({{Text|1|#F580B1}}), {{Text|<nowiki>","</nowiki>|#FFB100}}) {{Cl|THEN}}
        {{Text|EvaluateNumbers$|#55FF55}} = {{Text|<nowiki>"ERROR - Invalid comma ("</nowiki>|#FFB100}} + num({{Text|1|#F580B1}}) + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    l2 = {{Cl|INSTR}}(num({{Text|2|#F580B1}}), {{Text|<nowiki>","</nowiki>|#FFB100}})
    {{Cl|IF}} l2 {{Cl|THEN}}
        {{Cl|SELECT}} {{Cl|CASE}} OName(p) {{Text|<nowiki>'only certain commands should pass a comma value</nowiki>|#919191}}
            {{Cl|CASE}} {{Text|<nowiki>"C_RG"</nowiki>|#FFB100}}, {{Text|<nowiki>"C_RA"</nowiki>|#FFB100}}, {{Text|<nowiki>"_RGB"</nowiki>|#FFB100}}, {{Text|<nowiki>"_RGBA"</nowiki>|#FFB100}}, {{Text|<nowiki>"_RED"</nowiki>|#FFB100}}, {{Text|<nowiki>"_GREEN"</nowiki>|#FFB100}}, {{Text|<nowiki>"_BLUE"</nowiki>|#FFB100}}, {{Text|<nowiki>"C_BL"</nowiki>|#FFB100}}, {{Text|<nowiki>"_ALPHA"</nowiki>|#FFB100}}
            {{Cl|CASE}} {{Cl|ELSE}}
                C$ = {{Cl|MID$ (function)|MID$}}(num({{Text|2|#F580B1}}), l2)
                num({{Text|2|#F580B1}}) = {{Cl|LEFT$}}(num({{Text|2|#F580B1}}), l2 - {{Text|1|#F580B1}})
        {{Cl|END}} {{Cl|SELECT}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|SELECT}} {{Cl|CASE}} PL(p) {{Text|<nowiki>'divide up the work so we want do as much case checking</nowiki>|#919191}}
        {{Cl|CASE}} {{Text|5|#F580B1}} {{Text|<nowiki>'Type conversions</nowiki>|#919191}}
            {{Text|<nowiki>'Note, these are special cases and work with the number BEFORE the command and not after</nowiki>|#919191}}
            {{Cl|SELECT}} {{Cl|CASE}} OName(p) {{Text|<nowiki>'Depending on our operator..</nowiki>|#919191}}
                {{Cl|CASE}} {{Text|<nowiki>"C_UOF"</nowiki>|#FFB100}}: n1~%& = {{Cl|VAL}}(num({{Text|1|#F580B1}})): {{Text|EvaluateNumbers$|#55FF55}} = {{Cl|RTRIM$}}({{Cl|LTRIM$}}({{Cl|STR$}}(n1~%&)))
                {{Cl|CASE}} {{Text|<nowiki>"C_ULO"</nowiki>|#FFB100}}: n1%& = {{Cl|VAL}}(num({{Text|1|#F580B1}})): {{Text|EvaluateNumbers$|#55FF55}} = {{Cl|RTRIM$}}({{Cl|LTRIM$}}({{Cl|STR$}}(n1%&)))
                {{Cl|CASE}} {{Text|<nowiki>"C_UBY"</nowiki>|#FFB100}}: n1~%% = {{Cl|VAL}}(num({{Text|1|#F580B1}})): {{Text|EvaluateNumbers$|#55FF55}} = {{Cl|RTRIM$}}({{Cl|LTRIM$}}({{Cl|STR$}}(n1~%%)))
                {{Cl|CASE}} {{Text|<nowiki>"C_UIN"</nowiki>|#FFB100}}: n1~% = {{Cl|VAL}}(num({{Text|1|#F580B1}})): {{Text|EvaluateNumbers$|#55FF55}} = {{Cl|RTRIM$}}({{Cl|LTRIM$}}({{Cl|STR$}}(n1~%)))
                {{Cl|CASE}} {{Text|<nowiki>"C_BY"</nowiki>|#FFB100}}: n1%% = {{Cl|VAL}}(num({{Text|1|#F580B1}})): {{Text|EvaluateNumbers$|#55FF55}} = {{Cl|RTRIM$}}({{Cl|LTRIM$}}({{Cl|STR$}}(n1%%)))
                {{Cl|CASE}} {{Text|<nowiki>"C_IN"</nowiki>|#FFB100}}: n1% = {{Cl|VAL}}(num({{Text|1|#F580B1}})): {{Text|EvaluateNumbers$|#55FF55}} = {{Cl|RTRIM$}}({{Cl|LTRIM$}}({{Cl|STR$}}(n1%)))
                {{Cl|CASE}} {{Text|<nowiki>"C_UIF"</nowiki>|#FFB100}}: n1~&& = {{Cl|VAL}}(num({{Text|1|#F580B1}})): {{Text|EvaluateNumbers$|#55FF55}} = {{Cl|RTRIM$}}({{Cl|LTRIM$}}({{Cl|STR$}}(n1~&&)))
                {{Cl|CASE}} {{Text|<nowiki>"C_OF"</nowiki>|#FFB100}}: n1~& = {{Cl|VAL}}(num({{Text|1|#F580B1}})): {{Text|EvaluateNumbers$|#55FF55}} = {{Cl|RTRIM$}}({{Cl|LTRIM$}}({{Cl|STR$}}(n1~&)))
                {{Cl|CASE}} {{Text|<nowiki>"C_IF"</nowiki>|#FFB100}}: n1&& = {{Cl|VAL}}(num({{Text|1|#F580B1}})): {{Text|EvaluateNumbers$|#55FF55}} = {{Cl|RTRIM$}}({{Cl|LTRIM$}}({{Cl|STR$}}(n1&&)))
                {{Cl|CASE}} {{Text|<nowiki>"C_LO"</nowiki>|#FFB100}}: n1& = {{Cl|VAL}}(num({{Text|1|#F580B1}})): {{Text|EvaluateNumbers$|#55FF55}} = {{Cl|RTRIM$}}({{Cl|LTRIM$}}({{Cl|STR$}}(n1&)))
                {{Cl|CASE}} {{Text|<nowiki>"C_UBI"</nowiki>|#FFB100}}: n1~` = {{Cl|VAL}}(num({{Text|1|#F580B1}})): {{Text|EvaluateNumbers$|#55FF55}} = {{Cl|RTRIM$}}({{Cl|LTRIM$}}({{Cl|STR$}}(n1~`)))
                {{Cl|CASE}} {{Text|<nowiki>"C_BI"</nowiki>|#FFB100}}: n1` = {{Cl|VAL}}(num({{Text|1|#F580B1}})): {{Text|EvaluateNumbers$|#55FF55}} = {{Cl|RTRIM$}}({{Cl|LTRIM$}}({{Cl|STR$}}(n1`)))
                {{Cl|CASE}} {{Text|<nowiki>"C_FL"</nowiki>|#FFB100}}: n1## = {{Cl|VAL}}(num({{Text|1|#F580B1}})): {{Text|EvaluateNumbers$|#55FF55}} = {{Cl|RTRIM$}}({{Cl|LTRIM$}}({{Cl|STR$}}(n1##)))
                {{Cl|CASE}} {{Text|<nowiki>"C_DO"</nowiki>|#FFB100}}: n1# = {{Cl|VAL}}(num({{Text|1|#F580B1}})): {{Text|EvaluateNumbers$|#55FF55}} = {{Cl|RTRIM$}}({{Cl|LTRIM$}}({{Cl|STR$}}(n1#)))
                {{Cl|CASE}} {{Text|<nowiki>"C_SI"</nowiki>|#FFB100}}: n1! = {{Cl|VAL}}(num({{Text|1|#F580B1}})): {{Text|EvaluateNumbers$|#55FF55}} = {{Cl|RTRIM$}}({{Cl|LTRIM$}}({{Cl|STR$}}(n1!)))
            {{Cl|END}} {{Cl|SELECT}}
            {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|CASE}} {{Text|10|#F580B1}} {{Text|<nowiki>'functions</nowiki>|#919191}}
            {{Cl|SELECT}} {{Cl|CASE}} OName(p) {{Text|<nowiki>'Depending on our operator..</nowiki>|#919191}}
                {{Cl|CASE}} {{Text|<nowiki>"_PI"</nowiki>|#FFB100}}
                    n1 = {{Text|3.14159265358979323846264338327950288##|#F580B1}} {{Text|<nowiki>'Future compatable in case something ever stores extra digits for PI</nowiki>|#919191}}
                    {{Cl|IF}} num({{Text|2|#F580B1}}) <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} n1 = n1 * {{Cl|VAL}}(num({{Text|2|#F580B1}}))
                {{Cl|CASE}} {{Text|<nowiki>"_ACOS"</nowiki>|#FFB100}}: n1 = {{Cl|_ACOS}}({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"_ASIN"</nowiki>|#FFB100}}: n1 = {{Cl|_ASIN}}({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"_ARCSEC"</nowiki>|#FFB100}}: n1 = {{Cl|Mathematical Operations#Derived_Mathematical_Functions|_ARCSEC}}({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"_ARCCSC"</nowiki>|#FFB100}}: n1 = {{Cl|Mathematical Operations#Derived_Mathematical_Functions|_ARCCSC}}({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"_ARCCOT"</nowiki>|#FFB100}}: n1 = {{Cl|Mathematical Operations#Derived_Mathematical_Functions|_ARCCOT}}({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"_SECH"</nowiki>|#FFB100}}: n1 = {{Cl|Mathematical Operations#Derived_Mathematical_Functions|_SECH}}({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"_CSCH"</nowiki>|#FFB100}}: n1 = {{Cl|Mathematical Operations#Derived_Mathematical_Functions|_CSCH}}({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"_COTH"</nowiki>|#FFB100}}: n1 = {{Cl|Mathematical Operations#Derived_Mathematical_Functions|_COTH}}({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"C_RG"</nowiki>|#FFB100}}
                    n$ = num({{Text|2|#F580B1}})
                    {{Cl|IF}} n$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|EvaluateNumbers$|#55FF55}} = {{Text|<nowiki>"ERROR - Invalid null _RGB32"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    c1 = {{Cl|INSTR}}(n$, {{Text|<nowiki>","</nowiki>|#FFB100}})
                    {{Cl|IF}} c1 {{Cl|THEN}} c2 = {{Cl|INSTR}}(c1 + {{Text|1|#F580B1}}, n$, {{Text|<nowiki>","</nowiki>|#FFB100}})
                    {{Cl|IF}} c2 {{Cl|THEN}} c3 = {{Cl|INSTR}}(c2 + {{Text|1|#F580B1}}, n$, {{Text|<nowiki>","</nowiki>|#FFB100}})
                    {{Cl|IF}} c3 {{Cl|THEN}} c4 = {{Cl|INSTR}}(c3 + {{Text|1|#F580B1}}, n$, {{Text|<nowiki>","</nowiki>|#FFB100}})
                    {{Cl|IF}} c1 = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'there's no comma in the command to parse.  It's a grayscale value</nowiki>|#919191}}
                        n = {{Cl|VAL}}(num({{Text|2|#F580B1}}))
                        n1 = {{Cl|_RGB32}}(n, n, n)
                    {{Cl|ELSEIF}} c2 = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'there's one comma and not 2.  It's grayscale with alpha.</nowiki>|#919191}}
                        n = {{Cl|VAL}}({{Cl|LEFT$}}(num({{Text|2|#F580B1}}), c1))
                        n2 = {{Cl|VAL}}({{Cl|MID$ (function)|MID$}}(num({{Text|2|#F580B1}}), c1 + {{Text|1|#F580B1}}))
                        n1 = {{Cl|_RGBA32}}(n, n, n, n2)
                    {{Cl|ELSEIF}} c3 = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'there's two commas.  It's _RGB values</nowiki>|#919191}}
                        n = {{Cl|VAL}}({{Cl|LEFT$}}(num({{Text|2|#F580B1}}), c1))
                        n2 = {{Cl|VAL}}({{Cl|MID$ (function)|MID$}}(num({{Text|2|#F580B1}}), c1 + {{Text|1|#F580B1}}))
                        n3 = {{Cl|VAL}}({{Cl|MID$ (function)|MID$}}(num({{Text|2|#F580B1}}), c2 + {{Text|1|#F580B1}}))
                        n1 = {{Cl|_RGB32}}(n, n2, n3)
                    {{Cl|ELSEIF}} c4 = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'there's three commas.  It's _RGBA values</nowiki>|#919191}}
                        n = {{Cl|VAL}}({{Cl|LEFT$}}(num({{Text|2|#F580B1}}), c1))
                        n2 = {{Cl|VAL}}({{Cl|MID$ (function)|MID$}}(num({{Text|2|#F580B1}}), c1 + {{Text|1|#F580B1}}))
                        n3 = {{Cl|VAL}}({{Cl|MID$ (function)|MID$}}(num({{Text|2|#F580B1}}), c2 + {{Text|1|#F580B1}}))
                        n4 = {{Cl|VAL}}({{Cl|MID$ (function)|MID$}}(num({{Text|2|#F580B1}}), c3 + {{Text|1|#F580B1}}))
                        n1 = {{Cl|_RGBA32}}(n, n2, n3, n4)
                    {{Cl|ELSE}} {{Text|<nowiki>'we have more than three commas.  I have no idea WTH type of values got passed here!</nowiki>|#919191}}
                        {{Text|EvaluateNumbers$|#55FF55}} = {{Text|<nowiki>"ERROR - Invalid comma count ("</nowiki>|#FFB100}} + num({{Text|2|#F580B1}}) + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|CASE}} {{Text|<nowiki>"C_RA"</nowiki>|#FFB100}}
                    n$ = num({{Text|2|#F580B1}})
                    {{Cl|IF}} n$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|EvaluateNumbers$|#55FF55}} = {{Text|<nowiki>"ERROR - Invalid null _RGBA32"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    c1 = {{Cl|INSTR}}(n$, {{Text|<nowiki>","</nowiki>|#FFB100}})
                    {{Cl|IF}} c1 {{Cl|THEN}} c2 = {{Cl|INSTR}}(c1 + {{Text|1|#F580B1}}, n$, {{Text|<nowiki>","</nowiki>|#FFB100}})
                    {{Cl|IF}} c2 {{Cl|THEN}} c3 = {{Cl|INSTR}}(c2 + {{Text|1|#F580B1}}, n$, {{Text|<nowiki>","</nowiki>|#FFB100}})
                    {{Cl|IF}} c3 {{Cl|THEN}} c4 = {{Cl|INSTR}}(c3 + {{Text|1|#F580B1}}, n$, {{Text|<nowiki>","</nowiki>|#FFB100}})
                    {{Cl|IF}} c3 = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} c4 <> {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|EvaluateNumbers$|#55FF55}} = {{Text|<nowiki>"ERROR - Invalid comma count ("</nowiki>|#FFB100}} + num({{Text|2|#F580B1}}) + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Text|<nowiki>'we have to have 3 commas; not more, not less.</nowiki>|#919191}}
                    n = {{Cl|VAL}}({{Cl|LEFT$}}(num({{Text|2|#F580B1}}), c1))
                    n2 = {{Cl|VAL}}({{Cl|MID$ (function)|MID$}}(num({{Text|2|#F580B1}}), c1 + {{Text|1|#F580B1}}))
                    n3 = {{Cl|VAL}}({{Cl|MID$ (function)|MID$}}(num({{Text|2|#F580B1}}), c2 + {{Text|1|#F580B1}}))
                    n4 = {{Cl|VAL}}({{Cl|MID$ (function)|MID$}}(num({{Text|2|#F580B1}}), c3 + {{Text|1|#F580B1}}))
                    n1 = {{Cl|_RGBA32}}(n, n2, n3, n4)
                {{Cl|CASE}} {{Text|<nowiki>"_RGB"</nowiki>|#FFB100}}
                    n$ = num({{Text|2|#F580B1}})
                    {{Cl|IF}} n$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|EvaluateNumbers$|#55FF55}} = {{Text|<nowiki>"ERROR - Invalid null _RGB"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    c1 = {{Cl|INSTR}}(n$, {{Text|<nowiki>","</nowiki>|#FFB100}})
                    {{Cl|IF}} c1 {{Cl|THEN}} c2 = {{Cl|INSTR}}(c1 + {{Text|1|#F580B1}}, n$, {{Text|<nowiki>","</nowiki>|#FFB100}})
                    {{Cl|IF}} c2 {{Cl|THEN}} c3 = {{Cl|INSTR}}(c2 + {{Text|1|#F580B1}}, n$, {{Text|<nowiki>","</nowiki>|#FFB100}})
                    {{Cl|IF}} c3 {{Cl|THEN}} c4 = {{Cl|INSTR}}(c3 + {{Text|1|#F580B1}}, n$, {{Text|<nowiki>","</nowiki>|#FFB100}})
                    {{Cl|IF}} c3 = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} c4 <> {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|EvaluateNumbers$|#55FF55}} = {{Text|<nowiki>"ERROR - Invalid comma count ("</nowiki>|#FFB100}} + num({{Text|2|#F580B1}}) + {{Text|<nowiki>"). _RGB requires 4 parameters for Red, Green, Blue, ScreenMode."</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Text|<nowiki>'we have to have 3 commas; not more, not less.</nowiki>|#919191}}
                    n = {{Cl|VAL}}({{Cl|LEFT$}}(num({{Text|2|#F580B1}}), c1))
                    n2 = {{Cl|VAL}}({{Cl|MID$ (function)|MID$}}(num({{Text|2|#F580B1}}), c1 + {{Text|1|#F580B1}}))
                    n3 = {{Cl|VAL}}({{Cl|MID$ (function)|MID$}}(num({{Text|2|#F580B1}}), c2 + {{Text|1|#F580B1}}))
                    n4 = {{Cl|VAL}}({{Cl|MID$ (function)|MID$}}(num({{Text|2|#F580B1}}), c3 + {{Text|1|#F580B1}}))
                    {{Cl|SELECT}} {{Cl|CASE}} n4
                        {{Cl|CASE}} {{Text|0|#F580B1}} {{Cl|TO}} {{Text|2|#F580B1}}, {{Text|7|#F580B1}} {{Cl|TO}} {{Text|13|#F580B1}}, {{Text|256|#F580B1}}, {{Text|32|#F580B1}} {{Text|<nowiki>'these are the good screen values</nowiki>|#919191}}
                        {{Cl|CASE}} {{Cl|ELSE}}
                            {{Text|EvaluateNumbers$|#55FF55}} = {{Text|<nowiki>"ERROR - Invalid Screen Mode ("</nowiki>|#FFB100}} + {{Cl|STR$}}(n4) + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|END}} {{Cl|SELECT}}
                    t = {{Cl|_NEWIMAGE}}({{Text|1|#F580B1}}, {{Text|1|#F580B1}}, n4)
                    n1 = {{Cl|_RGB}}(n, n2, n3, t)
                    {{Cl|_FREEIMAGE}} t
                {{Cl|CASE}} {{Text|<nowiki>"_RGBA"</nowiki>|#FFB100}}
                    n$ = num({{Text|2|#F580B1}})
                    {{Cl|IF}} n$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|EvaluateNumbers$|#55FF55}} = {{Text|<nowiki>"ERROR - Invalid null _RGBA"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    c1 = {{Cl|INSTR}}(n$, {{Text|<nowiki>","</nowiki>|#FFB100}})
                    {{Cl|IF}} c1 {{Cl|THEN}} c2 = {{Cl|INSTR}}(c1 + {{Text|1|#F580B1}}, n$, {{Text|<nowiki>","</nowiki>|#FFB100}})
                    {{Cl|IF}} c2 {{Cl|THEN}} c3 = {{Cl|INSTR}}(c2 + {{Text|1|#F580B1}}, n$, {{Text|<nowiki>","</nowiki>|#FFB100}})
                    {{Cl|IF}} c3 {{Cl|THEN}} c4 = {{Cl|INSTR}}(c3 + {{Text|1|#F580B1}}, n$, {{Text|<nowiki>","</nowiki>|#FFB100}})
                    {{Cl|IF}} c4 {{Cl|THEN}} c5 = {{Cl|INSTR}}(c4 + {{Text|1|#F580B1}}, n$, {{Text|<nowiki>","</nowiki>|#FFB100}})
                    {{Cl|IF}} c4 = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} c5 <> {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|EvaluateNumbers$|#55FF55}} = {{Text|<nowiki>"ERROR - Invalid comma count ("</nowiki>|#FFB100}} + num({{Text|2|#F580B1}}) + {{Text|<nowiki>"). _RGBA requires 5 parameters for Red, Green, Blue, Alpha, ScreenMode."</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Text|<nowiki>'we have to have 4 commas; not more, not less.</nowiki>|#919191}}
                    n = {{Cl|VAL}}({{Cl|LEFT$}}(num({{Text|2|#F580B1}}), c1))
                    n2 = {{Cl|VAL}}({{Cl|MID$ (function)|MID$}}(num({{Text|2|#F580B1}}), c1 + {{Text|1|#F580B1}}))
                    n3 = {{Cl|VAL}}({{Cl|MID$ (function)|MID$}}(num({{Text|2|#F580B1}}), c2 + {{Text|1|#F580B1}}))
                    n4 = {{Cl|VAL}}({{Cl|MID$ (function)|MID$}}(num({{Text|2|#F580B1}}), c3 + {{Text|1|#F580B1}}))
                    n5 = {{Cl|VAL}}({{Cl|MID$ (function)|MID$}}(num({{Text|2|#F580B1}}), c4 + {{Text|1|#F580B1}}))
                    {{Cl|SELECT}} {{Cl|CASE}} n5
                        {{Cl|CASE}} {{Text|0|#F580B1}} {{Cl|TO}} {{Text|2|#F580B1}}, {{Text|7|#F580B1}} {{Cl|TO}} {{Text|13|#F580B1}}, {{Text|256|#F580B1}}, {{Text|32|#F580B1}} {{Text|<nowiki>'these are the good screen values</nowiki>|#919191}}
                        {{Cl|CASE}} {{Cl|ELSE}}
                            {{Text|EvaluateNumbers$|#55FF55}} = {{Text|<nowiki>"ERROR - Invalid Screen Mode ("</nowiki>|#FFB100}} + {{Cl|STR$}}(n5) + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|END}} {{Cl|SELECT}}
                    t = {{Cl|_NEWIMAGE}}({{Text|1|#F580B1}}, {{Text|1|#F580B1}}, n5)
                    n1 = {{Cl|_RGBA}}(n, n2, n3, n4, t)
                    {{Cl|_FREEIMAGE}} t
                {{Cl|CASE}} {{Text|<nowiki>"_RED"</nowiki>|#FFB100}}, {{Text|<nowiki>"_GREEN"</nowiki>|#FFB100}}, {{Text|<nowiki>"_BLUE"</nowiki>|#FFB100}}, {{Text|<nowiki>"_ALPHA"</nowiki>|#FFB100}}
                    n$ = num({{Text|2|#F580B1}})
                    {{Cl|IF}} n$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|EvaluateNumbers$|#55FF55}} = {{Text|<nowiki>"ERROR - Invalid null "</nowiki>|#FFB100}} + OName(p): {{Cl|EXIT}} {{Cl|FUNCTION}}
                    c1 = {{Cl|INSTR}}(n$, {{Text|<nowiki>","</nowiki>|#FFB100}})
                    {{Cl|IF}} c1 = {{Text|0|#F580B1}} {{Cl|THEN}} {{Text|EvaluateNumbers$|#55FF55}} = {{Text|<nowiki>"ERROR - "</nowiki>|#FFB100}} + OName(p) + {{Text|<nowiki>" requires 2 parameters for Color, ScreenMode."</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|IF}} c1 {{Cl|THEN}} c2 = {{Cl|INSTR}}(c1 + {{Text|1|#F580B1}}, n$, {{Text|<nowiki>","</nowiki>|#FFB100}})
                    {{Cl|IF}} c2 {{Cl|THEN}} {{Text|EvaluateNumbers$|#55FF55}} = {{Text|<nowiki>"ERROR - "</nowiki>|#FFB100}} + OName(p) + {{Text|<nowiki>" requires 2 parameters for Color, ScreenMode."</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    n = {{Cl|VAL}}({{Cl|LEFT$}}(num({{Text|2|#F580B1}}), c1))
                    n2 = {{Cl|VAL}}({{Cl|MID$ (function)|MID$}}(num({{Text|2|#F580B1}}), c1 + {{Text|1|#F580B1}}))
                    {{Cl|SELECT}} {{Cl|CASE}} n2
                        {{Cl|CASE}} {{Text|0|#F580B1}} {{Cl|TO}} {{Text|2|#F580B1}}, {{Text|7|#F580B1}} {{Cl|TO}} {{Text|13|#F580B1}}, {{Text|256|#F580B1}}, {{Text|32|#F580B1}} {{Text|<nowiki>'these are the good screen values</nowiki>|#919191}}
                        {{Cl|CASE}} {{Cl|ELSE}}
                            {{Text|EvaluateNumbers$|#55FF55}} = {{Text|<nowiki>"ERROR - Invalid Screen Mode ("</nowiki>|#FFB100}} + {{Cl|STR$}}(n2) + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|END}} {{Cl|SELECT}}
                    t = {{Cl|_NEWIMAGE}}({{Text|1|#F580B1}}, {{Text|1|#F580B1}}, n4)
                    {{Cl|SELECT}} {{Cl|CASE}} OName(p)
                        {{Cl|CASE}} {{Text|<nowiki>"_RED"</nowiki>|#FFB100}}: n1 = {{Cl|_RED}}(n, t)
                        {{Cl|CASE}} {{Text|<nowiki>"_BLUE"</nowiki>|#FFB100}}: n1 = {{Cl|_BLUE}}(n, t)
                        {{Cl|CASE}} {{Text|<nowiki>"_GREEN"</nowiki>|#FFB100}}: n1 = {{Cl|_GREEN}}(n, t)
                        {{Cl|CASE}} {{Text|<nowiki>"_ALPHA"</nowiki>|#FFB100}}: n1 = {{Cl|_ALPHA}}(n, t)
                    {{Cl|END}} {{Cl|SELECT}}
                    {{Cl|_FREEIMAGE}} t
                {{Cl|CASE}} {{Text|<nowiki>"C_RX"</nowiki>|#FFB100}}, {{Text|<nowiki>"C_GR"</nowiki>|#FFB100}}, {{Text|<nowiki>"C_BL"</nowiki>|#FFB100}}, {{Text|<nowiki>"C_AL"</nowiki>|#FFB100}}
                    n$ = num({{Text|2|#F580B1}})
                    {{Cl|IF}} n$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|EvaluateNumbers$|#55FF55}} = {{Text|<nowiki>"ERROR - Invalid null "</nowiki>|#FFB100}} + OName(p): {{Cl|EXIT}} {{Cl|FUNCTION}}
                    n = {{Cl|VAL}}(num({{Text|2|#F580B1}}))
                    {{Cl|SELECT}} {{Cl|CASE}} OName(p)
                        {{Cl|CASE}} {{Text|<nowiki>"C_RX"</nowiki>|#FFB100}}: n1 = {{Cl|_RED32}}(n)
                        {{Cl|CASE}} {{Text|<nowiki>"C_BL"</nowiki>|#FFB100}}: n1 = {{Cl|_BLUE32}}(n)
                        {{Cl|CASE}} {{Text|<nowiki>"C_GR"</nowiki>|#FFB100}}: n1 = {{Cl|_GREEN32}}(n)
                        {{Cl|CASE}} {{Text|<nowiki>"C_AL"</nowiki>|#FFB100}}: n1 = {{Cl|_ALPHA32}}(n)
                    {{Cl|END}} {{Cl|SELECT}}
                {{Cl|CASE}} {{Text|<nowiki>"COS"</nowiki>|#FFB100}}: n1 = {{Cl|COS}}({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"SIN"</nowiki>|#FFB100}}: n1 = {{Cl|SIN}}({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"TAN"</nowiki>|#FFB100}}: n1 = {{Cl|TAN}}({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"LOG"</nowiki>|#FFB100}}: n1 = {{Cl|LOG}}({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"EXP"</nowiki>|#FFB100}}: n1 = {{Cl|EXP}}({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"ATN"</nowiki>|#FFB100}}: n1 = {{Cl|ATN}}({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"_D2R"</nowiki>|#FFB100}}: n1 = {{Text|0.0174532925|#F580B1}} * ({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"_D2G"</nowiki>|#FFB100}}: n1 = {{Text|1.1111111111|#F580B1}} * ({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"_R2D"</nowiki>|#FFB100}}: n1 = {{Text|57.2957795|#F580B1}} * ({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"_R2G"</nowiki>|#FFB100}}: n1 = {{Text|0.015707963|#F580B1}} * ({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"_G2D"</nowiki>|#FFB100}}: n1 = {{Text|0.9|#F580B1}} * ({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"_G2R"</nowiki>|#FFB100}}: n1 = {{Text|63.661977237|#F580B1}} * ({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"ABS"</nowiki>|#FFB100}}: n1 = {{Cl|ABS}}({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"SGN"</nowiki>|#FFB100}}: n1 = {{Cl|SGN}}({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"INT"</nowiki>|#FFB100}}: n1 = {{Cl|INT}}({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"_ROUND"</nowiki>|#FFB100}}: n1 = {{Cl|_ROUND}}({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"_CEIL"</nowiki>|#FFB100}}: n1 = {{Cl|_CEIL}}({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"FIX"</nowiki>|#FFB100}}: n1 = {{Cl|FIX}}({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"_SEC"</nowiki>|#FFB100}}: n1 = {{Cl|Mathematical Operations#Derived_Mathematical_Functions|_SEC}}({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"_CSC"</nowiki>|#FFB100}}: n1 = {{Cl|Mathematical Operations#Derived_Mathematical_Functions|_CSC}}({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"_COT"</nowiki>|#FFB100}}: n1 = {{Cl|Mathematical Operations#Derived_Mathematical_Functions|_COT}}({{Cl|VAL}}(num({{Text|2|#F580B1}})))
            {{Cl|END}} {{Cl|SELECT}}
        {{Cl|CASE}} {{Text|20|#F580B1}} {{Cl|TO}} {{Text|60|#F580B1}} {{Text|<nowiki>'Math Operators</nowiki>|#919191}}
            {{Cl|SELECT}} {{Cl|CASE}} OName(p) {{Text|<nowiki>'Depending on our operator..</nowiki>|#919191}}
                {{Cl|CASE}} {{Text|<nowiki>"^"</nowiki>|#FFB100}}: n1 = {{Cl|VAL}}(num({{Text|1|#F580B1}})) ^ {{Cl|VAL}}(num({{Text|2|#F580B1}}))
                {{Cl|CASE}} {{Text|<nowiki>"SQR"</nowiki>|#FFB100}}: n1 = {{Cl|SQR}}({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"ROOT"</nowiki>|#FFB100}}
                    n1 = {{Cl|VAL}}(num({{Text|1|#F580B1}})): n2 = {{Cl|VAL}}(num({{Text|2|#F580B1}}))
                    {{Cl|IF}} n2 = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|EvaluateNumbers$|#55FF55}} = {{Cl|RTRIM$}}({{Cl|LTRIM$}}({{Cl|STR$}}(n1))): {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|IF}} n1 < {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} n2 >= {{Text|1|#F580B1}} {{Cl|THEN}} sign = {{Text|-1|#F580B1}}: n1 = -n1 {{Cl|ELSE}} sign = {{Text|1|#F580B1}}
                    n3 = {{Text|1##|#F580B1}} / n2
                    {{Cl|IF}} n3 <> {{Cl|INT}}(n3) {{Cl|AND (boolean)|AND}} n2 < {{Text|1|#F580B1}} {{Cl|THEN}} sign = {{Cl|SGN}}(n1): n1 = {{Cl|ABS}}(n1)
                    n1 = sign * (n1 ^ n3)
                {{Cl|CASE}} {{Text|<nowiki>"*"</nowiki>|#FFB100}}: n1 = {{Cl|VAL}}(num({{Text|1|#F580B1}})) * {{Cl|VAL}}(num({{Text|2|#F580B1}}))
                {{Cl|CASE}} {{Text|<nowiki>"/"</nowiki>|#FFB100}}
                    {{Cl|IF}} {{Cl|VAL}}(num({{Text|2|#F580B1}})) <> {{Text|0|#F580B1}} {{Cl|THEN}}
                        n1 = {{Cl|VAL}}(num({{Text|1|#F580B1}})) / {{Cl|VAL}}(num({{Text|2|#F580B1}}))
                    {{Cl|ELSE}}
                        {{Text|EvaluateNumbers$|#55FF55}} = {{Text|<nowiki>"ERROR - Division By Zero"</nowiki>|#FFB100}}
                        {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|CASE}} {{Text|<nowiki>"\"</nowiki>|#FFB100}}
                    {{Cl|IF}} {{Cl|FIX}}({{Cl|VAL}}(num({{Text|2|#F580B1}}))) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Text|EvaluateNumbers$|#55FF55}} = {{Text|<nowiki>"ERROR - Division By Zero"</nowiki>|#FFB100}}
                        {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|END}} {{Cl|IF}}
                    n1 = {{Cl|VAL}}(num({{Text|1|#F580B1}})) \ {{Cl|FIX}}({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"MOD"</nowiki>|#FFB100}}
                    {{Cl|IF}} {{Cl|FIX}}({{Cl|VAL}}(num({{Text|2|#F580B1}}))) = {{Text|0|#F580B1}} {{Cl|THEN}}
                        {{Text|EvaluateNumbers$|#55FF55}} = {{Text|<nowiki>"ERROR - Division By Zero"</nowiki>|#FFB100}}
                        {{Cl|EXIT}} {{Cl|FUNCTION}}
                    {{Cl|END}} {{Cl|IF}}
                    n1 = {{Cl|VAL}}(num({{Text|1|#F580B1}})) {{Cl|MOD}} {{Cl|FIX}}({{Cl|VAL}}(num({{Text|2|#F580B1}})))
                {{Cl|CASE}} {{Text|<nowiki>"+"</nowiki>|#FFB100}}: n1 = {{Cl|VAL}}(num({{Text|1|#F580B1}})) + {{Cl|VAL}}(num({{Text|2|#F580B1}}))
                {{Cl|CASE}} {{Text|<nowiki>"-"</nowiki>|#FFB100}}:
                    n1 = {{Cl|VAL}}(num({{Text|1|#F580B1}})) - {{Cl|VAL}}(num({{Text|2|#F580B1}}))
            {{Cl|END}} {{Cl|SELECT}}
        {{Cl|CASE}} {{Text|70|#F580B1}} {{Text|<nowiki>'Relational Operators =, >, <, <>, <=, >=</nowiki>|#919191}}
            {{Cl|SELECT}} {{Cl|CASE}} OName(p) {{Text|<nowiki>'Depending on our operator..</nowiki>|#919191}}
                {{Cl|CASE}} {{Text|<nowiki>"="</nowiki>|#FFB100}}: n1 = {{Cl|VAL}}(num({{Text|1|#F580B1}})) = {{Cl|VAL}}(num({{Text|2|#F580B1}}))
                {{Cl|CASE}} {{Text|<nowiki>">"</nowiki>|#FFB100}}: n1 = {{Cl|VAL}}(num({{Text|1|#F580B1}})) > {{Cl|VAL}}(num({{Text|2|#F580B1}}))
                {{Cl|CASE}} {{Text|<nowiki>"<"</nowiki>|#FFB100}}: n1 = {{Cl|VAL}}(num({{Text|1|#F580B1}})) < {{Cl|VAL}}(num({{Text|2|#F580B1}}))
                {{Cl|CASE}} {{Text|<nowiki>"<>"</nowiki>|#FFB100}}, {{Text|<nowiki>"><"</nowiki>|#FFB100}}: n1 = {{Cl|VAL}}(num({{Text|1|#F580B1}})) <> {{Cl|VAL}}(num({{Text|2|#F580B1}}))
                {{Cl|CASE}} {{Text|<nowiki>"<="</nowiki>|#FFB100}}, {{Text|<nowiki>"=<"</nowiki>|#FFB100}}: n1 = {{Cl|VAL}}(num({{Text|1|#F580B1}})) <= {{Cl|VAL}}(num({{Text|2|#F580B1}}))
                {{Cl|CASE}} {{Text|<nowiki>">="</nowiki>|#FFB100}}, {{Text|<nowiki>"=>"</nowiki>|#FFB100}}: n1 = {{Cl|VAL}}(num({{Text|1|#F580B1}})) >= {{Cl|VAL}}(num({{Text|2|#F580B1}}))
            {{Cl|END}} {{Cl|SELECT}}
        {{Cl|CASE}} {{Cl|ELSE}} {{Text|<nowiki>'a value we haven't processed elsewhere</nowiki>|#919191}}
            {{Cl|SELECT}} {{Cl|CASE}} OName(p) {{Text|<nowiki>'Depending on our operator..</nowiki>|#919191}}
                {{Cl|CASE}} {{Text|<nowiki>"NOT"</nowiki>|#FFB100}}: n1 = {{Cl|NOT}} {{Cl|VAL}}(num({{Text|2|#F580B1}}))
                {{Cl|CASE}} {{Text|<nowiki>"AND"</nowiki>|#FFB100}}: n1 = {{Cl|VAL}}(num({{Text|1|#F580B1}})) {{Cl|AND}} {{Cl|VAL}}(num({{Text|2|#F580B1}}))
                {{Cl|CASE}} {{Text|<nowiki>"OR"</nowiki>|#FFB100}}: n1 = {{Cl|VAL}}(num({{Text|1|#F580B1}})) {{Cl|OR}} {{Cl|VAL}}(num({{Text|2|#F580B1}}))
                {{Cl|CASE}} {{Text|<nowiki>"XOR"</nowiki>|#FFB100}}: n1 = {{Cl|VAL}}(num({{Text|1|#F580B1}})) {{Cl|XOR}} {{Cl|VAL}}(num({{Text|2|#F580B1}}))
                {{Cl|CASE}} {{Text|<nowiki>"EQV"</nowiki>|#FFB100}}: n1 = {{Cl|VAL}}(num({{Text|1|#F580B1}})) {{Cl|EQV}} {{Cl|VAL}}(num({{Text|2|#F580B1}}))
                {{Cl|CASE}} {{Text|<nowiki>"IMP"</nowiki>|#FFB100}}: n1 = {{Cl|VAL}}(num({{Text|1|#F580B1}})) {{Cl|IMP}} {{Cl|VAL}}(num({{Text|2|#F580B1}}))
            {{Cl|END}} {{Cl|SELECT}}
    {{Cl|END}} {{Cl|SELECT}}
    {{Text|EvaluateNumbers$|#55FF55}} = {{Cl|RTRIM$}}({{Cl|LTRIM$}}({{Cl|STR$}}(n1))) + C$
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|DWD$|#55FF55}} (exp$) {{Text|<nowiki>'Deal With Duplicates</nowiki>|#919191}}
    {{Text|<nowiki>'To deal with duplicate operators in our code.</nowiki>|#919191}}
    {{Text|<nowiki>'Such as --  becomes a +</nowiki>|#919191}}
    {{Text|<nowiki>'++ becomes a +</nowiki>|#919191}}
    {{Text|<nowiki>'+- becomes a -</nowiki>|#919191}}
    {{Text|<nowiki>'-+ becomes a -</nowiki>|#919191}}
    t$ = exp$
    {{Cl|DO}}
        bad = {{Text|0|#F580B1}}
        {{Cl|DO}}
            l = {{Cl|INSTR}}(t$, {{Text|<nowiki>"++"</nowiki>|#FFB100}})
            {{Cl|IF}} l {{Cl|THEN}} t$ = {{Cl|LEFT$}}(t$, l - {{Text|1|#F580B1}}) + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + {{Cl|MID$ (function)|MID$}}(t$, l + {{Text|2|#F580B1}}): bad = {{Text|-1|#F580B1}}
        {{Cl|LOOP}} {{Cl|UNTIL}} l = {{Text|0|#F580B1}}
        {{Cl|DO}}
            l = {{Cl|INSTR}}(t$, {{Text|<nowiki>"+-"</nowiki>|#FFB100}})
            {{Cl|IF}} l {{Cl|THEN}} t$ = {{Cl|LEFT$}}(t$, l - {{Text|1|#F580B1}}) + {{Text|<nowiki>"-"</nowiki>|#FFB100}} + {{Cl|MID$ (function)|MID$}}(t$, l + {{Text|2|#F580B1}}): bad = {{Text|-1|#F580B1}}
        {{Cl|LOOP}} {{Cl|UNTIL}} l = {{Text|0|#F580B1}}
        {{Cl|DO}}
            l = {{Cl|INSTR}}(t$, {{Text|<nowiki>"-+"</nowiki>|#FFB100}})
            {{Cl|IF}} l {{Cl|THEN}} t$ = {{Cl|LEFT$}}(t$, l - {{Text|1|#F580B1}}) + {{Text|<nowiki>"-"</nowiki>|#FFB100}} + {{Cl|MID$ (function)|MID$}}(t$, l + {{Text|2|#F580B1}}): bad = {{Text|-1|#F580B1}}
        {{Cl|LOOP}} {{Cl|UNTIL}} l = {{Text|0|#F580B1}}
        {{Cl|DO}}
            l = {{Cl|INSTR}}(t$, {{Text|<nowiki>"--"</nowiki>|#FFB100}})
            {{Cl|IF}} l {{Cl|THEN}} t$ = {{Cl|LEFT$}}(t$, l - {{Text|1|#F580B1}}) + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + {{Cl|MID$ (function)|MID$}}(t$, l + {{Text|2|#F580B1}}): bad = {{Text|-1|#F580B1}}
        {{Cl|LOOP}} {{Cl|UNTIL}} l = {{Text|0|#F580B1}}
    {{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|NOT}} bad
    {{Text|DWD$|#55FF55}} = t$
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|SUB}} {{Text|PreParse|#55FF55}} (e$)
    {{Cl|DIM}} f {{Cl|AS}} {{Cl|_FLOAT}}
    {{Cl|STATIC}} TotalPrefixedPP_TypeMod {{Cl|AS}} {{Cl|LONG}}, TotalPP_TypeMod {{Cl|AS}} {{Cl|LONG}}
    {{Cl|IF}} PP_TypeMod({{Text|0|#F580B1}}) = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
        {{Cl|REDIM}} PP_TypeMod({{Text|100|#F580B1}}) {{Cl|AS}} {{Cl|STRING}}, PP_ConvertedMod({{Text|100|#F580B1}}) {{Cl|AS}} {{Cl|STRING}} {{Text|<nowiki>'Large enough to hold all values to begin with</nowiki>|#919191}}
        PP_TypeMod({{Text|0|#F580B1}}) = {{Text|<nowiki>"Initialized"</nowiki>|#FFB100}} {{Text|<nowiki>'Set so we don't do this section over and over, as we keep the values in shared memory.</nowiki>|#919191}}
        {{Text|<nowiki>'and the below is a conversion list so symbols don't get cross confused.</nowiki>|#919191}}
        i = i + {{Text|1|#F580B1}}: PP_TypeMod(i) = {{Text|<nowiki>"~`"</nowiki>|#FFB100}}: PP_ConvertedMod(i) = {{Text|<nowiki>"C_UBI"</nowiki>|#FFB100}} {{Text|<nowiki>'unsigned bit</nowiki>|#919191}}
        i = i + {{Text|1|#F580B1}}: PP_TypeMod(i) = {{Text|<nowiki>"~%%"</nowiki>|#FFB100}}: PP_ConvertedMod(i) = {{Text|<nowiki>"C_UBY"</nowiki>|#FFB100}} {{Text|<nowiki>'unsigned byte</nowiki>|#919191}}
        i = i + {{Text|1|#F580B1}}: PP_TypeMod(i) = {{Text|<nowiki>"~%&"</nowiki>|#FFB100}}: PP_ConvertedMod(i) = {{Text|<nowiki>"C_UOF"</nowiki>|#FFB100}} {{Text|<nowiki>'unsigned offset</nowiki>|#919191}}
        i = i + {{Text|1|#F580B1}}: PP_TypeMod(i) = {{Text|<nowiki>"~%"</nowiki>|#FFB100}}: PP_ConvertedMod(i) = {{Text|<nowiki>"C_UIN"</nowiki>|#FFB100}} {{Text|<nowiki>'unsigned integer</nowiki>|#919191}}
        i = i + {{Text|1|#F580B1}}: PP_TypeMod(i) = {{Text|<nowiki>"~&&"</nowiki>|#FFB100}}: PP_ConvertedMod(i) = {{Text|<nowiki>"C_UIF"</nowiki>|#FFB100}} {{Text|<nowiki>'unsigned integer64</nowiki>|#919191}}
        i = i + {{Text|1|#F580B1}}: PP_TypeMod(i) = {{Text|<nowiki>"~&"</nowiki>|#FFB100}}: PP_ConvertedMod(i) = {{Text|<nowiki>"C_ULO"</nowiki>|#FFB100}} {{Text|<nowiki>'unsigned long</nowiki>|#919191}}
        i = i + {{Text|1|#F580B1}}: PP_TypeMod(i) = {{Text|<nowiki>"`"</nowiki>|#FFB100}}: PP_ConvertedMod(i) = {{Text|<nowiki>"C_BI"</nowiki>|#FFB100}} {{Text|<nowiki>'bit</nowiki>|#919191}}
        i = i + {{Text|1|#F580B1}}: PP_TypeMod(i) = {{Text|<nowiki>"%%"</nowiki>|#FFB100}}: PP_ConvertedMod(i) = {{Text|<nowiki>"C_BY"</nowiki>|#FFB100}} {{Text|<nowiki>'byte</nowiki>|#919191}}
        i = i + {{Text|1|#F580B1}}: PP_TypeMod(i) = {{Text|<nowiki>"%&"</nowiki>|#FFB100}}: PP_ConvertedMod(i) = {{Text|<nowiki>"C_OF"</nowiki>|#FFB100}} {{Text|<nowiki>'offset</nowiki>|#919191}}
        i = i + {{Text|1|#F580B1}}: PP_TypeMod(i) = {{Text|<nowiki>"%"</nowiki>|#FFB100}}: PP_ConvertedMod(i) = {{Text|<nowiki>"C_IN"</nowiki>|#FFB100}} {{Text|<nowiki>'integer</nowiki>|#919191}}
        i = i + {{Text|1|#F580B1}}: PP_TypeMod(i) = {{Text|<nowiki>"&&"</nowiki>|#FFB100}}: PP_ConvertedMod(i) = {{Text|<nowiki>"C_IF"</nowiki>|#FFB100}} {{Text|<nowiki>'integer64</nowiki>|#919191}}
        i = i + {{Text|1|#F580B1}}: PP_TypeMod(i) = {{Text|<nowiki>"&"</nowiki>|#FFB100}}: PP_ConvertedMod(i) = {{Text|<nowiki>"C_LO"</nowiki>|#FFB100}} {{Text|<nowiki>'long</nowiki>|#919191}}
        i = i + {{Text|1|#F580B1}}: PP_TypeMod(i) = {{Text|<nowiki>"!"</nowiki>|#FFB100}}: PP_ConvertedMod(i) = {{Text|<nowiki>"C_SI"</nowiki>|#FFB100}} {{Text|<nowiki>'single</nowiki>|#919191}}
        i = i + {{Text|1|#F580B1}}: PP_TypeMod(i) = {{Text|<nowiki>"##"</nowiki>|#FFB100}}: PP_ConvertedMod(i) = {{Text|<nowiki>"C_FL"</nowiki>|#FFB100}} {{Text|<nowiki>'float</nowiki>|#919191}}
        i = i + {{Text|1|#F580B1}}: PP_TypeMod(i) = {{Text|<nowiki>"#"</nowiki>|#FFB100}}: PP_ConvertedMod(i) = {{Text|<nowiki>"C_DO"</nowiki>|#FFB100}} {{Text|<nowiki>'double</nowiki>|#919191}}
        i = i + {{Text|1|#F580B1}}: PP_TypeMod(i) = {{Text|<nowiki>"_RGB32"</nowiki>|#FFB100}}: PP_ConvertedMod(i) = {{Text|<nowiki>"C_RG"</nowiki>|#FFB100}} {{Text|<nowiki>'rgb32</nowiki>|#919191}}
        i = i + {{Text|1|#F580B1}}: PP_TypeMod(i) = {{Text|<nowiki>"_RGBA32"</nowiki>|#FFB100}}: PP_ConvertedMod(i) = {{Text|<nowiki>"C_RA"</nowiki>|#FFB100}} {{Text|<nowiki>'rgba32</nowiki>|#919191}}
        i = i + {{Text|1|#F580B1}}: PP_TypeMod(i) = {{Text|<nowiki>"_RED32"</nowiki>|#FFB100}}: PP_ConvertedMod(i) = {{Text|<nowiki>"C_RX"</nowiki>|#FFB100}} {{Text|<nowiki>'red32</nowiki>|#919191}}
        i = i + {{Text|1|#F580B1}}: PP_TypeMod(i) = {{Text|<nowiki>"_GREEN32"</nowiki>|#FFB100}}: PP_ConvertedMod(i) = {{Text|<nowiki>"C_GR"</nowiki>|#FFB100}} {{Text|<nowiki>'green32</nowiki>|#919191}}
        i = i + {{Text|1|#F580B1}}: PP_TypeMod(i) = {{Text|<nowiki>"_BLUE32"</nowiki>|#FFB100}}: PP_ConvertedMod(i) = {{Text|<nowiki>"C_BL"</nowiki>|#FFB100}} {{Text|<nowiki>'blue32</nowiki>|#919191}}
        i = i + {{Text|1|#F580B1}}: PP_TypeMod(i) = {{Text|<nowiki>"_ALPHA32"</nowiki>|#FFB100}}: PP_ConvertedMod(i) = {{Text|<nowiki>"C_AL"</nowiki>|#FFB100}} {{Text|<nowiki>'alpha32</nowiki>|#919191}}
        TotalPrefixedPP_TypeMod = i
        i = i + {{Text|1|#F580B1}}: PP_TypeMod(i) = {{Text|<nowiki>"RGB32"</nowiki>|#FFB100}}: PP_ConvertedMod(i) = {{Text|<nowiki>"C_RG"</nowiki>|#FFB100}} {{Text|<nowiki>'rgb32</nowiki>|#919191}}
        i = i + {{Text|1|#F580B1}}: PP_TypeMod(i) = {{Text|<nowiki>"RGBA32"</nowiki>|#FFB100}}: PP_ConvertedMod(i) = {{Text|<nowiki>"C_RA"</nowiki>|#FFB100}} {{Text|<nowiki>'rgba32</nowiki>|#919191}}
        i = i + {{Text|1|#F580B1}}: PP_TypeMod(i) = {{Text|<nowiki>"RED32"</nowiki>|#FFB100}}: PP_ConvertedMod(i) = {{Text|<nowiki>"C_RX"</nowiki>|#FFB100}} {{Text|<nowiki>'red32</nowiki>|#919191}}
        i = i + {{Text|1|#F580B1}}: PP_TypeMod(i) = {{Text|<nowiki>"GREEN32"</nowiki>|#FFB100}}: PP_ConvertedMod(i) = {{Text|<nowiki>"C_GR"</nowiki>|#FFB100}} {{Text|<nowiki>'green32</nowiki>|#919191}}
        i = i + {{Text|1|#F580B1}}: PP_TypeMod(i) = {{Text|<nowiki>"BLUE32"</nowiki>|#FFB100}}: PP_ConvertedMod(i) = {{Text|<nowiki>"C_BL"</nowiki>|#FFB100}} {{Text|<nowiki>'blue32</nowiki>|#919191}}
        i = i + {{Text|1|#F580B1}}: PP_TypeMod(i) = {{Text|<nowiki>"ALPHA32"</nowiki>|#FFB100}}: PP_ConvertedMod(i) = {{Text|<nowiki>"C_AL"</nowiki>|#FFB100}} {{Text|<nowiki>'alpha32</nowiki>|#919191}}
        TotalPP_TypeMod = i
        {{Cl|REDIM}} {{Cl|_PRESERVE}} PP_TypeMod(i) {{Cl|AS}} {{Cl|STRING}}, PP_ConvertedMod(i) {{Cl|AS}} {{Cl|STRING}} {{Text|<nowiki>'And then resized to just contain the necessary space in memory</nowiki>|#919191}}
    {{Cl|END}} {{Cl|IF}}
    t$ = e$
    {{Text|<nowiki>'First strip all spaces</nowiki>|#919191}}
    t$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(e$)
        {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(e$, i, {{Text|1|#F580B1}}) <> {{Text|<nowiki>" "</nowiki>|#FFB100}} {{Cl|THEN}} t$ = t$ + {{Cl|MID$ (function)|MID$}}(e$, i, {{Text|1|#F580B1}})
    {{Cl|NEXT}}
    t$ = {{Cl|UCASE$}}(t$)
    {{Cl|IF}} t$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} e$ = {{Text|<nowiki>"ERROR -- NULL string; nothing to evaluate"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
    {{Text|<nowiki>'ERROR CHECK by counting our brackets</nowiki>|#919191}}
    l = {{Text|0|#F580B1}}
    {{Cl|DO}}
        l = {{Cl|INSTR}}(l + {{Text|1|#F580B1}}, t$, {{Text|<nowiki>"("</nowiki>|#FFB100}}): {{Cl|IF}} l {{Cl|THEN}} c = c + {{Text|1|#F580B1}}
    {{Cl|LOOP}} {{Cl|UNTIL}} l = {{Text|0|#F580B1}}
    l = {{Text|0|#F580B1}}
    {{Cl|DO}}
        l = {{Cl|INSTR}}(l + {{Text|1|#F580B1}}, t$, {{Text|<nowiki>")"</nowiki>|#FFB100}}): {{Cl|IF}} l {{Cl|THEN}} c1 = c1 + {{Text|1|#F580B1}}
    {{Cl|LOOP}} {{Cl|UNTIL}} l = {{Text|0|#F580B1}}
    {{Cl|IF}} c <> c1 {{Cl|THEN}} e$ = {{Text|<nowiki>"ERROR -- Bad Parenthesis:"</nowiki>|#FFB100}} + {{Cl|STR$}}(c) + {{Text|<nowiki>"( vs"</nowiki>|#FFB100}} + {{Cl|STR$}}(c1) + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
    {{Text|<nowiki>'replace existing CONST values</nowiki>|#919191}}
    sep$ = {{Text|<nowiki>"()+-*/\><=^"</nowiki>|#FFB100}}
    {{Cl|FOR}} i2 = {{Text|0|#F580B1}} {{Cl|TO}} constlast
        thisConstName$ = constname(i2)
        {{Cl|FOR}} replaceConstPass = {{Text|1|#F580B1}} {{Cl|TO}} {{Text|2|#F580B1}}
            found = {{Text|0|#F580B1}}
            {{Cl|DO}}
                found = {{Cl|INSTR}}(found + {{Text|1|#F580B1}}, {{Cl|UCASE$}}(t$), thisConstName$)
                {{Cl|IF}} found {{Cl|THEN}}
                    {{Cl|IF}} found > {{Text|1|#F580B1}} {{Cl|THEN}}
                        {{Cl|IF}} {{Cl|INSTR}}(sep$, {{Cl|MID$ (function)|MID$}}(t$, found - {{Text|1|#F580B1}}, {{Text|1|#F580B1}})) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|_CONTINUE}}
                    {{Cl|END}} {{Cl|IF}}
                    {{Cl|IF}} found + {{Cl|LEN}}(thisConstName$) <= {{Cl|LEN}}(t$) {{Cl|THEN}}
                        {{Cl|IF}} {{Cl|INSTR}}(sep$, {{Cl|MID$ (function)|MID$}}(t$, found + {{Cl|LEN}}(thisConstName$), {{Text|1|#F580B1}})) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|_CONTINUE}}
                    {{Cl|END}} {{Cl|IF}}
                    t = consttype(i2)
                    {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
                        r$ = conststring(i2)
                        i4 = {{Cl|_INSTRREV}}(r$, {{Text|<nowiki>","</nowiki>|#FFB100}})
                        r$ = {{Cl|LEFT$}}(r$, i4 - {{Text|1|#F580B1}})
                    {{Cl|ELSE}}
                        {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISFLOAT {{Cl|THEN}}
                            r$ = {{Cl|STR$}}(constfloat(i2))
                            r$ = {{Text|N2S|#55FF55}}(r$)
                        {{Cl|ELSE}}
                            {{Cl|IF}} t {{Cl|AND (boolean)|AND}} ISUNSIGNED {{Cl|THEN}} r$ = {{Cl|STR$}}(constuinteger(i2)) {{Cl|ELSE}} r$ = {{Cl|STR$}}(constinteger(i2))
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                    t$ = {{Cl|LEFT$}}(t$, found - {{Text|1|#F580B1}}) + {{Cl|_TRIM$}}(r$) + {{Cl|MID$ (function)|MID$}}(t$, found + {{Cl|LEN}}(thisConstName$))
                {{Cl|END}} {{Cl|IF}}
            {{Cl|LOOP}} {{Cl|UNTIL}} found = {{Text|0|#F580B1}}
            thisConstName$ = constname(i2) + constnamesymbol(i2)
        {{Cl|NEXT}}
    {{Cl|NEXT}}
    {{Text|<nowiki>'Modify so that NOT will process properly</nowiki>|#919191}}
    l = {{Text|0|#F580B1}}
    {{Cl|DO}}
        l = {{Cl|INSTR}}(l + {{Text|1|#F580B1}}, t$, {{Text|<nowiki>"NOT "</nowiki>|#FFB100}})
        {{Cl|IF}} l {{Cl|THEN}}
            {{Text|<nowiki>'We need to work magic on the statement so it looks pretty.</nowiki>|#919191}}
            {{Text|<nowiki>' 1 + NOT 2 + 1 is actually processed as 1 + (NOT 2 + 1)</nowiki>|#919191}}
            {{Text|<nowiki>'Look for something not proper</nowiki>|#919191}}
            l1 = {{Cl|INSTR}}(l + {{Text|1|#F580B1}}, t$, {{Text|<nowiki>"AND"</nowiki>|#FFB100}})
            {{Cl|IF}} l1 = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} ({{Cl|INSTR}}(l + {{Text|1|#F580B1}}, t$, {{Text|<nowiki>"OR"</nowiki>|#FFB100}}) > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|INSTR}}(l + {{Text|1|#F580B1}}, t$, {{Text|<nowiki>"OR"</nowiki>|#FFB100}}) < l1) {{Cl|THEN}} l1 = {{Cl|INSTR}}(l + {{Text|1|#F580B1}}, t$, {{Text|<nowiki>"OR"</nowiki>|#FFB100}})
            {{Cl|IF}} l1 = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} ({{Cl|INSTR}}(l + {{Text|1|#F580B1}}, t$, {{Text|<nowiki>"XOR"</nowiki>|#FFB100}}) > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|INSTR}}(l + {{Text|1|#F580B1}}, t$, {{Text|<nowiki>"XOR"</nowiki>|#FFB100}}) < l1) {{Cl|THEN}} l1 = {{Cl|INSTR}}(l + {{Text|1|#F580B1}}, t$, {{Text|<nowiki>"XOR"</nowiki>|#FFB100}})
            {{Cl|IF}} l1 = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} ({{Cl|INSTR}}(l + {{Text|1|#F580B1}}, t$, {{Text|<nowiki>"EQV"</nowiki>|#FFB100}}) > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|INSTR}}(l + {{Text|1|#F580B1}}, t$, {{Text|<nowiki>"EQV"</nowiki>|#FFB100}}) < l1) {{Cl|THEN}} l1 = {{Cl|INSTR}}(l + {{Text|1|#F580B1}}, t$, {{Text|<nowiki>"EQV"</nowiki>|#FFB100}})
            {{Cl|IF}} l1 = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} ({{Cl|INSTR}}(l + {{Text|1|#F580B1}}, t$, {{Text|<nowiki>"IMP"</nowiki>|#FFB100}}) > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|INSTR}}(l + {{Text|1|#F580B1}}, t$, {{Text|<nowiki>"IMP"</nowiki>|#FFB100}}) < l1) {{Cl|THEN}} l1 = {{Cl|INSTR}}(l + {{Text|1|#F580B1}}, t$, {{Text|<nowiki>"IMP"</nowiki>|#FFB100}})
            {{Cl|IF}} l1 = {{Text|0|#F580B1}} {{Cl|THEN}} l1 = {{Cl|LEN}}(t$) + {{Text|1|#F580B1}}
            t$ = {{Cl|LEFT$}}(t$, l - {{Text|1|#F580B1}}) + {{Text|<nowiki>"("</nowiki>|#FFB100}} + {{Cl|MID$ (function)|MID$}}(t$, l, l1 - l) + {{Text|<nowiki>")"</nowiki>|#FFB100}} + {{Cl|MID$ (function)|MID$}}(t$, l + l1 - l)
            l = l + {{Text|3|#F580B1}}
            {{Text|<nowiki>'PRINT t$</nowiki>|#919191}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|LOOP}} {{Cl|UNTIL}} l = {{Text|0|#F580B1}}
    uboundPP_TypeMod = TotalPrefixedPP_TypeMod
    {{Cl|IF}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|THEN}} uboundPP_TypeMod = TotalPP_TypeMod
    {{Cl|FOR}} j = {{Text|1|#F580B1}} {{Cl|TO}} uboundPP_TypeMod
        l = {{Text|0|#F580B1}}
        {{Cl|DO}}
            l = {{Cl|INSTR}}(l + {{Text|1|#F580B1}}, t$, PP_TypeMod(j))
            {{Cl|IF}} l = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|DO}}
            i = {{Text|0|#F580B1}}: l1 = {{Text|0|#F580B1}}: l2 = {{Text|0|#F580B1}}: lo = {{Cl|LEN}}(PP_TypeMod(j))
            {{Cl|DO}}
                {{Cl|IF}} PL(i) > {{Text|10|#F580B1}} {{Cl|THEN}}
                    l2 = {{Cl|_INSTRREV}}(l, t$, OName$(i))
                    {{Cl|IF}} l2 > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} l2 > l1 {{Cl|THEN}} l1 = l2
                {{Cl|END}} {{Cl|IF}}
                i = i + lo
            {{Cl|LOOP}} {{Cl|UNTIL}} i > {{Cl|UBOUND}}(PL)
            l$ = {{Cl|LEFT$}}(t$, l1)
            m$ = {{Cl|MID$ (function)|MID$}}(t$, l1 + {{Text|1|#F580B1}}, l - l1 - {{Text|1|#F580B1}})
            r$ = PP_ConvertedMod(j) + {{Cl|MID$ (function)|MID$}}(t$, l + lo)
            {{Cl|IF}} j > {{Text|15|#F580B1}} {{Cl|THEN}}
                t$ = l$ + m$ + r$ {{Text|<nowiki>'replacement routine for commands which might get confused with others, like _RGB and _RGB32</nowiki>|#919191}}
            {{Cl|ELSE}}
                {{Text|<nowiki>'the first 15 commands need to properly place the parenthesis around the value we want to convert.</nowiki>|#919191}}
                t$ = l$ + {{Text|<nowiki>"("</nowiki>|#FFB100}} + m$ + {{Text|<nowiki>")"</nowiki>|#FFB100}} + r$
            {{Cl|END}} {{Cl|IF}}
            l = l + {{Text|2|#F580B1}} + {{Cl|LEN}}(PP_TypeMod(j)) {{Text|<nowiki>'move forward from the length of the symbol we checked + the new "(" and  ")"</nowiki>|#919191}}
        {{Cl|LOOP}}
    {{Cl|NEXT}}
    {{Text|<nowiki>'Check for bad operators before a ( bracket</nowiki>|#919191}}
    l = {{Text|0|#F580B1}}
    {{Cl|DO}}
        l = {{Cl|INSTR}}(l + {{Text|1|#F580B1}}, t$, {{Text|<nowiki>"("</nowiki>|#FFB100}})
        {{Cl|IF}} l > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} l > {{Text|2|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'Don't check the starting bracket; there's nothing before it.</nowiki>|#919191}}
            good = {{Text|0|#F580B1}}
            {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|UBOUND}}(OName)
                m$ = {{Cl|MID$ (function)|MID$}}(t$, l - {{Cl|LEN}}(OName(i)), {{Cl|LEN}}(OName(i)))
                {{Cl|IF}} m$ = OName(i) {{Cl|THEN}}
                    good = {{Text|-1|#F580B1}}: {{Cl|EXIT}} {{Cl|FOR}} {{Text|<nowiki>'We found an operator after our ), and it's not a CONST (like PI)</nowiki>|#919191}}
                {{Cl|ELSE}}
                    {{Cl|IF}} {{Cl|LEFT$}}(OName(i), {{Text|1|#F580B1}}) = {{Text|<nowiki>"_"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|THEN}}
                        {{Text|<nowiki>'try without prefix</nowiki>|#919191}}
                        m$ = {{Cl|MID$ (function)|MID$}}(t$, l - ({{Cl|LEN}}(OName(i)) - {{Text|1|#F580B1}}), {{Cl|LEN}}(OName(i)) - {{Text|1|#F580B1}})
                        {{Cl|IF}} m$ = {{Cl|MID$ (function)|MID$}}(OName(i), {{Text|2|#F580B1}}) {{Cl|THEN}} good = {{Text|-1|#F580B1}}: {{Cl|EXIT}} {{Cl|FOR}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|NEXT}}
            {{Cl|IF}} {{Cl|NOT}} good {{Cl|THEN}} e$ = {{Text|<nowiki>"ERROR - Improper operations before (."</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
            l = l + {{Text|1|#F580B1}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|LOOP}} {{Cl|UNTIL}} l = {{Text|0|#F580B1}}
    {{Text|<nowiki>'Check for bad operators after a ) bracket</nowiki>|#919191}}
    l = {{Text|0|#F580B1}}
    {{Cl|DO}}
        l = {{Cl|INSTR}}(l + {{Text|1|#F580B1}}, t$, {{Text|<nowiki>")"</nowiki>|#FFB100}})
        {{Cl|IF}} l > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} l < {{Cl|LEN}}(t$) {{Cl|THEN}}
            good = {{Text|0|#F580B1}}
            {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|UBOUND}}(OName)
                m$ = {{Cl|MID$ (function)|MID$}}(t$, l + {{Text|1|#F580B1}}, {{Cl|LEN}}(OName(i)))
                {{Cl|IF}} m$ = OName(i) {{Cl|THEN}}
                    good = {{Text|-1|#F580B1}}: {{Cl|EXIT}} {{Cl|FOR}} {{Text|<nowiki>'We found an operator after our ), and it's not a CONST (like PI</nowiki>|#919191}}
                {{Cl|ELSE}}
                    {{Cl|IF}} {{Cl|LEFT$}}(OName(i), {{Text|1|#F580B1}}) = {{Text|<nowiki>"_"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|THEN}}
                        {{Text|<nowiki>'try without prefix</nowiki>|#919191}}
                        m$ = {{Cl|MID$ (function)|MID$}}(t$, l + {{Text|1|#F580B1}}, {{Cl|LEN}}(OName(i)) - {{Text|1|#F580B1}})
                        {{Cl|IF}} m$ = {{Cl|MID$ (function)|MID$}}(OName(i), {{Text|2|#F580B1}}) {{Cl|THEN}} good = {{Text|-1|#F580B1}}: {{Cl|EXIT}} {{Cl|FOR}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|NEXT}}
            {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(t$, l + {{Text|1|#F580B1}}, {{Text|1|#F580B1}}) = {{Text|<nowiki>")"</nowiki>|#FFB100}} {{Cl|THEN}} good = {{Text|-1|#F580B1}}
            {{Cl|IF}} {{Cl|NOT}} good {{Cl|THEN}} e$ = {{Text|<nowiki>"ERROR - Improper operations after )."</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
            l = l + {{Text|1|#F580B1}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|LOOP}} {{Cl|UNTIL}} l = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} l = {{Cl|LEN}}(t$) {{Text|<nowiki>'last symbol is a bracket</nowiki>|#919191}}
    {{Text|<nowiki>'Turn all &H (hex) numbers into decimal values for the program to process properly</nowiki>|#919191}}
    l = {{Text|0|#F580B1}}
    {{Cl|DO}}
        l = {{Cl|INSTR}}(t$, {{Text|<nowiki>"&H"</nowiki>|#FFB100}})
        {{Cl|IF}} l {{Cl|THEN}}
            E = l + {{Text|1|#F580B1}}: finished = {{Text|0|#F580B1}}
            {{Cl|DO}}
                E = E + {{Text|1|#F580B1}}
                comp$ = {{Cl|MID$ (function)|MID$}}(t$, E, {{Text|1|#F580B1}})
                {{Cl|SELECT}} {{Cl|CASE}} comp$
                    {{Cl|CASE}} {{Text|<nowiki>"0"</nowiki>|#FFB100}} {{Cl|TO}} {{Text|<nowiki>"9"</nowiki>|#FFB100}}, {{Text|<nowiki>"A"</nowiki>|#FFB100}} {{Cl|TO}} {{Text|<nowiki>"F"</nowiki>|#FFB100}} {{Text|<nowiki>'All is good, our next digit is a number, continue to add to the hex$</nowiki>|#919191}}
                    {{Cl|CASE}} {{Cl|ELSE}}
                        good = {{Text|0|#F580B1}}
                        {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|UBOUND}}(OName)
                            {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(t$, E, {{Cl|LEN}}(OName(i))) = OName(i) {{Cl|AND (boolean)|AND}} PL(i) > {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} PL(i) <= {{Text|250|#F580B1}} {{Cl|THEN}} good = {{Text|-1|#F580B1}}: {{Cl|EXIT}} {{Cl|FOR}} {{Text|<nowiki>'We found an operator after our ), and it's not a CONST (like PI)</nowiki>|#919191}}
                        {{Cl|NEXT}}
                        {{Cl|IF}} {{Cl|NOT}} good {{Cl|THEN}} e$ = {{Text|<nowiki>"ERROR - Improper &H value. ("</nowiki>|#FFB100}} + comp$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
                        E = E - {{Text|1|#F580B1}}
                        finished = {{Text|-1|#F580B1}}
                {{Cl|END}} {{Cl|SELECT}}
            {{Cl|LOOP}} {{Cl|UNTIL}} finished {{Cl|OR (boolean)|OR}} E = {{Cl|LEN}}(t$)
            t$ = {{Cl|LEFT$}}(t$, l - {{Text|1|#F580B1}}) + {{Cl|LTRIM$}}({{Cl|RTRIM$}}({{Cl|STR$}}({{Cl|VAL}}({{Cl|MID$ (function)|MID$}}(t$, l, E - l + {{Text|1|#F580B1}}))))) + {{Cl|MID$ (function)|MID$}}(t$, E + {{Text|1|#F580B1}})
        {{Cl|END}} {{Cl|IF}}
    {{Cl|LOOP}} {{Cl|UNTIL}} l = {{Text|0|#F580B1}}
    {{Text|<nowiki>'Turn all &B (binary) numbers into decimal values for the program to process properly</nowiki>|#919191}}
    l = {{Text|0|#F580B1}}
    {{Cl|DO}}
        l = {{Cl|INSTR}}(t$, {{Text|<nowiki>"&B"</nowiki>|#FFB100}})
        {{Cl|IF}} l {{Cl|THEN}}
            E = l + {{Text|1|#F580B1}}: finished = {{Text|0|#F580B1}}
            {{Cl|DO}}
                E = E + {{Text|1|#F580B1}}
                comp$ = {{Cl|MID$ (function)|MID$}}(t$, E, {{Text|1|#F580B1}})
                {{Cl|SELECT}} {{Cl|CASE}} comp$
                    {{Cl|CASE}} {{Text|<nowiki>"0"</nowiki>|#FFB100}}, {{Text|<nowiki>"1"</nowiki>|#FFB100}} {{Text|<nowiki>'All is good, our next digit is a number, continue to add to the hex$</nowiki>|#919191}}
                    {{Cl|CASE}} {{Cl|ELSE}}
                        good = {{Text|0|#F580B1}}
                        {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|UBOUND}}(OName)
                            {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(t$, E, {{Cl|LEN}}(OName(i))) = OName(i) {{Cl|AND (boolean)|AND}} PL(i) > {{Text|1|#F580B1}} {{Cl|AND (boolean)|AND}} PL(i) <= {{Text|250|#F580B1}} {{Cl|THEN}} good = {{Text|-1|#F580B1}}: {{Cl|EXIT}} {{Cl|FOR}} {{Text|<nowiki>'We found an operator after our ), and it's not a CONST (like PI)</nowiki>|#919191}}
                        {{Cl|NEXT}}
                        {{Cl|IF}} {{Cl|NOT}} good {{Cl|THEN}} e$ = {{Text|<nowiki>"ERROR - Improper &B value. ("</nowiki>|#FFB100}} + comp$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
                        E = E - {{Text|1|#F580B1}}
                        finished = {{Text|-1|#F580B1}}
                {{Cl|END}} {{Cl|SELECT}}
            {{Cl|LOOP}} {{Cl|UNTIL}} finished {{Cl|OR (boolean)|OR}} E = {{Cl|LEN}}(t$)
            bin$ = {{Cl|MID$ (function)|MID$}}(t$, l + {{Text|2|#F580B1}}, E - l - {{Text|1|#F580B1}})
            {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(bin$)
                {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(bin$, i, {{Text|1|#F580B1}}) = {{Text|<nowiki>"1"</nowiki>|#FFB100}} {{Cl|THEN}} f = f + {{Text|2|#F580B1}} ^ ({{Cl|LEN}}(bin$) - i)
            {{Cl|NEXT}}
            t$ = {{Cl|LEFT$}}(t$, l - {{Text|1|#F580B1}}) + {{Cl|LTRIM$}}({{Cl|RTRIM$}}({{Cl|STR$}}(f))) + {{Cl|MID$ (function)|MID$}}(t$, E + {{Text|1|#F580B1}})
        {{Cl|END}} {{Cl|IF}}
    {{Cl|LOOP}} {{Cl|UNTIL}} l = {{Text|0|#F580B1}}
    {{Text|<nowiki>'t$ = N2S(t$)</nowiki>|#919191}}
    {{Text|VerifyString|#55FF55}} t$
    e$ = t$
{{Cl|END}} {{Cl|SUB}}
{{Cl|SUB}} {{Text|VerifyString|#55FF55}} (t$)
    {{Text|<nowiki>'ERROR CHECK for unrecognized operations</nowiki>|#919191}}
    j = {{Text|1|#F580B1}}
    {{Cl|DO}}
        comp$ = {{Cl|MID$ (function)|MID$}}(t$, j, {{Text|1|#F580B1}})
        {{Cl|SELECT}} {{Cl|CASE}} comp$
            {{Cl|CASE}} {{Text|<nowiki>"0"</nowiki>|#FFB100}} {{Cl|TO}} {{Text|<nowiki>"9"</nowiki>|#FFB100}}, {{Text|<nowiki>"."</nowiki>|#FFB100}}, {{Text|<nowiki>"("</nowiki>|#FFB100}}, {{Text|<nowiki>")"</nowiki>|#FFB100}}, {{Text|<nowiki>","</nowiki>|#FFB100}}: j = j + {{Text|1|#F580B1}}
            {{Cl|CASE}} {{Cl|ELSE}}
                good = {{Text|0|#F580B1}}
                extrachar = {{Text|0|#F580B1}}
                {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|UBOUND}}(OName)
                    {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(t$, j, {{Cl|LEN}}(OName(i))) = OName(i) {{Cl|THEN}}
                        good = {{Text|-1|#F580B1}}: {{Cl|EXIT}} {{Cl|FOR}} {{Text|<nowiki>'We found an operator after our ), and it's not a CONST (like PI)</nowiki>|#919191}}
                    {{Cl|ELSE}}
                        {{Cl|IF}} {{Cl|LEFT$}}(OName(i), {{Text|1|#F580B1}}) = {{Text|<nowiki>"_"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} qb64prefix_set = {{Text|1|#F580B1}} {{Cl|THEN}}
                            {{Text|<nowiki>'try without prefix</nowiki>|#919191}}
                            {{Cl|IF}} {{Cl|MID$ (function)|MID$}}(t$, j, {{Cl|LEN}}(OName(i)) - {{Text|1|#F580B1}}) = {{Cl|MID$ (function)|MID$}}(OName(i), {{Text|2|#F580B1}}) {{Cl|THEN}}
                                good = {{Text|-1|#F580B1}}: extrachar = {{Text|1|#F580B1}}: {{Cl|EXIT}} {{Cl|FOR}}
                            {{Cl|END}} {{Cl|IF}}
                        {{Cl|END}} {{Cl|IF}}
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|NEXT}}
                {{Cl|IF}} {{Cl|NOT}} good {{Cl|THEN}} t$ = {{Text|<nowiki>"ERROR - Bad Operational value. ("</nowiki>|#FFB100}} + comp$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|SUB}}
                j = j + ({{Cl|LEN}}(OName(i)) - extrachar)
        {{Cl|END}} {{Cl|SELECT}}
    {{Cl|LOOP}} {{Cl|UNTIL}} j > {{Cl|LEN}}(t$)
{{Cl|END}} {{Cl|SUB}}
{{Cl|FUNCTION}} {{Text|N2S$|#55FF55}} (exp$) {{Text|<nowiki>'scientific Notation to String</nowiki>|#919191}}
    t$ = {{Cl|LTRIM$}}({{Cl|RTRIM$}}(exp$))
    {{Cl|IF}} {{Cl|LEFT$}}(t$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"-"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} {{Cl|LEFT$}}(t$, {{Text|1|#F580B1}}) = {{Text|<nowiki>"N"</nowiki>|#FFB100}} {{Cl|THEN}} sign$ = {{Text|<nowiki>"-"</nowiki>|#FFB100}}: t$ = {{Cl|MID$ (function)|MID$}}(t$, {{Text|2|#F580B1}})
    dp = {{Cl|INSTR}}(t$, {{Text|<nowiki>"D+"</nowiki>|#FFB100}}): dm = {{Cl|INSTR}}(t$, {{Text|<nowiki>"D-"</nowiki>|#FFB100}})
    ep = {{Cl|INSTR}}(t$, {{Text|<nowiki>"E+"</nowiki>|#FFB100}}): em = {{Cl|INSTR}}(t$, {{Text|<nowiki>"E-"</nowiki>|#FFB100}})
    check1 = {{Cl|SGN}}(dp) + {{Cl|SGN}}(dm) + {{Cl|SGN}}(ep) + {{Cl|SGN}}(em)
    {{Cl|IF}} check1 < {{Text|1|#F580B1}} {{Cl|OR (boolean)|OR}} check1 > {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|N2S|#55FF55}} = exp$: {{Cl|EXIT}} {{Cl|FUNCTION}} {{Text|<nowiki>'If no scientic notation is found, or if we find more than 1 type, it's not SN!</nowiki>|#919191}}
    {{Cl|SELECT}} {{Cl|CASE}} l {{Text|<nowiki>'l now tells us where the SN starts at.</nowiki>|#919191}}
        {{Cl|CASE}} {{Cl|IS}} < dp: l = dp
        {{Cl|CASE}} {{Cl|IS}} < dm: l = dm
        {{Cl|CASE}} {{Cl|IS}} < ep: l = ep
        {{Cl|CASE}} {{Cl|IS}} < em: l = em
    {{Cl|END}} {{Cl|SELECT}}
    l$ = {{Cl|LEFT$}}(t$, l - {{Text|1|#F580B1}}) {{Text|<nowiki>'The left of the SN</nowiki>|#919191}}
    r$ = {{Cl|MID$ (function)|MID$}}(t$, l + {{Text|1|#F580B1}}): r&& = {{Cl|VAL}}(r$) {{Text|<nowiki>'The right of the SN, turned into a workable long</nowiki>|#919191}}
    {{Cl|IF}} {{Cl|INSTR}}(l$, {{Text|<nowiki>"."</nowiki>|#FFB100}}) {{Cl|THEN}} {{Text|<nowiki>'Location of the decimal, if any</nowiki>|#919191}}
        {{Cl|IF}} r&& > {{Text|0|#F580B1}} {{Cl|THEN}}
            r&& = r&& - {{Cl|LEN}}(l$) + {{Text|2|#F580B1}}
        {{Cl|ELSE}}
            r&& = r&& + {{Text|1|#F580B1}}
        {{Cl|END}} {{Cl|IF}}
        l$ = {{Cl|LEFT$}}(l$, {{Text|1|#F580B1}}) + {{Cl|MID$ (function)|MID$}}(l$, {{Text|3|#F580B1}})
    {{Cl|END}} {{Cl|IF}}
    {{Cl|SELECT}} {{Cl|CASE}} r&&
        {{Cl|CASE}} {{Text|0|#F580B1}} {{Text|<nowiki>'what the heck? We solved it already?</nowiki>|#919191}}
            {{Text|<nowiki>'l$ = l$</nowiki>|#919191}}
        {{Cl|CASE}} {{Cl|IS}} < {{Text|0|#F580B1}}
            {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} -r&&
                l$ = {{Text|<nowiki>"0"</nowiki>|#FFB100}} + l$
            {{Cl|NEXT}}
            l$ = {{Text|<nowiki>"0."</nowiki>|#FFB100}} + l$
        {{Cl|CASE}} {{Cl|ELSE}}
            {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} r&&
                l$ = l$ + {{Text|<nowiki>"0"</nowiki>|#FFB100}}
            {{Cl|NEXT}}
    {{Cl|END}} {{Cl|SELECT}}
    {{Text|N2S$|#55FF55}} = sign$ + l$
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|QuotedFilename$|#55FF55}} (f$)
    {{Cl|IF}} os$ = {{Text|<nowiki>"WIN"</nowiki>|#FFB100}} {{Cl|THEN}}
        {{Text|QuotedFilename$|#55FF55}} = {{Cl|CHR$}}({{Text|34|#F580B1}}) + f$ + {{Cl|CHR$}}({{Text|34|#F580B1}})
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|IF}} os$ = {{Text|<nowiki>"LNX"</nowiki>|#FFB100}} {{Cl|THEN}}
        {{Text|QuotedFilename$|#55FF55}} = {{Text|<nowiki>"'"</nowiki>|#FFB100}} + f$ + {{Text|<nowiki>"'"</nowiki>|#FFB100}}
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|HashValue&|#55FF55}} (a$) {{Text|<nowiki>'returns the hash table value of a string</nowiki>|#919191}}
    {{Text|<nowiki>'[5(first)][5(second)][5(last)][5(2nd-last)][3(length AND 7)][1(first char is underscore)]</nowiki>|#919191}}
    l = {{Cl|LEN}}(a$)
    {{Cl|IF}} l = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}} {{Text|<nowiki>'an (invalid) NULL string equates to 0</nowiki>|#919191}}
    a = {{Cl|ASC (function)|ASC}}(a$)
    {{Cl|IF}} a <> {{Text|95|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'does not begin with underscore</nowiki>|#919191}}
        {{Cl|SELECT}} {{Cl|CASE}} l
            {{Cl|CASE}} {{Text|1|#F580B1}}
                {{Text|HashValue&|#55FF55}} = hash1char(a) + {{Text|1048576|#F580B1}}
                {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|CASE}} {{Text|2|#F580B1}}
                {{Text|HashValue&|#55FF55}} = hash2char({{Cl|CVI}}(a$)) + {{Text|2097152|#F580B1}}
                {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|CASE}} {{Text|3|#F580B1}}
                {{Text|HashValue&|#55FF55}} = hash2char({{Cl|CVI}}(a$)) + hash1char({{Cl|ASC (function)|ASC}}(a$, {{Text|3|#F580B1}})) * {{Text|1024|#F580B1}} + {{Text|3145728|#F580B1}}
                {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|CASE}} {{Cl|ELSE}}
                {{Text|HashValue&|#55FF55}} = hash2char({{Cl|CVI}}(a$)) + hash2char({{Cl|ASC (function)|ASC}}(a$, l) + {{Cl|ASC (function)|ASC}}(a$, l - {{Text|1|#F580B1}}) * {{Text|256|#F580B1}}) * {{Text|1024|#F580B1}} + (l {{Cl|AND}} {{Text|7|#F580B1}}) * {{Text|1048576|#F580B1}}
                {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|SELECT}}
    {{Cl|ELSE}} {{Text|<nowiki>'does begin with underscore</nowiki>|#919191}}
        {{Cl|SELECT}} {{Cl|CASE}} l
            {{Cl|CASE}} {{Text|1|#F580B1}}
                {{Text|HashValue&|#55FF55}} = ({{Text|1048576|#F580B1}} + {{Text|8388608|#F580B1}}): {{Cl|EXIT}} {{Cl|FUNCTION}} {{Text|<nowiki>'note: underscore only is illegal in QB64 but supported by hash</nowiki>|#919191}}
            {{Cl|CASE}} {{Text|2|#F580B1}}
                {{Text|HashValue&|#55FF55}} = hash1char({{Cl|ASC (function)|ASC}}(a$, {{Text|2|#F580B1}})) + ({{Text|2097152|#F580B1}} + {{Text|8388608|#F580B1}})
                {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|CASE}} {{Text|3|#F580B1}}
                {{Text|HashValue&|#55FF55}} = hash2char({{Cl|ASC (function)|ASC}}(a$, {{Text|2|#F580B1}}) + {{Cl|ASC (function)|ASC}}(a$, {{Text|3|#F580B1}}) * {{Text|256|#F580B1}}) + ({{Text|3145728|#F580B1}} + {{Text|8388608|#F580B1}})
                {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|CASE}} {{Text|4|#F580B1}}
                {{Text|HashValue&|#55FF55}} = hash2char(({{Cl|CVL}}(a$) {{Cl|AND}} {{Text|&HFFFF00|#F580B1}}) \ {{Text|256|#F580B1}}) + hash1char({{Cl|ASC (function)|ASC}}(a$, {{Text|4|#F580B1}})) * {{Text|1024|#F580B1}} + ({{Text|4194304|#F580B1}} + {{Text|8388608|#F580B1}})
                {{Cl|EXIT}} {{Cl|FUNCTION}}
            {{Cl|CASE}} {{Cl|ELSE}}
                {{Text|HashValue&|#55FF55}} = hash2char(({{Cl|CVL}}(a$) {{Cl|AND}} {{Text|&HFFFF00|#F580B1}}) \ {{Text|256|#F580B1}}) + hash2char({{Cl|ASC (function)|ASC}}(a$, l) + {{Cl|ASC (function)|ASC}}(a$, l - {{Text|1|#F580B1}}) * {{Text|256|#F580B1}}) * {{Text|1024|#F580B1}} + (l {{Cl|AND}} {{Text|7|#F580B1}}) * {{Text|1048576|#F580B1}} + {{Text|8388608|#F580B1}}
                {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|END}} {{Cl|SELECT}}
    {{Cl|END}} {{Cl|IF}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|SUB}} {{Text|HashAdd|#55FF55}} (a$, flags, reference)
    {{Text|<nowiki>'find the index to use</nowiki>|#919191}}
    {{Cl|IF}} HashListFreeLast > {{Text|0|#F580B1}} {{Cl|THEN}}
        {{Text|<nowiki>'take from free list</nowiki>|#919191}}
        i = HashListFree(HashListFreeLast)
        HashListFreeLast = HashListFreeLast - {{Text|1|#F580B1}}
    {{Cl|ELSE}}
        {{Cl|IF}} HashListNext > HashListSize {{Cl|THEN}}
            {{Text|<nowiki>'double hash list size</nowiki>|#919191}}
            HashListSize = HashListSize * {{Text|2|#F580B1}}
            {{Cl|REDIM}} {{Cl|_PRESERVE}} HashList({{Text|1|#F580B1}} {{Cl|TO}} HashListSize) {{Cl|AS}} HashListItem
            {{Cl|REDIM}} {{Cl|_PRESERVE}} HashListName({{Text|1|#F580B1}} {{Cl|TO}} HashListSize) {{Cl|AS}} {{Cl|STRING}} * {{Text|256|#F580B1}}
        {{Cl|END}} {{Cl|IF}}
        i = HashListNext
        HashListNext = HashListNext + {{Text|1|#F580B1}}
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'setup links to index</nowiki>|#919191}}
    x = {{Text|HashValue|#55FF55}}(a$)
    i2 = HashTable(x)
    {{Cl|IF}} i2 {{Cl|THEN}}
        i3 = HashList(i2).LastItem
        HashList(i2).LastItem = i
        HashList(i3).NextItem = i
        HashList(i).PrevItem = i3
    {{Cl|ELSE}}
        HashTable(x) = i
        HashList(i).PrevItem = {{Text|0|#F580B1}}
        HashList(i).LastItem = i
    {{Cl|END}} {{Cl|IF}}
    HashList(i).NextItem = {{Text|0|#F580B1}}
    {{Text|<nowiki>'set common hashlist values</nowiki>|#919191}}
    HashList(i).Flags = flags
    HashList(i).Reference = reference
    HashListName(i) = {{Cl|UCASE$}}(a$)
{{Cl|END}} {{Cl|SUB}}
{{Cl|FUNCTION}} {{Text|HashFind|#55FF55}} (a$, searchflags, resultflags, resultreference)
    {{Text|<nowiki>'(0,1,2)z=hashfind[rev]("RUMI",Hashflag_label,resflag,resref)</nowiki>|#919191}}
    {{Text|<nowiki>'0=doesn't exist</nowiki>|#919191}}
    {{Text|<nowiki>'1=found, no more items to scan</nowiki>|#919191}}
    {{Text|<nowiki>'2=found, more items still to scan</nowiki>|#919191}}
    i = HashTable({{Text|HashValue|#55FF55}}(a$))
    {{Cl|IF}} i {{Cl|THEN}}
        ua$ = {{Cl|UCASE$}}(a$) + {{Cl|SPACE$}}({{Text|256|#F580B1}} - {{Cl|LEN}}(a$))
        hashfind_next:
        f = HashList(i).Flags
        {{Cl|IF}} searchflags {{Cl|AND (boolean)|AND}} f {{Cl|THEN}} {{Text|<nowiki>'flags in common</nowiki>|#919191}}
            {{Cl|IF}} HashListName(i) = ua$ {{Cl|THEN}}
                resultflags = f
                resultreference = HashList(i).Reference
                i2 = HashList(i).NextItem
                {{Cl|IF}} i2 {{Cl|THEN}}
                    {{Text|HashFind|#55FF55}} = {{Text|2|#F580B1}}
                    HashFind_NextListItem = i2
                    HashFind_Reverse = {{Text|0|#F580B1}}
                    HashFind_SearchFlags = searchflags
                    HashFind_Name = ua$
                    HashRemove_LastFound = i
                    {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|ELSE}}
                    {{Text|HashFind|#55FF55}} = {{Text|1|#F580B1}}
                    HashRemove_LastFound = i
                    {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        i = HashList(i).NextItem
        {{Cl|IF}} i {{Cl|THEN}} {{Cl|GOTO}} hashfind_next
    {{Cl|END}} {{Cl|IF}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|HashFindRev|#55FF55}} (a$, searchflags, resultflags, resultreference)
    {{Text|<nowiki>'(0,1,2)z=hashfind[rev]("RUMI",Hashflag_label,resflag,resref)</nowiki>|#919191}}
    {{Text|<nowiki>'0=doesn't exist</nowiki>|#919191}}
    {{Text|<nowiki>'1=found, no more items to scan</nowiki>|#919191}}
    {{Text|<nowiki>'2=found, more items still to scan</nowiki>|#919191}}
    i = HashTable({{Text|HashValue|#55FF55}}(a$))
    {{Cl|IF}} i {{Cl|THEN}}
        i = HashList(i).LastItem
        ua$ = {{Cl|UCASE$}}(a$) + {{Cl|SPACE$}}({{Text|256|#F580B1}} - {{Cl|LEN}}(a$))
        hashfindrev_next:
        f = HashList(i).Flags
        {{Cl|IF}} searchflags {{Cl|AND (boolean)|AND}} f {{Cl|THEN}} {{Text|<nowiki>'flags in common</nowiki>|#919191}}
            {{Cl|IF}} HashListName(i) = ua$ {{Cl|THEN}}
                resultflags = f
                resultreference = HashList(i).Reference
                i2 = HashList(i).PrevItem
                {{Cl|IF}} i2 {{Cl|THEN}}
                    {{Text|HashFindRev|#55FF55}} = {{Text|2|#F580B1}}
                    HashFind_NextListItem = i2
                    HashFind_Reverse = {{Text|1|#F580B1}}
                    HashFind_SearchFlags = searchflags
                    HashFind_Name = ua$
                    HashRemove_LastFound = i
                    {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|ELSE}}
                    {{Text|HashFindRev|#55FF55}} = {{Text|1|#F580B1}}
                    HashRemove_LastFound = i
                    {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        i = HashList(i).PrevItem
        {{Cl|IF}} i {{Cl|THEN}} {{Cl|GOTO}} hashfindrev_next
    {{Cl|END}} {{Cl|IF}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|HashFindCont|#55FF55}} (resultflags, resultreference)
    {{Text|<nowiki>'(0,1,2)z=hashfind[rev](resflag,resref)</nowiki>|#919191}}
    {{Text|<nowiki>'0=no more items exist</nowiki>|#919191}}
    {{Text|<nowiki>'1=found, no more items to scan</nowiki>|#919191}}
    {{Text|<nowiki>'2=found, more items still to scan</nowiki>|#919191}}
    {{Cl|IF}} HashFind_Reverse {{Cl|THEN}}
        i = HashFind_NextListItem
        hashfindrevc_next:
        f = HashList(i).Flags
        {{Cl|IF}} HashFind_SearchFlags {{Cl|AND (boolean)|AND}} f {{Cl|THEN}} {{Text|<nowiki>'flags in common</nowiki>|#919191}}
            {{Cl|IF}} HashListName(i) = HashFind_Name {{Cl|THEN}}
                resultflags = f
                resultreference = HashList(i).Reference
                i2 = HashList(i).PrevItem
                {{Cl|IF}} i2 {{Cl|THEN}}
                    {{Text|HashFindCont|#55FF55}} = {{Text|2|#F580B1}}
                    HashFind_NextListItem = i2
                    HashRemove_LastFound = i
                    {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|ELSE}}
                    {{Text|HashFindCont|#55FF55}} = {{Text|1|#F580B1}}
                    HashRemove_LastFound = i
                    {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        i = HashList(i).PrevItem
        {{Cl|IF}} i {{Cl|THEN}} {{Cl|GOTO}} hashfindrevc_next
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|ELSE}}
        i = HashFind_NextListItem
        hashfindc_next:
        f = HashList(i).Flags
        {{Cl|IF}} HashFind_SearchFlags {{Cl|AND (boolean)|AND}} f {{Cl|THEN}} {{Text|<nowiki>'flags in common</nowiki>|#919191}}
            {{Cl|IF}} HashListName(i) = HashFind_Name {{Cl|THEN}}
                resultflags = f
                resultreference = HashList(i).Reference
                i2 = HashList(i).NextItem
                {{Cl|IF}} i2 {{Cl|THEN}}
                    {{Text|HashFindCont|#55FF55}} = {{Text|2|#F580B1}}
                    HashFind_NextListItem = i2
                    HashRemove_LastFound = i
                    {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|ELSE}}
                    {{Text|HashFindCont|#55FF55}} = {{Text|1|#F580B1}}
                    HashRemove_LastFound = i
                    {{Cl|EXIT}} {{Cl|FUNCTION}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        i = HashList(i).NextItem
        {{Cl|IF}} i {{Cl|THEN}} {{Cl|GOTO}} hashfindc_next
        {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|SUB}} {{Text|HashRemove|#55FF55}}
    i = HashRemove_LastFound
    {{Text|<nowiki>'add to free list</nowiki>|#919191}}
    HashListFreeLast = HashListFreeLast + {{Text|1|#F580B1}}
    {{Cl|IF}} HashListFreeLast > HashListFreeSize {{Cl|THEN}}
        HashListFreeSize = HashListFreeSize * {{Text|2|#F580B1}}
        {{Cl|REDIM}} {{Cl|_PRESERVE}} HashListFree({{Text|1|#F580B1}} {{Cl|TO}} HashListFreeSize) {{Cl|AS}} {{Cl|LONG}}
    {{Cl|END}} {{Cl|IF}}
    HashListFree(HashListFreeLast) = i
    {{Text|<nowiki>'unlink</nowiki>|#919191}}
    i1 = HashList(i).PrevItem
    {{Cl|IF}} i1 {{Cl|THEN}}
        {{Text|<nowiki>'not first item in list</nowiki>|#919191}}
        i2 = HashList(i).NextItem
        {{Cl|IF}} i2 {{Cl|THEN}}
            {{Text|<nowiki>'(not first and) not last item</nowiki>|#919191}}
            HashList(i1).NextItem = i2
            HashList(i2).LastItem = i1
        {{Cl|ELSE}}
            {{Text|<nowiki>'last item</nowiki>|#919191}}
            x = HashTable({{Text|HashValue|#55FF55}}(HashListName$(i)))
            HashList(x).LastItem = i1
            HashList(i1).NextItem = {{Text|0|#F580B1}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|ELSE}}
        {{Text|<nowiki>'first item in list</nowiki>|#919191}}
        x = HashTable({{Text|HashValue|#55FF55}}(HashListName$(i)))
        i2 = HashList(i).NextItem
        {{Cl|IF}} i2 {{Cl|THEN}}
            {{Text|<nowiki>'(first item but) not last item</nowiki>|#919191}}
            HashTable(x) = i2
            HashList(i2).PrevItem = {{Text|0|#F580B1}}
            HashList(i2).LastItem = HashList(i).LastItem
        {{Cl|ELSE}}
            {{Text|<nowiki>'(first and) last item</nowiki>|#919191}}
            HashTable(x) = {{Text|0|#F580B1}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
{{Cl|END}} {{Cl|SUB}}
{{Cl|SUB}} {{Text|HashDump|#55FF55}} {{Text|<nowiki>'used for debugging purposes</nowiki>|#919191}}
    fh = {{Cl|FREEFILE}}
    {{Cl|OPEN}} {{Text|<nowiki>"hashdump.txt"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|OUTPUT}} {{Cl|OPEN|AS}} #fh
    b$ = {{Text|<nowiki>"12345678901234567890123456789012}"</nowiki>|#FFB100}}
    {{Cl|FOR}} x = {{Text|0|#F580B1}} {{Cl|TO}} {{Text|16777215|#F580B1}}
        {{Cl|IF}} HashTable(x) {{Cl|THEN}}
            {{Cl|PRINT (file statement)|PRINT}} #fh, {{Text|<nowiki>"START HashTable("</nowiki>|#FFB100}}; x; {{Text|<nowiki>"):"</nowiki>|#FFB100}}
            i = HashTable(x)
            {{Text|<nowiki>'validate</nowiki>|#919191}}
            lasti = HashList(i).LastItem
            {{Cl|IF}} HashList(i).LastItem = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} HashList(i).PrevItem <> {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} {{Text|HashValue|#55FF55}}(HashListName(i)) <> x {{Cl|THEN}} {{Cl|GOTO}} corrupt
            {{Cl|PRINT (file statement)|PRINT}} #fh, {{Text|<nowiki>"  HashList("</nowiki>|#FFB100}}; i; {{Text|<nowiki>").LastItem="</nowiki>|#FFB100}}; HashList(i).LastItem
            hashdumpnextitem:
            x$ = {{Text|<nowiki>"  ["</nowiki>|#FFB100}} + {{Cl|STR$}}(i) + {{Text|<nowiki>"]"</nowiki>|#FFB100}} + HashListName(i)
            f = HashList(i).Flags
            x$ = x$ + {{Text|<nowiki>",.Flags="</nowiki>|#FFB100}} + {{Cl|STR$}}(f) + {{Text|<nowiki>"{"</nowiki>|#FFB100}}
            {{Cl|FOR}} z = {{Text|1|#F580B1}} {{Cl|TO}} {{Text|32|#F580B1}}
                {{Cl|ASC}}(b$, z) = (f {{Cl|AND}} {{Text|1|#F580B1}}) + {{Text|48|#F580B1}}
                f = f \ {{Text|2|#F580B1}}
            {{Cl|NEXT}}
            x$ = x$ + b$
            x$ = x$ + {{Text|<nowiki>",.Reference="</nowiki>|#FFB100}} + {{Cl|STR$}}(HashList(i).Reference)
            {{Cl|PRINT (file statement)|PRINT}} #fh, x$
            {{Text|<nowiki>'validate</nowiki>|#919191}}
            i1 = HashList(i).PrevItem
            i2 = HashList(i).NextItem
            {{Cl|IF}} i1 {{Cl|THEN}}
                {{Cl|IF}} HashList(i1).NextItem <> i {{Cl|THEN}} {{Cl|GOTO}} corrupt
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} i2 {{Cl|THEN}}
                {{Cl|IF}} HashList(i2).PrevItem <> i {{Cl|THEN}} {{Cl|GOTO}} corrupt
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} i2 = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} lasti <> i {{Cl|THEN}} {{Cl|GOTO}} corrupt
            {{Cl|END}} {{Cl|IF}}
            i = HashList(i).NextItem
            {{Cl|IF}} i {{Cl|THEN}} {{Cl|GOTO}} hashdumpnextitem
            {{Cl|PRINT (file statement)|PRINT}} #fh, {{Text|<nowiki>"END HashTable("</nowiki>|#FFB100}}; x; {{Text|<nowiki>")"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|NEXT}}
    {{Cl|CLOSE}} #fh
    {{Cl|EXIT}} {{Cl|SUB}}
    corrupt:
    {{Cl|PRINT (file statement)|PRINT}} #fh, {{Text|<nowiki>"HASH TABLE CORRUPT!"</nowiki>|#FFB100}} {{Text|<nowiki>'should never happen</nowiki>|#919191}}
    {{Cl|CLOSE}} #fh
{{Cl|END}} {{Cl|SUB}}
{{Cl|SUB}} {{Text|HashClear|#55FF55}} {{Text|<nowiki>'clear entire hash table</nowiki>|#919191}}
    HashListSize = {{Text|65536|#F580B1}}
    HashListNext = {{Text|1|#F580B1}}
    HashListFreeSize = {{Text|1024|#F580B1}}
    HashListFreeLast = {{Text|0|#F580B1}}
    {{Cl|REDIM}} HashList({{Text|1|#F580B1}} {{Cl|TO}} HashListSize) {{Cl|AS}} HashListItem
    {{Cl|REDIM}} HashListName({{Text|1|#F580B1}} {{Cl|TO}} HashListSize) {{Cl|AS}} {{Cl|STRING}} * {{Text|256|#F580B1}}
    {{Cl|REDIM}} HashListFree({{Text|1|#F580B1}} {{Cl|TO}} HashListFreeSize) {{Cl|AS}} {{Cl|LONG}}
    {{Cl|REDIM}} HashTable({{Text|16777215|#F580B1}}) {{Cl|AS}} {{Cl|LONG}} {{Text|<nowiki>'64MB lookup table with indexes to the hashlist</nowiki>|#919191}}
    HashFind_NextListItem = {{Text|0|#F580B1}}
    HashFind_Reverse = {{Text|0|#F580B1}}
    HashFind_SearchFlags = {{Text|0|#F580B1}}
    HashFind_Name = {{Text|<nowiki>""</nowiki>|#FFB100}}
    HashRemove_LastFound = {{Text|0|#F580B1}}
{{Cl|END}} {{Cl|SUB}}
{{Cl|FUNCTION}} {{Text|removecast$|#55FF55}} (a$)
    {{Text|removecast$|#55FF55}} = a$
    {{Cl|IF}} {{Cl|INSTR}}(a$, {{Text|<nowiki>"  )"</nowiki>|#FFB100}}) {{Cl|THEN}}
        {{Text|removecast$|#55FF55}} = {{Cl|RIGHT$}}(a$, {{Cl|LEN}}(a$) - {{Cl|INSTR}}(a$, {{Text|<nowiki>"  )"</nowiki>|#FFB100}}) - {{Text|2|#F580B1}})
    {{Cl|END}} {{Cl|IF}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|converttabs$|#55FF55}} (a2$)
    {{Cl|IF}} ideautoindent {{Cl|THEN}} s = ideautoindentsize {{Cl|ELSE}} s = {{Text|4|#F580B1}}
    a$ = a2$
    {{Cl|DO}} {{Cl|WHILE}} {{Cl|INSTR}}(a$, CHR_TAB)
        x = {{Cl|INSTR}}(a$, CHR_TAB)
        a$ = {{Cl|LEFT$}}(a$, x - {{Text|1|#F580B1}}) + {{Cl|SPACE$}}(s - ((x - {{Text|1|#F580B1}}) {{Cl|MOD}} s)) + {{Cl|RIGHT$}}(a$, {{Cl|LEN}}(a$) - x)
    {{Cl|LOOP}}
    {{Text|converttabs$|#55FF55}} = a$
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|NewByteElement$|#55FF55}}
    a$ = {{Text|<nowiki>"byte_element_"</nowiki>|#FFB100}} + {{Text|str2$|#55FF55}}({{Text|uniquenumber|#55FF55}})
    {{Text|NewByteElement$|#55FF55}} = a$
    {{Cl|IF}} use_global_byte_elements {{Cl|THEN}}
        {{Text|WriteBufLine|#55FF55}} GlobTxtBuf, {{Text|<nowiki>"byte_element_struct *"</nowiki>|#FFB100}} + a$ + {{Text|<nowiki>"=(byte_element_struct*)malloc(12);"</nowiki>|#FFB100}}
    {{Cl|ELSE}}
        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"byte_element_struct *"</nowiki>|#FFB100}} + a$ + {{Text|<nowiki>"=NULL;"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if (!"</nowiki>|#FFB100}} + a$ + {{Text|<nowiki>"){"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"if ((mem_static_pointer+=12)<mem_static_limit) "</nowiki>|#FFB100}} + a$ + {{Text|<nowiki>"=(byte_element_struct*)(mem_static_pointer-12); else "</nowiki>|#FFB100}} + a$ + {{Text|<nowiki>"=(byte_element_struct*)mem_static_malloc(12);"</nowiki>|#FFB100}}
        {{Text|WriteBufLine|#55FF55}} DataTxtBuf, {{Text|<nowiki>"}"</nowiki>|#FFB100}}
    {{Cl|END}} {{Cl|IF}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|validname|#55FF55}} (a$)
    {{Text|<nowiki>'notes:</nowiki>|#919191}}
    {{Text|<nowiki>'1) '_1' is invalid because it has no alphabet letters</nowiki>|#919191}}
    {{Text|<nowiki>'2) 'A_' is invalid because it has a trailing _</nowiki>|#919191}}
    {{Text|<nowiki>'3) '_1A' is invalid because it contains a number before the first alphabet letter</nowiki>|#919191}}
    {{Text|<nowiki>'4) names cannot be longer than 40 characters</nowiki>|#919191}}
    l = {{Cl|LEN}}(a$)
    {{Cl|IF}} l = {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} l > {{Text|40|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} l = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Text|<nowiki>'Note: variable names with periods need to be obfuscated, and this affects their length</nowiki>|#919191}}
        i = {{Cl|INSTR}}(a$, fix046$)
        {{Cl|DO}} {{Cl|WHILE}} i
            l = l - {{Cl|LEN}}(fix046$) + {{Text|1|#F580B1}}
            i = {{Cl|INSTR}}(i + {{Text|1|#F580B1}}, a$, fix046$)
        {{Cl|LOOP}}
        {{Cl|IF}} l > {{Text|40|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        l = {{Cl|LEN}}(a$)
    {{Cl|END}} {{Cl|IF}}
    {{Text|<nowiki>'check for single, leading underscore</nowiki>|#919191}}
    {{Cl|IF}} l >= {{Text|2|#F580B1}} {{Cl|THEN}}
        {{Cl|IF}} {{Cl|ASC (function)|ASC}}(a$, {{Text|1|#F580B1}}) = {{Text|95|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|ASC (function)|ASC}}(a$, {{Text|2|#F580B1}}) <> {{Text|95|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} l
        a = {{Cl|ASC (function)|ASC}}(a$, i)
        {{Cl|IF}} alphanumeric(a) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} isnumeric(a) {{Cl|THEN}}
            trailingunderscore = {{Text|0|#F580B1}}
            {{Cl|IF}} alphabetletter = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|ELSE}}
            {{Cl|IF}} a = {{Text|95|#F580B1}} {{Cl|THEN}}
                trailingunderscore = {{Text|1|#F580B1}}
            {{Cl|ELSE}}
                alphabetletter = {{Text|1|#F580B1}}
                trailingunderscore = {{Text|0|#F580B1}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|NEXT}}
    {{Cl|IF}} trailingunderscore {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Text|validname|#55FF55}} = {{Text|1|#F580B1}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|str_nth$|#55FF55}} (x)
    {{Cl|IF}} x = {{Text|1|#F580B1}} {{Cl|THEN}} {{Text|str_nth$|#55FF55}} = {{Text|<nowiki>"1st"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} x = {{Text|2|#F580B1}} {{Cl|THEN}} {{Text|str_nth$|#55FF55}} = {{Text|<nowiki>"2nd"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|IF}} x = {{Text|3|#F580B1}} {{Cl|THEN}} {{Text|str_nth$|#55FF55}} = {{Text|<nowiki>"3rd"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Text|str_nth$|#55FF55}} = {{Text|str2|#55FF55}}(x) + {{Text|<nowiki>"th"</nowiki>|#FFB100}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|SUB}} {{Text|Give_Error|#55FF55}} (a$)
    Error_Happened = {{Text|1|#F580B1}}
    Error_Message = a$
{{Cl|END}} {{Cl|SUB}}
{{Cl|SUB}} {{Text|WriteConfigSetting|#55FF55}} (section$, item$, value$)
    {{Text|WriteSetting|#55FF55}} ConfigFile$, section$, item$, value$
{{Cl|END}} {{Cl|SUB}}
{{Cl|FUNCTION}} {{Text|ReadConfigSetting|#55FF55}} (section$, item$, value$)
    value$ = {{Text|ReadSetting$|#55FF55}}(ConfigFile$, section$, item$)
    {{Text|ReadConfigSetting|#55FF55}} = ({{Cl|LEN}}(value$) > {{Text|0|#F580B1}})
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|VRGBS~&|#55FF55}} (text$, DefaultColor {{Cl|AS}} {{Cl|_UNSIGNED}} {{Cl|LONG}})
    {{Text|<nowiki>'Value of RGB String = VRGBS without a ton of typing</nowiki>|#919191}}
    {{Text|<nowiki>'A function to get the RGB value back from a string such as _RGB32(255,255,255)</nowiki>|#919191}}
    {{Text|<nowiki>'text$ is the string that we send to check for a value</nowiki>|#919191}}
    {{Text|<nowiki>'DefaultColor is the value we send back if the string isn't in the proper format</nowiki>|#919191}}
    {{Text|VRGBS~&|#55FF55}} = DefaultColor {{Text|<nowiki>'A return the default value if we can't parse the string properly</nowiki>|#919191}}
    {{Cl|IF}} {{Cl|UCASE$}}({{Cl|LEFT$}}(text$, {{Text|4|#F580B1}})) = {{Text|<nowiki>"_RGB"</nowiki>|#FFB100}} {{Cl|THEN}}
        rpos = {{Cl|INSTR}}(text$, {{Text|<nowiki>"("</nowiki>|#FFB100}})
        gpos = {{Cl|INSTR}}(rpos, text$, {{Text|<nowiki>","</nowiki>|#FFB100}})
        bpos = {{Cl|INSTR}}(gpos + {{Text|1|#F580B1}}, text$, {{Text|<nowiki>","</nowiki>|#FFB100}})
        {{Cl|IF}} rpos <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} bpos <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} gpos <> {{Text|0|#F580B1}} {{Cl|THEN}}
            red = {{Cl|VAL}}({{Cl|_TRIM$}}({{Cl|MID$ (function)|MID$}}(text$, rpos + {{Text|1|#F580B1}})))
            green = {{Cl|VAL}}({{Cl|_TRIM$}}({{Cl|MID$ (function)|MID$}}(text$, gpos + {{Text|1|#F580B1}})))
            blue = {{Cl|VAL}}({{Cl|_TRIM$}}({{Cl|MID$ (function)|MID$}}(text$, bpos + {{Text|1|#F580B1}})))
            {{Text|VRGBS~&|#55FF55}} = {{Cl|_RGB32}}(red, green, blue)
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|rgbs$|#55FF55}} (c {{Cl|AS}} {{Cl|_UNSIGNED}} {{Cl|LONG}})
    {{Text|rgbs$|#55FF55}} = {{Text|<nowiki>"_RGB32("</nowiki>|#FFB100}} + {{Cl|_TRIM$}}({{Cl|STR$}}({{Cl|_RED32}}(c))) + {{Text|<nowiki>", "</nowiki>|#FFB100}} + {{Cl|_TRIM$}}({{Cl|STR$}}({{Cl|_GREEN32}}(c))) + {{Text|<nowiki>", "</nowiki>|#FFB100}} + {{Cl|_TRIM$}}({{Cl|STR$}}({{Cl|_BLUE32}}(c))) + {{Text|<nowiki>")"</nowiki>|#FFB100}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|EvalPreIF|#55FF55}} (text$, err$)
    temp$ = text$ {{Text|<nowiki>'so we don't corrupt the string sent to us for evaluation</nowiki>|#919191}}
    err$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Text|<nowiki>'null the err message to begin with</nowiki>|#919191}}
    {{Text|<nowiki>'first order of business is to solve for <>=</nowiki>|#919191}}
    {{Cl|DIM}} PC_Op({{Text|3|#F580B1}}) {{Cl|AS}} {{Cl|STRING}}
    PC_Op({{Text|1|#F580B1}}) = {{Text|<nowiki>"="</nowiki>|#FFB100}}
    PC_Op({{Text|2|#F580B1}}) = {{Text|<nowiki>"<"</nowiki>|#FFB100}}
    PC_Op({{Text|3|#F580B1}}) = {{Text|<nowiki>">"</nowiki>|#FFB100}}
    {{Cl|DO}}
        {{Text|<nowiki>'look for the existence of the first symbol if there is any</nowiki>|#919191}}
        firstsymbol$ = {{Text|<nowiki>""</nowiki>|#FFB100}}: first = {{Text|0|#F580B1}}
        {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|UBOUND}}(PC_Op)
            temp = {{Cl|INSTR}}(temp$, PC_Op(i))
            {{Cl|IF}} first = {{Text|0|#F580B1}} {{Cl|THEN}} first = temp: firstsymbol$ = PC_Op(i)
            {{Cl|IF}} temp <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} temp < first {{Cl|THEN}} first = temp: firstsymbol$ = PC_Op(i)
        {{Cl|NEXT}}
        {{Cl|IF}} firstsymbol$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|<nowiki>'we've got = < >; let's see if we have a combination of them</nowiki>|#919191}}
            secondsymbol = {{Text|0|#F580B1}}: second = {{Text|0|#F580B1}}
            {{Cl|FOR}} i = first + {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(temp$)
                a$ = {{Cl|MID$ (function)|MID$}}(temp$, i, {{Text|1|#F580B1}})
                {{Cl|SELECT}} {{Cl|CASE}} a$
                    {{Cl|CASE}} {{Text|<nowiki>" "</nowiki>|#FFB100}} {{Text|<nowiki>'ignore spaces</nowiki>|#919191}}
                    {{Cl|CASE}} {{Text|<nowiki>"="</nowiki>|#FFB100}}, {{Text|<nowiki>"<"</nowiki>|#FFB100}}, {{Text|<nowiki>">"</nowiki>|#FFB100}}
                        {{Cl|IF}} a$ = firstsymbol$ {{Cl|THEN}} err$ = {{Text|<nowiki>"Duplicate operator ("</nowiki>|#FFB100}} + a$ + {{Text|<nowiki>")"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
                        second = i: secondsymbol$ = a$
                    {{Cl|CASE}} {{Cl|ELSE}} {{Text|<nowiki>'we found a symbol we don't recognize</nowiki>|#919191}}
                        {{Cl|EXIT}} {{Cl|FOR}}
                {{Cl|END}} {{Cl|SELECT}}
            {{Cl|NEXT}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} first {{Cl|THEN}} {{Text|<nowiki>'we found a symbol</nowiki>|#919191}}
            l$ = {{Cl|RTRIM$}}({{Cl|LEFT$}}(temp$, first - {{Text|1|#F580B1}}))
            {{Cl|IF}} second {{Cl|THEN}} rightstart = second + {{Text|1|#F580B1}} {{Cl|ELSE}} rightstart = first + {{Text|1|#F580B1}}
            r$ = {{Cl|LTRIM$}}({{Cl|MID$ (function)|MID$}}(temp$, rightstart))
            symbol$ = {{Cl|MID$ (function)|MID$}}(temp$, first, {{Text|1|#F580B1}}) + {{Cl|MID$ (function)|MID$}}(temp$, second, {{Text|1|#F580B1}})
            {{Text|<nowiki>'now we check for spaces to separate this segment from any other AND/OR conditions and such</nowiki>|#919191}}
            {{Cl|FOR}} i = {{Cl|LEN}}(l$) {{Cl|TO}} {{Text|1|#F580B1}} {{Cl|STEP}} {{Text|-1|#F580B1}}
                {{Cl|IF}} {{Cl|ASC (function)|ASC}}(l$, i) = {{Text|32|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}}
            {{Cl|NEXT}}
            leftside$ = {{Cl|RTRIM$}}({{Cl|LEFT$}}(temp$, i))
            l$ = {{Cl|LTRIM$}}({{Cl|RTRIM$}}({{Cl|MID$ (function)|MID$}}(temp$, i + {{Text|1|#F580B1}}, {{Cl|LEN}}(l$) - i)))
            {{Cl|IF}} {{Text|validname|#55FF55}}(l$) = {{Text|0|#F580B1}} {{Cl|THEN}} err$ = {{Text|<nowiki>"Invalid flag name"</nowiki>|#FFB100}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
            rightstop = {{Cl|LEN}}(r$)
            {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(r$)
                {{Cl|IF}} {{Cl|ASC (function)|ASC}}(r$, i) = {{Text|32|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FOR}}
            {{Cl|NEXT}}
            rightside$ = {{Cl|LTRIM$}}({{Cl|MID$ (function)|MID$}}(r$, i + {{Text|1|#F580B1}}))
            r$ = {{Cl|LTRIM$}}({{Cl|RTRIM$}}({{Cl|LEFT$}}(r$, i - {{Text|1|#F580B1}})))
            {{Cl|IF}} symbol$ = {{Text|<nowiki>"=<"</nowiki>|#FFB100}} {{Cl|THEN}} symbol$ = {{Text|<nowiki>"<="</nowiki>|#FFB100}}
            {{Cl|IF}} symbol$ = {{Text|<nowiki>"=>"</nowiki>|#FFB100}} {{Cl|THEN}} symbol$ = {{Text|<nowiki>">="</nowiki>|#FFB100}}
            {{Cl|IF}} symbol$ = {{Text|<nowiki>"><"</nowiki>|#FFB100}} {{Cl|THEN}} symbol$ = {{Text|<nowiki>"<>"</nowiki>|#FFB100}}
            result$ = {{Text|<nowiki>" 0 "</nowiki>|#FFB100}}
            {{Cl|IF}} symbol$ = {{Text|<nowiki>"<>"</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|<nowiki>'check to see if we're NOT equal in any case with <></nowiki>|#919191}}
                {{Cl|FOR}} i = {{Text|0|#F580B1}} {{Cl|TO}} UserDefineCount
                    {{Cl|IF}} UserDefine({{Text|0|#F580B1}}, i) = l$ {{Cl|AND (boolean)|AND}} UserDefine({{Text|1|#F580B1}}, i) <> r$ {{Cl|THEN}} result$ = {{Text|<nowiki>" -1 "</nowiki>|#FFB100}}: {{Cl|GOTO}} finishedcheck
                {{Cl|NEXT}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} {{Cl|INSTR}}(symbol$, {{Text|<nowiki>"="</nowiki>|#FFB100}}) {{Cl|THEN}} {{Text|<nowiki>'check to see if we're equal in any case with =</nowiki>|#919191}}
                UserFound = {{Text|0|#F580B1}}
                {{Cl|IF}} l$ = UserDefine({{Text|0|#F580B1}}, {{Text|7|#F580B1}}) {{Cl|THEN}} {{Text|<nowiki>'we're comparing VERSION numbers</nowiki>|#919191}}
                    result = {{Text|CompareVersions|#55FF55}}(Version$, r$) {{Text|<nowiki>'-1 is less than, 0 is equal, +1 is greater than</nowiki>|#919191}}
                    {{Cl|IF}} result = {{Text|0|#F580B1}} {{Cl|THEN}} result$ = {{Text|<nowiki>" -1 "</nowiki>|#FFB100}}: {{Cl|GOTO}} finishedcheck
                {{Cl|END}} {{Cl|IF}}
                {{Cl|FOR}} i = {{Text|0|#F580B1}} {{Cl|TO}} UserDefineCount
                    {{Cl|IF}} i = {{Text|7|#F580B1}} {{Cl|THEN}} {{Cl|_CONTINUE}}
                    {{Cl|IF}} UserDefine({{Text|0|#F580B1}}, i) = l$ {{Cl|THEN}}
                        UserFound = {{Text|-1|#F580B1}}
                        {{Cl|IF}} UserDefine({{Text|1|#F580B1}}, i) = r$ {{Cl|THEN}} result$ = {{Text|<nowiki>" -1 "</nowiki>|#FFB100}}: {{Cl|GOTO}} finishedcheck
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|NEXT}}
                {{Cl|IF}} UserFound = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|LTRIM$}}({{Cl|RTRIM$}}(r$)) = {{Text|<nowiki>"UNDEFINED"</nowiki>|#FFB100}} {{Cl|THEN}} result$ = {{Text|<nowiki>" -1 "</nowiki>|#FFB100}}: {{Cl|GOTO}} finishedcheck
                {{Cl|IF}} UserFound = {{Text|-1|#F580B1}} {{Cl|AND (boolean)|AND}} {{Cl|LTRIM$}}({{Cl|RTRIM$}}(r$)) = {{Text|<nowiki>"DEFINED"</nowiki>|#FFB100}} {{Cl|THEN}} result$ = {{Text|<nowiki>" -1 "</nowiki>|#FFB100}}: {{Cl|GOTO}} finishedcheck
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} {{Cl|INSTR}}(symbol$, {{Text|<nowiki>">"</nowiki>|#FFB100}}) {{Cl|THEN}} {{Text|<nowiki>'check to see if we're greater than in any case with ></nowiki>|#919191}}
                {{Cl|IF}} l$ = UserDefine({{Text|0|#F580B1}}, {{Text|7|#F580B1}}) {{Cl|THEN}} {{Text|<nowiki>'we're comparing VERSION numbers</nowiki>|#919191}}
                    result = {{Text|CompareVersions|#55FF55}}(Version$, r$) {{Text|<nowiki>'-1 is less than, 0 is equal, +1 is greater than</nowiki>|#919191}}
                    {{Cl|IF}} result = {{Text|1|#F580B1}} {{Cl|THEN}} result$ = {{Text|<nowiki>" -1 "</nowiki>|#FFB100}}: {{Cl|GOTO}} finishedcheck
                {{Cl|END}} {{Cl|IF}}
                {{Cl|FOR}} i = {{Text|0|#F580B1}} {{Cl|TO}} UserDefineCount
                    {{Cl|IF}} i = {{Text|7|#F580B1}} {{Cl|THEN}} {{Cl|_CONTINUE}}
                    {{Cl|IF}} {{Text|VerifyNumber|#55FF55}}(r$) {{Cl|AND (boolean)|AND}} {{Text|VerifyNumber|#55FF55}}(UserDefine({{Text|1|#F580B1}}, i)) {{Cl|THEN}} {{Text|<nowiki>'we're comparing numeric values</nowiki>|#919191}}
                        {{Cl|IF}} UserDefine({{Text|0|#F580B1}}, i) = l$ {{Cl|AND (boolean)|AND}} {{Cl|VAL}}(UserDefine({{Text|1|#F580B1}}, i)) > {{Cl|VAL}}(r$) {{Cl|THEN}} result$ = {{Text|<nowiki>" -1 "</nowiki>|#FFB100}}: {{Cl|GOTO}} finishedcheck
                    {{Cl|ELSE}}
                        {{Cl|IF}} UserDefine({{Text|0|#F580B1}}, i) = l$ {{Cl|AND (boolean)|AND}} UserDefine({{Text|1|#F580B1}}, i) > r$ {{Cl|THEN}} result$ = {{Text|<nowiki>" -1 "</nowiki>|#FFB100}}: {{Cl|GOTO}} finishedcheck
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|NEXT}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|IF}} {{Cl|INSTR}}(symbol$, {{Text|<nowiki>"<"</nowiki>|#FFB100}}) {{Cl|THEN}} {{Text|<nowiki>'check to see if we're less than in any case with <</nowiki>|#919191}}
                {{Cl|IF}} l$ = UserDefine({{Text|0|#F580B1}}, {{Text|7|#F580B1}}) {{Cl|THEN}} {{Text|<nowiki>'we're comparing VERSION numbers</nowiki>|#919191}}
                    result = {{Text|CompareVersions|#55FF55}}(Version$, r$) {{Text|<nowiki>'-1 is less than, 0 is equal, +1 is greater than</nowiki>|#919191}}
                    {{Cl|IF}} result = {{Text|-1|#F580B1}} {{Cl|THEN}} result$ = {{Text|<nowiki>" -1 "</nowiki>|#FFB100}}: {{Cl|GOTO}} finishedcheck
                {{Cl|END}} {{Cl|IF}}
                {{Cl|FOR}} i = {{Text|0|#F580B1}} {{Cl|TO}} UserDefineCount
                    {{Cl|IF}} i = {{Text|7|#F580B1}} {{Cl|THEN}} {{Cl|_CONTINUE}}
                    {{Cl|IF}} {{Text|VerifyNumber|#55FF55}}(r$) {{Cl|AND (boolean)|AND}} {{Text|VerifyNumber|#55FF55}}(UserDefine({{Text|1|#F580B1}}, i)) {{Cl|THEN}} {{Text|<nowiki>'we're comparing numeric values</nowiki>|#919191}}
                        {{Cl|IF}} UserDefine({{Text|0|#F580B1}}, i) = l$ {{Cl|AND (boolean)|AND}} {{Cl|VAL}}(UserDefine({{Text|1|#F580B1}}, i)) < {{Cl|VAL}}(r$) {{Cl|THEN}} result$ = {{Text|<nowiki>" -1 "</nowiki>|#FFB100}}: {{Cl|GOTO}} finishedcheck
                    {{Cl|ELSE}}
                        {{Cl|IF}} UserDefine({{Text|0|#F580B1}}, i) = l$ {{Cl|AND (boolean)|AND}} UserDefine({{Text|1|#F580B1}}, i) < r$ {{Cl|THEN}} result$ = {{Text|<nowiki>" -1 "</nowiki>|#FFB100}}: {{Cl|GOTO}} finishedcheck
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|NEXT}}
            {{Cl|END}} {{Cl|IF}}
            finishedcheck:
            temp$ = leftside$ + result$ + rightside$
        {{Cl|END}} {{Cl|IF}}
    {{Cl|LOOP}} {{Cl|UNTIL}} first = {{Text|0|#F580B1}}
    {{Text|<nowiki>'And at this point we should now be down to a statement with nothing but AND/OR/XORS in it</nowiki>|#919191}}
    PC_Op({{Text|1|#F580B1}}) = {{Text|<nowiki>" AND "</nowiki>|#FFB100}}
    PC_Op({{Text|2|#F580B1}}) = {{Text|<nowiki>" OR "</nowiki>|#FFB100}}
    PC_Op({{Text|3|#F580B1}}) = {{Text|<nowiki>" XOR "</nowiki>|#FFB100}}
    {{Cl|DO}}
        first = {{Text|0|#F580B1}}
        {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|UBOUND}}(PC_Op)
            {{Cl|IF}} PC_Op(i) <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}}
                t = {{Cl|INSTR}}(temp$, PC_Op(i))
                {{Cl|IF}} first <> {{Text|0|#F580B1}} {{Cl|THEN}}
                    {{Cl|IF}} t < first {{Cl|AND (boolean)|AND}} t <> {{Text|0|#F580B1}} {{Cl|THEN}} first = t: firstsymbol = i
                {{Cl|ELSE}}
                    first = t: firstsymbol = i
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|NEXT}}
        {{Cl|IF}} first = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|DO}}
        leftside$ = {{Cl|RTRIM$}}({{Cl|LEFT$}}(temp$, first - {{Text|1|#F580B1}}))
        symbol$ = {{Cl|MID$ (function)|MID$}}(temp$, first, {{Cl|LEN}}(PC_Op(firstsymbol)))
        t$ = {{Cl|MID$ (function)|MID$}}(temp$, first + {{Cl|LEN}}(PC_Op(firstsymbol)))
        t = {{Cl|INSTR}}(t$, {{Text|<nowiki>" "</nowiki>|#FFB100}}) {{Text|<nowiki>'the first space we come to</nowiki>|#919191}}
        {{Cl|IF}} t {{Cl|THEN}}
            m$ = {{Cl|LTRIM$}}({{Cl|RTRIM$}}({{Cl|LEFT$}}(t$, t - {{Text|1|#F580B1}})))
            rightside$ = {{Cl|LTRIM$}}({{Cl|MID$ (function)|MID$}}(t$, t))
        {{Cl|ELSE}}
            m$ = {{Cl|LTRIM$}}({{Cl|MID$ (function)|MID$}}(t$, t))
            rightside$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        leftresult = {{Text|0|#F580B1}}
        {{Cl|IF}} {{Text|VerifyNumber|#55FF55}}(leftside$) {{Cl|THEN}}
            {{Cl|IF}} {{Cl|VAL}}(leftside$) <> {{Text|0|#F580B1}} {{Cl|THEN}} leftresult = {{Text|-1|#F580B1}}
        {{Cl|ELSE}}
            {{Cl|FOR}} i = {{Text|0|#F580B1}} {{Cl|TO}} UserDefineCount
                {{Cl|IF}} UserDefine({{Text|0|#F580B1}}, i) = leftside$ {{Cl|THEN}}
                    t$ = {{Cl|LTRIM$}}({{Cl|RTRIM$}}(UserDefine({{Text|1|#F580B1}}, i)))
                    {{Cl|IF}} t$ <> {{Text|<nowiki>"0"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} t$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} leftresult = {{Text|-1|#F580B1}}: {{Cl|EXIT}} {{Cl|FOR}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|NEXT}}
        {{Cl|END}} {{Cl|IF}}
        rightresult = {{Text|0|#F580B1}}
        {{Cl|IF}} {{Text|VerifyNumber|#55FF55}}(m$) {{Cl|THEN}}
            {{Cl|IF}} {{Cl|VAL}}(m$) <> {{Text|0|#F580B1}} {{Cl|THEN}} rightresult = {{Text|-1|#F580B1}}
        {{Cl|ELSE}}
            {{Cl|FOR}} i = {{Text|0|#F580B1}} {{Cl|TO}} UserDefineCount
                {{Cl|IF}} UserDefine({{Text|0|#F580B1}}, i) = m$ {{Cl|THEN}}
                    t$ = {{Cl|LTRIM$}}({{Cl|RTRIM$}}(UserDefine({{Text|1|#F580B1}}, i)))
                    {{Cl|IF}} t$ <> {{Text|<nowiki>"0"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} t$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} rightresult = {{Text|-1|#F580B1}}: {{Cl|EXIT}} {{Cl|FOR}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|NEXT}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|SELECT}} {{Cl|CASE}} {{Cl|LTRIM$}}({{Cl|RTRIM$}}(symbol$))
            {{Cl|CASE}} {{Text|<nowiki>"AND"</nowiki>|#FFB100}}
                {{Cl|IF}} leftresult <> {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} rightresult <> {{Text|0|#F580B1}} {{Cl|THEN}} result$ = {{Text|<nowiki>" -1 "</nowiki>|#FFB100}} {{Cl|ELSE}} result$ = {{Text|<nowiki>" 0 "</nowiki>|#FFB100}}
            {{Cl|CASE}} {{Text|<nowiki>"OR"</nowiki>|#FFB100}}
                {{Cl|IF}} leftresult <> {{Text|0|#F580B1}} {{Cl|OR (boolean)|OR}} rightresult <> {{Text|0|#F580B1}} {{Cl|THEN}} result$ = {{Text|<nowiki>" -1 "</nowiki>|#FFB100}} {{Cl|ELSE}} result$ = {{Text|<nowiki>" 0 "</nowiki>|#FFB100}}
            {{Cl|CASE}} {{Text|<nowiki>"XOR"</nowiki>|#FFB100}}
                {{Cl|IF}} leftresult <> rightresult {{Cl|THEN}} result$ = {{Text|<nowiki>" -1 "</nowiki>|#FFB100}} {{Cl|ELSE}} result$ = {{Text|<nowiki>" 0 "</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|SELECT}}
        temp$ = result$ + rightside$
    {{Cl|LOOP}}
    {{Cl|IF}} {{Text|VerifyNumber|#55FF55}}(temp$) {{Cl|THEN}}
        {{Text|EvalPreIF|#55FF55}} = {{Cl|VAL}}(temp$)
    {{Cl|ELSE}}
        {{Cl|IF}} {{Cl|INSTR}}(temp$, {{Text|<nowiki>" "</nowiki>|#FFB100}}) {{Cl|THEN}} err$ = {{Text|<nowiki>"Invalid Resolution of $IF; check statements"</nowiki>|#FFB100}} {{Text|<nowiki>'If we've got more than 1 statement, it's invalid</nowiki>|#919191}}
        {{Cl|FOR}} i = {{Text|0|#F580B1}} {{Cl|TO}} UserDefineCount
            {{Cl|IF}} UserDefine({{Text|0|#F580B1}}, i) = temp$ {{Cl|THEN}}
                t$ = {{Cl|LTRIM$}}({{Cl|RTRIM$}}(UserDefine({{Text|1|#F580B1}}, i)))
                {{Cl|IF}} t$ <> {{Text|<nowiki>"0"</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} t$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|EvalPreIF|#55FF55}} = {{Text|-1|#F580B1}}: {{Cl|EXIT}} {{Cl|FOR}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|NEXT}}
    {{Cl|END}} {{Cl|IF}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|VerifyNumber|#55FF55}} (text$)
    t$ = {{Cl|LTRIM$}}({{Cl|RTRIM$}}(text$))
    v = {{Cl|VAL}}(t$)
    t1$ = {{Cl|LTRIM$}}({{Cl|STR$}}(v))
    {{Cl|IF}} t$ = t1$ {{Cl|THEN}} {{Text|VerifyNumber|#55FF55}} = {{Text|-1|#F580B1}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|SUB}} {{Text|initialise_udt_varstrings|#55FF55}} (n$, udt, buf, base_offset)
    {{Cl|IF}} {{Cl|NOT}} udtxvariable(udt) {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
    element = udtxnext(udt)
    offset = {{Text|0|#F580B1}}
    {{Cl|DO}} {{Cl|WHILE}} element
        {{Cl|IF}} udtetype(element) {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
            {{Cl|IF}} (udtetype(element) {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Text|WriteBufLine|#55FF55}} buf, {{Text|<nowiki>"*(qbs**)(((char*)"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")+"</nowiki>|#FFB100}} + {{Cl|STR$}}(base_offset + offset) + {{Text|<nowiki>") = qbs_new(0,0);"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|ELSEIF}} udtetype(element) {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
            {{Text|initialise_udt_varstrings|#55FF55}} n$, udtetype(element) {{Cl|AND}} {{Text|511|#F580B1}}, buf, offset
        {{Cl|END}} {{Cl|IF}}
        offset = offset + udtesize(element) \ {{Text|8|#F580B1}}
        element = udtenext(element)
    {{Cl|LOOP}}
{{Cl|END}} {{Cl|SUB}}
{{Cl|SUB}} {{Text|free_udt_varstrings|#55FF55}} (n$, udt, buf, base_offset)
    {{Cl|IF}} {{Cl|NOT}} udtxvariable(udt) {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
    element = udtxnext(udt)
    offset = {{Text|0|#F580B1}}
    {{Cl|DO}} {{Cl|WHILE}} element
        {{Cl|IF}} udtetype(element) {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
            {{Cl|IF}} (udtetype(element) {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Text|WriteBufLine|#55FF55}} buf, {{Text|<nowiki>"qbs_free(*((qbs**)(((char*)"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")+"</nowiki>|#FFB100}} + {{Cl|STR$}}(base_offset + offset) + {{Text|<nowiki>")));"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|ELSEIF}} udtetype(element) {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
            {{Text|initialise_udt_varstrings|#55FF55}} n$, udtetype(element) {{Cl|AND}} {{Text|511|#F580B1}}, buf, offset
        {{Cl|END}} {{Cl|IF}}
        offset = offset + udtesize(element) \ {{Text|8|#F580B1}}
        element = udtenext(element)
    {{Cl|LOOP}}
{{Cl|END}} {{Cl|SUB}}
{{Cl|SUB}} {{Text|clear_udt_with_varstrings|#55FF55}} (n$, udt, buf, base_offset)
    {{Cl|IF}} {{Cl|NOT}} udtxvariable(udt) {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
    element = udtxnext(udt)
    offset = {{Text|0|#F580B1}}
    {{Cl|DO}} {{Cl|WHILE}} element
        {{Cl|IF}} udtetype(element) {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
            {{Cl|IF}} (udtetype(element) {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Text|WriteBufLine|#55FF55}} buf, {{Text|<nowiki>"(*(qbs**)(((char*)"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>")+"</nowiki>|#FFB100}} + {{Cl|STR$}}(base_offset + offset) + {{Text|<nowiki>"))->len=0;"</nowiki>|#FFB100}}
            {{Cl|ELSE}}
                {{Text|WriteBufLine|#55FF55}} buf, {{Text|<nowiki>"memset((char*)"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + {{Cl|STR$}}(base_offset + offset) + {{Text|<nowiki>",0,"</nowiki>|#FFB100}} + {{Cl|STR$}}(udtesize(element) \ {{Text|8|#F580B1}}) + {{Text|<nowiki>");"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|ELSE}}
            {{Cl|IF}} udtetype(element) {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
                {{Text|clear_udt_with_varstrings|#55FF55}} n$, udtetype(element) {{Cl|AND}} {{Text|511|#F580B1}}, buf, base_offset + offset
            {{Cl|ELSE}}
                {{Text|WriteBufLine|#55FF55}} buf, {{Text|<nowiki>"memset((char*)"</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + {{Cl|STR$}}(base_offset + offset) + {{Text|<nowiki>",0,"</nowiki>|#FFB100}} + {{Cl|STR$}}(udtesize(element) \ {{Text|8|#F580B1}}) + {{Text|<nowiki>");"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
        offset = offset + udtesize(element) \ {{Text|8|#F580B1}}
        element = udtenext(element)
    {{Cl|LOOP}}
{{Cl|END}} {{Cl|SUB}}
{{Cl|SUB}} {{Text|initialise_array_udt_varstrings|#55FF55}} (n$, udt, base_offset, bytesperelement$, acc$)
    {{Cl|IF}} {{Cl|NOT}} udtxvariable(udt) {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
    offset = base_offset
    element = udtxnext(udt)
    {{Cl|DO}} {{Cl|WHILE}} element
        {{Cl|IF}} udtetype(element) {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
            {{Cl|IF}} (udtetype(element) {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Cl|THEN}}
                acc$ = acc$ + {{Cl|CHR$}}({{Text|13|#F580B1}}) + {{Cl|CHR$}}({{Text|10|#F580B1}}) + {{Text|<nowiki>"*(qbs**)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]+("</nowiki>|#FFB100}} + bytesperelement$ + {{Text|<nowiki>"-1)*tmp_long+"</nowiki>|#FFB100}} + {{Cl|STR$}}(offset) + {{Text|<nowiki>")=qbs_new(0,0);"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|ELSEIF}} udtetype(element) {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
            {{Text|initialise_array_udt_varstrings|#55FF55}} n$, udtetype(element) {{Cl|AND}} {{Text|511|#F580B1}}, offset, bytesperelement$, acc$
        {{Cl|END}} {{Cl|IF}}
        offset = offset + udtesize(element) \ {{Text|8|#F580B1}}
        element = udtenext(element)
    {{Cl|LOOP}}
{{Cl|END}} {{Cl|SUB}}
{{Cl|SUB}} {{Text|free_array_udt_varstrings|#55FF55}} (n$, udt, base_offset, bytesperelement$, acc$)
    {{Cl|IF}} {{Cl|NOT}} udtxvariable(udt) {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
    offset = base_offset
    element = udtxnext(udt)
    {{Cl|DO}} {{Cl|WHILE}} element
        {{Cl|IF}} udtetype(element) {{Cl|AND (boolean)|AND}} ISSTRING {{Cl|THEN}}
            {{Cl|IF}} (udtetype(element) {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Cl|THEN}}
                acc$ = acc$ + {{Cl|CHR$}}({{Text|13|#F580B1}}) + {{Cl|CHR$}}({{Text|10|#F580B1}}) + {{Text|<nowiki>"qbs_free(*(qbs**)("</nowiki>|#FFB100}} + n$ + {{Text|<nowiki>"[0]+("</nowiki>|#FFB100}} + bytesperelement$ + {{Text|<nowiki>"-1)*tmp_long+"</nowiki>|#FFB100}} + {{Cl|STR$}}(offset) + {{Text|<nowiki>"));"</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|ELSEIF}} udtetype(element) {{Cl|AND (boolean)|AND}} ISUDT {{Cl|THEN}}
            {{Text|free_array_udt_varstrings|#55FF55}} n$, udtetype(element) {{Cl|AND}} {{Text|511|#F580B1}}, offset, bytesperelement$, acc$
        {{Cl|END}} {{Cl|IF}}
        offset = offset + udtesize(element) \ {{Text|8|#F580B1}}
        element = udtenext(element)
    {{Cl|LOOP}}
{{Cl|END}} {{Cl|SUB}}
{{Cl|SUB}} {{Text|copy_full_udt|#55FF55}} (dst$, src$, buf, base_offset, udt)
    {{Cl|IF}} {{Cl|NOT}} udtxvariable(udt) {{Cl|THEN}}
        {{Text|WriteBufLine|#55FF55}} buf, {{Text|<nowiki>"memcpy("</nowiki>|#FFB100}} + dst$ + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + {{Cl|STR$}}(base_offset) + {{Text|<nowiki>","</nowiki>|#FFB100}} + src$ + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + {{Cl|STR$}}(base_offset) + {{Text|<nowiki>","</nowiki>|#FFB100}} + {{Cl|STR$}}(udtxsize(udt) \ {{Text|8|#F580B1}}) + {{Text|<nowiki>");"</nowiki>|#FFB100}}
        {{Cl|EXIT}} {{Cl|SUB}}
    {{Cl|END}} {{Cl|IF}}
    offset = base_offset
    element = udtxnext(udt)
    {{Cl|DO}} {{Cl|WHILE}} element
        {{Cl|IF}} ((udtetype(element) {{Cl|AND (boolean)|AND}} ISSTRING) > {{Text|0|#F580B1}}) {{Cl|AND (boolean)|AND}} (udtetype(element) {{Cl|AND (boolean)|AND}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Cl|THEN}}
            {{Text|WriteBufLine|#55FF55}} buf, {{Text|<nowiki>"qbs_set(*(qbs**)("</nowiki>|#FFB100}} + dst$ + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + {{Cl|STR$}}(offset) + {{Text|<nowiki>"), *(qbs**)("</nowiki>|#FFB100}} + src$ + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + {{Cl|STR$}}(offset) + {{Text|<nowiki>"));"</nowiki>|#FFB100}}
        {{Cl|ELSEIF}} ((udtetype(element) {{Cl|AND (boolean)|AND}} ISUDT) > {{Text|0|#F580B1}}) {{Cl|THEN}}
            {{Text|copy_full_udt|#55FF55}} dst$, src$, MainTxtBuf, offset, udtetype(element) {{Cl|AND}} {{Text|511|#F580B1}}
        {{Cl|ELSE}}
            {{Text|WriteBufLine|#55FF55}} buf, {{Text|<nowiki>"memcpy(("</nowiki>|#FFB100}} + dst$ + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + {{Cl|STR$}}(offset) + {{Text|<nowiki>"),("</nowiki>|#FFB100}} + src$ + {{Text|<nowiki>"+"</nowiki>|#FFB100}} + {{Cl|STR$}}(offset) + {{Text|<nowiki>"),"</nowiki>|#FFB100}} + {{Cl|STR$}}(udtesize(element) \ {{Text|8|#F580B1}}) + {{Text|<nowiki>");"</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        offset = offset + udtesize(element) \ {{Text|8|#F580B1}}
        element = udtenext(element)
    {{Cl|LOOP}}
{{Cl|END}} {{Cl|SUB}}
{{Cl|SUB}} {{Text|dump_udts|#55FF55}}
    fh = {{Cl|FREEFILE}}
    {{Cl|OPEN}} {{Text|<nowiki>"types.txt"</nowiki>|#FFB100}} {{Cl|OPEN#File_Access_Modes|FOR}} {{Cl|OPEN#File_Access_Modes|OUTPUT}} {{Cl|OPEN|AS}} #fh
    {{Cl|PRINT (file statement)|PRINT}} #fh, {{Text|<nowiki>"Name  Size  Align? Next  Var?"</nowiki>|#FFB100}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} lasttype
        {{Cl|PRINT (file statement)|PRINT}} #fh, {{Cl|RTRIM$}}(udtxname(i)), udtxsize(i), udtxbytealign(i), udtxnext(i), udtxvariable(i)
    {{Cl|NEXT}} i
    {{Cl|PRINT (file statement)|PRINT}} #fh, {{Text|<nowiki>"Name  Size  Align? Next  Type  Tsize  Arr"</nowiki>|#FFB100}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} lasttypeelement
        {{Cl|PRINT (file statement)|PRINT}} #fh, {{Cl|RTRIM$}}(udtename(i)), udtesize(i), udtebytealign(i), udtenext(i), udtetype(i), udtetypesize(i), udtearrayelements(i)
    {{Cl|NEXT}} i
    {{Cl|CLOSE}} #fh
{{Cl|END}} {{Cl|SUB}}
{{Cl|SUB}} {{Text|manageVariableList|#55FF55}} (__name$, __cname$, localIndex {{Cl|AS}} {{Cl|LONG}}, action {{Cl|AS}} {{Cl|_BYTE}})
    {{Cl|DIM}} findItem {{Cl|AS}} {{Cl|LONG}}, cname$, i {{Cl|AS}} {{Cl|LONG}}, j {{Cl|AS}} {{Cl|LONG}}, name$, temp$
    name$ = {{Cl|RTRIM$}}(__name$)
    cname$ = {{Cl|RTRIM$}}(__cname$)
    {{Cl|IF}} {{Cl|LEN}}(cname$) = {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|SUB}}
    findItem = {{Cl|INSTR}}(cname$, {{Text|<nowiki>"["</nowiki>|#FFB100}})
    {{Cl|IF}} findItem {{Cl|THEN}}
        cname$ = {{Cl|LEFT$}}(cname$, findItem - {{Text|1|#F580B1}})
    {{Cl|END}} {{Cl|IF}}
    found = {{Text|0|#F580B1}}
    {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} totalVariablesCreated
        {{Cl|IF}} usedVariableList(i).cname = cname$ {{Cl|THEN}} found = {{Text|-1|#F580B1}}: {{Cl|EXIT}} {{Cl|FOR}}
    {{Cl|NEXT}}
    {{Cl|SELECT}} {{Cl|CASE}} action
        {{Cl|CASE}} {{Text|0|#F580B1}} {{Text|<nowiki>'add</nowiki>|#919191}}
            {{Cl|IF}} found = {{Text|0|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} i > {{Cl|UBOUND}}(usedVariableList) {{Cl|THEN}}
                    {{Cl|REDIM}} {{Cl|_PRESERVE}} usedVariableList({{Cl|UBOUND}}(usedVariableList) + {{Text|999|#F580B1}}) {{Cl|AS}} usedVarList
                {{Cl|END}} {{Cl|IF}}
                usedVariableList(i).id = currentid
                usedVariableList(i).used = {{Text|0|#F580B1}}
                usedVariableList(i).watch = {{Text|0|#F580B1}}
                usedVariableList(i).displayFormat = {{Text|0|#F580B1}}
                usedVariableList(i).storage = {{Text|<nowiki>""</nowiki>|#FFB100}}
                usedVariableList(i).linenumber = linenumber
                usedVariableList(i).includeLevel = inclevel
                {{Cl|IF}} inclevel > {{Text|0|#F580B1}} {{Cl|THEN}}
                    usedVariableList(i).includedLine = inclinenumber(inclevel)
                    thisincname$ = {{Text|getfilepath$|#55FF55}}(incname$(inclevel))
                    thisincname$ = {{Cl|MID$ (function)|MID$}}(incname$(inclevel), {{Cl|LEN}}(thisincname$) + {{Text|1|#F580B1}})
                    usedVariableList(i).includedFile = thisincname$
                {{Cl|ELSE}}
                    totalMainVariablesCreated = totalMainVariablesCreated + {{Text|1|#F580B1}}
                    usedVariableList(i).includedLine = {{Text|0|#F580B1}}
                    usedVariableList(i).includedFile = {{Text|<nowiki>""</nowiki>|#FFB100}}
                {{Cl|END}} {{Cl|IF}}
                usedVariableList(i).{{Text|scope|#55FF55}} = subfuncn
                usedVariableList(i).subfunc = subfunc
                usedVariableList(i).varType = {{Text|id2fulltypename$|#55FF55}}
                usedVariableList(i).cname = cname$
                usedVariableList(i).localIndex = localIndex
                {{Text|<nowiki>'remove eventual instances of fix046$ in name$</nowiki>|#919191}}
                {{Cl|DO}} {{Cl|WHILE}} {{Cl|INSTR}}(name$, fix046$)
                    x = {{Cl|INSTR}}(name$, fix046$): name$ = {{Cl|LEFT$}}(name$, x - {{Text|1|#F580B1}}) + {{Text|<nowiki>"."</nowiki>|#FFB100}} + {{Cl|RIGHT$}}(name$, {{Cl|LEN}}(name$) - x + {{Text|1|#F580B1}} - {{Cl|LEN}}(fix046$))
                {{Cl|LOOP}}
                {{Cl|IF}} {{Cl|LEN}}({{Cl|RTRIM$}}(id.musthave)) > {{Text|0|#F580B1}} {{Cl|THEN}}
                    usedVariableList(i).name = name$ + {{Cl|RTRIM$}}(id.musthave)
                {{Cl|ELSEIF}} {{Cl|LEN}}({{Cl|RTRIM$}}(id.mayhave)) > {{Text|0|#F580B1}} {{Cl|THEN}}
                    usedVariableList(i).name = name$ + {{Cl|RTRIM$}}(id.mayhave)
                {{Cl|ELSE}}
                    usedVariableList(i).name = name$
                {{Cl|END}} {{Cl|IF}}
                {{Cl|IF}} (id.arrayelements > {{Text|0|#F580B1}}) {{Cl|THEN}}
                    usedVariableList(i).isarray = {{Text|-1|#F580B1}}
                    usedVariableList(i).name = usedVariableList(i).name + {{Text|<nowiki>"()"</nowiki>|#FFB100}}
                {{Cl|ELSE}}
                    usedVariableList(i).isarray = {{Text|0|#F580B1}}
                {{Cl|END}} {{Cl|IF}}
                usedVariableList(i).watchRange = {{Text|<nowiki>""</nowiki>|#FFB100}}
                usedVariableList(i).arrayElementSize = {{Text|0|#F580B1}}
                usedVariableList(i).indexes = {{Text|<nowiki>""</nowiki>|#FFB100}}
                usedVariableList(i).elements = {{Text|<nowiki>""</nowiki>|#FFB100}}
                usedVariableList(i).elementTypes = {{Text|<nowiki>""</nowiki>|#FFB100}}
                usedVariableList(i).elementOffset = {{Text|<nowiki>""</nowiki>|#FFB100}}
                totalVariablesCreated = totalVariablesCreated + {{Text|1|#F580B1}}
                temp$ = {{Cl|MKL$}}({{Text|-1|#F580B1}}) + {{Cl|MKL$}}({{Cl|LEN}}(cname$)) + cname$
                found = {{Cl|INSTR}}(backupVariableWatchList$, temp$)
                {{Cl|IF}} found {{Cl|THEN}}
                    {{Text|<nowiki>'this variable existed in a previous edit of this program</nowiki>|#919191}}
                    {{Text|<nowiki>'in this same session; let's preselect it.</nowiki>|#919191}}
                    j = {{Cl|CVL}}({{Cl|MID$ (function)|MID$}}(backupVariableWatchList$, found + {{Cl|LEN}}(temp$), {{Text|4|#F580B1}}))
                    {{Text|<nowiki>'if there have been changes in TYPEs, this variable won't be preselected</nowiki>|#919191}}
                    {{Cl|IF}} ({{Cl|LEN}}(backupUsedVariableList(j).elements) > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} backupTypeDefinitions$ = typeDefinitions$) {{Cl|OR (boolean)|OR}} _
                        ({{Cl|LEN}}(backupUsedVariableList(j).elements) = {{Text|0|#F580B1}}) {{Cl|THEN}}
                        usedVariableList(i).watch = backupUsedVariableList(j).watch
                        usedVariableList(i).watchRange = backupUsedVariableList(j).watchRange
                        usedVariableList(i).indexes = backupUsedVariableList(j).indexes
                        usedVariableList(i).displayFormat = backupUsedVariableList(j).displayFormat
                        usedVariableList(i).elements = backupUsedVariableList(j).elements
                        usedVariableList(i).elementTypes = backupUsedVariableList(j).elementTypes
                        usedVariableList(i).elementOffset = backupUsedVariableList(j).elementOffset
                    {{Cl|END}} {{Cl|IF}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|CASE}} {{Cl|ELSE}} {{Text|<nowiki>'find and mark as used</nowiki>|#919191}}
            {{Cl|IF}} found {{Cl|THEN}}
                usedVariableList(i).used = {{Text|-1|#F580B1}}
            {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|SELECT}}
{{Cl|END}} {{Cl|SUB}}
{{Cl|SUB}} {{Text|addWarning|#55FF55}} (whichLineNumber {{Cl|AS}} {{Cl|LONG}}, includeLevel {{Cl|AS}} {{Cl|LONG}}, incLineNumber {{Cl|AS}} {{Cl|LONG}}, incFileName$, header$, text$)
    warningsissued = {{Text|-1|#F580B1}}
    totalWarnings = totalWarnings + {{Text|1|#F580B1}}
    {{Cl|IF}} idemode = {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} ShowWarnings {{Cl|THEN}}
        thissource$ = {{Text|getfilepath$|#55FF55}}(CMDLineFile)
        thissource$ = {{Cl|MID$ (function)|MID$}}(CMDLineFile, {{Cl|LEN}}(thissource$) + {{Text|1|#F580B1}})
        thisincname$ = {{Text|getfilepath$|#55FF55}}(incFileName$)
        thisincname$ = {{Cl|MID$ (function)|MID$}}(incFileName$, {{Cl|LEN}}(thisincname$) + {{Text|1|#F580B1}})
        {{Cl|IF}} {{Cl|NOT}} MonochromeLoggingMode {{Cl|THEN}} {{Cl|COLOR}} {{Text|15|#F580B1}}
        {{Cl|IF}} includeLevel > {{Text|0|#F580B1}} {{Cl|AND (boolean)|AND}} incLineNumber > {{Text|0|#F580B1}} {{Cl|THEN}}
            {{Cl|PRINT}} thisincname$; {{Text|<nowiki>":"</nowiki>|#FFB100}};
            {{Cl|PRINT}} {{Text|str2$|#55FF55}}(incLineNumber); {{Text|<nowiki>": "</nowiki>|#FFB100}};
        {{Cl|ELSE}}
            {{Cl|PRINT}} thissource$; {{Text|<nowiki>":"</nowiki>|#FFB100}};
            {{Cl|PRINT}} {{Text|str2$|#55FF55}}(whichLineNumber); {{Text|<nowiki>": "</nowiki>|#FFB100}};
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} {{Cl|NOT}} MonochromeLoggingMode {{Cl|THEN}} {{Cl|COLOR}} {{Text|13|#F580B1}}
        {{Cl|PRINT}} {{Text|<nowiki>"warning: "</nowiki>|#FFB100}};
        {{Cl|IF}} {{Cl|NOT}} MonochromeLoggingMode {{Cl|THEN}} {{Cl|COLOR}} {{Text|7|#F580B1}}
        {{Cl|PRINT}} header$
        {{Cl|IF}} {{Cl|LEN}}(text$) > {{Text|0|#F580B1}} {{Cl|THEN}}
            {{Cl|IF}} {{Cl|NOT}} MonochromeLoggingMode {{Cl|THEN}} {{Cl|COLOR}} {{Text|2|#F580B1}}
            {{Cl|PRINT}} {{Cl|SPACE$}}({{Text|4|#F580B1}}); text$
            {{Cl|IF}} {{Cl|NOT}} MonochromeLoggingMode {{Cl|THEN}} {{Cl|COLOR}} {{Text|7|#F580B1}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|ELSEIF}} idemode {{Cl|THEN}}
        {{Cl|IF}} {{Cl|NOT}} IgnoreWarnings {{Cl|THEN}}
            {{Cl|IF}} whichLineNumber > maxLineNumber {{Cl|THEN}} maxLineNumber = whichLineNumber
            {{Cl|IF}} lastWarningHeader <> header$ {{Cl|THEN}}
                lastWarningHeader = header$
                {{Cl|GOSUB}} increaseWarningCount
                warning$(warningListItems) = header$
                warningLines(warningListItems) = {{Text|0|#F580B1}}
            {{Cl|END}} {{Cl|IF}}
            {{Cl|GOSUB}} increaseWarningCount
            warning$(warningListItems) = text$
            warningLines(warningListItems) = whichLineNumber
            {{Cl|IF}} includeLevel > {{Text|0|#F580B1}} {{Cl|THEN}}
                thisincname$ = {{Text|getfilepath$|#55FF55}}(incFileName$)
                thisincname$ = {{Cl|MID$ (function)|MID$}}(incFileName$, {{Cl|LEN}}(thisincname$) + {{Text|1|#F580B1}})
                warningIncLines(warningListItems) = incLineNumber
                warningIncFiles(warningListItems) = thisincname$
            {{Cl|ELSE}}
                warningIncLines(warningListItems) = {{Text|0|#F580B1}}
                warningIncFiles(warningListItems) = {{Text|<nowiki>""</nowiki>|#FFB100}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|END}} {{Cl|IF}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|EXIT}} {{Cl|SUB}}
    increaseWarningCount:
    warningListItems = warningListItems + {{Text|1|#F580B1}}
    {{Cl|IF}} warningListItems > {{Cl|UBOUND}}(warning$) {{Cl|THEN}}
        {{Cl|REDIM}} {{Cl|_PRESERVE}} warning$(warningListItems + {{Text|999|#F580B1}})
        {{Cl|REDIM}} {{Cl|_PRESERVE}} warningLines(warningListItems + {{Text|999|#F580B1}}) {{Cl|AS}} {{Cl|LONG}}
        {{Cl|REDIM}} {{Cl|_PRESERVE}} warningIncLines(warningListItems + {{Text|999|#F580B1}}) {{Cl|AS}} {{Cl|LONG}}
        {{Cl|REDIM}} {{Cl|_PRESERVE}} warningIncFiles(warningListItems + {{Text|999|#F580B1}}) {{Cl|AS}} {{Cl|STRING}}
    {{Cl|END}} {{Cl|IF}}
    {{Cl|RETURN}}
{{Cl|END}} {{Cl|SUB}}
{{Cl|FUNCTION}} {{Text|SCase$|#55FF55}} (t$)
    {{Cl|IF}} ideautolayoutkwcapitals {{Cl|THEN}} {{Text|SCase$|#55FF55}} = {{Cl|UCASE$}}(t$) {{Cl|ELSE}} {{Text|SCase$|#55FF55}} = t$
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|FUNCTION}} {{Text|SCase2$|#55FF55}} (t$)
    separator$ = sp
    {{Cl|IF}} ideautolayoutkwcapitals {{Cl|THEN}}
        {{Text|SCase2$|#55FF55}} = {{Cl|UCASE$}}(t$)
    {{Cl|ELSE}}
        newWord = {{Text|-1|#F580B1}}
        temp$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Cl|FOR}} i = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(t$)
            s$ = {{Cl|MID$ (function)|MID$}}(t$, i, {{Text|1|#F580B1}})
            {{Cl|IF}} newWord {{Cl|THEN}}
                {{Cl|IF}} s$ = {{Text|<nowiki>"_"</nowiki>|#FFB100}} {{Cl|OR (boolean)|OR}} s$ = separator$ {{Cl|THEN}}
                    temp$ = temp$ + s$
                {{Cl|ELSE}}
                    temp$ = temp$ + {{Cl|UCASE$}}(s$)
                    newWord = {{Text|0|#F580B1}}
                {{Cl|END}} {{Cl|IF}}
            {{Cl|ELSE}}
                {{Cl|IF}} s$ = separator$ {{Cl|THEN}}
                    temp$ = temp$ + separator$
                    newWord = {{Text|-1|#F580B1}}
                {{Cl|ELSE}}
                    temp$ = temp$ + {{Cl|LCASE$}}(s$)
                {{Cl|END}} {{Cl|IF}}
            {{Cl|END}} {{Cl|IF}}
        {{Cl|NEXT}}
        {{Text|SCase2$|#55FF55}} = temp$
    {{Cl|END}} {{Cl|IF}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Cl|SUB}} {{Text|increaseUDTArrays|#55FF55}}
    x = {{Cl|UBOUND}}(udtxname)
    {{Cl|REDIM}} {{Cl|_PRESERVE}} udtxname(x + {{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|STRING}} * {{Text|256|#F580B1}}
    {{Cl|REDIM}} {{Cl|_PRESERVE}} udtxcname(x + {{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|STRING}} * {{Text|256|#F580B1}}
    {{Cl|REDIM}} {{Cl|_PRESERVE}} udtxsize(x + {{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|LONG}}
    {{Cl|REDIM}} {{Cl|_PRESERVE}} udtxbytealign(x + {{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|INTEGER}} {{Text|<nowiki>'first element MUST be on a byte alignment & size is a multiple of 8</nowiki>|#919191}}
    {{Cl|REDIM}} {{Cl|_PRESERVE}} udtxnext(x + {{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|LONG}}
    {{Cl|REDIM}} {{Cl|_PRESERVE}} udtxvariable(x + {{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|INTEGER}} {{Text|<nowiki>'true if the udt contains variable length elements</nowiki>|#919191}}
    {{Text|<nowiki>'elements</nowiki>|#919191}}
    {{Cl|REDIM}} {{Cl|_PRESERVE}} udtename(x + {{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|STRING}} * {{Text|256|#F580B1}}
    {{Cl|REDIM}} {{Cl|_PRESERVE}} udtecname(x + {{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|STRING}} * {{Text|256|#F580B1}}
    {{Cl|REDIM}} {{Cl|_PRESERVE}} udtebytealign(x + {{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|INTEGER}}
    {{Cl|REDIM}} {{Cl|_PRESERVE}} udtesize(x + {{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|LONG}}
    {{Cl|REDIM}} {{Cl|_PRESERVE}} udtetype(x + {{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|LONG}}
    {{Cl|REDIM}} {{Cl|_PRESERVE}} udtetypesize(x + {{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|LONG}}
    {{Cl|REDIM}} {{Cl|_PRESERVE}} udtearrayelements(x + {{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|LONG}}
    {{Cl|REDIM}} {{Cl|_PRESERVE}} udtenext(x + {{Text|1000|#F580B1}}) {{Cl|AS}} {{Cl|LONG}}
{{Cl|END}} {{Cl|SUB}}
{{Cl|FUNCTION}} {{Text|CompareVersions|#55FF55}} (v$, v1$)
    t$ = v$: t1$ = v1$ {{Text|<nowiki>'temp strings so we don't change the passed values</nowiki>|#919191}}
    {{Cl|IF}} {{Cl|RIGHT$}}(t$, {{Text|8|#F580B1}}) = {{Text|<nowiki>"-UNKNOWN"</nowiki>|#FFB100}} {{Cl|THEN}} t$ = {{Cl|LEFT$}}(t$, {{Cl|LEN}}(t$) - {{Text|8|#F580B1}})
    {{Cl|IF}} {{Cl|RIGHT$}}(t1$, {{Text|8|#F580B1}}) = {{Text|<nowiki>"-UNKNOWN"</nowiki>|#FFB100}} {{Cl|THEN}} t1$ = {{Cl|LEFT$}}(t1$, {{Cl|LEN}}(t1$) - {{Text|8|#F580B1}})
    {{Cl|DO}}
        l = {{Cl|INSTR}}(t$, {{Text|<nowiki>"."</nowiki>|#FFB100}}): l1 = {{Cl|INSTR}}(t1$, {{Text|<nowiki>"."</nowiki>|#FFB100}})
        {{Cl|IF}} l {{Cl|THEN}} {{Text|<nowiki>'                      the first value has a period still</nowiki>|#919191}}
            v& = {{Cl|VAL}}({{Cl|LEFT$}}(t$, l - {{Text|1|#F580B1}})) {{Text|<nowiki>'  take what's to the left of that period for our value</nowiki>|#919191}}
            t$ = {{Cl|MID$ (function)|MID$}}(t$, l + {{Text|1|#F580B1}}) {{Text|<nowiki>'        strip that period and everything to the left off for the next pass</nowiki>|#919191}}
        {{Cl|ELSE}}
            v& = {{Cl|VAL}}(t$) {{Text|<nowiki>'                no period?  Then this is our final pass</nowiki>|#919191}}
            t$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} l1 {{Cl|THEN}}
            v1& = {{Cl|VAL}}({{Cl|LEFT$}}(t1$, l1 - {{Text|1|#F580B1}}))
            t1$ = {{Cl|MID$ (function)|MID$}}(t1$, l1 + {{Text|1|#F580B1}})
        {{Cl|ELSE}}
            v1& = {{Cl|VAL}}(t1$)
            t1$ = {{Text|<nowiki>""</nowiki>|#FFB100}}
        {{Cl|END}} {{Cl|IF}}
        {{Cl|IF}} v& < v1& {{Cl|THEN}} {{Text|CompareVersions|#55FF55}} = {{Text|-1|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} v& > v1& {{Cl|THEN}} {{Text|CompareVersions|#55FF55}} = {{Text|1|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} t$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} t1$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|EXIT}} {{Cl|FUNCTION}} {{Text|<nowiki>'return value 0 -- they're equal</nowiki>|#919191}}
        {{Cl|IF}} t$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} t1$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|CompareVersions|#55FF55}} = {{Text|-1|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
        {{Cl|IF}} t1$ = {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|AND (boolean)|AND}} t$ <> {{Text|<nowiki>""</nowiki>|#FFB100}} {{Cl|THEN}} {{Text|CompareVersions|#55FF55}} = {{Text|1|#F580B1}}: {{Cl|EXIT}} {{Cl|FUNCTION}}
    {{Cl|LOOP}}
{{Cl|END}} {{Cl|FUNCTION}}
{{Text|<nowiki>'</nowiki>|#919191}}{{Cm|$INCLUDE}}:{{Text|<nowiki>'utilities\strings.bas'</nowiki>|#919191}}
{{Text|<nowiki>'</nowiki>|#919191}}{{Cm|$INCLUDE}}:{{Text|<nowiki>'utilities\file.bas'</nowiki>|#919191}}
{{Text|<nowiki>'</nowiki>|#919191}}{{Cm|$INCLUDE}}:{{Text|<nowiki>'utilities\build.bas'</nowiki>|#919191}}
{{Text|<nowiki>'</nowiki>|#919191}}{{Cm|$INCLUDE}}:{{Text|<nowiki>'utilities\elements.bas'</nowiki>|#919191}}
{{Text|<nowiki>'</nowiki>|#919191}}{{Cm|$INCLUDE}}:{{Text|<nowiki>'subs_functions\extensions\opengl\opengl_methods.bas'</nowiki>|#919191}}
{{Text|<nowiki>'</nowiki>|#919191}}{{Cm|$INCLUDE}}:{{Text|<nowiki>'utilities\ini-manager\ini.bm'</nowiki>|#919191}}
{{Text|<nowiki>'</nowiki>|#919191}}{{Cm|$INCLUDE}}:{{Text|<nowiki>'utilities\s-buffer\simplebuffer.bm'</nowiki>|#919191}}
{{Cl|DEFLNG}} A-Z
{{Text|<nowiki>'-------- Optional IDE Component (2/2) --------</nowiki>|#919191}}
{{Text|<nowiki>'</nowiki>|#919191}}{{Cm|$INCLUDE}}:{{Text|<nowiki>'ide\ide_methods.bas'</nowiki>|#919191}}
{{CodeEnd}}

Revision as of 13:56, 15 March 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