BlankPage: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
No edit summary
Tag: Reverted
No edit summary
Tag: Reverted
Line 2,526: Line 2,526:
                             HashAdd hashname$, HASHFLAG_CONSTANT, i2
                             HashAdd hashname$, HASHFLAG_CONSTANT, i2


                            constdefined(i2) = {{Text|1|#F580B1}}
                            constcname(i2) = n$
                            constnamesymbol(i2) = typevalue2symbol$(t)
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            consttype(i2) = t
                            {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
                                conststring(i2) = e$
                            {{Text|ELSE|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISFLOAT {{Text|THEN|#F0F0F0}}
                                    constfloat(i2) = constval##
                                {{Text|ELSE|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISUNSIGNED {{Text|THEN|#F0F0F0}}
                                        constuinteger(i2) = constval~&&
                                    {{Text|ELSE|#F0F0F0}}
                                        constinteger(i2) = constval&&
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            constAddDone:
                            {{Text|IF|#F0F0F0}} pending {{Text|THEN|#F0F0F0}}
                                {{Text|'l$ = l$ + sp2 + ","|#31C4C4}}
                                {{Text|GOTO|#F0F0F0}} constdefpendingpp
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|'layoutdone = 1: IF LEN(layout$) THEN layout$ = layout$ + sp + l$ ELSE layout$ = l$|#31C4C4}}
                            {{Text|GOTO|#F0F0F0}} finishedlinepp
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|'DEFINE|#31C4C4}}
                        d = {{Text|0|#F580B1}}
                        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"DEFINT"|#FFB100}} {{Text|THEN|#F0F0F0}} d = {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"DEFLNG"|#FFB100}} {{Text|THEN|#F0F0F0}} d = {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"DEFSNG"|#FFB100}} {{Text|THEN|#F0F0F0}} d = {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"DEFDBL"|#FFB100}} {{Text|THEN|#F0F0F0}} d = {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"DEFSTR"|#FFB100}} {{Text|THEN|#F0F0F0}} d = {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"_DEFINE"|#FFB100}} {{Text|OR|#F0F0F0}} (firstelement$ = {{Text|"DEFINE"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} d = {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} d {{Text|THEN|#F0F0F0}}
                            predefining = {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} predefine
                            predefined: predefining = {{Text|0|#F580B1}}
                            {{Text|GOTO|#F0F0F0}} finishedlinepp
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|'declare library|#31C4C4}}
                        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"DECLARE"|#FFB100}} {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} secondelement$ = {{Text|"LIBRARY"|#FFB100}} {{Text|OR|#F0F0F0}} secondelement$ = {{Text|"DYNAMIC"|#FFB100}} {{Text|OR|#F0F0F0}} secondelement$ = {{Text|"CUSTOMTYPE"|#FFB100}} {{Text|OR|#F0F0F0}} secondelement$ = {{Text|"STATIC"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                declaringlibrary = {{Text|1|#F580B1}}
                                indirectlibrary = {{Text|0|#F580B1}}
                                {{Text|IF|#F0F0F0}} secondelement$ = {{Text|"CUSTOMTYPE"|#FFB100}} {{Text|OR|#F0F0F0}} secondelement$ = {{Text|"DYNAMIC"|#FFB100}} {{Text|THEN|#F0F0F0}} indirectlibrary = {{Text|1|#F580B1}}
                                {{Text|GOTO|#F0F0F0}} finishedlinepp
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|'SUB/FUNCTION|#31C4C4}}
                        dynamiclibrary = {{Text|0|#F580B1}}
                        declaresubfunc:
                        firstelement$ = getelement$(a$, {{Text|1|#F580B1}})
                        sf = {{Text|0|#F580B1}}
                        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"FUNCTION"|#FFB100}} {{Text|THEN|#F0F0F0}} sf = {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"SUB"|#FFB100}} {{Text|THEN|#F0F0F0}} sf = {{Text|2|#F580B1}}
                        {{Text|IF|#F0F0F0}} sf {{Text|THEN|#F0F0F0}}
                            subfuncn = subfuncn + {{Text|1|#F580B1}}
                            closedsubfunc = {{Text|0|#F580B1}}
                            {{Text|IF|#F0F0F0}} n = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected name after SUB/FUNCTION"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|'convert periods to _046_|#31C4C4}}
                            i2 = {{Text|INSTR|#F0F0F0}}(a$, sp + {{Text|"."|#FFB100}} + sp)
                            {{Text|IF|#F0F0F0}} i2 {{Text|THEN|#F0F0F0}}
                                {{Text|DO|#F0F0F0}}
                                    a$ = {{Text|LEFT$|#F0F0F0}}(a$, i2 - {{Text|1|#F580B1}}) + fix046$ + {{Text|RIGHT$|#F0F0F0}}(a$, {{Text|LEN|#F0F0F0}}(a$) - i2 - {{Text|2|#F580B1}})
                                    ca$ = {{Text|LEFT$|#F0F0F0}}(ca$, i2 - {{Text|1|#F580B1}}) + fix046$ + {{Text|RIGHT$|#F0F0F0}}(ca$, {{Text|LEN|#F0F0F0}}(ca$) - i2 - {{Text|2|#F580B1}})
                                    i2 = {{Text|INSTR|#F0F0F0}}(a$, sp + {{Text|"."|#FFB100}} + sp)
                                {{Text|LOOP|#F0F0F0}} {{Text|UNTIL|#F0F0F0}} i2 = {{Text|0|#F580B1}}
                                n = numelements(a$)
                                firstelement$ = getelement(a$, {{Text|1|#F580B1}}): secondelement$ = getelement(a$, {{Text|2|#F580B1}}): thirdelement$ = getelement(a$, {{Text|3|#F580B1}})
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            n$ = getelement$(ca$, {{Text|2|#F580B1}})
                            symbol$ = removesymbol$(n$)
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|IF|#F0F0F0}} sf = {{Text|2|#F580B1}} {{Text|AND|#F0F0F0}} symbol$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Type symbols after a SUB name are invalid"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|'remove STATIC (which is ignored)|#31C4C4}}
                            e$ = getelement$(a$, n): {{Text|IF|#F0F0F0}} e$ = {{Text|"STATIC"|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|LEFT$|#F0F0F0}}(a$, {{Text|LEN|#F0F0F0}}(a$) - {{Text|7|#F580B1}}): ca$ = {{Text|LEFT$|#F0F0F0}}(ca$, {{Text|LEN|#F0F0F0}}(ca$) - {{Text|7|#F580B1}}): n = n - {{Text|1|#F580B1}}
                            {{Text|'check for ALIAS|#31C4C4}}
                            aliasname$ = n$ {{Text|'use given name by default|#31C4C4}}
                            {{Text|IF|#F0F0F0}} n > {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                                e$ = getelement$(a$, {{Text|3|#F580B1}})
                                {{Text|IF|#F0F0F0}} e$ = {{Text|"ALIAS"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} declaringlibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"ALIAS can only be used with DECLARE LIBRARY"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                    {{Text|IF|#F0F0F0}} n = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ALIAS name-in-library"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                    e$ = getelement$(ca$, {{Text|4|#F580B1}})
                                    {{Text|'strip string content (optional)|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(e$, {{Text|1|#F580B1}}) = {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) {{Text|THEN|#F0F0F0}}
                                        e$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - {{Text|1|#F580B1}})
                                        x = {{Text|INSTR|#F0F0F0}}(e$, {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}})): {{Text|IF|#F0F0F0}} x = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}): {{Text|GOTO|#F0F0F0}} errmes
                                        e$ = {{Text|LEFT$|#F0F0F0}}(e$, x - {{Text|1|#F580B1}})
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|'strip fix046$ (created by unquoted periods)|#31C4C4}}
                                    {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(e$, fix046$)
                                        x = {{Text|INSTR|#F0F0F0}}(e$, fix046$): e$ = {{Text|LEFT$|#F0F0F0}}(e$, x - {{Text|1|#F580B1}}) + {{Text|"."|#FFB100}} + {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - x + {{Text|1|#F580B1}} - {{Text|LEN|#F0F0F0}}(fix046$))
                                    {{Text|LOOP|#F0F0F0}}
                                    {{Text|'validate alias name|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(e$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ALIAS name-in-library"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                    {{Text|FOR|#F0F0F0}} x = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|LEN|#F0F0F0}}(e$)
                                        a = {{Text|ASC|#F0F0F0}}(e$, x)
                                        {{Text|IF|#F0F0F0}} alphanumeric(a) = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} a <> ASC_FULLSTOP {{Text|AND|#F0F0F0}} a <> ASC_COLON {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ALIAS name-in-library"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                    {{Text|NEXT|#F0F0F0}}
                                    aliasname$ = e$
                                    {{Text|'remove ALIAS section from line|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} n <= {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = getelements(a$, {{Text|1|#F580B1}}, {{Text|2|#F580B1}})
                                    {{Text|IF|#F0F0F0}} n >= {{Text|5|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = getelements(a$, {{Text|1|#F580B1}}, {{Text|2|#F580B1}}) + sp + getelements(a$, {{Text|5|#F580B1}}, n)
                                    {{Text|IF|#F0F0F0}} n <= {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} ca$ = getelements(ca$, {{Text|1|#F580B1}}, {{Text|2|#F580B1}})
                                    {{Text|IF|#F0F0F0}} n >= {{Text|5|#F580B1}} {{Text|THEN|#F0F0F0}} ca$ = getelements(ca$, {{Text|1|#F580B1}}, {{Text|2|#F580B1}}) + sp + getelements(ca$, {{Text|5|#F580B1}}, n)
                                    n = n - {{Text|2|#F580B1}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} declaringlibrary {{Text|THEN|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} indirectlibrary {{Text|THEN|#F0F0F0}}
                                    aliasname$ = n$ {{Text|'override the alias name|#31C4C4}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            params = {{Text|0|#F580B1}}
                            params$ = {{Text|""|#FFB100}}
                            paramsize$ = {{Text|""|#FFB100}}
                            nele$ = {{Text|""|#FFB100}}
                            nelereq$ = {{Text|""|#FFB100}}
                            {{Text|IF|#F0F0F0}} n > {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                                e$ = getelement$(a$, {{Text|3|#F580B1}})
                                {{Text|IF|#F0F0F0}} e$ <> {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ("|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                e$ = getelement$(a$, n)
                                {{Text|IF|#F0F0F0}} e$ <> {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected )"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                {{Text|IF|#F0F0F0}} n < {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ( ... )"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                {{Text|IF|#F0F0F0}} n = {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} nosfparams
                                B = {{Text|0|#F580B1}}
                                a2$ = {{Text|""|#FFB100}}
                                {{Text|FOR|#F0F0F0}} i = {{Text|4|#F580B1}} {{Text|TO|#F0F0F0}} n - {{Text|1|#F580B1}}
                                    e$ = getelement$(a$, i)
                                    {{Text|IF|#F0F0F0}} e$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} B = B + {{Text|1|#F580B1}}
                                    {{Text|IF|#F0F0F0}} e$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} B = B - {{Text|1|#F580B1}}
                                    {{Text|IF|#F0F0F0}} e$ = {{Text|","|#FFB100}} {{Text|AND|#F0F0F0}} B = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} i = n - {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected , ... )"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                        getlastparam:
                                        {{Text|IF|#F0F0F0}} a2$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ... ,"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                        a2$ = {{Text|LEFT$|#F0F0F0}}(a2$, {{Text|LEN|#F0F0F0}}(a2$) - {{Text|1|#F580B1}})
                                        {{Text|'possible format: [BYVAL]a[%][(1)][AS][type]|#31C4C4}}
                                        n2 = numelements(a2$)
                                        array = {{Text|0|#F580B1}}
                                        t2$ = {{Text|""|#FFB100}}
                                        i2 = {{Text|1|#F580B1}}
                                        e$ = getelement$(a2$, i2): i2 = i2 + {{Text|1|#F580B1}}
                                        byvalue = {{Text|0|#F580B1}}
                                        {{Text|IF|#F0F0F0}} e$ = {{Text|"BYVAL"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                            {{Text|IF|#F0F0F0}} declaringlibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"BYVAL can currently only be used with DECLARE LIBRARY"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                            e$ = getelement$(a2$, i2): i2 = i2 + {{Text|1|#F580B1}}: byvalue = {{Text|1|#F580B1}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                        n2$ = e$
                                        symbol2$ = removesymbol$(n2$)
                                        {{Text|IF|#F0F0F0}} validname(n2$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Invalid name"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                        m = {{Text|0|#F580B1}}
                                        {{Text|FOR|#F0F0F0}} i2 = i2 {{Text|TO|#F0F0F0}} n2
                                            e$ = getelement$(a2$, i2)
                                            {{Text|IF|#F0F0F0}} e$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}}
                                                {{Text|IF|#F0F0F0}} m <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Syntax error - too many opening brackets"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                                m = {{Text|1|#F580B1}}
                                                array = {{Text|1|#F580B1}}
                                                {{Text|GOTO|#F0F0F0}} gotaa
                                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                            {{Text|IF|#F0F0F0}} e$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                                {{Text|IF|#F0F0F0}} m <> {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Syntax error - closing bracket without opening bracket"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                                m = {{Text|2|#F580B1}}
                                                {{Text|GOTO|#F0F0F0}} gotaa
                                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                            {{Text|IF|#F0F0F0}} e$ = {{Text|"AS"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                                {{Text|IF|#F0F0F0}} m <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} m <> {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Syntax error - check your brackets"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                                m = {{Text|3|#F580B1}}
                                                {{Text|GOTO|#F0F0F0}} gotaa
                                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                            {{Text|IF|#F0F0F0}} m = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} gotaa {{Text|'ignore contents of bracket|#31C4C4}}
                                            {{Text|IF|#F0F0F0}} m <> {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Syntax error - check your brackets"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                            {{Text|IF|#F0F0F0}} t2$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} t2$ = e$ {{Text|ELSE|#F0F0F0}} t2$ = t2$ + {{Text|" "|#FFB100}} + e$
                                            gotaa:
                                        {{Text|NEXT|#F0F0F0}} i2
                                        params = params + {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} params > {{Text|100|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"SUB/FUNCTION exceeds 100 parameter limit"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                        argnelereq = {{Text|0|#F580B1}}
                                        {{Text|IF|#F0F0F0}} symbol2$ <> {{Text|""|#FFB100}} {{Text|AND|#F0F0F0}} t2$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Syntax error - check parameter types"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                        {{Text|IF|#F0F0F0}} t2$ = {{Text|""|#FFB100}} {{Text|AND|#F0F0F0}} e$ = {{Text|"AS"|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected AS type"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                        {{Text|IF|#F0F0F0}} t2$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} t2$ = symbol2$
                                        {{Text|IF|#F0F0F0}} t2$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
                                            {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(n2$, {{Text|1|#F580B1}}) = {{Text|"_"|#FFB100}} {{Text|THEN|#F0F0F0}} v = {{Text|27|#F580B1}} {{Text|ELSE|#F0F0F0}} v = {{Text|ASC|#F0F0F0}}({{Text|UCASE$|#F0F0F0}}(n2$)) - {{Text|64|#F580B1}}
                                            t2$ = defineaz(v)
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                        paramsize = {{Text|0|#F580B1}}
                                        {{Text|IF|#F0F0F0}} array = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                                            t = typname2typ(t2$)
                                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                            {{Text|IF|#F0F0F0}} t = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Illegal SUB/FUNCTION parameter"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                            {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISFIXEDLENGTH) {{Text|THEN|#F0F0F0}} paramsize = typname2typsize
                                            t = t + ISARRAY
                                            {{Text|'check for recompilation override|#31C4C4}}
                                            {{Text|FOR|#F0F0F0}} i10 = {{Text|0|#F580B1}} {{Text|TO|#F0F0F0}} sflistn
                                                {{Text|IF|#F0F0F0}} sfidlist(i10) = idn + {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                                                    {{Text|IF|#F0F0F0}} sfarglist(i10) = params {{Text|THEN|#F0F0F0}}
                                                        argnelereq = sfelelist(i10)
                                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                            {{Text|NEXT|#F0F0F0}}
                                        {{Text|ELSE|#F0F0F0}}
                                            t = typname2typ(t2$)
                                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                            {{Text|IF|#F0F0F0}} t = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Illegal SUB/FUNCTION parameter"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                            {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISFIXEDLENGTH) {{Text|THEN|#F0F0F0}} paramsize = typname2typsize
                                            {{Text|IF|#F0F0F0}} byvalue {{Text|THEN|#F0F0F0}}
                                                {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISPOINTER {{Text|THEN|#F0F0F0}} t = t - ISPOINTER
                                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                        nelereq$ = nelereq$ + {{Text|CHR$|#F0F0F0}}(argnelereq)
                                        {{Text|'consider changing 0 in following line too!|#31C4C4}}
                                        nele$ = nele$ + {{Text|CHR$|#F0F0F0}}({{Text|0|#F580B1}})
                                        paramsize$ = paramsize$ + {{Text|MKL$|#F0F0F0}}(paramsize)
                                        params$ = params$ + {{Text|MKL$|#F0F0F0}}(t)
                                        a2$ = {{Text|""|#FFB100}}
                                    {{Text|ELSE|#F0F0F0}}
                                        a2$ = a2$ + e$ + sp
                                        {{Text|IF|#F0F0F0}} i = n - {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} getlastparam
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|NEXT|#F0F0F0}} i
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'n>2|#31C4C4}}
                            nosfparams:
                            {{Text|IF|#F0F0F0}} sf = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                                {{Text|'function|#31C4C4}}
                                clearid
                                id.n = n$
                                id.subfunc = {{Text|1|#F580B1}}
                                id.callname = {{Text|"FUNC_"|#FFB100}} + {{Text|UCASE$|#F0F0F0}}(n$)
                                {{Text|IF|#F0F0F0}} declaringlibrary {{Text|THEN|#F0F0F0}}
                                    id.ccall = {{Text|1|#F580B1}}
                                    {{Text|IF|#F0F0F0}} indirectlibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} id.callname = aliasname$
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                id.args = params
                                id.arg = params$
                                id.argsize = paramsize$
                                id.nele = nele$
                                id.nelereq = nelereq$
                                {{Text|IF|#F0F0F0}} symbol$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
                                    id.ret = typname2typ(symbol$)
                                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                {{Text|ELSE|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(n$, {{Text|1|#F580B1}}) = {{Text|"_"|#FFB100}} {{Text|THEN|#F0F0F0}} v = {{Text|27|#F580B1}} {{Text|ELSE|#F0F0F0}} v = {{Text|ASC|#F0F0F0}}({{Text|UCASE$|#F0F0F0}}(n$)) - {{Text|64|#F580B1}}
                                    symbol$ = defineaz(v)
                                    id.ret = typname2typ(symbol$)
                                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} id.ret = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Invalid FUNCTION return type"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                {{Text|IF|#F0F0F0}} declaringlibrary {{Text|THEN|#F0F0F0}}
                                    ctype$ = typ2ctyp$(id.ret, {{Text|""|#FFB100}})
                                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                    {{Text|IF|#F0F0F0}} ctype$ = {{Text|"qbs"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"char*"|#FFB100}}
                                    id.callname = {{Text|"(  "|#FFB100}} + ctype$ + {{Text|"  )"|#FFB100}} + {{Text|RTRIM$|#F0F0F0}}(id.callname)
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                s$ = {{Text|LEFT$|#F0F0F0}}(symbol$, {{Text|1|#F580B1}})
                                {{Text|IF|#F0F0F0}} s$ <> {{Text|"~"|#FFB100}} {{Text|AND|#F0F0F0}} s$ <> {{Text|"`"|#FFB100}} {{Text|AND|#F0F0F0}} s$ <> {{Text|"%"|#FFB100}} {{Text|AND|#F0F0F0}} s$ <> {{Text|"&"|#FFB100}} {{Text|AND|#F0F0F0}} s$ <> {{Text|"!"|#FFB100}} {{Text|AND|#F0F0F0}} s$ <> {{Text|"#"|#FFB100}} {{Text|AND|#F0F0F0}} s$ <> {{Text|"$"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                    symbol$ = type2symbol$(symbol$)
                                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                id.mayhave = symbol$
                                {{Text|IF|#F0F0F0}} id.ret {{Text|AND|#F0F0F0}} ISPOINTER {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} (id.ret {{Text|AND|#F0F0F0}} ISSTRING) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} id.ret = id.ret - ISPOINTER
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                regid
                                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|ELSE|#F0F0F0}}
                                {{Text|'sub|#31C4C4}}
                                clearid
                                id.n = n$
                                id.subfunc = {{Text|2|#F580B1}}
                                id.callname = {{Text|"SUB_"|#FFB100}} + {{Text|UCASE$|#F0F0F0}}(n$)
                                {{Text|IF|#F0F0F0}} declaringlibrary {{Text|THEN|#F0F0F0}}
                                    id.ccall = {{Text|1|#F580B1}}
                                    {{Text|IF|#F0F0F0}} indirectlibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} id.callname = aliasname$
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                id.args = params
                                id.arg = params$
                                id.argsize = paramsize$
                                id.nele = nele$
                                id.nelereq = nelereq$
                                {{Text|IF|#F0F0F0}} {{Text|UCASE$|#F0F0F0}}(n$) = {{Text|"_GL"|#FFB100}} {{Text|AND|#F0F0F0}} params = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} UseGL = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} reginternalsubfunc = {{Text|1|#F580B1}}: UseGL = {{Text|1|#F580B1}}: id.n = {{Text|"_GL"|#FFB100}}: DEPENDENCY(DEPENDENCY_GL) = {{Text|1|#F580B1}}
                                regid
                                reginternalsubfunc = {{Text|0|#F580B1}}
                                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|'========================================|#31C4C4}}
                        finishedlinepp:
                        firstLine = {{Text|0|#F580B1}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    a$ = {{Text|""|#FFB100}}
                    ca$ = {{Text|""|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} a$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = e$: ca$ = ce$ {{Text|ELSE|#F0F0F0}} a$ = a$ + sp + e$: ca$ = ca$ + sp + ce$
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} wholelinei <= wholelinen {{Text|THEN|#F0F0F0}} wholelinei = wholelinei + {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} ppblda
                {{Text|'----------------------------------------|#31C4C4}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'wholelinei<=wholelinen|#31C4C4}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'wholelinen|#31C4C4}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'len(wholeline$)|#31C4C4}}
    {{Text|'Include Manager #1|#31C4C4}}
    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(addmetainclude$) {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"Pre-pass:INCLUDE$-ing file:'"|#FFB100}} + addmetainclude$ + {{Text|"':On line"|#FFB100}}; linenumber
        a$ = addmetainclude$: addmetainclude$ = {{Text|""|#FFB100}} {{Text|'read/clear message|#31C4C4}}
        {{Text|IF|#F0F0F0}} inclevel = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            includingFromRoot = {{Text|0|#F580B1}}
            forceIncludingFile = {{Text|0|#F580B1}}
            forceInclude_prepass:
            {{Text|IF|#F0F0F0}} forceIncludeFromRoot$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
                a$ = forceIncludeFromRoot$
                forceIncludeFromRoot$ = {{Text|""|#FFB100}}
                forceIncludingFile = {{Text|1|#F580B1}}
                includingFromRoot = {{Text|1|#F580B1}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} inclevel = {{Text|100|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Too many indwelling INCLUDE files"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
        {{Text|'1. Verify file exists (location is either (a)relative to source file or (b)absolute)|#31C4C4}}
        fh = {{Text|99|#F580B1}} + inclevel + {{Text|1|#F580B1}}
        firstTryMethod = {{Text|1|#F580B1}}
        {{Text|IF|#F0F0F0}} includingFromRoot <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} inclevel = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} firstTryMethod = {{Text|2|#F580B1}}
        {{Text|FOR|#F0F0F0}} try = firstTryMethod {{Text|TO|#F0F0F0}} {{Text|2|#F580B1}} {{Text|'if including file from root, do not attempt including from relative location|#31C4C4}}
            {{Text|IF|#F0F0F0}} try = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} inclevel = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} idemode {{Text|THEN|#F0F0F0}} p$ = idepath$ + pathsep$ {{Text|ELSE|#F0F0F0}} p$ = getfilepath$(sourcefile$)
                {{Text|ELSE|#F0F0F0}}
                    p$ = getfilepath$(incname(inclevel))
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                f$ = p$ + a$
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} f$ = a$
            {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(f$) {{Text|THEN|#F0F0F0}}
                qberrorhappened = {{Text|-3|#F580B1}}
                {{Text|'We're using the faster LINE INPUT, which requires a BINARY open.|#31C4C4}}
                {{Text|OPEN|#F0F0F0}} f$ {{Text|FOR|#F0F0F0}} {{Text|BINARY|#F0F0F0}} {{Text|AS|#F0F0F0}} #fh
                {{Text|'And another line below edited|#31C4C4}}
                qberrorhappened3:
                {{Text|IF|#F0F0F0}} qberrorhappened = {{Text|-3|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            qberrorhappened = {{Text|0|#F580B1}}
        {{Text|NEXT|#F0F0F0}}
        {{Text|IF|#F0F0F0}} qberrorhappened <> {{Text|-3|#F580B1}} {{Text|THEN|#F0F0F0}} qberrorhappened = {{Text|0|#F580B1}}: a$ = {{Text|"File "|#FFB100}} + a$ + {{Text|" not found"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
        inclevel = inclevel + {{Text|1|#F580B1}}: incname$(inclevel) = f$: inclinenumber(inclevel) = {{Text|0|#F580B1}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'fall through to next section...|#31C4C4}}
    {{Text|'--------------------|#31C4C4}}
    {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} inclevel
        fh = {{Text|99|#F580B1}} + inclevel
        {{Text|'2. Feed next line|#31C4C4}}
        {{Text|IF|#F0F0F0}} {{Text|EOF|#F0F0F0}}(fh) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|LINE|#F0F0F0}} {{Text|INPUT|#F0F0F0}} #fh, x$
            wholeline$ = x$
            inclinenumber(inclevel) = inclinenumber(inclevel) + {{Text|1|#F580B1}}
            {{Text|'create extended error string 'incerror$'|#31C4C4}}
            errorLineInInclude = inclinenumber(inclevel)
            e$ = {{Text|" in line "|#FFB100}} + str2(inclinenumber(inclevel)) + {{Text|" of "|#FFB100}} + incname$(inclevel) + {{Text|" included"|#FFB100}}
            {{Text|IF|#F0F0F0}} inclevel > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                e$ = e$ + {{Text|" (through "|#FFB100}}
                {{Text|FOR|#F0F0F0}} x = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} inclevel - {{Text|1|#F580B1}} {{Text|STEP|#F0F0F0}} {{Text|1|#F580B1}}
                    e$ = e$ + incname$(x)
                    {{Text|IF|#F0F0F0}} x < inclevel - {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'a sep is req|#31C4C4}}
                        {{Text|IF|#F0F0F0}} x = inclevel - {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                            e$ = e$ + {{Text|" then "|#FFB100}}
                        {{Text|ELSE|#F0F0F0}}
                            e$ = e$ + {{Text|", "|#FFB100}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|NEXT|#F0F0F0}}
                e$ = e$ + {{Text|")"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            incerror$ = e$
            linenumber = linenumber - {{Text|1|#F580B1}} {{Text|'lower official linenumber to counter later increment|#31C4C4}}
            {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"Pre-pass:Feeding INCLUDE$ line:["|#FFB100}} + wholeline$ + {{Text|"]"|#FFB100}}
            {{Text|IF|#F0F0F0}} idemode {{Text|THEN|#F0F0F0}} sendc$ = {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}}) + wholeline$: {{Text|GOTO|#F0F0F0}} sendcommand {{Text|'passback|#31C4C4}}
            {{Text|GOTO|#F0F0F0}} ideprepass
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|'3. Close & return control|#31C4C4}}
        {{Text|CLOSE|#F0F0F0}} #fh
        inclevel = inclevel - {{Text|1|#F580B1}}
        {{Text|IF|#F0F0F0}} forceIncludingFile = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} inclevel = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            forceIncludingFile = {{Text|0|#F580B1}}
            {{Text|GOTO|#F0F0F0}} forceIncludeCompleted_prepass
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|LOOP|#F0F0F0}}
    {{Text|'(end manager)|#31C4C4}}
    {{Text|IF|#F0F0F0}} idemode {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} ideret2
{{Text|LOOP|#F0F0F0}}
{{Text|'add final line|#31C4C4}}
{{Text|IF|#F0F0F0}} lastLineReturn = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
    lastLineReturn = {{Text|1|#F580B1}}
    lastLine = {{Text|1|#F580B1}}
    wholeline$ = {{Text|""|#FFB100}}
    {{Text|GOTO|#F0F0F0}} prepassLastLine
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}} definingtype {{Text|THEN|#F0F0F0}} definingtype = {{Text|0|#F580B1}} {{Text|'ignore this error so that auto-formatting can be performed and catch it again later|#31C4C4}}
{{Text|IF|#F0F0F0}} declaringlibrary {{Text|THEN|#F0F0F0}} declaringlibrary = {{Text|0|#F580B1}} {{Text|'ignore this error so that auto-formatting can be performed and catch it again later|#31C4C4}}
totallinenumber = reallinenumber
{{Text|'IF idemode = 0 AND NOT QuietMode THEN PRINT "first pass finished.": PRINT "Translating code... "|#31C4C4}}
{{Text|'prepass finished|#31C4C4}}
lineinput3index = {{Text|1|#F580B1}} {{Text|'reset input line|#31C4C4}}
{{Text|'ide specific|#31C4C4}}
ide3:
addmetainclude$ = {{Text|""|#FFB100}} {{Text|'reset stray meta-includes|#31C4C4}}
{{Text|'reset altered variables|#31C4C4}}
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}}
{{Text|FOR|#F0F0F0}} i = {{Text|0|#F580B1}} {{Text|TO|#F0F0F0}} constlast: constdefined(i) = {{Text|0|#F580B1}}: {{Text|NEXT|#F0F0F0}} {{Text|'undefine constants|#31C4C4}}
{{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|27|#F580B1}}: defineaz(i) = {{Text|"SINGLE"|#FFB100}}: defineextaz(i) = {{Text|"!"|#FFB100}}: {{Text|NEXT|#F0F0F0}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} DataBinBuf: DataBinBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + {{Text|"data.bin"|#FFB100}})
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} MainTxtBuf: MainTxtBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + {{Text|"main.txt"|#FFB100}})
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} DataTxtBuf: DataTxtBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + {{Text|"maindata.txt"|#FFB100}})
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} RegTxtBuf: RegTxtBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + {{Text|"regsf.txt"|#FFB100}})
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} FreeTxtBuf: FreeTxtBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + {{Text|"mainfree.txt"|#FFB100}})
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} RunTxtBuf: RunTxtBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + {{Text|"runline.txt"|#FFB100}})
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} ErrTxtBuf: ErrTxtBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + {{Text|"mainerr.txt"|#FFB100}})
{{Text|'i. check the value of error_line|#31C4C4}}
{{Text|'ii. jump to the appropriate label|#31C4C4}}
errorlabels = {{Text|0|#F580B1}}
WriteBufLine ErrTxtBuf, {{Text|"if (error_occurred){ error_occurred=0;"|#FFB100}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} ChainTxtBuf: ChainTxtBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + {{Text|"chain.txt"|#FFB100}})
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} InpChainTxtBuf: InpChainTxtBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + {{Text|"inpchain.txt"|#FFB100}})
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} TimeTxtBuf: TimeTxtBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + {{Text|"ontimer.txt"|#FFB100}})
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} TimejTxtBuf: TimejTxtBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + {{Text|"ontimerj.txt"|#FFB100}})
{{Text|'*****#26 used for locking qb64pe|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} KeyTxtBuf: KeyTxtBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + {{Text|"onkey.txt"|#FFB100}})
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} KeyjTxtBuf: KeyjTxtBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + {{Text|"onkeyj.txt"|#FFB100}})
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} StrigTxtBuf: StrigTxtBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + {{Text|"onstrig.txt"|#FFB100}})
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} StrigjTxtBuf: StrigjTxtBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + {{Text|"onstrigj.txt"|#FFB100}})
gosubid = {{Text|1|#F580B1}}
{{Text|'to be included whenever return without a label is called|#31C4C4}}
{{Text|'return [label] in QBASIC was not possible in a sub/function, but QB64 will support this|#31C4C4}}
{{Text|'special codes will represent special return conditions:|#31C4C4}}
{{Text|'0=return from main to calling sub/function/proc by return [NULL];|#31C4C4}}
{{Text|'1... a global number representing a return point after a gosub|#31C4C4}}
{{Text|'note: RETURN [label] should fail if a "return [NULL];" type return is required|#31C4C4}}
{{Text|DIM|#F0F0F0}} {{Text|SHARED|#F0F0F0}} RetTxtBuf: RetTxtBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + {{Text|"ret0.txt"|#FFB100}})
WriteBufLine RetTxtBuf, {{Text|"if (next_return_point){"|#FFB100}}
WriteBufLine RetTxtBuf, {{Text|"next_return_point--;"|#FFB100}}
WriteBufLine RetTxtBuf, {{Text|"switch(return_point[next_return_point]){"|#FFB100}}
WriteBufLine RetTxtBuf, {{Text|"case 0:"|#FFB100}}
WriteBufLine RetTxtBuf, {{Text|"return;"|#FFB100}}
WriteBufLine RetTxtBuf, {{Text|"break;"|#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}}
WriteBufLine MainTxtBuf, {{Text|"S_0:;"|#FFB100}} {{Text|'note: REQUIRED by run statement|#31C4C4}}
{{Text|IF|#F0F0F0}} UseGL {{Text|THEN|#F0F0F0}} gl_include_content
{{Text|'ide specific|#31C4C4}}
{{Text|IF|#F0F0F0}} idemode {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} ideret3
{{Text|DO|#F0F0F0}}
    ide4:
    includeline:
    mainpassLastLine:
    {{Text|IF|#F0F0F0}} lastLine <> {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} firstLine <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
        lineBackup$ = a3$ {{Text|'backup the real first line (will be blank when lastline is set)|#31C4C4}}
        forceIncludeFromRoot$ = {{Text|""|#FFB100}}
        {{Text|IF|#F0F0F0}} vWatchOn {{Text|THEN|#F0F0F0}}
            addingvWatch = {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} firstLine <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} forceIncludeFromRoot$ = {{Text|"internal\support\vwatch\vwatch.bi"|#FFB100}}
            {{Text|IF|#F0F0F0}} lastLine <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} forceIncludeFromRoot$ = {{Text|"internal\support\vwatch\vwatch.bm"|#FFB100}}
        {{Text|ELSE|#F0F0F0}}
            {{Text|'IF firstLine <> 0 THEN forceIncludeFromRoot$ = "internal\support\vwatch\vwatch_stub.bi"|#31C4C4}}
            {{Text|IF|#F0F0F0}} lastLine <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} forceIncludeFromRoot$ = {{Text|"internal\support\vwatch\vwatch_stub.bm"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        firstLine = {{Text|0|#F580B1}}: lastLine = {{Text|0|#F580B1}}
        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(forceIncludeFromRoot$) {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} forceInclude
        forceIncludeCompleted:
        addingvWatch = {{Text|0|#F580B1}}
        a3$ = lineBackup$
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    prepass = {{Text|0|#F580B1}}
    stringprocessinghappened = {{Text|0|#F580B1}}
    {{Text|IF|#F0F0F0}} continuelinefrom {{Text|THEN|#F0F0F0}}
        start = continuelinefrom
        continuelinefrom = {{Text|0|#F580B1}}
        {{Text|GOTO|#F0F0F0}} contline
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'begin a new line|#31C4C4}}
    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|'apply metacommands from previous line|#31C4C4}}
    {{Text|IF|#F0F0F0}} addmetadynamic = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} addmetadynamic = {{Text|0|#F580B1}}: DynamicMode = {{Text|1|#F580B1}}
    {{Text|IF|#F0F0F0}} addmetastatic = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} addmetastatic = {{Text|0|#F580B1}}: DynamicMode = {{Text|0|#F580B1}}
    {{Text|'a3$ is passed in idemode and when using $include|#31C4C4}}
    {{Text|IF|#F0F0F0}} idemode = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} inclevel = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a3$ = lineinput3$
    {{Text|IF|#F0F0F0}} a3$ = {{Text|CHR$|#F0F0F0}}({{Text|13|#F580B1}}) {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
    linenumber = linenumber + {{Text|1|#F580B1}}
    reallinenumber = reallinenumber + {{Text|1|#F580B1}}
    {{Text|IF|#F0F0F0}} InValidLine(linenumber) {{Text|THEN|#F0F0F0}}
        layoutok = {{Text|1|#F580B1}}
        layout$ = {{Text|SPACE$|#F0F0F0}}(controllevel + {{Text|1|#F580B1}}) + {{Text|LTRIM$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(a3$))
        {{Text|IF|#F0F0F0}} idemode {{Text|GOTO|#F0F0F0}} ideret4 {{Text|ELSE|#F0F0F0}} {{Text|GOTO|#F0F0F0}} skipide4
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    layout = {{Text|""|#FFB100}}
    layoutok = {{Text|1|#F580B1}}
    {{Text|IF|#F0F0F0}} idemode = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|NOT|#F0F0F0}} QuietMode {{Text|THEN|#F0F0F0}}
        {{Text|'IF LEN(a3$) THEN|#31C4C4}}
        {{Text|'    dotlinecount = dotlinecount + 1: IF dotlinecount >= 100 THEN dotlinecount = 0: PRINT ".";|#31C4C4}}
        {{Text|'END IF|#31C4C4}}
        maxprogresswidth = {{Text|50|#F580B1}} {{Text|'arbitrary|#31C4C4}}
        percentage = {{Text|INT|#F0F0F0}}(reallinenumber / totallinenumber * {{Text|100|#F580B1}})
        percentagechars = {{Text|INT|#F0F0F0}}(maxprogresswidth * reallinenumber / totallinenumber)
        {{Text|IF|#F0F0F0}} percentage <> prevpercentage {{Text|AND|#F0F0F0}} percentagechars <> prevpercentagechars {{Text|THEN|#F0F0F0}}
            prevpercentage = percentage
            prevpercentagechars = percentagechars
            {{Text|IF|#F0F0F0}} ConsoleMode {{Text|THEN|#F0F0F0}}
                {{Text|PRINT|#F0F0F0}} {{Text|"["|#FFB100}} + {{Text|STRING$|#F0F0F0}}(percentagechars, {{Text|"."|#FFB100}}) + {{Text|SPACE$|#F0F0F0}}(maxprogresswidth - percentagechars) + {{Text|"]"|#FFB100}} + {{Text|STR$|#F0F0F0}}(percentage) + {{Text|"%"|#FFB100}};
                {{Text|IF|#F0F0F0}} os$ = {{Text|"LNX"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|PRINT|#F0F0F0}} {{Text|CHR$|#F0F0F0}}({{Text|27|#F580B1}}) + {{Text|"[A"|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    {{Text|PRINT|#F0F0F0}} {{Text|CHR$|#F0F0F0}}({{Text|13|#F580B1}});
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|ELSE|#F0F0F0}}
                {{Text|LOCATE|#F0F0F0}} , {{Text|1|#F580B1}}
                {{Text|PRINT|#F0F0F0}} {{Text|STRING$|#F0F0F0}}(percentagechars, {{Text|219|#F580B1}}) + {{Text|STRING$|#F0F0F0}}(maxprogresswidth - percentagechars, {{Text|176|#F580B1}}) + {{Text|STR$|#F0F0F0}}(percentage) + {{Text|"%"|#FFB100}};
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    a3$ = {{Text|LTRIM$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(a3$))
    wholeline = a3$
    layoutoriginal$ = a3$
    layoutcomment$ = {{Text|""|#FFB100}} {{Text|'clear any previous layout comment|#31C4C4}}
    lhscontrollevel = controllevel
    linefragment = {{Text|"[INFORMATION UNAVAILABLE]"|#FFB100}}
    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(a3$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} finishednonexec
    {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"########"|#FFB100}} + a3$ + {{Text|"########"|#FFB100}}
    layoutdone = {{Text|1|#F580B1}} {{Text|'validates layout of any following goto finishednonexec/finishedline|#31C4C4}}
    {{Text|'We've already figured out in the prepass which lines are invalidated by the precompiler|#31C4C4}}
    {{Text|'No need to go over those lines again.|#31C4C4}}
    {{Text|'IF InValidLine(linenumber) THEN goto skipide4 'layoutdone = 0: GOTO finishednonexec|#31C4C4}}
    a3u$ = {{Text|UCASE$|#F0F0F0}}(a3$)
    {{Text|'QB64 Metacommands|#31C4C4}}
    {{Text|IF|#F0F0F0}} {{Text|ASC|#F0F0F0}}(a3$) = {{Text|36|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'$|#31C4C4}}
        {{Text|'precompiler commands should always be executed FIRST.|#31C4C4}}
        {{Text|IF|#F0F0F0}} a3u$ = {{Text|"$END IF"|#FFB100}} {{Text|OR|#F0F0F0}} a3u$ = {{Text|"$ENDIF"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} DefineElse(ExecCounter) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"$END IF without $IF"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            DefineElse(ExecCounter) = {{Text|0|#F580B1}} {{Text|'We no longer have an $IF block at this level|#31C4C4}}
            ExecCounter = ExecCounter - {{Text|1|#F580B1}}
            layout$ = SCase$({{Text|"$End If"|#FFB100}})
            controltype(controllevel) = {{Text|0|#F580B1}}
            controllevel = controllevel - {{Text|1|#F580B1}}
            {{Text|GOTO|#F0F0F0}} finishednonexec
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(a3u$, {{Text|4|#F580B1}}) = {{Text|"$IF "|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|'prevents code from being placed before 'CASE condition' in a SELECT CASE block|#31C4C4}}
            {{Text|IF|#F0F0F0}} SelectCaseCounter > {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} SelectCaseHasCaseBlock(SelectCaseCounter) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                a$ = {{Text|"Expected CASE expression"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            temp$ = {{Text|LTRIM$|#F0F0F0}}({{Text|MID$|#F0F0F0}}(a3u$, {{Text|4|#F580B1}})) {{Text|'strip off the $IF and extra spaces|#31C4C4}}
            temp$ = {{Text|RTRIM$|#F0F0F0}}({{Text|LEFT$|#F0F0F0}}(temp$, {{Text|LEN|#F0F0F0}}(temp$) - {{Text|4|#F580B1}})) {{Text|'and strip off the THEN and extra spaces|#31C4C4}}
            temp = {{Text|0|#F580B1}}
            {{Text|IF|#F0F0F0}} temp = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} tempOp$ = {{Text|"<="|#FFB100}}: temp = {{Text|INSTR|#F0F0F0}}(temp$, tempOp$)
            {{Text|IF|#F0F0F0}} temp = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} tempOp$ = {{Text|"=<"|#FFB100}}: temp = {{Text|INSTR|#F0F0F0}}(temp$, tempOp$): tempOp$ = {{Text|"<="|#FFB100}}
            {{Text|IF|#F0F0F0}} temp = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} tempOp$ = {{Text|">="|#FFB100}}: temp = {{Text|INSTR|#F0F0F0}}(temp$, tempOp$)
            {{Text|IF|#F0F0F0}} temp = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} tempOp$ = {{Text|"=>"|#FFB100}}: temp = {{Text|INSTR|#F0F0F0}}(temp$, tempOp$): tempOp$ = {{Text|">="|#FFB100}}
            {{Text|IF|#F0F0F0}} temp = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} tempOp$ = {{Text|"<>"|#FFB100}}: temp = {{Text|INSTR|#F0F0F0}}(temp$, tempOp$)
            {{Text|IF|#F0F0F0}} temp = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} tempOp$ = {{Text|"><"|#FFB100}}: temp = {{Text|INSTR|#F0F0F0}}(temp$, tempOp$): tempOp$ = {{Text|"<>"|#FFB100}}
            {{Text|IF|#F0F0F0}} temp = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} tempOp$ = {{Text|"="|#FFB100}}: temp = {{Text|INSTR|#F0F0F0}}(temp$, tempOp$)
            {{Text|IF|#F0F0F0}} temp = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} tempOp$ = {{Text|">"|#FFB100}}: temp = {{Text|INSTR|#F0F0F0}}(temp$, tempOp$)
            {{Text|IF|#F0F0F0}} temp = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} tempOp$ = {{Text|"<"|#FFB100}}: temp = {{Text|INSTR|#F0F0F0}}(temp$, tempOp$)
            ExecCounter = ExecCounter + {{Text|1|#F580B1}}
            ExecLevel(ExecCounter) = {{Text|-1|#F580B1}} {{Text|'default to a skip value|#31C4C4}}
            DefineElse(ExecCounter) = {{Text|1|#F580B1}} {{Text|'1 says we have an $IF statement at this level|#31C4C4}}
            result = EvalPreIF(temp$, a$)
            {{Text|IF|#F0F0F0}} a$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} result <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                ExecLevel(ExecCounter) = ExecLevel(ExecCounter - {{Text|1|#F580B1}}) {{Text|'So we inherit the execlevel from above|#31C4C4}}
                {{Text|IF|#F0F0F0}} ExecLevel(ExecCounter) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} DefineElse(ExecCounter) = DefineElse(ExecCounter) {{Text|OR|#F0F0F0}} {{Text|4|#F580B1}} {{Text|'Else if used and conditon found|#31C4C4}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            controllevel = controllevel + {{Text|1|#F580B1}}
            controltype(controllevel) = {{Text|6|#F580B1}}
            {{Text|IF|#F0F0F0}} temp = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} layout$ = SCase$({{Text|"$If "|#FFB100}}) + temp$ + SCase$({{Text|" Then"|#FFB100}}): {{Text|GOTO|#F0F0F0}} finishednonexec {{Text|'no = sign in the $IF statement, so we're going to assume the user is doing something like $IF flag|#31C4C4}}
            l$ = {{Text|RTRIM$|#F0F0F0}}({{Text|LEFT$|#F0F0F0}}(temp$, temp - {{Text|1|#F580B1}})): r$ = {{Text|LTRIM$|#F0F0F0}}({{Text|MID$|#F0F0F0}}(temp$, temp + {{Text|LEN|#F0F0F0}}(tempOp$)))
            layout$ = SCase$({{Text|"$If "|#FFB100}}) + l$ + {{Text|" "|#FFB100}} + tempOp$ + {{Text|" "|#FFB100}} + r$ + SCase$({{Text|" Then"|#FFB100}})
            {{Text|GOTO|#F0F0F0}} finishednonexec
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} a3u$ = {{Text|"$ELSE"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} DefineElse(ExecCounter) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"$ELSE without $IF"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} DefineElse(ExecCounter) {{Text|AND|#F0F0F0}} {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"$IF block already has $ELSE statement in it"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            DefineElse(ExecCounter) = DefineElse(ExecCounter) {{Text|OR|#F0F0F0}} {{Text|2|#F580B1}} {{Text|'set the flag to declare an $ELSE already in this block|#31C4C4}}
            {{Text|IF|#F0F0F0}} DefineElse(ExecCounter) {{Text|AND|#F0F0F0}} {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'If we executed code in a previous IF or ELSE IF statement, we can't do it here|#31C4C4}}
                ExecLevel(ExecCounter) = {{Text|-1|#F580B1}} {{Text|'So we inherit the execlevel from above|#31C4C4}}
            {{Text|ELSE|#F0F0F0}}
                ExecLevel(ExecCounter) = ExecLevel(ExecCounter - {{Text|1|#F580B1}}) {{Text|'If we were processing code before, code after this segment is going to be SKIPPED|#31C4C4}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            layout$ = SCase$({{Text|"$Else"|#FFB100}})
            lhscontrollevel = lhscontrollevel - {{Text|1|#F580B1}}
            {{Text|GOTO|#F0F0F0}} finishednonexec
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(a3u$, {{Text|5|#F580B1}}) = {{Text|"$ELSE"|#FFB100}} {{Text|THEN|#F0F0F0}}
            temp$ = {{Text|LTRIM$|#F0F0F0}}({{Text|MID$|#F0F0F0}}(a3u$, {{Text|6|#F580B1}}))
            {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(temp$, {{Text|3|#F580B1}}) = {{Text|"IF "|#FFB100}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} DefineElse(ExecCounter) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"$ELSE IF without $IF"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} DefineElse(ExecCounter) {{Text|AND|#F0F0F0}} {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"$ELSE IF cannot follow $ELSE"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} {{Text|RIGHT$|#F0F0F0}}(temp$, {{Text|5|#F580B1}}) <> {{Text|" THEN"|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"$ELSE IF without THEN"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                temp$ = {{Text|LTRIM$|#F0F0F0}}({{Text|MID$|#F0F0F0}}(temp$, {{Text|3|#F580B1}})) {{Text|'strip off the IF and extra spaces|#31C4C4}}
                temp$ = {{Text|RTRIM$|#F0F0F0}}({{Text|LEFT$|#F0F0F0}}(temp$, {{Text|LEN|#F0F0F0}}(temp$) - {{Text|4|#F580B1}})) {{Text|'and strip off the THEN and extra spaces|#31C4C4}}
                {{Text|IF|#F0F0F0}} DefineElse(ExecCounter) {{Text|AND|#F0F0F0}} {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'If we executed code in a previous IF or ELSE IF statement, we can't do it here|#31C4C4}}
                    ExecLevel(ExecCounter) = {{Text|-1|#F580B1}}
                {{Text|ELSE|#F0F0F0}}
                    result = EvalPreIF(temp$, a$)
                    {{Text|IF|#F0F0F0}} a$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|IF|#F0F0F0}} result <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        ExecLevel(ExecCounter) = ExecLevel(ExecCounter - {{Text|1|#F580B1}}) {{Text|'So we inherit the execlevel from above|#31C4C4}}
                        {{Text|IF|#F0F0F0}} ExecLevel(ExecCounter) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} DefineElse(ExecCounter) = DefineElse(ExecCounter) {{Text|OR|#F0F0F0}} {{Text|4|#F580B1}} {{Text|'Else if used and conditon found|#31C4C4}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                lhscontrollevel = lhscontrollevel - {{Text|1|#F580B1}}
                temp = {{Text|INSTR|#F0F0F0}}(temp$, {{Text|"="|#FFB100}})
                {{Text|IF|#F0F0F0}} temp = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} layout$ = SCase$({{Text|"$ElseIf "|#FFB100}}) + temp$ + SCase$({{Text|" Then"|#FFB100}}): {{Text|GOTO|#F0F0F0}} finishednonexec {{Text|'no = sign in the $IF statement, so we're going to assume the user is doing something like $IF flag|#31C4C4}}
                l$ = {{Text|RTRIM$|#F0F0F0}}({{Text|LEFT$|#F0F0F0}}(temp$, temp - {{Text|1|#F580B1}})): r$ = {{Text|LTRIM$|#F0F0F0}}({{Text|MID$|#F0F0F0}}(temp$, temp + {{Text|1|#F580B1}}))
                layout$ = SCase$({{Text|"$ElseIf "|#FFB100}}) + l$ + {{Text|" = "|#FFB100}} + r$ + SCase$({{Text|" Then"|#FFB100}})
                {{Text|GOTO|#F0F0F0}} finishednonexec
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} ExecLevel(ExecCounter) {{Text|THEN|#F0F0F0}} {{Text|'don't check for any more metacommands except the one's which worth with the precompiler|#31C4C4}}
            layoutdone = {{Text|0|#F580B1}}
            {{Text|GOTO|#F0F0F0}} finishednonexec {{Text|'we don't check for anything inside lines that we've marked for skipping|#31C4C4}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(a3u$, {{Text|5|#F580B1}}) = {{Text|"$LET "|#FFB100}} {{Text|THEN|#F0F0F0}}
            temp$ = a3u$
            temp$ = {{Text|LTRIM$|#F0F0F0}}({{Text|MID$|#F0F0F0}}(temp$, {{Text|5|#F580B1}})) {{Text|'simply shorten our string to parse|#31C4C4}}
            {{Text|'For starters, let's make certain that we have 3 elements to deal with|#31C4C4}}
            temp = {{Text|INSTR|#F0F0F0}}(temp$, {{Text|"="|#FFB100}}) {{Text|'without an = in there, we can't get a value from the left and right side|#31C4C4}}
            l$ = {{Text|RTRIM$|#F0F0F0}}({{Text|LEFT$|#F0F0F0}}(temp$, temp - {{Text|1|#F580B1}})): r$ = {{Text|LTRIM$|#F0F0F0}}({{Text|MID$|#F0F0F0}}(temp$, temp + {{Text|1|#F580B1}}))
            layout$ = SCase$({{Text|"$Let "|#FFB100}}) + l$ + {{Text|" = "|#FFB100}} + r$
            {{Text|'First look to see if we have an existing setting like this and if so, update it|#31C4C4}}
            {{Text|FOR|#F0F0F0}} i = {{Text|7|#F580B1}} {{Text|TO|#F0F0F0}} UserDefineCount {{Text|'UserDefineCount 1-7 are reserved for automatic OS/BIT detection & version|#31C4C4}}
                {{Text|IF|#F0F0F0}} UserDefine({{Text|0|#F580B1}}, i) = l$ {{Text|THEN|#F0F0F0}} UserDefine({{Text|1|#F580B1}}, i) = r$: {{Text|GOTO|#F0F0F0}} finishednonexec
            {{Text|NEXT|#F0F0F0}}
            {{Text|'Otherwise create a new setting and set the initial value for it|#31C4C4}}
            UserDefineCount = UserDefineCount + {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} UserDefineCount > {{Text|UBOUND|#F0F0F0}}(UserDefine, {{Text|2|#F580B1}}) {{Text|THEN|#F0F0F0}}
                {{Text|REDIM|#F0F0F0}} {{Text|_PRESERVE|#F0F0F0}} UserDefine({{Text|1|#F580B1}}, {{Text|UBOUND|#F0F0F0}}(UserDefine, {{Text|2|#F580B1}}) + {{Text|10|#F580B1}}) {{Text|'Add another 10 elements to the array so it'll expand as the user adds to it|#31C4C4}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            UserDefine({{Text|0|#F580B1}}, UserDefineCount) = l$
            UserDefine({{Text|1|#F580B1}}, UserDefineCount) = r$
            {{Text|GOTO|#F0F0F0}} finishednonexec
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} a3u$ = {{Text|"$COLOR:0"|#FFB100}} {{Text|THEN|#F0F0F0}}
            layout$ = SCase$({{Text|"$Color:0"|#FFB100}})
            {{Text|IF|#F0F0F0}} qb64prefix_set {{Text|THEN|#F0F0F0}}
                addmetainclude$ = getfilepath$({{Text|COMMAND$|#F0F0F0}}({{Text|0|#F580B1}})) + {{Text|"internal"|#FFB100}} + pathsep$ + {{Text|"support"|#FFB100}} + pathsep$ + {{Text|"color"|#FFB100}} + pathsep$ + {{Text|"color0_noprefix.bi"|#FFB100}}
            {{Text|ELSE|#F0F0F0}}
                addmetainclude$ = getfilepath$({{Text|COMMAND$|#F0F0F0}}({{Text|0|#F580B1}})) + {{Text|"internal"|#FFB100}} + pathsep$ + {{Text|"support"|#FFB100}} + pathsep$ + {{Text|"color"|#FFB100}} + pathsep$ + {{Text|"color0.bi"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            layoutdone = {{Text|1|#F580B1}}
            {{Text|GOTO|#F0F0F0}} finishednonexec
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} a3u$ = {{Text|"$COLOR:32"|#FFB100}} {{Text|THEN|#F0F0F0}}
            layout$ = SCase$({{Text|"$Color:32"|#FFB100}})
            {{Text|IF|#F0F0F0}} qb64prefix_set {{Text|THEN|#F0F0F0}}
                addmetainclude$ = getfilepath$({{Text|COMMAND$|#F0F0F0}}({{Text|0|#F580B1}})) + {{Text|"internal"|#FFB100}} + pathsep$ + {{Text|"support"|#FFB100}} + pathsep$ + {{Text|"color"|#FFB100}} + pathsep$ + {{Text|"color32_noprefix.bi"|#FFB100}}
            {{Text|ELSE|#F0F0F0}}
                addmetainclude$ = getfilepath$({{Text|COMMAND$|#F0F0F0}}({{Text|0|#F580B1}})) + {{Text|"internal"|#FFB100}} + pathsep$ + {{Text|"support"|#FFB100}} + pathsep$ + {{Text|"color"|#FFB100}} + pathsep$ + {{Text|"color32.bi"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            layoutdone = {{Text|1|#F580B1}}
            {{Text|GOTO|#F0F0F0}} finishednonexec
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} a3u$ = {{Text|"$NOPREFIX"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|'already set in prepass|#31C4C4}}
            layout$ = SCase$({{Text|"$NoPrefix"|#FFB100}})
            {{Text|GOTO|#F0F0F0}} finishednonexec
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} a3u$ = {{Text|"$VIRTUALKEYBOARD:ON"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|'Deprecated; does nothing.|#31C4C4}}
            layout$ = SCase$({{Text|"$VirtualKeyboard:On"|#FFB100}})
            addWarning linenumber, inclevel, inclinenumber(inclevel), incname$(inclevel), {{Text|"Deprecated feature"|#FFB100}}, {{Text|"$VirtualKeyboard"|#FFB100}}
            {{Text|GOTO|#F0F0F0}} finishednonexec
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} a3u$ = {{Text|"$VIRTUALKEYBOARD:OFF"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|'Deprecated; does nothing.|#31C4C4}}
            layout$ = SCase$({{Text|"$VirtualKeyboard:Off"|#FFB100}})
            addWarning linenumber, inclevel, inclinenumber(inclevel), incname$(inclevel), {{Text|"Deprecated feature"|#FFB100}}, {{Text|"$VirtualKeyboard"|#FFB100}}
            {{Text|GOTO|#F0F0F0}} finishednonexec
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} a3u$ = {{Text|"$DEBUG"|#FFB100}} {{Text|THEN|#F0F0F0}}
            layout$ = SCase$({{Text|"$Debug"|#FFB100}})
            {{Text|IF|#F0F0F0}} NoIDEMode {{Text|THEN|#F0F0F0}}
                addWarning linenumber, inclevel, inclinenumber(inclevel), incname$(inclevel), {{Text|"$Debug"|#FFB100}}, {{Text|"$Debug features only work from the IDE"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|GOTO|#F0F0F0}} finishednonexec
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} a3u$ = {{Text|"$CHECKING:OFF"|#FFB100}} {{Text|THEN|#F0F0F0}}
            layout$ = SCase$({{Text|"$Checking:Off"|#FFB100}})
            NoChecks = {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} vWatchOn <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} NoIDEMode = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} inclevel = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                addWarning linenumber, inclevel, inclinenumber(inclevel), incname$(inclevel), {{Text|"$Debug"|#FFB100}}, {{Text|"$Debug features won't work in $Checking:Off blocks"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|GOTO|#F0F0F0}} finishednonexec
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} a3u$ = {{Text|"$CHECKING:ON"|#FFB100}} {{Text|THEN|#F0F0F0}}
            layout$ = SCase$({{Text|"$Checking:On"|#FFB100}})
            NoChecks = {{Text|0|#F580B1}}
            {{Text|GOTO|#F0F0F0}} finishednonexec
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} a3u$ = {{Text|"$CONSOLE"|#FFB100}} {{Text|THEN|#F0F0F0}}
            layout$ = SCase$({{Text|"$Console"|#FFB100}})
          {{Text|_Console|#F0F0F0}} = {{Text|1|#F580B1}}
            {{Text|GOTO|#F0F0F0}} finishednonexec
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} a3u$ = {{Text|"$CONSOLE:ONLY"|#FFB100}} {{Text|THEN|#F0F0F0}}
            layout$ = SCase$({{Text|"$Console:Only"|#FFB100}})
            DEPENDENCY(DEPENDENCY_CONSOLE_ONLY) = DEPENDENCY(DEPENDENCY_CONSOLE_ONLY) {{Text|OR|#F0F0F0}} {{Text|1|#F580B1}}
          {{Text|_Console|#F0F0F0}} = {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} prepass = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} NoChecks = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, {{Text|"do{"|#FFB100}}
                WriteBufLine MainTxtBuf, {{Text|"sub__dest(func__console());"|#FFB100}}
                WriteBufLine MainTxtBuf, {{Text|"sub__source(func__console());"|#FFB100}}
                {{Text|GOTO|#F0F0F0}} finishedline2
            {{Text|ELSE|#F0F0F0}}
                {{Text|GOTO|#F0F0F0}} finishednonexec
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} a3u$ = {{Text|"$ASSERTS"|#FFB100}} {{Text|THEN|#F0F0F0}}
            layout$ = SCase$({{Text|"$Asserts"|#FFB100}})
            Asserts = {{Text|1|#F580B1}}
            {{Text|GOTO|#F0F0F0}} finishednonexec
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} a3u$ = {{Text|"$ASSERTS:CONSOLE"|#FFB100}} {{Text|THEN|#F0F0F0}}
            layout$ = SCase$({{Text|"$Asserts:Console"|#FFB100}})
            Asserts = {{Text|1|#F580B1}}
          {{Text|_Console|#F0F0F0}} = {{Text|1|#F580B1}}
            {{Text|GOTO|#F0F0F0}} finishednonexec
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} a3u$ = {{Text|"$SCREENHIDE"|#FFB100}} {{Text|THEN|#F0F0F0}}
            layout$ = SCase$({{Text|"$ScreenHide"|#FFB100}})
          {{Text|_ScreenHide|#F0F0F0}} = {{Text|1|#F580B1}}
            {{Text|GOTO|#F0F0F0}} finishednonexec
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} a3u$ = {{Text|"$SCREENSHOW"|#FFB100}} {{Text|THEN|#F0F0F0}}
            layout$ = SCase$({{Text|"$ScreenShow"|#FFB100}})
          {{Text|_ScreenHide|#F0F0F0}} = {{Text|0|#F580B1}}
            {{Text|GOTO|#F0F0F0}} finishednonexec
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} a3u$ = {{Text|"$RESIZE:OFF"|#FFB100}} {{Text|THEN|#F0F0F0}}
            layout$ = SCase$({{Text|"$Resize:Off"|#FFB100}})
          {{Text|_Resize|#F0F0F0}} = {{Text|0|#F580B1}}: Resize_Scale = {{Text|0|#F580B1}}
            {{Text|GOTO|#F0F0F0}} finishednonexec
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} a3u$ = {{Text|"$RESIZE:ON"|#FFB100}} {{Text|THEN|#F0F0F0}}
            layout$ = SCase$({{Text|"$Resize:On"|#FFB100}})
          {{Text|_Resize|#F0F0F0}} = {{Text|1|#F580B1}}: Resize_Scale = {{Text|0|#F580B1}}
            {{Text|GOTO|#F0F0F0}} finishednonexec
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} a3u$ = {{Text|"$RESIZE:STRETCH"|#FFB100}} {{Text|THEN|#F0F0F0}}
            layout$ = SCase$({{Text|"$Resize:Stretch"|#FFB100}})
          {{Text|_Resize|#F0F0F0}} = {{Text|1|#F580B1}}: Resize_Scale = {{Text|1|#F580B1}}
            {{Text|GOTO|#F0F0F0}} finishednonexec
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} a3u$ = {{Text|"$RESIZE:SMOOTH"|#FFB100}} {{Text|THEN|#F0F0F0}}
            layout$ = SCase$({{Text|"$Resize:Smooth"|#FFB100}})
          {{Text|_Resize|#F0F0F0}} = {{Text|1|#F580B1}}: Resize_Scale = {{Text|2|#F580B1}}
            {{Text|GOTO|#F0F0F0}} finishednonexec
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(a3u$, {{Text|12|#F580B1}}) = {{Text|"$VERSIONINFO"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|'Embed version info into the final binary (Windows only)|#31C4C4}}
            FirstDelimiter = {{Text|INSTR|#F0F0F0}}(a3u$, {{Text|":"|#FFB100}})
            SecondDelimiter = {{Text|INSTR|#F0F0F0}}(FirstDelimiter + {{Text|1|#F580B1}}, a3u$, {{Text|"="|#FFB100}})
            {{Text|IF|#F0F0F0}} FirstDelimiter = {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} SecondDelimiter = {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} SecondDelimiter = FirstDelimiter + {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                a$ = {{Text|"Expected $VERSIONINFO:key=value"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            VersionInfoKey$ = {{Text|LTRIM$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}({{Text|MID$|#F0F0F0}}(a3u$, FirstDelimiter + {{Text|1|#F580B1}}, SecondDelimiter - FirstDelimiter - {{Text|1|#F580B1}})))
            VersionInfoValue$ = StrReplace$({{Text|LTRIM$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}({{Text|MID$|#F0F0F0}}(a3$, SecondDelimiter + {{Text|1|#F580B1}}))), {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}), {{Text|"'"|#FFB100}})
            {{Text|SELECT|#F0F0F0}} {{Text|CASE|#F0F0F0}} VersionInfoKey$
                {{Text|CASE|#F0F0F0}} {{Text|"FILEVERSION#"|#FFB100}}
                    {{Text|GOSUB|#F0F0F0}} ValidateVersion
                    viFileVersionNum$ = VersionInfoValue$
                    {{Text|IF|#F0F0F0}} viFileVersion$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} viFileVersion$ = viFileVersionNum$
                    layout$ = SCase$({{Text|"$VersionInfo:FILEVERSION#="|#FFB100}}) + VersionInfoValue$
                {{Text|CASE|#F0F0F0}} {{Text|"PRODUCTVERSION#"|#FFB100}}
                    {{Text|GOSUB|#F0F0F0}} ValidateVersion
                    viProductVersionNum$ = VersionInfoValue$
                    {{Text|IF|#F0F0F0}} viProductVersion$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} viProductVersion$ = viProductVersionNum$
                    layout$ = SCase$({{Text|"$VersionInfo:PRODUCTVERSION#="|#FFB100}}) + VersionInfoValue$
                {{Text|CASE|#F0F0F0}} {{Text|"COMPANYNAME"|#FFB100}}
                    viCompanyName$ = VersionInfoValue$
                    layout$ = SCase$({{Text|"$VersionInfo:"|#FFB100}}) + {{Text|"CompanyName="|#FFB100}} + VersionInfoValue$
                {{Text|CASE|#F0F0F0}} {{Text|"FILEDESCRIPTION"|#FFB100}}
                    viFileDescription$ = VersionInfoValue$
                    layout$ = SCase$({{Text|"$VersionInfo:"|#FFB100}}) + {{Text|"FileDescription="|#FFB100}} + VersionInfoValue$
                {{Text|CASE|#F0F0F0}} {{Text|"FILEVERSION"|#FFB100}}
                    viFileVersion$ = VersionInfoValue$
                    layout$ = SCase$({{Text|"$VersionInfo:"|#FFB100}}) + {{Text|"FileVersion="|#FFB100}} + VersionInfoValue$
                {{Text|CASE|#F0F0F0}} {{Text|"INTERNALNAME"|#FFB100}}
                    viInternalName$ = VersionInfoValue$
                    layout$ = SCase$({{Text|"$VersionInfo:"|#FFB100}}) + {{Text|"InternalName="|#FFB100}} + VersionInfoValue$
                {{Text|CASE|#F0F0F0}} {{Text|"LEGALCOPYRIGHT"|#FFB100}}
                    viLegalCopyright$ = VersionInfoValue$
                    layout$ = SCase$({{Text|"$VersionInfo:"|#FFB100}}) + {{Text|"LegalCopyright="|#FFB100}} + VersionInfoValue$
                {{Text|CASE|#F0F0F0}} {{Text|"LEGALTRADEMARKS"|#FFB100}}
                    viLegalTrademarks$ = VersionInfoValue$
                    layout$ = SCase$({{Text|"$VersionInfo:"|#FFB100}}) + {{Text|"LegalTrademarks="|#FFB100}} + VersionInfoValue$
                {{Text|CASE|#F0F0F0}} {{Text|"ORIGINALFILENAME"|#FFB100}}
                    viOriginalFilename$ = VersionInfoValue$
                    layout$ = SCase$({{Text|"$VersionInfo:"|#FFB100}}) + {{Text|"OriginalFilename="|#FFB100}} + VersionInfoValue$
                {{Text|CASE|#F0F0F0}} {{Text|"PRODUCTNAME"|#FFB100}}
                    viProductName$ = VersionInfoValue$
                    layout$ = SCase$({{Text|"$VersionInfo:"|#FFB100}}) + {{Text|"ProductName="|#FFB100}} + VersionInfoValue$
                {{Text|CASE|#F0F0F0}} {{Text|"PRODUCTVERSION"|#FFB100}}
                    viProductVersion$ = VersionInfoValue$
                    layout$ = SCase$({{Text|"$VersionInfo:"|#FFB100}}) + {{Text|"ProductVersion="|#FFB100}} + VersionInfoValue$
                {{Text|CASE|#F0F0F0}} {{Text|"COMMENTS"|#FFB100}}
                    viComments$ = VersionInfoValue$
                    layout$ = SCase$({{Text|"$VersionInfo:"|#FFB100}}) + {{Text|"Comments="|#FFB100}} + VersionInfoValue$
                {{Text|CASE|#F0F0F0}} {{Text|"WEB"|#FFB100}}
                    viWeb$ = VersionInfoValue$
                    layout$ = SCase$({{Text|"$VersionInfo:"|#FFB100}}) + {{Text|"Web="|#FFB100}} + VersionInfoValue$
                {{Text|CASE|#F0F0F0}} {{Text|ELSE|#F0F0F0}}
                    a$ = {{Text|"Invalid key. (Use FILEVERSION#, PRODUCTVERSION#, CompanyName, FileDescription, FileVersion, InternalName, LegalCopyright, LegalTrademarks, OriginalFilename, ProductName, ProductVersion, Comments or Web)"|#FFB100}}
                    {{Text|GOTO|#F0F0F0}} errmes
            {{Text|END|#F0F0F0}} {{Text|SELECT|#F0F0F0}}
            VersionInfoSet = {{Text|-1|#F580B1}}
            {{Text|GOTO|#F0F0F0}} finishednonexec
            ValidateVersion:
            {{Text|'Check if only numbers and commas (4 comma-separated values)|#31C4C4}}
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(VersionInfoValue$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected $VERSIONINFO:"|#FFB100}} + VersionInfoKey$ + {{Text|"=#,#,#,# (4 comma-separated numeric values: major, minor, revision and build)"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            viCommas = {{Text|0|#F580B1}}
            {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|LEN|#F0F0F0}}(VersionInfoValue$)
                {{Text|IF|#F0F0F0}} {{Text|ASC|#F0F0F0}}(VersionInfoValue$, i) = {{Text|44|#F580B1}} {{Text|THEN|#F0F0F0}} viCommas = viCommas + {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}({{Text|"0123456789,"|#FFB100}}, {{Text|MID$|#F0F0F0}}(VersionInfoValue$, i, {{Text|1|#F580B1}})) = {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} (i = {{Text|LEN|#F0F0F0}}(VersionInfoValue$) {{Text|AND|#F0F0F0}} viCommas <> {{Text|3|#F580B1}}) {{Text|OR|#F0F0F0}} {{Text|RIGHT$|#F0F0F0}}(VersionInfoValue$, {{Text|1|#F580B1}}) = {{Text|","|#FFB100}} {{Text|THEN|#F0F0F0}}
                    a$ = {{Text|"Expected $VERSIONINFO:"|#FFB100}} + VersionInfoKey$ + {{Text|"=#,#,#,# (4 comma-separated numeric values: major, minor, revision and build)"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|NEXT|#F0F0F0}}
            {{Text|RETURN|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(a3u$, {{Text|8|#F580B1}}) = {{Text|"$EXEICON"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|'Basic syntax check. Multi-platform.|#31C4C4}}
            {{Text|IF|#F0F0F0}} ExeIconSet {{Text|THEN|#F0F0F0}} a$ = {{Text|"$EXEICON already defined"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            FirstDelimiter = {{Text|INSTR|#F0F0F0}}(a3u$, {{Text|"'"|#FFB100}})
            {{Text|IF|#F0F0F0}} FirstDelimiter = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                a$ = {{Text|"Expected $EXEICON:'filename'"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|ELSE|#F0F0F0}}
                SecondDelimiter = {{Text|INSTR|#F0F0F0}}(FirstDelimiter + {{Text|1|#F580B1}}, a3u$, {{Text|"'"|#FFB100}})
                {{Text|IF|#F0F0F0}} SecondDelimiter = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected $EXEICON:'filename'"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            ExeIconFile$ = {{Text|RTRIM$|#F0F0F0}}({{Text|LTRIM$|#F0F0F0}}({{Text|MID$|#F0F0F0}}(a3$, FirstDelimiter + {{Text|1|#F580B1}}, SecondDelimiter - FirstDelimiter - {{Text|1|#F580B1}})))
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(ExeIconFile$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected $EXEICON:'filename'"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            layout$ = SCase$({{Text|"$ExeIcon:'"|#FFB100}}) + ExeIconFile$ + {{Text|"'"|#FFB100}} + {{Text|MID$|#F0F0F0}}(a3$, SecondDelimiter + {{Text|1|#F580B1}})
            IconPath$ = {{Text|""|#FFB100}}
            {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(ExeIconFile$, {{Text|2|#F580B1}}) = {{Text|"./"|#FFB100}} {{Text|OR|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(ExeIconFile$, {{Text|2|#F580B1}}) = {{Text|".\"|#FFB100}} {{Text|THEN|#F0F0F0}}
                {{Text|'Relative to source file's folder|#31C4C4}}
                {{Text|IF|#F0F0F0}} NoIDEMode {{Text|THEN|#F0F0F0}}
                    IconPath$ = path.source$
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(IconPath$) > {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|RIGHT$|#F0F0F0}}(IconPath$, {{Text|1|#F580B1}}) <> pathsep$ {{Text|THEN|#F0F0F0}} IconPath$ = IconPath$ + pathsep$
                {{Text|ELSE|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(ideprogname) {{Text|THEN|#F0F0F0}} IconPath$ = idepath$ + pathsep$
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                ExeIconFile$ = IconPath$ + {{Text|MID$|#F0F0F0}}(ExeIconFile$, {{Text|3|#F580B1}})
            {{Text|ELSEIF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(ExeIconFile$, {{Text|"/"|#FFB100}}) {{Text|OR|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(ExeIconFile$, {{Text|"\"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                {{Text|FOR|#F0F0F0}} i = {{Text|LEN|#F0F0F0}}(ExeIconFile$) {{Text|TO|#F0F0F0}} {{Text|1|#F580B1}} {{Text|STEP|#F0F0F0}} {{Text|-1|#F580B1}}
                    {{Text|IF|#F0F0F0}} {{Text|MID$|#F0F0F0}}(ExeIconFile$, i, {{Text|1|#F580B1}}) = {{Text|"/"|#FFB100}} {{Text|OR|#F0F0F0}} {{Text|MID$|#F0F0F0}}(ExeIconFile$, i, {{Text|1|#F580B1}}) = {{Text|"\"|#FFB100}} {{Text|THEN|#F0F0F0}}
                        IconPath$ = {{Text|LEFT$|#F0F0F0}}(ExeIconFile$, i)
                        ExeIconFileOnly$ = {{Text|MID$|#F0F0F0}}(ExeIconFile$, i + {{Text|1|#F580B1}})
                        {{Text|IF|#F0F0F0}} {{Text|_DIREXISTS|#F0F0F0}}(IconPath$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"File '"|#FFB100}} + ExeIconFileOnly$ + {{Text|"' not found"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                        currentdir$ = {{Text|_CWD$|#F0F0F0}}
                        {{Text|CHDIR|#F0F0F0}} IconPath$
                        IconPath$ = {{Text|_CWD$|#F0F0F0}}
                        {{Text|CHDIR|#F0F0F0}} currentdir$
                        ExeIconFile$ = IconPath$ + pathsep$ + ExeIconFileOnly$
                        {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|NEXT|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(ExeIconFile$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"File '"|#FFB100}} + ExeIconFile$ + {{Text|"' not found"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            ExeIconSet = linenumber
            SetDependency DEPENDENCY_ICON
            {{Text|IF|#F0F0F0}} NoChecks = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, {{Text|"do{"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"sub__icon(NULL,NULL,0);"|#FFB100}}
            {{Text|GOTO|#F0F0F0}} finishedline2
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(a3u$, {{Text|10|#F580B1}}) = {{Text|"$UNSTABLE:"|#FFB100}} {{Text|THEN|#F0F0F0}}
            layout$ = SCase({{Text|"$Unstable:"|#FFB100}})
            token$ = {{Text|LTRIM$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}({{Text|MID$|#F0F0F0}}(a3u$, {{Text|11|#F580B1}})))
            {{Text|SELECT|#F0F0F0}} {{Text|CASE|#F0F0F0}} token$
                {{Text|CASE|#F0F0F0}} {{Text|"MIDI"|#FFB100}}
                    layout$ = layout$ + SCase$({{Text|"Midi"|#FFB100}})
                {{Text|CASE|#F0F0F0}} {{Text|"HTTP"|#FFB100}}
                    layout$ = layout$ + SCase$({{Text|"Http"|#FFB100}})
            {{Text|END|#F0F0F0}} {{Text|SELECT|#F0F0F0}}
            {{Text|GOTO|#F0F0F0}} finishednonexec
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} unstableFlags(UNSTABLE_MIDI) {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(a3u$, {{Text|15|#F580B1}}) = {{Text|"$MIDISOUNDFONT:"|#FFB100}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} MidiSoundFontSet {{Text|THEN|#F0F0F0}}
                    a$ = {{Text|"$MIDISOUNDFONT already defined"|#FFB100}}
                    {{Text|GOTO|#F0F0F0}} errmes
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                layout$ = SCase$({{Text|"$MidiSoundFont:"|#FFB100}})
                MidiSoundFont$ = {{Text|LTRIM$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}({{Text|MID$|#F0F0F0}}(a3$, {{Text|16|#F580B1}})))
                {{Text|IF|#F0F0F0}} {{Text|MID$|#F0F0F0}}(MidiSoundFont$, {{Text|1|#F580B1}}, {{Text|1|#F580B1}}) = {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) {{Text|THEN|#F0F0F0}}
                    {{Text|' We have a quoted filename, verify it is valid|#31C4C4}}
                    {{Text|' We don't touch the filename in the formatting|#31C4C4}}
                    layout$ = layout$ + MidiSoundFont$
                    {{Text|' Strip the leading quote|#31C4C4}}
                    MidiSoundFont$ = {{Text|MID$|#F0F0F0}}(MidiSoundFont$, {{Text|2|#F580B1}})
                    {{Text|' Verify that there is a quote character at the end|#31C4C4}}
                    {{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(MidiSoundFont$, {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}})) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|" character at the end of the file name"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|' Verify there are no extra characters after end quote|#31C4C4}}
                    {{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(MidiSoundFont$, {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}})) <> {{Text|LEN|#F0F0F0}}(MidiSoundFont$) {{Text|THEN|#F0F0F0}} a$ = {{Text|"Unexpected characters after the quoted file name"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    MidiSoundFont$ = {{Text|MID$|#F0F0F0}}(MidiSoundFont$, {{Text|1|#F580B1}}, {{Text|LEN|#F0F0F0}}(MidiSoundFont$) - {{Text|1|#F580B1}})
                    {{Text|IF|#F0F0F0}} {{Text|NOT|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(MidiSoundFont$) {{Text|THEN|#F0F0F0}}
                        a$ = {{Text|"Soundfont file "|#FFB100}} + AddQuotes$(MidiSoundFont$) + {{Text|" could not be found!"|#FFB100}}
                        {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|ELSE|#F0F0F0}}
                    {{Text|' Constant values, only one for now|#31C4C4}}
                    {{Text|SELECT|#F0F0F0}} {{Text|CASE|#F0F0F0}} {{Text|UCASE$|#F0F0F0}}(MidiSoundFont$)
                        {{Text|CASE|#F0F0F0}} {{Text|"DEFAULT"|#FFB100}}
                            layout$ = layout$ + SCase$({{Text|"Default"|#FFB100}})
                            {{Text|' Clear MidiSoundFont$ to indicate the default should be used|#31C4C4}}
                            MidiSoundFont$ = {{Text|""|#FFB100}}
                        {{Text|CASE|#F0F0F0}} {{Text|ELSE|#F0F0F0}}
                            a$ = {{Text|"Unrecognized Soundfont option "|#FFB100}} + AddQuotes$(MidiSoundFont$)
                            {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|END|#F0F0F0}} {{Text|SELECT|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                MidiSoundFontSet = linenumber
                MidiSoundFontLine$ = layout$
                {{Text|GOTO|#F0F0F0}} finishednonexec
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'QB64 Metacommands|#31C4C4}}
    {{Text|IF|#F0F0F0}} ExecLevel(ExecCounter) {{Text|THEN|#F0F0F0}}
        layoutdone = {{Text|0|#F580B1}}
        {{Text|GOTO|#F0F0F0}} finishednonexec {{Text|'we don't check for anything inside lines that we've marked for skipping|#31C4C4}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    linedataoffset = DataOffset
    entireline$ = lineformat(a3$): {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(entireline$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} finishednonexec
    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
    u$ = {{Text|UCASE$|#F0F0F0}}(entireline$)
    newif = {{Text|0|#F580B1}}
    {{Text|'Convert "CASE ELSE" to "CASE C-EL" to avoid confusing compiler|#31C4C4}}
    {{Text|'note: CASE does not have to begin on a new line|#31C4C4}}
    s = {{Text|1|#F580B1}}
    i = {{Text|INSTR|#F0F0F0}}(s, u$, {{Text|"CASE"|#FFB100}} + sp + {{Text|"ELSE"|#FFB100}})
    {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} i
        skip = {{Text|0|#F580B1}}
        {{Text|IF|#F0F0F0}} i <> {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} {{Text|MID$|#F0F0F0}}(u$, i - {{Text|1|#F580B1}}, {{Text|1|#F580B1}}) <> sp {{Text|THEN|#F0F0F0}} skip = {{Text|1|#F580B1}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} i <> {{Text|LEN|#F0F0F0}}(u$) - {{Text|8|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} {{Text|MID$|#F0F0F0}}(u$, i + {{Text|9|#F580B1}}, {{Text|1|#F580B1}}) <> sp {{Text|THEN|#F0F0F0}} skip = {{Text|1|#F580B1}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} skip = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|MID$|#F0F0F0}}(entireline$, i) = {{Text|"CASE"|#FFB100}} + sp + {{Text|"C-EL"|#FFB100}}
            u$ = {{Text|UCASE$|#F0F0F0}}(entireline$)
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        s = i + {{Text|9|#F580B1}}
        i = {{Text|INSTR|#F0F0F0}}(s, u$, {{Text|"CASE"|#FFB100}} + sp + {{Text|"ELSE"|#FFB100}})
    {{Text|LOOP|#F0F0F0}}
    n = numelements(entireline$)
    {{Text|'line number?|#31C4C4}}
    a = {{Text|ASC|#F0F0F0}}(entireline$)
    {{Text|IF|#F0F0F0}} (a >= {{Text|48|#F580B1}} {{Text|AND|#F0F0F0}} a <= {{Text|57|#F580B1}}) {{Text|OR|#F0F0F0}} a = {{Text|46|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'numeric|#31C4C4}}
        label$ = getelement(entireline$, {{Text|1|#F580B1}})
        {{Text|IF|#F0F0F0}} validlabel(label$) {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} closedmain <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} subfunc = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Labels cannot be placed between SUB/FUNCTIONs"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            v = HashFind(label$, HASHFLAG_LABEL, ignore, r)
            addlabchk100:
            {{Text|IF|#F0F0F0}} v {{Text|THEN|#F0F0F0}}
                s = Labels(r).Scope
                {{Text|IF|#F0F0F0}} s = subfuncn {{Text|OR|#F0F0F0}} s = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'same scope?|#31C4C4}}
                    {{Text|IF|#F0F0F0}} s = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} Labels(r).Scope = subfuncn {{Text|'acquire scope|#31C4C4}}
                    {{Text|IF|#F0F0F0}} Labels(r).State = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Duplicate label ("|#FFB100}} + {{Text|RTRIM$|#F0F0F0}}(Labels(r).cn) + {{Text|")"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|'aquire state 0 types|#31C4C4}}
                    tlayout$ = {{Text|RTRIM$|#F0F0F0}}(Labels(r).cn)
                    {{Text|GOTO|#F0F0F0}} addlabaq100
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'same scope|#31C4C4}}
                {{Text|IF|#F0F0F0}} v = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} v = HashFindCont(ignore, r): {{Text|GOTO|#F0F0F0}} addlabchk100
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'does not exist|#31C4C4}}
            nLabels = nLabels + {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} nLabels > Labels_Ubound {{Text|THEN|#F0F0F0}} Labels_Ubound = Labels_Ubound * {{Text|2|#F580B1}}: {{Text|REDIM|#F0F0F0}} {{Text|_PRESERVE|#F0F0F0}} Labels({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} Labels_Ubound) {{Text|AS|#F0F0F0}} Label_Type
            Labels(nLabels) = Empty_Label
            HashAdd label$, HASHFLAG_LABEL, nLabels
            r = nLabels
            Labels(r).cn = tlayout$
            Labels(r).Scope = subfuncn
            addlabaq100:
            Labels(r).State = {{Text|1|#F580B1}}
            Labels(r).Data_Offset = linedataoffset
            layout$ = tlayout$
            WriteBufLine MainTxtBuf, {{Text|"LABEL_"|#FFB100}} + label$ + {{Text|":;"|#FFB100}}
            {{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(label$, {{Text|"p"|#FFB100}}) {{Text|THEN|#F0F0F0}} {{Text|MID$|#F0F0F0}}(label$, {{Text|INSTR|#F0F0F0}}(label$, {{Text|"p"|#FFB100}}), {{Text|1|#F580B1}}) = {{Text|"."|#FFB100}}
            {{Text|IF|#F0F0F0}} {{Text|RIGHT$|#F0F0F0}}(label$, {{Text|1|#F580B1}}) = {{Text|"d"|#FFB100}} {{Text|OR|#F0F0F0}} {{Text|RIGHT$|#F0F0F0}}(label$, {{Text|1|#F580B1}}) = {{Text|"s"|#FFB100}} {{Text|THEN|#F0F0F0}} label$ = {{Text|LEFT$|#F0F0F0}}(label$, {{Text|LEN|#F0F0F0}}(label$) - {{Text|1|#F580B1}})
            WriteBufLine MainTxtBuf, {{Text|"last_line="|#FFB100}} + label$ + {{Text|";"|#FFB100}}
            inclinenump$ = {{Text|""|#FFB100}}
            {{Text|IF|#F0F0F0}} inclinenumber(inclevel) {{Text|THEN|#F0F0F0}}
                inclinenump$ = {{Text|","|#FFB100}} + str2$(inclinenumber(inclevel))
                thisincname$ = getfilepath$(incname$(inclevel))
                thisincname$ = {{Text|MID$|#F0F0F0}}(incname$(inclevel), {{Text|LEN|#F0F0F0}}(thisincname$) + {{Text|1|#F580B1}})
                inclinenump$ = inclinenump$ + {{Text|","|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + thisincname$ + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}})
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} NoChecks = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} vWatchOn {{Text|AND|#F0F0F0}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} temp$ = vWatchErrorCall$ {{Text|ELSE|#F0F0F0}} temp$ = {{Text|""|#FFB100}}
                WriteBufLine MainTxtBuf, {{Text|"if(qbevent){"|#FFB100}} + temp$ + {{Text|"evnt("|#FFB100}} + str2$(linenumber) + inclinenump$ + {{Text|");r=0;}"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} n = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} finishednonexec
            entireline$ = getelements(entireline$, {{Text|2|#F580B1}}, n): u$ = {{Text|UCASE$|#F0F0F0}}(entireline$): n = n - {{Text|1|#F580B1}}
            {{Text|'note: fall through, numeric labels can be followed by alphanumeric label|#31C4C4}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'validlabel|#31C4C4}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'numeric|#31C4C4}}
    {{Text|'it wasn't a line number|#31C4C4}}
    {{Text|'label?|#31C4C4}}
    {{Text|'note: ignores possibility that this could be a single command SUB/FUNCTION (as in QBASIC?)|#31C4C4}}
    {{Text|IF|#F0F0F0}} n >= {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
        x2 = {{Text|INSTR|#F0F0F0}}(entireline$, sp + {{Text|":"|#FFB100}})
        {{Text|IF|#F0F0F0}} x2 {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} x2 = {{Text|LEN|#F0F0F0}}(entireline$) - {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} x3 = x2 + {{Text|1|#F580B1}} {{Text|ELSE|#F0F0F0}} x3 = x2 + {{Text|2|#F580B1}}
            a$ = {{Text|LEFT$|#F0F0F0}}(entireline$, x2 - {{Text|1|#F580B1}})
            CreatingLabel = {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} validlabel(a$) {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} validname(a$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Invalid name"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} closedmain <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} subfunc = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Labels cannot be placed between SUB/FUNCTIONs"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                v = HashFind(a$, HASHFLAG_LABEL, ignore, r)
                addlabchk:
                {{Text|IF|#F0F0F0}} v {{Text|THEN|#F0F0F0}}
                    s = Labels(r).Scope
                    {{Text|IF|#F0F0F0}} s = subfuncn {{Text|OR|#F0F0F0}} s = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'same scope?|#31C4C4}}
                        {{Text|IF|#F0F0F0}} s = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} Labels(r).Scope = subfuncn {{Text|'acquire scope|#31C4C4}}
                        {{Text|IF|#F0F0F0}} Labels(r).State = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Duplicate label ("|#FFB100}} + {{Text|RTRIM$|#F0F0F0}}(Labels(r).cn) + {{Text|")"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                        {{Text|'aquire state 0 types|#31C4C4}}
                        tlayout$ = {{Text|RTRIM$|#F0F0F0}}(Labels(r).cn)
                        {{Text|GOTO|#F0F0F0}} addlabaq
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'same scope|#31C4C4}}
                    {{Text|IF|#F0F0F0}} v = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} v = HashFindCont(ignore, r): {{Text|GOTO|#F0F0F0}} addlabchk
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'does not exist|#31C4C4}}
                nLabels = nLabels + {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} nLabels > Labels_Ubound {{Text|THEN|#F0F0F0}} Labels_Ubound = Labels_Ubound * {{Text|2|#F580B1}}: {{Text|REDIM|#F0F0F0}} {{Text|_PRESERVE|#F0F0F0}} Labels({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} Labels_Ubound) {{Text|AS|#F0F0F0}} Label_Type
                Labels(nLabels) = Empty_Label
                HashAdd a$, HASHFLAG_LABEL, nLabels
                r = nLabels
                Labels(r).cn = tlayout$
                Labels(r).Scope = subfuncn
                addlabaq:
                Labels(r).State = {{Text|1|#F580B1}}
                Labels(r).Data_Offset = linedataoffset
                Labels(r).SourceLineNumber = linenumber
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + tlayout$ + {{Text|":"|#FFB100}} {{Text|ELSE|#F0F0F0}} layout$ = tlayout$ + {{Text|":"|#FFB100}}
                WriteBufLine MainTxtBuf, {{Text|"LABEL_"|#FFB100}} + a$ + {{Text|":;"|#FFB100}}
                inclinenump$ = {{Text|""|#FFB100}}
                {{Text|IF|#F0F0F0}} inclinenumber(inclevel) {{Text|THEN|#F0F0F0}}
                    inclinenump$ = {{Text|","|#FFB100}} + str2$(inclinenumber(inclevel))
                    thisincname$ = getfilepath$(incname$(inclevel))
                    thisincname$ = {{Text|MID$|#F0F0F0}}(incname$(inclevel), {{Text|LEN|#F0F0F0}}(thisincname$) + {{Text|1|#F580B1}})
                    inclinenump$ = inclinenump$ + {{Text|","|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + thisincname$ + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}})
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} NoChecks = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} vWatchOn {{Text|AND|#F0F0F0}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} temp$ = vWatchErrorCall$ {{Text|ELSE|#F0F0F0}} temp$ = {{Text|""|#FFB100}}
                    WriteBufLine MainTxtBuf, {{Text|"if(qbevent){"|#FFB100}} + temp$ + {{Text|"evnt("|#FFB100}} + str2$(linenumber) + inclinenump$ + {{Text|");r=0;}"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                entireline$ = {{Text|RIGHT$|#F0F0F0}}(entireline$, {{Text|LEN|#F0F0F0}}(entireline$) - x3): u$ = {{Text|UCASE$|#F0F0F0}}(entireline$)
                n = numelements(entireline$): {{Text|IF|#F0F0F0}} n = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} finishednonexec
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'valid|#31C4C4}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'includes sp+":"|#31C4C4}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'n>=2|#31C4C4}}
    {{Text|'remove leading ":"|#31C4C4}}
    {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} {{Text|ASC|#F0F0F0}}(u$) = {{Text|58|#F580B1}} {{Text|'":"|#31C4C4}}
        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp2 + {{Text|":"|#FFB100}} {{Text|ELSE|#F0F0F0}} layout$ = {{Text|":"|#FFB100}}
        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(u$) = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} finishednonexec
        entireline$ = getelements(entireline$, {{Text|2|#F580B1}}, n): u$ = {{Text|UCASE$|#F0F0F0}}(entireline$): n = n - {{Text|1|#F580B1}}
    {{Text|LOOP|#F0F0F0}}
    {{Text|'ELSE at the beginning of a line|#31C4C4}}
    {{Text|IF|#F0F0F0}} {{Text|ASC|#F0F0F0}}(u$) = {{Text|69|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'"E"|#31C4C4}}
        e1$ = getelement(u$, {{Text|1|#F580B1}})
        {{Text|IF|#F0F0F0}} e1$ = {{Text|"ELSE"|#FFB100}} {{Text|THEN|#F0F0F0}}
            a$ = {{Text|"ELSE"|#FFB100}}
            {{Text|IF|#F0F0F0}} n > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} continuelinefrom = {{Text|2|#F580B1}}
            {{Text|GOTO|#F0F0F0}} gotcommand
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} e1$ = {{Text|"ELSEIF"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} n < {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ... THEN"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} getelement(u$, n) = {{Text|"THEN"|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = entireline$: {{Text|GOTO|#F0F0F0}} gotcommand
            {{Text|FOR|#F0F0F0}} i = {{Text|3|#F580B1}} {{Text|TO|#F0F0F0}} n - {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} getelement(u$, i) = {{Text|"THEN"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    a$ = getelements(entireline$, {{Text|1|#F580B1}}, i)
                    continuelinefrom = i + {{Text|1|#F580B1}}
                    {{Text|GOTO|#F0F0F0}} gotcommand
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|NEXT|#F0F0F0}}
            a$ = {{Text|"Expected THEN"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'"E"|#31C4C4}}
    start = {{Text|1|#F580B1}}
    {{Text|GOTO|#F0F0F0}} skipcontinit
    contline:
    n = numelements(entireline$)
    u$ = {{Text|UCASE$|#F0F0F0}}(entireline$)
    skipcontinit:
    {{Text|'jargon:|#31C4C4}}
    {{Text|'lineelseused - counts how many line ELSEs can POSSIBLY follow|#31C4C4}}
    {{Text|'endifs - how many C++ endifs "}" need to be added at the end of the line|#31C4C4}}
    {{Text|'lineelseused - counts the number of indwelling ELSE statements on a line|#31C4C4}}
    {{Text|'impliedendif - stops autoformat from adding "END IF"|#31C4C4}}
    a$ = {{Text|""|#FFB100}}
    {{Text|FOR|#F0F0F0}} i = start {{Text|TO|#F0F0F0}} n
        e$ = getelement(u$, i)
        {{Text|IF|#F0F0F0}} e$ = {{Text|":"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} i = start {{Text|THEN|#F0F0F0}}
                layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp2 + {{Text|":"|#FFB100}} {{Text|ELSE|#F0F0F0}} layout$ = {{Text|":"|#FFB100}}
                {{Text|IF|#F0F0F0}} i <> n {{Text|THEN|#F0F0F0}} continuelinefrom = i + {{Text|1|#F580B1}}
                {{Text|GOTO|#F0F0F0}} finishednonexec
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} i <> n {{Text|THEN|#F0F0F0}} continuelinefrom = i
            {{Text|GOTO|#F0F0F0}} gotcommand
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|'begin scanning an 'IF' statement|#31C4C4}}
        {{Text|IF|#F0F0F0}} e$ = {{Text|"IF"|#FFB100}} {{Text|AND|#F0F0F0}} a$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} newif = {{Text|1|#F580B1}}
        {{Text|IF|#F0F0F0}} e$ = {{Text|"THEN"|#FFB100}} {{Text|OR|#F0F0F0}} (e$ = {{Text|"GOTO"|#FFB100}} {{Text|AND|#F0F0F0}} newif = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} newif = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"THEN without IF"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            newif = {{Text|0|#F580B1}}
            {{Text|IF|#F0F0F0}} lineelseused > {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} lineelseused = lineelseused - {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} e$ = {{Text|"GOTO"|#FFB100}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} i = n {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected IF expression GOTO label"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                i = i - {{Text|1|#F580B1}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            a$ = a$ + sp + e$ {{Text|'+"THEN"/"GOTO"|#31C4C4}}
            {{Text|IF|#F0F0F0}} i <> n {{Text|THEN|#F0F0F0}} continuelinefrom = i + {{Text|1|#F580B1}}: endifs = endifs + {{Text|1|#F580B1}}
            {{Text|GOTO|#F0F0F0}} gotcommand
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} e$ = {{Text|"ELSE"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} start = i {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} lineelseused >= {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|'note: more than one else used (in a row) on this line, so close first if with an 'END IF' first|#31C4C4}}
                    {{Text|'note: parses 'END IF' then (after continuelinefrom) parses 'ELSE'|#31C4C4}}
                    {{Text|'consider the following: (square brackets make reading easier)|#31C4C4}}
                    {{Text|'eg. if a=1 then [if b=2 then c=2 else d=2] else e=3|#31C4C4}}
                    impliedendif = {{Text|1|#F580B1}}: a$ = {{Text|"END"|#FFB100}} + sp + {{Text|"IF"|#FFB100}}
                    endifs = endifs - {{Text|1|#F580B1}}
                    continuelinefrom = i
                    lineelseused = lineelseused - {{Text|1|#F580B1}}
                    {{Text|GOTO|#F0F0F0}} gotcommand
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'follow up previously encountered 'ELSE' by applying 'ELSE'|#31C4C4}}
                a$ = {{Text|"ELSE"|#FFB100}}: continuelinefrom = i + {{Text|1|#F580B1}}
                lineelseused = lineelseused + {{Text|1|#F580B1}}
                {{Text|GOTO|#F0F0F0}} gotcommand
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'start=i|#31C4C4}}
            {{Text|'apply everything up to (but not including) 'ELSE'|#31C4C4}}
            continuelinefrom = i
            {{Text|GOTO|#F0F0F0}} gotcommand
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'"ELSE"|#31C4C4}}
        e$ = getelement(entireline$, i): {{Text|IF|#F0F0F0}} a$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = e$ {{Text|ELSE|#F0F0F0}} a$ = a$ + sp + e$
    {{Text|NEXT|#F0F0F0}}
    {{Text|'we're reached the end of the line|#31C4C4}}
    {{Text|IF|#F0F0F0}} endifs > {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
        endifs = endifs - {{Text|1|#F580B1}}
        impliedendif = {{Text|1|#F580B1}}: entireline$ = entireline$ + sp + {{Text|":"|#FFB100}} + sp + {{Text|"END"|#FFB100}} + sp + {{Text|"IF"|#FFB100}}: n = n + {{Text|3|#F580B1}}
        i = i + {{Text|1|#F580B1}} {{Text|'skip the ":" (i is now equal to n+2)|#31C4C4}}
        continuelinefrom = i
        {{Text|GOTO|#F0F0F0}} gotcommand
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    gotcommand:
    dynscope = {{Text|0|#F580B1}}
    ca$ = a$
    a$ = eleucase$(ca$) {{Text|'***REVISE THIS SECTION LATER***|#31C4C4}}
    layoutdone = {{Text|0|#F580B1}}
    linefragment = a$
    {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, a$
    n = numelements(a$)
    {{Text|IF|#F0F0F0}} n = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} finishednonexec
    {{Text|'convert non-UDT dimensioned periods to _046_|#31C4C4}}
    {{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(ca$, sp + {{Text|"."|#FFB100}} + sp) {{Text|THEN|#F0F0F0}}
        a3$ = getelement(ca$, {{Text|1|#F580B1}})
        except = {{Text|0|#F580B1}}
        aa$ = a3$ + sp {{Text|'rebuilt a$ (always has a trailing spacer)|#31C4C4}}
        lastfuse = {{Text|-1|#F580B1}}
        {{Text|FOR|#F0F0F0}} x = {{Text|2|#F580B1}} {{Text|TO|#F0F0F0}} n
            a2$ = getelement(ca$, x)
            {{Text|IF|#F0F0F0}} except = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} except = {{Text|2|#F580B1}}: {{Text|GOTO|#F0F0F0}} udtperiod {{Text|'skip element name|#31C4C4}}
            {{Text|IF|#F0F0F0}} a2$ = {{Text|"."|#FFB100}} {{Text|AND|#F0F0F0}} x <> n {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} except = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} except = {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} udtperiod {{Text|'sub-element of UDT|#31C4C4}}
                {{Text|IF|#F0F0F0}} a3$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|'assume it was something like typevar(???).x and treat as a UDT|#31C4C4}}
                    except = {{Text|1|#F580B1}}
                    {{Text|GOTO|#F0F0F0}} udtperiod
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'find an ID of that type|#31C4C4}}
                try = findid({{Text|UCASE$|#F0F0F0}}(a3$))
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
                    {{Text|IF|#F0F0F0}} ((id.t {{Text|AND|#F0F0F0}} ISUDT) <> {{Text|0|#F580B1}}) {{Text|OR|#F0F0F0}} ((id.arraytype {{Text|AND|#F0F0F0}} ISUDT) <> {{Text|0|#F580B1}}) {{Text|THEN|#F0F0F0}}
                        except = {{Text|1|#F580B1}}
                        {{Text|GOTO|#F0F0F0}} udtperiod
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid({{Text|UCASE$|#F0F0F0}}(a3$)) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|LOOP|#F0F0F0}}
                {{Text|'not a udt; fuse lhs & rhs with _046_|#31C4C4}}
                {{Text|IF|#F0F0F0}} isalpha({{Text|ASC|#F0F0F0}}(a3$)) = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} lastfuse <> x - {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Invalid '.'"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                aa$ = {{Text|LEFT$|#F0F0F0}}(aa$, {{Text|LEN|#F0F0F0}}(aa$) - {{Text|1|#F580B1}}) + fix046$
                lastfuse = x
                {{Text|GOTO|#F0F0F0}} periodfused
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'"."|#31C4C4}}
            except = {{Text|0|#F580B1}}
            udtperiod:
            aa$ = aa$ + a2$ + sp
            periodfused:
            a3$ = a2$
        {{Text|NEXT|#F0F0F0}}
        a$ = {{Text|LEFT$|#F0F0F0}}(aa$, {{Text|LEN|#F0F0F0}}(aa$) - {{Text|1|#F580B1}})
        ca$ = a$
        a$ = eleucase$(ca$)
        n = numelements(a$)
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    arrayprocessinghappened = {{Text|0|#F580B1}}
    firstelement$ = getelement(a$, {{Text|1|#F580B1}})
    secondelement$ = getelement(a$, {{Text|2|#F580B1}})
    thirdelement$ = getelement(a$, {{Text|3|#F580B1}})
    {{Text|'non-executable section|#31C4C4}}
    {{Text|IF|#F0F0F0}} n = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"'"|#FFB100}} {{Text|THEN|#F0F0F0}} layoutdone = {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} finishednonexec {{Text|'nop|#31C4C4}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} n <= {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"DATA"|#FFB100}} {{Text|THEN|#F0F0F0}}
            l$ = SCase$({{Text|"Data"|#FFB100}})
            {{Text|IF|#F0F0F0}} n = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                e$ = {{Text|SPACE$|#F0F0F0}}(({{Text|LEN|#F0F0F0}}(secondelement$) - {{Text|1|#F580B1}}) \ {{Text|2|#F580B1}})
                {{Text|FOR|#F0F0F0}} x = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|LEN|#F0F0F0}}(e$)
                    v1 = {{Text|ASC|#F0F0F0}}(secondelement$, x * {{Text|2|#F580B1}})
                    v2 = {{Text|ASC|#F0F0F0}}(secondelement$, x * {{Text|2|#F580B1}} + {{Text|1|#F580B1}})
                    {{Text|IF|#F0F0F0}} v1 < {{Text|65|#F580B1}} {{Text|THEN|#F0F0F0}} v1 = v1 - {{Text|48|#F580B1}} {{Text|ELSE|#F0F0F0}} v1 = v1 - {{Text|55|#F580B1}}
                    {{Text|IF|#F0F0F0}} v2 < {{Text|65|#F580B1}} {{Text|THEN|#F0F0F0}} v2 = v2 - {{Text|48|#F580B1}} {{Text|ELSE|#F0F0F0}} v2 = v2 - {{Text|55|#F580B1}}
                    {{Text|ASC|#F0F0F0}}(e$, x) = v1 + v2 * {{Text|16|#F580B1}}
                {{Text|NEXT|#F0F0F0}}
                l$ = l$ + sp + e$
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'n=2|#31C4C4}}
            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
            {{Text|GOTO|#F0F0F0}} finishednonexec
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'declare library|#31C4C4}}
    {{Text|IF|#F0F0F0}} declaringlibrary {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"END"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} n <> {{Text|2|#F580B1}} {{Text|OR|#F0F0F0}} secondelement$ <> {{Text|"DECLARE"|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected END DECLARE"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            declaringlibrary = {{Text|0|#F580B1}}
            l$ = SCase$({{Text|"End"|#FFB100}} + sp + {{Text|"Declare"|#FFB100}})
            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
            {{Text|GOTO|#F0F0F0}} finishednonexec
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'end declare|#31C4C4}}
        declaringlibrary = {{Text|2|#F580B1}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"SUB"|#FFB100}} {{Text|OR|#F0F0F0}} firstelement$ = {{Text|"FUNCTION"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|GOTO|#F0F0F0}} declaresubfunc2
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        a$ = {{Text|"Expected SUB/FUNCTION definition or END DECLARE"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'declaringlibrary|#31C4C4}}
    {{Text|'check TYPE declarations (created on prepass)|#31C4C4}}
    {{Text|IF|#F0F0F0}} definingtype {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"END"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} n <> {{Text|2|#F580B1}} {{Text|OR|#F0F0F0}} secondelement$ <> {{Text|"TYPE"|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected END TYPE"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            definingtype = {{Text|0|#F580B1}}
            l$ = SCase$({{Text|"End"|#FFB100}} + sp + {{Text|"Type"|#FFB100}})
            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
            {{Text|GOTO|#F0F0F0}} finishednonexec
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|'IF n < 3 THEN definingtypeerror = linenumber: a$ = "Expected element-name AS type or AS type element-list": GOTO errmes|#31C4C4}}
        {{Text|IF|#F0F0F0}} n < {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected element-name AS type or AS type element-list"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
        definingtype = {{Text|2|#F580B1}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"AS"|#FFB100}} {{Text|THEN|#F0F0F0}}
            l$ = SCase$({{Text|"As"|#FFB100}})
            t$ = {{Text|""|#FFB100}}
            wordsInTypeName = {{Text|0|#F580B1}}
            {{Text|DO|#F0F0F0}}
                nextElement$ = getelement$(a$, {{Text|2|#F580B1}} + wordsInTypeName)
                {{Text|IF|#F0F0F0}} nextElement$ = {{Text|","|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|'element-list|#31C4C4}}
                    wordsInTypeName = wordsInTypeName - {{Text|2|#F580B1}}
                    {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                wordsInTypeName = wordsInTypeName + {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} wordsInTypeName = n - {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|'single element in line|#31C4C4}}
                    wordsInTypeName = wordsInTypeName - {{Text|1|#F580B1}}
                    {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|LOOP|#F0F0F0}}
            t$ = getelements$(a$, {{Text|2|#F580B1}}, {{Text|2|#F580B1}} + wordsInTypeName)
            typ = typname2typ(t$)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} typ = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Undefined type"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} typ {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} {{Text|UCASE$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(t$)) = {{Text|"MEM"|#FFB100}} {{Text|AND|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(udtxcname(typ {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}})) = {{Text|"_MEM"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                    t$ = {{Text|MID$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(udtxcname(typ {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}})), {{Text|2|#F580B1}})
                {{Text|ELSE|#F0F0F0}}
                    t$ = {{Text|RTRIM$|#F0F0F0}}(udtxcname(typ {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}))
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                l$ = l$ + sp + t$
            {{Text|ELSE|#F0F0F0}}
                l$ = l$ + sp + SCase2$(t$)
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'Now add each variable:|#31C4C4}}
            {{Text|FOR|#F0F0F0}} i = {{Text|3|#F580B1}} + wordsInTypeName {{Text|TO|#F0F0F0}} n
                thisElement$ = getelement$(ca$, i)
                {{Text|IF|#F0F0F0}} thisElement$ = {{Text|","|#FFB100}} {{Text|THEN|#F0F0F0}}
                    l$ = l$ + thisElement$
                {{Text|ELSE|#F0F0F0}}
                    l$ = l$ + sp + thisElement$
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|NEXT|#F0F0F0}}
            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
        {{Text|ELSE|#F0F0F0}}
            l$ = getelement(ca$, {{Text|1|#F580B1}}) + sp + SCase$({{Text|"As"|#FFB100}})
            t$ = getelements$(a$, {{Text|3|#F580B1}}, n)
            typ = typname2typ(t$)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} typ = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Undefined type"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} typ {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} {{Text|UCASE$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(t$)) = {{Text|"MEM"|#FFB100}} {{Text|AND|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(udtxcname(typ {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}})) = {{Text|"_MEM"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                    t$ = {{Text|MID$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(udtxcname(typ {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}})), {{Text|2|#F580B1}})
                {{Text|ELSE|#F0F0F0}}
                    t$ = {{Text|RTRIM$|#F0F0F0}}(udtxcname(typ {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}))
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                l$ = l$ + sp + t$
            {{Text|ELSE|#F0F0F0}}
                l$ = l$ + sp + SCase2$(t$)
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|GOTO|#F0F0F0}} finishednonexec
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'defining type|#31C4C4}}
    {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"TYPE"|#FFB100}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} n <> {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected TYPE type-name"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
        l$ = SCase$({{Text|"Type"|#FFB100}}) + sp + getelement(ca$, {{Text|2|#F580B1}})
        layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
        definingtype = {{Text|1|#F580B1}}
        definingtypeerror = linenumber
        {{Text|GOTO|#F0F0F0}} finishednonexec
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'skip DECLARE SUB/FUNCTION|#31C4C4}}
    {{Text|IF|#F0F0F0}} n >= {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"DECLARE"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} secondelement$ = {{Text|"LIBRARY"|#FFB100}} {{Text|OR|#F0F0F0}} secondelement$ = {{Text|"DYNAMIC"|#FFB100}} {{Text|OR|#F0F0F0}} secondelement$ = {{Text|"CUSTOMTYPE"|#FFB100}} {{Text|OR|#F0F0F0}} secondelement$ = {{Text|"STATIC"|#FFB100}} {{Text|THEN|#F0F0F0}}
                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$ = SCase$({{Text|"Declare"|#FFB100}} + sp + {{Text|"Library"|#FFB100}})
                {{Text|IF|#F0F0F0}} secondelement$ = {{Text|"DYNAMIC"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    e$ = getelement$(a$, {{Text|3|#F580B1}}): {{Text|IF|#F0F0F0}} e$ <> {{Text|"LIBRARY"|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected DYNAMIC LIBRARY "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"..."|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}): {{Text|GOTO|#F0F0F0}} errmes
                    dynamiclibrary = {{Text|1|#F580B1}}
                    x = {{Text|4|#F580B1}}
                    l$ = SCase$({{Text|"Declare"|#FFB100}} + sp + {{Text|"Dynamic"|#FFB100}} + sp + {{Text|"Library"|#FFB100}})
                    {{Text|IF|#F0F0F0}} n = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected DECLARE DYNAMIC LIBRARY "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"..."|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}): {{Text|GOTO|#F0F0F0}} errmes
                    indirectlibrary = {{Text|1|#F580B1}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} secondelement$ = {{Text|"CUSTOMTYPE"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    e$ = getelement$(a$, {{Text|3|#F580B1}}): {{Text|IF|#F0F0F0}} e$ <> {{Text|"LIBRARY"|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected CUSTOMTYPE LIBRARY"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    customtypelibrary = {{Text|1|#F580B1}}
                    x = {{Text|4|#F580B1}}
                    l$ = SCase$({{Text|"Declare"|#FFB100}} + sp + {{Text|"CustomType"|#FFB100}} + sp + {{Text|"Library"|#FFB100}})
                    indirectlibrary = {{Text|1|#F580B1}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} secondelement$ = {{Text|"STATIC"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    e$ = getelement$(a$, {{Text|3|#F580B1}}): {{Text|IF|#F0F0F0}} e$ <> {{Text|"LIBRARY"|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected STATIC LIBRARY"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    x = {{Text|4|#F580B1}}
                    l$ = SCase$({{Text|"Declare"|#FFB100}} + sp + {{Text|"Static"|#FFB100}} + sp + {{Text|"Library"|#FFB100}})
                    staticlinkedlibrary = {{Text|1|#F580B1}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                sfdeclare = {{Text|0|#F580B1}}: sfheader = {{Text|0|#F580B1}}
                {{Text|IF|#F0F0F0}} n >= x {{Text|THEN|#F0F0F0}}
                    sfdeclare = {{Text|1|#F580B1}}
                    addlibrary:
                    libname$ = {{Text|""|#FFB100}}
                    headername$ = {{Text|""|#FFB100}}
                    {{Text|'assume library name in double quotes follows|#31C4C4}}
                    {{Text|'assume library is in main qb64pe folder|#31C4C4}}
                    x$ = getelement$(ca$, x)
                    {{Text|IF|#F0F0F0}} {{Text|ASC|#F0F0F0}}(x$) <> {{Text|34|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected LIBRARY "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"..."|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}): {{Text|GOTO|#F0F0F0}} errmes
                    x$ = {{Text|RIGHT$|#F0F0F0}}(x$, {{Text|LEN|#F0F0F0}}(x$) - {{Text|1|#F580B1}})
                    z = {{Text|INSTR|#F0F0F0}}(x$, {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}))
                    {{Text|IF|#F0F0F0}} z = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected LIBRARY "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"..."|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}): {{Text|GOTO|#F0F0F0}} errmes
                    x$ = {{Text|LEFT$|#F0F0F0}}(x$, z - {{Text|1|#F580B1}})
                    {{Text|IF|#F0F0F0}} dynamiclibrary <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|LEN|#F0F0F0}}(x$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected DECLARE DYNAMIC LIBRARY "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"..."|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}): {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|IF|#F0F0F0}} customtypelibrary <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|LEN|#F0F0F0}}(x$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected DECLARE CUSTOMTYPE LIBRARY "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"..."|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}): {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|'convert '\\' to '\'|#31C4C4}}
                    {{Text|WHILE|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(x$, {{Text|"\\"|#FFB100}})
                        z = {{Text|INSTR|#F0F0F0}}(x$, {{Text|"\\"|#FFB100}})
                        x$ = {{Text|LEFT$|#F0F0F0}}(x$, z - {{Text|1|#F580B1}}) + {{Text|RIGHT$|#F0F0F0}}(x$, {{Text|LEN|#F0F0F0}}(x$) - z)
                    {{Text|WEND|#F0F0F0}}
                    autoformat_x$ = x$ {{Text|'used for autolayout purposes|#31C4C4}}
                    {{Text|'Remove version number from library name|#31C4C4}}
                    {{Text|'Eg. libname:1.0 becomes libname <-> 1.0 which later becomes libname.so.1.0|#31C4C4}}
                    v$ = {{Text|""|#FFB100}}
                    striplibver:
                    {{Text|FOR|#F0F0F0}} z = {{Text|LEN|#F0F0F0}}(x$) {{Text|TO|#F0F0F0}} {{Text|1|#F580B1}} {{Text|STEP|#F0F0F0}} {{Text|-1|#F580B1}}
                        a = {{Text|ASC|#F0F0F0}}(x$, z)
                        {{Text|IF|#F0F0F0}} a = ASC_BACKSLASH {{Text|OR|#F0F0F0}} a = ASC_FORWARDSLASH {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} a = ASC_FULLSTOP {{Text|OR|#F0F0F0}} a = ASC_COLON {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} isuinteger({{Text|RIGHT$|#F0F0F0}}(x$, {{Text|LEN|#F0F0F0}}(x$) - z)) {{Text|THEN|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(v$) {{Text|THEN|#F0F0F0}} v$ = {{Text|RIGHT$|#F0F0F0}}(x$, {{Text|LEN|#F0F0F0}}(x$) - z) + {{Text|"."|#FFB100}} + v$ {{Text|ELSE|#F0F0F0}} v$ = {{Text|RIGHT$|#F0F0F0}}(x$, {{Text|LEN|#F0F0F0}}(x$) - z)
                                x$ = {{Text|LEFT$|#F0F0F0}}(x$, z - {{Text|1|#F580B1}})
                                {{Text|IF|#F0F0F0}} a = ASC_COLON {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}}
                                {{Text|GOTO|#F0F0F0}} striplibver
                            {{Text|ELSE|#F0F0F0}}
                                {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|NEXT|#F0F0F0}}
                    libver$ = v$
                    {{Text|IF|#F0F0F0}} os$ = {{Text|"WIN"|#FFB100}} {{Text|THEN|#F0F0F0}}
                        {{Text|'convert forward-slashes to back-slashes|#31C4C4}}
                        {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(x$, {{Text|"/"|#FFB100}})
                            z = {{Text|INSTR|#F0F0F0}}(x$, {{Text|"/"|#FFB100}})
                            x$ = {{Text|LEFT$|#F0F0F0}}(x$, z - {{Text|1|#F580B1}}) + {{Text|"\"|#FFB100}} + {{Text|RIGHT$|#F0F0F0}}(x$, {{Text|LEN|#F0F0F0}}(x$) - z)
                        {{Text|LOOP|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} os$ = {{Text|"LNX"|#FFB100}} {{Text|THEN|#F0F0F0}}
                        {{Text|'convert any back-slashes to forward-slashes|#31C4C4}}
                        {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(x$, {{Text|"\"|#FFB100}})
                            z = {{Text|INSTR|#F0F0F0}}(x$, {{Text|"\"|#FFB100}})
                            x$ = {{Text|LEFT$|#F0F0F0}}(x$, z - {{Text|1|#F580B1}}) + {{Text|"/"|#FFB100}} + {{Text|RIGHT$|#F0F0F0}}(x$, {{Text|LEN|#F0F0F0}}(x$) - z)
                        {{Text|LOOP|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|'Separate path from name|#31C4C4}}
                    libpath$ = {{Text|""|#FFB100}}
                    {{Text|FOR|#F0F0F0}} z = {{Text|LEN|#F0F0F0}}(x$) {{Text|TO|#F0F0F0}} {{Text|1|#F580B1}} {{Text|STEP|#F0F0F0}} {{Text|-1|#F580B1}}
                        a = {{Text|ASC|#F0F0F0}}(x$, z)
                        {{Text|IF|#F0F0F0}} a = {{Text|47|#F580B1}} {{Text|OR|#F0F0F0}} a = {{Text|92|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'\ or /|#31C4C4}}
                            libpath$ = {{Text|LEFT$|#F0F0F0}}(x$, z)
                            x$ = {{Text|RIGHT$|#F0F0F0}}(x$, {{Text|LEN|#F0F0F0}}(x$) - z)
                            {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|NEXT|#F0F0F0}}
                    {{Text|'Accept ./ and .\ as a reference to the source file|#31C4C4}}
                    {{Text|'folder, replacing it with the actual full path, if available|#31C4C4}}
                    {{Text|IF|#F0F0F0}} libpath$ = {{Text|"./"|#FFB100}} {{Text|OR|#F0F0F0}} libpath$ = {{Text|".\"|#FFB100}} {{Text|THEN|#F0F0F0}}
                        libpath$ = {{Text|""|#FFB100}}
                        {{Text|IF|#F0F0F0}} NoIDEMode {{Text|THEN|#F0F0F0}}
                            libpath$ = path.source$
                            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libpath$) > {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|RIGHT$|#F0F0F0}}(libpath$, {{Text|1|#F580B1}}) <> pathsep$ {{Text|THEN|#F0F0F0}} libpath$ = libpath$ + pathsep$
                        {{Text|ELSE|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(ideprogname) {{Text|THEN|#F0F0F0}} libpath$ = idepath$ + pathsep$
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|'Create a path which can be used for inline code (uses \\ instead of \)|#31C4C4}}
                    libpath_inline$ = {{Text|""|#FFB100}}
                    {{Text|FOR|#F0F0F0}} z = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libpath$)
                        a = {{Text|ASC|#F0F0F0}}(libpath$, z)
                        libpath_inline$ = libpath_inline$ + {{Text|CHR$|#F0F0F0}}(a)
                        {{Text|IF|#F0F0F0}} a = {{Text|92|#F580B1}} {{Text|THEN|#F0F0F0}} libpath_inline$ = libpath_inline$ + {{Text|"\"|#FFB100}}
                    {{Text|NEXT|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(x$) {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} dynamiclibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                            {{Text|'Static library|#31C4C4}}
                            {{Text|IF|#F0F0F0}} os$ = {{Text|"WIN"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                {{Text|'check for .lib|#31C4C4}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(libpath$ + x$ + {{Text|".lib"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        libname$ = libpath$ + x$ + {{Text|".lib"|#FFB100}}
                                        inlinelibname$ = libpath_inline$ + x$ + {{Text|".lib"|#FFB100}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|'check for .a|#31C4C4}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(libpath$ + x$ + {{Text|".a"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        libname$ = libpath$ + x$ + {{Text|".a"|#FFB100}}
                                        inlinelibname$ = libpath_inline$ + x$ + {{Text|".a"|#FFB100}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|'check for .o|#31C4C4}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(libpath$ + x$ + {{Text|".o"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        libname$ = libpath$ + x$ + {{Text|".o"|#FFB100}}
                                        inlinelibname$ = libpath_inline$ + x$ + {{Text|".o"|#FFB100}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|'check for .lib|#31C4C4}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(x$ + {{Text|".lib"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        libname$ = x$ + {{Text|".lib"|#FFB100}}
                                        inlinelibname$ = x$ + {{Text|".lib"|#FFB100}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|'check for .a|#31C4C4}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(x$ + {{Text|".a"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        libname$ = x$ + {{Text|".a"|#FFB100}}
                                        inlinelibname$ = x$ + {{Text|".a"|#FFB100}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|'check for .o|#31C4C4}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(x$ + {{Text|".o"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        libname$ = x$ + {{Text|".o"|#FFB100}}
                                        inlinelibname$ = x$ + {{Text|".o"|#FFB100}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'Windows|#31C4C4}}
                            {{Text|IF|#F0F0F0}} os$ = {{Text|"LNX"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} staticlinkedlibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} MacOSX {{Text|THEN|#F0F0F0}} {{Text|'dylib support|#31C4C4}}
                                        {{Text|'check for .dylib (direct)|#31C4C4}}
                                        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                            {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|"."|#FFB100}} + libver$ + {{Text|".dylib"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                                libname$ = libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|"."|#FFB100}} + libver$ + {{Text|".dylib"|#FFB100}}
                                                inlinelibname$ = libpath_inline$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|"."|#FFB100}} + libver$ + {{Text|".dylib"|#FFB100}}
                                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libpath$) {{Text|THEN|#F0F0F0}} mylibopt$ = mylibopt$ + {{Text|" -Wl,-rpath "|#FFB100}} + libpath$ + {{Text|" "|#FFB100}} {{Text|ELSE|#F0F0F0}} mylibopt$ = mylibopt$ + {{Text|" -Wl,-rpath ./ "|#FFB100}}
                                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                            {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".dylib"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                                libname$ = libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".dylib"|#FFB100}}
                                                inlinelibname$ = libpath_inline$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".dylib"|#FFB100}}
                                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libpath$) {{Text|THEN|#F0F0F0}} mylibopt$ = mylibopt$ + {{Text|" -Wl,-rpath "|#FFB100}} + libpath$ + {{Text|" "|#FFB100}} {{Text|ELSE|#F0F0F0}} mylibopt$ = mylibopt$ + {{Text|" -Wl,-rpath ./ "|#FFB100}}
                                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|'check for .so (direct)|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$) {{Text|THEN|#F0F0F0}}
                                            libname$ = libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$
                                            inlinelibname$ = libpath_inline$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$
                                            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libpath$) {{Text|THEN|#F0F0F0}} mylibopt$ = mylibopt$ + {{Text|" -Wl,-rpath "|#FFB100}} + libpath$ + {{Text|" "|#FFB100}} {{Text|ELSE|#F0F0F0}} mylibopt$ = mylibopt$ + {{Text|" -Wl,-rpath ./ "|#FFB100}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                            libname$ = libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}
                                            inlinelibname$ = libpath_inline$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}
                                            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libpath$) {{Text|THEN|#F0F0F0}} mylibopt$ = mylibopt$ + {{Text|" -Wl,-rpath "|#FFB100}} + libpath$ + {{Text|" "|#FFB100}} {{Text|ELSE|#F0F0F0}} mylibopt$ = mylibopt$ + {{Text|" -Wl,-rpath ./ "|#FFB100}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|'check for .a (direct)|#31C4C4}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".a"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        libname$ = libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".a"|#FFB100}}
                                        inlinelibname$ = libpath_inline$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".a"|#FFB100}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|'check for .o (direct)|#31C4C4}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".o"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        libname$ = libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".o"|#FFB100}}
                                        inlinelibname$ = libpath_inline$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".o"|#FFB100}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} staticlinkedlibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|'check for .so (usr/lib64)|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/lib64/"|#FFB100}} + libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$) {{Text|THEN|#F0F0F0}}
                                            libname$ = {{Text|"/usr/lib64/"|#FFB100}} + libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$
                                            inlinelibname$ = {{Text|"/usr/lib64/"|#FFB100}} + libpath_inline$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$
                                            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libpath$) {{Text|THEN|#F0F0F0}} mylibopt$ = mylibopt$ + {{Text|" -Wl,-rpath /usr/lib64/"|#FFB100}} + libpath$ + {{Text|" "|#FFB100}} {{Text|ELSE|#F0F0F0}} mylibopt$ = mylibopt$ + {{Text|" -Wl,-rpath /usr/lib64/ "|#FFB100}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/lib64/"|#FFB100}} + libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                            libname$ = {{Text|"/usr/lib64/"|#FFB100}} + libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}
                                            inlinelibname$ = {{Text|"/usr/lib64/"|#FFB100}} + libpath_inline$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}
                                            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libpath$) {{Text|THEN|#F0F0F0}} mylibopt$ = mylibopt$ + {{Text|" -Wl,-rpath /usr/lib64/"|#FFB100}} + libpath$ + {{Text|" "|#FFB100}} {{Text|ELSE|#F0F0F0}} mylibopt$ = mylibopt$ + {{Text|" -Wl,-rpath /usr/lib64/ "|#FFB100}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|'check for .a (usr/lib64)|#31C4C4}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/lib64/"|#FFB100}} + libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".a"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        libname$ = {{Text|"/usr/lib64/"|#FFB100}} + libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".a"|#FFB100}}
                                        inlinelibname$ = {{Text|"/usr/lib64/"|#FFB100}} + libpath_inline$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".a"|#FFB100}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} staticlinkedlibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} MacOSX {{Text|THEN|#F0F0F0}} {{Text|'dylib support|#31C4C4}}
                                        {{Text|'check for .dylib (usr/lib)|#31C4C4}}
                                        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                            {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/lib/"|#FFB100}} + libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|"."|#FFB100}} + libver$ + {{Text|".dylib"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                                libname$ = {{Text|"/usr/lib/"|#FFB100}} + libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|"."|#FFB100}} + libver$ + {{Text|".dylib"|#FFB100}}
                                                inlinelibname$ = {{Text|"/usr/lib/"|#FFB100}} + libpath_inline$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|"."|#FFB100}} + libver$ + {{Text|".dylib"|#FFB100}}
                                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libpath$) {{Text|THEN|#F0F0F0}} mylibopt$ = mylibopt$ + {{Text|" -Wl,-rpath /usr/lib/"|#FFB100}} + libpath$ + {{Text|" "|#FFB100}} {{Text|ELSE|#F0F0F0}} mylibopt$ = mylibopt$ + {{Text|" -Wl,-rpath /usr/lib/ "|#FFB100}}
                                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                            {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/lib/"|#FFB100}} + libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".dylib"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                                libname$ = {{Text|"/usr/lib/"|#FFB100}} + libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".dylib"|#FFB100}}
                                                inlinelibname$ = {{Text|"/usr/lib/"|#FFB100}} + libpath_inline$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".dylib"|#FFB100}}
                                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libpath$) {{Text|THEN|#F0F0F0}} mylibopt$ = mylibopt$ + {{Text|" -Wl,-rpath /usr/lib/"|#FFB100}} + libpath$ + {{Text|" "|#FFB100}} {{Text|ELSE|#F0F0F0}} mylibopt$ = mylibopt$ + {{Text|" -Wl,-rpath /usr/lib/ "|#FFB100}}
                                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|'check for .so (usr/lib)|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/lib/"|#FFB100}} + libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$) {{Text|THEN|#F0F0F0}}
                                            libname$ = {{Text|"/usr/lib/"|#FFB100}} + libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$
                                            inlinelibname$ = {{Text|"/usr/lib/"|#FFB100}} + libpath_inline$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$
                                            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libpath$) {{Text|THEN|#F0F0F0}} mylibopt$ = mylibopt$ + {{Text|" -Wl,-rpath /usr/lib/"|#FFB100}} + libpath$ + {{Text|" "|#FFB100}} {{Text|ELSE|#F0F0F0}} mylibopt$ = mylibopt$ + {{Text|" -Wl,-rpath /usr/lib/ "|#FFB100}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/lib/"|#FFB100}} + libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                            libname$ = {{Text|"/usr/lib/"|#FFB100}} + libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}
                                            inlinelibname$ = {{Text|"/usr/lib/"|#FFB100}} + libpath_inline$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}
                                            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libpath$) {{Text|THEN|#F0F0F0}} mylibopt$ = mylibopt$ + {{Text|" -Wl,-rpath /usr/lib/"|#FFB100}} + libpath$ + {{Text|" "|#FFB100}} {{Text|ELSE|#F0F0F0}} mylibopt$ = mylibopt$ + {{Text|" -Wl,-rpath /usr/lib/ "|#FFB100}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|'check for .a (usr/lib)|#31C4C4}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/lib/"|#FFB100}} + libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".a"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        libname$ = {{Text|"/usr/lib/"|#FFB100}} + libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".a"|#FFB100}}
                                        inlinelibname$ = {{Text|"/usr/lib/"|#FFB100}} + libpath_inline$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".a"|#FFB100}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|'--------------------------(without path)------------------------------|#31C4C4}}
                                {{Text|IF|#F0F0F0}} staticlinkedlibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} MacOSX {{Text|THEN|#F0F0F0}} {{Text|'dylib support|#31C4C4}}
                                        {{Text|'check for .dylib (direct)|#31C4C4}}
                                        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                            {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"lib"|#FFB100}} + x$ + {{Text|"."|#FFB100}} + libver$ + {{Text|".dylib"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                                libname$ = {{Text|"lib"|#FFB100}} + x$ + {{Text|"."|#FFB100}} + libver$ + {{Text|".dylib"|#FFB100}}
                                                inlinelibname$ = {{Text|"lib"|#FFB100}} + x$ + {{Text|"."|#FFB100}} + libver$ + {{Text|".dylib"|#FFB100}}
                                                mylibopt$ = mylibopt$ + {{Text|" -Wl,-rpath ./ "|#FFB100}}
                                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                            {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"lib"|#FFB100}} + x$ + {{Text|".dylib"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                                libname$ = {{Text|"lib"|#FFB100}} + x$ + {{Text|".dylib"|#FFB100}}
                                                inlinelibname$ = {{Text|"lib"|#FFB100}} + x$ + {{Text|".dylib"|#FFB100}}
                                                mylibopt$ = mylibopt$ + {{Text|" -Wl,-rpath ./ "|#FFB100}}
                                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|'check for .so (direct)|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$) {{Text|THEN|#F0F0F0}}
                                            libname$ = {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$
                                            inlinelibname$ = {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$
                                            mylibopt$ = mylibopt$ + {{Text|" -Wl,-rpath ./ "|#FFB100}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                            libname$ = {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}
                                            inlinelibname$ = {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}
                                            mylibopt$ = mylibopt$ + {{Text|" -Wl,-rpath ./ "|#FFB100}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|'check for .a (direct)|#31C4C4}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"lib"|#FFB100}} + x$ + {{Text|".a"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        libname$ = {{Text|"lib"|#FFB100}} + x$ + {{Text|".a"|#FFB100}}
                                        inlinelibname$ = {{Text|"lib"|#FFB100}} + x$ + {{Text|".a"|#FFB100}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|'check for .o (direct)|#31C4C4}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"lib"|#FFB100}} + x$ + {{Text|".o"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        libname$ = {{Text|"lib"|#FFB100}} + x$ + {{Text|".o"|#FFB100}}
                                        inlinelibname$ = {{Text|"lib"|#FFB100}} + x$ + {{Text|".o"|#FFB100}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} staticlinkedlibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|'check for .so (usr/lib64)|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/lib64/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$) {{Text|THEN|#F0F0F0}}
                                            libname$ = {{Text|"/usr/lib64/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$
                                            inlinelibname$ = {{Text|"/usr/lib64/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$
                                            mylibopt$ = mylibopt$ + {{Text|" -Wl,-rpath /usr/lib64/ "|#FFB100}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/lib64/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                            libname$ = {{Text|"/usr/lib64/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}
                                            inlinelibname$ = {{Text|"/usr/lib64/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}
                                            mylibopt$ = mylibopt$ + {{Text|" -Wl,-rpath /usr/lib64/ "|#FFB100}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|'check for .a (usr/lib64)|#31C4C4}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/lib64/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".a"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        libname$ = {{Text|"/usr/lib64/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".a"|#FFB100}}
                                        inlinelibname$ = {{Text|"/usr/lib64/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".a"|#FFB100}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} staticlinkedlibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} MacOSX {{Text|THEN|#F0F0F0}} {{Text|'dylib support|#31C4C4}}
                                        {{Text|'check for .dylib (usr/lib)|#31C4C4}}
                                        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                            {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/lib/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|"."|#FFB100}} + libver$ + {{Text|".dylib"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                                libname$ = {{Text|"/usr/lib/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|"."|#FFB100}} + libver$ + {{Text|".dylib"|#FFB100}}
                                                inlinelibname$ = {{Text|"/usr/lib/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|"."|#FFB100}} + libver$ + {{Text|".dylib"|#FFB100}}
                                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                            {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/lib/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".dylib"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                                libname$ = {{Text|"/usr/lib/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".dylib"|#FFB100}}
                                                inlinelibname$ = {{Text|"/usr/lib/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".dylib"|#FFB100}}
                                                mylibopt$ = mylibopt$ + {{Text|" -Wl,-rpath /usr/lib/ "|#FFB100}}
                                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|'check for .so (usr/lib)|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/lib/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$) {{Text|THEN|#F0F0F0}}
                                            libname$ = {{Text|"/usr/lib/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$
                                            inlinelibname$ = {{Text|"/usr/lib/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/lib/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                            libname$ = {{Text|"/usr/lib/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}
                                            inlinelibname$ = {{Text|"/usr/lib/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}
                                            mylibopt$ = mylibopt$ + {{Text|" -Wl,-rpath /usr/lib/ "|#FFB100}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|'check for .a (usr/lib)|#31C4C4}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/lib/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".a"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        libname$ = {{Text|"/usr/lib/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".a"|#FFB100}}
                                        inlinelibname$ = {{Text|"/usr/lib/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".a"|#FFB100}}
                                        mylibopt$ = mylibopt$ + {{Text|" -Wl,-rpath /usr/lib/ "|#FFB100}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'Linux|#31C4C4}}
                            {{Text|'check for header|#31C4C4}}
                            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(headername$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} os$ = {{Text|"WIN"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(libpath$ + x$ + {{Text|".h"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        headername$ = libpath_inline$ + x$ + {{Text|".h"|#FFB100}}
                                        {{Text|IF|#F0F0F0}} customtypelibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} sfdeclare = {{Text|0|#F580B1}}
                                        sfheader = {{Text|1|#F580B1}}
                                        {{Text|GOTO|#F0F0F0}} GotHeader
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(libpath$ + x$ + {{Text|".hpp"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        headername$ = libpath_inline$ + x$ + {{Text|".hpp"|#FFB100}}
                                        {{Text|IF|#F0F0F0}} customtypelibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} sfdeclare = {{Text|0|#F580B1}}
                                        sfheader = {{Text|1|#F580B1}}
                                        {{Text|GOTO|#F0F0F0}} GotHeader
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|'--------------------------(without path)------------------------------|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(x$ + {{Text|".h"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        headername$ = x$ + {{Text|".h"|#FFB100}}
                                        {{Text|IF|#F0F0F0}} customtypelibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} sfdeclare = {{Text|0|#F580B1}}
                                        sfheader = {{Text|1|#F580B1}}
                                        {{Text|GOTO|#F0F0F0}} GotHeader
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(x$ + {{Text|".hpp"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        headername$ = x$ + {{Text|".hpp"|#FFB100}}
                                        {{Text|IF|#F0F0F0}} customtypelibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} sfdeclare = {{Text|0|#F580B1}}
                                        sfheader = {{Text|1|#F580B1}}
                                        {{Text|GOTO|#F0F0F0}} GotHeader
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'Windows|#31C4C4}}
                                {{Text|IF|#F0F0F0}} os$ = {{Text|"LNX"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(libpath$ + x$ + {{Text|".h"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        headername$ = libpath_inline$ + x$ + {{Text|".h"|#FFB100}}
                                        {{Text|IF|#F0F0F0}} customtypelibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} sfdeclare = {{Text|0|#F580B1}}
                                        sfheader = {{Text|1|#F580B1}}
                                        {{Text|GOTO|#F0F0F0}} GotHeader
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(libpath$ + x$ + {{Text|".hpp"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        headername$ = libpath_inline$ + x$ + {{Text|".hpp"|#FFB100}}
                                        {{Text|IF|#F0F0F0}} customtypelibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} sfdeclare = {{Text|0|#F580B1}}
                                        sfheader = {{Text|1|#F580B1}}
                                        {{Text|GOTO|#F0F0F0}} GotHeader
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/include/"|#FFB100}} + libpath$ + x$ + {{Text|".h"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        headername$ = {{Text|"/usr/include/"|#FFB100}} + libpath_inline$ + x$ + {{Text|".h"|#FFB100}}
                                        {{Text|IF|#F0F0F0}} customtypelibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} sfdeclare = {{Text|0|#F580B1}}
                                        sfheader = {{Text|1|#F580B1}}
                                        {{Text|GOTO|#F0F0F0}} GotHeader
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/include/"|#FFB100}} + libpath$ + x$ + {{Text|".hpp"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        headername$ = {{Text|"/usr/include/"|#FFB100}} + libpath_inline$ + x$ + {{Text|".hpp"|#FFB100}}
                                        {{Text|IF|#F0F0F0}} customtypelibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} sfdeclare = {{Text|0|#F580B1}}
                                        sfheader = {{Text|1|#F580B1}}
                                        {{Text|GOTO|#F0F0F0}} GotHeader
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|'--------------------------(without path)------------------------------|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(x$ + {{Text|".h"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        headername$ = x$ + {{Text|".h"|#FFB100}}
                                        {{Text|IF|#F0F0F0}} customtypelibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} sfdeclare = {{Text|0|#F580B1}}
                                        sfheader = {{Text|1|#F580B1}}
                                        {{Text|GOTO|#F0F0F0}} GotHeader
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(x$ + {{Text|".hpp"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        headername$ = x$ + {{Text|".hpp"|#FFB100}}
                                        {{Text|IF|#F0F0F0}} customtypelibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} sfdeclare = {{Text|0|#F580B1}}
                                        sfheader = {{Text|1|#F580B1}}
                                        {{Text|GOTO|#F0F0F0}} GotHeader
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/include/"|#FFB100}} + x$ + {{Text|".h"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        headername$ = {{Text|"/usr/include/"|#FFB100}} + x$ + {{Text|".h"|#FFB100}}
                                        {{Text|IF|#F0F0F0}} customtypelibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} sfdeclare = {{Text|0|#F580B1}}
                                        sfheader = {{Text|1|#F580B1}}
                                        {{Text|GOTO|#F0F0F0}} GotHeader
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/include/"|#FFB100}} + x$ + {{Text|".hpp"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        headername$ = {{Text|"/usr/include/"|#FFB100}} + x$ + {{Text|".hpp"|#FFB100}}
                                        {{Text|IF|#F0F0F0}} customtypelibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} sfdeclare = {{Text|0|#F580B1}}
                                        sfheader = {{Text|1|#F580B1}}
                                        {{Text|GOTO|#F0F0F0}} GotHeader
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'Linux|#31C4C4}}
                                GotHeader:
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|ELSE|#F0F0F0}}
                            {{Text|'dynamic library|#31C4C4}}
                            {{Text|IF|#F0F0F0}} os$ = {{Text|"WIN"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                {{Text|'check for .dll (direct)|#31C4C4}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(libpath$ + x$ + {{Text|".dll"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        libname$ = libpath$ + x$ + {{Text|".dll"|#FFB100}}
                                        inlinelibname$ = libpath_inline$ + x$ + {{Text|".dll"|#FFB100}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|'check for .dll (system32)|#31C4C4}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|ENVIRON$|#F0F0F0}}({{Text|"SYSTEMROOT"|#FFB100}}) + {{Text|"\System32\"|#FFB100}} + libpath$ + x$ + {{Text|".dll"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        libname$ = libpath$ + x$ + {{Text|".dll"|#FFB100}}
                                        inlinelibname$ = libpath_inline$ + x$ + {{Text|".dll"|#FFB100}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|'--------------------------(without path)------------------------------|#31C4C4}}
                                {{Text|'check for .dll (direct)|#31C4C4}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(x$ + {{Text|".dll"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        libname$ = x$ + {{Text|".dll"|#FFB100}}
                                        inlinelibname$ = x$ + {{Text|".dll"|#FFB100}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|'check for .dll (system32)|#31C4C4}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|ENVIRON$|#F0F0F0}}({{Text|"SYSTEMROOT"|#FFB100}}) + {{Text|"\System32\"|#FFB100}} + x$ + {{Text|".dll"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        libname$ = x$ + {{Text|".dll"|#FFB100}}
                                        inlinelibname$ = x$ + {{Text|".dll"|#FFB100}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'Windows|#31C4C4}}
                            {{Text|IF|#F0F0F0}} os$ = {{Text|"LNX"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                {{Text|'Note: STATIC libraries (.a/.o) cannot be loaded as dynamic objects|#31C4C4}}
                                {{Text|IF|#F0F0F0}} MacOSX {{Text|THEN|#F0F0F0}} {{Text|'dylib support|#31C4C4}}
                                    {{Text|'check for .dylib (direct)|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|"."|#FFB100}} + libver$ + {{Text|".dylib"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                            libname$ = libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|"."|#FFB100}} + libver$ + {{Text|".dylib"|#FFB100}}
                                            inlinelibname$ = libpath_inline$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|"."|#FFB100}} + libver$ + {{Text|".dylib"|#FFB100}}
                                            {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(libpath$, {{Text|1|#F580B1}}) <> {{Text|"/"|#FFB100}} {{Text|THEN|#F0F0F0}} libname$ = {{Text|"./"|#FFB100}} + libname$: inlinelibname$ = {{Text|"./"|#FFB100}} + inlinelibname$
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".dylib"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                            libname$ = libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".dylib"|#FFB100}}
                                            inlinelibname$ = libpath_inline$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".dylib"|#FFB100}}
                                            {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(libpath$, {{Text|1|#F580B1}}) <> {{Text|"/"|#FFB100}} {{Text|THEN|#F0F0F0}} libname$ = {{Text|"./"|#FFB100}} + libname$: inlinelibname$ = {{Text|"./"|#FFB100}} + inlinelibname$
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|'check for .so (direct)|#31C4C4}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$) {{Text|THEN|#F0F0F0}}
                                        libname$ = libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$
                                        inlinelibname$ = libpath_inline$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$
                                        {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(libpath$, {{Text|1|#F580B1}}) <> {{Text|"/"|#FFB100}} {{Text|THEN|#F0F0F0}} libname$ = {{Text|"./"|#FFB100}} + libname$: inlinelibname$ = {{Text|"./"|#FFB100}} + inlinelibname$
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        libname$ = libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}
                                        inlinelibname$ = libpath_inline$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}
                                        {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(libpath$, {{Text|1|#F580B1}}) <> {{Text|"/"|#FFB100}} {{Text|THEN|#F0F0F0}} libname$ = {{Text|"./"|#FFB100}} + libname$: inlinelibname$ = {{Text|"./"|#FFB100}} + inlinelibname$
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|'check for .so (usr/lib64)|#31C4C4}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/lib64/"|#FFB100}} + libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$) {{Text|THEN|#F0F0F0}}
                                        libname$ = {{Text|"/usr/lib64/"|#FFB100}} + libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$
                                        inlinelibname$ = {{Text|"/usr/lib64/"|#FFB100}} + libpath_inline$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/lib64/"|#FFB100}} + libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        libname$ = {{Text|"/usr/lib64/"|#FFB100}} + libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}
                                        inlinelibname$ = {{Text|"/usr/lib64/"|#FFB100}} + libpath_inline$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} MacOSX {{Text|THEN|#F0F0F0}} {{Text|'dylib support|#31C4C4}}
                                    {{Text|'check for .dylib (usr/lib)|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/lib/"|#FFB100}} + libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|"."|#FFB100}} + libver$ + {{Text|".dylib"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                            libname$ = {{Text|"/usr/lib/"|#FFB100}} + libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|"."|#FFB100}} + libver$ + {{Text|".dylib"|#FFB100}}
                                            inlinelibname$ = {{Text|"/usr/lib/"|#FFB100}} + libpath_inline$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|"."|#FFB100}} + libver$ + {{Text|".dylib"|#FFB100}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/lib/"|#FFB100}} + libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".dylib"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                            libname$ = {{Text|"/usr/lib/"|#FFB100}} + libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".dylib"|#FFB100}}
                                            inlinelibname$ = {{Text|"/usr/lib/"|#FFB100}} + libpath_inline$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".dylib"|#FFB100}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|'check for .so (usr/lib)|#31C4C4}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/lib/"|#FFB100}} + libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$) {{Text|THEN|#F0F0F0}}
                                        libname$ = {{Text|"/usr/lib/"|#FFB100}} + libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$
                                        inlinelibname$ = {{Text|"/usr/lib/"|#FFB100}} + libpath_inline$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/lib/"|#FFB100}} + libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        libname$ = {{Text|"/usr/lib/"|#FFB100}} + libpath$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}
                                        inlinelibname$ = {{Text|"/usr/lib/"|#FFB100}} + libpath_inline$ + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|'--------------------------(without path)------------------------------|#31C4C4}}
                                {{Text|IF|#F0F0F0}} MacOSX {{Text|THEN|#F0F0F0}} {{Text|'dylib support|#31C4C4}}
                                    {{Text|'check for .dylib (direct)|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"lib"|#FFB100}} + x$ + {{Text|"."|#FFB100}} + libver$ + {{Text|".dylib"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                            libname$ = {{Text|"lib"|#FFB100}} + x$ + {{Text|"."|#FFB100}} + libver$ + {{Text|".dylib"|#FFB100}}
                                            inlinelibname$ = {{Text|"lib"|#FFB100}} + x$ + {{Text|"."|#FFB100}} + libver$ + {{Text|".dylib"|#FFB100}}
                                            libname$ = {{Text|"./"|#FFB100}} + libname$: inlinelibname$ = {{Text|"./"|#FFB100}} + inlinelibname$
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"lib"|#FFB100}} + x$ + {{Text|".dylib"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                            libname$ = {{Text|"lib"|#FFB100}} + x$ + {{Text|".dylib"|#FFB100}}
                                            inlinelibname$ = {{Text|"lib"|#FFB100}} + x$ + {{Text|".dylib"|#FFB100}}
                                            libname$ = {{Text|"./"|#FFB100}} + libname$: inlinelibname$ = {{Text|"./"|#FFB100}} + inlinelibname$
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|'check for .so (direct)|#31C4C4}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$) {{Text|THEN|#F0F0F0}}
                                        libname$ = {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$
                                        inlinelibname$ = {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$
                                        libname$ = {{Text|"./"|#FFB100}} + libname$: inlinelibname$ = {{Text|"./"|#FFB100}} + inlinelibname$
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        libname$ = {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}
                                        inlinelibname$ = {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}
                                        libname$ = {{Text|"./"|#FFB100}} + libname$: inlinelibname$ = {{Text|"./"|#FFB100}} + inlinelibname$
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|'check for .so (usr/lib64)|#31C4C4}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/lib64/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$) {{Text|THEN|#F0F0F0}}
                                        libname$ = {{Text|"/usr/lib64/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$
                                        inlinelibname$ = {{Text|"/usr/lib64/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/lib64/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        libname$ = {{Text|"/usr/lib64/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}
                                        inlinelibname$ = {{Text|"/usr/lib64/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} MacOSX {{Text|THEN|#F0F0F0}} {{Text|'dylib support|#31C4C4}}
                                    {{Text|'check for .dylib (usr/lib)|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/lib/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|"."|#FFB100}} + libver$ + {{Text|".dylib"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                            libname$ = {{Text|"/usr/lib/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|"."|#FFB100}} + libver$ + {{Text|".dylib"|#FFB100}}
                                            inlinelibname$ = {{Text|"/usr/lib/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|"."|#FFB100}} + libver$ + {{Text|".dylib"|#FFB100}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/lib/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".dylib"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                            libname$ = {{Text|"/usr/lib/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".dylib"|#FFB100}}
                                            inlinelibname$ = {{Text|"/usr/lib/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".dylib"|#FFB100}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|'check for .so (usr/lib)|#31C4C4}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/lib/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$) {{Text|THEN|#F0F0F0}}
                                        libname$ = {{Text|"/usr/lib/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$
                                        inlinelibname$ = {{Text|"/usr/lib/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so."|#FFB100}} + libver$
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}({{Text|"/usr/lib/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                        libname$ = {{Text|"/usr/lib/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}
                                        inlinelibname$ = {{Text|"/usr/lib/"|#FFB100}} + {{Text|"lib"|#FFB100}} + x$ + {{Text|".so"|#FFB100}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'Linux|#31C4C4}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'Dynamic|#31C4C4}}
                        {{Text|'library found?|#31C4C4}}
                        {{Text|IF|#F0F0F0}} dynamiclibrary <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"DYNAMIC LIBRARY not found"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|LEN|#F0F0F0}}(headername$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"LIBRARY not found"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                        {{Text|'***actual method should cull redundant header and library entries***|#31C4C4}}
                        {{Text|IF|#F0F0F0}} dynamiclibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                            {{Text|'static|#31C4C4}}
                            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(libname$) {{Text|THEN|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} os$ = {{Text|"WIN"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|MID$|#F0F0F0}}(libname$, {{Text|2|#F580B1}}, {{Text|1|#F580B1}}) = {{Text|":"|#FFB100}} {{Text|OR|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(libname$, {{Text|1|#F580B1}}) = {{Text|"\"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                        mylib$ = mylib$ + {{Text|" "|#FFB100}} + libname$ + {{Text|" "|#FFB100}}
                                    {{Text|ELSE|#F0F0F0}}
                                        mylib$ = mylib$ + {{Text|" ..\..\"|#FFB100}} + libname$ + {{Text|" "|#FFB100}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} os$ = {{Text|"LNX"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(libname$, {{Text|1|#F580B1}}) = {{Text|"/"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                        mylib$ = mylib$ + {{Text|" "|#FFB100}} + libname$ + {{Text|" "|#FFB100}}
                                    {{Text|ELSE|#F0F0F0}}
                                        mylib$ = mylib$ + {{Text|" ../../"|#FFB100}} + libname$ + {{Text|" "|#FFB100}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|ELSE|#F0F0F0}}
                            {{Text|'dynamic|#31C4C4}}
                            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(headername$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'no header|#31C4C4}}
                                {{Text|IF|#F0F0F0}} subfuncn {{Text|THEN|#F0F0F0}}
                                    f = OpenBuffer%({{Text|"A"|#FFB100}}, tmpdir$ + {{Text|"maindata.txt"|#FFB100}})
                                {{Text|ELSE|#F0F0F0}}
                                    f = DataTxtBuf
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|'make name a C-appropriate variable name|#31C4C4}}
                                {{Text|'by converting everything except numbers and|#31C4C4}}
                                {{Text|'letters to underscores|#31C4C4}}
                                x2$ = x$
                                {{Text|FOR|#F0F0F0}} x2 = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|LEN|#F0F0F0}}(x2$)
                                    {{Text|IF|#F0F0F0}} {{Text|ASC|#F0F0F0}}(x2$, x2) < {{Text|48|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|ASC|#F0F0F0}}(x2$, x2) = {{Text|95|#F580B1}}
                                    {{Text|IF|#F0F0F0}} {{Text|ASC|#F0F0F0}}(x2$, x2) > {{Text|57|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|ASC|#F0F0F0}}(x2$, x2) < {{Text|65|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|ASC|#F0F0F0}}(x2$, x2) = {{Text|95|#F580B1}}
                                    {{Text|IF|#F0F0F0}} {{Text|ASC|#F0F0F0}}(x2$, x2) > {{Text|90|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|ASC|#F0F0F0}}(x2$, x2) < {{Text|97|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|ASC|#F0F0F0}}(x2$, x2) = {{Text|95|#F580B1}}
                                    {{Text|IF|#F0F0F0}} {{Text|ASC|#F0F0F0}}(x2$, x2) > {{Text|122|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|ASC|#F0F0F0}}(x2$, x2) = {{Text|95|#F580B1}}
                                {{Text|NEXT|#F0F0F0}}
                                DLLname$ = x2$
                                {{Text|IF|#F0F0F0}} sfdeclare {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} os$ = {{Text|"WIN"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                        WriteBufLine RegTxtBuf, {{Text|"HINSTANCE DLL_"|#FFB100}} + x2$ + {{Text|"=NULL;"|#FFB100}}
                                        WriteBufLine f, {{Text|"if (!DLL_"|#FFB100}} + x2$ + {{Text|"){"|#FFB100}}
                                        WriteBufLine f, {{Text|"DLL_"|#FFB100}} + x2$ + {{Text|"=LoadLibrary("|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + inlinelibname$ + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|");"|#FFB100}}
                                        WriteBufLine f, {{Text|"if (!DLL_"|#FFB100}} + x2$ + {{Text|") error(259);"|#FFB100}}
                                        WriteBufLine f, {{Text|"}"|#FFB100}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} os$ = {{Text|"LNX"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                        WriteBufLine RegTxtBuf, {{Text|"void *DLL_"|#FFB100}} + x2$ + {{Text|"=NULL;"|#FFB100}}
                                        WriteBufLine f, {{Text|"if (!DLL_"|#FFB100}} + x2$ + {{Text|"){"|#FFB100}}
                                        WriteBufLine f, {{Text|"DLL_"|#FFB100}} + x2$ + {{Text|"=dlopen("|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + inlinelibname$ + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|",RTLD_LAZY);"|#FFB100}}
                                        WriteBufLine f, {{Text|"if (!DLL_"|#FFB100}} + x2$ + {{Text|") error(259);"|#FFB100}}
                                        WriteBufLine f, {{Text|"}"|#FFB100}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'no header|#31C4C4}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'dynamiclibrary|#31C4C4}}
                        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(headername$) {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} (os$ = {{Text|"WIN"|#FFB100}} {{Text|AND|#F0F0F0}} ({{Text|MID$|#F0F0F0}}(headername$, {{Text|2|#F580B1}}, {{Text|1|#F580B1}}) = {{Text|":"|#FFB100}} {{Text|OR|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(headername$, {{Text|1|#F580B1}}) = {{Text|"\"|#FFB100}})) _
                            {{Text|OR|#F0F0F0}} (os$ = {{Text|"LNX"|#FFB100}} {{Text|AND|#F0F0F0}} ({{Text|LEFT$|#F0F0F0}}(headername$, {{Text|1|#F580B1}}) = {{Text|"/"|#FFB100}})) {{Text|THEN|#F0F0F0}}
                                WriteBufLine RegTxtBuf, {{Text|"#include "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + headername$ + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}})
                            {{Text|ELSE|#F0F0F0}}
                                WriteBufLine RegTxtBuf, {{Text|"#include "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"../../"|#FFB100}} + headername$ + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}})
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    l$ = l$ + sp + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + autoformat_x$ + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}})
                    {{Text|IF|#F0F0F0}} n > x {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} dynamiclibrary {{Text|THEN|#F0F0F0}} a$ = {{Text|"Cannot specify multiple DYNAMIC LIBRARY names in a single DECLARE statement"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                        x = x + {{Text|1|#F580B1}}: x2$ = getelement$(a$, x): {{Text|IF|#F0F0F0}} x2$ <> {{Text|","|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ,"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                        l$ = l$ + sp2 + {{Text|","|#FFB100}}
                        x = x + {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} x > n {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected , ..."|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                        {{Text|GOTO|#F0F0F0}} addlibrary
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'n>=x|#31C4C4}}
                layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                {{Text|GOTO|#F0F0F0}} finishednonexec
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|GOTO|#F0F0F0}} finishednonexec {{Text|'note: no layout required|#31C4C4}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'begin SUB/FUNCTION|#31C4C4}}
    {{Text|IF|#F0F0F0}} n >= {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        dynamiclibrary = {{Text|0|#F580B1}}
        declaresubfunc2:
        sf = {{Text|0|#F580B1}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"FUNCTION"|#FFB100}} {{Text|THEN|#F0F0F0}} sf = {{Text|1|#F580B1}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"SUB"|#FFB100}} {{Text|THEN|#F0F0F0}} sf = {{Text|2|#F580B1}}
        {{Text|IF|#F0F0F0}} sf {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} declaringlibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(subfunc) {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected END SUB/FUNCTION before "|#FFB100}} + firstelement$: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} n = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected name after SUB/FUNCTION"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            e$ = getelement$(ca$, {{Text|2|#F580B1}})
            symbol$ = removesymbol$(e$) {{Text|'$,%,etc.|#31C4C4}}
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} sf = {{Text|2|#F580B1}} {{Text|AND|#F0F0F0}} symbol$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Type symbols after a SUB name are invalid"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            try = findid(e$)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
                {{Text|IF|#F0F0F0}} id.subfunc = sf {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} createsf
                {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(e$) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|LOOP|#F0F0F0}}
            a$ = {{Text|"Unregistered SUB/FUNCTION encountered"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            createsf:
            {{Text|IF|#F0F0F0}} {{Text|UCASE$|#F0F0F0}}(e$) = {{Text|"_GL"|#FFB100}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"_GL"|#FFB100}}
            {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"SUB"|#FFB100}} {{Text|THEN|#F0F0F0}}
                l$ = SCase$({{Text|"Sub"|#FFB100}}) + sp + e$ + symbol$
            {{Text|ELSE|#F0F0F0}}
                l$ = SCase$({{Text|"Function"|#FFB100}}) + sp + e$ + symbol$
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            id2 = id
            targetid = currentid
            {{Text|'check for ALIAS|#31C4C4}}
            aliasname$ = {{Text|RTRIM$|#F0F0F0}}(id.cn)
            {{Text|IF|#F0F0F0}} n > {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                ee$ = getelement$(a$, {{Text|3|#F580B1}})
                {{Text|IF|#F0F0F0}} ee$ = {{Text|"ALIAS"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} declaringlibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"ALIAS can only be used with DECLARE LIBRARY"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|IF|#F0F0F0}} n = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ALIAS name-in-library"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    ee$ = getelement$(ca$, {{Text|4|#F580B1}})
                    {{Text|'strip string content (optional)|#31C4C4}}
                    {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(ee$, {{Text|1|#F580B1}}) = {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) {{Text|THEN|#F0F0F0}}
                        ee$ = {{Text|RIGHT$|#F0F0F0}}(ee$, {{Text|LEN|#F0F0F0}}(ee$) - {{Text|1|#F580B1}})
                        x = {{Text|INSTR|#F0F0F0}}(ee$, {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}})): {{Text|IF|#F0F0F0}} x = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}): {{Text|GOTO|#F0F0F0}} errmes
                        ee$ = {{Text|LEFT$|#F0F0F0}}(ee$, x - {{Text|1|#F580B1}})
                        l$ = l$ + sp + SCase$({{Text|"Alias"|#FFB100}}) + sp + CHR_QUOTE + ee$ + CHR_QUOTE
                    {{Text|ELSE|#F0F0F0}}
                        l$ = l$ + sp + SCase$({{Text|"Alias"|#FFB100}}) + sp + ee$
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|'strip fix046$ (created by unquoted periods)|#31C4C4}}
                    {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(ee$, fix046$)
                        x = {{Text|INSTR|#F0F0F0}}(ee$, fix046$): ee$ = {{Text|LEFT$|#F0F0F0}}(ee$, x - {{Text|1|#F580B1}}) + {{Text|"."|#FFB100}} + {{Text|RIGHT$|#F0F0F0}}(ee$, {{Text|LEN|#F0F0F0}}(ee$) - x + {{Text|1|#F580B1}} - {{Text|LEN|#F0F0F0}}(fix046$))
                    {{Text|LOOP|#F0F0F0}}
                    aliasname$ = ee$
                    {{Text|'remove ALIAS section from line|#31C4C4}}
                    {{Text|IF|#F0F0F0}} n <= {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = getelements(a$, {{Text|1|#F580B1}}, {{Text|2|#F580B1}})
                    {{Text|IF|#F0F0F0}} n >= {{Text|5|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = getelements(a$, {{Text|1|#F580B1}}, {{Text|2|#F580B1}}) + sp + getelements(a$, {{Text|5|#F580B1}}, n)
                    {{Text|IF|#F0F0F0}} n <= {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} ca$ = getelements(ca$, {{Text|1|#F580B1}}, {{Text|2|#F580B1}})
                    {{Text|IF|#F0F0F0}} n >= {{Text|5|#F580B1}} {{Text|THEN|#F0F0F0}} ca$ = getelements(ca$, {{Text|1|#F580B1}}, {{Text|2|#F580B1}}) + sp + getelements(ca$, {{Text|5|#F580B1}}, n)
                    n = n - {{Text|2|#F580B1}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} declaringlibrary {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} declibjmp1
            {{Text|IF|#F0F0F0}} closedmain = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} closemain
            {{Text|'check for open controls (copy #2)|#31C4C4}}
            {{Text|IF|#F0F0F0}} controllevel <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} controltype(controllevel) <> {{Text|6|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'It's OK for subs to be inside $IF blocks|#31C4C4}}
                a$ = {{Text|"Unidentified open control block"|#FFB100}}
                {{Text|SELECT|#F0F0F0}} {{Text|CASE|#F0F0F0}} controltype(controllevel)
                    {{Text|CASE|#F0F0F0}} {{Text|1|#F580B1}}: a$ = {{Text|"IF without END IF"|#FFB100}}
                    {{Text|CASE|#F0F0F0}} {{Text|2|#F580B1}}: a$ = {{Text|"FOR without NEXT"|#FFB100}}
                    {{Text|CASE|#F0F0F0}} {{Text|3|#F580B1}}, {{Text|4|#F580B1}}: a$ = {{Text|"DO without LOOP"|#FFB100}}
                    {{Text|CASE|#F0F0F0}} {{Text|5|#F580B1}}: a$ = {{Text|"WHILE without WEND"|#FFB100}}
                    {{Text|CASE|#F0F0F0}} {{Text|10|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|19|#F580B1}}: a$ = {{Text|"SELECT CASE without END SELECT"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|SELECT|#F0F0F0}}
                linenumber = controlref(controllevel)
                {{Text|GOTO|#F0F0F0}} errmes
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} ideindentsubs {{Text|THEN|#F0F0F0}}
                controllevel = controllevel + {{Text|1|#F580B1}}
                controltype(controllevel) = {{Text|32|#F580B1}}
                controlref(controllevel) = linenumber
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            subfunc = {{Text|RTRIM$|#F0F0F0}}(id.callname) {{Text|'SUB_..."|#31C4C4}}
            {{Text|IF|#F0F0F0}} id.subfunc = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} subfuncoriginalname$ = {{Text|"FUNCTION "|#FFB100}} {{Text|ELSE|#F0F0F0}} subfuncoriginalname$ = {{Text|"SUB "|#FFB100}}
            subfuncoriginalname$ = subfuncoriginalname$ + {{Text|RTRIM$|#F0F0F0}}(id.cn)
            subfuncn = subfuncn + {{Text|1|#F580B1}}
            closedsubfunc = {{Text|0|#F580B1}}
            subfuncid = targetid
            subfuncret$ = {{Text|""|#FFB100}}
            DataTxtBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + {{Text|"data"|#FFB100}} + str2$(subfuncn) + {{Text|".txt"|#FFB100}})
            FreeTxtBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + {{Text|"free"|#FFB100}} + str2$(subfuncn) + {{Text|".txt"|#FFB100}})
            RetTxtBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + {{Text|"ret"|#FFB100}} + str2$(subfuncn) + {{Text|".txt"|#FFB100}})
            defdatahandle = DataTxtBuf
            WriteBufLine RetTxtBuf, {{Text|"if (next_return_point){"|#FFB100}}
            WriteBufLine RetTxtBuf, {{Text|"next_return_point--;"|#FFB100}}
            WriteBufLine RetTxtBuf, {{Text|"switch(return_point[next_return_point]){"|#FFB100}}
            WriteBufLine RetTxtBuf, {{Text|"case 0:"|#FFB100}}
            WriteBufLine RetTxtBuf, {{Text|"error(3);"|#FFB100}} {{Text|'return without gosub!|#31C4C4}}
            WriteBufLine RetTxtBuf, {{Text|"break;"|#FFB100}}
            declibjmp1:
            {{Text|IF|#F0F0F0}} declaringlibrary {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} sfdeclare = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} indirectlibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    RegTxtBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + {{Text|"regsf_ignore.txt"|#FFB100}})
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} sfdeclare = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} customtypelibrary = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} dynamiclibrary = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} indirectlibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    WriteBufLine RegTxtBuf, {{Text|"#include "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"externtype"|#FFB100}} + str2(ResolveStaticFunctions + {{Text|1|#F580B1}}) + {{Text|".txt"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}})
                    fh = {{Text|FREEFILE|#F0F0F0}}: {{Text|OPEN|#F0F0F0}} tmpdir$ + {{Text|"externtype"|#FFB100}} + str2(ResolveStaticFunctions + {{Text|1|#F580B1}}) + {{Text|".txt"|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|OUTPUT|#F0F0F0}} {{Text|AS|#F0F0F0}} #fh: {{Text|CLOSE|#F0F0F0}} #fh
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} sf = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                rettyp = id.ret
                t$ = typ2ctyp$(id.ret, {{Text|""|#FFB100}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} t$ = {{Text|"qbs"|#FFB100}} {{Text|THEN|#F0F0F0}} t$ = {{Text|"qbs*"|#FFB100}}
                {{Text|IF|#F0F0F0}} declaringlibrary {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} rettyp {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
                        t$ = {{Text|"char*"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} declaringlibrary <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} dynamiclibrary <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} os$ = {{Text|"WIN"|#FFB100}} {{Text|THEN|#F0F0F0}}
                        WriteBufRawData RegTxtBuf, {{Text|"typedef "|#FFB100}} + t$ + {{Text|" (CALLBACK* DLLCALL_"|#FFB100}} + removecast$({{Text|RTRIM$|#F0F0F0}}(id.callname)) + {{Text|")("|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} os$ = {{Text|"LNX"|#FFB100}} {{Text|THEN|#F0F0F0}}
                        WriteBufRawData RegTxtBuf, {{Text|"typedef "|#FFB100}} + t$ + {{Text|" (*DLLCALL_"|#FFB100}} + removecast$({{Text|RTRIM$|#F0F0F0}}(id.callname)) + {{Text|")("|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|ELSEIF|#F0F0F0}} declaringlibrary <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} customtypelibrary <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    WriteBufRawData RegTxtBuf, {{Text|"typedef "|#FFB100}} + t$ + {{Text|" CUSTOMCALL_"|#FFB100}} + removecast$({{Text|RTRIM$|#F0F0F0}}(id.callname)) + {{Text|"("|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    WriteBufRawData RegTxtBuf, t$ + {{Text|" "|#FFB100}} + removecast$({{Text|RTRIM$|#F0F0F0}}(id.callname)) + {{Text|"("|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} declaringlibrary {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} declibjmp2
                WriteBufRawData MainTxtBuf, t$ + {{Text|" "|#FFB100}} + removecast$({{Text|RTRIM$|#F0F0F0}}(id.callname)) + {{Text|"("|#FFB100}}
                {{Text|'create variable to return result|#31C4C4}}
                {{Text|'if type wasn't specified, define it|#31C4C4}}
                {{Text|IF|#F0F0F0}} symbol$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
                    a = {{Text|ASC|#F0F0F0}}({{Text|UCASE$|#F0F0F0}}(e$)): {{Text|IF|#F0F0F0}} a = {{Text|95|#F580B1}} {{Text|THEN|#F0F0F0}} a = {{Text|91|#F580B1}}
                    a = a - {{Text|64|#F580B1}} {{Text|'so A=1, Z=27 and _=28|#31C4C4}}
                    symbol$ = defineextaz(a)
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                reginternalvariable = {{Text|1|#F580B1}}
                ignore = dim2(e$, symbol$, {{Text|0|#F580B1}}, {{Text|""|#FFB100}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                reginternalvariable = {{Text|0|#F580B1}}
                {{Text|'the following line stops the return variable from being free'd before being returned|#31C4C4}}
                FreeTxtBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + {{Text|"free"|#FFB100}} + str2$(subfuncn) + {{Text|".txt"|#FFB100}})
                {{Text|'create return|#31C4C4}}
                {{Text|IF|#F0F0F0}} (rettyp {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}}
                    r$ = refer$(str2$(currentid), id.t, {{Text|1|#F580B1}})
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    subfuncret$ = subfuncret$ + {{Text|"qbs_maketmp("|#FFB100}} + r$ + {{Text|");"|#FFB100}}
                    subfuncret$ = subfuncret$ + {{Text|"return "|#FFB100}} + r$ + {{Text|";"|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    r$ = refer$(str2$(currentid), id.t, {{Text|0|#F580B1}})
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    subfuncret$ = {{Text|"return "|#FFB100}} + r$ + {{Text|";"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|ELSE|#F0F0F0}}
                {{Text|IF|#F0F0F0}} declaringlibrary <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} dynamiclibrary <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} os$ = {{Text|"WIN"|#FFB100}} {{Text|THEN|#F0F0F0}}
                        WriteBufRawData RegTxtBuf, {{Text|"typedef void (CALLBACK* DLLCALL_"|#FFB100}} + removecast$({{Text|RTRIM$|#F0F0F0}}(id.callname)) + {{Text|")("|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} os$ = {{Text|"LNX"|#FFB100}} {{Text|THEN|#F0F0F0}}
                        WriteBufRawData RegTxtBuf, {{Text|"typedef void (*DLLCALL_"|#FFB100}} + removecast$({{Text|RTRIM$|#F0F0F0}}(id.callname)) + {{Text|")("|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|ELSEIF|#F0F0F0}} declaringlibrary <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} customtypelibrary <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    WriteBufRawData RegTxtBuf, {{Text|"typedef void CUSTOMCALL_"|#FFB100}} + removecast$({{Text|RTRIM$|#F0F0F0}}(id.callname)) + {{Text|"("|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    WriteBufRawData RegTxtBuf, {{Text|"void "|#FFB100}} + removecast$({{Text|RTRIM$|#F0F0F0}}(id.callname)) + {{Text|"("|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} declaringlibrary {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} declibjmp2
                WriteBufRawData MainTxtBuf, {{Text|"void "|#FFB100}} + removecast$({{Text|RTRIM$|#F0F0F0}}(id.callname)) + {{Text|"("|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            declibjmp2:
            addstatic2layout = {{Text|0|#F580B1}}
            staticsf = {{Text|0|#F580B1}}
            e$ = getelement$(a$, n)
            {{Text|IF|#F0F0F0}} e$ = {{Text|"STATIC"|#FFB100}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} declaringlibrary {{Text|THEN|#F0F0F0}} a$ = {{Text|"STATIC cannot be used in a library declaration"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                addstatic2layout = {{Text|1|#F580B1}}
                staticsf = {{Text|2|#F580B1}}
                a$ = {{Text|LEFT$|#F0F0F0}}(a$, {{Text|LEN|#F0F0F0}}(a$) - {{Text|7|#F580B1}}): n = n - {{Text|1|#F580B1}} {{Text|'remove STATIC|#31C4C4}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'check items to pass|#31C4C4}}
            params = {{Text|0|#F580B1}}
            AllowLocalName = {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} n > {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                e$ = getelement$(a$, {{Text|3|#F580B1}})
                {{Text|IF|#F0F0F0}} e$ <> {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ("|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                e$ = getelement$(a$, n)
                {{Text|IF|#F0F0F0}} e$ <> {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected )"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                l$ = l$ + sp + {{Text|"("|#FFB100}}
                {{Text|IF|#F0F0F0}} n = {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} nosfparams2
                {{Text|IF|#F0F0F0}} n < {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ( ... )"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                B = {{Text|0|#F580B1}}
                a2$ = {{Text|""|#FFB100}}
                {{Text|FOR|#F0F0F0}} i = {{Text|4|#F580B1}} {{Text|TO|#F0F0F0}} n - {{Text|1|#F580B1}}
                    e$ = getelement$(ca$, i)
                    {{Text|IF|#F0F0F0}} e$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} B = B + {{Text|1|#F580B1}}
                    {{Text|IF|#F0F0F0}} e$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} B = B - {{Text|1|#F580B1}}
                    {{Text|IF|#F0F0F0}} e$ = {{Text|","|#FFB100}} {{Text|AND|#F0F0F0}} B = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} i = n - {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected , ... )"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                        getlastparam2:
                        {{Text|IF|#F0F0F0}} a2$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ... ,"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                        a2$ = {{Text|LEFT$|#F0F0F0}}(a2$, {{Text|LEN|#F0F0F0}}(a2$) - {{Text|1|#F580B1}})
                        {{Text|'possible format: [BYVAL]a[%][(1)][AS][type]|#31C4C4}}
                        params = params + {{Text|1|#F580B1}}
                        glinkid = targetid
                        glinkarg = params
                        {{Text|IF|#F0F0F0}} params > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                            WriteBufRawData RegTxtBuf, {{Text|","|#FFB100}}
                            {{Text|IF|#F0F0F0}} declaringlibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                WriteBufRawData MainTxtBuf, {{Text|","|#FFB100}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        n2 = numelements(a2$)
                        array = {{Text|0|#F580B1}}
                        t2$ = {{Text|""|#FFB100}}
                        e$ = getelement$(a2$, {{Text|1|#F580B1}})
                        byvalue = {{Text|0|#F580B1}}
                        {{Text|IF|#F0F0F0}} {{Text|UCASE$|#F0F0F0}}(e$) = {{Text|"BYVAL"|#FFB100}} {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} declaringlibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"BYVAL can only be used with DECLARE LIBRARY"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                            byvalue = {{Text|1|#F580B1}}: a2$ = {{Text|RIGHT$|#F0F0F0}}(a2$, {{Text|LEN|#F0F0F0}}(a2$) - {{Text|6|#F580B1}})
                            {{Text|IF|#F0F0F0}} {{Text|RIGHT$|#F0F0F0}}(l$, {{Text|1|#F580B1}}) = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} l$ = l$ + sp2 + SCase$({{Text|"ByVal"|#FFB100}}) {{Text|ELSE|#F0F0F0}} l$ = l$ + sp + SCase$({{Text|"Byval"|#FFB100}})
                            n2 = numelements(a2$): e$ = getelement$(a2$, {{Text|1|#F580B1}})
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} {{Text|RIGHT$|#F0F0F0}}(l$, {{Text|1|#F580B1}}) = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} l$ = l$ + sp2 + e$ {{Text|ELSE|#F0F0F0}} l$ = l$ + sp + e$
                        n2$ = e$
                        dimmethod = {{Text|0|#F580B1}}
                        symbol2$ = removesymbol$(n2$)
                        {{Text|IF|#F0F0F0}} validname(n2$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Invalid name"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                        {{Text|IF|#F0F0F0}} symbol2$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} dimmethod = {{Text|1|#F580B1}}
                        m = {{Text|0|#F580B1}}
                        {{Text|FOR|#F0F0F0}} i2 = {{Text|2|#F580B1}} {{Text|TO|#F0F0F0}} n2
                            e$ = getelement$(a2$, i2)
                            {{Text|IF|#F0F0F0}} e$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} m <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Syntax error - too many opening brackets"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                m = {{Text|1|#F580B1}}
                                array = {{Text|1|#F580B1}}
                                l$ = l$ + sp2 + {{Text|"("|#FFB100}}
                                {{Text|GOTO|#F0F0F0}} gotaa2
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} e$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} m <> {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Syntax error - closing bracket without opening bracket"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                m = {{Text|2|#F580B1}}
                                l$ = l$ + sp2 + {{Text|")"|#FFB100}}
                                {{Text|GOTO|#F0F0F0}} gotaa2
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} {{Text|UCASE$|#F0F0F0}}(e$) = {{Text|"AS"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} m <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} m <> {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Syntax error - check your brackets"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                m = {{Text|3|#F580B1}}
                                l$ = l$ + sp + SCase$({{Text|"As"|#FFB100}})
                                {{Text|GOTO|#F0F0F0}} gotaa2
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} m = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} l$ = l$ + sp + e$: {{Text|GOTO|#F0F0F0}} gotaa2 {{Text|'ignore contents of option bracket telling how many dimensions (add to layout as is)|#31C4C4}}
                            {{Text|IF|#F0F0F0}} m <> {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Syntax error - check your brackets"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|IF|#F0F0F0}} t2$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} t2$ = e$ {{Text|ELSE|#F0F0F0}} t2$ = t2$ + {{Text|" "|#FFB100}} + e$
                            gotaa2:
                        {{Text|NEXT|#F0F0F0}} i2
                        {{Text|IF|#F0F0F0}} m = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Syntax error - check your brackets"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                        {{Text|IF|#F0F0F0}} symbol2$ <> {{Text|""|#FFB100}} {{Text|AND|#F0F0F0}} t2$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Syntax error - check parameter types"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(t2$) {{Text|THEN|#F0F0F0}} {{Text|'add type-name after AS|#31C4C4}}
                            t2$ = {{Text|UCASE$|#F0F0F0}}(t2$)
                            t3$ = t2$
                            typ = typname2typ(t3$)
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|IF|#F0F0F0}} typ = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Undefined type"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|IF|#F0F0F0}} typ {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(udtxcname(typ {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}})) = {{Text|"_MEM"|#FFB100}} {{Text|AND|#F0F0F0}} {{Text|UCASE$|#F0F0F0}}(t3$) = {{Text|"MEM"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    t3$ = {{Text|MID$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(udtxcname(typ {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}})), {{Text|2|#F580B1}})
                                {{Text|ELSE|#F0F0F0}}
                                    t3$ = {{Text|RTRIM$|#F0F0F0}}(udtxcname(typ {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}))
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                l$ = l$ + sp + t3$
                            {{Text|ELSE|#F0F0F0}}
                                {{Text|FOR|#F0F0F0}} t3i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|LEN|#F0F0F0}}(t3$)
                                    {{Text|IF|#F0F0F0}} {{Text|ASC|#F0F0F0}}(t3$, t3i) = {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|ASC|#F0F0F0}}(t3$, t3i) = {{Text|ASC|#F0F0F0}}(sp)
                                {{Text|NEXT|#F0F0F0}}
                                t3$ = SCase2$(t3$)
                                l$ = l$ + sp + t3$
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} t2$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} t2$ = symbol2$
                        {{Text|IF|#F0F0F0}} t2$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(n2$, {{Text|1|#F580B1}}) = {{Text|"_"|#FFB100}} {{Text|THEN|#F0F0F0}} v = {{Text|27|#F580B1}} {{Text|ELSE|#F0F0F0}} v = {{Text|ASC|#F0F0F0}}({{Text|UCASE$|#F0F0F0}}(n2$)) - {{Text|64|#F580B1}}
                            t2$ = defineaz(v)
                            dimmethod = {{Text|1|#F580B1}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} array = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} declaringlibrary {{Text|THEN|#F0F0F0}} a$ = {{Text|"Arrays cannot be passed to a library"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                            dimsfarray = {{Text|1|#F580B1}}
                            {{Text|'note: id2.nele is currently 0|#31C4C4}}
                            nelereq = {{Text|ASC|#F0F0F0}}({{Text|MID$|#F0F0F0}}(id2.nelereq, params, {{Text|1|#F580B1}}))
                            {{Text|IF|#F0F0F0}} nelereq {{Text|THEN|#F0F0F0}}
                                nele = nelereq
                                {{Text|MID$|#F0F0F0}}(id2.nele, params, {{Text|1|#F580B1}}) = {{Text|CHR$|#F0F0F0}}(nele)
                                ids(targetid) = id2
                                ignore = dim2(n2$, t2$, dimmethod, str2$(nele))
                                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|ELSE|#F0F0F0}}
                                nele = {{Text|1|#F580B1}}
                                {{Text|MID$|#F0F0F0}}(id2.nele, params, {{Text|1|#F580B1}}) = {{Text|CHR$|#F0F0F0}}(nele)
                                ids(targetid) = id2
                                ignore = dim2(n2$, t2$, dimmethod, {{Text|"?"|#FFB100}})
                                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            dimsfarray = {{Text|0|#F580B1}}
                            r$ = refer$(str2$(currentid), id.t, {{Text|1|#F580B1}})
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            WriteBufRawData RegTxtBuf, {{Text|"ptrszint*"|#FFB100}} + r$
                            WriteBufRawData MainTxtBuf, {{Text|"ptrszint*"|#FFB100}} + r$
                        {{Text|ELSE|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} declaringlibrary {{Text|THEN|#F0F0F0}}
                                {{Text|'is it a udt?|#31C4C4}}
                                {{Text|FOR|#F0F0F0}} xx = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} lasttype
                                    {{Text|IF|#F0F0F0}} t2$ = {{Text|RTRIM$|#F0F0F0}}(udtxname(xx)) {{Text|THEN|#F0F0F0}}
                                        WriteBufLine RegTxtBuf, {{Text|"void*"|#FFB100}}
                                        {{Text|GOTO|#F0F0F0}} decudt
                                    {{Text|ELSEIF|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(udtxname(xx)) = {{Text|"_MEM"|#FFB100}} {{Text|AND|#F0F0F0}} t2$ = {{Text|"MEM"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        WriteBufLine RegTxtBuf, {{Text|"void*"|#FFB100}}
                                        {{Text|GOTO|#F0F0F0}} decudt
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|NEXT|#F0F0F0}}
                                t$ = typ2ctyp$({{Text|0|#F580B1}}, t2$)
                                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                {{Text|IF|#F0F0F0}} t$ = {{Text|"qbs"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                    t$ = {{Text|"char*"|#FFB100}}
                                    {{Text|IF|#F0F0F0}} byvalue = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"STRINGs cannot be passed using BYVAL"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                    byvalue = {{Text|1|#F580B1}} {{Text|'use t$ as is|#31C4C4}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} byvalue {{Text|THEN|#F0F0F0}} WriteBufRawData RegTxtBuf, t$ {{Text|ELSE|#F0F0F0}} WriteBufRawData RegTxtBuf, t$ + {{Text|"*"|#FFB100}}
                                decudt:
                                {{Text|GOTO|#F0F0F0}} declibjmp3
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            dimsfarray = {{Text|1|#F580B1}}
                            ignore = dim2(n2$, t2$, dimmethod, {{Text|""|#FFB100}})
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            dimsfarray = {{Text|0|#F580B1}}
                            t$ = {{Text|""|#FFB100}}
                            typ = id.t {{Text|'the typ of the ID created by dim2|#31C4C4}}
                            t$ = typ2ctyp$(typ, {{Text|""|#FFB100}})
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|IF|#F0F0F0}} t$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Cannot find C type to return array data"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|'searchpoint|#31C4C4}}
                            {{Text|'get the name of the variable|#31C4C4}}
                            r$ = refer$(str2$(currentid), id.t, {{Text|1|#F580B1}})
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            WriteBufRawData RegTxtBuf, t$ + {{Text|"*"|#FFB100}} + r$
                            WriteBufRawData MainTxtBuf, t$ + {{Text|"*"|#FFB100}} + r$
                            {{Text|IF|#F0F0F0}} t$ = {{Text|"qbs"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                u$ = str2$(uniquenumber)
                                WriteBufLine DataTxtBuf, {{Text|"qbs*oldstr"|#FFB100}} + u$ + {{Text|"=NULL;"|#FFB100}}
                                WriteBufLine DataTxtBuf, {{Text|"if("|#FFB100}} + r$ + {{Text|"->tmp¦¦"|#FFB100}} + r$ + {{Text|"->fixed¦¦"|#FFB100}} + r$ + {{Text|"->readonly){"|#FFB100}}
                                WriteBufLine DataTxtBuf, {{Text|"oldstr"|#FFB100}} + u$ + {{Text|"="|#FFB100}} + r$ + {{Text|";"|#FFB100}}
                                WriteBufLine DataTxtBuf, {{Text|"if (oldstr"|#FFB100}} + u$ + {{Text|"->cmem_descriptor){"|#FFB100}}
                                WriteBufLine DataTxtBuf, r$ + {{Text|"=qbs_new_cmem(oldstr"|#FFB100}} + u$ + {{Text|"->len,0);"|#FFB100}}
                                WriteBufLine DataTxtBuf, {{Text|"}else{"|#FFB100}}
                                WriteBufLine DataTxtBuf, r$ + {{Text|"=qbs_new(oldstr"|#FFB100}} + u$ + {{Text|"->len,0);"|#FFB100}}
                                WriteBufLine DataTxtBuf, {{Text|"}"|#FFB100}}
                                WriteBufLine DataTxtBuf, {{Text|"memcpy("|#FFB100}} + r$ + {{Text|"->chr,oldstr"|#FFB100}} + u$ + {{Text|"->chr,oldstr"|#FFB100}} + u$ + {{Text|"->len);"|#FFB100}}
                                WriteBufLine DataTxtBuf, {{Text|"}"|#FFB100}}
                                WriteBufLine FreeTxtBuf, {{Text|"if(oldstr"|#FFB100}} + u$ + {{Text|"){"|#FFB100}}
                                WriteBufLine FreeTxtBuf, {{Text|"if(oldstr"|#FFB100}} + u$ + {{Text|"->fixed)qbs_set(oldstr"|#FFB100}} + u$ + {{Text|","|#FFB100}} + r$ + {{Text|");"|#FFB100}}
                                WriteBufLine FreeTxtBuf, {{Text|"qbs_free("|#FFB100}} + r$ + {{Text|");"|#FFB100}}
                                WriteBufLine FreeTxtBuf, {{Text|"}"|#FFB100}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        declibjmp3:
                        {{Text|IF|#F0F0F0}} i <> n - {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} l$ = l$ + sp2 + {{Text|","|#FFB100}}
                        a2$ = {{Text|""|#FFB100}}
                    {{Text|ELSE|#F0F0F0}}
                        a2$ = a2$ + e$ + sp
                        {{Text|IF|#F0F0F0}} i = n - {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} getlastparam2
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|NEXT|#F0F0F0}} i
                nosfparams2:
                l$ = l$ + sp2 + {{Text|")"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'n>2|#31C4C4}}
            AllowLocalName = {{Text|0|#F580B1}}
            {{Text|IF|#F0F0F0}} addstatic2layout {{Text|THEN|#F0F0F0}} l$ = l$ + sp + SCase$({{Text|"Static"|#FFB100}})
            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
            WriteBufLine RegTxtBuf, {{Text|");"|#FFB100}}
            {{Text|IF|#F0F0F0}} declaringlibrary {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} declibjmp4
            WriteBufLine MainTxtBuf, {{Text|"){"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"qbs *tqbs;"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"ptrszint tmp_long;"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"int32 tmp_fileno;"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"uint32 qbs_tmp_base=qbs_tmp_list_nexti;"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"uint8 *tmp_mem_static_pointer=mem_static_pointer;"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"uint32 tmp_cmem_sp=cmem_sp;"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"#include "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"data"|#FFB100}} + str2$(subfuncn) + {{Text|".txt"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}})
            {{Text|'create new _MEM lock for this scope|#31C4C4}}
            WriteBufLine MainTxtBuf, {{Text|"mem_lock *sf_mem_lock;"|#FFB100}} {{Text|'MUST not be static for recursion reasons|#31C4C4}}
            WriteBufLine MainTxtBuf, {{Text|"new_mem_lock();"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"sf_mem_lock=mem_lock_tmp;"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"sf_mem_lock->type=3;"|#FFB100}}
            {{Text|IF|#F0F0F0}} vWatchOn = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                WriteBufLine MainTxtBuf, {{Text|"*__LONG_VWATCH_SUBLEVEL=*__LONG_VWATCH_SUBLEVEL+ 1 ;"|#FFB100}}
                {{Text|IF|#F0F0F0}} subfunc <> {{Text|"SUB_VWATCH"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    inclinenump$ = {{Text|""|#FFB100}}
                    {{Text|IF|#F0F0F0}} inclinenumber(inclevel) {{Text|THEN|#F0F0F0}}
                        thisincname$ = getfilepath$(incname$(inclevel))
                        thisincname$ = {{Text|MID$|#F0F0F0}}(incname$(inclevel), {{Text|LEN|#F0F0F0}}(thisincname$) + {{Text|1|#F580B1}})
                        inclinenump$ = {{Text|"("|#FFB100}} + thisincname$ + {{Text|","|#FFB100}} + {{Text|STR$|#F0F0F0}}(inclinenumber(inclevel)) + {{Text|") "|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    WriteBufLine MainTxtBuf, {{Text|"qbs_set(__STRING_VWATCH_SUBNAME,qbs_new_txt_len("|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + inclinenump$ + subfuncoriginalname$ + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|","|#FFB100}} + str2$({{Text|LEN|#F0F0F0}}(inclinenump$ + subfuncoriginalname$)) + {{Text|"));"|#FFB100}}
                    WriteBufLine MainTxtBuf, {{Text|"qbs_cleanup(qbs_tmp_base,0);"|#FFB100}}
                    WriteBufLine MainTxtBuf, {{Text|"qbs_set(__STRING_VWATCH_INTERNALSUBNAME,qbs_new_txt_len("|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + subfunc + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|","|#FFB100}} + str2$({{Text|LEN|#F0F0F0}}(subfunc)) + {{Text|"));"|#FFB100}}
                    WriteBufLine MainTxtBuf, {{Text|"qbs_cleanup(qbs_tmp_base,0);"|#FFB100}}
                    WriteBufLine MainTxtBuf, {{Text|"*__LONG_VWATCH_LINENUMBER=-2; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            WriteBufLine MainTxtBuf, {{Text|"if (new_error) goto exit_subfunc;"|#FFB100}}
            {{Text|'statementn = statementn + 1|#31C4C4}}
            {{Text|'if nochecks=0 then WriteBufLine MainTxtBuf, "S_" + str2$(statementn) + ":;"|#31C4C4}}
            dimstatic = staticsf
            declibjmp4:
            {{Text|IF|#F0F0F0}} declaringlibrary {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} customtypelibrary {{Text|THEN|#F0F0F0}}
                    callname$ = removecast$({{Text|RTRIM$|#F0F0F0}}(id2.callname))
                    WriteBufLine RegTxtBuf, {{Text|"CUSTOMCALL_"|#FFB100}} + callname$ + {{Text|" *"|#FFB100}} + callname$ + {{Text|"=NULL;"|#FFB100}}
                    {{Text|IF|#F0F0F0}} subfuncn {{Text|THEN|#F0F0F0}}
                        f = OpenBuffer%({{Text|"A"|#FFB100}}, tmpdir$ + {{Text|"maindata.txt"|#FFB100}})
                    {{Text|ELSE|#F0F0F0}}
                        f = DataTxtBuf
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    WriteBufLine f, callname$ + {{Text|"=(CUSTOMCALL_"|#FFB100}} + callname$ + {{Text|"*)&"|#FFB100}} + aliasname$ + {{Text|";"|#FFB100}}
                    {{Text|'if no header exists to make the external function available, the function definition must be found|#31C4C4}}
                    {{Text|IF|#F0F0F0}} sfheader = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} sfdeclare <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        ResolveStaticFunctions = ResolveStaticFunctions + {{Text|1|#F580B1}}
                        {{Text|'expand array if necessary|#31C4C4}}
                        {{Text|IF|#F0F0F0}} ResolveStaticFunctions > {{Text|UBOUND|#F0F0F0}}(ResolveStaticFunction_Name) {{Text|THEN|#F0F0F0}}
                            {{Text|REDIM|#F0F0F0}} {{Text|_PRESERVE|#F0F0F0}} ResolveStaticFunction_Name({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} ResolveStaticFunctions + {{Text|100|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
                            {{Text|REDIM|#F0F0F0}} {{Text|_PRESERVE|#F0F0F0}} ResolveStaticFunction_File({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} ResolveStaticFunctions + {{Text|100|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
                            {{Text|REDIM|#F0F0F0}} {{Text|_PRESERVE|#F0F0F0}} ResolveStaticFunction_Method({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} ResolveStaticFunctions + {{Text|100|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        ResolveStaticFunction_File(ResolveStaticFunctions) = libname$
                        ResolveStaticFunction_Name(ResolveStaticFunctions) = aliasname$
                        ResolveStaticFunction_Method(ResolveStaticFunctions) = {{Text|1|#F580B1}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'sfheader=0|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} dynamiclibrary {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} sfdeclare {{Text|THEN|#F0F0F0}}
                        WriteBufLine RegTxtBuf, {{Text|"DLLCALL_"|#FFB100}} + removecast$({{Text|RTRIM$|#F0F0F0}}(id2.callname)) + {{Text|" "|#FFB100}} + removecast$({{Text|RTRIM$|#F0F0F0}}(id2.callname)) + {{Text|"=NULL;"|#FFB100}}
                        {{Text|IF|#F0F0F0}} subfuncn {{Text|THEN|#F0F0F0}}
                            f = OpenBuffer%({{Text|"A"|#FFB100}}, tmpdir$ + {{Text|"maindata.txt"|#FFB100}})
                        {{Text|ELSE|#F0F0F0}}
                            f = DataTxtBuf
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        WriteBufLine f, {{Text|"if (!"|#FFB100}} + removecast$({{Text|RTRIM$|#F0F0F0}}(id2.callname)) + {{Text|"){"|#FFB100}}
                        {{Text|IF|#F0F0F0}} os$ = {{Text|"WIN"|#FFB100}} {{Text|THEN|#F0F0F0}}
                            WriteBufLine f, removecast$({{Text|RTRIM$|#F0F0F0}}(id2.callname)) + {{Text|"=(DLLCALL_"|#FFB100}} + removecast$({{Text|RTRIM$|#F0F0F0}}(id2.callname)) + {{Text|")GetProcAddress(DLL_"|#FFB100}} + DLLname$ + {{Text|","|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + aliasname$ + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|");"|#FFB100}}
                            WriteBufLine f, {{Text|"if (!"|#FFB100}} + removecast$({{Text|RTRIM$|#F0F0F0}}(id2.callname)) + {{Text|") error(260);"|#FFB100}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} os$ = {{Text|"LNX"|#FFB100}} {{Text|THEN|#F0F0F0}}
                            WriteBufLine f, removecast$({{Text|RTRIM$|#F0F0F0}}(id2.callname)) + {{Text|"=(DLLCALL_"|#FFB100}} + removecast$({{Text|RTRIM$|#F0F0F0}}(id2.callname)) + {{Text|")dlsym(DLL_"|#FFB100}} + DLLname$ + {{Text|","|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + aliasname$ + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|");"|#FFB100}}
                            WriteBufLine f, {{Text|"if (dlerror()) error(260);"|#FFB100}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        WriteBufLine f, {{Text|"}"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'sfdeclare|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'dynamic|#31C4C4}}
                {{Text|IF|#F0F0F0}} sfdeclare = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} customtypelibrary = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} dynamiclibrary = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} indirectlibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    ResolveStaticFunctions = ResolveStaticFunctions + {{Text|1|#F580B1}}
                    {{Text|'expand array if necessary|#31C4C4}}
                    {{Text|IF|#F0F0F0}} ResolveStaticFunctions > {{Text|UBOUND|#F0F0F0}}(ResolveStaticFunction_Name) {{Text|THEN|#F0F0F0}}
                        {{Text|REDIM|#F0F0F0}} {{Text|_PRESERVE|#F0F0F0}} ResolveStaticFunction_Name({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} ResolveStaticFunctions + {{Text|100|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
                        {{Text|REDIM|#F0F0F0}} {{Text|_PRESERVE|#F0F0F0}} ResolveStaticFunction_File({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} ResolveStaticFunctions + {{Text|100|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
                        {{Text|REDIM|#F0F0F0}} {{Text|_PRESERVE|#F0F0F0}} ResolveStaticFunction_Method({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} ResolveStaticFunctions + {{Text|100|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    ResolveStaticFunction_File(ResolveStaticFunctions) = libname$
                    ResolveStaticFunction_Name(ResolveStaticFunctions) = aliasname$
                    ResolveStaticFunction_Method(ResolveStaticFunctions) = {{Text|2|#F580B1}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} sfdeclare = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} indirectlibrary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    RegTxtBuf = OpenBuffer%({{Text|"A"|#FFB100}}, tmpdir$ + {{Text|"regsf.txt"|#FFB100}})
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'declaring library|#31C4C4}}
            {{Text|GOTO|#F0F0F0}} finishednonexec
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'END SUB/FUNCTION|#31C4C4}}
    {{Text|IF|#F0F0F0}} n = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"END"|#FFB100}} {{Text|THEN|#F0F0F0}}
            sf = {{Text|0|#F580B1}}
            {{Text|IF|#F0F0F0}} secondelement$ = {{Text|"FUNCTION"|#FFB100}} {{Text|THEN|#F0F0F0}} sf = {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} secondelement$ = {{Text|"SUB"|#FFB100}} {{Text|THEN|#F0F0F0}} sf = {{Text|2|#F580B1}}
            {{Text|IF|#F0F0F0}} sf {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(subfunc) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"END "|#FFB100}} + secondelement$ + {{Text|" without "|#FFB100}} + secondelement$: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|'check for open controls (copy #3)|#31C4C4}}
                {{Text|IF|#F0F0F0}} controllevel <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} controltype(controllevel) <> {{Text|6|#F580B1}} {{Text|AND|#F0F0F0}} controltype(controllevel) <> {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'It's OK for subs to be inside $IF blocks|#31C4C4}}
                    a$ = {{Text|"Unidentified open control block"|#FFB100}}
                    {{Text|SELECT|#F0F0F0}} {{Text|CASE|#F0F0F0}} controltype(controllevel)
                        {{Text|CASE|#F0F0F0}} {{Text|1|#F580B1}}: a$ = {{Text|"IF without END IF"|#FFB100}}
                        {{Text|CASE|#F0F0F0}} {{Text|2|#F580B1}}: a$ = {{Text|"FOR without NEXT"|#FFB100}}
                        {{Text|CASE|#F0F0F0}} {{Text|3|#F580B1}}, {{Text|4|#F580B1}}: a$ = {{Text|"DO without LOOP"|#FFB100}}
                        {{Text|CASE|#F0F0F0}} {{Text|5|#F580B1}}: a$ = {{Text|"WHILE without WEND"|#FFB100}}
                        {{Text|CASE|#F0F0F0}} {{Text|10|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|19|#F580B1}}: a$ = {{Text|"SELECT CASE without END SELECT"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|SELECT|#F0F0F0}}
                    linenumber = controlref(controllevel)
                    {{Text|GOTO|#F0F0F0}} errmes
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} controltype(controllevel) = {{Text|32|#F580B1}} {{Text|AND|#F0F0F0}} ideindentsubs {{Text|THEN|#F0F0F0}}
                    controltype(controllevel) = {{Text|0|#F580B1}}
                    controllevel = controllevel - {{Text|1|#F580B1}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(subfunc, {{Text|4|#F580B1}}) = {{Text|"SUB_"|#FFB100}} {{Text|THEN|#F0F0F0}} secondelement$ = SCase$({{Text|"Sub"|#FFB100}}) {{Text|ELSE|#F0F0F0}} secondelement$ = SCase$({{Text|"Function"|#FFB100}})
                l$ = SCase$({{Text|"End"|#FFB100}}) + sp + secondelement$
                layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                {{Text|IF|#F0F0F0}} vWatchOn = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                    vWatchVariable {{Text|""|#FFB100}}, {{Text|1|#F580B1}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                staticarraylist = {{Text|""|#FFB100}}: staticarraylistn = {{Text|0|#F580B1}} {{Text|'remove previously listed arrays|#31C4C4}}
                dimstatic = {{Text|0|#F580B1}}
                WriteBufLine MainTxtBuf, {{Text|"exit_subfunc:;"|#FFB100}}
                {{Text|IF|#F0F0F0}} vWatchOn = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} NoChecks = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        vWatchAddLabel linenumber, {{Text|0|#F580B1}}
                        WriteBufLine MainTxtBuf, {{Text|"*__LONG_VWATCH_LINENUMBER= "|#FFB100}} + str2$(linenumber) + {{Text|"; 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;"|#FFB100}}
                        vWatchAddLabel {{Text|0|#F580B1}}, {{Text|-1|#F580B1}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    WriteBufLine MainTxtBuf, {{Text|"*__LONG_VWATCH_SUBLEVEL=*__LONG_VWATCH_SUBLEVEL- 1 ;"|#FFB100}}
                    {{Text|IF|#F0F0F0}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} firstLineNumberLabelvWatch > {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        WriteBufLine MainTxtBuf, {{Text|"goto VWATCH_SKIPSETNEXTLINE;"|#FFB100}}
                        WriteBufLine MainTxtBuf, {{Text|"VWATCH_SETNEXTLINE:;"|#FFB100}}
                        WriteBufLine MainTxtBuf, {{Text|"switch (*__LONG_VWATCH_GOTO) {"|#FFB100}}
                        {{Text|FOR|#F0F0F0}} i = firstLineNumberLabelvWatch {{Text|TO|#F0F0F0}} lastLineNumberLabelvWatch
                            {{Text|WHILE|#F0F0F0}} i > {{Text|LEN|#F0F0F0}}(vWatchUsedLabels)
                                vWatchUsedLabels = vWatchUsedLabels + {{Text|SPACE$|#F0F0F0}}({{Text|1000|#F580B1}})
                                vWatchUsedSkipLabels = vWatchUsedSkipLabels + {{Text|SPACE$|#F0F0F0}}({{Text|1000|#F580B1}})
                            {{Text|WEND|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} {{Text|ASC|#F0F0F0}}(vWatchUsedLabels, i) = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                                WriteBufLine MainTxtBuf, {{Text|"    case "|#FFB100}} + str2$(i) + {{Text|":"|#FFB100}}
                                WriteBufLine MainTxtBuf, {{Text|"        goto VWATCH_LABEL_"|#FFB100}} + str2$(i) + {{Text|";"|#FFB100}}
                                WriteBufLine MainTxtBuf, {{Text|"        break;"|#FFB100}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|NEXT|#F0F0F0}}
                        WriteBufLine MainTxtBuf, {{Text|"    default:"|#FFB100}}
                        WriteBufLine MainTxtBuf, {{Text|"        *__LONG_VWATCH_GOTO=*__LONG_VWATCH_LINENUMBER;"|#FFB100}}
                        WriteBufLine MainTxtBuf, {{Text|"        goto VWATCH_SETNEXTLINE;"|#FFB100}}
                        WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}}
                        WriteBufLine MainTxtBuf, {{Text|"VWATCH_SKIPLINE:;"|#FFB100}}
                        WriteBufLine MainTxtBuf, {{Text|"switch (*__LONG_VWATCH_GOTO) {"|#FFB100}}
                        {{Text|FOR|#F0F0F0}} i = firstLineNumberLabelvWatch {{Text|TO|#F0F0F0}} lastLineNumberLabelvWatch
                            {{Text|IF|#F0F0F0}} {{Text|ASC|#F0F0F0}}(vWatchUsedSkipLabels, i) = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                                WriteBufLine MainTxtBuf, {{Text|"    case -"|#FFB100}} + str2$(i) + {{Text|":"|#FFB100}}
                                WriteBufLine MainTxtBuf, {{Text|"        goto VWATCH_SKIPLABEL_"|#FFB100}} + str2$(i) + {{Text|";"|#FFB100}}
                                WriteBufLine MainTxtBuf, {{Text|"        break;"|#FFB100}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|NEXT|#F0F0F0}}
                        WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}}
                        WriteBufLine MainTxtBuf, {{Text|"VWATCH_SKIPSETNEXTLINE:;"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    firstLineNumberLabelvWatch = {{Text|0|#F580B1}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'release _MEM lock for this scope|#31C4C4}}
                WriteBufLine MainTxtBuf, {{Text|"free_mem_lock(sf_mem_lock);"|#FFB100}}
                WriteBufLine MainTxtBuf, {{Text|"#include "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"free"|#FFB100}} + str2$(subfuncn) + {{Text|".txt"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}})
                WriteBufLine MainTxtBuf, {{Text|"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;"|#FFB100}}
                WriteBufLine MainTxtBuf, {{Text|"cmem_sp=tmp_cmem_sp;"|#FFB100}}
                {{Text|IF|#F0F0F0}} subfuncret$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, subfuncret$
                WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}} {{Text|'skeleton sub|#31C4C4}}
                {{Text|'ret???.txt|#31C4C4}}
                WriteBufLine RetTxtBuf, {{Text|"}"|#FFB100}} {{Text|'end case|#31C4C4}}
                WriteBufLine RetTxtBuf, {{Text|"}"|#FFB100}}
                WriteBufLine RetTxtBuf, {{Text|"error(3);"|#FFB100}} {{Text|'no valid return possible|#31C4C4}}
                subfunc = {{Text|""|#FFB100}}
                closedsubfunc = {{Text|-1|#F580B1}}
                {{Text|'unshare temp. shared variables|#31C4C4}}
                {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} idn
                    {{Text|IF|#F0F0F0}} ids(i).share {{Text|AND|#F0F0F0}} {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} ids(i).share = ids(i).share - {{Text|2|#F580B1}}
                {{Text|NEXT|#F0F0F0}}
                {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} revertmaymusthaven
                    x = revertmaymusthave(i)
                    {{Text|SWAP|#F0F0F0}} ids(x).musthave, ids(x).mayhave
                {{Text|NEXT|#F0F0F0}}
                revertmaymusthaven = {{Text|0|#F580B1}}
                {{Text|'undeclare constants in sub/function's scope|#31C4C4}}
                {{Text|'constlast = constlastshared|#31C4C4}}
                {{Text|GOTO|#F0F0F0}} finishednonexec
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} n >= {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} firstelement$ = {{Text|"CONST"|#FFB100}} {{Text|THEN|#F0F0F0}}
        l$ = SCase$({{Text|"Const"|#FFB100}})
        {{Text|'DEF... do not change type, the expression is stored in a suitable type|#31C4C4}}
        {{Text|'based on its value if type isn't forced/specified|#31C4C4}}
        {{Text|IF|#F0F0F0}} n < {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected CONST name = value/expression"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
        i = {{Text|2|#F580B1}}
        constdefpending:
        pending = {{Text|0|#F580B1}}
        n$ = getelement$(ca$, i): i = i + {{Text|1|#F580B1}}
        l$ = l$ + sp + n$ + sp + {{Text|"="|#FFB100}}
        typeoverride = {{Text|0|#F580B1}}
        s$ = removesymbol$(n$)
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
        {{Text|IF|#F0F0F0}} s$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
            typeoverride = typname2typ(s$)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} typeoverride {{Text|AND|#F0F0F0}} ISFIXEDLENGTH {{Text|THEN|#F0F0F0}} a$ = {{Text|"Invalid constant type"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} typeoverride = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Invalid constant type"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} getelement$(a$, i) <> {{Text|"="|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ="|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
        i = i + {{Text|1|#F580B1}}
        {{Text|'get expression|#31C4C4}}
        e$ = {{Text|""|#FFB100}}
        B = {{Text|0|#F580B1}}
        {{Text|FOR|#F0F0F0}} i2 = i {{Text|TO|#F0F0F0}} n
            e2$ = getelement$(ca$, i2)
            {{Text|IF|#F0F0F0}} e2$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} B = B + {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} e2$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} B = B - {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} e2$ = {{Text|","|#FFB100}} {{Text|AND|#F0F0F0}} B = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                pending = {{Text|1|#F580B1}}
                i = i2 + {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} i > n - {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected CONST ... , name = value/expression"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(e$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = e2$ {{Text|ELSE|#F0F0F0}} e$ = e$ + sp + e2$
        {{Text|NEXT|#F0F0F0}}
        e$ = fixoperationorder(e$)
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
        l$ = l$ + sp + tlayout$
        {{Text|'Note: Actual CONST definition handled in prepass|#31C4C4}}
        {{Text|'Set CONST as defined|#31C4C4}}
        hashname$ = n$
        hashchkflags = HASHFLAG_CONSTANT
        hashres = HashFind(hashname$, hashchkflags, hashresflags, hashresref)
        {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} hashres
            {{Text|IF|#F0F0F0}} constsubfunc(hashresref) = subfuncn {{Text|THEN|#F0F0F0}} constdefined(hashresref) = {{Text|1|#F580B1}}: {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
            {{Text|IF|#F0F0F0}} hashres <> {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} hashres = HashFindCont(hashresflags, hashresref) {{Text|ELSE|#F0F0F0}} hashres = {{Text|0|#F580B1}}
        {{Text|LOOP|#F0F0F0}}
        {{Text|IF|#F0F0F0}} pending {{Text|THEN|#F0F0F0}} l$ = l$ + sp2 + {{Text|","|#FFB100}}: {{Text|GOTO|#F0F0F0}} constdefpending
        layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
        {{Text|GOTO|#F0F0F0}} finishednonexec
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    predefine:
    {{Text|IF|#F0F0F0}} n >= {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
        asreq = {{Text|0|#F580B1}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"DEFINT"|#FFB100}} {{Text|THEN|#F0F0F0}} l$ = SCase$({{Text|"DefInt"|#FFB100}}): a$ = a$ + sp + {{Text|"AS"|#FFB100}} + sp + {{Text|"INTEGER"|#FFB100}}: n = n + {{Text|2|#F580B1}}: {{Text|GOTO|#F0F0F0}} definetype
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"DEFLNG"|#FFB100}} {{Text|THEN|#F0F0F0}} l$ = SCase$({{Text|"DefLng"|#FFB100}}): a$ = a$ + sp + {{Text|"AS"|#FFB100}} + sp + {{Text|"LONG"|#FFB100}}: n = n + {{Text|2|#F580B1}}: {{Text|GOTO|#F0F0F0}} definetype
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"DEFSNG"|#FFB100}} {{Text|THEN|#F0F0F0}} l$ = SCase$({{Text|"DefSng"|#FFB100}}): a$ = a$ + sp + {{Text|"AS"|#FFB100}} + sp + {{Text|"SINGLE"|#FFB100}}: n = n + {{Text|2|#F580B1}}: {{Text|GOTO|#F0F0F0}} definetype
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"DEFDBL"|#FFB100}} {{Text|THEN|#F0F0F0}} l$ = SCase$({{Text|"DefDbl"|#FFB100}}): a$ = a$ + sp + {{Text|"AS"|#FFB100}} + sp + {{Text|"DOUBLE"|#FFB100}}: n = n + {{Text|2|#F580B1}}: {{Text|GOTO|#F0F0F0}} definetype
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"DEFSTR"|#FFB100}} {{Text|THEN|#F0F0F0}} l$ = SCase$({{Text|"DefStr"|#FFB100}}): a$ = a$ + sp + {{Text|"AS"|#FFB100}} + sp + {{Text|"STRING"|#FFB100}}: n = n + {{Text|2|#F580B1}}: {{Text|GOTO|#F0F0F0}} definetype
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"_DEFINE"|#FFB100}} {{Text|OR|#F0F0F0}} (firstelement$ = {{Text|"DEFINE"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
            asreq = {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"_DEFINE"|#FFB100}} {{Text|THEN|#F0F0F0}} l$ = SCase$({{Text|"_Define"|#FFB100}}) {{Text|ELSE|#F0F0F0}} l$ = SCase$({{Text|"Define"|#FFB100}})
            definetype:
            {{Text|'get type from rhs|#31C4C4}}
            typ$ = {{Text|""|#FFB100}}
            typ2$ = {{Text|""|#FFB100}}
            t$ = {{Text|""|#FFB100}}
            {{Text|FOR|#F0F0F0}} i = n {{Text|TO|#F0F0F0}} {{Text|2|#F580B1}} {{Text|STEP|#F0F0F0}} {{Text|-1|#F580B1}}
                t$ = getelement$(a$, i)
                {{Text|IF|#F0F0F0}} t$ = {{Text|"AS"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}}
                typ$ = t$ + {{Text|" "|#FFB100}} + typ$
                typ2$ = t$ + sp + typ2$
            {{Text|NEXT|#F0F0F0}}
            typ$ = {{Text|RTRIM$|#F0F0F0}}(typ$)
            {{Text|IF|#F0F0F0}} t$ <> {{Text|"AS"|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = qb64prefix$ + {{Text|"DEFINE: Expected ... AS ..."|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} i = n {{Text|OR|#F0F0F0}} i = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = qb64prefix$ + {{Text|"DEFINE: Expected ... AS ..."|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            n = i - {{Text|1|#F580B1}}
            {{Text|'the data is from element 2 to element n|#31C4C4}}
            i = {{Text|2|#F580B1}} - {{Text|1|#F580B1}}
            definenext:
            {{Text|'expects an alphabet letter or underscore|#31C4C4}}
            i = i + {{Text|1|#F580B1}}: e$ = getelement$(a$, i): E = {{Text|ASC|#F0F0F0}}({{Text|UCASE$|#F0F0F0}}(e$))
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(e$) > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = qb64prefix$ + {{Text|"DEFINE: Expected an alphabet letter or the underscore character (_)"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} E <> {{Text|95|#F580B1}} {{Text|AND|#F0F0F0}} (E > {{Text|90|#F580B1}} {{Text|OR|#F0F0F0}} E < {{Text|65|#F580B1}}) {{Text|THEN|#F0F0F0}} a$ = qb64prefix$ + {{Text|"DEFINE: Expected an alphabet letter or the underscore character (_)"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} E = {{Text|95|#F580B1}} {{Text|THEN|#F0F0F0}} E = {{Text|27|#F580B1}} {{Text|ELSE|#F0F0F0}} E = E - {{Text|64|#F580B1}}
            defineaz(E) = typ$
            defineextaz(E) = type2symbol(typ$)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            firste = E
            l$ = l$ + sp + e$
            {{Text|IF|#F0F0F0}} i = n {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} predefining = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} predefined
                {{Text|IF|#F0F0F0}} asreq {{Text|THEN|#F0F0F0}} l$ = l$ + sp + SCase$({{Text|"As"|#FFB100}}) + sp + typ2$
                layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                {{Text|GOTO|#F0F0F0}} finishednonexec
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'expects "-" or ","|#31C4C4}}
            i = i + {{Text|1|#F580B1}}: e$ = getelement$(a$, i)
            {{Text|IF|#F0F0F0}} e$ <> {{Text|"-"|#FFB100}} {{Text|AND|#F0F0F0}} e$ <> {{Text|","|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = qb64prefix$ + {{Text|"DEFINE: Expected - or ,"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} e$ = {{Text|"-"|#FFB100}} {{Text|THEN|#F0F0F0}}
                l$ = l$ + sp2 + {{Text|"-"|#FFB100}}
                {{Text|IF|#F0F0F0}} i = n {{Text|THEN|#F0F0F0}} a$ = qb64prefix$ + {{Text|"DEFINE: Syntax incomplete"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|'expects an alphabet letter or underscore|#31C4C4}}
                i = i + {{Text|1|#F580B1}}: e$ = getelement$(a$, i): E = {{Text|ASC|#F0F0F0}}({{Text|UCASE$|#F0F0F0}}(e$))
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(e$) > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = qb64prefix$ + {{Text|"DEFINE: Expected an alphabet letter or the underscore character (_)"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} E <> {{Text|95|#F580B1}} {{Text|AND|#F0F0F0}} (E > {{Text|90|#F580B1}} {{Text|OR|#F0F0F0}} E < {{Text|65|#F580B1}}) {{Text|THEN|#F0F0F0}} a$ = qb64prefix$ + {{Text|"DEFINE: Expected an alphabet letter or the underscore character (_)"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} E = {{Text|95|#F580B1}} {{Text|THEN|#F0F0F0}} E = {{Text|27|#F580B1}} {{Text|ELSE|#F0F0F0}} E = E - {{Text|64|#F580B1}}
                {{Text|IF|#F0F0F0}} firste > E {{Text|THEN|#F0F0F0}} {{Text|SWAP|#F0F0F0}} E, firste
                {{Text|FOR|#F0F0F0}} e2 = firste {{Text|TO|#F0F0F0}} E
                    defineaz(e2) = typ$
                    defineextaz(e2) = type2symbol(typ$)
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|NEXT|#F0F0F0}}
                l$ = l$ + sp2 + e$
                {{Text|IF|#F0F0F0}} i = n {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} predefining = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} predefined
                    {{Text|IF|#F0F0F0}} asreq {{Text|THEN|#F0F0F0}} l$ = l$ + sp + SCase$({{Text|"As"|#FFB100}}) + sp + typ2$
                    layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                    {{Text|GOTO|#F0F0F0}} finishednonexec
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'expects ","|#31C4C4}}
                i = i + {{Text|1|#F580B1}}: e$ = getelement$(a$, i)
                {{Text|IF|#F0F0F0}} e$ <> {{Text|","|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = qb64prefix$ + {{Text|"DEFINE: Expected ,"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            l$ = l$ + sp2 + {{Text|","|#FFB100}}
            {{Text|GOTO|#F0F0F0}} definenext
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'_DEFINE|#31C4C4}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'2|#31C4C4}}
    {{Text|IF|#F0F0F0}} predefining = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} predefined
    {{Text|IF|#F0F0F0}} closedmain <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} subfunc = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Statement cannot be placed between SUB/FUNCTIONs"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
    {{Text|'executable section:|#31C4C4}}
    statementn = statementn + {{Text|1|#F580B1}}
    {{Text|IF|#F0F0F0}} n >= {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"NEXT"|#FFB100}} {{Text|THEN|#F0F0F0}}
            l$ = SCase$({{Text|"Next"|#FFB100}})
            {{Text|IF|#F0F0F0}} n = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} simplenext
            v$ = {{Text|""|#FFB100}}
            {{Text|FOR|#F0F0F0}} i = {{Text|2|#F580B1}} {{Text|TO|#F0F0F0}} n
                a2$ = getelement(ca$, i)
                {{Text|IF|#F0F0F0}} a2$ = {{Text|","|#FFB100}} {{Text|THEN|#F0F0F0}}
                    lastnextele:
                    e$ = fixoperationorder(v$)
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(l$) = {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} l$ = l$ + sp + tlayout$ {{Text|ELSE|#F0F0F0}} l$ = l$ + sp2 + {{Text|","|#FFB100}} + sp + tlayout$
                    e$ = evaluate(e$, typ)
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}}
                        getid {{Text|VAL|#F0F0F0}}(e$)
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                        {{Text|IF|#F0F0F0}} (id.t {{Text|AND|#F0F0F0}} ISPOINTER) {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} (id.t {{Text|AND|#F0F0F0}} ISSTRING) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} (id.t {{Text|AND|#F0F0F0}} ISOFFSETINBITS) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} (id.t {{Text|AND|#F0F0F0}} ISARRAY) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        {{Text|GOTO|#F0F0F0}} fornextfoundvar2
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    a$ = {{Text|"Unsupported variable after NEXT"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    fornextfoundvar2:
                    simplenext:
                    {{Text|IF|#F0F0F0}} controltype(controllevel) <> {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"NEXT without FOR"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|IF|#F0F0F0}} n <> {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} controlvalue(controllevel) <> currentid {{Text|THEN|#F0F0F0}} a$ = {{Text|"Incorrect variable after NEXT"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    WriteBufLine MainTxtBuf, {{Text|"fornext_continue_"|#FFB100}} + str2$(controlid(controllevel)) + {{Text|":;"|#FFB100}}
                    {{Text|IF|#F0F0F0}} vWatchOn = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} NoChecks = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        vWatchAddLabel linenumber, {{Text|0|#F580B1}}
                        WriteBufLine MainTxtBuf, {{Text|"*__LONG_VWATCH_LINENUMBER= "|#FFB100}} + str2$(linenumber) + {{Text|"; 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;"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}}
                    WriteBufLine MainTxtBuf, {{Text|"fornext_exit_"|#FFB100}} + str2$(controlid(controllevel)) + {{Text|":;"|#FFB100}}
                    controllevel = controllevel - {{Text|1|#F580B1}}
                    {{Text|IF|#F0F0F0}} n = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}}
                    v$ = {{Text|""|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(v$) {{Text|THEN|#F0F0F0}} v$ = v$ + sp + a2$ {{Text|ELSE|#F0F0F0}} v$ = a2$
                    {{Text|IF|#F0F0F0}} i = n {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} lastnextele
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|NEXT|#F0F0F0}}
            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
            {{Text|GOTO|#F0F0F0}} finishednonexec {{Text|'***no error causing code, event checking done by FOR***|#31C4C4}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} n >= {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"WHILE"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} NoChecks = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, {{Text|"S_"|#FFB100}} + str2$(statementn) + {{Text|":;"|#FFB100}}: dynscope = {{Text|1|#F580B1}}
            {{Text|'prevents code from being placed before 'CASE condition' in a SELECT CASE block|#31C4C4}}
            {{Text|IF|#F0F0F0}} SelectCaseCounter > {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} SelectCaseHasCaseBlock(SelectCaseCounter) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                a$ = {{Text|"Expected CASE expression"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            controllevel = controllevel + {{Text|1|#F580B1}}
            controlref(controllevel) = linenumber
            controltype(controllevel) = {{Text|5|#F580B1}}
            controlid(controllevel) = uniquenumber
            {{Text|IF|#F0F0F0}} n >= {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                e$ = fixoperationorder(getelements$(ca$, {{Text|2|#F580B1}}, n))
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                l$ = SCase$({{Text|"While"|#FFB100}}) + sp + tlayout$
                layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                e$ = evaluate(e$, typ)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}} e$ = refer$(e$, typ, {{Text|0|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} stringprocessinghappened {{Text|THEN|#F0F0F0}} e$ = cleanupstringprocessingcall$ + e$ + {{Text|")"|#FFB100}}
                {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}} a$ = {{Text|"WHILE ERROR! Cannot accept a STRING type."|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} NoChecks = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} vWatchOn = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    vWatchAddLabel linenumber, {{Text|0|#F580B1}}
                    WriteBufLine MainTxtBuf, {{Text|"*__LONG_VWATCH_LINENUMBER= "|#FFB100}} + str2$(linenumber) + {{Text|"; 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;"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                WriteBufLine MainTxtBuf, {{Text|"while(("|#FFB100}} + e$ + {{Text|")¦¦new_error){"|#FFB100}}
            {{Text|ELSE|#F0F0F0}}
                a$ = {{Text|"WHILE ERROR! Expected expression after WHILE."|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|GOTO|#F0F0F0}} finishedline
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} n = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"WEND"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} controltype(controllevel) <> {{Text|5|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"WEND without WHILE"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            WriteBufLine MainTxtBuf, {{Text|"ww_continue_"|#FFB100}} + str2$(controlid(controllevel)) + {{Text|":;"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"ww_exit_"|#FFB100}} + str2$(controlid(controllevel)) + {{Text|":;"|#FFB100}}
            controllevel = controllevel - {{Text|1|#F580B1}}
            l$ = SCase$({{Text|"Wend"|#FFB100}})
            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
            {{Text|GOTO|#F0F0F0}} finishednonexec {{Text|'***no error causing code, event checking done by WHILE***|#31C4C4}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} n >= {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"DO"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} NoChecks = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, {{Text|"S_"|#FFB100}} + str2$(statementn) + {{Text|":;"|#FFB100}}: dynscope = {{Text|1|#F580B1}}
            {{Text|'prevents code from being placed before 'CASE condition' in a SELECT CASE block|#31C4C4}}
            {{Text|IF|#F0F0F0}} SelectCaseCounter > {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} SelectCaseHasCaseBlock(SelectCaseCounter) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                a$ = {{Text|"Expected CASE expression"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            controllevel = controllevel + {{Text|1|#F580B1}}
            controlref(controllevel) = linenumber
            l$ = SCase$({{Text|"Do"|#FFB100}})
            {{Text|IF|#F0F0F0}} n >= {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                whileuntil = {{Text|0|#F580B1}}
                {{Text|IF|#F0F0F0}} secondelement$ = {{Text|"WHILE"|#FFB100}} {{Text|THEN|#F0F0F0}} whileuntil = {{Text|1|#F580B1}}: l$ = l$ + sp + SCase$({{Text|"While"|#FFB100}})
                {{Text|IF|#F0F0F0}} secondelement$ = {{Text|"UNTIL"|#FFB100}} {{Text|THEN|#F0F0F0}} whileuntil = {{Text|2|#F580B1}}: l$ = l$ + sp + SCase$({{Text|"Until"|#FFB100}})
                {{Text|IF|#F0F0F0}} whileuntil = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"DO ERROR! Expected WHILE or UNTIL after DO."|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} whileuntil > {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} n = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Condition expected after WHILE/UNTIL"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                e$ = fixoperationorder(getelements$(ca$, {{Text|3|#F580B1}}, n))
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                l$ = l$ + sp + tlayout$
                e$ = evaluate(e$, typ)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}} e$ = refer$(e$, typ, {{Text|0|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} stringprocessinghappened {{Text|THEN|#F0F0F0}} e$ = cleanupstringprocessingcall$ + e$ + {{Text|")"|#FFB100}}
                {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}} a$ = {{Text|"DO ERROR! Cannot accept a STRING type."|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} whileuntil = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, {{Text|"while(("|#FFB100}} + e$ + {{Text|")¦¦new_error){"|#FFB100}} {{Text|ELSE|#F0F0F0}} WriteBufLine MainTxtBuf, {{Text|"while((!("|#FFB100}} + e$ + {{Text|"))¦¦new_error){"|#FFB100}}
                {{Text|IF|#F0F0F0}} NoChecks = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} vWatchOn = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    vWatchAddLabel linenumber, {{Text|0|#F580B1}}
                    WriteBufLine MainTxtBuf, {{Text|"*__LONG_VWATCH_LINENUMBER= "|#FFB100}} + str2$(linenumber) + {{Text|"; 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;"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                controltype(controllevel) = {{Text|4|#F580B1}}
            {{Text|ELSE|#F0F0F0}}
                controltype(controllevel) = {{Text|3|#F580B1}}
                {{Text|IF|#F0F0F0}} vWatchOn = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} NoChecks = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    vWatchAddLabel linenumber, {{Text|0|#F580B1}}
                    WriteBufLine MainTxtBuf, {{Text|"do{*__LONG_VWATCH_LINENUMBER= "|#FFB100}} + str2$(linenumber) + {{Text|"; 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;"|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    WriteBufLine MainTxtBuf, {{Text|"do{"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            controlid(controllevel) = uniquenumber
            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
            {{Text|GOTO|#F0F0F0}} finishedline
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} n >= {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"LOOP"|#FFB100}} {{Text|THEN|#F0F0F0}}
            l$ = SCase$({{Text|"Loop"|#FFB100}})
            {{Text|IF|#F0F0F0}} controltype(controllevel) <> {{Text|3|#F580B1}} {{Text|AND|#F0F0F0}} controltype(controllevel) <> {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"PROGRAM FLOW ERROR!"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} n >= {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} NoChecks = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, {{Text|"S_"|#FFB100}} + str2$(statementn) + {{Text|":;"|#FFB100}}: dynscope = {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} controltype(controllevel) = {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"PROGRAM FLOW ERROR!"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                whileuntil = {{Text|0|#F580B1}}
                {{Text|IF|#F0F0F0}} secondelement$ = {{Text|"WHILE"|#FFB100}} {{Text|THEN|#F0F0F0}} whileuntil = {{Text|1|#F580B1}}: l$ = l$ + sp + SCase$({{Text|"While"|#FFB100}})
                {{Text|IF|#F0F0F0}} secondelement$ = {{Text|"UNTIL"|#FFB100}} {{Text|THEN|#F0F0F0}} whileuntil = {{Text|2|#F580B1}}: l$ = l$ + sp + SCase$({{Text|"Until"|#FFB100}})
                {{Text|IF|#F0F0F0}} whileuntil = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"LOOP ERROR! Expected WHILE or UNTIL after LOOP."|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} whileuntil > {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} n = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Condition expected after WHILE/UNTIL"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                e$ = fixoperationorder(getelements$(ca$, {{Text|3|#F580B1}}, n))
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                l$ = l$ + sp + tlayout$
                e$ = evaluate(e$, typ)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}} e$ = refer$(e$, typ, {{Text|0|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} stringprocessinghappened {{Text|THEN|#F0F0F0}} e$ = cleanupstringprocessingcall$ + e$ + {{Text|")"|#FFB100}}
                {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}} a$ = {{Text|"LOOP ERROR! Cannot accept a STRING type."|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                WriteBufLine MainTxtBuf, {{Text|"dl_continue_"|#FFB100}} + str2$(controlid(controllevel)) + {{Text|":;"|#FFB100}}
                {{Text|IF|#F0F0F0}} NoChecks = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} vWatchOn = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    vWatchAddLabel linenumber, {{Text|0|#F580B1}}
                    WriteBufLine MainTxtBuf, {{Text|"*__LONG_VWATCH_LINENUMBER= "|#FFB100}} + str2$(linenumber) + {{Text|"; 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;"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} whileuntil = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, {{Text|"}while(("|#FFB100}} + e$ + {{Text|")&&(!new_error));"|#FFB100}} {{Text|ELSE|#F0F0F0}} WriteBufLine MainTxtBuf, {{Text|"}while((!("|#FFB100}} + e$ + {{Text|"))&&(!new_error));"|#FFB100}}
            {{Text|ELSE|#F0F0F0}}
                WriteBufLine MainTxtBuf, {{Text|"dl_continue_"|#FFB100}} + str2$(controlid(controllevel)) + {{Text|":;"|#FFB100}}
                {{Text|IF|#F0F0F0}} NoChecks = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} vWatchOn = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    vWatchAddLabel linenumber, {{Text|0|#F580B1}}
                    WriteBufLine MainTxtBuf, {{Text|"*__LONG_VWATCH_LINENUMBER= "|#FFB100}} + str2$(linenumber) + {{Text|"; 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;"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} controltype(controllevel) = {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}}
                    WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    WriteBufLine MainTxtBuf, {{Text|"}while(1);"|#FFB100}} {{Text|'infinite loop!|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            WriteBufLine MainTxtBuf, {{Text|"dl_exit_"|#FFB100}} + str2$(controlid(controllevel)) + {{Text|":;"|#FFB100}}
            controllevel = controllevel - {{Text|1|#F580B1}}
            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
            {{Text|IF|#F0F0F0}} n = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} finishednonexec {{Text|'***no error causing code, event checking done by DO***|#31C4C4}}
            {{Text|GOTO|#F0F0F0}} finishedline
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} n >= {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"FOR"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} NoChecks = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, {{Text|"S_"|#FFB100}} + str2$(statementn) + {{Text|":;"|#FFB100}}: dynscope = {{Text|1|#F580B1}}
            l$ = SCase$({{Text|"For"|#FFB100}})
            {{Text|'prevents code from being placed before 'CASE condition' in a SELECT CASE block|#31C4C4}}
            {{Text|IF|#F0F0F0}} SelectCaseCounter > {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} SelectCaseHasCaseBlock(SelectCaseCounter) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                a$ = {{Text|"Expected CASE expression"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            controllevel = controllevel + {{Text|1|#F580B1}}
            controlref(controllevel) = linenumber
            controltype(controllevel) = {{Text|2|#F580B1}}
            controlid(controllevel) = uniquenumber
            v$ = {{Text|""|#FFB100}}
            startvalue$ = {{Text|""|#FFB100}}
            p3$ = {{Text|"1"|#FFB100}}: stepused = {{Text|0|#F580B1}}
            p2$ = {{Text|""|#FFB100}}
            mode = {{Text|0|#F580B1}}
            E = {{Text|0|#F580B1}}
            {{Text|FOR|#F0F0F0}} i = {{Text|2|#F580B1}} {{Text|TO|#F0F0F0}} n
                e$ = getelement$(a$, i)
                {{Text|IF|#F0F0F0}} e$ = {{Text|"="|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} mode <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} E = {{Text|1|#F580B1}}: {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}}
                    mode = {{Text|1|#F580B1}}
                    v$ = getelements$(ca$, {{Text|2|#F580B1}}, i - {{Text|1|#F580B1}})
                    equpos = i
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} e$ = {{Text|"TO"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} mode <> {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} E = {{Text|1|#F580B1}}: {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}}
                    mode = {{Text|2|#F580B1}}
                    startvalue$ = getelements$(ca$, equpos + {{Text|1|#F580B1}}, i - {{Text|1|#F580B1}})
                    topos = i
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} e$ = {{Text|"STEP"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} mode <> {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} E = {{Text|1|#F580B1}}: {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}}
                    mode = {{Text|3|#F580B1}}
                    stepused = {{Text|1|#F580B1}}
                    p2$ = getelements$(ca$, topos + {{Text|1|#F580B1}}, i - {{Text|1|#F580B1}})
                    p3$ = getelements$(ca$, i + {{Text|1|#F580B1}}, n)
                    {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|NEXT|#F0F0F0}}
            {{Text|IF|#F0F0F0}} mode < {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} E = {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} p2$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} p2$ = getelements$(ca$, topos + {{Text|1|#F580B1}}, n)
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(v$) = {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} {{Text|LEN|#F0F0F0}}(startvalue$) = {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} {{Text|LEN|#F0F0F0}}(p2$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} E = {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} E <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} mode < {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected FOR name = start TO end"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} E {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected FOR name = start TO end STEP increment"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            e$ = fixoperationorder(v$)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            l$ = l$ + sp + tlayout$
            e$ = evaluate(e$, typ)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}}
                getid {{Text|VAL|#F0F0F0}}(e$)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} (id.t {{Text|AND|#F0F0F0}} ISPOINTER) {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (id.t {{Text|AND|#F0F0F0}} ISSTRING) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} (id.t {{Text|AND|#F0F0F0}} ISOFFSETINBITS) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} (id.t {{Text|AND|#F0F0F0}} ISARRAY) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                {{Text|GOTO|#F0F0F0}} fornextfoundvar
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            a$ = {{Text|"Unsupported variable used in FOR statement"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            fornextfoundvar:
            controlvalue(controllevel) = currentid
            v$ = e$
            {{Text|'find C++ datatype to match variable|#31C4C4}}
            {{Text|'markup to cater for greater range/accuracy|#31C4C4}}
            ctype$ = {{Text|""|#FFB100}}
            ctyp = typ - ISPOINTER
            bits = typ {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
            {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISFLOAT) {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} bits = {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"double"|#FFB100}}: ctyp = {{Text|64&|#F580B1}} + ISFLOAT
                {{Text|IF|#F0F0F0}} bits = {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"long double"|#FFB100}}: ctyp = {{Text|256&|#F580B1}} + ISFLOAT
                {{Text|IF|#F0F0F0}} bits = {{Text|256|#F580B1}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"long double"|#FFB100}}: ctyp = {{Text|256&|#F580B1}} + ISFLOAT
            {{Text|ELSE|#F0F0F0}}
                {{Text|IF|#F0F0F0}} bits = {{Text|8|#F580B1}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"int16"|#FFB100}}: ctyp = {{Text|16&|#F580B1}}
                {{Text|IF|#F0F0F0}} bits = {{Text|16|#F580B1}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"int32"|#FFB100}}: ctyp = {{Text|32&|#F580B1}}
                {{Text|IF|#F0F0F0}} bits = {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"int64"|#FFB100}}: ctyp = {{Text|64&|#F580B1}}
                {{Text|IF|#F0F0F0}} bits = {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"int64"|#FFB100}}: ctyp = {{Text|64&|#F580B1}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} ctype$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Unsupported variable used in FOR statement"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            u$ = str2(uniquenumber)
            {{Text|IF|#F0F0F0}} subfunc = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
                WriteBufLine DataTxtBuf, {{Text|"static "|#FFB100}} + ctype$ + {{Text|" fornext_value"|#FFB100}} + u$ + {{Text|";"|#FFB100}}
                WriteBufLine DataTxtBuf, {{Text|"static "|#FFB100}} + ctype$ + {{Text|" fornext_finalvalue"|#FFB100}} + u$ + {{Text|";"|#FFB100}}
                WriteBufLine DataTxtBuf, {{Text|"static "|#FFB100}} + ctype$ + {{Text|" fornext_step"|#FFB100}} + u$ + {{Text|";"|#FFB100}}
                WriteBufLine DataTxtBuf, {{Text|"static uint8 fornext_step_negative"|#FFB100}} + u$ + {{Text|";"|#FFB100}}
            {{Text|ELSE|#F0F0F0}}
                WriteBufLine DataTxtBuf, ctype$ + {{Text|" fornext_value"|#FFB100}} + u$ + {{Text|";"|#FFB100}}
                WriteBufLine DataTxtBuf, ctype$ + {{Text|" fornext_finalvalue"|#FFB100}} + u$ + {{Text|";"|#FFB100}}
                WriteBufLine DataTxtBuf, ctype$ + {{Text|" fornext_step"|#FFB100}} + u$ + {{Text|";"|#FFB100}}
                WriteBufLine DataTxtBuf, {{Text|"uint8 fornext_step_negative"|#FFB100}} + u$ + {{Text|";"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'calculate start|#31C4C4}}
            e$ = fixoperationorder$(startvalue$)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            l$ = l$ + sp + {{Text|"="|#FFB100}} + sp + tlayout$
            e$ = evaluatetotyp$(e$, ctyp)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            WriteBufLine MainTxtBuf, {{Text|"fornext_value"|#FFB100}} + u$ + {{Text|"="|#FFB100}} + e$ + {{Text|";"|#FFB100}}
            {{Text|'final|#31C4C4}}
            e$ = fixoperationorder$(p2$)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            l$ = l$ + sp + SCase$({{Text|"To"|#FFB100}}) + sp + tlayout$
            e$ = evaluatetotyp(e$, ctyp)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            WriteBufLine MainTxtBuf, {{Text|"fornext_finalvalue"|#FFB100}} + u$ + {{Text|"="|#FFB100}} + e$ + {{Text|";"|#FFB100}}
            {{Text|'step|#31C4C4}}
            e$ = fixoperationorder$(p3$)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} stepused = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} l$ = l$ + sp + SCase$({{Text|"Step"|#FFB100}}) + sp + tlayout$
            e$ = evaluatetotyp(e$, ctyp)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} NoChecks = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} vWatchOn = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                vWatchAddLabel linenumber, {{Text|0|#F580B1}}
                WriteBufLine MainTxtBuf, {{Text|"*__LONG_VWATCH_LINENUMBER= "|#FFB100}} + str2$(linenumber) + {{Text|"; 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;"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            WriteBufLine MainTxtBuf, {{Text|"fornext_step"|#FFB100}} + u$ + {{Text|"="|#FFB100}} + e$ + {{Text|";"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"if (fornext_step"|#FFB100}} + u$ + {{Text|"<0) fornext_step_negative"|#FFB100}} + u$ + {{Text|"=1; else fornext_step_negative"|#FFB100}} + u$ + {{Text|"=0;"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"if (new_error) goto fornext_error"|#FFB100}} + u$ + {{Text|";"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"goto fornext_entrylabel"|#FFB100}} + u$ + {{Text|";"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"while(1){"|#FFB100}}
            typbak = typ
            WriteBufLine MainTxtBuf, {{Text|"fornext_value"|#FFB100}} + u$ + {{Text|"=fornext_step"|#FFB100}} + u$ + {{Text|"+("|#FFB100}} + refer$(v$, typ, {{Text|0|#F580B1}}) + {{Text|");"|#FFB100}}
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            typ = typbak
            WriteBufLine MainTxtBuf, {{Text|"fornext_entrylabel"|#FFB100}} + u$ + {{Text|":"|#FFB100}}
            setrefer v$, typ, {{Text|"fornext_value"|#FFB100}} + u$, {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            WriteBufLine MainTxtBuf, {{Text|"if (fornext_step_negative"|#FFB100}} + u$ + {{Text|"){"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"if (fornext_value"|#FFB100}} + u$ + {{Text|"<fornext_finalvalue"|#FFB100}} + u$ + {{Text|") break;"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"}else{"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"if (fornext_value"|#FFB100}} + u$ + {{Text|">fornext_finalvalue"|#FFB100}} + u$ + {{Text|") break;"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"fornext_error"|#FFB100}} + u$ + {{Text|":;"|#FFB100}}
            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
            {{Text|GOTO|#F0F0F0}} finishedline
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} n = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"ELSE"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|'Routine to add error checking for ELSE so we'll no longer be able to do things like the following:|#31C4C4}}
            {{Text|'IF x = 1 THEN|#31C4C4}}
            {{Text|'    SELECT CASE s|#31C4C4}}
            {{Text|'        CASE 1|#31C4C4}}
            {{Text|'    END SELECT ELSE y = 2|#31C4C4}}
            {{Text|'END IF|#31C4C4}}
            {{Text|'Notice the ELSE with the SELECT CASE?  Before this patch, commands like those were considered valid QB64 code.|#31C4C4}}
            temp$ = {{Text|UCASE$|#F0F0F0}}({{Text|LTRIM$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(wholeline)))
            {{Text|'IF NoIDEMode THEN|#31C4C4}}
            {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(temp$, {{Text|CHR$|#F0F0F0}}({{Text|9|#F580B1}}))
                {{Text|ASC|#F0F0F0}}(temp$, {{Text|INSTR|#F0F0F0}}(temp$, {{Text|CHR$|#F0F0F0}}({{Text|9|#F580B1}}))) = {{Text|32|#F580B1}}
            {{Text|LOOP|#F0F0F0}}
            {{Text|'END IF|#31C4C4}}
            goodelse = {{Text|0|#F580B1}} {{Text|'a check to see if it's a good else|#31C4C4}}
            {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(temp$, {{Text|2|#F580B1}}) = {{Text|"IF"|#FFB100}} {{Text|THEN|#F0F0F0}} goodelse = {{Text|-1|#F580B1}}: {{Text|GOTO|#F0F0F0}} skipelsecheck {{Text|'If we have an IF, the else is probably good|#31C4C4}}
            {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(temp$, {{Text|4|#F580B1}}) = {{Text|"ELSE"|#FFB100}} {{Text|THEN|#F0F0F0}} goodelse = {{Text|-1|#F580B1}}: {{Text|GOTO|#F0F0F0}} skipelsecheck {{Text|'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|#31C4C4}}
            {{Text|DO|#F0F0F0}}
                spacelocation = {{Text|INSTR|#F0F0F0}}(temp$, {{Text|" "|#FFB100}})
                {{Text|IF|#F0F0F0}} spacelocation {{Text|THEN|#F0F0F0}} temp$ = {{Text|LEFT$|#F0F0F0}}(temp$, spacelocation - {{Text|1|#F580B1}}) + {{Text|MID$|#F0F0F0}}(temp$, spacelocation + {{Text|1|#F580B1}})
            {{Text|LOOP|#F0F0F0}} {{Text|UNTIL|#F0F0F0}} spacelocation = {{Text|0|#F580B1}}
            {{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(temp$, {{Text|":ELSE"|#FFB100}}) {{Text|OR|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(temp$, {{Text|":IF"|#FFB100}}) {{Text|THEN|#F0F0F0}} goodelse = {{Text|-1|#F580B1}}: {{Text|GOTO|#F0F0F0}} skipelsecheck {{Text|'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|#31C4C4}}
            count = {{Text|0|#F580B1}}
            {{Text|DO|#F0F0F0}}
                count = count + {{Text|1|#F580B1}}
                {{Text|SELECT|#F0F0F0}} {{Text|CASE|#F0F0F0}} {{Text|MID$|#F0F0F0}}(temp$, count, {{Text|1|#F580B1}})
                    {{Text|CASE|#F0F0F0}} {{Text|IS|#F0F0F0}} = {{Text|"1"|#FFB100}}, {{Text|"2"|#FFB100}}, {{Text|"3"|#FFB100}}, {{Text|"4"|#FFB100}}, {{Text|"5"|#FFB100}}, {{Text|"6"|#FFB100}}, {{Text|"7"|#FFB100}}, {{Text|"8"|#FFB100}}, {{Text|"9"|#FFB100}}, {{Text|"0"|#FFB100}}, {{Text|":"|#FFB100}}
                    {{Text|CASE|#F0F0F0}} {{Text|ELSE|#F0F0F0}}: {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|SELECT|#F0F0F0}}
            {{Text|LOOP|#F0F0F0}} {{Text|UNTIL|#F0F0F0}} count >= {{Text|LEN|#F0F0F0}}(temp$)
            {{Text|IF|#F0F0F0}} {{Text|MID$|#F0F0F0}}(temp$, count, {{Text|4|#F580B1}}) = {{Text|"ELSE"|#FFB100}} {{Text|OR|#F0F0F0}} {{Text|MID$|#F0F0F0}}(temp$, count, {{Text|2|#F580B1}}) = {{Text|"IF"|#FFB100}} {{Text|THEN|#F0F0F0}} goodelse = {{Text|-1|#F580B1}} {{Text|'We only had numbers before our else|#31C4C4}}
            {{Text|IF|#F0F0F0}} {{Text|NOT|#F0F0F0}} goodelse {{Text|THEN|#F0F0F0}} a$ = {{Text|"Invalid Syntax for ELSE"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            skipelsecheck:
            {{Text|'End of ELSE Error checking|#31C4C4}}
            {{Text|FOR|#F0F0F0}} i = controllevel {{Text|TO|#F0F0F0}} {{Text|1|#F580B1}} {{Text|STEP|#F0F0F0}} {{Text|-1|#F580B1}}
                t = controltype(i)
                {{Text|IF|#F0F0F0}} t = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} controlstate(controllevel) = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"IF-THEN already contains an ELSE statement"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    WriteBufLine MainTxtBuf, {{Text|"}else{"|#FFB100}}
                    controlstate(controllevel) = {{Text|2|#F580B1}}
                    {{Text|IF|#F0F0F0}} lineelseused = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} lhscontrollevel = lhscontrollevel - {{Text|1|#F580B1}}
                    l$ = SCase$({{Text|"Else"|#FFB100}})
                    layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                    {{Text|GOTO|#F0F0F0}} finishednonexec {{Text|'***no error causing code, event checking done by IF***|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|NEXT|#F0F0F0}}
            a$ = {{Text|"ELSE without IF"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} n >= {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"ELSEIF"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} NoChecks = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                WriteBufLine MainTxtBuf, {{Text|"S_"|#FFB100}} + str2$(statementn) + {{Text|":;"|#FFB100}}: dynscope = {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} vWatchOn = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    vWatchAddLabel linenumber, {{Text|0|#F580B1}}
                    WriteBufLine MainTxtBuf, {{Text|"*__LONG_VWATCH_LINENUMBER= "|#FFB100}} + str2$(linenumber) + {{Text|"; 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;"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|FOR|#F0F0F0}} i = controllevel {{Text|TO|#F0F0F0}} {{Text|1|#F580B1}} {{Text|STEP|#F0F0F0}} {{Text|-1|#F580B1}}
                t = controltype(i)
                {{Text|IF|#F0F0F0}} t = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} controlstate(controllevel) = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"ELSEIF invalid after ELSE"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    controlstate(controllevel) = {{Text|1|#F580B1}}
                    controlvalue(controllevel) = controlvalue(controllevel) + {{Text|1|#F580B1}}
                    e$ = getelement$(a$, n)
                    {{Text|IF|#F0F0F0}} e$ <> {{Text|"THEN"|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ELSEIF expression THEN"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    WriteBufLine MainTxtBuf, {{Text|"}else{"|#FFB100}}
                    e$ = fixoperationorder$(getelements$(ca$, {{Text|2|#F580B1}}, n - {{Text|1|#F580B1}}))
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    l$ = SCase$({{Text|"ElseIf"|#FFB100}}) + sp + tlayout$ + sp + SCase$({{Text|"Then"|#FFB100}})
                    layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                    e$ = evaluate(e$, typ)
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}} e$ = refer$(e$, typ, {{Text|0|#F580B1}})
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|IF|#F0F0F0}} typ {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
                        a$ = {{Text|"Expected ELSEIF LEN(stringexpression) THEN"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} stringprocessinghappened {{Text|THEN|#F0F0F0}}
                        WriteBufLine MainTxtBuf, {{Text|"if ("|#FFB100}} + cleanupstringprocessingcall$ + e$ + {{Text|")){"|#FFB100}}
                    {{Text|ELSE|#F0F0F0}}
                        WriteBufLine MainTxtBuf, {{Text|"if ("|#FFB100}} + e$ + {{Text|"){"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    lhscontrollevel = lhscontrollevel - {{Text|1|#F580B1}}
                    {{Text|GOTO|#F0F0F0}} finishedline
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|NEXT|#F0F0F0}}
            a$ = {{Text|"ELSEIF without IF"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} n >= {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"IF"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} NoChecks = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                WriteBufLine MainTxtBuf, {{Text|"S_"|#FFB100}} + str2$(statementn) + {{Text|":;"|#FFB100}}: dynscope = {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} vWatchOn = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    vWatchAddLabel linenumber, {{Text|0|#F580B1}}
                    WriteBufLine MainTxtBuf, {{Text|"*__LONG_VWATCH_LINENUMBER= "|#FFB100}} + str2$(linenumber) + {{Text|"; 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;"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'prevents code from being placed before 'CASE condition' in a SELECT CASE block|#31C4C4}}
            {{Text|IF|#F0F0F0}} SelectCaseCounter > {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} SelectCaseHasCaseBlock(SelectCaseCounter) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                a$ = {{Text|"Expected CASE expression"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            e$ = getelement(a$, n)
            iftype = {{Text|0|#F580B1}}
            {{Text|IF|#F0F0F0}} e$ = {{Text|"THEN"|#FFB100}} {{Text|THEN|#F0F0F0}} iftype = {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} e$ = {{Text|"GOTO"|#FFB100}} {{Text|THEN|#F0F0F0}} iftype = {{Text|2|#F580B1}}
            {{Text|IF|#F0F0F0}} iftype = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected IF expression THEN/GOTO"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            controllevel = controllevel + {{Text|1|#F580B1}}
            controlref(controllevel) = linenumber
            controltype(controllevel) = {{Text|1|#F580B1}}
            controlvalue(controllevel) = {{Text|0|#F580B1}} {{Text|'number of extra closing } required at END IF|#31C4C4}}
            controlstate(controllevel) = {{Text|0|#F580B1}}
            e$ = fixoperationorder$(getelements(ca$, {{Text|2|#F580B1}}, n - {{Text|1|#F580B1}}))
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            l$ = SCase$({{Text|"If"|#FFB100}}) + sp + tlayout$
            e$ = evaluate(e$, typ)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}} e$ = refer$(e$, typ, {{Text|0|#F580B1}})
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} typ {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
                a$ = {{Text|"Expected IF LEN(stringexpression) THEN"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} stringprocessinghappened {{Text|THEN|#F0F0F0}}
                WriteBufLine MainTxtBuf, {{Text|"if (("|#FFB100}} + cleanupstringprocessingcall$ + e$ + {{Text|"))¦¦new_error){"|#FFB100}}
            {{Text|ELSE|#F0F0F0}}
                WriteBufLine MainTxtBuf, {{Text|"if (("|#FFB100}} + e$ + {{Text|")¦¦new_error){"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} iftype = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} l$ = l$ + sp + SCase$({{Text|"Then"|#FFB100}}) {{Text|'note: 'GOTO' will be added when iftype=2|#31C4C4}}
            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} layout$ = l$ {{Text|ELSE|#F0F0F0}} layout$ = layout$ + sp + l$
            {{Text|IF|#F0F0F0}} iftype = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'IF ... GOTO|#31C4C4}}
                {{Text|GOTO|#F0F0F0}} finishedline
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            THENGOTO = {{Text|1|#F580B1}} {{Text|'possible: IF a=1 THEN 10|#31C4C4}}
            {{Text|GOTO|#F0F0F0}} finishedline2
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'ENDIF|#31C4C4}}
    {{Text|IF|#F0F0F0}} n = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} getelement(a$, {{Text|1|#F580B1}}) = {{Text|"ENDIF"|#FFB100}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} controltype(controllevel) <> {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"END IF without IF"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
        layoutdone = {{Text|1|#F580B1}}
        {{Text|IF|#F0F0F0}} impliedendif = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            l$ = SCase$({{Text|"End If"|#FFB100}})
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} layout$ = l$ {{Text|ELSE|#F0F0F0}} layout$ = layout$ + sp + l$
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}}
        {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} controlvalue(controllevel)
            WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}}
        {{Text|NEXT|#F0F0F0}}
        controllevel = controllevel - {{Text|1|#F580B1}}
        {{Text|GOTO|#F0F0F0}} finishednonexec {{Text|'***no error causing code, event checking done by IF***|#31C4C4}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'END IF|#31C4C4}}
    {{Text|IF|#F0F0F0}} n = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} getelement(a$, {{Text|1|#F580B1}}) = {{Text|"END"|#FFB100}} {{Text|AND|#F0F0F0}} getelement(a$, {{Text|2|#F580B1}}) = {{Text|"IF"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} controltype(controllevel) <> {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"END IF without IF"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            layoutdone = {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} impliedendif = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                l$ = SCase$({{Text|"End"|#FFB100}} + sp + {{Text|"If"|#FFB100}})
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} layout$ = l$ {{Text|ELSE|#F0F0F0}} layout$ = layout$ + sp + l$
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} NoChecks = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} vWatchOn = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                vWatchAddLabel linenumber, {{Text|0|#F580B1}}
                WriteBufLine MainTxtBuf, {{Text|"*__LONG_VWATCH_LINENUMBER= "|#FFB100}} + str2$(linenumber) + {{Text|"; 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;"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}}
            {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} controlvalue(controllevel)
                WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}}
            {{Text|NEXT|#F0F0F0}}
            controllevel = controllevel - {{Text|1|#F580B1}}
            {{Text|GOTO|#F0F0F0}} finishednonexec {{Text|'***no error causing code, event checking done by IF***|#31C4C4}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'SELECT CASE|#31C4C4}}
    {{Text|IF|#F0F0F0}} n >= {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"SELECT"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} NoChecks = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                WriteBufLine MainTxtBuf, {{Text|"S_"|#FFB100}} + str2$(statementn) + {{Text|":;"|#FFB100}}: dynscope = {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} vWatchOn = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    vWatchAddLabel linenumber, {{Text|0|#F580B1}}
                    WriteBufLine MainTxtBuf, {{Text|"*__LONG_VWATCH_LINENUMBER= "|#FFB100}} + str2$(linenumber) + {{Text|"; 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;"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'prevents code from being placed before 'CASE condition' in a SELECT CASE block|#31C4C4}}
            {{Text|IF|#F0F0F0}} SelectCaseCounter > {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} SelectCaseHasCaseBlock(SelectCaseCounter) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                a$ = {{Text|"Expected CASE expression"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            SelectCaseCounter = SelectCaseCounter + {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} {{Text|UBOUND|#F0F0F0}}(EveryCaseSet) <= SelectCaseCounter {{Text|THEN|#F0F0F0}} {{Text|REDIM|#F0F0F0}} {{Text|_PRESERVE|#F0F0F0}} EveryCaseSet(SelectCaseCounter)
            {{Text|IF|#F0F0F0}} {{Text|UBOUND|#F0F0F0}}(SelectCaseHasCaseBlock) <= SelectCaseCounter {{Text|THEN|#F0F0F0}} {{Text|REDIM|#F0F0F0}} {{Text|_PRESERVE|#F0F0F0}} SelectCaseHasCaseBlock(SelectCaseCounter)
            SelectCaseHasCaseBlock(SelectCaseCounter) = {{Text|0|#F580B1}}
            {{Text|IF|#F0F0F0}} secondelement$ = {{Text|"EVERYCASE"|#FFB100}} {{Text|THEN|#F0F0F0}}
                EveryCaseSet(SelectCaseCounter) = {{Text|-1|#F580B1}}
                {{Text|IF|#F0F0F0}} n = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected SELECT CASE expression"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                e$ = fixoperationorder(getelements$(ca$, {{Text|3|#F580B1}}, n))
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                l$ = SCase$({{Text|"Select EveryCase "|#FFB100}}) + tlayout$
            {{Text|ELSE|#F0F0F0}}
                EveryCaseSet(SelectCaseCounter) = {{Text|0|#F580B1}}
                {{Text|IF|#F0F0F0}} n = {{Text|1|#F580B1}} {{Text|OR|#F0F0F0}} secondelement$ <> {{Text|"CASE"|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected CASE or EVERYCASE"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} n = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected SELECT CASE expression"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                e$ = fixoperationorder(getelements$(ca$, {{Text|3|#F580B1}}, n))
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                l$ = SCase$({{Text|"Select Case "|#FFB100}}) + tlayout$
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
            e$ = evaluate(e$, typ)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            u = uniquenumber
            controllevel = controllevel + {{Text|1|#F580B1}}
            controlvalue(controllevel) = {{Text|0|#F580B1}} {{Text|'id|#31C4C4}}
            t$ = {{Text|""|#FFB100}}
            {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}}
                t = {{Text|0|#F580B1}}
                {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISUDT) = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISARRAY) = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISREFERENCE) <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    controlvalue(controllevel) = {{Text|VAL|#F0F0F0}}(e$)
                {{Text|ELSE|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}} e$ = refer(e$, typ, {{Text|0|#F580B1}})
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    WriteBufLine DataTxtBuf, {{Text|"static qbs *sc_"|#FFB100}} + str2$(u) + {{Text|"=qbs_new(0,0);"|#FFB100}}
                    WriteBufLine MainTxtBuf, {{Text|"qbs_set(sc_"|#FFB100}} + str2$(u) + {{Text|","|#FFB100}} + e$ + {{Text|");"|#FFB100}}
                    {{Text|IF|#F0F0F0}} stringprocessinghappened {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, cleanupstringprocessingcall$ + {{Text|"0);"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|ELSE|#F0F0F0}}
                {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISFLOAT) {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) > {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}} t = {{Text|3|#F580B1}}: t$ = {{Text|"long double"|#FFB100}}
                    {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) = {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} t = {{Text|4|#F580B1}}: t$ = {{Text|"float"|#FFB100}}
                    {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) = {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}} t = {{Text|5|#F580B1}}: t$ = {{Text|"double"|#FFB100}}
                    {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISUDT) = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISARRAY) = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISREFERENCE) <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        controlvalue(controllevel) = {{Text|VAL|#F0F0F0}}(e$)
                    {{Text|ELSE|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}} e$ = refer(e$, typ, {{Text|0|#F580B1}})
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                        WriteBufLine DataTxtBuf, {{Text|"static "|#FFB100}} + t$ + {{Text|" sc_"|#FFB100}} + str2$(u) + {{Text|";"|#FFB100}}
                        WriteBufLine MainTxtBuf, {{Text|"sc_"|#FFB100}} + str2$(u) + {{Text|"="|#FFB100}} + e$ + {{Text|";"|#FFB100}}
                        {{Text|IF|#F0F0F0}} stringprocessinghappened {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, cleanupstringprocessingcall$ + {{Text|"0);"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|ELSE|#F0F0F0}}
                    {{Text|'non-float|#31C4C4}}
                    t = {{Text|1|#F580B1}}: t$ = {{Text|"int64"|#FFB100}}
                    {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISUNSIGNED) {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) <= {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} t = {{Text|7|#F580B1}}: t$ = {{Text|"uint32"|#FFB100}}
                        {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) > {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} t = {{Text|2|#F580B1}}: t$ = {{Text|"uint64"|#FFB100}}
                    {{Text|ELSE|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) <= {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} t = {{Text|6|#F580B1}}: t$ = {{Text|"int32"|#FFB100}}
                        {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) > {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} t = {{Text|1|#F580B1}}: t$ = {{Text|"int64"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISUDT) = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISARRAY) = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISREFERENCE) <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        controlvalue(controllevel) = {{Text|VAL|#F0F0F0}}(e$)
                    {{Text|ELSE|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}} e$ = refer(e$, typ, {{Text|0|#F580B1}})
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                        WriteBufLine DataTxtBuf, {{Text|"static "|#FFB100}} + t$ + {{Text|" sc_"|#FFB100}} + str2$(u) + {{Text|";"|#FFB100}}
                        WriteBufLine MainTxtBuf, {{Text|"sc_"|#FFB100}} + str2$(u) + {{Text|"="|#FFB100}} + e$ + {{Text|";"|#FFB100}}
                        {{Text|IF|#F0F0F0}} stringprocessinghappened {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, cleanupstringprocessingcall$ + {{Text|"0);"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            controlref(controllevel) = linenumber
            controltype(controllevel) = {{Text|10|#F580B1}} + t
            controlid(controllevel) = u
            {{Text|IF|#F0F0F0}} EveryCaseSet(SelectCaseCounter) {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"int32 sc_"|#FFB100}} + str2$(controlid(controllevel)) + {{Text|"_var;"|#FFB100}}
            {{Text|IF|#F0F0F0}} EveryCaseSet(SelectCaseCounter) {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, {{Text|"sc_"|#FFB100}} + str2$(controlid(controllevel)) + {{Text|"_var=0;"|#FFB100}}
            {{Text|GOTO|#F0F0F0}} finishedline
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'END SELECT|#31C4C4}}
    {{Text|IF|#F0F0F0}} n = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"END"|#FFB100}} {{Text|AND|#F0F0F0}} secondelement$ = {{Text|"SELECT"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|'complete current case if necessary|#31C4C4}}
            {{Text|'18=CASE (awaiting END SELECT/CASE/CASE ELSE)|#31C4C4}}
            {{Text|'19=CASE ELSE (awaiting END SELECT)|#31C4C4}}
            {{Text|IF|#F0F0F0}} controltype(controllevel) = {{Text|18|#F580B1}} {{Text|THEN|#F0F0F0}}
                everycasenewcase = everycasenewcase + {{Text|1|#F580B1}}
                WriteBufLine MainTxtBuf, {{Text|"sc_ec_"|#FFB100}} + str2$(everycasenewcase) + {{Text|"_end:;"|#FFB100}}
                controllevel = controllevel - {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} EveryCaseSet(SelectCaseCounter) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, {{Text|"goto sc_"|#FFB100}} + str2$(controlid(controllevel)) + {{Text|"_end;"|#FFB100}}
                WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} controltype(controllevel) = {{Text|19|#F580B1}} {{Text|THEN|#F0F0F0}}
                controllevel = controllevel - {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} EveryCaseSet(SelectCaseCounter) {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, {{Text|"} /* End of SELECT EVERYCASE ELSE */"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            WriteBufLine MainTxtBuf, {{Text|"sc_"|#FFB100}} + str2$(controlid(controllevel)) + {{Text|"_end:;"|#FFB100}}
            {{Text|IF|#F0F0F0}} controltype(controllevel) < {{Text|10|#F580B1}} {{Text|OR|#F0F0F0}} controltype(controllevel) > {{Text|17|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"END SELECT without SELECT CASE"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} NoChecks = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} vWatchOn = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                vWatchAddLabel linenumber, {{Text|0|#F580B1}}
                WriteBufLine MainTxtBuf, {{Text|"*__LONG_VWATCH_LINENUMBER= "|#FFB100}} + str2$(linenumber) + {{Text|"; 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;"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} SelectCaseCounter > {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} SelectCaseHasCaseBlock(SelectCaseCounter) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|'warn user of empty SELECT CASE block|#31C4C4}}
                {{Text|IF|#F0F0F0}} {{Text|NOT|#F0F0F0}} IgnoreWarnings {{Text|THEN|#F0F0F0}}
                    addWarning linenumber, inclevel, inclinenumber(inclevel), incname$(inclevel), {{Text|"empty SELECT CASE block"|#FFB100}}, {{Text|""|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            controllevel = controllevel - {{Text|1|#F580B1}}
            SelectCaseCounter = SelectCaseCounter - {{Text|1|#F580B1}}
            l$ = SCase$({{Text|"End"|#FFB100}} + sp + {{Text|"Select"|#FFB100}})
            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
            {{Text|GOTO|#F0F0F0}} finishednonexec {{Text|'***no error causing code, event checking done by SELECT CASE***|#31C4C4}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'prevents code from being placed before 'CASE condition' in a SELECT CASE block|#31C4C4}}
    {{Text|IF|#F0F0F0}} n >= {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} firstelement$ <> {{Text|"CASE"|#FFB100}} {{Text|AND|#F0F0F0}} SelectCaseCounter > {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} SelectCaseHasCaseBlock(SelectCaseCounter) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
        a$ = {{Text|"Expected CASE expression"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'CASE|#31C4C4}}
    {{Text|IF|#F0F0F0}} n >= {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"CASE"|#FFB100}} {{Text|THEN|#F0F0F0}}
            l$ = SCase$({{Text|"Case"|#FFB100}})
            {{Text|'complete current case if necessary|#31C4C4}}
            {{Text|'18=CASE (awaiting END SELECT/CASE/CASE ELSE)|#31C4C4}}
            {{Text|'19=CASE ELSE (awaiting END SELECT)|#31C4C4}}
            {{Text|IF|#F0F0F0}} controltype(controllevel) = {{Text|19|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected END SELECT"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} controltype(controllevel) = {{Text|18|#F580B1}} {{Text|THEN|#F0F0F0}}
                lhscontrollevel = lhscontrollevel - {{Text|1|#F580B1}}
                controllevel = controllevel - {{Text|1|#F580B1}}
                everycasenewcase = everycasenewcase + {{Text|1|#F580B1}}
                WriteBufLine MainTxtBuf, {{Text|"sc_ec_"|#FFB100}} + str2$(everycasenewcase) + {{Text|"_end:;"|#FFB100}}
                {{Text|IF|#F0F0F0}} EveryCaseSet(SelectCaseCounter) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    WriteBufLine MainTxtBuf, {{Text|"goto sc_"|#FFB100}} + str2$(controlid(controllevel)) + {{Text|"_end;"|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    WriteBufLine MainTxtBuf, {{Text|"sc_"|#FFB100}} + str2$(controlid(controllevel)) + {{Text|"_var=-1;"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}}
                {{Text|'following line fixes problem related to RESUME after error|#31C4C4}}
                {{Text|'statementn = statementn + 1|#31C4C4}}
                {{Text|'if nochecks=0 then WriteBufLine MainTxtBuf, "S_" + str2$(statementn) + ":;"|#31C4C4}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} controltype(controllevel) <> {{Text|6|#F580B1}} {{Text|AND|#F0F0F0}} (controltype(controllevel) < {{Text|10|#F580B1}} {{Text|OR|#F0F0F0}} controltype(controllevel) > {{Text|17|#F580B1}}) {{Text|THEN|#F0F0F0}} a$ = {{Text|"CASE without SELECT CASE"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} n = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected CASE expression"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            SelectCaseHasCaseBlock(SelectCaseCounter) = {{Text|-1|#F580B1}}
            {{Text|'upgrade:|#31C4C4}}
            {{Text|'#1: variables can be referred to directly by storing an id in 'controlref'|#31C4C4}}
            {{Text|'    (but not if part of an array etc.)|#31C4C4}}
            {{Text|'DIM controlvalue(1000) AS LONG|#31C4C4}}
            {{Text|'#2: more types will be available|#31C4C4}}
            {{Text|'    +SINGLE|#31C4C4}}
            {{Text|'    +DOUBLE|#31C4C4}}
            {{Text|'    -LONG DOUBLE|#31C4C4}}
            {{Text|'    +INT32|#31C4C4}}
            {{Text|'    +UINT32|#31C4C4}}
            {{Text|'14=SELECT CASE float ...|#31C4C4}}
            {{Text|'15=SELECT CASE double|#31C4C4}}
            {{Text|'16=SELECT CASE int32|#31C4C4}}
            {{Text|'17=SELECT CASE uint32|#31C4C4}}
            {{Text|'10=SELECT CASE qbs (awaiting END SELECT/CASE)|#31C4C4}}
            {{Text|'11=SELECT CASE int64 (awaiting END SELECT/CASE)|#31C4C4}}
            {{Text|'12=SELECT CASE uint64 (awaiting END SELECT/CASE)|#31C4C4}}
            {{Text|'13=SELECT CASE LONG double (awaiting END SELECT/CASE/CASE ELSE)|#31C4C4}}
            {{Text|'14=SELECT CASE float ...|#31C4C4}}
            {{Text|'15=SELECT CASE double|#31C4C4}}
            {{Text|'16=SELECT CASE int32|#31C4C4}}
            {{Text|'17=SELECT CASE uint32|#31C4C4}}
            {{Text|'    bits = targettyp AND 511|#31C4C4}}
            {{Text|'                                IF bits <= 16 THEN e$ = "qbr_float_to_long(" + e$ + ")"|#31C4C4}}
            {{Text|'                                IF bits > 16 AND bits < 32 THEN e$ = "qbr_double_to_long(" + e$ + ")"|#31C4C4}}
            {{Text|'                                IF bits >= 32 THEN e$ = "qbr(" + e$ + ")"|#31C4C4}}
            t = controltype(controllevel) - {{Text|10|#F580B1}}
            {{Text|'get required type cast, and float options|#31C4C4}}
            flt = {{Text|0|#F580B1}}
            {{Text|IF|#F0F0F0}} t = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} tc$ = {{Text|""|#FFB100}}
            {{Text|IF|#F0F0F0}} t = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} tc$ = {{Text|""|#FFB100}}
            {{Text|IF|#F0F0F0}} t = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} tc$ = {{Text|""|#FFB100}}
            {{Text|IF|#F0F0F0}} t = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} tc$ = {{Text|""|#FFB100}}: flt = {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} t = {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} tc$ = {{Text|"(float)"|#FFB100}}: flt = {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} t = {{Text|5|#F580B1}} {{Text|THEN|#F0F0F0}} tc$ = {{Text|"(double)"|#FFB100}}: flt = {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} t = {{Text|6|#F580B1}} {{Text|THEN|#F0F0F0}} tc$ = {{Text|""|#FFB100}}
            {{Text|IF|#F0F0F0}} t = {{Text|7|#F580B1}} {{Text|THEN|#F0F0F0}} tc$ = {{Text|""|#FFB100}}
            n$ = {{Text|"sc_"|#FFB100}} + str2$(controlid(controllevel))
            cv = controlvalue(controllevel)
            {{Text|IF|#F0F0F0}} cv {{Text|THEN|#F0F0F0}}
                n$ = refer$(str2$(cv), {{Text|0|#F580B1}}, {{Text|0|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'CASE ELSE|#31C4C4}}
            {{Text|IF|#F0F0F0}} n = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} getelement$(a$, {{Text|2|#F580B1}}) = {{Text|"C-EL"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} EveryCaseSet(SelectCaseCounter) {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, {{Text|"if (sc_"|#FFB100}} + str2$(controlid(controllevel)) + {{Text|"_var==0) {"|#FFB100}}
                    controllevel = controllevel + {{Text|1|#F580B1}}: controltype(controllevel) = {{Text|19|#F580B1}}
                    controlref(controllevel) = controlref(controllevel - {{Text|1|#F580B1}})
                    l$ = l$ + sp + SCase$({{Text|"Else"|#FFB100}})
                    layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                    {{Text|GOTO|#F0F0F0}} finishednonexec {{Text|'***no error causing code, event checking done by SELECT CASE***|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} NoChecks = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                WriteBufLine MainTxtBuf, {{Text|"S_"|#FFB100}} + str2$(statementn) + {{Text|":;"|#FFB100}}: dynscope = {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} vWatchOn = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    vWatchAddLabel linenumber, {{Text|0|#F580B1}}
                    WriteBufLine MainTxtBuf, {{Text|"*__LONG_VWATCH_LINENUMBER= "|#FFB100}} + str2$(linenumber) + {{Text|"; 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;"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            f12$ = {{Text|""|#FFB100}}
            nexp = {{Text|0|#F580B1}}
            B = {{Text|0|#F580B1}}
            e$ = {{Text|""|#FFB100}}
            {{Text|FOR|#F0F0F0}} i = {{Text|2|#F580B1}} {{Text|TO|#F0F0F0}} n
                e2$ = getelement$(ca$, i)
                {{Text|IF|#F0F0F0}} e2$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} B = B + {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} e2$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} B = B - {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} i = n {{Text|THEN|#F0F0F0}} e$ = e$ + sp + e2$
                {{Text|IF|#F0F0F0}} i = n {{Text|OR|#F0F0F0}} (e2$ = {{Text|","|#FFB100}} {{Text|AND|#F0F0F0}} B = {{Text|0|#F580B1}}) {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} nexp <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} l$ = l$ + sp2 + {{Text|","|#FFB100}}: f12$ = f12$ + {{Text|"¦¦"|#FFB100}}
                    {{Text|IF|#F0F0F0}} e$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected expression"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    e$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - {{Text|1|#F580B1}})
                    {{Text|'TYPE 1? ... TO ...|#31C4C4}}
                    n2 = numelements(e$)
                    b2 = {{Text|0|#F580B1}}
                    el$ = {{Text|""|#FFB100}}: er$ = {{Text|""|#FFB100}}
                    usedto = {{Text|0|#F580B1}}
                    {{Text|FOR|#F0F0F0}} i2 = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} n2
                        e3$ = getelement$(e$, i2)
                        {{Text|IF|#F0F0F0}} e3$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} b2 = b2 + {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} e3$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} b2 = b2 - {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} b2 = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|UCASE$|#F0F0F0}}(e3$) = {{Text|"TO"|#FFB100}} {{Text|THEN|#F0F0F0}}
                            usedto = {{Text|1|#F580B1}}
                        {{Text|ELSE|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} usedto = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} el$ = el$ + sp + e3$ {{Text|ELSE|#F0F0F0}} er$ = er$ + sp + e3$
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|NEXT|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} usedto = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} el$ = {{Text|""|#FFB100}} {{Text|OR|#F0F0F0}} er$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected expression TO expression"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                        el$ = {{Text|RIGHT$|#F0F0F0}}(el$, {{Text|LEN|#F0F0F0}}(el$) - {{Text|1|#F580B1}}): er$ = {{Text|RIGHT$|#F0F0F0}}(er$, {{Text|LEN|#F0F0F0}}(er$) - {{Text|1|#F580B1}})
                        {{Text|'evaluate each side|#31C4C4}}
                        {{Text|FOR|#F0F0F0}} i2 = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|2|#F580B1}}
                            {{Text|IF|#F0F0F0}} i2 = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = el$ {{Text|ELSE|#F0F0F0}} e$ = er$
                            e$ = fixoperationorder(e$)
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|IF|#F0F0F0}} i2 = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} l$ = l$ + sp + tlayout$ {{Text|ELSE|#F0F0F0}} l$ = l$ + sp + SCase$({{Text|"To"|#FFB100}}) + sp + tlayout$
                            e$ = evaluate(e$, typ)
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}} e$ = refer(e$, typ, {{Text|0|#F580B1}})
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|IF|#F0F0F0}} t = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISSTRING) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected string expression"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                {{Text|IF|#F0F0F0}} i2 = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} f12$ = f12$ + {{Text|"(qbs_greaterorequal("|#FFB100}} + n$ + {{Text|","|#FFB100}} + e$ + {{Text|")&&qbs_lessorequal("|#FFB100}} + n$ + {{Text|","|#FFB100}}
                                {{Text|IF|#F0F0F0}} i2 = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} f12$ = f12$ + e$ + {{Text|"))"|#FFB100}}
                            {{Text|ELSE|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected numeric expression"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                {{Text|'round to integer?|#31C4C4}}
                                {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISFLOAT) {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} t = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"qbr("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                                    {{Text|IF|#F0F0F0}} t = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"qbr_longdouble_to_uint64("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                                    {{Text|IF|#F0F0F0}} t = {{Text|6|#F580B1}} {{Text|OR|#F0F0F0}} t = {{Text|7|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"qbr_double_to_long("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|'cast result?|#31C4C4}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(tc$) {{Text|THEN|#F0F0F0}} e$ = tc$ + {{Text|"("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                                {{Text|IF|#F0F0F0}} i2 = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} f12$ = f12$ + {{Text|"(("|#FFB100}} + n$ + {{Text|">=("|#FFB100}} + e$ + {{Text|"))&&("|#FFB100}} + n$ + {{Text|"<=("|#FFB100}}
                                {{Text|IF|#F0F0F0}} i2 = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} f12$ = f12$ + e$ + {{Text|")))"|#FFB100}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|NEXT|#F0F0F0}}
                        {{Text|GOTO|#F0F0F0}} addedexp
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|'10=SELECT CASE qbs (awaiting END SELECT/CASE)|#31C4C4}}
                    {{Text|'11=SELECT CASE int64 (awaiting END SELECT/CASE)|#31C4C4}}
                    {{Text|'12=SELECT CASE uint64 (awaiting END SELECT/CASE)|#31C4C4}}
                    {{Text|'13=SELECT CASE LONG double (awaiting END SELECT/CASE/CASE ELSE)|#31C4C4}}
                    {{Text|'14=SELECT CASE float ...|#31C4C4}}
                    {{Text|'15=SELECT CASE double|#31C4C4}}
                    {{Text|'16=SELECT CASE int32|#31C4C4}}
                    {{Text|'17=SELECT CASE uint32|#31C4C4}}
                    {{Text|'    bits = targettyp AND 511|#31C4C4}}
                    {{Text|'                                IF bits <= 16 THEN e$ = "qbr_float_to_long(" + e$ + ")"|#31C4C4}}
                    {{Text|'                                IF bits > 16 AND bits < 32 THEN e$ = "qbr_double_to_long(" + e$ + ")"|#31C4C4}}
                    {{Text|'                                IF bits >= 32 THEN e$ = "qbr(" + e$ + ")"|#31C4C4}}
                    o$ = {{Text|"=="|#FFB100}} {{Text|'used by type 3|#31C4C4}}
                    {{Text|'TYPE 2?|#31C4C4}}
                    x$ = getelement$(e$, {{Text|1|#F580B1}})
                    {{Text|IF|#F0F0F0}} isoperator(x$) {{Text|THEN|#F0F0F0}} {{Text|'non-standard usage correction|#31C4C4}}
                        {{Text|IF|#F0F0F0}} x$ = {{Text|"="|#FFB100}} {{Text|OR|#F0F0F0}} x$ = {{Text|"<>"|#FFB100}} {{Text|OR|#F0F0F0}} x$ = {{Text|">"|#FFB100}} {{Text|OR|#F0F0F0}} x$ = {{Text|"<"|#FFB100}} {{Text|OR|#F0F0F0}} x$ = {{Text|">="|#FFB100}} {{Text|OR|#F0F0F0}} x$ = {{Text|"<="|#FFB100}} {{Text|THEN|#F0F0F0}}
                            e$ = {{Text|"IS"|#FFB100}} + sp + e$
                            x$ = {{Text|"IS"|#FFB100}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} {{Text|UCASE$|#F0F0F0}}(x$) = {{Text|"IS"|#FFB100}} {{Text|THEN|#F0F0F0}}
                        n2 = numelements(e$)
                        {{Text|IF|#F0F0F0}} n2 < {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected IS =,<>,>,<,>=,<= expression"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                        o$ = getelement$(e$, {{Text|2|#F580B1}})
                        o2$ = o$
                        o = {{Text|0|#F580B1}}
                        {{Text|IF|#F0F0F0}} o$ = {{Text|"="|#FFB100}} {{Text|THEN|#F0F0F0}} o$ = {{Text|"=="|#FFB100}}: o = {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} o$ = {{Text|"<>"|#FFB100}} {{Text|THEN|#F0F0F0}} o$ = {{Text|"!="|#FFB100}}: o = {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} o$ = {{Text|">"|#FFB100}} {{Text|THEN|#F0F0F0}} o = {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} o$ = {{Text|"<"|#FFB100}} {{Text|THEN|#F0F0F0}} o = {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} o$ = {{Text|">="|#FFB100}} {{Text|THEN|#F0F0F0}} o = {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} o$ = {{Text|"<="|#FFB100}} {{Text|THEN|#F0F0F0}} o = {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} o <> {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected IS =,<>,>,<,>=,<= expression"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                        l$ = l$ + sp + SCase$({{Text|"Is"|#FFB100}}) + sp + o2$
                        e$ = getelements$(e$, {{Text|3|#F580B1}}, n2)
                        {{Text|'fall through to type 3 using modified e$ & o$|#31C4C4}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|'TYPE 3? simple expression|#31C4C4}}
                    e$ = fixoperationorder(e$)
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    l$ = l$ + sp + tlayout$
                    e$ = evaluate(e$, typ)
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}} e$ = refer(e$, typ, {{Text|0|#F580B1}})
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|IF|#F0F0F0}} t = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|'string comparison|#31C4C4}}
                        {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISSTRING) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected string expression"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                        {{Text|IF|#F0F0F0}} o$ = {{Text|"=="|#FFB100}} {{Text|THEN|#F0F0F0}} o$ = {{Text|"qbs_equal"|#FFB100}}
                        {{Text|IF|#F0F0F0}} o$ = {{Text|"!="|#FFB100}} {{Text|THEN|#F0F0F0}} o$ = {{Text|"qbs_notequal"|#FFB100}}
                        {{Text|IF|#F0F0F0}} o$ = {{Text|">"|#FFB100}} {{Text|THEN|#F0F0F0}} o$ = {{Text|"qbs_greaterthan"|#FFB100}}
                        {{Text|IF|#F0F0F0}} o$ = {{Text|"<"|#FFB100}} {{Text|THEN|#F0F0F0}} o$ = {{Text|"qbs_lessthan"|#FFB100}}
                        {{Text|IF|#F0F0F0}} o$ = {{Text|">="|#FFB100}} {{Text|THEN|#F0F0F0}} o$ = {{Text|"qbs_greaterorequal"|#FFB100}}
                        {{Text|IF|#F0F0F0}} o$ = {{Text|"<="|#FFB100}} {{Text|THEN|#F0F0F0}} o$ = {{Text|"qbs_lessorequal"|#FFB100}}
                        f12$ = f12$ + o$ + {{Text|"("|#FFB100}} + n$ + {{Text|","|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                    {{Text|ELSE|#F0F0F0}}
                        {{Text|'numeric|#31C4C4}}
                        {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected numeric expression"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                        {{Text|'round to integer?|#31C4C4}}
                        {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISFLOAT) {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} t = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"qbr("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                            {{Text|IF|#F0F0F0}} t = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"qbr_longdouble_to_uint64("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                            {{Text|IF|#F0F0F0}} t = {{Text|6|#F580B1}} {{Text|OR|#F0F0F0}} t = {{Text|7|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"qbr_double_to_long("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|'cast result?|#31C4C4}}
                        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(tc$) {{Text|THEN|#F0F0F0}} e$ = tc$ + {{Text|"("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                        f12$ = f12$ + {{Text|"("|#FFB100}} + n$ + o$ + {{Text|"("|#FFB100}} + e$ + {{Text|"))"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    addedexp:
                    e$ = {{Text|""|#FFB100}}
                    nexp = nexp + {{Text|1|#F580B1}}
                {{Text|ELSE|#F0F0F0}}
                    e$ = e$ + sp + e2$
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|NEXT|#F0F0F0}}
            {{Text|IF|#F0F0F0}} stringprocessinghappened {{Text|THEN|#F0F0F0}}
                WriteBufLine MainTxtBuf, {{Text|"if (("|#FFB100}} + cleanupstringprocessingcall$ + f12$ + {{Text|"))¦¦new_error){"|#FFB100}}
            {{Text|ELSE|#F0F0F0}}
                WriteBufLine MainTxtBuf, {{Text|"if (("|#FFB100}} + f12$ + {{Text|")¦¦new_error){"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
            controllevel = controllevel + {{Text|1|#F580B1}}
            controlref(controllevel) = controlref(controllevel - {{Text|1|#F580B1}})
            controltype(controllevel) = {{Text|18|#F580B1}}
            {{Text|GOTO|#F0F0F0}} finishedline
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'static scope commands:|#31C4C4}}
    {{Text|IF|#F0F0F0}} NoChecks = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} vWatchOn = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            vWatchAddLabel linenumber, {{Text|0|#F580B1}}
            WriteBufLine MainTxtBuf, {{Text|"do{*__LONG_VWATCH_LINENUMBER= "|#FFB100}} + str2$(linenumber) + {{Text|"; 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;"|#FFB100}}
        {{Text|ELSE|#F0F0F0}}
            WriteBufLine MainTxtBuf, {{Text|"do{"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|'WriteBufLine MainTxtBuf, "S_" + str2$(statementn) + ":;"|#31C4C4}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} n > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"PALETTE"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} secondelement$ = {{Text|"USING"|#FFB100}} {{Text|THEN|#F0F0F0}}
                l$ = SCase$({{Text|"Palette"|#FFB100}} + sp + {{Text|"Using"|#FFB100}} + sp)
                {{Text|IF|#F0F0F0}} n < {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected PALETTE USING array-name"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|'check array|#31C4C4}}
                e$ = getelement$(ca$, {{Text|3|#F580B1}})
                {{Text|IF|#F0F0F0}} FindArray(e$) {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    z = {{Text|1|#F580B1}}
                    t = id.arraytype
                    {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) <> {{Text|16|#F580B1}} {{Text|AND|#F0F0F0}} (t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) <> {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} z = {{Text|0|#F580B1}}
                    {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISFLOAT {{Text|THEN|#F0F0F0}} z = {{Text|0|#F580B1}}
                    {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISOFFSETINBITS {{Text|THEN|#F0F0F0}} z = {{Text|0|#F580B1}}
                    {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}} z = {{Text|0|#F580B1}}
                    {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}} z = {{Text|0|#F580B1}}
                    {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISUNSIGNED {{Text|THEN|#F0F0F0}} z = {{Text|0|#F580B1}}
                    {{Text|IF|#F0F0F0}} z = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Array must be of type INTEGER or LONG"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    bits = t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
                    {{Text|GOTO|#F0F0F0}} pu_gotarray
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                a$ = {{Text|"Expected PALETTE USING array-name"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                pu_gotarray:
                {{Text|'add () if index not specified|#31C4C4}}
                {{Text|IF|#F0F0F0}} n = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}}
                    e$ = e$ + sp + {{Text|"("|#FFB100}} + sp + {{Text|")"|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} n = {{Text|4|#F580B1}} {{Text|OR|#F0F0F0}} getelement$(a$, {{Text|4|#F580B1}}) <> {{Text|"("|#FFB100}} {{Text|OR|#F0F0F0}} getelement$(a$, n) <> {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected PALETTE USING array-name(...)"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    e$ = e$ + sp + getelements$(ca$, {{Text|4|#F580B1}}, n)
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                e$ = fixoperationorder$(e$)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                l$ = l$ + tlayout$
                e$ = evaluatetotyp(e$, {{Text|-2|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                WriteBufLine MainTxtBuf, {{Text|"sub_paletteusing("|#FFB100}} + e$ + {{Text|","|#FFB100}} + str2(bits) + {{Text|");"|#FFB100}}
                layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                {{Text|GOTO|#F0F0F0}} finishedline
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'using|#31C4C4}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'palette|#31C4C4}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'n>1|#31C4C4}}
    {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"KEY"|#FFB100}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} n = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected KEY ..."|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
        l$ = SCase$({{Text|"KEY"|#FFB100}}) + sp
        {{Text|IF|#F0F0F0}} secondelement$ = {{Text|"OFF"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} n > {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected KEY OFF only"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            l$ = l$ + SCase$({{Text|"Off"|#FFB100}}): layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
            WriteBufLine MainTxtBuf, {{Text|"key_off();"|#FFB100}}
            {{Text|GOTO|#F0F0F0}} finishedline
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} secondelement$ = {{Text|"ON"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} n > {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected KEY ON only"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            l$ = l$ + SCase$({{Text|"On"|#FFB100}}): layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
            WriteBufLine MainTxtBuf, {{Text|"key_on();"|#FFB100}}
            {{Text|GOTO|#F0F0F0}} finishedline
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} secondelement$ = {{Text|"LIST"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} n > {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected KEY LIST only"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            l$ = l$ + SCase$({{Text|"List"|#FFB100}}): layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
            WriteBufLine MainTxtBuf, {{Text|"key_list();"|#FFB100}}
            {{Text|GOTO|#F0F0F0}} finishedline
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|'search for comma to indicate assignment|#31C4C4}}
        B = {{Text|0|#F580B1}}: e$ = {{Text|""|#FFB100}}
        {{Text|FOR|#F0F0F0}} i = {{Text|2|#F580B1}} {{Text|TO|#F0F0F0}} n
            e2$ = getelement(ca$, i)
            {{Text|IF|#F0F0F0}} e2$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} B = B + {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} e2$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} B = B - {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} e2$ = {{Text|","|#FFB100}} {{Text|AND|#F0F0F0}} B = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                i = i + {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} key_assignment
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(e$) {{Text|THEN|#F0F0F0}} e$ = e$ + sp + e2$ {{Text|ELSE|#F0F0F0}} e$ = e2$
        {{Text|NEXT|#F0F0F0}}
        {{Text|'assume KEY(x) ON/OFF/STOP and handle as a sub|#31C4C4}}
        {{Text|GOTO|#F0F0F0}} key_fallthrough
        key_assignment:
        {{Text|'KEY x, "string"|#31C4C4}}
        {{Text|'index|#31C4C4}}
        e$ = fixoperationorder(e$)
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
        l$ = l$ + tlayout$ + sp2 + {{Text|","|#FFB100}} + sp
        e$ = evaluatetotyp(e$, {{Text|32&|#F580B1}})
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
        WriteBufRawData MainTxtBuf, {{Text|"key_assign("|#FFB100}} + e$ + {{Text|","|#FFB100}}
        {{Text|'string|#31C4C4}}
        e$ = getelements$(ca$, i, n)
        e$ = fixoperationorder(e$)
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
        l$ = l$ + tlayout$
        e$ = evaluatetotyp(e$, ISSTRING)
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
        WriteBufLine MainTxtBuf, e$ + {{Text|");"|#FFB100}}
        layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
        {{Text|GOTO|#F0F0F0}} finishedline
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'KEY|#31C4C4}}
    key_fallthrough:
    {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"FIELD"|#FFB100}} {{Text|THEN|#F0F0F0}}
        {{Text|'get filenumber|#31C4C4}}
        B = {{Text|0|#F580B1}}: e$ = {{Text|""|#FFB100}}
        {{Text|FOR|#F0F0F0}} i = {{Text|2|#F580B1}} {{Text|TO|#F0F0F0}} n
            e2$ = getelement(ca$, i)
            {{Text|IF|#F0F0F0}} e2$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} B = B + {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} e2$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} B = B - {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} e2$ = {{Text|","|#FFB100}} {{Text|AND|#F0F0F0}} B = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                i = i + {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} fieldgotfn
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(e$) {{Text|THEN|#F0F0F0}} e$ = e$ + sp + e2$ {{Text|ELSE|#F0F0F0}} e$ = e2$
        {{Text|NEXT|#F0F0F0}}
        {{Text|GOTO|#F0F0F0}} fielderror
        fieldgotfn:
        {{Text|IF|#F0F0F0}} e$ = {{Text|"#"|#FFB100}} {{Text|OR|#F0F0F0}} {{Text|LEN|#F0F0F0}}(e$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} fielderror
        {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(e$, {{Text|2|#F580B1}}) = {{Text|"#"|#FFB100}} + sp {{Text|THEN|#F0F0F0}} e$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - {{Text|2|#F580B1}}): l$ = SCase$({{Text|"Field"|#FFB100}}) + sp + {{Text|"#"|#FFB100}} + sp2 {{Text|ELSE|#F0F0F0}} l$ = SCase$({{Text|"Field"|#FFB100}}) + sp
        e$ = fixoperationorder(e$)
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
        l$ = l$ + tlayout$ + sp2 + {{Text|","|#FFB100}} + sp
        e$ = evaluatetotyp(e$, {{Text|32&|#F580B1}})
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
        WriteBufLine MainTxtBuf, {{Text|"field_new("|#FFB100}} + e$ + {{Text|");"|#FFB100}}
        fieldnext:
        {{Text|'get fieldwidth|#31C4C4}}
        {{Text|IF|#F0F0F0}} i > n {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} fielderror
        B = {{Text|0|#F580B1}}: e$ = {{Text|""|#FFB100}}
        {{Text|FOR|#F0F0F0}} i = i {{Text|TO|#F0F0F0}} n
            e2$ = getelement(ca$, i)
            {{Text|IF|#F0F0F0}} e2$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} B = B + {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} e2$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} B = B - {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} {{Text|UCASE$|#F0F0F0}}(e2$) = {{Text|"AS"|#FFB100}} {{Text|AND|#F0F0F0}} B = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                i = i + {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} fieldgotfw
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(e$) {{Text|THEN|#F0F0F0}} e$ = e$ + sp + e2$ {{Text|ELSE|#F0F0F0}} e$ = e2$
        {{Text|NEXT|#F0F0F0}}
        {{Text|GOTO|#F0F0F0}} fielderror
        fieldgotfw:
        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(e$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} fielderror
        e$ = fixoperationorder(e$)
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
        l$ = l$ + tlayout$ + sp + SCase$({{Text|"As"|#FFB100}}) + sp
        sizee$ = evaluatetotyp(e$, {{Text|32&|#F580B1}})
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
        {{Text|'get variable name|#31C4C4}}
        {{Text|IF|#F0F0F0}} i > n {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} fielderror
        B = {{Text|0|#F580B1}}: e$ = {{Text|""|#FFB100}}
        {{Text|FOR|#F0F0F0}} i = i {{Text|TO|#F0F0F0}} n
            e2$ = getelement(ca$, i)
            {{Text|IF|#F0F0F0}} e2$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} B = B + {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} e2$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} B = B - {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} (i = n {{Text|OR|#F0F0F0}} e2$ = {{Text|","|#FFB100}}) {{Text|AND|#F0F0F0}} B = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} e2$ = {{Text|","|#FFB100}} {{Text|THEN|#F0F0F0}} i = i - {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} i = n {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(e$) {{Text|THEN|#F0F0F0}} e$ = e$ + sp + e2$ {{Text|ELSE|#F0F0F0}} e$ = e2$
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|GOTO|#F0F0F0}} fieldgotfname
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(e$) {{Text|THEN|#F0F0F0}} e$ = e$ + sp + e2$ {{Text|ELSE|#F0F0F0}} e$ = e2$
        {{Text|NEXT|#F0F0F0}}
        {{Text|GOTO|#F0F0F0}} fielderror
        fieldgotfname:
        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(e$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} fielderror
        {{Text|'evaluate it to check it is a STRING|#31C4C4}}
        e$ = fixoperationorder(e$)
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
        l$ = l$ + tlayout$
        e$ = evaluate(e$, typ)
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
        {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISSTRING) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} fielderror
        {{Text|IF|#F0F0F0}} typ {{Text|AND|#F0F0F0}} ISFIXEDLENGTH {{Text|THEN|#F0F0F0}} a$ = {{Text|"Fixed length strings cannot be used in a FIELD statement"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
        {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISREFERENCE) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} fielderror
        e$ = refer(e$, typ, {{Text|0|#F580B1}})
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
        WriteBufLine MainTxtBuf, {{Text|"field_add("|#FFB100}} + e$ + {{Text|","|#FFB100}} + sizee$ + {{Text|");"|#FFB100}}
        {{Text|IF|#F0F0F0}} i < n {{Text|THEN|#F0F0F0}}
            i = i + {{Text|1|#F580B1}}
            e$ = getelement(a$, i)
            {{Text|IF|#F0F0F0}} e$ <> {{Text|","|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ,"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            l$ = l$ + sp2 + {{Text|","|#FFB100}} + sp
            i = i + {{Text|1|#F580B1}}
            {{Text|GOTO|#F0F0F0}} fieldnext
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
        {{Text|GOTO|#F0F0F0}} finishedline
        fielderror: a$ = {{Text|"Expected FIELD #filenumber, characters AS variable$, ..."|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'1=IF (awaiting END IF)|#31C4C4}}
    {{Text|'2=FOR (awaiting NEXT)|#31C4C4}}
    {{Text|'3=DO (awaiting LOOP [UNTIL¦WHILE param])|#31C4C4}}
    {{Text|'4=DO WHILE/UNTIL (awaiting LOOP)|#31C4C4}}
    {{Text|'5=WHILE (awaiting WEND)|#31C4C4}}
    {{Text|IF|#F0F0F0}} n = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"EXIT"|#FFB100}} {{Text|THEN|#F0F0F0}}
            l$ = SCase$({{Text|"Exit"|#FFB100}}) + sp
            {{Text|IF|#F0F0F0}} secondelement$ = {{Text|"DO"|#FFB100}} {{Text|THEN|#F0F0F0}}
                {{Text|'scan backwards until previous control level reached|#31C4C4}}
                l$ = l$ + SCase$({{Text|"Do"|#FFB100}})
                {{Text|FOR|#F0F0F0}} i = controllevel {{Text|TO|#F0F0F0}} {{Text|1|#F580B1}} {{Text|STEP|#F0F0F0}} {{Text|-1|#F580B1}}
                    t = controltype(i)
                    {{Text|IF|#F0F0F0}} t = {{Text|3|#F580B1}} {{Text|OR|#F0F0F0}} t = {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}}
                        WriteBufLine MainTxtBuf, {{Text|"goto dl_exit_"|#FFB100}} + str2$(controlid(i)) + {{Text|";"|#FFB100}}
                        layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                        {{Text|GOTO|#F0F0F0}} finishedline
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|NEXT|#F0F0F0}}
                a$ = {{Text|"EXIT DO without DO"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} secondelement$ = {{Text|"FOR"|#FFB100}} {{Text|THEN|#F0F0F0}}
                {{Text|'scan backwards until previous control level reached|#31C4C4}}
                l$ = l$ + SCase$({{Text|"For"|#FFB100}})
                {{Text|FOR|#F0F0F0}} i = controllevel {{Text|TO|#F0F0F0}} {{Text|1|#F580B1}} {{Text|STEP|#F0F0F0}} {{Text|-1|#F580B1}}
                    t = controltype(i)
                    {{Text|IF|#F0F0F0}} t = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                        WriteBufLine MainTxtBuf, {{Text|"goto fornext_exit_"|#FFB100}} + str2$(controlid(i)) + {{Text|";"|#FFB100}}
                        layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                        {{Text|GOTO|#F0F0F0}} finishedline
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|NEXT|#F0F0F0}}
                a$ = {{Text|"EXIT FOR without FOR"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} secondelement$ = {{Text|"WHILE"|#FFB100}} {{Text|THEN|#F0F0F0}}
                {{Text|'scan backwards until previous control level reached|#31C4C4}}
                l$ = l$ + SCase$({{Text|"While"|#FFB100}})
                {{Text|FOR|#F0F0F0}} i = controllevel {{Text|TO|#F0F0F0}} {{Text|1|#F580B1}} {{Text|STEP|#F0F0F0}} {{Text|-1|#F580B1}}
                    t = controltype(i)
                    {{Text|IF|#F0F0F0}} t = {{Text|5|#F580B1}} {{Text|THEN|#F0F0F0}}
                        WriteBufLine MainTxtBuf, {{Text|"goto ww_exit_"|#FFB100}} + str2$(controlid(i)) + {{Text|";"|#FFB100}}
                        layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                        {{Text|GOTO|#F0F0F0}} finishedline
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|NEXT|#F0F0F0}}
                a$ = {{Text|"EXIT WHILE without WHILE"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} secondelement$ = {{Text|"SELECT"|#FFB100}} {{Text|THEN|#F0F0F0}}
                {{Text|'scan backwards until previous control level reached|#31C4C4}}
                l$ = l$ + SCase$({{Text|"Select"|#FFB100}})
                {{Text|FOR|#F0F0F0}} i = controllevel {{Text|TO|#F0F0F0}} {{Text|1|#F580B1}} {{Text|STEP|#F0F0F0}} {{Text|-1|#F580B1}}
                    t = controltype(i)
                    {{Text|IF|#F0F0F0}} t = {{Text|18|#F580B1}} {{Text|OR|#F0F0F0}} t = {{Text|19|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'CASE/CASE ELSE|#31C4C4}}
                        WriteBufLine MainTxtBuf, {{Text|"goto sc_"|#FFB100}} + str2$(controlid(i - {{Text|1|#F580B1}})) + {{Text|"_end;"|#FFB100}}
                        layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                        {{Text|GOTO|#F0F0F0}} finishedline
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|NEXT|#F0F0F0}}
                a$ = {{Text|"EXIT SELECT without SELECT"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} secondelement$ = {{Text|"CASE"|#FFB100}} {{Text|THEN|#F0F0F0}}
                {{Text|'scan backwards until previous control level reached|#31C4C4}}
                l$ = l$ + SCase$({{Text|"Case"|#FFB100}})
                {{Text|FOR|#F0F0F0}} i = controllevel {{Text|TO|#F0F0F0}} {{Text|1|#F580B1}} {{Text|STEP|#F0F0F0}} {{Text|-1|#F580B1}}
                    t = controltype(i)
                    {{Text|IF|#F0F0F0}} t = {{Text|18|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'CASE|#31C4C4}}
                        WriteBufLine MainTxtBuf, {{Text|"goto sc_ec_"|#FFB100}} + str2$(everycasenewcase + {{Text|1|#F580B1}}) + {{Text|"_end;"|#FFB100}}
                        layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                        {{Text|GOTO|#F0F0F0}} finishedline
                    {{Text|ELSEIF|#F0F0F0}} t = {{Text|19|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'CASE ELSE|#31C4C4}}
                        WriteBufLine MainTxtBuf, {{Text|"goto sc_"|#FFB100}} + str2$(controlid(i - {{Text|1|#F580B1}})) + {{Text|"_end;"|#FFB100}}
                        layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                        {{Text|GOTO|#F0F0F0}} finishedline
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|NEXT|#F0F0F0}}
                a$ = {{Text|"EXIT CASE without CASE"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} n >= {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"ON"|#FFB100}} {{Text|AND|#F0F0F0}} secondelement$ = {{Text|"STRIG"|#FFB100}} {{Text|THEN|#F0F0F0}}
            DEPENDENCY(DEPENDENCY_DEVICEINPUT) = {{Text|1|#F580B1}}
            i = {{Text|3|#F580B1}}
            {{Text|IF|#F0F0F0}} i > n {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ("|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            a2$ = getelement$(ca$, i): i = i + {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} a2$ <> {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ("|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            l$ = SCase$({{Text|"On"|#FFB100}} + sp + {{Text|"Strig"|#FFB100}} + sp2 + {{Text|"("|#FFB100}})
            {{Text|IF|#F0F0F0}} i > n {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ..."|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            B = {{Text|0|#F580B1}}
            x = {{Text|0|#F580B1}}
            e2$ = {{Text|""|#FFB100}}
            e3$ = {{Text|""|#FFB100}}
            {{Text|FOR|#F0F0F0}} i = i {{Text|TO|#F0F0F0}} n
                e$ = getelement$(ca$, i)
                a = {{Text|ASC|#F0F0F0}}(e$)
                {{Text|IF|#F0F0F0}} a = {{Text|40|#F580B1}} {{Text|THEN|#F0F0F0}} B = B + {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} a = {{Text|41|#F580B1}} {{Text|THEN|#F0F0F0}} B = B - {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} B = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} onstriggotarg
                {{Text|IF|#F0F0F0}} a = {{Text|44|#F580B1}} {{Text|AND|#F0F0F0}} B = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    x = x + {{Text|1|#F580B1}}
                    {{Text|IF|#F0F0F0}} x > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected )"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|IF|#F0F0F0}} e2$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ... ,"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    e3$ = e2$
                    e2$ = {{Text|""|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(e2$) {{Text|THEN|#F0F0F0}} e2$ = e2$ + sp + e$ {{Text|ELSE|#F0F0F0}} e2$ = e$
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|NEXT|#F0F0F0}}
            a$ = {{Text|"Expected )"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            onstriggotarg:
            {{Text|IF|#F0F0F0}} e2$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ... )"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            WriteBufRawData MainTxtBuf, {{Text|"onstrig_setup("|#FFB100}}
            {{Text|'sort scanned results|#31C4C4}}
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(e3$) {{Text|THEN|#F0F0F0}}
                optI$ = e3$
                optController$ = e2$
                optPassed$ = {{Text|"1"|#FFB100}}
            {{Text|ELSE|#F0F0F0}}
                optI$ = e2$
                optController$ = {{Text|"0"|#FFB100}}
                optPassed$ = {{Text|"0"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'i|#31C4C4}}
            e$ = fixoperationorder$(optI$): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            l$ = l$ + sp2 + tlayout$
            e$ = evaluatetotyp(e$, {{Text|32&|#F580B1}}): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            WriteBufRawData MainTxtBuf, e$ + {{Text|","|#FFB100}}
            {{Text|'controller , passed|#31C4C4}}
            {{Text|IF|#F0F0F0}} optPassed$ = {{Text|"1"|#FFB100}} {{Text|THEN|#F0F0F0}}
                e$ = fixoperationorder$(optController$): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                l$ = l$ + sp2 + {{Text|","|#FFB100}} + sp + tlayout$
                e$ = evaluatetotyp(e$, {{Text|32&|#F580B1}}): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|ELSE|#F0F0F0}}
                e$ = optController$
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            WriteBufRawData MainTxtBuf, e$ + {{Text|","|#FFB100}} + optPassed$ + {{Text|","|#FFB100}}
            l$ = l$ + sp2 + {{Text|")"|#FFB100}} + sp {{Text|'close brackets|#31C4C4}}
            i = i + {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} i > n {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected GOSUB/sub-name"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            a2$ = getelement$(a$, i): i = i + {{Text|1|#F580B1}}
            onstrigid = onstrigid + {{Text|1|#F580B1}}
            WriteBufRawData MainTxtBuf, str2$(onstrigid) + {{Text|","|#FFB100}}
            {{Text|IF|#F0F0F0}} a2$ = {{Text|"GOSUB"|#FFB100}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} i > n {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected linenumber/label"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                a2$ = getelement$(ca$, i): i = i + {{Text|1|#F580B1}}
                WriteBufLine MainTxtBuf, {{Text|"0);"|#FFB100}}
                {{Text|IF|#F0F0F0}} validlabel(a2$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Invalid label"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                v = HashFind(a2$, HASHFLAG_LABEL, ignore, r)
                x = {{Text|1|#F580B1}}
                labchk60z:
                {{Text|IF|#F0F0F0}} v {{Text|THEN|#F0F0F0}}
                    s = Labels(r).Scope
                    {{Text|IF|#F0F0F0}} s = {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} s = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'main scope?|#31C4C4}}
                        {{Text|IF|#F0F0F0}} s = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} Labels(r).Scope = {{Text|0|#F580B1}} {{Text|'acquire scope|#31C4C4}}
                        x = {{Text|0|#F580B1}} {{Text|'already defined|#31C4C4}}
                        tlayout$ = {{Text|RTRIM$|#F0F0F0}}(Labels(r).cn)
                        Labels(r).Scope_Restriction = subfuncn
                        Labels(r).Error_Line = linenumber
                    {{Text|ELSE|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} v = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} v = HashFindCont(ignore, r): {{Text|GOTO|#F0F0F0}} labchk60z
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} x {{Text|THEN|#F0F0F0}}
                    {{Text|'does not exist|#31C4C4}}
                    nLabels = nLabels + {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} nLabels > Labels_Ubound {{Text|THEN|#F0F0F0}} Labels_Ubound = Labels_Ubound * {{Text|2|#F580B1}}: {{Text|REDIM|#F0F0F0}} {{Text|_PRESERVE|#F0F0F0}} Labels({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} Labels_Ubound) {{Text|AS|#F0F0F0}} Label_Type
                    Labels(nLabels) = Empty_Label
                    HashAdd a2$, HASHFLAG_LABEL, nLabels
                    r = nLabels
                    Labels(r).State = {{Text|0|#F580B1}}
                    Labels(r).cn = tlayout$
                    Labels(r).Scope = {{Text|0|#F580B1}}
                    Labels(r).Error_Line = linenumber
                    Labels(r).Scope_Restriction = subfuncn
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'x|#31C4C4}}
                l$ = l$ + SCase$({{Text|"GoSub"|#FFB100}}) + sp + tlayout$
                WriteBufLine StrigjTxtBuf, {{Text|"if(strig_event_id=="|#FFB100}} + str2$(onstrigid) + {{Text|")goto LABEL_"|#FFB100}} + a2$ + {{Text|";"|#FFB100}}
                WriteBufLine StrigTxtBuf, {{Text|"case "|#FFB100}} + str2$(onstrigid) + {{Text|":"|#FFB100}}
                WriteBufLine StrigTxtBuf, {{Text|"strig_event_occurred++;"|#FFB100}}
                WriteBufLine StrigTxtBuf, {{Text|"strig_event_id="|#FFB100}} + str2$(onstrigid) + {{Text|";"|#FFB100}}
                WriteBufLine StrigTxtBuf, {{Text|"strig_event_occurred++;"|#FFB100}}
                WriteBufLine StrigTxtBuf, {{Text|"return_point[next_return_point++]=0;"|#FFB100}}
                WriteBufLine StrigTxtBuf, {{Text|"if (next_return_point>=return_points) more_return_points();"|#FFB100}}
                WriteBufLine StrigTxtBuf, {{Text|"QBMAIN(NULL);"|#FFB100}}
                WriteBufLine StrigTxtBuf, {{Text|"break;"|#FFB100}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} layout$ = l$ {{Text|ELSE|#F0F0F0}} layout$ = layout$ + sp + l$
                layoutdone = {{Text|1|#F580B1}}
                {{Text|GOTO|#F0F0F0}} finishedline
            {{Text|ELSE|#F0F0F0}}
                {{Text|'establish whether sub a2$ exists using try|#31C4C4}}
                x = {{Text|0|#F580B1}}
                try = findid(a2$)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
                    {{Text|IF|#F0F0F0}} id.subfunc = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} x = {{Text|1|#F580B1}}: {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(a2$) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|LOOP|#F0F0F0}}
                {{Text|IF|#F0F0F0}} x = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected GOSUB/sub"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                l$ = l$ + {{Text|RTRIM$|#F0F0F0}}(id.cn)
                WriteBufLine StrigTxtBuf, {{Text|"case "|#FFB100}} + str2$(onstrigid) + {{Text|":"|#FFB100}}
                WriteBufRawData StrigTxtBuf, {{Text|RTRIM$|#F0F0F0}}(id.callname) + {{Text|"("|#FFB100}}
                {{Text|IF|#F0F0F0}} id.args > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"SUB requires more than one argument"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} i > n {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} id.args = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected argument after SUB"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    WriteBufLine MainTxtBuf, {{Text|"0);"|#FFB100}}
                    WriteBufLine StrigTxtBuf, {{Text|");"|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} id.args = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"SUB has no arguments"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    t = {{Text|CVL|#F0F0F0}}(id.arg)
                    B = t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
                    {{Text|IF|#F0F0F0}} B = {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISARRAY) <> {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISFLOAT) <> {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISSTRING) <> {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISOFFSETINBITS) <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Only SUB arguments of integer-type allowed"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|IF|#F0F0F0}} B = {{Text|8|#F580B1}} {{Text|THEN|#F0F0F0}} ct$ = {{Text|"int8"|#FFB100}}
                    {{Text|IF|#F0F0F0}} B = {{Text|16|#F580B1}} {{Text|THEN|#F0F0F0}} ct$ = {{Text|"int16"|#FFB100}}
                    {{Text|IF|#F0F0F0}} B = {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} ct$ = {{Text|"int32"|#FFB100}}
                    {{Text|IF|#F0F0F0}} B = {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}} ct$ = {{Text|"int64"|#FFB100}}
                    {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISOFFSET {{Text|THEN|#F0F0F0}} ct$ = {{Text|"ptrszint"|#FFB100}}
                    {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISUNSIGNED {{Text|THEN|#F0F0F0}} ct$ = {{Text|"u"|#FFB100}} + ct$
                    WriteBufLine StrigTxtBuf, {{Text|"("|#FFB100}} + ct$ + {{Text|"*)&i64);"|#FFB100}}
                    e$ = getelements$(ca$, i, n)
                    e$ = fixoperationorder$(e$)
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    l$ = l$ + sp + tlayout$
                    e$ = evaluatetotyp(e$, INTEGER64TYPE - ISPOINTER)
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    WriteBufLine MainTxtBuf, e$ + {{Text|");"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                WriteBufLine StrigTxtBuf, {{Text|"break;"|#FFB100}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} layout$ = l$ {{Text|ELSE|#F0F0F0}} layout$ = layout$ + sp + l$
                layoutdone = {{Text|1|#F580B1}}
                {{Text|GOTO|#F0F0F0}} finishedline
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} n >= {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"ON"|#FFB100}} {{Text|AND|#F0F0F0}} secondelement$ = {{Text|"TIMER"|#FFB100}} {{Text|THEN|#F0F0F0}}
            i = {{Text|3|#F580B1}}
            {{Text|IF|#F0F0F0}} i > n {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ("|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            a2$ = getelement$(ca$, i): i = i + {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} a2$ <> {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ("|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            l$ = SCase$({{Text|"On"|#FFB100}} + sp + {{Text|"Timer"|#FFB100}} + sp2 + {{Text|"("|#FFB100}})
            {{Text|IF|#F0F0F0}} i > n {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ..."|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            B = {{Text|0|#F580B1}}
            x = {{Text|0|#F580B1}}
            e2$ = {{Text|""|#FFB100}}
            e3$ = {{Text|""|#FFB100}}
            {{Text|FOR|#F0F0F0}} i = i {{Text|TO|#F0F0F0}} n
                e$ = getelement$(ca$, i)
                a = {{Text|ASC|#F0F0F0}}(e$)
                {{Text|IF|#F0F0F0}} a = {{Text|40|#F580B1}} {{Text|THEN|#F0F0F0}} B = B + {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} a = {{Text|41|#F580B1}} {{Text|THEN|#F0F0F0}} B = B - {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} B = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} ontimgotarg
                {{Text|IF|#F0F0F0}} a = {{Text|44|#F580B1}} {{Text|AND|#F0F0F0}} B = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    x = x + {{Text|1|#F580B1}}
                    {{Text|IF|#F0F0F0}} x > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected )"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|IF|#F0F0F0}} e2$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ... ,"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    e3$ = e2$
                    e2$ = {{Text|""|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(e2$) {{Text|THEN|#F0F0F0}} e2$ = e2$ + sp + e$ {{Text|ELSE|#F0F0F0}} e2$ = e$
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|NEXT|#F0F0F0}}
            a$ = {{Text|"Expected )"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            ontimgotarg:
            {{Text|IF|#F0F0F0}} e2$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ... )"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            WriteBufRawData MainTxtBuf, {{Text|"ontimer_setup("|#FFB100}}
            {{Text|'i|#31C4C4}}
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(e3$) {{Text|THEN|#F0F0F0}}
                e$ = fixoperationorder$(e3$)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                l$ = l$ + sp2 + tlayout$ + {{Text|","|#FFB100}} + sp
                e$ = evaluatetotyp(e$, {{Text|32&|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                WriteBufRawData MainTxtBuf, e$ + {{Text|","|#FFB100}}
            {{Text|ELSE|#F0F0F0}}
                WriteBufRawData MainTxtBuf, {{Text|"0,"|#FFB100}}
                l$ = l$ + sp2
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'sec|#31C4C4}}
            e$ = fixoperationorder$(e2$)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            l$ = l$ + tlayout$ + sp2 + {{Text|")"|#FFB100}} + sp
            e$ = evaluatetotyp(e$, DOUBLETYPE - ISPOINTER)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            WriteBufRawData MainTxtBuf, e$ + {{Text|","|#FFB100}}
            i = i + {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} i > n {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected GOSUB/sub-name"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            a2$ = getelement$(a$, i): i = i + {{Text|1|#F580B1}}
            ontimerid = ontimerid + {{Text|1|#F580B1}}
            WriteBufRawData MainTxtBuf, str2$(ontimerid) + {{Text|","|#FFB100}}
            {{Text|IF|#F0F0F0}} a2$ = {{Text|"GOSUB"|#FFB100}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} i > n {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected linenumber/label"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                a2$ = getelement$(ca$, i): i = i + {{Text|1|#F580B1}}
                WriteBufLine MainTxtBuf, {{Text|"0);"|#FFB100}}
                {{Text|IF|#F0F0F0}} validlabel(a2$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Invalid label"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                v = HashFind(a2$, HASHFLAG_LABEL, ignore, r)
                x = {{Text|1|#F580B1}}
                labchk60:
                {{Text|IF|#F0F0F0}} v {{Text|THEN|#F0F0F0}}
                    s = Labels(r).Scope
                    {{Text|IF|#F0F0F0}} s = {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} s = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'main scope?|#31C4C4}}
                        {{Text|IF|#F0F0F0}} s = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} Labels(r).Scope = {{Text|0|#F580B1}} {{Text|'acquire scope|#31C4C4}}
                        x = {{Text|0|#F580B1}} {{Text|'already defined|#31C4C4}}
                        tlayout$ = {{Text|RTRIM$|#F0F0F0}}(Labels(r).cn)
                        Labels(r).Scope_Restriction = subfuncn
                        Labels(r).Error_Line = linenumber
                    {{Text|ELSE|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} v = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} v = HashFindCont(ignore, r): {{Text|GOTO|#F0F0F0}} labchk60
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} x {{Text|THEN|#F0F0F0}}
                    {{Text|'does not exist|#31C4C4}}
                    nLabels = nLabels + {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} nLabels > Labels_Ubound {{Text|THEN|#F0F0F0}} Labels_Ubound = Labels_Ubound * {{Text|2|#F580B1}}: {{Text|REDIM|#F0F0F0}} {{Text|_PRESERVE|#F0F0F0}} Labels({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} Labels_Ubound) {{Text|AS|#F0F0F0}} Label_Type
                    Labels(nLabels) = Empty_Label
                    HashAdd a2$, HASHFLAG_LABEL, nLabels
                    r = nLabels
                    Labels(r).State = {{Text|0|#F580B1}}
                    Labels(r).cn = tlayout$
                    Labels(r).Scope = {{Text|0|#F580B1}}
                    Labels(r).Error_Line = linenumber
                    Labels(r).Scope_Restriction = subfuncn
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'x|#31C4C4}}
                l$ = l$ + SCase$({{Text|"GoSub"|#FFB100}}) + sp + tlayout$
                WriteBufLine TimejTxtBuf, {{Text|"if(timer_event_id=="|#FFB100}} + str2$(ontimerid) + {{Text|")goto LABEL_"|#FFB100}} + a2$ + {{Text|";"|#FFB100}}
                WriteBufLine TimeTxtBuf, {{Text|"case "|#FFB100}} + str2$(ontimerid) + {{Text|":"|#FFB100}}
                WriteBufLine TimeTxtBuf, {{Text|"timer_event_occurred++;"|#FFB100}}
                WriteBufLine TimeTxtBuf, {{Text|"timer_event_id="|#FFB100}} + str2$(ontimerid) + {{Text|";"|#FFB100}}
                WriteBufLine TimeTxtBuf, {{Text|"timer_event_occurred++;"|#FFB100}}
                WriteBufLine TimeTxtBuf, {{Text|"return_point[next_return_point++]=0;"|#FFB100}}
                WriteBufLine TimeTxtBuf, {{Text|"if (next_return_point>=return_points) more_return_points();"|#FFB100}}
                WriteBufLine TimeTxtBuf, {{Text|"QBMAIN(NULL);"|#FFB100}}
                WriteBufLine TimeTxtBuf, {{Text|"break;"|#FFB100}}
                {{Text|'call validlabel (to validate the label) [see goto]|#31C4C4}}
                {{Text|'increment ontimerid|#31C4C4}}
                {{Text|'use ontimerid to generate the jumper routine|#31C4C4}}
                {{Text|'etc.|#31C4C4}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} layout$ = l$ {{Text|ELSE|#F0F0F0}} layout$ = layout$ + sp + l$
                layoutdone = {{Text|1|#F580B1}}
                {{Text|GOTO|#F0F0F0}} finishedline
            {{Text|ELSE|#F0F0F0}}
                {{Text|'establish whether sub a2$ exists using try|#31C4C4}}
                x = {{Text|0|#F580B1}}
                try = findid(a2$)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
                    {{Text|IF|#F0F0F0}} id.subfunc = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} x = {{Text|1|#F580B1}}: {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(a2$) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|LOOP|#F0F0F0}}
                {{Text|IF|#F0F0F0}} x = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected GOSUB/sub"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                l$ = l$ + {{Text|RTRIM$|#F0F0F0}}(id.cn)
                WriteBufLine TimeTxtBuf, {{Text|"case "|#FFB100}} + str2$(ontimerid) + {{Text|":"|#FFB100}}
                WriteBufRawData TimeTxtBuf, {{Text|RTRIM$|#F0F0F0}}(id.callname) + {{Text|"("|#FFB100}}
                {{Text|IF|#F0F0F0}} id.args > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"SUB requires more than one argument"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} i > n {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} id.args = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected argument after SUB"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    WriteBufLine MainTxtBuf, {{Text|"0);"|#FFB100}}
                    WriteBufLine TimeTxtBuf, {{Text|");"|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} id.args = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"SUB has no arguments"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    t = {{Text|CVL|#F0F0F0}}(id.arg)
                    B = t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
                    {{Text|IF|#F0F0F0}} B = {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISARRAY) <> {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISFLOAT) <> {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISSTRING) <> {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISOFFSETINBITS) <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Only SUB arguments of integer-type allowed"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|IF|#F0F0F0}} B = {{Text|8|#F580B1}} {{Text|THEN|#F0F0F0}} ct$ = {{Text|"int8"|#FFB100}}
                    {{Text|IF|#F0F0F0}} B = {{Text|16|#F580B1}} {{Text|THEN|#F0F0F0}} ct$ = {{Text|"int16"|#FFB100}}
                    {{Text|IF|#F0F0F0}} B = {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} ct$ = {{Text|"int32"|#FFB100}}
                    {{Text|IF|#F0F0F0}} B = {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}} ct$ = {{Text|"int64"|#FFB100}}
                    {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISOFFSET {{Text|THEN|#F0F0F0}} ct$ = {{Text|"ptrszint"|#FFB100}}
                    {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISUNSIGNED {{Text|THEN|#F0F0F0}} ct$ = {{Text|"u"|#FFB100}} + ct$
                    WriteBufLine TimeTxtBuf, {{Text|"("|#FFB100}} + ct$ + {{Text|"*)&i64);"|#FFB100}}
                    e$ = getelements$(ca$, i, n)
                    e$ = fixoperationorder$(e$)
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    l$ = l$ + sp + tlayout$
                    e$ = evaluatetotyp(e$, INTEGER64TYPE - ISPOINTER)
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    WriteBufLine MainTxtBuf, e$ + {{Text|");"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                WriteBufLine TimeTxtBuf, {{Text|"break;"|#FFB100}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} layout$ = l$ {{Text|ELSE|#F0F0F0}} layout$ = layout$ + sp + l$
                layoutdone = {{Text|1|#F580B1}}
                {{Text|GOTO|#F0F0F0}} finishedline
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} n >= {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"ON"|#FFB100}} {{Text|AND|#F0F0F0}} secondelement$ = {{Text|"KEY"|#FFB100}} {{Text|THEN|#F0F0F0}}
            i = {{Text|3|#F580B1}}
            {{Text|IF|#F0F0F0}} i > n {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ("|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            a2$ = getelement$(ca$, i): i = i + {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} a2$ <> {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ("|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            l$ = SCase$({{Text|"On"|#FFB100}} + sp + {{Text|"Key"|#FFB100}} + sp2 + {{Text|"("|#FFB100}})
            {{Text|IF|#F0F0F0}} i > n {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ..."|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            B = {{Text|0|#F580B1}}
            x = {{Text|0|#F580B1}}
            e2$ = {{Text|""|#FFB100}}
            {{Text|FOR|#F0F0F0}} i = i {{Text|TO|#F0F0F0}} n
                e$ = getelement$(ca$, i)
                a = {{Text|ASC|#F0F0F0}}(e$)
                {{Text|IF|#F0F0F0}} a = {{Text|40|#F580B1}} {{Text|THEN|#F0F0F0}} B = B + {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} a = {{Text|41|#F580B1}} {{Text|THEN|#F0F0F0}} B = B - {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} B = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(e2$) {{Text|THEN|#F0F0F0}} e2$ = e2$ + sp + e$ {{Text|ELSE|#F0F0F0}} e2$ = e$
            {{Text|NEXT|#F0F0F0}}
            {{Text|IF|#F0F0F0}} i = n + {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected )"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} e2$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ... )"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            e$ = fixoperationorder$(e2$)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            l$ = l$ + tlayout$ + sp2 + {{Text|")"|#FFB100}} + sp
            e$ = evaluatetotyp(e$, DOUBLETYPE - ISPOINTER)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            WriteBufRawData MainTxtBuf, {{Text|"onkey_setup("|#FFB100}} + e$ + {{Text|","|#FFB100}}
            i = i + {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} i > n {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected GOSUB/sub-name"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            a2$ = getelement$(a$, i): i = i + {{Text|1|#F580B1}}
            onkeyid = onkeyid + {{Text|1|#F580B1}}
            WriteBufRawData MainTxtBuf, str2$(onkeyid) + {{Text|","|#FFB100}}
            {{Text|IF|#F0F0F0}} a2$ = {{Text|"GOSUB"|#FFB100}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} i > n {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected linenumber/label"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                a2$ = getelement$(ca$, i): i = i + {{Text|1|#F580B1}}
                WriteBufLine MainTxtBuf, {{Text|"0);"|#FFB100}}
                {{Text|IF|#F0F0F0}} validlabel(a2$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Invalid label"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                v = HashFind(a2$, HASHFLAG_LABEL, ignore, r)
                x = {{Text|1|#F580B1}}
                labchk61:
                {{Text|IF|#F0F0F0}} v {{Text|THEN|#F0F0F0}}
                    s = Labels(r).Scope
                    {{Text|IF|#F0F0F0}} s = {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} s = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'main scope?|#31C4C4}}
                        {{Text|IF|#F0F0F0}} s = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} Labels(r).Scope = {{Text|0|#F580B1}} {{Text|'acquire scope|#31C4C4}}
                        x = {{Text|0|#F580B1}} {{Text|'already defined|#31C4C4}}
                        tlayout$ = {{Text|RTRIM$|#F0F0F0}}(Labels(r).cn)
                        Labels(r).Scope_Restriction = subfuncn
                        Labels(r).Error_Line = linenumber
                    {{Text|ELSE|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} v = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} v = HashFindCont(ignore, r): {{Text|GOTO|#F0F0F0}} labchk61
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} x {{Text|THEN|#F0F0F0}}
                    {{Text|'does not exist|#31C4C4}}
                    nLabels = nLabels + {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} nLabels > Labels_Ubound {{Text|THEN|#F0F0F0}} Labels_Ubound = Labels_Ubound * {{Text|2|#F580B1}}: {{Text|REDIM|#F0F0F0}} {{Text|_PRESERVE|#F0F0F0}} Labels({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} Labels_Ubound) {{Text|AS|#F0F0F0}} Label_Type
                    Labels(nLabels) = Empty_Label
                    HashAdd a2$, HASHFLAG_LABEL, nLabels
                    r = nLabels
                    Labels(r).State = {{Text|0|#F580B1}}
                    Labels(r).cn = tlayout$
                    Labels(r).Scope = {{Text|0|#F580B1}}
                    Labels(r).Error_Line = linenumber
                    Labels(r).Scope_Restriction = subfuncn
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'x|#31C4C4}}
                l$ = l$ + SCase$({{Text|"GoSub"|#FFB100}}) + sp + tlayout$
                WriteBufLine KeyjTxtBuf, {{Text|"if(key_event_id=="|#FFB100}} + str2$(onkeyid) + {{Text|")goto LABEL_"|#FFB100}} + a2$ + {{Text|";"|#FFB100}}
                WriteBufLine KeyTxtBuf, {{Text|"case "|#FFB100}} + str2$(onkeyid) + {{Text|":"|#FFB100}}
                WriteBufLine KeyTxtBuf, {{Text|"key_event_occurred++;"|#FFB100}}
                WriteBufLine KeyTxtBuf, {{Text|"key_event_id="|#FFB100}} + str2$(onkeyid) + {{Text|";"|#FFB100}}
                WriteBufLine KeyTxtBuf, {{Text|"key_event_occurred++;"|#FFB100}}
                WriteBufLine KeyTxtBuf, {{Text|"return_point[next_return_point++]=0;"|#FFB100}}
                WriteBufLine KeyTxtBuf, {{Text|"if (next_return_point>=return_points) more_return_points();"|#FFB100}}
                WriteBufLine KeyTxtBuf, {{Text|"QBMAIN(NULL);"|#FFB100}}
                WriteBufLine KeyTxtBuf, {{Text|"break;"|#FFB100}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} layout$ = l$ {{Text|ELSE|#F0F0F0}} layout$ = layout$ + sp + l$
                layoutdone = {{Text|1|#F580B1}}
                {{Text|GOTO|#F0F0F0}} finishedline
            {{Text|ELSE|#F0F0F0}}
                {{Text|'establish whether sub a2$ exists using try|#31C4C4}}
                x = {{Text|0|#F580B1}}
                try = findid(a2$)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
                    {{Text|IF|#F0F0F0}} id.subfunc = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} x = {{Text|1|#F580B1}}: {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(a2$) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|LOOP|#F0F0F0}}
                {{Text|IF|#F0F0F0}} x = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected GOSUB/sub"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                l$ = l$ + {{Text|RTRIM$|#F0F0F0}}(id.cn)
                WriteBufLine KeyTxtBuf, {{Text|"case "|#FFB100}} + str2$(onkeyid) + {{Text|":"|#FFB100}}
                WriteBufRawData KeyTxtBuf, {{Text|RTRIM$|#F0F0F0}}(id.callname) + {{Text|"("|#FFB100}}
                {{Text|IF|#F0F0F0}} id.args > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"SUB requires more than one argument"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} i > n {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} id.args = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected argument after SUB"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    WriteBufLine MainTxtBuf, {{Text|"0);"|#FFB100}}
                    WriteBufLine KeyTxtBuf, {{Text|");"|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} id.args = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"SUB has no arguments"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    t = {{Text|CVL|#F0F0F0}}(id.arg)
                    B = t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
                    {{Text|IF|#F0F0F0}} B = {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISARRAY) <> {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISFLOAT) <> {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISSTRING) <> {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISOFFSETINBITS) <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Only SUB arguments of integer-type allowed"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|IF|#F0F0F0}} B = {{Text|8|#F580B1}} {{Text|THEN|#F0F0F0}} ct$ = {{Text|"int8"|#FFB100}}
                    {{Text|IF|#F0F0F0}} B = {{Text|16|#F580B1}} {{Text|THEN|#F0F0F0}} ct$ = {{Text|"int16"|#FFB100}}
                    {{Text|IF|#F0F0F0}} B = {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} ct$ = {{Text|"int32"|#FFB100}}
                    {{Text|IF|#F0F0F0}} B = {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}} ct$ = {{Text|"int64"|#FFB100}}
                    {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISOFFSET {{Text|THEN|#F0F0F0}} ct$ = {{Text|"ptrszint"|#FFB100}}
                    {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISUNSIGNED {{Text|THEN|#F0F0F0}} ct$ = {{Text|"u"|#FFB100}} + ct$
                    WriteBufLine KeyTxtBuf, {{Text|"("|#FFB100}} + ct$ + {{Text|"*)&i64);"|#FFB100}}
                    e$ = getelements$(ca$, i, n)
                    e$ = fixoperationorder$(e$)
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    l$ = l$ + sp + tlayout$
                    e$ = evaluatetotyp(e$, INTEGER64TYPE - ISPOINTER)
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    WriteBufLine MainTxtBuf, e$ + {{Text|");"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                WriteBufLine KeyTxtBuf, {{Text|"break;"|#FFB100}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} layout$ = l$ {{Text|ELSE|#F0F0F0}} layout$ = layout$ + sp + l$
                layoutdone = {{Text|1|#F580B1}}
                {{Text|GOTO|#F0F0F0}} finishedline
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'SHARED (SUB)|#31C4C4}}
    {{Text|IF|#F0F0F0}} n >= {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"SHARED"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} n = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected SHARED ..."|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            i = {{Text|2|#F580B1}}
            {{Text|IF|#F0F0F0}} subfuncn = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"SHARED must be used within a SUB/FUNCTION"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            l$ = SCase$({{Text|"Shared"|#FFB100}})
            subfuncshr:
            {{Text|'get variable name|#31C4C4}}
            n$ = getelement$(ca$, i): i = i + {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} n$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected SHARED variable-name or SHARED AS type variable-list"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} {{Text|UCASE$|#F0F0F0}}(n$) <> {{Text|"AS"|#FFB100}} {{Text|THEN|#F0F0F0}}
                {{Text|'traditional dim syntax for SHARED|#31C4C4}}
                newSharedSyntax = {{Text|0|#F580B1}}
                s$ = removesymbol(n$)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                l2$ = s$ {{Text|'either symbol or nothing|#31C4C4}}
                {{Text|'array?|#31C4C4}}
                a = {{Text|0|#F580B1}}
                {{Text|IF|#F0F0F0}} getelement$(a$, i) = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} getelement$(a$, i + {{Text|1|#F580B1}}) <> {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ()"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    i = i + {{Text|2|#F580B1}}
                    a = {{Text|1|#F580B1}}
                    l2$ = l2$ + sp2 + {{Text|"("|#FFB100}} + sp2 + {{Text|")"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                method = {{Text|1|#F580B1}}
                {{Text|'specific type?|#31C4C4}}
                t$ = {{Text|""|#FFB100}}
                ts$ = {{Text|""|#FFB100}}
                t3$ = {{Text|""|#FFB100}}
                {{Text|IF|#F0F0F0}} getelement$(a$, i) = {{Text|"AS"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    l2$ = l2$ + sp + SCase$({{Text|"As"|#FFB100}})
                    getshrtyp:
                    i = i + {{Text|1|#F580B1}}
                    t2$ = getelement$(a$, i)
                    {{Text|IF|#F0F0F0}} t2$ <> {{Text|","|#FFB100}} {{Text|AND|#F0F0F0}} t2$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} t$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} t$ = t2$ {{Text|ELSE|#F0F0F0}} t$ = t$ + {{Text|" "|#FFB100}} + t2$
                        {{Text|IF|#F0F0F0}} t3$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} t3$ = t2$ {{Text|ELSE|#F0F0F0}} t3$ = t3$ + sp + t2$
                        {{Text|GOTO|#F0F0F0}} getshrtyp
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} t$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected AS type"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    t = typname2typ(t$)
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISINCONVENTIONALMEMORY {{Text|THEN|#F0F0F0}} t = t - ISINCONVENTIONALMEMORY
                    {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISPOINTER {{Text|THEN|#F0F0F0}} t = t - ISPOINTER
                    {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISREFERENCE {{Text|THEN|#F0F0F0}} t = t - ISREFERENCE
                    tsize = typname2typsize
                    method = {{Text|0|#F580B1}}
                    {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISUDT) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        ts$ = type2symbol$(t$)
                        l2$ = l2$ + sp + SCase2$(t3$)
                    {{Text|ELSE|#F0F0F0}}
                        t3$ = {{Text|RTRIM$|#F0F0F0}}(udtxcname(t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}))
                        {{Text|IF|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(udtxcname(t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}})) = {{Text|"_MEM"|#FFB100}} {{Text|AND|#F0F0F0}} {{Text|UCASE$|#F0F0F0}}(t$) = {{Text|"MEM"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                            t3$ = {{Text|MID$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(udtxcname(t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}})), {{Text|2|#F580B1}})
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        l2$ = l2$ + sp + t3$
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'as|#31C4C4}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(s$) <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|LEN|#F0F0F0}}(t$) <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected symbol or AS type after variable name"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|'no symbol of type specified, apply default|#31C4C4}}
                {{Text|IF|#F0F0F0}} s$ = {{Text|""|#FFB100}} {{Text|AND|#F0F0F0}} t$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(n$, {{Text|1|#F580B1}}) = {{Text|"_"|#FFB100}} {{Text|THEN|#F0F0F0}} v = {{Text|27|#F580B1}} {{Text|ELSE|#F0F0F0}} v = {{Text|ASC|#F0F0F0}}({{Text|UCASE$|#F0F0F0}}(n$)) - {{Text|64|#F580B1}}
                    s$ = defineextaz(v)
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                NormalSharedBlock:
                {{Text|'switch to main module|#31C4C4}}
                oldsubfunc$ = subfunc$
                subfunc$ = {{Text|""|#FFB100}}
                defdatahandle = GlobTxtBuf
                DataTxtBuf = OpenBuffer%({{Text|"A"|#FFB100}}, tmpdir$ + {{Text|"maindata.txt"|#FFB100}})
                FreeTxtBuf = OpenBuffer%({{Text|"A"|#FFB100}}, tmpdir$ + {{Text|"mainfree.txt"|#FFB100}})
                {{Text|'use 'try' to locate the variable (if it already exists)|#31C4C4}}
                n2$ = n$ + s$ + ts$ {{Text|'note: either ts$ or s$ will exist unless it is a UDT|#31C4C4}}
                try = findid(n2$)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
                    {{Text|IF|#F0F0F0}} a {{Text|THEN|#F0F0F0}}
                        {{Text|'an array|#31C4C4}}
                        {{Text|IF|#F0F0F0}} id.arraytype {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(t$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} shrfound
                            t2 = id.arraytype: t2size = id.tsize
                            {{Text|IF|#F0F0F0}} t2 {{Text|AND|#F0F0F0}} ISINCONVENTIONALMEMORY {{Text|THEN|#F0F0F0}} t2 = t2 - ISINCONVENTIONALMEMORY
                            {{Text|IF|#F0F0F0}} t2 {{Text|AND|#F0F0F0}} ISPOINTER {{Text|THEN|#F0F0F0}} t2 = t2 - ISPOINTER
                            {{Text|IF|#F0F0F0}} t2 {{Text|AND|#F0F0F0}} ISREFERENCE {{Text|THEN|#F0F0F0}} t2 = t2 - ISREFERENCE
                            {{Text|IF|#F0F0F0}} t = t2 {{Text|AND|#F0F0F0}} tsize = t2size {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} shrfound
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|ELSE|#F0F0F0}}
                        {{Text|'not an array|#31C4C4}}
                        {{Text|IF|#F0F0F0}} id.t {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(t$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} shrfound
                            t2 = id.t: t2size = id.tsize
                            {{Text|IF|#F0F0F0}} t2 {{Text|AND|#F0F0F0}} ISINCONVENTIONALMEMORY {{Text|THEN|#F0F0F0}} t2 = t2 - ISINCONVENTIONALMEMORY
                            {{Text|IF|#F0F0F0}} t2 {{Text|AND|#F0F0F0}} ISPOINTER {{Text|THEN|#F0F0F0}} t2 = t2 - ISPOINTER
                            {{Text|IF|#F0F0F0}} t2 {{Text|AND|#F0F0F0}} ISREFERENCE {{Text|THEN|#F0F0F0}} t2 = t2 - ISREFERENCE
                            {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"SHARED:comparing:"|#FFB100}}; t; t2, tsize; t2size
                            {{Text|IF|#F0F0F0}} t = t2 {{Text|AND|#F0F0F0}} tsize = t2size {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} shrfound
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(n2$) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|LOOP|#F0F0F0}}
                {{Text|'unknown variable|#31C4C4}}
                {{Text|IF|#F0F0F0}} a {{Text|THEN|#F0F0F0}} a$ = {{Text|"Array '"|#FFB100}} + n$ + {{Text|"' not defined"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|'create variable|#31C4C4}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(s$) {{Text|THEN|#F0F0F0}} typ$ = s$ {{Text|ELSE|#F0F0F0}} typ$ = t$
                {{Text|IF|#F0F0F0}} optionexplicit {{Text|THEN|#F0F0F0}} a$ = {{Text|"Variable '"|#FFB100}} + n$ + {{Text|"' ("|#FFB100}} + symbol2fulltypename$(typ$) + {{Text|") not defined"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                bypassNextVariable = {{Text|-1|#F580B1}}
                retval = dim2(n$, typ$, method, {{Text|""|#FFB100}})
                manageVariableList {{Text|""|#FFB100}}, vWatchNewVariable$, {{Text|0|#F580B1}}, {{Text|2|#F580B1}}
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|'note: variable created!|#31C4C4}}
                shrfound:
                {{Text|IF|#F0F0F0}} newSharedSyntax = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    l$ = l$ + sp + {{Text|RTRIM$|#F0F0F0}}(id.cn) + l2$
                {{Text|ELSE|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} sharedAsLayoutAdded = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        sharedAsLayoutAdded = {{Text|-1|#F580B1}}
                        l$ = l$ + l2$ + sp$ + {{Text|RTRIM$|#F0F0F0}}(id.cn) + l3$
                    {{Text|ELSE|#F0F0F0}}
                        l$ = l$ + sp$ + {{Text|RTRIM$|#F0F0F0}}(id.cn) + l3$
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                ids(currentid).share = ids(currentid).share {{Text|OR|#F0F0F0}} {{Text|2|#F580B1}} {{Text|'set as temporarily shared|#31C4C4}}
                {{Text|'method must apply to the current sub/function regardless of how the variable was defined in 'main'|#31C4C4}}
                lmay = {{Text|LEN|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(id.mayhave)): lmust = {{Text|LEN|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(id.musthave))
                {{Text|IF|#F0F0F0}} lmay <> {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} lmust <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (method = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} lmust = {{Text|0|#F580B1}}) {{Text|OR|#F0F0F0}} (method = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} lmay = {{Text|0|#F580B1}}) {{Text|THEN|#F0F0F0}}
                        revertmaymusthaven = revertmaymusthaven + {{Text|1|#F580B1}}
                        revertmaymusthave(revertmaymusthaven) = currentid
                        {{Text|SWAP|#F0F0F0}} ids(currentid).musthave, ids(currentid).mayhave
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'switch back to sub/func|#31C4C4}}
                subfunc$ = oldsubfunc$
                DataTxtBuf = OpenBuffer%({{Text|"A"|#FFB100}}, tmpdir$ + {{Text|"data"|#FFB100}} + str2$(subfuncn) + {{Text|".txt"|#FFB100}})
                FreeTxtBuf = OpenBuffer%({{Text|"A"|#FFB100}}, tmpdir$ + {{Text|"free"|#FFB100}} + str2$(subfuncn) + {{Text|".txt"|#FFB100}})
                defdatahandle = DataTxtBuf
                {{Text|IF|#F0F0F0}} newSharedSyntax {{Text|THEN|#F0F0F0}} {{Text|RETURN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} getelement$(a$, i) = {{Text|","|#FFB100}} {{Text|THEN|#F0F0F0}} i = i + {{Text|1|#F580B1}}: l$ = l$ + sp2 + {{Text|","|#FFB100}}: {{Text|GOTO|#F0F0F0}} subfuncshr
                {{Text|IF|#F0F0F0}} getelement$(a$, i) <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ,"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                {{Text|GOTO|#F0F0F0}} finishedline
            {{Text|ELSE|#F0F0F0}}
                {{Text|'new dim syntax for SHARED!|#31C4C4}}
                i = i - {{Text|1|#F580B1}} {{Text|'relocate back to "AS"|#31C4C4}}
                {{Text|'estabilish the data type:|#31C4C4}}
                t$ = {{Text|""|#FFB100}}
                ts$ = {{Text|""|#FFB100}}
                t3$ = {{Text|""|#FFB100}}
                n$ = {{Text|""|#FFB100}}
                previousElement$ = {{Text|""|#FFB100}}
                l2$ = sp + SCase$({{Text|"As"|#FFB100}})
                sharedAsLayoutAdded = {{Text|0|#F580B1}}
                getshrtyp2:
                i = i + {{Text|1|#F580B1}}
                t2$ = getelement$(a$, i)
                {{Text|IF|#F0F0F0}} t2$ <> {{Text|","|#FFB100}} {{Text|AND|#F0F0F0}} t2$ <> {{Text|"("|#FFB100}} {{Text|AND|#F0F0F0}} t2$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|'get first variable name|#31C4C4}}
                    n$ = getelement$(ca$, i)
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(previousElement$) {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} t$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} t$ = previousElement$ {{Text|ELSE|#F0F0F0}} t$ = t$ + {{Text|" "|#FFB100}} + previousElement$
                        {{Text|IF|#F0F0F0}} t3$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} t3$ = previousElement$ {{Text|ELSE|#F0F0F0}} t3$ = t3$ + sp + previousElement$
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    previousElement$ = t2$
                    {{Text|GOTO|#F0F0F0}} getshrtyp2
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} t$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected SHARED AS type variable-list or SHARED variable-name AS type"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                t = typname2typ(t$)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISINCONVENTIONALMEMORY {{Text|THEN|#F0F0F0}} t = t - ISINCONVENTIONALMEMORY
                {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISPOINTER {{Text|THEN|#F0F0F0}} t = t - ISPOINTER
                {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISREFERENCE {{Text|THEN|#F0F0F0}} t = t - ISREFERENCE
                tsize = typname2typsize
                method = {{Text|0|#F580B1}}
                {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISUDT) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    ts$ = type2symbol$(t$)
                    l2$ = l2$ + sp + SCase2$(t3$)
                {{Text|ELSE|#F0F0F0}}
                    t3$ = {{Text|RTRIM$|#F0F0F0}}(udtxcname(t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}))
                    {{Text|IF|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(udtxcname(t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}})) = {{Text|"_MEM"|#FFB100}} {{Text|AND|#F0F0F0}} {{Text|UCASE$|#F0F0F0}}(t$) = {{Text|"MEM"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                        t3$ = {{Text|MID$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(udtxcname(t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}})), {{Text|2|#F580B1}})
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    l2$ = l2$ + sp + t3$
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                subfuncshr2:
                s$ = removesymbol(n$)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} s$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
                    a$ = {{Text|"Cannot use type symbol with SHARED AS type variable-list ("|#FFB100}} + s$ + {{Text|")"|#FFB100}}
                    {{Text|GOTO|#F0F0F0}} errmes
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'array?|#31C4C4}}
                a = {{Text|0|#F580B1}}
                l3$ = {{Text|""|#FFB100}}
                {{Text|IF|#F0F0F0}} getelement$(a$, i) = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} getelement$(a$, i + {{Text|1|#F580B1}}) <> {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ()"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    i = i + {{Text|2|#F580B1}}
                    a = {{Text|1|#F580B1}}
                    l3$ = sp2 + {{Text|"("|#FFB100}} + sp2 + {{Text|")"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                newSharedSyntax = {{Text|-1|#F580B1}}
                {{Text|GOSUB|#F0F0F0}} NormalSharedBlock
                newSharedSyntax = {{Text|0|#F580B1}}
                {{Text|IF|#F0F0F0}} getelement$(a$, i) = {{Text|","|#FFB100}} {{Text|THEN|#F0F0F0}}
                    i = i + {{Text|1|#F580B1}}
                    l$ = l$ + sp2 + {{Text|","|#FFB100}}
                    {{Text|'get next variable name|#31C4C4}}
                    n$ = getelement$(ca$, i): i = i + {{Text|1|#F580B1}}
                    {{Text|GOTO|#F0F0F0}} subfuncshr2
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} getelement$(a$, i) <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ,"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                {{Text|GOTO|#F0F0F0}} finishedline
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'EXIT SUB/FUNCTION|#31C4C4}}
    {{Text|IF|#F0F0F0}} n = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"EXIT"|#FFB100}} {{Text|THEN|#F0F0F0}}
            sf = {{Text|0|#F580B1}}
            {{Text|IF|#F0F0F0}} secondelement$ = {{Text|"FUNCTION"|#FFB100}} {{Text|THEN|#F0F0F0}} sf = {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} secondelement$ = {{Text|"SUB"|#FFB100}} {{Text|THEN|#F0F0F0}} sf = {{Text|2|#F580B1}}
            {{Text|IF|#F0F0F0}} sf {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(subfunc) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"EXIT "|#FFB100}} + secondelement$ + {{Text|" must be used within a "|#FFB100}} + secondelement$: {{Text|GOTO|#F0F0F0}} errmes
                WriteBufLine MainTxtBuf, {{Text|"goto exit_subfunc;"|#FFB100}}
                {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(subfunc, {{Text|4|#F580B1}}) = {{Text|"SUB_"|#FFB100}} {{Text|THEN|#F0F0F0}} secondelement$ = SCase$({{Text|"Sub"|#FFB100}}) {{Text|ELSE|#F0F0F0}} secondelement$ = SCase$({{Text|"Function"|#FFB100}})
                l$ = SCase$({{Text|"Exit"|#FFB100}}) + sp + secondelement$
                layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                {{Text|GOTO|#F0F0F0}} finishedline
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'_ECHO checking|#31C4C4}}
    {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"_ECHO"|#FFB100}} {{Text|OR|#F0F0F0}} (firstelement$ = {{Text|"ECHO"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}}{{Text|_Console|#F0F0F0}} = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            a$ = qb64prefix$ + {{Text|"ECHO requires $CONSOLE or $CONSOLE:ONLY to be set first"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'ASC statement (fully inline)|#31C4C4}}
    {{Text|IF|#F0F0F0}} n >= {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"ASC"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} getelement$(a$, {{Text|2|#F580B1}}) <> {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ( after ASC"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|'calculate 3 parts|#31C4C4}}
            useposition = {{Text|0|#F580B1}}
            part = {{Text|1|#F580B1}}
            i = {{Text|3|#F580B1}}
            a3$ = {{Text|""|#FFB100}}
            stringvariable$ = {{Text|""|#FFB100}}
            position$ = {{Text|""|#FFB100}}
            B = {{Text|0|#F580B1}}
            {{Text|DO|#F0F0F0}}
                {{Text|IF|#F0F0F0}} i > n {{Text|THEN|#F0F0F0}} {{Text|'got part 3|#31C4C4}}
                    {{Text|IF|#F0F0F0}} part <> {{Text|3|#F580B1}} {{Text|OR|#F0F0F0}} {{Text|LEN|#F0F0F0}}(a3$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ASC ( ... , ... ) = ..."|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    expression$ = a3$
                    {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                a2$ = getelement$(ca$, i)
                {{Text|IF|#F0F0F0}} a2$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} B = B + {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} a2$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} B = B - {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} B = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} part = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'eg. ASC(a$)=65|#31C4C4}}
                        {{Text|IF|#F0F0F0}} getelement$(a$, i + {{Text|1|#F580B1}}) <> {{Text|"="|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ="|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                        stringvariable$ = a3$
                        position$ = {{Text|"1"|#FFB100}}
                        part = {{Text|3|#F580B1}}: a3$ = {{Text|""|#FFB100}}: i = i + {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} ascgotpart
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} part = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'eg. ASC(a$,i)=65|#31C4C4}}
                        {{Text|IF|#F0F0F0}} getelement$(a$, i + {{Text|1|#F580B1}}) <> {{Text|"="|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ="|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                        useposition = {{Text|1|#F580B1}}
                        position$ = a3$
                        part = {{Text|3|#F580B1}}: a3$ = {{Text|""|#FFB100}}: i = i + {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} ascgotpart
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|'fall through, already in part 3|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} a2$ = {{Text|","|#FFB100}} {{Text|AND|#F0F0F0}} B = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} part = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} stringvariable$ = a3$: part = {{Text|2|#F580B1}}: a3$ = {{Text|""|#FFB100}}: {{Text|GOTO|#F0F0F0}} ascgotpart
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(a3$) {{Text|THEN|#F0F0F0}} a3$ = a3$ + sp + a2$ {{Text|ELSE|#F0F0F0}} a3$ = a2$
                ascgotpart:
                i = i + {{Text|1|#F580B1}}
            {{Text|LOOP|#F0F0F0}}
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(stringvariable$) = {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} {{Text|LEN|#F0F0F0}}(position$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ASC ( ... , ... ) = ..."|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|'validate stringvariable$|#31C4C4}}
            stringvariable$ = fixoperationorder$(stringvariable$)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            l$ = SCase$({{Text|"Asc"|#FFB100}}) + sp2 + {{Text|"("|#FFB100}} + sp2 + tlayout$
            e$ = evaluate(stringvariable$, sourcetyp)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) = {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ASC ( string-variable , ..."|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            stringvariable$ = evaluatetotyp(stringvariable$, ISSTRING)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} position$ = {{Text|"1"|#FFB100}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} useposition {{Text|THEN|#F0F0F0}} l$ = l$ + sp2 + {{Text|","|#FFB100}} + sp + {{Text|"1"|#FFB100}} + sp2 + {{Text|")"|#FFB100}} + sp + {{Text|"="|#FFB100}} {{Text|ELSE|#F0F0F0}} l$ = l$ + sp2 + {{Text|")"|#FFB100}} + sp + {{Text|"="|#FFB100}}
                WriteBufLine MainTxtBuf, {{Text|"tqbs="|#FFB100}} + stringvariable$ + {{Text|"; if (!new_error){"|#FFB100}}
                e$ = fixoperationorder$(expression$)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                l$ = l$ + sp + tlayout$
                e$ = evaluatetotyp(e$, {{Text|32&|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                WriteBufLine MainTxtBuf, {{Text|"tmp_long="|#FFB100}} + e$ + {{Text|"; if (!new_error){"|#FFB100}}
                WriteBufLine MainTxtBuf, {{Text|"if (tqbs->len){tqbs->chr[0]=tmp_long;}else{error(5);}"|#FFB100}}
                WriteBufLine MainTxtBuf, {{Text|"}}"|#FFB100}}
            {{Text|ELSE|#F0F0F0}}
                WriteBufLine MainTxtBuf, {{Text|"tqbs="|#FFB100}} + stringvariable$ + {{Text|"; if (!new_error){"|#FFB100}}
                e$ = fixoperationorder$(position$)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                l$ = l$ + sp2 + {{Text|","|#FFB100}} + sp + tlayout$ + sp2 + {{Text|")"|#FFB100}} + sp + {{Text|"="|#FFB100}}
                e$ = evaluatetotyp(e$, {{Text|32&|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                WriteBufLine MainTxtBuf, {{Text|"tmp_fileno="|#FFB100}} + e$ + {{Text|"; if (!new_error){"|#FFB100}}
                e$ = fixoperationorder$(expression$)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                l$ = l$ + sp + tlayout$
                e$ = evaluatetotyp(e$, {{Text|32&|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                WriteBufLine MainTxtBuf, {{Text|"tmp_long="|#FFB100}} + e$ + {{Text|"; if (!new_error){"|#FFB100}}
                WriteBufLine MainTxtBuf, {{Text|"if ((tmp_fileno>0)&&(tmp_fileno<=tqbs->len)){tqbs->chr[tmp_fileno-1]=tmp_long;}else{error(5);}"|#FFB100}}
                WriteBufLine MainTxtBuf, {{Text|"}}}"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
            {{Text|GOTO|#F0F0F0}} finishedline
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'MID$ statement|#31C4C4}}
    {{Text|IF|#F0F0F0}} n >= {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"MID$"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} getelement$(a$, {{Text|2|#F580B1}}) <> {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ( after MID$"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|'calculate 4 parts|#31C4C4}}
            length$ = {{Text|""|#FFB100}}
            part = {{Text|1|#F580B1}}
            i = {{Text|3|#F580B1}}
            a3$ = {{Text|""|#FFB100}}
            stringvariable$ = {{Text|""|#FFB100}}
            start$ = {{Text|""|#FFB100}}
            B = {{Text|0|#F580B1}}
            {{Text|DO|#F0F0F0}}
                {{Text|IF|#F0F0F0}} i > n {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} part <> {{Text|4|#F580B1}} {{Text|OR|#F0F0F0}} a3$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected MID$(...)=..."|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    stringexpression$ = a3$
                    {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                a2$ = getelement$(ca$, i)
                {{Text|IF|#F0F0F0}} a2$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} B = B + {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} a2$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} B = B - {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} B = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} part = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} getelement$(a$, i + {{Text|1|#F580B1}}) <> {{Text|"="|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected = after )"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                        start$ = a3$: part = {{Text|4|#F580B1}}: a3$ = {{Text|""|#FFB100}}: i = i + {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} midgotpart
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} part = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} getelement$(a$, i + {{Text|1|#F580B1}}) <> {{Text|"="|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected = after )"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                        {{Text|IF|#F0F0F0}} a3$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Omit , before ) if omitting length in MID$ statement"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                        length$ = a3$: part = {{Text|4|#F580B1}}: a3$ = {{Text|""|#FFB100}}: i = i + {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} midgotpart
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} a2$ = {{Text|","|#FFB100}} {{Text|AND|#F0F0F0}} B = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} part = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} stringvariable$ = a3$: part = {{Text|2|#F580B1}}: a3$ = {{Text|""|#FFB100}}: {{Text|GOTO|#F0F0F0}} midgotpart
                    {{Text|IF|#F0F0F0}} part = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} start$ = a3$: part = {{Text|3|#F580B1}}: a3$ = {{Text|""|#FFB100}}: {{Text|GOTO|#F0F0F0}} midgotpart
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(a3$) {{Text|THEN|#F0F0F0}} a3$ = a3$ + sp + a2$ {{Text|ELSE|#F0F0F0}} a3$ = a2$
                midgotpart:
                i = i + {{Text|1|#F580B1}}
            {{Text|LOOP|#F0F0F0}}
            {{Text|IF|#F0F0F0}} stringvariable$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Syntax error - first parameter must be a string variable/array-element"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} start$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Syntax error - second parameter not optional"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|'check if it is a valid source string|#31C4C4}}
            stringvariable$ = fixoperationorder$(stringvariable$)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            l$ = SCase$({{Text|"Mid$"|#FFB100}}) + sp2 + {{Text|"("|#FFB100}} + sp2 + tlayout$
            e$ = evaluate(stringvariable$, sourcetyp)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) = {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"MID$ expects a string variable/array-element as its first argument"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            stringvariable$ = evaluatetotyp(stringvariable$, ISSTRING)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            start$ = fixoperationorder$(start$)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            l$ = l$ + sp2 + {{Text|","|#FFB100}} + sp + tlayout$
            start$ = evaluatetotyp((start$), {{Text|32&|#F580B1}})
            stringexpression$ = fixoperationorder$(stringexpression$)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            l2$ = tlayout$
            stringexpression$ = evaluatetotyp(stringexpression$, ISSTRING)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(length$) {{Text|THEN|#F0F0F0}}
                length$ = fixoperationorder$(length$)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                l$ = l$ + sp2 + {{Text|","|#FFB100}} + sp + tlayout$
                length$ = evaluatetotyp(length$, {{Text|32&|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                WriteBufLine MainTxtBuf, {{Text|"sub_mid("|#FFB100}} + stringvariable$ + {{Text|","|#FFB100}} + start$ + {{Text|","|#FFB100}} + length$ + {{Text|","|#FFB100}} + stringexpression$ + {{Text|",1);"|#FFB100}}
            {{Text|ELSE|#F0F0F0}}
                WriteBufLine MainTxtBuf, {{Text|"sub_mid("|#FFB100}} + stringvariable$ + {{Text|","|#FFB100}} + start$ + {{Text|",0,"|#FFB100}} + stringexpression$ + {{Text|",0);"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            l$ = l$ + sp2 + {{Text|")"|#FFB100}} + sp + {{Text|"="|#FFB100}} + sp + l2$
            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
            {{Text|GOTO|#F0F0F0}} finishedline
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} n >= {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"ERASE"|#FFB100}} {{Text|THEN|#F0F0F0}}
            i = {{Text|2|#F580B1}}
            l$ = SCase$({{Text|"Erase"|#FFB100}})
            erasenextarray:
            var$ = getelement$(ca$, i)
            x$ = var$: ls$ = removesymbol(x$)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} FindArray(var$) {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                l$ = l$ + sp + {{Text|RTRIM$|#F0F0F0}}(id.cn) + ls$
                {{Text|'erase the array|#31C4C4}}
                clearerase:
                n$ = {{Text|RTRIM$|#F0F0F0}}(id.callname)
                bytesperelement$ = str2((id.arraytype {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}})
                {{Text|IF|#F0F0F0}} id.arraytype {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}} bytesperelement$ = str2(id.tsize)
                {{Text|IF|#F0F0F0}} id.arraytype {{Text|AND|#F0F0F0}} ISOFFSETINBITS {{Text|THEN|#F0F0F0}} bytesperelement$ = str2((id.arraytype {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}})) + {{Text|"/8+1"|#FFB100}}
                {{Text|IF|#F0F0F0}} id.arraytype {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}}
                    bytesperelement$ = str2(udtxsize(id.arraytype {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}})
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                WriteBufLine MainTxtBuf, {{Text|"if ("|#FFB100}} + n$ + {{Text|"[2]&1){"|#FFB100}} {{Text|'array is defined|#31C4C4}}
                WriteBufLine MainTxtBuf, {{Text|"if ("|#FFB100}} + n$ + {{Text|"[2]&2){"|#FFB100}} {{Text|'array is static|#31C4C4}}
                {{Text|IF|#F0F0F0}} (id.arraytype {{Text|AND|#F0F0F0}} ISSTRING) <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} (id.arraytype {{Text|AND|#F0F0F0}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    WriteBufRawData MainTxtBuf, {{Text|"tmp_long="|#FFB100}}
                    {{Text|FOR|#F0F0F0}} i2 = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|ABS|#F0F0F0}}(id.arrayelements)
                        {{Text|IF|#F0F0F0}} i2 <> {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufRawData MainTxtBuf, {{Text|"*"|#FFB100}}
                        WriteBufRawData MainTxtBuf, n$ + {{Text|"["|#FFB100}} + str2(i2 * {{Text|4|#F580B1}} - {{Text|4|#F580B1}} + {{Text|5|#F580B1}}) + {{Text|"]"|#FFB100}}
                    {{Text|NEXT|#F0F0F0}}
                    WriteBufLine MainTxtBuf, {{Text|";"|#FFB100}}
                    WriteBufLine MainTxtBuf, {{Text|"while(tmp_long--){"|#FFB100}}
                    WriteBufLine MainTxtBuf, {{Text|"((qbs*)(((uint64*)("|#FFB100}} + n$ + {{Text|"[0]))[tmp_long]))->len=0;"|#FFB100}}
                    WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    {{Text|'numeric|#31C4C4}}
                    {{Text|'clear array|#31C4C4}}
                    WriteBufRawData MainTxtBuf, {{Text|"memset((void*)("|#FFB100}} + n$ + {{Text|"[0]),0,"|#FFB100}}
                    {{Text|FOR|#F0F0F0}} i2 = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|ABS|#F0F0F0}}(id.arrayelements)
                        {{Text|IF|#F0F0F0}} i2 <> {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufRawData MainTxtBuf, {{Text|"*"|#FFB100}}
                        WriteBufRawData MainTxtBuf, n$ + {{Text|"["|#FFB100}} + str2(i2 * {{Text|4|#F580B1}} - {{Text|4|#F580B1}} + {{Text|5|#F580B1}}) + {{Text|"]"|#FFB100}}
                    {{Text|NEXT|#F0F0F0}}
                    WriteBufLine MainTxtBuf, {{Text|"*"|#FFB100}} + bytesperelement$ + {{Text|");"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                WriteBufLine MainTxtBuf, {{Text|"}else{"|#FFB100}} {{Text|'array is dynamic|#31C4C4}}
                {{Text|'1. free memory & any allocated strings|#31C4C4}}
                {{Text|IF|#F0F0F0}} (id.arraytype {{Text|AND|#F0F0F0}} ISSTRING) <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} (id.arraytype {{Text|AND|#F0F0F0}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|'free strings|#31C4C4}}
                    WriteBufRawData MainTxtBuf, {{Text|"tmp_long="|#FFB100}}
                    {{Text|FOR|#F0F0F0}} i2 = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|ABS|#F0F0F0}}(id.arrayelements)
                        {{Text|IF|#F0F0F0}} i2 <> {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufRawData MainTxtBuf, {{Text|"*"|#FFB100}}
                        WriteBufRawData MainTxtBuf, n$ + {{Text|"["|#FFB100}} + str2(i2 * {{Text|4|#F580B1}} - {{Text|4|#F580B1}} + {{Text|5|#F580B1}}) + {{Text|"]"|#FFB100}}
                    {{Text|NEXT|#F0F0F0}}
                    WriteBufLine MainTxtBuf, {{Text|";"|#FFB100}}
                    WriteBufLine MainTxtBuf, {{Text|"while(tmp_long--){"|#FFB100}}
                    WriteBufLine MainTxtBuf, {{Text|"qbs_free((qbs*)(((uint64*)("|#FFB100}} + n$ + {{Text|"[0]))[tmp_long]));"|#FFB100}}
                    WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}}
                    {{Text|'free memory|#31C4C4}}
                    WriteBufLine MainTxtBuf, {{Text|"free((void*)("|#FFB100}} + n$ + {{Text|"[0]));"|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    {{Text|'free memory|#31C4C4}}
                    WriteBufLine MainTxtBuf, {{Text|"if ("|#FFB100}} + n$ + {{Text|"[2]&4){"|#FFB100}} {{Text|'cmem array|#31C4C4}}
                    WriteBufLine MainTxtBuf, {{Text|"cmem_dynamic_free((uint8*)("|#FFB100}} + n$ + {{Text|"[0]));"|#FFB100}}
                    WriteBufLine MainTxtBuf, {{Text|"}else{"|#FFB100}} {{Text|'non-cmem array|#31C4C4}}
                    WriteBufLine MainTxtBuf, {{Text|"free((void*)("|#FFB100}} + n$ + {{Text|"[0]));"|#FFB100}}
                    WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'2. set array (and its elements) as undefined|#31C4C4}}
                WriteBufLine MainTxtBuf, n$ + {{Text|"[2]^=1;"|#FFB100}} {{Text|'remove defined flag, keeping other flags (such as cmem)|#31C4C4}}
                {{Text|'set dimensions as undefined|#31C4C4}}
                {{Text|FOR|#F0F0F0}} i2 = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|ABS|#F0F0F0}}(id.arrayelements)
                    B = i2 * {{Text|4|#F580B1}}
                    WriteBufLine MainTxtBuf, n$ + {{Text|"["|#FFB100}} + str2(B) + {{Text|"]=2147483647;"|#FFB100}} {{Text|'base|#31C4C4}}
                    WriteBufLine MainTxtBuf, n$ + {{Text|"["|#FFB100}} + str2(B + {{Text|1|#F580B1}}) + {{Text|"]=0;"|#FFB100}} {{Text|'num. index|#31C4C4}}
                    WriteBufLine MainTxtBuf, n$ + {{Text|"["|#FFB100}} + str2(B + {{Text|2|#F580B1}}) + {{Text|"]=0;"|#FFB100}} {{Text|'multiplier|#31C4C4}}
                {{Text|NEXT|#F0F0F0}}
                {{Text|IF|#F0F0F0}} (id.arraytype {{Text|AND|#F0F0F0}} ISSTRING) <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} (id.arraytype {{Text|AND|#F0F0F0}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    WriteBufLine MainTxtBuf, n$ + {{Text|"[0]=(ptrszint)&nothingstring;"|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    WriteBufLine MainTxtBuf, n$ + {{Text|"[0]=(ptrszint)nothingvalue;"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}} {{Text|'static/dynamic|#31C4C4}}
                WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}} {{Text|'array is defined|#31C4C4}}
                {{Text|IF|#F0F0F0}} clearerasereturn = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} clearerasereturn = {{Text|0|#F580B1}}: {{Text|GOTO|#F0F0F0}} clearerasereturned
                {{Text|GOTO|#F0F0F0}} erasedarray
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            a$ = {{Text|"Undefined array passed to ERASE"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            erasedarray:
            {{Text|IF|#F0F0F0}} i < n {{Text|THEN|#F0F0F0}}
                i = i + {{Text|1|#F580B1}}: n$ = getelement$(a$, i): {{Text|IF|#F0F0F0}} n$ <> {{Text|","|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ,"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                l$ = l$ + sp2 + {{Text|","|#FFB100}}
                i = i + {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} i > n {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected , ..."|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|GOTO|#F0F0F0}} erasenextarray
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
            {{Text|GOTO|#F0F0F0}} finishedline
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'DIM/REDIM/STATIC|#31C4C4}}
    {{Text|IF|#F0F0F0}} n >= {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
        dimoption = {{Text|0|#F580B1}}: redimoption = {{Text|0|#F580B1}}: commonoption = {{Text|0|#F580B1}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"DIM"|#FFB100}} {{Text|THEN|#F0F0F0}} l$ = SCase$({{Text|"Dim"|#FFB100}}): dimoption = {{Text|1|#F580B1}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"REDIM"|#FFB100}} {{Text|THEN|#F0F0F0}}
            l$ = SCase$({{Text|"ReDim"|#FFB100}})
            dimoption = {{Text|2|#F580B1}}: redimoption = {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} secondelement$ = {{Text|"_PRESERVE"|#FFB100}} {{Text|OR|#F0F0F0}} (secondelement$ = {{Text|"PRESERVE"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
                redimoption = {{Text|2|#F580B1}}
                {{Text|IF|#F0F0F0}} secondelement$ = {{Text|"_PRESERVE"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    l$ = l$ + sp + SCase$({{Text|"_Preserve"|#FFB100}})
                {{Text|ELSE|#F0F0F0}}
                    l$ = l$ + sp + SCase$({{Text|"Preserve"|#FFB100}})
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} n = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected REDIM "|#FFB100}} + qb64prefix$ + {{Text|"PRESERVE ..."|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"STATIC"|#FFB100}} {{Text|THEN|#F0F0F0}} l$ = SCase$({{Text|"Static"|#FFB100}}): dimoption = {{Text|3|#F580B1}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"COMMON"|#FFB100}} {{Text|THEN|#F0F0F0}} l$ = SCase$({{Text|"Common"|#FFB100}}): dimoption = {{Text|1|#F580B1}}: commonoption = {{Text|1|#F580B1}}
        {{Text|IF|#F0F0F0}} dimoption {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} dimoption = {{Text|3|#F580B1}} {{Text|AND|#F0F0F0}} subfuncn = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"STATIC must be used within a SUB/FUNCTION"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} commonoption = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} subfuncn <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"COMMON cannot be used within a SUB/FUNCTION"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            i = {{Text|2|#F580B1}}
            {{Text|IF|#F0F0F0}} redimoption = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} i = {{Text|3|#F580B1}}
            {{Text|IF|#F0F0F0}} dimoption <> {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'shared cannot be static|#31C4C4}}
                a2$ = getelement(a$, i)
                {{Text|IF|#F0F0F0}} a2$ = {{Text|"SHARED"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} subfuncn <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"DIM/REDIM SHARED invalid within a SUB/FUNCTION"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    dimshared = {{Text|1|#F580B1}}
                    i = i + {{Text|1|#F580B1}}
                    l$ = l$ + sp + SCase$({{Text|"Shared"|#FFB100}})
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} dimoption = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} dimstatic = {{Text|1|#F580B1}}: AllowLocalName = {{Text|1|#F580B1}}
            {{Text|'look for new dim syntax: DIM AS variabletype var1, var2, etc....|#31C4C4}}
            e$ = getelement$(a$, i)
            {{Text|IF|#F0F0F0}} e$ <> {{Text|"AS"|#FFB100}} {{Text|THEN|#F0F0F0}}
                {{Text|'no "AS", so this is the traditional dim syntax|#31C4C4}}
                dimnext:
                newDimSyntax = {{Text|0|#F580B1}}
                notype = {{Text|0|#F580B1}}
                listarray = {{Text|0|#F580B1}}
                {{Text|'old chain code|#31C4C4}}
                {{Text|'chaincommonarray=0|#31C4C4}}
                varname$ = getelement(ca$, i): i = i + {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} varname$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected "|#FFB100}} + firstelement$ + {{Text|" variable-name or "|#FFB100}} + firstelement$ + {{Text|" AS type variable-list"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|'get the next element|#31C4C4}}
                {{Text|IF|#F0F0F0}} i >= n + {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|""|#FFB100}} {{Text|ELSE|#F0F0F0}} e$ = getelement(a$, i): i = i + {{Text|1|#F580B1}}
                {{Text|'check if next element is a ( to create an array|#31C4C4}}
                elements$ = {{Text|""|#FFB100}}
                {{Text|IF|#F0F0F0}} e$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}}
                    B = {{Text|1|#F580B1}}
                    {{Text|FOR|#F0F0F0}} i = i {{Text|TO|#F0F0F0}} n
                        e$ = getelement(ca$, i)
                        {{Text|IF|#F0F0F0}} e$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} B = B + {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} e$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} B = B - {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} B = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(elements$) {{Text|THEN|#F0F0F0}} elements$ = elements$ + sp + e$ {{Text|ELSE|#F0F0F0}} elements$ = e$
                    {{Text|NEXT|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} B <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected )"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    i = i + {{Text|1|#F580B1}} {{Text|'set i to point to the next element|#31C4C4}}
                    {{Text|IF|#F0F0F0}} commonoption {{Text|THEN|#F0F0F0}} elements$ = {{Text|"?"|#FFB100}}
                    {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"DIM2:array:elements$:["|#FFB100}} + elements$ + {{Text|"]"|#FFB100}}
                    {{Text|'arrayname() means list array to it will automatically be static when it is formally dimensioned later|#31C4C4}}
                    {{Text|'note: listed arrays are always created in dynamic memory, but their contents are not erased|#31C4C4}}
                    {{Text|'      this differs from static arrays from SUB...STATIC and the unique QB64 method -> STATIC arrayname(100)|#31C4C4}}
                    {{Text|IF|#F0F0F0}} dimoption = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'STATIC used|#31C4C4}}
                        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(elements$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'nothing between brackets|#31C4C4}}
                            listarray = {{Text|1|#F580B1}} {{Text|'add to static list|#31C4C4}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|'last element was ")"|#31C4C4}}
                    {{Text|'get next element|#31C4C4}}
                    {{Text|IF|#F0F0F0}} i >= n + {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|""|#FFB100}} {{Text|ELSE|#F0F0F0}} e$ = getelement(a$, i): i = i + {{Text|1|#F580B1}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'e$="("|#31C4C4}}
                d$ = e$
                dimmethod = {{Text|0|#F580B1}}
                appendname$ = {{Text|""|#FFB100}} {{Text|'the symbol to append to name returned by dim2|#31C4C4}}
                appendtype$ = {{Text|""|#FFB100}} {{Text|'eg. sp+AS+spINTEGER|#31C4C4}}
                dim2typepassback$ = {{Text|""|#FFB100}}
                {{Text|'does varname have an appended symbol?|#31C4C4}}
                s$ = removesymbol$(varname$)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} validname(varname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Invalid variable name"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} s$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
                    typ$ = s$
                    dimmethod = {{Text|1|#F580B1}}
                    appendname$ = typ$
                    {{Text|GOTO|#F0F0F0}} dimgottyp
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} d$ = {{Text|"AS"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    appendtype$ = sp + SCase$({{Text|"As"|#FFB100}})
                    typ$ = {{Text|""|#FFB100}}
                    {{Text|FOR|#F0F0F0}} i = i {{Text|TO|#F0F0F0}} n
                        d$ = getelement(a$, i)
                        {{Text|IF|#F0F0F0}} d$ = {{Text|","|#FFB100}} {{Text|THEN|#F0F0F0}} i = i + {{Text|1|#F580B1}}: {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}}
                        typ$ = typ$ + d$ + {{Text|" "|#FFB100}}
                        appendtype$ = appendtype$ + sp + d$
                        d$ = {{Text|""|#FFB100}}
                    {{Text|NEXT|#F0F0F0}}
                    appendtype$ = SCase2$(appendtype$) {{Text|'capitalise default types (udt override this later if necessary)|#31C4C4}}
                    typ$ = {{Text|RTRIM$|#F0F0F0}}(typ$)
                    {{Text|GOTO|#F0F0F0}} dimgottyp
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'auto-define type based on name|#31C4C4}}
                notype = {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(varname$, {{Text|1|#F580B1}}) = {{Text|"_"|#FFB100}} {{Text|THEN|#F0F0F0}} v = {{Text|27|#F580B1}} {{Text|ELSE|#F0F0F0}} v = {{Text|ASC|#F0F0F0}}({{Text|UCASE$|#F0F0F0}}(varname$)) - {{Text|64|#F580B1}}
                typ$ = defineaz(v)
                dimmethod = {{Text|1|#F580B1}}
                {{Text|GOTO|#F0F0F0}} dimgottyp
                dimgottyp:
                {{Text|IF|#F0F0F0}} d$ <> {{Text|""|#FFB100}} {{Text|AND|#F0F0F0}} d$ <> {{Text|","|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"DIM: Expected ,"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|'In QBASIC, if no type info is given it can refer to an expeicit/formally defined array|#31C4C4}}
                {{Text|IF|#F0F0F0}} notype <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} dimoption <> {{Text|3|#F580B1}} {{Text|AND|#F0F0F0}} dimoption <> {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'not DIM or STATIC which only create new content|#31C4C4}}
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(elements$) {{Text|THEN|#F0F0F0}} {{Text|'an array|#31C4C4}}
                        {{Text|IF|#F0F0F0}} FindArray(varname$) {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(id.mayhave)) {{Text|THEN|#F0F0F0}} {{Text|'explict/formally defined|#31C4C4}}
                                typ$ = id2fulltypename$ {{Text|'adopt type|#31C4C4}}
                                dimmethod = {{Text|0|#F580B1}} {{Text|'set as formally defined|#31C4C4}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                NormalDimBlock:
                {{Text|IF|#F0F0F0}} dimoption = {{Text|3|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|LEN|#F0F0F0}}(elements$) {{Text|THEN|#F0F0F0}} {{Text|'eg. STATIC a(100)|#31C4C4}}
                    {{Text|'does a conflicting array exist? (use findarray) if so again this should lead to duplicate definition|#31C4C4}}
                    typ2$ = symbol2fulltypename$(typ$)
                    t = typname2typ(typ2$): ts = typname2typsize
                    {{Text|'try name without any extension|#31C4C4}}
                    {{Text|IF|#F0F0F0}} FindArray(varname$) {{Text|THEN|#F0F0F0}} {{Text|'name without any symbol|#31C4C4}}
                        {{Text|IF|#F0F0F0}} id.insubfuncn = subfuncn {{Text|THEN|#F0F0F0}} {{Text|'global cannot conflict with static|#31C4C4}}
                            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(id.musthave)) {{Text|THEN|#F0F0F0}}
                                {{Text|'if types match then fail|#31C4C4}}
                                {{Text|IF|#F0F0F0}} (id.arraytype {{Text|AND|#F0F0F0}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) = (t {{Text|AND|#F0F0F0}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} ts = id.tsize {{Text|THEN|#F0F0F0}}
                                        a$ = {{Text|"Name already in use ("|#FFB100}} + varname$ + {{Text|")"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|ELSE|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} dimmethod = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    a$ = {{Text|"Name already in use ("|#FFB100}} + varname$ + {{Text|")"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes {{Text|'explicit over explicit|#31C4C4}}
                                {{Text|ELSE|#F0F0F0}}
                                    {{Text|'if types match then fail|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} (id.arraytype {{Text|AND|#F0F0F0}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) = (t {{Text|AND|#F0F0F0}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} ts = id.tsize {{Text|THEN|#F0F0F0}}
                                            a$ = {{Text|"Name already in use ("|#FFB100}} + varname$ + {{Text|")"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|'add extension (if possible)|#31C4C4}}
                    {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISUDT) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        s2$ = type2symbol$(typ2$)
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                        {{Text|IF|#F0F0F0}} FindArray(varname$ + s2$) {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} id.insubfuncn = subfuncn {{Text|THEN|#F0F0F0}} {{Text|'global cannot conflict with static|#31C4C4}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(id.musthave)) {{Text|THEN|#F0F0F0}}
                                    {{Text|'if types match then fail|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} (id.arraytype {{Text|AND|#F0F0F0}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) = (t {{Text|AND|#F0F0F0}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} ts = id.tsize {{Text|THEN|#F0F0F0}}
                                            a$ = {{Text|"Name already in use ("|#FFB100}} + varname$ + s2$ + {{Text|")"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|ELSE|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} dimmethod = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        a$ = {{Text|"Name already in use ("|#FFB100}} + varname$ + s2$ + {{Text|")"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes {{Text|'explicit over explicit|#31C4C4}}
                                    {{Text|ELSE|#F0F0F0}}
                                        {{Text|'if types match then fail|#31C4C4}}
                                        {{Text|IF|#F0F0F0}} (id.arraytype {{Text|AND|#F0F0F0}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) = (t {{Text|AND|#F0F0F0}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) {{Text|THEN|#F0F0F0}}
                                            {{Text|IF|#F0F0F0}} ts = id.tsize {{Text|THEN|#F0F0F0}}
                                                a$ = {{Text|"Name already in use ("|#FFB100}} + varname$ + s2$ + {{Text|")"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'not a UDT|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} listarray {{Text|THEN|#F0F0F0}} {{Text|'eg. STATIC a()|#31C4C4}}
                    {{Text|'note: list is cleared by END SUB/FUNCTION|#31C4C4}}
                    {{Text|'is a conflicting array already listed? if so this should cause a duplicate definition error|#31C4C4}}
                    {{Text|'check for conflict within list:|#31C4C4}}
                    xi = {{Text|1|#F580B1}}
                    {{Text|FOR|#F0F0F0}} x = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} staticarraylistn
                        varname2$ = getelement$(staticarraylist, xi): xi = xi + {{Text|1|#F580B1}}
                        typ2$ = getelement$(staticarraylist, xi): xi = xi + {{Text|1|#F580B1}}
                        dimmethod2 = {{Text|VAL|#F0F0F0}}(getelement$(staticarraylist, xi)): xi = xi + {{Text|1|#F580B1}}
                        {{Text|'check if they are similar|#31C4C4}}
                        {{Text|IF|#F0F0F0}} {{Text|UCASE$|#F0F0F0}}(varname$) = {{Text|UCASE$|#F0F0F0}}(varname2$) {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} dimmethod2 = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                                {{Text|'old using symbol|#31C4C4}}
                                {{Text|IF|#F0F0F0}} symbol2fulltypename$(typ$) = typ2$ {{Text|THEN|#F0F0F0}} a$ = {{Text|"Name already in use ("|#FFB100}} + varname$ + {{Text|")"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|ELSE|#F0F0F0}}
                                {{Text|'old using AS|#31C4C4}}
                                {{Text|IF|#F0F0F0}} dimmethod = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    a$ = {{Text|"Name already in use ("|#FFB100}} + varname$ + {{Text|")"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                {{Text|ELSE|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} symbol2fulltypename$(typ$) = typ2$ {{Text|THEN|#F0F0F0}} a$ = {{Text|"Name already in use ("|#FFB100}} + varname$ + {{Text|")"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|NEXT|#F0F0F0}}
                    {{Text|'does a conflicting array exist? (use findarray) if so again this should lead to duplicate definition|#31C4C4}}
                    typ2$ = symbol2fulltypename$(typ$)
                    t = typname2typ(typ2$): ts = typname2typsize
                    {{Text|'try name without any extension|#31C4C4}}
                    {{Text|IF|#F0F0F0}} FindArray(varname$) {{Text|THEN|#F0F0F0}} {{Text|'name without any symbol|#31C4C4}}
                        {{Text|IF|#F0F0F0}} id.insubfuncn = subfuncn {{Text|THEN|#F0F0F0}} {{Text|'global cannot conflict with static|#31C4C4}}
                            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(id.musthave)) {{Text|THEN|#F0F0F0}}
                                {{Text|'if types match then fail|#31C4C4}}
                                {{Text|IF|#F0F0F0}} (id.arraytype {{Text|AND|#F0F0F0}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) = (t {{Text|AND|#F0F0F0}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} ts = id.tsize {{Text|THEN|#F0F0F0}}
                                        a$ = {{Text|"Name already in use ("|#FFB100}} + varname$ + {{Text|")"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|ELSE|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} dimmethod = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    a$ = {{Text|"Name already in use ("|#FFB100}} + varname$ + {{Text|")"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes {{Text|'explicit over explicit|#31C4C4}}
                                {{Text|ELSE|#F0F0F0}}
                                    {{Text|'if types match then fail|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} (id.arraytype {{Text|AND|#F0F0F0}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) = (t {{Text|AND|#F0F0F0}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} ts = id.tsize {{Text|THEN|#F0F0F0}}
                                            a$ = {{Text|"Name already in use ("|#FFB100}} + varname$ + {{Text|")"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|'add extension (if possible)|#31C4C4}}
                    {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISUDT) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        s2$ = type2symbol$(typ2$)
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                        {{Text|IF|#F0F0F0}} FindArray(varname$ + s2$) {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} id.insubfuncn = subfuncn {{Text|THEN|#F0F0F0}} {{Text|'global cannot conflict with static|#31C4C4}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(id.musthave)) {{Text|THEN|#F0F0F0}}
                                    {{Text|'if types match then fail|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} (id.arraytype {{Text|AND|#F0F0F0}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) = (t {{Text|AND|#F0F0F0}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} ts = id.tsize {{Text|THEN|#F0F0F0}}
                                            a$ = {{Text|"Name already in use ("|#FFB100}} + varname$ + s2$ + {{Text|")"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|ELSE|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} dimmethod = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        a$ = {{Text|"Name already in use ("|#FFB100}} + varname$ + s2$ + {{Text|")"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes {{Text|'explicit over explicit|#31C4C4}}
                                    {{Text|ELSE|#F0F0F0}}
                                        {{Text|'if types match then fail|#31C4C4}}
                                        {{Text|IF|#F0F0F0}} (id.arraytype {{Text|AND|#F0F0F0}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) = (t {{Text|AND|#F0F0F0}} (ISFLOAT + ISUDT + {{Text|511|#F580B1}} + ISUNSIGNED + ISSTRING + ISFIXEDLENGTH)) {{Text|THEN|#F0F0F0}}
                                            {{Text|IF|#F0F0F0}} ts = id.tsize {{Text|THEN|#F0F0F0}}
                                                a$ = {{Text|"Name already in use ("|#FFB100}} + varname$ + s2$ + {{Text|")"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'not a UDT|#31C4C4}}
                    {{Text|'note: static list arrays cannot be created until they are formally [or informally] (RE)DIM'd later|#31C4C4}}
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(staticarraylist) {{Text|THEN|#F0F0F0}} staticarraylist = staticarraylist + sp
                    staticarraylist = staticarraylist + varname$ + sp + symbol2fulltypename$(typ$) + sp + str2(dimmethod)
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    staticarraylistn = staticarraylistn + {{Text|1|#F580B1}}
                    l$ = l$ + sp + varname$ + appendname$ + sp2 + {{Text|"("|#FFB100}} + sp2 + {{Text|")"|#FFB100}} + appendtype$
                    {{Text|'note: none of the following code is run, dim2 call is also skipped|#31C4C4}}
                {{Text|ELSE|#F0F0F0}}
                    olddimstatic = dimstatic
                    {{Text|'check if varname is on the static list|#31C4C4}}
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(elements$) {{Text|THEN|#F0F0F0}} {{Text|'it's an array|#31C4C4}}
                        {{Text|IF|#F0F0F0}} subfuncn {{Text|THEN|#F0F0F0}} {{Text|'it's in a sub/function|#31C4C4}}
                            xi = {{Text|1|#F580B1}}
                            {{Text|FOR|#F0F0F0}} x = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} staticarraylistn
                                varname2$ = getelement$(staticarraylist, xi): xi = xi + {{Text|1|#F580B1}}
                                typ2$ = getelement$(staticarraylist, xi): xi = xi + {{Text|1|#F580B1}}
                                dimmethod2 = {{Text|VAL|#F0F0F0}}(getelement$(staticarraylist, xi)): xi = xi + {{Text|1|#F580B1}}
                                {{Text|'check if they are similar|#31C4C4}}
                                {{Text|IF|#F0F0F0}} {{Text|UCASE$|#F0F0F0}}(varname$) = {{Text|UCASE$|#F0F0F0}}(varname2$) {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} symbol2fulltypename$(typ$) = typ2$ {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                        {{Text|IF|#F0F0F0}} dimmethod = dimmethod2 {{Text|THEN|#F0F0F0}}
                                            {{Text|'match found!|#31C4C4}}
                                            varname$ = varname2$
                                            dimstatic = {{Text|3|#F580B1}}
                                            {{Text|IF|#F0F0F0}} dimoption = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Array already listed as STATIC"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'typ|#31C4C4}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'varname|#31C4C4}}
                            {{Text|NEXT|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|'COMMON exception|#31C4C4}}
                    {{Text|'note: COMMON alone does not imply SHARED|#31C4C4}}
                    {{Text|'      if either(or both) COMMON & later DIM have SHARED, variable becomes shared|#31C4C4}}
                    {{Text|IF|#F0F0F0}} commonoption {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(elements$) {{Text|THEN|#F0F0F0}}
                            {{Text|'add array to list|#31C4C4}}
                            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(commonarraylist) {{Text|THEN|#F0F0F0}} commonarraylist = commonarraylist + sp
                            {{Text|'note: dimmethod distinguishes between a%(...) vs a(...) AS INTEGER|#31C4C4}}
                            commonarraylist = commonarraylist + varname$ + sp + symbol2fulltypename$(typ$) + sp + str2(dimmethod) + sp + str2(dimshared)
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            commonarraylistn = commonarraylistn + {{Text|1|#F580B1}}
                            {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"common listed:"|#FFB100}} + varname$ + sp + symbol2fulltypename$(typ$) + sp + str2(dimmethod) + sp + str2(dimshared)
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            x = {{Text|0|#F580B1}}
                            v$ = varname$
                            {{Text|IF|#F0F0F0}} dimmethod = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} v$ = v$ + typ$
                            try = findid(v$)
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
                                {{Text|IF|#F0F0F0}} id.arraytype {{Text|THEN|#F0F0F0}}
                                    t = typname2typ(typ$)
                                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                    s = typname2typsize
                                    match = {{Text|1|#F580B1}}
                                    {{Text|'note: dimmethod 2 is already matched|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} dimmethod = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        t2 = id.arraytype
                                        s2 = id.tsize
                                        {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISFLOAT) <> (t2 {{Text|AND|#F0F0F0}} ISFLOAT) {{Text|THEN|#F0F0F0}} match = {{Text|0|#F580B1}}
                                        {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISUNSIGNED) <> (t2 {{Text|AND|#F0F0F0}} ISUNSIGNED) {{Text|THEN|#F0F0F0}} match = {{Text|0|#F580B1}}
                                        {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISSTRING) <> (t2 {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}} match = {{Text|0|#F580B1}}
                                        {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISFIXEDLENGTH) <> (t2 {{Text|AND|#F0F0F0}} ISFIXEDLENGTH) {{Text|THEN|#F0F0F0}} match = {{Text|0|#F580B1}}
                                        {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISOFFSETINBITS) <> (t2 {{Text|AND|#F0F0F0}} ISOFFSETINBITS) {{Text|THEN|#F0F0F0}} match = {{Text|0|#F580B1}}
                                        {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISUDT) <> (t2 {{Text|AND|#F0F0F0}} ISUDT) {{Text|THEN|#F0F0F0}} match = {{Text|0|#F580B1}}
                                        {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) <> (t2 {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) {{Text|THEN|#F0F0F0}} match = {{Text|0|#F580B1}}
                                        {{Text|IF|#F0F0F0}} s <> s2 {{Text|THEN|#F0F0F0}} match = {{Text|0|#F580B1}}
                                        {{Text|'check for implicit/explicit declaration match|#31C4C4}}
                                        oldmethod = {{Text|0|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(id.musthave)) {{Text|THEN|#F0F0F0}} oldmethod = {{Text|1|#F580B1}}
                                        {{Text|IF|#F0F0F0}} oldmethod <> dimmethod {{Text|THEN|#F0F0F0}} match = {{Text|0|#F580B1}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} match {{Text|THEN|#F0F0F0}}
                                        x = currentid
                                        {{Text|IF|#F0F0F0}} dimshared {{Text|THEN|#F0F0F0}} ids(x).share = {{Text|1|#F580B1}} {{Text|'share if necessary|#31C4C4}}
                                        tlayout$ = {{Text|RTRIM$|#F0F0F0}}(id.cn) + sp + {{Text|"("|#FFB100}} + sp2 + {{Text|")"|#FFB100}}
                                        {{Text|IF|#F0F0F0}} dimmethod = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                            {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}}
                                                dim2typepassback$ = {{Text|RTRIM$|#F0F0F0}}(udtxcname(t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}))
                                                {{Text|IF|#F0F0F0}} {{Text|UCASE$|#F0F0F0}}(typ$) = {{Text|"MEM"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(udtxcname(t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}})) = {{Text|"_MEM"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                                    dim2typepassback$ = {{Text|MID$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(udtxcname(t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}})), {{Text|2|#F580B1}})
                                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                            {{Text|ELSE|#F0F0F0}}
                                                dim2typepassback$ = typ$
                                                {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(dim2typepassback$, {{Text|" "|#FFB100}})
                                                    {{Text|ASC|#F0F0F0}}(dim2typepassback$, {{Text|INSTR|#F0F0F0}}(dim2typepassback$, {{Text|" "|#FFB100}})) = {{Text|ASC|#F0F0F0}}(sp)
                                                {{Text|LOOP|#F0F0F0}}
                                                dim2typepassback$ = SCase2$(dim2typepassback$)
                                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'method 0|#31C4C4}}
                                        {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'match|#31C4C4}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'arraytype|#31C4C4}}
                                {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(v$) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
                                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|LOOP|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} x = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} x = idn + {{Text|1|#F580B1}}
                            {{Text|'note: the following code only adds include directives, everything else is defered|#31C4C4}}
                            ChainTxtBuf = OpenBuffer%({{Text|"A"|#FFB100}}, tmpdir$ + {{Text|"chain.txt"|#FFB100}})
                            {{Text|'include directive|#31C4C4}}
                            WriteBufLine ChainTxtBuf, {{Text|"#include "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"chain"|#FFB100}} + str2$(x) + {{Text|".txt"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}})
                            {{Text|'create/clear include file|#31C4C4}}
                            ChainTxtBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + {{Text|"chain"|#FFB100}} + str2$(x) + {{Text|".txt"|#FFB100}})
                            ChainTxtBuf = OpenBuffer%({{Text|"A"|#FFB100}}, tmpdir$ + {{Text|"inpchain.txt"|#FFB100}})
                            {{Text|'include directive|#31C4C4}}
                            WriteBufLine ChainTxtBuf, {{Text|"#include "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"inpchain"|#FFB100}} + str2$(x) + {{Text|".txt"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}})
                            {{Text|'create/clear include file|#31C4C4}}
                            ChainTxtBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + {{Text|"inpchain"|#FFB100}} + str2$(x) + {{Text|".txt"|#FFB100}})
                            {{Text|'note: elements$="?"|#31C4C4}}
                            {{Text|IF|#F0F0F0}} x <> idn + {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} skipdim {{Text|'array already exists|#31C4C4}}
                            {{Text|GOTO|#F0F0F0}} dimcommonarray
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|'is varname on common list?|#31C4C4}}
                    {{Text|'******|#31C4C4}}
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(elements$) {{Text|THEN|#F0F0F0}} {{Text|'it's an array|#31C4C4}}
                        {{Text|IF|#F0F0F0}} subfuncn = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'not in a sub/function|#31C4C4}}
                            {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"common checking:"|#FFB100}} + varname$
                            xi = {{Text|1|#F580B1}}
                            {{Text|FOR|#F0F0F0}} x = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} commonarraylistn
                                varname2$ = getelement$(commonarraylist, xi): xi = xi + {{Text|1|#F580B1}}
                                typ2$ = getelement$(commonarraylist, xi): xi = xi + {{Text|1|#F580B1}}
                                dimmethod2 = {{Text|VAL|#F0F0F0}}(getelement$(commonarraylist, xi)): xi = xi + {{Text|1|#F580B1}}
                                dimshared2 = {{Text|VAL|#F0F0F0}}(getelement$(commonarraylist, xi)): xi = xi + {{Text|1|#F580B1}}
                                {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"common checking against:"|#FFB100}} + varname2$ + sp + typ2$ + sp + str2(dimmethod2) + sp + str2(dimshared2)
                                {{Text|'check if they are similar|#31C4C4}}
                                {{Text|IF|#F0F0F0}} varname$ = varname2$ {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} symbol2fulltypename$(typ$) = typ2$ {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                        {{Text|IF|#F0F0F0}} dimmethod = dimmethod2 {{Text|THEN|#F0F0F0}}
                                            {{Text|'match found!|#31C4C4}}
                                            {{Text|'enforce shared status (if necessary)|#31C4C4}}
                                            {{Text|IF|#F0F0F0}} dimshared2 {{Text|THEN|#F0F0F0}} dimshared = dimshared {{Text|OR|#F0F0F0}} {{Text|2|#F580B1}} {{Text|'temp force SHARED|#31C4C4}}
                                            {{Text|'old chain code|#31C4C4}}
                                            {{Text|'chaincommonarray=x|#31C4C4}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'method|#31C4C4}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'typ|#31C4C4}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'varname|#31C4C4}}
                            {{Text|NEXT|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    dimcommonarray:
                    retval = dim2(varname$, typ$, dimmethod, elements$)
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    skipdim:
                    {{Text|IF|#F0F0F0}} dimshared >= {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} dimshared = dimshared - {{Text|2|#F580B1}}
                    {{Text|'non-array COMMON variable|#31C4C4}}
                    {{Text|IF|#F0F0F0}} commonoption <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|LEN|#F0F0F0}}(elements$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|'CHAIN.TXT (save)|#31C4C4}}
                        use_global_byte_elements = {{Text|1|#F580B1}}
                        {{Text|'switch output from main.txt to chain.txt|#31C4C4}}
                        MainTxtBuf = OpenBuffer%({{Text|"A"|#FFB100}}, tmpdir$ + {{Text|"chain.txt"|#FFB100}})
                        l2$ = tlayout$
                        WriteBufLine MainTxtBuf, {{Text|"int32val=1;"|#FFB100}} {{Text|'simple variable|#31C4C4}}
                        WriteBufLine MainTxtBuf, {{Text|"sub_put(FF,NULL,byte_element((uint64)&int32val,4,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}}
                        t = id.t
                        bits = t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
                        {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}} bits = udtxsize(t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}})
                        {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISFIXEDLENGTH {{Text|THEN|#F0F0F0}}
                                bits = id.tsize * {{Text|8|#F580B1}}
                            {{Text|ELSE|#F0F0F0}}
                                WriteBufLine MainTxtBuf, {{Text|"int64val=__STRING_"|#FFB100}} + {{Text|RTRIM$|#F0F0F0}}(id.n) + {{Text|"->len*8;"|#FFB100}}
                                bits = {{Text|0|#F580B1}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} bits {{Text|THEN|#F0F0F0}}
                            WriteBufLine MainTxtBuf, {{Text|"int64val="|#FFB100}} + str2$(bits) + {{Text|";"|#FFB100}} {{Text|'size in bits|#31C4C4}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        WriteBufLine MainTxtBuf, {{Text|"sub_put(FF,NULL,byte_element((uint64)&int64val,8,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}}
                        {{Text|'put the variable|#31C4C4}}
                        e$ = {{Text|RTRIM$|#F0F0F0}}(id.n)
                        {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISUDT) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISFIXEDLENGTH {{Text|THEN|#F0F0F0}}
                                e$ = e$ + {{Text|"$"|#FFB100}} + str2$(id.tsize)
                            {{Text|ELSE|#F0F0F0}}
                                e$ = e$ + typevalue2symbol$(t)
                                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        e$ = evaluatetotyp(fixoperationorder$(e$), {{Text|-4|#F580B1}})
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                        WriteBufLine MainTxtBuf, {{Text|"sub_put(FF,NULL,"|#FFB100}} + e$ + {{Text|",0);"|#FFB100}}
                        tlayout$ = l2$
                        {{Text|'revert output to main.txt|#31C4C4}}
                        MainTxtBuf = OpenBuffer%({{Text|"A"|#FFB100}}, tmpdir$ + {{Text|"main.txt"|#FFB100}})
                        {{Text|'INPCHAIN.TXT (load)|#31C4C4}}
                        {{Text|'switch output from main.txt to chain.txt|#31C4C4}}
                        MainTxtBuf = OpenBuffer%({{Text|"A"|#FFB100}}, tmpdir$ + {{Text|"inpchain.txt"|#FFB100}})
                        l2$ = tlayout$
                        WriteBufLine MainTxtBuf, {{Text|"if (int32val==1){"|#FFB100}}
                        {{Text|'get the size in bits|#31C4C4}}
                        WriteBufLine MainTxtBuf, {{Text|"sub_get(FF,NULL,byte_element((uint64)&int64val,8,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}}
                        {{Text|'***assume correct size***|#31C4C4}}
                        e$ = {{Text|RTRIM$|#F0F0F0}}(id.n)
                        t = id.t
                        {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISUDT) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISFIXEDLENGTH {{Text|THEN|#F0F0F0}}
                                e$ = e$ + {{Text|"$"|#FFB100}} + str2$(id.tsize)
                            {{Text|ELSE|#F0F0F0}}
                                e$ = e$ + typevalue2symbol$(t)
                                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                WriteBufLine MainTxtBuf, {{Text|"tqbs=qbs_new(int64val>>3,1);"|#FFB100}}
                                WriteBufLine MainTxtBuf, {{Text|"qbs_set(__STRING_"|#FFB100}} + {{Text|RTRIM$|#F0F0F0}}(id.n) + {{Text|",tqbs);"|#FFB100}}
                                {{Text|'now that the string is the correct size, the following GET command will work correctly...|#31C4C4}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        e$ = evaluatetotyp(fixoperationorder$(e$), {{Text|-4|#F580B1}})
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                        WriteBufLine MainTxtBuf, {{Text|"sub_get(FF,NULL,"|#FFB100}} + e$ + {{Text|",0);"|#FFB100}}
                        WriteBufLine MainTxtBuf, {{Text|"sub_get(FF,NULL,byte_element((uint64)&int32val,4,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}} {{Text|'get next command|#31C4C4}}
                        WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}}
                        tlayout$ = l2$
                        {{Text|'revert output to main.txt|#31C4C4}}
                        MainTxtBuf = OpenBuffer%({{Text|"A"|#FFB100}}, tmpdir$ + {{Text|"main.txt"|#FFB100}})
                        use_global_byte_elements = {{Text|0|#F580B1}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    commonarraylisted:
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(appendtype$) > {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} newDimSyntax = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(dim2typepassback$) {{Text|THEN|#F0F0F0}} appendtype$ = sp + SCase$({{Text|"As"|#FFB100}}) + sp + dim2typepassback$
                        {{Text|IF|#F0F0F0}} newDimSyntaxTypePassBack = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                            newDimSyntaxTypePassBack = {{Text|-1|#F580B1}}
                            l$ = l$ + appendtype$
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    n2 = numelements(tlayout$)
                    l$ = l$ + sp + getelement$(tlayout$, {{Text|1|#F580B1}}) + appendname$
                    {{Text|IF|#F0F0F0}} n2 > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                        l$ = l$ + sp2 + getelements$(tlayout$, {{Text|2|#F580B1}}, n2)
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(appendtype$) > {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} newDimSyntax = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(dim2typepassback$) {{Text|THEN|#F0F0F0}} appendtype$ = sp + SCase$({{Text|"As"|#FFB100}}) + sp + dim2typepassback$
                        l$ = l$ + appendtype$
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|'modify first element name to include symbol|#31C4C4}}
                    dimstatic = olddimstatic
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'listarray=0|#31C4C4}}
                {{Text|IF|#F0F0F0}} newDimSyntax {{Text|THEN|#F0F0F0}} {{Text|RETURN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} d$ = {{Text|","|#FFB100}} {{Text|THEN|#F0F0F0}} l$ = l$ + sp2 + {{Text|","|#FFB100}}: {{Text|GOTO|#F0F0F0}} dimnext
                dimoption = {{Text|0|#F580B1}}
                dimshared = {{Text|0|#F580B1}}
                redimoption = {{Text|0|#F580B1}}
                {{Text|IF|#F0F0F0}} dimstatic = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} dimstatic = {{Text|0|#F580B1}}
                AllowLocalName = {{Text|0|#F580B1}}
                layoutdone = {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} layout$ = l$ {{Text|ELSE|#F0F0F0}} layout$ = layout$ + sp + l$
                {{Text|GOTO|#F0F0F0}} finishedline
            {{Text|ELSE|#F0F0F0}}
                {{Text|'yes, this is the new dim syntax.|#31C4C4}}
                i = i + {{Text|1|#F580B1}} {{Text|'skip "AS"|#31C4C4}}
                newDimSyntaxTypePassBack = {{Text|0|#F580B1}}
                {{Text|'estabilish the data type:|#31C4C4}}
                appendname$ = {{Text|""|#FFB100}}
                appendtype$ = sp + SCase$({{Text|"As"|#FFB100}})
                typ$ = {{Text|""|#FFB100}}
                varname$ = {{Text|""|#FFB100}}
                previousElement$ = {{Text|""|#FFB100}}
                {{Text|FOR|#F0F0F0}} i = i {{Text|TO|#F0F0F0}} n
                    d$ = getelement(a$, i)
                    {{Text|IF|#F0F0F0}} d$ = {{Text|","|#FFB100}} {{Text|OR|#F0F0F0}} d$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}}
                    varname$ = getelement(ca$, i)
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(previousElement$) {{Text|THEN|#F0F0F0}}
                        typ$ = typ$ + previousElement$ + {{Text|" "|#FFB100}}
                        appendtype$ = appendtype$ + sp + previousElement$
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    previousElement$ = d$
                    d$ = {{Text|""|#FFB100}}
                {{Text|NEXT|#F0F0F0}}
                appendtype$ = SCase2$(appendtype$) {{Text|'capitalise default types (udt override this later if necessary)|#31C4C4}}
                typ$ = {{Text|RTRIM$|#F0F0F0}}(typ$)
                dimnext2:
                notype = {{Text|0|#F580B1}}
                listarray = {{Text|0|#F580B1}}
                {{Text|IF|#F0F0F0}} typ$ = {{Text|""|#FFB100}} {{Text|OR|#F0F0F0}} varname$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected "|#FFB100}} + firstelement$ + {{Text|" AS type variable-list or "|#FFB100}} + firstelement$ + {{Text|" variable-name AS type"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|'get the next element|#31C4C4}}
                {{Text|IF|#F0F0F0}} i >= n + {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|""|#FFB100}} {{Text|ELSE|#F0F0F0}} e$ = getelement(a$, i): i = i + {{Text|1|#F580B1}}
                {{Text|'check if next element is a ( to create an array|#31C4C4}}
                elements$ = {{Text|""|#FFB100}}
                {{Text|IF|#F0F0F0}} e$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}}
                    B = {{Text|1|#F580B1}}
                    {{Text|FOR|#F0F0F0}} i = i {{Text|TO|#F0F0F0}} n
                        e$ = getelement(ca$, i)
                        {{Text|IF|#F0F0F0}} e$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} B = B + {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} e$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} B = B - {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} B = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(elements$) {{Text|THEN|#F0F0F0}} elements$ = elements$ + sp + e$ {{Text|ELSE|#F0F0F0}} elements$ = e$
                    {{Text|NEXT|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} B <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected )"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    i = i + {{Text|1|#F580B1}} {{Text|'set i to point to the next element|#31C4C4}}
                    {{Text|IF|#F0F0F0}} commonoption {{Text|THEN|#F0F0F0}} elements$ = {{Text|"?"|#FFB100}}
                    {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"DIM2:array:elements$:["|#FFB100}} + elements$ + {{Text|"]"|#FFB100}}
                    {{Text|'arrayname() means list array to it will automatically be static when it is formally dimensioned later|#31C4C4}}
                    {{Text|'note: listed arrays are always created in dynamic memory, but their contents are not erased|#31C4C4}}
                    {{Text|'      this differs from static arrays from SUB...STATIC and the unique QB64 method -> STATIC arrayname(100)|#31C4C4}}
                    {{Text|IF|#F0F0F0}} dimoption = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'STATIC used|#31C4C4}}
                        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(elements$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'nothing between brackets|#31C4C4}}
                            listarray = {{Text|1|#F580B1}} {{Text|'add to static list|#31C4C4}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|'last element was ")"|#31C4C4}}
                    {{Text|'get next element|#31C4C4}}
                    {{Text|IF|#F0F0F0}} i >= n + {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|""|#FFB100}} {{Text|ELSE|#F0F0F0}} e$ = getelement(a$, i): i = i + {{Text|1|#F580B1}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'e$="("|#31C4C4}}
                d$ = e$
                dimmethod = {{Text|0|#F580B1}}
                dim2typepassback$ = {{Text|""|#FFB100}}
                {{Text|'does varname have an appended symbol?|#31C4C4}}
                s$ = removesymbol$(varname$)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} validname(varname$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Invalid variable name"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} s$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
                    a$ = {{Text|"Cannot use type symbol with "|#FFB100}} + firstelement$ + {{Text|" AS type variable-list ("|#FFB100}} + s$ + {{Text|")"|#FFB100}}
                    {{Text|GOTO|#F0F0F0}} errmes
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} d$ <> {{Text|""|#FFB100}} {{Text|AND|#F0F0F0}} d$ <> {{Text|","|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"DIM: Expected ,"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                newDimSyntax = {{Text|-1|#F580B1}}
                {{Text|GOSUB|#F0F0F0}} NormalDimBlock
                newDimSyntax = {{Text|0|#F580B1}}
                {{Text|IF|#F0F0F0}} d$ = {{Text|","|#FFB100}} {{Text|THEN|#F0F0F0}}
                    l$ = l$ + sp2 + {{Text|","|#FFB100}}
                    varname$ = getelement(ca$, i): i = i + {{Text|1|#F580B1}}
                    {{Text|GOTO|#F0F0F0}} dimnext2
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                dimoption = {{Text|0|#F580B1}}
                dimshared = {{Text|0|#F580B1}}
                redimoption = {{Text|0|#F580B1}}
                {{Text|IF|#F0F0F0}} dimstatic = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} dimstatic = {{Text|0|#F580B1}}
                AllowLocalName = {{Text|0|#F580B1}}
                layoutdone = {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} layout$ = l$ {{Text|ELSE|#F0F0F0}} layout$ = layout$ + sp + l$
                {{Text|GOTO|#F0F0F0}} finishedline
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'THEN [GOTO] linenumber?|#31C4C4}}
    {{Text|IF|#F0F0F0}} THENGOTO = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} n = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
            l$ = {{Text|""|#FFB100}}
            a = {{Text|ASC|#F0F0F0}}({{Text|LEFT$|#F0F0F0}}(firstelement$, {{Text|1|#F580B1}}))
            {{Text|IF|#F0F0F0}} a = {{Text|46|#F580B1}} {{Text|OR|#F0F0F0}} (a >= {{Text|48|#F580B1}} {{Text|AND|#F0F0F0}} a <= {{Text|57|#F580B1}}) {{Text|THEN|#F0F0F0}} a2$ = ca$: {{Text|GOTO|#F0F0F0}} THENGOTO
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'goto|#31C4C4}}
    {{Text|IF|#F0F0F0}} n = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} getelement$(a$, {{Text|1|#F580B1}}) = {{Text|"GOTO"|#FFB100}} {{Text|THEN|#F0F0F0}}
            l$ = SCase$({{Text|"GoTo"|#FFB100}})
            a2$ = getelement$(ca$, {{Text|2|#F580B1}})
            THENGOTO:
            {{Text|IF|#F0F0F0}} validlabel(a2$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Invalid label!"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            v = HashFind(a2$, HASHFLAG_LABEL, ignore, r)
            x = {{Text|1|#F580B1}}
            labchk2:
            {{Text|IF|#F0F0F0}} v {{Text|THEN|#F0F0F0}}
                s = Labels(r).Scope
                {{Text|IF|#F0F0F0}} s = subfuncn {{Text|OR|#F0F0F0}} s = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'same scope?|#31C4C4}}
                    {{Text|IF|#F0F0F0}} s = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} Labels(r).Scope = subfuncn {{Text|'acquire scope|#31C4C4}}
                    x = {{Text|0|#F580B1}} {{Text|'already defined|#31C4C4}}
                    tlayout$ = {{Text|RTRIM$|#F0F0F0}}(Labels(r).cn)
                {{Text|ELSE|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} v = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} v = HashFindCont(ignore, r): {{Text|GOTO|#F0F0F0}} labchk2
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} x {{Text|THEN|#F0F0F0}}
                {{Text|'does not exist|#31C4C4}}
                nLabels = nLabels + {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} nLabels > Labels_Ubound {{Text|THEN|#F0F0F0}} Labels_Ubound = Labels_Ubound * {{Text|2|#F580B1}}: {{Text|REDIM|#F0F0F0}} {{Text|_PRESERVE|#F0F0F0}} Labels({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} Labels_Ubound) {{Text|AS|#F0F0F0}} Label_Type
                Labels(nLabels) = Empty_Label
                HashAdd a2$, HASHFLAG_LABEL, nLabels
                r = nLabels
                Labels(r).State = {{Text|0|#F580B1}}
                Labels(r).cn = tlayout$
                Labels(r).Scope = subfuncn
                Labels(r).Error_Line = linenumber
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'x|#31C4C4}}
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(l$) {{Text|THEN|#F0F0F0}} l$ = l$ + sp + tlayout$ {{Text|ELSE|#F0F0F0}} l$ = tlayout$
            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
            WriteBufLine MainTxtBuf, {{Text|"goto LABEL_"|#FFB100}} + a2$ + {{Text|";"|#FFB100}}
            {{Text|GOTO|#F0F0F0}} finishedline
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} n = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"_CONTINUE"|#FFB100}} {{Text|OR|#F0F0F0}} (firstelement$ = {{Text|"CONTINUE"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"_CONTINUE"|#FFB100}} {{Text|THEN|#F0F0F0}} l$ = SCase$({{Text|"_Continue"|#FFB100}}) {{Text|ELSE|#F0F0F0}} l$ = SCase$({{Text|"Continue"|#FFB100}})
            {{Text|'scan backwards until previous control level reached|#31C4C4}}
            {{Text|FOR|#F0F0F0}} i = controllevel {{Text|TO|#F0F0F0}} {{Text|1|#F580B1}} {{Text|STEP|#F0F0F0}} {{Text|-1|#F580B1}}
                t = controltype(i)
                {{Text|IF|#F0F0F0}} t = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'for...next|#31C4C4}}
                    WriteBufLine MainTxtBuf, {{Text|"goto fornext_continue_"|#FFB100}} + str2$(controlid(i)) + {{Text|";"|#FFB100}}
                    layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                    {{Text|GOTO|#F0F0F0}} finishedline
                {{Text|ELSEIF|#F0F0F0}} t = {{Text|3|#F580B1}} {{Text|OR|#F0F0F0}} t = {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'do...loop|#31C4C4}}
                    WriteBufLine MainTxtBuf, {{Text|"goto dl_continue_"|#FFB100}} + str2$(controlid(i)) + {{Text|";"|#FFB100}}
                    layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                    {{Text|GOTO|#F0F0F0}} finishedline
                {{Text|ELSEIF|#F0F0F0}} t = {{Text|5|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'while...wend|#31C4C4}}
                    WriteBufLine MainTxtBuf, {{Text|"goto ww_continue_"|#FFB100}} + str2$(controlid(i)) + {{Text|";"|#FFB100}}
                    layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                    {{Text|GOTO|#F0F0F0}} finishedline
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|NEXT|#F0F0F0}}
            a$ = qb64prefix$ + {{Text|"CONTINUE outside DO..LOOP/FOR..NEXT/WHILE..WEND block"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"CHAIN"|#FFB100}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} vWatchOn {{Text|THEN|#F0F0F0}}
            addWarning linenumber, inclevel, inclinenumber(inclevel), incname$(inclevel), {{Text|"Feature incompatible with $Debug mode"|#FFB100}}, {{Text|"CHAIN"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"RUN"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|'RUN|#31C4C4}}
        {{Text|IF|#F0F0F0}} vWatchOn {{Text|THEN|#F0F0F0}}
            addWarning linenumber, inclevel, inclinenumber(inclevel), incname$(inclevel), {{Text|"Feature incompatible with $Debug mode"|#FFB100}}, {{Text|"RUN"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        l$ = SCase$({{Text|"Run"|#FFB100}})
        {{Text|IF|#F0F0F0}} n = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|'no parameters|#31C4C4}}
            WriteBufLine MainTxtBuf, {{Text|"sub_run_init();"|#FFB100}} {{Text|'note: called first to free up screen-locked image handles|#31C4C4}}
            WriteBufLine MainTxtBuf, {{Text|"sub_clear(NULL,NULL,NULL,NULL);"|#FFB100}} {{Text|'use functionality of CLEAR|#31C4C4}}
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(subfunc$) {{Text|THEN|#F0F0F0}}
                WriteBufLine MainTxtBuf, {{Text|"QBMAIN(NULL);"|#FFB100}}
            {{Text|ELSE|#F0F0F0}}
                WriteBufLine MainTxtBuf, {{Text|"goto S_0;"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|ELSE|#F0F0F0}}
            {{Text|'parameter passed|#31C4C4}}
            e$ = getelements$(ca$, {{Text|2|#F580B1}}, n)
            e$ = fixoperationorder$(e$)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            l2$ = tlayout$
            ignore$ = evaluate(e$, typ)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} n = {{Text|2|#F580B1}} {{Text|AND|#F0F0F0}} ((typ {{Text|AND|#F0F0F0}} ISSTRING) = {{Text|0|#F580B1}}) {{Text|THEN|#F0F0F0}}
                {{Text|'assume it's a label or line number|#31C4C4}}
                lbl$ = getelement$(ca$, {{Text|2|#F580B1}})
                {{Text|IF|#F0F0F0}} validlabel(lbl$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Invalid label!"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes {{Text|'invalid label|#31C4C4}}
                v = HashFind(lbl$, HASHFLAG_LABEL, ignore, r)
                x = {{Text|1|#F580B1}}
                labchk501:
                {{Text|IF|#F0F0F0}} v {{Text|THEN|#F0F0F0}}
                    s = Labels(r).Scope
                    {{Text|IF|#F0F0F0}} s = {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} s = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'main scope?|#31C4C4}}
                        {{Text|IF|#F0F0F0}} s = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} Labels(r).Scope = {{Text|0|#F580B1}} {{Text|'acquire scope|#31C4C4}}
                        x = {{Text|0|#F580B1}} {{Text|'already defined|#31C4C4}}
                        tlayout$ = {{Text|RTRIM$|#F0F0F0}}(Labels(r).cn)
                        Labels(r).Scope_Restriction = subfuncn
                        Labels(r).Error_Line = linenumber
                    {{Text|ELSE|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} v = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} v = HashFindCont(ignore, r): {{Text|GOTO|#F0F0F0}} labchk501
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} x {{Text|THEN|#F0F0F0}}
                    {{Text|'does not exist|#31C4C4}}
                    nLabels = nLabels + {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} nLabels > Labels_Ubound {{Text|THEN|#F0F0F0}} Labels_Ubound = Labels_Ubound * {{Text|2|#F580B1}}: {{Text|REDIM|#F0F0F0}} {{Text|_PRESERVE|#F0F0F0}} Labels({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} Labels_Ubound) {{Text|AS|#F0F0F0}} Label_Type
                    Labels(nLabels) = Empty_Label
                    HashAdd lbl$, HASHFLAG_LABEL, nLabels
                    r = nLabels
                    Labels(r).State = {{Text|0|#F580B1}}
                    Labels(r).cn = tlayout$
                    Labels(r).Scope = {{Text|0|#F580B1}}
                    Labels(r).Error_Line = linenumber
                    Labels(r).Scope_Restriction = subfuncn
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'x|#31C4C4}}
                l$ = l$ + sp + tlayout$
                WriteBufLine MainTxtBuf, {{Text|"sub_run_init();"|#FFB100}} {{Text|'note: called first to free up screen-locked image handles|#31C4C4}}
                WriteBufLine MainTxtBuf, {{Text|"sub_clear(NULL,NULL,NULL,NULL);"|#FFB100}} {{Text|'use functionality of CLEAR|#31C4C4}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(subfunc$) {{Text|THEN|#F0F0F0}}
                    WriteBufLine RunTxtBuf, {{Text|"if (run_from_line=="|#FFB100}} + str2(nextrunlineindex) + {{Text|"){run_from_line=0;goto LABEL_"|#FFB100}} + lbl$ + {{Text|";}"|#FFB100}}
                    WriteBufLine MainTxtBuf, {{Text|"run_from_line="|#FFB100}} + str2(nextrunlineindex) + {{Text|";"|#FFB100}}
                    nextrunlineindex = nextrunlineindex + {{Text|1|#F580B1}}
                    WriteBufLine MainTxtBuf, {{Text|"QBMAIN(NULL);"|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    WriteBufLine MainTxtBuf, {{Text|"goto LABEL_"|#FFB100}} + lbl$ + {{Text|";"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|ELSE|#F0F0F0}}
                {{Text|'assume it's a string containing a filename to execute|#31C4C4}}
                e$ = evaluatetotyp(e$, ISSTRING)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                WriteBufLine MainTxtBuf, {{Text|"sub_run("|#FFB100}} + e$ + {{Text|");"|#FFB100}}
                l$ = l$ + sp + l2$
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'isstring|#31C4C4}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'n=1|#31C4C4}}
        layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
        {{Text|GOTO|#F0F0F0}} finishedline
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'run|#31C4C4}}
    {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"END"|#FFB100}} {{Text|THEN|#F0F0F0}}
        l$ = SCase$({{Text|"End"|#FFB100}})
        {{Text|IF|#F0F0F0}} n > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
            e$ = getelements$(ca$, {{Text|2|#F580B1}}, n)
            e$ = fixoperationorder$(e$): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            l2$ = tlayout$
            e$ = evaluatetotyp(e$, ISINTEGER64): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            inclinenump$ = {{Text|""|#FFB100}}
            {{Text|IF|#F0F0F0}} inclinenumber(inclevel) {{Text|THEN|#F0F0F0}}
                inclinenump$ = {{Text|","|#FFB100}} + str2$(inclinenumber(inclevel))
                thisincname$ = getfilepath$(incname$(inclevel))
                thisincname$ = {{Text|MID$|#F0F0F0}}(incname$(inclevel), {{Text|LEN|#F0F0F0}}(thisincname$) + {{Text|1|#F580B1}})
                inclinenump$ = inclinenump$ + {{Text|","|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + thisincname$ + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}})
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} vWatchOn {{Text|AND|#F0F0F0}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} temp$ = vWatchErrorCall$ {{Text|ELSE|#F0F0F0}} temp$ = {{Text|""|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"if(qbevent){"|#FFB100}} + temp$ + {{Text|"evnt("|#FFB100}} + str2$(linenumber) + inclinenump$ + {{Text|");}"|#FFB100}} {{Text|'non-resumable error check (cannot exit without handling errors)|#31C4C4}}
            WriteBufLine MainTxtBuf, {{Text|"exit_code="|#FFB100}} + e$ + {{Text|";"|#FFB100}}
            l$ = l$ + sp + l2$
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        xend
        layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
        {{Text|GOTO|#F0F0F0}} finishedline
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"SYSTEM"|#FFB100}} {{Text|THEN|#F0F0F0}}
        l$ = SCase$({{Text|"System"|#FFB100}})
        {{Text|IF|#F0F0F0}} n > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
            e$ = getelements$(ca$, {{Text|2|#F580B1}}, n)
            e$ = fixoperationorder$(e$): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            l2$ = tlayout$
            e$ = evaluatetotyp(e$, ISINTEGER64): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            inclinenump$ = {{Text|""|#FFB100}}
            {{Text|IF|#F0F0F0}} inclinenumber(inclevel) {{Text|THEN|#F0F0F0}}
                inclinenump$ = {{Text|","|#FFB100}} + str2$(inclinenumber(inclevel))
                thisincname$ = getfilepath$(incname$(inclevel))
                thisincname$ = {{Text|MID$|#F0F0F0}}(incname$(inclevel), {{Text|LEN|#F0F0F0}}(thisincname$) + {{Text|1|#F580B1}})
                inclinenump$ = inclinenump$ + {{Text|","|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + thisincname$ + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}})
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} vWatchOn = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} NoChecks = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} temp$ = vWatchErrorCall$ {{Text|ELSE|#F0F0F0}} temp$ = {{Text|""|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"if(qbevent){"|#FFB100}} + temp$ + {{Text|"evnt("|#FFB100}} + str2$(linenumber) + inclinenump$ + {{Text|");}"|#FFB100}} {{Text|'non-resumable error check (cannot exit without handling errors)|#31C4C4}}
            WriteBufLine MainTxtBuf, {{Text|"exit_code="|#FFB100}} + e$ + {{Text|";"|#FFB100}}
            l$ = l$ + sp + l2$
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} vWatchOn = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                vWatchAddLabel linenumber, {{Text|0|#F580B1}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            WriteBufLine MainTxtBuf, {{Text|"*__LONG_VWATCH_LINENUMBER= 0; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        WriteBufLine MainTxtBuf, {{Text|"if (sub_gl_called) error(271);"|#FFB100}}
        WriteBufLine MainTxtBuf, {{Text|"close_program=1;"|#FFB100}}
        WriteBufLine MainTxtBuf, {{Text|"end();"|#FFB100}}
        layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
        {{Text|GOTO|#F0F0F0}} finishedline
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} n >= {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"STOP"|#FFB100}} {{Text|THEN|#F0F0F0}}
            l$ = SCase$({{Text|"Stop"|#FFB100}})
            {{Text|IF|#F0F0F0}} n > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                e$ = getelements$(ca$, {{Text|2|#F580B1}}, n)
                e$ = fixoperationorder$(e$)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                l$ = SCase$({{Text|"Stop"|#FFB100}}) + sp + tlayout$
                e$ = evaluatetotyp(e$, {{Text|64|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|'note: this value is currently ignored but evaluated for checking reasons|#31C4C4}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
            {{Text|IF|#F0F0F0}} vWatchOn = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} NoChecks = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                WriteBufLine MainTxtBuf, {{Text|"*__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;"|#FFB100}}
                vWatchAddLabel linenumber, {{Text|0|#F580B1}}
            {{Text|ELSE|#F0F0F0}}
                WriteBufLine MainTxtBuf, {{Text|"close_program=1;"|#FFB100}}
                WriteBufLine MainTxtBuf, {{Text|"end();"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|GOTO|#F0F0F0}} finishedline
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} n = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"GOSUB"|#FFB100}} {{Text|THEN|#F0F0F0}}
            xgosub ca$
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|'note: layout implemented in xgosub|#31C4C4}}
            {{Text|GOTO|#F0F0F0}} finishedline
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} n >= {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"RETURN"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} n = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                WriteBufLine MainTxtBuf, {{Text|"#include "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"ret"|#FFB100}} + str2$(subfuncn) + {{Text|".txt"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}})
                l$ = SCase$({{Text|"Return"|#FFB100}})
                layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                {{Text|GOTO|#F0F0F0}} finishedline
            {{Text|ELSE|#F0F0F0}}
                {{Text|'label/linenumber follows|#31C4C4}}
                {{Text|IF|#F0F0F0}} subfuncn <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"RETURN linelabel/linenumber invalid within a SUB/FUNCTION"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} n > {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected linelabel/linenumber after RETURN"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                WriteBufLine MainTxtBuf, {{Text|"if (!next_return_point) error(3);"|#FFB100}} {{Text|'check return point available|#31C4C4}}
                WriteBufLine MainTxtBuf, {{Text|"next_return_point--;"|#FFB100}} {{Text|'destroy return point|#31C4C4}}
                a2$ = getelement$(ca$, {{Text|2|#F580B1}})
                {{Text|IF|#F0F0F0}} validlabel(a2$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Invalid label!"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                v = HashFind(a2$, HASHFLAG_LABEL, ignore, r)
                x = {{Text|1|#F580B1}}
                labchk505:
                {{Text|IF|#F0F0F0}} v {{Text|THEN|#F0F0F0}}
                    s = Labels(r).Scope
                    {{Text|IF|#F0F0F0}} s = subfuncn {{Text|OR|#F0F0F0}} s = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'same scope?|#31C4C4}}
                        {{Text|IF|#F0F0F0}} s = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} Labels(r).Scope = subfuncn {{Text|'acquire scope|#31C4C4}}
                        x = {{Text|0|#F580B1}} {{Text|'already defined|#31C4C4}}
                        tlayout$ = {{Text|RTRIM$|#F0F0F0}}(Labels(r).cn)
                    {{Text|ELSE|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} v = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} v = HashFindCont(ignore, r): {{Text|GOTO|#F0F0F0}} labchk505
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} x {{Text|THEN|#F0F0F0}}
                    {{Text|'does not exist|#31C4C4}}
                    nLabels = nLabels + {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} nLabels > Labels_Ubound {{Text|THEN|#F0F0F0}} Labels_Ubound = Labels_Ubound * {{Text|2|#F580B1}}: {{Text|REDIM|#F0F0F0}} {{Text|_PRESERVE|#F0F0F0}} Labels({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} Labels_Ubound) {{Text|AS|#F0F0F0}} Label_Type
                    Labels(nLabels) = Empty_Label
                    HashAdd a2$, HASHFLAG_LABEL, nLabels
                    r = nLabels
                    Labels(r).State = {{Text|0|#F580B1}}
                    Labels(r).cn = tlayout$
                    Labels(r).Scope = subfuncn
                    Labels(r).Error_Line = linenumber
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'x|#31C4C4}}
                WriteBufLine MainTxtBuf, {{Text|"goto LABEL_"|#FFB100}} + a2$ + {{Text|";"|#FFB100}}
                l$ = SCase$({{Text|"Return"|#FFB100}}) + sp + tlayout$
                layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                {{Text|GOTO|#F0F0F0}} finishedline
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} n >= {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"RESUME"|#FFB100}} {{Text|THEN|#F0F0F0}}
            l$ = SCase$({{Text|"Resume"|#FFB100}})
            {{Text|IF|#F0F0F0}} n = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                resumeprev:
                WriteBufLine MainTxtBuf, {{Text|"if (!error_handling){error(20);}else{error_retry=1; qbevent=1; error_handling=0; error_err=0; return;}"|#FFB100}}
                layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                {{Text|GOTO|#F0F0F0}} finishedline
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} n > {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Too many parameters"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            s$ = getelement$(ca$, {{Text|2|#F580B1}})
            {{Text|IF|#F0F0F0}} {{Text|UCASE$|#F0F0F0}}(s$) = {{Text|"NEXT"|#FFB100}} {{Text|THEN|#F0F0F0}}
                WriteBufLine MainTxtBuf, {{Text|"if (!error_handling){error(20);}else{error_handling=0; error_err=0; return;}"|#FFB100}}
                l$ = l$ + sp + SCase$({{Text|"Next"|#FFB100}})
                layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                {{Text|GOTO|#F0F0F0}} finishedline
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} s$ = {{Text|"0"|#FFB100}} {{Text|THEN|#F0F0F0}} l$ = l$ + sp + {{Text|"0"|#FFB100}}: {{Text|GOTO|#F0F0F0}} resumeprev
            {{Text|IF|#F0F0F0}} validlabel(s$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Invalid label passed to RESUME"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            v = HashFind(s$, HASHFLAG_LABEL, ignore, r)
            x = {{Text|1|#F580B1}}
            labchk506:
            {{Text|IF|#F0F0F0}} v {{Text|THEN|#F0F0F0}}
                s = Labels(r).Scope
                {{Text|IF|#F0F0F0}} s = subfuncn {{Text|OR|#F0F0F0}} s = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'same scope?|#31C4C4}}
                    {{Text|IF|#F0F0F0}} s = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} Labels(r).Scope = subfuncn {{Text|'acquire scope|#31C4C4}}
                    x = {{Text|0|#F580B1}} {{Text|'already defined|#31C4C4}}
                    tlayout$ = {{Text|RTRIM$|#F0F0F0}}(Labels(r).cn)
                {{Text|ELSE|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} v = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} v = HashFindCont(ignore, r): {{Text|GOTO|#F0F0F0}} labchk506
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} x {{Text|THEN|#F0F0F0}}
                {{Text|'does not exist|#31C4C4}}
                nLabels = nLabels + {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} nLabels > Labels_Ubound {{Text|THEN|#F0F0F0}} Labels_Ubound = Labels_Ubound * {{Text|2|#F580B1}}: {{Text|REDIM|#F0F0F0}} {{Text|_PRESERVE|#F0F0F0}} Labels({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} Labels_Ubound) {{Text|AS|#F0F0F0}} Label_Type
                Labels(nLabels) = Empty_Label
                HashAdd s$, HASHFLAG_LABEL, nLabels
                r = nLabels
                Labels(r).State = {{Text|0|#F580B1}}
                Labels(r).cn = tlayout$
                Labels(r).Scope = subfuncn
                Labels(r).Error_Line = linenumber
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'x|#31C4C4}}
            l$ = l$ + sp + tlayout$
            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
            WriteBufLine MainTxtBuf, {{Text|"if (!error_handling){error(20);}else{error_handling=0; error_err=0; goto LABEL_"|#FFB100}} + s$ + {{Text|";}"|#FFB100}}
            {{Text|GOTO|#F0F0F0}} finishedline
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} n = {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} getelements(a$, {{Text|1|#F580B1}}, {{Text|3|#F580B1}}) = {{Text|"ON"|#FFB100}} + sp + {{Text|"ERROR"|#FFB100}} + sp + {{Text|"GOTO"|#FFB100}} {{Text|THEN|#F0F0F0}}
            l$ = SCase$({{Text|"On"|#FFB100}} + sp + {{Text|"Error"|#FFB100}} + sp + {{Text|"GoTo"|#FFB100}})
            lbl$ = getelement$(ca$, {{Text|4|#F580B1}})
            {{Text|IF|#F0F0F0}} lbl$ = {{Text|"0"|#FFB100}} {{Text|THEN|#F0F0F0}}
                WriteBufLine MainTxtBuf, {{Text|"error_goto_line=0;"|#FFB100}}
                l$ = l$ + sp + {{Text|"0"|#FFB100}}
                layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                {{Text|GOTO|#F0F0F0}} finishedline
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} validlabel(lbl$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Invalid label"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            v = HashFind(lbl$, HASHFLAG_LABEL, ignore, r)
            x = {{Text|1|#F580B1}}
            labchk6:
            {{Text|IF|#F0F0F0}} v {{Text|THEN|#F0F0F0}}
                s = Labels(r).Scope
                {{Text|IF|#F0F0F0}} s = {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} s = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'main scope?|#31C4C4}}
                    {{Text|IF|#F0F0F0}} s = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} Labels(r).Scope = {{Text|0|#F580B1}} {{Text|'acquire scope|#31C4C4}}
                    x = {{Text|0|#F580B1}} {{Text|'already defined|#31C4C4}}
                    tlayout$ = {{Text|RTRIM$|#F0F0F0}}(Labels(r).cn)
                    Labels(r).Scope_Restriction = subfuncn
                    Labels(r).Error_Line = linenumber
                {{Text|ELSE|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} v = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} v = HashFindCont(ignore, r): {{Text|GOTO|#F0F0F0}} labchk6
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} x {{Text|THEN|#F0F0F0}}
                {{Text|'does not exist|#31C4C4}}
                nLabels = nLabels + {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} nLabels > Labels_Ubound {{Text|THEN|#F0F0F0}} Labels_Ubound = Labels_Ubound * {{Text|2|#F580B1}}: {{Text|REDIM|#F0F0F0}} {{Text|_PRESERVE|#F0F0F0}} Labels({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} Labels_Ubound) {{Text|AS|#F0F0F0}} Label_Type
                Labels(nLabels) = Empty_Label
                HashAdd lbl$, HASHFLAG_LABEL, nLabels
                r = nLabels
                Labels(r).State = {{Text|0|#F580B1}}
                Labels(r).cn = tlayout$
                Labels(r).Scope = {{Text|0|#F580B1}}
                Labels(r).Error_Line = linenumber
                Labels(r).Scope_Restriction = subfuncn
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'x|#31C4C4}}
            l$ = l$ + sp + tlayout$
            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
            errorlabels = errorlabels + {{Text|1|#F580B1}}
            WriteBufLine MainTxtBuf, {{Text|"error_goto_line="|#FFB100}} + str2(errorlabels) + {{Text|";"|#FFB100}}
            WriteBufLine ErrTxtBuf, {{Text|"if (error_goto_line=="|#FFB100}} + str2(errorlabels) + {{Text|"){error_handling=1; goto LABEL_"|#FFB100}} + lbl$ + {{Text|";}"|#FFB100}}
            {{Text|GOTO|#F0F0F0}} finishedline
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} n >= {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"RESTORE"|#FFB100}} {{Text|THEN|#F0F0F0}}
            l$ = SCase$({{Text|"Restore"|#FFB100}})
            {{Text|IF|#F0F0F0}} n = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                WriteBufLine MainTxtBuf, {{Text|"data_offset=0;"|#FFB100}}
            {{Text|ELSE|#F0F0F0}}
                {{Text|IF|#F0F0F0}} n > {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Syntax error - too many parameters (expected RESTORE label/line number)"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                lbl$ = getelement$(ca$, {{Text|2|#F580B1}})
                {{Text|IF|#F0F0F0}} validlabel(lbl$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Invalid label"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|'rule: a RESTORE label has no scope, therefore, only one instance of that label may exist|#31C4C4}}
                {{Text|'how: enforced by a post check for duplicates|#31C4C4}}
                v = HashFind(lbl$, HASHFLAG_LABEL, ignore, r)
                x = {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} v {{Text|THEN|#F0F0F0}} {{Text|'already defined|#31C4C4}}
                    x = {{Text|0|#F580B1}}
                    tlayout$ = {{Text|RTRIM$|#F0F0F0}}(Labels(r).cn)
                    Labels(r).Data_Referenced = {{Text|1|#F580B1}} {{Text|'make sure the data referenced flag is set|#31C4C4}}
                    {{Text|IF|#F0F0F0}} Labels(r).Error_Line = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Labels(r).Error_Line = linenumber
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} x {{Text|THEN|#F0F0F0}}
                    nLabels = nLabels + {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} nLabels > Labels_Ubound {{Text|THEN|#F0F0F0}} Labels_Ubound = Labels_Ubound * {{Text|2|#F580B1}}: {{Text|REDIM|#F0F0F0}} {{Text|_PRESERVE|#F0F0F0}} Labels({{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} Labels_Ubound) {{Text|AS|#F0F0F0}} Label_Type
                    Labels(nLabels) = Empty_Label
                    HashAdd lbl$, HASHFLAG_LABEL, nLabels
                    r = nLabels
                    Labels(r).State = {{Text|0|#F580B1}}
                    Labels(r).cn = tlayout$
                    Labels(r).Scope = {{Text|-1|#F580B1}} {{Text|'modifyable scope|#31C4C4}}
                    Labels(r).Error_Line = linenumber
                    Labels(r).Data_Referenced = {{Text|1|#F580B1}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'x|#31C4C4}}
                l$ = l$ + sp + tlayout$
                WriteBufLine MainTxtBuf, {{Text|"data_offset=data_at_LABEL_"|#FFB100}} + lbl$ + {{Text|";"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
            {{Text|GOTO|#F0F0F0}} finishedline
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'ON ... GOTO/GOSUB|#31C4C4}}
    {{Text|IF|#F0F0F0}} n >= {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"ON"|#FFB100}} {{Text|THEN|#F0F0F0}}
            xongotogosub a$, ca$, n
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|GOTO|#F0F0F0}} finishedline
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'(_MEM) _MEMPUT _MEMGET|#31C4C4}}
    {{Text|IF|#F0F0F0}} n >= {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"_MEMGET"|#FFB100}} {{Text|OR|#F0F0F0}} (firstelement$ = {{Text|"MEMGET"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
            {{Text|'get expressions|#31C4C4}}
            e$ = {{Text|""|#FFB100}}
            B = {{Text|0|#F580B1}}
            ne = {{Text|0|#F580B1}}
            {{Text|FOR|#F0F0F0}} i2 = {{Text|2|#F580B1}} {{Text|TO|#F0F0F0}} n
                e2$ = getelement$(ca$, i2)
                {{Text|IF|#F0F0F0}} e2$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} B = B + {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} e2$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} B = B - {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} e2$ = {{Text|","|#FFB100}} {{Text|AND|#F0F0F0}} B = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    ne = ne + {{Text|1|#F580B1}}
                    {{Text|IF|#F0F0F0}} ne = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} blk$ = e$: e$ = {{Text|""|#FFB100}}
                    {{Text|IF|#F0F0F0}} ne = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} offs$ = e$: e$ = {{Text|""|#FFB100}}
                    {{Text|IF|#F0F0F0}} ne = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Syntax error - too many parameters (Expected "|#FFB100}} + qb64prefix$ + {{Text|"MEMGET mem-reference, offset, variable)"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|ELSE|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(e$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = e2$ {{Text|ELSE|#F0F0F0}} e$ = e$ + sp + e2$
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|NEXT|#F0F0F0}}
            var$ = e$
            {{Text|IF|#F0F0F0}} e$ = {{Text|""|#FFB100}} {{Text|OR|#F0F0F0}} ne <> {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected "|#FFB100}} + qb64prefix$ + {{Text|"MEMGET mem-reference, offset, variable"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"_MEMGET"|#FFB100}} {{Text|THEN|#F0F0F0}} l$ = SCase$({{Text|"_MemGet"|#FFB100}}) + sp {{Text|ELSE|#F0F0F0}} l$ = SCase$({{Text|"MemGet"|#FFB100}}) + sp
            e$ = fixoperationorder$(blk$): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            l$ = l$ + tlayout$
            test$ = evaluate(e$, typ): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISUDT) = {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) <> {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected "|#FFB100}} + qb64prefix$ + {{Text|"MEM type"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            blkoffs$ = evaluatetotyp(e$, {{Text|-6|#F580B1}})
            {{Text|'            IF typ AND ISREFERENCE THEN e$ = refer(e$, typ, 0)|#31C4C4}}
            {{Text|'WriteBufLine MainTxtBuf, blkoffs$ '???|#31C4C4}}
            e$ = fixoperationorder$(offs$): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            l$ = l$ + sp2 + {{Text|","|#FFB100}} + sp + tlayout$
            e$ = evaluatetotyp(e$, OFFSETTYPE - ISPOINTER): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            offs$ = e$
            {{Text|'WriteBufLine MainTxtBuf, e$ '???|#31C4C4}}
            e$ = fixoperationorder$(var$): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            l$ = l$ + sp2 + {{Text|","|#FFB100}} + sp + tlayout$
            varsize$ = evaluatetotyp(e$, {{Text|-5|#F580B1}}): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            varoffs$ = evaluatetotyp(e$, {{Text|-6|#F580B1}}): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|'WriteBufLine MainTxtBuf, varoffs$ '???|#31C4C4}}
            {{Text|'WriteBufLine MainTxtBuf, varsize$ '???|#31C4C4}}
            {{Text|'what do we do next|#31C4C4}}
            {{Text|'need to know offset of variable and its size|#31C4C4}}
            {{Text|'known sizes will be handled by designated command casts, otherwise use memmove|#31C4C4}}
            s = {{Text|0|#F580B1}}
            {{Text|IF|#F0F0F0}} varsize$ = {{Text|"1"|#FFB100}} {{Text|THEN|#F0F0F0}} s = {{Text|1|#F580B1}}: st$ = {{Text|"int8"|#FFB100}}
            {{Text|IF|#F0F0F0}} varsize$ = {{Text|"2"|#FFB100}} {{Text|THEN|#F0F0F0}} s = {{Text|2|#F580B1}}: st$ = {{Text|"int16"|#FFB100}}
            {{Text|IF|#F0F0F0}} varsize$ = {{Text|"4"|#FFB100}} {{Text|THEN|#F0F0F0}} s = {{Text|4|#F580B1}}: st$ = {{Text|"int32"|#FFB100}}
            {{Text|IF|#F0F0F0}} varsize$ = {{Text|"8"|#FFB100}} {{Text|THEN|#F0F0F0}} s = {{Text|8|#F580B1}}: st$ = {{Text|"int64"|#FFB100}}
            {{Text|IF|#F0F0F0}} NoChecks {{Text|THEN|#F0F0F0}}
                {{Text|'fast version:|#31C4C4}}
                {{Text|IF|#F0F0F0}} s {{Text|THEN|#F0F0F0}}
                    WriteBufLine MainTxtBuf, {{Text|"*("|#FFB100}} + st$ + {{Text|"*)"|#FFB100}} + varoffs$ + {{Text|"=*("|#FFB100}} + st$ + {{Text|"*)("|#FFB100}} + offs$ + {{Text|");"|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    WriteBufLine MainTxtBuf, {{Text|"memmove("|#FFB100}} + varoffs$ + {{Text|",(void*)"|#FFB100}} + offs$ + {{Text|","|#FFB100}} + varsize$ + {{Text|");"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|ELSE|#F0F0F0}}
                {{Text|'safe version:|#31C4C4}}
                WriteBufLine MainTxtBuf, {{Text|"tmp_long="|#FFB100}} + offs$ + {{Text|";"|#FFB100}}
                {{Text|'is mem block init?|#31C4C4}}
                WriteBufLine MainTxtBuf, {{Text|"if ( ((mem_block*)("|#FFB100}} + blkoffs$ + {{Text|"))->lock_offset ){"|#FFB100}}
                {{Text|'are region and id valid?|#31C4C4}}
                WriteBufLine MainTxtBuf, {{Text|"if ("|#FFB100}}
                WriteBufLine MainTxtBuf, {{Text|"tmp_long < ((mem_block*)("|#FFB100}} + blkoffs$ + {{Text|"))->offset  ¦¦"|#FFB100}}
                WriteBufLine MainTxtBuf, {{Text|"(tmp_long+("|#FFB100}} + varsize$ + {{Text|")) > ( ((mem_block*)("|#FFB100}} + blkoffs$ + {{Text|"))->offset + ((mem_block*)("|#FFB100}} + blkoffs$ + {{Text|"))->size)  ¦¦"|#FFB100}}
                WriteBufLine MainTxtBuf, {{Text|"((mem_lock*)((mem_block*)("|#FFB100}} + blkoffs$ + {{Text|"))->lock_offset)->id != ((mem_block*)("|#FFB100}} + blkoffs$ + {{Text|"))->lock_id  ){"|#FFB100}}
                {{Text|'diagnose error|#31C4C4}}
                WriteBufLine MainTxtBuf, {{Text|"if ("|#FFB100}} + {{Text|"((mem_lock*)((mem_block*)("|#FFB100}} + blkoffs$ + {{Text|"))->lock_offset)->id != ((mem_block*)("|#FFB100}} + blkoffs$ + {{Text|"))->lock_id"|#FFB100}} + {{Text|") error(308); else error(300);"|#FFB100}}
                WriteBufLine MainTxtBuf, {{Text|"}else{"|#FFB100}}
                {{Text|IF|#F0F0F0}} s {{Text|THEN|#F0F0F0}}
                    WriteBufLine MainTxtBuf, {{Text|"*("|#FFB100}} + st$ + {{Text|"*)"|#FFB100}} + varoffs$ + {{Text|"=*("|#FFB100}} + st$ + {{Text|"*)tmp_long;"|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    WriteBufLine MainTxtBuf, {{Text|"memmove("|#FFB100}} + varoffs$ + {{Text|",(void*)tmp_long,"|#FFB100}} + varsize$ + {{Text|");"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}}
                WriteBufLine MainTxtBuf, {{Text|"}else error(309);"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
            {{Text|GOTO|#F0F0F0}} finishedline
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} n >= {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"_MEMPUT"|#FFB100}} {{Text|OR|#F0F0F0}} (firstelement$ = {{Text|"MEMPUT"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
            {{Text|'get expressions|#31C4C4}}
            typ$ = {{Text|""|#FFB100}}
            e$ = {{Text|""|#FFB100}}
            B = {{Text|0|#F580B1}}
            ne = {{Text|0|#F580B1}}
            {{Text|FOR|#F0F0F0}} i2 = {{Text|2|#F580B1}} {{Text|TO|#F0F0F0}} n
                e2$ = getelement$(ca$, i2)
                {{Text|IF|#F0F0F0}} e2$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} B = B + {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} e2$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} B = B - {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} (e2$ = {{Text|","|#FFB100}} {{Text|OR|#F0F0F0}} {{Text|UCASE$|#F0F0F0}}(e2$) = {{Text|"AS"|#FFB100}}) {{Text|AND|#F0F0F0}} B = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    ne = ne + {{Text|1|#F580B1}}
                    {{Text|IF|#F0F0F0}} ne = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} blk$ = e$: e$ = {{Text|""|#FFB100}}
                    {{Text|IF|#F0F0F0}} ne = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} offs$ = e$: e$ = {{Text|""|#FFB100}}
                    {{Text|IF|#F0F0F0}} ne = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} var$ = e$: e$ = {{Text|""|#FFB100}}
                    {{Text|IF|#F0F0F0}} ({{Text|UCASE$|#F0F0F0}}(e2$) = {{Text|"AS"|#FFB100}} {{Text|AND|#F0F0F0}} ne <> {{Text|3|#F580B1}}) {{Text|OR|#F0F0F0}} (ne = {{Text|3|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|UCASE$|#F0F0F0}}(e2$) <> {{Text|"AS"|#FFB100}}) {{Text|OR|#F0F0F0}} ne = {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected _MEMPUT mem-reference,offset,variable¦value[AS type]"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|ELSE|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(e$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = e2$ {{Text|ELSE|#F0F0F0}} e$ = e$ + sp + e2$
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|NEXT|#F0F0F0}}
            {{Text|IF|#F0F0F0}} ne < {{Text|2|#F580B1}} {{Text|OR|#F0F0F0}} e$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected "|#FFB100}} + qb64prefix$ + {{Text|"MEMPUT mem-reference, offset, variable¦value[AS type]"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} ne = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} var$ = e$ {{Text|ELSE|#F0F0F0}} typ$ = {{Text|UCASE$|#F0F0F0}}(e$)
            {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"_MEMPUT"|#FFB100}} {{Text|THEN|#F0F0F0}} l$ = SCase$({{Text|"_MemPut"|#FFB100}}) + sp {{Text|ELSE|#F0F0F0}} l$ = SCase$({{Text|"MemPut"|#FFB100}}) + sp
            e$ = fixoperationorder$(blk$): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            l$ = l$ + tlayout$
            test$ = evaluate(e$, typ): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISUDT) = {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) <> {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected "|#FFB100}} + qb64prefix$ + {{Text|"MEM type"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            blkoffs$ = evaluatetotyp(e$, {{Text|-6|#F580B1}})
            e$ = fixoperationorder$(offs$): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            l$ = l$ + sp2 + {{Text|","|#FFB100}} + sp + tlayout$
            e$ = evaluatetotyp(e$, OFFSETTYPE - ISPOINTER): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            offs$ = e$
            {{Text|IF|#F0F0F0}} ne = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                e$ = fixoperationorder$(var$): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                l$ = l$ + sp2 + {{Text|","|#FFB100}} + sp + tlayout$
                test$ = evaluate(e$, t): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISREFERENCE) = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}}
                    WriteBufLine MainTxtBuf, {{Text|"g_tmp_str="|#FFB100}} + test$ + {{Text|";"|#FFB100}}
                    varsize$ = {{Text|"g_tmp_str->len"|#FFB100}}
                    varoffs$ = {{Text|"g_tmp_str->chr"|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    varsize$ = evaluatetotyp(e$, {{Text|-5|#F580B1}}): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    varoffs$ = evaluatetotyp(e$, {{Text|-6|#F580B1}}): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'known sizes will be handled by designated command casts, otherwise use memmove|#31C4C4}}
                s = {{Text|0|#F580B1}}
                {{Text|IF|#F0F0F0}} varsize$ = {{Text|"1"|#FFB100}} {{Text|THEN|#F0F0F0}} s = {{Text|1|#F580B1}}: st$ = {{Text|"int8"|#FFB100}}
                {{Text|IF|#F0F0F0}} varsize$ = {{Text|"2"|#FFB100}} {{Text|THEN|#F0F0F0}} s = {{Text|2|#F580B1}}: st$ = {{Text|"int16"|#FFB100}}
                {{Text|IF|#F0F0F0}} varsize$ = {{Text|"4"|#FFB100}} {{Text|THEN|#F0F0F0}} s = {{Text|4|#F580B1}}: st$ = {{Text|"int32"|#FFB100}}
                {{Text|IF|#F0F0F0}} varsize$ = {{Text|"8"|#FFB100}} {{Text|THEN|#F0F0F0}} s = {{Text|8|#F580B1}}: st$ = {{Text|"int64"|#FFB100}}
                {{Text|IF|#F0F0F0}} NoChecks {{Text|THEN|#F0F0F0}}
                    {{Text|'fast version:|#31C4C4}}
                    {{Text|IF|#F0F0F0}} s {{Text|THEN|#F0F0F0}}
                        WriteBufLine MainTxtBuf, {{Text|"*("|#FFB100}} + st$ + {{Text|"*)("|#FFB100}} + offs$ + {{Text|")=*("|#FFB100}} + st$ + {{Text|"*)"|#FFB100}} + varoffs$ + {{Text|";"|#FFB100}}
                    {{Text|ELSE|#F0F0F0}}
                        WriteBufLine MainTxtBuf, {{Text|"memmove((void*)"|#FFB100}} + offs$ + {{Text|","|#FFB100}} + varoffs$ + {{Text|","|#FFB100}} + varsize$ + {{Text|");"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|ELSE|#F0F0F0}}
                    {{Text|'safe version:|#31C4C4}}
                    WriteBufLine MainTxtBuf, {{Text|"tmp_long="|#FFB100}} + offs$ + {{Text|";"|#FFB100}}
                    {{Text|'is mem block init?|#31C4C4}}
                    WriteBufLine MainTxtBuf, {{Text|"if ( ((mem_block*)("|#FFB100}} + blkoffs$ + {{Text|"))->lock_offset ){"|#FFB100}}
                    {{Text|'are region and id valid?|#31C4C4}}
                    WriteBufLine MainTxtBuf, {{Text|"if ("|#FFB100}}
                    WriteBufLine MainTxtBuf, {{Text|"tmp_long < ((mem_block*)("|#FFB100}} + blkoffs$ + {{Text|"))->offset  ¦¦"|#FFB100}}
                    WriteBufLine MainTxtBuf, {{Text|"(tmp_long+("|#FFB100}} + varsize$ + {{Text|")) > ( ((mem_block*)("|#FFB100}} + blkoffs$ + {{Text|"))->offset + ((mem_block*)("|#FFB100}} + blkoffs$ + {{Text|"))->size)  ¦¦"|#FFB100}}
                    WriteBufLine MainTxtBuf, {{Text|"((mem_lock*)((mem_block*)("|#FFB100}} + blkoffs$ + {{Text|"))->lock_offset)->id != ((mem_block*)("|#FFB100}} + blkoffs$ + {{Text|"))->lock_id  ){"|#FFB100}}
                    {{Text|'diagnose error|#31C4C4}}
                    WriteBufLine MainTxtBuf, {{Text|"if ("|#FFB100}} + {{Text|"((mem_lock*)((mem_block*)("|#FFB100}} + blkoffs$ + {{Text|"))->lock_offset)->id != ((mem_block*)("|#FFB100}} + blkoffs$ + {{Text|"))->lock_id"|#FFB100}} + {{Text|") error(308); else error(300);"|#FFB100}}
                    WriteBufLine MainTxtBuf, {{Text|"}else{"|#FFB100}}
                    {{Text|IF|#F0F0F0}} s {{Text|THEN|#F0F0F0}}
                        WriteBufLine MainTxtBuf, {{Text|"*("|#FFB100}} + st$ + {{Text|"*)tmp_long=*("|#FFB100}} + st$ + {{Text|"*)"|#FFB100}} + varoffs$ + {{Text|";"|#FFB100}}
                    {{Text|ELSE|#F0F0F0}}
                        WriteBufLine MainTxtBuf, {{Text|"memmove((void*)tmp_long,"|#FFB100}} + varoffs$ + {{Text|","|#FFB100}} + varsize$ + {{Text|");"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}}
                    WriteBufLine MainTxtBuf, {{Text|"}else error(309);"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|ELSE|#F0F0F0}}
                {{Text|'... AS type method|#31C4C4}}
                {{Text|'FUNCTION typname2typ& (t2$)|#31C4C4}}
                {{Text|'typname2typsize = 0 'the default|#31C4C4}}
                t = typname2typ(typ$)
                {{Text|IF|#F0F0F0}} t = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Invalid type"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISOFFSETINBITS) <> {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISUDT) <> {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}} a$ = qb64prefix$ + {{Text|"MEMPUT requires numeric type"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISPOINTER) {{Text|THEN|#F0F0F0}} t = t - ISPOINTER
                {{Text|'attempt conversion...|#31C4C4}}
                e$ = fixoperationorder$(var$): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                l$ = l$ + sp2 + {{Text|","|#FFB100}} + sp + tlayout$ + sp + SCase$({{Text|"As"|#FFB100}}) + sp + typ$
                e$ = evaluatetotyp(e$, t): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                st$ = typ2ctyp$(t, {{Text|""|#FFB100}})
                varsize$ = str2((t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}})
                {{Text|IF|#F0F0F0}} NoChecks {{Text|THEN|#F0F0F0}}
                    {{Text|'fast version:|#31C4C4}}
                    WriteBufLine MainTxtBuf, {{Text|"*("|#FFB100}} + st$ + {{Text|"*)("|#FFB100}} + offs$ + {{Text|")="|#FFB100}} + e$ + {{Text|";"|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    {{Text|'safe version:|#31C4C4}}
                    WriteBufLine MainTxtBuf, {{Text|"tmp_long="|#FFB100}} + offs$ + {{Text|";"|#FFB100}}
                    {{Text|'is mem block init?|#31C4C4}}
                    WriteBufLine MainTxtBuf, {{Text|"if ( ((mem_block*)("|#FFB100}} + blkoffs$ + {{Text|"))->lock_offset ){"|#FFB100}}
                    {{Text|'are region and id valid?|#31C4C4}}
                    WriteBufLine MainTxtBuf, {{Text|"if ("|#FFB100}}
                    WriteBufLine MainTxtBuf, {{Text|"tmp_long < ((mem_block*)("|#FFB100}} + blkoffs$ + {{Text|"))->offset  ¦¦"|#FFB100}}
                    WriteBufLine MainTxtBuf, {{Text|"(tmp_long+("|#FFB100}} + varsize$ + {{Text|")) > ( ((mem_block*)("|#FFB100}} + blkoffs$ + {{Text|"))->offset + ((mem_block*)("|#FFB100}} + blkoffs$ + {{Text|"))->size)  ¦¦"|#FFB100}}
                    WriteBufLine MainTxtBuf, {{Text|"((mem_lock*)((mem_block*)("|#FFB100}} + blkoffs$ + {{Text|"))->lock_offset)->id != ((mem_block*)("|#FFB100}} + blkoffs$ + {{Text|"))->lock_id  ){"|#FFB100}}
                    {{Text|'diagnose error|#31C4C4}}
                    WriteBufLine MainTxtBuf, {{Text|"if ("|#FFB100}} + {{Text|"((mem_lock*)((mem_block*)("|#FFB100}} + blkoffs$ + {{Text|"))->lock_offset)->id != ((mem_block*)("|#FFB100}} + blkoffs$ + {{Text|"))->lock_id"|#FFB100}} + {{Text|") error(308); else error(300);"|#FFB100}}
                    WriteBufLine MainTxtBuf, {{Text|"}else{"|#FFB100}}
                    WriteBufLine MainTxtBuf, {{Text|"*("|#FFB100}} + st$ + {{Text|"*)tmp_long="|#FFB100}} + e$ + {{Text|";"|#FFB100}}
                    WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}}
                    WriteBufLine MainTxtBuf, {{Text|"}else error(309);"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
            {{Text|GOTO|#F0F0F0}} finishedline
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} n >= {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"_MEMFILL"|#FFB100}} {{Text|OR|#F0F0F0}} (firstelement$ = {{Text|"MEMFILL"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
            {{Text|'get expressions|#31C4C4}}
            typ$ = {{Text|""|#FFB100}}
            e$ = {{Text|""|#FFB100}}
            B = {{Text|0|#F580B1}}
            ne = {{Text|0|#F580B1}}
            {{Text|FOR|#F0F0F0}} i2 = {{Text|2|#F580B1}} {{Text|TO|#F0F0F0}} n
                e2$ = getelement$(ca$, i2)
                {{Text|IF|#F0F0F0}} e2$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} B = B + {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} e2$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} B = B - {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} (e2$ = {{Text|","|#FFB100}} {{Text|OR|#F0F0F0}} {{Text|UCASE$|#F0F0F0}}(e2$) = {{Text|"AS"|#FFB100}}) {{Text|AND|#F0F0F0}} B = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    ne = ne + {{Text|1|#F580B1}}
                    {{Text|IF|#F0F0F0}} ne = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} blk$ = e$: e$ = {{Text|""|#FFB100}}
                    {{Text|IF|#F0F0F0}} ne = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} offs$ = e$: e$ = {{Text|""|#FFB100}}
                    {{Text|IF|#F0F0F0}} ne = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} bytes$ = e$: e$ = {{Text|""|#FFB100}}
                    {{Text|IF|#F0F0F0}} ne = {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} var$ = e$: e$ = {{Text|""|#FFB100}}
                    {{Text|IF|#F0F0F0}} ({{Text|UCASE$|#F0F0F0}}(e2$) = {{Text|"AS"|#FFB100}} {{Text|AND|#F0F0F0}} ne <> {{Text|4|#F580B1}}) {{Text|OR|#F0F0F0}} (ne = {{Text|4|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|UCASE$|#F0F0F0}}(e2$) <> {{Text|"AS"|#FFB100}}) {{Text|OR|#F0F0F0}} ne = {{Text|5|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected _MEMFILL mem-reference,offset,bytes,variable¦value[AS type]"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|ELSE|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(e$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = e2$ {{Text|ELSE|#F0F0F0}} e$ = e$ + sp + e2$
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|NEXT|#F0F0F0}}
            {{Text|IF|#F0F0F0}} ne < {{Text|3|#F580B1}} {{Text|OR|#F0F0F0}} e$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected "|#FFB100}} + qb64prefix$ + {{Text|"MEMFILL mem-reference, offset, bytes, variable¦value[AS type]"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} ne = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} var$ = e$ {{Text|ELSE|#F0F0F0}} typ$ = {{Text|UCASE$|#F0F0F0}}(e$)
            {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"_MEMFILL"|#FFB100}} {{Text|THEN|#F0F0F0}} l$ = SCase$({{Text|"_MemFill"|#FFB100}}) + sp {{Text|ELSE|#F0F0F0}} l$ = SCase$({{Text|"MemFill"|#FFB100}}) + sp
            e$ = fixoperationorder$(blk$): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            l$ = l$ + tlayout$
            test$ = evaluate(e$, typ): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISUDT) = {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) <> {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected "|#FFB100}} + qb64prefix$ + {{Text|"MEM type"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            blkoffs$ = evaluatetotyp(e$, {{Text|-6|#F580B1}})
            e$ = fixoperationorder$(offs$): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            l$ = l$ + sp2 + {{Text|","|#FFB100}} + sp + tlayout$
            e$ = evaluatetotyp(e$, OFFSETTYPE - ISPOINTER): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            offs$ = e$
            e$ = fixoperationorder$(bytes$): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            l$ = l$ + sp2 + {{Text|","|#FFB100}} + sp + tlayout$
            e$ = evaluatetotyp(e$, OFFSETTYPE - ISPOINTER): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            bytes$ = e$
            {{Text|IF|#F0F0F0}} ne = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'no AS|#31C4C4}}
                e$ = fixoperationorder$(var$): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                l$ = l$ + sp2 + {{Text|","|#FFB100}} + sp + tlayout$
                test$ = evaluate(e$, t)
                {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISREFERENCE) = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}}
                    WriteBufLine MainTxtBuf, {{Text|"tmp_long=(ptrszint)"|#FFB100}} + test$ + {{Text|";"|#FFB100}}
                    varsize$ = {{Text|"((qbs*)tmp_long)->len"|#FFB100}}
                    varoffs$ = {{Text|"((qbs*)tmp_long)->chr"|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    varsize$ = evaluatetotyp(e$, {{Text|-5|#F580B1}}): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    varoffs$ = evaluatetotyp(e$, {{Text|-6|#F580B1}}): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} NoChecks {{Text|THEN|#F0F0F0}}
                    WriteBufLine MainTxtBuf, {{Text|"sub__memfill_nochecks("|#FFB100}} + offs$ + {{Text|","|#FFB100}} + bytes$ + {{Text|",(ptrszint)"|#FFB100}} + varoffs$ + {{Text|","|#FFB100}} + varsize$ + {{Text|");"|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    WriteBufLine MainTxtBuf, {{Text|"sub__memfill((mem_block*)"|#FFB100}} + blkoffs$ + {{Text|","|#FFB100}} + offs$ + {{Text|","|#FFB100}} + bytes$ + {{Text|",(ptrszint)"|#FFB100}} + varoffs$ + {{Text|","|#FFB100}} + varsize$ + {{Text|");"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|ELSE|#F0F0F0}}
                {{Text|'... AS type method|#31C4C4}}
                t = typname2typ(typ$)
                {{Text|IF|#F0F0F0}} t = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Invalid type"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISOFFSETINBITS) <> {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISUDT) <> {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}} a$ = qb64prefix$ + {{Text|"MEMFILL requires numeric type"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISPOINTER) {{Text|THEN|#F0F0F0}} t = t - ISPOINTER
                {{Text|'attempt conversion...|#31C4C4}}
                e$ = fixoperationorder$(var$): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                l$ = l$ + sp2 + {{Text|","|#FFB100}} + sp + tlayout$ + sp + SCase$({{Text|"As"|#FFB100}}) + sp + typ$
                e$ = evaluatetotyp(e$, t): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                c$ = {{Text|"sub__memfill_"|#FFB100}}
                {{Text|IF|#F0F0F0}} NoChecks {{Text|THEN|#F0F0F0}} c$ = {{Text|"sub__memfill_nochecks_"|#FFB100}}
                {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISOFFSET {{Text|THEN|#F0F0F0}}
                    c$ = c$ + {{Text|"OFFSET"|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISFLOAT {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) = {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} c$ = c$ + {{Text|"SINGLE"|#FFB100}}
                        {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) = {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}} c$ = c$ + {{Text|"DOUBLE"|#FFB100}}
                        {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) = {{Text|256|#F580B1}} {{Text|THEN|#F0F0F0}} c$ = c$ + {{Text|"FLOAT"|#FFB100}} {{Text|'padded variable|#31C4C4}}
                    {{Text|ELSE|#F0F0F0}}
                        c$ = c$ + str2((t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}})
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                c$ = c$ + {{Text|"("|#FFB100}}
                {{Text|IF|#F0F0F0}} NoChecks = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} c$ = c$ + {{Text|"(mem_block*)"|#FFB100}} + blkoffs$ + {{Text|","|#FFB100}}
                WriteBufLine MainTxtBuf, c$ + offs$ + {{Text|","|#FFB100}} + bytes$ + {{Text|","|#FFB100}} + e$ + {{Text|");"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
            {{Text|GOTO|#F0F0F0}} finishedline
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'note: ABSOLUTE cannot be used without CALL|#31C4C4}}
    cispecial = {{Text|0|#F580B1}}
    {{Text|IF|#F0F0F0}} n > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"INTERRUPT"|#FFB100}} {{Text|OR|#F0F0F0}} firstelement$ = {{Text|"INTERRUPTX"|#FFB100}} {{Text|THEN|#F0F0F0}}
            a$ = {{Text|"CALL"|#FFB100}} + sp + firstelement$ + sp + {{Text|"("|#FFB100}} + sp + getelements$(a$, {{Text|2|#F580B1}}, n) + sp + {{Text|")"|#FFB100}}
            ca$ = {{Text|"CALL"|#FFB100}} + sp + firstelement$ + sp + {{Text|"("|#FFB100}} + sp + getelements$(ca$, {{Text|2|#F580B1}}, n) + sp + {{Text|")"|#FFB100}}
            n = n + {{Text|3|#F580B1}}
            firstelement$ = {{Text|"CALL"|#FFB100}}
            cispecial = {{Text|1|#F580B1}}
            {{Text|'fall through|#31C4C4}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    usecall = {{Text|0|#F580B1}}
    {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"CALL"|#FFB100}} {{Text|THEN|#F0F0F0}}
        usecall = {{Text|1|#F580B1}}
        {{Text|IF|#F0F0F0}} n = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected CALL sub-name [(...)]"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
        cn$ = getelement$(ca$, {{Text|2|#F580B1}}): n$ = {{Text|UCASE$|#F0F0F0}}(cn$)
        {{Text|IF|#F0F0F0}} n > {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} n <= {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected CALL sub-name (...)"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} getelement$(a$, {{Text|3|#F580B1}}) <> {{Text|"("|#FFB100}} {{Text|OR|#F0F0F0}} getelement$(a$, n) <> {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected CALL sub-name (...)"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            a$ = n$ + sp + getelements$(a$, {{Text|4|#F580B1}}, n - {{Text|1|#F580B1}})
            ca$ = cn$ + sp + getelements$(ca$, {{Text|4|#F580B1}}, n - {{Text|1|#F580B1}})
            {{Text|IF|#F0F0F0}} n$ = {{Text|"INTERRUPT"|#FFB100}} {{Text|OR|#F0F0F0}} n$ = {{Text|"INTERRUPTX"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|'assume CALL INTERRUPT[X] request|#31C4C4}}
                {{Text|'print "CI: call interrupt command reached":sleep 1|#31C4C4}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"INTERRUPT"|#FFB100}} {{Text|THEN|#F0F0F0}} WriteBufRawData MainTxtBuf, {{Text|"call_interrupt("|#FFB100}} {{Text|ELSE|#F0F0F0}} WriteBufRawData MainTxtBuf, {{Text|"call_interruptx("|#FFB100}}
                argn = {{Text|0|#F580B1}}
                n = numelements(a$)
                B = {{Text|0|#F580B1}}
                e$ = {{Text|""|#FFB100}}
                {{Text|FOR|#F0F0F0}} i = {{Text|2|#F580B1}} {{Text|TO|#F0F0F0}} n
                    e2$ = getelement$(ca$, i)
                    {{Text|IF|#F0F0F0}} e2$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} B = B + {{Text|1|#F580B1}}
                    {{Text|IF|#F0F0F0}} e2$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} B = B - {{Text|1|#F580B1}}
                    {{Text|IF|#F0F0F0}} (e2$ = {{Text|","|#FFB100}} {{Text|AND|#F0F0F0}} B = {{Text|0|#F580B1}}) {{Text|OR|#F0F0F0}} i = n {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} i = n {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} e$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} e$ = e2$ {{Text|ELSE|#F0F0F0}} e$ = e$ + sp + e2$
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        argn = argn + {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} argn = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'interrupt number|#31C4C4}}
                            e$ = fixoperationorder$(e$)
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            l$ = SCase$({{Text|"Call"|#FFB100}}) + sp + n$ + sp2 + {{Text|"("|#FFB100}} + sp2 + tlayout$
                            {{Text|IF|#F0F0F0}} cispecial = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} l$ = n$ + sp + tlayout$
                            e$ = evaluatetotyp(e$, {{Text|64&|#F580B1}})
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|'print "CI: evaluated interrupt number as ["+e$+"]":sleep 1|#31C4C4}}
                            WriteBufRawData MainTxtBuf, e$
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} argn = {{Text|2|#F580B1}} {{Text|OR|#F0F0F0}} argn = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'inregs, outregs|#31C4C4}}
                            e$ = fixoperationorder$(e$)
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            l$ = l$ + sp2 + {{Text|","|#FFB100}} + sp + tlayout$
                            e2$ = e$
                            e$ = evaluatetotyp(e$, {{Text|-2|#F580B1}}) {{Text|'offset+size|#31C4C4}}
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|'print "CI: evaluated in/out regs ["+e2$+"] as ["+e$+"]":sleep 1|#31C4C4}}
                            WriteBufRawData MainTxtBuf, {{Text|","|#FFB100}} + e$
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        e$ = {{Text|""|#FFB100}}
                    {{Text|ELSE|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} e$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} e$ = e2$ {{Text|ELSE|#F0F0F0}} e$ = e$ + sp + e2$
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|NEXT|#F0F0F0}}
                {{Text|IF|#F0F0F0}} argn <> {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected CALL INTERRUPT (interrupt-no, inregs, outregs)"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                WriteBufLine MainTxtBuf, {{Text|");"|#FFB100}}
                {{Text|IF|#F0F0F0}} cispecial = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} l$ = l$ + sp2 + {{Text|")"|#FFB100}}
                layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                {{Text|'print "CI: done":sleep 1|#31C4C4}}
                {{Text|GOTO|#F0F0F0}} finishedline
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'call interrupt|#31C4C4}}
            {{Text|'call to CALL ABSOLUTE beyond reasonable doubt|#31C4C4}}
            {{Text|IF|#F0F0F0}} n$ = {{Text|"ABSOLUTE"|#FFB100}} {{Text|THEN|#F0F0F0}}
                l$ = SCase$({{Text|"Call"|#FFB100}} + sp + {{Text|"Absolute"|#FFB100}} + sp2 + {{Text|"("|#FFB100}} + sp2)
                argn = {{Text|0|#F580B1}}
                n = numelements(a$)
                B = {{Text|0|#F580B1}}
                e$ = {{Text|""|#FFB100}}
                {{Text|FOR|#F0F0F0}} i = {{Text|2|#F580B1}} {{Text|TO|#F0F0F0}} n
                    e2$ = getelement$(ca$, i)
                    {{Text|IF|#F0F0F0}} e2$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} B = B + {{Text|1|#F580B1}}
                    {{Text|IF|#F0F0F0}} e2$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} B = B - {{Text|1|#F580B1}}
                    {{Text|IF|#F0F0F0}} (e2$ = {{Text|","|#FFB100}} {{Text|AND|#F0F0F0}} B = {{Text|0|#F580B1}}) {{Text|OR|#F0F0F0}} i = n {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} i < n {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} e$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected expression before , or )"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|'1. variable or value?|#31C4C4}}
                            e$ = fixoperationorder$(e$)
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            l$ = l$ + tlayout$ + sp2 + {{Text|","|#FFB100}} + sp
                            ignore$ = evaluate(e$, typ)
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISPOINTER) <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISREFERENCE) <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                {{Text|'assume standard variable|#31C4C4}}
                                {{Text|'assume not string/array/udt/etc|#31C4C4}}
                                e$ = {{Text|"VARPTR"|#FFB100}} + sp + {{Text|"("|#FFB100}} + sp + e$ + sp + {{Text|")"|#FFB100}}
                                e$ = evaluatetotyp(e$, UINTEGERTYPE - ISPOINTER)
                                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|ELSE|#F0F0F0}}
                                {{Text|'assume not string|#31C4C4}}
                                {{Text|'single, double or integer64?|#31C4C4}}
                                {{Text|IF|#F0F0F0}} typ {{Text|AND|#F0F0F0}} ISFLOAT {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) = {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        e$ = evaluatetotyp(e$, SINGLETYPE - ISPOINTER)
                                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                        v$ = {{Text|"pass"|#FFB100}} + str2$(uniquenumber)
                                        WriteBufLine defdatahandle, {{Text|"float *"|#FFB100}} + v$ + {{Text|"=NULL;"|#FFB100}}
                                        WriteBufLine DataTxtBuf, {{Text|"if("|#FFB100}} + v$ + {{Text|"==NULL){"|#FFB100}}
                                        WriteBufLine DataTxtBuf, {{Text|"cmem_sp-=4;"|#FFB100}}
                                        WriteBufLine DataTxtBuf, v$ + {{Text|"=(float*)(dblock+cmem_sp);"|#FFB100}}
                                        WriteBufLine DataTxtBuf, {{Text|"if (cmem_sp<qbs_cmem_sp) error(257);"|#FFB100}}
                                        WriteBufLine DataTxtBuf, {{Text|"}"|#FFB100}}
                                        e$ = {{Text|"(uint16)(((uint8*)&(*"|#FFB100}} + v$ + {{Text|"="|#FFB100}} + e$ + {{Text|"))-((uint8*)dblock))"|#FFB100}}
                                    {{Text|ELSE|#F0F0F0}}
                                        e$ = evaluatetotyp(e$, DOUBLETYPE - ISPOINTER)
                                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                        v$ = {{Text|"pass"|#FFB100}} + str2$(uniquenumber)
                                        WriteBufLine defdatahandle, {{Text|"double *"|#FFB100}} + v$ + {{Text|"=NULL;"|#FFB100}}
                                        WriteBufLine DataTxtBuf, {{Text|"if("|#FFB100}} + v$ + {{Text|"==NULL){"|#FFB100}}
                                        WriteBufLine DataTxtBuf, {{Text|"cmem_sp-=8;"|#FFB100}}
                                        WriteBufLine DataTxtBuf, v$ + {{Text|"=(double*)(dblock+cmem_sp);"|#FFB100}}
                                        WriteBufLine DataTxtBuf, {{Text|"if (cmem_sp<qbs_cmem_sp) error(257);"|#FFB100}}
                                        WriteBufLine DataTxtBuf, {{Text|"}"|#FFB100}}
                                        e$ = {{Text|"(uint16)(((uint8*)&(*"|#FFB100}} + v$ + {{Text|"="|#FFB100}} + e$ + {{Text|"))-((uint8*)dblock))"|#FFB100}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|ELSE|#F0F0F0}}
                                    e$ = evaluatetotyp(e$, INTEGER64TYPE - ISPOINTER)
                                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                    v$ = {{Text|"pass"|#FFB100}} + str2$(uniquenumber)
                                    WriteBufLine defdatahandle, {{Text|"int64 *"|#FFB100}} + v$ + {{Text|"=NULL;"|#FFB100}}
                                    WriteBufLine DataTxtBuf, {{Text|"if("|#FFB100}} + v$ + {{Text|"==NULL){"|#FFB100}}
                                    WriteBufLine DataTxtBuf, {{Text|"cmem_sp-=8;"|#FFB100}}
                                    WriteBufLine DataTxtBuf, v$ + {{Text|"=(int64*)(dblock+cmem_sp);"|#FFB100}}
                                    WriteBufLine DataTxtBuf, {{Text|"if (cmem_sp<qbs_cmem_sp) error(257);"|#FFB100}}
                                    WriteBufLine DataTxtBuf, {{Text|"}"|#FFB100}}
                                    e$ = {{Text|"(uint16)(((uint8*)&(*"|#FFB100}} + v$ + {{Text|"="|#FFB100}} + e$ + {{Text|"))-((uint8*)dblock))"|#FFB100}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            WriteBufLine MainTxtBuf, {{Text|"call_absolute_offsets["|#FFB100}} + str2$(argn) + {{Text|"]="|#FFB100}} + e$ + {{Text|";"|#FFB100}}
                        {{Text|ELSE|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} e$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} e$ = e2$ {{Text|ELSE|#F0F0F0}} e$ = e$ + sp + e2$
                            e$ = fixoperationorder(e$)
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            l$ = l$ + tlayout$ + sp2 + {{Text|")"|#FFB100}}
                            e$ = evaluatetotyp(e$, UINTEGERTYPE - ISPOINTER)
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            WriteBufLine MainTxtBuf, {{Text|"call_absolute("|#FFB100}} + str2$(argn) + {{Text|","|#FFB100}} + e$ + {{Text|");"|#FFB100}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        argn = argn + {{Text|1|#F580B1}}
                        e$ = {{Text|""|#FFB100}}
                    {{Text|ELSE|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} e$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} e$ = e2$ {{Text|ELSE|#F0F0F0}} e$ = e$ + sp + e2$
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|NEXT|#F0F0F0}}
                layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                {{Text|GOTO|#F0F0F0}} finishedline
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|ELSE|#F0F0F0}} {{Text|'n>2|#31C4C4}}
            a$ = n$
            ca$ = cn$
            usecall = {{Text|2|#F580B1}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'n>2|#31C4C4}}
        n = numelements(a$)
        firstelement$ = getelement$(a$, {{Text|1|#F580B1}})
        {{Text|'valid SUB name|#31C4C4}}
        validsub = {{Text|0|#F580B1}}
        findidsecondarg = {{Text|""|#FFB100}}: {{Text|IF|#F0F0F0}} n >= {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findidsecondarg = getelement$(a$, {{Text|2|#F580B1}})
        try = findid(firstelement$)
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
        {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
            {{Text|IF|#F0F0F0}} id.subfunc = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} validsub = {{Text|1|#F580B1}}: {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
            {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                findidsecondarg = {{Text|""|#FFB100}}: {{Text|IF|#F0F0F0}} n >= {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findidsecondarg = getelement$(a$, {{Text|2|#F580B1}})
                findanotherid = {{Text|1|#F580B1}}
                try = findid(firstelement$)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|ELSE|#F0F0F0}}
                try = {{Text|0|#F580B1}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|LOOP|#F0F0F0}}
        {{Text|IF|#F0F0F0}} validsub = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected CALL sub-name [(...)]"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'sub?|#31C4C4}}
    {{Text|IF|#F0F0F0}} n >= {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"?"|#FFB100}} {{Text|THEN|#F0F0F0}} firstelement$ = {{Text|"PRINT"|#FFB100}}
        findidsecondarg = {{Text|""|#FFB100}}: {{Text|IF|#F0F0F0}} n >= {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findidsecondarg = getelement$(a$, {{Text|2|#F580B1}})
        try = findid(firstelement$)
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
        {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
            {{Text|IF|#F0F0F0}} id.subfunc = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|'check symbol|#31C4C4}}
                s$ = removesymbol$(firstelement$ + {{Text|""|#FFB100}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} {{Text|ASC|#F0F0F0}}(id.musthave) = {{Text|36|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'="$"|#31C4C4}}
                    {{Text|IF|#F0F0F0}} s$ <> {{Text|"$"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} notsubcall {{Text|'missing musthave "$"|#31C4C4}}
                {{Text|ELSE|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(s$) {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} notsubcall {{Text|'unrequired symbol added|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'check for variable assignment|#31C4C4}}
                {{Text|IF|#F0F0F0}} n > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} {{Text|ASC|#F0F0F0}}(id.specialformat) <> {{Text|61|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'<>"="|#31C4C4}}
                        {{Text|IF|#F0F0F0}} {{Text|ASC|#F0F0F0}}(getelement$(a$, {{Text|2|#F580B1}})) = {{Text|61|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} notsubcall {{Text|'assignment, not sub call|#31C4C4}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'check for array assignment|#31C4C4}}
                {{Text|IF|#F0F0F0}} n > {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} firstelement$ <> {{Text|"PRINT"|#FFB100}} {{Text|AND|#F0F0F0}} firstelement$ <> {{Text|"LPRINT"|#FFB100}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} getelement$(a$, {{Text|2|#F580B1}}) = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}}
                            B = {{Text|1|#F580B1}}
                            {{Text|FOR|#F0F0F0}} i = {{Text|3|#F580B1}} {{Text|TO|#F0F0F0}} n
                                e$ = getelement$(a$, i)
                                {{Text|IF|#F0F0F0}} e$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} B = B + {{Text|1|#F580B1}}
                                {{Text|IF|#F0F0F0}} e$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                    B = B - {{Text|1|#F580B1}}
                                    {{Text|IF|#F0F0F0}} B = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} i = n {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} getelement$(a$, i + {{Text|1|#F580B1}}) = {{Text|"="|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} notsubcall
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|NEXT|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'generate error on driect _GL call|#31C4C4}}
                {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"_GL"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    a$ = {{Text|"Cannot call SUB _GL directly"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"VWATCH"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    a$ = {{Text|"Cannot call SUB VWATCH directly"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"OPEN"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|'gwbasic or qbasic version?|#31C4C4}}
                    B = {{Text|0|#F580B1}}
                    {{Text|FOR|#F0F0F0}} x = {{Text|2|#F580B1}} {{Text|TO|#F0F0F0}} n
                        a2$ = getelement$(a$, x)
                        {{Text|IF|#F0F0F0}} a2$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} B = B + {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} a2$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} B = B - {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} a2$ = {{Text|"FOR"|#FFB100}} {{Text|OR|#F0F0F0}} a2$ = {{Text|"AS"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}} {{Text|'qb style open verified|#31C4C4}}
                        {{Text|IF|#F0F0F0}} B = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} a2$ = {{Text|","|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|'the gwbasic version includes a comma after the first string expression|#31C4C4}}
                            findanotherid = {{Text|1|#F580B1}}
                            try = findid(firstelement$) {{Text|'id of sub_open_gwbasic|#31C4C4}}
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|NEXT|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'IF findid(firstelement$) THEN|#31C4C4}}
                {{Text|'IF id.subfunc = 2 THEN|#31C4C4}}
                {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"CLOSE"|#FFB100}} {{Text|OR|#F0F0F0}} firstelement$ = {{Text|"RESET"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"RESET"|#FFB100}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} n > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Syntax error - RESET takes no parameters"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                        l$ = SCase$({{Text|"Reset"|#FFB100}})
                    {{Text|ELSE|#F0F0F0}}
                        l$ = SCase$({{Text|"Close"|#FFB100}})
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} n = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                        WriteBufLine MainTxtBuf, {{Text|"sub_close(NULL,0);"|#FFB100}} {{Text|'closes all files|#31C4C4}}
                    {{Text|ELSE|#F0F0F0}}
                        l$ = l$ + sp
                        B = {{Text|0|#F580B1}}
                        s = {{Text|0|#F580B1}}
                        a3$ = {{Text|""|#FFB100}}
                        {{Text|FOR|#F0F0F0}} x = {{Text|2|#F580B1}} {{Text|TO|#F0F0F0}} n
                            a2$ = getelement$(ca$, x)
                            {{Text|IF|#F0F0F0}} a2$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} B = B + {{Text|1|#F580B1}}
                            {{Text|IF|#F0F0F0}} a2$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} B = B - {{Text|1|#F580B1}}
                            {{Text|IF|#F0F0F0}} a2$ = {{Text|"#"|#FFB100}} {{Text|AND|#F0F0F0}} B = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} s = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} s = {{Text|1|#F580B1}} {{Text|ELSE|#F0F0F0}} a$ = {{Text|"Unexpected #"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                l$ = l$ + {{Text|"#"|#FFB100}} + sp2
                                {{Text|GOTO|#F0F0F0}} closenexta
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} a2$ = {{Text|","|#FFB100}} {{Text|AND|#F0F0F0}} B = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} s = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    e$ = fixoperationorder$(a3$)
                                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                    l$ = l$ + tlayout$ + sp2 + {{Text|","|#FFB100}} + sp
                                    e$ = evaluatetotyp(e$, {{Text|64&|#F580B1}})
                                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                    WriteBufLine MainTxtBuf, {{Text|"sub_close("|#FFB100}} + e$ + {{Text|",1);"|#FFB100}}
                                    a3$ = {{Text|""|#FFB100}}
                                    s = {{Text|0|#F580B1}}
                                    {{Text|GOTO|#F0F0F0}} closenexta
                                {{Text|ELSE|#F0F0F0}}
                                    a$ = {{Text|"Expected expression before ,"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            s = {{Text|2|#F580B1}}
                            {{Text|IF|#F0F0F0}} a3$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a3$ = a2$ {{Text|ELSE|#F0F0F0}} a3$ = a3$ + sp + a2$
                            closenexta:
                        {{Text|NEXT|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} s = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                            e$ = fixoperationorder$(a3$)
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            l$ = l$ + tlayout$
                            e$ = evaluatetotyp(e$, {{Text|64&|#F580B1}})
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            WriteBufLine MainTxtBuf, {{Text|"sub_close("|#FFB100}} + e$ + {{Text|",1);"|#FFB100}}
                        {{Text|ELSE|#F0F0F0}}
                            l$ = {{Text|LEFT$|#F0F0F0}}(l$, {{Text|LEN|#F0F0F0}}(l$) - {{Text|1|#F580B1}})
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                    {{Text|GOTO|#F0F0F0}} finishedline
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'close|#31C4C4}}
                {{Text|'data, restore, read|#31C4C4}}
                {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"READ"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|'file input|#31C4C4}}
                    xread ca$, n
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|'note: layout done in xread sub|#31C4C4}}
                    {{Text|GOTO|#F0F0F0}} finishedline
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'read|#31C4C4}}
                lineinput = {{Text|0|#F580B1}}
                {{Text|IF|#F0F0F0}} n >= {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"LINE"|#FFB100}} {{Text|AND|#F0F0F0}} secondelement$ = {{Text|"INPUT"|#FFB100}} {{Text|THEN|#F0F0F0}}
                        lineinput = {{Text|1|#F580B1}}
                        a$ = {{Text|RIGHT$|#F0F0F0}}(a$, {{Text|LEN|#F0F0F0}}(a$) - {{Text|5|#F580B1}}): ca$ = {{Text|RIGHT$|#F0F0F0}}(ca$, {{Text|LEN|#F0F0F0}}(ca$) - {{Text|5|#F580B1}}): n = n - {{Text|1|#F580B1}} {{Text|'remove "LINE"|#31C4C4}}
                        firstelement$ = {{Text|"INPUT"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"INPUT"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|'file input|#31C4C4}}
                    {{Text|IF|#F0F0F0}} n > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} getelement$(a$, {{Text|2|#F580B1}}) = {{Text|"#"|#FFB100}} {{Text|THEN|#F0F0F0}}
                            l$ = SCase$({{Text|"Input"|#FFB100}}) + sp + {{Text|"#"|#FFB100}}: {{Text|IF|#F0F0F0}} lineinput {{Text|THEN|#F0F0F0}} l$ = SCase$({{Text|"Line"|#FFB100}}) + sp + l$
                            u$ = str2$(uniquenumber)
                            {{Text|'which file?|#31C4C4}}
                            {{Text|IF|#F0F0F0}} n = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected # ... , ..."|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                            a3$ = {{Text|""|#FFB100}}
                            B = {{Text|0|#F580B1}}
                            {{Text|FOR|#F0F0F0}} i = {{Text|3|#F580B1}} {{Text|TO|#F0F0F0}} n
                                a2$ = getelement$(ca$, i)
                                {{Text|IF|#F0F0F0}} a2$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} B = B + {{Text|1|#F580B1}}
                                {{Text|IF|#F0F0F0}} a2$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} B = B - {{Text|1|#F580B1}}
                                {{Text|IF|#F0F0F0}} a2$ = {{Text|","|#FFB100}} {{Text|AND|#F0F0F0}} B = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} a3$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected # ... , ..."|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                    {{Text|GOTO|#F0F0F0}} inputgotfn
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} a3$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a3$ = a2$ {{Text|ELSE|#F0F0F0}} a3$ = a3$ + sp + a2$
                            {{Text|NEXT|#F0F0F0}}
                            inputgotfn:
                            e$ = fixoperationorder$(a3$)
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            l$ = l$ + sp2 + tlayout$
                            e$ = evaluatetotyp(e$, {{Text|64&|#F580B1}})
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            WriteBufLine MainTxtBuf, {{Text|"tmp_fileno="|#FFB100}} + e$ + {{Text|";"|#FFB100}}
                            WriteBufLine MainTxtBuf, {{Text|"if (new_error) goto skip"|#FFB100}} + u$ + {{Text|";"|#FFB100}}
                            i = i + {{Text|1|#F580B1}}
                            {{Text|IF|#F0F0F0}} i > n {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected , ..."|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                            a3$ = {{Text|""|#FFB100}}
                            B = {{Text|0|#F580B1}}
                            {{Text|FOR|#F0F0F0}} i = i {{Text|TO|#F0F0F0}} n
                                a2$ = getelement$(ca$, i)
                                {{Text|IF|#F0F0F0}} a2$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} B = B + {{Text|1|#F580B1}}
                                {{Text|IF|#F0F0F0}} a2$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} B = B - {{Text|1|#F580B1}}
                                {{Text|IF|#F0F0F0}} i = n {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} a3$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a3$ = a2$ {{Text|ELSE|#F0F0F0}} a3$ = a3$ + sp + a2$
                                    a2$ = {{Text|","|#FFB100}}: B = {{Text|0|#F580B1}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} a2$ = {{Text|","|#FFB100}} {{Text|AND|#F0F0F0}} B = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} a3$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected , ..."|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                    e$ = fixoperationorder$(a3$)
                                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                    l$ = l$ + sp2 + {{Text|","|#FFB100}} + sp + tlayout$
                                    e$ = evaluate(e$, t)
                                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                    {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISREFERENCE) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected variable-name"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                    {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}}
                                        e$ = refer(e$, t, {{Text|0|#F580B1}})
                                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                        {{Text|IF|#F0F0F0}} lineinput {{Text|THEN|#F0F0F0}}
                                            WriteBufLine MainTxtBuf, {{Text|"sub_file_line_input_string(tmp_fileno,"|#FFB100}} + e$ + {{Text|");"|#FFB100}}
                                            WriteBufLine MainTxtBuf, {{Text|"if (new_error) goto skip"|#FFB100}} + u$ + {{Text|";"|#FFB100}}
                                        {{Text|ELSE|#F0F0F0}}
                                            WriteBufLine MainTxtBuf, {{Text|"sub_file_input_string(tmp_fileno,"|#FFB100}} + e$ + {{Text|");"|#FFB100}}
                                            WriteBufLine MainTxtBuf, {{Text|"if (new_error) goto skip"|#FFB100}} + u$ + {{Text|";"|#FFB100}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                        stringprocessinghappened = {{Text|1|#F580B1}}
                                    {{Text|ELSE|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} lineinput {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected string-variable"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                        {{Text|'numeric variable|#31C4C4}}
                                        {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISFLOAT) <> {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} (t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) <> {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}}
                                            {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISOFFSETINBITS) {{Text|THEN|#F0F0F0}}
                                                setrefer e$, t, {{Text|"((int64)func_file_input_float(tmp_fileno,"|#FFB100}} + str2(t) + {{Text|"))"|#FFB100}}, {{Text|1|#F580B1}}
                                                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                            {{Text|ELSE|#F0F0F0}}
                                                setrefer e$, t, {{Text|"func_file_input_float(tmp_fileno,"|#FFB100}} + str2(t) + {{Text|")"|#FFB100}}, {{Text|1|#F580B1}}
                                                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                        {{Text|ELSE|#F0F0F0}}
                                            {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISUNSIGNED {{Text|THEN|#F0F0F0}}
                                                setrefer e$, t, {{Text|"func_file_input_uint64(tmp_fileno)"|#FFB100}}, {{Text|1|#F580B1}}
                                                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                            {{Text|ELSE|#F0F0F0}}
                                                setrefer e$, t, {{Text|"func_file_input_int64(tmp_fileno)"|#FFB100}}, {{Text|1|#F580B1}}
                                                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                        WriteBufLine MainTxtBuf, {{Text|"if (new_error) goto skip"|#FFB100}} + u$ + {{Text|";"|#FFB100}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} i = n {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} lineinput {{Text|THEN|#F0F0F0}} a$ = {{Text|"Too many variables"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                    a3$ = {{Text|""|#FFB100}}: a2$ = {{Text|""|#FFB100}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} a3$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a3$ = a2$ {{Text|ELSE|#F0F0F0}} a3$ = a3$ + sp + a2$
                            {{Text|NEXT|#F0F0F0}}
                            WriteBufLine MainTxtBuf, {{Text|"skip"|#FFB100}} + u$ + {{Text|":"|#FFB100}}
                            {{Text|IF|#F0F0F0}} stringprocessinghappened {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, cleanupstringprocessingcall$ + {{Text|"0);"|#FFB100}}
                            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                            {{Text|GOTO|#F0F0F0}} finishedline
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'input#|#31C4C4}}
                {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"INPUT"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    l$ = SCase$({{Text|"Input"|#FFB100}}): {{Text|IF|#F0F0F0}} lineinput {{Text|THEN|#F0F0F0}} l$ = SCase$({{Text|"Line"|#FFB100}}) + sp + l$
                    commaneeded = {{Text|0|#F580B1}}
                    i = {{Text|2|#F580B1}}
                    newline = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} getelement$(a$, i) = {{Text|";"|#FFB100}} {{Text|THEN|#F0F0F0}} newline = {{Text|0|#F580B1}}: i = i + {{Text|1|#F580B1}}: l$ = l$ + sp + {{Text|";"|#FFB100}}
                    a2$ = getelement$(ca$, i)
                    {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(a2$, {{Text|1|#F580B1}}) = {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) {{Text|THEN|#F0F0F0}}
                        e$ = fixoperationorder$(a2$): l$ = l$ + sp + tlayout$
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                        WriteBufLine MainTxtBuf, {{Text|"qbs_print(qbs_new_txt_len("|#FFB100}} + a2$ + {{Text|"),0);"|#FFB100}}
                        i = i + {{Text|1|#F580B1}}
                        {{Text|'MUST be followed by a ; or ,|#31C4C4}}
                        a2$ = getelement$(ca$, i)
                        i = i + {{Text|1|#F580B1}}
                        l$ = l$ + sp2 + a2$
                        {{Text|IF|#F0F0F0}} a2$ = {{Text|";"|#FFB100}} {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} lineinput {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} finishedpromptstring
                            WriteBufLine MainTxtBuf, {{Text|"qbs_print(qbs_new_txt("|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"? "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"),0);"|#FFB100}}
                            {{Text|GOTO|#F0F0F0}} finishedpromptstring
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} a2$ = {{Text|","|#FFB100}} {{Text|THEN|#F0F0F0}}
                            {{Text|GOTO|#F0F0F0}} finishedpromptstring
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        a$ = {{Text|"Syntax error - Reference: INPUT [;] "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"[Question or statement text]"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"{,¦;} variable[, ...] or INPUT ; variable[, ...]"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|'there was no promptstring, so print a ?|#31C4C4}}
                    {{Text|IF|#F0F0F0}} lineinput = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, {{Text|"qbs_print(qbs_new_txt("|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"? "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"),0);"|#FFB100}}
                    finishedpromptstring:
                    numvar = {{Text|0|#F580B1}}
                    {{Text|FOR|#F0F0F0}} i = i {{Text|TO|#F0F0F0}} n
                        {{Text|IF|#F0F0F0}} commaneeded = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                            a2$ = getelement$(ca$, i)
                            {{Text|IF|#F0F0F0}} a2$ <> {{Text|","|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Syntax error - comma expected"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                        {{Text|ELSE|#F0F0F0}}
                            B = {{Text|0|#F580B1}}
                            e$ = {{Text|""|#FFB100}}
                            {{Text|FOR|#F0F0F0}} i2 = i {{Text|TO|#F0F0F0}} n
                                e2$ = getelement$(ca$, i2)
                                {{Text|IF|#F0F0F0}} e2$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} B = B + {{Text|1|#F580B1}}
                                {{Text|IF|#F0F0F0}} e2$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} B = B - {{Text|1|#F580B1}}
                                {{Text|IF|#F0F0F0}} e2$ = {{Text|","|#FFB100}} {{Text|AND|#F0F0F0}} B = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} i2 = i2 - {{Text|1|#F580B1}}: {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}}
                                e$ = e$ + sp + e2$
                            {{Text|NEXT|#F0F0F0}}
                            i = i2: {{Text|IF|#F0F0F0}} i > n {{Text|THEN|#F0F0F0}} i = n
                            {{Text|IF|#F0F0F0}} e$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected variable"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                            e$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - {{Text|1|#F580B1}})
                            e$ = fixoperationorder$(e$)
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            l$ = l$ + sp + tlayout$: {{Text|IF|#F0F0F0}} i <> n {{Text|THEN|#F0F0F0}} l$ = l$ + sp2 + {{Text|","|#FFB100}}
                            e$ = evaluate(e$, t)
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISREFERENCE) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected variable"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}}
                                e$ = refer(e$, t, {{Text|0|#F580B1}})
                                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                numvar = numvar + {{Text|1|#F580B1}}
                                {{Text|IF|#F0F0F0}} lineinput {{Text|THEN|#F0F0F0}}
                                    WriteBufLine MainTxtBuf, {{Text|"qbs_input_variabletypes["|#FFB100}} + str2(numvar) + {{Text|"]=ISSTRING+512;"|#FFB100}}
                                {{Text|ELSE|#F0F0F0}}
                                    WriteBufLine MainTxtBuf, {{Text|"qbs_input_variabletypes["|#FFB100}} + str2(numvar) + {{Text|"]=ISSTRING;"|#FFB100}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                WriteBufLine MainTxtBuf, {{Text|"qbs_input_variableoffsets["|#FFB100}} + str2(numvar) + {{Text|"]="|#FFB100}} + e$ + {{Text|";"|#FFB100}}
                                {{Text|GOTO|#F0F0F0}} gotinputvar
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} lineinput {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected string variable"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISARRAY) {{Text|THEN|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISOFFSETINBITS) {{Text|THEN|#F0F0F0}}
                                    a$ = {{Text|"INPUT cannot handle BIT array elements"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            e$ = {{Text|"&("|#FFB100}} + refer(e$, t, {{Text|0|#F580B1}}) + {{Text|")"|#FFB100}}
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|'remove assumed/unnecessary flags|#31C4C4}}
                            {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISPOINTER) {{Text|THEN|#F0F0F0}} t = t - ISPOINTER
                            {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISINCONVENTIONALMEMORY) {{Text|THEN|#F0F0F0}} t = t - ISINCONVENTIONALMEMORY
                            {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}} t = t - ISREFERENCE
                            {{Text|'IF (t AND ISOFFSETINBITS) THEN|#31C4C4}}
                            {{Text|'numvar = numvar + 1|#31C4C4}}
                            {{Text|'consider storing the bit offset in unused bits of t|#31C4C4}}
                            {{Text|'WriteBufLine MainTxtBuf, "qbs_input_variabletypes[" + str2(numvar) + "]=" + str2(t) + ";"|#31C4C4}}
                            {{Text|'WriteBufLine MainTxtBuf, "qbs_input_variableoffsets[" + str2(numvar) + "]=" + refer(ref$, typ, 1) + ";"|#31C4C4}}
                            {{Text|'GOTO gotinputvar|#31C4C4}}
                            {{Text|'END IF|#31C4C4}}
                            {{Text|'assume it is a regular variable|#31C4C4}}
                            numvar = numvar + {{Text|1|#F580B1}}
                            WriteBufLine MainTxtBuf, {{Text|"qbs_input_variabletypes["|#FFB100}} + str2(numvar) + {{Text|"]="|#FFB100}} + str2$(t) + {{Text|";"|#FFB100}}
                            WriteBufLine MainTxtBuf, {{Text|"qbs_input_variableoffsets["|#FFB100}} + str2(numvar) + {{Text|"]="|#FFB100}} + e$ + {{Text|";"|#FFB100}}
                            {{Text|GOTO|#F0F0F0}} gotinputvar
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        gotinputvar:
                        commaneeded = commaneeded + {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} commaneeded = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} commaneeded = {{Text|0|#F580B1}}
                    {{Text|NEXT|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} numvar = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Syntax error - Reference: INPUT [;] "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"[Question or statement text]"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"{,¦;} variable[, ...] or INPUT ; variable[, ...]"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|IF|#F0F0F0}} lineinput = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} numvar > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Too many variables"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|IF|#F0F0F0}} vWatchOn = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                        WriteBufLine MainTxtBuf, {{Text|"*__LONG_VWATCH_LINENUMBER= -4; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    WriteBufLine MainTxtBuf, {{Text|"qbs_input("|#FFB100}} + str2(numvar) + {{Text|","|#FFB100}} + str2$(newline) + {{Text|");"|#FFB100}}
                    WriteBufLine MainTxtBuf, {{Text|"if (stop_program) end();"|#FFB100}}
                    {{Text|IF|#F0F0F0}} vWatchOn = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                        WriteBufLine MainTxtBuf, {{Text|"*__LONG_VWATCH_LINENUMBER= -5; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    WriteBufLine MainTxtBuf, cleanupstringprocessingcall$ + {{Text|"0);"|#FFB100}}
                    layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                    {{Text|GOTO|#F0F0F0}} finishedline
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"WRITE"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|'file write|#31C4C4}}
                    {{Text|IF|#F0F0F0}} n > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} getelement$(a$, {{Text|2|#F580B1}}) = {{Text|"#"|#FFB100}} {{Text|THEN|#F0F0F0}}
                            xfilewrite ca$, n
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|GOTO|#F0F0F0}} finishedline
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'#|#31C4C4}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'n>1|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'"write"|#31C4C4}}
                {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"WRITE"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|'write|#31C4C4}}
                    xwrite ca$, n
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|GOTO|#F0F0F0}} finishedline
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'"write"|#31C4C4}}
                {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"PRINT"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|'file print|#31C4C4}}
                    {{Text|IF|#F0F0F0}} n > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} getelement$(a$, {{Text|2|#F580B1}}) = {{Text|"#"|#FFB100}} {{Text|THEN|#F0F0F0}}
                            xfileprint a$, ca$, n
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            l$ = tlayout$
                            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                            {{Text|GOTO|#F0F0F0}} finishedline
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'#|#31C4C4}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'n>1|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'"print"|#31C4C4}}
                {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"PRINT"|#FFB100}} {{Text|OR|#F0F0F0}} firstelement$ = {{Text|"LPRINT"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} secondelement$ <> {{Text|"USING"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|'check to see if we need to auto-add semicolons|#31C4C4}}
                        elementon = {{Text|2|#F580B1}}
                        redosemi:
                        {{Text|FOR|#F0F0F0}} i = elementon {{Text|TO|#F0F0F0}} n - {{Text|1|#F580B1}}
                            nextchar$ = getelement$(a$, i + {{Text|1|#F580B1}})
                            {{Text|IF|#F0F0F0}} nextchar$ <> {{Text|";"|#FFB100}} {{Text|AND|#F0F0F0}} nextchar$ <> {{Text|","|#FFB100}} {{Text|AND|#F0F0F0}} nextchar$ <> {{Text|"+"|#FFB100}} {{Text|AND|#F0F0F0}} nextchar$ <> {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                temp1$ = getelement$(a$, i)
                                beginpoint = {{Text|INSTR|#F0F0F0}}(beginpoint, temp1$, {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}))
                                endpoint = {{Text|INSTR|#F0F0F0}}(beginpoint + {{Text|1|#F580B1}}, temp1$, {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|","|#FFB100}})
                                {{Text|IF|#F0F0F0}} beginpoint <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} endpoint <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'if we have both positions|#31C4C4}}
                                    {{Text|'Quote without semicolon check (like PRINT "abc"123)|#31C4C4}}
                                    textlength = endpoint - beginpoint - {{Text|1|#F580B1}}
                                    textvalue$ = {{Text|MID$|#F0F0F0}}(temp1$, endpoint + {{Text|2|#F580B1}}, {{Text|LEN|#F0F0F0}}({{Text|LTRIM$|#F0F0F0}}({{Text|STR$|#F0F0F0}}(textlength))))
                                    {{Text|IF|#F0F0F0}} {{Text|VAL|#F0F0F0}}(textvalue$) = textlength {{Text|THEN|#F0F0F0}}
                                        insertelements a$, i, {{Text|";"|#FFB100}}
                                        insertelements ca$, i, {{Text|";"|#FFB100}}
                                        n = n + {{Text|1|#F580B1}}
                                        elementon = i + {{Text|2|#F580B1}} {{Text|'just a easy way to reduce redundant calls to the routine|#31C4C4}}
                                        {{Text|GOTO|#F0F0F0}} redosemi
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} temp1$ <> {{Text|"USING"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}({{Text|LTRIM$|#F0F0F0}}(nextchar$), {{Text|1|#F580B1}}) = {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} temp1$ <> {{Text|";"|#FFB100}} {{Text|AND|#F0F0F0}} temp1$ <> {{Text|","|#FFB100}} {{Text|AND|#F0F0F0}} temp1$ <> {{Text|"+"|#FFB100}} {{Text|AND|#F0F0F0}} temp1$ <> {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}}
                                            insertelements a$, i, {{Text|";"|#FFB100}}
                                            insertelements ca$, i, {{Text|";"|#FFB100}}
                                            n = n + {{Text|1|#F580B1}}
                                            elementon = i + {{Text|2|#F580B1}} {{Text|'just a easy way to reduce redundant calls to the routine|#31C4C4}}
                                            {{Text|GOTO|#F0F0F0}} redosemi
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|NEXT|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    xprint a$, ca$, n
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    l$ = tlayout$
                    layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                    {{Text|GOTO|#F0F0F0}} finishedline
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"CLEAR"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} subfunc$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"CLEAR cannot be used inside a SUB/FUNCTION"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'LSET/RSET|#31C4C4}}
                {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"LSET"|#FFB100}} {{Text|OR|#F0F0F0}} firstelement$ = {{Text|"RSET"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} n = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected "|#FFB100}} + firstelement$ + {{Text|" ..."|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"LSET"|#FFB100}} {{Text|THEN|#F0F0F0}} l$ = SCase$({{Text|"LSet"|#FFB100}}) {{Text|ELSE|#F0F0F0}} l$ = SCase$({{Text|"RSet"|#FFB100}})
                    dest$ = {{Text|""|#FFB100}}
                    source$ = {{Text|""|#FFB100}}
                    part = {{Text|1|#F580B1}}
                    i = {{Text|2|#F580B1}}
                    a3$ = {{Text|""|#FFB100}}
                    B = {{Text|0|#F580B1}}
                    {{Text|DO|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} i > n {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} part <> {{Text|2|#F580B1}} {{Text|OR|#F0F0F0}} a3$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected LSET/RSET stringvariable=string"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                            source$ = a3$
                            {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        a2$ = getelement$(ca$, i)
                        {{Text|IF|#F0F0F0}} a2$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} B = B + {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} a2$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} B = B - {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} a2$ = {{Text|"="|#FFB100}} {{Text|AND|#F0F0F0}} B = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} part = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} dest$ = a3$: part = {{Text|2|#F580B1}}: a3$ = {{Text|""|#FFB100}}: {{Text|GOTO|#F0F0F0}} lrsetgotpart
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(a3$) {{Text|THEN|#F0F0F0}} a3$ = a3$ + sp + a2$ {{Text|ELSE|#F0F0F0}} a3$ = a2$
                        lrsetgotpart:
                        i = i + {{Text|1|#F580B1}}
                    {{Text|LOOP|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} dest$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected LSET/RSET stringvariable=string"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|'check if it is a valid source string|#31C4C4}}
                    f$ = fixoperationorder$(dest$)
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    l$ = l$ + sp + tlayout$ + sp + {{Text|"="|#FFB100}}
                    e$ = evaluate(f$, sourcetyp)
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) = {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"LSET/RSET expects a string variable/array-element as its first argument"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    dest$ = evaluatetotyp(f$, ISSTRING)
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    source$ = fixoperationorder$(source$)
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    l$ = l$ + sp + tlayout$
                    layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                    source$ = evaluatetotyp(source$, ISSTRING)
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"LSET"|#FFB100}} {{Text|THEN|#F0F0F0}}
                        WriteBufLine MainTxtBuf, {{Text|"sub_lset("|#FFB100}} + dest$ + {{Text|","|#FFB100}} + source$ + {{Text|");"|#FFB100}}
                    {{Text|ELSE|#F0F0F0}}
                        WriteBufLine MainTxtBuf, {{Text|"sub_rset("|#FFB100}} + dest$ + {{Text|","|#FFB100}} + source$ + {{Text|");"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|GOTO|#F0F0F0}} finishedline
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'SWAP|#31C4C4}}
                {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"SWAP"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} n < {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected SWAP ... , ..."|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    B = {{Text|0|#F580B1}}
                    ele = {{Text|1|#F580B1}}
                    e1$ = {{Text|""|#FFB100}}
                    e2$ = {{Text|""|#FFB100}}
                    {{Text|FOR|#F0F0F0}} i = {{Text|2|#F580B1}} {{Text|TO|#F0F0F0}} n
                        e$ = getelement$(ca$, i)
                        {{Text|IF|#F0F0F0}} e$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} B = B + {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} e$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} B = B - {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} e$ = {{Text|","|#FFB100}} {{Text|AND|#F0F0F0}} B = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} ele = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected SWAP ... , ..."|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                            ele = {{Text|2|#F580B1}}
                        {{Text|ELSE|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} ele = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} e1$ = e1$ + sp + e$ {{Text|ELSE|#F0F0F0}} e2$ = e2$ + sp + e$
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|NEXT|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} e2$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected SWAP ... , ..."|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    e1$ = {{Text|RIGHT$|#F0F0F0}}(e1$, {{Text|LEN|#F0F0F0}}(e1$) - {{Text|1|#F580B1}}): e2$ = {{Text|RIGHT$|#F0F0F0}}(e2$, {{Text|LEN|#F0F0F0}}(e2$) - {{Text|1|#F580B1}})
                    e1$ = fixoperationorder(e1$)
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    e1l$ = tlayout$
                    e2$ = fixoperationorder(e2$)
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    e2l$ = tlayout$
                    e1$ = evaluate(e1$, e1typ): e2$ = evaluate(e2$, e2typ)
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|IF|#F0F0F0}} (e1typ {{Text|AND|#F0F0F0}} ISREFERENCE) = {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} (e2typ {{Text|AND|#F0F0F0}} ISREFERENCE) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected variable"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    layoutdone = {{Text|1|#F580B1}}
                    l$ = SCase$({{Text|"Swap"|#FFB100}}) + sp + e1l$ + sp2 + {{Text|","|#FFB100}} + sp + e2l$
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} layout$ = l$ {{Text|ELSE|#F0F0F0}} layout$ = layout$ + sp + l$
                    {{Text|'swap strings?|#31C4C4}}
                    {{Text|IF|#F0F0F0}} (e1typ {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} (e2typ {{Text|AND|#F0F0F0}} ISSTRING) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Type mismatch"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                        e1$ = refer(e1$, e1typ, {{Text|0|#F580B1}}): e2$ = refer(e2$, e2typ, {{Text|0|#F580B1}})
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                        WriteBufLine MainTxtBuf, {{Text|"swap_string("|#FFB100}} + e1$ + {{Text|","|#FFB100}} + e2$ + {{Text|");"|#FFB100}}
                        {{Text|GOTO|#F0F0F0}} finishedline
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|'swap UDT?|#31C4C4}}
                    {{Text|'note: entire UDTs, unlike thier elements cannot be swapped like standard variables|#31C4C4}}
                    {{Text|'      as UDT sizes may vary, and to avoid a malloc operation, QB64 should allocate a buffer|#31C4C4}}
                    {{Text|'      in global.txt for the purpose of swapping each UDT type|#31C4C4}}
                    {{Text|IF|#F0F0F0}} e1typ {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}}
                        a$ = e1$
                        {{Text|'retrieve ID|#31C4C4}}
                        i = {{Text|INSTR|#F0F0F0}}(a$, sp3)
                        {{Text|IF|#F0F0F0}} i {{Text|THEN|#F0F0F0}}
                            idnumber = {{Text|VAL|#F0F0F0}}({{Text|LEFT$|#F0F0F0}}(a$, i - {{Text|1|#F580B1}})): a$ = {{Text|RIGHT$|#F0F0F0}}(a$, {{Text|LEN|#F0F0F0}}(a$) - i)
                            getid idnumber
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            u = {{Text|VAL|#F0F0F0}}(a$)
                            i = {{Text|INSTR|#F0F0F0}}(a$, sp3): a$ = {{Text|RIGHT$|#F0F0F0}}(a$, {{Text|LEN|#F0F0F0}}(a$) - i): E = {{Text|VAL|#F0F0F0}}(a$)
                            i = {{Text|INSTR|#F0F0F0}}(a$, sp3): o$ = {{Text|RIGHT$|#F0F0F0}}(a$, {{Text|LEN|#F0F0F0}}(a$) - i)
                            n$ = {{Text|"UDT_"|#FFB100}} + {{Text|RTRIM$|#F0F0F0}}(id.n): {{Text|IF|#F0F0F0}} id.t = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} n$ = {{Text|"ARRAY_"|#FFB100}} + n$ + {{Text|"[0]"|#FFB100}}
                            {{Text|IF|#F0F0F0}} E = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'not an element of UDT u|#31C4C4}}
                                lhsscope$ = scope$
                                e$ = e2$: t2 = e2typ
                                {{Text|IF|#F0F0F0}} (t2 {{Text|AND|#F0F0F0}} ISUDT) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected SWAP with similar user defined type"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                idnumber2 = {{Text|VAL|#F0F0F0}}(e$)
                                getid idnumber2
                                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                n2$ = {{Text|"UDT_"|#FFB100}} + {{Text|RTRIM$|#F0F0F0}}(id.n): {{Text|IF|#F0F0F0}} id.t = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} n2$ = {{Text|"ARRAY_"|#FFB100}} + n2$ + {{Text|"[0]"|#FFB100}}
                                i = {{Text|INSTR|#F0F0F0}}(e$, sp3): e$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - i): u2 = {{Text|VAL|#F0F0F0}}(e$)
                                i = {{Text|INSTR|#F0F0F0}}(e$, sp3): e$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - i): e2 = {{Text|VAL|#F0F0F0}}(e$)
                                i = {{Text|INSTR|#F0F0F0}}(e$, sp3): o2$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - i)
                                {{Text|'WARNING: u2 may need minor modifications based on e to see if they are the same|#31C4C4}}
                                {{Text|IF|#F0F0F0}} u <> u2 {{Text|OR|#F0F0F0}} e2 <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected SWAP with similar user defined type"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                dst$ = {{Text|"(((char*)"|#FFB100}} + lhsscope$ + n$ + {{Text|")+("|#FFB100}} + o$ + {{Text|"))"|#FFB100}}
                                src$ = {{Text|"(((char*)"|#FFB100}} + scope$ + n2$ + {{Text|")+("|#FFB100}} + o2$ + {{Text|"))"|#FFB100}}
                                B = udtxsize(u) \ {{Text|8|#F580B1}}
                                siz$ = str2$(B)
                                {{Text|IF|#F0F0F0}} B = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, {{Text|"swap_8("|#FFB100}} + src$ + {{Text|","|#FFB100}} + dst$ + {{Text|");"|#FFB100}}
                                {{Text|IF|#F0F0F0}} B = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, {{Text|"swap_16("|#FFB100}} + src$ + {{Text|","|#FFB100}} + dst$ + {{Text|");"|#FFB100}}
                                {{Text|IF|#F0F0F0}} B = {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, {{Text|"swap_32("|#FFB100}} + src$ + {{Text|","|#FFB100}} + dst$ + {{Text|");"|#FFB100}}
                                {{Text|IF|#F0F0F0}} B = {{Text|8|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, {{Text|"swap_64("|#FFB100}} + src$ + {{Text|","|#FFB100}} + dst$ + {{Text|");"|#FFB100}}
                                {{Text|IF|#F0F0F0}} B <> {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} B <> {{Text|2|#F580B1}} {{Text|AND|#F0F0F0}} B <> {{Text|4|#F580B1}} {{Text|AND|#F0F0F0}} B <> {{Text|8|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, {{Text|"swap_block("|#FFB100}} + src$ + {{Text|","|#FFB100}} + dst$ + {{Text|","|#FFB100}} + siz$ + {{Text|");"|#FFB100}}
                                {{Text|GOTO|#F0F0F0}} finishedline
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'e=0|#31C4C4}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'i|#31C4C4}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'isudt|#31C4C4}}
                    {{Text|'cull irrelavent flags to make comparison possible|#31C4C4}}
                    e1typc = e1typ
                    {{Text|IF|#F0F0F0}} e1typc {{Text|AND|#F0F0F0}} ISPOINTER {{Text|THEN|#F0F0F0}} e1typc = e1typc - ISPOINTER
                    {{Text|IF|#F0F0F0}} e1typc {{Text|AND|#F0F0F0}} ISINCONVENTIONALMEMORY {{Text|THEN|#F0F0F0}} e1typc = e1typc - ISINCONVENTIONALMEMORY
                    {{Text|IF|#F0F0F0}} e1typc {{Text|AND|#F0F0F0}} ISARRAY {{Text|THEN|#F0F0F0}} e1typc = e1typc - ISARRAY
                    {{Text|IF|#F0F0F0}} e1typc {{Text|AND|#F0F0F0}} ISUNSIGNED {{Text|THEN|#F0F0F0}} e1typc = e1typc - ISUNSIGNED
                    {{Text|IF|#F0F0F0}} e1typc {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}} e1typc = e1typc - ISUDT
                    e2typc = e2typ
                    {{Text|IF|#F0F0F0}} e2typc {{Text|AND|#F0F0F0}} ISPOINTER {{Text|THEN|#F0F0F0}} e2typc = e2typc - ISPOINTER
                    {{Text|IF|#F0F0F0}} e2typc {{Text|AND|#F0F0F0}} ISINCONVENTIONALMEMORY {{Text|THEN|#F0F0F0}} e2typc = e2typc - ISINCONVENTIONALMEMORY
                    {{Text|IF|#F0F0F0}} e2typc {{Text|AND|#F0F0F0}} ISARRAY {{Text|THEN|#F0F0F0}} e2typc = e2typc - ISARRAY
                    {{Text|IF|#F0F0F0}} e2typc {{Text|AND|#F0F0F0}} ISUNSIGNED {{Text|THEN|#F0F0F0}} e2typc = e2typc - ISUNSIGNED
                    {{Text|IF|#F0F0F0}} e2typc {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}} e2typc = e2typc - ISUDT
                    {{Text|IF|#F0F0F0}} e1typc <> e2typc {{Text|THEN|#F0F0F0}} a$ = {{Text|"Type mismatch"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    t = e1typ
                    {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISOFFSETINBITS {{Text|THEN|#F0F0F0}} a$ = {{Text|"Cannot SWAP bit-length variables"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                    B = t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
                    t$ = str2$(B): {{Text|IF|#F0F0F0}} B > {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}} t$ = {{Text|"longdouble"|#FFB100}}
                    WriteBufLine MainTxtBuf, {{Text|"swap_"|#FFB100}} + t$ + {{Text|"(&"|#FFB100}} + refer(e1$, e1typ, {{Text|0|#F580B1}}) + {{Text|",&"|#FFB100}} + refer(e2$, e2typ, {{Text|0|#F580B1}}) + {{Text|");"|#FFB100}}
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|GOTO|#F0F0F0}} finishedline
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"OPTION"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} optionexplicit = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|" or OPTION "|#FFB100}} + qb64prefix$ + {{Text|"EXPLICIT"|#FFB100}} {{Text|ELSE|#F0F0F0}} e$ = {{Text|""|#FFB100}}
                    {{Text|IF|#F0F0F0}} optionexplicitarray = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = e$ + {{Text|" or OPTION "|#FFB100}} + qb64prefix$ + {{Text|"EXPLICITARRAY"|#FFB100}}
                    {{Text|IF|#F0F0F0}} n = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected OPTION BASE"|#FFB100}} + e$: {{Text|GOTO|#F0F0F0}} errmes
                    e$ = getelement$(a$, {{Text|2|#F580B1}})
                    {{Text|SELECT|#F0F0F0}} {{Text|CASE|#F0F0F0}} e$
                        {{Text|CASE|#F0F0F0}} {{Text|"BASE"|#FFB100}}
                            l$ = getelement$(a$, {{Text|3|#F580B1}})
                            {{Text|IF|#F0F0F0}} l$ <> {{Text|"0"|#FFB100}} {{Text|AND|#F0F0F0}} l$ <> {{Text|"1"|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected OPTION BASE 0 or 1"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|IF|#F0F0F0}} l$ = {{Text|"1"|#FFB100}} {{Text|THEN|#F0F0F0}} optionbase = {{Text|1|#F580B1}} {{Text|ELSE|#F0F0F0}} optionbase = {{Text|0|#F580B1}}
                            l$ = SCase$({{Text|"Option"|#FFB100}} + sp + {{Text|"Base"|#FFB100}}) + sp + l$
                            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                            {{Text|GOTO|#F0F0F0}} finishedline
                        {{Text|CASE|#F0F0F0}} {{Text|"EXPLICIT"|#FFB100}}, {{Text|"_EXPLICIT"|#FFB100}}
                            {{Text|IF|#F0F0F0}} e$ = {{Text|"EXPLICIT"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix$ = {{Text|"_"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} optionexplicit = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|" or OPTION "|#FFB100}} + qb64prefix$ + {{Text|"EXPLICIT"|#FFB100}} {{Text|ELSE|#F0F0F0}} e$ = {{Text|""|#FFB100}}
                                {{Text|IF|#F0F0F0}} optionexplicitarray = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = e$ + {{Text|" or OPTION "|#FFB100}} + qb64prefix$ + {{Text|"EXPLICITARRAY"|#FFB100}}
                                a$ = {{Text|"Expected OPTION BASE"|#FFB100}} + e$: {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            opex_desiredState = {{Text|-1|#F580B1}}
                            {{Text|IF|#F0F0F0}} optionexplicit = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} opex_recompileAttempts = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    opex_recompileAttempts = opex_recompileAttempts + {{Text|1|#F580B1}}
                                    {{Text|GOTO|#F0F0F0}} do_recompile
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            l$ = SCase$({{Text|"Option"|#FFB100}}) + sp
                            {{Text|IF|#F0F0F0}} e$ = {{Text|"EXPLICIT"|#FFB100}} {{Text|THEN|#F0F0F0}} l$ = l$ + SCase$({{Text|"Explicit"|#FFB100}}) {{Text|ELSE|#F0F0F0}} l$ = l$ + SCase$({{Text|"_Explicit"|#FFB100}})
                            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                            {{Text|GOTO|#F0F0F0}} finishedline
                        {{Text|CASE|#F0F0F0}} {{Text|"EXPLICITARRAY"|#FFB100}}, {{Text|"_EXPLICITARRAY"|#FFB100}}
                            {{Text|IF|#F0F0F0}} e$ = {{Text|"EXPLICITARRAY"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix$ = {{Text|"_"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} optionexplicit = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|" or OPTION "|#FFB100}} + qb64prefix$ + {{Text|"EXPLICIT"|#FFB100}} {{Text|ELSE|#F0F0F0}} e$ = {{Text|""|#FFB100}}
                                {{Text|IF|#F0F0F0}} optionexplicitarray = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = e$ + {{Text|" or OPTION "|#FFB100}} + qb64prefix$ + {{Text|"EXPLICITARRAY"|#FFB100}}
                                a$ = {{Text|"Expected OPTION BASE"|#FFB100}} + e$: {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            opexarray_desiredState = {{Text|-1|#F580B1}}
                            {{Text|IF|#F0F0F0}} optionexplicitarray = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} opexarray_recompileAttempts = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    opexarray_recompileAttempts = opexarray_recompileAttempts + {{Text|1|#F580B1}}
                                    {{Text|GOTO|#F0F0F0}} do_recompile
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            l$ = SCase$({{Text|"Option"|#FFB100}}) + sp
                            {{Text|IF|#F0F0F0}} e$ = {{Text|"EXPLICITARRAY"|#FFB100}} {{Text|THEN|#F0F0F0}} l$ = l$ + SCase$({{Text|"ExplicitArray"|#FFB100}}) {{Text|ELSE|#F0F0F0}} l$ = l$ + SCase$({{Text|"_ExplicitArray"|#FFB100}})
                            layoutdone = {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
                            {{Text|GOTO|#F0F0F0}} finishedline
                        {{Text|CASE|#F0F0F0}} {{Text|ELSE|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} optionexplicit = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|" or OPTION "|#FFB100}} + qb64prefix$ + {{Text|"EXPLICIT"|#FFB100}} {{Text|ELSE|#F0F0F0}} e$ = {{Text|""|#FFB100}}
                            {{Text|IF|#F0F0F0}} optionexplicitarray = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = e$ + {{Text|" or OPTION "|#FFB100}} + qb64prefix$ + {{Text|"EXPLICITARRAY"|#FFB100}}
                            a$ = {{Text|"Expected OPTION BASE"|#FFB100}} + e$: {{Text|GOTO|#F0F0F0}} errmes
                    {{Text|END|#F0F0F0}} {{Text|SELECT|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'any other "unique" subs can be processed above|#31C4C4}}
                id2 = id
                targetid = currentid
                {{Text|IF|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(id2.callname) = {{Text|"sub_stub"|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Command not implemented"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} n > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} id2.args = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"SUB does not require any arguments"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                SetDependency id2.Dependency
                seperateargs_error = {{Text|0|#F580B1}}
                passedneeded = seperateargs(getelements(a$, {{Text|2|#F580B1}}, n), getelements(ca$, {{Text|2|#F580B1}}, n), passed&)
                {{Text|IF|#F0F0F0}} seperateargs_error {{Text|THEN|#F0F0F0}} a$ = seperateargs_error_message: {{Text|GOTO|#F0F0F0}} errmes
                {{Text|'backup args to local string array space before calling evaluate|#31C4C4}}
                {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} OptMax: separgs2(i) = {{Text|""|#FFB100}}: {{Text|NEXT|#F0F0F0}} {{Text|'save space!|#31C4C4}}
                {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} OptMax + {{Text|1|#F580B1}}: separgslayout2(i) = {{Text|""|#FFB100}}: {{Text|NEXT|#F0F0F0}}
                {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} id2.args: separgs2(i) = separgs(i): {{Text|NEXT|#F0F0F0}}
                {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} id2.args + {{Text|1|#F580B1}}: separgslayout2(i) = separgslayout(i): {{Text|NEXT|#F0F0F0}}
                {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}}
                    {{Text|PRINT|#F0F0F0}} #9, {{Text|"separgs:"|#FFB100}}: {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} id2.args: {{Text|PRINT|#F0F0F0}} #9, i, separgs2(i): {{Text|NEXT|#F0F0F0}}
                    {{Text|PRINT|#F0F0F0}} #9, {{Text|"separgslayout:"|#FFB100}}: {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} id2.args + {{Text|1|#F580B1}}: {{Text|PRINT|#F0F0F0}} #9, i, separgslayout2(i): {{Text|NEXT|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'note: seperateargs finds the arguments to pass and sets passed& as necessary|#31C4C4}}
                {{Text|'      FIXOPERTIONORDER is not called on these args yet|#31C4C4}}
                {{Text|'      what we need it to do is build a second array of layout info at the same time|#31C4C4}}
                {{Text|'  ref:DIM SHARED separgslayout(100) AS STRING|#31C4C4}}
                {{Text|'  the above array stores what layout info (if any) goes BEFORE the arg in question|#31C4C4}}
                {{Text|'      it has one extra index which is the arg after|#31C4C4}}
                {{Text|IF|#F0F0F0}} usecall {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} id.internal_subfunc {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} usecall = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} l$ = SCase$({{Text|"Call"|#FFB100}}) + sp + SCase$({{Text|RTRIM$|#F0F0F0}}(id.cn)) + {{Text|RTRIM$|#F0F0F0}}(id.musthave) + sp2 + {{Text|"("|#FFB100}} + sp2
                        {{Text|IF|#F0F0F0}} usecall = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} l$ = SCase$({{Text|"Call"|#FFB100}}) + sp + SCase$({{Text|RTRIM$|#F0F0F0}}(id.cn)) + {{Text|RTRIM$|#F0F0F0}}(id.musthave) + sp {{Text|'sp at end for easy parsing|#31C4C4}}
                    {{Text|ELSE|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} usecall = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} l$ = SCase$({{Text|"Call"|#FFB100}}) + sp + {{Text|RTRIM$|#F0F0F0}}(id.cn) + {{Text|RTRIM$|#F0F0F0}}(id.musthave) + sp2 + {{Text|"("|#FFB100}} + sp2
                        {{Text|IF|#F0F0F0}} usecall = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} l$ = SCase$({{Text|"Call"|#FFB100}}) + sp + {{Text|RTRIM$|#F0F0F0}}(id.cn) + {{Text|RTRIM$|#F0F0F0}}(id.musthave) + sp {{Text|'sp at end for easy parsing|#31C4C4}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|ELSE|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} id.internal_subfunc {{Text|THEN|#F0F0F0}}
                        l$ = SCase$({{Text|RTRIM$|#F0F0F0}}(id.cn)) + {{Text|RTRIM$|#F0F0F0}}(id.musthave) + sp
                    {{Text|ELSE|#F0F0F0}}
                        l$ = {{Text|RTRIM$|#F0F0F0}}(id.cn) + {{Text|RTRIM$|#F0F0F0}}(id.musthave) + sp
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                subcall$ = {{Text|RTRIM$|#F0F0F0}}(id.callname) + {{Text|"("|#FFB100}}
                addedlayout = {{Text|0|#F580B1}}
                fieldcall = {{Text|0|#F580B1}}
                {{Text|'GET/PUT field exception|#31C4C4}}
                {{Text|IF|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(id2.callname) = {{Text|"sub_get"|#FFB100}} {{Text|OR|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(id2.callname) = {{Text|"sub_put"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} passed {{Text|AND|#F0F0F0}} {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|'regular GET/PUT call with variable provided|#31C4C4}}
                        passed = passed - {{Text|2|#F580B1}} {{Text|'for complience with existing methods, remove 'passed' flag for the passing of a variable|#31C4C4}}
                    {{Text|ELSE|#F0F0F0}}
                        {{Text|'FIELD GET/PUT call with variable omited|#31C4C4}}
                        {{Text|IF|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(id2.callname) = {{Text|"sub_get"|#FFB100}} {{Text|THEN|#F0F0F0}}
                            fieldcall = {{Text|1|#F580B1}}
                            subcall$ = {{Text|"field_get("|#FFB100}}
                        {{Text|ELSE|#F0F0F0}}
                            fieldcall = {{Text|2|#F580B1}}
                            subcall$ = {{Text|"field_put("|#FFB100}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'field exception|#31C4C4}}
                {{Text|IF|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(id2.callname) = {{Text|"sub_timer"|#FFB100}} {{Text|OR|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(id2.callname) = {{Text|"sub_key"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|'spacing exception|#31C4C4}}
                    {{Text|IF|#F0F0F0}} usecall = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        l$ = {{Text|LEFT$|#F0F0F0}}(l$, {{Text|LEN|#F0F0F0}}(l$) - {{Text|1|#F580B1}}) + sp2
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} id2.args
                    targettyp = {{Text|CVL|#F0F0F0}}({{Text|MID$|#F0F0F0}}(id2.arg, {{Text|-3|#F580B1}} + i * {{Text|4|#F580B1}}, {{Text|4|#F580B1}}))
                    nele = {{Text|ASC|#F0F0F0}}({{Text|MID$|#F0F0F0}}(id2.nele, i, {{Text|1|#F580B1}}))
                    nelereq = {{Text|ASC|#F0F0F0}}({{Text|MID$|#F0F0F0}}(id2.nelereq, i, {{Text|1|#F580B1}}))
                    addlayout = {{Text|1|#F580B1}} {{Text|'omits option values in layout (eg. BINARY="2")|#31C4C4}}
                    convertspacing = {{Text|0|#F580B1}} {{Text|'if an 'equation' is next, it will be preceeded by a space|#31C4C4}}
                    x$ = separgslayout2$(i)
                    {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} {{Text|LEN|#F0F0F0}}(x$)
                        x = {{Text|ASC|#F0F0F0}}(x$)
                        {{Text|IF|#F0F0F0}} x {{Text|THEN|#F0F0F0}}
                            convertspacing = {{Text|0|#F580B1}}
                            x2$ = {{Text|MID$|#F0F0F0}}(x$, {{Text|2|#F580B1}}, x)
                            x$ = {{Text|RIGHT$|#F0F0F0}}(x$, {{Text|LEN|#F0F0F0}}(x$) - x - {{Text|1|#F580B1}})
                            s = {{Text|0|#F580B1}}
                            an = {{Text|0|#F580B1}}
                            x3$ = {{Text|RIGHT$|#F0F0F0}}(l$, {{Text|1|#F580B1}})
                            {{Text|IF|#F0F0F0}} x3$ = sp {{Text|THEN|#F0F0F0}} s = {{Text|1|#F580B1}}
                            {{Text|IF|#F0F0F0}} x3$ = sp2 {{Text|THEN|#F0F0F0}}
                                s = {{Text|2|#F580B1}}
                                {{Text|IF|#F0F0F0}} alphanumeric({{Text|ASC|#F0F0F0}}({{Text|RIGHT$|#F0F0F0}}(l$, {{Text|2|#F580B1}}))) {{Text|THEN|#F0F0F0}} an = {{Text|1|#F580B1}}
                            {{Text|ELSE|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} alphanumeric({{Text|ASC|#F0F0F0}}(x3$)) {{Text|THEN|#F0F0F0}} an = {{Text|1|#F580B1}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            s1 = s
                            {{Text|IF|#F0F0F0}} alphanumeric({{Text|ASC|#F0F0F0}}(x2$)) {{Text|THEN|#F0F0F0}} convertspacing = {{Text|1|#F580B1}}
                            {{Text|IF|#F0F0F0}} x2$ = {{Text|"LPRINT"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                {{Text|'x2$="LPRINT"|#31C4C4}}
                                {{Text|'x$=CHR$(0)|#31C4C4}}
                                {{Text|'x3$=[sp] from WIDTH[sp]|#31C4C4}}
                                {{Text|'therefore...|#31C4C4}}
                                {{Text|'s=1|#31C4C4}}
                                {{Text|'an=0|#31C4C4}}
                                {{Text|'convertspacing=1|#31C4C4}}
                                {{Text|'if debug=1 then|#31C4C4}}
                                {{Text|'print #9,"LPRINT:"|#31C4C4}}
                                {{Text|'print #9,s|#31C4C4}}
                                {{Text|'print #9,an|#31C4C4}}
                                {{Text|'print #9,l$|#31C4C4}}
                                {{Text|'print #9,x2$|#31C4C4}}
                                {{Text|'end if|#31C4C4}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} (an = {{Text|1|#F580B1}} {{Text|OR|#F0F0F0}} addedlayout = {{Text|1|#F580B1}}) {{Text|AND|#F0F0F0}} alphanumeric({{Text|ASC|#F0F0F0}}(x2$)) <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                s = {{Text|1|#F580B1}} {{Text|'force space|#31C4C4}}
                                x2$ = x2$ + sp2
                                {{Text|GOTO|#F0F0F0}} customlaychar
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} x2$ = {{Text|"="|#FFB100}} {{Text|THEN|#F0F0F0}}
                                s = {{Text|1|#F580B1}}
                                x2$ = x2$ + sp
                                {{Text|GOTO|#F0F0F0}} customlaychar
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} x2$ = {{Text|"#"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                s = {{Text|1|#F580B1}}
                                x2$ = x2$ + sp2
                                {{Text|GOTO|#F0F0F0}} customlaychar
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} x2$ = {{Text|","|#FFB100}} {{Text|THEN|#F0F0F0}} x2$ = x2$ + sp: {{Text|GOTO|#F0F0F0}} customlaychar
                            {{Text|IF|#F0F0F0}} x$ = {{Text|CHR$|#F0F0F0}}({{Text|0|#F580B1}}) {{Text|THEN|#F0F0F0}} {{Text|'substitution|#31C4C4}}
                                {{Text|IF|#F0F0F0}} x2$ = {{Text|"STEP"|#FFB100}} {{Text|THEN|#F0F0F0}} x2$ = x2$ + sp2: {{Text|GOTO|#F0F0F0}} customlaychar
                                x2$ = x2$ + sp: {{Text|GOTO|#F0F0F0}} customlaychar
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|'default solution sp2+?+sp2|#31C4C4}}
                            x2$ = x2$ + sp2
                            customlaychar:
                            {{Text|IF|#F0F0F0}} s = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} s = {{Text|2|#F580B1}}
                            {{Text|IF|#F0F0F0}} s <> s1 {{Text|THEN|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} s1 {{Text|THEN|#F0F0F0}} l$ = {{Text|LEFT$|#F0F0F0}}(l$, {{Text|LEN|#F0F0F0}}(l$) - {{Text|1|#F580B1}})
                                {{Text|IF|#F0F0F0}} s = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} l$ = l$ + sp
                                {{Text|IF|#F0F0F0}} s = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} l$ = l$ + sp2
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} ({{Text|RTRIM$|#F0F0F0}}(id2.callname) = {{Text|"sub_timer"|#FFB100}} {{Text|OR|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(id2.callname) = {{Text|"sub_key"|#FFB100}}) {{Text|AND|#F0F0F0}} i = id2.args {{Text|THEN|#F0F0F0}} {{Text|'spacing exception|#31C4C4}}
                                {{Text|IF|#F0F0F0}} x2$ <> {{Text|")"|#FFB100}} + sp2 {{Text|THEN|#F0F0F0}}
                                    l$ = {{Text|LEFT$|#F0F0F0}}(l$, {{Text|LEN|#F0F0F0}}(l$) - {{Text|1|#F580B1}}) + sp
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            l$ = l$ + x2$
                        {{Text|ELSE|#F0F0F0}}
                            addlayout = {{Text|0|#F580B1}}
                            x$ = {{Text|RIGHT$|#F0F0F0}}(x$, {{Text|LEN|#F0F0F0}}(x$) - {{Text|1|#F580B1}})
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        addedlayout = {{Text|0|#F580B1}}
                    {{Text|LOOP|#F0F0F0}}
                    {{Text|'---better sub syntax checking begins here---|#31C4C4}}
                    {{Text|IF|#F0F0F0}} targettyp = {{Text|-3|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} separgs2(i) = {{Text|"N-LL"|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected array name"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                        {{Text|'names of numeric arrays have ( ) automatically appended (nothing else)|#31C4C4}}
                        e$ = separgs2(i)
                        {{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(e$, sp) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'one element only|#31C4C4}}
                            try_string$ = e$
                            try = findid(try_string$)
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|DO|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} try {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} id.arraytype {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} (id.arraytype {{Text|AND|#F0F0F0}} ISSTRING) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                            e$ = e$ + sp + {{Text|"("|#FFB100}} + sp + {{Text|")"|#FFB100}}
                                            {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|'---|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(try_string$) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
                                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'if try|#31C4C4}}
                                {{Text|IF|#F0F0F0}} try = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'add symbol?|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(removesymbol$(try_string$)) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                        a = {{Text|ASC|#F0F0F0}}(try_string$)
                                        {{Text|IF|#F0F0F0}} a >= {{Text|97|#F580B1}} {{Text|AND|#F0F0F0}} a <= {{Text|122|#F580B1}} {{Text|THEN|#F0F0F0}} a = a - {{Text|32|#F580B1}}
                                        {{Text|IF|#F0F0F0}} a = {{Text|95|#F580B1}} {{Text|THEN|#F0F0F0}} a = {{Text|91|#F580B1}}
                                        a = a - {{Text|64|#F580B1}}
                                        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(defineextaz(a)) {{Text|THEN|#F0F0F0}} try_string$ = try_string$ + defineextaz(a): try = findid(try_string$)
                                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'try=0|#31C4C4}}
                            {{Text|LOOP|#F0F0F0}} {{Text|UNTIL|#F0F0F0}} try = {{Text|0|#F580B1}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'one element only|#31C4C4}}
                        e$ = fixoperationorder$(e$)
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                        {{Text|IF|#F0F0F0}} convertspacing = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} addlayout = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} l$ = {{Text|LEFT$|#F0F0F0}}(l$, {{Text|LEN|#F0F0F0}}(l$) - {{Text|1|#F580B1}}) + sp
                        {{Text|IF|#F0F0F0}} addlayout {{Text|THEN|#F0F0F0}} l$ = l$ + tlayout$: addedlayout = {{Text|1|#F580B1}}
                        e$ = evaluatetotyp(e$, {{Text|-2|#F580B1}})
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                        {{Text|GOTO|#F0F0F0}} sete
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'-3|#31C4C4}}
                    {{Text|IF|#F0F0F0}} targettyp = {{Text|-2|#F580B1}} {{Text|THEN|#F0F0F0}}
                        e$ = fixoperationorder$(e$)
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                        {{Text|IF|#F0F0F0}} convertspacing = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} addlayout = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} l$ = {{Text|LEFT$|#F0F0F0}}(l$, {{Text|LEN|#F0F0F0}}(l$) - {{Text|1|#F580B1}}) + sp
                        {{Text|IF|#F0F0F0}} addlayout {{Text|THEN|#F0F0F0}} l$ = l$ + tlayout$: addedlayout = {{Text|1|#F580B1}}
                        e$ = evaluatetotyp(e$, {{Text|-2|#F580B1}})
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                        {{Text|GOTO|#F0F0F0}} sete
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'-2|#31C4C4}}
                    {{Text|IF|#F0F0F0}} targettyp = {{Text|-4|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} fieldcall {{Text|THEN|#F0F0F0}}
                            i = id2.args + {{Text|1|#F580B1}}
                            {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} separgs2(i) = {{Text|"N-LL"|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected variable name/array element"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                        e$ = fixoperationorder$(separgs2(i))
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                        {{Text|IF|#F0F0F0}} convertspacing = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} addlayout = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} l$ = {{Text|LEFT$|#F0F0F0}}(l$, {{Text|LEN|#F0F0F0}}(l$) - {{Text|1|#F580B1}}) + sp
                        {{Text|IF|#F0F0F0}} addlayout {{Text|THEN|#F0F0F0}} l$ = l$ + tlayout$: addedlayout = {{Text|1|#F580B1}}
                        {{Text|'GET/PUT RANDOM-ACCESS override|#31C4C4}}
                        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"GET"|#FFB100}} {{Text|OR|#F0F0F0}} firstelement$ = {{Text|"PUT"|#FFB100}} {{Text|THEN|#F0F0F0}}
                            e2$ = e$ {{Text|'backup|#31C4C4}}
                            e$ = evaluate(e$, sourcetyp)
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|'replace name of sub to call|#31C4C4}}
                                    subcall$ = {{Text|RIGHT$|#F0F0F0}}(subcall$, {{Text|LEN|#F0F0F0}}(subcall$) - {{Text|7|#F580B1}}) {{Text|'delete original name|#31C4C4}}
                                    {{Text|'note: GET2 & PUT2 take differing input, following code is correct|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"GET"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                        subcall$ = {{Text|"sub_get2"|#FFB100}} + subcall$
                                        e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}}) {{Text|'pass a qbs pointer instead|#31C4C4}}
                                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                        {{Text|GOTO|#F0F0F0}} sete
                                    {{Text|ELSE|#F0F0F0}}
                                        subcall$ = {{Text|"sub_put2"|#FFB100}} + subcall$
                                        {{Text|'no goto sete required, fall through|#31C4C4}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            e$ = e2$ {{Text|'restore|#31C4C4}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'override|#31C4C4}}
                        e$ = evaluatetotyp(e$, {{Text|-4|#F580B1}})
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                        {{Text|GOTO|#F0F0F0}} sete
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'-4|#31C4C4}}
                    {{Text|IF|#F0F0F0}} separgs2(i) = {{Text|"N-LL"|#FFB100}} {{Text|THEN|#F0F0F0}}
                        e$ = {{Text|"NULL"|#FFB100}}
                    {{Text|ELSE|#F0F0F0}}
                        e2$ = fixoperationorder$(separgs2(i))
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                        {{Text|IF|#F0F0F0}} convertspacing = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} addlayout = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} l$ = {{Text|LEFT$|#F0F0F0}}(l$, {{Text|LEN|#F0F0F0}}(l$) - {{Text|1|#F580B1}}) + sp
                        {{Text|IF|#F0F0F0}} addlayout {{Text|THEN|#F0F0F0}} l$ = l$ + tlayout$: addedlayout = {{Text|1|#F580B1}}
                        e$ = evaluate(e2$, sourcetyp)
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                        {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISOFFSET {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} ISOFFSET) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} id2.internal_subfunc = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Cannot convert _OFFSET type to other types"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(id2.callname) = {{Text|"sub_paint"|#FFB100}} {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} i = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}}
                                    targettyp = ISSTRING
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(separgs2(i), {{Text|2|#F580B1}}) = {{Text|"("|#FFB100}} + sp {{Text|THEN|#F0F0F0}} dereference = {{Text|1|#F580B1}} {{Text|ELSE|#F0F0F0}} dereference = {{Text|0|#F580B1}}
                        {{Text|'pass by reference|#31C4C4}}
                        {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} ISPOINTER) {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} dereference = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'check deferencing wasn't used|#31C4C4}}
                                {{Text|'note: array pointer|#31C4C4}}
                                {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} ISARRAY) {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected arrayname()"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISARRAY) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected arrayname()"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                    {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"sub:array reference:["|#FFB100}} + e$ + {{Text|"]"|#FFB100}}
                                    {{Text|'check arrays are of same type|#31C4C4}}
                                    targettyp2 = targettyp: sourcetyp2 = sourcetyp
                                    targettyp2 = targettyp2 {{Text|AND|#F0F0F0}} ({{Text|511|#F580B1}} + ISOFFSETINBITS + ISUDT + ISSTRING + ISFIXEDLENGTH + ISFLOAT)
                                    sourcetyp2 = sourcetyp2 {{Text|AND|#F0F0F0}} ({{Text|511|#F580B1}} + ISOFFSETINBITS + ISUDT + ISSTRING + ISFIXEDLENGTH + ISFLOAT)
                                    {{Text|IF|#F0F0F0}} sourcetyp2 <> targettyp2 {{Text|THEN|#F0F0F0}} a$ = {{Text|"Incorrect array type passed to sub"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                    {{Text|'check arrayname was followed by '()'|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} targettyp {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"sub:array reference:udt reference:["|#FFB100}} + e$ + {{Text|"]"|#FFB100}}
                                        {{Text|'get UDT info|#31C4C4}}
                                        udtrefid = {{Text|VAL|#F0F0F0}}(e$)
                                        getid udtrefid
                                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                        udtrefi = {{Text|INSTR|#F0F0F0}}(e$, sp3) {{Text|'end of id|#31C4C4}}
                                        udtrefi2 = {{Text|INSTR|#F0F0F0}}(udtrefi + {{Text|1|#F580B1}}, e$, sp3) {{Text|'end of u|#31C4C4}}
                                        udtrefu = {{Text|VAL|#F0F0F0}}({{Text|MID$|#F0F0F0}}(e$, udtrefi + {{Text|1|#F580B1}}, udtrefi2 - udtrefi - {{Text|1|#F580B1}}))
                                        udtrefi3 = {{Text|INSTR|#F0F0F0}}(udtrefi2 + {{Text|1|#F580B1}}, e$, sp3) {{Text|'skip e|#31C4C4}}
                                        udtrefe = {{Text|VAL|#F0F0F0}}({{Text|MID$|#F0F0F0}}(e$, udtrefi2 + {{Text|1|#F580B1}}, udtrefi3 - udtrefi2 - {{Text|1|#F580B1}}))
                                        o$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - udtrefi3)
                                        {{Text|'note: most of the UDT info above is not required|#31C4C4}}
                                        {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(o$, {{Text|4|#F580B1}}) <> {{Text|"(0)*"|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected arrayname()"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                    {{Text|ELSE|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|2|#F580B1}}) <> sp3 + {{Text|"0"|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected arrayname()"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    idnum = {{Text|VAL|#F0F0F0}}({{Text|LEFT$|#F0F0F0}}(e$, {{Text|INSTR|#F0F0F0}}(e$, sp3) - {{Text|1|#F580B1}}))
                                    getid idnum
                                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                    {{Text|IF|#F0F0F0}} targettyp {{Text|AND|#F0F0F0}} ISFIXEDLENGTH {{Text|THEN|#F0F0F0}}
                                        targettypsize = {{Text|CVL|#F0F0F0}}({{Text|MID$|#F0F0F0}}(id2.argsize, i * {{Text|4|#F580B1}} - {{Text|4|#F580B1}} + {{Text|1|#F580B1}}, {{Text|4|#F580B1}}))
                                        {{Text|IF|#F0F0F0}} id.tsize <> targettypsize {{Text|THEN|#F0F0F0}} a$ = {{Text|"Incorrect array type passed to sub"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|MID$|#F0F0F0}}(sfcmemargs(targetid), i, {{Text|1|#F580B1}}) = {{Text|CHR$|#F0F0F0}}({{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} {{Text|'cmem required?|#31C4C4}}
                                        {{Text|IF|#F0F0F0}} cmemlist(idnum) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                            cmemlist(idnum) = {{Text|1|#F580B1}}
                                            recompile = {{Text|1|#F580B1}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} id.linkid = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        {{Text|'if id.linkid is 0, it means the number of array elements is definietly|#31C4C4}}
                                        {{Text|'known of the array being passed, this is not some "fake"/unknown array.|#31C4C4}}
                                        {{Text|'using the numer of array elements of a fake array would be dangerous!|#31C4C4}}
                                        {{Text|IF|#F0F0F0}} nelereq = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                            {{Text|'only continue if the number of array elements required is unknown|#31C4C4}}
                                            {{Text|'and it needs to be set|#31C4C4}}
                                            {{Text|IF|#F0F0F0}} id.arrayelements > {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'2009|#31C4C4}}
                                                nelereq = id.arrayelements
                                                {{Text|MID$|#F0F0F0}}(id2.nelereq, i, {{Text|1|#F580B1}}) = {{Text|CHR$|#F0F0F0}}(nelereq)
                                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                            {{Text|'print rtrim$(id2.n)+">nelereq=";nelereq|#31C4C4}}
                                            ids(targetid) = id2
                                        {{Text|ELSE|#F0F0F0}}
                                            {{Text|'the number of array elements required is known AND|#31C4C4}}
                                            {{Text|'the number of elements in the array to be passed is known|#31C4C4}}
                                            {{Text|IF|#F0F0F0}} id.arrayelements <> nelereq {{Text|THEN|#F0F0F0}} a$ = {{Text|"Passing arrays with a differing number of elements to a SUB/FUNCTION is not supported"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    e$ = refer(e$, sourcetyp, {{Text|1|#F580B1}})
                                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                    {{Text|GOTO|#F0F0F0}} sete
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'target is an array|#31C4C4}}
                                {{Text|'note: not an array...|#31C4C4}}
                                {{Text|'target is not an array|#31C4C4}}
                                {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} ISSTRING) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}}
                                        idnum = {{Text|VAL|#F0F0F0}}({{Text|LEFT$|#F0F0F0}}(e$, {{Text|INSTR|#F0F0F0}}(e$, sp3) - {{Text|1|#F580B1}})) {{Text|'id# of sourcetyp|#31C4C4}}
                                        targettyp2 = targettyp: sourcetyp2 = sourcetyp
                                        {{Text|'get info about source/target|#31C4C4}}
                                        arr = {{Text|0|#F580B1}}: {{Text|IF|#F0F0F0}} (sourcetyp2 {{Text|AND|#F0F0F0}} ISARRAY) {{Text|THEN|#F0F0F0}} arr = {{Text|1|#F580B1}}
                                        passudtelement = {{Text|0|#F580B1}}: {{Text|IF|#F0F0F0}} (targettyp2 {{Text|AND|#F0F0F0}} ISUDT) = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} (sourcetyp2 {{Text|AND|#F0F0F0}} ISUDT) <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} passudtelement = {{Text|1|#F580B1}}: sourcetyp2 = sourcetyp2 - ISUDT
                                        {{Text|'remove flags irrelevant for comparison... ISPOINTER,ISREFERENCE,ISINCONVENTIONALMEMORY,ISARRAY|#31C4C4}}
                                        targettyp2 = targettyp2 {{Text|AND|#F0F0F0}} ({{Text|511|#F580B1}} + ISOFFSETINBITS + ISUDT + ISFLOAT + ISSTRING)
                                        sourcetyp2 = sourcetyp2 {{Text|AND|#F0F0F0}} ({{Text|511|#F580B1}} + ISOFFSETINBITS + ISUDT + ISFLOAT + ISSTRING)
                                        {{Text|'compare types|#31C4C4}}
                                        {{Text|IF|#F0F0F0}} sourcetyp2 = targettyp2 {{Text|THEN|#F0F0F0}}
                                            {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}}
                                                {{Text|'udt/udt array|#31C4C4}}
                                                {{Text|'get info|#31C4C4}}
                                                udtrefid = {{Text|VAL|#F0F0F0}}(e$)
                                                getid udtrefid
                                                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                                udtrefi = {{Text|INSTR|#F0F0F0}}(e$, sp3) {{Text|'end of id|#31C4C4}}
                                                udtrefi2 = {{Text|INSTR|#F0F0F0}}(udtrefi + {{Text|1|#F580B1}}, e$, sp3) {{Text|'end of u|#31C4C4}}
                                                udtrefu = {{Text|VAL|#F0F0F0}}({{Text|MID$|#F0F0F0}}(e$, udtrefi + {{Text|1|#F580B1}}, udtrefi2 - udtrefi - {{Text|1|#F580B1}}))
                                                udtrefi3 = {{Text|INSTR|#F0F0F0}}(udtrefi2 + {{Text|1|#F580B1}}, e$, sp3) {{Text|'skip e|#31C4C4}}
                                                udtrefe = {{Text|VAL|#F0F0F0}}({{Text|MID$|#F0F0F0}}(e$, udtrefi2 + {{Text|1|#F580B1}}, udtrefi3 - udtrefi2 - {{Text|1|#F580B1}}))
                                                o$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - udtrefi3)
                                                {{Text|'note: most of the UDT info above is not required|#31C4C4}}
                                                {{Text|IF|#F0F0F0}} arr {{Text|THEN|#F0F0F0}}
                                                    n$ = scope$ + {{Text|"ARRAY_UDT_"|#FFB100}} + {{Text|RTRIM$|#F0F0F0}}(id.n) + {{Text|"[0]"|#FFB100}}
                                                {{Text|ELSE|#F0F0F0}}
                                                    n$ = scope$ + {{Text|"UDT_"|#FFB100}} + {{Text|RTRIM$|#F0F0F0}}(id.n)
                                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                                e$ = {{Text|"(void*)( ((char*)("|#FFB100}} + n$ + {{Text|")) + ("|#FFB100}} + o$ + {{Text|") )"|#FFB100}}
                                                {{Text|'convert void* to target type*|#31C4C4}}
                                                {{Text|IF|#F0F0F0}} passudtelement {{Text|THEN|#F0F0F0}} e$ = {{Text|"("|#FFB100}} + typ2ctyp$(targettyp2 + (targettyp {{Text|AND|#F0F0F0}} ISUNSIGNED), {{Text|""|#FFB100}}) + {{Text|"*)"|#FFB100}} + e$
                                                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                            {{Text|ELSE|#F0F0F0}}
                                                {{Text|'not a udt|#31C4C4}}
                                                {{Text|IF|#F0F0F0}} arr {{Text|THEN|#F0F0F0}}
                                                    {{Text|IF|#F0F0F0}} (sourcetyp2 {{Text|AND|#F0F0F0}} ISOFFSETINBITS) {{Text|THEN|#F0F0F0}} a$ = {{Text|"Cannot pass BIT array offsets"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                                    e$ = {{Text|"(&("|#FFB100}} + refer(e$, sourcetyp, {{Text|0|#F580B1}}) + {{Text|"))"|#FFB100}}
                                                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                                {{Text|ELSE|#F0F0F0}}
                                                    e$ = refer(e$, sourcetyp, {{Text|1|#F580B1}})
                                                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                                {{Text|'note: signed/unsigned mismatch requires casting|#31C4C4}}
                                                {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISUNSIGNED) <> (targettyp {{Text|AND|#F0F0F0}} ISUNSIGNED) {{Text|THEN|#F0F0F0}}
                                                    e$ = {{Text|"("|#FFB100}} + typ2ctyp$(targettyp2 + (targettyp {{Text|AND|#F0F0F0}} ISUNSIGNED), {{Text|""|#FFB100}}) + {{Text|"*)"|#FFB100}} + e$
                                                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'udt?|#31C4C4}}
                                            {{Text|IF|#F0F0F0}} {{Text|MID$|#F0F0F0}}(sfcmemargs(targetid), i, {{Text|1|#F580B1}}) = {{Text|CHR$|#F0F0F0}}({{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} {{Text|'cmem required?|#31C4C4}}
                                                {{Text|IF|#F0F0F0}} cmemlist(idnum) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                                    cmemlist(idnum) = {{Text|1|#F580B1}}
                                                    recompile = {{Text|1|#F580B1}}
                                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                            {{Text|GOTO|#F0F0F0}} sete
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'similar|#31C4C4}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'reference|#31C4C4}}
                                {{Text|ELSE|#F0F0F0}} {{Text|'not a string|#31C4C4}}
                                    {{Text|'its a string|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}}
                                        idnum = {{Text|VAL|#F0F0F0}}({{Text|LEFT$|#F0F0F0}}(e$, {{Text|INSTR|#F0F0F0}}(e$, sp3) - {{Text|1|#F580B1}})) {{Text|'id# of sourcetyp|#31C4C4}}
                                        {{Text|IF|#F0F0F0}} {{Text|MID$|#F0F0F0}}(sfcmemargs(targetid), i, {{Text|1|#F580B1}}) = {{Text|CHR$|#F0F0F0}}({{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} {{Text|'cmem required?|#31C4C4}}
                                            {{Text|IF|#F0F0F0}} cmemlist(idnum) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                                cmemlist(idnum) = {{Text|1|#F580B1}}
                                                recompile = {{Text|1|#F580B1}}
                                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'reference|#31C4C4}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'its a string|#31C4C4}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'dereference check|#31C4C4}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'target is a pointer|#31C4C4}}
                        {{Text|'note: Target is not a pointer...|#31C4C4}}
                        {{Text|'String-numeric mismatch?|#31C4C4}}
                        {{Text|IF|#F0F0F0}} targettyp {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                nth = i
                                {{Text|IF|#F0F0F0}} ids(targetid).args = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"String required for sub"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                a$ = str_nth$(nth) + {{Text|" sub argument requires a string"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} ISSTRING) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
                                nth = i
                                {{Text|IF|#F0F0F0}} ids(targetid).args = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Number required for sub"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                a$ = str_nth$(nth) + {{Text|" sub argument requires a number"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|'change to "non-pointer" value|#31C4C4}}
                        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}}
                            e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} explicitreference = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} targettyp {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}}
                                nth = i
                                {{Text|IF|#F0F0F0}} qb64prefix_set {{Text|AND|#F0F0F0}} udtxcname(targettyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) = {{Text|"_MEM"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                    x$ = {{Text|"'"|#FFB100}} + {{Text|MID$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(udtxcname(targettyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}})), {{Text|2|#F580B1}}) + {{Text|"'"|#FFB100}}
                                {{Text|ELSE|#F0F0F0}}
                                    x$ = {{Text|"'"|#FFB100}} + {{Text|RTRIM$|#F0F0F0}}(udtxcname(targettyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}})) + {{Text|"'"|#FFB100}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} ids(targetid).args = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"TYPE "|#FFB100}} + x$ + {{Text|" required for sub"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                                a$ = str_nth$(nth) + {{Text|" sub argument requires TYPE "|#FFB100}} + x$: {{Text|GOTO|#F0F0F0}} errmes
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|ELSE|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}} a$ = {{Text|"Number required for sub"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|'round to integer if required|#31C4C4}}
                        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISFLOAT) {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} ISFLOAT) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                {{Text|'**32 rounding fix|#31C4C4}}
                                bits = targettyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
                                {{Text|IF|#F0F0F0}} bits <= {{Text|16|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"qbr_float_to_long("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                                {{Text|IF|#F0F0F0}} bits > {{Text|16|#F580B1}} {{Text|AND|#F0F0F0}} bits < {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"qbr_double_to_long("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                                {{Text|IF|#F0F0F0}} bits >= {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"qbr("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} ISPOINTER) {{Text|THEN|#F0F0F0}} {{Text|'pointer required|#31C4C4}}
                            {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} sete {{Text|'no changes required|#31C4C4}}
                            t$ = typ2ctyp$(targettyp, {{Text|""|#FFB100}})
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                            v$ = {{Text|"pass"|#FFB100}} + str2$(uniquenumber)
                            {{Text|'assume numeric type|#31C4C4}}
                            {{Text|IF|#F0F0F0}} {{Text|MID$|#F0F0F0}}(sfcmemargs(targetid), i, {{Text|1|#F580B1}}) = {{Text|CHR$|#F0F0F0}}({{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} {{Text|'cmem required?|#31C4C4}}
                                bytesreq = ((targettyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) + {{Text|7|#F580B1}}) \ {{Text|8|#F580B1}}
                                WriteBufLine defdatahandle, t$ + {{Text|" *"|#FFB100}} + v$ + {{Text|"=NULL;"|#FFB100}}
                                WriteBufLine DataTxtBuf, {{Text|"if("|#FFB100}} + v$ + {{Text|"==NULL){"|#FFB100}}
                                WriteBufLine DataTxtBuf, {{Text|"cmem_sp-="|#FFB100}} + str2(bytesreq) + {{Text|";"|#FFB100}}
                                WriteBufLine DataTxtBuf, v$ + {{Text|"=("|#FFB100}} + t$ + {{Text|"*)(dblock+cmem_sp);"|#FFB100}}
                                WriteBufLine DataTxtBuf, {{Text|"if (cmem_sp<qbs_cmem_sp) error(257);"|#FFB100}}
                                WriteBufLine DataTxtBuf, {{Text|"}"|#FFB100}}
                                e$ = {{Text|"&(*"|#FFB100}} + v$ + {{Text|"="|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                            {{Text|ELSE|#F0F0F0}}
                                WriteBufLine DataTxtBuf, t$ + {{Text|" "|#FFB100}} + v$ + {{Text|";"|#FFB100}}
                                e$ = {{Text|"&("|#FFB100}} + v$ + {{Text|"="|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|GOTO|#F0F0F0}} sete
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'not "NULL"|#31C4C4}}
                    sete:
                    {{Text|IF|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(id2.callname) = {{Text|"sub_paint"|#FFB100}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} i = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}}
                                e$ = {{Text|"(qbs*)"|#FFB100}} + e$
                            {{Text|ELSE|#F0F0F0}}
                                e$ = {{Text|"(uint32)"|#FFB100}} + e$
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} id2.ccall {{Text|THEN|#F0F0F0}}
                        {{Text|'if a forced cast from a returned ccall function is in e$, remove it|#31C4C4}}
                        {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(e$, {{Text|3|#F580B1}}) = {{Text|"(  "|#FFB100}} {{Text|THEN|#F0F0F0}}
                            e$ = removecast$(e$)
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} targettyp {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
                            e$ = {{Text|"(char*)("|#FFB100}} + e$ + {{Text|")->chr"|#FFB100}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} {{Text|LTRIM$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(e$)) = {{Text|"0"|#FFB100}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"NULL"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} i <> {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} subcall$ = subcall$ + {{Text|","|#FFB100}}
                    subcall$ = subcall$ + e$
                {{Text|NEXT|#F0F0F0}}
                {{Text|'note: i=id.args+1|#31C4C4}}
                x$ = separgslayout2$(i)
                {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} {{Text|LEN|#F0F0F0}}(x$)
                    x = {{Text|ASC|#F0F0F0}}(x$)
                    {{Text|IF|#F0F0F0}} x {{Text|THEN|#F0F0F0}}
                        x2$ = {{Text|MID$|#F0F0F0}}(x$, {{Text|2|#F580B1}}, x)
                        x$ = {{Text|RIGHT$|#F0F0F0}}(x$, {{Text|LEN|#F0F0F0}}(x$) - x - {{Text|1|#F580B1}})
                        s = {{Text|0|#F580B1}}
                        an = {{Text|0|#F580B1}}
                        x3$ = {{Text|RIGHT$|#F0F0F0}}(l$, {{Text|1|#F580B1}})
                        {{Text|IF|#F0F0F0}} x3$ = sp {{Text|THEN|#F0F0F0}} s = {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} x3$ = sp2 {{Text|THEN|#F0F0F0}}
                            s = {{Text|2|#F580B1}}
                            {{Text|IF|#F0F0F0}} alphanumeric({{Text|ASC|#F0F0F0}}({{Text|RIGHT$|#F0F0F0}}(l$, {{Text|2|#F580B1}}))) {{Text|THEN|#F0F0F0}} an = {{Text|1|#F580B1}}
                            {{Text|'if asc(right$(l$,2))=34 then an=1|#31C4C4}}
                        {{Text|ELSE|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} alphanumeric({{Text|ASC|#F0F0F0}}(x3$)) {{Text|THEN|#F0F0F0}} an = {{Text|1|#F580B1}}
                            {{Text|'if asc(x3$)=34 then an=1|#31C4C4}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        s1 = s
                        {{Text|IF|#F0F0F0}} (an = {{Text|1|#F580B1}} {{Text|OR|#F0F0F0}} addedlayout = {{Text|1|#F580B1}}) {{Text|AND|#F0F0F0}} alphanumeric({{Text|ASC|#F0F0F0}}(x2$)) <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                            s = {{Text|1|#F580B1}} {{Text|'force space|#31C4C4}}
                            x2$ = x2$ + sp2
                            {{Text|GOTO|#F0F0F0}} customlaychar2
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} x2$ = {{Text|"="|#FFB100}} {{Text|THEN|#F0F0F0}}
                            s = {{Text|1|#F580B1}}
                            x2$ = x2$ + sp
                            {{Text|GOTO|#F0F0F0}} customlaychar2
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} x2$ = {{Text|"#"|#FFB100}} {{Text|THEN|#F0F0F0}}
                            s = {{Text|1|#F580B1}}
                            x2$ = x2$ + sp2
                            {{Text|GOTO|#F0F0F0}} customlaychar2
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} x2$ = {{Text|","|#FFB100}} {{Text|THEN|#F0F0F0}} x2$ = x2$ + sp: {{Text|GOTO|#F0F0F0}} customlaychar2
                        {{Text|IF|#F0F0F0}} x$ = {{Text|CHR$|#F0F0F0}}({{Text|0|#F580B1}}) {{Text|THEN|#F0F0F0}} {{Text|'substitution|#31C4C4}}
                            {{Text|IF|#F0F0F0}} x2$ = {{Text|"STEP"|#FFB100}} {{Text|THEN|#F0F0F0}} x2$ = SCase$({{Text|"Step"|#FFB100}}) + sp2: {{Text|GOTO|#F0F0F0}} customlaychar2
                            x2$ = x2$ + sp: {{Text|GOTO|#F0F0F0}} customlaychar2
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|'default solution sp2+?+sp2|#31C4C4}}
                        x2$ = x2$ + sp2
                        customlaychar2:
                        {{Text|IF|#F0F0F0}} s = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} s = {{Text|2|#F580B1}}
                        {{Text|IF|#F0F0F0}} s <> s1 {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} s1 {{Text|THEN|#F0F0F0}} l$ = {{Text|LEFT$|#F0F0F0}}(l$, {{Text|LEN|#F0F0F0}}(l$) - {{Text|1|#F580B1}})
                            {{Text|IF|#F0F0F0}} s = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} l$ = l$ + sp
                            {{Text|IF|#F0F0F0}} s = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} l$ = l$ + sp2
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        l$ = l$ + x2$
                    {{Text|ELSE|#F0F0F0}}
                        addlayout = {{Text|0|#F580B1}}
                        x$ = {{Text|RIGHT$|#F0F0F0}}(x$, {{Text|LEN|#F0F0F0}}(x$) - {{Text|1|#F580B1}})
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    addedlayout = {{Text|0|#F580B1}}
                {{Text|LOOP|#F0F0F0}}
                {{Text|IF|#F0F0F0}} passedneeded {{Text|THEN|#F0F0F0}}
                    subcall$ = subcall$ + {{Text|","|#FFB100}} + str2$(passed&)
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                subcall$ = subcall$ + {{Text|");"|#FFB100}}
                {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"SLEEP"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} vWatchOn = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                        WriteBufLine MainTxtBuf, {{Text|"*__LONG_VWATCH_LINENUMBER= -4; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                WriteBufLine MainTxtBuf, subcall$
                {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"SLEEP"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} vWatchOn = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                        WriteBufLine MainTxtBuf, {{Text|"*__LONG_VWATCH_LINENUMBER= -5; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                subcall$ = {{Text|""|#FFB100}}
                {{Text|IF|#F0F0F0}} stringprocessinghappened {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, cleanupstringprocessingcall$ + {{Text|"0);"|#FFB100}}
                layoutdone = {{Text|1|#F580B1}}
                x$ = {{Text|RIGHT$|#F0F0F0}}(l$, {{Text|1|#F580B1}}): {{Text|IF|#F0F0F0}} x$ = sp {{Text|OR|#F0F0F0}} x$ = sp2 {{Text|THEN|#F0F0F0}} l$ = {{Text|LEFT$|#F0F0F0}}(l$, {{Text|LEN|#F0F0F0}}(l$) - {{Text|1|#F580B1}})
                {{Text|IF|#F0F0F0}} usecall = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} l$ = l$ + sp2 + {{Text|")"|#FFB100}}
                {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"SUB layout:["|#FFB100}} + l$ + {{Text|"]"|#FFB100}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} layout$ = l$ {{Text|ELSE|#F0F0F0}} layout$ = layout$ + sp + l$
                {{Text|GOTO|#F0F0F0}} finishedline
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                findidsecondarg = {{Text|""|#FFB100}}: {{Text|IF|#F0F0F0}} n >= {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findidsecondarg = getelement$(a$, {{Text|2|#F580B1}})
                findanotherid = {{Text|1|#F580B1}}
                try = findid(firstelement$)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|ELSE|#F0F0F0}}
                try = {{Text|0|#F580B1}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|LOOP|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    notsubcall:
    {{Text|IF|#F0F0F0}} n >= {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstelement$ = {{Text|"LET"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} n = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Syntax error - Reference: LET variable = expression (tip: LET is entirely optional)"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            ca$ = {{Text|RIGHT$|#F0F0F0}}(ca$, {{Text|LEN|#F0F0F0}}(ca$) - {{Text|4|#F580B1}})
            n = n - {{Text|1|#F580B1}}
            l$ = SCase$({{Text|"Let"|#FFB100}})
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + l$ {{Text|ELSE|#F0F0F0}} layout$ = l$
            {{Text|'note: layoutdone=1 will be set later|#31C4C4}}
            {{Text|GOTO|#F0F0F0}} letused
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'LET ???=???|#31C4C4}}
    {{Text|IF|#F0F0F0}} n >= {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(a$, sp + {{Text|"="|#FFB100}} + sp) {{Text|THEN|#F0F0F0}}
            letused:
            assign ca$, n
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            layoutdone = {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} layout$ = tlayout$ {{Text|ELSE|#F0F0F0}} layout$ = layout$ + sp + tlayout$
            {{Text|GOTO|#F0F0F0}} finishedline
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'>=3|#31C4C4}}
    {{Text|IF|#F0F0F0}} {{Text|RIGHT$|#F0F0F0}}(a$, {{Text|2|#F580B1}}) = sp + {{Text|"="|#FFB100}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Expected ... = expression"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
    {{Text|'Syntax error|#31C4C4}}
    a$ = {{Text|"Syntax error"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
    finishedline:
    THENGOTO = {{Text|0|#F580B1}}
    finishedline2:
    {{Text|IF|#F0F0F0}} inputfunctioncalled {{Text|THEN|#F0F0F0}}
        inputfunctioncalled = {{Text|0|#F580B1}}
        {{Text|IF|#F0F0F0}} vWatchOn = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
            WriteBufLine MainTxtBuf, {{Text|"*__LONG_VWATCH_LINENUMBER= -5; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} arrayprocessinghappened = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} arrayprocessinghappened = {{Text|0|#F580B1}}
    inclinenump$ = {{Text|""|#FFB100}}
    {{Text|IF|#F0F0F0}} inclinenumber(inclevel) {{Text|THEN|#F0F0F0}}
        inclinenump$ = {{Text|","|#FFB100}} + str2$(inclinenumber(inclevel))
        thisincname$ = getfilepath$(incname$(inclevel))
        thisincname$ = {{Text|MID$|#F0F0F0}}(incname$(inclevel), {{Text|LEN|#F0F0F0}}(thisincname$) + {{Text|1|#F580B1}})
        inclinenump$ = inclinenump$ + {{Text|","|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + thisincname$ + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}})
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} NoChecks = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} vWatchOn {{Text|AND|#F0F0F0}} inclinenumber(inclevel) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} temp$ = vWatchErrorCall$ {{Text|ELSE|#F0F0F0}} temp$ = {{Text|""|#FFB100}}
        {{Text|IF|#F0F0F0}} dynscope {{Text|THEN|#F0F0F0}}
            dynscope = {{Text|0|#F580B1}}
            WriteBufLine MainTxtBuf, {{Text|"if(qbevent){"|#FFB100}} + temp$ + {{Text|"evnt("|#FFB100}} + str2$(linenumber) + inclinenump$ + {{Text|");if(r)goto S_"|#FFB100}} + str2$(statementn) + {{Text|";}"|#FFB100}}
        {{Text|ELSE|#F0F0F0}}
            WriteBufLine MainTxtBuf, {{Text|"if(!qbevent)break;"|#FFB100}} + temp$ + {{Text|"evnt("|#FFB100}} + str2$(linenumber) + inclinenump$ + {{Text|");}while(r);"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    finishednonexec:
    firstLine = {{Text|0|#F580B1}}
    {{Text|IF|#F0F0F0}} layoutdone = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} layoutok = {{Text|0|#F580B1}} {{Text|'invalidate layout if not handled|#31C4C4}}
    {{Text|IF|#F0F0F0}} continuelinefrom = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'note: manager #2 requires this condition|#31C4C4}}
        {{Text|'Include Manager #2 '***|#31C4C4}}
        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(addmetainclude$) {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} inclevel = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|'backup line formatting|#31C4C4}}
                layoutcomment_backup$ = layoutcomment$
                layoutok_backup = layoutok
                layout_backup$ = layout$
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            a$ = addmetainclude$: addmetainclude$ = {{Text|""|#FFB100}} {{Text|'read/clear message|#31C4C4}}
            {{Text|IF|#F0F0F0}} inclevel = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                includingFromRoot = {{Text|0|#F580B1}}
                forceIncludingFile = {{Text|0|#F580B1}}
                forceInclude:
                {{Text|IF|#F0F0F0}} forceIncludeFromRoot$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
                    a$ = forceIncludeFromRoot$
                    forceIncludeFromRoot$ = {{Text|""|#FFB100}}
                    forceIncludingFile = {{Text|1|#F580B1}}
                    includingFromRoot = {{Text|1|#F580B1}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} inclevel = {{Text|100|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Too many indwelling INCLUDE files"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|'1. Verify file exists (location is either (a)relative to source file or (b)absolute)|#31C4C4}}
            fh = {{Text|99|#F580B1}} + inclevel + {{Text|1|#F580B1}}
            firstTryMethod = {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} includingFromRoot <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} inclevel = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} firstTryMethod = {{Text|2|#F580B1}}
            {{Text|FOR|#F0F0F0}} try = firstTryMethod {{Text|TO|#F0F0F0}} {{Text|2|#F580B1}} {{Text|'if including file from root, do not attempt including from relative location|#31C4C4}}
                {{Text|IF|#F0F0F0}} try = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} inclevel = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} idemode {{Text|THEN|#F0F0F0}} p$ = idepath$ + pathsep$ {{Text|ELSE|#F0F0F0}} p$ = getfilepath$(sourcefile$)
                    {{Text|ELSE|#F0F0F0}}
                        p$ = getfilepath$(incname(inclevel))
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    f$ = p$ + a$
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} f$ = a$
                {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(f$) {{Text|THEN|#F0F0F0}}
                    qberrorhappened = {{Text|-2|#F580B1}} {{Text|'***|#31C4C4}}
                    {{Text|OPEN|#F0F0F0}} f$ {{Text|FOR|#F0F0F0}} {{Text|BINARY|#F0F0F0}} {{Text|AS|#F0F0F0}} #fh
                    qberrorhappened2: {{Text|'***|#31C4C4}}
                    {{Text|IF|#F0F0F0}} qberrorhappened = {{Text|-2|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}} {{Text|'***|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                qberrorhappened = {{Text|0|#F580B1}}
            {{Text|NEXT|#F0F0F0}}
            {{Text|IF|#F0F0F0}} qberrorhappened <> {{Text|-2|#F580B1}} {{Text|THEN|#F0F0F0}} qberrorhappened = {{Text|0|#F580B1}}: a$ = {{Text|"File "|#FFB100}} + a$ + {{Text|" not found"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            inclevel = inclevel + {{Text|1|#F580B1}}: incname$(inclevel) = f$: inclinenumber(inclevel) = {{Text|0|#F580B1}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'fall through to next section...|#31C4C4}}
        {{Text|'--------------------|#31C4C4}}
        {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} inclevel
            fh = {{Text|99|#F580B1}} + inclevel
            {{Text|'2. Feed next line|#31C4C4}}
            {{Text|IF|#F0F0F0}} {{Text|EOF|#F0F0F0}}(fh) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|LINE|#F0F0F0}} {{Text|INPUT|#F0F0F0}} #fh, x$
                a3$ = x$
                continuelinefrom = {{Text|0|#F580B1}}
                inclinenumber(inclevel) = inclinenumber(inclevel) + {{Text|1|#F580B1}}
                {{Text|'create extended error string 'incerror$'|#31C4C4}}
                errorLineInInclude = inclinenumber(inclevel)
                e$ = {{Text|" in line "|#FFB100}} + str2(inclinenumber(inclevel)) + {{Text|" of "|#FFB100}} + incname$(inclevel) + {{Text|" included"|#FFB100}}
                {{Text|IF|#F0F0F0}} inclevel > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                    e$ = e$ + {{Text|" (through "|#FFB100}}
                    {{Text|FOR|#F0F0F0}} x = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} inclevel - {{Text|1|#F580B1}} {{Text|STEP|#F0F0F0}} {{Text|1|#F580B1}}
                        e$ = e$ + incname$(x)
                        {{Text|IF|#F0F0F0}} x < inclevel - {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'a sep is req|#31C4C4}}
                            {{Text|IF|#F0F0F0}} x = inclevel - {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                                e$ = e$ + {{Text|" then "|#FFB100}}
                            {{Text|ELSE|#F0F0F0}}
                                e$ = e$ + {{Text|", "|#FFB100}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|NEXT|#F0F0F0}}
                    e$ = e$ + {{Text|")"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                incerror$ = e$
                linenumber = linenumber - {{Text|1|#F580B1}} {{Text|'lower official linenumber to counter later increment|#31C4C4}}
                {{Text|IF|#F0F0F0}} idemode {{Text|THEN|#F0F0F0}} sendc$ = {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}}) + a3$: {{Text|GOTO|#F0F0F0}} sendcommand {{Text|'passback|#31C4C4}}
                {{Text|GOTO|#F0F0F0}} includeline
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'3. Close & return control|#31C4C4}}
            {{Text|CLOSE|#F0F0F0}} #fh
            inclevel = inclevel - {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} inclevel = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} forceIncludingFile = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                    forceIncludingFile = {{Text|0|#F580B1}}
                    {{Text|GOTO|#F0F0F0}} forceIncludeCompleted
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'restore line formatting|#31C4C4}}
                layoutok = layoutok_backup
                layout$ = layout_backup$
                layoutcomment$ = layoutcomment_backup$
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|LOOP|#F0F0F0}} {{Text|'fall through to next section...|#31C4C4}}
        {{Text|'(end manager)|#31C4C4}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'continuelinefrom=0|#31C4C4}}
    {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}}
        {{Text|PRINT|#F0F0F0}} #9, {{Text|"[layout check]"|#FFB100}}
        {{Text|PRINT|#F0F0F0}} #9, {{Text|"["|#FFB100}} + layoutoriginal$ + {{Text|"]"|#FFB100}}
        {{Text|PRINT|#F0F0F0}} #9, {{Text|"["|#FFB100}} + layout$ + {{Text|"]"|#FFB100}}
        {{Text|PRINT|#F0F0F0}} #9, layoutok
        {{Text|PRINT|#F0F0F0}} #9, {{Text|"[end layout check]"|#FFB100}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} idemode {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} continuelinefrom <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} ide4 {{Text|'continue processing other commands on line|#31C4C4}}
        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layoutcomment$) {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(layout$) {{Text|THEN|#F0F0F0}} layout$ = layout$ + sp + layoutcomment$ {{Text|ELSE|#F0F0F0}} layout$ = layoutcomment$
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} layoutok = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            layout$ = layoutoriginal$
        {{Text|ELSE|#F0F0F0}}
            {{Text|'reverse '046' changes present in autolayout|#31C4C4}}
            {{Text|'replace fix046$ with .|#31C4C4}}
            i = {{Text|INSTR|#F0F0F0}}(layout$, fix046$)
            {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} i
                layout$ = {{Text|LEFT$|#F0F0F0}}(layout$, i - {{Text|1|#F580B1}}) + {{Text|"."|#FFB100}} + {{Text|RIGHT$|#F0F0F0}}(layout$, {{Text|LEN|#F0F0F0}}(layout$) - (i + {{Text|LEN|#F0F0F0}}(fix046$) - {{Text|1|#F580B1}}))
                i = {{Text|INSTR|#F0F0F0}}(layout$, fix046$)
            {{Text|LOOP|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        x = lhscontrollevel: {{Text|IF|#F0F0F0}} controllevel < lhscontrollevel {{Text|THEN|#F0F0F0}} x = controllevel
        {{Text|IF|#F0F0F0}} definingtype = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} x = x + {{Text|1|#F580B1}}
        {{Text|IF|#F0F0F0}} definingtype > {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} definingtype = {{Text|2|#F580B1}}
        {{Text|IF|#F0F0F0}} declaringlibrary = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} x = x + {{Text|1|#F580B1}}
        {{Text|IF|#F0F0F0}} declaringlibrary > {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} declaringlibrary = {{Text|2|#F580B1}}
        layout$ = {{Text|SPACE$|#F0F0F0}}(x) + layout$
        {{Text|IF|#F0F0F0}} linecontinuation {{Text|THEN|#F0F0F0}} layout$ = {{Text|""|#FFB100}}
        {{Text|GOTO|#F0F0F0}} ideret4 {{Text|'return control to IDE|#31C4C4}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'layout is not currently used by the compiler (as appose to the IDE), if it was it would be used here|#31C4C4}}
    skipide4:
{{Text|LOOP|#F0F0F0}}
{{Text|'add final line|#31C4C4}}
{{Text|IF|#F0F0F0}} lastLineReturn = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
    lastLineReturn = {{Text|1|#F580B1}}
    lastLine = {{Text|1|#F580B1}}
    wholeline$ = {{Text|""|#FFB100}}
    {{Text|GOTO|#F0F0F0}} mainpassLastLine
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
ide5:
linenumber = {{Text|0|#F580B1}}
{{Text|IF|#F0F0F0}} closedmain = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} closemain
{{Text|IF|#F0F0F0}} definingtype {{Text|THEN|#F0F0F0}} linenumber = definingtypeerror: a$ = {{Text|"TYPE without END TYPE"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
{{Text|'check for open controls (copy #1)|#31C4C4}}
{{Text|IF|#F0F0F0}} controllevel {{Text|THEN|#F0F0F0}}
    a$ = {{Text|"Unidentified open control block"|#FFB100}}
    {{Text|SELECT|#F0F0F0}} {{Text|CASE|#F0F0F0}} controltype(controllevel)
        {{Text|CASE|#F0F0F0}} {{Text|1|#F580B1}}: a$ = {{Text|"IF without END IF"|#FFB100}}
        {{Text|CASE|#F0F0F0}} {{Text|2|#F580B1}}: a$ = {{Text|"FOR without NEXT"|#FFB100}}
        {{Text|CASE|#F0F0F0}} {{Text|3|#F580B1}}, {{Text|4|#F580B1}}: a$ = {{Text|"DO without LOOP"|#FFB100}}
        {{Text|CASE|#F0F0F0}} {{Text|5|#F580B1}}: a$ = {{Text|"WHILE without WEND"|#FFB100}}
        {{Text|CASE|#F0F0F0}} {{Text|6|#F580B1}}: a$ = {{Text|"$IF without $END IF"|#FFB100}}
        {{Text|CASE|#F0F0F0}} {{Text|10|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|19|#F580B1}}: a$ = {{Text|"SELECT CASE without END SELECT"|#FFB100}}
        {{Text|CASE|#F0F0F0}} {{Text|32|#F580B1}}: a$ = {{Text|"SUB/FUNCTION without END SUB/FUNCTION"|#FFB100}}
    {{Text|END|#F0F0F0}} {{Text|SELECT|#F0F0F0}}
    linenumber = controlref(controllevel)
    {{Text|GOTO|#F0F0F0}} errmes
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}} ideindentsubs = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(subfunc) {{Text|THEN|#F0F0F0}} a$ = {{Text|"SUB/FUNCTION without END SUB/FUNCTION"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|'close the error handler (cannot be put in 'closemain' because subs/functions can also add error jumps to this file)|#31C4C4}}
WriteBufLine ErrTxtBuf, {{Text|"exit(99);"|#FFB100}} {{Text|'in theory this line should never be run!|#31C4C4}}
WriteBufLine ErrTxtBuf, {{Text|"}"|#FFB100}} {{Text|'close error jump handler|#31C4C4}}
{{Text|'create CLEAR method "CLEAR"|#31C4C4}}
MainTxtBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + {{Text|"clear.txt"|#FFB100}})
{{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} idn
    {{Text|IF|#F0F0F0}} ids(i).staticscope {{Text|THEN|#F0F0F0}} {{Text|'static scope?|#31C4C4}}
        subfunc = {{Text|RTRIM$|#F0F0F0}}(ids(i).insubfunc) {{Text|'set static scope|#31C4C4}}
        {{Text|GOTO|#F0F0F0}} clearstaticscope
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    a = {{Text|ASC|#F0F0F0}}(ids(i).insubfunc)
    {{Text|IF|#F0F0F0}} a = {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} a = {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'global scope?|#31C4C4}}
        subfunc = {{Text|""|#FFB100}} {{Text|'set global scope|#31C4C4}}
        clearstaticscope:
        {{Text|IF|#F0F0F0}} ids(i).arraytype {{Text|THEN|#F0F0F0}} {{Text|'an array|#31C4C4}}
            getid i
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} id.arrayelements = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} clearerasereturned {{Text|'cannot erase non-existant array|#31C4C4}}
            {{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(vWatchVariableExclusions$, {{Text|"@"|#FFB100}} + {{Text|RTRIM$|#F0F0F0}}(id.callname) + {{Text|"@"|#FFB100}}) > {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|GOTO|#F0F0F0}} clearerasereturned
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            clearerasereturn = {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} clearerase
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'array|#31C4C4}}
        {{Text|IF|#F0F0F0}} ids(i).t {{Text|THEN|#F0F0F0}} {{Text|'non-array variable|#31C4C4}}
            getid i
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            bytes$ = variablesize$({{Text|-1|#F580B1}})
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|'create a reference|#31C4C4}}
            typ = id.t + ISREFERENCE
            {{Text|IF|#F0F0F0}} typ {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}}
                e$ = str2(i) + sp3 + str2(typ {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) + sp3 + {{Text|"0"|#FFB100}} + sp3 + {{Text|"0"|#FFB100}}
            {{Text|ELSE|#F0F0F0}}
                e$ = str2(i)
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            e$ = refer$(e$, typ, {{Text|1|#F580B1}})
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} typ {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} typ {{Text|AND|#F0F0F0}} ISFIXEDLENGTH {{Text|THEN|#F0F0F0}}
                    WriteBufLine MainTxtBuf, {{Text|"memset((void*)("|#FFB100}} + e$ + {{Text|"->chr),0,"|#FFB100}} + bytes$ + {{Text|");"|#FFB100}}
                    {{Text|GOTO|#F0F0F0}} cleared
                {{Text|ELSE|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(vWatchVariableExclusions$, {{Text|"@"|#FFB100}} + e$ + {{Text|"@"|#FFB100}}) = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(e$, {{Text|12|#F580B1}}) <> {{Text|"_SUB_VWATCH_"|#FFB100}} {{Text|THEN|#F0F0F0}}
                        WriteBufLine MainTxtBuf, e$ + {{Text|"->len=0;"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|GOTO|#F0F0F0}} cleared
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} typ {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} udtxvariable(typ {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) {{Text|THEN|#F0F0F0}}
                    {{Text|'this next procedure resets values of UDT variables with variable-length strings|#31C4C4}}
                    clear_udt_with_varstrings e$, typ {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}, MainTxtBuf, {{Text|0|#F580B1}}
                {{Text|ELSE|#F0F0F0}}
                    WriteBufLine MainTxtBuf, {{Text|"memset((void*)"|#FFB100}} + e$ + {{Text|",0,"|#FFB100}} + bytes$ + {{Text|");"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|ELSE|#F0F0F0}}
                {{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(vWatchVariableExclusions$, {{Text|"@"|#FFB100}} + e$ + {{Text|"@"|#FFB100}}) = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(e$, {{Text|12|#F580B1}}) <> {{Text|"_SUB_VWATCH_"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    WriteBufLine MainTxtBuf, {{Text|"*"|#FFB100}} + e$ + {{Text|"=0;"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|GOTO|#F0F0F0}} cleared
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'non-array variable|#31C4C4}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'scope|#31C4C4}}
    cleared:
    clearerasereturned:
{{Text|NEXT|#F0F0F0}}
{{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}}
    {{Text|PRINT|#F0F0F0}} #9, {{Text|"finished making program!"|#FFB100}}
    {{Text|PRINT|#F0F0F0}} #9, {{Text|"recompile="|#FFB100}}; recompile
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|'Set cmem flags for subs/functions requiring data passed in cmem|#31C4C4}}
{{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} idn
    {{Text|IF|#F0F0F0}} cmemlist(i) {{Text|THEN|#F0F0F0}} {{Text|'must be in cmem|#31C4C4}}
        getid i
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
        {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"recompiling cmem sf! checking:"|#FFB100}}; {{Text|RTRIM$|#F0F0F0}}(id.n)
        {{Text|IF|#F0F0F0}} id.sfid {{Text|THEN|#F0F0F0}} {{Text|'it is an argument of a sub/function|#31C4C4}}
            {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"recompiling cmem sf! It's a sub/func arg!"|#FFB100}}
            i2 = id.sfid
            x = id.sfarg
            {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"recompiling cmem sf! values:"|#FFB100}}; i2; x
            {{Text|'check if cmem flag is set, if not then set it & force recompile|#31C4C4}}
            {{Text|IF|#F0F0F0}} {{Text|MID$|#F0F0F0}}(sfcmemargs(i2), x, {{Text|1|#F580B1}}) <> {{Text|CHR$|#F0F0F0}}({{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
                {{Text|MID$|#F0F0F0}}(sfcmemargs(i2), x, {{Text|1|#F580B1}}) = {{Text|CHR$|#F0F0F0}}({{Text|1|#F580B1}})
                {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"recompiling cmem sf! setting:"|#FFB100}}; i2; x
                recompile = {{Text|1|#F580B1}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|NEXT|#F0F0F0}} i
unresolved = {{Text|0|#F580B1}}
{{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} idn
    getid i
    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
    {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"checking id named:"|#FFB100}}; id.n
    {{Text|IF|#F0F0F0}} id.subfunc {{Text|THEN|#F0F0F0}}
        {{Text|FOR|#F0F0F0}} i2 = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} id.args
            t = {{Text|CVL|#F0F0F0}}({{Text|MID$|#F0F0F0}}(id.arg, i2 * {{Text|4|#F580B1}} - {{Text|3|#F580B1}}, {{Text|4|#F580B1}}))
            {{Text|IF|#F0F0F0}} t > {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISPOINTER) {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISARRAY) {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"checking argument "|#FFB100}}; i2; {{Text|" of "|#FFB100}}; id.args
                        nele = {{Text|ASC|#F0F0F0}}({{Text|MID$|#F0F0F0}}(id.nele, i2, {{Text|1|#F580B1}}))
                        nelereq = {{Text|ASC|#F0F0F0}}({{Text|MID$|#F0F0F0}}(id.nelereq, i2, {{Text|1|#F580B1}}))
                        {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"nele="|#FFB100}}; nele
                        {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"nelereq="|#FFB100}}; nelereq
                        {{Text|IF|#F0F0F0}} nele <> nelereq {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"mismatch detected!"|#FFB100}}
                            unresolved = unresolved + {{Text|1|#F580B1}}
                            sflistn = sflistn + {{Text|1|#F580B1}}
                            sfidlist(sflistn) = i
                            sfarglist(sflistn) = i2
                            sfelelist(sflistn) = nelereq {{Text|'0 means still unknown|#31C4C4}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|NEXT|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|NEXT|#F0F0F0}}
{{Text|'is recompilation required to resolve this?|#31C4C4}}
{{Text|IF|#F0F0F0}} unresolved > {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
    {{Text|IF|#F0F0F0}} lastunresolved = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|'first pass|#31C4C4}}
        recompile = {{Text|1|#F580B1}}
        {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}}
            {{Text|PRINT|#F0F0F0}} #9, {{Text|"recompiling to resolve array elements (first time)"|#FFB100}}
            {{Text|PRINT|#F0F0F0}} #9, {{Text|"sflistn="|#FFB100}}; sflistn
            {{Text|PRINT|#F0F0F0}} #9, {{Text|"oldsflistn="|#FFB100}}; oldsflistn
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|ELSE|#F0F0F0}}
        {{Text|'not first pass|#31C4C4}}
        {{Text|IF|#F0F0F0}} unresolved < lastunresolved {{Text|THEN|#F0F0F0}}
            recompile = {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}}
                {{Text|PRINT|#F0F0F0}} #9, {{Text|"recompiling to resolve array elements (not first time)"|#FFB100}}
                {{Text|PRINT|#F0F0F0}} #9, {{Text|"sflistn="|#FFB100}}; sflistn
                {{Text|PRINT|#F0F0F0}} #9, {{Text|"oldsflistn="|#FFB100}}; oldsflistn
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'unresolved|#31C4C4}}
lastunresolved = unresolved
{{Text|'IDEA!|#31C4C4}}
{{Text|'have a flag to record if anything gets resolved in a pass|#31C4C4}}
{{Text|'if not then it's time to stop|#31C4C4}}
{{Text|'the problem is the same amount of new problems may be created by a|#31C4C4}}
{{Text|'resolve as those that get fixed|#31C4C4}}
{{Text|'also/or.. could it be that previous fixes are overridden in a recompile|#31C4C4}}
{{Text|'          by a new fix? if so, it would give these effects|#31C4C4}}
{{Text|'could recompilation resolve this?|#31C4C4}}
{{Text|'IF sflistn <> -1 THEN|#31C4C4}}
{{Text|'IF sflistn <> oldsflistn THEN|#31C4C4}}
{{Text|'recompile = 1|#31C4C4}}
{{Text|'|#31C4C4}}
{{Text|'if debug then|#31C4C4}}
{{Text|'print #9,"recompile set to 1 to resolve array elements"|#31C4C4}}
{{Text|'print #9,"sflistn=";sflistn|#31C4C4}}
{{Text|'print #9,"oldsflistn=";oldsflistn|#31C4C4}}
{{Text|'end if|#31C4C4}}
{{Text|'|#31C4C4}}
{{Text|'END IF|#31C4C4}}
{{Text|'END IF|#31C4C4}}
{{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"Beginning COMMON array list check..."|#FFB100}}
xi = {{Text|1|#F580B1}}
{{Text|FOR|#F0F0F0}} x = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} commonarraylistn
    varname$ = getelement$(commonarraylist, xi): xi = xi + {{Text|1|#F580B1}}
    typ$ = getelement$(commonarraylist, xi): xi = xi + {{Text|1|#F580B1}}
    dimmethod2 = {{Text|VAL|#F0F0F0}}(getelement$(commonarraylist, xi)): xi = xi + {{Text|1|#F580B1}}
    dimshared2 = {{Text|VAL|#F0F0F0}}(getelement$(commonarraylist, xi)): xi = xi + {{Text|1|#F580B1}}
    {{Text|'find the array ID (try method)|#31C4C4}}
    t = typname2typ(typ$)
    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
    {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISUDT) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} varname$ = varname$ + type2symbol$(typ$)
    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
    {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"Checking for array '"|#FFB100}} + varname$ + {{Text|"'..."|#FFB100}}
    try = findid(varname$)
    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
    {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
        {{Text|IF|#F0F0F0}} id.arraytype {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} foundcommonarray2
        {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(varname$) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
    {{Text|LOOP|#F0F0F0}}
    foundcommonarray2:
    {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"Found array '"|#FFB100}} + varname$ + {{Text|"!"|#FFB100}}
    {{Text|IF|#F0F0F0}} id.arrayelements = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} arrayelementslist(currentid) <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} recompile = {{Text|1|#F580B1}}
        {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"Recompiling to resolve elements of:"|#FFB100}} + varname$
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|NEXT|#F0F0F0}}
{{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"Finished COMMON array list check!"|#FFB100}}
{{Text|IF|#F0F0F0}} vWatchDesiredState <> vWatchOn {{Text|THEN|#F0F0F0}}
    vWatchRecompileAttempts = vWatchRecompileAttempts + {{Text|1|#F580B1}}
    recompile = {{Text|1|#F580B1}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}} recompile {{Text|THEN|#F0F0F0}}
    do_recompile:
    {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"Recompile required!"|#FFB100}}
    recompile = {{Text|0|#F580B1}}
    {{Text|IF|#F0F0F0}} idemode {{Text|THEN|#F0F0F0}} iderecompile = {{Text|1|#F580B1}}
    {{Text|FOR|#F0F0F0}} closeall = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|255|#F580B1}}: {{Text|CLOSE|#F0F0F0}} closeall: {{Text|NEXT|#F0F0F0}}
    {{Text|OPEN|#F0F0F0}} tmpdir$ + {{Text|"temp.bin"|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|OUTPUT|#F0F0F0}} {{Text|LOCK|#F0F0F0}} {{Text|WRITE|#F0F0F0}} {{Text|AS|#F0F0F0}} #26 {{Text|'relock|#31C4C4}}
    {{Text|GOTO|#F0F0F0}} recompile
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"Beginning label check..."|#FFB100}}
{{Text|FOR|#F0F0F0}} r = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} nLabels
    {{Text|IF|#F0F0F0}} Labels(r).Scope_Restriction {{Text|THEN|#F0F0F0}}
        a$ = {{Text|RTRIM$|#F0F0F0}}(Labels(r).cn)
        ignore = validlabel(a$)
        v = HashFind(a$, HASHFLAG_LABEL, ignore, r2)
        addlabchk7:
        {{Text|IF|#F0F0F0}} v {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} Labels(r2).Scope = Labels(r).Scope_Restriction {{Text|THEN|#F0F0F0}}
                linenumber = Labels(r).Error_Line: a$ = {{Text|"Common label within a SUB/FUNCTION"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} v = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} v = HashFindCont(ignore, r2): {{Text|GOTO|#F0F0F0}} addlabchk7
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'v|#31C4C4}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'restriction|#31C4C4}}
    {{Text|'check for undefined labels|#31C4C4}}
    {{Text|IF|#F0F0F0}} Labels(r).State = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(PossibleSubNameLabels$, sp + {{Text|UCASE$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(Labels(r).cn)) + sp) {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(SubNameLabels$, sp + {{Text|UCASE$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(Labels(r).cn)) + sp) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'not already added|#31C4C4}}
                SubNameLabels$ = SubNameLabels$ + {{Text|UCASE$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(Labels(r).cn)) + sp
                {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"Recompiling to resolve label:"|#FFB100}}; {{Text|RTRIM$|#F0F0F0}}(Labels(r).cn)
                {{Text|GOTO|#F0F0F0}} do_recompile
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        linenumber = Labels(r).Error_Line: a$ = {{Text|"Label '"|#FFB100}} + {{Text|RTRIM$|#F0F0F0}}(Labels(r).cn) + {{Text|"' not defined"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} Labels(r).Data_Referenced {{Text|THEN|#F0F0F0}}
        {{Text|'check for ambiguous RESTORE reference|#31C4C4}}
        x = {{Text|0|#F580B1}}
        a$ = {{Text|RTRIM$|#F0F0F0}}(Labels(r).cn)
        ignore = validlabel(a$)
        v = HashFind(a$, HASHFLAG_LABEL, ignore, r2)
        addlabchk4:
        {{Text|IF|#F0F0F0}} v {{Text|THEN|#F0F0F0}}
            x = x + {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} v = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} v = HashFindCont(ignore, r2): {{Text|GOTO|#F0F0F0}} addlabchk4
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'v|#31C4C4}}
        {{Text|IF|#F0F0F0}} x <> {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} linenumber = Labels(r).Error_Line: a$ = {{Text|"Ambiguous DATA label"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
        {{Text|'add global data offset variable|#31C4C4}}
        WriteBufLine GlobTxtBuf, {{Text|"ptrszint data_at_LABEL_"|#FFB100}} + a$ + {{Text|"="|#FFB100}} + str2(Labels(r).Data_Offset) + {{Text|";"|#FFB100}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'data referenced|#31C4C4}}
{{Text|NEXT|#F0F0F0}}
{{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"Finished check!"|#FFB100}}
{{Text|'if targettyp=-4 or targettyp=-5 then '? -> byte_element(offset,element size in bytes)|#31C4C4}}
{{Text|' IF (sourcetyp AND ISREFERENCE) = 0 THEN a$ = "Expected variable name/array element": GOTO errmes|#31C4C4}}
{{Text|'create include files for COMMON arrays|#31C4C4}}
{{Text|'return to 'main'|#31C4C4}}
subfunc$ = {{Text|""|#FFB100}}
defdatahandle = GlobTxtBuf
DataTxtBuf = OpenBuffer%({{Text|"A"|#FFB100}}, tmpdir$ + {{Text|"maindata.txt"|#FFB100}})
FreeTxtBuf = OpenBuffer%({{Text|"A"|#FFB100}}, tmpdir$ + {{Text|"mainfree.txt"|#FFB100}})
{{Text|IF|#F0F0F0}}{{Text|_Console|#F0F0F0}} {{Text|THEN|#F0F0F0}}
    WriteBufLine GlobTxtBuf, {{Text|"int32 console=1;"|#FFB100}}
{{Text|ELSE|#F0F0F0}}
    WriteBufLine GlobTxtBuf, {{Text|"int32 console=0;"|#FFB100}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}}{{Text|_ScreenHide|#F0F0F0}} {{Text|THEN|#F0F0F0}}
    WriteBufLine GlobTxtBuf, {{Text|"int32 screen_hide_startup=1;"|#FFB100}}
{{Text|ELSE|#F0F0F0}}
    WriteBufLine GlobTxtBuf, {{Text|"int32 screen_hide_startup=0;"|#FFB100}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}} Asserts {{Text|THEN|#F0F0F0}}
    WriteBufLine GlobTxtBuf, {{Text|"int32 asserts=1;"|#FFB100}}
{{Text|ELSE|#F0F0F0}}
    WriteBufLine GlobTxtBuf, {{Text|"int32 asserts=0;"|#FFB100}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}} vWatchOn {{Text|THEN|#F0F0F0}}
    WriteBufLine GlobTxtBuf, {{Text|"int32 vwatch=-1;"|#FFB100}}
{{Text|ELSE|#F0F0F0}}
    WriteBufLine GlobTxtBuf, {{Text|"int32 vwatch=0;"|#FFB100}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
bh = OpenBuffer%({{Text|"A"|#FFB100}}, tmpdir$ + {{Text|"dyninfo.txt"|#FFB100}})
{{Text|IF|#F0F0F0}}{{Text|_Resize|#F0F0F0}} {{Text|THEN|#F0F0F0}}
    WriteBufLine bh, {{Text|"ScreenResize=1;"|#FFB100}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}} Resize_Scale {{Text|THEN|#F0F0F0}}
    WriteBufLine bh, {{Text|"ScreenResizeScale="|#FFB100}} + str2(Resize_Scale) + {{Text|";"|#FFB100}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}} vWatchOn = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
    vWatchVariable {{Text|""|#FFB100}}, {{Text|1|#F580B1}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|'DATA_finalize|#31C4C4}}
WriteBufLine GlobTxtBuf, {{Text|"ptrszint data_size="|#FFB100}} + str2(DataOffset) + {{Text|";"|#FFB100}}
{{Text|IF|#F0F0F0}} DataOffset = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
    WriteBufLine GlobTxtBuf, {{Text|"uint8 *data=(uint8*)calloc(1,1);"|#FFB100}}
{{Text|ELSE|#F0F0F0}}
    {{Text|IF|#F0F0F0}} inline_DATA = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} os$ = {{Text|"WIN"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} OS_BITS = {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}}
                x$ = {{Text|CHR$|#F0F0F0}}({{Text|0|#F580B1}}): WriteBufRawData DataBinBuf, x$
                WriteBufLine GlobTxtBuf, {{Text|"extern "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"C"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"{"|#FFB100}}
                WriteBufLine GlobTxtBuf, {{Text|"extern char *binary_internal_temp"|#FFB100}} + tempfolderindexstr2$ + {{Text|"_data_bin_start;"|#FFB100}}
                WriteBufLine GlobTxtBuf, {{Text|"}"|#FFB100}}
                WriteBufLine GlobTxtBuf, {{Text|"uint8 *data=(uint8*)&binary_internal_temp"|#FFB100}} + tempfolderindexstr2$ + {{Text|"_data_bin_start;"|#FFB100}}
            {{Text|ELSE|#F0F0F0}}
                x$ = {{Text|CHR$|#F0F0F0}}({{Text|0|#F580B1}}): WriteBufRawData DataBinBuf, x$
                WriteBufLine GlobTxtBuf, {{Text|"extern "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"C"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"{"|#FFB100}}
                WriteBufLine GlobTxtBuf, {{Text|"extern char *_binary_internal_temp"|#FFB100}} + tempfolderindexstr2$ + {{Text|"_data_bin_start;"|#FFB100}}
                WriteBufLine GlobTxtBuf, {{Text|"}"|#FFB100}}
                WriteBufLine GlobTxtBuf, {{Text|"uint8 *data=(uint8*)&_binary_internal_temp"|#FFB100}} + tempfolderindexstr2$ + {{Text|"_data_bin_start;"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} os$ = {{Text|"LNX"|#FFB100}} {{Text|THEN|#F0F0F0}}
            x$ = {{Text|CHR$|#F0F0F0}}({{Text|0|#F580B1}}): WriteBufRawData DataBinBuf, x$
            WriteBufLine GlobTxtBuf, {{Text|"extern "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"C"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"{"|#FFB100}}
            WriteBufLine GlobTxtBuf, {{Text|"extern char *_binary_internal_temp"|#FFB100}} + tempfolderindexstr2$ + {{Text|"_data_bin_start;"|#FFB100}}
            WriteBufLine GlobTxtBuf, {{Text|"}"|#FFB100}}
            WriteBufLine GlobTxtBuf, {{Text|"uint8 *data=(uint8*)&_binary_internal_temp"|#FFB100}} + tempfolderindexstr2$ + {{Text|"_data_bin_start;"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|ELSE|#F0F0F0}}
        {{Text|'inline data|#31C4C4}}
        ff = OpenBuffer%({{Text|"B"|#FFB100}}, tmpdir$ + {{Text|"data.bin"|#FFB100}})
        x$ = ReadBufRawData$(ff, GetBufLen&(ff))
        x2$ = {{Text|"uint8 inline_data[]={"|#FFB100}}
        {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|LEN|#F0F0F0}}(x$)
            x2$ = x2$ + inlinedatastr$({{Text|ASC|#F0F0F0}}(x$, i))
        {{Text|NEXT|#F0F0F0}}
        x2$ = x2$ + {{Text|"0};"|#FFB100}}
        WriteBufLine GlobTxtBuf, x2$
        WriteBufLine GlobTxtBuf, {{Text|"uint8 *data=&inline_data[0];"|#FFB100}}
        x$ = {{Text|""|#FFB100}}: x2$ = {{Text|""|#FFB100}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"Beginning generation of code for saving/sharing common array data..."|#FFB100}}
use_global_byte_elements = {{Text|1|#F580B1}}
ncommontmp = {{Text|0|#F580B1}}
xi = {{Text|1|#F580B1}}
{{Text|FOR|#F0F0F0}} x = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} commonarraylistn
    varname$ = getelement$(commonarraylist, xi): xi = xi + {{Text|1|#F580B1}}
    typ$ = getelement$(commonarraylist, xi): xi = xi + {{Text|1|#F580B1}}
    dimmethod2 = {{Text|VAL|#F0F0F0}}(getelement$(commonarraylist, xi)): xi = xi + {{Text|1|#F580B1}}
    dimshared2 = {{Text|VAL|#F0F0F0}}(getelement$(commonarraylist, xi)): xi = xi + {{Text|1|#F580B1}}
    {{Text|'find the array ID (try method)|#31C4C4}}
    purevarname$ = varname$
    t = typname2typ(typ$)
    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
    {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISUDT) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} varname$ = varname$ + type2symbol$(typ$)
    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
    try = findid(varname$)
    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
    {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
        {{Text|IF|#F0F0F0}} id.arraytype {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} foundcommonarray
        {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(varname$) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
    {{Text|LOOP|#F0F0F0}}
    a$ = {{Text|"COMMON array unlocatable"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes {{Text|'should never happen|#31C4C4}}
    foundcommonarray:
    {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"Found common array '"|#FFB100}} + varname$ + {{Text|"'!"|#FFB100}}
    i = currentid
    arraytype = id.arraytype
    arrayelements = id.arrayelements
    e$ = {{Text|RTRIM$|#F0F0F0}}(id.n)
    {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISUDT) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = e$ + typevalue2symbol$(t)
    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
    n$ = e$
    n2$ = {{Text|RTRIM$|#F0F0F0}}(id.callname)
    tsize = id.tsize
    {{Text|'select command|#31C4C4}}
    command = {{Text|3|#F580B1}} {{Text|'fixed length elements|#31C4C4}}
    {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            command = {{Text|4|#F580B1}} {{Text|'var-len elements|#31C4C4}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'if...|#31C4C4}}
    {{Text|'i) array elements are still undefined (ie. arrayelements=-1) pass the input content along|#31C4C4}}
    {{Text|'  if any existed or an array-placeholder|#31C4C4}}
    {{Text|'ii) if the array's elements were defined, any input content would have been loaded so the|#31C4C4}}
    {{Text|'    array (in whatever state it currently is) should be passed. If it is currently erased|#31C4C4}}
    {{Text|'    then it should be passed as a placeholder|#31C4C4}}
    {{Text|IF|#F0F0F0}} arrayelements = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|'load array (copies the array, if any, into a buffer for later)|#31C4C4}}
        MainTxtBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + {{Text|"inpchain"|#FFB100}} + str2$(i) + {{Text|".txt"|#FFB100}})
        WriteBufLine MainTxtBuf, {{Text|"if (int32val==2){"|#FFB100}} {{Text|'array place-holder|#31C4C4}}
        {{Text|'create buffer to store array as-is in global.txt|#31C4C4}}
        x$ = str2$(uniquenumber)
        x1$ = {{Text|"chainarraybuf"|#FFB100}} + x$
        x2$ = {{Text|"chainarraybufsiz"|#FFB100}} + x$
        WriteBufLine GlobTxtBuf, {{Text|"static uint8 *"|#FFB100}} + x1$ + {{Text|"=(uint8*)malloc(1);"|#FFB100}}
        WriteBufLine GlobTxtBuf, {{Text|"static int64 "|#FFB100}} + x2$ + {{Text|"=0;"|#FFB100}}
        {{Text|'read next command|#31C4C4}}
        WriteBufLine MainTxtBuf, {{Text|"sub_get(FF,NULL,byte_element((uint64)&int32val,4,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}}
        {{Text|IF|#F0F0F0}} command = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, {{Text|"if (int32val==3){"|#FFB100}} {{Text|'fixed-length-element array|#31C4C4}}
        {{Text|IF|#F0F0F0}} command = {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, {{Text|"if (int32val==4){"|#FFB100}} {{Text|'var-length-element array|#31C4C4}}
        WriteBufLine MainTxtBuf, x2$ + {{Text|"+=4; "|#FFB100}} + x1$ + {{Text|"=(uint8*)realloc("|#FFB100}} + x1$ + {{Text|","|#FFB100}} + x2$ + {{Text|"); *(int32*)("|#FFB100}} + x1$ + {{Text|"+"|#FFB100}} + x2$ + {{Text|"-4)=int32val;"|#FFB100}}
        {{Text|IF|#F0F0F0}} command = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|'read size in bits of one element, convert it to bytes|#31C4C4}}
            WriteBufLine MainTxtBuf, {{Text|"sub_get(FF,NULL,byte_element((uint64)&int64val,8,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}}
            WriteBufLine MainTxtBuf, x2$ + {{Text|"+=8; "|#FFB100}} + x1$ + {{Text|"=(uint8*)realloc("|#FFB100}} + x1$ + {{Text|","|#FFB100}} + x2$ + {{Text|"); *(int64*)("|#FFB100}} + x1$ + {{Text|"+"|#FFB100}} + x2$ + {{Text|"-8)=int64val;"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"bytes=int64val>>3;"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'com=3|#31C4C4}}
        {{Text|IF|#F0F0F0}} command = {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, {{Text|"bytes=1;"|#FFB100}} {{Text|'bytes used to calculate number of elements|#31C4C4}}
        {{Text|'read number of dimensions|#31C4C4}}
        WriteBufLine MainTxtBuf, {{Text|"sub_get(FF,NULL,byte_element((uint64)&int32val,4,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}}
        WriteBufLine MainTxtBuf, x2$ + {{Text|"+=4; "|#FFB100}} + x1$ + {{Text|"=(uint8*)realloc("|#FFB100}} + x1$ + {{Text|","|#FFB100}} + x2$ + {{Text|"); *(int32*)("|#FFB100}} + x1$ + {{Text|"+"|#FFB100}} + x2$ + {{Text|"-4)=int32val;"|#FFB100}}
        {{Text|'read size of dimensions & calculate the size of the array in bytes|#31C4C4}}
        WriteBufLine MainTxtBuf, {{Text|"while(int32val--){"|#FFB100}}
        WriteBufLine MainTxtBuf, {{Text|"sub_get(FF,NULL,byte_element((uint64)&int64val,8,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}} {{Text|'lbound|#31C4C4}}
        WriteBufLine MainTxtBuf, x2$ + {{Text|"+=8; "|#FFB100}} + x1$ + {{Text|"=(uint8*)realloc("|#FFB100}} + x1$ + {{Text|","|#FFB100}} + x2$ + {{Text|"); *(int64*)("|#FFB100}} + x1$ + {{Text|"+"|#FFB100}} + x2$ + {{Text|"-8)=int64val;"|#FFB100}}
        WriteBufLine MainTxtBuf, {{Text|"sub_get(FF,NULL,byte_element((uint64)&int64val2,8,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}} {{Text|'ubound|#31C4C4}}
        WriteBufLine MainTxtBuf, x2$ + {{Text|"+=8; "|#FFB100}} + x1$ + {{Text|"=(uint8*)realloc("|#FFB100}} + x1$ + {{Text|","|#FFB100}} + x2$ + {{Text|"); *(int64*)("|#FFB100}} + x1$ + {{Text|"+"|#FFB100}} + x2$ + {{Text|"-8)=int64val2;"|#FFB100}}
        WriteBufLine MainTxtBuf, {{Text|"bytes*=(int64val2-int64val+1);"|#FFB100}}
        WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}}
        {{Text|IF|#F0F0F0}} command = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|'read the array data|#31C4C4}}
            WriteBufLine MainTxtBuf, x2$ + {{Text|"+=bytes; "|#FFB100}} + x1$ + {{Text|"=(uint8*)realloc("|#FFB100}} + x1$ + {{Text|","|#FFB100}} + x2$ + {{Text|");"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"sub_get(FF,NULL,byte_element((uint64)("|#FFB100}} + x1$ + {{Text|"+"|#FFB100}} + x2$ + {{Text|"-bytes),bytes,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'com=3|#31C4C4}}
        {{Text|IF|#F0F0F0}} command = {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}}
            WriteBufLine MainTxtBuf, {{Text|"bytei=0;"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"while(bytei<bytes){"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"sub_get(FF,NULL,byte_element((uint64)&int64val,8,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}} {{Text|'get size|#31C4C4}}
            WriteBufLine MainTxtBuf, x2$ + {{Text|"+=8; "|#FFB100}} + x1$ + {{Text|"=(uint8*)realloc("|#FFB100}} + x1$ + {{Text|","|#FFB100}} + x2$ + {{Text|"); *(int64*)("|#FFB100}} + x1$ + {{Text|"+"|#FFB100}} + x2$ + {{Text|"-8)=int64val;"|#FFB100}}
            WriteBufLine MainTxtBuf, x2$ + {{Text|"+=(int64val>>3); "|#FFB100}} + x1$ + {{Text|"=(uint8*)realloc("|#FFB100}} + x1$ + {{Text|","|#FFB100}} + x2$ + {{Text|");"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"sub_get(FF,NULL,byte_element((uint64)("|#FFB100}} + x1$ + {{Text|"+"|#FFB100}} + x2$ + {{Text|"-(int64val>>3)),(int64val>>3),"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"bytei++;"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|'get next command|#31C4C4}}
        WriteBufLine MainTxtBuf, {{Text|"sub_get(FF,NULL,byte_element((uint64)&int32val,4,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}}
        WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}} {{Text|'command=3 or 4|#31C4C4}}
        WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}} {{Text|'array place-holder|#31C4C4}}
        {{Text|'save array (saves the buffered data, if any, for later)|#31C4C4}}
        MainTxtBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + {{Text|"chain"|#FFB100}} + str2$(i) + {{Text|".txt"|#FFB100}})
        WriteBufLine MainTxtBuf, {{Text|"int32val=2;"|#FFB100}} {{Text|'placeholder|#31C4C4}}
        WriteBufLine MainTxtBuf, {{Text|"sub_put(FF,NULL,byte_element((uint64)&int32val,4,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}}
        WriteBufLine MainTxtBuf, {{Text|"sub_put(FF,NULL,byte_element((uint64)"|#FFB100}} + x1$ + {{Text|","|#FFB100}} + x2$ + {{Text|","|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}}
    {{Text|ELSE|#F0F0F0}}
        {{Text|'note: arrayelements<>-1|#31C4C4}}
        {{Text|'load array|#31C4C4}}
        MainTxtBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + {{Text|"inpchain"|#FFB100}} + str2$(i) + {{Text|".txt"|#FFB100}})
        WriteBufLine MainTxtBuf, {{Text|"if (int32val==2){"|#FFB100}} {{Text|'array place-holder|#31C4C4}}
        WriteBufLine MainTxtBuf, {{Text|"sub_get(FF,NULL,byte_element((uint64)&int32val,4,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}}
        {{Text|IF|#F0F0F0}} command = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, {{Text|"if (int32val==3){"|#FFB100}} {{Text|'fixed-length-element array|#31C4C4}}
        {{Text|IF|#F0F0F0}} command = {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, {{Text|"if (int32val==4){"|#FFB100}} {{Text|'var-length-element array|#31C4C4}}
        {{Text|IF|#F0F0F0}} command = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|'get size in bits|#31C4C4}}
            WriteBufLine MainTxtBuf, {{Text|"sub_get(FF,NULL,byte_element((uint64)&int64val,8,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}}
            {{Text|'***assume correct***|#31C4C4}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|'get number of elements|#31C4C4}}
        WriteBufLine MainTxtBuf, {{Text|"sub_get(FF,NULL,byte_element((uint64)&int32val,4,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}}
        {{Text|'***assume correct***|#31C4C4}}
        e$ = {{Text|""|#FFB100}}
        {{Text|IF|#F0F0F0}} command = {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, {{Text|"bytes=1;"|#FFB100}} {{Text|'bytes counts the number of total elements|#31C4C4}}
        {{Text|FOR|#F0F0F0}} x2 = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} arrayelements
            {{Text|'create 'secret' variables to assist in passing common arrays|#31C4C4}}
            {{Text|IF|#F0F0F0}} x2 > ncommontmp {{Text|THEN|#F0F0F0}}
                ncommontmp = ncommontmp + {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"Calling DIM2(...)..."|#FFB100}}
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                retval = dim2({{Text|"___RESERVED_COMMON_LBOUND"|#FFB100}} + str2$(ncommontmp), {{Text|"_INTEGER64"|#FFB100}}, {{Text|0|#F580B1}}, {{Text|""|#FFB100}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                retval = dim2({{Text|"___RESERVED_COMMON_UBOUND"|#FFB100}} + str2$(ncommontmp), {{Text|"_INTEGER64"|#FFB100}}, {{Text|0|#F580B1}}, {{Text|""|#FFB100}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"Finished calling DIM2(...)!"|#FFB100}}
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            WriteBufLine MainTxtBuf, {{Text|"sub_get(FF,NULL,byte_element((uint64)&int64val,8,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"*__INTEGER64____RESERVED_COMMON_LBOUND"|#FFB100}} + str2$(x2) + {{Text|"=int64val;"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"sub_get(FF,NULL,byte_element((uint64)&int64val2,8,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"*__INTEGER64____RESERVED_COMMON_UBOUND"|#FFB100}} + str2$(x2) + {{Text|"=int64val2;"|#FFB100}}
            {{Text|IF|#F0F0F0}} command = {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, {{Text|"bytes*=(int64val2-int64val+1);"|#FFB100}}
            {{Text|IF|#F0F0F0}} x2 > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = e$ + sp + {{Text|","|#FFB100}} + sp
            e$ = e$ + {{Text|"___RESERVED_COMMON_LBOUND"|#FFB100}} + str2$(x2) + sp + {{Text|"TO"|#FFB100}} + sp + {{Text|"___RESERVED_COMMON_UBOUND"|#FFB100}} + str2$(x2)
        {{Text|NEXT|#F0F0F0}}
        {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"Calling DIM2("|#FFB100}} + purevarname$ + {{Text|","|#FFB100}} + typ$ + {{Text|",0,"|#FFB100}} + e$ + {{Text|")..."|#FFB100}}
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
        {{Text|'Note: purevarname$ is simply varname$ without the type symbol after it|#31C4C4}}
        redimoption = {{Text|1|#F580B1}}
        retval = dim2(purevarname$, typ$, {{Text|0|#F580B1}}, e$)
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
        redimoption = {{Text|0|#F580B1}}
        {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"Finished calling DIM2("|#FFB100}} + purevarname$ + {{Text|","|#FFB100}} + typ$ + {{Text|",0,"|#FFB100}} + e$ + {{Text|")!"|#FFB100}}
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
        {{Text|IF|#F0F0F0}} command = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|'use get to load in the array data|#31C4C4}}
            varname$ = varname$ + sp + {{Text|"("|#FFB100}} + sp + {{Text|")"|#FFB100}}
            e$ = evaluatetotyp(fixoperationorder$(varname$), {{Text|-4|#F580B1}})
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            WriteBufLine MainTxtBuf, {{Text|"sub_get(FF,NULL,"|#FFB100}} + e$ + {{Text|",0);"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} command = {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}}
            WriteBufLine MainTxtBuf, {{Text|"bytei=0;"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"while(bytei<bytes){"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"sub_get(FF,NULL,byte_element((uint64)&int64val,8,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}} {{Text|'get size|#31C4C4}}
            WriteBufLine MainTxtBuf, {{Text|"tqbs=((qbs*)(((uint64*)("|#FFB100}} + n2$ + {{Text|"[0]))[bytei]));"|#FFB100}} {{Text|'get element|#31C4C4}}
            WriteBufLine MainTxtBuf, {{Text|"qbs_set(tqbs,qbs_new(int64val>>3,1));"|#FFB100}} {{Text|'change string size|#31C4C4}}
            WriteBufLine MainTxtBuf, {{Text|"sub_get(FF,NULL,byte_element((uint64)tqbs->chr,int64val>>3,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}} {{Text|'get size|#31C4C4}}
            WriteBufLine MainTxtBuf, {{Text|"bytei++;"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|'get next command|#31C4C4}}
        WriteBufLine MainTxtBuf, {{Text|"sub_get(FF,NULL,byte_element((uint64)&int32val,4,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}}
        WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}}
        WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}}
        {{Text|'save array|#31C4C4}}
        MainTxtBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + {{Text|"chain"|#FFB100}} + str2$(i) + {{Text|".txt"|#FFB100}})
        WriteBufLine MainTxtBuf, {{Text|"int32val=2;"|#FFB100}} {{Text|'placeholder|#31C4C4}}
        WriteBufLine MainTxtBuf, {{Text|"sub_put(FF,NULL,byte_element((uint64)&int32val,4,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}}
        WriteBufLine MainTxtBuf, {{Text|"if ("|#FFB100}} + n2$ + {{Text|"[2]&1){"|#FFB100}} {{Text|'don't add unless defined|#31C4C4}}
        {{Text|IF|#F0F0F0}} command = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, {{Text|"int32val=3;"|#FFB100}}
        {{Text|IF|#F0F0F0}} command = {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine MainTxtBuf, {{Text|"int32val=4;"|#FFB100}}
        WriteBufLine MainTxtBuf, {{Text|"sub_put(FF,NULL,byte_element((uint64)&int32val,4,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}}
        {{Text|IF|#F0F0F0}} command = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|'size of each element in bits|#31C4C4}}
            bits = t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
            {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}} bits = udtxsize(t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}})
            {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}} bits = tsize * {{Text|8|#F580B1}}
            WriteBufLine MainTxtBuf, {{Text|"int64val="|#FFB100}} + str2$(bits) + {{Text|";"|#FFB100}} {{Text|'size in bits|#31C4C4}}
            WriteBufLine MainTxtBuf, {{Text|"sub_put(FF,NULL,byte_element((uint64)&int64val,8,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'com=3|#31C4C4}}
        WriteBufLine MainTxtBuf, {{Text|"int32val="|#FFB100}} + str2$(arrayelements) + {{Text|";"|#FFB100}} {{Text|'number of dimensions|#31C4C4}}
        WriteBufLine MainTxtBuf, {{Text|"sub_put(FF,NULL,byte_element((uint64)&int32val,4,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}}
        {{Text|IF|#F0F0F0}} command = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|FOR|#F0F0F0}} x2 = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} arrayelements
                {{Text|'simulate calls to lbound/ubound|#31C4C4}}
                e$ = {{Text|"LBOUND"|#FFB100}} + sp + {{Text|"("|#FFB100}} + sp + n$ + sp + {{Text|","|#FFB100}} + sp + str2$(x2) + sp + {{Text|")"|#FFB100}}
                e$ = evaluatetotyp(fixoperationorder$(e$), {{Text|64|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                WriteBufLine MainTxtBuf, {{Text|"int64val="|#FFB100}} + e$ + {{Text|";"|#FFB100}}
                WriteBufLine MainTxtBuf, {{Text|"sub_put(FF,NULL,byte_element((uint64)&int64val,8,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}}
                e$ = {{Text|"UBOUND"|#FFB100}} + sp + {{Text|"("|#FFB100}} + sp + n$ + sp + {{Text|","|#FFB100}} + sp + str2$(x2) + sp + {{Text|")"|#FFB100}}
                e$ = evaluatetotyp(fixoperationorder$(e$), {{Text|64|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                WriteBufLine MainTxtBuf, {{Text|"int64val="|#FFB100}} + e$ + {{Text|";"|#FFB100}}
                WriteBufLine MainTxtBuf, {{Text|"sub_put(FF,NULL,byte_element((uint64)&int64val,8,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}}
            {{Text|NEXT|#F0F0F0}}
            {{Text|'array data|#31C4C4}}
            e$ = evaluatetotyp(fixoperationorder$(n$ + sp + {{Text|"("|#FFB100}} + sp + {{Text|")"|#FFB100}}), {{Text|-4|#F580B1}})
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
            WriteBufLine MainTxtBuf, {{Text|"sub_put(FF,NULL,"|#FFB100}} + e$ + {{Text|",0);"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'com=3|#31C4C4}}
        {{Text|IF|#F0F0F0}} command = {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|'store LBOUND/UBOUND values and calculate number of total elements/strings|#31C4C4}}
            WriteBufLine MainTxtBuf, {{Text|"bytes=1;"|#FFB100}} {{Text|'note: bytes is actually the total number of elements|#31C4C4}}
            {{Text|FOR|#F0F0F0}} x2 = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} arrayelements
                e$ = {{Text|"LBOUND"|#FFB100}} + sp + {{Text|"("|#FFB100}} + sp + n$ + sp + {{Text|","|#FFB100}} + sp + str2$(x2) + sp + {{Text|")"|#FFB100}}
                e$ = evaluatetotyp(fixoperationorder$(e$), {{Text|64|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                WriteBufLine MainTxtBuf, {{Text|"int64val="|#FFB100}} + e$ + {{Text|";"|#FFB100}}
                WriteBufLine MainTxtBuf, {{Text|"sub_put(FF,NULL,byte_element((uint64)&int64val,8,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}}
                e$ = {{Text|"UBOUND"|#FFB100}} + sp + {{Text|"("|#FFB100}} + sp + n$ + sp + {{Text|","|#FFB100}} + sp + str2$(x2) + sp + {{Text|")"|#FFB100}}
                e$ = evaluatetotyp(fixoperationorder$(e$), {{Text|64|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} errmes
                WriteBufLine MainTxtBuf, {{Text|"int64val2="|#FFB100}} + e$ + {{Text|";"|#FFB100}}
                WriteBufLine MainTxtBuf, {{Text|"sub_put(FF,NULL,byte_element((uint64)&int64val2,8,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}}
                WriteBufLine MainTxtBuf, {{Text|"bytes*=(int64val2-int64val+1);"|#FFB100}}
            {{Text|NEXT|#F0F0F0}}
            WriteBufLine MainTxtBuf, {{Text|"bytei=0;"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"while(bytei<bytes){"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"tqbs=((qbs*)(((uint64*)("|#FFB100}} + n2$ + {{Text|"[0]))[bytei]));"|#FFB100}} {{Text|'get element|#31C4C4}}
            WriteBufLine MainTxtBuf, {{Text|"int64val=tqbs->len; int64val<<=3;"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"sub_put(FF,NULL,byte_element((uint64)&int64val,8,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}} {{Text|'size of element|#31C4C4}}
            WriteBufLine MainTxtBuf, {{Text|"sub_put(FF,NULL,byte_element((uint64)tqbs->chr,tqbs->len,"|#FFB100}} + NewByteElement$ + {{Text|"),0);"|#FFB100}} {{Text|'element data|#31C4C4}}
            WriteBufLine MainTxtBuf, {{Text|"bytei++;"|#FFB100}}
            WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'com=4|#31C4C4}}
        WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}} {{Text|'don't add unless defined|#31C4C4}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'id.arrayelements=-1|#31C4C4}}
{{Text|NEXT|#F0F0F0}}
use_global_byte_elements = {{Text|0|#F580B1}}
{{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"Finished generation of code for saving/sharing common array data!"|#FFB100}}
{{Text|FOR|#F0F0F0}} closeall = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|255|#F580B1}}: {{Text|CLOSE|#F0F0F0}} closeall: {{Text|NEXT|#F0F0F0}}
{{Text|OPEN|#F0F0F0}} tmpdir$ + {{Text|"temp.bin"|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|OUTPUT|#F0F0F0}} {{Text|LOCK|#F0F0F0}} {{Text|WRITE|#F0F0F0}} {{Text|AS|#F0F0F0}} #26 {{Text|'relock|#31C4C4}}
compilelog$ = tmpdir$ + {{Text|"compilelog.txt"|#FFB100}}
{{Text|OPEN|#F0F0F0}} compilelog$ {{Text|FOR|#F0F0F0}} {{Text|OUTPUT|#F0F0F0}} {{Text|AS|#F0F0F0}} #1: {{Text|CLOSE|#F0F0F0}} #1 {{Text|'Clear log|#31C4C4}}
{{Text|IF|#F0F0F0}} idemode = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|NOT|#F0F0F0}} QuietMode {{Text|THEN|#F0F0F0}}
    {{Text|IF|#F0F0F0}} ConsoleMode {{Text|THEN|#F0F0F0}}
        {{Text|PRINT|#F0F0F0}} {{Text|"["|#FFB100}} + {{Text|STRING$|#F0F0F0}}(maxprogresswidth, {{Text|"."|#FFB100}}) + {{Text|"] 100%"|#FFB100}}
    {{Text|ELSE|#F0F0F0}}
        {{Text|LOCATE|#F0F0F0}} , {{Text|1|#F580B1}}
        {{Text|PRINT|#F0F0F0}} {{Text|STRING$|#F0F0F0}}(maxprogresswidth, {{Text|219|#F580B1}}) + {{Text|" 100%"|#FFB100}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}} {{Text|NOT|#F0F0F0}} IgnoreWarnings {{Text|THEN|#F0F0F0}}
    totalUnusedVariables = {{Text|0|#F580B1}}
    {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} totalVariablesCreated
        {{Text|IF|#F0F0F0}} usedVariableList(i).used = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            totalUnusedVariables = totalUnusedVariables + {{Text|1|#F580B1}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|NEXT|#F0F0F0}}
    {{Text|IF|#F0F0F0}} totalUnusedVariables > {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
        maxVarNameLen = {{Text|0|#F580B1}}
        {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} totalVariablesCreated
            {{Text|IF|#F0F0F0}} usedVariableList(i).used = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(usedVariableList(i).name) > maxVarNameLen {{Text|THEN|#F0F0F0}} maxVarNameLen = {{Text|LEN|#F0F0F0}}(usedVariableList(i).name)
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|NEXT|#F0F0F0}}
        header$ = {{Text|"unused variable"|#FFB100}} {{Text|'s (" + LTRIM$(STR$(totalUnusedVariables)) + ")"|#31C4C4}}
        {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} totalVariablesCreated
            {{Text|IF|#F0F0F0}} usedVariableList(i).used = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                addWarning usedVariableList(i).linenumber, usedVariableList(i).includeLevel, usedVariableList(i).includedLine, usedVariableList(i).includedFile, header$, usedVariableList(i).name + {{Text|SPACE$|#F0F0F0}}((maxVarNameLen + {{Text|1|#F580B1}}) - {{Text|LEN|#F0F0F0}}(usedVariableList(i).name)) + {{Text|"  "|#FFB100}} + usedVariableList(i).varType
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|NEXT|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}} idemode {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} ideret5
ide6:
{{Text|IF|#F0F0F0}} idemode = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} No_C_Compile_Mode = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
    {{Text|IF|#F0F0F0}} {{Text|NOT|#F0F0F0}} QuietMode {{Text|THEN|#F0F0F0}}
        {{Text|PRINT|#F0F0F0}}
        {{Text|IF|#F0F0F0}} os$ = {{Text|"LNX"|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|PRINT|#F0F0F0}} {{Text|"Compiling C++ code into executable..."|#FFB100}}
        {{Text|ELSE|#F0F0F0}}
            {{Text|PRINT|#F0F0F0}} {{Text|"Compiling C++ code into EXE..."|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|' Fixup the output path if either we got an `-o` argument, or we're relative to `_StartDir$`|#31C4C4}}
    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(outputfile_cmd$) {{Text|OR|#F0F0F0}} OutputIsRelativeToStartDir {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(outputfile_cmd$) {{Text|THEN|#F0F0F0}}
            {{Text|'resolve relative path for output file|#31C4C4}}
            path.out$ = getfilepath$(outputfile_cmd$)
            f$ = {{Text|MID$|#F0F0F0}}(outputfile_cmd$, {{Text|LEN|#F0F0F0}}(path.out$) + {{Text|1|#F580B1}})
            {{Text|IF|#F0F0F0}} {{Text|UCASE$|#F0F0F0}}(GetFileExtension$(f$)) = {{Text|"EXE"|#FFB100}} {{Text|THEN|#F0F0F0}}
                file$ = RemoveFileExtension$(f$)
            {{Text|ELSE|#F0F0F0}}
                file$ = f$
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(path.out$) {{Text|OR|#F0F0F0}} OutputIsRelativeToStartDir {{Text|THEN|#F0F0F0}}
            currentdir$ = {{Text|_CWD$|#F0F0F0}}
            {{Text|IF|#F0F0F0}} OutputIsRelativeToStartDir {{Text|THEN|#F0F0F0}}
                {{Text|' This CHDIR makes the next CHDIR relative to _STARTDIR$|#31C4C4}}
                {{Text|' We do this if the provided source file was also relative to _STARTDIR$|#31C4C4}}
                {{Text|CHDIR|#F0F0F0}} {{Text|_STARTDIR$|#F0F0F0}}
                {{Text|' If there was no provided path then that is the same as the|#31C4C4}}
                {{Text|' output file being directly in _STARTDIR$. Assigning it here|#31C4C4}}
                {{Text|' is perfectly fine and avoids failing the error check below|#31C4C4}}
                {{Text|' with a blank string.|#31C4C4}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(path.out$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    path.out$ = {{Text|_STARTDIR$|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} {{Text|_DIREXISTS|#F0F0F0}}(path.out$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|PRINT|#F0F0F0}}
                {{Text|PRINT|#F0F0F0}} {{Text|"Can't create output executable - path not found: "|#FFB100}} + path.out$
                {{Text|IF|#F0F0F0}} ConsoleMode {{Text|THEN|#F0F0F0}} {{Text|SYSTEM|#F0F0F0}} {{Text|1|#F580B1}}
                {{Text|END|#F0F0F0}} {{Text|1|#F580B1}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|CHDIR|#F0F0F0}} path.out$
            path.out$ = {{Text|_CWD$|#F0F0F0}}
            {{Text|CHDIR|#F0F0F0}} currentdir$
            {{Text|IF|#F0F0F0}} {{Text|RIGHT$|#F0F0F0}}(path.out$, {{Text|1|#F580B1}}) <> pathsep$ {{Text|THEN|#F0F0F0}} path.out$ = path.out$ + pathsep$
            path.exe$ = path.out$
            SaveExeWithSource = {{Text|-1|#F580B1}} {{Text|'Override the global setting if an output file was specified|#31C4C4}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    t.path.exe$ = path.exe$
    {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(path.exe$ + file$ + extension$) {{Text|THEN|#F0F0F0}}
        E = {{Text|0|#F580B1}}
        {{Text|ON|#F0F0F0}} {{Text|ERROR|#F0F0F0}} {{Text|GOTO|#F0F0F0}} qberror_test
        {{Text|KILL|#F0F0F0}} path.exe$ + file$ + extension$
        {{Text|ON|#F0F0F0}} {{Text|ERROR|#F0F0F0}} {{Text|GOTO|#F0F0F0}} qberror
        {{Text|IF|#F0F0F0}} E = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
            a$ = {{Text|"CANNOT CREATE "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + file$ + extension$ + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|" BECAUSE THE FILE IS ALREADY IN USE!"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    path.exe$ = t.path.exe$
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}} ExeIconSet {{Text|THEN|#F0F0F0}}
    linenumber = ExeIconSet {{Text|'on error, this allows reporting the linenumber where $EXEICON was used|#31C4C4}}
    wholeline = {{Text|" $EXEICON:'"|#FFB100}} + ExeIconFile$ + {{Text|"'"|#FFB100}}
    {{Text|' Copy icon file into temp directory with known name|#31C4C4}}
    {{Text|' This solves the problem of the resource file needing an absolute path|#31C4C4}}
    {{Text|ON|#F0F0F0}} {{Text|ERROR|#F0F0F0}} {{Text|GOTO|#F0F0F0}} qberror_test
    {{Text|DIM|#F0F0F0}} errNo {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
    errNo = CopyFile&(ExeIconFile$, tmpdir$ + {{Text|"icon.ico"|#FFB100}})
    {{Text|IF|#F0F0F0}} errNo <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Error copying "|#FFB100}} + QuotedFilename$(ExeIconFile$) + {{Text|" to temp directory"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
    {{Text|ON|#F0F0F0}} {{Text|ERROR|#F0F0F0}} {{Text|GOTO|#F0F0F0}} qberror
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}} VersionInfoSet {{Text|THEN|#F0F0F0}}
    ManiBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + file$ + extension$ + {{Text|".manifest"|#FFB100}})
    WriteBufLine ManiBuf, {{Text|"<?xml version="|#FFB100}} + AddQuotes$({{Text|"1.0"|#FFB100}}) + {{Text|" encoding="|#FFB100}} + AddQuotes$({{Text|"UTF-8"|#FFB100}}) + {{Text|" standalone="|#FFB100}} + AddQuotes$({{Text|"yes"|#FFB100}}) + {{Text|"?>"|#FFB100}}
    WriteBufLine ManiBuf, {{Text|"<assembly xmlns="|#FFB100}} + AddQuotes$({{Text|"urn:schemas-microsoft-com:asm.v1"|#FFB100}}) + {{Text|" manifestVersion="|#FFB100}} + AddQuotes$({{Text|"1.0"|#FFB100}}) + {{Text|">"|#FFB100}}
    WriteBufLine ManiBuf, {{Text|"<assemblyIdentity"|#FFB100}}
    WriteBufLine ManiBuf, {{Text|"    version="|#FFB100}} + AddQuotes$({{Text|"1.0.0.0"|#FFB100}})
    WriteBufLine ManiBuf, {{Text|"    processorArchitecture="|#FFB100}} + AddQuotes$({{Text|"*"|#FFB100}})
    WriteBufLine ManiBuf, {{Text|"    name="|#FFB100}} + AddQuotes$(viCompanyName$ + {{Text|"."|#FFB100}} + viProductName$ + {{Text|"."|#FFB100}} + viProductName$)
    WriteBufLine ManiBuf, {{Text|"    type="|#FFB100}} + AddQuotes$({{Text|"win32"|#FFB100}})
    WriteBufLine ManiBuf, {{Text|"/>"|#FFB100}}
    WriteBufLine ManiBuf, {{Text|"<description>"|#FFB100}} + viFileDescription$ + {{Text|"</description>"|#FFB100}}
    WriteBufLine ManiBuf, {{Text|"<dependency>"|#FFB100}}
    WriteBufLine ManiBuf, {{Text|"    <dependentAssembly>"|#FFB100}}
    WriteBufLine ManiBuf, {{Text|"        <assemblyIdentity"|#FFB100}}
    WriteBufLine ManiBuf, {{Text|"            type="|#FFB100}} + AddQuotes$({{Text|"win32"|#FFB100}})
    WriteBufLine ManiBuf, {{Text|"            name="|#FFB100}} + AddQuotes$({{Text|"Microsoft.Windows.Common-Controls"|#FFB100}})
    WriteBufLine ManiBuf, {{Text|"            version="|#FFB100}} + AddQuotes$({{Text|"6.0.0.0"|#FFB100}})
    WriteBufLine ManiBuf, {{Text|"            processorArchitecture="|#FFB100}} + AddQuotes$({{Text|"*"|#FFB100}})
    WriteBufLine ManiBuf, {{Text|"            publicKeyToken="|#FFB100}} + AddQuotes$({{Text|"6595b64144ccf1df"|#FFB100}})
    WriteBufLine ManiBuf, {{Text|"            language="|#FFB100}} + AddQuotes$({{Text|"*"|#FFB100}})
    WriteBufLine ManiBuf, {{Text|"        />"|#FFB100}}
    WriteBufLine ManiBuf, {{Text|"    </dependentAssembly>"|#FFB100}}
    WriteBufLine ManiBuf, {{Text|"</dependency>"|#FFB100}}
    WriteBufLine ManiBuf, {{Text|"</assembly>"|#FFB100}}
    ManiBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + {{Text|"manifest.h"|#FFB100}})
    WriteBufLine ManiBuf, {{Text|"#ifndef RESOURCE_H"|#FFB100}}
    WriteBufLine ManiBuf, {{Text|"#define  RESOURCE_H"|#FFB100}}
    WriteBufLine ManiBuf, {{Text|"#ifdef    __cplusplus"|#FFB100}}
    WriteBufLine ManiBuf, {{Text|"extern "|#FFB100}} + AddQuotes$({{Text|"C"|#FFB100}}) + {{Text|" {"|#FFB100}}
    WriteBufLine ManiBuf, {{Text|"#endif"|#FFB100}}
    WriteBufLine ManiBuf, {{Text|"#ifdef    __cplusplus"|#FFB100}}
    WriteBufLine ManiBuf, {{Text|"}"|#FFB100}}
    WriteBufLine ManiBuf, {{Text|"#endif"|#FFB100}}
    WriteBufLine ManiBuf, {{Text|"#endif    /* RESOURCE_H */"|#FFB100}}
    WriteBufLine ManiBuf, {{Text|"#define CREATEPROCESS_MANIFEST_RESOURCE_ID 1 /*Defined manifest file*/"|#FFB100}}
    WriteBufLine ManiBuf, {{Text|"#define RT_MANIFEST                      24"|#FFB100}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}} VersionInfoSet {{Text|OR|#F0F0F0}} ExeIconSet {{Text|THEN|#F0F0F0}}
    IconRcBuf = OpenBuffer%({{Text|"O"|#FFB100}}, tmpdir$ + {{Text|"icon.rc"|#FFB100}})
    {{Text|IF|#F0F0F0}} ExeIconSet {{Text|THEN|#F0F0F0}}
        WriteBufLine IconRcBuf, {{Text|"0 ICON "|#FFB100}} + AddQuotes$({{Text|"icon.ico"|#FFB100}})
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} VersionInfoSet {{Text|THEN|#F0F0F0}}
        WriteBufLine IconRcBuf, {{Text|""|#FFB100}}
        WriteBufLine IconRcBuf, {{Text|"#include "|#FFB100}} + AddQuotes$({{Text|"manifest.h"|#FFB100}})
        WriteBufLine IconRcBuf, {{Text|""|#FFB100}}
        WriteBufLine IconRcBuf, {{Text|"CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "|#FFB100}} + AddQuotes$(file$ + extension$ + {{Text|".manifest"|#FFB100}})
        WriteBufLine IconRcBuf, {{Text|""|#FFB100}}
        WriteBufLine IconRcBuf, {{Text|"1 VERSIONINFO"|#FFB100}}
        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(viFileVersionNum$) {{Text|THEN|#F0F0F0}} WriteBufLine IconRcBuf, {{Text|"FILEVERSION    "|#FFB100}} + viFileVersionNum$
        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(viProductVersionNum$) {{Text|THEN|#F0F0F0}} WriteBufLine IconRcBuf, {{Text|"PRODUCTVERSION  "|#FFB100}} + viProductVersionNum$
        WriteBufLine IconRcBuf, {{Text|"BEGIN"|#FFB100}}
        WriteBufLine IconRcBuf, {{Text|"    BLOCK "|#FFB100}} + AddQuotes$({{Text|"StringFileInfo"|#FFB100}})
        WriteBufLine IconRcBuf, {{Text|"    BEGIN"|#FFB100}}
        WriteBufLine IconRcBuf, {{Text|"        BLOCK "|#FFB100}} + AddQuotes$({{Text|"040904E4"|#FFB100}})
        WriteBufLine IconRcBuf, {{Text|"        BEGIN"|#FFB100}}
        WriteBufLine IconRcBuf, {{Text|"            VALUE "|#FFB100}} + AddQuotes$({{Text|"CompanyName"|#FFB100}}) + {{Text|","|#FFB100}} + AddQuotes$(viCompanyName$ + {{Text|"\0"|#FFB100}})
        WriteBufLine IconRcBuf, {{Text|"            VALUE "|#FFB100}} + AddQuotes$({{Text|"FileDescription"|#FFB100}}) + {{Text|","|#FFB100}} + AddQuotes$(viFileDescription$ + {{Text|"\0"|#FFB100}})
        WriteBufLine IconRcBuf, {{Text|"            VALUE "|#FFB100}} + AddQuotes$({{Text|"FileVersion"|#FFB100}}) + {{Text|","|#FFB100}} + AddQuotes$(viFileVersion$ + {{Text|"\0"|#FFB100}})
        WriteBufLine IconRcBuf, {{Text|"            VALUE "|#FFB100}} + AddQuotes$({{Text|"InternalName"|#FFB100}}) + {{Text|","|#FFB100}} + AddQuotes$(viInternalName$ + {{Text|"\0"|#FFB100}})
        WriteBufLine IconRcBuf, {{Text|"            VALUE "|#FFB100}} + AddQuotes$({{Text|"LegalCopyright"|#FFB100}}) + {{Text|","|#FFB100}} + AddQuotes$(viLegalCopyright$ + {{Text|"\0"|#FFB100}})
        WriteBufLine IconRcBuf, {{Text|"            VALUE "|#FFB100}} + AddQuotes$({{Text|"LegalTrademarks"|#FFB100}}) + {{Text|","|#FFB100}} + AddQuotes$(viLegalTrademarks$ + {{Text|"\0"|#FFB100}})
        WriteBufLine IconRcBuf, {{Text|"            VALUE "|#FFB100}} + AddQuotes$({{Text|"OriginalFilename"|#FFB100}}) + {{Text|","|#FFB100}} + AddQuotes$(viOriginalFilename$ + {{Text|"\0"|#FFB100}})
        WriteBufLine IconRcBuf, {{Text|"            VALUE "|#FFB100}} + AddQuotes$({{Text|"ProductName"|#FFB100}}) + {{Text|","|#FFB100}} + AddQuotes$(viProductName$ + {{Text|"\0"|#FFB100}})
        WriteBufLine IconRcBuf, {{Text|"            VALUE "|#FFB100}} + AddQuotes$({{Text|"ProductVersion"|#FFB100}}) + {{Text|","|#FFB100}} + AddQuotes$(viProductVersion$ + {{Text|"\0"|#FFB100}})
        WriteBufLine IconRcBuf, {{Text|"            VALUE "|#FFB100}} + AddQuotes$({{Text|"Comments"|#FFB100}}) + {{Text|","|#FFB100}} + AddQuotes$(viComments$ + {{Text|"\0"|#FFB100}})
        WriteBufLine IconRcBuf, {{Text|"            VALUE "|#FFB100}} + AddQuotes$({{Text|"Web"|#FFB100}}) + {{Text|","|#FFB100}} + AddQuotes$(viWeb$ + {{Text|"\0"|#FFB100}})
        WriteBufLine IconRcBuf, {{Text|"        END"|#FFB100}}
        WriteBufLine IconRcBuf, {{Text|"    END"|#FFB100}}
        WriteBufLine IconRcBuf, {{Text|"    BLOCK "|#FFB100}} + AddQuotes$({{Text|"VarFileInfo"|#FFB100}})
        WriteBufLine IconRcBuf, {{Text|"    BEGIN"|#FFB100}}
        WriteBufLine IconRcBuf, {{Text|"            VALUE "|#FFB100}} + AddQuotes$({{Text|"Translation"|#FFB100}}) + {{Text|", 0x409, 0x04E4"|#FFB100}}
        WriteBufLine IconRcBuf, {{Text|"    END"|#FFB100}}
        WriteBufLine IconRcBuf, {{Text|"END"|#FFB100}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|'Write out all buffered files, all remaining|#31C4C4}}
{{Text|'actions are performed on the disk based files|#31C4C4}}
WriteBuffers {{Text|""|#FFB100}}
{{Text|IF|#F0F0F0}} MidiSoundFontSet {{Text|THEN|#F0F0F0}}
    linenumber = MidiSoundFontSet
    wholeline = MidiSoundFontLine$
    {{Text|IF|#F0F0F0}} MidiSoundFont$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
        MidiSoundFont$ = {{Text|"internal/support/default_soundfont.sf2"|#FFB100}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|ON|#F0F0F0}} {{Text|ERROR|#F0F0F0}} {{Text|GOTO|#F0F0F0}} qberror_test
    errNo = CopyFile&(MidiSoundFont$, tmpdir$ + {{Text|"soundfont.sf2"|#FFB100}})
    {{Text|IF|#F0F0F0}} errNo <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Error copying "|#FFB100}} + QuotedFilename$(MidiSoundFont$) + {{Text|" to temp directory"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
    {{Text|ON|#F0F0F0}} {{Text|ERROR|#F0F0F0}} {{Text|GOTO|#F0F0F0}} qberror
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|'Update dependencies|#31C4C4}}
o$ = {{Text|LCASE$|#F0F0F0}}(os$)
win = {{Text|0|#F580B1}}: {{Text|IF|#F0F0F0}} os$ = {{Text|"WIN"|#FFB100}} {{Text|THEN|#F0F0F0}} win = {{Text|1|#F580B1}}
lnx = {{Text|0|#F580B1}}: {{Text|IF|#F0F0F0}} os$ = {{Text|"LNX"|#FFB100}} {{Text|THEN|#F0F0F0}} lnx = {{Text|1|#F580B1}}
mac = {{Text|0|#F580B1}}: {{Text|IF|#F0F0F0}} MacOSX {{Text|THEN|#F0F0F0}} mac = {{Text|1|#F580B1}}: o$ = {{Text|"osx"|#FFB100}}
ver$ = Version$ {{Text|'eg. "0.123"|#31C4C4}}
libs$ = {{Text|""|#FFB100}}
makedeps$ = {{Text|""|#FFB100}}
make$ = GetMakeExecutable$
localpath$ = {{Text|"internal\c\"|#FFB100}}
{{Text|IF|#F0F0F0}} DEPENDENCY(DEPENDENCY_GL) {{Text|THEN|#F0F0F0}} makedeps$ = makedeps$ + {{Text|" DEP_GL=y"|#FFB100}}
{{Text|IF|#F0F0F0}} DEPENDENCY(DEPENDENCY_SCREENIMAGE) {{Text|THEN|#F0F0F0}} makedeps$ = makedeps$ + {{Text|" DEP_SCREENIMAGE=y"|#FFB100}}
{{Text|IF|#F0F0F0}} DEPENDENCY(DEPENDENCY_IMAGE_CODEC) {{Text|THEN|#F0F0F0}} makedeps$ = makedeps$ + {{Text|" DEP_IMAGE_CODEC=y"|#FFB100}}
{{Text|IF|#F0F0F0}} DEPENDENCY(DEPENDENCY_CONSOLE_ONLY) {{Text|THEN|#F0F0F0}} makedeps$ = makedeps$ + {{Text|" DEP_CONSOLE_ONLY=y"|#FFB100}}
{{Text|IF|#F0F0F0}} DEPENDENCY(DEPENDENCY_SOCKETS) {{Text|THEN|#F0F0F0}} makedeps$ = makedeps$ + {{Text|" DEP_SOCKETS=y"|#FFB100}}
{{Text|IF|#F0F0F0}} DEPENDENCY(DEPENDENCY_PRINTER) {{Text|THEN|#F0F0F0}} makedeps$ = makedeps$ + {{Text|" DEP_PRINTER=y"|#FFB100}}
{{Text|IF|#F0F0F0}} DEPENDENCY(DEPENDENCY_ICON) {{Text|THEN|#F0F0F0}} makedeps$ = makedeps$ + {{Text|" DEP_ICON=y"|#FFB100}}
{{Text|IF|#F0F0F0}} DEPENDENCY(DEPENDENCY_SCREENIMAGE) {{Text|THEN|#F0F0F0}} makedeps$ = makedeps$ + {{Text|" DEP_SCREENIMAGE=y"|#FFB100}}
{{Text|IF|#F0F0F0}} DEPENDENCY(DEPENDENCY_LOADFONT) {{Text|THEN|#F0F0F0}} makedeps$ = makedeps$ + {{Text|" DEP_FONT=y"|#FFB100}}
{{Text|IF|#F0F0F0}} DEPENDENCY(DEPENDENCY_DEVICEINPUT) {{Text|THEN|#F0F0F0}} makedeps$ = makedeps$ + {{Text|" DEP_DEVICEINPUT=y"|#FFB100}}
{{Text|IF|#F0F0F0}} DEPENDENCY(DEPENDENCY_ZLIB) {{Text|THEN|#F0F0F0}} makedeps$ = makedeps$ + {{Text|" DEP_ZLIB=y"|#FFB100}}
{{Text|IF|#F0F0F0}} inline_DATA = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} DataOffset {{Text|THEN|#F0F0F0}} makedeps$ = makedeps$ + {{Text|" DEP_DATA=y"|#FFB100}}
{{Text|IF|#F0F0F0}}{{Text|_Console|#F0F0F0}} {{Text|THEN|#F0F0F0}} makedeps$ = makedeps$ + {{Text|" DEP_CONSOLE=y"|#FFB100}}
{{Text|IF|#F0F0F0}} ExeIconSet {{Text|OR|#F0F0F0}} VersionInfoSet {{Text|THEN|#F0F0F0}} makedeps$ = makedeps$ + {{Text|" DEP_ICON_RC=y"|#FFB100}}
{{Text|IF|#F0F0F0}} {{Text|NOT|#F0F0F0}} UseMiniaudioBackend {{Text|THEN|#F0F0F0}}
    {{Text|IF|#F0F0F0}} DEPENDENCY(DEPENDENCY_AUDIO_DECODE) {{Text|THEN|#F0F0F0}} makedeps$ = makedeps$ + {{Text|" DEP_AUDIO_DECODE=y"|#FFB100}}
    {{Text|IF|#F0F0F0}} DEPENDENCY(DEPENDENCY_AUDIO_CONVERSION) {{Text|THEN|#F0F0F0}} makedeps$ = makedeps$ + {{Text|" DEP_AUDIO_CONVERSION=y"|#FFB100}}
    {{Text|IF|#F0F0F0}} DEPENDENCY(DEPENDENCY_AUDIO_OUT) {{Text|THEN|#F0F0F0}} makedeps$ = makedeps$ + {{Text|" DEP_AUDIO_OUT=y"|#FFB100}}
{{Text|ELSE|#F0F0F0}}
    {{Text|IF|#F0F0F0}} DEPENDENCY(DEPENDENCY_AUDIO_DECODE) {{Text|OR|#F0F0F0}} DEPENDENCY(DEPENDENCY_AUDIO_CONVERSION) {{Text|OR|#F0F0F0}} DEPENDENCY(DEPENDENCY_AUDIO_OUT) {{Text|THEN|#F0F0F0}}
        makedeps$ = makedeps$ + {{Text|" DEP_AUDIO_MINIAUDIO=y"|#FFB100}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}} unstableFlags(UNSTABLE_HTTP) {{Text|AND|#F0F0F0}} DEPENDENCY(DEPENDENCY_SOCKETS) <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
    makedeps$ = makedeps$ + {{Text|" DEP_HTTP=y"|#FFB100}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}} MidiSoundFontSet {{Text|THEN|#F0F0F0}} makedeps$ = makedeps$ + {{Text|" DEP_AUDIO_DECODE_MIDI=y"|#FFB100}}
{{Text|IF|#F0F0F0}} tempfolderindex > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} makedeps$ = makedeps$ + {{Text|" TEMP_ID="|#FFB100}} + str2$(tempfolderindex)
CxxFlagsExtra$ = ExtraCppFlags
CxxLibsExtra$ = ExtraLinkerFlags
{{Text|' If debugging then use `-Og` rather than `-O2`|#31C4C4}}
{{Text|IF|#F0F0F0}} OptimizeCppProgram {{Text|THEN|#F0F0F0}}
    {{Text|IF|#F0F0F0}} Include_GDB_Debugging_Info {{Text|THEN|#F0F0F0}}
        CxxFlagsExtra$ = CxxFlagsExtra$ + {{Text|" -Og"|#FFB100}}
    {{Text|ELSE|#F0F0F0}}
        CxxFlagsExtra$ = CxxFlagsExtra$ + {{Text|" -O2"|#FFB100}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|ELSE|#F0F0F0}}
    {{Text|IF|#F0F0F0}} Include_GDB_Debugging_Info {{Text|THEN|#F0F0F0}}
        CxxFlagsExtra$ = CxxFlagsExtra$ + {{Text|" -g"|#FFB100}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
CxxLibsExtra$ = CxxLibsExtra$ + {{Text|" "|#FFB100}} + mylib$ + {{Text|" "|#FFB100}} + mylibopt$
{{Text|' Make and the shell don't like certain characters in the file name, so we|#31C4C4}}
{{Text|' escape them to get them to handle them properly|#31C4C4}}
escapedExe$ = StrReplace$(path.exe$ + file$ + extension$, {{Text|" "|#FFB100}}, {{Text|"\ "|#FFB100}})
escapedExe$ = StrReplace$(escapedExe$, {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}), {{Text|"\"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}))
escapedExe$ = StrReplace$(escapedExe$, {{Text|"$"|#FFB100}}, {{Text|"$$"|#FFB100}})
makeline$ = make$ + makedeps$ + {{Text|" EXE="|#FFB100}} + AddQuotes$(escapedExe$)
makeline$ = makeline$ + {{Text|" "|#FFB100}} + AddQuotes$({{Text|"CXXFLAGS_EXTRA="|#FFB100}} + CxxFlagsExtra$)
makeline$ = makeline$ + {{Text|" "|#FFB100}} + AddQuotes$({{Text|"CFLAGS_EXTRA="|#FFB100}} + CxxFlagsExtra$)
makeline$ = makeline$ + {{Text|" "|#FFB100}} + AddQuotes$({{Text|"CXXLIBS_EXTRA="|#FFB100}} + CxxLibsExtra$)
makeline$ = makeline$ + {{Text|" -j"|#FFB100}} + AddQuotes$(str2$(MaxParallelProcesses))
{{Text|IF|#F0F0F0}} {{Text|NOT|#F0F0F0}} StripDebugSymbols {{Text|THEN|#F0F0F0}}
    makeline$ = makeline$ + {{Text|" STRIP_SYMBOLS=n"|#FFB100}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|' We avoid generating the license file if the user picked the "No Exe" option|#31C4C4}}
{{Text|IF|#F0F0F0}} GenerateLicenseFile {{Text|AND|#F0F0F0}} {{Text|NOT|#F0F0F0}} NoExeSaved {{Text|THEN|#F0F0F0}}
    makeline$ = makeline$ + {{Text|" GENERATE_LICENSE=y"|#FFB100}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|'Clear nm output from previous runs|#31C4C4}}
{{Text|FOR|#F0F0F0}} x = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} ResolveStaticFunctions
    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(ResolveStaticFunction_File(x)) {{Text|THEN|#F0F0F0}}
        s$ = MakeNMOutputFilename$(ResolveStaticFunction_File(x), {{Text|0|#F580B1}})
        {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(s$) {{Text|THEN|#F0F0F0}} {{Text|KILL|#F0F0F0}} s$: ClearBuffers s$
        s$ = MakeNMOutputFilename$(ResolveStaticFunction_File(x), {{Text|1|#F580B1}})
        {{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(s$) {{Text|THEN|#F0F0F0}} {{Text|KILL|#F0F0F0}} s$: ClearBuffers s$
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|NEXT|#F0F0F0}} x
{{Text|' Delete existing qbx.o file, it ensures that it always gets rebuilt|#31C4C4}}
{{Text|ON|#F0F0F0}} {{Text|ERROR|#F0F0F0}} {{Text|GOTO|#F0F0F0}} qberror_test
{{Text|IF|#F0F0F0}} tempfolderindex > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
    {{Text|KILL|#F0F0F0}} {{Text|"internal/c/qbx"|#FFB100}} + str2$(tempfolderindex) + {{Text|".o"|#FFB100}}
{{Text|ELSE|#F0F0F0}}
    {{Text|KILL|#F0F0F0}} {{Text|"internal/c/qbx.o"|#FFB100}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|ON|#F0F0F0}} {{Text|ERROR|#F0F0F0}} {{Text|GOTO|#F0F0F0}} qberror
{{Text|IF|#F0F0F0}} os$ = {{Text|"WIN"|#FFB100}} {{Text|THEN|#F0F0F0}}
    makeline$ = makeline$ + {{Text|" OS=win"|#FFB100}}
    {{Text|'resolve static function definitions and add to global.txt|#31C4C4}}
    {{Text|FOR|#F0F0F0}} x = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} ResolveStaticFunctions
        nm_output_file$ = MakeNMOutputFilename$(ResolveStaticFunction_File(x), {{Text|0|#F580B1}})
        nm_output_file_dynamic$ = MakeNMOutputFilename$(ResolveStaticFunction_File(x), {{Text|1|#F580B1}})
        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(ResolveStaticFunction_File(x)) {{Text|THEN|#F0F0F0}}
            n = {{Text|0|#F580B1}}
            {{Text|IF|#F0F0F0}} {{Text|NOT|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(nm_output_file$) {{Text|THEN|#F0F0F0}}
                {{Text|SHELL|#F0F0F0}} {{Text|_HIDE|#F0F0F0}} {{Text|"cmd /c internal\c\c_compiler\bin\nm.exe "|#FFB100}} + AddQuotes$(ResolveStaticFunction_File(x)) + {{Text|" --demangle -g >"|#FFB100}} + AddQuotes$(nm_output_file$)
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            s$ = {{Text|" "|#FFB100}} + ResolveStaticFunction_Name(x) + {{Text|"("|#FFB100}}
            fh = OpenBuffer%({{Text|"I"|#FFB100}}, nm_output_file$)
            {{Text|DO|#F0F0F0}} {{Text|UNTIL|#F0F0F0}} EndOfBuf%(fh)
                a$ = ReadBufLine$(fh)
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(a$) {{Text|THEN|#F0F0F0}}
                    {{Text|'search for SPACE+functionname+LEFTBRACKET|#31C4C4}}
                    x1 = {{Text|INSTR|#F0F0F0}}(a$, s$)
                    {{Text|IF|#F0F0F0}} x1 {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} ResolveStaticFunction_Method(x) = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                            x1 = x1 + {{Text|1|#F580B1}}
                            x2 = {{Text|INSTR|#F0F0F0}}(x1, a$, {{Text|")"|#FFB100}})
                            fh2 = {{Text|FREEFILE|#F0F0F0}}
                            {{Text|OPEN|#F0F0F0}} tmpdir$ + {{Text|"global.txt"|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|APPEND|#F0F0F0}} {{Text|AS|#F0F0F0}} #fh2
                            {{Text|PRINT|#F0F0F0}} #fh2, {{Text|"extern void "|#FFB100}} + {{Text|MID$|#F0F0F0}}(a$, x1, x2 - x1 + {{Text|1|#F580B1}}) + {{Text|";"|#FFB100}}
                            {{Text|CLOSE|#F0F0F0}} #fh2
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        n = n + {{Text|1|#F580B1}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'x1|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'<>""|#31C4C4}}
            {{Text|LOOP|#F0F0F0}}
            {{Text|IF|#F0F0F0}} n > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Unable to resolve multiple instances of sub/function '"|#FFB100}} + ResolveStaticFunction_Name(x) + {{Text|"' in '"|#FFB100}} + ResolveStaticFunction_File(x) + {{Text|"'"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|IF|#F0F0F0}} n = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'attempt to locate simple function name without brackets|#31C4C4}}
                s$ = {{Text|" "|#FFB100}} + ResolveStaticFunction_Name(x)
                fh = OpenBuffer%({{Text|"I"|#FFB100}}, nm_output_file$)
                {{Text|DO|#F0F0F0}} {{Text|UNTIL|#F0F0F0}} EndOfBuf%(fh)
                    a$ = ReadBufLine$(fh)
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(a$) {{Text|THEN|#F0F0F0}}
                        {{Text|'search for SPACE+functionname|#31C4C4}}
                        x1 = {{Text|INSTR|#F0F0F0}}(a$, s$)
                        {{Text|IF|#F0F0F0}} {{Text|RIGHT$|#F0F0F0}}(a$, {{Text|LEN|#F0F0F0}}(s$)) = s$ {{Text|THEN|#F0F0F0}}
                            fh2 = {{Text|FREEFILE|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} ResolveStaticFunction_Method(x) = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                                {{Text|OPEN|#F0F0F0}} tmpdir$ + {{Text|"global.txt"|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|APPEND|#F0F0F0}} {{Text|AS|#F0F0F0}} #fh2
                                {{Text|PRINT|#F0F0F0}} #fh2, {{Text|"extern "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"C"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"{"|#FFB100}}
                                {{Text|PRINT|#F0F0F0}} #fh2, {{Text|"extern void "|#FFB100}} + s$ + {{Text|"(void);"|#FFB100}}
                                {{Text|PRINT|#F0F0F0}} #fh2, {{Text|"}"|#FFB100}}
                            {{Text|ELSE|#F0F0F0}}
                                {{Text|OPEN|#F0F0F0}} tmpdir$ + {{Text|"externtype"|#FFB100}} + str2(x) + {{Text|".txt"|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|OUTPUT|#F0F0F0}} {{Text|AS|#F0F0F0}} #fh2
                                {{Text|PRINT|#F0F0F0}} #fh2, {{Text|"extern "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"C"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|" "|#FFB100}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|CLOSE|#F0F0F0}} #fh2
                            n = n + {{Text|1|#F580B1}}
                            {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'x1|#31C4C4}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'<>""|#31C4C4}}
                {{Text|LOOP|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} n = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'a C++ dynamic object library?|#31C4C4}}
                {{Text|IF|#F0F0F0}} {{Text|NOT|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(nm_output_file_dynamic$) {{Text|THEN|#F0F0F0}}
                    {{Text|SHELL|#F0F0F0}} {{Text|_HIDE|#F0F0F0}} {{Text|"cmd /c internal\c\c_compiler\bin\nm.exe "|#FFB100}} + AddQuotes$(ResolveStaticFunction_File(x)) + {{Text|" -D --demangle -g >"|#FFB100}} + AddQuotes$(nm_output_file_dynamic$)
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                s$ = {{Text|" "|#FFB100}} + ResolveStaticFunction_Name(x) + {{Text|"("|#FFB100}}
                fh = OpenBuffer%({{Text|"I"|#FFB100}}, nm_output_file$)
                {{Text|DO|#F0F0F0}} {{Text|UNTIL|#F0F0F0}} EndOfBuf%(fh)
                    a$ = ReadBufLine$(fh)
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(a$) {{Text|THEN|#F0F0F0}}
                        {{Text|'search for SPACE+functionname+LEFTBRACKET|#31C4C4}}
                        x1 = {{Text|INSTR|#F0F0F0}}(a$, s$)
                        {{Text|IF|#F0F0F0}} x1 {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} ResolveStaticFunction_Method(x) = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                                x1 = x1 + {{Text|1|#F580B1}}
                                x2 = {{Text|INSTR|#F0F0F0}}(x1, a$, {{Text|")"|#FFB100}})
                                fh2 = {{Text|FREEFILE|#F0F0F0}}
                                {{Text|OPEN|#F0F0F0}} tmpdir$ + {{Text|"global.txt"|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|APPEND|#F0F0F0}} {{Text|AS|#F0F0F0}} #fh2
                                {{Text|PRINT|#F0F0F0}} #fh2, {{Text|"extern void "|#FFB100}} + {{Text|MID$|#F0F0F0}}(a$, x1, x2 - x1 + {{Text|1|#F580B1}}) + {{Text|";"|#FFB100}}
                                {{Text|CLOSE|#F0F0F0}} #fh2
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            n = n + {{Text|1|#F580B1}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'x1|#31C4C4}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'<>""|#31C4C4}}
                {{Text|LOOP|#F0F0F0}}
                {{Text|IF|#F0F0F0}} n > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Unable to resolve multiple instances of sub/function '"|#FFB100}} + ResolveStaticFunction_Name(x) + {{Text|"' in '"|#FFB100}} + ResolveStaticFunction_File(x) + {{Text|"'"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} n = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'a C dynamic object library?|#31C4C4}}
                s$ = {{Text|" "|#FFB100}} + ResolveStaticFunction_Name(x)
                fh = OpenBuffer%({{Text|"I"|#FFB100}}, nm_output_file_dynamic$)
                {{Text|DO|#F0F0F0}} {{Text|UNTIL|#F0F0F0}} EndOfBuf%(fh)
                    a$ = ReadBufLine$(fh)
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(a$) {{Text|THEN|#F0F0F0}}
                        {{Text|'search for SPACE+functionname|#31C4C4}}
                        x1 = {{Text|INSTR|#F0F0F0}}(a$, s$)
                        {{Text|IF|#F0F0F0}} {{Text|RIGHT$|#F0F0F0}}(a$, {{Text|LEN|#F0F0F0}}(s$)) = s$ {{Text|THEN|#F0F0F0}}
                            fh2 = {{Text|FREEFILE|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} ResolveStaticFunction_Method(x) = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                                {{Text|OPEN|#F0F0F0}} tmpdir$ + {{Text|"global.txt"|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|APPEND|#F0F0F0}} {{Text|AS|#F0F0F0}} #fh2
                                {{Text|PRINT|#F0F0F0}} #fh2, {{Text|"extern "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"C"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"{"|#FFB100}}
                                {{Text|PRINT|#F0F0F0}} #fh2, {{Text|"extern void "|#FFB100}} + s$ + {{Text|"(void);"|#FFB100}}
                                {{Text|PRINT|#F0F0F0}} #fh2, {{Text|"}"|#FFB100}}
                            {{Text|ELSE|#F0F0F0}}
                                {{Text|OPEN|#F0F0F0}} tmpdir$ + {{Text|"externtype"|#FFB100}} + str2(x) + {{Text|".txt"|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|OUTPUT|#F0F0F0}} {{Text|AS|#F0F0F0}} #fh2
                                {{Text|PRINT|#F0F0F0}} #fh2, {{Text|"extern "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"C"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|" "|#FFB100}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|CLOSE|#F0F0F0}} #fh2
                            n = n + {{Text|1|#F580B1}}
                            {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'x1|#31C4C4}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'<>""|#31C4C4}}
                {{Text|LOOP|#F0F0F0}}
                {{Text|IF|#F0F0F0}} n = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Could not find sub/function '"|#FFB100}} + ResolveStaticFunction_Name(x) + {{Text|"' in '"|#FFB100}} + ResolveStaticFunction_File(x) + {{Text|"'"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|NEXT|#F0F0F0}}
    {{Text|IF|#F0F0F0}} No_C_Compile_Mode = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|SHELL|#F0F0F0}} {{Text|_HIDE|#F0F0F0}} {{Text|"cmd /c "|#FFB100}} + makeline$ + {{Text|" 1>> "|#FFB100}} + compilelog$ + {{Text|" 2>&1"|#FFB100}}
        {{Text|IF|#F0F0F0}} idemode {{Text|THEN|#F0F0F0}}
            {{Text|'Restore fg/bg colors|#31C4C4}}
            dummy = DarkenFGBG({{Text|0|#F580B1}})
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    ffh = {{Text|FREEFILE|#F0F0F0}}
    {{Text|OPEN|#F0F0F0}} tmpdir$ + {{Text|"debug_win.bat"|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|OUTPUT|#F0F0F0}} {{Text|AS|#F0F0F0}} #ffh
    {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"@echo off"|#FFB100}}
    {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"cd %0\..\"|#FFB100}}
    {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"cd ../.."|#FFB100}}
    {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"echo C++ Debugging: "|#FFB100}} + file$ + extension$ + {{Text|" using gdb.exe"|#FFB100}}
    {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"echo Debugger commands:"|#FFB100}}
    {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"echo After the debugger launches type 'run' to start your program"|#FFB100}}
    {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"echo After your program crashes type 'list' to find where the problem is and fix/report it"|#FFB100}}
    {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"echo Type 'quit' to exit"|#FFB100}}
    {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"echo (the GDB debugger has many other useful commands, this advice is for beginners)"|#FFB100}}
    {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"pause"|#FFB100}}
    {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"internal\c\c_compiler\bin\gdb.exe "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + path.exe$ + file$ + extension$ + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}})
    {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"pause"|#FFB100}}
    {{Text|CLOSE|#F0F0F0}} ffh
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}} os$ = {{Text|"LNX"|#FFB100}} {{Text|THEN|#F0F0F0}}
    {{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}({{Text|_OS$|#F0F0F0}}, {{Text|"[MACOSX]"|#FFB100}}) {{Text|THEN|#F0F0F0}}
        makeline$ = makeline$ + {{Text|" OS=osx"|#FFB100}}
    {{Text|ELSE|#F0F0F0}}
        makeline$ = makeline$ + {{Text|" OS=lnx"|#FFB100}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|FOR|#F0F0F0}} x = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} ResolveStaticFunctions
        nm_output_file$ = MakeNMOutputFilename$(ResolveStaticFunction_File(x), {{Text|0|#F580B1}})
        nm_output_file_dynamic$ = MakeNMOutputFilename$(ResolveStaticFunction_File(x), {{Text|1|#F580B1}})
        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(ResolveStaticFunction_File(x)) {{Text|THEN|#F0F0F0}}
            n = {{Text|0|#F580B1}}
            {{Text|IF|#F0F0F0}} {{Text|NOT|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(nm_output_file$) {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} MacOSX = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|SHELL|#F0F0F0}} {{Text|_HIDE|#F0F0F0}} {{Text|"nm "|#FFB100}} + AddQuotes$(ResolveStaticFunction_File(x)) + {{Text|" --demangle -g >"|#FFB100}} + AddQuotes$(nm_output_file$) + {{Text|" 2>"|#FFB100}} + AddQuotes$(tmpdir$ + {{Text|"nm_error.txt"|#FFB100}})
                {{Text|IF|#F0F0F0}} MacOSX {{Text|THEN|#F0F0F0}} {{Text|SHELL|#F0F0F0}} {{Text|_HIDE|#F0F0F0}} {{Text|"nm "|#FFB100}} + AddQuotes$(ResolveStaticFunction_File(x)) + {{Text|" >"|#FFB100}} + AddQuotes$(nm_output_file$) + {{Text|" 2>"|#FFB100}} + AddQuotes$(tmpdir$ + {{Text|"nm_error.txt"|#FFB100}})
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} MacOSX = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'C++ name demangling not supported in MacOSX|#31C4C4}}
                s$ = {{Text|" "|#FFB100}} + ResolveStaticFunction_Name(x) + {{Text|"("|#FFB100}}
                fh = OpenBuffer%({{Text|"I"|#FFB100}}, nm_output_file$)
                {{Text|DO|#F0F0F0}} {{Text|UNTIL|#F0F0F0}} EndOfBuf%(fh)
                    a$ = ReadBufLine$(fh)
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(a$) {{Text|THEN|#F0F0F0}}
                        {{Text|'search for SPACE+functionname+LEFTBRACKET|#31C4C4}}
                        x1 = {{Text|INSTR|#F0F0F0}}(a$, s$)
                        {{Text|IF|#F0F0F0}} x1 {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} ResolveStaticFunction_Method(x) = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                                x1 = x1 + {{Text|1|#F580B1}}
                                x2 = {{Text|INSTR|#F0F0F0}}(x1, a$, {{Text|")"|#FFB100}})
                                fh2 = {{Text|FREEFILE|#F0F0F0}}
                                {{Text|OPEN|#F0F0F0}} tmpdir$ + {{Text|"global.txt"|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|APPEND|#F0F0F0}} {{Text|AS|#F0F0F0}} #fh2
                                {{Text|PRINT|#F0F0F0}} #fh2, {{Text|"extern void "|#FFB100}} + {{Text|MID$|#F0F0F0}}(a$, x1, x2 - x1 + {{Text|1|#F580B1}}) + {{Text|";"|#FFB100}}
                                {{Text|CLOSE|#F0F0F0}} #fh2
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            n = n + {{Text|1|#F580B1}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'x1|#31C4C4}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'<>""|#31C4C4}}
                {{Text|LOOP|#F0F0F0}}
                {{Text|IF|#F0F0F0}} n > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Unable to resolve multiple instances of sub/function '"|#FFB100}} + ResolveStaticFunction_Name(x) + {{Text|"' in '"|#FFB100}} + ResolveStaticFunction_File(x) + {{Text|"'"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'macosx=0|#31C4C4}}
            {{Text|IF|#F0F0F0}} n = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'attempt to locate simple function name without brackets|#31C4C4}}
                s$ = {{Text|" "|#FFB100}} + ResolveStaticFunction_Name(x): s2$ = s$
                {{Text|IF|#F0F0F0}} MacOSX {{Text|THEN|#F0F0F0}} s$ = {{Text|" _"|#FFB100}} + ResolveStaticFunction_Name(x) {{Text|'search for C mangled name|#31C4C4}}
                fh = OpenBuffer%({{Text|"I"|#FFB100}}, nm_output_file$)
                {{Text|DO|#F0F0F0}} {{Text|UNTIL|#F0F0F0}} EndOfBuf%(fh)
                    a$ = ReadBufLine$(fh)
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(a$) {{Text|THEN|#F0F0F0}}
                        {{Text|'search for SPACE+functionname|#31C4C4}}
                        x1 = {{Text|INSTR|#F0F0F0}}(a$, s$)
                        {{Text|IF|#F0F0F0}} {{Text|RIGHT$|#F0F0F0}}(a$, {{Text|LEN|#F0F0F0}}(s$)) = s$ {{Text|THEN|#F0F0F0}}
                            fh2 = {{Text|FREEFILE|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} ResolveStaticFunction_Method(x) = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                                {{Text|OPEN|#F0F0F0}} tmpdir$ + {{Text|"global.txt"|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|APPEND|#F0F0F0}} {{Text|AS|#F0F0F0}} #fh2
                                {{Text|PRINT|#F0F0F0}} #fh2, {{Text|"extern "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"C"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"{"|#FFB100}}
                                {{Text|PRINT|#F0F0F0}} #fh2, {{Text|"extern void "|#FFB100}} + s2$ + {{Text|"(void);"|#FFB100}}
                                {{Text|PRINT|#F0F0F0}} #fh2, {{Text|"}"|#FFB100}}
                            {{Text|ELSE|#F0F0F0}}
                                {{Text|OPEN|#F0F0F0}} tmpdir$ + {{Text|"externtype"|#FFB100}} + str2(x) + {{Text|".txt"|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|OUTPUT|#F0F0F0}} {{Text|AS|#F0F0F0}} #fh2
                                {{Text|PRINT|#F0F0F0}} #fh2, {{Text|"extern "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"C"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|" "|#FFB100}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|CLOSE|#F0F0F0}} #fh2
                            n = n + {{Text|1|#F580B1}}
                            {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'x1|#31C4C4}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'<>""|#31C4C4}}
                {{Text|LOOP|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} n = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'a C++ dynamic object library?|#31C4C4}}
                {{Text|IF|#F0F0F0}} MacOSX {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} macosx_libfind_failed
                {{Text|IF|#F0F0F0}} {{Text|NOT|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(nm_output_file_dynamic$) {{Text|THEN|#F0F0F0}}
                    {{Text|SHELL|#F0F0F0}} {{Text|_HIDE|#F0F0F0}} {{Text|"nm "|#FFB100}} + AddQuotes$(ResolveStaticFunction_File(x)) + {{Text|" -D --demangle -g >"|#FFB100}} + AddQuotes$(nm_output_file_dynamic$) + {{Text|" 2>"|#FFB100}} + AddQuotes$(tmpdir$ + {{Text|"nm_error.txt"|#FFB100}})
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                s$ = {{Text|" "|#FFB100}} + ResolveStaticFunction_Name(x) + {{Text|"("|#FFB100}}
                fh = OpenBuffer%({{Text|"I"|#FFB100}}, nm_output_file$)
                {{Text|DO|#F0F0F0}} {{Text|UNTIL|#F0F0F0}} EndOfBuf%(fh)
                    a$ = ReadBufLine$(fh)
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(a$) {{Text|THEN|#F0F0F0}}
                        {{Text|'search for SPACE+functionname+LEFTBRACKET|#31C4C4}}
                        x1 = {{Text|INSTR|#F0F0F0}}(a$, s$)
                        {{Text|IF|#F0F0F0}} x1 {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} ResolveStaticFunction_Method(x) = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                                x1 = x1 + {{Text|1|#F580B1}}
                                x2 = {{Text|INSTR|#F0F0F0}}(x1, a$, {{Text|")"|#FFB100}})
                                fh2 = {{Text|FREEFILE|#F0F0F0}}
                                {{Text|OPEN|#F0F0F0}} tmpdir$ + {{Text|"global.txt"|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|APPEND|#F0F0F0}} {{Text|AS|#F0F0F0}} #fh2
                                {{Text|PRINT|#F0F0F0}} #fh2, {{Text|"extern void "|#FFB100}} + {{Text|MID$|#F0F0F0}}(a$, x1, x2 - x1 + {{Text|1|#F580B1}}) + {{Text|";"|#FFB100}}
                                {{Text|CLOSE|#F0F0F0}} #fh2
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            n = n + {{Text|1|#F580B1}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'x1|#31C4C4}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'<>""|#31C4C4}}
                {{Text|LOOP|#F0F0F0}}
                {{Text|IF|#F0F0F0}} n > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Unable to resolve multiple instances of sub/function '"|#FFB100}} + ResolveStaticFunction_Name(x) + {{Text|"' in '"|#FFB100}} + ResolveStaticFunction_File(x) + {{Text|"'"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} n = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'a C dynamic object library?|#31C4C4}}
                s$ = {{Text|" "|#FFB100}} + ResolveStaticFunction_Name(x)
                fh = OpenBuffer%({{Text|"I"|#FFB100}}, nm_output_file_dynamic$)
                {{Text|DO|#F0F0F0}} {{Text|UNTIL|#F0F0F0}} EndOfBuf%(fh)
                    a$ = ReadBufLine$(fh)
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(a$) {{Text|THEN|#F0F0F0}}
                        {{Text|'search for SPACE+functionname|#31C4C4}}
                        x1 = {{Text|INSTR|#F0F0F0}}(a$, s$)
                        {{Text|IF|#F0F0F0}} {{Text|RIGHT$|#F0F0F0}}(a$, {{Text|LEN|#F0F0F0}}(s$)) = s$ {{Text|THEN|#F0F0F0}}
                            fh2 = {{Text|FREEFILE|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} ResolveStaticFunction_Method(x) = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                                {{Text|OPEN|#F0F0F0}} tmpdir$ + {{Text|"global.txt"|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|APPEND|#F0F0F0}} {{Text|AS|#F0F0F0}} #fh2
                                {{Text|PRINT|#F0F0F0}} #fh2, {{Text|"extern "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"C"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"{"|#FFB100}}
                                {{Text|PRINT|#F0F0F0}} #fh2, {{Text|"extern void "|#FFB100}} + s$ + {{Text|"(void);"|#FFB100}}
                                {{Text|PRINT|#F0F0F0}} #fh2, {{Text|"}"|#FFB100}}
                            {{Text|ELSE|#F0F0F0}}
                                {{Text|OPEN|#F0F0F0}} tmpdir$ + {{Text|"externtype"|#FFB100}} + str2(x) + {{Text|".txt"|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|OUTPUT|#F0F0F0}} {{Text|AS|#F0F0F0}} #fh2
                                {{Text|PRINT|#F0F0F0}} #fh2, {{Text|"extern "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"C"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|" "|#FFB100}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|CLOSE|#F0F0F0}} #fh2
                            n = n + {{Text|1|#F580B1}}
                            {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'x1|#31C4C4}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'<>""|#31C4C4}}
                {{Text|LOOP|#F0F0F0}}
                macosx_libfind_failed:
                {{Text|IF|#F0F0F0}} n = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"Could not find sub/function '"|#FFB100}} + ResolveStaticFunction_Name(x) + {{Text|"' in '"|#FFB100}} + ResolveStaticFunction_File(x) + {{Text|"'"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|NEXT|#F0F0F0}}
    {{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}({{Text|_OS$|#F0F0F0}}, {{Text|"[MACOSX]"|#FFB100}}) {{Text|THEN|#F0F0F0}}
        ffh = {{Text|FREEFILE|#F0F0F0}}
        {{Text|OPEN|#F0F0F0}} tmpdir$ + {{Text|"recompile_osx.command"|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|OUTPUT|#F0F0F0}} {{Text|AS|#F0F0F0}} #ffh
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"cd "|#FFB100}} + CHR_QUOTE + {{Text|"$(dirname "|#FFB100}} + CHR_QUOTE + {{Text|"$0"|#FFB100}} + CHR_QUOTE + {{Text|")"|#FFB100}} + CHR_QUOTE + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"echo "|#FFB100}} + CHR_QUOTE + {{Text|"Recompiling..."|#FFB100}} + CHR_QUOTE + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"cd ../c"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, makeline$ + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"read -p "|#FFB100}} + CHR_QUOTE + {{Text|"Press ENTER to exit..."|#FFB100}} + CHR_QUOTE + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|CLOSE|#F0F0F0}} ffh
        {{Text|SHELL|#F0F0F0}} {{Text|_HIDE|#F0F0F0}} {{Text|"chmod +x "|#FFB100}} + AddQuotes$(tmpdir$ + {{Text|"recompile_osx.command"|#FFB100}})
        ffh = {{Text|FREEFILE|#F0F0F0}}
        {{Text|OPEN|#F0F0F0}} tmpdir$ + {{Text|"debug_osx.command"|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|OUTPUT|#F0F0F0}} {{Text|AS|#F0F0F0}} #ffh
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"cd "|#FFB100}} + CHR_QUOTE + {{Text|"$(dirname "|#FFB100}} + CHR_QUOTE + {{Text|"$0"|#FFB100}} + CHR_QUOTE + {{Text|")"|#FFB100}} + CHR_QUOTE + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"Pause()"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"{"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"OLDCONFIG=`stty -g`"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"stty -icanon -echo min 1 time 0"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"dd count=1 2>/dev/null"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"stty $OLDCONFIG"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"}"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"echo "|#FFB100}} + CHR_QUOTE + {{Text|"C++ Debugging: "|#FFB100}} + file$ + extension$ + {{Text|" using GDB"|#FFB100}} + CHR_QUOTE + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"echo "|#FFB100}} + CHR_QUOTE + {{Text|"Debugger commands:"|#FFB100}} + CHR_QUOTE + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"echo "|#FFB100}} + CHR_QUOTE + {{Text|"After the debugger launches type 'run' to start your program"|#FFB100}} + CHR_QUOTE + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"echo "|#FFB100}} + CHR_QUOTE + {{Text|"After your program crashes type 'list' to find where the problem is and fix/report it"|#FFB100}} + CHR_QUOTE + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"echo "|#FFB100}} + CHR_QUOTE + {{Text|"(the GDB debugger has many other useful commands, this advice is for beginners)"|#FFB100}} + CHR_QUOTE + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"gdb "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + path.exe$ + file$ + extension$ + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"Pause"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|CLOSE|#F0F0F0}} ffh
        {{Text|SHELL|#F0F0F0}} {{Text|_HIDE|#F0F0F0}} {{Text|"chmod +x "|#FFB100}} + AddQuotes$(tmpdir$ + {{Text|"debug_osx.command"|#FFB100}})
    {{Text|ELSE|#F0F0F0}}
        ffh = {{Text|FREEFILE|#F0F0F0}}
        {{Text|OPEN|#F0F0F0}} tmpdir$ + {{Text|"recompile_lnx.sh"|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|OUTPUT|#F0F0F0}} {{Text|AS|#F0F0F0}} #ffh
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"#!/bin/sh"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"Pause()"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"{"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"OLDCONFIG=`stty -g`"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"stty -icanon -echo min 1 time 0"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"dd count=1 2>/dev/null"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"stty $OLDCONFIG"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"}"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"echo "|#FFB100}} + CHR_QUOTE + {{Text|"Recompiling..."|#FFB100}} + CHR_QUOTE + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"cd ../c"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, makeline$ + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"echo "|#FFB100}} + CHR_QUOTE + {{Text|"Press ENTER to exit..."|#FFB100}} + CHR_QUOTE + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"Pause"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|CLOSE|#F0F0F0}} ffh
        {{Text|SHELL|#F0F0F0}} {{Text|_HIDE|#F0F0F0}} {{Text|"chmod +x "|#FFB100}} + AddQuotes$(tmpdir$ + {{Text|"recompile_lnx.sh"|#FFB100}})
        ffh = {{Text|FREEFILE|#F0F0F0}}
        {{Text|OPEN|#F0F0F0}} tmpdir$ + {{Text|"debug_lnx.sh"|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|OUTPUT|#F0F0F0}} {{Text|AS|#F0F0F0}} #ffh
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"#!/bin/sh"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"Pause()"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"{"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"OLDCONFIG=`stty -g`"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"stty -icanon -echo min 1 time 0"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"dd count=1 2>/dev/null"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"stty $OLDCONFIG"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"}"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"echo "|#FFB100}} + CHR_QUOTE + {{Text|"C++ Debugging: "|#FFB100}} + file$ + extension$ + {{Text|" using GDB"|#FFB100}} + CHR_QUOTE + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"echo "|#FFB100}} + CHR_QUOTE + {{Text|"Debugger commands:"|#FFB100}} + CHR_QUOTE + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"echo "|#FFB100}} + CHR_QUOTE + {{Text|"After the debugger launches type 'run' to start your program"|#FFB100}} + CHR_QUOTE + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"echo "|#FFB100}} + CHR_QUOTE + {{Text|"After your program crashes type 'list' to find where the problem is and fix/report it"|#FFB100}} + CHR_QUOTE + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"echo "|#FFB100}} + CHR_QUOTE + {{Text|"(the GDB debugger has many other useful commands, this advice is for beginners)"|#FFB100}} + CHR_QUOTE + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"gdb "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + path.exe$ + file$ + extension$ + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ffh, {{Text|"Pause"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|CLOSE|#F0F0F0}} ffh
        {{Text|SHELL|#F0F0F0}} {{Text|_HIDE|#F0F0F0}} {{Text|"chmod +x "|#FFB100}} + AddQuotes$(tmpdir$ + {{Text|"debug_lnx.sh"|#FFB100}})
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} No_C_Compile_Mode = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|SHELL|#F0F0F0}} {{Text|_HIDE|#F0F0F0}} makeline$ + {{Text|" 1>> "|#FFB100}} + compilelog$ + {{Text|" 2>&1"|#FFB100}}
        {{Text|IF|#F0F0F0}} idemode {{Text|THEN|#F0F0F0}}
            {{Text|'Restore fg/bg colors|#31C4C4}}
            dummy = DarkenFGBG({{Text|0|#F580B1}})
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}({{Text|_OS$|#F0F0F0}}, {{Text|"[MACOSX]"|#FFB100}}) {{Text|THEN|#F0F0F0}}
        ff = {{Text|FREEFILE|#F0F0F0}}
        {{Text|IF|#F0F0F0}} path.exe$ = {{Text|"./"|#FFB100}} {{Text|OR|#F0F0F0}} path.exe$ = {{Text|"../../"|#FFB100}} {{Text|OR|#F0F0F0}} path.exe$ = {{Text|"..\..\"|#FFB100}} {{Text|THEN|#F0F0F0}} path.exe$ = {{Text|""|#FFB100}}
        {{Text|OPEN|#F0F0F0}} path.exe$ + file$ + extension$ + {{Text|"_start.command"|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|OUTPUT|#F0F0F0}} {{Text|AS|#F0F0F0}} #ff
        {{Text|PRINT|#F0F0F0}} #ff, {{Text|"cd "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"$(dirname "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"$0"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|")"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ff, {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ff, {{Text|"./"|#FFB100}} + file$ + extension$ + {{Text|" &"|#FFB100}};
        {{Text|PRINT|#F0F0F0}} #ff, {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ff, {{Text|"osascript -e 'tell application "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"Terminal"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|" to close (every window whose name contains "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + file$ + extension$ + {{Text|"_start.command"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|")' &"|#FFB100}};
        {{Text|PRINT|#F0F0F0}} #ff, {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ff, {{Text|"osascript -e 'if (count the windows of application "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"Terminal"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|") is 0 then tell application "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|"Terminal"|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|" to quit' &"|#FFB100}};
        {{Text|PRINT|#F0F0F0}} #ff, {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|PRINT|#F0F0F0}} #ff, {{Text|"exit"|#FFB100}};
        {{Text|PRINT|#F0F0F0}} #ff, {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}});
        {{Text|CLOSE|#F0F0F0}} #ff
        {{Text|SHELL|#F0F0F0}} {{Text|_HIDE|#F0F0F0}} {{Text|"chmod +x "|#FFB100}} + AddQuotes$(path.exe$ + file$ + extension$ + {{Text|"_start.command"|#FFB100}})
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}} No_C_Compile_Mode {{Text|THEN|#F0F0F0}} compfailed = {{Text|0|#F580B1}}: {{Text|GOTO|#F0F0F0}} No_C_Compile
{{Text|IF|#F0F0F0}} path.exe$ = {{Text|"../../"|#FFB100}} {{Text|OR|#F0F0F0}} path.exe$ = {{Text|"..\..\"|#FFB100}} {{Text|THEN|#F0F0F0}} path.exe$ = {{Text|""|#FFB100}}
{{Text|IF|#F0F0F0}} {{Text|_FILEEXISTS|#F0F0F0}}(path.exe$ + file$ + extension$) {{Text|THEN|#F0F0F0}}
    compfailed = {{Text|0|#F580B1}}
    lastBinaryGenerated$ = path.exe$ + file$ + extension$
{{Text|ELSE|#F0F0F0}}
    compfailed = {{Text|1|#F580B1}} {{Text|'detect compilation failure|#31C4C4}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}} compfailed {{Text|THEN|#F0F0F0}}
    {{Text|IF|#F0F0F0}} idemode {{Text|THEN|#F0F0F0}}
        idemessage$ = {{Text|"C++ Compilation failed "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|0|#F580B1}}) + {{Text|"(Check "|#FFB100}} + {{Text|_TRIM$|#F0F0F0}}(compilelog$) + {{Text|")"|#FFB100}}
        {{Text|GOTO|#F0F0F0}} ideerror
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} compfailed {{Text|THEN|#F0F0F0}}
        {{Text|PRINT|#F0F0F0}} {{Text|"ERROR: C++ compilation failed."|#FFB100}}
        {{Text|PRINT|#F0F0F0}} {{Text|"Check "|#FFB100}} + compilelog$ + {{Text|" for details."|#FFB100}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|ELSE|#F0F0F0}}
    {{Text|IF|#F0F0F0}} idemode = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|NOT|#F0F0F0}} QuietMode {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} {{Text|"Output: "|#FFB100}}; lastBinaryGenerated$
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
Skip_Build:
{{Text|IF|#F0F0F0}} idemode {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} ideret6
No_C_Compile:
{{Text|IF|#F0F0F0}} (compfailed <> {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} warningsissued <> {{Text|0|#F580B1}}) {{Text|AND|#F0F0F0}} ConsoleMode = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|END|#F0F0F0}} {{Text|1|#F580B1}}
{{Text|IF|#F0F0F0}} compfailed <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|SYSTEM|#F0F0F0}} {{Text|1|#F580B1}}
{{Text|SYSTEM|#F0F0F0}} {{Text|0|#F580B1}}
qberror_test:
E = {{Text|1|#F580B1}}
{{Text|RESUME|#F0F0F0}} {{Text|NEXT|#F0F0F0}}
qberror:
{{Text|'_CONSOLE ON|#31C4C4}}
{{Text|'_ECHO "A QB error has occurred (and you have compiled in debugging support)."|#31C4C4}}
{{Text|'_ECHO "Some key information (qb64pe.bas):"|#31C4C4}}
{{Text|'_ECHO "Error" + STR$(ERR)|#31C4C4}}
{{Text|'_ECHO "Description: " + _ERRORMESSAGE$|#31C4C4}}
{{Text|'_ECHO "Line" + STR$(_ERRORLINE)|#31C4C4}}
{{Text|'IF _INCLERRORLINE THEN|#31C4C4}}
{{Text|'    _ECHO "Included line" + STR$(_INCLERRORLINE)|#31C4C4}}
{{Text|'    _ECHO "Included file " + _INCLERRORFILE$|#31C4C4}}
{{Text|'END IF|#31C4C4}}
{{Text|'_ECHO ""|#31C4C4}}
{{Text|'_ECHO "Loaded source file details:"|#31C4C4}}
{{Text|'_ECHO "ideerror =" + STR$(ideerror) + "; qberrorhappened =" + STR$(qberrorhappened) + "; qberrorhappenedvalue =" + STR$(qberrorhappenedvalue) + "; linenumber =" + STR$(linenumber)|#31C4C4}}
{{Text|'_ECHO "ca$ = {" + ca$ + "}, idecommand$ = {" + idecommand$ + "}"|#31C4C4}}
{{Text|'_ECHO "linefragment = {" + linefragment+ "}"|#31C4C4}}
{{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|'A more in-your-face error handler|#31C4C4}}
    {{Text|IF|#F0F0F0}} ConsoleMode {{Text|THEN|#F0F0F0}}
        {{Text|PRINT|#F0F0F0}}
    {{Text|ELSE|#F0F0F0}}
        {{Text|_AUTODISPLAY|#F0F0F0}}
        {{Text|SCREEN|#F0F0F0}} {{Text|_NEWIMAGE|#F0F0F0}}({{Text|80|#F580B1}}, {{Text|25|#F580B1}}, {{Text|0|#F580B1}}), , {{Text|0|#F580B1}}, {{Text|0|#F580B1}}
        {{Text|COLOR|#F0F0F0}} {{Text|7|#F580B1}}, {{Text|0|#F580B1}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|_CONTROLCHR|#F0F0F0}} {{Text|OFF|#F0F0F0}}
    {{Text|PRINT|#F0F0F0}} {{Text|"A QB error has occurred (and you have compiled in debugging support)."|#FFB100}}
    {{Text|PRINT|#F0F0F0}} {{Text|"Some key information (qb64pe.bas):"|#FFB100}}
    {{Text|PRINT|#F0F0F0}} {{Text|"Error"|#FFB100}}; {{Text|ERR|#F0F0F0}}
    {{Text|PRINT|#F0F0F0}} {{Text|"Description: "|#FFB100}}; {{Text|_ERRORMESSAGE$|#F0F0F0}}
    {{Text|PRINT|#F0F0F0}} {{Text|"Line"|#FFB100}}; {{Text|_ERRORLINE|#F0F0F0}}
    {{Text|IF|#F0F0F0}} {{Text|_INCLERRORLINE|#F0F0F0}} {{Text|THEN|#F0F0F0}}
        {{Text|PRINT|#F0F0F0}} {{Text|"Included line"|#FFB100}}; {{Text|_INCLERRORLINE|#F0F0F0}}
        {{Text|PRINT|#F0F0F0}} {{Text|"Included file "|#FFB100}}; {{Text|_INCLERRORFILE$|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|PRINT|#F0F0F0}}
    {{Text|PRINT|#F0F0F0}} {{Text|"Loaded source file details:"|#FFB100}}
    {{Text|PRINT|#F0F0F0}} {{Text|"ideerror ="|#FFB100}}; ideerror; {{Text|"qberrorhappened ="|#FFB100}}; qberrorhappened; {{Text|"qberrorhappenedvalue ="|#FFB100}}; qberrorhappenedvalue; {{Text|"linenumber ="|#FFB100}}; linenumber
    {{Text|PRINT|#F0F0F0}} {{Text|"ca$ = {"|#FFB100}}; ca$; {{Text|"}, idecommand$ = {"|#FFB100}}; idecommand$; {{Text|"}"|#FFB100}}
    {{Text|PRINT|#F0F0F0}} {{Text|"linefragment = {"|#FFB100}}; linefragment; {{Text|"}"|#FFB100}}
    {{Text|END|#F0F0F0}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}} ideerror {{Text|THEN|#F0F0F0}} {{Text|'error happened inside the IDE|#31C4C4}}
    fh = {{Text|FREEFILE|#F0F0F0}}
    {{Text|OPEN|#F0F0F0}} {{Text|"internal\temp\ideerror.txt"|#FFB100}} {{Text|FOR|#F0F0F0}} {{Text|APPEND|#F0F0F0}} {{Text|AS|#F0F0F0}} #fh
    {{Text|PRINT|#F0F0F0}} #fh, {{Text|DATE$|#F0F0F0}}; {{Text|TIME$|#F0F0F0}}; {{Text|"--------------------"|#FFB100}}
    {{Text|PRINT|#F0F0F0}} #fh, {{Text|ERR|#F0F0F0}}
    {{Text|PRINT|#F0F0F0}} #fh, {{Text|_ERRORMESSAGE$|#F0F0F0}}
    {{Text|PRINT|#F0F0F0}} #fh, {{Text|_ERRORLINE|#F0F0F0}}
    {{Text|PRINT|#F0F0F0}} #fh, {{Text|_INCLERRORLINE|#F0F0F0}}
    {{Text|PRINT|#F0F0F0}} #fh, {{Text|_INCLERRORFILE$|#F0F0F0}}
    {{Text|CLOSE|#F0F0F0}} #fh
    sendc$ = {{Text|CHR$|#F0F0F0}}({{Text|255|#F580B1}}) {{Text|'a runtime error has occurred|#31C4C4}}
    {{Text|RESUME|#F0F0F0}} sendcommand {{Text|'allow IDE to handle error recovery|#31C4C4}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
qberrorhappenedvalue = qberrorhappened
qberrorhappened = {{Text|1|#F580B1}}
{{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"QB ERROR!"|#FFB100}}
{{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"ERR="|#FFB100}}; {{Text|ERR|#F0F0F0}}
{{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"ERL="|#FFB100}}; {{Text|ERL|#F0F0F0}}
{{Text|IF|#F0F0F0}} idemode {{Text|AND|#F0F0F0}} qberrorhappenedvalue >= {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
    {{Text|'real qb error occurred|#31C4C4}}
    ideerrorline = linenumber
    idemessage$ = {{Text|"Compiler error (check for syntax errors) ("|#FFB100}} + {{Text|_ERRORMESSAGE$|#F0F0F0}} + {{Text|":"|#FFB100}}
    {{Text|IF|#F0F0F0}} {{Text|ERR|#F0F0F0}} {{Text|THEN|#F0F0F0}} idemessage$ = idemessage$ + str2$({{Text|ERR|#F0F0F0}}) + {{Text|"-"|#FFB100}}
    {{Text|IF|#F0F0F0}} {{Text|_ERRORLINE|#F0F0F0}} {{Text|THEN|#F0F0F0}} idemessage$ = idemessage$ + str2$({{Text|_ERRORLINE|#F0F0F0}})
    {{Text|IF|#F0F0F0}} {{Text|_INCLERRORLINE|#F0F0F0}} {{Text|THEN|#F0F0F0}} idemessage$ = idemessage$ + {{Text|"-"|#FFB100}} + {{Text|_INCLERRORFILE$|#F0F0F0}} + {{Text|"-"|#FFB100}} + str2$({{Text|_INCLERRORLINE|#F0F0F0}})
    idemessage$ = idemessage$ + {{Text|")"|#FFB100}}
    {{Text|IF|#F0F0F0}} inclevel > {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} idemessage$ = idemessage$ + incerror$
    {{Text|RESUME|#F0F0F0}} ideerror
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}} qberrorhappenedvalue >= {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
    a$ = {{Text|"UNEXPECTED INTERNAL COMPILER ERROR!"|#FFB100}}: {{Text|GOTO|#F0F0F0}} errmes {{Text|'internal comiler error|#31C4C4}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
qberrorcode = {{Text|ERR|#F0F0F0}}
qberrorline = {{Text|ERL|#F0F0F0}}
{{Text|IF|#F0F0F0}} qberrorhappenedvalue = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|RESUME|#F0F0F0}} qberrorhappened1
{{Text|IF|#F0F0F0}} qberrorhappenedvalue = {{Text|-2|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|RESUME|#F0F0F0}} qberrorhappened2
{{Text|IF|#F0F0F0}} qberrorhappenedvalue = {{Text|-3|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|RESUME|#F0F0F0}} qberrorhappened3
{{Text|END|#F0F0F0}}
errmes: {{Text|'set a$ to message|#31C4C4}}
{{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} a$ = Error_Message: Error_Happened = {{Text|0|#F580B1}}
layout$ = {{Text|""|#FFB100}}: layoutok = {{Text|0|#F580B1}} {{Text|'invalidate layout|#31C4C4}}
{{Text|IF|#F0F0F0}} forceIncludingFile {{Text|THEN|#F0F0F0}} {{Text|'If we're to the point where we're adding the automatic QB64 includes, we don't need to report the $INCLUDE information|#31C4C4}}
    {{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(a$, {{Text|"END SUB/FUNCTION before"|#FFB100}}) {{Text|THEN|#F0F0F0}} a$ = {{Text|"SUB without END SUB"|#FFB100}} {{Text|'Just a simple rewrite of the error message to be less confusing for SUB/FUNCTIONs|#31C4C4}}
{{Text|ELSE|#F0F0F0}} {{Text|'We want to let the user know which module the error occurred in|#31C4C4}}
    {{Text|IF|#F0F0F0}} inclevel > {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = a$ + incerror$
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|IF|#F0F0F0}} idemode {{Text|THEN|#F0F0F0}}
    ideerrorline = linenumber
    idemessage$ = a$
    {{Text|GOTO|#F0F0F0}} ideerror {{Text|'infinitely preferable to RESUME|#31C4C4}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|'non-ide mode output|#31C4C4}}
{{Text|PRINT|#F0F0F0}}
{{Text|IF|#F0F0F0}} {{Text|NOT|#F0F0F0}} MonochromeLoggingMode {{Text|THEN|#F0F0F0}}
    {{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}({{Text|_OS$|#F0F0F0}}, {{Text|"WIN"|#FFB100}}) {{Text|THEN|#F0F0F0}}
        {{Text|COLOR|#F0F0F0}} {{Text|4|#F580B1}}
    {{Text|ELSE|#F0F0F0}}
        {{Text|COLOR|#F0F0F0}} {{Text|9|#F580B1}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|PRINT|#F0F0F0}} a$
{{Text|IF|#F0F0F0}} {{Text|NOT|#F0F0F0}} MonochromeLoggingMode {{Text|THEN|#F0F0F0}} {{Text|COLOR|#F0F0F0}} {{Text|7|#F580B1}}
{{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|LEN|#F0F0F0}}(linefragment)
    {{Text|IF|#F0F0F0}} {{Text|MID$|#F0F0F0}}(linefragment, i, {{Text|1|#F580B1}}) = sp$ {{Text|THEN|#F0F0F0}} {{Text|MID$|#F0F0F0}}(linefragment, i, {{Text|1|#F580B1}}) = {{Text|" "|#FFB100}}
{{Text|NEXT|#F0F0F0}}
{{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|LEN|#F0F0F0}}(wholeline)
    {{Text|IF|#F0F0F0}} {{Text|MID$|#F0F0F0}}(wholeline, i, {{Text|1|#F580B1}}) = sp$ {{Text|THEN|#F0F0F0}} {{Text|MID$|#F0F0F0}}(wholeline, i, {{Text|1|#F580B1}}) = {{Text|" "|#FFB100}}
{{Text|NEXT|#F0F0F0}}
{{Text|PRINT|#F0F0F0}} {{Text|"Caused by (or after):"|#FFB100}} + linefragment
{{Text|IF|#F0F0F0}} {{Text|NOT|#F0F0F0}} MonochromeLoggingMode {{Text|THEN|#F0F0F0}} {{Text|COLOR|#F0F0F0}} {{Text|8|#F580B1}}
{{Text|PRINT|#F0F0F0}} {{Text|"LINE "|#FFB100}};
{{Text|IF|#F0F0F0}} {{Text|NOT|#F0F0F0}} MonochromeLoggingMode {{Text|THEN|#F0F0F0}} {{Text|COLOR|#F0F0F0}} {{Text|15|#F580B1}}
{{Text|PRINT|#F0F0F0}} str2(linenumber) + {{Text|":"|#FFB100}};
{{Text|IF|#F0F0F0}} {{Text|NOT|#F0F0F0}} MonochromeLoggingMode {{Text|THEN|#F0F0F0}} {{Text|COLOR|#F0F0F0}} {{Text|7|#F580B1}}
{{Text|PRINT|#F0F0F0}} wholeline
{{Text|IF|#F0F0F0}} ConsoleMode {{Text|THEN|#F0F0F0}} {{Text|SYSTEM|#F0F0F0}} {{Text|1|#F580B1}}
{{Text|END|#F0F0F0}} {{Text|1|#F580B1}}
{{Text|FUNCTION|#F0F0F0}} ParseCMDLineArgs$ ()
    {{Text|'Recall that COMMAND$ is a concatenation of argv[] elements, so we don't have|#31C4C4}}
    {{Text|'to worry about more than one space between things (unless they used quotes,|#31C4C4}}
    {{Text|'in which case they're simply asking for trouble).|#31C4C4}}
    {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|_COMMANDCOUNT|#F0F0F0}}
        token$ = {{Text|COMMAND$|#F0F0F0}}(i)
        {{Text|IF|#F0F0F0}} {{Text|LCASE$|#F0F0F0}}(token$) = {{Text|"/?"|#FFB100}} {{Text|OR|#F0F0F0}} {{Text|LCASE$|#F0F0F0}}(token$) = {{Text|"--help"|#FFB100}} {{Text|OR|#F0F0F0}} {{Text|LCASE$|#F0F0F0}}(token$) = {{Text|"/help"|#FFB100}} {{Text|THEN|#F0F0F0}} token$ = {{Text|"-?"|#FFB100}}
        {{Text|SELECT|#F0F0F0}} {{Text|CASE|#F0F0F0}} {{Text|LCASE$|#F0F0F0}}({{Text|LEFT$|#F0F0F0}}(token$, {{Text|2|#F580B1}}))
            {{Text|CASE|#F0F0F0}} {{Text|"-?"|#FFB100}} {{Text|'Command-line help|#31C4C4}}
                {{Text|_DEST|#F0F0F0}} {{Text|_CONSOLE|#F0F0F0}}
                {{Text|IF|#F0F0F0}} qb64versionprinted = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} qb64versionprinted = {{Text|-1|#F580B1}}: {{Text|PRINT|#F0F0F0}} {{Text|"QB64-PE Compiler V"|#FFB100}} + Version$
                {{Text|PRINT|#F0F0F0}}
                {{Text|PRINT|#F0F0F0}} {{Text|"Usage: qb64pe [switches] <file>"|#FFB100}}
                {{Text|PRINT|#F0F0F0}}
                {{Text|PRINT|#F0F0F0}} {{Text|"Options:"|#FFB100}}
                {{Text|PRINT|#F0F0F0}} {{Text|"  <file>                  Source file to load"|#FFB100}} {{Text|'                                '80 columns|#31C4C4}}
                {{Text|PRINT|#F0F0F0}} {{Text|"  -v                      Print version"|#FFB100}}
                {{Text|PRINT|#F0F0F0}} {{Text|"  -c                      Compile instead of edit"|#FFB100}}
                {{Text|PRINT|#F0F0F0}} {{Text|"  -o <output file>        Write output executable to <output file>"|#FFB100}}
                {{Text|PRINT|#F0F0F0}} {{Text|"  -x                      Compile instead of edit and output the result to the"|#FFB100}}
                {{Text|PRINT|#F0F0F0}} {{Text|"                            console"|#FFB100}}
                {{Text|PRINT|#F0F0F0}} {{Text|"  -w                      Show warnings"|#FFB100}}
                {{Text|PRINT|#F0F0F0}} {{Text|"  -q                      Quiet mode (does not inhibit warnings or errors)"|#FFB100}}
                {{Text|PRINT|#F0F0F0}} {{Text|"  -m                      Do not colorize compiler output (monochrome mode)"|#FFB100}}
                {{Text|PRINT|#F0F0F0}} {{Text|"  -e                      Enable OPTION _EXPLICIT, making variable declaration"|#FFB100}}
                {{Text|PRINT|#F0F0F0}} {{Text|"                            mandatory (per-compilation; doesn't affect the"|#FFB100}}
                {{Text|PRINT|#F0F0F0}} {{Text|"                            source file or global settings)"|#FFB100}}
                {{Text|PRINT|#F0F0F0}} {{Text|"  -s[:switch=true/false]  View/edit compiler settings"|#FFB100}}
                {{Text|PRINT|#F0F0F0}} {{Text|"  -l:<line number>        Start the IDE at the specified line number"|#FFB100}}
                {{Text|PRINT|#F0F0F0}} {{Text|"  -p                      Purge all pre-compiled content first"|#FFB100}}
                {{Text|PRINT|#F0F0F0}} {{Text|"  -z                      Generate C code without compiling to executable"|#FFB100}}
                {{Text|PRINT|#F0F0F0}} {{Text|"  -f[:setting=value]      compiler settings to use"|#FFB100}}
                {{Text|PRINT|#F0F0F0}}
                {{Text|SYSTEM|#F0F0F0}}
            {{Text|CASE|#F0F0F0}} {{Text|"-v"|#FFB100}} {{Text|' Print version|#31C4C4}}
                {{Text|_DEST|#F0F0F0}} {{Text|_CONSOLE|#F0F0F0}}
                {{Text|IF|#F0F0F0}} qb64versionprinted = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} qb64versionprinted = {{Text|-1|#F580B1}}: {{Text|PRINT|#F0F0F0}} {{Text|"QB64-PE Compiler V"|#FFB100}} + Version$
                {{Text|SYSTEM|#F0F0F0}}
            {{Text|CASE|#F0F0F0}} {{Text|"-u"|#FFB100}} {{Text|'Invoke "Update all pages" to populate internal/help files (hidden build option)|#31C4C4}}
                Help_Recaching = {{Text|2|#F580B1}}: Help_IgnoreCache = {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} ideupdatehelpbox {{Text|THEN|#F0F0F0}}
                    {{Text|_DEST|#F0F0F0}} {{Text|_CONSOLE|#F0F0F0}}
                    {{Text|PRINT|#F0F0F0}} {{Text|"Update failed: Can't make connection to Wiki."|#FFB100}}
                    {{Text|SYSTEM|#F0F0F0}} {{Text|1|#F580B1}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|SYSTEM|#F0F0F0}}
            {{Text|CASE|#F0F0F0}} {{Text|"-c"|#FFB100}} {{Text|'Compile instead of edit|#31C4C4}}
                NoIDEMode = {{Text|1|#F580B1}}
                cmdlineswitch = {{Text|-1|#F580B1}}
            {{Text|CASE|#F0F0F0}} {{Text|"-o"|#FFB100}} {{Text|'Specify an output file|#31C4C4}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}({{Text|COMMAND$|#F0F0F0}}(i + {{Text|1|#F580B1}})) > {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} outputfile_cmd$ = {{Text|COMMAND$|#F0F0F0}}(i + {{Text|1|#F580B1}}): i = i + {{Text|1|#F580B1}}
                cmdlineswitch = {{Text|-1|#F580B1}}
            {{Text|CASE|#F0F0F0}} {{Text|"-x"|#FFB100}} {{Text|'Use the console|#31C4C4}}
                ConsoleMode = {{Text|1|#F580B1}}
                NoIDEMode = {{Text|1|#F580B1}} {{Text|'Implies -c|#31C4C4}}
                cmdlineswitch = {{Text|-1|#F580B1}}
            {{Text|CASE|#F0F0F0}} {{Text|"-w"|#FFB100}} {{Text|'Show warnings|#31C4C4}}
                ShowWarnings = {{Text|-1|#F580B1}}
                cmdlineswitch = {{Text|-1|#F580B1}}
            {{Text|CASE|#F0F0F0}} {{Text|"-q"|#FFB100}} {{Text|'Quiet mode|#31C4C4}}
                QuietMode = {{Text|-1|#F580B1}}
                cmdlineswitch = {{Text|-1|#F580B1}}
            {{Text|CASE|#F0F0F0}} {{Text|"-m"|#FFB100}} {{Text|'Monochrome mode|#31C4C4}}
                MonochromeLoggingMode = {{Text|-1|#F580B1}}
                cmdlineswitch = {{Text|-1|#F580B1}}
            {{Text|CASE|#F0F0F0}} {{Text|"-e"|#FFB100}} {{Text|'Option Explicit|#31C4C4}}
                optionexplicit_cmd = {{Text|-1|#F580B1}}
                cmdlineswitch = {{Text|-1|#F580B1}}
            {{Text|CASE|#F0F0F0}} {{Text|"-s"|#FFB100}} {{Text|'Settings|#31C4C4}}
                settingsMode = {{Text|-1|#F580B1}}
                {{Text|_DEST|#F0F0F0}} {{Text|_CONSOLE|#F0F0F0}}
                {{Text|IF|#F0F0F0}} qb64versionprinted = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} qb64versionprinted = {{Text|-1|#F580B1}}: {{Text|PRINT|#F0F0F0}} {{Text|"QB64-PE Compiler V"|#FFB100}} + Version$
                {{Text|SELECT|#F0F0F0}} {{Text|CASE|#F0F0F0}} {{Text|LCASE$|#F0F0F0}}({{Text|MID$|#F0F0F0}}(token$, {{Text|3|#F580B1}}))
                    {{Text|CASE|#F0F0F0}} {{Text|""|#FFB100}}
                        {{Text|PRINT|#F0F0F0}} {{Text|"debuginfo    = "|#FFB100}};
                        {{Text|IF|#F0F0F0}} idedebuginfo {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} {{Text|"true"|#FFB100}} {{Text|ELSE|#F0F0F0}} {{Text|PRINT|#F0F0F0}} {{Text|"false"|#FFB100}}
                        {{Text|PRINT|#F0F0F0}} {{Text|"exewithsource = "|#FFB100}};
                        {{Text|IF|#F0F0F0}} SaveExeWithSource {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} {{Text|"true"|#FFB100}} {{Text|ELSE|#F0F0F0}} {{Text|PRINT|#F0F0F0}} {{Text|"false"|#FFB100}}
                        {{Text|SYSTEM|#F0F0F0}}
                    {{Text|CASE|#F0F0F0}} {{Text|":exewithsource"|#FFB100}}
                        {{Text|PRINT|#F0F0F0}} {{Text|"exewithsource = "|#FFB100}};
                        {{Text|IF|#F0F0F0}} SaveExeWithSource {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} {{Text|"true"|#FFB100}} {{Text|ELSE|#F0F0F0}} {{Text|PRINT|#F0F0F0}} {{Text|"false"|#FFB100}}
                        {{Text|SYSTEM|#F0F0F0}}
                    {{Text|CASE|#F0F0F0}} {{Text|":exewithsource=true"|#FFB100}}
                        WriteConfigSetting generalSettingsSection$, {{Text|"SaveExeWithSource"|#FFB100}}, {{Text|"True"|#FFB100}}
                        {{Text|PRINT|#F0F0F0}} {{Text|"exewithsource = true"|#FFB100}}
                        SaveExeWithSource = {{Text|-1|#F580B1}}
                    {{Text|CASE|#F0F0F0}} {{Text|":exewithsource=false"|#FFB100}}
                        WriteConfigSetting generalSettingsSection$, {{Text|"SaveExeWithSource"|#FFB100}}, {{Text|"False"|#FFB100}}
                        {{Text|PRINT|#F0F0F0}} {{Text|"exewithsource = false"|#FFB100}}
                        SaveExeWithSource = {{Text|0|#F580B1}}
                    {{Text|CASE|#F0F0F0}} {{Text|":debuginfo"|#FFB100}}
                        {{Text|PRINT|#F0F0F0}} {{Text|"debuginfo = "|#FFB100}};
                        {{Text|IF|#F0F0F0}} idedebuginfo {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} {{Text|"true"|#FFB100}} {{Text|ELSE|#F0F0F0}} {{Text|PRINT|#F0F0F0}} {{Text|"false"|#FFB100}}
                        {{Text|SYSTEM|#F0F0F0}}
                    {{Text|CASE|#F0F0F0}} {{Text|":debuginfo=true"|#FFB100}}
                        {{Text|PRINT|#F0F0F0}} {{Text|"debuginfo = true"|#FFB100}}
                        WriteConfigSetting generalSettingsSection$, {{Text|"DebugInfo"|#FFB100}}, {{Text|"True"|#FFB100}} + DebugInfoIniWarning$
                        idedebuginfo = {{Text|-1|#F580B1}}
                        Include_GDB_Debugging_Info = idedebuginfo
                        PurgeTemporaryBuildFiles (os$), (MacOSX)
                    {{Text|CASE|#F0F0F0}} {{Text|":debuginfo=false"|#FFB100}}
                        {{Text|PRINT|#F0F0F0}} {{Text|"debuginfo = false"|#FFB100}}
                        WriteConfigSetting generalSettingsSection$, {{Text|"DebugInfo"|#FFB100}}, {{Text|"False"|#FFB100}} + DebugInfoIniWarning$
                        idedebuginfo = {{Text|0|#F580B1}}
                        Include_GDB_Debugging_Info = idedebuginfo
                        PurgeTemporaryBuildFiles (os$), (MacOSX)
                    {{Text|CASE|#F0F0F0}} {{Text|ELSE|#F0F0F0}}
                        {{Text|PRINT|#F0F0F0}} {{Text|"Invalid settings switch: "|#FFB100}}; token$
                        {{Text|PRINT|#F0F0F0}}
                        {{Text|PRINT|#F0F0F0}} {{Text|"Valid switches:"|#FFB100}}
                        {{Text|PRINT|#F0F0F0}} {{Text|"    -s:debuginfo=true/false    (Embed C++ debug info into .EXE)"|#FFB100}}
                        {{Text|PRINT|#F0F0F0}} {{Text|"    -s:exewithsource=true/false (Save .EXE in the source folder)"|#FFB100}}
                        {{Text|SYSTEM|#F0F0F0}} {{Text|1|#F580B1}}
                {{Text|END|#F0F0F0}} {{Text|SELECT|#F0F0F0}}
                {{Text|_DEST|#F0F0F0}} {{Text|0|#F580B1}}
            {{Text|CASE|#F0F0F0}} {{Text|"-l"|#FFB100}} {{Text|'goto line (ide mode only); -l:<line number>|#31C4C4}}
                {{Text|IF|#F0F0F0}} {{Text|MID$|#F0F0F0}}(token$, {{Text|3|#F580B1}}, {{Text|1|#F580B1}}) = {{Text|":"|#FFB100}} {{Text|THEN|#F0F0F0}} ideStartAtLine = {{Text|VAL|#F0F0F0}}({{Text|MID$|#F0F0F0}}(token$, {{Text|4|#F580B1}}))
                cmdlineswitch = {{Text|-1|#F580B1}}
            {{Text|CASE|#F0F0F0}} {{Text|"-p"|#FFB100}} {{Text|'Purge|#31C4C4}}
                PurgeTemporaryBuildFiles (os$), (MacOSX)
                cmdlineswitch = {{Text|-1|#F580B1}}
            {{Text|CASE|#F0F0F0}} {{Text|"-z"|#FFB100}} {{Text|'Not compiling C code|#31C4C4}}
                No_C_Compile_Mode = {{Text|1|#F580B1}}
                ConsoleMode = {{Text|1|#F580B1}} {{Text|'Implies -x|#31C4C4}}
                NoIDEMode = {{Text|1|#F580B1}} {{Text|'Implies -c|#31C4C4}}
                cmdlineswitch = {{Text|-1|#F580B1}}
            {{Text|CASE|#F0F0F0}} {{Text|"-f"|#FFB100}} {{Text|'temporary setting|#31C4C4}}
                token$ = {{Text|MID$|#F0F0F0}}(token$, {{Text|3|#F580B1}})
                {{Text|SELECT|#F0F0F0}} {{Text|CASE|#F0F0F0}} {{Text|LCASE$|#F0F0F0}}({{Text|LEFT$|#F0F0F0}}(token$, {{Text|INSTR|#F0F0F0}}(token$, {{Text|"="|#FFB100}}) - {{Text|1|#F580B1}}))
                    {{Text|CASE|#F0F0F0}} {{Text|":useminiaudio"|#FFB100}}
                        {{Text|IF|#F0F0F0}} {{Text|NOT|#F0F0F0}} ParseBooleanSetting&(token$, UseMiniaudioBackend) {{Text|THEN|#F0F0F0}} PrintTemporarySettingsHelpAndExit InvalidSettingError$(token$)
                    {{Text|CASE|#F0F0F0}} {{Text|":optimizecppprogram"|#FFB100}}
                        {{Text|IF|#F0F0F0}} {{Text|NOT|#F0F0F0}} ParseBooleanSetting&(token$, OptimizeCppProgram) {{Text|THEN|#F0F0F0}} PrintTemporarySettingsHelpAndExit InvalidSettingError$(token$)
                    {{Text|CASE|#F0F0F0}} {{Text|":stripdebugsymbols"|#FFB100}}
                        {{Text|IF|#F0F0F0}} {{Text|NOT|#F0F0F0}} ParseBooleanSetting&(token$, StripDebugSymbols) {{Text|THEN|#F0F0F0}} PrintTemporarySettingsHelpAndExit InvalidSettingError$(token$)
                    {{Text|CASE|#F0F0F0}} {{Text|":extracppflags"|#FFB100}}
                        {{Text|IF|#F0F0F0}} {{Text|NOT|#F0F0F0}} ParseStringSetting&(token$, ExtraCppFlags) {{Text|THEN|#F0F0F0}} PrintTemporarySettingsHelpAndExit InvalidSettingError$(token$)
                    {{Text|CASE|#F0F0F0}} {{Text|":extralinkerflags"|#FFB100}}
                        {{Text|IF|#F0F0F0}} {{Text|NOT|#F0F0F0}} ParseStringSetting&(token$, ExtraLinkerFlags) {{Text|THEN|#F0F0F0}} PrintTemporarySettingsHelpAndExit InvalidSettingError$(token$)
                    {{Text|CASE|#F0F0F0}} {{Text|":maxcompilerprocesses"|#FFB100}}
                        {{Text|IF|#F0F0F0}} {{Text|NOT|#F0F0F0}} ParseLongSetting&(token$, MaxParallelProcesses) {{Text|THEN|#F0F0F0}} PrintTemporarySettingsHelpAndExit InvalidSettingError$(token$)
                        {{Text|IF|#F0F0F0}} MaxParallelProcesses = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} PrintTemporarySettingsHelpAndExit {{Text|"MaxCompilerProcesses must be more than zero"|#FFB100}}
                    {{Text|CASE|#F0F0F0}} {{Text|":generatelicensefile"|#FFB100}}
                        {{Text|IF|#F0F0F0}} {{Text|NOT|#F0F0F0}} ParseBooleanSetting&(token$, GenerateLicenseFile) {{Text|THEN|#F0F0F0}} PrintTemporarySettingsHelpAndExit InvalidSettingError$(token$)
                    {{Text|CASE|#F0F0F0}} {{Text|ELSE|#F0F0F0}}
                        PrintTemporarySettingsHelpAndExit {{Text|""|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|SELECT|#F0F0F0}}
            {{Text|CASE|#F0F0F0}} {{Text|ELSE|#F0F0F0}} {{Text|'Something we don't recognise, assume it's a filename|#31C4C4}}
                {{Text|IF|#F0F0F0}} PassedFileName$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} PassedFileName$ = token$
        {{Text|END|#F0F0F0}} {{Text|SELECT|#F0F0F0}}
    {{Text|NEXT|#F0F0F0}} i
    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(PassedFileName$) {{Text|THEN|#F0F0F0}}
        ParseCMDLineArgs$ = PassedFileName$
    {{Text|ELSE|#F0F0F0}}
        {{Text|IF|#F0F0F0}} cmdlineswitch = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} settingsMode = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|SYSTEM|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|END|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
{{Text|FUNCTION|#F0F0F0}} InvalidSettingError$ (token$)
    InvalidSettingError$ = {{Text|"Invalid temporary setting switch: "|#FFB100}} + AddQuotes$(token$)
{{Text|END|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
{{Text|SUB|#F0F0F0}} PrintTemporarySettingsHelpAndExit (errstr$)
    {{Text|_DEST|#F0F0F0}} {{Text|_CONSOLE|#F0F0F0}}
    {{Text|PRINT|#F0F0F0}} {{Text|"QB64-PE Compiler V"|#FFB100}} + Version$
    {{Text|IF|#F0F0F0}} errstr$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
        {{Text|PRINT|#F0F0F0}} {{Text|"Error: "|#FFB100}}; errstr$
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|PRINT|#F0F0F0}}
    {{Text|PRINT|#F0F0F0}} {{Text|"Note: Defaults can be changed by IDE settings"|#FFB100}}
    {{Text|PRINT|#F0F0F0}}
    {{Text|PRINT|#F0F0F0}} {{Text|"Valid settings:"|#FFB100}}
    {{Text|PRINT|#F0F0F0}} {{Text|"    -f:UseMiniAudio=[true¦false]        (Use Miniaudio Audio backend, default true)"|#FFB100}}
    {{Text|PRINT|#F0F0F0}} {{Text|"    -f:OptimizeCppProgram=[true¦false]  (Use C++ Optimization flag, default false)"|#FFB100}}
    {{Text|PRINT|#F0F0F0}} {{Text|"    -f:StripDebugSymbols=[true¦false]    (Stirp C++ debug symbols, default true)"|#FFB100}}
    {{Text|PRINT|#F0F0F0}} {{Text|"    -f:ExtraCppFlags=[string]            (Extra flags to pass to the C++ compiler)"|#FFB100}}
    {{Text|PRINT|#F0F0F0}} {{Text|"    -f:ExtraLinkerFlags=[string]        (Extra flags to pass at link time)"|#FFB100}}
    {{Text|PRINT|#F0F0F0}} {{Text|"    -f:MaxCompilerProcesses=[integer]    (Max C++ compiler processes to start in parallel)"|#FFB100}}
    {{Text|PRINT|#F0F0F0}} {{Text|"    -f:GenerateLicenseFile=[true¦false]  (Produce a license.txt file for the program)"|#FFB100}}
    {{Text|SYSTEM|#F0F0F0}}
{{Text|END|#F0F0F0}} {{Text|SUB|#F0F0F0}}
{{Text|FUNCTION|#F0F0F0}} ParseBooleanSetting& (token$, setting {{Text|AS|#F0F0F0}} {{Text|_UNSIGNED|#F0F0F0}} {{Text|LONG|#F0F0F0}})
    {{Text|DIM|#F0F0F0}} equals {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
    {{Text|DIM|#F0F0F0}} value {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
    equals = {{Text|INSTR|#F0F0F0}}(token$, {{Text|"="|#FFB100}})
    {{Text|IF|#F0F0F0}} equals = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} ParseBooleanSetting& = {{Text|0|#F580B1}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    value = {{Text|LCASE$|#F0F0F0}}({{Text|MID$|#F0F0F0}}(token$, equals + {{Text|1|#F580B1}}))
    {{Text|SELECT|#F0F0F0}} {{Text|CASE|#F0F0F0}} value
        {{Text|CASE|#F0F0F0}} {{Text|"true"|#FFB100}}, {{Text|"on"|#FFB100}}, {{Text|"yes"|#FFB100}}
            setting = {{Text|-1|#F580B1}}
            ParseBooleanSetting& = {{Text|-1|#F580B1}}
        {{Text|CASE|#F0F0F0}} {{Text|"false"|#FFB100}}, {{Text|"off"|#FFB100}}, {{Text|"no"|#FFB100}}
            setting = {{Text|0|#F580B1}}
            ParseBooleanSetting& = {{Text|-1|#F580B1}}
        {{Text|CASE|#F0F0F0}} {{Text|ELSE|#F0F0F0}}
            ParseBooleanSetting& = {{Text|0|#F580B1}}
    {{Text|END|#F0F0F0}} {{Text|SELECT|#F0F0F0}}
{{Text|END|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
{{Text|FUNCTION|#F0F0F0}} ParseLongSetting& (token$, setting {{Text|AS|#F0F0F0}} {{Text|_UNSIGNED|#F0F0F0}} {{Text|LONG|#F0F0F0}})
    {{Text|DIM|#F0F0F0}} equals {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
    equals = {{Text|INSTR|#F0F0F0}}(token$, {{Text|"="|#FFB100}})
    {{Text|IF|#F0F0F0}} equals = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} ParseLongSetting& = {{Text|0|#F580B1}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    setting = {{Text|VAL|#F0F0F0}}({{Text|MID$|#F0F0F0}}(token$, equals + {{Text|1|#F580B1}}))
    ParseLongSetting& = {{Text|-1|#F580B1}}
{{Text|END|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
{{Text|FUNCTION|#F0F0F0}} ParseStringSetting& (token$, setting {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}})
    {{Text|DIM|#F0F0F0}} equals {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
    equals = {{Text|INSTR|#F0F0F0}}(token$, {{Text|"="|#FFB100}})
    {{Text|IF|#F0F0F0}} equals = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} ParseStringSetting& = {{Text|0|#F580B1}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    setting = {{Text|MID$|#F0F0F0}}(token$, equals + {{Text|1|#F580B1}})
    ParseStringSetting& = {{Text|-1|#F580B1}}
{{Text|END|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
{{Text|FUNCTION|#F0F0F0}} Type2MemTypeValue (t1)
    t = {{Text|0|#F580B1}}
    {{Text|IF|#F0F0F0}} t1 {{Text|AND|#F0F0F0}} ISARRAY {{Text|THEN|#F0F0F0}} t = t + {{Text|65536|#F580B1}}
    {{Text|IF|#F0F0F0}} t1 {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} (t1 {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
            t = t + {{Text|4096|#F580B1}} {{Text|'_MEM type|#31C4C4}}
        {{Text|ELSE|#F0F0F0}}
            t = t + {{Text|32768|#F580B1}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|ELSE|#F0F0F0}}
        {{Text|IF|#F0F0F0}} t1 {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
            t = t + {{Text|512|#F580B1}} {{Text|'string|#31C4C4}}
        {{Text|ELSE|#F0F0F0}}
            {{Text|IF|#F0F0F0}} t1 {{Text|AND|#F0F0F0}} ISFLOAT {{Text|THEN|#F0F0F0}}
                t = t + {{Text|256|#F580B1}} {{Text|'float|#31C4C4}}
            {{Text|ELSE|#F0F0F0}}
                t = t + {{Text|128|#F580B1}} {{Text|'integer|#31C4C4}}
                {{Text|IF|#F0F0F0}} t1 {{Text|AND|#F0F0F0}} ISUNSIGNED {{Text|THEN|#F0F0F0}} t = t + {{Text|1024|#F580B1}}
                {{Text|IF|#F0F0F0}} t1 {{Text|AND|#F0F0F0}} ISOFFSET {{Text|THEN|#F0F0F0}} t = t + {{Text|8192|#F580B1}} {{Text|'offset type|#31C4C4}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            t1s = (t1 {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}}
            {{Text|IF|#F0F0F0}} t1s = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} t = t + t1s
            {{Text|IF|#F0F0F0}} t1s = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} t = t + t1s
            {{Text|IF|#F0F0F0}} t1s = {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} t = t + t1s
            {{Text|IF|#F0F0F0}} t1s = {{Text|8|#F580B1}} {{Text|THEN|#F0F0F0}} t = t + t1s
            {{Text|IF|#F0F0F0}} t1s = {{Text|16|#F580B1}} {{Text|THEN|#F0F0F0}} t = t + t1s
            {{Text|IF|#F0F0F0}} t1s = {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} t = t + t1s
            {{Text|IF|#F0F0F0}} t1s = {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}} t = t + t1s
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    Type2MemTypeValue = t
{{Text|END|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
{{Text|'udt is non-zero if this is an array of udt's, to allow examining each udt element|#31C4C4}}
{{Text|FUNCTION|#F0F0F0}} allocarray (n2$, elements$, elementsize, udt)
    dimsharedlast = dimshared: dimshared = {{Text|0|#F580B1}}
    {{Text|IF|#F0F0F0}} autoarray = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} autoarray = {{Text|0|#F580B1}}: autoary = {{Text|1|#F580B1}} {{Text|'clear global value & set local value|#31C4C4}}
    f12$ = {{Text|""|#FFB100}}
    {{Text|'changelog:|#31C4C4}}
    {{Text|'added 4 to [2] to indicate cmem array where appropriate|#31C4C4}}
    e$ = elements$: n$ = n2$
    {{Text|IF|#F0F0F0}} elementsize = {{Text|-2147483647|#F580B1}} {{Text|THEN|#F0F0F0}} stringarray = {{Text|1|#F580B1}}: elementsize = {{Text|8|#F580B1}}
    {{Text|IF|#F0F0F0}} {{Text|ASC|#F0F0F0}}(e$) = {{Text|63|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'?|#31C4C4}}
        l$ = {{Text|"("|#FFB100}} + sp2 + {{Text|")"|#FFB100}}
        undefined = {{Text|-1|#F580B1}}
        nume = {{Text|1|#F580B1}}
        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(e$) = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} undefinedarray
        undefined = {{Text|1|#F580B1}}
        nume = {{Text|VAL|#F0F0F0}}({{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - {{Text|1|#F580B1}}))
        {{Text|GOTO|#F0F0F0}} undefinedarray
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'work out how many elements there are (critical to later calculations)|#31C4C4}}
    nume = {{Text|1|#F580B1}}
    n = numelements(e$)
    {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} n
        e2$ = getelement(e$, i)
        {{Text|IF|#F0F0F0}} e2$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} b = b + {{Text|1|#F580B1}}
        {{Text|IF|#F0F0F0}} b = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} e2$ = {{Text|","|#FFB100}} {{Text|THEN|#F0F0F0}} nume = nume + {{Text|1|#F580B1}}
        {{Text|IF|#F0F0F0}} e2$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} b = b - {{Text|1|#F580B1}}
    {{Text|NEXT|#F0F0F0}}
    {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"numelements count:"|#FFB100}}; nume
    descstatic = {{Text|0|#F580B1}}
    {{Text|IF|#F0F0F0}} arraydesc {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} id.arrayelements <> nume {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} id.arrayelements = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'unknown|#31C4C4}}
                {{Text|IF|#F0F0F0}} arrayelementslist(currentid) <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} nume <> arrayelementslist(currentid) {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Cannot change the number of elements an array has!"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|IF|#F0F0F0}} nume = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} id.arrayelements = {{Text|1|#F580B1}}: ids(currentid).arrayelements = {{Text|1|#F580B1}} {{Text|'lucky guess!|#31C4C4}}
                arrayelementslist(currentid) = nume
            {{Text|ELSE|#F0F0F0}}
                Give_Error {{Text|"Cannot change the number of elements an array has!"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} id.staticarray {{Text|THEN|#F0F0F0}} descstatic = {{Text|1|#F580B1}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    l$ = {{Text|"("|#FFB100}} + sp2
    cr$ = {{Text|CHR$|#F0F0F0}}({{Text|13|#F580B1}}) + {{Text|CHR$|#F0F0F0}}({{Text|10|#F580B1}})
    sd$ = {{Text|""|#FFB100}}
    constdimensions = {{Text|1|#F580B1}}
    ei = {{Text|4|#F580B1}} + nume * {{Text|4|#F580B1}} - {{Text|4|#F580B1}}
    cure = {{Text|1|#F580B1}}
    e3$ = {{Text|""|#FFB100}}: e3base$ = {{Text|""|#FFB100}}
    {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} n
        e2$ = getelement(e$, i)
        {{Text|IF|#F0F0F0}} e2$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} b = b + {{Text|1|#F580B1}}
        {{Text|IF|#F0F0F0}} (e2$ = {{Text|","|#FFB100}} {{Text|AND|#F0F0F0}} b = {{Text|0|#F580B1}}) {{Text|OR|#F0F0F0}} i = n {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} i = n {{Text|THEN|#F0F0F0}} e3$ = e3$ + sp + e2$
            e3$ = {{Text|RIGHT$|#F0F0F0}}(e3$, {{Text|LEN|#F0F0F0}}(e3$) - {{Text|1|#F580B1}})
            {{Text|IF|#F0F0F0}} e3base$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} e3base$ = {{Text|RIGHT$|#F0F0F0}}(e3base$, {{Text|LEN|#F0F0F0}}(e3base$) - {{Text|1|#F580B1}})
            {{Text|'PRINT e3base$ + "[TO]" + e3$|#31C4C4}}
            {{Text|'set the base|#31C4C4}}
            basegiven = {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} e3base$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} e3base$ = str2$(optionbase + {{Text|0|#F580B1}}): basegiven = {{Text|0|#F580B1}}
            constequation = {{Text|1|#F580B1}}
            e3base$ = fixoperationorder$(e3base$)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|IF|#F0F0F0}} basegiven {{Text|THEN|#F0F0F0}} l$ = l$ + tlayout$ + sp + SCase$({{Text|"To"|#FFB100}}) + sp
            e3base$ = evaluatetotyp$(e3base$, {{Text|64&|#F580B1}})
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|IF|#F0F0F0}} constequation = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} constdimensions = {{Text|0|#F580B1}}
            sd$ = sd$ + n$ + {{Text|"["|#FFB100}} + str2(ei) + {{Text|"]="|#FFB100}} + e3base$ + {{Text|";"|#FFB100}} + cr$
            {{Text|'set the number of indexes|#31C4C4}}
            constequation = {{Text|1|#F580B1}}
            e3$ = fixoperationorder$(e3$)
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            l$ = l$ + tlayout$ + sp2
            {{Text|IF|#F0F0F0}} i = n {{Text|THEN|#F0F0F0}} l$ = l$ + {{Text|")"|#FFB100}} {{Text|ELSE|#F0F0F0}} l$ = l$ + {{Text|","|#FFB100}} + sp
            e3$ = evaluatetotyp$(e3$, {{Text|64&|#F580B1}})
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|IF|#F0F0F0}} constequation = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} constdimensions = {{Text|0|#F580B1}}
            ei = ei + {{Text|1|#F580B1}}
            sd$ = sd$ + n$ + {{Text|"["|#FFB100}} + str2(ei) + {{Text|"]=("|#FFB100}} + e3$ + {{Text|")-"|#FFB100}} + n$ + {{Text|"["|#FFB100}} + str2(ei - {{Text|1|#F580B1}}) + {{Text|"]+1;"|#FFB100}} + cr$
            ei = ei + {{Text|1|#F580B1}}
            {{Text|'calc muliplier|#31C4C4}}
            {{Text|IF|#F0F0F0}} cure = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|'set only for the purpose of the calculating correct multipliers|#31C4C4}}
                sd$ = sd$ + n$ + {{Text|"["|#FFB100}} + str2(ei) + {{Text|"]=1;"|#FFB100}} + cr$
            {{Text|ELSE|#F0F0F0}}
                sd$ = sd$ + n$ + {{Text|"["|#FFB100}} + str2(ei) + {{Text|"]="|#FFB100}} + n$ + {{Text|"["|#FFB100}} + str2(ei + {{Text|4|#F580B1}}) + {{Text|"]*"|#FFB100}} + n$ + {{Text|"["|#FFB100}} + str2(ei + {{Text|3|#F580B1}}) + {{Text|"];"|#FFB100}} + cr$
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            ei = ei + {{Text|1|#F580B1}}
            ei = ei + {{Text|1|#F580B1}} {{Text|'skip reserved|#31C4C4}}
            ei = ei - {{Text|8|#F580B1}}
            cure = cure + {{Text|1|#F580B1}}
            e3$ = {{Text|""|#FFB100}}: e3base$ = {{Text|""|#FFB100}}
            {{Text|GOTO|#F0F0F0}} aanexte
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} e2$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} b = b - {{Text|1|#F580B1}}
        {{Text|IF|#F0F0F0}} {{Text|UCASE$|#F0F0F0}}(e2$) = {{Text|"TO"|#FFB100}} {{Text|AND|#F0F0F0}} b = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            e3base$ = e3$
            e3$ = {{Text|""|#FFB100}}
        {{Text|ELSE|#F0F0F0}}
            e3$ = e3$ + sp + e2$
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        aanexte:
    {{Text|NEXT|#F0F0F0}}
    sd$ = {{Text|LEFT$|#F0F0F0}}(sd$, {{Text|LEN|#F0F0F0}}(sd$) - {{Text|2|#F580B1}})
    undefinedarray:
    {{Text|'calc cmem|#31C4C4}}
    cmem = {{Text|0|#F580B1}}
    {{Text|IF|#F0F0F0}} arraydesc = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} cmemlist(idn + {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} cmem = {{Text|1|#F580B1}}
    {{Text|ELSE|#F0F0F0}}
        {{Text|IF|#F0F0F0}} cmemlist(arraydesc) {{Text|THEN|#F0F0F0}} cmem = {{Text|1|#F580B1}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    staticarray = constdimensions
    {{Text|IF|#F0F0F0}} subfuncn <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} dimstatic = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} staticarray = {{Text|0|#F580B1}} {{Text|'arrays in SUBS/FUNCTIONS are DYNAMIC|#31C4C4}}
    {{Text|IF|#F0F0F0}} dimstatic = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} staticarray = {{Text|0|#F580B1}} {{Text|'STATIC arrayname() listed arrays keep thier values but are dynamic in memory|#31C4C4}}
    {{Text|IF|#F0F0F0}} DynamicMode {{Text|THEN|#F0F0F0}} staticarray = {{Text|0|#F580B1}}
    {{Text|IF|#F0F0F0}} redimoption {{Text|THEN|#F0F0F0}} staticarray = {{Text|0|#F580B1}}
    {{Text|IF|#F0F0F0}} dimoption = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} staticarray = {{Text|0|#F580B1}} {{Text|'STATIC a(100) arrays are still dynamic|#31C4C4}}
    {{Text|IF|#F0F0F0}} arraydesc {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} staticarray = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} descstatic {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Cannot redefine a static array!"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            staticarray = {{Text|0|#F580B1}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    bytesperelement$ = str2(elementsize)
    {{Text|IF|#F0F0F0}} elementsize < {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
        elementsize = {{Text|-elementsize|#F580B1}}
        bytesperelement$ = str2(elementsize) + {{Text|"/8+1"|#FFB100}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'Begin creation of array descriptor (if array has not been defined yet)|#31C4C4}}
    {{Text|IF|#F0F0F0}} arraydesc = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
        WriteBufLine defdatahandle, {{Text|"ptrszint *"|#FFB100}} + n$ + {{Text|"=NULL;"|#FFB100}}
        WriteBufLine DataTxtBuf, {{Text|"if (!"|#FFB100}} + n$ + {{Text|"){"|#FFB100}}
        WriteBufLine DataTxtBuf, n$ + {{Text|"=(ptrszint*)mem_static_malloc("|#FFB100}} + str2({{Text|4|#F580B1}} * nume + {{Text|4|#F580B1}} + {{Text|1|#F580B1}}) + {{Text|"*ptrsz);"|#FFB100}} {{Text|'+1 is for the lock|#31C4C4}}
        {{Text|'create _MEM lock|#31C4C4}}
        WriteBufLine DataTxtBuf, {{Text|"new_mem_lock();"|#FFB100}}
        WriteBufLine DataTxtBuf, {{Text|"mem_lock_tmp->type=4;"|#FFB100}}
        WriteBufLine DataTxtBuf, {{Text|"((ptrszint*)"|#FFB100}} + n$ + {{Text|")["|#FFB100}} + str2({{Text|4|#F580B1}} * nume + {{Text|4|#F580B1}} + {{Text|1|#F580B1}} - {{Text|1|#F580B1}}) + {{Text|"]=(ptrszint)mem_lock_tmp;"|#FFB100}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'generate sizestr$ & elesizestr$ (both are used in various places in following code)|#31C4C4}}
    sizestr$ = {{Text|""|#FFB100}}
    {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} nume
        {{Text|IF|#F0F0F0}} i <> {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} sizestr$ = sizestr$ + {{Text|"*"|#FFB100}}
        sizestr$ = sizestr$ + n$ + {{Text|"["|#FFB100}} + str2(i * {{Text|4|#F580B1}} - {{Text|4|#F580B1}} + {{Text|5|#F580B1}}) + {{Text|"]"|#FFB100}}
    {{Text|NEXT|#F0F0F0}}
    elesizestr$ = sizestr$ {{Text|'elements in entire array|#31C4C4}}
    sizestr$ = sizestr$ + {{Text|"*"|#FFB100}} + bytesperelement$ {{Text|'bytes in entire array|#31C4C4}}
    {{Text|'------------------STATIC ARRAY CREATION--------------------------------|#31C4C4}}
    {{Text|IF|#F0F0F0}} staticarray {{Text|THEN|#F0F0F0}}
        {{Text|'STATIC memory|#31C4C4}}
        WriteBufLine DataTxtBuf, sd$ {{Text|'setup new array dimension ranges|#31C4C4}}
        {{Text|'Example of sd$ for DIM a(10):|#31C4C4}}
        {{Text|'__ARRAY_SINGLE_A[4]= 0 ;|#31C4C4}}
        {{Text|'__ARRAY_SINGLE_A[5]=( 10 )-__ARRAY_SINGLE_A[4]+1;|#31C4C4}}
        {{Text|'__ARRAY_SINGLE_A[6]=1;|#31C4C4}}
        {{Text|IF|#F0F0F0}} cmem {{Text|AND|#F0F0F0}} stringarray = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|'Note: A string array's pointers are always stored in 64bit memory|#31C4C4}}
            {{Text|'(static)CONVENTINAL memory|#31C4C4}}
            WriteBufLine DataTxtBuf, n$ + {{Text|"[0]=(ptrszint)cmem_static_pointer;"|#FFB100}}
            {{Text|'alloc mem & check if static memory boundry has oversteped dynamic memory boundry|#31C4C4}}
            WriteBufLine DataTxtBuf, {{Text|"if ((cmem_static_pointer+=(("|#FFB100}} + sizestr$ + {{Text|")+15)&-16)>cmem_dynamic_base) error(257);"|#FFB100}}
            {{Text|'64K check|#31C4C4}}
            WriteBufLine DataTxtBuf, {{Text|"if (("|#FFB100}} + sizestr$ + {{Text|")>65536) error(257);"|#FFB100}}
            {{Text|'clear array|#31C4C4}}
            WriteBufLine DataTxtBuf, {{Text|"memset((void*)("|#FFB100}} + n$ + {{Text|"[0]),0,"|#FFB100}} + sizestr$ + {{Text|");"|#FFB100}}
            {{Text|'set flags|#31C4C4}}
            WriteBufLine DataTxtBuf, n$ + {{Text|"[2]=1+2+4;"|#FFB100}} {{Text|'init+static+cmem|#31C4C4}}
        {{Text|ELSE|#F0F0F0}}
            {{Text|'64BIT MEMORY|#31C4C4}}
            WriteBufLine DataTxtBuf, n$ + {{Text|"[0]=(ptrszint)mem_static_malloc("|#FFB100}} + sizestr$ + {{Text|");"|#FFB100}}
            {{Text|IF|#F0F0F0}} stringarray {{Text|THEN|#F0F0F0}}
                {{Text|'Init string pointers in the array|#31C4C4}}
                WriteBufLine DataTxtBuf, {{Text|"tmp_long="|#FFB100}} + elesizestr$ + {{Text|";"|#FFB100}}
                WriteBufLine DataTxtBuf, {{Text|"while(tmp_long--){"|#FFB100}}
                {{Text|IF|#F0F0F0}} cmem {{Text|THEN|#F0F0F0}}
                    WriteBufLine DataTxtBuf, {{Text|"((uint64*)("|#FFB100}} + n$ + {{Text|"[0]))[tmp_long]=(uint64)qbs_new_cmem(0,0);"|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    WriteBufLine DataTxtBuf, {{Text|"((uint64*)("|#FFB100}} + n$ + {{Text|"[0]))[tmp_long]=(uint64)qbs_new(0,0);"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                WriteBufLine DataTxtBuf, {{Text|"}"|#FFB100}}
            {{Text|ELSE|#F0F0F0}}
                {{Text|'clear array|#31C4C4}}
                WriteBufLine DataTxtBuf, {{Text|"memset((void*)("|#FFB100}} + n$ + {{Text|"[0]),0,"|#FFB100}} + sizestr$ + {{Text|");"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            WriteBufLine DataTxtBuf, n$ + {{Text|"[2]=1+2;"|#FFB100}} {{Text|'init+static|#31C4C4}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} udt > {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} udtxvariable(udt) {{Text|THEN|#F0F0F0}}
            WriteBufLine DataTxtBuf, {{Text|"tmp_long="|#FFB100}} + elesizestr$ + {{Text|";"|#FFB100}}
            WriteBufLine DataTxtBuf, {{Text|"while(tmp_long--){"|#FFB100}}
            initialise_array_udt_varstrings n$, udt, {{Text|0|#F580B1}}, bytesperelement$, acc$
            WriteBufLine DataTxtBuf, acc$
            WriteBufLine DataTxtBuf, {{Text|"}"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|'Close static array desc|#31C4C4}}
        WriteBufLine DataTxtBuf, {{Text|"}"|#FFB100}}
        allocarray = nume + {{Text|65536|#F580B1}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'------------------END OF STATIC ARRAY CREATION-------------------------|#31C4C4}}
    {{Text|'------------------DYNAMIC ARRAY CREATION-------------------------------|#31C4C4}}
    {{Text|IF|#F0F0F0}} staticarray = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} undefined = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|'Generate error if array is static|#31C4C4}}
            f12$ = f12$ + CRLF + {{Text|"if ("|#FFB100}} + n$ + {{Text|"[2]&2){"|#FFB100}} {{Text|'static array|#31C4C4}}
            f12$ = f12$ + CRLF + {{Text|"error(10);"|#FFB100}} {{Text|'cannot redefine a static array!|#31C4C4}}
            f12$ = f12$ + CRLF + {{Text|"}else{"|#FFB100}}
            {{Text|'Note: Array is either undefined or dynamically defined at this point|#31C4C4}}
            {{Text|'REDIM (not DIM) must be used to redefine an array|#31C4C4}}
            {{Text|IF|#F0F0F0}} redimoption = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                f12$ = f12$ + CRLF + {{Text|"if ("|#FFB100}} + n$ + {{Text|"[2]&1){"|#FFB100}} {{Text|'array is defined|#31C4C4}}
                f12$ = f12$ + CRLF + {{Text|"if (!error_occurred) error(10);"|#FFB100}} {{Text|'cannot redefine an array without using REDIM!|#31C4C4}}
                f12$ = f12$ + CRLF + {{Text|"}else{"|#FFB100}}
            {{Text|ELSE|#F0F0F0}}
                {{Text|'--------ERASE EXISTING ARRAY IF NECESSARY--------|#31C4C4}}
                {{Text|'IMPORTANT: If array is not going to be preserved, it should be cleared before|#31C4C4}}
                {{Text|'          creating the new array for memory considerations|#31C4C4}}
                {{Text|'refresh lock ID (_MEM)|#31C4C4}}
                f12$ = f12$ + CRLF + {{Text|"((mem_lock*)((ptrszint*)"|#FFB100}} + n$ + {{Text|")["|#FFB100}} + str2({{Text|4|#F580B1}} * nume + {{Text|4|#F580B1}} + {{Text|1|#F580B1}} - {{Text|1|#F580B1}}) + {{Text|"])->id=(++mem_lock_id);"|#FFB100}}
                {{Text|IF|#F0F0F0}} redimoption = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                    f12$ = f12$ + CRLF + {{Text|"static int32 preserved_elements;"|#FFB100}} {{Text|'must be put here for scope considerations|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'If array is defined, it must be destroyed first|#31C4C4}}
                f12$ = f12$ + CRLF + {{Text|"if ("|#FFB100}} + n$ + {{Text|"[2]&1){"|#FFB100}} {{Text|'array is defined|#31C4C4}}
                {{Text|IF|#F0F0F0}} redimoption = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                    f12$ = f12$ + CRLF + {{Text|"preserved_elements="|#FFB100}} + elesizestr$ + {{Text|";"|#FFB100}}
                    {{Text|GOTO|#F0F0F0}} skiperase
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'Note: pointers to strings must be freed before array can be freed|#31C4C4}}
                {{Text|IF|#F0F0F0}} stringarray {{Text|THEN|#F0F0F0}}
                    f12$ = f12$ + CRLF + {{Text|"tmp_long="|#FFB100}} + elesizestr$ + {{Text|";"|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|"while(tmp_long--) qbs_free((qbs*)((uint64*)("|#FFB100}} + n$ + {{Text|"[0]))[tmp_long]);"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'As must any variable length strings in UDT's|#31C4C4}}
                {{Text|IF|#F0F0F0}} udt > {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} udtxvariable(udt) {{Text|THEN|#F0F0F0}}
                    f12$ = f12$ + CRLF + {{Text|"tmp_long="|#FFB100}} + elesizestr$ + {{Text|";"|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|"while(tmp_long--) {"|#FFB100}}
                    free_array_udt_varstrings n$, udt, {{Text|0|#F580B1}}, bytesperelement$, acc$
                    f12$ = f12$ + acc$ + {{Text|"}"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'Free array's memory|#31C4C4}}
                {{Text|IF|#F0F0F0}} stringarray {{Text|THEN|#F0F0F0}}
                    {{Text|'Note: String arrays are never in cmem|#31C4C4}}
                    f12$ = f12$ + CRLF + {{Text|"free((void*)("|#FFB100}} + n$ + {{Text|"[0]));"|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    {{Text|'Note: Array may be in cmem!|#31C4C4}}
                    f12$ = f12$ + CRLF + {{Text|"if ("|#FFB100}} + n$ + {{Text|"[2]&4){"|#FFB100}} {{Text|'array is in cmem|#31C4C4}}
                    f12$ = f12$ + CRLF + {{Text|"cmem_dynamic_free((uint8*)("|#FFB100}} + n$ + {{Text|"[0]));"|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|"}else{"|#FFB100}} {{Text|'not in cmem|#31C4C4}}
                    f12$ = f12$ + CRLF + {{Text|"free((void*)("|#FFB100}} + n$ + {{Text|"[0]));"|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|"}"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                skiperase:
                f12$ = f12$ + CRLF + {{Text|"}"|#FFB100}} {{Text|'array was defined|#31C4C4}}
                {{Text|IF|#F0F0F0}} redimoption = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                    f12$ = f12$ + CRLF + {{Text|"else preserved_elements=0;"|#FFB100}} {{Text|'if array wasn't defined, no elements are preserved|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'--------ERASED ARRAY AS NECESSARY--------|#31C4C4}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'redim specified|#31C4C4}}
            {{Text|'--------CREATE ARRAY & CLEAN-UP CODE--------|#31C4C4}}
            {{Text|'Overwrite existing array dimension sizes/ranges|#31C4C4}}
            f12$ = f12$ + CRLF + sd$
            {{Text|IF|#F0F0F0}} stringarray {{Text|OR|#F0F0F0}} ((udt > {{Text|0|#F580B1}}) {{Text|AND|#F0F0F0}} udtxvariable(udt)) {{Text|THEN|#F0F0F0}}
                {{Text|'Note: String and variable-length udt arrays are always created in 64bit memory|#31C4C4}}
                {{Text|IF|#F0F0F0}} redimoption = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                    f12$ = f12$ + CRLF + {{Text|"if (preserved_elements){"|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|"static ptrszint tmp_long2;"|#FFB100}}
                    {{Text|'free any qbs strings which will be lost in the realloc|#31C4C4}}
                    f12$ = f12$ + CRLF + {{Text|"tmp_long2="|#FFB100}} + elesizestr$ + {{Text|";"|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|"if (tmp_long2<preserved_elements){"|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|"for(tmp_long=tmp_long2;tmp_long<preserved_elements;tmp_long++) {"|#FFB100}}
                    {{Text|IF|#F0F0F0}} stringarray {{Text|THEN|#F0F0F0}}
                        f12$ = f12$ + CRLF + {{Text|"qbs_free((qbs*)((uint64*)("|#FFB100}} + n$ + {{Text|"[0]))[tmp_long]);"|#FFB100}}
                    {{Text|ELSE|#F0F0F0}}
                        acc$ = {{Text|""|#FFB100}}
                        free_array_udt_varstrings n$, udt, {{Text|0|#F580B1}}, bytesperelement$, acc$
                        f12$ = f12$ + acc$
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    f12$ = f12$ + CRLF + {{Text|"}}"|#FFB100}}
                    {{Text|'reallocate the array|#31C4C4}}
                    f12$ = f12$ + CRLF + n$ + {{Text|"[0]=(ptrszint)realloc((void*)("|#FFB100}} + n$ + {{Text|"[0]),tmp_long2*"|#FFB100}} + bytesperelement$ + {{Text|");"|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|"if (!"|#FFB100}} + n$ + {{Text|"[0]) error(257);"|#FFB100}} {{Text|'not enough memory|#31C4C4}}
                    f12$ = f12$ + CRLF + {{Text|"if (preserved_elements<tmp_long2){"|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|"for(tmp_long=preserved_elements;tmp_long<tmp_long2;tmp_long++){"|#FFB100}}
                    {{Text|IF|#F0F0F0}} stringarray {{Text|THEN|#F0F0F0}}
                        f12$ = f12$ + CRLF + {{Text|"if ("|#FFB100}} + n$ + {{Text|"[2]&4){"|#FFB100}} {{Text|'array is in cmem|#31C4C4}}
                        f12$ = f12$ + CRLF + {{Text|"((uint64*)("|#FFB100}} + n$ + {{Text|"[0]))[tmp_long]=(uint64)qbs_new_cmem(0,0);"|#FFB100}}
                        f12$ = f12$ + CRLF + {{Text|"}else{"|#FFB100}} {{Text|'not in cmem|#31C4C4}}
                        f12$ = f12$ + CRLF + {{Text|"((uint64*)("|#FFB100}} + n$ + {{Text|"[0]))[tmp_long]=(uint64)qbs_new(0,0);"|#FFB100}}
                        f12$ = f12$ + CRLF + {{Text|"}"|#FFB100}} {{Text|'not in cmem|#31C4C4}}
                    {{Text|ELSE|#F0F0F0}}
                        acc$ = {{Text|""|#FFB100}}
                        initialise_array_udt_varstrings n$, udt, {{Text|0|#F580B1}}, bytesperelement$, acc$
                        f12$ = f12$ + acc$
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    f12$ = f12$ + CRLF + {{Text|"}"|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|"}"|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|"}else{"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'1. Create array|#31C4C4}}
                f12$ = f12$ + CRLF + n$ + {{Text|"[0]=(ptrszint)malloc("|#FFB100}} + sizestr$ + {{Text|");"|#FFB100}}
                f12$ = f12$ + CRLF + {{Text|"if (!"|#FFB100}} + n$ + {{Text|"[0]) error(257);"|#FFB100}} {{Text|'not enough memory|#31C4C4}}
                f12$ = f12$ + CRLF + n$ + {{Text|"[2]¦=1;"|#FFB100}} {{Text|'ADD initialized flag|#31C4C4}}
                f12$ = f12$ + CRLF + {{Text|"tmp_long="|#FFB100}} + elesizestr$ + {{Text|";"|#FFB100}}
                {{Text|'init individual strings|#31C4C4}}
                {{Text|IF|#F0F0F0}} stringarray {{Text|THEN|#F0F0F0}}
                    f12$ = f12$ + CRLF + {{Text|"if ("|#FFB100}} + n$ + {{Text|"[2]&4){"|#FFB100}} {{Text|'array is in cmem|#31C4C4}}
                    f12$ = f12$ + CRLF + {{Text|"while(tmp_long--) ((uint64*)("|#FFB100}} + n$ + {{Text|"[0]))[tmp_long]=(uint64)qbs_new_cmem(0,0);"|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|"}else{"|#FFB100}} {{Text|'not in cmem|#31C4C4}}
                    f12$ = f12$ + CRLF + {{Text|"while(tmp_long--) ((uint64*)("|#FFB100}} + n$ + {{Text|"[0]))[tmp_long]=(uint64)qbs_new(0,0);"|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|"}"|#FFB100}} {{Text|'not in cmem|#31C4C4}}
                {{Text|ELSE|#F0F0F0}} {{Text|'initialise udt's|#31C4C4}}
                    f12$ = f12$ + CRLF + {{Text|"while(tmp_long--){"|#FFB100}}
                    acc$ = {{Text|""|#FFB100}}
                    initialise_array_udt_varstrings n$, udt, {{Text|0|#F580B1}}, bytesperelement$, acc$
                    f12$ = f12$ + acc$ + {{Text|"}"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} redimoption = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                    f12$ = f12$ + CRLF + {{Text|"}"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'2. Generate "clean up" code (called when EXITING A SUB/FUNCTION)|#31C4C4}}
                {{Text|IF|#F0F0F0}} arraydesc = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'only add for first declaration of the array|#31C4C4}}
                    WriteBufLine FreeTxtBuf, {{Text|"if ("|#FFB100}} + n$ + {{Text|"[2]&1){"|#FFB100}} {{Text|'initialized?|#31C4C4}}
                    WriteBufLine FreeTxtBuf, {{Text|"tmp_long="|#FFB100}} + elesizestr$ + {{Text|";"|#FFB100}}
                    {{Text|IF|#F0F0F0}} udt > {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} udtxvariable(udt) {{Text|THEN|#F0F0F0}}
                        WriteBufLine FreeTxtBuf, {{Text|"while(tmp_long--) {"|#FFB100}}
                        acc$ = {{Text|""|#FFB100}}
                        free_array_udt_varstrings n$, udt, {{Text|0|#F580B1}}, bytesperelement$, acc$
                        WriteBufLine FreeTxtBuf, acc$ + {{Text|"}"|#FFB100}}
                    {{Text|ELSE|#F0F0F0}}
                        WriteBufLine FreeTxtBuf, {{Text|"while(tmp_long--) qbs_free((qbs*)((uint64*)("|#FFB100}} + n$ + {{Text|"[0]))[tmp_long]);"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    WriteBufLine FreeTxtBuf, {{Text|"free((void*)("|#FFB100}} + n$ + {{Text|"[0]));"|#FFB100}}
                    WriteBufLine FreeTxtBuf, {{Text|"}"|#FFB100}}
                    {{Text|'free lock (_MEM)|#31C4C4}}
                    WriteBufLine FreeTxtBuf, {{Text|"free_mem_lock( (mem_lock*)((ptrszint*)"|#FFB100}} + n$ + {{Text|")["|#FFB100}} + str2({{Text|4|#F580B1}} * nume + {{Text|4|#F580B1}} + {{Text|1|#F580B1}} - {{Text|1|#F580B1}}) + {{Text|"] );"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|ELSE|#F0F0F0}} {{Text|'not string/var-udt array|#31C4C4}}
                {{Text|'1. Create array|#31C4C4}}
                f12$ = f12$ + CRLF + {{Text|"if ("|#FFB100}} + n$ + {{Text|"[2]&4){"|#FFB100}} {{Text|'array will be in cmem|#31C4C4}}
                {{Text|IF|#F0F0F0}} redimoption = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                    f12$ = f12$ + CRLF + {{Text|"if (preserved_elements){"|#FFB100}}
                    {{Text|'reallocation method|#31C4C4}}
                    {{Text|'backup data|#31C4C4}}
                    f12$ = f12$ + CRLF + {{Text|"memcpy(redim_preserve_cmem_buffer,(void*)("|#FFB100}} + n$ + {{Text|"[0]),preserved_elements*"|#FFB100}} + bytesperelement$ + {{Text|");"|#FFB100}}
                    {{Text|'free old array|#31C4C4}}
                    f12$ = f12$ + CRLF + {{Text|"cmem_dynamic_free((uint8*)("|#FFB100}} + n$ + {{Text|"[0]));"|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|"tmp_long="|#FFB100}} + elesizestr$ + {{Text|";"|#FFB100}}
                    f12$ = f12$ + CRLF + n$ + {{Text|"[0]=(ptrszint)cmem_dynamic_malloc(tmp_long*"|#FFB100}} + bytesperelement$ + {{Text|");"|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|"memcpy((void*)("|#FFB100}} + n$ + {{Text|"[0]),redim_preserve_cmem_buffer,preserved_elements*"|#FFB100}} + bytesperelement$ + {{Text|");"|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|"if (preserved_elements<tmp_long) ZeroMemory(((uint8*)("|#FFB100}} + n$ + {{Text|"[0]))+preserved_elements*"|#FFB100}} + bytesperelement$ + {{Text|",(tmp_long*"|#FFB100}} + bytesperelement$ + {{Text|")-(preserved_elements*"|#FFB100}} + bytesperelement$ + {{Text|"));"|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|"}else{"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'standard cmem method|#31C4C4}}
                f12$ = f12$ + CRLF + n$ + {{Text|"[0]=(ptrszint)cmem_dynamic_malloc("|#FFB100}} + sizestr$ + {{Text|");"|#FFB100}}
                {{Text|'clear array|#31C4C4}}
                f12$ = f12$ + CRLF + {{Text|"memset((void*)("|#FFB100}} + n$ + {{Text|"[0]),0,"|#FFB100}} + sizestr$ + {{Text|");"|#FFB100}}
                {{Text|IF|#F0F0F0}} redimoption = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                    f12$ = f12$ + CRLF + {{Text|"}"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                f12$ = f12$ + CRLF + {{Text|"}else{"|#FFB100}} {{Text|'not in cmem|#31C4C4}}
                {{Text|IF|#F0F0F0}} redimoption = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                    f12$ = f12$ + CRLF + {{Text|"if (preserved_elements){"|#FFB100}}
                    {{Text|'reallocation method|#31C4C4}}
                    f12$ = f12$ + CRLF + {{Text|"tmp_long="|#FFB100}} + elesizestr$ + {{Text|";"|#FFB100}}
                    f12$ = f12$ + CRLF + n$ + {{Text|"[0]=(ptrszint)realloc((void*)("|#FFB100}} + n$ + {{Text|"[0]),tmp_long*"|#FFB100}} + bytesperelement$ + {{Text|");"|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|"if (!"|#FFB100}} + n$ + {{Text|"[0]) error(257);"|#FFB100}} {{Text|'not enough memory|#31C4C4}}
                    f12$ = f12$ + CRLF + {{Text|"if (preserved_elements<tmp_long) ZeroMemory(((uint8*)("|#FFB100}} + n$ + {{Text|"[0]))+preserved_elements*"|#FFB100}} + bytesperelement$ + {{Text|",(tmp_long*"|#FFB100}} + bytesperelement$ + {{Text|")-(preserved_elements*"|#FFB100}} + bytesperelement$ + {{Text|"));"|#FFB100}}
                    f12$ = f12$ + CRLF + {{Text|"}else{"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'standard allocation method|#31C4C4}}
                f12$ = f12$ + CRLF + n$ + {{Text|"[0]=(ptrszint)calloc("|#FFB100}} + sizestr$ + {{Text|",1);"|#FFB100}}
                f12$ = f12$ + CRLF + {{Text|"if (!"|#FFB100}} + n$ + {{Text|"[0]) error(257);"|#FFB100}} {{Text|'not enough memory|#31C4C4}}
                {{Text|IF|#F0F0F0}} redimoption = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                    f12$ = f12$ + CRLF + {{Text|"}"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                f12$ = f12$ + CRLF + {{Text|"}"|#FFB100}} {{Text|'not in cmem|#31C4C4}}
                f12$ = f12$ + CRLF + n$ + {{Text|"[2]¦=1;"|#FFB100}} {{Text|'ADD initialized flag|#31C4C4}}
                {{Text|'2. Generate "clean up" code (called when EXITING A SUB/FUNCTION)|#31C4C4}}
                {{Text|IF|#F0F0F0}} arraydesc = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'only add for first declaration of the array|#31C4C4}}
                    WriteBufLine FreeTxtBuf, {{Text|"if ("|#FFB100}} + n$ + {{Text|"[2]&1){"|#FFB100}} {{Text|'initialized?|#31C4C4}}
                    WriteBufLine FreeTxtBuf, {{Text|"if ("|#FFB100}} + n$ + {{Text|"[2]&4){"|#FFB100}} {{Text|'array is in cmem|#31C4C4}}
                    WriteBufLine FreeTxtBuf, {{Text|"cmem_dynamic_free((uint8*)("|#FFB100}} + n$ + {{Text|"[0]));"|#FFB100}}
                    WriteBufLine FreeTxtBuf, {{Text|"}else{"|#FFB100}}
                    WriteBufLine FreeTxtBuf, {{Text|"free((void*)("|#FFB100}} + n$ + {{Text|"[0]));"|#FFB100}}
                    WriteBufLine FreeTxtBuf, {{Text|"}"|#FFB100}} {{Text|'cmem|#31C4C4}}
                    WriteBufLine FreeTxtBuf, {{Text|"}"|#FFB100}} {{Text|'init|#31C4C4}}
                    {{Text|'free lock (_MEM)|#31C4C4}}
                    WriteBufLine FreeTxtBuf, {{Text|"free_mem_lock( (mem_lock*)((ptrszint*)"|#FFB100}} + n$ + {{Text|")["|#FFB100}} + str2({{Text|4|#F580B1}} * nume + {{Text|4|#F580B1}} + {{Text|1|#F580B1}} - {{Text|1|#F580B1}}) + {{Text|"] );"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'not string array|#31C4C4}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'undefined=0|#31C4C4}}
        {{Text|'----FINISH ARRAY DESCRIPTOR IF DEFINING FOR THE FIRST TIME----|#31C4C4}}
        {{Text|IF|#F0F0F0}} arraydesc = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|'Note: Array is init as undefined (& possibly a cmem flag)|#31C4C4}}
            {{Text|IF|#F0F0F0}} cmem {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, n$ + {{Text|"[2]=4;"|#FFB100}} {{Text|ELSE|#F0F0F0}} WriteBufLine DataTxtBuf, n$ + {{Text|"[2]=0;"|#FFB100}}
            {{Text|'set dimensions as undefined|#31C4C4}}
            {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} nume
                b = i * {{Text|4|#F580B1}}
                WriteBufLine DataTxtBuf, n$ + {{Text|"["|#FFB100}} + str2(b) + {{Text|"]=2147483647;"|#FFB100}} {{Text|'base|#31C4C4}}
                WriteBufLine DataTxtBuf, n$ + {{Text|"["|#FFB100}} + str2(b + {{Text|1|#F580B1}}) + {{Text|"]=0;"|#FFB100}} {{Text|'num. index|#31C4C4}}
                WriteBufLine DataTxtBuf, n$ + {{Text|"["|#FFB100}} + str2(b + {{Text|2|#F580B1}}) + {{Text|"]=0;"|#FFB100}} {{Text|'multiplier|#31C4C4}}
            {{Text|NEXT|#F0F0F0}}
            {{Text|IF|#F0F0F0}} stringarray {{Text|THEN|#F0F0F0}}
                {{Text|'set array's data offset to the offset of the offset to nothingstring|#31C4C4}}
                WriteBufLine DataTxtBuf, n$ + {{Text|"[0]=(ptrszint)&nothingstring;"|#FFB100}}
            {{Text|ELSE|#F0F0F0}}
                {{Text|'set array's data offset to "nothing"|#31C4C4}}
                WriteBufLine DataTxtBuf, n$ + {{Text|"[0]=(ptrszint)nothingvalue;"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            WriteBufLine DataTxtBuf, {{Text|"}"|#FFB100}} {{Text|'close array descriptor|#31C4C4}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'arraydesc = 0|#31C4C4}}
        {{Text|IF|#F0F0F0}} undefined = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} redimoption = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} f12$ = f12$ + CRLF + {{Text|"}"|#FFB100}} {{Text|'if REDIM not specified the above is conditional|#31C4C4}}
            f12$ = f12$ + CRLF + {{Text|"}"|#FFB100}} {{Text|'not static|#31C4C4}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'undefined=0|#31C4C4}}
        allocarray = nume
        {{Text|IF|#F0F0F0}} undefined = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} allocarray = {{Text|-1|#F580B1}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} autoary = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} dimoption = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'STATIC a(100) puts creation code in main|#31C4C4}}
            WriteBufLine DataTxtBuf, f12$
        {{Text|ELSE|#F0F0F0}}
            WriteBufLine MainTxtBuf, f12$
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'[8] offset of data|#31C4C4}}
    {{Text|'[8] reserved (could be used to store a bit offset)|#31C4C4}}
    {{Text|'(the following repeats depending on the number of elements)|#31C4C4}}
    {{Text|'[4] base-offset|#31C4C4}}
    {{Text|'[4] number of indexes|#31C4C4}}
    {{Text|'[4] multiplier (the last multiplier doesn't actually exist)|#31C4C4}}
    {{Text|'[4] reserved|#31C4C4}}
    dimshared = dimsharedlast
    tlayout$ = l$
{{Text|END|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
{{Text|FUNCTION|#F0F0F0}} arrayreference$ (indexes$, typ)
    arrayprocessinghappened = {{Text|1|#F580B1}}
    {{Text|'*returns an array reference: idnumber ¦ index$|#31C4C4}}
    {{Text|'*does not take into consideration the type of the array|#31C4C4}}
    {{Text|'*expects array id to be passed in the global id structure|#31C4C4}}
    idnumber$ = str2(currentid)
    {{Text|DIM|#F0F0F0}} id2 {{Text|AS|#F0F0F0}} idstruct
    id2 = id
    a$ = indexes$
    typ = id2.arraytype + ISARRAY + ISREFERENCE
    n$ = {{Text|RTRIM$|#F0F0F0}}(id2.callname)
    {{Text|IF|#F0F0F0}} a$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|'no indexes passed eg. a()|#31C4C4}}
        r$ = {{Text|"0"|#FFB100}}
        {{Text|GOTO|#F0F0F0}} gotarrayindex
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    n = numelements(a$)
    {{Text|'find number of elements supplied|#31C4C4}}
    elements = {{Text|1|#F580B1}}
    b = {{Text|0|#F580B1}}
    {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} n
        a = {{Text|ASC|#F0F0F0}}(getelement(a$, i))
        {{Text|IF|#F0F0F0}} a = {{Text|40|#F580B1}} {{Text|THEN|#F0F0F0}} b = b + {{Text|1|#F580B1}}
        {{Text|IF|#F0F0F0}} a = {{Text|41|#F580B1}} {{Text|THEN|#F0F0F0}} b = b - {{Text|1|#F580B1}}
        {{Text|IF|#F0F0F0}} a = {{Text|44|#F580B1}} {{Text|AND|#F0F0F0}} b = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} elements = elements + {{Text|1|#F580B1}}
    {{Text|NEXT|#F0F0F0}}
    {{Text|IF|#F0F0F0}} id2.arrayelements = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} arrayelementslist(currentid) <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} elements <> arrayelementslist(currentid) {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Cannot change the number of elements an array has!"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|IF|#F0F0F0}} elements = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} id2.arrayelements = {{Text|1|#F580B1}}: ids(currentid).arrayelements = {{Text|1|#F580B1}} {{Text|'lucky guess|#31C4C4}}
        arrayelementslist(currentid) = elements
    {{Text|ELSE|#F0F0F0}}
        {{Text|IF|#F0F0F0}} elements <> id2.arrayelements {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Cannot change the number of elements an array has!"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    curarg = {{Text|1|#F580B1}}
    firsti = {{Text|1|#F580B1}}
    {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} n
        l$ = getelement(a$, i)
        {{Text|IF|#F0F0F0}} l$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} b = b + {{Text|1|#F580B1}}
        {{Text|IF|#F0F0F0}} l$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} b = b - {{Text|1|#F580B1}}
        {{Text|IF|#F0F0F0}} (l$ = {{Text|","|#FFB100}} {{Text|AND|#F0F0F0}} b = {{Text|0|#F580B1}}) {{Text|OR|#F0F0F0}} (i = n) {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} i = n {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} l$ = {{Text|","|#FFB100}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Array index missing"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                e$ = evaluatetotyp(getelements$(a$, firsti, i), {{Text|64&|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|ELSE|#F0F0F0}}
                e$ = evaluatetotyp(getelements$(a$, firsti, i - {{Text|1|#F580B1}}), {{Text|64&|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} e$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Array index missing"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            argi = (elements - curarg) * {{Text|4|#F580B1}} + {{Text|4|#F580B1}}
            {{Text|IF|#F0F0F0}} curarg = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} NoChecks = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    r$ = r$ + {{Text|"array_check(("|#FFB100}} + e$ + {{Text|")-"|#FFB100}} + n$ + {{Text|"["|#FFB100}} + str2(argi) + {{Text|"],"|#FFB100}} + n$ + {{Text|"["|#FFB100}} + str2(argi + {{Text|1|#F580B1}}) + {{Text|"])+"|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    r$ = r$ + {{Text|"("|#FFB100}} + e$ + {{Text|")-"|#FFB100}} + n$ + {{Text|"["|#FFB100}} + str2(argi) + {{Text|"]+"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|ELSE|#F0F0F0}}
                {{Text|IF|#F0F0F0}} NoChecks = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    r$ = r$ + {{Text|"array_check(("|#FFB100}} + e$ + {{Text|")-"|#FFB100}} + n$ + {{Text|"["|#FFB100}} + str2(argi) + {{Text|"],"|#FFB100}} + n$ + {{Text|"["|#FFB100}} + str2(argi + {{Text|1|#F580B1}}) + {{Text|"])*"|#FFB100}} + n$ + {{Text|"["|#FFB100}} + str2(argi + {{Text|2|#F580B1}}) + {{Text|"]+"|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    r$ = r$ + {{Text|"(("|#FFB100}} + e$ + {{Text|")-"|#FFB100}} + n$ + {{Text|"["|#FFB100}} + str2(argi) + {{Text|"])*"|#FFB100}} + n$ + {{Text|"["|#FFB100}} + str2(argi + {{Text|2|#F580B1}}) + {{Text|"]+"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            firsti = i + {{Text|1|#F580B1}}
            curarg = curarg + {{Text|1|#F580B1}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|NEXT|#F0F0F0}}
    r$ = {{Text|LEFT$|#F0F0F0}}(r$, {{Text|LEN|#F0F0F0}}(r$) - {{Text|1|#F580B1}}) {{Text|'remove trailing +|#31C4C4}}
    gotarrayindex:
    r$ = idnumber$ + sp3 + r$
    arrayreference$ = r$
    {{Text|'PRINT "arrayreference returning:" + r$|#31C4C4}}
{{Text|END|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
{{Text|SUB|#F0F0F0}} assign (a$, n)
    {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} n
        c = {{Text|ASC|#F0F0F0}}(getelement$(a$, i))
        {{Text|IF|#F0F0F0}} c = {{Text|40|#F580B1}} {{Text|THEN|#F0F0F0}} b = b + {{Text|1|#F580B1}} {{Text|'(|#31C4C4}}
        {{Text|IF|#F0F0F0}} c = {{Text|41|#F580B1}} {{Text|THEN|#F0F0F0}} b = b - {{Text|1|#F580B1}} {{Text|')|#31C4C4}}
        {{Text|IF|#F0F0F0}} c = {{Text|61|#F580B1}} {{Text|AND|#F0F0F0}} b = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'=|#31C4C4}}
            {{Text|IF|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected ... ="|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|SUB|#F0F0F0}}
            {{Text|IF|#F0F0F0}} i = n {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected = ..."|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|SUB|#F0F0F0}}
            a2$ = fixoperationorder(getelements$(a$, {{Text|1|#F580B1}}, i - {{Text|1|#F580B1}}))
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|SUB|#F0F0F0}}
            l$ = tlayout$ + sp + {{Text|"="|#FFB100}} + sp
            {{Text|'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)|#31C4C4}}
            {{Text|IF|#F0F0F0}} i = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'lhs has only 1 element|#31C4C4}}
                try = findid(a2$)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|SUB|#F0F0F0}}
                {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
                    {{Text|IF|#F0F0F0}} id.t {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} subfuncn = id.insubfuncn {{Text|THEN|#F0F0F0}} {{Text|'avoid global before local|#31C4C4}}
                            {{Text|IF|#F0F0F0}} (id.t {{Text|AND|#F0F0F0}} ISUDT) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                makeidrefer a2$, typ
                                {{Text|GOTO|#F0F0F0}} assignsimplevariable
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(a2$) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|SUB|#F0F0F0}}
                {{Text|LOOP|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            a2$ = evaluate$(a2$, typ): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|SUB|#F0F0F0}}
            assignsimplevariable:
            {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISREFERENCE) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected variable ="|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|SUB|#F0F0F0}}
            setrefer a2$, typ, getelements$(a$, i + {{Text|1|#F580B1}}, n), {{Text|0|#F580B1}}
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|SUB|#F0F0F0}}
            tlayout$ = l$ + tlayout$
            {{Text|EXIT|#F0F0F0}} {{Text|SUB|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'=,b=0|#31C4C4}}
    {{Text|NEXT|#F0F0F0}}
    Give_Error {{Text|"Expected ="|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|SUB|#F0F0F0}}
{{Text|END|#F0F0F0}} {{Text|SUB|#F0F0F0}}
{{Text|SUB|#F0F0F0}} clearid
    id = cleariddata
{{Text|END|#F0F0F0}} {{Text|SUB|#F0F0F0}}
{{Text|SUB|#F0F0F0}} vWatchVariable (this$, action {{Text|AS|#F0F0F0}} {{Text|_BYTE|#F0F0F0}})
    {{Text|STATIC|#F0F0F0}} totalLocalVariables {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}, localVariablesList$
    {{Text|STATIC|#F0F0F0}} totalMainModuleVariables {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}, mainModuleVariablesList$
    {{Text|SELECT|#F0F0F0}} {{Text|CASE|#F0F0F0}} action
        {{Text|CASE|#F0F0F0}} {{Text|-1|#F580B1}} {{Text|'reset|#31C4C4}}
            totalLocalVariables = {{Text|0|#F580B1}}
            localVariablesList$ = {{Text|""|#FFB100}}
            totalMainModuleVariables = {{Text|0|#F580B1}}
            mainModuleVariablesList$ = {{Text|""|#FFB100}}
        {{Text|CASE|#F0F0F0}} {{Text|0|#F580B1}} {{Text|'add|#31C4C4}}
            {{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(vWatchVariableExclusions$, {{Text|"@"|#FFB100}} + this$ + {{Text|"@"|#FFB100}}) > {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(this$, {{Text|12|#F580B1}}) = {{Text|"_SUB_VWATCH_"|#FFB100}} {{Text|THEN|#F0F0F0}}
                {{Text|EXIT|#F0F0F0}} {{Text|SUB|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            vWatchNewVariable$ = this$
            {{Text|IF|#F0F0F0}} subfunc = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
                totalMainModuleVariables = totalMainModuleVariables + {{Text|1|#F580B1}}
                mainModuleVariablesList$ = mainModuleVariablesList$ + {{Text|"vwatch_global_vars["|#FFB100}} + str2$(totalMainModuleVariables - {{Text|1|#F580B1}}) + {{Text|"] = &"|#FFB100}} + this$ + {{Text|";"|#FFB100}} + CRLF
                manageVariableList id.cn, this$, totalMainModuleVariables - {{Text|1|#F580B1}}, {{Text|0|#F580B1}}
            {{Text|ELSE|#F0F0F0}}
                totalLocalVariables = totalLocalVariables + {{Text|1|#F580B1}}
                localVariablesList$ = localVariablesList$ + {{Text|"vwatch_local_vars["|#FFB100}} + str2$(totalLocalVariables - {{Text|1|#F580B1}}) + {{Text|"] = &"|#FFB100}} + this$ + {{Text|";"|#FFB100}} + CRLF
                manageVariableList id.cn, this$, totalLocalVariables - {{Text|1|#F580B1}}, {{Text|0|#F580B1}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|CASE|#F0F0F0}} {{Text|1|#F580B1}} {{Text|'dump to data[].txt & reset|#31C4C4}}
            {{Text|IF|#F0F0F0}} subfunc = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} totalMainModuleVariables > {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    WriteBufLine DataTxtBuf, {{Text|"void *vwatch_local_vars[0];"|#FFB100}}
                    WriteBufLine GlobTxtBuf, {{Text|"void *vwatch_global_vars["|#FFB100}} + {{Text|STR$|#F0F0F0}}(totalMainModuleVariables) + {{Text|"];"|#FFB100}}
                    WriteBufLine DataTxtBuf, mainModuleVariablesList$
                {{Text|ELSE|#F0F0F0}}
                    WriteBufLine DataTxtBuf, {{Text|"void *vwatch_local_vars[0];"|#FFB100}}
                    WriteBufLine GlobTxtBuf, {{Text|"void *vwatch_global_vars[0];"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                mainModuleVariablesList$ = {{Text|""|#FFB100}}
                totalMainModuleVariables = {{Text|0|#F580B1}}
            {{Text|ELSE|#F0F0F0}}
                {{Text|IF|#F0F0F0}} subfunc <> {{Text|"SUB_VWATCH"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} totalLocalVariables > {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        WriteBufLine DataTxtBuf, {{Text|"void *vwatch_local_vars["|#FFB100}} + {{Text|STR$|#F0F0F0}}(totalLocalVariables) + {{Text|"];"|#FFB100}}
                        WriteBufLine DataTxtBuf, localVariablesList$
                    {{Text|ELSE|#F0F0F0}}
                        WriteBufLine DataTxtBuf, {{Text|"void *vwatch_local_vars[0];"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|ELSE|#F0F0F0}}
                    WriteBufLine DataTxtBuf, {{Text|"void *vwatch_local_vars[0];"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                localVariablesList$ = {{Text|""|#FFB100}}
                totalLocalVariables = {{Text|0|#F580B1}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|SELECT|#F0F0F0}}
{{Text|END|#F0F0F0}} {{Text|SUB|#F0F0F0}}
{{Text|SUB|#F0F0F0}} vWatchAddLabel (this {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}, lastLine {{Text|AS|#F0F0F0}} {{Text|_BYTE|#F0F0F0}})
    {{Text|STATIC|#F0F0F0}} prevLabel {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}, prevSkip {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
    {{Text|IF|#F0F0F0}} lastLine = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|WHILE|#F0F0F0}} this > {{Text|LEN|#F0F0F0}}(vWatchUsedLabels)
            vWatchUsedLabels = vWatchUsedLabels + {{Text|SPACE$|#F0F0F0}}({{Text|1000|#F580B1}})
            vWatchUsedSkipLabels = vWatchUsedSkipLabels + {{Text|SPACE$|#F0F0F0}}({{Text|1000|#F580B1}})
        {{Text|WEND|#F0F0F0}}
        {{Text|IF|#F0F0F0}} firstLineNumberLabelvWatch = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            firstLineNumberLabelvWatch = this
        {{Text|ELSE|#F0F0F0}}
            {{Text|IF|#F0F0F0}} prevSkip <> prevLabel {{Text|THEN|#F0F0F0}}
                {{Text|ASC|#F0F0F0}}(vWatchUsedSkipLabels, prevLabel) = {{Text|1|#F580B1}}
                WriteBufLine MainTxtBuf, {{Text|"VWATCH_SKIPLABEL_"|#FFB100}} + str2$(prevLabel) + {{Text|":;"|#FFB100}}
                prevSkip = prevLabel
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} prevLabel <> this {{Text|THEN|#F0F0F0}}
            {{Text|ASC|#F0F0F0}}(vWatchUsedLabels, this) = {{Text|1|#F580B1}}
            WriteBufLine MainTxtBuf, {{Text|"VWATCH_LABEL_"|#FFB100}} + str2$(this) + {{Text|":;"|#FFB100}}
            prevLabel = this
            lastLineNumberLabelvWatch = this
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|ELSE|#F0F0F0}}
        {{Text|IF|#F0F0F0}} prevSkip <> prevLabel {{Text|THEN|#F0F0F0}}
            {{Text|ASC|#F0F0F0}}(vWatchUsedSkipLabels, prevLabel) = {{Text|1|#F580B1}}
            WriteBufLine MainTxtBuf, {{Text|"VWATCH_SKIPLABEL_"|#FFB100}} + str2$(prevLabel) + {{Text|":;"|#FFB100}}
            prevSkip = prevLabel
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
{{Text|END|#F0F0F0}} {{Text|SUB|#F0F0F0}}
{{Text|SUB|#F0F0F0}} closemain
    xend
    WriteBufLine MainTxtBuf, {{Text|"return;"|#FFB100}}
    {{Text|IF|#F0F0F0}} vWatchOn {{Text|AND|#F0F0F0}} firstLineNumberLabelvWatch > {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
        WriteBufLine MainTxtBuf, {{Text|"VWATCH_SETNEXTLINE:;"|#FFB100}}
        WriteBufLine MainTxtBuf, {{Text|"switch (*__LONG_VWATCH_GOTO) {"|#FFB100}}
        {{Text|FOR|#F0F0F0}} i = firstLineNumberLabelvWatch {{Text|TO|#F0F0F0}} lastLineNumberLabelvWatch
            {{Text|IF|#F0F0F0}} {{Text|ASC|#F0F0F0}}(vWatchUsedLabels, i) = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                WriteBufLine MainTxtBuf, {{Text|"    case "|#FFB100}} + str2$(i) + {{Text|":"|#FFB100}}
                WriteBufLine MainTxtBuf, {{Text|"        goto VWATCH_LABEL_"|#FFB100}} + str2$(i) + {{Text|";"|#FFB100}}
                WriteBufLine MainTxtBuf, {{Text|"        break;"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|NEXT|#F0F0F0}}
        WriteBufLine MainTxtBuf, {{Text|"    default:"|#FFB100}}
        WriteBufLine MainTxtBuf, {{Text|"        *__LONG_VWATCH_GOTO=*__LONG_VWATCH_LINENUMBER;"|#FFB100}}
        WriteBufLine MainTxtBuf, {{Text|"        goto VWATCH_SETNEXTLINE;"|#FFB100}}
        WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}}
        WriteBufLine MainTxtBuf, {{Text|"VWATCH_SKIPLINE:;"|#FFB100}}
        WriteBufLine MainTxtBuf, {{Text|"switch (*__LONG_VWATCH_GOTO) {"|#FFB100}}
        {{Text|FOR|#F0F0F0}} i = firstLineNumberLabelvWatch {{Text|TO|#F0F0F0}} lastLineNumberLabelvWatch
            {{Text|IF|#F0F0F0}} {{Text|ASC|#F0F0F0}}(vWatchUsedSkipLabels, i) = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                WriteBufLine MainTxtBuf, {{Text|"    case -"|#FFB100}} + str2$(i) + {{Text|":"|#FFB100}}
                WriteBufLine MainTxtBuf, {{Text|"        goto VWATCH_SKIPLABEL_"|#FFB100}} + str2$(i) + {{Text|";"|#FFB100}}
                WriteBufLine MainTxtBuf, {{Text|"        break;"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|NEXT|#F0F0F0}}
        WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    WriteBufLine MainTxtBuf, {{Text|"}"|#FFB100}}
    WriteBufLine RetTxtBuf, {{Text|"}"|#FFB100}} {{Text|'end case|#31C4C4}}
    WriteBufLine RetTxtBuf, {{Text|"}"|#FFB100}}
    WriteBufLine RetTxtBuf, {{Text|"error(3);"|#FFB100}} {{Text|'no valid return possible|#31C4C4}}
    closedmain = {{Text|1|#F580B1}}
    firstLineNumberLabelvWatch = {{Text|0|#F580B1}}
{{Text|END|#F0F0F0}} {{Text|SUB|#F0F0F0}}
{{Text|FUNCTION|#F0F0F0}} countelements (a$)
    n = numelements(a$)
    c = {{Text|1|#F580B1}}
    {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} n
        e$ = getelement$(a$, i)
        {{Text|IF|#F0F0F0}} e$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} b = b + {{Text|1|#F580B1}}
        {{Text|IF|#F0F0F0}} e$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} b = b - {{Text|1|#F580B1}}
        {{Text|IF|#F0F0F0}} b < {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Unexpected ) encountered"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|IF|#F0F0F0}} e$ = {{Text|","|#FFB100}} {{Text|AND|#F0F0F0}} b = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} c = c + {{Text|1|#F580B1}}
    {{Text|NEXT|#F0F0F0}}
    countelements = c
{{Text|END|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
{{Text|FUNCTION|#F0F0F0}} dim2 (varname$, typ2$, method, elements$)
    {{Text|'notes: (DO NOT REMOVE THESE IMPORTANT USAGE NOTES)|#31C4C4}}
    {{Text|'|#31C4C4}}
    {{Text|'(shared)dimsfarray: Creates an ID only (no C++ code)|#31C4C4}}
    {{Text|'                    Adds an index/'link' to the sub/function's argument|#31C4C4}}
    {{Text|'                        ID.sfid=glinkid|#31C4C4}}
    {{Text|'                        ID.sfarg=glinkarg|#31C4C4}}
    {{Text|'                    Sets arrayelements=-1 'unknown' (if elements$="?") otherwise val(elements$)|#31C4C4}}
    {{Text|'                    ***Does not refer to arrayelementslist()***|#31C4C4}}
    {{Text|'|#31C4C4}}
    {{Text|'(argument)method: 0 being created by a DIM name AS type|#31C4C4}}
    {{Text|'                  1 being created by a DIM name+symbol|#31C4C4}}
    {{Text|'                  or automatically without the use of DIM|#31C4C4}}
    {{Text|'|#31C4C4}}
    {{Text|'elements$="?": (see also dimsfarray for that special case)|#31C4C4}}
    {{Text|'              Checks arrayelementslist() and;|#31C4C4}}
    {{Text|'              if unknown(=0), creates an ID only|#31C4C4}}
    {{Text|'              if known, creates a DYNAMIC array's C++ initialization code so it can be used later|#31C4C4}}
    typ$ = typ2$
    dim2 = {{Text|1|#F580B1}} {{Text|'success|#31C4C4}}
    {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"dim2 called"|#FFB100}}, method
    cvarname$ = varname$
    l$ = cvarname$
    varname$ = {{Text|UCASE$|#F0F0F0}}(varname$)
    {{Text|IF|#F0F0F0}} dimsfarray = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} f = {{Text|0|#F580B1}} {{Text|ELSE|#F0F0F0}} f = {{Text|1|#F580B1}}
    {{Text|IF|#F0F0F0}} dimstatic <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} dimshared = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|'name will have include the sub/func name in its scope|#31C4C4}}
        {{Text|'variable/array will be created in main on startup|#31C4C4}}
        defdatahandle = GlobTxtBuf
        DataTxtBuf = OpenBuffer%({{Text|"A"|#FFB100}}, tmpdir$ + {{Text|"maindata.txt"|#FFB100}})
        FreeTxtBuf = OpenBuffer%({{Text|"A"|#FFB100}}, tmpdir$ + {{Text|"mainfree.txt"|#FFB100}})
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    scope2$ = module$ + {{Text|"_"|#FFB100}} + subfunc$ + {{Text|"_"|#FFB100}}
    {{Text|'Note: when REDIMing a SHARED array in dynamic memory scope2$ must be modified|#31C4C4}}
    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(typ$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"DIM2: No type specified!"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|'UDT|#31C4C4}}
    {{Text|'is it a udt?|#31C4C4}}
    {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} lasttype
        {{Text|IF|#F0F0F0}} typ$ = {{Text|RTRIM$|#F0F0F0}}(udtxname(i)) {{Text|OR|#F0F0F0}} (typ$ = {{Text|"MEM"|#FFB100}} {{Text|AND|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(udtxname(i)) = {{Text|"_MEM"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
            dim2typepassback$ = {{Text|RTRIM$|#F0F0F0}}(udtxcname(i))
            {{Text|IF|#F0F0F0}} typ$ = {{Text|"MEM"|#FFB100}} {{Text|AND|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(udtxname(i)) = {{Text|"_MEM"|#FFB100}} {{Text|THEN|#F0F0F0}}
                dim2typepassback$ = {{Text|MID$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(udtxcname(i)), {{Text|2|#F580B1}})
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            n$ = {{Text|"UDT_"|#FFB100}} + varname$
            {{Text|'array of UDTs|#31C4C4}}
            {{Text|IF|#F0F0F0}} elements$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
                arraydesc = {{Text|0|#F580B1}}
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                    try = findid(varname$)
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
                        {{Text|IF|#F0F0F0}} (id.arraytype) {{Text|THEN|#F0F0F0}}
                            l$ = {{Text|RTRIM$|#F0F0F0}}(id.cn)
                            arraydesc = currentid: scope2$ = scope$
                            {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(varname$) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|LOOP|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                n$ = scope2$ + {{Text|"ARRAY_"|#FFB100}} + n$
                bits = udtxsize(i)
                {{Text|IF|#F0F0F0}} udtxbytealign(i) {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} bits {{Text|MOD|#F0F0F0}} {{Text|8|#F580B1}} {{Text|THEN|#F0F0F0}} bits = bits + {{Text|8|#F580B1}} - (bits {{Text|MOD|#F0F0F0}} {{Text|8|#F580B1}})
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(elements$) = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|ASC|#F0F0F0}}(elements$) = {{Text|63|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'"?"|#31C4C4}}
                        E = arrayelementslist(idn + {{Text|1|#F580B1}}): {{Text|IF|#F0F0F0}} E {{Text|THEN|#F0F0F0}} elements$ = elements$ + str2$(E) {{Text|'eg. "?3" for a 3 dimensional array|#31C4C4}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    nume = allocarray(n$, elements$, {{Text|-bits|#F580B1}}, i)
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    l$ = l$ + sp + tlayout$
                    {{Text|IF|#F0F0F0}} arraydesc {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} dim2exitfunc
                    clearid
                {{Text|ELSE|#F0F0F0}}
                    clearid
                    {{Text|IF|#F0F0F0}} elements$ = {{Text|"?"|#FFB100}} {{Text|THEN|#F0F0F0}}
                        nume = {{Text|-1|#F580B1}}
                        id.linkid = glinkid
                        id.linkarg = glinkarg
                    {{Text|ELSE|#F0F0F0}}
                        nume = {{Text|VAL|#F0F0F0}}(elements$)
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                id.arraytype = UDTTYPE + i
                {{Text|IF|#F0F0F0}} cmemlist(idn + {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} id.arraytype = id.arraytype + ISINCONVENTIONALMEMORY
                id.n = cvarname$
                {{Text|IF|#F0F0F0}} nume > {{Text|65536|#F580B1}} {{Text|THEN|#F0F0F0}} nume = nume - {{Text|65536|#F580B1}}: id.staticarray = {{Text|1|#F580B1}}
                id.arrayelements = nume
                id.callname = n$
                regid
                vWatchVariable n$, {{Text|0|#F580B1}}
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|GOTO|#F0F0F0}} dim2exitfunc
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'not an array of UDTs|#31C4C4}}
            bits = udtxsize(i): bytes = bits \ {{Text|8|#F580B1}}
            {{Text|IF|#F0F0F0}} bits {{Text|MOD|#F0F0F0}} {{Text|8|#F580B1}} {{Text|THEN|#F0F0F0}}
                bytes = bytes + {{Text|1|#F580B1}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            n$ = scope2$ + n$
            {{Text|IF|#F0F0F0}} f {{Text|THEN|#F0F0F0}} WriteBufLine defdatahandle, {{Text|"void *"|#FFB100}} + n$ + {{Text|"=NULL;"|#FFB100}}
            clearid
            id.n = cvarname$
            id.t = UDTTYPE + i
            {{Text|IF|#F0F0F0}} cmemlist(idn + {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
                id.t = id.t + ISINCONVENTIONALMEMORY
                {{Text|IF|#F0F0F0}} f {{Text|THEN|#F0F0F0}}
                    WriteBufLine DataTxtBuf, {{Text|"if("|#FFB100}} + n$ + {{Text|"==NULL){"|#FFB100}}
                    WriteBufLine DataTxtBuf, {{Text|"cmem_sp-="|#FFB100}} + str2(bytes) + {{Text|";"|#FFB100}}
                    WriteBufLine DataTxtBuf, {{Text|"if (cmem_sp<qbs_cmem_sp) error(257);"|#FFB100}}
                    WriteBufLine DataTxtBuf, n$ + {{Text|"=(void*)(dblock+cmem_sp);"|#FFB100}}
                    WriteBufLine DataTxtBuf, {{Text|"memset("|#FFB100}} + n$ + {{Text|",0,"|#FFB100}} + str2(bytes) + {{Text|");"|#FFB100}}
                    WriteBufLine DataTxtBuf, {{Text|"}"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|ELSE|#F0F0F0}}
                {{Text|IF|#F0F0F0}} f {{Text|THEN|#F0F0F0}}
                    WriteBufLine DataTxtBuf, {{Text|"if("|#FFB100}} + n$ + {{Text|"==NULL){"|#FFB100}}
                    WriteBufLine DataTxtBuf, n$ + {{Text|"=(void*)mem_static_malloc("|#FFB100}} + str2$(bytes) + {{Text|");"|#FFB100}}
                    WriteBufLine DataTxtBuf, {{Text|"memset("|#FFB100}} + n$ + {{Text|",0,"|#FFB100}} + str2(bytes) + {{Text|");"|#FFB100}}
                    {{Text|IF|#F0F0F0}} udtxvariable(i) {{Text|THEN|#F0F0F0}}
                        initialise_udt_varstrings n$, i, DataTxtBuf, {{Text|0|#F580B1}}
                        free_udt_varstrings n$, i, FreeTxtBuf, {{Text|0|#F580B1}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    WriteBufLine DataTxtBuf, {{Text|"}"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            id.callname = n$
            regid
            vWatchVariable n$, {{Text|0|#F580B1}}
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|GOTO|#F0F0F0}} dim2exitfunc
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|NEXT|#F0F0F0}} i
    {{Text|'it isn't a udt|#31C4C4}}
    typ$ = symbol2fulltypename$(typ$)
    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|'check if _UNSIGNED was specified|#31C4C4}}
    unsgn = {{Text|0|#F580B1}}
    {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(typ$, {{Text|10|#F580B1}}) = {{Text|"_UNSIGNED "|#FFB100}} {{Text|OR|#F0F0F0}} ({{Text|LEFT$|#F0F0F0}}(typ$, {{Text|9|#F580B1}}) = {{Text|"UNSIGNED "|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
        unsgn = {{Text|1|#F580B1}}
        typ$ = {{Text|MID$|#F0F0F0}}(typ$, {{Text|INSTR|#F0F0F0}}(typ$, {{Text|CHR$|#F0F0F0}}({{Text|32|#F580B1}})) + {{Text|1|#F580B1}})
        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(typ$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected more type information after "|#FFB100}} + qb64prefix$ + {{Text|"UNSIGNED!"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    n$ = {{Text|""|#FFB100}} {{Text|'n$ is assumed to be "" after branching into the code for each type|#31C4C4}}
    {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(typ$, {{Text|6|#F580B1}}) = {{Text|"STRING"|#FFB100}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(typ$) > {{Text|6|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(typ$, {{Text|9|#F580B1}}) <> {{Text|"STRING * "|#FFB100}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected STRING * number/constant"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            c$ = {{Text|RIGHT$|#F0F0F0}}(typ$, {{Text|LEN|#F0F0F0}}(typ$) - {{Text|9|#F580B1}})
            {{Text|'constant check 2011|#31C4C4}}
            hashfound = {{Text|0|#F580B1}}
            hashname$ = c$
            hashchkflags = HASHFLAG_CONSTANT
            hashres = HashFindRev(hashname$, hashchkflags, hashresflags, hashresref)
            {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} hashres
                {{Text|IF|#F0F0F0}} constsubfunc(hashresref) = subfuncn {{Text|OR|#F0F0F0}} constsubfunc(hashresref) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} constdefined(hashresref) {{Text|THEN|#F0F0F0}}
                        hashfound = {{Text|1|#F580B1}}
                        {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} hashres <> {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} hashres = HashFindCont(hashresflags, hashresref) {{Text|ELSE|#F0F0F0}} hashres = {{Text|0|#F580B1}}
            {{Text|LOOP|#F0F0F0}}
            {{Text|IF|#F0F0F0}} hashfound {{Text|THEN|#F0F0F0}}
                i2 = hashresref
                t = consttype(i2)
                {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected STRING * numeric-constant"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|'convert value to general formats|#31C4C4}}
                {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISFLOAT {{Text|THEN|#F0F0F0}}
                    v## = constfloat(i2)
                    v&& = v##
                    v~&& = v&&
                {{Text|ELSE|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISUNSIGNED {{Text|THEN|#F0F0F0}}
                        v~&& = constuinteger(i2)
                        v&& = v~&&
                        v## = v&&
                    {{Text|ELSE|#F0F0F0}}
                        v&& = constinteger(i2)
                        v## = v&&
                        v~&& = v&&
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} v&& < {{Text|1|#F580B1}} {{Text|OR|#F0F0F0}} v&& > {{Text|9999999999|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"STRING * out-of-range constant"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                bytes = v&&
                dim2typepassback$ = SCase$({{Text|"String * "|#FFB100}}) + constcname(i2)
                {{Text|GOTO|#F0F0F0}} constantlenstr
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} isuinteger(c$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Number/Constant expected after *"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(c$) > {{Text|10|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Too many characters in number after *"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            bytes = {{Text|VAL|#F0F0F0}}(c$)
            {{Text|IF|#F0F0F0}} bytes = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Cannot create a fixed string of length 0"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            constantlenstr:
            n$ = {{Text|"STRING"|#FFB100}} + str2(bytes) + {{Text|"_"|#FFB100}} + varname$
            {{Text|'array of fixed length strings|#31C4C4}}
            {{Text|IF|#F0F0F0}} elements$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
                arraydesc = {{Text|0|#F580B1}}
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                    try = findid(varname$ + {{Text|"$"|#FFB100}})
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
                        {{Text|IF|#F0F0F0}} (id.arraytype) {{Text|THEN|#F0F0F0}}
                            l$ = {{Text|RTRIM$|#F0F0F0}}(id.cn)
                            arraydesc = currentid: scope2$ = scope$
                            {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(varname$ + {{Text|"$"|#FFB100}}) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|LOOP|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                n$ = scope2$ + {{Text|"ARRAY_"|#FFB100}} + n$
                {{Text|'nume = allocarray(n$, elements$, bytes)|#31C4C4}}
                {{Text|'IF arraydesc THEN goto dim2exitfunc 'id already exists!|#31C4C4}}
                {{Text|'clearid|#31C4C4}}
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(elements$) = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|ASC|#F0F0F0}}(elements$) = {{Text|63|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'"?"|#31C4C4}}
                        E = arrayelementslist(idn + {{Text|1|#F580B1}}): {{Text|IF|#F0F0F0}} E {{Text|THEN|#F0F0F0}} elements$ = elements$ + str2$(E) {{Text|'eg. "?3" for a 3 dimensional array|#31C4C4}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    nume = allocarray(n$, elements$, bytes, {{Text|0|#F580B1}})
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    l$ = l$ + sp + tlayout$
                    {{Text|IF|#F0F0F0}} arraydesc {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} dim2exitfunc
                    clearid
                {{Text|ELSE|#F0F0F0}}
                    clearid
                    {{Text|IF|#F0F0F0}} elements$ = {{Text|"?"|#FFB100}} {{Text|THEN|#F0F0F0}}
                        nume = {{Text|-1|#F580B1}}
                        id.linkid = glinkid
                        id.linkarg = glinkarg
                    {{Text|ELSE|#F0F0F0}}
                        nume = {{Text|VAL|#F0F0F0}}(elements$)
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                id.arraytype = STRINGTYPE + ISFIXEDLENGTH
                {{Text|IF|#F0F0F0}} cmemlist(idn + {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} id.arraytype = id.arraytype + ISINCONVENTIONALMEMORY
                id.n = cvarname$
                {{Text|IF|#F0F0F0}} nume > {{Text|65536|#F580B1}} {{Text|THEN|#F0F0F0}} nume = nume - {{Text|65536|#F580B1}}: id.staticarray = {{Text|1|#F580B1}}
                id.arrayelements = nume
                id.callname = n$
                id.tsize = bytes
                {{Text|IF|#F0F0F0}} method = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    id.mayhave = {{Text|"$"|#FFB100}} + str2(bytes)
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} method = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                    id.musthave = {{Text|"$"|#FFB100}} + str2(bytes)
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                regid
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                vWatchVariable n$, {{Text|0|#F580B1}}
                {{Text|GOTO|#F0F0F0}} dim2exitfunc
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'standard fixed length string|#31C4C4}}
            n$ = scope2$ + n$
            {{Text|IF|#F0F0F0}} f {{Text|THEN|#F0F0F0}} WriteBufLine defdatahandle, {{Text|"qbs *"|#FFB100}} + n$ + {{Text|"=NULL;"|#FFB100}}
            {{Text|IF|#F0F0F0}} f {{Text|THEN|#F0F0F0}} WriteBufLine FreeTxtBuf, {{Text|"qbs_free("|#FFB100}} + n$ + {{Text|");"|#FFB100}} {{Text|'so descriptor can be freed|#31C4C4}}
            clearid
            id.n = cvarname$
            id.t = STRINGTYPE + ISFIXEDLENGTH
            {{Text|IF|#F0F0F0}} cmemlist(idn + {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
                id.t = id.t + ISINCONVENTIONALMEMORY
                {{Text|IF|#F0F0F0}} f {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"if("|#FFB100}} + n$ + {{Text|"==NULL){"|#FFB100}}
                {{Text|IF|#F0F0F0}} f {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"cmem_sp-="|#FFB100}} + str2(bytes) + {{Text|";"|#FFB100}}
                {{Text|IF|#F0F0F0}} f {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"if (cmem_sp<qbs_cmem_sp) error(257);"|#FFB100}}
                {{Text|IF|#F0F0F0}} f {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, n$ + {{Text|"=qbs_new_fixed((uint8*)(dblock+cmem_sp),"|#FFB100}} + str2(bytes) + {{Text|",0);"|#FFB100}}
                {{Text|IF|#F0F0F0}} f {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"memset("|#FFB100}} + n$ + {{Text|"->chr,0,"|#FFB100}} + str2(bytes) + {{Text|");"|#FFB100}}
                {{Text|IF|#F0F0F0}} f {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"}"|#FFB100}}
            {{Text|ELSE|#F0F0F0}}
                {{Text|IF|#F0F0F0}} f {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"if("|#FFB100}} + n$ + {{Text|"==NULL){"|#FFB100}}
                o$ = {{Text|"(uint8*)mem_static_malloc("|#FFB100}} + str2$(bytes) + {{Text|")"|#FFB100}}
                {{Text|IF|#F0F0F0}} f {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, n$ + {{Text|"=qbs_new_fixed("|#FFB100}} + o$ + {{Text|","|#FFB100}} + str2$(bytes) + {{Text|",0);"|#FFB100}}
                {{Text|IF|#F0F0F0}} f {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"memset("|#FFB100}} + n$ + {{Text|"->chr,0,"|#FFB100}} + str2$(bytes) + {{Text|");"|#FFB100}}
                {{Text|IF|#F0F0F0}} f {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"}"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            id.tsize = bytes
            {{Text|IF|#F0F0F0}} method = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                id.mayhave = {{Text|"$"|#FFB100}} + str2(bytes)
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} method = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                id.musthave = {{Text|"$"|#FFB100}} + str2(bytes)
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            id.callname = n$
            regid
            vWatchVariable n$, {{Text|0|#F580B1}}
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|GOTO|#F0F0F0}} dim2exitfunc
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|'variable length string processing|#31C4C4}}
        n$ = {{Text|"STRING_"|#FFB100}} + varname$
        {{Text|'array of variable length strings|#31C4C4}}
        {{Text|IF|#F0F0F0}} elements$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
            arraydesc = {{Text|0|#F580B1}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                try = findid(varname$ + {{Text|"$"|#FFB100}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
                    {{Text|IF|#F0F0F0}} (id.arraytype) {{Text|THEN|#F0F0F0}}
                        l$ = {{Text|RTRIM$|#F0F0F0}}(id.cn)
                        arraydesc = currentid: scope2$ = scope$
                        {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(varname$ + {{Text|"$"|#FFB100}}) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|LOOP|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            n$ = scope2$ + {{Text|"ARRAY_"|#FFB100}} + n$
            {{Text|'nume = allocarray(n$, elements$, -2147483647) '-2147483647=STRING|#31C4C4}}
            {{Text|'IF arraydesc THEN goto dim2exitfunc 'id already exists!|#31C4C4}}
            {{Text|'clearid|#31C4C4}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(elements$) = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|ASC|#F0F0F0}}(elements$) = {{Text|63|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'"?"|#31C4C4}}
                    E = arrayelementslist(idn + {{Text|1|#F580B1}}): {{Text|IF|#F0F0F0}} E {{Text|THEN|#F0F0F0}} elements$ = elements$ + str2$(E) {{Text|'eg. "?3" for a 3 dimensional array|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                nume = allocarray(n$, elements$, {{Text|-2147483647|#F580B1}}, {{Text|0|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                l$ = l$ + sp + tlayout$
                {{Text|IF|#F0F0F0}} arraydesc {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} dim2exitfunc
                clearid
            {{Text|ELSE|#F0F0F0}}
                clearid
                {{Text|IF|#F0F0F0}} elements$ = {{Text|"?"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    nume = {{Text|-1|#F580B1}}
                    id.linkid = glinkid
                    id.linkarg = glinkarg
                {{Text|ELSE|#F0F0F0}}
                    nume = {{Text|VAL|#F0F0F0}}(elements$)
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            id.n = cvarname$
            id.arraytype = STRINGTYPE
            {{Text|IF|#F0F0F0}} cmemlist(idn + {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} id.arraytype = id.arraytype + ISINCONVENTIONALMEMORY
            {{Text|IF|#F0F0F0}} nume > {{Text|65536|#F580B1}} {{Text|THEN|#F0F0F0}} nume = nume - {{Text|65536|#F580B1}}: id.staticarray = {{Text|1|#F580B1}}
            id.arrayelements = nume
            id.callname = n$
            {{Text|IF|#F0F0F0}} method = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                id.mayhave = {{Text|"$"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} method = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                id.musthave = {{Text|"$"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            regid
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            vWatchVariable n$, {{Text|0|#F580B1}}
            {{Text|GOTO|#F0F0F0}} dim2exitfunc
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|'standard variable length string|#31C4C4}}
        n$ = scope2$ + n$
        clearid
        id.n = cvarname$
        id.t = STRINGTYPE
        {{Text|IF|#F0F0F0}} cmemlist(idn + {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} f {{Text|THEN|#F0F0F0}} WriteBufLine defdatahandle, {{Text|"qbs *"|#FFB100}} + n$ + {{Text|"=NULL;"|#FFB100}}
            {{Text|IF|#F0F0F0}} f {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"if (!"|#FFB100}} + n$ + {{Text|")"|#FFB100}} + n$ + {{Text|"=qbs_new_cmem(0,0);"|#FFB100}}
            id.t = id.t + ISINCONVENTIONALMEMORY
        {{Text|ELSE|#F0F0F0}}
            {{Text|IF|#F0F0F0}} f {{Text|THEN|#F0F0F0}} WriteBufLine defdatahandle, {{Text|"qbs *"|#FFB100}} + n$ + {{Text|"=NULL;"|#FFB100}}
            {{Text|IF|#F0F0F0}} f {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"if (!"|#FFB100}} + n$ + {{Text|")"|#FFB100}} + n$ + {{Text|"=qbs_new(0,0);"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} f {{Text|THEN|#F0F0F0}} WriteBufLine FreeTxtBuf, {{Text|"qbs_free("|#FFB100}} + n$ + {{Text|");"|#FFB100}}
        {{Text|IF|#F0F0F0}} method = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            id.mayhave = {{Text|"$"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} method = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
            id.musthave = {{Text|"$"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        id.callname = n$
        regid
        vWatchVariable n$, {{Text|0|#F580B1}}
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|GOTO|#F0F0F0}} dim2exitfunc
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(typ$, {{Text|4|#F580B1}}) = {{Text|"_BIT"|#FFB100}} {{Text|OR|#F0F0F0}} ({{Text|LEFT$|#F0F0F0}}(typ$, {{Text|3|#F580B1}}) = {{Text|"BIT"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} ({{Text|LEFT$|#F0F0F0}}(typ$, {{Text|4|#F580B1}}) = {{Text|"_BIT"|#FFB100}} {{Text|AND|#F0F0F0}} {{Text|LEN|#F0F0F0}}(typ$) > {{Text|4|#F580B1}}) {{Text|OR|#F0F0F0}} ({{Text|LEFT$|#F0F0F0}}(typ$, {{Text|3|#F580B1}}) = {{Text|"BIT"|#FFB100}} {{Text|AND|#F0F0F0}} {{Text|LEN|#F0F0F0}}(typ$) > {{Text|3|#F580B1}}) {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(typ$, {{Text|7|#F580B1}}) <> {{Text|"_BIT * "|#FFB100}} {{Text|AND|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(typ$, {{Text|6|#F580B1}}) <> {{Text|"BIT * "|#FFB100}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected "|#FFB100}} + qb64prefix$ + {{Text|"BIT * number"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            c$ = {{Text|MID$|#F0F0F0}}(typ$, {{Text|INSTR|#F0F0F0}}(typ$, {{Text|" * "|#FFB100}}) + {{Text|3|#F580B1}})
            {{Text|IF|#F0F0F0}} isuinteger(c$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Number expected after *"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(c$) > {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Cannot create a bit variable of size > 64 bits"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            bits = {{Text|VAL|#F0F0F0}}(c$)
            {{Text|IF|#F0F0F0}} bits = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Cannot create a bit variable of size 0 bits"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|IF|#F0F0F0}} bits > {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Cannot create a bit variable of size > 64 bits"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|ELSE|#F0F0F0}}
            bits = {{Text|1|#F580B1}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} bits <= {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} ct$ = {{Text|"int32"|#FFB100}} {{Text|ELSE|#F0F0F0}} ct$ = {{Text|"int64"|#FFB100}}
        {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} n$ = {{Text|"U"|#FFB100}}: ct$ = {{Text|"u"|#FFB100}} + ct$
        n$ = n$ + {{Text|"BIT"|#FFB100}} + str2(bits) + {{Text|"_"|#FFB100}} + varname$
        {{Text|'array of bit-length variables|#31C4C4}}
        {{Text|IF|#F0F0F0}} elements$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} bits > {{Text|63|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Cannot create a bit array of size > 63 bits"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            arraydesc = {{Text|0|#F580B1}}
            cmps$ = varname$: {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} cmps$ = cmps$ + {{Text|"~"|#FFB100}}
            cmps$ = cmps$ + {{Text|"`"|#FFB100}} + str2(bits)
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                try = findid(cmps$)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
                    {{Text|IF|#F0F0F0}} (id.arraytype) {{Text|THEN|#F0F0F0}}
                        l$ = {{Text|RTRIM$|#F0F0F0}}(id.cn)
                        arraydesc = currentid: scope2$ = scope$
                        {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(cmps$) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|LOOP|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            n$ = scope2$ + {{Text|"ARRAY_"|#FFB100}} + n$
            {{Text|'nume = allocarray(n$, elements$, -bits) 'passing a negative element size signifies bits not bytes|#31C4C4}}
            {{Text|'IF arraydesc THEN goto dim2exitfunc 'id already exists!|#31C4C4}}
            {{Text|'clearid|#31C4C4}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(elements$) = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|ASC|#F0F0F0}}(elements$) = {{Text|63|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'"?"|#31C4C4}}
                    E = arrayelementslist(idn + {{Text|1|#F580B1}}): {{Text|IF|#F0F0F0}} E {{Text|THEN|#F0F0F0}} elements$ = elements$ + str2$(E) {{Text|'eg. "?3" for a 3 dimensional array|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                nume = allocarray(n$, elements$, {{Text|-bits|#F580B1}}, {{Text|0|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                l$ = l$ + sp + tlayout$
                {{Text|IF|#F0F0F0}} arraydesc {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} dim2exitfunc
                clearid
            {{Text|ELSE|#F0F0F0}}
                clearid
                {{Text|IF|#F0F0F0}} elements$ = {{Text|"?"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    nume = {{Text|-1|#F580B1}}
                    id.linkid = glinkid
                    id.linkarg = glinkarg
                {{Text|ELSE|#F0F0F0}}
                    nume = {{Text|VAL|#F0F0F0}}(elements$)
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            id.n = cvarname$
            id.arraytype = BITTYPE - {{Text|1|#F580B1}} + bits
            {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} id.arraytype = id.arraytype + ISUNSIGNED
            {{Text|IF|#F0F0F0}} cmemlist(idn + {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} id.arraytype = id.arraytype + ISINCONVENTIONALMEMORY
            {{Text|IF|#F0F0F0}} nume > {{Text|65536|#F580B1}} {{Text|THEN|#F0F0F0}} nume = nume - {{Text|65536|#F580B1}}: id.staticarray = {{Text|1|#F580B1}}
            id.arrayelements = nume
            id.callname = n$
            {{Text|IF|#F0F0F0}} method = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} id.mayhave = {{Text|"~`"|#FFB100}} + str2(bits) {{Text|ELSE|#F0F0F0}} id.mayhave = {{Text|"`"|#FFB100}} + str2(bits)
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} method = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} id.musthave = {{Text|"~`"|#FFB100}} + str2(bits) {{Text|ELSE|#F0F0F0}} id.musthave = {{Text|"`"|#FFB100}} + str2(bits)
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            regid
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            vWatchVariable n$, {{Text|0|#F580B1}}
            {{Text|GOTO|#F0F0F0}} dim2exitfunc
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|'standard bit-length variable|#31C4C4}}
        n$ = scope2$ + n$
        WriteBufLine defdatahandle, ct$ + {{Text|" *"|#FFB100}} + n$ + {{Text|"=NULL;"|#FFB100}}
        WriteBufLine DataTxtBuf, {{Text|"if("|#FFB100}} + n$ + {{Text|"==NULL){"|#FFB100}}
        WriteBufLine DataTxtBuf, {{Text|"cmem_sp-=4;"|#FFB100}}
        WriteBufLine DataTxtBuf, {{Text|"if (cmem_sp<qbs_cmem_sp) error(257);"|#FFB100}}
        WriteBufLine DataTxtBuf, n$ + {{Text|"=("|#FFB100}} + ct$ + {{Text|"*)(dblock+cmem_sp);"|#FFB100}}
        WriteBufLine DataTxtBuf, {{Text|"*"|#FFB100}} + n$ + {{Text|"=0;"|#FFB100}}
        WriteBufLine DataTxtBuf, {{Text|"}"|#FFB100}}
        clearid
        id.n = cvarname$
        id.t = BITTYPE - {{Text|1|#F580B1}} + bits + ISINCONVENTIONALMEMORY: {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} id.t = id.t + ISUNSIGNED
        {{Text|IF|#F0F0F0}} method = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} id.mayhave = {{Text|"~`"|#FFB100}} + str2(bits) {{Text|ELSE|#F0F0F0}} id.mayhave = {{Text|"`"|#FFB100}} + str2(bits)
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} method = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} id.musthave = {{Text|"~`"|#FFB100}} + str2(bits) {{Text|ELSE|#F0F0F0}} id.musthave = {{Text|"`"|#FFB100}} + str2(bits)
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        id.callname = n$
        regid
        vWatchVariable n$, {{Text|0|#F580B1}}
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|GOTO|#F0F0F0}} dim2exitfunc
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} typ$ = {{Text|"_BYTE"|#FFB100}} {{Text|OR|#F0F0F0}} (typ$ = {{Text|"BYTE"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
        ct$ = {{Text|"int8"|#FFB100}}
        {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} n$ = {{Text|"U"|#FFB100}}: ct$ = {{Text|"u"|#FFB100}} + ct$
        n$ = n$ + {{Text|"BYTE_"|#FFB100}} + varname$
        {{Text|IF|#F0F0F0}} elements$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
            arraydesc = {{Text|0|#F580B1}}
            cmps$ = varname$: {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} cmps$ = cmps$ + {{Text|"~"|#FFB100}}
            cmps$ = cmps$ + {{Text|"%%"|#FFB100}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                try = findid(cmps$)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
                    {{Text|IF|#F0F0F0}} (id.arraytype) {{Text|THEN|#F0F0F0}}
                        l$ = {{Text|RTRIM$|#F0F0F0}}(id.cn)
                        arraydesc = currentid: scope2$ = scope$
                        {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(cmps$) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|LOOP|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            n$ = scope2$ + {{Text|"ARRAY_"|#FFB100}} + n$
            {{Text|'nume = allocarray(n$, elements$, 1)|#31C4C4}}
            {{Text|'IF arraydesc THEN goto dim2exitfunc|#31C4C4}}
            {{Text|'clearid|#31C4C4}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(elements$) = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|ASC|#F0F0F0}}(elements$) = {{Text|63|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'"?"|#31C4C4}}
                    E = arrayelementslist(idn + {{Text|1|#F580B1}}): {{Text|IF|#F0F0F0}} E {{Text|THEN|#F0F0F0}} elements$ = elements$ + str2$(E) {{Text|'eg. "?3" for a 3 dimensional array|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                nume = allocarray(n$, elements$, {{Text|1|#F580B1}}, {{Text|0|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                l$ = l$ + sp + tlayout$
                {{Text|IF|#F0F0F0}} arraydesc {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} dim2exitfunc
                clearid
            {{Text|ELSE|#F0F0F0}}
                clearid
                {{Text|IF|#F0F0F0}} elements$ = {{Text|"?"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    nume = {{Text|-1|#F580B1}}
                    id.linkid = glinkid
                    id.linkarg = glinkarg
                {{Text|ELSE|#F0F0F0}}
                    nume = {{Text|VAL|#F0F0F0}}(elements$)
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            id.arraytype = BYTETYPE: {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} id.arraytype = id.arraytype + ISUNSIGNED
            {{Text|IF|#F0F0F0}} cmemlist(idn + {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} id.arraytype = id.arraytype + ISINCONVENTIONALMEMORY
            {{Text|IF|#F0F0F0}} nume > {{Text|65536|#F580B1}} {{Text|THEN|#F0F0F0}} nume = nume - {{Text|65536|#F580B1}}: id.staticarray = {{Text|1|#F580B1}}
            id.arrayelements = nume
            id.callname = n$
        {{Text|ELSE|#F0F0F0}}
            n$ = scope2$ + n$
            clearid
            id.t = BYTETYPE: {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} id.t = id.t + ISUNSIGNED
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine defdatahandle, ct$ + {{Text|" *"|#FFB100}} + n$ + {{Text|"=NULL;"|#FFB100}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"if("|#FFB100}} + n$ + {{Text|"==NULL){"|#FFB100}}
            {{Text|IF|#F0F0F0}} cmemlist(idn + {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
                id.t = id.t + ISINCONVENTIONALMEMORY
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"cmem_sp-=1;"|#FFB100}}
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, n$ + {{Text|"=("|#FFB100}} + ct$ + {{Text|"*)(dblock+cmem_sp);"|#FFB100}}
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"if (cmem_sp<qbs_cmem_sp) error(257);"|#FFB100}}
            {{Text|ELSE|#F0F0F0}}
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, n$ + {{Text|"=("|#FFB100}} + ct$ + {{Text|"*)mem_static_malloc(1);"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"*"|#FFB100}} + n$ + {{Text|"=0;"|#FFB100}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"}"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        id.n = cvarname$
        {{Text|IF|#F0F0F0}} method = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} id.mayhave = {{Text|"~%%"|#FFB100}} {{Text|ELSE|#F0F0F0}} id.mayhave = {{Text|"%%"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} method = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} id.musthave = {{Text|"~%%"|#FFB100}} {{Text|ELSE|#F0F0F0}} id.musthave = {{Text|"%%"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        id.callname = n$
        regid
        vWatchVariable n$, {{Text|0|#F580B1}}
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|GOTO|#F0F0F0}} dim2exitfunc
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} typ$ = {{Text|"INTEGER"|#FFB100}} {{Text|THEN|#F0F0F0}}
        ct$ = {{Text|"int16"|#FFB100}}
        {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} n$ = {{Text|"U"|#FFB100}}: ct$ = {{Text|"u"|#FFB100}} + ct$
        n$ = n$ + {{Text|"INTEGER_"|#FFB100}} + varname$
        {{Text|IF|#F0F0F0}} elements$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
            arraydesc = {{Text|0|#F580B1}}
            cmps$ = varname$: {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} cmps$ = cmps$ + {{Text|"~"|#FFB100}}
            cmps$ = cmps$ + {{Text|"%"|#FFB100}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                try = findid(cmps$)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
                    {{Text|IF|#F0F0F0}} (id.arraytype) {{Text|THEN|#F0F0F0}}
                        l$ = {{Text|RTRIM$|#F0F0F0}}(id.cn)
                        arraydesc = currentid: scope2$ = scope$
                        {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(cmps$) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|LOOP|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            n$ = scope2$ + {{Text|"ARRAY_"|#FFB100}} + n$
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(elements$) = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|ASC|#F0F0F0}}(elements$) = {{Text|63|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'"?"|#31C4C4}}
                    E = arrayelementslist(idn + {{Text|1|#F580B1}}): {{Text|IF|#F0F0F0}} E {{Text|THEN|#F0F0F0}} elements$ = elements$ + str2$(E) {{Text|'eg. "?3" for a 3 dimensional array|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                nume = allocarray(n$, elements$, {{Text|2|#F580B1}}, {{Text|0|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                l$ = l$ + sp + tlayout$
                {{Text|IF|#F0F0F0}} arraydesc {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} dim2exitfunc
                clearid
            {{Text|ELSE|#F0F0F0}}
                clearid
                {{Text|IF|#F0F0F0}} elements$ = {{Text|"?"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    nume = {{Text|-1|#F580B1}}
                    id.linkid = glinkid
                    id.linkarg = glinkarg
                {{Text|ELSE|#F0F0F0}}
                    nume = {{Text|VAL|#F0F0F0}}(elements$)
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            id.arraytype = INTEGERTYPE: {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} id.arraytype = id.arraytype + ISUNSIGNED
            {{Text|IF|#F0F0F0}} cmemlist(idn + {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} id.arraytype = id.arraytype + ISINCONVENTIONALMEMORY
            {{Text|IF|#F0F0F0}} nume > {{Text|65536|#F580B1}} {{Text|THEN|#F0F0F0}} nume = nume - {{Text|65536|#F580B1}}: id.staticarray = {{Text|1|#F580B1}}
            id.arrayelements = nume
            id.callname = n$
        {{Text|ELSE|#F0F0F0}}
            n$ = scope2$ + n$
            clearid
            id.t = INTEGERTYPE: {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} id.t = id.t + ISUNSIGNED
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine defdatahandle, ct$ + {{Text|" *"|#FFB100}} + n$ + {{Text|"=NULL;"|#FFB100}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"if("|#FFB100}} + n$ + {{Text|"==NULL){"|#FFB100}}
            {{Text|IF|#F0F0F0}} cmemlist(idn + {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
                id.t = id.t + ISINCONVENTIONALMEMORY
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"cmem_sp-=2;"|#FFB100}}
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, n$ + {{Text|"=("|#FFB100}} + ct$ + {{Text|"*)(dblock+cmem_sp);"|#FFB100}}
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"if (cmem_sp<qbs_cmem_sp) error(257);"|#FFB100}}
            {{Text|ELSE|#F0F0F0}}
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, n$ + {{Text|"=("|#FFB100}} + ct$ + {{Text|"*)mem_static_malloc(2);"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"*"|#FFB100}} + n$ + {{Text|"=0;"|#FFB100}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"}"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        id.n = cvarname$
        {{Text|IF|#F0F0F0}} method = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} id.mayhave = {{Text|"~%"|#FFB100}} {{Text|ELSE|#F0F0F0}} id.mayhave = {{Text|"%"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} method = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} id.musthave = {{Text|"~%"|#FFB100}} {{Text|ELSE|#F0F0F0}} id.musthave = {{Text|"%"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        id.callname = n$
        regid
        vWatchVariable n$, {{Text|0|#F580B1}}
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|GOTO|#F0F0F0}} dim2exitfunc
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} typ$ = {{Text|"_OFFSET"|#FFB100}} {{Text|OR|#F0F0F0}} (typ$ = {{Text|"OFFSET"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
        ct$ = {{Text|"ptrszint"|#FFB100}}
        {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} n$ = {{Text|"U"|#FFB100}}: ct$ = {{Text|"u"|#FFB100}} + ct$
        n$ = n$ + {{Text|"OFFSET_"|#FFB100}} + varname$
        {{Text|IF|#F0F0F0}} elements$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
            arraydesc = {{Text|0|#F580B1}}
            cmps$ = varname$: {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} cmps$ = cmps$ + {{Text|"~"|#FFB100}}
            cmps$ = cmps$ + {{Text|"%&"|#FFB100}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                try = findid(cmps$)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
                    {{Text|IF|#F0F0F0}} (id.arraytype) {{Text|THEN|#F0F0F0}}
                        l$ = {{Text|RTRIM$|#F0F0F0}}(id.cn)
                        arraydesc = currentid: scope2$ = scope$
                        {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(cmps$) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|LOOP|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            n$ = scope2$ + {{Text|"ARRAY_"|#FFB100}} + n$
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(elements$) = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|ASC|#F0F0F0}}(elements$) = {{Text|63|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'"?"|#31C4C4}}
                    E = arrayelementslist(idn + {{Text|1|#F580B1}}): {{Text|IF|#F0F0F0}} E {{Text|THEN|#F0F0F0}} elements$ = elements$ + str2$(E) {{Text|'eg. "?3" for a 3 dimensional array|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                nume = allocarray(n$, elements$, OS_BITS \ {{Text|8|#F580B1}}, {{Text|0|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                l$ = l$ + sp + tlayout$
                {{Text|IF|#F0F0F0}} arraydesc {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} dim2exitfunc
                clearid
            {{Text|ELSE|#F0F0F0}}
                clearid
                {{Text|IF|#F0F0F0}} elements$ = {{Text|"?"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    nume = {{Text|-1|#F580B1}}
                    id.linkid = glinkid
                    id.linkarg = glinkarg
                {{Text|ELSE|#F0F0F0}}
                    nume = {{Text|VAL|#F0F0F0}}(elements$)
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            id.arraytype = OFFSETTYPE: {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} id.arraytype = id.arraytype + ISUNSIGNED
            {{Text|IF|#F0F0F0}} cmemlist(idn + {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} id.arraytype = id.arraytype + ISINCONVENTIONALMEMORY
            {{Text|IF|#F0F0F0}} nume > {{Text|65536|#F580B1}} {{Text|THEN|#F0F0F0}} nume = nume - {{Text|65536|#F580B1}}: id.staticarray = {{Text|1|#F580B1}}
            id.arrayelements = nume
            id.callname = n$
        {{Text|ELSE|#F0F0F0}}
            n$ = scope2$ + n$
            clearid
            id.t = OFFSETTYPE: {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} id.t = id.t + ISUNSIGNED
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine defdatahandle, ct$ + {{Text|" *"|#FFB100}} + n$ + {{Text|"=NULL;"|#FFB100}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"if("|#FFB100}} + n$ + {{Text|"==NULL){"|#FFB100}}
            {{Text|IF|#F0F0F0}} cmemlist(idn + {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
                id.t = id.t + ISINCONVENTIONALMEMORY
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"cmem_sp-="|#FFB100}} + str2(OS_BITS \ {{Text|8|#F580B1}}) + {{Text|";"|#FFB100}}
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, n$ + {{Text|"=("|#FFB100}} + ct$ + {{Text|"*)(dblock+cmem_sp);"|#FFB100}}
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"if (cmem_sp<qbs_cmem_sp) error(257);"|#FFB100}}
            {{Text|ELSE|#F0F0F0}}
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, n$ + {{Text|"=("|#FFB100}} + ct$ + {{Text|"*)mem_static_malloc("|#FFB100}} + str2(OS_BITS \ {{Text|8|#F580B1}}) + {{Text|");"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"*"|#FFB100}} + n$ + {{Text|"=0;"|#FFB100}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"}"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        id.n = cvarname$
        {{Text|IF|#F0F0F0}} method = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} id.mayhave = {{Text|"~%&"|#FFB100}} {{Text|ELSE|#F0F0F0}} id.mayhave = {{Text|"%&"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} method = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} id.musthave = {{Text|"~%&"|#FFB100}} {{Text|ELSE|#F0F0F0}} id.musthave = {{Text|"%&"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        id.callname = n$
        regid
        vWatchVariable n$, {{Text|0|#F580B1}}
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|GOTO|#F0F0F0}} dim2exitfunc
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} typ$ = {{Text|"LONG"|#FFB100}} {{Text|THEN|#F0F0F0}}
        ct$ = {{Text|"int32"|#FFB100}}
        {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} n$ = {{Text|"U"|#FFB100}}: ct$ = {{Text|"u"|#FFB100}} + ct$
        n$ = n$ + {{Text|"LONG_"|#FFB100}} + varname$
        {{Text|IF|#F0F0F0}} elements$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
            arraydesc = {{Text|0|#F580B1}}
            cmps$ = varname$: {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} cmps$ = cmps$ + {{Text|"~"|#FFB100}}
            cmps$ = cmps$ + {{Text|"&"|#FFB100}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                try = findid(cmps$)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
                    {{Text|IF|#F0F0F0}} (id.arraytype) {{Text|THEN|#F0F0F0}}
                        l$ = {{Text|RTRIM$|#F0F0F0}}(id.cn)
                        arraydesc = currentid: scope2$ = scope$
                        {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(cmps$) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|LOOP|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            n$ = scope2$ + {{Text|"ARRAY_"|#FFB100}} + n$
            {{Text|'nume = allocarray(n$, elements$, 4)|#31C4C4}}
            {{Text|'IF arraydesc THEN goto dim2exitfunc|#31C4C4}}
            {{Text|'clearid|#31C4C4}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(elements$) = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|ASC|#F0F0F0}}(elements$) = {{Text|63|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'"?"|#31C4C4}}
                    E = arrayelementslist(idn + {{Text|1|#F580B1}}): {{Text|IF|#F0F0F0}} E {{Text|THEN|#F0F0F0}} elements$ = elements$ + str2$(E) {{Text|'eg. "?3" for a 3 dimensional array|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                nume = allocarray(n$, elements$, {{Text|4|#F580B1}}, {{Text|0|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                l$ = l$ + sp + tlayout$
                {{Text|IF|#F0F0F0}} arraydesc {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} dim2exitfunc
                clearid
            {{Text|ELSE|#F0F0F0}}
                clearid
                {{Text|IF|#F0F0F0}} elements$ = {{Text|"?"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    nume = {{Text|-1|#F580B1}}
                    id.linkid = glinkid
                    id.linkarg = glinkarg
                {{Text|ELSE|#F0F0F0}}
                    nume = {{Text|VAL|#F0F0F0}}(elements$)
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            id.arraytype = LONGTYPE: {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} id.arraytype = id.arraytype + ISUNSIGNED
            {{Text|IF|#F0F0F0}} cmemlist(idn + {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} id.arraytype = id.arraytype + ISINCONVENTIONALMEMORY
            {{Text|IF|#F0F0F0}} nume > {{Text|65536|#F580B1}} {{Text|THEN|#F0F0F0}} nume = nume - {{Text|65536|#F580B1}}: id.staticarray = {{Text|1|#F580B1}}
            id.arrayelements = nume
            id.callname = n$
        {{Text|ELSE|#F0F0F0}}
            n$ = scope2$ + n$
            clearid
            id.t = LONGTYPE: {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} id.t = id.t + ISUNSIGNED
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine defdatahandle, ct$ + {{Text|" *"|#FFB100}} + n$ + {{Text|"=NULL;"|#FFB100}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"if("|#FFB100}} + n$ + {{Text|"==NULL){"|#FFB100}}
            {{Text|IF|#F0F0F0}} cmemlist(idn + {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
                id.t = id.t + ISINCONVENTIONALMEMORY
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"cmem_sp-=4;"|#FFB100}}
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, n$ + {{Text|"=("|#FFB100}} + ct$ + {{Text|"*)(dblock+cmem_sp);"|#FFB100}}
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"if (cmem_sp<qbs_cmem_sp) error(257);"|#FFB100}}
            {{Text|ELSE|#F0F0F0}}
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, n$ + {{Text|"=("|#FFB100}} + ct$ + {{Text|"*)mem_static_malloc(4);"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"*"|#FFB100}} + n$ + {{Text|"=0;"|#FFB100}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"}"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        id.n = cvarname$
        {{Text|IF|#F0F0F0}} method = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} id.mayhave = {{Text|"~&"|#FFB100}} {{Text|ELSE|#F0F0F0}} id.mayhave = {{Text|"&"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} method = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} id.musthave = {{Text|"~&"|#FFB100}} {{Text|ELSE|#F0F0F0}} id.musthave = {{Text|"&"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        id.callname = n$
        regid
        vWatchVariable n$, {{Text|0|#F580B1}}
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|GOTO|#F0F0F0}} dim2exitfunc
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} typ$ = {{Text|"_INTEGER64"|#FFB100}} {{Text|OR|#F0F0F0}} (typ$ = {{Text|"INTEGER64"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
        ct$ = {{Text|"int64"|#FFB100}}
        {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} n$ = {{Text|"U"|#FFB100}}: ct$ = {{Text|"u"|#FFB100}} + ct$
        n$ = n$ + {{Text|"INTEGER64_"|#FFB100}} + varname$
        {{Text|IF|#F0F0F0}} elements$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
            arraydesc = {{Text|0|#F580B1}}
            cmps$ = varname$: {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} cmps$ = cmps$ + {{Text|"~"|#FFB100}}
            cmps$ = cmps$ + {{Text|"&&"|#FFB100}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                try = findid(cmps$)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
                    {{Text|IF|#F0F0F0}} (id.arraytype) {{Text|THEN|#F0F0F0}}
                        l$ = {{Text|RTRIM$|#F0F0F0}}(id.cn)
                        arraydesc = currentid: scope2$ = scope$
                        {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(cmps$) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|LOOP|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            n$ = scope2$ + {{Text|"ARRAY_"|#FFB100}} + n$
            {{Text|'nume = allocarray(n$, elements$, 8)|#31C4C4}}
            {{Text|'IF arraydesc THEN goto dim2exitfunc|#31C4C4}}
            {{Text|'clearid|#31C4C4}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(elements$) = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|ASC|#F0F0F0}}(elements$) = {{Text|63|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'"?"|#31C4C4}}
                    E = arrayelementslist(idn + {{Text|1|#F580B1}}): {{Text|IF|#F0F0F0}} E {{Text|THEN|#F0F0F0}} elements$ = elements$ + str2$(E) {{Text|'eg. "?3" for a 3 dimensional array|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                nume = allocarray(n$, elements$, {{Text|8|#F580B1}}, {{Text|0|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                l$ = l$ + sp + tlayout$
                {{Text|IF|#F0F0F0}} arraydesc {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} dim2exitfunc
                clearid
            {{Text|ELSE|#F0F0F0}}
                clearid
                {{Text|IF|#F0F0F0}} elements$ = {{Text|"?"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    nume = {{Text|-1|#F580B1}}
                    id.linkid = glinkid
                    id.linkarg = glinkarg
                {{Text|ELSE|#F0F0F0}}
                    nume = {{Text|VAL|#F0F0F0}}(elements$)
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            id.arraytype = INTEGER64TYPE: {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} id.arraytype = id.arraytype + ISUNSIGNED
            {{Text|IF|#F0F0F0}} cmemlist(idn + {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} id.arraytype = id.arraytype + ISINCONVENTIONALMEMORY
            {{Text|IF|#F0F0F0}} nume > {{Text|65536|#F580B1}} {{Text|THEN|#F0F0F0}} nume = nume - {{Text|65536|#F580B1}}: id.staticarray = {{Text|1|#F580B1}}
            id.arrayelements = nume
            id.callname = n$
        {{Text|ELSE|#F0F0F0}}
            n$ = scope2$ + n$
            clearid
            id.t = INTEGER64TYPE: {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} id.t = id.t + ISUNSIGNED
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine defdatahandle, ct$ + {{Text|" *"|#FFB100}} + n$ + {{Text|"=NULL;"|#FFB100}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"if("|#FFB100}} + n$ + {{Text|"==NULL){"|#FFB100}}
            {{Text|IF|#F0F0F0}} cmemlist(idn + {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
                id.t = id.t + ISINCONVENTIONALMEMORY
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"cmem_sp-=8;"|#FFB100}}
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, n$ + {{Text|"=("|#FFB100}} + ct$ + {{Text|"*)(dblock+cmem_sp);"|#FFB100}}
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"if (cmem_sp<qbs_cmem_sp) error(257);"|#FFB100}}
            {{Text|ELSE|#F0F0F0}}
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, n$ + {{Text|"=("|#FFB100}} + ct$ + {{Text|"*)mem_static_malloc(8);"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"*"|#FFB100}} + n$ + {{Text|"=0;"|#FFB100}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"}"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        id.n = cvarname$
        {{Text|IF|#F0F0F0}} method = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} id.mayhave = {{Text|"~&&"|#FFB100}} {{Text|ELSE|#F0F0F0}} id.mayhave = {{Text|"&&"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} method = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} unsgn {{Text|THEN|#F0F0F0}} id.musthave = {{Text|"~&&"|#FFB100}} {{Text|ELSE|#F0F0F0}} id.musthave = {{Text|"&&"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        id.callname = n$
        regid
        vWatchVariable n$, {{Text|0|#F580B1}}
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|GOTO|#F0F0F0}} dim2exitfunc
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} unsgn = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Type cannot be unsigned"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|IF|#F0F0F0}} typ$ = {{Text|"SINGLE"|#FFB100}} {{Text|THEN|#F0F0F0}}
        ct$ = {{Text|"float"|#FFB100}}
        n$ = n$ + {{Text|"SINGLE_"|#FFB100}} + varname$
        {{Text|IF|#F0F0F0}} elements$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
            arraydesc = {{Text|0|#F580B1}}
            cmps$ = varname$ + {{Text|"!"|#FFB100}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                try = findid(cmps$)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
                    {{Text|IF|#F0F0F0}} (id.arraytype) {{Text|THEN|#F0F0F0}}
                        l$ = {{Text|RTRIM$|#F0F0F0}}(id.cn)
                        arraydesc = currentid: scope2$ = scope$
                        {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(cmps$) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|LOOP|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            n$ = scope2$ + {{Text|"ARRAY_"|#FFB100}} + n$
            {{Text|'nume = allocarray(n$, elements$, 4)|#31C4C4}}
            {{Text|'IF arraydesc THEN goto dim2exitfunc|#31C4C4}}
            {{Text|'clearid|#31C4C4}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(elements$) = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|ASC|#F0F0F0}}(elements$) = {{Text|63|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'"?"|#31C4C4}}
                    E = arrayelementslist(idn + {{Text|1|#F580B1}}): {{Text|IF|#F0F0F0}} E {{Text|THEN|#F0F0F0}} elements$ = elements$ + str2$(E) {{Text|'eg. "?3" for a 3 dimensional array|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                nume = allocarray(n$, elements$, {{Text|4|#F580B1}}, {{Text|0|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                l$ = l$ + sp + tlayout$
                {{Text|IF|#F0F0F0}} arraydesc {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} dim2exitfunc
                clearid
            {{Text|ELSE|#F0F0F0}}
                clearid
                {{Text|IF|#F0F0F0}} elements$ = {{Text|"?"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    nume = {{Text|-1|#F580B1}}
                    id.linkid = glinkid
                    id.linkarg = glinkarg
                {{Text|ELSE|#F0F0F0}}
                    nume = {{Text|VAL|#F0F0F0}}(elements$)
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            id.arraytype = SINGLETYPE
            {{Text|IF|#F0F0F0}} cmemlist(idn + {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} id.arraytype = id.arraytype + ISINCONVENTIONALMEMORY
            {{Text|IF|#F0F0F0}} nume > {{Text|65536|#F580B1}} {{Text|THEN|#F0F0F0}} nume = nume - {{Text|65536|#F580B1}}: id.staticarray = {{Text|1|#F580B1}}
            id.arrayelements = nume
            id.callname = n$
        {{Text|ELSE|#F0F0F0}}
            n$ = scope2$ + n$
            clearid
            id.t = SINGLETYPE
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine defdatahandle, ct$ + {{Text|" *"|#FFB100}} + n$ + {{Text|"=NULL;"|#FFB100}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"if("|#FFB100}} + n$ + {{Text|"==NULL){"|#FFB100}}
            {{Text|IF|#F0F0F0}} cmemlist(idn + {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
                id.t = id.t + ISINCONVENTIONALMEMORY
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"cmem_sp-=4;"|#FFB100}}
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, n$ + {{Text|"=("|#FFB100}} + ct$ + {{Text|"*)(dblock+cmem_sp);"|#FFB100}}
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"if (cmem_sp<qbs_cmem_sp) error(257);"|#FFB100}}
            {{Text|ELSE|#F0F0F0}}
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, n$ + {{Text|"=("|#FFB100}} + ct$ + {{Text|"*)mem_static_malloc(4);"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"*"|#FFB100}} + n$ + {{Text|"=0;"|#FFB100}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"}"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        id.n = cvarname$
        {{Text|IF|#F0F0F0}} method = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            id.mayhave = {{Text|"!"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} method = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
            id.musthave = {{Text|"!"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        id.callname = n$
        regid
        vWatchVariable n$, {{Text|0|#F580B1}}
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|GOTO|#F0F0F0}} dim2exitfunc
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} typ$ = {{Text|"DOUBLE"|#FFB100}} {{Text|THEN|#F0F0F0}}
        ct$ = {{Text|"double"|#FFB100}}
        n$ = n$ + {{Text|"DOUBLE_"|#FFB100}} + varname$
        {{Text|IF|#F0F0F0}} elements$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
            arraydesc = {{Text|0|#F580B1}}
            cmps$ = varname$ + {{Text|"#"|#FFB100}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                try = findid(cmps$)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
                    {{Text|IF|#F0F0F0}} (id.arraytype) {{Text|THEN|#F0F0F0}}
                        l$ = {{Text|RTRIM$|#F0F0F0}}(id.cn)
                        arraydesc = currentid: scope2$ = scope$
                        {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(cmps$) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|LOOP|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            n$ = scope2$ + {{Text|"ARRAY_"|#FFB100}} + n$
            {{Text|'nume = allocarray(n$, elements$, 8)|#31C4C4}}
            {{Text|'IF arraydesc THEN goto dim2exitfunc|#31C4C4}}
            {{Text|'clearid|#31C4C4}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(elements$) = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|ASC|#F0F0F0}}(elements$) = {{Text|63|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'"?"|#31C4C4}}
                    E = arrayelementslist(idn + {{Text|1|#F580B1}}): {{Text|IF|#F0F0F0}} E {{Text|THEN|#F0F0F0}} elements$ = elements$ + str2$(E) {{Text|'eg. "?3" for a 3 dimensional array|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                nume = allocarray(n$, elements$, {{Text|8|#F580B1}}, {{Text|0|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                l$ = l$ + sp + tlayout$
                {{Text|IF|#F0F0F0}} arraydesc {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} dim2exitfunc
                clearid
            {{Text|ELSE|#F0F0F0}}
                clearid
                {{Text|IF|#F0F0F0}} elements$ = {{Text|"?"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    nume = {{Text|-1|#F580B1}}
                    id.linkid = glinkid
                    id.linkarg = glinkarg
                {{Text|ELSE|#F0F0F0}}
                    nume = {{Text|VAL|#F0F0F0}}(elements$)
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            id.arraytype = DOUBLETYPE
            {{Text|IF|#F0F0F0}} cmemlist(idn + {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} id.arraytype = id.arraytype + ISINCONVENTIONALMEMORY
            {{Text|IF|#F0F0F0}} nume > {{Text|65536|#F580B1}} {{Text|THEN|#F0F0F0}} nume = nume - {{Text|65536|#F580B1}}: id.staticarray = {{Text|1|#F580B1}}
            id.arrayelements = nume
            id.callname = n$
        {{Text|ELSE|#F0F0F0}}
            n$ = scope2$ + n$
            clearid
            id.t = DOUBLETYPE
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine defdatahandle, ct$ + {{Text|" *"|#FFB100}} + n$ + {{Text|"=NULL;"|#FFB100}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"if("|#FFB100}} + n$ + {{Text|"==NULL){"|#FFB100}}
            {{Text|IF|#F0F0F0}} cmemlist(idn + {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
                id.t = id.t + ISINCONVENTIONALMEMORY
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"cmem_sp-=8;"|#FFB100}}
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, n$ + {{Text|"=("|#FFB100}} + ct$ + {{Text|"*)(dblock+cmem_sp);"|#FFB100}}
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"if (cmem_sp<qbs_cmem_sp) error(257);"|#FFB100}}
            {{Text|ELSE|#F0F0F0}}
                {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, n$ + {{Text|"=("|#FFB100}} + ct$ + {{Text|"*)mem_static_malloc(8);"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"*"|#FFB100}} + n$ + {{Text|"=0;"|#FFB100}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"}"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        id.n = cvarname$
        {{Text|IF|#F0F0F0}} method = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            id.mayhave = {{Text|"#"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} method = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
            id.musthave = {{Text|"#"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        id.callname = n$
        regid
        vWatchVariable n$, {{Text|0|#F580B1}}
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|GOTO|#F0F0F0}} dim2exitfunc
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} typ$ = {{Text|"_FLOAT"|#FFB100}} {{Text|OR|#F0F0F0}} (typ$ = {{Text|"FLOAT"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
        ct$ = {{Text|"long double"|#FFB100}}
        n$ = n$ + {{Text|"FLOAT_"|#FFB100}} + varname$
        {{Text|IF|#F0F0F0}} elements$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
            arraydesc = {{Text|0|#F580B1}}
            cmps$ = varname$ + {{Text|"##"|#FFB100}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                try = findid(cmps$)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
                    {{Text|IF|#F0F0F0}} (id.arraytype) {{Text|THEN|#F0F0F0}}
                        l$ = {{Text|RTRIM$|#F0F0F0}}(id.cn)
                        arraydesc = currentid: scope2$ = scope$
                        {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(cmps$) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|LOOP|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            n$ = scope2$ + {{Text|"ARRAY_"|#FFB100}} + n$
            {{Text|'nume = allocarray(n$, elements$, 32)|#31C4C4}}
            {{Text|'IF arraydesc THEN goto dim2exitfunc|#31C4C4}}
            {{Text|'clearid|#31C4C4}}
            {{Text|IF|#F0F0F0}} f = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(elements$) = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|ASC|#F0F0F0}}(elements$) = {{Text|63|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'"?"|#31C4C4}}
                    E = arrayelementslist(idn + {{Text|1|#F580B1}}): {{Text|IF|#F0F0F0}} E {{Text|THEN|#F0F0F0}} elements$ = elements$ + str2$(E) {{Text|'eg. "?3" for a 3 dimensional array|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                nume = allocarray(n$, elements$, {{Text|32|#F580B1}}, {{Text|0|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                l$ = l$ + sp + tlayout$
                {{Text|IF|#F0F0F0}} arraydesc {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} dim2exitfunc
                clearid
            {{Text|ELSE|#F0F0F0}}
                clearid
                {{Text|IF|#F0F0F0}} elements$ = {{Text|"?"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    nume = {{Text|-1|#F580B1}}
                    id.linkid = glinkid
                    id.linkarg = glinkarg
                {{Text|ELSE|#F0F0F0}}
                    nume = {{Text|VAL|#F0F0F0}}(elements$)
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            id.arraytype = FLOATTYPE
            {{Text|IF|#F0F0F0}} cmemlist(idn + {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} id.arraytype = id.arraytype + ISINCONVENTIONALMEMORY
            {{Text|IF|#F0F0F0}} nume > {{Text|65536|#F580B1}} {{Text|THEN|#F0F0F0}} nume = nume - {{Text|65536|#F580B1}}: id.staticarray = {{Text|1|#F580B1}}
            id.arrayelements = nume
            id.callname = n$
        {{Text|ELSE|#F0F0F0}}
            n$ = scope2$ + n$
            clearid
            id.t = FLOATTYPE
            {{Text|IF|#F0F0F0}} f {{Text|THEN|#F0F0F0}} WriteBufLine defdatahandle, ct$ + {{Text|" *"|#FFB100}} + n$ + {{Text|"=NULL;"|#FFB100}}
            {{Text|IF|#F0F0F0}} f {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"if("|#FFB100}} + n$ + {{Text|"==NULL){"|#FFB100}}
            {{Text|IF|#F0F0F0}} cmemlist(idn + {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
                id.t = id.t + ISINCONVENTIONALMEMORY
                {{Text|IF|#F0F0F0}} f {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"cmem_sp-=32;"|#FFB100}}
                {{Text|IF|#F0F0F0}} f {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, n$ + {{Text|"=("|#FFB100}} + ct$ + {{Text|"*)(dblock+cmem_sp);"|#FFB100}}
                {{Text|IF|#F0F0F0}} f {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"if (cmem_sp<qbs_cmem_sp) error(257);"|#FFB100}}
            {{Text|ELSE|#F0F0F0}}
                {{Text|IF|#F0F0F0}} f {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, n$ + {{Text|"=("|#FFB100}} + ct$ + {{Text|"*)mem_static_malloc(32);"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} f {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"*"|#FFB100}} + n$ + {{Text|"=0;"|#FFB100}}
            {{Text|IF|#F0F0F0}} f {{Text|THEN|#F0F0F0}} WriteBufLine DataTxtBuf, {{Text|"}"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        id.n = cvarname$
        {{Text|IF|#F0F0F0}} method = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            id.mayhave = {{Text|"##"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} method = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
            id.musthave = {{Text|"##"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        id.callname = n$
        regid
        vWatchVariable n$, {{Text|0|#F580B1}}
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|GOTO|#F0F0F0}} dim2exitfunc
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    Give_Error {{Text|"Unknown type"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    dim2exitfunc:
    bypassNextVariable = {{Text|0|#F580B1}}
    {{Text|IF|#F0F0F0}} dimsfarray {{Text|THEN|#F0F0F0}}
        ids(idn).sfid = glinkid
        ids(idn).sfarg = glinkarg
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'restore STATIC state|#31C4C4}}
    {{Text|IF|#F0F0F0}} dimstatic <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} dimshared = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
        DataTxtBuf = OpenBuffer%({{Text|"A"|#FFB100}}, tmpdir$ + {{Text|"data"|#FFB100}} + str2$(subfuncn) + {{Text|".txt"|#FFB100}})
        FreeTxtBuf = OpenBuffer%({{Text|"A"|#FFB100}}, tmpdir$ + {{Text|"free"|#FFB100}} + str2$(subfuncn) + {{Text|".txt"|#FFB100}})
        defdatahandle = DataTxtBuf
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    tlayout$ = l$
{{Text|END|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
{{Text|FUNCTION|#F0F0F0}} udtreference$ (o$, a$, typ {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}})
    {{Text|'UDT REFERENCE FORMAT|#31C4C4}}
    {{Text|'idno¦udtno¦udtelementno¦byteoffset|#31C4C4}}
    {{Text|'    ^udt of the element, not of the id|#31C4C4}}
    obak$ = o$
    {{Text|'PRINT "called udtreference!"|#31C4C4}}
    r$ = str2$(currentid) + sp3
    o = {{Text|0|#F580B1}} {{Text|'the fixed/known part of the offset|#31C4C4}}
    incmem = {{Text|0|#F580B1}}
    {{Text|IF|#F0F0F0}} id.t {{Text|THEN|#F0F0F0}}
        u = id.t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
        {{Text|IF|#F0F0F0}} id.t {{Text|AND|#F0F0F0}} ISINCONVENTIONALMEMORY {{Text|THEN|#F0F0F0}} incmem = {{Text|1|#F580B1}}
    {{Text|ELSE|#F0F0F0}}
        u = id.arraytype {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
        {{Text|IF|#F0F0F0}} id.arraytype {{Text|AND|#F0F0F0}} ISINCONVENTIONALMEMORY {{Text|THEN|#F0F0F0}} incmem = {{Text|1|#F580B1}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    E = {{Text|0|#F580B1}}
    n = numelements(a$)
    {{Text|IF|#F0F0F0}} n = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} fulludt
    i = {{Text|1|#F580B1}}
    udtfindelenext:
    {{Text|IF|#F0F0F0}} getelement$(a$, i) <> {{Text|"."|#FFB100}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected ."|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    i = i + {{Text|1|#F580B1}}
    n$ = getelement$(a$, i)
    nsym$ = removesymbol(n$): {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(nsym$) {{Text|THEN|#F0F0F0}} ntyp = typname2typ(nsym$): ntypsize = typname2typsize
    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|IF|#F0F0F0}} n$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected .elementname"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    udtfindele:
    {{Text|IF|#F0F0F0}} E = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} E = udtxnext(u) {{Text|ELSE|#F0F0F0}} E = udtenext(E)
    {{Text|IF|#F0F0F0}} E = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Element not defined"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    n2$ = {{Text|RTRIM$|#F0F0F0}}(udtename(E))
    {{Text|IF|#F0F0F0}} udtebytealign(E) {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} o {{Text|MOD|#F0F0F0}} {{Text|8|#F580B1}} {{Text|THEN|#F0F0F0}} o = o + ({{Text|8|#F580B1}} - (o {{Text|MOD|#F0F0F0}} {{Text|8|#F580B1}}))
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} n$ <> n2$ {{Text|THEN|#F0F0F0}}
        {{Text|'increment fixed offset|#31C4C4}}
        o = o + udtesize(E)
        {{Text|GOTO|#F0F0F0}} udtfindele
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'check symbol after element's name (if given) is correct|#31C4C4}}
    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(nsym$) {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} udtetype(E) {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Invalid symbol after user defined type"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|IF|#F0F0F0}} ntyp <> udtetype(E) {{Text|OR|#F0F0F0}} ntypsize <> udtetypesize(E) {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} nsym$ = {{Text|"$"|#FFB100}} {{Text|AND|#F0F0F0}} ((udtetype(E) {{Text|AND|#F0F0F0}} ISFIXEDLENGTH) <> {{Text|0|#F580B1}}) {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} correctsymbol
            Give_Error {{Text|"Incorrect symbol after element name"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    correctsymbol:
    {{Text|'Move into another UDT structure?|#31C4C4}}
    {{Text|IF|#F0F0F0}} i <> n {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} (udtetype(E) {{Text|AND|#F0F0F0}} ISUDT) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected user defined type"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        u = udtetype(E) {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
        E = {{Text|0|#F580B1}}
        i = i + {{Text|1|#F580B1}}
        {{Text|GOTO|#F0F0F0}} udtfindelenext
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'Change e reference to u ¦ 0 reference?|#31C4C4}}
    {{Text|IF|#F0F0F0}} udtetype(E) {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}}
        u = udtetype(E) {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
        E = {{Text|0|#F580B1}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    fulludt:
    r$ = r$ + str2$(u) + sp3 + str2$(E) + sp3
    {{Text|IF|#F0F0F0}} o {{Text|MOD|#F0F0F0}} {{Text|8|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"QB64 cannot handle bit offsets within user defined types"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    o = o \ {{Text|8|#F580B1}}
    {{Text|IF|#F0F0F0}} o$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} o <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'dont add an unnecessary 0|#31C4C4}}
            o$ = o$ + {{Text|"+"|#FFB100}} + str2$(o)
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|ELSE|#F0F0F0}}
        o$ = str2$(o)
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    r$ = r$ + o$
    udtreference$ = r$
    typ = udtetype(E) + ISUDT + ISREFERENCE
    {{Text|'full udt override:|#31C4C4}}
    {{Text|IF|#F0F0F0}} E = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
        typ = u + ISUDT + ISREFERENCE
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} obak$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} typ = typ + ISARRAY
    {{Text|IF|#F0F0F0}} incmem {{Text|THEN|#F0F0F0}} typ = typ + ISINCONVENTIONALMEMORY
    {{Text|'print "UDTREF:"+r$+","+str2$(typ)|#31C4C4}}
{{Text|END|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
{{Text|FUNCTION|#F0F0F0}} evaluate$ (a2$, typ {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}})
    {{Text|DIM|#F0F0F0}} block({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|STRING|#F0F0F0}}
    {{Text|DIM|#F0F0F0}} evaledblock({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|INTEGER|#F0F0F0}}
    {{Text|DIM|#F0F0F0}} blocktype({{Text|1000|#F580B1}}) {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}
    {{Text|'typ IS A RETURN VALUE|#31C4C4}}
    {{Text|'''DIM cli(15) AS INTEGER|#31C4C4}}
    a$ = a2$
    typ = {{Text|-1|#F580B1}}
    {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"evaluating:["|#FFB100}} + a2$ + {{Text|"]"|#FFB100}}
    {{Text|IF|#F0F0F0}} a2$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Syntax error"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|'''cl$ = classify(a$)|#31C4C4}}
    blockn = {{Text|0|#F580B1}}
    n = numelements(a$)
    b = {{Text|0|#F580B1}} {{Text|'bracketting level|#31C4C4}}
    {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} n
        reevaluate:
        l$ = getelement(a$, i)
        {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"#*#*#* reevaluating:"|#FFB100}} + l$, i
        {{Text|IF|#F0F0F0}} i <> n {{Text|THEN|#F0F0F0}} nextl$ = getelement(a$, i + {{Text|1|#F580B1}}) {{Text|ELSE|#F0F0F0}} nextl$ = {{Text|""|#FFB100}}
        {{Text|'''getclass cl$, i, cli()|#31C4C4}}
        {{Text|IF|#F0F0F0}} b = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'don't evaluate anything within brackets|#31C4C4}}
            {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, l$
            l2$ = l$ {{Text|'pure version of l$|#31C4C4}}
            {{Text|FOR|#F0F0F0}} try_method = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|4|#F580B1}}
                l$ = l2$
                {{Text|IF|#F0F0F0}} try_method = {{Text|2|#F580B1}} {{Text|OR|#F0F0F0}} try_method = {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    dtyp$ = removesymbol(l$): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} dtyp$ = {{Text|""|#FFB100}}: Error_Happened = {{Text|0|#F580B1}}
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(dtyp$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} isoperator(l$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} isvalidvariable(l$) {{Text|THEN|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(l$, {{Text|1|#F580B1}}) = {{Text|"_"|#FFB100}} {{Text|THEN|#F0F0F0}} v = {{Text|27|#F580B1}} {{Text|ELSE|#F0F0F0}} v = {{Text|ASC|#F0F0F0}}({{Text|UCASE$|#F0F0F0}}(l$)) - {{Text|64|#F580B1}}
                                l$ = l$ + defineextaz(v)
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|ELSE|#F0F0F0}}
                        l$ = l2$
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                try = findid(l$)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
                    {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, try
                    {{Text|'is l$ an array?|#31C4C4}}
                    {{Text|IF|#F0F0F0}} nextl$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} id.arraytype {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} (subfuncn = id.insubfuncn {{Text|AND|#F0F0F0}} try_method <= {{Text|2|#F580B1}}) {{Text|OR|#F0F0F0}} try_method >= {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}}
                                arrayid = currentid
                                constequation = {{Text|0|#F580B1}}
                                i2 = i + {{Text|2|#F580B1}}
                                b2 = {{Text|0|#F580B1}}
                                evalnextele3:
                                l2$ = getelement(a$, i2)
                                {{Text|IF|#F0F0F0}} l2$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} b2 = b2 + {{Text|1|#F580B1}}
                                {{Text|IF|#F0F0F0}} l2$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                    b2 = b2 - {{Text|1|#F580B1}}
                                    {{Text|IF|#F0F0F0}} b2 = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        c$ = arrayreference(getelements$(a$, i + {{Text|2|#F580B1}}, i2 - {{Text|1|#F580B1}}), typ2)
                                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                                        i = i2
                                        {{Text|'UDT|#31C4C4}}
                                        {{Text|IF|#F0F0F0}} typ2 {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}}
                                            {{Text|'print "arrayref returned:"+c$|#31C4C4}}
                                            getid arrayid
                                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                                            o$ = {{Text|RIGHT$|#F0F0F0}}(c$, {{Text|LEN|#F0F0F0}}(c$) - {{Text|INSTR|#F0F0F0}}(c$, sp3))
                                            {{Text|'change o$ to a byte offset if necessary|#31C4C4}}
                                            u = typ2 {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
                                            s = udtxsize(u)
                                            {{Text|IF|#F0F0F0}} udtxbytealign(u) {{Text|THEN|#F0F0F0}}
                                                {{Text|IF|#F0F0F0}} s {{Text|MOD|#F0F0F0}} {{Text|8|#F580B1}} {{Text|THEN|#F0F0F0}} s = s + ({{Text|8|#F580B1}} - (s {{Text|MOD|#F0F0F0}} {{Text|8|#F580B1}})) {{Text|'round up to nearest byte|#31C4C4}}
                                                s = s \ {{Text|8|#F580B1}}
                                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                            o$ = {{Text|"("|#FFB100}} + o$ + {{Text|")*"|#FFB100}} + str2$(s)
                                            {{Text|'print "calling evaludt with o$:"+o$|#31C4C4}}
                                            {{Text|GOTO|#F0F0F0}} evaludt
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                        {{Text|GOTO|#F0F0F0}} evalednextele3
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                i2 = i2 + {{Text|1|#F580B1}}
                                {{Text|GOTO|#F0F0F0}} evalnextele3
                                evalednextele3:
                                blockn = blockn + {{Text|1|#F580B1}}
                                block(blockn) = c$
                                evaledblock(blockn) = {{Text|2|#F580B1}}
                                blocktype(blockn) = typ2
                                {{Text|IF|#F0F0F0}} (typ2 {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}} stringprocessinghappened = {{Text|1|#F580B1}}
                                {{Text|GOTO|#F0F0F0}} evaled
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|ELSE|#F0F0F0}}
                        {{Text|'not followed by "("|#31C4C4}}
                        {{Text|'is l$ a simple variable?|#31C4C4}}
                        {{Text|IF|#F0F0F0}} id.t <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} (id.t {{Text|AND|#F0F0F0}} ISUDT) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} (subfuncn = id.insubfuncn {{Text|AND|#F0F0F0}} try_method <= {{Text|2|#F580B1}}) {{Text|OR|#F0F0F0}} try_method >= {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}}
                                constequation = {{Text|0|#F580B1}}
                                blockn = blockn + {{Text|1|#F580B1}}
                                makeidrefer block(blockn), blocktype(blockn)
                                {{Text|IF|#F0F0F0}} (blocktype(blockn) {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}} stringprocessinghappened = {{Text|1|#F580B1}}
                                evaledblock(blockn) = {{Text|2|#F580B1}}
                                {{Text|GOTO|#F0F0F0}} evaled
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|'is l$ a UDT?|#31C4C4}}
                        {{Text|IF|#F0F0F0}} id.t {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} (subfuncn = id.insubfuncn {{Text|AND|#F0F0F0}} try_method <= {{Text|2|#F580B1}}) {{Text|OR|#F0F0F0}} try_method >= {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}}
                                constequation = {{Text|0|#F580B1}}
                                o$ = {{Text|""|#FFB100}}
                                evaludt:
                                b2 = {{Text|0|#F580B1}}
                                i3 = i + {{Text|1|#F580B1}}
                                {{Text|FOR|#F0F0F0}} i2 = i3 {{Text|TO|#F0F0F0}} n
                                    e2$ = getelement(a$, i2)
                                    {{Text|IF|#F0F0F0}} e2$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} b2 = b2 + {{Text|1|#F580B1}}
                                    {{Text|IF|#F0F0F0}} b2 = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} e2$ = {{Text|")"|#FFB100}} {{Text|OR|#F0F0F0}} isoperator(e2$) {{Text|THEN|#F0F0F0}}
                                            i4 = i2 - {{Text|1|#F580B1}}
                                            {{Text|GOTO|#F0F0F0}} gotudt
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} e2$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} b2 = b2 - {{Text|1|#F580B1}}
                                {{Text|NEXT|#F0F0F0}}
                                i4 = n
                                gotudt:
                                {{Text|IF|#F0F0F0}} i4 < i3 {{Text|THEN|#F0F0F0}} e$ = {{Text|""|#FFB100}} {{Text|ELSE|#F0F0F0}} e$ = getelements$(a$, i3, i4)
                                {{Text|'PRINT "UDTREFERENCE:";l$; e$|#31C4C4}}
                                e$ = udtreference(o$, e$, typ2)
                                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                                i = i4
                                blockn = blockn + {{Text|1|#F580B1}}
                                block(blockn) = e$
                                evaledblock(blockn) = {{Text|2|#F580B1}}
                                blocktype(blockn) = typ2
                                {{Text|'is the following next necessary?|#31C4C4}}
                                {{Text|'IF (typ2 AND ISSTRING) THEN stringprocessinghappened = 1|#31C4C4}}
                                {{Text|GOTO|#F0F0F0}} evaled
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'"(" or no "("|#31C4C4}}
                    {{Text|'is l$ a function?|#31C4C4}}
                    {{Text|IF|#F0F0F0}} id.subfunc = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                        constequation = {{Text|0|#F580B1}}
                        {{Text|IF|#F0F0F0}} getelement(a$, i + {{Text|1|#F580B1}}) = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}}
                            i2 = i + {{Text|2|#F580B1}}
                            b2 = {{Text|0|#F580B1}}
                            args = {{Text|1|#F580B1}}
                            evalnextele:
                            l2$ = getelement(a$, i2)
                            {{Text|IF|#F0F0F0}} l2$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} b2 = b2 + {{Text|1|#F580B1}}
                            {{Text|IF|#F0F0F0}} l2$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                b2 = b2 - {{Text|1|#F580B1}}
                                {{Text|IF|#F0F0F0}} b2 = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} i2 = i + {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected (...)"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                                    c$ = evaluatefunc(getelements$(a$, i + {{Text|2|#F580B1}}, i2 - {{Text|1|#F580B1}}), args, typ2)
                                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                                    i = i2
                                    {{Text|GOTO|#F0F0F0}} evalednextele
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} l2$ = {{Text|","|#FFB100}} {{Text|AND|#F0F0F0}} b2 = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} args = args + {{Text|1|#F580B1}}
                            i2 = i2 + {{Text|1|#F580B1}}
                            {{Text|GOTO|#F0F0F0}} evalnextele
                        {{Text|ELSE|#F0F0F0}}
                            {{Text|'no brackets|#31C4C4}}
                            c$ = evaluatefunc({{Text|""|#FFB100}}, {{Text|0|#F580B1}}, typ2)
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        evalednextele:
                        blockn = blockn + {{Text|1|#F580B1}}
                        block(blockn) = c$
                        evaledblock(blockn) = {{Text|2|#F580B1}}
                        blocktype(blockn) = typ2
                        {{Text|IF|#F0F0F0}} (typ2 {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}} stringprocessinghappened = {{Text|1|#F580B1}}
                        {{Text|GOTO|#F0F0F0}} evaled
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(l$) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|LOOP|#F0F0F0}}
            {{Text|NEXT|#F0F0F0}} {{Text|'try method (1-4)|#31C4C4}}
            {{Text|'assume l$ an undefined array?|#31C4C4}}
            {{Text|IF|#F0F0F0}} i <> n {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} getelement$(a$, i + {{Text|1|#F580B1}}) = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} isoperator(l$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} isvalidvariable(l$) {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}}
                                {{Text|PRINT|#F0F0F0}} #9, {{Text|"**************"|#FFB100}}
                                {{Text|PRINT|#F0F0F0}} #9, {{Text|"about to auto-create array:"|#FFB100}} + l$, i
                                {{Text|PRINT|#F0F0F0}} #9, {{Text|"**************"|#FFB100}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            dtyp$ = removesymbol(l$)
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                            {{Text|'count the number of elements|#31C4C4}}
                            nume = {{Text|1|#F580B1}}
                            b2 = {{Text|0|#F580B1}}
                            {{Text|FOR|#F0F0F0}} i2 = i + {{Text|2|#F580B1}} {{Text|TO|#F0F0F0}} n
                                e$ = getelement(a$, i2)
                                {{Text|IF|#F0F0F0}} e$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} b2 = b2 + {{Text|1|#F580B1}}
                                {{Text|IF|#F0F0F0}} b2 = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} e$ = {{Text|","|#FFB100}} {{Text|THEN|#F0F0F0}} nume = nume + {{Text|1|#F580B1}}
                                {{Text|IF|#F0F0F0}} e$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} b2 = b2 - {{Text|1|#F580B1}}
                                {{Text|IF|#F0F0F0}} b2 = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}}
                            {{Text|NEXT|#F0F0F0}}
                            fakee$ = {{Text|"10"|#FFB100}}: {{Text|FOR|#F0F0F0}} i2 = {{Text|2|#F580B1}} {{Text|TO|#F0F0F0}} nume: fakee$ = fakee$ + sp + {{Text|","|#FFB100}} + sp + {{Text|"10"|#FFB100}}: {{Text|NEXT|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"evaluate:creating undefined array using dim2("|#FFB100}} + l$ + {{Text|","|#FFB100}} + dtyp$ + {{Text|",1,"|#FFB100}} + fakee$ + {{Text|")"|#FFB100}}
                            {{Text|IF|#F0F0F0}} optionexplicit {{Text|OR|#F0F0F0}} optionexplicitarray {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Array '"|#FFB100}} + l$ + {{Text|"' ("|#FFB100}} + symbol2fulltypename$(dtyp$) + {{Text|") not defined"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                            olddimstatic = dimstatic
                            method = {{Text|1|#F580B1}}
                            {{Text|IF|#F0F0F0}} subfuncn {{Text|THEN|#F0F0F0}}
                                autoarray = {{Text|1|#F580B1}} {{Text|'move dimensioning of auto array to data???.txt from inline|#31C4C4}}
                                {{Text|'static array declared by STATIC name()?|#31C4C4}}
                                {{Text|'check if varname is on the static list|#31C4C4}}
                                xi = {{Text|1|#F580B1}}
                                {{Text|FOR|#F0F0F0}} x = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} staticarraylistn
                                    varname2$ = getelement$(staticarraylist, xi): xi = xi + {{Text|1|#F580B1}}
                                    typ2$ = getelement$(staticarraylist, xi): xi = xi + {{Text|1|#F580B1}}
                                    dimmethod2 = {{Text|VAL|#F0F0F0}}(getelement$(staticarraylist, xi)): xi = xi + {{Text|1|#F580B1}}
                                    {{Text|'check if they are similar|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} {{Text|UCASE$|#F0F0F0}}(l$) = {{Text|UCASE$|#F0F0F0}}(varname2$) {{Text|THEN|#F0F0F0}}
                                        l3$ = l2$: s$ = removesymbol(l3$)
                                        {{Text|IF|#F0F0F0}} symbol2fulltypename$(dtyp$) = typ2$ {{Text|OR|#F0F0F0}} (dimmethod2 = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} s$ = {{Text|""|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                                            {{Text|'adopt properties|#31C4C4}}
                                            l$ = varname2$
                                            dtyp$ = typ2$
                                            method = dimmethod2
                                            dimstatic = {{Text|3|#F580B1}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'typ|#31C4C4}}
                                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'varname|#31C4C4}}
                                {{Text|NEXT|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'subfuncn|#31C4C4}}
                            bypassNextVariable = {{Text|-1|#F580B1}}
                            ignore = dim2(l$, dtyp$, method, fakee$)
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                            dimstatic = olddimstatic
                            {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"#*#*#* dim2 has returned!!!"|#FFB100}}
                            {{Text|GOTO|#F0F0F0}} reevaluate
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            l$ = l2$ {{Text|'restore l$|#31C4C4}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'b=0|#31C4C4}}
        {{Text|IF|#F0F0F0}} l$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} b = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} i1 = i + {{Text|1|#F580B1}}
            b = b + {{Text|1|#F580B1}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} b = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            blockn = blockn + {{Text|1|#F580B1}}
            block(blockn) = l$
            evaledblock(blockn) = {{Text|0|#F580B1}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} l$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}}
            b = b - {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} b = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                c$ = evaluate(getelements$(a$, i1, i - {{Text|1|#F580B1}}), typ2)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|IF|#F0F0F0}} (typ2 {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}} stringprocessinghappened = {{Text|1|#F580B1}}
                blockn = blockn + {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} (typ2 {{Text|AND|#F0F0F0}} ISPOINTER) {{Text|THEN|#F0F0F0}}
                    block(blockn) = c$
                {{Text|ELSE|#F0F0F0}}
                    block(blockn) = {{Text|"("|#FFB100}} + c$ + {{Text|")"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                evaledblock(blockn) = {{Text|1|#F580B1}}
                blocktype(blockn) = typ2
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        evaled:
    {{Text|NEXT|#F0F0F0}}
    r$ = {{Text|""|#FFB100}} {{Text|'return value|#31C4C4}}
    {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"evaluated blocks:"|#FFB100}};
    {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} blockn
        {{Text|IF|#F0F0F0}} i <> blockn {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, block(i) + {{Text|CHR$|#F0F0F0}}({{Text|219|#F580B1}});
        {{Text|ELSE|#F0F0F0}}
            {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, block(i)
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|NEXT|#F0F0F0}}
    {{Text|'identify any referencable values|#31C4C4}}
    {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} blockn
        {{Text|IF|#F0F0F0}} isoperator(block(i)) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} evaledblock(i) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|'a number?|#31C4C4}}
                c = {{Text|ASC|#F0F0F0}}({{Text|LEFT$|#F0F0F0}}(block(i), {{Text|1|#F580B1}}))
                {{Text|IF|#F0F0F0}} c = {{Text|45|#F580B1}} {{Text|OR|#F0F0F0}} (c >= {{Text|48|#F580B1}} {{Text|AND|#F0F0F0}} c <= {{Text|57|#F580B1}}) {{Text|THEN|#F0F0F0}}
                    num$ = block(i)
                    {{Text|'a float?|#31C4C4}}
                    f = {{Text|0|#F580B1}}
                    x = {{Text|INSTR|#F0F0F0}}(num$, {{Text|"E"|#FFB100}})
                    {{Text|IF|#F0F0F0}} x {{Text|THEN|#F0F0F0}}
                        f = {{Text|1|#F580B1}}: blocktype(i) = SINGLETYPE - ISPOINTER
                    {{Text|ELSE|#F0F0F0}}
                        x = {{Text|INSTR|#F0F0F0}}(num$, {{Text|"D"|#FFB100}})
                        {{Text|IF|#F0F0F0}} x {{Text|THEN|#F0F0F0}}
                            f = {{Text|2|#F580B1}}: blocktype(i) = DOUBLETYPE - ISPOINTER
                        {{Text|ELSE|#F0F0F0}}
                            x = {{Text|INSTR|#F0F0F0}}(num$, {{Text|"F"|#FFB100}})
                            {{Text|IF|#F0F0F0}} x {{Text|THEN|#F0F0F0}}
                                f = {{Text|3|#F580B1}}: blocktype(i) = FLOATTYPE - ISPOINTER
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} f {{Text|THEN|#F0F0F0}}
                        {{Text|'float|#31C4C4}}
                        {{Text|IF|#F0F0F0}} f = {{Text|2|#F580B1}} {{Text|OR|#F0F0F0}} f = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|MID$|#F0F0F0}}(num$, x, {{Text|1|#F580B1}}) = {{Text|"E"|#FFB100}} {{Text|'D,F invalid in C++|#31C4C4}}
                        {{Text|IF|#F0F0F0}} f = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} num$ = num$ + {{Text|"L"|#FFB100}} {{Text|'otherwise number is rounded to a double|#31C4C4}}
                    {{Text|ELSE|#F0F0F0}}
                        {{Text|'integer|#31C4C4}}
                        blocktype(i) = typname2typ(removesymbol$(num$))
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} blocktype(i) {{Text|AND|#F0F0F0}} ISPOINTER {{Text|THEN|#F0F0F0}} blocktype(i) = blocktype(i) - ISPOINTER
                        {{Text|IF|#F0F0F0}} (blocktype(i) {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) > {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} blocktype(i) {{Text|AND|#F0F0F0}} ISUNSIGNED {{Text|THEN|#F0F0F0}} num$ = num$ + {{Text|"ull"|#FFB100}} {{Text|ELSE|#F0F0F0}} num$ = num$ + {{Text|"ll"|#FFB100}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    block(i) = {{Text|" "|#FFB100}} + num$ + {{Text|" "|#FFB100}} {{Text|'pad with spaces to avoid C++ computation errors|#31C4C4}}
                    evaledblock(i) = {{Text|1|#F580B1}}
                    {{Text|GOTO|#F0F0F0}} evaledblock
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'number?|#31C4C4}}
                {{Text|'fc = ASC(LEFT$(block(i), 1))|#31C4C4}}
                {{Text|'IF fc = 45 OR (fc >= 48 AND fc <= 57) THEN '- or 0-9|#31C4C4}}
                {{Text|''it's a number|#31C4C4}}
                {{Text|''check for an extension, if none, assume integer|#31C4C4}}
                {{Text|'blocktype(i) = INTEGER64TYPE - ISPOINTER|#31C4C4}}
                {{Text|'tblock$ = " " + block(i)|#31C4C4}}
                {{Text|'IF RIGHT$(tblock$, 2) = "##" THEN blocktype(i) = FLOATTYPE - ISPOINTER: block(i) = LEFT$(block(i), LEN(block$(i)) - 2): GOTO evfltnum|#31C4C4}}
                {{Text|'IF RIGHT$(tblock$, 1) = "#" THEN blocktype(i) = DOUBLETYPE - ISPOINTER: block(i) = LEFT$(block(i), LEN(block$(i)) - 1): GOTO evfltnum|#31C4C4}}
                {{Text|'IF RIGHT$(tblock$, 1) = "!" THEN blocktype(i) = SINGLETYPE - ISPOINTER: block(i) = LEFT$(block(i), LEN(block$(i)) - 1): GOTO evfltnum|#31C4C4}}
                {{Text|'|#31C4C4}}
                {{Text|''C++ 32bit unsigned to signed 64bit|#31C4C4}}
                {{Text|'IF INSTR(block(i),".")=0 THEN|#31C4C4}}
                {{Text|'|#31C4C4}}
                {{Text|'negated=0|#31C4C4}}
                {{Text|'if left$(block(i),1)="-" then block(i)=right$(block(i),len(block(i))-1):negated=1|#31C4C4}}
                {{Text|'|#31C4C4}}
                {{Text|'if left$(block(i),2)="0x" then 'hex|#31C4C4}}
                {{Text|'if len(block(i))=10 then|#31C4C4}}
                {{Text|'if block(i)>="0x80000000" and block(i)<="0xFFFFFFFF" then block(i)="(int64)"+block(i): goto evnum|#31C4C4}}
                {{Text|'end if|#31C4C4}}
                {{Text|'if len(block(i))>10 then block(i)=block(i)+"ll": goto evnum|#31C4C4}}
                {{Text|'goto evnum|#31C4C4}}
                {{Text|'end if|#31C4C4}}
                {{Text|'|#31C4C4}}
                {{Text|'if left$(block(i),1)="0" then 'octal|#31C4C4}}
                {{Text|'if len(block(i))=12 then|#31C4C4}}
                {{Text|'if block(i)>="020000000000" and block(i)<="037777777777" then block(i)="(int64)"+block(i): goto evnum|#31C4C4}}
                {{Text|'if block(i)>"037777777777" then block(i)=block(i)+"ll": goto evnum|#31C4C4}}
                {{Text|'end if|#31C4C4}}
                {{Text|'if len(block(i))>12 then block(i)=block(i)+"ll": goto evnum|#31C4C4}}
                {{Text|'goto evnum|#31C4C4}}
                {{Text|'end if|#31C4C4}}
                {{Text|'|#31C4C4}}
                {{Text|''decimal|#31C4C4}}
                {{Text|'if len(block(i))=10 then|#31C4C4}}
                {{Text|'if block(i)>="2147483648" and block(i)<="4294967295" then block(i)="(int64)"+block(i): goto evnum|#31C4C4}}
                {{Text|'if block(i)>"4294967295" then block(i)=block(i)+"ll": goto evnum|#31C4C4}}
                {{Text|'end if|#31C4C4}}
                {{Text|'if len(block(i))>10 then block(i)=block(i)+"ll"|#31C4C4}}
                {{Text|'|#31C4C4}}
                {{Text|'evnum:|#31C4C4}}
                {{Text|'|#31C4C4}}
                {{Text|'if negated=1 then block(i)="-"+block(i)|#31C4C4}}
                {{Text|'|#31C4C4}}
                {{Text|'END IF|#31C4C4}}
                {{Text|'|#31C4C4}}
                {{Text|'evfltnum:|#31C4C4}}
                {{Text|'|#31C4C4}}
                {{Text|'block(i) = " " + block(i)+" "|#31C4C4}}
                {{Text|'evaledblock(i) = 1|#31C4C4}}
                {{Text|'GOTO evaledblock|#31C4C4}}
                {{Text|'END IF|#31C4C4}}
                {{Text|'a typed string in ""|#31C4C4}}
                {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(block(i), {{Text|1|#F580B1}}) = {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} {{Text|RIGHT$|#F0F0F0}}(block(i), {{Text|1|#F580B1}}) <> {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) {{Text|THEN|#F0F0F0}}
                        block(i) = {{Text|"qbs_new_txt_len("|#FFB100}} + block(i) + {{Text|")"|#FFB100}}
                    {{Text|ELSE|#F0F0F0}}
                        block(i) = {{Text|"qbs_new_txt("|#FFB100}} + block(i) + {{Text|")"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    blocktype(i) = ISSTRING
                    evaledblock(i) = {{Text|1|#F580B1}}
                    stringprocessinghappened = {{Text|1|#F580B1}}
                    {{Text|GOTO|#F0F0F0}} evaledblock
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'create variable|#31C4C4}}
                {{Text|IF|#F0F0F0}} isvalidvariable(block(i)) {{Text|THEN|#F0F0F0}}
                    x$ = block(i)
                    typ$ = removesymbol$(x$)
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|'add symbol extension if none given|#31C4C4}}
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(typ$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(x$, {{Text|1|#F580B1}}) = {{Text|"_"|#FFB100}} {{Text|THEN|#F0F0F0}} v = {{Text|27|#F580B1}} {{Text|ELSE|#F0F0F0}} v = {{Text|ASC|#F0F0F0}}({{Text|UCASE$|#F0F0F0}}(x$)) - {{Text|64|#F580B1}}
                        typ$ = defineextaz(v)
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|'check that it hasn't just been created within this loop (a=b+b)|#31C4C4}}
                    try = findid(x$ + typ$)
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
                        {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, try
                        {{Text|IF|#F0F0F0}} id.t <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} (id.t {{Text|AND|#F0F0F0}} ISUDT) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'is x$ a simple variable?|#31C4C4}}
                            {{Text|GOTO|#F0F0F0}} simplevarfound
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(x$ + typ$) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|LOOP|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"CREATING VARIABLE:"|#FFB100}} + x$
                    {{Text|IF|#F0F0F0}} optionexplicit {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Variable '"|#FFB100}} + x$ + {{Text|"' ("|#FFB100}} + symbol2fulltypename$(typ$) + {{Text|") not defined"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    bypassNextVariable = {{Text|-1|#F580B1}}
                    retval = dim2(x$, typ$, {{Text|1|#F580B1}}, {{Text|""|#FFB100}})
                    manageVariableList {{Text|""|#FFB100}}, vWatchNewVariable$, {{Text|0|#F580B1}}, {{Text|3|#F580B1}}
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    simplevarfound:
                    constequation = {{Text|0|#F580B1}}
                    makeidrefer block(i), blocktype(i)
                    {{Text|IF|#F0F0F0}} (blocktype(i) {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}} stringprocessinghappened = {{Text|1|#F580B1}}
                    {{Text|IF|#F0F0F0}} blockn = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} (blocktype(i) {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} returnpointer
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|'reference value|#31C4C4}}
                    block(i) = refer(block(i), blocktype(i), {{Text|0|#F580B1}}): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    evaledblock(i) = {{Text|1|#F580B1}}
                    {{Text|GOTO|#F0F0F0}} evaledblock
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                Give_Error {{Text|"Invalid expression"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|ELSE|#F0F0F0}}
                {{Text|IF|#F0F0F0}} (blocktype(i) {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} blockn = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} returnpointer
                    {{Text|'if blocktype(i) and ISUDT then PRINT "UDT passed to refer by evaluate"|#31C4C4}}
                    block(i) = refer(block(i), blocktype(i), {{Text|0|#F580B1}})
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        evaledblock:
    {{Text|NEXT|#F0F0F0}}
    {{Text|'return a POINTER if possible|#31C4C4}}
    {{Text|IF|#F0F0F0}} blockn = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} evaledblock({{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} (blocktype({{Text|1|#F580B1}}) {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}}
                returnpointer:
                {{Text|IF|#F0F0F0}} (blocktype({{Text|1|#F580B1}}) {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}} stringprocessinghappened = {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"evaluated reference:"|#FFB100}} + block({{Text|1|#F580B1}})
                typ = blocktype({{Text|1|#F580B1}})
                evaluate$ = block({{Text|1|#F580B1}})
                {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'it cannot be returned as a pointer|#31C4C4}}
    {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"applying operators:"|#FFB100}};
    {{Text|IF|#F0F0F0}} typ = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}}
        typ = blocktype({{Text|1|#F580B1}}) {{Text|'init typ with first blocktype|#31C4C4}}
        {{Text|IF|#F0F0F0}} isoperator(block({{Text|1|#F580B1}})) {{Text|THEN|#F0F0F0}} {{Text|'but what if it starts with a UNARY operator?|#31C4C4}}
            typ = blocktype({{Text|2|#F580B1}}) {{Text|'init typ with second blocktype|#31C4C4}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    nonop = {{Text|0|#F580B1}}
    {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} blockn
        {{Text|IF|#F0F0F0}} evaledblock(i) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            isop = isoperator(block(i))
            {{Text|IF|#F0F0F0}} isop {{Text|THEN|#F0F0F0}}
                nonop = {{Text|0|#F580B1}}
                constequation = {{Text|0|#F580B1}}
                {{Text|'operator found|#31C4C4}}
                o$ = block(i)
                u = operatorusage(o$, typ, i$, lhstyp, rhstyp, result)
                {{Text|IF|#F0F0F0}} u <> {{Text|5|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'not unary|#31C4C4}}
                    nonop = {{Text|1|#F580B1}}
                    {{Text|IF|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|OR|#F0F0F0}} evaledblock(i - {{Text|1|#F580B1}}) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} blockn = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} o$ = {{Text|"-"|#FFB100}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected variable/value after '"|#FFB100}} + {{Text|UCASE$|#F0F0F0}}(o$) + {{Text|"'"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}} {{Text|'guess - is neg in this case|#31C4C4}}
                        Give_Error {{Text|"Expected variable/value before '"|#FFB100}} + {{Text|UCASE$|#F0F0F0}}(o$) + {{Text|"'"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} i = blockn {{Text|OR|#F0F0F0}} evaledblock(i + {{Text|1|#F580B1}}) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected variable/value after '"|#FFB100}} + {{Text|UCASE$|#F0F0F0}}(o$) + {{Text|"'"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|'lhstyp & rhstyp bit-field values|#31C4C4}}
                {{Text|'1=integeral|#31C4C4}}
                {{Text|'2=floating point|#31C4C4}}
                {{Text|'4=string|#31C4C4}}
                {{Text|'8=bool *only used for result|#31C4C4}}
                oldtyp = typ
                newtyp = blocktype(i + {{Text|1|#F580B1}})
                {{Text|'IF block(i - 1) = "6" THEN|#31C4C4}}
                {{Text|'PRINT o$|#31C4C4}}
                {{Text|'PRINT oldtyp AND ISFLOAT|#31C4C4}}
                {{Text|'PRINT blocktype(i - 1) AND ISFLOAT|#31C4C4}}
                {{Text|'END|#31C4C4}}
                {{Text|'END IF|#31C4C4}}
                {{Text|'numeric->string is illegal!|#31C4C4}}
                {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISSTRING) = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} (newtyp {{Text|AND|#F0F0F0}} ISSTRING) <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    Give_Error {{Text|"Cannot convert number to string"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'Offset protection: Override conversion rules for operator as necessary|#31C4C4}}
                offsetmode = {{Text|0|#F580B1}}
                offsetcvi = {{Text|0|#F580B1}}
                {{Text|IF|#F0F0F0}} (oldtyp {{Text|AND|#F0F0F0}} ISOFFSET) <> {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} (newtyp {{Text|AND|#F0F0F0}} ISOFFSET) <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    offsetmode = {{Text|2|#F580B1}}
                    {{Text|IF|#F0F0F0}} newtyp {{Text|AND|#F0F0F0}} ISOFFSET {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} (newtyp {{Text|AND|#F0F0F0}} ISUNSIGNED) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} offsetmode = {{Text|1|#F580B1}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} oldtyp {{Text|AND|#F0F0F0}} ISOFFSET {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} (oldtyp {{Text|AND|#F0F0F0}} ISUNSIGNED) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} offsetmode = {{Text|1|#F580B1}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|'depending on the operater we may do things differently|#31C4C4}}
                    {{Text|'the default method is convert both sides to integer first|#31C4C4}}
                    {{Text|'but these operators are different: * / ^|#31C4C4}}
                    {{Text|IF|#F0F0F0}} o$ = {{Text|"*"|#FFB100}} {{Text|OR|#F0F0F0}} o$ = {{Text|"/"|#FFB100}} {{Text|OR|#F0F0F0}} o$ = {{Text|"^"|#FFB100}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} o$ = {{Text|"*"|#FFB100}} {{Text|OR|#F0F0F0}} o$ = {{Text|"^"|#FFB100}} {{Text|THEN|#F0F0F0}}
                            {{Text|'for mult, if either side is a float cast integers to 'long double's first|#31C4C4}}
                            {{Text|IF|#F0F0F0}} (newtyp {{Text|AND|#F0F0F0}} ISFLOAT) <> {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} (oldtyp {{Text|AND|#F0F0F0}} ISFLOAT) <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                offsetcvi = {{Text|1|#F580B1}}
                                {{Text|IF|#F0F0F0}} (oldtyp {{Text|AND|#F0F0F0}} ISFLOAT) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} lhstyp = {{Text|2|#F580B1}}
                                {{Text|IF|#F0F0F0}} (newtyp {{Text|AND|#F0F0F0}} ISFLOAT) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} rhstyp = {{Text|2|#F580B1}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} o$ = {{Text|"/"|#FFB100}} {{Text|OR|#F0F0F0}} o$ = {{Text|"^"|#FFB100}} {{Text|THEN|#F0F0F0}}
                            {{Text|'for division or exponentials, to prevent integer division cast integers to 'long double's|#31C4C4}}
                            offsetcvi = {{Text|1|#F580B1}}
                            {{Text|IF|#F0F0F0}} (oldtyp {{Text|AND|#F0F0F0}} ISFLOAT) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} lhstyp = {{Text|2|#F580B1}}
                            {{Text|IF|#F0F0F0}} (newtyp {{Text|AND|#F0F0F0}} ISFLOAT) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} rhstyp = {{Text|2|#F580B1}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|ELSE|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} lhstyp {{Text|AND|#F0F0F0}} {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} lhstyp = {{Text|1|#F580B1}} {{Text|'force lhs and rhs to be integer values|#31C4C4}}
                        {{Text|IF|#F0F0F0}} rhstyp {{Text|AND|#F0F0F0}} {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} rhstyp = {{Text|1|#F580B1}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} result = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} result = {{Text|1|#F580B1}} {{Text|'force integer result|#31C4C4}}
                    {{Text|'note: result=1 just sets typ&=64 if typ is a float|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'STEP 1: convert oldtyp and/or newtyp if required for the operator|#31C4C4}}
                {{Text|'convert lhs|#31C4C4}}
                {{Text|IF|#F0F0F0}} (oldtyp {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (lhstyp {{Text|AND|#F0F0F0}} {{Text|4|#F580B1}}) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Cannot convert string to number"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|ELSE|#F0F0F0}}
                    {{Text|'oldtyp is numeric|#31C4C4}}
                    {{Text|IF|#F0F0F0}} lhstyp = {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Cannot convert number to string"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (oldtyp {{Text|AND|#F0F0F0}} ISFLOAT) {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} (lhstyp {{Text|AND|#F0F0F0}} {{Text|2|#F580B1}}) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                            {{Text|'convert float to int|#31C4C4}}
                            block(i - {{Text|1|#F580B1}}) = {{Text|"qbr("|#FFB100}} + block(i - {{Text|1|#F580B1}}) + {{Text|")"|#FFB100}}
                            oldtyp = {{Text|64&|#F580B1}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|ELSE|#F0F0F0}}
                        {{Text|'oldtyp is an int|#31C4C4}}
                        {{Text|IF|#F0F0F0}} (lhstyp {{Text|AND|#F0F0F0}} {{Text|1|#F580B1}}) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                            {{Text|'convert int to float|#31C4C4}}
                            block(i - {{Text|1|#F580B1}}) = {{Text|"((long double)("|#FFB100}} + block(i - {{Text|1|#F580B1}}) + {{Text|"))"|#FFB100}}
                            oldtyp = {{Text|256&|#F580B1}} + ISFLOAT
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'convert rhs|#31C4C4}}
                {{Text|IF|#F0F0F0}} (newtyp {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (rhstyp {{Text|AND|#F0F0F0}} {{Text|4|#F580B1}}) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Cannot convert string to number"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|ELSE|#F0F0F0}}
                    {{Text|'newtyp is numeric|#31C4C4}}
                    {{Text|IF|#F0F0F0}} rhstyp = {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Cannot convert number to string"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (newtyp {{Text|AND|#F0F0F0}} ISFLOAT) {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} (rhstyp {{Text|AND|#F0F0F0}} {{Text|2|#F580B1}}) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                            {{Text|'convert float to int|#31C4C4}}
                            block(i + {{Text|1|#F580B1}}) = {{Text|"qbr("|#FFB100}} + block(i + {{Text|1|#F580B1}}) + {{Text|")"|#FFB100}}
                            newtyp = {{Text|64&|#F580B1}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|ELSE|#F0F0F0}}
                        {{Text|'newtyp is an int|#31C4C4}}
                        {{Text|IF|#F0F0F0}} (rhstyp {{Text|AND|#F0F0F0}} {{Text|1|#F580B1}}) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                            {{Text|'convert int to float|#31C4C4}}
                            block(i + {{Text|1|#F580B1}}) = {{Text|"((long double)("|#FFB100}} + block(i + {{Text|1|#F580B1}}) + {{Text|"))"|#FFB100}}
                            newtyp = {{Text|256&|#F580B1}} + ISFLOAT
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'Reduce floating point values to common base for comparison?|#31C4C4}}
                {{Text|IF|#F0F0F0}} isop = {{Text|7|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'comparitive operator|#31C4C4}}
                    {{Text|'Corrects problems encountered such as:|#31C4C4}}
                    {{Text|'    S = 2.1|#31C4C4}}
                    {{Text|'    IF S = 2.1 THEN PRINT "OK" ELSE PRINT "ERROR S PRINTS AS"; S; "BUT IS SEEN BY QB64 AS..."|#31C4C4}}
                    {{Text|'    IF S < 2.1 THEN PRINT "LESS THAN 2.1"|#31C4C4}}
                    {{Text|'concerns:|#31C4C4}}
                    {{Text|'1. Return value from TIMER will be reduced to a SINGLE in direct comparisons|#31C4C4}}
                    {{Text|'solution: assess, and only apply to SINGLE variables/arrays|#31C4C4}}
                    {{Text|'2. Comparison of a double higher/lower than single range may fail|#31C4C4}}
                    {{Text|'solution: out of range values convert to +/-1.#INF, making comparison still possible|#31C4C4}}
                    {{Text|IF|#F0F0F0}} (oldtyp {{Text|AND|#F0F0F0}} ISFLOAT) <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} (newtyp {{Text|AND|#F0F0F0}} ISFLOAT) <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'both floating point|#31C4C4}}
                        s1 = oldtyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}: s2 = newtyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
                        {{Text|IF|#F0F0F0}} s2 < s1 {{Text|THEN|#F0F0F0}} s1 = s2
                        {{Text|IF|#F0F0F0}} s1 = {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}}
                            block(i - {{Text|1|#F580B1}}) = {{Text|"((float)("|#FFB100}} + block(i - {{Text|1|#F580B1}}) + {{Text|"))"|#FFB100}}: oldtyp = {{Text|32&|#F580B1}} + ISFLOAT
                            block(i + {{Text|1|#F580B1}}) = {{Text|"((float)("|#FFB100}} + block(i + {{Text|1|#F580B1}}) + {{Text|"))"|#FFB100}}: newtyp = {{Text|32&|#F580B1}} + ISFLOAT
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} s1 = {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}}
                            block(i - {{Text|1|#F580B1}}) = {{Text|"((double)("|#FFB100}} + block(i - {{Text|1|#F580B1}}) + {{Text|"))"|#FFB100}}: oldtyp = {{Text|64&|#F580B1}} + ISFLOAT
                            block(i + {{Text|1|#F580B1}}) = {{Text|"((double)("|#FFB100}} + block(i + {{Text|1|#F580B1}}) + {{Text|"))"|#FFB100}}: newtyp = {{Text|64&|#F580B1}} + ISFLOAT
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'both floating point|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'comparitive operator|#31C4C4}}
                typ = newtyp
                {{Text|'STEP 2: markup typ|#31C4C4}}
                {{Text|'        if either side is a float, markup typ to largest float|#31C4C4}}
                {{Text|'        if either side is integer, markup typ|#31C4C4}}
                {{Text|'Note: A markup is a GUESS of what the return type will be,|#31C4C4}}
                {{Text|'      'result' can override this markup|#31C4C4}}
                {{Text|IF|#F0F0F0}} (oldtyp {{Text|AND|#F0F0F0}} ISSTRING) = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} (newtyp {{Text|AND|#F0F0F0}} ISSTRING) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (oldtyp {{Text|AND|#F0F0F0}} ISFLOAT) <> {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} (newtyp {{Text|AND|#F0F0F0}} ISFLOAT) <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|'float|#31C4C4}}
                        b = {{Text|0|#F580B1}}: {{Text|IF|#F0F0F0}} (oldtyp {{Text|AND|#F0F0F0}} ISFLOAT) {{Text|THEN|#F0F0F0}} b = oldtyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
                        {{Text|IF|#F0F0F0}} (newtyp {{Text|AND|#F0F0F0}} ISFLOAT) {{Text|THEN|#F0F0F0}}
                            b2 = newtyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}: {{Text|IF|#F0F0F0}} b2 > b {{Text|THEN|#F0F0F0}} b = b2
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        typ = ISFLOAT + b
                    {{Text|ELSE|#F0F0F0}}
                        {{Text|'integer|#31C4C4}}
                        {{Text|'***THIS IS THE IDEAL MARKUP FOR A 64-BIT SYSTEM***|#31C4C4}}
                        {{Text|'In reality 32-bit C++ only marks-up to 32-bit integers|#31C4C4}}
                        b = oldtyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}: b2 = newtyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}: {{Text|IF|#F0F0F0}} b2 > b {{Text|THEN|#F0F0F0}} b = b2
                        typ = {{Text|64&|#F580B1}}
                        {{Text|IF|#F0F0F0}} b = {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} (oldtyp {{Text|AND|#F0F0F0}} ISUNSIGNED) <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} (newtyp {{Text|AND|#F0F0F0}} ISUNSIGNED) <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} typ = {{Text|64&|#F580B1}} + ISUNSIGNED
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} result = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISFLOAT) <> {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISSTRING) <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} typ = {{Text|64|#F580B1}} {{Text|'otherwise keep markuped integer type|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} result = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISFLOAT) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} typ = ISFLOAT + {{Text|256|#F580B1}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} result = {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}}
                    typ = ISSTRING
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} result = {{Text|8|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'bool|#31C4C4}}
                    typ = {{Text|32|#F580B1}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'Offset protection: Force result to be an offset type with correct signage|#31C4C4}}
                {{Text|IF|#F0F0F0}} offsetmode {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} result <> {{Text|8|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'boolean comparison results are allowed|#31C4C4}}
                        typ = OFFSETTYPE - ISPOINTER: {{Text|IF|#F0F0F0}} offsetmode = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} typ = typ + ISUNSIGNED
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'override typ=ISFLOAT+256 to typ=ISFLOAT+64 for ^ operator's result|#31C4C4}}
                {{Text|IF|#F0F0F0}} u = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} i$ = {{Text|"pow2"|#FFB100}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} offsetmode {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Operator '^' cannot be used with an _OFFSET"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        {{Text|'QB-like conversion of math functions returning floating point values|#31C4C4}}
                        {{Text|'reassess oldtype & newtype|#31C4C4}}
                        b = oldtyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
                        {{Text|IF|#F0F0F0}} oldtyp {{Text|AND|#F0F0F0}} ISFLOAT {{Text|THEN|#F0F0F0}}
                            {{Text|'no change to b|#31C4C4}}
                        {{Text|ELSE|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} b > {{Text|16|#F580B1}} {{Text|THEN|#F0F0F0}} b = {{Text|64|#F580B1}} {{Text|'larger than INTEGER? return DOUBLE|#31C4C4}}
                            {{Text|IF|#F0F0F0}} b > {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} b = {{Text|256|#F580B1}} {{Text|'larger than LONG? return FLOAT|#31C4C4}}
                            {{Text|IF|#F0F0F0}} b <= {{Text|16|#F580B1}} {{Text|THEN|#F0F0F0}} b = {{Text|32|#F580B1}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        b2 = newtyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
                        {{Text|IF|#F0F0F0}} newtyp {{Text|AND|#F0F0F0}} ISFLOAT {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} b2 > b {{Text|THEN|#F0F0F0}} b = b2
                        {{Text|ELSE|#F0F0F0}}
                            b3 = {{Text|32|#F580B1}}
                            {{Text|IF|#F0F0F0}} b2 > {{Text|16|#F580B1}} {{Text|THEN|#F0F0F0}} b3 = {{Text|64|#F580B1}} {{Text|'larger than INTEGER? return DOUBLE|#31C4C4}}
                            {{Text|IF|#F0F0F0}} b2 > {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} b3 = {{Text|256|#F580B1}} {{Text|'larger than LONG? return FLOAT|#31C4C4}}
                            {{Text|IF|#F0F0F0}} b3 > b {{Text|THEN|#F0F0F0}} b = b3
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        typ = ISFLOAT + b
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'pow2|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'u=2|#31C4C4}}
                {{Text|'STEP 3: apply operator appropriately|#31C4C4}}
                {{Text|IF|#F0F0F0}} u = {{Text|5|#F580B1}} {{Text|THEN|#F0F0F0}}
                    block(i + {{Text|1|#F580B1}}) = i$ + {{Text|"("|#FFB100}} + block(i + {{Text|1|#F580B1}}) + {{Text|")"|#FFB100}}
                    block(i) = {{Text|""|#FFB100}}: i = i + {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} operatorapplied
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'binary operators|#31C4C4}}
                {{Text|IF|#F0F0F0}} u = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                    block(i + {{Text|1|#F580B1}}) = block(i - {{Text|1|#F580B1}}) + i$ + block(i + {{Text|1|#F580B1}})
                    block(i - {{Text|1|#F580B1}}) = {{Text|""|#FFB100}}: block(i) = {{Text|""|#FFB100}}: i = i + {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} operatorapplied
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} u = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                    block(i + {{Text|1|#F580B1}}) = i$ + {{Text|"("|#FFB100}} + block(i - {{Text|1|#F580B1}}) + {{Text|","|#FFB100}} + block(i + {{Text|1|#F580B1}}) + {{Text|")"|#FFB100}}
                    block(i - {{Text|1|#F580B1}}) = {{Text|""|#FFB100}}: block(i) = {{Text|""|#FFB100}}: i = i + {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} operatorapplied
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} u = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}}
                    block(i + {{Text|1|#F580B1}}) = {{Text|"-("|#FFB100}} + block(i - {{Text|1|#F580B1}}) + i$ + block(i + {{Text|1|#F580B1}}) + {{Text|")"|#FFB100}}
                    block(i - {{Text|1|#F580B1}}) = {{Text|""|#FFB100}}: block(i) = {{Text|""|#FFB100}}: i = i + {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} operatorapplied
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} u = {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}}
                    block(i + {{Text|1|#F580B1}}) = {{Text|"~"|#FFB100}} + block(i - {{Text|1|#F580B1}}) + i$ + block(i + {{Text|1|#F580B1}})
                    block(i - {{Text|1|#F580B1}}) = {{Text|""|#FFB100}}: block(i) = {{Text|""|#FFB100}}: i = i + {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} operatorapplied
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'...more?...|#31C4C4}}
                Give_Error {{Text|"ERROR: Operator could not be applied correctly!"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}} {{Text|'<--should never happen!|#31C4C4}}
                operatorapplied:
                {{Text|IF|#F0F0F0}} offsetcvi {{Text|THEN|#F0F0F0}} block(i) = {{Text|"qbr("|#FFB100}} + block(i) + {{Text|")"|#FFB100}}: offsetcvi = {{Text|0|#F580B1}}
                offsetmode = {{Text|0|#F580B1}}
            {{Text|ELSE|#F0F0F0}}
                nonop = nonop + {{Text|1|#F580B1}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|ELSE|#F0F0F0}}
            nonop = nonop + {{Text|1|#F580B1}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} nonop > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected operator in equation"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|NEXT|#F0F0F0}}
    {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|""|#FFB100}}
    {{Text|'join blocks|#31C4C4}}
    {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} blockn
        r$ = r$ + block(i)
    {{Text|NEXT|#F0F0F0}}
    {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}}
        {{Text|PRINT|#F0F0F0}} #9, {{Text|"evaluated:"|#FFB100}} + r$ + {{Text|" AS TYPE:"|#FFB100}};
        {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"[ISSTRING]"|#FFB100}};
        {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISFLOAT) {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"[ISFLOAT]"|#FFB100}};
        {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISUNSIGNED) {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"[ISUNSIGNED]"|#FFB100}};
        {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISPOINTER) {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"[ISPOINTER]"|#FFB100}};
        {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISFIXEDLENGTH) {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"[ISFIXEDLENGTH]"|#FFB100}};
        {{Text|IF|#F0F0F0}} (typ {{Text|AND|#F0F0F0}} ISINCONVENTIONALMEMORY) {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"[ISINCONVENTIONALMEMORY]"|#FFB100}};
        {{Text|PRINT|#F0F0F0}} #9, {{Text|"(size in bits="|#FFB100}} + str2$(typ {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) + {{Text|")"|#FFB100}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    evaluate$ = r$
{{Text|END|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
{{Text|FUNCTION|#F0F0F0}} evaluatefunc$ (a2$, args {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}, typ {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}})
    a$ = a2$
    {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"evaluatingfunction:"|#FFB100}} + {{Text|RTRIM$|#F0F0F0}}(id.n) + {{Text|":"|#FFB100}} + a$
    {{Text|DIM|#F0F0F0}} id2 {{Text|AS|#F0F0F0}} idstruct
    id2 = id
    n$ = {{Text|RTRIM$|#F0F0F0}}(id2.n)
    typ = id2.ret
    targetid = currentid
    {{Text|IF|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(id2.callname) = {{Text|"func_stub"|#FFB100}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Command not implemented"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|IF|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(id2.callname) = {{Text|"func_input"|#FFB100}} {{Text|AND|#F0F0F0}} args = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} inputfunctioncalled = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
        inputfunctioncalled = {{Text|-1|#F580B1}}
        {{Text|IF|#F0F0F0}} vWatchOn = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
            WriteBufLine MainTxtBuf, {{Text|"*__LONG_VWATCH_LINENUMBER= -4; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    SetDependency id2.Dependency
    argCount = countFunctionElements(a$)
    {{Text|REDIM|#F0F0F0}} providedArgs(argCount)
    passomit = {{Text|0|#F580B1}}
    hasOptionalFirstArg = {{Text|0|#F580B1}}
    firstOptionalArgument = {{Text|0|#F580B1}}
    f$ = {{Text|RTRIM$|#F0F0F0}}(id2.specialformat)
    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(f$) {{Text|THEN|#F0F0F0}} {{Text|'special format given|#31C4C4}}
        {{Text|FOR|#F0F0F0}} fi = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} argCount
            providedArgs(fi) = hasFunctionElement(a$, fi)
        {{Text|NEXT|#F0F0F0}}
        {{Text|' Special case for the INSTR and _INSTRREV format, which have an optional argument at the beginning|#31C4C4}}
        {{Text|IF|#F0F0F0}} f$ = {{Text|"[?],?,?"|#FFB100}} {{Text|THEN|#F0F0F0}}
            hasOptionalFirstArg = {{Text|-1|#F580B1}}
            {{Text|IF|#F0F0F0}} {{Text|UBOUND|#F0F0F0}}(providedArgs) = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|REDIM|#F0F0F0}} {{Text|_PRESERVE|#F0F0F0}} 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|' The first argument was not provided|#31C4C4}}
                skipFirstArg = {{Text|-1|#F580B1}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} {{Text|NOT|#F0F0F0}} isValidArgSet(id2.specialformat, providedArgs(), firstOptionalArgument) {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(id2.hr_syntax) > {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                Give_Error {{Text|"Incorrect number of arguments - Reference: "|#FFB100}} + id2.hr_syntax
            {{Text|ELSE|#F0F0F0}}
                Give_Error {{Text|"Incorrect number of arguments passed to function"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        passomit = {{Text|1|#F580B1}} {{Text|'pass omit flags param to function|#31C4C4}}
    {{Text|ELSE|#F0F0F0}} {{Text|'no special format given|#31C4C4}}
        {{Text|FOR|#F0F0F0}} fi = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} argCount
            providedArgs(fi) = {{Text|-1|#F580B1}}
        {{Text|NEXT|#F0F0F0}}
        {{Text|IF|#F0F0F0}} n$ = {{Text|"ASC"|#FFB100}} {{Text|AND|#F0F0F0}} args = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} skipargnumchk
        {{Text|IF|#F0F0F0}} id2.overloaded = {{Text|-1|#F580B1}} {{Text|AND|#F0F0F0}} (args >= id2.minargs {{Text|AND|#F0F0F0}} args <= id2.args) {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} skipargnumchk
        {{Text|IF|#F0F0F0}} id2.args <> args {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(id2.hr_syntax) > {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                Give_Error {{Text|"Incorrect number of arguments - Reference: "|#FFB100}} + id2.hr_syntax
            {{Text|ELSE|#F0F0F0}}
                Give_Error {{Text|"Incorrect number of arguments passed to function"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    skipargnumchk:
    r$ = {{Text|RTRIM$|#F0F0F0}}(id2.callname) + {{Text|"("|#FFB100}}
    {{Text|IF|#F0F0F0}} id2.args <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
        curarg = {{Text|1|#F580B1}}
        firsti = {{Text|1|#F580B1}}
        {{Text|' The first optional argument is missing and not included in the|#31C4C4}}
        {{Text|' argument list|#31C4C4}}
        {{Text|IF|#F0F0F0}} skipFirstArg {{Text|THEN|#F0F0F0}}
            r$ = r$ + {{Text|"NULL,"|#FFB100}}
            curarg = {{Text|2|#F580B1}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        n = numelements(a$)
        {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} n
            l$ = getelement(a$, i)
            {{Text|IF|#F0F0F0}} l$ = {{Text|"("|#FFB100}} {{Text|THEN|#F0F0F0}} b = b + {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} l$ = {{Text|")"|#FFB100}} {{Text|THEN|#F0F0F0}} b = b - {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} (l$ = {{Text|","|#FFB100}} {{Text|AND|#F0F0F0}} b = {{Text|0|#F580B1}}) {{Text|OR|#F0F0F0}} (i = n) {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} {{Text|NOT|#F0F0F0}} providedArgs(curarg) {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} i = n {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Last function argument cannot be empty"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    r$ = r$ + {{Text|"NULL,"|#FFB100}}
                    firsti = i + {{Text|1|#F580B1}}
                    curarg = curarg + {{Text|1|#F580B1}}
                    {{Text|_CONTINUE|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                targettyp = {{Text|CVL|#F0F0F0}}({{Text|MID$|#F0F0F0}}(id2.arg, curarg * {{Text|4|#F580B1}} - {{Text|4|#F580B1}} + {{Text|1|#F580B1}}, {{Text|4|#F580B1}}))
                nele = {{Text|ASC|#F0F0F0}}({{Text|MID$|#F0F0F0}}(id2.nele, curarg, {{Text|1|#F580B1}}))
                nelereq = {{Text|ASC|#F0F0F0}}({{Text|MID$|#F0F0F0}}(id2.nelereq, curarg, {{Text|1|#F580B1}}))
                {{Text|IF|#F0F0F0}} i = n {{Text|THEN|#F0F0F0}}
                    e$ = getelements$(a$, firsti, i)
                {{Text|ELSE|#F0F0F0}}
                    e$ = getelements$(a$, firsti, i - {{Text|1|#F580B1}})
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(e$, {{Text|2|#F580B1}}) = {{Text|"("|#FFB100}} + sp {{Text|THEN|#F0F0F0}} dereference = {{Text|1|#F580B1}} {{Text|ELSE|#F0F0F0}} dereference = {{Text|0|#F580B1}}
                {{Text|'*special case CVI,CVL,CVS,CVD,_CV (part #1)|#31C4C4}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"_CV"|#FFB100}} {{Text|OR|#F0F0F0}} (n$ = {{Text|"CV"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} curarg = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                        cvtype$ = type2symbol$(e$)
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        e$ = {{Text|""|#FFB100}}
                        {{Text|GOTO|#F0F0F0}} dontevaluate
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'*special case MKI,MKL,MKS,MKD,_MK (part #1)|#31C4C4}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"_MK"|#FFB100}} {{Text|OR|#F0F0F0}} (n$ = {{Text|"MK"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(id2.musthave) = {{Text|"$"|#FFB100}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} curarg = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                            mktype$ = type2symbol$(e$)
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"_MK:["|#FFB100}} + e$ + {{Text|"]:["|#FFB100}} + mktype$ + {{Text|"]"|#FFB100}}
                            e$ = {{Text|""|#FFB100}}
                            {{Text|GOTO|#F0F0F0}} dontevaluate
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"UBOUND"|#FFB100}} {{Text|OR|#F0F0F0}} n$ = {{Text|"LBOUND"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} curarg = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|'perform a "fake" evaluation of the array|#31C4C4}}
                        e$ = e$ + sp + {{Text|"("|#FFB100}} + sp + {{Text|")"|#FFB100}}
                        e$ = evaluate(e$, sourcetyp)
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected array-name"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISARRAY) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected array-name"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        {{Text|'make a note of the array's index for later|#31C4C4}}
                        ulboundarray$ = e$
                        ulboundarraytyp = sourcetyp
                        e$ = {{Text|""|#FFB100}}
                        r$ = {{Text|""|#FFB100}}
                        {{Text|GOTO|#F0F0F0}} dontevaluate
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'*special case: INPUT$ function|#31C4C4}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"INPUT"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(id2.musthave) = {{Text|"$"|#FFB100}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} curarg = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(e$, {{Text|2|#F580B1}}) = {{Text|"#"|#FFB100}} + sp {{Text|THEN|#F0F0F0}} e$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - {{Text|2|#F580B1}})
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'*special case*|#31C4C4}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"ASC"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} curarg = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                        e$ = evaluatetotyp$(e$, {{Text|32&|#F580B1}})
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        typ& = LONGTYPE - ISPOINTER
                        r$ = r$ + e$ + {{Text|")"|#FFB100}}
                        {{Text|GOTO|#F0F0F0}} evalfuncspecial
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'WriteBufLine MainTxtBuf, "n$="; n$|#31C4C4}}
                {{Text|'WriteBufLine MainTxtBuf, "curarg="; curarg|#31C4C4}}
                {{Text|'WriteBufLine MainTxtBuf, "e$="; e$|#31C4C4}}
                {{Text|'WriteBufLine MainTxtBuf, "r$="; r$|#31C4C4}}
                {{Text|'*special case*|#31C4C4}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"_MEMGET"|#FFB100}} {{Text|OR|#F0F0F0}} (n$ = {{Text|"MEMGET"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} curarg = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                        memget_blk$ = e$
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} curarg = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                        memget_offs$ = e$
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} curarg = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}}
                        e$ = {{Text|UCASE$|#F0F0F0}}(e$)
                        {{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(e$, sp + {{Text|"*"|#FFB100}} + sp) {{Text|THEN|#F0F0F0}} {{Text|'multiplier will have an appended %,& or && symbol|#31C4C4}}
                            {{Text|IF|#F0F0F0}} {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|2|#F580B1}}) = {{Text|"&&"|#FFB100}} {{Text|THEN|#F0F0F0}}
                                e$ = {{Text|LEFT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - {{Text|2|#F580B1}})
                            {{Text|ELSE|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|1|#F580B1}}) = {{Text|"&"|#FFB100}} {{Text|OR|#F0F0F0}} {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|1|#F580B1}}) = {{Text|"%"|#FFB100}} {{Text|THEN|#F0F0F0}} e$ = {{Text|LEFT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - {{Text|1|#F580B1}})
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        t = typname2typ(e$)
                        {{Text|IF|#F0F0F0}} t = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Invalid TYPE name"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISOFFSETINBITS {{Text|THEN|#F0F0F0}} Give_Error qb64prefix$ + {{Text|"BIT TYPE unsupported"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        memget_size = typname2typsize
                        {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected STRING * ..."|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                            memget_ctyp$ = {{Text|"qbs*"|#FFB100}}
                        {{Text|ELSE|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}}
                                memget_size = udtxsize(t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}}
                                memget_ctyp$ = {{Text|"void*"|#FFB100}}
                            {{Text|ELSE|#F0F0F0}}
                                memget_size = (t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}}
                                memget_ctyp$ = typ2ctyp$(t, {{Text|""|#FFB100}})
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|'assume checking off|#31C4C4}}
                        offs$ = evaluatetotyp(memget_offs$, OFFSETTYPE - ISPOINTER)
                        blkoffs$ = evaluatetotyp(memget_blk$, {{Text|-6|#F580B1}})
                        {{Text|IF|#F0F0F0}} NoChecks = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                            {{Text|'change offs$ to be the return of the safe version|#31C4C4}}
                            offs$ = {{Text|"func__memget((mem_block*)"|#FFB100}} + blkoffs$ + {{Text|","|#FFB100}} + offs$ + {{Text|","|#FFB100}} + str2(memget_size) + {{Text|")"|#FFB100}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
                            r$ = {{Text|"qbs_new_txt_len((char*)"|#FFB100}} + offs$ + {{Text|","|#FFB100}} + str2(memget_size) + {{Text|")"|#FFB100}}
                        {{Text|ELSE|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}}
                                r$ = {{Text|"((void*)+"|#FFB100}} + offs$ + {{Text|")"|#FFB100}}
                                t = ISUDT + ISPOINTER + (t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}})
                            {{Text|ELSE|#F0F0F0}}
                                r$ = {{Text|"*("|#FFB100}} + memget_ctyp$ + {{Text|"*)("|#FFB100}} + offs$ + {{Text|")"|#FFB100}}
                                {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISPOINTER {{Text|THEN|#F0F0F0}} t = t - ISPOINTER
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        typ& = t
                        {{Text|GOTO|#F0F0F0}} evalfuncspecial
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'------------------------------------------------------------------------------------------------------------|#31C4C4}}
                e2$ = e$
                e$ = evaluate(e$, sourcetyp)
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|'------------------------------------------------------------------------------------------------------------|#31C4C4}}
                {{Text|' a740g: ROR & ROL support|#31C4C4}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"_ROR"|#FFB100}} {{Text|OR|#F0F0F0}} (n$ = {{Text|"ROR"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|OR|#F0F0F0}} n$ = {{Text|"_ROL"|#FFB100}} {{Text|OR|#F0F0F0}} (n$ = {{Text|"ROL"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
                    rotlr_n$ = {{Text|LCASE$|#F0F0F0}}({{Text|RIGHT$|#F0F0F0}}(n$, {{Text|3|#F580B1}})) {{Text|' Get the last 3 characters and convert to lower case. We'll need this to construct the C call|#31C4C4}}
                    {{Text|IF|#F0F0F0}} curarg = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|' First paramater|#31C4C4}}
                        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) {{Text|OR|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISFLOAT) {{Text|OR|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISOFFSET) {{Text|OR|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISUDT) {{Text|THEN|#F0F0F0}} {{Text|' Bad parameters types|#31C4C4}}
                            Give_Error {{Text|"Expected non-floating-point value"|#FFB100}}
                            {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE {{Text|THEN|#F0F0F0}} e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}}) {{Text|' This gets the C-style dereferencing syntax for an identifier (I think XD)|#31C4C4}}
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        {{Text|' Establish which function (if any!) should be used|#31C4C4}}
                        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) = {{Text|8|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|' sourcetyp is the type of data (bits can be examined to get more details)|#31C4C4}}
                            e$ = {{Text|"func__"|#FFB100}} + rotlr_n$ + {{Text|"8("|#FFB100}} + e$
                            typ& = UBYTETYPE - ISPOINTER {{Text|' We force the return type here. This is passed back up to the caller|#31C4C4}}
                        {{Text|ELSEIF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) = {{Text|16|#F580B1}} {{Text|THEN|#F0F0F0}}
                            e$ = {{Text|"func__"|#FFB100}} + rotlr_n$ + {{Text|"16("|#FFB100}} + e$
                            typ& = UINTEGERTYPE - ISPOINTER
                        {{Text|ELSEIF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) = {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}}
                            e$ = {{Text|"func__"|#FFB100}} + rotlr_n$ + {{Text|"32("|#FFB100}} + e$
                            typ& = ULONGTYPE - ISPOINTER
                        {{Text|ELSEIF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) = {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}}
                            e$ = {{Text|"func__"|#FFB100}} + rotlr_n$ + {{Text|"64("|#FFB100}} + e$
                            typ& = UINTEGER64TYPE - ISPOINTER
                        {{Text|ELSE|#F0F0F0}}
                            Give_Error {{Text|"Unknown data size"|#FFB100}}
                            {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        r$ = e$ {{Text|' Save whatever syntax he have so far|#31C4C4}}
                        e$ = {{Text|""|#FFB100}} {{Text|' This must be cleared so that it is not repeated when we get to parameter 2|#31C4C4}}
                        {{Text|GOTO|#F0F0F0}} dontevaluate {{Text|' Don't evaluate until we get the second parameter|#31C4C4}}
                    {{Text|ELSEIF|#F0F0F0}} curarg = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|' Second parameter|#31C4C4}}
                        {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE {{Text|THEN|#F0F0F0}} e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        r$ = r$ + e$ + {{Text|")"|#FFB100}}
                        {{Text|GOTO|#F0F0F0}} evalfuncspecial {{Text|' Evaluate now that we have everything|#31C4C4}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'***special case***|#31C4C4}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"_MEM"|#FFB100}} {{Text|OR|#F0F0F0}} (n$ = {{Text|"MEM"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} curarg = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} args = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                            targettyp = {{Text|-7|#F580B1}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} args = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                            r$ = {{Text|RTRIM$|#F0F0F0}}(id2.callname) + {{Text|"_at_offset"|#FFB100}} + {{Text|RIGHT$|#F0F0F0}}(r$, {{Text|LEN|#F0F0F0}}(r$) - {{Text|LEN|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(id2.callname)))
                            {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISOFFSET) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected _MEM(_OFFSET-value,...)"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'*special case*|#31C4C4}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"_OFFSET"|#FFB100}} {{Text|OR|#F0F0F0}} (n$ = {{Text|"OFFSET"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        Give_Error qb64prefix$ + {{Text|"OFFSET expects the name of a variable/array"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISARRAY) {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISOFFSETINBITS) {{Text|THEN|#F0F0F0}} Give_Error qb64prefix$ + {{Text|"OFFSET cannot reference _BIT type arrays"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    r$ = {{Text|"((uptrszint)("|#FFB100}} + evaluatetotyp$(e2$, {{Text|-6|#F580B1}}) + {{Text|"))"|#FFB100}}
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    typ& = UOFFSETTYPE - ISPOINTER
                    {{Text|GOTO|#F0F0F0}} evalfuncspecial
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'_OFFSET|#31C4C4}}
                {{Text|'*_OFFSET exceptions*|#31C4C4}}
                {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISOFFSET {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} n$ = {{Text|"MKSMBF"|#FFB100}} {{Text|AND|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(id2.musthave) = {{Text|"$"|#FFB100}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Cannot convert _OFFSET type to other types"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} n$ = {{Text|"MKDMBF"|#FFB100}} {{Text|AND|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(id2.musthave) = {{Text|"$"|#FFB100}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Cannot convert _OFFSET type to other types"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'*special case*|#31C4C4}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"ENVIRON"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE {{Text|THEN|#F0F0F0}} e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        {{Text|GOTO|#F0F0F0}} dontevaluate
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'*special case*|#31C4C4}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"LEN"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    typ& = LONGTYPE - ISPOINTER
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|'could be a string expression|#31C4C4}}
                        {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
                            r$ = {{Text|"((int32)("|#FFB100}} + e$ + {{Text|")->len)"|#FFB100}}
                            {{Text|GOTO|#F0F0F0}} evalfuncspecial
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        Give_Error {{Text|"String expression or variable name required in LEN statement"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    r$ = evaluatetotyp$(e2$, {{Text|-5|#F580B1}}) {{Text|'use evaluatetotyp to get 'element' size|#31C4C4}}
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|GOTO|#F0F0F0}} evalfuncspecial
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'*special case*|#31C4C4}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"_BIN"|#FFB100}} {{Text|OR|#F0F0F0}} (n$ = {{Text|"BIN"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(id2.musthave) = {{Text|"$"|#FFB100}} {{Text|THEN|#F0F0F0}}
                        bits = sourcetyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
                        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected numeric value"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        wasref = {{Text|0|#F580B1}}
                        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}} e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}}): wasref = {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        bits = sourcetyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
                        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISOFFSETINBITS) {{Text|THEN|#F0F0F0}}
                            e$ = {{Text|"func__bin("|#FFB100}} + e$ + {{Text|","|#FFB100}} + str2$(bits) + {{Text|")"|#FFB100}}
                        {{Text|ELSE|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISFLOAT) {{Text|THEN|#F0F0F0}}
                                e$ = {{Text|"func__bin_float("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                            {{Text|ELSE|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} bits = {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} wasref = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} bits = {{Text|0|#F580B1}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                e$ = {{Text|"func__bin("|#FFB100}} + e$ + {{Text|","|#FFB100}} + str2$(bits) + {{Text|")"|#FFB100}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        typ& = STRINGTYPE - ISPOINTER
                        r$ = e$
                        {{Text|GOTO|#F0F0F0}} evalfuncspecial
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'*special case*|#31C4C4}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"OCT"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(id2.musthave) = {{Text|"$"|#FFB100}} {{Text|THEN|#F0F0F0}}
                        bits = sourcetyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
                        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected numeric value"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        wasref = {{Text|0|#F580B1}}
                        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}} e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}}): wasref = {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        bits = sourcetyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
                        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISOFFSETINBITS) {{Text|THEN|#F0F0F0}}
                            e$ = {{Text|"func_oct("|#FFB100}} + e$ + {{Text|","|#FFB100}} + str2$(bits) + {{Text|")"|#FFB100}}
                        {{Text|ELSE|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISFLOAT) {{Text|THEN|#F0F0F0}}
                                e$ = {{Text|"func_oct_float("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                            {{Text|ELSE|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} bits = {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} wasref = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} bits = {{Text|0|#F580B1}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                e$ = {{Text|"func_oct("|#FFB100}} + e$ + {{Text|","|#FFB100}} + str2$(bits) + {{Text|")"|#FFB100}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        typ& = STRINGTYPE - ISPOINTER
                        r$ = e$
                        {{Text|GOTO|#F0F0F0}} evalfuncspecial
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'*special case*|#31C4C4}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"HEX"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(id2.musthave) = {{Text|"$"|#FFB100}} {{Text|THEN|#F0F0F0}}
                        bits = sourcetyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
                        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected numeric value"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        wasref = {{Text|0|#F580B1}}
                        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}} e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}}): wasref = {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        bits = sourcetyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
                        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISOFFSETINBITS) {{Text|THEN|#F0F0F0}}
                            chars = (bits + {{Text|3|#F580B1}}) \ {{Text|4|#F580B1}}
                            e$ = {{Text|"func_hex("|#FFB100}} + e$ + {{Text|","|#FFB100}} + str2$(chars) + {{Text|")"|#FFB100}}
                        {{Text|ELSE|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISFLOAT) {{Text|THEN|#F0F0F0}}
                                e$ = {{Text|"func_hex_float("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                            {{Text|ELSE|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} bits = {{Text|8|#F580B1}} {{Text|THEN|#F0F0F0}} chars = {{Text|2|#F580B1}}
                                {{Text|IF|#F0F0F0}} bits = {{Text|16|#F580B1}} {{Text|THEN|#F0F0F0}} chars = {{Text|4|#F580B1}}
                                {{Text|IF|#F0F0F0}} bits = {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} chars = {{Text|8|#F580B1}}
                                {{Text|IF|#F0F0F0}} bits = {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} wasref = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} chars = {{Text|16|#F580B1}} {{Text|ELSE|#F0F0F0}} chars = {{Text|0|#F580B1}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                e$ = {{Text|"func_hex("|#FFB100}} + e$ + {{Text|","|#FFB100}} + str2$(chars) + {{Text|")"|#FFB100}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        typ& = STRINGTYPE - ISPOINTER
                        r$ = e$
                        {{Text|GOTO|#F0F0F0}} evalfuncspecial
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'*special case*|#31C4C4}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"EXP"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    bits = sourcetyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected numeric value"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}} e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    bits = sourcetyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
                    typ& = SINGLETYPE - ISPOINTER
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISFLOAT) {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} bits = {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"func_exp_single("|#FFB100}} + e$ + {{Text|")"|#FFB100}} {{Text|ELSE|#F0F0F0}} e$ = {{Text|"func_exp_float("|#FFB100}} + e$ + {{Text|")"|#FFB100}}: typ& = FLOATTYPE - ISPOINTER
                    {{Text|ELSE|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISOFFSETINBITS) {{Text|THEN|#F0F0F0}}
                            e$ = {{Text|"func_exp_float("|#FFB100}} + e$ + {{Text|")"|#FFB100}}: typ& = FLOATTYPE - ISPOINTER
                        {{Text|ELSE|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} bits <= {{Text|16|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"func_exp_single("|#FFB100}} + e$ + {{Text|")"|#FFB100}} {{Text|ELSE|#F0F0F0}} e$ = {{Text|"func_exp_float("|#FFB100}} + e$ + {{Text|")"|#FFB100}}: typ& = FLOATTYPE - ISPOINTER
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    r$ = e$
                    {{Text|GOTO|#F0F0F0}} evalfuncspecial
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'*special case*|#31C4C4}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"INT"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected numeric value"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}} e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|'establish which function (if any!) should be used|#31C4C4}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISFLOAT) {{Text|THEN|#F0F0F0}} e$ = {{Text|"floor("|#FFB100}} + e$ + {{Text|")"|#FFB100}} {{Text|ELSE|#F0F0F0}} e$ = {{Text|"("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                    r$ = e$
                    typ& = sourcetyp
                    {{Text|GOTO|#F0F0F0}} evalfuncspecial
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'*special case*|#31C4C4}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"FIX"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected numeric value"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}} e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|'establish which function (if any!) should be used|#31C4C4}}
                    bits = sourcetyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISFLOAT) {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} bits > {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"func_fix_float("|#FFB100}} + e$ + {{Text|")"|#FFB100}} {{Text|ELSE|#F0F0F0}} e$ = {{Text|"func_fix_double("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                    {{Text|ELSE|#F0F0F0}}
                        e$ = {{Text|"("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    r$ = e$
                    typ& = sourcetyp
                    {{Text|GOTO|#F0F0F0}} evalfuncspecial
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'*special case*|#31C4C4}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"_ROUND"|#FFB100}} {{Text|OR|#F0F0F0}} (n$ = {{Text|"ROUND"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected numeric value"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}} e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|'establish which function (if any!) should be used|#31C4C4}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISFLOAT) {{Text|THEN|#F0F0F0}}
                        bits = sourcetyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
                        {{Text|IF|#F0F0F0}} bits > {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"func_round_float("|#FFB100}} + e$ + {{Text|")"|#FFB100}} {{Text|ELSE|#F0F0F0}} e$ = {{Text|"func_round_double("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                    {{Text|ELSE|#F0F0F0}}
                        e$ = {{Text|"("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    r$ = e$
                    typ& = {{Text|64&|#F580B1}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISOFFSET) {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISUNSIGNED {{Text|THEN|#F0F0F0}} typ& = UOFFSETTYPE - ISPOINTER {{Text|ELSE|#F0F0F0}} typ& = OFFSETTYPE - ISPOINTER
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|GOTO|#F0F0F0}} evalfuncspecial
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'*special case*|#31C4C4}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"CDBL"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISOFFSET) {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Cannot convert _OFFSET type to other types"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected numeric value"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}} e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|'establish which function (if any!) should be used|#31C4C4}}
                    bits = sourcetyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISFLOAT) {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} bits > {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"func_cdbl_float("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                    {{Text|ELSE|#F0F0F0}}
                        e$ = {{Text|"((double)("|#FFB100}} + e$ + {{Text|"))"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    r$ = e$
                    typ& = DOUBLETYPE - ISPOINTER
                    {{Text|GOTO|#F0F0F0}} evalfuncspecial
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'*special case*|#31C4C4}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"CSNG"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISOFFSET) {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Cannot convert _OFFSET type to other types"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected numeric value"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}} e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|'establish which function (if any!) should be used|#31C4C4}}
                    bits = sourcetyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISFLOAT) {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} bits = {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"func_csng_double("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                        {{Text|IF|#F0F0F0}} bits > {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"func_csng_float("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                    {{Text|ELSE|#F0F0F0}}
                        e$ = {{Text|"((double)("|#FFB100}} + e$ + {{Text|"))"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    r$ = e$
                    typ& = SINGLETYPE - ISPOINTER
                    {{Text|GOTO|#F0F0F0}} evalfuncspecial
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'*special case*|#31C4C4}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"CLNG"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISOFFSET) {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Cannot convert _OFFSET type to other types"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected numeric value"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}} e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|'establish which function (if any!) should be used|#31C4C4}}
                    bits = sourcetyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISFLOAT) {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} bits > {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"func_clng_float("|#FFB100}} + e$ + {{Text|")"|#FFB100}} {{Text|ELSE|#F0F0F0}} e$ = {{Text|"func_clng_double("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                    {{Text|ELSE|#F0F0F0}} {{Text|'integer|#31C4C4}}
                        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISUNSIGNED) {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} bits = {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"func_clng_ulong("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                            {{Text|IF|#F0F0F0}} bits > {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"func_clng_uint64("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                        {{Text|ELSE|#F0F0F0}} {{Text|'signed|#31C4C4}}
                            {{Text|IF|#F0F0F0}} bits > {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"func_clng_int64("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    r$ = e$
                    typ& = {{Text|32&|#F580B1}}
                    {{Text|GOTO|#F0F0F0}} evalfuncspecial
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'*special case*|#31C4C4}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"CINT"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISOFFSET) {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Cannot convert _OFFSET type to other types"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected numeric value"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}} e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|'establish which function (if any!) should be used|#31C4C4}}
                    bits = sourcetyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISFLOAT) {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} bits > {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"func_cint_float("|#FFB100}} + e$ + {{Text|")"|#FFB100}} {{Text|ELSE|#F0F0F0}} e$ = {{Text|"func_cint_double("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                    {{Text|ELSE|#F0F0F0}} {{Text|'integer|#31C4C4}}
                        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISUNSIGNED) {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} bits > {{Text|15|#F580B1}} {{Text|AND|#F0F0F0}} bits <= {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"func_cint_ulong("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                            {{Text|IF|#F0F0F0}} bits > {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"func_cint_uint64("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                        {{Text|ELSE|#F0F0F0}} {{Text|'signed|#31C4C4}}
                            {{Text|IF|#F0F0F0}} bits > {{Text|16|#F580B1}} {{Text|AND|#F0F0F0}} bits <= {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"func_cint_long("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                            {{Text|IF|#F0F0F0}} bits > {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"func_cint_int64("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    r$ = e$
                    typ& = {{Text|16&|#F580B1}}
                    {{Text|GOTO|#F0F0F0}} evalfuncspecial
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'*special case MKI,MKL,MKS,MKD,_MK (part #2)|#31C4C4}}
                mktype = {{Text|0|#F580B1}}
                size = {{Text|0|#F580B1}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"MKI"|#FFB100}} {{Text|THEN|#F0F0F0}} mktype = {{Text|1|#F580B1}}: mktype$ = {{Text|"%"|#FFB100}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"MKL"|#FFB100}} {{Text|THEN|#F0F0F0}} mktype = {{Text|2|#F580B1}}: mktype$ = {{Text|"&"|#FFB100}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"MKS"|#FFB100}} {{Text|THEN|#F0F0F0}} mktype = {{Text|3|#F580B1}}: mktype$ = {{Text|"!"|#FFB100}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"MKD"|#FFB100}} {{Text|THEN|#F0F0F0}} mktype = {{Text|4|#F580B1}}: mktype$ = {{Text|"#"|#FFB100}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"_MK"|#FFB100}} {{Text|OR|#F0F0F0}} (n$ = {{Text|"MK"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} mktype = {{Text|-1|#F580B1}}
                {{Text|IF|#F0F0F0}} mktype {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} mktype <> {{Text|-1|#F580B1}} {{Text|OR|#F0F0F0}} curarg = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|'IF (sourcetyp AND ISOFFSET) THEN Give_Error "Cannot convert " + qb64prefix$ + "OFFSET type to other types": EXIT FUNCTION|#31C4C4}}
                        {{Text|'both _MK and trad. process the following|#31C4C4}}
                        qtyp& = {{Text|0|#F580B1}}
                        {{Text|IF|#F0F0F0}} mktype$ = {{Text|"%%"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"b"|#FFB100}}: qtyp& = BYTETYPE - ISPOINTER
                        {{Text|IF|#F0F0F0}} mktype$ = {{Text|"~%%"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"ub"|#FFB100}}: qtyp& = UBYTETYPE - ISPOINTER
                        {{Text|IF|#F0F0F0}} mktype$ = {{Text|"%"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"i"|#FFB100}}: qtyp& = INTEGERTYPE - ISPOINTER
                        {{Text|IF|#F0F0F0}} mktype$ = {{Text|"~%"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"ui"|#FFB100}}: qtyp& = UINTEGERTYPE - ISPOINTER
                        {{Text|IF|#F0F0F0}} mktype$ = {{Text|"&"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"l"|#FFB100}}: qtyp& = LONGTYPE - ISPOINTER
                        {{Text|IF|#F0F0F0}} mktype$ = {{Text|"~&"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"ul"|#FFB100}}: qtyp& = ULONGTYPE - ISPOINTER
                        {{Text|IF|#F0F0F0}} mktype$ = {{Text|"&&"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"i64"|#FFB100}}: qtyp& = INTEGER64TYPE - ISPOINTER
                        {{Text|IF|#F0F0F0}} mktype$ = {{Text|"~&&"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"ui64"|#FFB100}}: qtyp& = UINTEGER64TYPE - ISPOINTER
                        {{Text|IF|#F0F0F0}} mktype$ = {{Text|"!"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"s"|#FFB100}}: qtyp& = SINGLETYPE - ISPOINTER
                        {{Text|IF|#F0F0F0}} mktype$ = {{Text|"#"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"d"|#FFB100}}: qtyp& = DOUBLETYPE - ISPOINTER
                        {{Text|IF|#F0F0F0}} mktype$ = {{Text|"##"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"f"|#FFB100}}: qtyp& = FLOATTYPE - ISPOINTER
                        {{Text|IF|#F0F0F0}} mktype$ = {{Text|"%&"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"o"|#FFB100}}: qtyp& = OFFSETTYPE - ISPOINTER
                        {{Text|IF|#F0F0F0}} mktype$ = {{Text|"~%&"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"uo"|#FFB100}}: qtyp& = UOFFSETTYPE - ISPOINTER
                        {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(mktype$, {{Text|2|#F580B1}}) = {{Text|"~`"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"ubit"|#FFB100}}: qtyp& = UINTEGER64TYPE - ISPOINTER: size = {{Text|VAL|#F0F0F0}}({{Text|RIGHT$|#F0F0F0}}(mktype$, {{Text|LEN|#F0F0F0}}(mktype$) - {{Text|2|#F580B1}}))
                        {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(mktype$, {{Text|1|#F580B1}}) = {{Text|"`"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"bit"|#FFB100}}: qtyp& = INTEGER64TYPE - ISPOINTER: size = {{Text|VAL|#F0F0F0}}({{Text|RIGHT$|#F0F0F0}}(mktype$, {{Text|LEN|#F0F0F0}}(mktype$) - {{Text|1|#F580B1}}))
                        {{Text|IF|#F0F0F0}} qtyp& = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error qb64prefix$ + {{Text|"MK only accepts numeric types"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} size {{Text|THEN|#F0F0F0}}
                            r$ = ctype$ + {{Text|"2string("|#FFB100}} + str2(size) + {{Text|","|#FFB100}}
                        {{Text|ELSE|#F0F0F0}}
                            r$ = ctype$ + {{Text|"2string("|#FFB100}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        nocomma = {{Text|1|#F580B1}}
                        targettyp = qtyp&
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'*special case CVI,CVL,CVS,CVD,_CV (part #2)|#31C4C4}}
                cvtype = {{Text|0|#F580B1}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"CVI"|#FFB100}} {{Text|THEN|#F0F0F0}} cvtype = {{Text|1|#F580B1}}: cvtype$ = {{Text|"%"|#FFB100}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"CVL"|#FFB100}} {{Text|THEN|#F0F0F0}} cvtype = {{Text|2|#F580B1}}: cvtype$ = {{Text|"&"|#FFB100}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"CVS"|#FFB100}} {{Text|THEN|#F0F0F0}} cvtype = {{Text|3|#F580B1}}: cvtype$ = {{Text|"!"|#FFB100}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"CVD"|#FFB100}} {{Text|THEN|#F0F0F0}} cvtype = {{Text|4|#F580B1}}: cvtype$ = {{Text|"#"|#FFB100}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"_CV"|#FFB100}} {{Text|OR|#F0F0F0}} (n$ = {{Text|"CV"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} cvtype = {{Text|-1|#F580B1}}
                {{Text|IF|#F0F0F0}} cvtype {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} cvtype <> {{Text|-1|#F580B1}} {{Text|OR|#F0F0F0}} curarg = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error n$ + {{Text|" requires a STRING argument"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}} e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        typ& = {{Text|0|#F580B1}}
                        {{Text|IF|#F0F0F0}} cvtype$ = {{Text|"%%"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"b"|#FFB100}}: typ& = BYTETYPE - ISPOINTER
                        {{Text|IF|#F0F0F0}} cvtype$ = {{Text|"~%%"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"ub"|#FFB100}}: typ& = UBYTETYPE - ISPOINTER
                        {{Text|IF|#F0F0F0}} cvtype$ = {{Text|"%"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"i"|#FFB100}}: typ& = INTEGERTYPE - ISPOINTER
                        {{Text|IF|#F0F0F0}} cvtype$ = {{Text|"~%"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"ui"|#FFB100}}: typ& = UINTEGERTYPE - ISPOINTER
                        {{Text|IF|#F0F0F0}} cvtype$ = {{Text|"&"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"l"|#FFB100}}: typ& = LONGTYPE - ISPOINTER
                        {{Text|IF|#F0F0F0}} cvtype$ = {{Text|"~&"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"ul"|#FFB100}}: typ& = ULONGTYPE - ISPOINTER
                        {{Text|IF|#F0F0F0}} cvtype$ = {{Text|"&&"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"i64"|#FFB100}}: typ& = INTEGER64TYPE - ISPOINTER
                        {{Text|IF|#F0F0F0}} cvtype$ = {{Text|"~&&"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"ui64"|#FFB100}}: typ& = UINTEGER64TYPE - ISPOINTER
                        {{Text|IF|#F0F0F0}} cvtype$ = {{Text|"!"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"s"|#FFB100}}: typ& = SINGLETYPE - ISPOINTER
                        {{Text|IF|#F0F0F0}} cvtype$ = {{Text|"#"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"d"|#FFB100}}: typ& = DOUBLETYPE - ISPOINTER
                        {{Text|IF|#F0F0F0}} cvtype$ = {{Text|"##"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"f"|#FFB100}}: typ& = FLOATTYPE - ISPOINTER
                        {{Text|IF|#F0F0F0}} cvtype$ = {{Text|"%&"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"o"|#FFB100}}: typ& = OFFSETTYPE - ISPOINTER
                        {{Text|IF|#F0F0F0}} cvtype$ = {{Text|"~%&"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"uo"|#FFB100}}: typ& = UOFFSETTYPE - ISPOINTER
                        {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(cvtype$, {{Text|2|#F580B1}}) = {{Text|"~`"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"ubit"|#FFB100}}: typ& = UINTEGER64TYPE - ISPOINTER: size = {{Text|VAL|#F0F0F0}}({{Text|RIGHT$|#F0F0F0}}(cvtype$, {{Text|LEN|#F0F0F0}}(cvtype$) - {{Text|2|#F580B1}}))
                        {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(cvtype$, {{Text|1|#F580B1}}) = {{Text|"`"|#FFB100}} {{Text|THEN|#F0F0F0}} ctype$ = {{Text|"bit"|#FFB100}}: typ& = INTEGER64TYPE - ISPOINTER: size = {{Text|VAL|#F0F0F0}}({{Text|RIGHT$|#F0F0F0}}(cvtype$, {{Text|LEN|#F0F0F0}}(cvtype$) - {{Text|1|#F580B1}}))
                        {{Text|IF|#F0F0F0}} typ& = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error qb64prefix$ + {{Text|"CV cannot return STRING type!"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} ctype$ = {{Text|"bit"|#FFB100}} {{Text|OR|#F0F0F0}} ctype$ = {{Text|"ubit"|#FFB100}} {{Text|THEN|#F0F0F0}}
                            r$ = {{Text|"string2"|#FFB100}} + ctype$ + {{Text|"("|#FFB100}} + e$ + {{Text|","|#FFB100}} + str2(size) + {{Text|")"|#FFB100}}
                        {{Text|ELSE|#F0F0F0}}
                            r$ = {{Text|"string2"|#FFB100}} + ctype$ + {{Text|"("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|GOTO|#F0F0F0}} evalfuncspecial
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'*special case|#31C4C4}}
                {{Text|IF|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(id2.n) = {{Text|"STRING"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} curarg = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}} e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                            sourcetyp = {{Text|64&|#F580B1}}
                            e$ = {{Text|"("|#FFB100}} + e$ + {{Text|"->chr[0])"|#FFB100}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'*special case|#31C4C4}}
                {{Text|IF|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(id2.n) = {{Text|"SADD"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        Give_Error {{Text|"SADD only accepts variable-length string variables"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISFIXEDLENGTH) {{Text|THEN|#F0F0F0}}
                        Give_Error {{Text|"SADD only accepts variable-length string variables"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISINCONVENTIONALMEMORY) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        recompile = {{Text|1|#F580B1}}
                        cmemlist({{Text|VAL|#F0F0F0}}(e$)) = {{Text|1|#F580B1}}
                        r$ = {{Text|"[CONVENTIONAL_MEMORY_REQUIRED]"|#FFB100}}
                        typ& = {{Text|64&|#F580B1}}
                        {{Text|GOTO|#F0F0F0}} evalfuncspecial
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    r$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    r$ = {{Text|"((unsigned short)("|#FFB100}} + r$ + {{Text|"->chr-&cmem[1280]))"|#FFB100}}
                    typ& = {{Text|64&|#F580B1}}
                    {{Text|GOTO|#F0F0F0}} evalfuncspecial
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'*special case|#31C4C4}}
                {{Text|IF|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(id2.n) = {{Text|"VARPTR"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        Give_Error {{Text|"Expected reference to a variable/array"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(id2.musthave) = {{Text|"$"|#FFB100}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISINCONVENTIONALMEMORY) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                            recompile = {{Text|1|#F580B1}}
                            cmemlist({{Text|VAL|#F0F0F0}}(e$)) = {{Text|1|#F580B1}}
                            r$ = {{Text|"[CONVENTIONAL_MEMORY_REQUIRED]"|#FFB100}}
                            typ& = ISSTRING
                            {{Text|GOTO|#F0F0F0}} evalfuncspecial
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISARRAY) {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"VARPTR$ only accepts variable-length string arrays"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISFIXEDLENGTH) {{Text|THEN|#F0F0F0}} Give_Error {{Text|"VARPTR$ only accepts variable-length string arrays"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|'must be a simple variable|#31C4C4}}
                        {{Text|'!assuming it is in cmem in DBLOCK|#31C4C4}}
                        r$ = refer(e$, sourcetyp, {{Text|1|#F580B1}})
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISARRAY) {{Text|THEN|#F0F0F0}} r$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                            r$ = r$ + {{Text|"->cmem_descriptor_offset"|#FFB100}}
                            t = {{Text|3|#F580B1}}
                        {{Text|ELSE|#F0F0F0}}
                            r$ = {{Text|"((unsigned short)(((uint8*)"|#FFB100}} + r$ + {{Text|")-&cmem[1280]))"|#FFB100}}
                            {{Text|'*top bit on=unsigned|#31C4C4}}
                            {{Text|'*second top bit on=bit-value (lower bits indicate the size)|#31C4C4}}
                            {{Text|'BYTE=1|#31C4C4}}
                            {{Text|'INTEGER=2|#31C4C4}}
                            {{Text|'STRING=3|#31C4C4}}
                            {{Text|'SINGLE=4|#31C4C4}}
                            {{Text|'INT64=5|#31C4C4}}
                            {{Text|'FLOAT=6|#31C4C4}}
                            {{Text|'DOUBLE=8|#31C4C4}}
                            {{Text|'LONG=20|#31C4C4}}
                            {{Text|'BIT=64+n|#31C4C4}}
                            t = {{Text|0|#F580B1}}
                            {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISUNSIGNED) {{Text|THEN|#F0F0F0}} t = t + {{Text|128|#F580B1}}
                            {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISOFFSETINBITS) {{Text|THEN|#F0F0F0}}
                                t = t + {{Text|64|#F580B1}}
                                t = t + (sourcetyp {{Text|AND|#F0F0F0}} {{Text|63|#F580B1}})
                            {{Text|ELSE|#F0F0F0}}
                                bits = sourcetyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
                                {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISFLOAT) {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} bits = {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} t = t + {{Text|4|#F580B1}}
                                    {{Text|IF|#F0F0F0}} bits = {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}} t = t + {{Text|8|#F580B1}}
                                    {{Text|IF|#F0F0F0}} bits = {{Text|256|#F580B1}} {{Text|THEN|#F0F0F0}} t = t + {{Text|6|#F580B1}}
                                {{Text|ELSE|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} bits = {{Text|8|#F580B1}} {{Text|THEN|#F0F0F0}} t = t + {{Text|1|#F580B1}}
                                    {{Text|IF|#F0F0F0}} bits = {{Text|16|#F580B1}} {{Text|THEN|#F0F0F0}} t = t + {{Text|2|#F580B1}}
                                    {{Text|IF|#F0F0F0}} bits = {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} t = t + {{Text|20|#F580B1}}
                                    {{Text|IF|#F0F0F0}} bits = {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}} t = t + {{Text|5|#F580B1}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        r$ = {{Text|"func_varptr_helper("|#FFB100}} + str2(t) + {{Text|","|#FFB100}} + r$ + {{Text|")"|#FFB100}}
                        typ& = ISSTRING
                        {{Text|GOTO|#F0F0F0}} evalfuncspecial
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'end of varptr$|#31C4C4}}
                    {{Text|'VARPTR|#31C4C4}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISINCONVENTIONALMEMORY) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        recompile = {{Text|1|#F580B1}}
                        cmemlist({{Text|VAL|#F0F0F0}}(e$)) = {{Text|1|#F580B1}}
                        r$ = {{Text|"[CONVENTIONAL_MEMORY_REQUIRED]"|#FFB100}}
                        typ& = {{Text|64&|#F580B1}}
                        {{Text|GOTO|#F0F0F0}} evalfuncspecial
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISARRAY) {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISOFFSETINBITS) {{Text|THEN|#F0F0F0}} Give_Error {{Text|"VARPTR cannot reference _BIT type arrays"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        {{Text|'string array?|#31C4C4}}
                        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISFIXEDLENGTH) {{Text|THEN|#F0F0F0}}
                                getid {{Text|VAL|#F0F0F0}}(e$)
                                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                                m = id.tsize
                                index$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - {{Text|INSTR|#F0F0F0}}(e$, sp3))
                                typ = {{Text|64&|#F580B1}}
                                r$ = {{Text|"(("|#FFB100}} + index$ + {{Text|")*"|#FFB100}} + str2(m) + {{Text|")"|#FFB100}}
                                {{Text|GOTO|#F0F0F0}} evalfuncspecial
                            {{Text|ELSE|#F0F0F0}}
                                {{Text|'return the offset of the string's descriptor|#31C4C4}}
                                r$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
                                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                                r$ = r$ + {{Text|"->cmem_descriptor_offset"|#FFB100}}
                                typ = {{Text|64&|#F580B1}}
                                {{Text|GOTO|#F0F0F0}} evalfuncspecial
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}}
                            e$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - {{Text|INSTR|#F0F0F0}}(e$, sp3)) {{Text|'skip idnumber|#31C4C4}}
                            e$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - {{Text|INSTR|#F0F0F0}}(e$, sp3)) {{Text|'skip u|#31C4C4}}
                            o$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - {{Text|INSTR|#F0F0F0}}(e$, sp3)) {{Text|'skip e|#31C4C4}}
                            typ = {{Text|64&|#F580B1}}
                            r$ = {{Text|"("|#FFB100}} + o$ + {{Text|")"|#FFB100}}
                            {{Text|GOTO|#F0F0F0}} evalfuncspecial
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|'non-UDT array|#31C4C4}}
                        m = (sourcetyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}} {{Text|'calculate size multiplier|#31C4C4}}
                        index$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - {{Text|INSTR|#F0F0F0}}(e$, sp3))
                        typ = {{Text|64&|#F580B1}}
                        r$ = {{Text|"(("|#FFB100}} + index$ + {{Text|")*"|#FFB100}} + str2(m) + {{Text|")"|#FFB100}}
                        {{Text|GOTO|#F0F0F0}} evalfuncspecial
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|'not an array|#31C4C4}}
                    {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}}
                        r$ = refer(e$, sourcetyp, {{Text|1|#F580B1}})
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        e$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - {{Text|INSTR|#F0F0F0}}(e$, sp3)) {{Text|'skip idnumber|#31C4C4}}
                        e$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - {{Text|INSTR|#F0F0F0}}(e$, sp3)) {{Text|'skip u|#31C4C4}}
                        o$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - {{Text|INSTR|#F0F0F0}}(e$, sp3)) {{Text|'skip e|#31C4C4}}
                        typ = {{Text|64&|#F580B1}}
                        {{Text|'if sub/func arg, may not be in DBLOCK|#31C4C4}}
                        getid {{Text|VAL|#F0F0F0}}(e$)
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} id.sfarg {{Text|THEN|#F0F0F0}} {{Text|'could be in DBLOCK|#31C4C4}}
                            {{Text|'note: segment could be the closest segment to UDT element or the base of DBLOCK|#31C4C4}}
                            r$ = {{Text|"varptr_dblock_check(((uint8*)"|#FFB100}} + r$ + {{Text|")+("|#FFB100}} + o$ + {{Text|"))"|#FFB100}}
                        {{Text|ELSE|#F0F0F0}} {{Text|'definitely in DBLOCK|#31C4C4}}
                            {{Text|'give offset relative to DBLOCK|#31C4C4}}
                            r$ = {{Text|"((unsigned short)(((uint8*)"|#FFB100}} + r$ + {{Text|") - &cmem[1280] + ("|#FFB100}} + o$ + {{Text|") ))"|#FFB100}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|GOTO|#F0F0F0}} evalfuncspecial
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    typ = {{Text|64&|#F580B1}}
                    r$ = refer(e$, sourcetyp, {{Text|1|#F580B1}})
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISFIXEDLENGTH) {{Text|THEN|#F0F0F0}}
                            {{Text|'if sub/func arg, may not be in DBLOCK|#31C4C4}}
                            getid {{Text|VAL|#F0F0F0}}(e$)
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} id.sfarg {{Text|THEN|#F0F0F0}} {{Text|'could be in DBLOCK|#31C4C4}}
                                r$ = {{Text|"varptr_dblock_check("|#FFB100}} + r$ + {{Text|"->chr)"|#FFB100}}
                            {{Text|ELSE|#F0F0F0}} {{Text|'definitely in DBLOCK|#31C4C4}}
                                r$ = {{Text|"((unsigned short)("|#FFB100}} + r$ + {{Text|"->chr-&cmem[1280]))"|#FFB100}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|ELSE|#F0F0F0}}
                            r$ = r$ + {{Text|"->cmem_descriptor_offset"|#FFB100}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|GOTO|#F0F0F0}} evalfuncspecial
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|'single, simple variable|#31C4C4}}
                    {{Text|'if sub/func arg, may not be in DBLOCK|#31C4C4}}
                    getid {{Text|VAL|#F0F0F0}}(e$)
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} id.sfarg {{Text|THEN|#F0F0F0}} {{Text|'could be in DBLOCK|#31C4C4}}
                        r$ = {{Text|"varptr_dblock_check((uint8*)"|#FFB100}} + r$ + {{Text|")"|#FFB100}}
                    {{Text|ELSE|#F0F0F0}} {{Text|'definitely in DBLOCK|#31C4C4}}
                        r$ = {{Text|"((unsigned short)(((uint8*)"|#FFB100}} + r$ + {{Text|")-&cmem[1280]))"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|GOTO|#F0F0F0}} evalfuncspecial
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'*special case*|#31C4C4}}
                {{Text|IF|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(id2.n) = {{Text|"VARSEG"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        Give_Error {{Text|"Expected reference to a variable/array"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISINCONVENTIONALMEMORY) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        recompile = {{Text|1|#F580B1}}
                        cmemlist({{Text|VAL|#F0F0F0}}(e$)) = {{Text|1|#F580B1}}
                        r$ = {{Text|"[CONVENTIONAL_MEMORY_REQUIRED]"|#FFB100}}
                        typ& = {{Text|64&|#F580B1}}
                        {{Text|GOTO|#F0F0F0}} evalfuncspecial
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|'array?|#31C4C4}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISARRAY) {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}}
                                r$ = {{Text|"80"|#FFB100}}
                                typ = {{Text|64&|#F580B1}}
                                {{Text|GOTO|#F0F0F0}} evalfuncspecial
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        typ = {{Text|64&|#F580B1}}
                        r$ = {{Text|"( ( ((ptrszint)("|#FFB100}} + refer(e$, sourcetyp, {{Text|1|#F580B1}}) + {{Text|"[0])) - ((ptrszint)(&cmem[0])) ) /16)"|#FFB100}}
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        {{Text|GOTO|#F0F0F0}} evalfuncspecial
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|'single variable/(var-len)string/udt? (usually stored in DBLOCK)|#31C4C4}}
                    typ = {{Text|64&|#F580B1}}
                    {{Text|'if sub/func arg, may not be in DBLOCK|#31C4C4}}
                    getid {{Text|VAL|#F0F0F0}}(e$)
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} id.sfarg <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}}
                            r$ = refer(e$, sourcetyp, {{Text|1|#F580B1}})
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                            e$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - {{Text|INSTR|#F0F0F0}}(e$, sp3)) {{Text|'skip idnumber|#31C4C4}}
                            e$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - {{Text|INSTR|#F0F0F0}}(e$, sp3)) {{Text|'skip u|#31C4C4}}
                            o$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - {{Text|INSTR|#F0F0F0}}(e$, sp3)) {{Text|'skip e|#31C4C4}}
                            r$ = {{Text|"varseg_dblock_check(((uint8*)"|#FFB100}} + r$ + {{Text|")+("|#FFB100}} + o$ + {{Text|"))"|#FFB100}}
                        {{Text|ELSE|#F0F0F0}}
                            r$ = {{Text|"varseg_dblock_check((uint8*)"|#FFB100}} + refer(e$, sourcetyp, {{Text|1|#F580B1}}) + {{Text|")"|#FFB100}}
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|ELSE|#F0F0F0}}
                        {{Text|'can be assumed to be in DBLOCK|#31C4C4}}
                        r$ = {{Text|"80"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|GOTO|#F0F0F0}} evalfuncspecial
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'varseg|#31C4C4}}
                {{Text|'note: this code has already been called...|#31C4C4}}
                {{Text|'------------------------------------------------------------------------------------------------------------|#31C4C4}}
                {{Text|'e2$ = e$|#31C4C4}}
                {{Text|'e$ = evaluate(e$, sourcetyp)|#31C4C4}}
                {{Text|'------------------------------------------------------------------------------------------------------------|#31C4C4}}
                {{Text|'note: this comment makes no sense...|#31C4C4}}
                {{Text|'any numeric variable, but it must be type-speficied|#31C4C4}}
                {{Text|IF|#F0F0F0}} targettyp = {{Text|-2|#F580B1}} {{Text|THEN|#F0F0F0}}
                    e$ = evaluatetotyp(e2$, {{Text|-2|#F580B1}})
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|GOTO|#F0F0F0}} dontevaluate
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'-2|#31C4C4}}
                {{Text|IF|#F0F0F0}} targettyp = {{Text|-7|#F580B1}} {{Text|THEN|#F0F0F0}}
                    e$ = evaluatetotyp(e2$, {{Text|-7|#F580B1}})
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|GOTO|#F0F0F0}} dontevaluate
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'-7|#31C4C4}}
                {{Text|IF|#F0F0F0}} targettyp = {{Text|-8|#F580B1}} {{Text|THEN|#F0F0F0}}
                    e$ = evaluatetotyp(e2$, {{Text|-8|#F580B1}})
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|GOTO|#F0F0F0}} dontevaluate
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'-8|#31C4C4}}
                {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISOFFSET {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} ISOFFSET) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} id2.internal_subfunc = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Cannot convert _OFFSET type to other types"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'note: this is used for functions like STR(...) which accept all types...|#31C4C4}}
                explicitreference = {{Text|0|#F580B1}}
                {{Text|IF|#F0F0F0}} targettyp = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}}
                    explicitreference = {{Text|1|#F580B1}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Number required for function"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    targettyp = sourcetyp
                    {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} ISPOINTER) {{Text|THEN|#F0F0F0}} targettyp = targettyp - ISPOINTER
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'pointer?|#31C4C4}}
                {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} ISPOINTER) {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} dereference = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'check deferencing wasn't used|#31C4C4}}
                        {{Text|'note: array pointer|#31C4C4}}
                        {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} ISARRAY) {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected arrayname()"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISARRAY) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected arrayname()"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"evaluatefunc:array reference:["|#FFB100}} + e$ + {{Text|"]"|#FFB100}}
                            {{Text|'check arrays are of same type|#31C4C4}}
                            targettyp2 = targettyp: sourcetyp2 = sourcetyp
                            targettyp2 = targettyp2 {{Text|AND|#F0F0F0}} ({{Text|511|#F580B1}} + ISOFFSETINBITS + ISUDT + ISSTRING + ISFIXEDLENGTH + ISFLOAT)
                            sourcetyp2 = sourcetyp2 {{Text|AND|#F0F0F0}} ({{Text|511|#F580B1}} + ISOFFSETINBITS + ISUDT + ISSTRING + ISFIXEDLENGTH + ISFLOAT)
                            {{Text|IF|#F0F0F0}} sourcetyp2 <> targettyp2 {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Incorrect array type passed to function"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                            {{Text|'check arrayname was followed by '()'|#31C4C4}}
                            {{Text|IF|#F0F0F0}} targettyp {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"evaluatefunc:array reference:udt reference:["|#FFB100}} + e$ + {{Text|"]"|#FFB100}}
                                {{Text|'get UDT info|#31C4C4}}
                                udtrefid = {{Text|VAL|#F0F0F0}}(e$)
                                getid udtrefid
                                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                                udtrefi = {{Text|INSTR|#F0F0F0}}(e$, sp3) {{Text|'end of id|#31C4C4}}
                                udtrefi2 = {{Text|INSTR|#F0F0F0}}(udtrefi + {{Text|1|#F580B1}}, e$, sp3) {{Text|'end of u|#31C4C4}}
                                udtrefu = {{Text|VAL|#F0F0F0}}({{Text|MID$|#F0F0F0}}(e$, udtrefi + {{Text|1|#F580B1}}, udtrefi2 - udtrefi - {{Text|1|#F580B1}}))
                                udtrefi3 = {{Text|INSTR|#F0F0F0}}(udtrefi2 + {{Text|1|#F580B1}}, e$, sp3) {{Text|'skip e|#31C4C4}}
                                udtrefe = {{Text|VAL|#F0F0F0}}({{Text|MID$|#F0F0F0}}(e$, udtrefi2 + {{Text|1|#F580B1}}, udtrefi3 - udtrefi2 - {{Text|1|#F580B1}}))
                                o$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - udtrefi3)
                                {{Text|'note: most of the UDT info above is not required|#31C4C4}}
                                {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(o$, {{Text|4|#F580B1}}) <> {{Text|"(0)*"|#FFB100}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected arrayname()"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                            {{Text|ELSE|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|2|#F580B1}}) <> sp3 + {{Text|"0"|#FFB100}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected arrayname()"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            idnum = {{Text|VAL|#F0F0F0}}({{Text|LEFT$|#F0F0F0}}(e$, {{Text|INSTR|#F0F0F0}}(e$, sp3) - {{Text|1|#F580B1}}))
                            getid idnum
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} targettyp {{Text|AND|#F0F0F0}} ISFIXEDLENGTH {{Text|THEN|#F0F0F0}}
                                targettypsize = {{Text|CVL|#F0F0F0}}({{Text|MID$|#F0F0F0}}(id2.argsize, curarg * {{Text|4|#F580B1}} - {{Text|4|#F580B1}} + {{Text|1|#F580B1}}, {{Text|4|#F580B1}}))
                                {{Text|IF|#F0F0F0}} id.tsize <> targettypsize {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Incorrect array type passed to function"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} {{Text|MID$|#F0F0F0}}(sfcmemargs(targetid), curarg, {{Text|1|#F580B1}}) = {{Text|CHR$|#F0F0F0}}({{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} {{Text|'cmem required?|#31C4C4}}
                                {{Text|IF|#F0F0F0}} cmemlist(idnum) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    cmemlist(idnum) = {{Text|1|#F580B1}}
                                    recompile = {{Text|1|#F580B1}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} id.linkid = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                {{Text|'if id.linkid is 0, it means the number of array elements is definietly|#31C4C4}}
                                {{Text|'known of the array being passed, this is not some "fake"/unknown array.|#31C4C4}}
                                {{Text|'using the numer of array elements of a fake array would be dangerous!|#31C4C4}}
                                {{Text|IF|#F0F0F0}} nelereq = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|'only continue if the number of array elements required is unknown|#31C4C4}}
                                    {{Text|'and it needs to be set|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} id.arrayelements <> {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        nelereq = id.arrayelements
                                        {{Text|MID$|#F0F0F0}}(id2.nelereq, curarg, {{Text|1|#F580B1}}) = {{Text|CHR$|#F0F0F0}}(nelereq)
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    ids(targetid) = id2
                                {{Text|ELSE|#F0F0F0}}
                                    {{Text|'the number of array elements required is known AND|#31C4C4}}
                                    {{Text|'the number of elements in the array to be passed is known|#31C4C4}}
                                    {{Text|'REMOVE FOR TESTING PURPOSES ONLY!!! SHOULD BE UNREM'd!|#31C4C4}}
                                    {{Text|'print id.arrayelements,nelereq|#31C4C4}}
                                    {{Text|'            1      ,  2|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} id.arrayelements <> nelereq {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Passing arrays with a differing number of elements to a SUB/FUNCTION is not supported"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            e$ = refer(e$, sourcetyp, {{Text|1|#F580B1}})
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                            {{Text|GOTO|#F0F0F0}} dontevaluate
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|'note: not an array...|#31C4C4}}
                        {{Text|'target is not an array|#31C4C4}}
                        {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} ISSTRING) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}}
                                idnum = {{Text|VAL|#F0F0F0}}({{Text|LEFT$|#F0F0F0}}(e$, {{Text|INSTR|#F0F0F0}}(e$, sp3) - {{Text|1|#F580B1}})) {{Text|'id# of sourcetyp|#31C4C4}}
                                targettyp2 = targettyp: sourcetyp2 = sourcetyp
                                {{Text|'get info about source/target|#31C4C4}}
                                arr = {{Text|0|#F580B1}}: {{Text|IF|#F0F0F0}} (sourcetyp2 {{Text|AND|#F0F0F0}} ISARRAY) {{Text|THEN|#F0F0F0}} arr = {{Text|1|#F580B1}}
                                passudtelement = {{Text|0|#F580B1}}: {{Text|IF|#F0F0F0}} (targettyp2 {{Text|AND|#F0F0F0}} ISUDT) = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} (sourcetyp2 {{Text|AND|#F0F0F0}} ISUDT) <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} passudtelement = {{Text|1|#F580B1}}: sourcetyp2 = sourcetyp2 - ISUDT
                                {{Text|'remove flags irrelevant for comparison... ISPOINTER,ISREFERENCE,ISINCONVENTIONALMEMORY,ISARRAY|#31C4C4}}
                                targettyp2 = targettyp2 {{Text|AND|#F0F0F0}} ({{Text|511|#F580B1}} + ISOFFSETINBITS + ISUDT + ISFLOAT + ISSTRING)
                                sourcetyp2 = sourcetyp2 {{Text|AND|#F0F0F0}} ({{Text|511|#F580B1}} + ISOFFSETINBITS + ISUDT + ISFLOAT + ISSTRING)
                                {{Text|'compare types|#31C4C4}}
                                {{Text|IF|#F0F0F0}} sourcetyp2 = targettyp2 {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}}
                                        {{Text|'udt/udt array|#31C4C4}}
                                        {{Text|'get info|#31C4C4}}
                                        udtrefid = {{Text|VAL|#F0F0F0}}(e$)
                                        getid udtrefid
                                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                                        udtrefi = {{Text|INSTR|#F0F0F0}}(e$, sp3) {{Text|'end of id|#31C4C4}}
                                        udtrefi2 = {{Text|INSTR|#F0F0F0}}(udtrefi + {{Text|1|#F580B1}}, e$, sp3) {{Text|'end of u|#31C4C4}}
                                        udtrefu = {{Text|VAL|#F0F0F0}}({{Text|MID$|#F0F0F0}}(e$, udtrefi + {{Text|1|#F580B1}}, udtrefi2 - udtrefi - {{Text|1|#F580B1}}))
                                        udtrefi3 = {{Text|INSTR|#F0F0F0}}(udtrefi2 + {{Text|1|#F580B1}}, e$, sp3) {{Text|'skip e|#31C4C4}}
                                        udtrefe = {{Text|VAL|#F0F0F0}}({{Text|MID$|#F0F0F0}}(e$, udtrefi2 + {{Text|1|#F580B1}}, udtrefi3 - udtrefi2 - {{Text|1|#F580B1}}))
                                        o$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - udtrefi3)
                                        {{Text|'note: most of the UDT info above is not required|#31C4C4}}
                                        {{Text|IF|#F0F0F0}} arr {{Text|THEN|#F0F0F0}}
                                            n2$ = scope$ + {{Text|"ARRAY_UDT_"|#FFB100}} + {{Text|RTRIM$|#F0F0F0}}(id.n) + {{Text|"[0]"|#FFB100}}
                                        {{Text|ELSE|#F0F0F0}}
                                            n2$ = scope$ + {{Text|"UDT_"|#FFB100}} + {{Text|RTRIM$|#F0F0F0}}(id.n)
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                        e$ = {{Text|"(void*)( ((char*)("|#FFB100}} + n2$ + {{Text|")) + ("|#FFB100}} + o$ + {{Text|") )"|#FFB100}}
                                        {{Text|'convert void* to target type*|#31C4C4}}
                                        {{Text|IF|#F0F0F0}} passudtelement {{Text|THEN|#F0F0F0}} e$ = {{Text|"("|#FFB100}} + typ2ctyp$(targettyp2 + (targettyp {{Text|AND|#F0F0F0}} ISUNSIGNED), {{Text|""|#FFB100}}) + {{Text|"*)"|#FFB100}} + e$
                                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                                    {{Text|ELSE|#F0F0F0}}
                                        {{Text|'not a udt|#31C4C4}}
                                        {{Text|IF|#F0F0F0}} arr {{Text|THEN|#F0F0F0}}
                                            {{Text|IF|#F0F0F0}} (sourcetyp2 {{Text|AND|#F0F0F0}} ISOFFSETINBITS) {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Cannot pass BIT array offsets"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                                            e$ = {{Text|"(&("|#FFB100}} + refer(e$, sourcetyp, {{Text|0|#F580B1}}) + {{Text|"))"|#FFB100}}
                                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                                        {{Text|ELSE|#F0F0F0}}
                                            e$ = refer(e$, sourcetyp, {{Text|1|#F580B1}})
                                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                        {{Text|'note: signed/unsigned mismatch requires casting|#31C4C4}}
                                        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISUNSIGNED) <> (targettyp {{Text|AND|#F0F0F0}} ISUNSIGNED) {{Text|THEN|#F0F0F0}}
                                            e$ = {{Text|"("|#FFB100}} + typ2ctyp$(targettyp2 + (targettyp {{Text|AND|#F0F0F0}} ISUNSIGNED), {{Text|""|#FFB100}}) + {{Text|"*)"|#FFB100}} + e$
                                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'udt?|#31C4C4}}
                                    {{Text|'force recompile if target needs to be in cmem and the source is not|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} {{Text|MID$|#F0F0F0}}(sfcmemargs(targetid), curarg, {{Text|1|#F580B1}}) = {{Text|CHR$|#F0F0F0}}({{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} {{Text|'cmem required?|#31C4C4}}
                                        {{Text|IF|#F0F0F0}} cmemlist(idnum) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                            cmemlist(idnum) = {{Text|1|#F580B1}}
                                            recompile = {{Text|1|#F580B1}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|GOTO|#F0F0F0}} dontevaluate
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'similar|#31C4C4}}
                                {{Text|'IF sourcetyp2 = targettyp2 THEN|#31C4C4}}
                                {{Text|'IF arr THEN|#31C4C4}}
                                {{Text|'IF (sourcetyp2 AND ISOFFSETINBITS) THEN Give_Error "Cannot pass BIT array offsets yet": EXIT FUNCTION|#31C4C4}}
                                {{Text|'e$ = "(&(" + refer(e$, sourcetyp, 0) + "))"|#31C4C4}}
                                {{Text|'ELSE|#31C4C4}}
                                {{Text|'e$ = refer(e$, sourcetyp, 1)|#31C4C4}}
                                {{Text|'END IF|#31C4C4}}
                                {{Text|'GOTO dontevaluate|#31C4C4}}
                                {{Text|'END IF|#31C4C4}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'source is a reference|#31C4C4}}
                        {{Text|ELSE|#F0F0F0}} {{Text|'string|#31C4C4}}
                            {{Text|'its a string|#31C4C4}}
                            {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}}
                                idnum = {{Text|VAL|#F0F0F0}}({{Text|LEFT$|#F0F0F0}}(e$, {{Text|INSTR|#F0F0F0}}(e$, sp3) - {{Text|1|#F580B1}})) {{Text|'id# of sourcetyp|#31C4C4}}
                                {{Text|IF|#F0F0F0}} {{Text|MID$|#F0F0F0}}(sfcmemargs(targetid), curarg, {{Text|1|#F580B1}}) = {{Text|CHR$|#F0F0F0}}({{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} {{Text|'cmem required?|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} cmemlist(idnum) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                        cmemlist(idnum) = {{Text|1|#F580B1}}
                                        recompile = {{Text|1|#F580B1}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'reference|#31C4C4}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'string|#31C4C4}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'dereference was not used|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'pointer|#31C4C4}}
                {{Text|'note: Target is not a pointer...|#31C4C4}}
                {{Text|'IF (targettyp AND ISSTRING) = 0 THEN|#31C4C4}}
                {{Text|'IF (sourcetyp AND ISREFERENCE) THEN|#31C4C4}}
                {{Text|'targettyp2 = targettyp: sourcetyp2 = sourcetyp - ISREFERENCE|#31C4C4}}
                {{Text|'IF (sourcetyp2 AND ISINCONVENTIONALMEMORY) THEN sourcetyp2 = sourcetyp2 - ISINCONVENTIONALMEMORY|#31C4C4}}
                {{Text|'IF sourcetyp2 = targettyp2 THEN e$ = refer(e$, sourcetyp, 1): GOTO dontevaluate|#31C4C4}}
                {{Text|'END IF|#31C4C4}}
                {{Text|'END IF|#31C4C4}}
                {{Text|'END IF|#31C4C4}}
                {{Text|'String-numeric mismatch?|#31C4C4}}
                {{Text|IF|#F0F0F0}} targettyp {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        nth = curarg
                        {{Text|IF|#F0F0F0}} skipFirstArg {{Text|THEN|#F0F0F0}} nth = nth - {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} ids(targetid).args = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"String required for function"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        Give_Error str_nth$(nth) + {{Text|" function argument requires a string"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} ISSTRING) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
                        nth = curarg
                        {{Text|IF|#F0F0F0}} skipFirstArg {{Text|THEN|#F0F0F0}} nth = nth - {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} ids(targetid).args = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Number required for function"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        Give_Error str_nth$(nth) + {{Text|" function argument requires a number"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'change to "non-pointer" value|#31C4C4}}
                {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}}
                    e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} explicitreference = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} targettyp {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}}
                        nth = curarg
                        {{Text|IF|#F0F0F0}} skipFirstArg {{Text|THEN|#F0F0F0}} nth = nth - {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} qb64prefix_set {{Text|AND|#F0F0F0}} udtxcname(targettyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) = {{Text|"_MEM"|#FFB100}} {{Text|THEN|#F0F0F0}}
                            x$ = {{Text|"'"|#FFB100}} + {{Text|MID$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(udtxcname(targettyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}})), {{Text|2|#F580B1}}) + {{Text|"'"|#FFB100}}
                        {{Text|ELSE|#F0F0F0}}
                            x$ = {{Text|"'"|#FFB100}} + {{Text|RTRIM$|#F0F0F0}}(udtxcname(targettyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}})) + {{Text|"'"|#FFB100}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} ids(targetid).args = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"TYPE "|#FFB100}} + x$ + {{Text|" required for function"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        Give_Error str_nth$(nth) + {{Text|" function argument requires TYPE "|#FFB100}} + x$: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|ELSE|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Number required for function"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'round to integer if required|#31C4C4}}
                {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISFLOAT) {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} ISFLOAT) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|'**32 rounding fix|#31C4C4}}
                        bits = targettyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
                        {{Text|IF|#F0F0F0}} bits <= {{Text|16|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"qbr_float_to_long("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                        {{Text|IF|#F0F0F0}} bits > {{Text|16|#F580B1}} {{Text|AND|#F0F0F0}} bits < {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"qbr_double_to_long("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                        {{Text|IF|#F0F0F0}} bits >= {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"qbr("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} explicitreference {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} ISOFFSETINBITS) {{Text|THEN|#F0F0F0}}
                        {{Text|'integer value can fit inside int64|#31C4C4}}
                        e$ = {{Text|"(int64)("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                    {{Text|ELSE|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} ISFLOAT) {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) = {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"(float)("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                            {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) = {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"(double)("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                            {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) = {{Text|256|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"(long double)("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                        {{Text|ELSE|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} ISUNSIGNED) {{Text|THEN|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) = {{Text|8|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"(uint8)("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                                {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) = {{Text|16|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"(uint16)("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                                {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) = {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"(uint32)("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                                {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) = {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"(uint64)("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                            {{Text|ELSE|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) = {{Text|8|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"(int8)("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                                {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) = {{Text|16|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"(int16)("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                                {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) = {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"(int32)("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                                {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) = {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"(int64)("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'float?|#31C4C4}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'offset in bits?|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'explicit?|#31C4C4}}
                {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} ISPOINTER) {{Text|THEN|#F0F0F0}} {{Text|'pointer required|#31C4C4}}
                    {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} dontevaluate {{Text|'no changes required|#31C4C4}}
                    {{Text|'20090703|#31C4C4}}
                    t$ = typ2ctyp$(targettyp, {{Text|""|#FFB100}})
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    v$ = {{Text|"pass"|#FFB100}} + str2$(uniquenumber)
                    {{Text|'assume numeric type|#31C4C4}}
                    {{Text|IF|#F0F0F0}} {{Text|MID$|#F0F0F0}}(sfcmemargs(targetid), curarg, {{Text|1|#F580B1}}) = {{Text|CHR$|#F0F0F0}}({{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} {{Text|'cmem required?|#31C4C4}}
                        bytesreq = ((targettyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) + {{Text|7|#F580B1}}) \ {{Text|8|#F580B1}}
                        WriteBufLine defdatahandle, t$ + {{Text|" *"|#FFB100}} + v$ + {{Text|"=NULL;"|#FFB100}}
                        WriteBufLine DataTxtBuf, {{Text|"if("|#FFB100}} + v$ + {{Text|"==NULL){"|#FFB100}}
                        WriteBufLine DataTxtBuf, {{Text|"cmem_sp-="|#FFB100}} + str2(bytesreq) + {{Text|";"|#FFB100}}
                        WriteBufLine DataTxtBuf, v$ + {{Text|"=("|#FFB100}} + t$ + {{Text|"*)(dblock+cmem_sp);"|#FFB100}}
                        WriteBufLine DataTxtBuf, {{Text|"if (cmem_sp<qbs_cmem_sp) error(257);"|#FFB100}}
                        WriteBufLine DataTxtBuf, {{Text|"}"|#FFB100}}
                        e$ = {{Text|"&(*"|#FFB100}} + v$ + {{Text|"="|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                    {{Text|ELSE|#F0F0F0}}
                        WriteBufLine DataTxtBuf, t$ + {{Text|" "|#FFB100}} + v$ + {{Text|";"|#FFB100}}
                        e$ = {{Text|"&("|#FFB100}} + v$ + {{Text|"="|#FFB100}} + e$ + {{Text|")"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|GOTO|#F0F0F0}} dontevaluate
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                dontevaluate:
                {{Text|IF|#F0F0F0}} id2.ccall {{Text|THEN|#F0F0F0}}
                    {{Text|'if a forced cast from a returned ccall function is in e$, remove it|#31C4C4}}
                    {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(e$, {{Text|3|#F580B1}}) = {{Text|"(  "|#FFB100}} {{Text|THEN|#F0F0F0}}
                        e$ = removecast$(e$)
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} targettyp {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
                        e$ = {{Text|"(char*)("|#FFB100}} + e$ + {{Text|")->chr"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} {{Text|LTRIM$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(e$)) = {{Text|"0"|#FFB100}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"NULL"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                r$ = r$ + e$
                {{Text|'***special case****|#31C4C4}}
                {{Text|IF|#F0F0F0}} n$ = {{Text|"_MEM"|#FFB100}} {{Text|OR|#F0F0F0}} (n$ = {{Text|"MEM"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} args = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} curarg = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} r$ = r$ + {{Text|")"|#FFB100}}: {{Text|GOTO|#F0F0F0}} evalfuncspecial
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} args = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} curarg = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} r$ = r$ + {{Text|")"|#FFB100}}: {{Text|GOTO|#F0F0F0}} evalfuncspecial
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} i <> n {{Text|AND|#F0F0F0}} nocomma = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} r$ = r$ + {{Text|","|#FFB100}}
                nocomma = {{Text|0|#F580B1}}
                firsti = i + {{Text|1|#F580B1}}
                curarg = curarg + {{Text|1|#F580B1}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|NEXT|#F0F0F0}}
        {{Text|' Add on any extra optional arguments that were not provided|#31C4C4}}
        {{Text|'|#31C4C4}}
        {{Text|' Overloaded functions do not require the omited arguments to be provided|#31C4C4}}
        {{Text|IF|#F0F0F0}} curarg <= id2.args {{Text|AND|#F0F0F0}} {{Text|NOT|#F0F0F0}} id2.overloaded {{Text|THEN|#F0F0F0}}
            {{Text|FOR|#F0F0F0}} i = curarg {{Text|TO|#F0F0F0}} id2.args
                {{Text|IF|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} r$ = r$ + {{Text|"NULL"|#FFB100}} {{Text|ELSE|#F0F0F0}} r$ = r$ + {{Text|",NULL"|#FFB100}}
            {{Text|NEXT|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} n$ = {{Text|"UBOUND"|#FFB100}} {{Text|OR|#F0F0F0}} n$ = {{Text|"LBOUND"|#FFB100}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} r$ = {{Text|",NULL"|#FFB100}} {{Text|THEN|#F0F0F0}} r$ = {{Text|",1"|#FFB100}} {{Text|' FIXME: ??????|#31C4C4}}
        {{Text|IF|#F0F0F0}} n$ = {{Text|"UBOUND"|#FFB100}} {{Text|THEN|#F0F0F0}} r2$ = {{Text|"func_ubound("|#FFB100}} {{Text|ELSE|#F0F0F0}} r2$ = {{Text|"func_lbound("|#FFB100}}
        e$ = refer$(ulboundarray$, sourcetyp, {{Text|1|#F580B1}})
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|'note: ID contins refer'ed array info|#31C4C4}}
        arrayelements = id.arrayelements {{Text|'2009|#31C4C4}}
        {{Text|IF|#F0F0F0}} arrayelements = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} arrayelements = {{Text|1|#F580B1}} {{Text|'2009|#31C4C4}}
        r$ = r2$ + e$ + r$ + {{Text|","|#FFB100}} + str2$(arrayelements) + {{Text|")"|#FFB100}}
        typ& = INTEGER64TYPE - ISPOINTER
        {{Text|GOTO|#F0F0F0}} evalfuncspecial
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} passomit {{Text|THEN|#F0F0F0}}
        r$ = r$ + {{Text|",0"|#FFB100}}
        {{Text|IF|#F0F0F0}} hasOptionalFirstArg {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} providedArgs({{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} r$ = r$ + {{Text|"¦1"|#FFB100}}
        {{Text|ELSE|#F0F0F0}}
            {{Text|FOR|#F0F0F0}} i = firstOptionalArgument {{Text|TO|#F0F0F0}} {{Text|UBOUND|#F0F0F0}}(providedArgs)
                {{Text|IF|#F0F0F0}} providedArgs(i) {{Text|THEN|#F0F0F0}} r$ = r$ + {{Text|"¦"|#FFB100}} + str2$({{Text|_SHL|#F0F0F0}}({{Text|1|#F580B1}}, i - firstOptionalArgument))
            {{Text|NEXT|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    r$ = r$ + {{Text|")"|#FFB100}}
    evalfuncspecial:
    {{Text|IF|#F0F0F0}} n$ = {{Text|"ABS"|#FFB100}} {{Text|THEN|#F0F0F0}} typ& = sourcetyp {{Text|'ABS Note: ABS() returns argument #1's type|#31C4C4}}
    {{Text|'QB-like conversion of math functions returning floating point values|#31C4C4}}
    {{Text|IF|#F0F0F0}} n$ = {{Text|"SIN"|#FFB100}} {{Text|OR|#F0F0F0}} n$ = {{Text|"COS"|#FFB100}} {{Text|OR|#F0F0F0}} n$ = {{Text|"TAN"|#FFB100}} {{Text|OR|#F0F0F0}} n$ = {{Text|"ATN"|#FFB100}} {{Text|OR|#F0F0F0}} n$ = {{Text|"SQR"|#FFB100}} {{Text|OR|#F0F0F0}} n$ = {{Text|"LOG"|#FFB100}} {{Text|THEN|#F0F0F0}}
        b = sourcetyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
        {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISFLOAT {{Text|THEN|#F0F0F0}}
            {{Text|'Default is FLOATTYPE|#31C4C4}}
            {{Text|IF|#F0F0F0}} b = {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}} typ& = DOUBLETYPE - ISPOINTER
            {{Text|IF|#F0F0F0}} b = {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} typ& = SINGLETYPE - ISPOINTER
        {{Text|ELSE|#F0F0F0}}
            {{Text|'Default is FLOATTYPE|#31C4C4}}
            {{Text|IF|#F0F0F0}} b <= {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} typ& = DOUBLETYPE - ISPOINTER
            {{Text|IF|#F0F0F0}} b <= {{Text|16|#F580B1}} {{Text|THEN|#F0F0F0}} typ& = SINGLETYPE - ISPOINTER
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} id2.ret = ISUDT + ({{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
        {{Text|'***special case***|#31C4C4}}
        v$ = {{Text|"func"|#FFB100}} + str2$(uniquenumber)
        WriteBufLine defdatahandle, {{Text|"mem_block "|#FFB100}} + v$ + {{Text|";"|#FFB100}}
        r$ = {{Text|"("|#FFB100}} + v$ + {{Text|"="|#FFB100}} + r$ + {{Text|")"|#FFB100}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} id2.ccall {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(r$, {{Text|11|#F580B1}}) = {{Text|"(  char*  )"|#FFB100}} {{Text|THEN|#F0F0F0}}
            r$ = {{Text|"qbs_new_txt("|#FFB100}} + r$ + {{Text|")"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"evaluatefunc:out:"|#FFB100}}; r$
    evaluatefunc$ = r$
{{Text|END|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
{{Text|FUNCTION|#F0F0F0}} variablesize$ (i {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}}) {{Text|'ID or -1 (if ID already 'loaded')|#31C4C4}}
    {{Text|'Note: assumes whole bytes, no bit offsets/sizes|#31C4C4}}
    {{Text|IF|#F0F0F0}} i <> {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} getid i
    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|'find base size from type|#31C4C4}}
    t = id.t: {{Text|IF|#F0F0F0}} t = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} t = id.arraytype
    bytes = (t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}}
    {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}} {{Text|'correct size for UDTs|#31C4C4}}
        u = t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
        bytes = udtxsize(u) \ {{Text|8|#F580B1}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}} {{Text|'correct size for strings|#31C4C4}}
        {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISFIXEDLENGTH {{Text|THEN|#F0F0F0}}
            bytes = id.tsize
        {{Text|ELSE|#F0F0F0}}
            {{Text|IF|#F0F0F0}} id.arraytype {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Cannot determine size of variable-length string array"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            variablesize$ = scope$ + {{Text|"STRING_"|#FFB100}} + {{Text|RTRIM$|#F0F0F0}}(id.n) + {{Text|"->len"|#FFB100}}
            {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} id.arraytype {{Text|THEN|#F0F0F0}} {{Text|'multiply size for arrays|#31C4C4}}
        n$ = {{Text|RTRIM$|#F0F0F0}}(id.callname)
        s$ = str2(bytes) + {{Text|"*("|#FFB100}} + n$ + {{Text|"[2]&1)"|#FFB100}} {{Text|'note: multiplying by 0 if array not currently defined (affects dynamic arrays)|#31C4C4}}
        arrayelements = id.arrayelements: {{Text|IF|#F0F0F0}} arrayelements = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} arrayelements = {{Text|1|#F580B1}} {{Text|'2009|#31C4C4}}
        {{Text|FOR|#F0F0F0}} i2 = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} arrayelements
            s$ = s$ + {{Text|"*"|#FFB100}} + n$ + {{Text|"["|#FFB100}} + str2(i2 * {{Text|4|#F580B1}} - {{Text|4|#F580B1}} + {{Text|5|#F580B1}}) + {{Text|"]"|#FFB100}}
        {{Text|NEXT|#F0F0F0}}
        variablesize$ = {{Text|"("|#FFB100}} + s$ + {{Text|")"|#FFB100}}
        {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    variablesize$ = str2(bytes)
{{Text|END|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
{{Text|FUNCTION|#F0F0F0}} evaluatetotyp$ (a2$, targettyp {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}})
    {{Text|'note: 'evaluatetotyp' no longer performs 'fixoperationorder' on a2$ (in many cases, this has already been done)|#31C4C4}}
    a$ = a2$
    e$ = evaluate(a$, sourcetyp)
    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|'Offset protection:|#31C4C4}}
    {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISOFFSET {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} ISOFFSET) = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} targettyp >= {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            Give_Error {{Text|"Cannot convert _OFFSET type to other types"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'-5 size|#31C4C4}}
    {{Text|'-6 offset|#31C4C4}}
    {{Text|IF|#F0F0F0}} targettyp = {{Text|-4|#F580B1}} {{Text|OR|#F0F0F0}} targettyp = {{Text|-5|#F580B1}} {{Text|OR|#F0F0F0}} targettyp = {{Text|-6|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'? -> byte_element(offset,element size in bytes)|#31C4C4}}
        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected variable name/array element"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISOFFSETINBITS) {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Variable/element cannot be BIT aligned"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|' print "-4: evaluated as ["+e$+"]":sleep 1|#31C4C4}}
        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISUDT) {{Text|THEN|#F0F0F0}} {{Text|'User Defined Type -> byte_element(offset,bytes)|#31C4C4}}
            {{Text|IF|#F0F0F0}} udtxvariable(sourcetyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) {{Text|THEN|#F0F0F0}} Give_Error {{Text|"UDT must have fixed size"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            idnumber = {{Text|VAL|#F0F0F0}}(e$)
            i = {{Text|INSTR|#F0F0F0}}(e$, sp3): e$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - i)
            u = {{Text|VAL|#F0F0F0}}(e$) {{Text|'closest parent|#31C4C4}}
            i = {{Text|INSTR|#F0F0F0}}(e$, sp3): e$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - i)
            E = {{Text|VAL|#F0F0F0}}(e$)
            i = {{Text|INSTR|#F0F0F0}}(e$, sp3): e$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - i)
            o$ = e$
            getid idnumber
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            n$ = {{Text|"UDT_"|#FFB100}} + {{Text|RTRIM$|#F0F0F0}}(id.n)
            {{Text|IF|#F0F0F0}} id.arraytype {{Text|THEN|#F0F0F0}}
                n$ = {{Text|"ARRAY_"|#FFB100}} + n$ + {{Text|"[0]"|#FFB100}}
                {{Text|'whole array reference examplename()?|#31C4C4}}
                {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(o$, {{Text|3|#F580B1}}) = {{Text|"(0)"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|'use -2 type method|#31C4C4}}
                    {{Text|GOTO|#F0F0F0}} method2usealludt
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            dst$ = {{Text|"(((char*)"|#FFB100}} + scope$ + n$ + {{Text|")+("|#FFB100}} + o$ + {{Text|"))"|#FFB100}}
            {{Text|'determine size of element|#31C4C4}}
            {{Text|IF|#F0F0F0}} E = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'no specific element, use size of entire type|#31C4C4}}
                bytes$ = str2(udtxsize(u) \ {{Text|8|#F580B1}})
            {{Text|ELSE|#F0F0F0}} {{Text|'a specific element|#31C4C4}}
                {{Text|IF|#F0F0F0}} (udtetype(E) {{Text|AND|#F0F0F0}} ISSTRING) > {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} (udtetype(E) {{Text|AND|#F0F0F0}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} (targettyp = {{Text|-5|#F580B1}}) {{Text|THEN|#F0F0F0}}
                    evaluatetotyp$ = {{Text|"(*(qbs**)"|#FFB100}} + dst$ + {{Text|")->len"|#FFB100}}
                    {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|ELSEIF|#F0F0F0}} (udtetype(E) {{Text|AND|#F0F0F0}} ISSTRING) > {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} (udtetype(E) {{Text|AND|#F0F0F0}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} (targettyp = {{Text|-4|#F580B1}}) {{Text|THEN|#F0F0F0}}
                    dst$ = {{Text|"(*((qbs**)((char*)"|#FFB100}} + scope$ + n$ + {{Text|"+("|#FFB100}} + o$ + {{Text|"))))->chr"|#FFB100}}
                    bytes$ = {{Text|"(*((qbs**)((char*)"|#FFB100}} + scope$ + n$ + {{Text|"+("|#FFB100}} + o$ + {{Text|"))))->len"|#FFB100}}
                    evaluatetotyp$ = {{Text|"byte_element((uint64)"|#FFB100}} + dst$ + {{Text|","|#FFB100}} + bytes$ + {{Text|","|#FFB100}} + NewByteElement$ + {{Text|")"|#FFB100}}
                    {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                bytes$ = str2(udtesize(E) \ {{Text|8|#F580B1}})
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            evaluatetotyp$ = {{Text|"byte_element((uint64)"|#FFB100}} + dst$ + {{Text|","|#FFB100}} + bytes$ + {{Text|","|#FFB100}} + NewByteElement$ + {{Text|")"|#FFB100}}
            {{Text|IF|#F0F0F0}} targettyp = {{Text|-5|#F580B1}} {{Text|THEN|#F0F0F0}} evaluatetotyp$ = bytes$
            {{Text|IF|#F0F0F0}} targettyp = {{Text|-6|#F580B1}} {{Text|THEN|#F0F0F0}} evaluatetotyp$ = dst$
            {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISARRAY) {{Text|THEN|#F0F0F0}} {{Text|'Array reference -> byte_element(offset,bytes)|#31C4C4}}
            {{Text|'whole array reference examplename()?|#31C4C4}}
            {{Text|IF|#F0F0F0}} {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|2|#F580B1}}) = sp3 + {{Text|"0"|#FFB100}} {{Text|THEN|#F0F0F0}}
                {{Text|'use -2 type method|#31C4C4}}
                {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        Give_Error {{Text|"Cannot pass array of variable-length strings"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|GOTO|#F0F0F0}} method2useall
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'assume a specific element|#31C4C4}}
            {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISFIXEDLENGTH {{Text|THEN|#F0F0F0}}
                    idnumber = {{Text|VAL|#F0F0F0}}(e$)
                    getid idnumber
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    bytes$ = str2(id.tsize)
                    e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    evaluatetotyp$ = {{Text|"byte_element((uint64)"|#FFB100}} + e$ + {{Text|"->chr,"|#FFB100}} + bytes$ + {{Text|","|#FFB100}} + NewByteElement$ + {{Text|")"|#FFB100}}
                    {{Text|IF|#F0F0F0}} targettyp = {{Text|-5|#F580B1}} {{Text|THEN|#F0F0F0}} evaluatetotyp$ = bytes$
                    {{Text|IF|#F0F0F0}} targettyp = {{Text|-6|#F580B1}} {{Text|THEN|#F0F0F0}} evaluatetotyp$ = e$ + {{Text|"->chr"|#FFB100}}
                {{Text|ELSE|#F0F0F0}}
                    e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    evaluatetotyp$ = {{Text|"byte_element((uint64)"|#FFB100}} + e$ + {{Text|"->chr,"|#FFB100}} + e$ + {{Text|"->len,"|#FFB100}} + NewByteElement$ + {{Text|")"|#FFB100}}
                    {{Text|IF|#F0F0F0}} targettyp = {{Text|-5|#F580B1}} {{Text|THEN|#F0F0F0}} evaluatetotyp$ = e$ + {{Text|"->len"|#FFB100}}
                    {{Text|IF|#F0F0F0}} targettyp = {{Text|-6|#F580B1}} {{Text|THEN|#F0F0F0}} evaluatetotyp$ = e$ + {{Text|"->chr"|#FFB100}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            e$ = {{Text|"(&("|#FFB100}} + e$ + {{Text|"))"|#FFB100}}
            bytes$ = str2((sourcetyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}})
            evaluatetotyp$ = {{Text|"byte_element((uint64)"|#FFB100}} + e$ + {{Text|","|#FFB100}} + bytes$ + {{Text|","|#FFB100}} + NewByteElement$ + {{Text|")"|#FFB100}}
            {{Text|IF|#F0F0F0}} targettyp = {{Text|-5|#F580B1}} {{Text|THEN|#F0F0F0}} evaluatetotyp$ = bytes$
            {{Text|IF|#F0F0F0}} targettyp = {{Text|-6|#F580B1}} {{Text|THEN|#F0F0F0}} evaluatetotyp$ = e$
            {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}} {{Text|'String -> byte_element(offset,bytes)|#31C4C4}}
            {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISFIXEDLENGTH {{Text|THEN|#F0F0F0}}
                idnumber = {{Text|VAL|#F0F0F0}}(e$)
                getid idnumber
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                bytes$ = str2(id.tsize)
                e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|ELSE|#F0F0F0}}
                e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                bytes$ = e$ + {{Text|"->len"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            evaluatetotyp$ = {{Text|"byte_element((uint64)"|#FFB100}} + e$ + {{Text|"->chr,"|#FFB100}} + bytes$ + {{Text|","|#FFB100}} + NewByteElement$ + {{Text|")"|#FFB100}}
            {{Text|IF|#F0F0F0}} targettyp = {{Text|-5|#F580B1}} {{Text|THEN|#F0F0F0}} evaluatetotyp$ = bytes$
            {{Text|IF|#F0F0F0}} targettyp = {{Text|-6|#F580B1}} {{Text|THEN|#F0F0F0}} evaluatetotyp$ = e$ + {{Text|"->chr"|#FFB100}}
            {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|'Standard variable -> byte_element(offset,bytes)|#31C4C4}}
        e$ = refer(e$, sourcetyp, {{Text|1|#F580B1}}) {{Text|'get the variable's formal name|#31C4C4}}
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        size = (sourcetyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}} {{Text|'calculate its size in bytes|#31C4C4}}
        evaluatetotyp$ = {{Text|"byte_element((uint64)"|#FFB100}} + e$ + {{Text|","|#FFB100}} + str2(size) + {{Text|","|#FFB100}} + NewByteElement$ + {{Text|")"|#FFB100}}
        {{Text|IF|#F0F0F0}} targettyp = {{Text|-5|#F580B1}} {{Text|THEN|#F0F0F0}} evaluatetotyp$ = str2(size)
        {{Text|IF|#F0F0F0}} targettyp = {{Text|-6|#F580B1}} {{Text|THEN|#F0F0F0}} evaluatetotyp$ = e$
        {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'-4, -5, -6|#31C4C4}}
    {{Text|IF|#F0F0F0}} targettyp = {{Text|-8|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'? -> _MEM structure helper {offset, fullsize, typeval, elementsize, sf_mem_lock¦???}|#31C4C4}}
        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected variable name/array element"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISOFFSETINBITS) {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Variable/element cannot be BIT aligned"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISUDT) {{Text|THEN|#F0F0F0}} {{Text|'User Defined Type -> byte_element(offset,bytes)|#31C4C4}}
            idnumber = {{Text|VAL|#F0F0F0}}(e$)
            i = {{Text|INSTR|#F0F0F0}}(e$, sp3): e$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - i)
            u = {{Text|VAL|#F0F0F0}}(e$) {{Text|'closest parent|#31C4C4}}
            i = {{Text|INSTR|#F0F0F0}}(e$, sp3): e$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - i)
            E = {{Text|VAL|#F0F0F0}}(e$)
            i = {{Text|INSTR|#F0F0F0}}(e$, sp3): e$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - i)
            o$ = e$
            getid idnumber
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            n$ = {{Text|"UDT_"|#FFB100}} + {{Text|RTRIM$|#F0F0F0}}(id.n)
            {{Text|IF|#F0F0F0}} id.arraytype {{Text|THEN|#F0F0F0}}
                n$ = {{Text|"ARRAY_"|#FFB100}} + n$ + {{Text|"[0]"|#FFB100}}
                {{Text|'whole array reference examplename()?|#31C4C4}}
                {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(o$, {{Text|3|#F580B1}}) = {{Text|"(0)"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|'use -7 type method|#31C4C4}}
                    {{Text|GOTO|#F0F0F0}} method2usealludt__7
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'determine size of element|#31C4C4}}
            {{Text|IF|#F0F0F0}} E = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'no specific element, use size of entire type|#31C4C4}}
                bytes$ = str2(udtxsize(u) \ {{Text|8|#F580B1}})
                t1 = ISUDT + udtetype(u)
            {{Text|ELSE|#F0F0F0}} {{Text|'a specific element|#31C4C4}}
                bytes$ = str2(udtesize(E) \ {{Text|8|#F580B1}})
                t1 = udtetype(E)
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            dst$ = {{Text|"(((char*)"|#FFB100}} + scope$ + n$ + {{Text|")+("|#FFB100}} + o$ + {{Text|"))"|#FFB100}}
            {{Text|'evaluatetotyp$ = "byte_element((uint64)" + dst$ + "," + bytes$ + "," + NewByteElement$ + ")"|#31C4C4}}
            {{Text|'IF targettyp = -5 THEN evaluatetotyp$ = bytes$|#31C4C4}}
            {{Text|'IF targettyp = -6 THEN evaluatetotyp$ = dst$|#31C4C4}}
            t = Type2MemTypeValue(t1)
            evaluatetotyp$ = {{Text|"(ptrszint)"|#FFB100}} + dst$ + {{Text|","|#FFB100}} + bytes$ + {{Text|","|#FFB100}} + str2(t) + {{Text|","|#FFB100}} + bytes$ + {{Text|",sf_mem_lock"|#FFB100}}
            {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISARRAY) {{Text|THEN|#F0F0F0}} {{Text|'Array reference -> byte_element(offset,bytes)|#31C4C4}}
            {{Text|'whole array reference examplename()?|#31C4C4}}
            {{Text|IF|#F0F0F0}} {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|2|#F580B1}}) = sp3 + {{Text|"0"|#FFB100}} {{Text|THEN|#F0F0F0}}
                {{Text|'use -7 type method|#31C4C4}}
                {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        Give_Error {{Text|"Cannot pass array of variable-length strings"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|GOTO|#F0F0F0}} method2useall__7
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            idnumber = {{Text|VAL|#F0F0F0}}(e$)
            getid idnumber
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            n$ = {{Text|RTRIM$|#F0F0F0}}(id.callname)
            lk$ = {{Text|"(mem_lock*)((ptrszint*)"|#FFB100}} + n$ + {{Text|")["|#FFB100}} + str2({{Text|4|#F580B1}} * id.arrayelements + {{Text|4|#F580B1}} + {{Text|1|#F580B1}} - {{Text|1|#F580B1}}) + {{Text|"]"|#FFB100}}
            {{Text|'assume a specific element|#31C4C4}}
            {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISFIXEDLENGTH {{Text|THEN|#F0F0F0}}
                    bytes$ = str2(id.tsize)
                    e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|'evaluatetotyp$ = "byte_element((uint64)" + e$ + "->chr," + bytes$ + "," + NewByteElement$ + ")"|#31C4C4}}
                    {{Text|'IF targettyp = -5 THEN evaluatetotyp$ = bytes$|#31C4C4}}
                    {{Text|'IF targettyp = -6 THEN evaluatetotyp$ = e$ + "->chr"|#31C4C4}}
                    t = Type2MemTypeValue(sourcetyp)
                    evaluatetotyp$ = {{Text|"(ptrszint)"|#FFB100}} + e$ + {{Text|"->chr,"|#FFB100}} + bytes$ + {{Text|","|#FFB100}} + str2(t) + {{Text|","|#FFB100}} + bytes$ + {{Text|","|#FFB100}} + lk$
                {{Text|ELSE|#F0F0F0}}
                    Give_Error qb64prefix$ + {{Text|"MEMELEMENT cannot reference variable-length strings"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            e$ = {{Text|"(&("|#FFB100}} + e$ + {{Text|"))"|#FFB100}}
            bytes$ = str2((sourcetyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}})
            {{Text|'evaluatetotyp$ = "byte_element((uint64)" + e$ + "," + bytes$ + "," + NewByteElement$ + ")"|#31C4C4}}
            {{Text|'IF targettyp = -5 THEN evaluatetotyp$ = bytes$|#31C4C4}}
            {{Text|'IF targettyp = -6 THEN evaluatetotyp$ = e$|#31C4C4}}
            t = Type2MemTypeValue(sourcetyp)
            evaluatetotyp$ = {{Text|"(ptrszint)"|#FFB100}} + e$ + {{Text|","|#FFB100}} + bytes$ + {{Text|","|#FFB100}} + str2(t) + {{Text|","|#FFB100}} + bytes$ + {{Text|","|#FFB100}} + lk$
            {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'isarray|#31C4C4}}
        {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}} {{Text|'String -> byte_element(offset,bytes)|#31C4C4}}
            {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISFIXEDLENGTH {{Text|THEN|#F0F0F0}}
                idnumber = {{Text|VAL|#F0F0F0}}(e$)
                getid idnumber
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                bytes$ = str2(id.tsize)
                e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|ELSE|#F0F0F0}}
                Give_Error qb64prefix$ + {{Text|"MEMELEMENT cannot reference variable-length strings"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'evaluatetotyp$ = "byte_element((uint64)" + e$ + "->chr," + bytes$ + "," + NewByteElement$ + ")"|#31C4C4}}
            {{Text|'IF targettyp = -5 THEN evaluatetotyp$ = bytes$|#31C4C4}}
            {{Text|'IF targettyp = -6 THEN evaluatetotyp$ = e$ + "->chr"|#31C4C4}}
            t = Type2MemTypeValue(sourcetyp)
            evaluatetotyp$ = {{Text|"(ptrszint)"|#FFB100}} + e$ + {{Text|"->chr,"|#FFB100}} + bytes$ + {{Text|","|#FFB100}} + str2(t) + {{Text|","|#FFB100}} + bytes$ + {{Text|",sf_mem_lock"|#FFB100}}
            {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|'Standard variable -> byte_element(offset,bytes)|#31C4C4}}
        e$ = refer(e$, sourcetyp, {{Text|1|#F580B1}}) {{Text|'get the variable's formal name|#31C4C4}}
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        size = (sourcetyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}} {{Text|'calculate its size in bytes|#31C4C4}}
        {{Text|'evaluatetotyp$ = "byte_element((uint64)" + e$ + "," + str2(size) + "," + NewByteElement$ + ")"|#31C4C4}}
        {{Text|'IF targettyp = -5 THEN evaluatetotyp$ = str2(size)|#31C4C4}}
        {{Text|'IF targettyp = -6 THEN evaluatetotyp$ = e$|#31C4C4}}
        t = Type2MemTypeValue(sourcetyp)
        evaluatetotyp$ = {{Text|"(ptrszint)"|#FFB100}} + e$ + {{Text|","|#FFB100}} + str2(size) + {{Text|","|#FFB100}} + str2(t) + {{Text|","|#FFB100}} + str2(size) + {{Text|",sf_mem_lock"|#FFB100}}
        {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'-8|#31C4C4}}
    {{Text|IF|#F0F0F0}} targettyp = {{Text|-7|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'? -> _MEM structure helper {offset, fullsize, typeval, elementsize, sf_mem_lock¦???}|#31C4C4}}
        method2useall__7:
        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected variable name/array element"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISOFFSETINBITS) {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Variable/element cannot be BIT aligned"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|'User Defined Type|#31C4C4}}
        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISUDT) {{Text|THEN|#F0F0F0}}
            {{Text|'          print "CI: -2 type from a UDT":sleep 1|#31C4C4}}
            idnumber = {{Text|VAL|#F0F0F0}}(e$)
            i = {{Text|INSTR|#F0F0F0}}(e$, sp3): e$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - i)
            u = {{Text|VAL|#F0F0F0}}(e$) {{Text|'closest parent|#31C4C4}}
            i = {{Text|INSTR|#F0F0F0}}(e$, sp3): e$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - i)
            E = {{Text|VAL|#F0F0F0}}(e$)
            i = {{Text|INSTR|#F0F0F0}}(e$, sp3): e$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - i)
            o$ = e$
            getid idnumber
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            n$ = {{Text|"UDT_"|#FFB100}} + {{Text|RTRIM$|#F0F0F0}}(id.n): {{Text|IF|#F0F0F0}} id.arraytype {{Text|THEN|#F0F0F0}} n$ = {{Text|"ARRAY_"|#FFB100}} + n$ + {{Text|"[0]"|#FFB100}}
            method2usealludt__7:
            bytes$ = variablesize$({{Text|-1|#F580B1}}) + {{Text|"-("|#FFB100}} + o$ + {{Text|")"|#FFB100}}
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            dst$ = {{Text|"(((char*)"|#FFB100}} + scope$ + n$ + {{Text|")+("|#FFB100}} + o$ + {{Text|"))"|#FFB100}}
            {{Text|'evaluatetotyp$ = "byte_element((uint64)" + dst$ + "," + bytes$ + "," + NewByteElement$ + ")"|#31C4C4}}
            {{Text|'note: myudt.myelement results in a size of 1 because it is a continuous run of no consistent granularity|#31C4C4}}
            {{Text|IF|#F0F0F0}} E <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} size = {{Text|1|#F580B1}} {{Text|ELSE|#F0F0F0}} size = udtxsize(u) \ {{Text|8|#F580B1}}
            t = Type2MemTypeValue(sourcetyp)
            evaluatetotyp$ = {{Text|"(ptrszint)"|#FFB100}} + dst$ + {{Text|","|#FFB100}} + bytes$ + {{Text|","|#FFB100}} + str2(t) + {{Text|","|#FFB100}} + str2(size) + {{Text|",sf_mem_lock"|#FFB100}}
            {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|'Array reference|#31C4C4}}
        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISARRAY) {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    Give_Error qb64prefix$ + {{Text|"MEM cannot reference variable-length strings"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            idnumber = {{Text|VAL|#F0F0F0}}(e$)
            getid idnumber
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            n$ = {{Text|RTRIM$|#F0F0F0}}(id.callname)
            lk$ = {{Text|"(mem_lock*)((ptrszint*)"|#FFB100}} + n$ + {{Text|")["|#FFB100}} + str2({{Text|4|#F580B1}} * id.arrayelements + {{Text|4|#F580B1}} + {{Text|1|#F580B1}} - {{Text|1|#F580B1}}) + {{Text|"]"|#FFB100}}
            tsize = id.tsize {{Text|'used later to determine element size of fixed length strings|#31C4C4}}
            {{Text|'note: array references consist of idnumber¦unmultiplied-element-index|#31C4C4}}
            index$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - {{Text|INSTR|#F0F0F0}}(e$, sp3)) {{Text|'get element index|#31C4C4}}
            bytes$ = variablesize$({{Text|-1|#F580B1}})
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
                e$ = {{Text|"(("|#FFB100}} + e$ + {{Text|")->chr)"|#FFB100}} {{Text|'[2013] handle fixed string arrays differently because they are already pointers|#31C4C4}}
            {{Text|ELSE|#F0F0F0}}
                e$ = {{Text|"(&("|#FFB100}} + e$ + {{Text|"))"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'          print "CI: array: e$["+e$+"], bytes$["+bytes$+"]":sleep 1|#31C4C4}}
            {{Text|'calculate size of elements|#31C4C4}}
            {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
                bytes = tsize
            {{Text|ELSE|#F0F0F0}}
                bytes = (sourcetyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            bytes$ = bytes$ + {{Text|"-("|#FFB100}} + str2(bytes) + {{Text|"*("|#FFB100}} + index$ + {{Text|"))"|#FFB100}}
            t = Type2MemTypeValue(sourcetyp)
            evaluatetotyp$ = {{Text|"(ptrszint)"|#FFB100}} + e$ + {{Text|","|#FFB100}} + bytes$ + {{Text|","|#FFB100}} + str2(t) + {{Text|","|#FFB100}} + str2(bytes) + {{Text|","|#FFB100}} + lk$
            {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|'String|#31C4C4}}
        {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error qb64prefix$ + {{Text|"MEM cannot reference variable-length strings"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            idnumber = {{Text|VAL|#F0F0F0}}(e$)
            getid idnumber: {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            bytes$ = str2(id.tsize)
            e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}}): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            t = Type2MemTypeValue(sourcetyp)
            evaluatetotyp$ = {{Text|"(ptrszint)"|#FFB100}} + e$ + {{Text|"->chr,"|#FFB100}} + bytes$ + {{Text|","|#FFB100}} + str2(t) + {{Text|","|#FFB100}} + bytes$ + {{Text|",sf_mem_lock"|#FFB100}}
            {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|'Standard variable -> byte_element(offset,bytes)|#31C4C4}}
        e$ = refer(e$, sourcetyp, {{Text|1|#F580B1}}) {{Text|'get the variable's formal name|#31C4C4}}
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        size = (sourcetyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}} {{Text|'calculate its size in bytes|#31C4C4}}
        t = Type2MemTypeValue(sourcetyp)
        evaluatetotyp$ = {{Text|"(ptrszint)"|#FFB100}} + e$ + {{Text|","|#FFB100}} + str2(size) + {{Text|","|#FFB100}} + str2(t) + {{Text|","|#FFB100}} + str2(size) + {{Text|",sf_mem_lock"|#FFB100}}
        {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'-7 _MEM structure helper|#31C4C4}}
    {{Text|IF|#F0F0F0}} targettyp = {{Text|-2|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'? -> byte_element(offset,max possible bytes)|#31C4C4}}
        method2useall:
        {{Text|' print "CI: eval2typ detected target type of -2 for ["+a2$+"] evaluated as ["+e$+"]":sleep 1|#31C4C4}}
        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected variable name/array element"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISOFFSETINBITS) {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Variable/element cannot be BIT aligned"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|'User Defined Type -> byte_element(offset,bytes)|#31C4C4}}
        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISUDT) {{Text|THEN|#F0F0F0}}
            {{Text|'          print "CI: -2 type from a UDT":sleep 1|#31C4C4}}
            idnumber = {{Text|VAL|#F0F0F0}}(e$)
            i = {{Text|INSTR|#F0F0F0}}(e$, sp3): e$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - i)
            u = {{Text|VAL|#F0F0F0}}(e$) {{Text|'closest parent|#31C4C4}}
            i = {{Text|INSTR|#F0F0F0}}(e$, sp3): e$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - i)
            E = {{Text|VAL|#F0F0F0}}(e$)
            i = {{Text|INSTR|#F0F0F0}}(e$, sp3): e$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - i)
            o$ = e$
            getid idnumber
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            n$ = {{Text|"UDT_"|#FFB100}} + {{Text|RTRIM$|#F0F0F0}}(id.n): {{Text|IF|#F0F0F0}} id.arraytype {{Text|THEN|#F0F0F0}} n$ = {{Text|"ARRAY_"|#FFB100}} + n$ + {{Text|"[0]"|#FFB100}}
            method2usealludt:
            bytes$ = variablesize$({{Text|-1|#F580B1}}) + {{Text|"-("|#FFB100}} + o$ + {{Text|")"|#FFB100}}
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            dst$ = {{Text|"(((char*)"|#FFB100}} + scope$ + n$ + {{Text|")+("|#FFB100}} + o$ + {{Text|"))"|#FFB100}}
            evaluatetotyp$ = {{Text|"byte_element((uint64)"|#FFB100}} + dst$ + {{Text|","|#FFB100}} + bytes$ + {{Text|","|#FFB100}} + NewByteElement$ + {{Text|")"|#FFB100}}
            {{Text|IF|#F0F0F0}} targettyp = {{Text|-5|#F580B1}} {{Text|THEN|#F0F0F0}} evaluatetotyp$ = bytes$
            {{Text|IF|#F0F0F0}} targettyp = {{Text|-6|#F580B1}} {{Text|THEN|#F0F0F0}} evaluatetotyp$ = dst$
            {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|'Array reference -> byte_element(offset,bytes)|#31C4C4}}
        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISARRAY) {{Text|THEN|#F0F0F0}}
            {{Text|'array of variable length strings (special case, can only refer to single element)|#31C4C4}}
            {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISFIXEDLENGTH) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    evaluatetotyp$ = {{Text|"byte_element((uint64)"|#FFB100}} + e$ + {{Text|"->chr,"|#FFB100}} + e$ + {{Text|"->len,"|#FFB100}} + NewByteElement$ + {{Text|")"|#FFB100}}
                    {{Text|IF|#F0F0F0}} targettyp = {{Text|-5|#F580B1}} {{Text|THEN|#F0F0F0}} evaluatetotyp$ = e$ + {{Text|"->len"|#FFB100}}
                    {{Text|IF|#F0F0F0}} targettyp = {{Text|-6|#F580B1}} {{Text|THEN|#F0F0F0}} evaluatetotyp$ = e$ + {{Text|"->chr"|#FFB100}}
                    {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            idnumber = {{Text|VAL|#F0F0F0}}(e$)
            getid idnumber
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            tsize = id.tsize {{Text|'used later to determine element size of fixed length strings|#31C4C4}}
            {{Text|'note: array references consist of idnumber¦unmultiplied-element-index|#31C4C4}}
            index$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - {{Text|INSTR|#F0F0F0}}(e$, sp3)) {{Text|'get element index|#31C4C4}}
            bytes$ = variablesize$({{Text|-1|#F580B1}})
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            e$ = {{Text|"(&("|#FFB100}} + e$ + {{Text|"))"|#FFB100}}
            {{Text|'          print "CI: array: e$["+e$+"], bytes$["+bytes$+"]":sleep 1|#31C4C4}}
            {{Text|'calculate size of elements|#31C4C4}}
            {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
                bytes = tsize
            {{Text|ELSE|#F0F0F0}}
                bytes = (sourcetyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            bytes$ = bytes$ + {{Text|"-("|#FFB100}} + str2(bytes) + {{Text|"*("|#FFB100}} + index$ + {{Text|"))"|#FFB100}}
            evaluatetotyp$ = {{Text|"byte_element((uint64)"|#FFB100}} + e$ + {{Text|","|#FFB100}} + bytes$ + {{Text|","|#FFB100}} + NewByteElement$ + {{Text|")"|#FFB100}}
            {{Text|IF|#F0F0F0}} targettyp = {{Text|-5|#F580B1}} {{Text|THEN|#F0F0F0}} evaluatetotyp$ = bytes$
            {{Text|IF|#F0F0F0}} targettyp = {{Text|-6|#F580B1}} {{Text|THEN|#F0F0F0}} evaluatetotyp$ = e$
            {{Text|'          print "CI: array ->["+"byte_element((uint64)" + e$ + "," + bytes$+ ","+NewByteElement$+")"+"]":sleep 1|#31C4C4}}
            {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|'String -> byte_element(offset,bytes)|#31C4C4}}
        {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} sourcetyp {{Text|AND|#F0F0F0}} ISFIXEDLENGTH {{Text|THEN|#F0F0F0}}
                idnumber = {{Text|VAL|#F0F0F0}}(e$)
                getid idnumber
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                bytes$ = str2(id.tsize)
                e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|ELSE|#F0F0F0}}
                e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                bytes$ = e$ + {{Text|"->len"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            evaluatetotyp$ = {{Text|"byte_element((uint64)"|#FFB100}} + e$ + {{Text|"->chr,"|#FFB100}} + bytes$ + {{Text|","|#FFB100}} + NewByteElement$ + {{Text|")"|#FFB100}}
            {{Text|IF|#F0F0F0}} targettyp = {{Text|-5|#F580B1}} {{Text|THEN|#F0F0F0}} evaluatetotyp$ = bytes$
            {{Text|IF|#F0F0F0}} targettyp = {{Text|-6|#F580B1}} {{Text|THEN|#F0F0F0}} evaluatetotyp$ = e$ + {{Text|"->chr"|#FFB100}}
            {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|'Standard variable -> byte_element(offset,bytes)|#31C4C4}}
        e$ = refer(e$, sourcetyp, {{Text|1|#F580B1}}) {{Text|'get the variable's formal name|#31C4C4}}
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        size = (sourcetyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) \ {{Text|8|#F580B1}} {{Text|'calculate its size in bytes|#31C4C4}}
        evaluatetotyp$ = {{Text|"byte_element((uint64)"|#FFB100}} + e$ + {{Text|","|#FFB100}} + str2(size) + {{Text|","|#FFB100}} + NewByteElement$ + {{Text|")"|#FFB100}}
        {{Text|IF|#F0F0F0}} targettyp = {{Text|-5|#F580B1}} {{Text|THEN|#F0F0F0}} evaluatetotyp$ = str2(size)
        {{Text|IF|#F0F0F0}} targettyp = {{Text|-6|#F580B1}} {{Text|THEN|#F0F0F0}} evaluatetotyp$ = e$
        {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'-2 byte_element(offset,bytes)|#31C4C4}}
    {{Text|'string?|#31C4C4}}
    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) <> (targettyp {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}}
        Give_Error {{Text|"Illegal string-number conversion"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISSTRING) {{Text|THEN|#F0F0F0}}
        evaluatetotyp$ = e$
        {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}}
            evaluatetotyp$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'pointer required?|#31C4C4}}
    {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} ISPOINTER) {{Text|THEN|#F0F0F0}}
        Give_Error {{Text|"evaluatetotyp received a request for a pointer (unsupported)"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|'...|#31C4C4}}
        Give_Error {{Text|"Invalid pointer"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'change to "non-pointer" value|#31C4C4}}
    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISREFERENCE) {{Text|THEN|#F0F0F0}}
        e$ = refer(e$, sourcetyp, {{Text|0|#F580B1}})
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'check if successful|#31C4C4}}
    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISPOINTER) {{Text|THEN|#F0F0F0}}
        Give_Error {{Text|"evaluatetotyp couldn't convert pointer type!"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'round to integer if required|#31C4C4}}
    {{Text|IF|#F0F0F0}} (sourcetyp {{Text|AND|#F0F0F0}} ISFLOAT) {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} (targettyp {{Text|AND|#F0F0F0}} ISFLOAT) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            bits = targettyp {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
            {{Text|'**32 rounding fix|#31C4C4}}
            {{Text|IF|#F0F0F0}} bits <= {{Text|16|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"qbr_float_to_long("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
            {{Text|IF|#F0F0F0}} bits > {{Text|16|#F580B1}} {{Text|AND|#F0F0F0}} bits < {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"qbr_double_to_long("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
            {{Text|IF|#F0F0F0}} bits >= {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"qbr("|#FFB100}} + e$ + {{Text|")"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    evaluatetotyp$ = e$
{{Text|END|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
{{Text|FUNCTION|#F0F0F0}} findid& (n2$)
    n$ = {{Text|UCASE$|#F0F0F0}}(n2$) {{Text|'case insensitive|#31C4C4}}
    {{Text|'return all strings as 'not found'|#31C4C4}}
    {{Text|IF|#F0F0F0}} {{Text|ASC|#F0F0F0}}(n$) = {{Text|34|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} noid
    {{Text|'if findidsecondarg was set, it will be used for finding the name of a sub (not a func or variable)|#31C4C4}}
    secondarg$ = findidsecondarg: findidsecondarg = {{Text|""|#FFB100}}
    {{Text|'if findanotherid was set, findid will continue scan from last index, otherwise, it will begin a new search|#31C4C4}}
    findanother = findanotherid: findanotherid = {{Text|0|#F580B1}}
    {{Text|IF|#F0F0F0}} findanother <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} findidinternal <> {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"FINDID() ERROR: Invalid repeat search requested!"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}} {{Text|'cannot continue search, no more indexes left!|#31C4C4}}
    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|'(the above should never happen)|#31C4C4}}
    findid& = {{Text|2|#F580B1}} {{Text|'2=not finished searching all indexes|#31C4C4}}
    {{Text|'seperate symbol from name (if a symbol has been added), this is the only way symbols can be passed to findid|#31C4C4}}
    i = {{Text|0|#F580B1}}
    i = {{Text|INSTR|#F0F0F0}}(n$, {{Text|"~"|#FFB100}}): {{Text|IF|#F0F0F0}} i {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} gotsc
    i = {{Text|INSTR|#F0F0F0}}(n$, {{Text|"`"|#FFB100}}): {{Text|IF|#F0F0F0}} i {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} gotsc
    i = {{Text|INSTR|#F0F0F0}}(n$, {{Text|"%"|#FFB100}}): {{Text|IF|#F0F0F0}} i {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} gotsc
    i = {{Text|INSTR|#F0F0F0}}(n$, {{Text|"&"|#FFB100}}): {{Text|IF|#F0F0F0}} i {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} gotsc
    i = {{Text|INSTR|#F0F0F0}}(n$, {{Text|"!"|#FFB100}}): {{Text|IF|#F0F0F0}} i {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} gotsc
    i = {{Text|INSTR|#F0F0F0}}(n$, {{Text|"#"|#FFB100}}): {{Text|IF|#F0F0F0}} i {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} gotsc
    i = {{Text|INSTR|#F0F0F0}}(n$, {{Text|"$"|#FFB100}}): {{Text|IF|#F0F0F0}} i {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} gotsc
    gotsc:
    {{Text|IF|#F0F0F0}} i {{Text|THEN|#F0F0F0}}
        sc$ = {{Text|RIGHT$|#F0F0F0}}(n$, {{Text|LEN|#F0F0F0}}(n$) - i + {{Text|1|#F580B1}}): n$ = {{Text|LEFT$|#F0F0F0}}(n$, i - {{Text|1|#F580B1}})
        {{Text|IF|#F0F0F0}} sc$ = {{Text|"`"|#FFB100}} {{Text|OR|#F0F0F0}} sc$ = {{Text|"~`"|#FFB100}} {{Text|THEN|#F0F0F0}} sc$ = sc$ + {{Text|"1"|#FFB100}} {{Text|'clarify abbreviated 1 bit reference|#31C4C4}}
    {{Text|ELSE|#F0F0F0}}
        {{Text|'''    'no symbol passed, so check what symbol could be assumed under the current DEF...|#31C4C4}}
        {{Text|'''    v = ASC(n$): IF v = 95 THEN v = 27 ELSE v = v - 64|#31C4C4}}
        {{Text|'''    IF v >= 1 AND v <= 27 THEN 'safeguard against n$ not being a standard name|#31C4C4}}
        {{Text|'''        couldhavesc$ = defineextaz(v)|#31C4C4}}
        {{Text|'''        IF couldhavesc$ = "`" OR couldhavesc$ = "~`" THEN couldhavesc$ = couldhavesc$ + "1" 'clarify abbreviated 1 bit reference|#31C4C4}}
        {{Text|'''    END IF 'safeguard|#31C4C4}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'optimizations for later comparisons|#31C4C4}}
    insf$ = subfunc + {{Text|SPACE$|#F0F0F0}}({{Text|256|#F580B1}} - {{Text|LEN|#F0F0F0}}(subfunc))
    secondarg$ = secondarg$ + {{Text|SPACE$|#F0F0F0}}({{Text|256|#F580B1}} - {{Text|LEN|#F0F0F0}}(secondarg$))
    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(sc$) {{Text|THEN|#F0F0F0}} scpassed = {{Text|1|#F580B1}}: sc$ = sc$ + {{Text|SPACE$|#F0F0F0}}({{Text|8|#F580B1}} - {{Text|LEN|#F0F0F0}}(sc$)) {{Text|ELSE|#F0F0F0}} scpassed = {{Text|0|#F580B1}}
    {{Text|'''IF LEN(couldhavesc$) THEN couldhavesc$ = couldhavesc$ + SPACE$(8 - LEN(couldhavesc$)): couldhavescpassed = 1 ELSE couldhavescpassed = 0|#31C4C4}}
    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(n$) < {{Text|256|#F580B1}} {{Text|THEN|#F0F0F0}} n$ = n$ + {{Text|SPACE$|#F0F0F0}}({{Text|256|#F580B1}} - {{Text|LEN|#F0F0F0}}(n$))
    {{Text|'FUNCTION HashFind (a$, searchflags, resultflags, resultreference)|#31C4C4}}
    {{Text|'(0,1,2)z=hashfind[rev]("RUMI",Hashflag_label,resflag,resref)|#31C4C4}}
    {{Text|'0=doesn't exist|#31C4C4}}
    {{Text|'1=found, no more items to scan|#31C4C4}}
    {{Text|'2=found, more items still to scan|#31C4C4}}
    {{Text|'NEW HASH SYSTEM|#31C4C4}}
    n$ = {{Text|RTRIM$|#F0F0F0}}(n$)
    {{Text|IF|#F0F0F0}} findanother {{Text|THEN|#F0F0F0}}
        hashretry:
        z = HashFindCont(unrequired, i)
    {{Text|ELSE|#F0F0F0}}
        z = HashFind(n$, {{Text|1|#F580B1}}, unrequired, i)
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    findidinternal = z
    {{Text|IF|#F0F0F0}} z = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} noid
    findid = z
    {{Text|'continue from previous position?|#31C4C4}}
    {{Text|''IF findanother THEN start = findidinternal ELSE start = idn|#31C4C4}}
    {{Text|''FOR i = start TO 1 STEP -1|#31C4C4}}
    {{Text|''    findidinternal = i - 1|#31C4C4}}
    {{Text|''    IF findidinternal = 0 THEN findid& = 1 '1=found id, but no more to search|#31C4C4}}
    {{Text|''    IF ids(i).n = n$ THEN 'same name?|#31C4C4}}
    {{Text|'in scope?|#31C4C4}}
    {{Text|IF|#F0F0F0}} ids(i).subfunc = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} ids(i).share = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'scope check required (not a shared variable or the name of a sub/function)|#31C4C4}}
        {{Text|IF|#F0F0F0}} ids(i).insubfunc <> insf$ {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} findidnomatch
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'some subs require a second argument (eg. PUT #, DEF SEG, etc.)|#31C4C4}}
    {{Text|IF|#F0F0F0}} ids(i).subfunc = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} {{Text|ASC|#F0F0F0}}(ids(i).secondargmustbe) <> {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'exists?|#31C4C4}}
            {{Text|IF|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(secondarg$) = {{Text|UCASE$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(ids(i).secondargmustbe)) {{Text|THEN|#F0F0F0}}
            {{Text|ELSEIF|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(ids(i).secondargmustbe, {{Text|1|#F580B1}}) = {{Text|"_"|#FFB100}} {{Text|AND|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(secondarg$, {{Text|1|#F580B1}}) <> {{Text|"_"|#FFB100}} {{Text|AND|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(secondarg$) = {{Text|UCASE$|#F0F0F0}}({{Text|MID$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(ids(i).secondargmustbe), {{Text|2|#F580B1}})) {{Text|THEN|#F0F0F0}}
            {{Text|ELSE|#F0F0F0}}
                {{Text|GOTO|#F0F0F0}} findidnomatch
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} {{Text|ASC|#F0F0F0}}(ids(i).secondargcantbe) <> {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'exists?|#31C4C4}}
            {{Text|IF|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(secondarg$) <> {{Text|UCASE$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(ids(i).secondargcantbe)) {{Text|THEN|#F0F0F0}}
            {{Text|ELSEIF|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(ids(i).secondargcantbe, {{Text|1|#F580B1}}) = {{Text|"_"|#FFB100}} {{Text|AND|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(secondarg$, {{Text|1|#F580B1}}) <> {{Text|"_"|#FFB100}} {{Text|AND|#F0F0F0}} {{Text|RTRIM$|#F0F0F0}}(secondarg$) <> {{Text|UCASE$|#F0F0F0}}({{Text|MID$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}(ids(i).secondargcantbe), {{Text|2|#F580B1}})) {{Text|THEN|#F0F0F0}}
            {{Text|ELSE|#F0F0F0}}
                {{Text|GOTO|#F0F0F0}} findidnomatch
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'second sub argument possible|#31C4C4}}
    {{Text|'must have symbol?|#31C4C4}}
    {{Text|'typically for variables defined automatically or by a symbol and not the full type name|#31C4C4}}
    imusthave = {{Text|CVI|#F0F0F0}}(ids(i).musthave) {{Text|'speed up checks of first 2 characters|#31C4C4}}
    amusthave = imusthave {{Text|AND|#F0F0F0}} {{Text|255|#F580B1}} {{Text|'speed up checks of first character|#31C4C4}}
    {{Text|IF|#F0F0F0}} amusthave <> {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} scpassed {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} sc$ = ids(i).musthave {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} findidok
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|'''    IF couldhavescpassed THEN|#31C4C4}}
        {{Text|'''        IF couldhavesc$ = ids(i).musthave THEN GOTO findidok|#31C4C4}}
        {{Text|'''    END IF|#31C4C4}}
        {{Text|'Q: why is the above triple-commented?|#31C4C4}}
        {{Text|'A: because if something must have a symbol to refer to it, then a could-have is|#31C4C4}}
        {{Text|'  not sufficient, and it could mask shared variables in global scope|#31C4C4}}
        {{Text|'note: symbol defined fixed length strings cannot be referred to by $ without an extension|#31C4C4}}
        {{Text|'note: sc$ and couldhavesc$ are already changed from ` to `1 to match stored musthave|#31C4C4}}
        {{Text|GOTO|#F0F0F0}} findidnomatch
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'may have symbol?|#31C4C4}}
    {{Text|'typically for variables formally dim'd|#31C4C4}}
    {{Text|'note: couldhavesc$ needn't be considered for mayhave checks|#31C4C4}}
    {{Text|IF|#F0F0F0}} scpassed {{Text|THEN|#F0F0F0}} {{Text|'symbol was passed, so it must match the mayhave symbol|#31C4C4}}
        imayhave = {{Text|CVI|#F0F0F0}}(ids(i).mayhave) {{Text|'speed up checks of first 2 characters|#31C4C4}}
        amayhave = imayhave {{Text|AND|#F0F0F0}} {{Text|255|#F580B1}} {{Text|'speed up checks of first character|#31C4C4}}
        {{Text|IF|#F0F0F0}} amayhave = {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} findidnomatch {{Text|'it cannot have the symbol passed (nb. musthave symbols have already been ok'd)|#31C4C4}}
        {{Text|'note: variable length strings are not a problem here, as they can only have one possible extension|#31C4C4}}
        {{Text|IF|#F0F0F0}} amayhave = {{Text|36|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'"$"|#31C4C4}}
            {{Text|IF|#F0F0F0}} imayhave <> {{Text|8228|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'"$ "|#31C4C4}}
                {{Text|'it is a fixed length string|#31C4C4}}
                {{Text|IF|#F0F0F0}} {{Text|CVI|#F0F0F0}}(sc$) = {{Text|8228|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} findidok {{Text|'allow myvariable$ to become myvariable$10|#31C4C4}}
                {{Text|'allow later comparison to verify if extension is correct|#31C4C4}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} sc$ <> ids(i).mayhave {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} findidnomatch
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'scpassed|#31C4C4}}
    {{Text|'return id|#31C4C4}}
    findidok:
    id = ids(i)
    t = id.t
    temp$ = refer$(str2$(i), t, {{Text|1|#F580B1}})
    manageVariableList {{Text|""|#FFB100}}, temp$, {{Text|0|#F580B1}}, {{Text|1|#F580B1}}
    currentid = i
    {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|'END IF 'same name|#31C4C4}}
    findidnomatch:
    {{Text|'NEXT|#31C4C4}}
    {{Text|IF|#F0F0F0}} z = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} hashretry
    {{Text|'totally unclassifiable|#31C4C4}}
    noid:
    findid& = {{Text|0|#F580B1}}
    currentid = {{Text|-1|#F580B1}}
{{Text|END|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
{{Text|FUNCTION|#F0F0F0}} FindArray (secure$)
    FindArray = {{Text|-1|#F580B1}}
    n$ = secure$
    {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"func findarray:in:"|#FFB100}} + n$
    {{Text|IF|#F0F0F0}} alphanumeric({{Text|ASC|#F0F0F0}}(n$)) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} FindArray = {{Text|0|#F580B1}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|'establish whether n$ includes an extension|#31C4C4}}
    i = {{Text|INSTR|#F0F0F0}}(n$, {{Text|"~"|#FFB100}}): {{Text|IF|#F0F0F0}} i {{Text|THEN|#F0F0F0}} sc$ = {{Text|RIGHT$|#F0F0F0}}(n$, {{Text|LEN|#F0F0F0}}(n$) - i + {{Text|1|#F580B1}}): n$ = {{Text|LEFT$|#F0F0F0}}(n$, i - {{Text|1|#F580B1}}): {{Text|GOTO|#F0F0F0}} gotsc2
    i = {{Text|INSTR|#F0F0F0}}(n$, {{Text|"`"|#FFB100}}): {{Text|IF|#F0F0F0}} i {{Text|THEN|#F0F0F0}} sc$ = {{Text|RIGHT$|#F0F0F0}}(n$, {{Text|LEN|#F0F0F0}}(n$) - i + {{Text|1|#F580B1}}): n$ = {{Text|LEFT$|#F0F0F0}}(n$, i - {{Text|1|#F580B1}}): {{Text|GOTO|#F0F0F0}} gotsc2
    i = {{Text|INSTR|#F0F0F0}}(n$, {{Text|"%"|#FFB100}}): {{Text|IF|#F0F0F0}} i {{Text|THEN|#F0F0F0}} sc$ = {{Text|RIGHT$|#F0F0F0}}(n$, {{Text|LEN|#F0F0F0}}(n$) - i + {{Text|1|#F580B1}}): n$ = {{Text|LEFT$|#F0F0F0}}(n$, i - {{Text|1|#F580B1}}): {{Text|GOTO|#F0F0F0}} gotsc2
    i = {{Text|INSTR|#F0F0F0}}(n$, {{Text|"&"|#FFB100}}): {{Text|IF|#F0F0F0}} i {{Text|THEN|#F0F0F0}} sc$ = {{Text|RIGHT$|#F0F0F0}}(n$, {{Text|LEN|#F0F0F0}}(n$) - i + {{Text|1|#F580B1}}): n$ = {{Text|LEFT$|#F0F0F0}}(n$, i - {{Text|1|#F580B1}}): {{Text|GOTO|#F0F0F0}} gotsc2
    i = {{Text|INSTR|#F0F0F0}}(n$, {{Text|"!"|#FFB100}}): {{Text|IF|#F0F0F0}} i {{Text|THEN|#F0F0F0}} sc$ = {{Text|RIGHT$|#F0F0F0}}(n$, {{Text|LEN|#F0F0F0}}(n$) - i + {{Text|1|#F580B1}}): n$ = {{Text|LEFT$|#F0F0F0}}(n$, i - {{Text|1|#F580B1}}): {{Text|GOTO|#F0F0F0}} gotsc2
    i = {{Text|INSTR|#F0F0F0}}(n$, {{Text|"#"|#FFB100}}): {{Text|IF|#F0F0F0}} i {{Text|THEN|#F0F0F0}} sc$ = {{Text|RIGHT$|#F0F0F0}}(n$, {{Text|LEN|#F0F0F0}}(n$) - i + {{Text|1|#F580B1}}): n$ = {{Text|LEFT$|#F0F0F0}}(n$, i - {{Text|1|#F580B1}}): {{Text|GOTO|#F0F0F0}} gotsc2
    i = {{Text|INSTR|#F0F0F0}}(n$, {{Text|"$"|#FFB100}}): {{Text|IF|#F0F0F0}} i {{Text|THEN|#F0F0F0}} sc$ = {{Text|RIGHT$|#F0F0F0}}(n$, {{Text|LEN|#F0F0F0}}(n$) - i + {{Text|1|#F580B1}}): n$ = {{Text|LEFT$|#F0F0F0}}(n$, i - {{Text|1|#F580B1}}): {{Text|GOTO|#F0F0F0}} gotsc2
    gotsc2:
    n2$ = n$ + sc$
    {{Text|IF|#F0F0F0}} sc$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
        {{Text|'has an extension|#31C4C4}}
        {{Text|'note! findid must unambiguify ` to `5 or $ to $10 where applicable|#31C4C4}}
        try = findid(n2$): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
            {{Text|IF|#F0F0F0}} id.arraytype {{Text|THEN|#F0F0F0}}
                {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(n2$) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|LOOP|#F0F0F0}}
    {{Text|ELSE|#F0F0F0}}
        {{Text|'no extension|#31C4C4}}
        {{Text|'1. pass as is, without any extension (local)|#31C4C4}}
        try = findid(n2$): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
            {{Text|IF|#F0F0F0}} id.arraytype {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} subfuncn = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|IF|#F0F0F0}} id.insubfuncn = subfuncn {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(n2$) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|LOOP|#F0F0F0}}
        {{Text|'2. that failed, so apply the _define'd extension and pass (local)|#31C4C4}}
        a = {{Text|ASC|#F0F0F0}}({{Text|UCASE$|#F0F0F0}}(n$)): {{Text|IF|#F0F0F0}} a = {{Text|95|#F580B1}} {{Text|THEN|#F0F0F0}} a = {{Text|91|#F580B1}}
        a = a - {{Text|64|#F580B1}} {{Text|'so A=1, Z=27 and _=28|#31C4C4}}
        n2$ = n$ + defineextaz(a)
        try = findid(n2$): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
            {{Text|IF|#F0F0F0}} id.arraytype {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} subfuncn = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|IF|#F0F0F0}} id.insubfuncn = subfuncn {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(n2$) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|LOOP|#F0F0F0}}
        {{Text|'3. pass as is, without any extension (global)|#31C4C4}}
        n2$ = n$
        try = findid(n2$): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
            {{Text|IF|#F0F0F0}} id.arraytype {{Text|THEN|#F0F0F0}}
                {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(n2$) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|LOOP|#F0F0F0}}
        {{Text|'4. that failed, so apply the _define'd extension and pass (global)|#31C4C4}}
        a = {{Text|ASC|#F0F0F0}}({{Text|UCASE$|#F0F0F0}}(n$)): {{Text|IF|#F0F0F0}} a = {{Text|95|#F580B1}} {{Text|THEN|#F0F0F0}} a = {{Text|91|#F580B1}}
        a = a - {{Text|64|#F580B1}} {{Text|'so A=1, Z=27 and _=28|#31C4C4}}
        n2$ = n$ + defineextaz(a)
        try = findid(n2$): {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
            {{Text|IF|#F0F0F0}} id.arraytype {{Text|THEN|#F0F0F0}}
                {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(n2$) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|LOOP|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    FindArray = {{Text|0|#F580B1}}
{{Text|END|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
{{Text|FUNCTION|#F0F0F0}} fixoperationorder$ (savea$)
    {{Text|STATIC|#F0F0F0}} uboundlbound {{Text|AS|#F0F0F0}} {{Text|_BYTE|#F0F0F0}}
    a$ = savea$
    {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"fixoperationorder:in:"|#FFB100}} + a$
    fooindwel = fooindwel + {{Text|1|#F580B1}}
    n = numelements(a$) {{Text|'n is maintained throughout function|#31C4C4}}
    {{Text|IF|#F0F0F0}} fooindwel = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'actions to take on initial call only|#31C4C4}}
        uboundlbound = {{Text|0|#F580B1}}
        {{Text|'Quick check for duplicate binary operations|#31C4C4}}
        uppercasea$ = {{Text|UCASE$|#F0F0F0}}(a$) {{Text|'capitalize it once to reduce calls to ucase over and over|#31C4C4}}
        {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} n - {{Text|1|#F580B1}}
            temp1$ = getelement(uppercasea$, i)
            temp2$ = getelement(uppercasea$, i + {{Text|1|#F580B1}})
            {{Text|IF|#F0F0F0}} temp1$ = {{Text|"AND"|#FFB100}} {{Text|AND|#F0F0F0}} temp2$ = {{Text|"AND"|#FFB100}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Error: AND AND"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|IF|#F0F0F0}} temp1$ = {{Text|"OR"|#FFB100}} {{Text|AND|#F0F0F0}} temp2$ = {{Text|"OR"|#FFB100}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Error: OR OR"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|IF|#F0F0F0}} temp1$ = {{Text|"XOR"|#FFB100}} {{Text|AND|#F0F0F0}} temp2$ = {{Text|"XOR"|#FFB100}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Error: XOR XOR"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|IF|#F0F0F0}} temp1$ = {{Text|"IMP"|#FFB100}} {{Text|AND|#F0F0F0}} temp2$ = {{Text|"IMP"|#FFB100}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Error: IMP IMP"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|IF|#F0F0F0}} temp1$ = {{Text|"EQV"|#FFB100}} {{Text|AND|#F0F0F0}} temp2$ = {{Text|"EQV"|#FFB100}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Error: EQV EQV"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|NEXT|#F0F0F0}}
        {{Text|'----------------A. 'Quick' mismatched brackets check----------------|#31C4C4}}
        b = {{Text|0|#F580B1}}
        a2$ = sp + a$ + sp
        b1$ = sp + {{Text|"("|#FFB100}} + sp
        b2$ = sp + {{Text|")"|#FFB100}} + sp
        i = {{Text|1|#F580B1}}
        findmmb:
        i1 = {{Text|INSTR|#F0F0F0}}(i, a2$, b1$)
        i2 = {{Text|INSTR|#F0F0F0}}(i, a2$, b2$)
        i3 = i1
        {{Text|IF|#F0F0F0}} i2 {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} i1 = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                i3 = i2
            {{Text|ELSE|#F0F0F0}}
                {{Text|IF|#F0F0F0}} i2 < i1 {{Text|THEN|#F0F0F0}} i3 = i2
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} i3 {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} i3 = i1 {{Text|THEN|#F0F0F0}} b = b + {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} i3 = i2 {{Text|THEN|#F0F0F0}} b = b - {{Text|1|#F580B1}}
            i = i3 + {{Text|2|#F580B1}}
            {{Text|IF|#F0F0F0}} b < {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Missing ("|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|GOTO|#F0F0F0}} findmmb
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} b > {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Missing )"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|'----------------B. 'Quick' correction of over-use of +,- ----------------|#31C4C4}}
        {{Text|'note: the results of this change are beneficial to foolayout|#31C4C4}}
        a2$ = sp + a$ + sp
        {{Text|'rule 1: change ++ to +|#31C4C4}}
        rule1:
        i = {{Text|INSTR|#F0F0F0}}(a2$, sp + {{Text|"+"|#FFB100}} + sp + {{Text|"+"|#FFB100}} + sp)
        {{Text|IF|#F0F0F0}} i {{Text|THEN|#F0F0F0}}
            a2$ = {{Text|LEFT$|#F0F0F0}}(a2$, i + {{Text|2|#F580B1}}) + {{Text|RIGHT$|#F0F0F0}}(a2$, {{Text|LEN|#F0F0F0}}(a2$) - i - {{Text|4|#F580B1}})
            a$ = {{Text|MID$|#F0F0F0}}(a2$, {{Text|2|#F580B1}}, {{Text|LEN|#F0F0F0}}(a2$) - {{Text|2|#F580B1}})
            n = n - {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"fixoperationorder:+/-:"|#FFB100}} + a$
            {{Text|GOTO|#F0F0F0}} rule1
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|'rule 2: change -+ to -|#31C4C4}}
        rule2:
        i = {{Text|INSTR|#F0F0F0}}(a2$, sp + {{Text|"-"|#FFB100}} + sp + {{Text|"+"|#FFB100}} + sp)
        {{Text|IF|#F0F0F0}} i {{Text|THEN|#F0F0F0}}
            a2$ = {{Text|LEFT$|#F0F0F0}}(a2$, i + {{Text|2|#F580B1}}) + {{Text|RIGHT$|#F0F0F0}}(a2$, {{Text|LEN|#F0F0F0}}(a2$) - i - {{Text|4|#F580B1}})
            a$ = {{Text|MID$|#F0F0F0}}(a2$, {{Text|2|#F580B1}}, {{Text|LEN|#F0F0F0}}(a2$) - {{Text|2|#F580B1}})
            n = n - {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"fixoperationorder:+/-:"|#FFB100}} + a$
            {{Text|GOTO|#F0F0F0}} rule2
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|'rule 3: change anyoperator-- to anyoperator|#31C4C4}}
        rule3:
        {{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(a2$, sp + {{Text|"-"|#FFB100}} + sp + {{Text|"-"|#FFB100}} + sp) {{Text|THEN|#F0F0F0}}
            {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} n - {{Text|2|#F580B1}}
                {{Text|IF|#F0F0F0}} isoperator(getelement(a$, i)) {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} getelement(a$, i + {{Text|1|#F580B1}}) = {{Text|"-"|#FFB100}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} getelement(a$, i + {{Text|2|#F580B1}}) = {{Text|"-"|#FFB100}} {{Text|THEN|#F0F0F0}}
                            removeelements a$, i + {{Text|1|#F580B1}}, i + {{Text|2|#F580B1}}, {{Text|0|#F580B1}}
                            a2$ = sp + a$ + sp
                            n = n - {{Text|2|#F580B1}}
                            {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"fixoperationorder:+/-:"|#FFB100}} + a$
                            {{Text|GOTO|#F0F0F0}} rule3
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|NEXT|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'rule 3|#31C4C4}}
        {{Text|'----------------C. 'Quick' location of negation----------------|#31C4C4}}
        {{Text|'note: the results of this change are beneficial to foolayout|#31C4C4}}
        {{Text|'for numbers...|#31C4C4}}
        {{Text|'before: anyoperator,-,number|#31C4C4}}
        {{Text|'after:  anyoperator,-number|#31C4C4}}
        {{Text|'for variables...|#31C4C4}}
        {{Text|'before: anyoperator,-,variable|#31C4C4}}
        {{Text|'after:  anyoperator,CHR$(241),variable|#31C4C4}}
        {{Text|'exception for numbers followed by ^... (they will be bracketed up along with the ^ later)|#31C4C4}}
        {{Text|'before: anyoperator,-,number,^|#31C4C4}}
        {{Text|'after:  anyoperator,CHR$(241),number,^|#31C4C4}}
        {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} n - {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} i > n - {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}} {{Text|'n changes, so manually exit if required|#31C4C4}}
            {{Text|IF|#F0F0F0}} {{Text|ASC|#F0F0F0}}(getelement(a$, i)) = {{Text|45|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'-|#31C4C4}}
                neg = {{Text|0|#F580B1}}
                {{Text|IF|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                    neg = {{Text|1|#F580B1}}
                {{Text|ELSE|#F0F0F0}}
                    a2$ = getelement(a$, i - {{Text|1|#F580B1}})
                    c = {{Text|ASC|#F0F0F0}}(a2$)
                    {{Text|IF|#F0F0F0}} c = {{Text|40|#F580B1}} {{Text|OR|#F0F0F0}} c = {{Text|44|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'(,|#31C4C4}}
                        neg = {{Text|1|#F580B1}}
                    {{Text|ELSE|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} isoperator(a2$) {{Text|THEN|#F0F0F0}} neg = {{Text|1|#F580B1}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'()|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'i=1|#31C4C4}}
                {{Text|IF|#F0F0F0}} neg = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                    a2$ = getelement(a$, i + {{Text|1|#F580B1}})
                    c = {{Text|ASC|#F0F0F0}}(a2$)
                    {{Text|IF|#F0F0F0}} c >= {{Text|48|#F580B1}} {{Text|AND|#F0F0F0}} c <= {{Text|57|#F580B1}} {{Text|THEN|#F0F0F0}}
                        c2 = {{Text|0|#F580B1}}: {{Text|IF|#F0F0F0}} i < n - {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} c2 = {{Text|ASC|#F0F0F0}}(getelement(a$, i + {{Text|2|#F580B1}}))
                        {{Text|IF|#F0F0F0}} c2 <> {{Text|94|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'not ^|#31C4C4}}
                            {{Text|'number...|#31C4C4}}
                            i2 = {{Text|INSTR|#F0F0F0}}(a2$, {{Text|","|#FFB100}})
                            {{Text|IF|#F0F0F0}} i2 {{Text|AND|#F0F0F0}} {{Text|ASC|#F0F0F0}}(a2$, i2 + {{Text|1|#F580B1}}) <> {{Text|38|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'&H/&O/&B values don't need the assumed negation|#31C4C4}}
                                a2$ = {{Text|"-"|#FFB100}} + {{Text|LEFT$|#F0F0F0}}(a2$, i2) + {{Text|"-"|#FFB100}} + {{Text|RIGHT$|#F0F0F0}}(a2$, {{Text|LEN|#F0F0F0}}(a2$) - i2)
                            {{Text|ELSE|#F0F0F0}}
                                a2$ = {{Text|"-"|#FFB100}} + a2$
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            removeelements a$, i, i + {{Text|1|#F580B1}}, {{Text|0|#F580B1}}
                            insertelements a$, i - {{Text|1|#F580B1}}, a2$
                            n = n - {{Text|1|#F580B1}}
                            {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"fixoperationorder:negation:"|#FFB100}} + a$
                            {{Text|GOTO|#F0F0F0}} negdone
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|'not a number (or for exceptions)...|#31C4C4}}
                    removeelements a$, i, i, {{Text|0|#F580B1}}
                    insertelements a$, i - {{Text|1|#F580B1}}, {{Text|CHR$|#F0F0F0}}({{Text|241|#F580B1}})
                    {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"fixoperationorder:negation:"|#FFB100}} + a$
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'isoperator|#31C4C4}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'-|#31C4C4}}
            negdone:
        {{Text|NEXT|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'fooindwel=1|#31C4C4}}
    {{Text|'----------------D. 'Quick' Add 'power of' with negation {}bracketing to bottom bracket level----------------|#31C4C4}}
    pownegused = {{Text|0|#F580B1}}
    powneg:
    {{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(a$, {{Text|"^"|#FFB100}} + sp + {{Text|CHR$|#F0F0F0}}({{Text|241|#F580B1}})) {{Text|THEN|#F0F0F0}} {{Text|'quick check|#31C4C4}}
        b = {{Text|0|#F580B1}}
        b1 = {{Text|0|#F580B1}}
        {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} n
            a2$ = getelement(a$, i)
            c = {{Text|ASC|#F0F0F0}}(a2$)
            {{Text|IF|#F0F0F0}} c = {{Text|40|#F580B1}} {{Text|THEN|#F0F0F0}} b = b + {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} c = {{Text|41|#F580B1}} {{Text|THEN|#F0F0F0}} b = b - {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} b = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} b1 {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} isoperator(a2$) {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} a2$ <> {{Text|"^"|#FFB100}} {{Text|AND|#F0F0F0}} a2$ <> {{Text|CHR$|#F0F0F0}}({{Text|241|#F580B1}}) {{Text|THEN|#F0F0F0}}
                            insertelements a$, i - {{Text|1|#F580B1}}, {{Text|"}"|#FFB100}}
                            insertelements a$, b1, {{Text|"{"|#FFB100}}
                            n = n + {{Text|2|#F580B1}}
                            {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"fixoperationorder:^-:"|#FFB100}} + a$
                            {{Text|GOTO|#F0F0F0}} powneg
                            pownegused = {{Text|1|#F580B1}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} c = {{Text|94|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'^|#31C4C4}}
                    {{Text|IF|#F0F0F0}} getelement$(a$, i + {{Text|1|#F580B1}}) = {{Text|CHR$|#F0F0F0}}({{Text|241|#F580B1}}) {{Text|THEN|#F0F0F0}} b1 = i: i = i + {{Text|1|#F580B1}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'b=0|#31C4C4}}
        {{Text|NEXT|#F0F0F0}} i
        {{Text|IF|#F0F0F0}} b1 {{Text|THEN|#F0F0F0}}
            insertelements a$, b1, {{Text|"{"|#FFB100}}
            a$ = a$ + sp + {{Text|"}"|#FFB100}}
            n = n + {{Text|2|#F580B1}}
            {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"fixoperationorder:^-:"|#FFB100}} + a$
            pownegused = {{Text|1|#F580B1}}
            {{Text|GOTO|#F0F0F0}} powneg
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'quick check|#31C4C4}}
    {{Text|'----------------E. Find lowest & highest operator level in bottom bracket level----------------|#31C4C4}}
    NOT_recheck:
    lco = {{Text|255|#F580B1}}
    hco = {{Text|0|#F580B1}}
    b = {{Text|0|#F580B1}}
    {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} n
        a2$ = getelement(a$, i)
        c = {{Text|ASC|#F0F0F0}}(a2$)
        {{Text|IF|#F0F0F0}} c = {{Text|40|#F580B1}} {{Text|OR|#F0F0F0}} c = {{Text|123|#F580B1}} {{Text|THEN|#F0F0F0}} b = b + {{Text|1|#F580B1}}
        {{Text|IF|#F0F0F0}} c = {{Text|41|#F580B1}} {{Text|OR|#F0F0F0}} c = {{Text|125|#F580B1}} {{Text|THEN|#F0F0F0}} b = b - {{Text|1|#F580B1}}
        {{Text|IF|#F0F0F0}} b = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            op = isoperator(a2$)
            {{Text|IF|#F0F0F0}} op {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} op < lco {{Text|THEN|#F0F0F0}} lco = op
                {{Text|IF|#F0F0F0}} op > hco {{Text|THEN|#F0F0F0}} hco = op
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|NEXT|#F0F0F0}}
    {{Text|'----------------F. Add operator {}bracketting----------------|#31C4C4}}
    {{Text|'apply bracketting only if required|#31C4C4}}
    {{Text|IF|#F0F0F0}} hco <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'operators were used|#31C4C4}}
        {{Text|IF|#F0F0F0}} lco <> hco {{Text|THEN|#F0F0F0}}
            {{Text|'brackets needed|#31C4C4}}
            {{Text|IF|#F0F0F0}} lco = {{Text|6|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'NOT exception|#31C4C4}}
                {{Text|'Step 1: Add brackets as follows [[User:RhoSigma|RhoSigma]] ([[User talk:RhoSigma|talk]]) ( NOT ( [[User:RhoSigma|RhoSigma]] ([[User talk:RhoSigma|talk]]) NOT [[User:RhoSigma|RhoSigma]] ([[User talk:RhoSigma|talk]]) NOT [[User:RhoSigma|RhoSigma]] ([[User talk:RhoSigma|talk]]) NOT [[User:RhoSigma|RhoSigma]] ([[User talk:RhoSigma|talk]]) ))|#31C4C4}}
                {{Text|'Step 2: Recheck line from beginning|#31C4C4}}
                {{Text|IF|#F0F0F0}} n = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected NOT ..."|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                b = {{Text|0|#F580B1}}
                {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} n
                    a2$ = getelement(a$, i)
                    c = {{Text|ASC|#F0F0F0}}(a2$)
                    {{Text|IF|#F0F0F0}} c = {{Text|40|#F580B1}} {{Text|OR|#F0F0F0}} c = {{Text|123|#F580B1}} {{Text|THEN|#F0F0F0}} b = b + {{Text|1|#F580B1}}
                    {{Text|IF|#F0F0F0}} c = {{Text|41|#F580B1}} {{Text|OR|#F0F0F0}} c = {{Text|125|#F580B1}} {{Text|THEN|#F0F0F0}} b = b - {{Text|1|#F580B1}}
                    {{Text|IF|#F0F0F0}} b = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} {{Text|UCASE$|#F0F0F0}}(a2$) = {{Text|"NOT"|#FFB100}} {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} i = n {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected NOT ..."|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a$ = {{Text|"NOT"|#FFB100}} + sp + {{Text|"{"|#FFB100}} + sp + getelements$(a$, {{Text|2|#F580B1}}, n) + sp + {{Text|"}"|#FFB100}}: n = n + {{Text|2|#F580B1}}: {{Text|GOTO|#F0F0F0}} lco_bracketting_done
                            a$ = getelements$(a$, {{Text|1|#F580B1}}, i - {{Text|1|#F580B1}}) + sp + {{Text|"{"|#FFB100}} + sp + {{Text|"NOT"|#FFB100}} + sp + {{Text|"{"|#FFB100}} + sp + getelements$(a$, i + {{Text|1|#F580B1}}, n) + sp + {{Text|"}"|#FFB100}} + sp + {{Text|"}"|#FFB100}}
                            n = n + {{Text|4|#F580B1}}
                            {{Text|GOTO|#F0F0F0}} NOT_recheck
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'not|#31C4C4}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'b=0|#31C4C4}}
                {{Text|NEXT|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'NOT exception|#31C4C4}}
            n2 = n
            b = {{Text|0|#F580B1}}
            a3$ = {{Text|"{"|#FFB100}}
            n = {{Text|1|#F580B1}}
            {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} n2
                a2$ = getelement(a$, i)
                c = {{Text|ASC|#F0F0F0}}(a2$)
                {{Text|IF|#F0F0F0}} c = {{Text|40|#F580B1}} {{Text|OR|#F0F0F0}} c = {{Text|123|#F580B1}} {{Text|THEN|#F0F0F0}} b = b + {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} c = {{Text|41|#F580B1}} {{Text|OR|#F0F0F0}} c = {{Text|125|#F580B1}} {{Text|THEN|#F0F0F0}} b = b - {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} b = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    op = isoperator(a2$)
                    {{Text|IF|#F0F0F0}} op = lco {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                            a3$ = a2$ + sp + {{Text|"{"|#FFB100}}
                            n = {{Text|2|#F580B1}}
                        {{Text|ELSE|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} i = n2 {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected variable/value after '"|#FFB100}} + {{Text|UCASE$|#F0F0F0}}(a2$) + {{Text|"'"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                            a3$ = a3$ + sp + {{Text|"}"|#FFB100}} + sp + a2$ + sp + {{Text|"{"|#FFB100}}
                            n = n + {{Text|3|#F580B1}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|GOTO|#F0F0F0}} fixop0
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'b=0|#31C4C4}}
                a3$ = a3$ + sp + a2$
                n = n + {{Text|1|#F580B1}}
                fixop0:
            {{Text|NEXT|#F0F0F0}}
            a3$ = a3$ + sp + {{Text|"}"|#FFB100}}
            n = n + {{Text|1|#F580B1}}
            a$ = a3$
            lco_bracketting_done:
            {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"fixoperationorder:lco bracketing["|#FFB100}}; lco; {{Text|","|#FFB100}}; hco; {{Text|"]:"|#FFB100}} + a$
            {{Text|'--------(F)G. Remove indwelling {}bracketting from power-negation--------|#31C4C4}}
            {{Text|IF|#F0F0F0}} pownegused {{Text|THEN|#F0F0F0}}
                b = {{Text|0|#F580B1}}
                i = {{Text|0|#F580B1}}
                {{Text|DO|#F0F0F0}}
                    i = i + {{Text|1|#F580B1}}
                    {{Text|IF|#F0F0F0}} i > n {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                    c = {{Text|ASC|#F0F0F0}}(getelement(a$, i))
                    {{Text|IF|#F0F0F0}} c = {{Text|41|#F580B1}} {{Text|OR|#F0F0F0}} c = {{Text|125|#F580B1}} {{Text|THEN|#F0F0F0}} b = b - {{Text|1|#F580B1}}
                    {{Text|IF|#F0F0F0}} (c = {{Text|123|#F580B1}} {{Text|OR|#F0F0F0}} c = {{Text|125|#F580B1}}) {{Text|AND|#F0F0F0}} b <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        removeelements a$, i, i, {{Text|0|#F580B1}}
                        n = n - {{Text|1|#F580B1}}
                        i = i - {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"fixoperationorder:^- {} removed:"|#FFB100}} + a$
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} c = {{Text|40|#F580B1}} {{Text|OR|#F0F0F0}} c = {{Text|123|#F580B1}} {{Text|THEN|#F0F0F0}} b = b + {{Text|1|#F580B1}}
                {{Text|LOOP|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'pownegused|#31C4C4}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'lco <> hco|#31C4C4}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'hco <> 0|#31C4C4}}
    {{Text|'--------Bracketting of multiple NOT/negation unary operators--------|#31C4C4}}
    {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(a$, {{Text|4|#F580B1}}) = {{Text|CHR$|#F0F0F0}}({{Text|241|#F580B1}}) + sp + {{Text|CHR$|#F0F0F0}}({{Text|241|#F580B1}}) + sp {{Text|THEN|#F0F0F0}}
        a$ = {{Text|CHR$|#F0F0F0}}({{Text|241|#F580B1}}) + sp + {{Text|"{"|#FFB100}} + sp + getelements$(a$, {{Text|2|#F580B1}}, n) + sp + {{Text|"}"|#FFB100}}: n = n + {{Text|2|#F580B1}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} {{Text|UCASE$|#F0F0F0}}({{Text|LEFT$|#F0F0F0}}(a$, {{Text|8|#F580B1}})) = {{Text|"NOT"|#FFB100}} + sp + {{Text|"NOT"|#FFB100}} + sp {{Text|THEN|#F0F0F0}}
        a$ = {{Text|"NOT"|#FFB100}} + sp + {{Text|"{"|#FFB100}} + sp + getelements$(a$, {{Text|2|#F580B1}}, n) + sp + {{Text|"}"|#FFB100}}: n = n + {{Text|2|#F580B1}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'----------------H. Identification/conversion of elements within bottom bracket level----------------|#31C4C4}}
    {{Text|'actions performed:|#31C4C4}}
    {{Text|'  ->builds f$(tlayout)|#31C4C4}}
    {{Text|'  ->adds symbols to all numbers|#31C4C4}}
    {{Text|'  ->evaluates constants to numbers|#31C4C4}}
    f$ = {{Text|""|#FFB100}}
    b = {{Text|0|#F580B1}}
    c = {{Text|0|#F580B1}}
    lastt = {{Text|0|#F580B1}}: lastti = {{Text|0|#F580B1}}
    {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} n
        f2$ = getelement(a$, i)
        lastc = c
        c = {{Text|ASC|#F0F0F0}}(f2$)
        {{Text|IF|#F0F0F0}} c = {{Text|40|#F580B1}} {{Text|OR|#F0F0F0}} c = {{Text|123|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} c <> {{Text|40|#F580B1}} {{Text|OR|#F0F0F0}} b <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} f2$ = {{Text|""|#FFB100}} {{Text|'skip temporary & indwelling  brackets|#31C4C4}}
            b = b + {{Text|1|#F580B1}}
            {{Text|GOTO|#F0F0F0}} classdone
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} c = {{Text|41|#F580B1}} {{Text|OR|#F0F0F0}} c = {{Text|125|#F580B1}} {{Text|THEN|#F0F0F0}}
            b = b - {{Text|1|#F580B1}}
            {{Text|'check for "("+sp+")" after literal-string, operator, number or nothing|#31C4C4}}
            {{Text|IF|#F0F0F0}} b = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'must be within the lowest level|#31C4C4}}
                {{Text|IF|#F0F0F0}} c = {{Text|41|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} lastc = {{Text|40|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} lastti = i - {{Text|2|#F580B1}} {{Text|OR|#F0F0F0}} lastti = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} lastt >= {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} lastt <= {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}}
                                Give_Error {{Text|"Unexpected ("|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} c <> {{Text|41|#F580B1}} {{Text|OR|#F0F0F0}} b <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} f2$ = {{Text|""|#FFB100}} {{Text|'skip temporary & indwelling  brackets|#31C4C4}}
            {{Text|GOTO|#F0F0F0}} classdone
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} b = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|'classifications/conversions:|#31C4C4}}
            {{Text|'1. quoted string ("....)|#31C4C4}}
            {{Text|'2. number|#31C4C4}}
            {{Text|'3. operator|#31C4C4}}
            {{Text|'4. constant|#31C4C4}}
            {{Text|'5. variable/array/udt/function (note: nothing can share the same name as a function except a label)|#31C4C4}}
            {{Text|'quoted string?|#31C4C4}}
            {{Text|IF|#F0F0F0}} c = {{Text|34|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'"|#31C4C4}}
                lastt = {{Text|1|#F580B1}}: lastti = i
                {{Text|'convert \\ to \|#31C4C4}}
                {{Text|'convert \??? to CHR$(&O???)|#31C4C4}}
                x2 = {{Text|1|#F580B1}}
                x = {{Text|INSTR|#F0F0F0}}(x2, f2$, {{Text|"\"|#FFB100}})
                {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} x
                    c2 = {{Text|ASC|#F0F0F0}}(f2$, x + {{Text|1|#F580B1}})
                    {{Text|IF|#F0F0F0}} c2 = {{Text|92|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'\\|#31C4C4}}
                        f2$ = {{Text|LEFT$|#F0F0F0}}(f2$, x) + {{Text|RIGHT$|#F0F0F0}}(f2$, {{Text|LEN|#F0F0F0}}(f2$) - x - {{Text|1|#F580B1}}) {{Text|'remove second \|#31C4C4}}
                        x2 = x + {{Text|1|#F580B1}}
                    {{Text|ELSE|#F0F0F0}}
                        {{Text|'octal triplet value|#31C4C4}}
                        c3 = ({{Text|ASC|#F0F0F0}}(f2$, x + {{Text|3|#F580B1}}) - {{Text|48|#F580B1}}) + ({{Text|ASC|#F0F0F0}}(f2$, x + {{Text|2|#F580B1}}) - {{Text|48|#F580B1}}) * {{Text|8|#F580B1}} + ({{Text|ASC|#F0F0F0}}(f2$, x + {{Text|1|#F580B1}}) - {{Text|48|#F580B1}}) * {{Text|64|#F580B1}}
                        f2$ = {{Text|LEFT$|#F0F0F0}}(f2$, x - {{Text|1|#F580B1}}) + {{Text|CHR$|#F0F0F0}}(c3) + {{Text|RIGHT$|#F0F0F0}}(f2$, {{Text|LEN|#F0F0F0}}(f2$) - x - {{Text|3|#F580B1}})
                        x2 = x + {{Text|1|#F580B1}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    x = {{Text|INSTR|#F0F0F0}}(x2, f2$, {{Text|"\"|#FFB100}})
                {{Text|LOOP|#F0F0F0}}
                {{Text|'remove ',len' (if it exists)|#31C4C4}}
                x = {{Text|INSTR|#F0F0F0}}({{Text|2|#F580B1}}, f2$, {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|","|#FFB100}}): {{Text|IF|#F0F0F0}} x {{Text|THEN|#F0F0F0}} f2$ = {{Text|LEFT$|#F0F0F0}}(f2$, x)
                {{Text|GOTO|#F0F0F0}} classdone
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'number?|#31C4C4}}
            {{Text|IF|#F0F0F0}} (c >= {{Text|48|#F580B1}} {{Text|AND|#F0F0F0}} c <= {{Text|57|#F580B1}}) {{Text|OR|#F0F0F0}} c = {{Text|45|#F580B1}} {{Text|THEN|#F0F0F0}}
                lastt = {{Text|2|#F580B1}}: lastti = i
                x = {{Text|INSTR|#F0F0F0}}(f2$, {{Text|","|#FFB100}})
                {{Text|IF|#F0F0F0}} x {{Text|THEN|#F0F0F0}}
                    removeelements a$, i, i, {{Text|0|#F580B1}}: insertelements a$, i - {{Text|1|#F580B1}}, {{Text|LEFT$|#F0F0F0}}(f2$, x - {{Text|1|#F580B1}})
                    f2$ = {{Text|RIGHT$|#F0F0F0}}(f2$, {{Text|LEN|#F0F0F0}}(f2$) - x)
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} x = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    c2 = {{Text|ASC|#F0F0F0}}(f2$, {{Text|LEN|#F0F0F0}}(f2$))
                    {{Text|IF|#F0F0F0}} c2 < {{Text|48|#F580B1}} {{Text|OR|#F0F0F0}} c2 > {{Text|57|#F580B1}} {{Text|THEN|#F0F0F0}}
                        x = {{Text|1|#F580B1}} {{Text|'extension given|#31C4C4}}
                    {{Text|ELSE|#F0F0F0}}
                        x = {{Text|INSTR|#F0F0F0}}(f2$, {{Text|"`"|#FFB100}})
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'add appropriate integer symbol if none present|#31C4C4}}
                {{Text|IF|#F0F0F0}} x = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                    f3$ = f2$
                    s$ = {{Text|""|#FFB100}}
                    {{Text|IF|#F0F0F0}} c = {{Text|45|#F580B1}} {{Text|THEN|#F0F0F0}}
                        s$ = {{Text|"&&"|#FFB100}}
                        {{Text|IF|#F0F0F0}} (f3$ < {{Text|"-2147483648"|#FFB100}} {{Text|AND|#F0F0F0}} {{Text|LEN|#F0F0F0}}(f3$) = {{Text|11|#F580B1}}) {{Text|OR|#F0F0F0}} {{Text|LEN|#F0F0F0}}(f3$) < {{Text|11|#F580B1}} {{Text|THEN|#F0F0F0}} s$ = {{Text|"&"|#FFB100}}
                        {{Text|IF|#F0F0F0}} (f3$ <= {{Text|"-32768"|#FFB100}} {{Text|AND|#F0F0F0}} {{Text|LEN|#F0F0F0}}(f3$) = {{Text|6|#F580B1}}) {{Text|OR|#F0F0F0}} {{Text|LEN|#F0F0F0}}(f3$) < {{Text|6|#F580B1}} {{Text|THEN|#F0F0F0}} s$ = {{Text|"%"|#FFB100}}
                    {{Text|ELSE|#F0F0F0}}
                        s$ = {{Text|"~&&"|#FFB100}}
                        {{Text|IF|#F0F0F0}} (f3$ <= {{Text|"9223372036854775807"|#FFB100}} {{Text|AND|#F0F0F0}} {{Text|LEN|#F0F0F0}}(f3$) = {{Text|19|#F580B1}}) {{Text|OR|#F0F0F0}} {{Text|LEN|#F0F0F0}}(f3$) < {{Text|19|#F580B1}} {{Text|THEN|#F0F0F0}} s$ = {{Text|"&&"|#FFB100}}
                        {{Text|IF|#F0F0F0}} (f3$ <= {{Text|"2147483647"|#FFB100}} {{Text|AND|#F0F0F0}} {{Text|LEN|#F0F0F0}}(f3$) = {{Text|10|#F580B1}}) {{Text|OR|#F0F0F0}} {{Text|LEN|#F0F0F0}}(f3$) < {{Text|10|#F580B1}} {{Text|THEN|#F0F0F0}} s$ = {{Text|"&"|#FFB100}}
                        {{Text|IF|#F0F0F0}} (f3$ <= {{Text|"32767"|#FFB100}} {{Text|AND|#F0F0F0}} {{Text|LEN|#F0F0F0}}(f3$) = {{Text|5|#F580B1}}) {{Text|OR|#F0F0F0}} {{Text|LEN|#F0F0F0}}(f3$) < {{Text|5|#F580B1}} {{Text|THEN|#F0F0F0}} s$ = {{Text|"%"|#FFB100}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    f3$ = f3$ + s$
                    removeelements a$, i, i, {{Text|0|#F580B1}}: insertelements a$, i - {{Text|1|#F580B1}}, f3$
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'x=0|#31C4C4}}
                {{Text|GOTO|#F0F0F0}} classdone
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'operator?|#31C4C4}}
            {{Text|IF|#F0F0F0}} isoperator(f2$) {{Text|THEN|#F0F0F0}}
                lastt = {{Text|3|#F580B1}}: lastti = i
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(f2$) > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} f2$ <> SCase2$(f2$) {{Text|THEN|#F0F0F0}}
                        f2$ = SCase2$(f2$)
                        removeelements a$, i, i, {{Text|0|#F580B1}}
                        insertelements a$, i - {{Text|1|#F580B1}}, f2$
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|'append negation|#31C4C4}}
                {{Text|IF|#F0F0F0}} f2$ = {{Text|CHR$|#F0F0F0}}({{Text|241|#F580B1}}) {{Text|THEN|#F0F0F0}} f$ = f$ + sp + {{Text|"-"|#FFB100}}: {{Text|GOTO|#F0F0F0}} classdone_special
                {{Text|GOTO|#F0F0F0}} classdone
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} alphanumeric(c) {{Text|THEN|#F0F0F0}}
                lastt = {{Text|4|#F580B1}}: lastti = i
                {{Text|IF|#F0F0F0}} i < n {{Text|THEN|#F0F0F0}} nextc = {{Text|ASC|#F0F0F0}}(getelement(a$, i + {{Text|1|#F580B1}})) {{Text|ELSE|#F0F0F0}} nextc = {{Text|0|#F580B1}}
                {{Text|' a constant?|#31C4C4}}
                {{Text|IF|#F0F0F0}} nextc <> {{Text|40|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'<>"(" (not an array)|#31C4C4}}
                    {{Text|IF|#F0F0F0}} lastc <> {{Text|46|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'<>"." (not an element of a UDT)|#31C4C4}}
                        e$ = {{Text|UCASE$|#F0F0F0}}(f2$)
                        es$ = removesymbol$(e$)
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        hashfound = {{Text|0|#F580B1}}
                        hashname$ = e$
                        hashchkflags = HASHFLAG_CONSTANT
                        hashres = HashFindRev(hashname$, hashchkflags, hashresflags, hashresref)
                        {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} hashres
                            {{Text|IF|#F0F0F0}} constsubfunc(hashresref) = subfuncn {{Text|OR|#F0F0F0}} constsubfunc(hashresref) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} constdefined(hashresref) {{Text|THEN|#F0F0F0}}
                                    hashfound = {{Text|1|#F580B1}}
                                    {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} hashres <> {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} hashres = HashFindCont(hashresflags, hashresref) {{Text|ELSE|#F0F0F0}} hashres = {{Text|0|#F580B1}}
                        {{Text|LOOP|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} hashfound {{Text|THEN|#F0F0F0}}
                            i2 = hashresref
                            {{Text|'FOR i2 = constlast TO 0 STEP -1|#31C4C4}}
                            {{Text|'IF e$ = constname(i2) THEN|#31C4C4}}
                            {{Text|'is a STATIC variable overriding this constant?|#31C4C4}}
                            staticvariable = {{Text|0|#F580B1}}
                            try = findid(e$ + es$)
                            {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                            {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
                                {{Text|IF|#F0F0F0}} id.arraytype = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} staticvariable = {{Text|1|#F580B1}}: {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}} {{Text|'if it's not an array, it's probably a static variable|#31C4C4}}
                                {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(e$ + es$) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
                                {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                            {{Text|LOOP|#F0F0F0}}
                            {{Text|'add symbol and try again|#31C4C4}}
                            {{Text|IF|#F0F0F0}} staticvariable = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(es$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    a = {{Text|ASC|#F0F0F0}}({{Text|UCASE$|#F0F0F0}}(e$)): {{Text|IF|#F0F0F0}} a = {{Text|95|#F580B1}} {{Text|THEN|#F0F0F0}} a = {{Text|91|#F580B1}}
                                    a = a - {{Text|64|#F580B1}} {{Text|'so A=1, Z=27 and _=28|#31C4C4}}
                                    es2$ = defineextaz(a)
                                    try = findid(e$ + es2$)
                                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                                    {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
                                        {{Text|IF|#F0F0F0}} id.arraytype = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} staticvariable = {{Text|1|#F580B1}}: {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}} {{Text|'if it's not an array, it's probably a static variable|#31C4C4}}
                                        {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(e$ + es2$) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
                                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                                    {{Text|LOOP|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} staticvariable = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                t = consttype(i2)
                                {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(es$) > {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} es$ <> {{Text|"$"|#FFB100}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Type mismatch"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                                    e$ = conststring(i2)
                                {{Text|ELSE|#F0F0F0}} {{Text|'not a string|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(es$) {{Text|THEN|#F0F0F0}} et = typname2typ(es$) {{Text|ELSE|#F0F0F0}} et = {{Text|0|#F580B1}}
                                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} et {{Text|AND|#F0F0F0}} ISSTRING {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Type mismatch"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                                    {{Text|'convert value to general formats|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISFLOAT {{Text|THEN|#F0F0F0}}
                                        v## = constfloat(i2)
                                        v&& = v##
                                        v~&& = v&&
                                    {{Text|ELSE|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISUNSIGNED {{Text|THEN|#F0F0F0}}
                                            v~&& = constuinteger(i2)
                                            v&& = v~&&
                                            v## = v&&
                                        {{Text|ELSE|#F0F0F0}}
                                            v&& = constinteger(i2)
                                            v## = v&&
                                            v~&& = v&&
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|'apply type conversion if necessary|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} et {{Text|THEN|#F0F0F0}} t = et
                                    {{Text|'(todo: range checking)|#31C4C4}}
                                    {{Text|'convert value into string for returning|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISFLOAT {{Text|THEN|#F0F0F0}}
                                        e$ = {{Text|LTRIM$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}({{Text|STR$|#F0F0F0}}(v##)))
                                    {{Text|ELSE|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISUNSIGNED {{Text|THEN|#F0F0F0}}
                                            e$ = {{Text|LTRIM$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}({{Text|STR$|#F0F0F0}}(v~&&)))
                                        {{Text|ELSE|#F0F0F0}}
                                            e$ = {{Text|LTRIM$|#F0F0F0}}({{Text|RTRIM$|#F0F0F0}}({{Text|STR$|#F0F0F0}}(v&&)))
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|'floats returned by str$ must be converted to qb64 standard format|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} t {{Text|AND|#F0F0F0}} ISFLOAT {{Text|THEN|#F0F0F0}}
                                        t2 = t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}
                                        {{Text|'find E,D or F|#31C4C4}}
                                        s$ = {{Text|""|#FFB100}}
                                        {{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(e$, {{Text|"E"|#FFB100}}) {{Text|THEN|#F0F0F0}} s$ = {{Text|"E"|#FFB100}}
                                        {{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(e$, {{Text|"D"|#FFB100}}) {{Text|THEN|#F0F0F0}} s$ = {{Text|"D"|#FFB100}}
                                        {{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(e$, {{Text|"F"|#FFB100}}) {{Text|THEN|#F0F0F0}} s$ = {{Text|"F"|#FFB100}}
                                        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(s$) {{Text|THEN|#F0F0F0}}
                                            {{Text|'E,D,F found|#31C4C4}}
                                            x = {{Text|INSTR|#F0F0F0}}(e$, s$)
                                            {{Text|'as incorrect type letter may have been returned by STR$, override it|#31C4C4}}
                                            {{Text|IF|#F0F0F0}} t2 = {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} s$ = {{Text|"E"|#FFB100}}
                                            {{Text|IF|#F0F0F0}} t2 = {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}} s$ = {{Text|"D"|#FFB100}}
                                            {{Text|IF|#F0F0F0}} t2 = {{Text|256|#F580B1}} {{Text|THEN|#F0F0F0}} s$ = {{Text|"F"|#FFB100}}
                                            {{Text|MID$|#F0F0F0}}(e$, x, {{Text|1|#F580B1}}) = s$
                                            {{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(e$, {{Text|"."|#FFB100}}) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|LEFT$|#F0F0F0}}(e$, x - {{Text|1|#F580B1}}) + {{Text|".0"|#FFB100}} + {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - x + {{Text|1|#F580B1}}): x = x + {{Text|2|#F580B1}}
                                            {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(e$, {{Text|1|#F580B1}}) = {{Text|"."|#FFB100}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"0"|#FFB100}} + e$
                                            {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(e$, {{Text|2|#F580B1}}) = {{Text|"-."|#FFB100}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"-0"|#FFB100}} + {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - {{Text|1|#F580B1}})
                                            {{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(e$, {{Text|"+"|#FFB100}}) = {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(e$, {{Text|"-"|#FFB100}}) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                                e$ = {{Text|LEFT$|#F0F0F0}}(e$, x) + {{Text|"+"|#FFB100}} + {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - x)
                                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                        {{Text|ELSE|#F0F0F0}}
                                            {{Text|'E,D,F not found|#31C4C4}}
                                            {{Text|IF|#F0F0F0}} {{Text|INSTR|#F0F0F0}}(e$, {{Text|"."|#FFB100}}) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = e$ + {{Text|".0"|#FFB100}}
                                            {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(e$, {{Text|1|#F580B1}}) = {{Text|"."|#FFB100}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"0"|#FFB100}} + e$
                                            {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(e$, {{Text|2|#F580B1}}) = {{Text|"-."|#FFB100}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"-0"|#FFB100}} + {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - {{Text|1|#F580B1}})
                                            {{Text|IF|#F0F0F0}} t2 = {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = e$ + {{Text|"E+0"|#FFB100}}
                                            {{Text|IF|#F0F0F0}} t2 = {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = e$ + {{Text|"D+0"|#FFB100}}
                                            {{Text|IF|#F0F0F0}} t2 = {{Text|256|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = e$ + {{Text|"F+0"|#FFB100}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|ELSE|#F0F0F0}}
                                        s$ = typevalue2symbol$(t)
                                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                                        e$ = e$ + s$ {{Text|'simply append symbol to integer|#31C4C4}}
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'not a string|#31C4C4}}
                                removeelements a$, i, i, {{Text|0|#F580B1}}
                                insertelements a$, i - {{Text|1|#F580B1}}, e$
                                {{Text|'alter f2$ here to original casing|#31C4C4}}
                                f2$ = constcname(i2) + es$
                                {{Text|GOTO|#F0F0F0}} classdone
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'not static|#31C4C4}}
                            {{Text|'END IF 'same name|#31C4C4}}
                            {{Text|'NEXT|#31C4C4}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'hashfound|#31C4C4}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'not udt element|#31C4C4}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'not array|#31C4C4}}
                {{Text|'variable/array/udt?|#31C4C4}}
                u$ = f2$
                try_string$ = f2$
                try_string2$ = try_string$ {{Text|'pure version of try_string$|#31C4C4}}
                {{Text|FOR|#F0F0F0}} try_method = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|4|#F580B1}}
                    try_string$ = try_string2$
                    {{Text|IF|#F0F0F0}} try_method = {{Text|2|#F580B1}} {{Text|OR|#F0F0F0}} try_method = {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}}
                        dtyp$ = removesymbol(try_string$)
                        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(dtyp$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} isoperator(try_string$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} isvalidvariable(try_string$) {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(try_string$, {{Text|1|#F580B1}}) = {{Text|"_"|#FFB100}} {{Text|THEN|#F0F0F0}} v = {{Text|27|#F580B1}} {{Text|ELSE|#F0F0F0}} v = {{Text|ASC|#F0F0F0}}({{Text|UCASE$|#F0F0F0}}(try_string$)) - {{Text|64|#F580B1}}
                                    try_string$ = try_string$ + defineextaz(v)
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|ELSE|#F0F0F0}}
                            try_string$ = try_string2$
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    try = findid(try_string$)
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} try
                        {{Text|IF|#F0F0F0}} (subfuncn = id.insubfuncn {{Text|AND|#F0F0F0}} try_method <= {{Text|2|#F580B1}}) {{Text|OR|#F0F0F0}} try_method >= {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"found id matching "|#FFB100}} + f2$
                            {{Text|IF|#F0F0F0}} nextc = {{Text|40|#F580B1}} {{Text|OR|#F0F0F0}} uboundlbound <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'(|#31C4C4}}
                                uboundlbound = {{Text|0|#F580B1}}
                                {{Text|'function or array?|#31C4C4}}
                                {{Text|IF|#F0F0F0}} id.arraytype <> {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} id.subfunc = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|'note: even if it's an array of UDTs, the bracketted index will follow immediately|#31C4C4}}
                                    {{Text|'correct name|#31C4C4}}
                                    f3$ = f2$
                                    s$ = removesymbol$(f3$)
                                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} id.internal_subfunc {{Text|THEN|#F0F0F0}}
                                        f2$ = SCase$({{Text|RTRIM$|#F0F0F0}}(id.cn)) + s$
                                        {{Text|IF|#F0F0F0}} ({{Text|UCASE$|#F0F0F0}}(f2$) = {{Text|"UBOUND"|#FFB100}} {{Text|OR|#F0F0F0}} {{Text|UCASE$|#F0F0F0}}(f2$) = {{Text|"LBOUND"|#FFB100}}) {{Text|THEN|#F0F0F0}}
                                            uboundlbound = {{Text|2|#F580B1}}
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|ELSE|#F0F0F0}}
                                        f2$ = {{Text|RTRIM$|#F0F0F0}}(id.cn) + s$
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    removeelements a$, i, i, {{Text|0|#F580B1}}
                                    insertelements a$, i - {{Text|1|#F580B1}}, {{Text|UCASE$|#F0F0F0}}(f2$)
                                    f$ = f$ + f2$ + sp + {{Text|"("|#FFB100}} + sp
                                    {{Text|'skip (but record with nothing inside them) brackets|#31C4C4}}
                                    b2 = {{Text|1|#F580B1}} {{Text|'already in first bracket|#31C4C4}}
                                    {{Text|FOR|#F0F0F0}} i2 = i + {{Text|2|#F580B1}} {{Text|TO|#F0F0F0}} n
                                        c2 = {{Text|ASC|#F0F0F0}}(getelement(a$, i2))
                                        {{Text|IF|#F0F0F0}} c2 = {{Text|40|#F580B1}} {{Text|THEN|#F0F0F0}} b2 = b2 + {{Text|1|#F580B1}}
                                        {{Text|IF|#F0F0F0}} c2 = {{Text|41|#F580B1}} {{Text|THEN|#F0F0F0}} b2 = b2 - {{Text|1|#F580B1}}
                                        {{Text|IF|#F0F0F0}} b2 = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}} {{Text|'note: mismatched brackets check ensures this always succeeds|#31C4C4}}
                                        f$ = f$ + sp
                                    {{Text|NEXT|#F0F0F0}}
                                    {{Text|'adjust i accordingly|#31C4C4}}
                                    i = i2
                                    f$ = f$ + {{Text|")"|#FFB100}}
                                    {{Text|'jump to UDT section if array is of UDT type (and elements are referenced)|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} id.arraytype {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} i < n {{Text|THEN|#F0F0F0}} nextc = {{Text|ASC|#F0F0F0}}(getelement(a$, i + {{Text|1|#F580B1}})) {{Text|ELSE|#F0F0F0}} nextc = {{Text|0|#F580B1}}
                                        {{Text|IF|#F0F0F0}} nextc = {{Text|46|#F580B1}} {{Text|THEN|#F0F0F0}} t = id.arraytype: {{Text|GOTO|#F0F0F0}} fooudt
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    f$ = f$ + sp
                                    {{Text|GOTO|#F0F0F0}} classdone_special
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'id.arraytype|#31C4C4}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'nextc "("|#31C4C4}}
                            {{Text|IF|#F0F0F0}} nextc <> {{Text|40|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'not "(" (this avoids confusing simple variables with arrays)|#31C4C4}}
                                {{Text|IF|#F0F0F0}} id.t <> {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} id.subfunc = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'simple variable or function (without parameters)|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} id.t {{Text|AND|#F0F0F0}} ISUDT {{Text|THEN|#F0F0F0}}
                                        {{Text|'note: it may or may not be followed by a period (eg. if whole udt is being referred to)|#31C4C4}}
                                        {{Text|'check if next item is a period|#31C4C4}}
                                        {{Text|'correct name|#31C4C4}}
                                        {{Text|IF|#F0F0F0}} id.internal_subfunc {{Text|THEN|#F0F0F0}}
                                            f2$ = SCase$({{Text|RTRIM$|#F0F0F0}}(id.cn)) + removesymbol$(f2$)
                                        {{Text|ELSE|#F0F0F0}}
                                            f2$ = {{Text|RTRIM$|#F0F0F0}}(id.cn) + removesymbol$(f2$)
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                                        removeelements a$, i, i, {{Text|0|#F580B1}}
                                        insertelements a$, i - {{Text|1|#F580B1}}, {{Text|UCASE$|#F0F0F0}}(f2$)
                                        f$ = f$ + f2$
                                        {{Text|IF|#F0F0F0}} nextc <> {{Text|46|#F580B1}} {{Text|THEN|#F0F0F0}} f$ = f$ + sp: {{Text|GOTO|#F0F0F0}} classdone_special {{Text|'no sub-elements referenced|#31C4C4}}
                                        t = id.t
                                        fooudt:
                                        f$ = f$ + sp + {{Text|"."|#FFB100}} + sp
                                        E = udtxnext(t {{Text|AND|#F0F0F0}} {{Text|511|#F580B1}}) {{Text|'next element to check|#31C4C4}}
                                        i = i + {{Text|2|#F580B1}}
                                        {{Text|'loop|#31C4C4}}
                                        {{Text|'"." encountered, i must be an element|#31C4C4}}
                                        {{Text|IF|#F0F0F0}} i > n {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected .element"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                                        f2$ = getelement(a$, i)
                                        s$ = removesymbol$(f2$)
                                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                                        u$ = {{Text|UCASE$|#F0F0F0}}(f2$) + {{Text|SPACE$|#F0F0F0}}({{Text|256|#F580B1}} - {{Text|LEN|#F0F0F0}}(f2$)) {{Text|'fast scanning|#31C4C4}}
                                        {{Text|'is f$ the same as element e?|#31C4C4}}
                                        fooudtnexte:
                                        {{Text|IF|#F0F0F0}} udtename(E) = u$ {{Text|THEN|#F0F0F0}}
                                            {{Text|'match found|#31C4C4}}
                                            {{Text|'todo: check symbol(s$) matches element's type|#31C4C4}}
                                            {{Text|'correct name|#31C4C4}}
                                            f2$ = {{Text|RTRIM$|#F0F0F0}}(udtecname(E)) + s$
                                            removeelements a$, i, i, {{Text|0|#F580B1}}
                                            insertelements a$, i - {{Text|1|#F580B1}}, {{Text|UCASE$|#F0F0F0}}(f2$)
                                            f$ = f$ + f2$
                                            {{Text|IF|#F0F0F0}} i = n {{Text|THEN|#F0F0F0}} f$ = f$ + sp: {{Text|GOTO|#F0F0F0}} classdone_special
                                            nextc = {{Text|ASC|#F0F0F0}}(getelement(a$, i + {{Text|1|#F580B1}}))
                                            {{Text|IF|#F0F0F0}} nextc <> {{Text|46|#F580B1}} {{Text|THEN|#F0F0F0}} f$ = f$ + sp: {{Text|GOTO|#F0F0F0}} classdone_special {{Text|'no sub-elements referenced|#31C4C4}}
                                            {{Text|'sub-element exists|#31C4C4}}
                                            t = udtetype(E)
                                            {{Text|IF|#F0F0F0}} (t {{Text|AND|#F0F0F0}} ISUDT) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Invalid . after element"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                                            {{Text|GOTO|#F0F0F0}} fooudt
                                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'match found|#31C4C4}}
                                        {{Text|'no, so check next element|#31C4C4}}
                                        E = udtenext(E)
                                        {{Text|IF|#F0F0F0}} E = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Element not defined"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                                        {{Text|GOTO|#F0F0F0}} fooudtnexte
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'udt|#31C4C4}}
                                    {{Text|'non array/udt based variable|#31C4C4}}
                                    f3$ = f2$
                                    s$ = removesymbol$(f3$)
                                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} id.internal_subfunc {{Text|THEN|#F0F0F0}}
                                        f2$ = SCase$({{Text|RTRIM$|#F0F0F0}}(id.cn)) + s$
                                    {{Text|ELSE|#F0F0F0}}
                                        f2$ = {{Text|RTRIM$|#F0F0F0}}(id.cn) + s$
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|'change was is returned to uppercase|#31C4C4}}
                                    removeelements a$, i, i, {{Text|0|#F580B1}}
                                    insertelements a$, i - {{Text|1|#F580B1}}, {{Text|UCASE$|#F0F0F0}}(f2$)
                                    {{Text|GOTO|#F0F0F0}} CouldNotClassify
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'id.t|#31C4C4}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'nextc not "("|#31C4C4}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} try = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} findanotherid = {{Text|1|#F580B1}}: try = findid(try_string$) {{Text|ELSE|#F0F0F0}} try = {{Text|0|#F580B1}}
                        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|LOOP|#F0F0F0}}
                {{Text|NEXT|#F0F0F0}} {{Text|'try method (1-4)|#31C4C4}}
                CouldNotClassify:
                {{Text|'alphanumeric, but item name is unknown... is it an internal type? if so, use capitals|#31C4C4}}
                f3$ = {{Text|UCASE$|#F0F0F0}}(f2$)
                internaltype = {{Text|0|#F580B1}}
                {{Text|IF|#F0F0F0}} f3$ = {{Text|"STRING"|#FFB100}} {{Text|THEN|#F0F0F0}} internaltype = {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} f3$ = {{Text|"_UNSIGNED"|#FFB100}} {{Text|OR|#F0F0F0}} (f3$ = {{Text|"UNSIGNED"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} internaltype = {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} f3$ = {{Text|"_BIT"|#FFB100}} {{Text|OR|#F0F0F0}} (f3$ = {{Text|"BIT"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} internaltype = {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} f3$ = {{Text|"_BYTE"|#FFB100}} {{Text|OR|#F0F0F0}} (f3$ = {{Text|"BYTE"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} internaltype = {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} f3$ = {{Text|"INTEGER"|#FFB100}} {{Text|THEN|#F0F0F0}} internaltype = {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} f3$ = {{Text|"LONG"|#FFB100}} {{Text|THEN|#F0F0F0}} internaltype = {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} f3$ = {{Text|"_INTEGER64"|#FFB100}} {{Text|OR|#F0F0F0}} (f3$ = {{Text|"INTEGER64"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} internaltype = {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} f3$ = {{Text|"SINGLE"|#FFB100}} {{Text|THEN|#F0F0F0}} internaltype = {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} f3$ = {{Text|"DOUBLE"|#FFB100}} {{Text|THEN|#F0F0F0}} internaltype = {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} f3$ = {{Text|"_FLOAT"|#FFB100}} {{Text|OR|#F0F0F0}} (f3$ = {{Text|"FLOAT"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} internaltype = {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} f3$ = {{Text|"_OFFSET"|#FFB100}} {{Text|OR|#F0F0F0}} (f3$ = {{Text|"OFFSET"|#FFB100}} {{Text|AND|#F0F0F0}} qb64prefix_set = {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}} internaltype = {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} internaltype = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                    f2$ = SCase2$(f3$)
                    removeelements a$, i, i, {{Text|0|#F580B1}}
                    insertelements a$, i - {{Text|1|#F580B1}}, f3$
                    {{Text|GOTO|#F0F0F0}} classdone
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|GOTO|#F0F0F0}} classdone
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'alphanumeric|#31C4C4}}
            classdone:
            f$ = f$ + f2$
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'b=0|#31C4C4}}
        f$ = f$ + sp
        classdone_special:
    {{Text|NEXT|#F0F0F0}}
    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(f$) {{Text|THEN|#F0F0F0}} f$ = {{Text|LEFT$|#F0F0F0}}(f$, {{Text|LEN|#F0F0F0}}(f$) - {{Text|1|#F580B1}}) {{Text|'remove trailing 'sp'|#31C4C4}}
    {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"fixoperationorder:identification:"|#FFB100}} + a$, n
    {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"fixoperationorder:identification(layout):"|#FFB100}} + f$, n
    {{Text|'----------------I. Pass (){}bracketed items (if any) to fixoperationorder & build return----------------|#31C4C4}}
    {{Text|'note: items seperated by commas are done seperately|#31C4C4}}
    ff$ = {{Text|""|#FFB100}}
    b = {{Text|0|#F580B1}}
    b2 = {{Text|0|#F580B1}}
    p1 = {{Text|0|#F580B1}} {{Text|'where level 1 began|#31C4C4}}
    aa$ = {{Text|""|#FFB100}}
    n = numelements(a$)
    {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} n
        openbracket = {{Text|0|#F580B1}}
        a2$ = getelement(a$, i)
        c = {{Text|ASC|#F0F0F0}}(a2$)
        {{Text|IF|#F0F0F0}} c = {{Text|40|#F580B1}} {{Text|OR|#F0F0F0}} c = {{Text|123|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'({|#31C4C4}}
            b = b + {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} b = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                p1 = i + {{Text|1|#F580B1}}
                aa$ = aa$ + {{Text|"("|#FFB100}} + sp
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            openbracket = {{Text|1|#F580B1}}
            {{Text|GOTO|#F0F0F0}} foopass
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'({|#31C4C4}}
        {{Text|IF|#F0F0F0}} c = {{Text|44|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|',|#31C4C4}}
            {{Text|IF|#F0F0F0}} b = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|GOTO|#F0F0F0}} foopassit
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} c = {{Text|41|#F580B1}} {{Text|OR|#F0F0F0}} c = {{Text|125|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|')}|#31C4C4}}
            {{Text|IF|#F0F0F0}} uboundlbound {{Text|THEN|#F0F0F0}} uboundlbound = uboundlbound - {{Text|1|#F580B1}}
            b = b - {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} b = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                foopassit:
                {{Text|IF|#F0F0F0}} p1 <> i {{Text|THEN|#F0F0F0}}
                    foo$ = fixoperationorder(getelements(a$, p1, i - {{Text|1|#F580B1}}))
                    {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(foo$) {{Text|THEN|#F0F0F0}}
                        aa$ = aa$ + foo$ + sp
                        {{Text|IF|#F0F0F0}} c = {{Text|125|#F580B1}} {{Text|THEN|#F0F0F0}} ff$ = ff$ + tlayout$ + sp {{Text|ELSE|#F0F0F0}} ff$ = ff$ + tlayout$ + sp2 {{Text|'spacing between ) } , varies|#31C4C4}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} c = {{Text|44|#F580B1}} {{Text|THEN|#F0F0F0}} aa$ = aa$ + {{Text|","|#FFB100}} + sp: ff$ = ff$ + {{Text|","|#FFB100}} + sp {{Text|ELSE|#F0F0F0}} aa$ = aa$ + {{Text|")"|#FFB100}} + sp
                p1 = i + {{Text|1|#F580B1}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|GOTO|#F0F0F0}} foopass
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|')}|#31C4C4}}
        {{Text|IF|#F0F0F0}} b = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} aa$ = aa$ + a2$ + sp
        foopass:
        f2$ = getelementspecial(f$, i)
        {{Text|IF|#F0F0F0}} Error_Happened {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(f2$) {{Text|THEN|#F0F0F0}}
            {{Text|'use sp2 to join items connected by a period|#31C4C4}}
            {{Text|IF|#F0F0F0}} c = {{Text|46|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'"."|#31C4C4}}
                {{Text|IF|#F0F0F0}} i > {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} i < n {{Text|THEN|#F0F0F0}} {{Text|'stupidity check|#31C4C4}}
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(ff$) {{Text|THEN|#F0F0F0}} {{Text|MID$|#F0F0F0}}(ff$, {{Text|LEN|#F0F0F0}}(ff$), {{Text|1|#F580B1}}) = sp2 {{Text|'convert last spacer to a sp2|#31C4C4}}
                    ff$ = ff$ + {{Text|"."|#FFB100}} + sp2
                    {{Text|GOTO|#F0F0F0}} fooloopnxt
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'spacing just before (|#31C4C4}}
            {{Text|IF|#F0F0F0}} openbracket {{Text|THEN|#F0F0F0}}
                {{Text|'convert last spacer?|#31C4C4}}
                {{Text|IF|#F0F0F0}} i <> {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} isoperator(getelement$(a$, i - {{Text|1|#F580B1}})) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|MID$|#F0F0F0}}(ff$, {{Text|LEN|#F0F0F0}}(ff$), {{Text|1|#F580B1}}) = sp2
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                ff$ = ff$ + f2$ + sp2
            {{Text|ELSE|#F0F0F0}} {{Text|'not openbracket|#31C4C4}}
                ff$ = ff$ + f2$ + sp
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'len(f2$)|#31C4C4}}
        fooloopnxt:
    {{Text|NEXT|#F0F0F0}}
    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(aa$) {{Text|THEN|#F0F0F0}} aa$ = {{Text|LEFT$|#F0F0F0}}(aa$, {{Text|LEN|#F0F0F0}}(aa$) - {{Text|1|#F580B1}})
    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(ff$) {{Text|THEN|#F0F0F0}} ff$ = {{Text|LEFT$|#F0F0F0}}(ff$, {{Text|LEN|#F0F0F0}}(ff$) - {{Text|1|#F580B1}})
    {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"fixoperationorder:return:"|#FFB100}} + aa$
    {{Text|IF|#F0F0F0}} Debug {{Text|THEN|#F0F0F0}} {{Text|PRINT|#F0F0F0}} #9, {{Text|"fixoperationorder:layout:"|#FFB100}} + ff$
    tlayout$ = ff$
    fixoperationorder$ = aa$
    fooindwel = fooindwel - {{Text|1|#F580B1}}
{{Text|END|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
{{Text|FUNCTION|#F0F0F0}} getelementspecial$ (savea$, elenum)
    a$ = savea$
    {{Text|IF|#F0F0F0}} a$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}} {{Text|'no elements!|#31C4C4}}
    n = {{Text|1|#F580B1}}
    p = {{Text|1|#F580B1}}
    getelementspecialnext:
    i = {{Text|INSTR|#F0F0F0}}(p, a$, sp)
    {{Text|'avoid sp inside "..."|#31C4C4}}
    i2 = {{Text|INSTR|#F0F0F0}}(p, a$, {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}))
    {{Text|IF|#F0F0F0}} i2 < i {{Text|AND|#F0F0F0}} i2 <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
        i3 = {{Text|INSTR|#F0F0F0}}(i2 + {{Text|1|#F580B1}}, a$, {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}})): {{Text|IF|#F0F0F0}} i3 = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected "|#FFB100}} + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}): {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        i = {{Text|INSTR|#F0F0F0}}(i3, a$, sp)
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} elenum = n {{Text|THEN|#F0F0F0}}
        {{Text|IF|#F0F0F0}} i {{Text|THEN|#F0F0F0}}
            getelementspecial$ = {{Text|MID$|#F0F0F0}}(a$, p, i - p)
        {{Text|ELSE|#F0F0F0}}
            getelementspecial$ = {{Text|RIGHT$|#F0F0F0}}(a$, {{Text|LEN|#F0F0F0}}(a$) - p + {{Text|1|#F580B1}})
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} i = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}} {{Text|'no more elements!|#31C4C4}}
    n = n + {{Text|1|#F580B1}}
    p = i + {{Text|1|#F580B1}}
    {{Text|GOTO|#F0F0F0}} getelementspecialnext
{{Text|END|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
{{Text|SUB|#F0F0F0}} getid (i {{Text|AS|#F0F0F0}} {{Text|LONG|#F0F0F0}})
    {{Text|IF|#F0F0F0}} i = {{Text|-1|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"-1 passed to getid!"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|SUB|#F0F0F0}}
    id = ids(i)
    currentid = i
{{Text|END|#F0F0F0}} {{Text|SUB|#F0F0F0}}
{{Text|FUNCTION|#F0F0F0}} isoperator (a2$)
    a$ = {{Text|UCASE$|#F0F0F0}}(a2$)
    l = {{Text|0|#F580B1}}
    l = l + {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} a$ = {{Text|"IMP"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} opfound
    l = l + {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} a$ = {{Text|"EQV"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} opfound
    l = l + {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} a$ = {{Text|"XOR"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} opfound
    l = l + {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} a$ = {{Text|"OR"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} opfound
    l = l + {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} a$ = {{Text|"AND"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} opfound
    l = l + {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} a$ = {{Text|"NOT"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} opfound
    l = l + {{Text|1|#F580B1}}
    {{Text|IF|#F0F0F0}} a$ = {{Text|"="|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} opfound
    {{Text|IF|#F0F0F0}} a$ = {{Text|">"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} opfound
    {{Text|IF|#F0F0F0}} a$ = {{Text|"<"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} opfound
    {{Text|IF|#F0F0F0}} a$ = {{Text|"<>"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} opfound
    {{Text|IF|#F0F0F0}} a$ = {{Text|"<="|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} opfound
    {{Text|IF|#F0F0F0}} a$ = {{Text|">="|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} opfound
    l = l + {{Text|1|#F580B1}}
    {{Text|IF|#F0F0F0}} a$ = {{Text|"+"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} opfound
    {{Text|IF|#F0F0F0}} a$ = {{Text|"-"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} opfound {{Text|'!CAREFUL! could be negation|#31C4C4}}
    l = l + {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} a$ = {{Text|"MOD"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} opfound
    l = l + {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} a$ = {{Text|"\"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} opfound
    l = l + {{Text|1|#F580B1}}
    {{Text|IF|#F0F0F0}} a$ = {{Text|"*"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} opfound
    {{Text|IF|#F0F0F0}} a$ = {{Text|"/"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} opfound
    {{Text|'NEGATION LEVEL (MUST BE SET AFTER CALLING ISOPERATOR BY CONTEXT)|#31C4C4}}
    l = l + {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} a$ = {{Text|CHR$|#F0F0F0}}({{Text|241|#F580B1}}) {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} opfound
    l = l + {{Text|1|#F580B1}}: {{Text|IF|#F0F0F0}} a$ = {{Text|"^"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} opfound
    {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    opfound:
    isoperator = l
{{Text|END|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
{{Text|FUNCTION|#F0F0F0}} isuinteger (i$)
    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(i$) = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|IF|#F0F0F0}} {{Text|ASC|#F0F0F0}}(i$, {{Text|1|#F580B1}}) = {{Text|48|#F580B1}} {{Text|AND|#F0F0F0}} {{Text|LEN|#F0F0F0}}(i$) > {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|FOR|#F0F0F0}} c = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|LEN|#F0F0F0}}(i$)
        v = {{Text|ASC|#F0F0F0}}(i$, c)
        {{Text|IF|#F0F0F0}} v < {{Text|48|#F580B1}} {{Text|OR|#F0F0F0}} v > {{Text|57|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|NEXT|#F0F0F0}}
    isuinteger = {{Text|-1|#F580B1}}
{{Text|END|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
{{Text|FUNCTION|#F0F0F0}} isvalidvariable (a$)
    {{Text|FOR|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|LEN|#F0F0F0}}(a$)
        c = {{Text|ASC|#F0F0F0}}(a$, i)
        t = {{Text|0|#F580B1}}
        {{Text|IF|#F0F0F0}} c >= {{Text|48|#F580B1}} {{Text|AND|#F0F0F0}} c <= {{Text|57|#F580B1}} {{Text|THEN|#F0F0F0}} t = {{Text|1|#F580B1}} {{Text|'numeric|#31C4C4}}
        {{Text|IF|#F0F0F0}} c >= {{Text|65|#F580B1}} {{Text|AND|#F0F0F0}} c <= {{Text|90|#F580B1}} {{Text|THEN|#F0F0F0}} t = {{Text|2|#F580B1}} {{Text|'uppercase|#31C4C4}}
        {{Text|IF|#F0F0F0}} c >= {{Text|97|#F580B1}} {{Text|AND|#F0F0F0}} c <= {{Text|122|#F580B1}} {{Text|THEN|#F0F0F0}} t = {{Text|2|#F580B1}} {{Text|'lowercase|#31C4C4}}
        {{Text|IF|#F0F0F0}} c = {{Text|95|#F580B1}} {{Text|THEN|#F0F0F0}} t = {{Text|2|#F580B1}} {{Text|'_ underscore|#31C4C4}}
        {{Text|IF|#F0F0F0}} t = {{Text|2|#F580B1}} {{Text|OR|#F0F0F0}} (t = {{Text|1|#F580B1}} {{Text|AND|#F0F0F0}} i > {{Text|1|#F580B1}}) {{Text|THEN|#F0F0F0}}
            {{Text|'valid (continue)|#31C4C4}}
        {{Text|ELSE|#F0F0F0}}
            {{Text|IF|#F0F0F0}} i = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} isvalidvariable = {{Text|0|#F580B1}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|NEXT|#F0F0F0}}
    isvalidvariable = {{Text|1|#F580B1}}
    {{Text|IF|#F0F0F0}} i > n {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}} {{Text|'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.|#31C4C4}}
    e$ = {{Text|RIGHT$|#F0F0F0}}(a$, {{Text|LEN|#F0F0F0}}(a$) - i - {{Text|1|#F580B1}})
    {{Text|IF|#F0F0F0}} e$ = {{Text|"%%"|#FFB100}} {{Text|OR|#F0F0F0}} e$ = {{Text|"~%%"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|IF|#F0F0F0}} e$ = {{Text|"%"|#FFB100}} {{Text|OR|#F0F0F0}} e$ = {{Text|"~%"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|IF|#F0F0F0}} e$ = {{Text|"&"|#FFB100}} {{Text|OR|#F0F0F0}} e$ = {{Text|"~&"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|IF|#F0F0F0}} e$ = {{Text|"&&"|#FFB100}} {{Text|OR|#F0F0F0}} e$ = {{Text|"~&&"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|IF|#F0F0F0}} e$ = {{Text|"!"|#FFB100}} {{Text|OR|#F0F0F0}} e$ = {{Text|"#"|#FFB100}} {{Text|OR|#F0F0F0}} e$ = {{Text|"##"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|IF|#F0F0F0}} e$ = {{Text|"$"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|IF|#F0F0F0}} e$ = {{Text|"`"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(e$, {{Text|1|#F580B1}}) <> {{Text|"$"|#FFB100}} {{Text|AND|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(e$, {{Text|1|#F580B1}}) <> {{Text|"`"|#FFB100}} {{Text|THEN|#F0F0F0}} isvalidvariable = {{Text|0|#F580B1}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    e$ = {{Text|RIGHT$|#F0F0F0}}(e$, {{Text|LEN|#F0F0F0}}(e$) - {{Text|1|#F580B1}})
    {{Text|IF|#F0F0F0}} isuinteger(e$) {{Text|THEN|#F0F0F0}} isvalidvariable = {{Text|1|#F580B1}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    isvalidvariable = {{Text|0|#F580B1}}
{{Text|END|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
{{Text|FUNCTION|#F0F0F0}} lineformat$ (a$)
    a2$ = {{Text|""|#FFB100}}
    linecontinuation = {{Text|0|#F580B1}}
    continueline:
    a$ = a$ + {{Text|"  "|#FFB100}} {{Text|'add 2 extra spaces to make reading next char easier|#31C4C4}}
    ca$ = a$
    a$ = {{Text|UCASE$|#F0F0F0}}(a$)
    n = {{Text|LEN|#F0F0F0}}(a$)
    i = {{Text|1|#F580B1}}
    lineformatnext:
    {{Text|IF|#F0F0F0}} i >= n {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} lineformatdone
    c = {{Text|ASC|#F0F0F0}}(a$, i)
    c$ = {{Text|CHR$|#F0F0F0}}(c) {{Text|'***remove later***|#31C4C4}}
    {{Text|'----------------quoted string----------------|#31C4C4}}
    {{Text|IF|#F0F0F0}} c = {{Text|34|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'"|#31C4C4}}
        a2$ = a2$ + sp + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}})
        p1 = i + {{Text|1|#F580B1}}
        {{Text|FOR|#F0F0F0}} i2 = i + {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} n - {{Text|2|#F580B1}}
            c2 = {{Text|ASC|#F0F0F0}}(a$, i2)
            {{Text|IF|#F0F0F0}} c2 = {{Text|34|#F580B1}} {{Text|THEN|#F0F0F0}}
                a2$ = a2$ + {{Text|MID$|#F0F0F0}}(ca$, p1, i2 - p1 + {{Text|1|#F580B1}}) + {{Text|","|#FFB100}} + str2$(i2 - (i + {{Text|1|#F580B1}}))
                i = i2 + {{Text|1|#F580B1}}
                {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} c2 = {{Text|92|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'\|#31C4C4}}
                a2$ = a2$ + {{Text|MID$|#F0F0F0}}(ca$, p1, i2 - p1) + {{Text|"\\"|#FFB100}}
                p1 = i2 + {{Text|1|#F580B1}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} c2 < {{Text|32|#F580B1}} {{Text|OR|#F0F0F0}} c2 > {{Text|126|#F580B1}} {{Text|THEN|#F0F0F0}}
                o$ = {{Text|OCT$|#F0F0F0}}(c2)
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(o$) < {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}}
                    o$ = {{Text|"0"|#FFB100}} + o$
                    {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(o$) < {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} o$ = {{Text|"0"|#FFB100}} + o$
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                a2$ = a2$ + {{Text|MID$|#F0F0F0}}(ca$, p1, i2 - p1) + {{Text|"\"|#FFB100}} + o$
                p1 = i2 + {{Text|1|#F580B1}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|NEXT|#F0F0F0}}
        {{Text|IF|#F0F0F0}} i2 = n - {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'no closing "|#31C4C4}}
            a2$ = a2$ + {{Text|MID$|#F0F0F0}}(ca$, p1, (n - {{Text|2|#F580B1}}) - p1 + {{Text|1|#F580B1}}) + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}}) + {{Text|","|#FFB100}} + str2$((n - {{Text|2|#F580B1}}) - (i + {{Text|1|#F580B1}}) + {{Text|1|#F580B1}})
            i = n - {{Text|1|#F580B1}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|GOTO|#F0F0F0}} lineformatnext
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'----------------number----------------|#31C4C4}}
    firsti = i
    {{Text|IF|#F0F0F0}} c = {{Text|46|#F580B1}} {{Text|THEN|#F0F0F0}}
        c2$ = {{Text|MID$|#F0F0F0}}(a$, i + {{Text|1|#F580B1}}, {{Text|1|#F580B1}}): c2 = {{Text|ASC|#F0F0F0}}(c2$)
        {{Text|IF|#F0F0F0}} (c2 >= {{Text|48|#F580B1}} {{Text|AND|#F0F0F0}} c2 <= {{Text|57|#F580B1}}) {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} lfnumber
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|IF|#F0F0F0}} (c >= {{Text|48|#F580B1}} {{Text|AND|#F0F0F0}} c <= {{Text|57|#F580B1}}) {{Text|THEN|#F0F0F0}} {{Text|'0-9|#31C4C4}}
        lfnumber:
        {{Text|'handle 'IF a=1 THEN a=2 ELSE 100' by assuming numeric after ELSE to be a|#31C4C4}}
        {{Text|IF|#F0F0F0}} {{Text|RIGHT$|#F0F0F0}}(a2$, {{Text|5|#F580B1}}) = sp + {{Text|"ELSE"|#FFB100}} {{Text|THEN|#F0F0F0}}
            a2$ = a2$ + sp + {{Text|"GOTO"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|'Number will be converted to the following format:|#31C4C4}}
        {{Text|' 999999  .        99999  E        +        999|#31C4C4}}
        {{Text|'[whole$][dp(0/1)][frac$][ed(1/2)][pm(1/-1)][ex$]|#31C4C4}}
        {{Text|' 0                1              2        3    <-mode|#31C4C4}}
        mode = {{Text|0|#F580B1}}
        whole$ = {{Text|""|#FFB100}}
        dp = {{Text|0|#F580B1}}
        frac$ = {{Text|""|#FFB100}}
        ed = {{Text|0|#F580B1}} {{Text|'E=1, D=2, F=3|#31C4C4}}
        pm = {{Text|1|#F580B1}}
        ex$ = {{Text|""|#FFB100}}
        lfreadnumber:
        valid = {{Text|0|#F580B1}}
        {{Text|IF|#F0F0F0}} c = {{Text|46|#F580B1}} {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} mode = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} valid = {{Text|1|#F580B1}}: dp = {{Text|1|#F580B1}}: mode = {{Text|1|#F580B1}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} c >= {{Text|48|#F580B1}} {{Text|AND|#F0F0F0}} c <= {{Text|57|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'0-9|#31C4C4}}
            valid = {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} mode = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} whole$ = whole$ + c$
            {{Text|IF|#F0F0F0}} mode = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} frac$ = frac$ + c$
            {{Text|IF|#F0F0F0}} mode = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} mode = {{Text|3|#F580B1}}
            {{Text|IF|#F0F0F0}} mode = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} ex$ = ex$ + c$
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} c = {{Text|69|#F580B1}} {{Text|OR|#F0F0F0}} c = {{Text|68|#F580B1}} {{Text|OR|#F0F0F0}} c = {{Text|70|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'E,D,F|#31C4C4}}
            {{Text|IF|#F0F0F0}} mode < {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                valid = {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} c = {{Text|69|#F580B1}} {{Text|THEN|#F0F0F0}} ed = {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} c = {{Text|68|#F580B1}} {{Text|THEN|#F0F0F0}} ed = {{Text|2|#F580B1}}
                {{Text|IF|#F0F0F0}} c = {{Text|70|#F580B1}} {{Text|THEN|#F0F0F0}} ed = {{Text|3|#F580B1}}
                mode = {{Text|2|#F580B1}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} c = {{Text|43|#F580B1}} {{Text|OR|#F0F0F0}} c = {{Text|45|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'+,-|#31C4C4}}
            {{Text|IF|#F0F0F0}} mode = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                valid = {{Text|1|#F580B1}}
                {{Text|IF|#F0F0F0}} c = {{Text|45|#F580B1}} {{Text|THEN|#F0F0F0}} pm = {{Text|-1|#F580B1}}
                mode = {{Text|3|#F580B1}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} valid {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} i <= n {{Text|THEN|#F0F0F0}} i = i + {{Text|1|#F580B1}}: c$ = {{Text|MID$|#F0F0F0}}(a$, i, {{Text|1|#F580B1}}): c = {{Text|ASC|#F0F0F0}}(c$): {{Text|GOTO|#F0F0F0}} lfreadnumber
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|'cull leading 0s off whole$|#31C4C4}}
        {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(whole$, {{Text|1|#F580B1}}) = {{Text|"0"|#FFB100}}: whole$ = {{Text|RIGHT$|#F0F0F0}}(whole$, {{Text|LEN|#F0F0F0}}(whole$) - {{Text|1|#F580B1}}): {{Text|LOOP|#F0F0F0}}
        {{Text|'cull trailing 0s off frac$|#31C4C4}}
        {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} {{Text|RIGHT$|#F0F0F0}}(frac$, {{Text|1|#F580B1}}) = {{Text|"0"|#FFB100}}: frac$ = {{Text|LEFT$|#F0F0F0}}(frac$, {{Text|LEN|#F0F0F0}}(frac$) - {{Text|1|#F580B1}}): {{Text|LOOP|#F0F0F0}}
        {{Text|'cull leading 0s off ex$|#31C4C4}}
        {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(ex$, {{Text|1|#F580B1}}) = {{Text|"0"|#FFB100}}: ex$ = {{Text|RIGHT$|#F0F0F0}}(ex$, {{Text|LEN|#F0F0F0}}(ex$) - {{Text|1|#F580B1}}): {{Text|LOOP|#F0F0F0}}
        {{Text|IF|#F0F0F0}} dp <> {{Text|0|#F580B1}} {{Text|OR|#F0F0F0}} ed <> {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} float = {{Text|1|#F580B1}} {{Text|ELSE|#F0F0F0}} float = {{Text|0|#F580B1}}
        extused = {{Text|1|#F580B1}}
        {{Text|IF|#F0F0F0}} ed {{Text|THEN|#F0F0F0}} e$ = {{Text|""|#FFB100}}: {{Text|GOTO|#F0F0F0}} lffoundext {{Text|'no extensions valid after E/D/F specified|#31C4C4}}
        {{Text|'3-character extensions|#31C4C4}}
        {{Text|IF|#F0F0F0}} i <= n - {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
            e$ = {{Text|MID$|#F0F0F0}}(a$, i, {{Text|3|#F580B1}})
            {{Text|IF|#F0F0F0}} e$ = {{Text|"~%%"|#FFB100}} {{Text|AND|#F0F0F0}} float = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} i = i + {{Text|3|#F580B1}}: {{Text|GOTO|#F0F0F0}} lffoundext
            {{Text|IF|#F0F0F0}} e$ = {{Text|"~&&"|#FFB100}} {{Text|AND|#F0F0F0}} float = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} i = i + {{Text|3|#F580B1}}: {{Text|GOTO|#F0F0F0}} lffoundext
            {{Text|IF|#F0F0F0}} e$ = {{Text|"~%&"|#FFB100}} {{Text|AND|#F0F0F0}} float = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Cannot use _OFFSET symbols after numbers"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|'2-character extensions|#31C4C4}}
        {{Text|IF|#F0F0F0}} i <= n - {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
            e$ = {{Text|MID$|#F0F0F0}}(a$, i, {{Text|2|#F580B1}})
            {{Text|IF|#F0F0F0}} e$ = {{Text|"%%"|#FFB100}} {{Text|AND|#F0F0F0}} float = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} i = i + {{Text|2|#F580B1}}: {{Text|GOTO|#F0F0F0}} lffoundext
            {{Text|IF|#F0F0F0}} e$ = {{Text|"~%"|#FFB100}} {{Text|AND|#F0F0F0}} float = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} i = i + {{Text|2|#F580B1}}: {{Text|GOTO|#F0F0F0}} lffoundext
            {{Text|IF|#F0F0F0}} e$ = {{Text|"&&"|#FFB100}} {{Text|AND|#F0F0F0}} float = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} i = i + {{Text|2|#F580B1}}: {{Text|GOTO|#F0F0F0}} lffoundext
            {{Text|IF|#F0F0F0}} e$ = {{Text|"~&"|#FFB100}} {{Text|AND|#F0F0F0}} float = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} i = i + {{Text|2|#F580B1}}: {{Text|GOTO|#F0F0F0}} lffoundext
            {{Text|IF|#F0F0F0}} e$ = {{Text|"%&"|#FFB100}} {{Text|AND|#F0F0F0}} float = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Cannot use _OFFSET symbols after numbers"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|IF|#F0F0F0}} e$ = {{Text|"##"|#FFB100}} {{Text|THEN|#F0F0F0}}
                i = i + {{Text|2|#F580B1}}
                ed = {{Text|3|#F580B1}}
                e$ = {{Text|""|#FFB100}}
                {{Text|GOTO|#F0F0F0}} lffoundext
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} e$ = {{Text|"~`"|#FFB100}} {{Text|THEN|#F0F0F0}}
                i = i + {{Text|2|#F580B1}}
                {{Text|GOTO|#F0F0F0}} lffoundbitext
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|'1-character extensions|#31C4C4}}
        {{Text|IF|#F0F0F0}} i <= n {{Text|THEN|#F0F0F0}}
            e$ = {{Text|MID$|#F0F0F0}}(a$, i, {{Text|1|#F580B1}})
            {{Text|IF|#F0F0F0}} e$ = {{Text|"%"|#FFB100}} {{Text|AND|#F0F0F0}} float = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} i = i + {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} lffoundext
            {{Text|IF|#F0F0F0}} e$ = {{Text|"&"|#FFB100}} {{Text|AND|#F0F0F0}} float = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} i = i + {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} lffoundext
            {{Text|IF|#F0F0F0}} e$ = {{Text|"!"|#FFB100}} {{Text|THEN|#F0F0F0}}
                i = i + {{Text|1|#F580B1}}
                ed = {{Text|1|#F580B1}}
                e$ = {{Text|""|#FFB100}}
                {{Text|GOTO|#F0F0F0}} lffoundext
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} e$ = {{Text|"#"|#FFB100}} {{Text|THEN|#F0F0F0}}
                i = i + {{Text|1|#F580B1}}
                ed = {{Text|2|#F580B1}}
                e$ = {{Text|""|#FFB100}}
                {{Text|GOTO|#F0F0F0}} lffoundext
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|IF|#F0F0F0}} e$ = {{Text|"`"|#FFB100}} {{Text|THEN|#F0F0F0}}
                i = i + {{Text|1|#F580B1}}
                lffoundbitext:
                bitn$ = {{Text|""|#FFB100}}
                {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} i <= n
                    c2 = {{Text|ASC|#F0F0F0}}({{Text|MID$|#F0F0F0}}(a$, i, {{Text|1|#F580B1}}))
                    {{Text|IF|#F0F0F0}} c2 >= {{Text|48|#F580B1}} {{Text|AND|#F0F0F0}} c2 <= {{Text|57|#F580B1}} {{Text|THEN|#F0F0F0}}
                        bitn$ = bitn$ + {{Text|CHR$|#F0F0F0}}(c2)
                        i = i + {{Text|1|#F580B1}}
                    {{Text|ELSE|#F0F0F0}}
                        {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|LOOP|#F0F0F0}}
                {{Text|IF|#F0F0F0}} bitn$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} bitn$ = {{Text|"1"|#FFB100}}
                {{Text|'cull leading 0s off bitn$|#31C4C4}}
                {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(bitn$, {{Text|1|#F580B1}}) = {{Text|"0"|#FFB100}}: bitn$ = {{Text|RIGHT$|#F0F0F0}}(bitn$, {{Text|LEN|#F0F0F0}}(bitn$) - {{Text|1|#F580B1}}): {{Text|LOOP|#F0F0F0}}
                e$ = e$ + bitn$
                {{Text|GOTO|#F0F0F0}} lffoundext
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|IF|#F0F0F0}} float {{Text|THEN|#F0F0F0}} {{Text|'floating point types CAN be assumed|#31C4C4}}
            {{Text|'calculate first significant digit offset & number of significant digits|#31C4C4}}
            {{Text|IF|#F0F0F0}} whole$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
                offset = {{Text|LEN|#F0F0F0}}(whole$) - {{Text|1|#F580B1}}
                sigdigits = {{Text|LEN|#F0F0F0}}(whole$) + {{Text|LEN|#F0F0F0}}(frac$)
            {{Text|ELSE|#F0F0F0}}
                {{Text|IF|#F0F0F0}} frac$ <> {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}}
                    offset = {{Text|-1|#F580B1}}
                    sigdigits = {{Text|LEN|#F0F0F0}}(frac$)
                    {{Text|FOR|#F0F0F0}} i2 = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|LEN|#F0F0F0}}(frac$)
                        {{Text|IF|#F0F0F0}} {{Text|MID$|#F0F0F0}}(frac$, i2, {{Text|1|#F580B1}}) <> {{Text|"0"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}}
                        offset = offset - {{Text|1|#F580B1}}
                        sigdigits = sigdigits - {{Text|1|#F580B1}}
                    {{Text|NEXT|#F0F0F0}}
                {{Text|ELSE|#F0F0F0}}
                    {{Text|'number is 0|#31C4C4}}
                    offset = {{Text|0|#F580B1}}
                    sigdigits = {{Text|0|#F580B1}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            sigdig$ = {{Text|RIGHT$|#F0F0F0}}(whole$ + frac$, sigdigits)
            {{Text|'SINGLE?|#31C4C4}}
            {{Text|IF|#F0F0F0}} sigdigits <= {{Text|7|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'QBASIC interprets anything with more than 7 sig. digits as a DOUBLE|#31C4C4}}
                {{Text|IF|#F0F0F0}} offset <= {{Text|38|#F580B1}} {{Text|AND|#F0F0F0}} offset >= {{Text|-38|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'anything outside this range cannot be represented as a SINGLE|#31C4C4}}
                    {{Text|IF|#F0F0F0}} offset = {{Text|38|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} sigdig$ > {{Text|"3402823"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} lfxsingle
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} offset = {{Text|-38|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} sigdig$ < {{Text|"1175494"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} lfxsingle
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    ed = {{Text|1|#F580B1}}
                    e$ = {{Text|""|#FFB100}}
                    {{Text|GOTO|#F0F0F0}} lffoundext
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            lfxsingle:
            {{Text|'DOUBLE?|#31C4C4}}
            {{Text|IF|#F0F0F0}} sigdigits <= {{Text|16|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'QB64 handles DOUBLES with 16-digit precision|#31C4C4}}
                {{Text|IF|#F0F0F0}} offset <= {{Text|308|#F580B1}} {{Text|AND|#F0F0F0}} offset >= {{Text|-308|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'anything outside this range cannot be represented as a DOUBLE|#31C4C4}}
                    {{Text|IF|#F0F0F0}} offset = {{Text|308|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} sigdig$ > {{Text|"1797693134862315"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} lfxdouble
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} offset = {{Text|-308|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} sigdig$ < {{Text|"2225073858507201"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} lfxdouble
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    ed = {{Text|2|#F580B1}}
                    e$ = {{Text|""|#FFB100}}
                    {{Text|GOTO|#F0F0F0}} lffoundext
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            lfxdouble:
            {{Text|'assume _FLOAT|#31C4C4}}
            ed = {{Text|3|#F580B1}}
            e$ = {{Text|""|#FFB100}}: {{Text|GOTO|#F0F0F0}} lffoundext
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        extused = {{Text|0|#F580B1}}
        e$ = {{Text|""|#FFB100}}
        lffoundext:
        {{Text|'make sure a leading numberic character exists|#31C4C4}}
        {{Text|IF|#F0F0F0}} whole$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} whole$ = {{Text|"0"|#FFB100}}
        {{Text|'if a float, ensure frac$<>"" and dp=1|#31C4C4}}
        {{Text|IF|#F0F0F0}} float {{Text|THEN|#F0F0F0}}
            dp = {{Text|1|#F580B1}}
            {{Text|IF|#F0F0F0}} frac$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} frac$ = {{Text|"0"|#FFB100}}
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        {{Text|'if ed is specified, make sure ex$ exists|#31C4C4}}
        {{Text|IF|#F0F0F0}} ed <> {{Text|0|#F580B1}} {{Text|AND|#F0F0F0}} ex$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} ex$ = {{Text|"0"|#FFB100}}
        a2$ = a2$ + sp
        a2$ = a2$ + whole$
        {{Text|IF|#F0F0F0}} dp {{Text|THEN|#F0F0F0}} a2$ = a2$ + {{Text|"."|#FFB100}} + frac$
        {{Text|IF|#F0F0F0}} ed {{Text|THEN|#F0F0F0}}
            {{Text|IF|#F0F0F0}} ed = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} a2$ = a2$ + {{Text|"E"|#FFB100}}
            {{Text|IF|#F0F0F0}} ed = {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}} a2$ = a2$ + {{Text|"D"|#FFB100}}
            {{Text|IF|#F0F0F0}} ed = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}} a2$ = a2$ + {{Text|"F"|#FFB100}}
            {{Text|IF|#F0F0F0}} pm = {{Text|-1|#F580B1}} {{Text|AND|#F0F0F0}} ex$ <> {{Text|"0"|#FFB100}} {{Text|THEN|#F0F0F0}} a2$ = a2$ + {{Text|"-"|#FFB100}} {{Text|ELSE|#F0F0F0}} a2$ = a2$ + {{Text|"+"|#FFB100}}
            a2$ = a2$ + ex$
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
        a2$ = a2$ + e$
        {{Text|IF|#F0F0F0}} extused {{Text|THEN|#F0F0F0}} a2$ = a2$ + {{Text|","|#FFB100}} + {{Text|MID$|#F0F0F0}}(a$, firsti, i - firsti)
        {{Text|GOTO|#F0F0F0}} lineformatnext
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'----------------(number)&H...----------------|#31C4C4}}
    {{Text|'note: the final value, not the number of hex characters, sets the default type|#31C4C4}}
    {{Text|IF|#F0F0F0}} c = {{Text|38|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'&|#31C4C4}}
        {{Text|IF|#F0F0F0}} {{Text|MID$|#F0F0F0}}(a$, i + {{Text|1|#F580B1}}, {{Text|1|#F580B1}}) = {{Text|"H"|#FFB100}} {{Text|THEN|#F0F0F0}}
            i = i + {{Text|2|#F580B1}}
            hx$ = {{Text|""|#FFB100}}
            lfreadhex:
            {{Text|IF|#F0F0F0}} i <= n {{Text|THEN|#F0F0F0}}
                c$ = {{Text|MID$|#F0F0F0}}(a$, i, {{Text|1|#F580B1}}): c = {{Text|ASC|#F0F0F0}}(c$)
                {{Text|IF|#F0F0F0}} (c >= {{Text|48|#F580B1}} {{Text|AND|#F0F0F0}} c <= {{Text|57|#F580B1}}) {{Text|OR|#F0F0F0}} (c >= {{Text|65|#F580B1}} {{Text|AND|#F0F0F0}} c <= {{Text|70|#F580B1}}) {{Text|THEN|#F0F0F0}} hx$ = hx$ + c$: i = i + {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} lfreadhex
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            fullhx$ = {{Text|"&H"|#FFB100}} + hx$
            {{Text|'cull leading 0s off hx$|#31C4C4}}
            {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(hx$, {{Text|1|#F580B1}}) = {{Text|"0"|#FFB100}}: hx$ = {{Text|RIGHT$|#F0F0F0}}(hx$, {{Text|LEN|#F0F0F0}}(hx$) - {{Text|1|#F580B1}}): {{Text|LOOP|#F0F0F0}}
            {{Text|IF|#F0F0F0}} hx$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} hx$ = {{Text|"0"|#FFB100}}
            bitn$ = {{Text|""|#FFB100}}
            {{Text|'3-character extensions|#31C4C4}}
            {{Text|IF|#F0F0F0}} i <= n - {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                e$ = {{Text|MID$|#F0F0F0}}(a$, i, {{Text|3|#F580B1}})
                {{Text|IF|#F0F0F0}} e$ = {{Text|"~%%"|#FFB100}} {{Text|THEN|#F0F0F0}} i = i + {{Text|3|#F580B1}}: {{Text|GOTO|#F0F0F0}} lfhxext
                {{Text|IF|#F0F0F0}} e$ = {{Text|"~&&"|#FFB100}} {{Text|THEN|#F0F0F0}} i = i + {{Text|3|#F580B1}}: {{Text|GOTO|#F0F0F0}} lfhxext
                {{Text|IF|#F0F0F0}} e$ = {{Text|"~%&"|#FFB100}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Cannot use _OFFSET symbols after numbers"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'2-character extensions|#31C4C4}}
            {{Text|IF|#F0F0F0}} i <= n - {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                e$ = {{Text|MID$|#F0F0F0}}(a$, i, {{Text|2|#F580B1}})
                {{Text|IF|#F0F0F0}} e$ = {{Text|"%%"|#FFB100}} {{Text|THEN|#F0F0F0}} i = i + {{Text|2|#F580B1}}: {{Text|GOTO|#F0F0F0}} lfhxext
                {{Text|IF|#F0F0F0}} e$ = {{Text|"~%"|#FFB100}} {{Text|THEN|#F0F0F0}} i = i + {{Text|2|#F580B1}}: {{Text|GOTO|#F0F0F0}} lfhxext
                {{Text|IF|#F0F0F0}} e$ = {{Text|"&&"|#FFB100}} {{Text|THEN|#F0F0F0}} i = i + {{Text|2|#F580B1}}: {{Text|GOTO|#F0F0F0}} lfhxext
                {{Text|IF|#F0F0F0}} e$ = {{Text|"%&"|#FFB100}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Cannot use _OFFSET symbols after numbers"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|IF|#F0F0F0}} e$ = {{Text|"~&"|#FFB100}} {{Text|THEN|#F0F0F0}} i = i + {{Text|2|#F580B1}}: {{Text|GOTO|#F0F0F0}} lfhxext
                {{Text|IF|#F0F0F0}} e$ = {{Text|"~`"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    i = i + {{Text|2|#F580B1}}
                    {{Text|GOTO|#F0F0F0}} lfhxbitext
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'1-character extensions|#31C4C4}}
            {{Text|IF|#F0F0F0}} i <= n {{Text|THEN|#F0F0F0}}
                e$ = {{Text|MID$|#F0F0F0}}(a$, i, {{Text|1|#F580B1}})
                {{Text|IF|#F0F0F0}} e$ = {{Text|"%"|#FFB100}} {{Text|THEN|#F0F0F0}} i = i + {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} lfhxext
                {{Text|IF|#F0F0F0}} e$ = {{Text|"&"|#FFB100}} {{Text|THEN|#F0F0F0}} i = i + {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} lfhxext
                {{Text|IF|#F0F0F0}} e$ = {{Text|"`"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    i = i + {{Text|1|#F580B1}}
                    lfhxbitext:
                    {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} i <= n
                        c2 = {{Text|ASC|#F0F0F0}}({{Text|MID$|#F0F0F0}}(a$, i, {{Text|1|#F580B1}}))
                        {{Text|IF|#F0F0F0}} c2 >= {{Text|48|#F580B1}} {{Text|AND|#F0F0F0}} c2 <= {{Text|57|#F580B1}} {{Text|THEN|#F0F0F0}}
                            bitn$ = bitn$ + {{Text|CHR$|#F0F0F0}}(c2)
                            i = i + {{Text|1|#F580B1}}
                        {{Text|ELSE|#F0F0F0}}
                            {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|LOOP|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} bitn$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} bitn$ = {{Text|"1"|#FFB100}}
                    {{Text|'cull leading 0s off bitn$|#31C4C4}}
                    {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(bitn$, {{Text|1|#F580B1}}) = {{Text|"0"|#FFB100}}: bitn$ = {{Text|RIGHT$|#F0F0F0}}(bitn$, {{Text|LEN|#F0F0F0}}(bitn$) - {{Text|1|#F580B1}}): {{Text|LOOP|#F0F0F0}}
                    {{Text|GOTO|#F0F0F0}} lfhxext
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'if no valid extension context was given, assume one|#31C4C4}}
            {{Text|'note: leading 0s have been culled, so LEN(hx$) reflects its values size|#31C4C4}}
            e$ = {{Text|"&&"|#FFB100}}
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(hx$) <= {{Text|8|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"&"|#FFB100}} {{Text|'as in QBASIC, signed values must be used|#31C4C4}}
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(hx$) <= {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"%"|#FFB100}} {{Text|'as in QBASIC, signed values must be used|#31C4C4}}
            {{Text|GOTO|#F0F0F0}} lfhxext2
            lfhxext:
            fullhx$ = fullhx$ + e$ + bitn$
            lfhxext2:
            {{Text|'build 8-byte unsigned integer rep. of hx$|#31C4C4}}
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(hx$) > {{Text|16|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Overflow"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            v~&& = {{Text|0|#F580B1}}
            {{Text|FOR|#F0F0F0}} i2 = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|LEN|#F0F0F0}}(hx$)
                v2 = {{Text|ASC|#F0F0F0}}({{Text|MID$|#F0F0F0}}(hx$, i2, {{Text|1|#F580B1}}))
                {{Text|IF|#F0F0F0}} v2 <= {{Text|57|#F580B1}} {{Text|THEN|#F0F0F0}} v2 = v2 - {{Text|48|#F580B1}} {{Text|ELSE|#F0F0F0}} v2 = v2 - {{Text|65|#F580B1}} + {{Text|10|#F580B1}}
                v~&& = v~&& * {{Text|16|#F580B1}} + v2
            {{Text|NEXT|#F0F0F0}}
            finishhexoctbin:
            num$ = str2u64$(v~&&) {{Text|'correct for unsigned values (overflow of unsigned can be checked later)|#31C4C4}}
            {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(e$, {{Text|1|#F580B1}}) <> {{Text|"~"|#FFB100}} {{Text|THEN|#F0F0F0}} {{Text|'note: range checking will be performed later in fixop.order|#31C4C4}}
                {{Text|'signed|#31C4C4}}
                {{Text|IF|#F0F0F0}} e$ = {{Text|"%%"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} v~&& > {{Text|127|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} v~&& > {{Text|255|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Overflow"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        v~&& = (({{Text|NOT|#F0F0F0}} v~&&) {{Text|AND|#F0F0F0}} {{Text|255|#F580B1}}) + {{Text|1|#F580B1}}
                        num$ = {{Text|"-"|#FFB100}} + sp + str2u64$(v~&&)
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} e$ = {{Text|"%"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} v~&& > {{Text|32767|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} v~&& > {{Text|65535|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Overflow"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        v~&& = (({{Text|NOT|#F0F0F0}} v~&&) {{Text|AND|#F0F0F0}} {{Text|65535|#F580B1}}) + {{Text|1|#F580B1}}
                        num$ = {{Text|"-"|#FFB100}} + sp + str2u64$(v~&&)
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} e$ = {{Text|"&"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} v~&& > {{Text|2147483647|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} v~&& > {{Text|4294967295|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Overflow"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        v~&& = (({{Text|NOT|#F0F0F0}} v~&&) {{Text|AND|#F0F0F0}} {{Text|4294967295|#F580B1}}) + {{Text|1|#F580B1}}
                        num$ = {{Text|"-"|#FFB100}} + sp + str2u64$(v~&&)
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} e$ = {{Text|"&&"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} v~&& > {{Text|9223372036854775807|#F580B1}} {{Text|THEN|#F0F0F0}}
                        {{Text|'note: no error checking necessary|#31C4C4}}
                        v~&& = ({{Text|NOT|#F0F0F0}} v~&&) + {{Text|1|#F580B1}}
                        num$ = {{Text|"-"|#FFB100}} + sp + str2u64$(v~&&)
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|IF|#F0F0F0}} e$ = {{Text|"`"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    vbitn = {{Text|VAL|#F0F0F0}}(bitn$)
                    h~&& = {{Text|1|#F580B1}}: {{Text|FOR|#F0F0F0}} i2 = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} vbitn - {{Text|1|#F580B1}}: h~&& = h~&& * {{Text|2|#F580B1}}: {{Text|NEXT|#F0F0F0}}: h~&& = h~&& - {{Text|1|#F580B1}} {{Text|'build h~&&|#31C4C4}}
                    {{Text|IF|#F0F0F0}} v~&& > h~&& {{Text|THEN|#F0F0F0}}
                        h~&& = {{Text|1|#F580B1}}: {{Text|FOR|#F0F0F0}} i2 = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} vbitn: h~&& = h~&& * {{Text|2|#F580B1}}: {{Text|NEXT|#F0F0F0}}: h~&& = h~&& - {{Text|1|#F580B1}} {{Text|'build h~&&|#31C4C4}}
                        {{Text|IF|#F0F0F0}} v~&& > h~&& {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Overflow"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        v~&& = (({{Text|NOT|#F0F0F0}} v~&&) {{Text|AND|#F0F0F0}} h~&&) + {{Text|1|#F580B1}}
                        num$ = {{Text|"-"|#FFB100}} + sp + str2u64$(v~&&)
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'<>"~"|#31C4C4}}
            a2$ = a2$ + sp + num$ + e$ + bitn$ + {{Text|","|#FFB100}} + fullhx$
            {{Text|GOTO|#F0F0F0}} lineformatnext
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'----------------(number)&O...----------------|#31C4C4}}
    {{Text|'note: the final value, not the number of oct characters, sets the default type|#31C4C4}}
    {{Text|IF|#F0F0F0}} c = {{Text|38|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'&|#31C4C4}}
        {{Text|IF|#F0F0F0}} {{Text|MID$|#F0F0F0}}(a$, i + {{Text|1|#F580B1}}, {{Text|1|#F580B1}}) = {{Text|"O"|#FFB100}} {{Text|THEN|#F0F0F0}}
            i = i + {{Text|2|#F580B1}}
            {{Text|'note: to avoid mistakes, hx$ is used instead of 'ot$'|#31C4C4}}
            hx$ = {{Text|""|#FFB100}}
            lfreadoct:
            {{Text|IF|#F0F0F0}} i <= n {{Text|THEN|#F0F0F0}}
                c$ = {{Text|MID$|#F0F0F0}}(a$, i, {{Text|1|#F580B1}}): c = {{Text|ASC|#F0F0F0}}(c$)
                {{Text|IF|#F0F0F0}} c >= {{Text|48|#F580B1}} {{Text|AND|#F0F0F0}} c <= {{Text|55|#F580B1}} {{Text|THEN|#F0F0F0}} hx$ = hx$ + c$: i = i + {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} lfreadoct
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            fullhx$ = {{Text|"&O"|#FFB100}} + hx$
            {{Text|'cull leading 0s off hx$|#31C4C4}}
            {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(hx$, {{Text|1|#F580B1}}) = {{Text|"0"|#FFB100}}: hx$ = {{Text|RIGHT$|#F0F0F0}}(hx$, {{Text|LEN|#F0F0F0}}(hx$) - {{Text|1|#F580B1}}): {{Text|LOOP|#F0F0F0}}
            {{Text|IF|#F0F0F0}} hx$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} hx$ = {{Text|"0"|#FFB100}}
            bitn$ = {{Text|""|#FFB100}}
            {{Text|'3-character extensions|#31C4C4}}
            {{Text|IF|#F0F0F0}} i <= n - {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                e$ = {{Text|MID$|#F0F0F0}}(a$, i, {{Text|3|#F580B1}})
                {{Text|IF|#F0F0F0}} e$ = {{Text|"~%%"|#FFB100}} {{Text|THEN|#F0F0F0}} i = i + {{Text|3|#F580B1}}: {{Text|GOTO|#F0F0F0}} lfotext
                {{Text|IF|#F0F0F0}} e$ = {{Text|"~&&"|#FFB100}} {{Text|THEN|#F0F0F0}} i = i + {{Text|3|#F580B1}}: {{Text|GOTO|#F0F0F0}} lfotext
                {{Text|IF|#F0F0F0}} e$ = {{Text|"~%&"|#FFB100}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Cannot use _OFFSET symbols after numbers"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'2-character extensions|#31C4C4}}
            {{Text|IF|#F0F0F0}} i <= n - {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                e$ = {{Text|MID$|#F0F0F0}}(a$, i, {{Text|2|#F580B1}})
                {{Text|IF|#F0F0F0}} e$ = {{Text|"%%"|#FFB100}} {{Text|THEN|#F0F0F0}} i = i + {{Text|2|#F580B1}}: {{Text|GOTO|#F0F0F0}} lfotext
                {{Text|IF|#F0F0F0}} e$ = {{Text|"~%"|#FFB100}} {{Text|THEN|#F0F0F0}} i = i + {{Text|2|#F580B1}}: {{Text|GOTO|#F0F0F0}} lfotext
                {{Text|IF|#F0F0F0}} e$ = {{Text|"&&"|#FFB100}} {{Text|THEN|#F0F0F0}} i = i + {{Text|2|#F580B1}}: {{Text|GOTO|#F0F0F0}} lfotext
                {{Text|IF|#F0F0F0}} e$ = {{Text|"%&"|#FFB100}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Cannot use _OFFSET symbols after numbers"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|IF|#F0F0F0}} e$ = {{Text|"~&"|#FFB100}} {{Text|THEN|#F0F0F0}} i = i + {{Text|2|#F580B1}}: {{Text|GOTO|#F0F0F0}} lfotext
                {{Text|IF|#F0F0F0}} e$ = {{Text|"~`"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    i = i + {{Text|2|#F580B1}}
                    {{Text|GOTO|#F0F0F0}} lfotbitext
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'1-character extensions|#31C4C4}}
            {{Text|IF|#F0F0F0}} i <= n {{Text|THEN|#F0F0F0}}
                e$ = {{Text|MID$|#F0F0F0}}(a$, i, {{Text|1|#F580B1}})
                {{Text|IF|#F0F0F0}} e$ = {{Text|"%"|#FFB100}} {{Text|THEN|#F0F0F0}} i = i + {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} lfotext
                {{Text|IF|#F0F0F0}} e$ = {{Text|"&"|#FFB100}} {{Text|THEN|#F0F0F0}} i = i + {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} lfotext
                {{Text|IF|#F0F0F0}} e$ = {{Text|"`"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    i = i + {{Text|1|#F580B1}}
                    lfotbitext:
                    bitn$ = {{Text|""|#FFB100}}
                    {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} i <= n
                        c2 = {{Text|ASC|#F0F0F0}}({{Text|MID$|#F0F0F0}}(a$, i, {{Text|1|#F580B1}}))
                        {{Text|IF|#F0F0F0}} c2 >= {{Text|48|#F580B1}} {{Text|AND|#F0F0F0}} c2 <= {{Text|57|#F580B1}} {{Text|THEN|#F0F0F0}}
                            bitn$ = bitn$ + {{Text|CHR$|#F0F0F0}}(c2)
                            i = i + {{Text|1|#F580B1}}
                        {{Text|ELSE|#F0F0F0}}
                            {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|LOOP|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} bitn$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} bitn$ = {{Text|"1"|#FFB100}}
                    {{Text|'cull leading 0s off bitn$|#31C4C4}}
                    {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(bitn$, {{Text|1|#F580B1}}) = {{Text|"0"|#FFB100}}: bitn$ = {{Text|RIGHT$|#F0F0F0}}(bitn$, {{Text|LEN|#F0F0F0}}(bitn$) - {{Text|1|#F580B1}}): {{Text|LOOP|#F0F0F0}}
                    {{Text|GOTO|#F0F0F0}} lfotext
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'if no valid extension context was given, assume one|#31C4C4}}
            {{Text|'note: leading 0s have been culled, so LEN(hx$) reflects its values size|#31C4C4}}
            e$ = {{Text|"&&"|#FFB100}}
            {{Text|'37777777777|#31C4C4}}
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(hx$) <= {{Text|11|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(hx$) < {{Text|11|#F580B1}} {{Text|OR|#F0F0F0}} {{Text|ASC|#F0F0F0}}({{Text|LEFT$|#F0F0F0}}(hx$, {{Text|1|#F580B1}})) <= {{Text|51|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"&"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'177777|#31C4C4}}
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(hx$) <= {{Text|6|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(hx$) < {{Text|6|#F580B1}} {{Text|OR|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(hx$, {{Text|1|#F580B1}}) = {{Text|"1"|#FFB100}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"%"|#FFB100}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|GOTO|#F0F0F0}} lfotext2
            lfotext:
            fullhx$ = fullhx$ + e$ + bitn$
            lfotext2:
            {{Text|'build 8-byte unsigned integer rep. of hx$|#31C4C4}}
            {{Text|'1777777777777777777777 (22 digits)|#31C4C4}}
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(hx$) > {{Text|22|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Overflow"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(hx$) = {{Text|22|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(hx$, {{Text|1|#F580B1}}) <> {{Text|"1"|#FFB100}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Overflow"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'********change v& to v~&&********|#31C4C4}}
            v~&& = {{Text|0|#F580B1}}
            {{Text|FOR|#F0F0F0}} i2 = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|LEN|#F0F0F0}}(hx$)
                v2 = {{Text|ASC|#F0F0F0}}({{Text|MID$|#F0F0F0}}(hx$, i2, {{Text|1|#F580B1}}))
                v2 = v2 - {{Text|48|#F580B1}}
                v~&& = v~&& * {{Text|8|#F580B1}} + v2
            {{Text|NEXT|#F0F0F0}}
            {{Text|GOTO|#F0F0F0}} finishhexoctbin
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'----------------(number)&B...----------------|#31C4C4}}
    {{Text|'note: the final value, not the number of bin characters, sets the default type|#31C4C4}}
    {{Text|IF|#F0F0F0}} c = {{Text|38|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'&|#31C4C4}}
        {{Text|IF|#F0F0F0}} {{Text|MID$|#F0F0F0}}(a$, i + {{Text|1|#F580B1}}, {{Text|1|#F580B1}}) = {{Text|"B"|#FFB100}} {{Text|THEN|#F0F0F0}}
            i = i + {{Text|2|#F580B1}}
            {{Text|'note: to avoid mistakes, hx$ is used instead of 'bi$'|#31C4C4}}
            hx$ = {{Text|""|#FFB100}}
            lfreadbin:
            {{Text|IF|#F0F0F0}} i <= n {{Text|THEN|#F0F0F0}}
                c$ = {{Text|MID$|#F0F0F0}}(a$, i, {{Text|1|#F580B1}}): c = {{Text|ASC|#F0F0F0}}(c$)
                {{Text|IF|#F0F0F0}} c >= {{Text|48|#F580B1}} {{Text|AND|#F0F0F0}} c <= {{Text|49|#F580B1}} {{Text|THEN|#F0F0F0}} hx$ = hx$ + c$: i = i + {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} lfreadbin
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            fullhx$ = {{Text|"&B"|#FFB100}} + hx$
            {{Text|'cull leading 0s off hx$|#31C4C4}}
            {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(hx$, {{Text|1|#F580B1}}) = {{Text|"0"|#FFB100}}: hx$ = {{Text|RIGHT$|#F0F0F0}}(hx$, {{Text|LEN|#F0F0F0}}(hx$) - {{Text|1|#F580B1}}): {{Text|LOOP|#F0F0F0}}
            {{Text|IF|#F0F0F0}} hx$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} hx$ = {{Text|"0"|#FFB100}}
            bitn$ = {{Text|""|#FFB100}}
            {{Text|'3-character extensions|#31C4C4}}
            {{Text|IF|#F0F0F0}} i <= n - {{Text|2|#F580B1}} {{Text|THEN|#F0F0F0}}
                e$ = {{Text|MID$|#F0F0F0}}(a$, i, {{Text|3|#F580B1}})
                {{Text|IF|#F0F0F0}} e$ = {{Text|"~%%"|#FFB100}} {{Text|THEN|#F0F0F0}} i = i + {{Text|3|#F580B1}}: {{Text|GOTO|#F0F0F0}} lfbiext
                {{Text|IF|#F0F0F0}} e$ = {{Text|"~&&"|#FFB100}} {{Text|THEN|#F0F0F0}} i = i + {{Text|3|#F580B1}}: {{Text|GOTO|#F0F0F0}} lfbiext
                {{Text|IF|#F0F0F0}} e$ = {{Text|"~%&"|#FFB100}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Cannot use _OFFSET symbols after numbers"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'2-character extensions|#31C4C4}}
            {{Text|IF|#F0F0F0}} i <= n - {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                e$ = {{Text|MID$|#F0F0F0}}(a$, i, {{Text|2|#F580B1}})
                {{Text|IF|#F0F0F0}} e$ = {{Text|"%%"|#FFB100}} {{Text|THEN|#F0F0F0}} i = i + {{Text|2|#F580B1}}: {{Text|GOTO|#F0F0F0}} lfbiext
                {{Text|IF|#F0F0F0}} e$ = {{Text|"~%"|#FFB100}} {{Text|THEN|#F0F0F0}} i = i + {{Text|2|#F580B1}}: {{Text|GOTO|#F0F0F0}} lfbiext
                {{Text|IF|#F0F0F0}} e$ = {{Text|"&&"|#FFB100}} {{Text|THEN|#F0F0F0}} i = i + {{Text|2|#F580B1}}: {{Text|GOTO|#F0F0F0}} lfbiext
                {{Text|IF|#F0F0F0}} e$ = {{Text|"%&"|#FFB100}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Cannot use _OFFSET symbols after numbers"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                {{Text|IF|#F0F0F0}} e$ = {{Text|"~&"|#FFB100}} {{Text|THEN|#F0F0F0}} i = i + {{Text|2|#F580B1}}: {{Text|GOTO|#F0F0F0}} lfbiext
                {{Text|IF|#F0F0F0}} e$ = {{Text|"~`"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    i = i + {{Text|2|#F580B1}}
                    {{Text|GOTO|#F0F0F0}} lfbibitext
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'1-character extensions|#31C4C4}}
            {{Text|IF|#F0F0F0}} i <= n {{Text|THEN|#F0F0F0}}
                e$ = {{Text|MID$|#F0F0F0}}(a$, i, {{Text|1|#F580B1}})
                {{Text|IF|#F0F0F0}} e$ = {{Text|"%"|#FFB100}} {{Text|THEN|#F0F0F0}} i = i + {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} lfbiext
                {{Text|IF|#F0F0F0}} e$ = {{Text|"&"|#FFB100}} {{Text|THEN|#F0F0F0}} i = i + {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} lfbiext
                {{Text|IF|#F0F0F0}} e$ = {{Text|"`"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    i = i + {{Text|1|#F580B1}}
                    lfbibitext:
                    bitn$ = {{Text|""|#FFB100}}
                    {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} i <= n
                        c2 = {{Text|ASC|#F0F0F0}}({{Text|MID$|#F0F0F0}}(a$, i, {{Text|1|#F580B1}}))
                        {{Text|IF|#F0F0F0}} c2 >= {{Text|48|#F580B1}} {{Text|AND|#F0F0F0}} c2 <= {{Text|57|#F580B1}} {{Text|THEN|#F0F0F0}}
                            bitn$ = bitn$ + {{Text|CHR$|#F0F0F0}}(c2)
                            i = i + {{Text|1|#F580B1}}
                        {{Text|ELSE|#F0F0F0}}
                            {{Text|EXIT|#F0F0F0}} {{Text|DO|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|LOOP|#F0F0F0}}
                    {{Text|IF|#F0F0F0}} bitn$ = {{Text|""|#FFB100}} {{Text|THEN|#F0F0F0}} bitn$ = {{Text|"1"|#FFB100}}
                    {{Text|'cull leading 0s off bitn$|#31C4C4}}
                    {{Text|DO|#F0F0F0}} {{Text|WHILE|#F0F0F0}} {{Text|LEFT$|#F0F0F0}}(bitn$, {{Text|1|#F580B1}}) = {{Text|"0"|#FFB100}}: bitn$ = {{Text|RIGHT$|#F0F0F0}}(bitn$, {{Text|LEN|#F0F0F0}}(bitn$) - {{Text|1|#F580B1}}): {{Text|LOOP|#F0F0F0}}
                    {{Text|GOTO|#F0F0F0}} lfbiext
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'if no valid extension context was given, assume one|#31C4C4}}
            {{Text|'note: leading 0s have been culled, so LEN(hx$) reflects its values size|#31C4C4}}
            e$ = {{Text|"&&"|#FFB100}}
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(hx$) <= {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"&"|#FFB100}}
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(hx$) <= {{Text|16|#F580B1}} {{Text|THEN|#F0F0F0}} e$ = {{Text|"%"|#FFB100}}
            {{Text|GOTO|#F0F0F0}} lfbiext2
            lfbiext:
            fullhx$ = fullhx$ + e$ + bitn$
            lfbiext2:
            {{Text|'build 8-byte unsigned integer rep. of hx$|#31C4C4}}
            {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(hx$) > {{Text|64|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Overflow"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            v~&& = {{Text|0|#F580B1}}
            {{Text|FOR|#F0F0F0}} i2 = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|LEN|#F0F0F0}}(hx$)
                v2 = {{Text|ASC|#F0F0F0}}({{Text|MID$|#F0F0F0}}(hx$, i2, {{Text|1|#F580B1}}))
                v2 = v2 - {{Text|48|#F580B1}}
                v~&& = v~&& * {{Text|2|#F580B1}} + v2
            {{Text|NEXT|#F0F0F0}}
            {{Text|GOTO|#F0F0F0}} finishhexoctbin
        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
    {{Text|'----------------(number)&H??? error----------------|#31C4C4}}
    {{Text|IF|#F0F0F0}} c = {{Text|38|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected &H... or &O..."|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
    {{Text|'----------------variable/name----------------|#31C4C4}}
    {{Text|'*trailing _ is treated as a seperate line extension*|#31C4C4}}
    {{Text|IF|#F0F0F0}} (c >= {{Text|65|#F580B1}} {{Text|AND|#F0F0F0}} c <= {{Text|90|#F580B1}}) {{Text|OR|#F0F0F0}} c = {{Text|95|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'A-Z(a-z) or _|#31C4C4}}
        {{Text|IF|#F0F0F0}} c = {{Text|95|#F580B1}} {{Text|THEN|#F0F0F0}} p2 = {{Text|0|#F580B1}} {{Text|ELSE|#F0F0F0}} p2 = i
        {{Text|FOR|#F0F0F0}} i2 = i + {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} n
            c2 = {{Text|ASC|#F0F0F0}}(a$, i2)
            {{Text|IF|#F0F0F0}} {{Text|NOT|#F0F0F0}} alphanumeric(c2) {{Text|THEN|#F0F0F0}} {{Text|EXIT|#F0F0F0}} {{Text|FOR|#F0F0F0}}
            {{Text|IF|#F0F0F0}} c2 <> {{Text|95|#F580B1}} {{Text|THEN|#F0F0F0}} p2 = i2
        {{Text|NEXT|#F0F0F0}}
        {{Text|IF|#F0F0F0}} p2 {{Text|THEN|#F0F0F0}} {{Text|'not just underscores!|#31C4C4}}
            {{Text|'char is from i to p2|#31C4C4}}
            n2 = p2 - i + {{Text|1|#F580B1}}
            a3$ = {{Text|MID$|#F0F0F0}}(a$, i, n2)
            {{Text|'----(variable/name)rem----|#31C4C4}}
            {{Text|IF|#F0F0F0}} n2 = {{Text|3|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} a3$ = {{Text|"REM"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    i = i + n2
                    {{Text|IF|#F0F0F0}} i < n {{Text|THEN|#F0F0F0}}
                        c = {{Text|ASC|#F0F0F0}}(a$, i)
                        {{Text|IF|#F0F0F0}} c = {{Text|46|#F580B1}} {{Text|THEN|#F0F0F0}} a2$ = a2$ + sp + {{Text|MID$|#F0F0F0}}(ca$, i - n2, n2): {{Text|GOTO|#F0F0F0}} extcheck {{Text|'rem.Variable is a valid variable name in QB45|#31C4C4}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    {{Text|'note: In QBASIC 'IF cond THEN REM comment' counts as a single line IF statement, however use of ' instead of REM does not|#31C4C4}}
                    {{Text|IF|#F0F0F0}} {{Text|UCASE$|#F0F0F0}}({{Text|RIGHT$|#F0F0F0}}(a2$, {{Text|5|#F580B1}})) = sp + {{Text|"THEN"|#FFB100}} {{Text|THEN|#F0F0F0}} a2$ = a2$ + sp + {{Text|"'"|#FFB100}} {{Text|'add nop|#31C4C4}}
                    layoutcomment = SCase$({{Text|"Rem"|#FFB100}})
                    {{Text|GOTO|#F0F0F0}} comment
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|'----(variable/name)data----|#31C4C4}}
            {{Text|IF|#F0F0F0}} n2 = {{Text|4|#F580B1}} {{Text|THEN|#F0F0F0}}
                {{Text|IF|#F0F0F0}} a3$ = {{Text|"DATA"|#FFB100}} {{Text|THEN|#F0F0F0}}
                    x$ = {{Text|""|#FFB100}}
                    i = i + n2
                    {{Text|IF|#F0F0F0}} i < n {{Text|THEN|#F0F0F0}}
                        c = {{Text|ASC|#F0F0F0}}(a$, i)
                        {{Text|IF|#F0F0F0}} c = {{Text|46|#F580B1}} {{Text|THEN|#F0F0F0}} a2$ = a2$ + sp + {{Text|MID$|#F0F0F0}}(ca$, i - n2, n2): {{Text|GOTO|#F0F0F0}} extcheck {{Text|'data.Variable is a valid variable name in QB45|#31C4C4}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    scan = {{Text|0|#F580B1}}
                    speechmarks = {{Text|0|#F580B1}}
                    commanext = {{Text|0|#F580B1}}
                    finaldata = {{Text|0|#F580B1}}
                    e$ = {{Text|""|#FFB100}}
                    p1 = {{Text|0|#F580B1}}
                    p2 = {{Text|0|#F580B1}}
                    nextdatachr:
                    {{Text|IF|#F0F0F0}} i < n {{Text|THEN|#F0F0F0}}
                        c = {{Text|ASC|#F0F0F0}}(a$, i)
                        {{Text|IF|#F0F0F0}} c = {{Text|9|#F580B1}} {{Text|OR|#F0F0F0}} c = {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} scan = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} skipwhitespace
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} c = {{Text|58|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'":"|#31C4C4}}
                            {{Text|IF|#F0F0F0}} speechmarks = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} finaldata = {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} adddata
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} c = {{Text|44|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'","|#31C4C4}}
                            {{Text|IF|#F0F0F0}} speechmarks = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                adddata:
                                {{Text|IF|#F0F0F0}} prepass = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                                    {{Text|IF|#F0F0F0}} p1 {{Text|THEN|#F0F0F0}}
                                        {{Text|'FOR i2 = p1 TO p2|#31C4C4}}
                                        {{Text|'    DATA_add ASC(ca$, i2)|#31C4C4}}
                                        {{Text|'NEXT|#31C4C4}}
                                        x$ = x$ + {{Text|MID$|#F0F0F0}}(ca$, p1, p2 - p1 + {{Text|1|#F580B1}})
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|'assume closing "|#31C4C4}}
                                    {{Text|IF|#F0F0F0}} speechmarks {{Text|THEN|#F0F0F0}}
                                        {{Text|'DATA_add 34|#31C4C4}}
                                        x$ = x$ + {{Text|CHR$|#F0F0F0}}({{Text|34|#F580B1}})
                                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                    {{Text|'append comma|#31C4C4}}
                                    {{Text|'DATA_add 44|#31C4C4}}
                                    x$ = x$ + {{Text|CHR$|#F0F0F0}}({{Text|44|#F580B1}})
                                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                                {{Text|IF|#F0F0F0}} finaldata = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|GOTO|#F0F0F0}} finisheddata
                                e$ = {{Text|""|#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}}
                                {{Text|GOTO|#F0F0F0}} nextdatachr
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'","|#31C4C4}}
                        {{Text|IF|#F0F0F0}} commanext = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} c <> {{Text|32|#F580B1}} {{Text|AND|#F0F0F0}} c <> {{Text|9|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Expected , after quoted string in DATA statement"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        {{Text|IF|#F0F0F0}} c = {{Text|34|#F580B1}} {{Text|THEN|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} speechmarks = {{Text|1|#F580B1}} {{Text|THEN|#F0F0F0}}
                                commanext = {{Text|1|#F580B1}}
                                speechmarks = {{Text|0|#F580B1}}
                            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                            {{Text|IF|#F0F0F0}} scan = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} speechmarks = {{Text|1|#F580B1}}
                        {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                        scan = {{Text|1|#F580B1}}
                        {{Text|IF|#F0F0F0}} p1 = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}} p1 = i: p2 = i
                        {{Text|IF|#F0F0F0}} c <> {{Text|9|#F580B1}} {{Text|AND|#F0F0F0}} c <> {{Text|32|#F580B1}} {{Text|THEN|#F0F0F0}} p2 = i
                        skipwhitespace:
                        i = i + {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} nextdatachr
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}} {{Text|'i<n|#31C4C4}}
                    finaldata = {{Text|1|#F580B1}}: {{Text|GOTO|#F0F0F0}} adddata
                    finisheddata:
                    e$ = {{Text|""|#FFB100}}
                    {{Text|IF|#F0F0F0}} prepass = {{Text|0|#F580B1}} {{Text|THEN|#F0F0F0}}
                        WriteBufRawData DataBinBuf, x$
                        DataOffset = DataOffset + {{Text|LEN|#F0F0F0}}(x$)
                        e$ = {{Text|SPACE$|#F0F0F0}}(({{Text|LEN|#F0F0F0}}(x$) - {{Text|1|#F580B1}}) * {{Text|2|#F580B1}})
                        {{Text|FOR|#F0F0F0}} ec = {{Text|1|#F580B1}} {{Text|TO|#F0F0F0}} {{Text|LEN|#F0F0F0}}(x$) - {{Text|1|#F580B1}}
                            {{Text|'2 chr hex encode each character|#31C4C4}}
                            v1 = {{Text|ASC|#F0F0F0}}(x$, ec)
                            v2 = v1 \ {{Text|16|#F580B1}}: {{Text|IF|#F0F0F0}} v2 <= {{Text|9|#F580B1}} {{Text|THEN|#F0F0F0}} v2 = v2 + {{Text|48|#F580B1}} {{Text|ELSE|#F0F0F0}} v2 = v2 + {{Text|55|#F580B1}}
                            v1 = v1 {{Text|AND|#F0F0F0}} {{Text|15|#F580B1}}: {{Text|IF|#F0F0F0}} v1 <= {{Text|9|#F580B1}} {{Text|THEN|#F0F0F0}} v1 = v1 + {{Text|48|#F580B1}} {{Text|ELSE|#F0F0F0}} v1 = v1 + {{Text|55|#F580B1}}
                            {{Text|ASC|#F0F0F0}}(e$, ec * {{Text|2|#F580B1}} - {{Text|1|#F580B1}}) = v1
                            {{Text|ASC|#F0F0F0}}(e$, ec * {{Text|2|#F580B1}}) = v2
                        {{Text|NEXT|#F0F0F0}}
                    {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
                    a2$ = a2$ + sp + {{Text|"DATA"|#FFB100}}: {{Text|IF|#F0F0F0}} {{Text|LEN|#F0F0F0}}(e$) {{Text|THEN|#F0F0F0}} a2$ = a2$ + sp + {{Text|"_"|#FFB100}} + e$
                    {{Text|GOTO|#F0F0F0}} lineformatnext
                {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            {{Text|END|#F0F0F0}} {{Text|IF|#F0F0F0}}
            a2$ = a2$ + sp + {{Text|MID$|#F0F0F0}}(ca$, i, n2)
            i = i + n2
            {{Text|'----(variable/name)extensions----|#31C4C4}}
            extcheck:
            {{Text|IF|#F0F0F0}} n2 > {{Text|40|#F580B1}} {{Text|THEN|#F0F0F0}} Give_Error {{Text|"Identifier longer than 40 character limit"|#FFB100}}: {{Text|EXIT|#F0F0F0}} {{Text|FUNCTION|#F0F0F0}}
            c3 = {{Text|ASC|#F0F0F0}}(a$, i)
            m = {{Text|0|#F580B1}}
            {{Text|IF|#F0F0F0}} c3 = {{Text|126|#F580B1}} {{Text|THEN|#F0F0F0}} {{Text|'"~"|#31C4C4}}
                e2$ = {{Text|MID$|#F0F0F0}}(a$, i + {{Text|1|#F580B1}}, {{Text|2|#F580B1}})
                {{Text|IF|#F0F0F0}} e2$ = {{Text|"&&"|#FFB100}} {{Text|THEN|#F0F0F0}} e2$ = {{Text|"~&&"|#FFB100}}: {{Text|GOTO|#F0F0F0}} lfgetve
                {{Text|IF|#F0F0F0}} e2$ = {{Text|"%%"|#FFB100}} {{Text|THEN|#F0F0F0}} e2$ = {{Text|"~%%"|#FFB100}}: {{Text|GOTO|#F0F0F0}} lfgetve
                {{Text|IF|#F0F0F0}} e2$ = {{Text|"%&"|#FFB100}} {{Text|THEN|#F0F0F0}} e2$ = {{Text|"~%&"|#FFB100}}: {{Text|GOTO|#F0F0F0}} lfgetve
{{CodeEnd}}
{{CodeEnd}}

Revision as of 22:33, 23 February 2023

The _BlankPage serves as a skeleton for new Wiki pages.


Syntax

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


Parameters

  • arg1 is a mandatory argument
  • the arg2 is optional


Description

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

You can inline simple code one liners like w = _WIDTH

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

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

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

Notes

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

Errors

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


Availability

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


Examples

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


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


See also



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

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

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

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

$EXEICON:'./qb64pe.ico'

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

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

DEFLNG A-Z

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

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

DIM SHARED NoExeSaved AS INTEGER

DIM SHARED vWatchOn, vWatchRecompileAttempts, vWatchDesiredState, vWatchErrorCall$
DIM SHARED vWatchNewVariable$, vWatchVariableExclusions$
vWatchErrorCall$ = #FFB100
vWatchVariableExclusions$ = "@__LONG_VWATCH_LINENUMBER@__LONG_VWATCH_SUBLEVEL@__LONG_VWATCH_GOTO@" + _
              "@__STRING_VWATCH_SUBNAME@__STRING_VWATCH_CALLSTACK@__ARRAY_BYTE_VWATCH_BREAKPOINTS" + _
              "@__ARRAY_BYTE_VWATCH_SKIPLINES@__STRING_VWATCH_INTERNALSUBNAME@__ARRAY_STRING_VWATCH_STACK@"

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

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

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

DIM SHARED QB64_uptime!

QB64_uptime! = TIMER

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

DIM SHARED Include_GDB_Debugging_Info 'set using "options.bin"

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



DIM SHARED DEPENDENCY(1 TO DEPENDENCY_LAST)

DIM SHARED UseGL 'declared SUB _GL (no params)


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

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

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

TYPE usedVarList
    AS LONG id, linenumber, includeLevel, includedLine, scope, localIndex
    AS LONG arrayElementSize
    AS _BYTE used, watch, isarray, displayFormat #31C4C4
    AS STRING name, cname, varType, includedFile, subfunc
    AS STRING watchRange, indexes, elements, elementTypes 'for Arrays and UDTs
    AS STRING elementOffset, storage
END TYPE

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

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

DIM SHARED NoChecks

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





DIM SHARED E










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





DIM SHARED Error_Happened AS LONG
DIM SHARED Error_Message AS STRING

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

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

DIM SHARED inline_DATA
IF MacOSX THEN inline_DATA = 1

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


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


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

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

ON ERROR GOTO qberror_test

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

IF NOT _DIREXISTS(tmpdir$) THEN MKDIR tmpdir$

DECLARE LIBRARY
    FUNCTION getpid& ()
END DECLARE

thisinstancepid = getpid&
DIM SHARED tempfolderindex

IF INSTR(_OS$, "LINUX") THEN
    fh = FREEFILE
    OPEN ".\internal\temp\tempfoldersearch.bin" FOR RANDOM AS #fh LEN = LEN(tempfolderindex)
    tempfolderrecords = LOF(fh) / LEN(tempfolderindex)
    i = 1
    IF tempfolderrecords = 0 THEN
        'first run ever?
        PUT #fh, 1, thisinstancepid
    ELSE
        FOR i = 1 TO tempfolderrecords
            #31C4C4
            GET #fh, i, tempfoldersearch

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


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

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

ON ERROR GOTO qberror



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


DIM SHARED idedebuginfo
DIM SHARED seperateargs_error
DIM SHARED seperateargs_error_message AS STRING

DIM SHARED compfailed

DIM SHARED reginternalsubfunc
DIM SHARED reginternalvariable


DIM SHARED symboltype_size
symboltype_size = 0

DIM SHARED use_global_byte_elements
use_global_byte_elements = 0

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

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

'$INCLUDE:'global\IDEsettings.bas'

DIM OutputIsRelativeToStartDir AS LONG

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

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

#31C4C4
'is passed back in idereturn

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

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

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

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

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

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

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

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

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

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

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

'11 ".EXE file created" message

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

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

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

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

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

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

DIM SHARED AllowLocalName AS LONG

DIM SHARED DataOffset

DIM SHARED prepass


DIM SHARED autoarray

DIM SHARED ontimerid, onkeyid, onstrigid

DIM SHARED revertmaymusthave(1 TO 10000)
DIM SHARED revertmaymusthaven

DIM SHARED linecontinuation

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


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


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

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

DIM SHARED layoutcomment AS STRING

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


DIM SHARED fooindwel

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

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

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


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

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

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










DIM SHARED nextrunlineindex AS LONG

DIM SHARED lineinput3buffer AS STRING
DIM SHARED lineinput3index AS LONG

DIM SHARED dimstatic AS LONG

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

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

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

TYPE idstruct

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

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

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

    tsize AS LONG


    subfunc AS INTEGER #31C4C4
    Dependency AS INTEGER
    internal_subfunc AS INTEGER

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

    insubfunc AS STRING * 256
    insubfuncn AS LONG

    share AS INTEGER
    nele AS STRING * 100
    nelereq AS STRING * 100
    linkid AS LONG
    linkarg AS INTEGER
    staticscope AS INTEGER
    'For variables which are arguments passed to a sub/function
    sfid AS LONG 'id number of variable's parent sub/function
    sfarg AS INTEGER #31C4C4

    hr_syntax AS STRING
END TYPE

DIM SHARED id AS idstruct

DIM SHARED idn AS LONG
DIM SHARED ids_max AS LONG
ids_max = 1024
REDIM SHARED ids(1 TO ids_max) AS idstruct
REDIM SHARED cmemlist(1 TO ids_max + 1) AS INTEGER 'variables that must be in cmem
REDIM SHARED sfcmemargs(1 TO ids_max + 1) AS STRING * 100 's/f arg that must be in cmem
REDIM SHARED arrayelementslist(1 TO ids_max + 1) AS INTEGER #31C4C4


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

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

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

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

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

'COMMON SHARED separgs() AS STRING

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

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

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

DIM SHARED closedmain AS INTEGER
DIM SHARED module AS STRING

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

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

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

'CLEAR , , 16384


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

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

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

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






DIM SHARED statementn AS LONG
DIM SHARED everycasenewcase AS LONG




DIM SHARED controllevel AS INTEGER #31C4C4
DIM SHARED controltype(1000) AS INTEGER
#31C4C4
#31C4C4
#31C4C4
#31C4C4
#31C4C4
#31C4C4
#31C4C4
#31C4C4
#31C4C4
#31C4C4
#31C4C4
#31C4C4
#31C4C4
#31C4C4
#31C4C4
#31C4C4
#31C4C4
DIM controlid(1000) AS LONG
DIM controlvalue(1000) AS LONG
DIM controlstate(1000) AS INTEGER
DIM SHARED controlref(1000) AS LONG 'the line number the control was created on

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

UNSTABLE_MIDI = 1
UNSTABLE_HTTP = 2




ON ERROR GOTO qberror

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

DIM id2 AS idstruct

cleanupstringprocessingcall$ = "qbs_cleanup(qbs_tmp_base,"

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















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







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

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

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

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

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

IF C = 5 THEN 'end of program reached

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

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

IF C = 9 THEN 'run

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

        'locate accessible file and truncate
        f$ = file$

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

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

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

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

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

    'execute program




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



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

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

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

PRINT "Invalid IDE message": END

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

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


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

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

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

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

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

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

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

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

fullrecompile:

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

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

Error_Happened = 0

FOR closeall = 1 TO 255: CLOSE closeall: NEXT

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

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

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

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

'erase cmemlist
'erase sfcmemargs

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

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

vWatchDesiredState = 0
vWatchRecompileAttempts = 0

qb64prefix_set_desiredState = 0
qb64prefix_set_recompileAttempts = 0

opex_desiredState = 0
opex_recompileAttempts = 0

opexarray_desiredState = 0
opexarray_recompileAttempts = 0

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

qb64prefix_set = qb64prefix_set_desiredState
qb64prefix$ = "_"

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

lastLineReturn = 0
lastLine = 0
firstLine = 1

_Resize = 0
Resize_Scale = 0

UseGL = 0

Error_Happened = 0

HashClear 'clear the hash table

'add reserved words to hashtable

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

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

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

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







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


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

'import _MEM type
ptrsz = OS_BITS \ 8

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

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

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

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








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

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

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

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

reginternal

IF qb64prefix_set THEN
    qb64prefix$ = ""

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

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

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

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

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

IF idemode THEN GOTO ideret1

lineinput3load sourcefile$

DO

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

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

    ideprepass:
    prepassLastLine:

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

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

    prepass = 1
    layout = ""
    layoutok = 0

    linenumber = linenumber + 1
    reallinenumber = reallinenumber + 1

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

    IF LEN(wholeline$) THEN

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    unstableFlags(UNSTABLE_MIDI) = -1

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

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

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


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

        IF wholelinen THEN

            wholelinei = 1

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

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

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

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

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

                        'declare library
                        IF declaringlibrary THEN

                            IF firstelement$ = "END" THEN
                                IF n <> 2 OR secondelement$ <> "DECLARE" THEN a$ = "Expected END DECLARE": GOTO errmes
                                declaringlibrary = 0
                                GOTO finishedlinepp
                            END IF 'end declare

                            declaringlibrary = 2

                            IF firstelement$ = "SUB" OR firstelement$ = "FUNCTION" THEN subfuncn = subfuncn - 1: GOTO declaresubfunc

                            a$ = "Expected SUB/FUNCTION definition or END DECLARE (#2)": GOTO errmes
                        END IF

                        'UDT TYPE definition
                        IF definingtype THEN
                            i = definingtype

                            IF n >= 1 THEN
                                IF firstelement$ = "END" THEN
                                    IF n <> 2 OR secondelement$ <> "TYPE" THEN a$ = "Expected END TYPE": GOTO errmes
                                    IF udtxnext(i) = 0 THEN a$ = "No elements defined in TYPE": GOTO errmes
                                    definingtype = 0

                                    'create global buffer for SWAP space
                                    siz$ = str2$(udtxsize(i) \ 8)
                                    WriteBufLine GlobTxtBuf, "char *g_tmp_udt_" + RTRIM$(udtxname(i)) + #FFB100 + siz$ + ");"

                                    'print "END TYPE";udtxsize(i);udtxbytealign(i)
                                    GOTO finishedlinepp
                                END IF
                            END IF

                            IF n < 3 THEN a$ = "Expected element-name AS type, AS type element-list, or END TYPE": GOTO errmes
                            n$ = firstelement$

                            IF n$ <> "AS" THEN
                                'traditional variable-name AS type syntax, single-element
                                lasttypeelement = lasttypeelement + 1
                                i2 = lasttypeelement
                                WHILE i2 > UBOUND(udtenext): increaseUDTArrays: WEND
                                udtenext(i2) = 0

                                ii = 2

                                udtearrayelements(i2) = 0

                                IF ii >= n OR getelement$(a$, ii) <> "AS" THEN a$ = "Expected element-name AS type, AS type element-list, or END TYPE": GOTO errmes
                                t$ = getelements$(a$, ii + 1, n)

                                IF t$ = RTRIM$(udtxname(definingtype)) THEN a$ = "Invalid self-reference": GOTO errmes
                                typ = typname2typ(t$)
                                IF Error_Happened THEN GOTO errmes
                                IF typ = 0 THEN a$ = "Undefined type": GOTO errmes
                                typsize = typname2typsize

                                IF validname(n$) = 0 THEN a$ = "Invalid name": GOTO errmes
                                udtename(i2) = n$
                                udtecname(i2) = getelement$(ca$, 1)
                                NormalTypeBlock:
                                typeDefinitions$ = typeDefinitions$ + MKL$(i2) + MKL$(LEN(n$)) + n$
                                udtetype(i2) = typ
                                udtetypesize(i2) = typsize

                                hashname$ = n$

                                'check for name conflicts (any similar reserved or element from current UDT)
                                hashchkflags = HASHFLAG_RESERVED + HASHFLAG_UDTELEMENT
                                hashres = HashFind(hashname$, hashchkflags, hashresflags, hashresref)
                                DO WHILE hashres
                                    IF hashresflags AND HASHFLAG_UDTELEMENT THEN
                                        IF hashresref = i THEN a$ = "Name already in use (" + hashname$ + ")": GOTO errmes
                                    END IF
                                    IF hashresflags AND HASHFLAG_RESERVED THEN
                                        IF hashresflags AND (HASHFLAG_TYPE + HASHFLAG_CUSTOMSYNTAX + HASHFLAG_OPERATOR + HASHFLAG_XELEMENTNAME) THEN a$ = "Name already in use (" + hashname$ + ")": GOTO errmes
                                    END IF
                                    IF hashres <> 1 THEN hashres = HashFindCont(hashresflags, hashresref) ELSE hashres = 0
                                LOOP
                                'add to hash table
                                HashAdd hashname$, HASHFLAG_UDTELEMENT, i

                                'Calculate element's size
                                IF typ AND ISUDT THEN
                                    u = typ AND 511
                                    udtesize(i2) = udtxsize(u)
                                    IF udtxbytealign(u) THEN udtxbytealign(i) = 1: udtebytealign(i2) = 1
                                    IF udtxvariable(u) THEN udtxvariable(i) = -1
                                ELSE
                                    IF (typ AND ISSTRING) THEN
                                        IF (typ AND ISFIXEDLENGTH) = 0 THEN
                                            udtesize(i2) = OFFSETTYPE AND 511
                                            udtxvariable(i) = -1
                                        ELSE
                                            udtesize(i2) = typsize * 8
                                        END IF
                                        udtxbytealign(i) = 1: udtebytealign(i2) = 1
                                    ELSE
                                        udtesize(i2) = typ AND 511
                                        IF (typ AND ISOFFSETINBITS) = 0 THEN udtxbytealign(i) = 1: udtebytealign(i2) = 1
                                    END IF
                                END IF

                                'Increase block size
                                IF udtebytealign(i2) THEN
                                    IF udtxsize(i) MOD 8 THEN
                                        udtxsize(i) = udtxsize(i) + (8 - (udtxsize(i) MOD 8))
                                    END IF
                                END IF
                                udtxsize(i) = udtxsize(i) + udtesize(i2)

                                'Link element to previous element
                                IF udtxnext(i) = 0 THEN
                                    udtxnext(i) = i2
                                ELSE
                                    udtenext(i2 - 1) = i2
                                END IF

                                'print "+"+rtrim$(udtename(i2));udtetype(i2);udtesize(i2);udtebytealign(i2);udtxsize(i)
                                IF newAsTypeBlockSyntax THEN RETURN
                                GOTO finishedlinepp
                            ELSE
                                'new AS type variable-list syntax, multiple elements
                                ii = 2

                                IF ii >= n THEN a$ = "Expected element-name AS type, AS type element-list, or END TYPE": GOTO errmes
                                previousElement$ = ""
                                t$ = ""
                                lastElement$ = ""
                                buildTypeName:
                                lastElement$ = getelement$(a$, ii)
                                IF lastElement$ <> "," AND lastElement$ <> "" THEN
                                    n$ = lastElement$
                                    cn$ = getelement$(ca$, ii)
                                    IF LEN(previousElement$) THEN t$ = t$ + previousElement$ + " "
                                    previousElement$ = n$
                                    lastElement$ = ""
                                    ii = ii + 1
                                    GOTO buildTypeName
                                END IF

                                t$ = RTRIM$(t$)
                                IF t$ = RTRIM$(udtxname(definingtype)) THEN a$ = "Invalid self-reference": GOTO errmes
                                typ = typname2typ(t$)
                                IF Error_Happened THEN GOTO errmes
                                IF typ = 0 THEN a$ = "Undefined type": GOTO errmes
                                typsize = typname2typsize

                                previousElement$ = lastElement$
                                nexttypeelement:
                                lasttypeelement = lasttypeelement + 1
                                i2 = lasttypeelement
                                WHILE i2 > UBOUND(udtenext): increaseUDTArrays: WEND
                                udtenext(i2) = 0
                                udtearrayelements(i2) = 0

                                udtename(i2) = n$
                                udtecname(i2) = cn$

                                IF validname(n$) = 0 THEN a$ = "Invalid name": GOTO errmes

                                newAsTypeBlockSyntax = -1
                                GOSUB NormalTypeBlock
                                newAsTypeBlockSyntax = 0

                                getNextElement:
                                ii = ii + 1
                                lastElement$ = getelement$(a$, ii)
                                IF lastElement$ = "" THEN GOTO finishedlinepp
                                IF ii = n AND lastElement$ = "," THEN a$ = "Expected element-name": GOTO errmes
                                IF lastElement$ = "," THEN
                                    IF previousElement$ = "," THEN a$ = "Expected element-name": GOTO errmes
                                    previousElement$ = lastElement$
                                    GOTO getNextElement
                                END IF
                                n$ = lastElement$
                                IF previousElement$ <> "," THEN a$ = "Expected ,": GOTO errmes
                                previousElement$ = lastElement$
                                cn$ = getelement$(ca$, ii)
                                GOTO nexttypeelement
                            END IF
                        END IF 'definingtype

                        IF definingtype AND n >= 1 THEN a$ = "Expected END TYPE": GOTO errmes

                        IF n >= 1 THEN
                            IF firstelement$ = "TYPE" THEN
                                IF n <> 2 THEN a$ = "Expected TYPE typename": GOTO errmes
                                lasttype = lasttype + 1
                                typeDefinitions$ = typeDefinitions$ + MKL$(-1) + MKL$(lasttype)
                                definingtype = lasttype
                                i = definingtype
                                WHILE i > UBOUND(udtenext): increaseUDTArrays: WEND
                                IF validname(secondelement$) = 0 THEN a$ = "Invalid name": GOTO errmes
                                typeDefinitions$ = typeDefinitions$ + MKL$(LEN(secondelement$)) + secondelement$
                                udtxname(i) = secondelement$
                                udtxcname(i) = getelement(ca$, 2)
                                udtxnext(i) = 0
                                udtxsize(i) = 0
                                udtxvariable(i) = 0

                                hashname$ = secondelement$
                                hashflags = HASHFLAG_UDT
                                'check for name conflicts (any similar reserved/sub/function/UDT name)
                                hashchkflags = HASHFLAG_RESERVED + HASHFLAG_SUB + HASHFLAG_FUNCTION + HASHFLAG_UDT
                                hashres = HashFind(hashname$, hashchkflags, hashresflags, hashresref)
                                DO WHILE hashres
                                    allow = 0
                                    IF hashresflags AND (HASHFLAG_SUB + HASHFLAG_FUNCTION) THEN
                                        allow = 1
                                    END IF
                                    IF hashresflags AND HASHFLAG_RESERVED THEN
                                        IF (hashresflags AND (HASHFLAG_TYPE + HASHFLAG_OPERATOR + HASHFLAG_CUSTOMSYNTAX + HASHFLAG_XTYPENAME)) = 0 THEN allow = 1
                                    END IF
                                    IF allow = 0 THEN a$ = "Name already in use (" + hashname$ + ")": GOTO errmes
                                    IF hashres <> 1 THEN hashres = HashFindCont(hashresflags, hashresref) ELSE hashres = 0
                                LOOP

                                'add to hash table
                                HashAdd hashname$, hashflags, i

                                GOTO finishedlinepp
                            END IF
                        END IF





                        IF n >= 1 AND firstelement$ = "CONST" THEN
                            #31C4C4
                            'DEF... do not change type, the expression is stored in a suitable type
                            'based on its value if type isn't forced/specified

                            IF subfuncn > 0 AND closedsubfunc <> 0 THEN a$ = "Statement cannot be placed between SUB/FUNCTIONs": GOTO errmes

                            'convert periods to _046_
                            i2 = INSTR(a$, sp + "." + sp)
                            IF i2 THEN
                                DO
                                    a$ = LEFT$(a$, i2 - 1) + fix046$ + RIGHT$(a$, LEN(a$) - i2 - 2)
                                    ca$ = LEFT$(ca$, i2 - 1) + fix046$ + RIGHT$(ca$, LEN(ca$) - i2 - 2)
                                    i2 = INSTR(a$, sp + "." + sp)
                                LOOP UNTIL i2 = 0
                                n = numelements(a$)
                                firstelement$ = getelement(a$, 1): secondelement$ = getelement(a$, 2): thirdelement$ = getelement(a$, 3)
                            END IF

                            IF n < 3 THEN a$ = #FFB100: GOTO errmes
                            i = 2
                            constdefpendingpp:
                            pending = 0

                            n$ = getelement$(ca$, i): i = i + 1
                            typeoverride = 0
                            s$ = removesymbol$(n$)
                            IF Error_Happened THEN GOTO errmes
                            IF s$ <> "" THEN
                                typeoverride = typname2typ(s$)
                                IF Error_Happened THEN GOTO errmes
                                IF typeoverride AND ISFIXEDLENGTH THEN a$ = "Invalid constant type": GOTO errmes
                                IF typeoverride = 0 THEN a$ = "Invalid constant type": GOTO errmes
                            END IF

                            IF getelement$(a$, i) <> #FFB100 THEN a$ = #FFB100: GOTO errmes
                            i = i + 1

                            'get expression
                            e$ = ""
                            readable_e$ = ""
                            B = 0
                            FOR i2 = i TO n
                                e2$ = getelement$(ca$, i2)
                                IF e2$ = "(" THEN B = B + 1
                                IF e2$ = ")" THEN B = B - 1
                                IF e2$ = "," AND B = 0 THEN
                                    pending = 1
                                    i = i2 + 1
                                    IF i > n - 2 THEN a$ = #FFB100: GOTO errmes
                                    EXIT FOR
                                END IF
                                IF LEN(e$) = 0 THEN e$ = e2$ ELSE e$ = e$ + sp + e2$

                                e3$ = e2$
                                IF LEN(e2$) > 1 THEN
                                    IF ASC(e2$, 1) = 34 THEN
                                        removeComma = _INSTRREV(e2$, ",")
                                        e3$ = LEFT$(e2$, removeComma - 1)
                                    ELSE
                                        removeComma = INSTR(e2$, ",")
                                        e3$ = MID$(e2$, removeComma + 1)
                                    END IF
                                END IF

                                IF LEN(readable_e$) = 0 THEN
                                    readable_e$ = e3$
                                ELSE
                                    readable_e$ = readable_e$ + " " + e3$
                                END IF
                            NEXT

                            'intercept current expression and pass it through Evaluate_Expression$
                            '(unless it is a literal string)
                            IF LEFT$(readable_e$, 1) <> CHR$(34) THEN
                                temp1$ = _TRIM$(Evaluate_Expression$(readable_e$))
                                IF LEFT$(temp1$, 5) <> "ERROR" AND e$ <> temp1$ THEN
                                    e$ = lineformat(temp1$) 'retrieve parseable format
                                ELSE
                                    IF temp1$ = "ERROR - Division By Zero" THEN a$ = temp1$: GOTO errmes
                                    IF INSTR(temp1$, "Improper operations") THEN
                                        a$ = "Invalid CONST expression.14": GOTO errmes
                                    END IF
                                END IF
                            END IF

                            'Proceed as usual
                            e$ = fixoperationorder(e$)
                            IF Error_Happened THEN GOTO errmes

                            e$ = evaluateconst(e$, t)
                            IF Error_Happened THEN GOTO errmes

                            IF t AND ISSTRING THEN 'string type

                                IF typeoverride THEN
                                    IF (typeoverride AND ISSTRING) = 0 THEN a$ = "Type mismatch": GOTO errmes
                                END IF

                            ELSE 'not a string type

                                IF typeoverride THEN
                                    IF typeoverride AND ISSTRING THEN a$ = "Type mismatch": GOTO errmes
                                END IF

                                IF t AND ISFLOAT THEN
                                    constval## = _CV(_FLOAT, e$)
                                    constval&& = constval##
                                    constval~&& = constval&&
                                ELSE
                                    IF (t AND ISUNSIGNED) AND (t AND 511) = 64 THEN
                                        constval~&& = _CV(_UNSIGNED _INTEGER64, e$)
                                        constval&& = constval~&&
                                        constval## = constval&&
                                    ELSE
                                        constval&& = _CV(_INTEGER64, e$)
                                        constval## = constval&&
                                        constval~&& = constval&&
                                    END IF
                                END IF

                                'override type?
                                IF typeoverride THEN
                                    'range check required here (noted in todo)
                                    t = typeoverride
                                END IF

                            END IF 'not a string type

                            constlast = constlast + 1
                            IF constlast > constmax THEN
                                constmax = constmax * 2
                                REDIM _PRESERVE constname(constmax) AS STRING
                                REDIM _PRESERVE constcname(constmax) AS STRING
                                REDIM _PRESERVE constnamesymbol(constmax) AS STRING 'optional name symbol
                                REDIM _PRESERVE consttype(constmax) AS LONG 'variable type number
                                REDIM _PRESERVE constinteger(constmax) AS _INTEGER64
                                REDIM _PRESERVE constuinteger(constmax) AS _UNSIGNED _INTEGER64
                                REDIM _PRESERVE constfloat(constmax) AS _FLOAT
                                REDIM _PRESERVE conststring(constmax) AS STRING
                                REDIM _PRESERVE constsubfunc(constmax) AS LONG
                                REDIM _PRESERVE constdefined(constmax) AS LONG
                            END IF

                            i2 = constlast

                            constsubfunc(i2) = subfuncn
                            #31C4C4

                            IF validname(n$) = 0 THEN a$ = "Invalid name": GOTO errmes
                            constname(i2) = UCASE$(n$)

                            hashname$ = n$
                            'check for name conflicts (any similar: reserved, sub, function, constant)

                            allow = 0
                            const_recheck:
                            hashchkflags = HASHFLAG_RESERVED + HASHFLAG_SUB + HASHFLAG_FUNCTION + HASHFLAG_CONSTANT
                            hashres = HashFind(hashname$, hashchkflags, hashresflags, hashresref)
                            DO WHILE hashres
                                IF hashresflags AND HASHFLAG_CONSTANT THEN
                                    IF constsubfunc(hashresref) = subfuncn THEN
                                        'If merely redefining a CONST with same value
                                        'just issue a warning instead of an error
                                        issueWarning = 0
                                        IF t AND ISSTRING THEN
                                            IF conststring(hashresref) = e$ THEN issueWarning = -1: thisconstval$ = e$
                                        ELSE
                                            IF t AND ISFLOAT THEN
                                                IF constfloat(hashresref) = constval## THEN issueWarning = -1: thisconstval$ = STR$(constval##)
                                            ELSE
                                                IF t AND ISUNSIGNED THEN
                                                    IF constuinteger(hashresref) = constval~&& THEN issueWarning = -1: thisconstval$ = STR$(constval~&&)
                                                ELSE
                                                    IF constinteger(hashresref) = constval&& THEN issueWarning = -1: thisconstval$ = STR$(constval&&)
                                                END IF
                                            END IF
                                        END IF
                                        IF issueWarning THEN
                                            IF NOT IgnoreWarnings THEN
                                                addWarning linenumber, inclevel, inclinenumber(inclevel), incname$(inclevel), "duplicate constant definition", n$ + #FFB100 + thisconstval$
                                            END IF
                                            GOTO constAddDone
                                        ELSE
                                            a$ = "Name already in use (" + hashname$ + ")": GOTO errmes
                                        END IF
                                    END IF
                                END IF
                                IF hashresflags AND HASHFLAG_RESERVED THEN
                                    a$ = "Name already in use (" + hashname$ + ")": GOTO errmes
                                END IF
                                IF hashresflags AND (HASHFLAG_SUB + HASHFLAG_FUNCTION) THEN
                                    IF ids(hashresref).internal_subfunc = 0 OR RTRIM$(ids(hashresref).musthave) <> "$" THEN a$ = "Name already in use (" + hashname$ + ")": GOTO errmes
                                    IF t AND ISSTRING THEN a$ = "Name already in use (" + hashname$ + ")": GOTO errmes
                                END IF
                                IF hashres <> 1 THEN hashres = HashFindCont(hashresflags, hashresref) ELSE hashres = 0
                            LOOP

                            'add to hash table
                            HashAdd hashname$, HASHFLAG_CONSTANT, i2