01-29-2024, 03:13 AM
(This post was last modified: 01-29-2024, 03:14 AM by JamesAlexander.)
It consists of one big loop, and the IF/THEN statements are single line expressions. Example:
LINE INPUT "File to read in:",FILE$
LINE INPUT "File to write out:",FILE2$
Open FILE$ For Binary As #1: 'For reading
Open FILE2$ For Output As #2: Close #2: Open FILE2$ For Binary As #2 ':For write
Do '(Main loop goes here)
IF Lookahead$=CHR$(0) THEN G$="(output)": PUT #2 , , G$: G$=""
IF Lookahead$=CHR$(1) THEN G$="(output)": PUT #2 , , G$: G$=""
...etc
Loop
-----------------------------------
^ The output is a type of automated script done by another program. The output is QB64 source code. The lines are simple, and there are no Gosubs, Gotos, or anything else. There are just a LOT of lines, because some of them are like this:
IF Lookahead$=CHR$(0) + CHR$ (0) THEN G$="(output)": PUT #2 , , G$: G$=""
IF Lookahead$=CHR$(0) + CHR$ (1) THEN G$="(output)": PUT #2 , , G$: G$=""
etc
So depending on the automated data, it could be between 256 or 65,536 or (heaven forbid) even 16,777,216 if we are tasked with up to 3 characters.
If I follow the automation through to completion, it will be about (give or take) 22,000 lines. But alas, I can only do this with 9,786 and it bombs out...
There are no other nested loops or anything. Just "If X = [statement] THEN [command 1] : [command 2]: [command 3] on a single line.
LINE INPUT "File to read in:",FILE$
LINE INPUT "File to write out:",FILE2$
Open FILE$ For Binary As #1: 'For reading
Open FILE2$ For Output As #2: Close #2: Open FILE2$ For Binary As #2 ':For write
Do '(Main loop goes here)
IF Lookahead$=CHR$(0) THEN G$="(output)": PUT #2 , , G$: G$=""
IF Lookahead$=CHR$(1) THEN G$="(output)": PUT #2 , , G$: G$=""
...etc
Loop
-----------------------------------
^ The output is a type of automated script done by another program. The output is QB64 source code. The lines are simple, and there are no Gosubs, Gotos, or anything else. There are just a LOT of lines, because some of them are like this:
IF Lookahead$=CHR$(0) + CHR$ (0) THEN G$="(output)": PUT #2 , , G$: G$=""
IF Lookahead$=CHR$(0) + CHR$ (1) THEN G$="(output)": PUT #2 , , G$: G$=""
etc
So depending on the automated data, it could be between 256 or 65,536 or (heaven forbid) even 16,777,216 if we are tasked with up to 3 characters.
If I follow the automation through to completion, it will be about (give or take) 22,000 lines. But alas, I can only do this with 9,786 and it bombs out...
There are no other nested loops or anything. Just "If X = [statement] THEN [command 1] : [command 2]: [command 3] on a single line.