Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Stack size limit for If/Then statements?
#8
No idea what's going on for you. 

This code produces a 65,535 line program set up as you describe:

Code: (Select All)
$Console:Only
Open "QB64_main_test.bas" For Output As #1

For x = 0 To 255
For y = 0 To 255
Print #1, "IF a$ = chr$( " + Str$(x) + ") + CHR$(" + Str$(y) + ") THEN g$ = " + Chr$(34) + "(output)" + Chr$(34) + ": PUT #2, ,g$: g$ = " + Chr$(34) + Chr$(34)
Next
Next

Shell "qb64pe.exe -x QB64_main_test.bas" 'this should compile the program for us

Compiles and runs with no issues on my system. (Even though it takes forever and ever and ever to compile.)

The generated program looks like the following:

If a$ = Chr$(0) + Chr$(0) Then g$ = "(output)": Put #2, , g$: g$ = ""
If a$ = Chr$(0) + Chr$(1) Then g$ = "(output)": Put #2, , g$: g$ = ""
If a$ = Chr$(0) + Chr$(2) Then g$ = "(output)": Put #2, , g$: g$ = ""
If a$ = Chr$(0) + Chr$(3) Then g$ = "(output)": Put #2, , g$: g$ = ""
If a$ = Chr$(0) + Chr$(4) Then g$ = "(output)": Put #2, , g$: g$ = ""
If a$ = Chr$(0) + Chr$(5) Then g$ = "(output)": Put #2, , g$: g$ = ""
If a$ = Chr$(0) + Chr$(6) Then g$ = "(output)": Put #2, , g$: g$ = ""
If a$ = Chr$(0) + Chr$(7) Then g$ = "(output)": Put #2, , g$: g$ = ""
If a$ = Chr$(0) + Chr$(8) Then g$ = "(output)": Put #2, , g$: g$ = ""
If a$ = Chr$(0) + Chr$(9) Then g$ = "(output)": Put #2, , g$: g$ = ""
If a$ = Chr$(0) + Chr$(10) Then g$ = "(output)": Put #2, , g$: g$ = ""
If a$ = Chr$(0) + Chr$(11) Then g$ = "(output)": Put #2, , g$: g$ = ""
If a$ = Chr$(0) + Chr$(12) Then g$ = "(output)": Put #2, , g$: g$ = ""
If a$ = Chr$(0) + Chr$(13) Then g$ = "(output)": Put #2, , g$: g$ = ""
If a$ = Chr$(0) + Chr$(14) Then g$ = "(output)": Put #2, , g$: g$ = ""
If a$ = Chr$(0) + Chr$(15) Then g$ = "(output)": Put #2, , g$: g$ = ""
If a$ = Chr$(0) + Chr$(16) Then g$ = "(output)": Put #2, , g$: g$ = ""
If a$ = Chr$(0) + Chr$(17) Then g$ = "(output)": Put #2, , g$: g$ = ""
If a$ = Chr$(0) + Chr$(18) Then g$ = "(output)": Put #2, , g$: g$ = ""

From the double loops, this checks for CHR$(0) + CHR$(0) to CHR$(255) + CHR$(255), which makes for 65,536 lines of code -- which compiles and runs with no isses on my system.

What exactly is the c++ compiler error that you're getting? And which version of QB64PE are you running?
Reply


Messages In This Thread
RE: Stack size limit for If/Then statements? - by SMcNeill - 01-29-2024, 03:59 AM



Users browsing this thread: 13 Guest(s)