Author Topic: Program hangs unexpectedly with Type change  (Read 3366 times)

0 Members and 1 Guest are viewing this topic.

This topic contains a post which is marked as Best Answer. Press here if you would like to see it.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Program hangs unexpectedly with Type change
« on: September 11, 2018, 12:39:31 am »
This is wacky, what am I missing?

I am checking out Zeppelin's BF signature and I see he is not using ASCII numbers because the values are way out of range for 0 to 255 for CHR$() to use.

They are huge with memory() array Typed for Integers they run range -32000 to 32000 and knowing this can't be right for print characters, they all should be positive, I up the memory array Type to Long with & suffix and the program then completely hangs with bf Zeppelin signature.txt file but works fine for the other 4 ASCII sample bf*.txt files.

Wow, that's weird so I try Type ~% unsigned Integer and it works and they are all positive in value as expected.

So what is wrong with changing Type to Long? that causes the program to hang?

Here is code with sample bf*.txt files:


Dang Typos, Code comments  should say:

'?????????????????????????????????????????????????????????????????????????

'    Why does this program hang when I change memory% or memory~% to
'    memory& and Only With bf Zeppelin signature.txt file


'????????????????????????????????????????????????????????????????????????

Yes, it hangs with 64 x 64 And with Last Beta 2018 0228/86 git 6fde149
« Last Edit: September 11, 2018, 12:46:49 am by bplus »

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Program hangs unexpectedly with Type change
« Reply #1 on: September 11, 2018, 02:21:26 pm »
Well I doubt I've stumped our in house panel of experts, I suspect they don't want to be bothered by .zip file.

I am really curious about this, not so complicated. How about if I comment out critical points in question?
Code: QB64: [Select]
  1. 'BF translation.bas for QB64 fork (B+=MGA) 2017-07-23
  2. ' BF in QB.bas for SmallBASIC 0.12.9 (B+=MGA) 2017-07-22
  3. ' I just translated some QB code from Rosetta to SmallBASIC
  4. ' and tested a couple of programs Hello World, Goodbye World
  5. ' count down also found at Rosetta Code
  6. '======================================================================
  7. ' QB64 has excellent Help wiki, thanks to all who put that together!
  8. '======================================================================
  9.  
  10.  
  11. '?????????????????????????????????????????????????????????????????????????
  12.  
  13. '    Why does this program hang when I change memory% or memory~% to
  14. '    memory& and Only With bf Zeppelin signature.txt file
  15.  
  16.  
  17. '????????????????????????????????????????????????????????????????????????
  18.  
  19.  
  20. _TITLE "Brainf***, Rosetta Code - Quick Basic translation to SB then to QB64 (fork)"
  21. 'for directory stuff
  22. CONST ListMAX% = 20
  23. COMMON SHARED dirList$()
  24. COMMON SHARED DIRCount% 'returns file count if desired
  25. DIM memsize%, ptr%, i%, ln%, bktCnt%, ff%, ascNum%
  26. DIM instChars$, source$, fileName$, fLine$, code$, char$, inLine$, instruction$, inChar$, yes$
  27.  
  28. memsize% = 20000
  29. DIM memory&(memsize%)
  30. instChars$ = "+-<>.,[]" 'valid characters
  31. loadDirList "bf*.txt"
  32.  
  33.     ptr% = 0 'memory pointer
  34.     source$ = ""
  35.     CLS
  36.  
  37.     '==================================== file stuff just to access the BF "program"
  38.     IF DIRCount% THEN
  39.         FOR i% = 1 TO DIRCount%
  40.             PRINT i%, dirList$(i%)
  41.         NEXT
  42.     ELSE
  43.         PRINT "Sorry, no bf*.txt files found."
  44.         SLEEP
  45.         END
  46.     END IF
  47.     PRINT: INPUT "Enter line number of BF Filename you desire "; ln%
  48.     IF ln% < 1 OR ln% > DIRCount% THEN END
  49.     fileName$ = dirList$(ln%)
  50.  
  51.     OPEN fileName$ FOR INPUT AS #1
  52.     DO
  53.         LINE INPUT #1, fLine$
  54.         source$ = source$ + fLine$
  55.     LOOP UNTIL EOF(1)
  56.     CLOSE #1
  57.  
  58.     IF LEN(source$) < 1 THEN
  59.         PRINT "No source code to BF."
  60.         SLEEP
  61.         END
  62.     END IF
  63.  
  64.  
  65.     '================================================  a check that BF program is correct and brackets balanced
  66.     'let's clean the code up, check bracket balance
  67.     bktCnt% = 0
  68.     code$ = ""
  69.     FOR i% = 1 TO LEN(source$)
  70.         char$ = MID$(source$, i%, 1)
  71.         'check to see if this is a valid instruction character
  72.         IF INSTR(instChars$, char$) THEN
  73.             code$ = code$ + char$
  74.             'count brackets
  75.             IF char$ = "[" THEN bktCnt% = bktCnt% + 1
  76.             IF char$ = "]" THEN bktCnt% = bktCnt% - 1
  77.         ELSE
  78.             PRINT "Non BF character found (and ignored): "; char$
  79.         END IF
  80.     NEXT
  81.  
  82.     IF bktCnt% THEN 'mismatched brackets
  83.         PRINT "Uneven brackets";
  84.         SLEEP
  85.         END
  86.     ELSE
  87.         PRINT "Code:": PRINT code$: PRINT: PRINT "Output:"
  88.     END IF
  89.     'clear last if any
  90.     ERASE memory&
  91.  
  92.     ' ============================================== here is meat and potatoes of translation
  93.  
  94.     DIM memory&(memsize%) '<<<<<<<<<<<<< here is the array in question, at type % integer works but numbers are neg
  95.     ' ====================================================== unsigned itegers ~works too
  96.     ' ====================================================== so why not long & integers ????????
  97.  
  98.     inLine$ = "" 'input buffer  if a comma is used
  99.     FOR i% = 1 TO LEN(code$) 'loop through the code
  100.         instruction$ = MID$(code$, i%, 1) 'get the instruction we're on
  101.         SELECT CASE instruction$
  102.             CASE "+" ' +
  103.                 memory&(ptr%) = memory&(ptr%) + 1
  104.             CASE "-" ' -
  105.                 memory&(ptr%) = memory&(ptr%) - 1
  106.             CASE "."
  107.                 IF memory&(ptr%) < 1 OR memory&(ptr%) > 255 THEN
  108.                     'PRINT "?";
  109.                     PRINT "[" + LTRIM$(STR$(memory&(ptr%))) + "]";
  110.                 ELSE
  111.                     PRINT CHR$(memory&(ptr%));
  112.                 END IF
  113.             CASE "," ' <<<<<    rarely used when playing with coded messages
  114.                 IF inLine$ = "" THEN LINE INPUT inLine$ 'buffer input
  115.                 inChar$ = LEFT$(inLine$, 1) 'take the first char off the buffer
  116.                 inLine$ = MID$(inLine$, 2) 'delete it from the buffer
  117.                 memory&(ptr%) = ASC(inChar$) 'use it
  118.             CASE ">"
  119.                 ptr% = ptr% + 1
  120.                 IF ptr% > memsize% THEN
  121.                     PRINT "Memory pointer out of range"
  122.                     SLEEP
  123.                     END
  124.                 END IF
  125.             CASE "<"
  126.                 ptr% = ptr% - 1
  127.                 IF ptr% < 0 THEN
  128.                     PRINT "Memory pointer out of range"
  129.                     SLEEP
  130.                     END
  131.                 END IF
  132.             CASE "["
  133.                 IF memory&(ptr%) = 0 THEN
  134.                     bktCnt% = 1 'count the bracket we're on
  135.                     i% = i% + 1 'move the code pointer to the next char
  136.                     WHILE bktCnt% <> 0
  137.                         'count nested loops till we find the matching one
  138.                         IF MID$(code$, i%, 1) = "]" THEN bktCnt% = bktCnt% - 1
  139.                         IF MID$(code$, i%, 1) = "[" THEN bktCnt% = bktCnt% + 1
  140.                         i% = i% + 1 'search forward
  141.                     WEND
  142.                 END IF
  143.             CASE "]"
  144.                 IF memory&(ptr%) <> 0 THEN
  145.                     bktCnt% = -1 'count the bracket we're on
  146.                     i% = i% - 1 'move the code pointer back a char
  147.                     WHILE bktCnt% <> 0
  148.                         'count nested loops till we fine the matching one
  149.                         IF MID$(code$, i%, 1) = "]" THEN bktCnt% = bktCnt% - 1
  150.                         IF MID$(code$, i%, 1) = "[" THEN bktCnt% = bktCnt% + 1
  151.                         i% = i% - 1 'search backwards
  152.                     WEND
  153.                 END IF
  154.             CASE ELSE
  155.                 PRINT "[?]";
  156.         END SELECT
  157.  
  158.     NEXT
  159.     '======================================================================== end of translation
  160.     PRINT: PRINT: INPUT "Press y for yes to do another "; yes$
  161.     IF yes$ <> "y" THEN END
  162.  
  163. ' modified function from Help files
  164. '                                          to get a bf program string from a file it is saved in
  165. SUB loadDirList (spec$)
  166.     DIM ff%, size&
  167.     CONST TmpFile$ = "DIR$INF0.INF"
  168.     STATIC Ready%, Index%
  169.     IF NOT Ready% THEN REDIM dirList$(ListMAX%): Ready% = -1 'DIM array first use
  170.     IF spec$ > "" THEN 'get file names when a spec is given
  171.         SHELL _HIDE "DIR " + spec$ + " /b > " + TmpFile$
  172.         Index% = 0: dirList$(Index%) = "": ff% = FREEFILE
  173.         OPEN TmpFile$ FOR APPEND AS #ff%
  174.         size& = LOF(ff%)
  175.         CLOSE #ff%
  176.         IF size& = 0 THEN KILL TmpFile$: EXIT SUB
  177.         OPEN TmpFile$ FOR INPUT AS #ff%
  178.         DO WHILE NOT EOF(ff%) AND Index% < ListMAX%
  179.             Index% = Index% + 1
  180.             LINE INPUT #ff%, dirList$(Index%)
  181.         LOOP
  182.         DIRCount% = Index% 'SHARED variable can return the file count
  183.         CLOSE #ff%
  184.         KILL TmpFile$
  185.     ELSE IF Index% > 0 THEN Index% = Index% - 1 'no spec sends next file name
  186.     END IF
  187.  

I am sure there is not some sort of bug here with long type but I am not seeing why it's not working here.

FellippeHeitor

  • Guest
Re: Program hangs unexpectedly with Type change
« Reply #2 on: September 11, 2018, 02:35:41 pm »
Hi bplus,

You pointed out a weird issue coming from the guts of a full project. In all honesty, I didn't even download it cause I'd have to analyze all of the code from the start to begin to understand what it's doing in order to try to figure the issue.

I recommend trying to create a Minimal, Complete, and Verifiable example. A simpler snippet of code in which you could replicate the issue by just changing a data type. Not only that'll provide you with a more focused view of the issue but it may in the end bring you to an answer even before we look into it.

If even after that the mystery remains, it'd be at least easier to spot the faulty bit of code.

An interesting read on the suggested practice can be found at https://stackoverflow.com/help/mcve
« Last Edit: September 11, 2018, 02:37:29 pm by FellippeHeitor »

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Program hangs unexpectedly with Type change
« Reply #3 on: September 11, 2018, 03:06:59 pm »
OK stripped down version:
Code: QB64: [Select]
  1. memsize% = 20000
  2. instChars$ = "+-<>.,[]" 'valid characters
  3. ptr% = 0 'memory pointer
  4. code$ = "++[---------->+<]>.-[++++>---<]>.-[---->+<]>++.---[----->++<]>.-------------.----.+++++++++++.[++>---<]>--.+[----->+<]>+.-------------.++++++++++++.--------.--[--->+<]>-.-[--->++<]>-.++++++++++.+[---->+<]>+++.++++++[->++<]>+.-[------>+<]>-.--[--->+<]>---.-------.-[++>---<]>+.--[->++<]>-.+[--->++<]>+"
  5.  
  6. DIM memory%(memsize%) '<<<<<<<<<<<<< here is the array in question, at type % integer works but numbers are neg
  7. ' ====================================================== unsigned itegers ~works too
  8. ' ====================================================== so why not long & integers ????????
  9. PRINT "Code translation:"
  10. FOR i% = 1 TO LEN(code$) 'loop through the code
  11.     instruction$ = MID$(code$, i%, 1) 'get the instruction we're on
  12.     SELECT CASE instruction$
  13.         CASE "+" ' +
  14.             memory%(ptr%) = memory%(ptr%) + 1
  15.         CASE "-" ' -
  16.             memory%(ptr%) = memory%(ptr%) - 1
  17.         CASE "."
  18.             IF memory%(ptr%) < 1 OR memory%(ptr%) > 255 THEN
  19.                 'PRINT "?";
  20.                 PRINT "[" + LTRIM$(STR$(memory%(ptr%))) + "]";
  21.             ELSE
  22.                 PRINT CHR$(memory%(ptr%));
  23.             END IF
  24.         CASE ">"
  25.             ptr% = ptr% + 1
  26.             IF ptr% > memsize% THEN
  27.                 PRINT "Memory pointer out of range"
  28.                 SLEEP
  29.                 END
  30.             END IF
  31.         CASE "<"
  32.             ptr% = ptr% - 1
  33.             IF ptr% < 0 THEN
  34.                 PRINT "Memory pointer out of range"
  35.                 SLEEP
  36.                 END
  37.             END IF
  38.         CASE "["
  39.             IF memory%(ptr%) = 0 THEN
  40.                 bktCnt% = 1 'count the bracket we're on
  41.                 i% = i% + 1 'move the code pointer to the next char
  42.                 WHILE bktCnt% <> 0
  43.                     'count nested loops till we find the matching one
  44.                     IF MID$(code$, i%, 1) = "]" THEN bktCnt% = bktCnt% - 1
  45.                     IF MID$(code$, i%, 1) = "[" THEN bktCnt% = bktCnt% + 1
  46.                     i% = i% + 1 'search forward
  47.                 WEND
  48.             END IF
  49.         CASE "]"
  50.             IF memory%(ptr%) <> 0 THEN
  51.                 bktCnt% = -1 'count the bracket we're on
  52.                 i% = i% - 1 'move the code pointer back a char
  53.                 WHILE bktCnt% <> 0
  54.                     'count nested loops till we fine the matching one
  55.                     IF MID$(code$, i%, 1) = "]" THEN bktCnt% = bktCnt% - 1
  56.                     IF MID$(code$, i%, 1) = "[" THEN bktCnt% = bktCnt% + 1
  57.                     i% = i% - 1 'search backwards
  58.                 WEND
  59.             END IF
  60.     END SELECT
  61.  
  62.  
« Last Edit: September 11, 2018, 03:08:01 pm by bplus »

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Program hangs unexpectedly with Type change
« Reply #4 on: September 11, 2018, 04:41:10 pm »
One thing is clear! The program that coded "My real name is Mark." Is not the same as the program that coded this example of "Hello World!"

2,793,000 loops for "My real name is Mark." Yikes! and the letter codes are different.

Code: QB64: [Select]
  1. memsize% = 20000
  2. instChars$ = "+-<>.,[]" 'valid characters
  3. ptr% = 0 'memory pointer
  4.  
  5. printIndex = 1
  6. trans$ = "Hello World!"
  7. code$ = "++++++++[>++++[>++>+++>+++>+<<<<-]>+>->+>>+[<]<-]>>.>>---.+++++++..+++.>.<<-.>.+++.------.--------.>+.>++.+++."
  8. 'trans$ = "My real name is Mark ;"
  9. 'code$ = "++[---------->+<]>.-[++++>---<]>.-[---->+<]>++.---[----->++<]>.-------------.----.+++++++++++.[++>---<]>--.+[----->+<]>+.-------------.++++++++++++.--------.--[--->+<]>-.-[--->++<]>-.++++++++++.+[---->+<]>+++.++++++[->++<]>+.-[------>+<]>-.--[--->+<]>---.-------.-[++>---<]>+.--[->++<]>-.+[--->++<]>+"
  10.  
  11. DIM memory%(memsize%) '<<<<<<<<<<<<< here is the array in question, at type % integer works but numbers are neg
  12. ' ====================================================== unsigned itegers ~works too
  13. ' ====================================================== so why not long & integers ????????
  14. PRINT "Code translation:"
  15. FOR i% = 1 TO LEN(code$) 'loop through the code
  16.     cnt = cnt + 1
  17.     'IF cnt MOD 100000 = 0 THEN PRINT cnt; " ";
  18.  
  19.     instruction$ = MID$(code$, i%, 1) 'get the instruction we're on
  20.     SELECT CASE instruction$
  21.         CASE "+" ' +
  22.             memory%(ptr%) = memory%(ptr%) + 1
  23.         CASE "-" ' -
  24.             memory%(ptr%) = memory%(ptr%) - 1
  25.         CASE "."
  26.             'BEEP
  27.             'IF memory%(ptr%) < 1 OR memory%(ptr%) > 255 THEN
  28.             PRINT "[" + LTRIM$(STR$(memory%(ptr%))) + "]";
  29.               'check the translation
  30.             PRINT " = "; MID$(trans$, printIndex, 1)
  31.             printIndex = printIndex + 1
  32.             'ELSE
  33.             'PRINT CHR$(memory%(ptr%));
  34.             'END IF
  35.         CASE ">"
  36.             ptr% = ptr% + 1
  37.             IF ptr% > memsize% THEN
  38.                 PRINT "Memory pointer out of range"
  39.                 SLEEP
  40.                 END
  41.             END IF
  42.         CASE "<"
  43.             ptr% = ptr% - 1
  44.             IF ptr% < 0 THEN
  45.                 PRINT "Memory pointer out of range"
  46.                 SLEEP
  47.                 END
  48.             END IF
  49.         CASE "["
  50.             IF memory%(ptr%) = 0 THEN
  51.                 bktCnt% = 1 'count the bracket we're on
  52.                 i% = i% + 1 'move the code pointer to the next char
  53.                 WHILE bktCnt% <> 0
  54.                     'count nested loops till we find the matching one
  55.                     IF MID$(code$, i%, 1) = "]" THEN bktCnt% = bktCnt% - 1
  56.                     IF MID$(code$, i%, 1) = "[" THEN bktCnt% = bktCnt% + 1
  57.                     i% = i% + 1 'search forward
  58.                     IF i% > LEN(code$) THEN PRINT "i% exceeded upper bound of code, goodbye.": END '<<< added boundary check
  59.                 WEND
  60.             END IF
  61.         CASE "]"
  62.             IF memory%(ptr%) <> 0 THEN
  63.                 bktCnt% = -1 'count the bracket we're on
  64.                 i% = i% - 1 'move the code pointer back a char
  65.                 WHILE bktCnt% <> 0
  66.                     'count nested loops till we fine the matching one
  67.                     IF MID$(code$, i%, 1) = "]" THEN bktCnt% = bktCnt% - 1
  68.                     IF MID$(code$, i%, 1) = "[" THEN bktCnt% = bktCnt% + 1
  69.                     i% = i% - 1 'search backwards
  70.                     IF i% < 0 THEN PRINT "i% exceeded lower bound of code, goodbye.": END  '<<< added boundary check
  71.                 WEND
  72.             END IF
  73.     END SELECT
  74.  
  75.  
  76. PRINT "Loopcount:"; cnt

Could the hanging be a result of taking way, way, way more time to access items in a Long array as compared to an Integer? Array?
« Last Edit: September 11, 2018, 04:48:40 pm by bplus »

Marked as best answer by bplus on September 11, 2018, 02:58:53 pm

FellippeHeitor

  • Guest
Re: Program hangs unexpectedly with Type change
« Reply #5 on: September 11, 2018, 05:02:52 pm »
The program doesn't crash when you use LONG type for the memory() array. It just runs indefinitely because it never manages to close the [] loop.

You see it conclude faster with INTEGER because when the value reaches < -32768 it overflows back to 32767, and runs less until the loop gets closed.

Apparently, brainf*ck requires values to overflow below zero into 255 and above 255 into 0. From the wikipedia article on the language: "In the classic distribution, the cells are of 8-bit size (cells are bytes), and this is still the most common size."

To fix your program (and to properly translate Zeppelin's message), you need to have memory() be of type _UNSIGNED _BYTE:

Code: QB64: [Select]
  1. DIM memsize%, instChars$, ptr%, code$
  2. DIM i%, instruction$
  3. DIM bktCnt%
  4.  
  5. memsize% = 20000
  6. instChars$ = "+-<>.,[]" 'valid characters
  7. ptr% = 0 'memory pointer
  8. code$ = "++[---------->+<]>.-[++++>---<]>.-[---->+<]>++.---[----->++<]>.-------------.----.+++++++++++.[++>---<]>--.+[----->+<]>+.-------------.++++++++++++.--------.--[--->+<]>-.-[--->++<]>-.++++++++++.+[---->+<]>+++.++++++[->++<]>+.-[------>+<]>-.--[--->+<]>---.-------.-[++>---<]>+.--[->++<]>-.+[--->++<]>+"
  9.  
  10. DIM memory(memsize%) AS _UNSIGNED _BYTE 'fixed by Fellippe
  11.  
  12. PRINT "Code translation:"
  13. r = CSRLIN
  14. c = POS(0)
  15. FOR i% = 1 TO LEN(code$) 'loop through the code
  16.     instruction$ = MID$(code$, i%, 1) 'get the instruction we're on
  17.     LOCATE 1, 30
  18.     PRINT "i%="; i%, "ptr%="; ptr%, memory(ptr%)
  19.     SELECT CASE instruction$
  20.         CASE "+" ' +
  21.             memory(ptr%) = memory(ptr%) + 1
  22.         CASE "-" ' -
  23.             memory(ptr%) = memory(ptr%) - 1
  24.         CASE "."
  25.             LOCATE r, c
  26.             IF memory(ptr%) < 1 OR memory(ptr%) > 255 THEN
  27.                 'PRINT "?";
  28.                 PRINT "[" + LTRIM$(STR$(memory(ptr%))) + "]";
  29.             ELSE
  30.                 PRINT CHR$(memory(ptr%));
  31.             END IF
  32.             r = CSRLIN
  33.             c = POS(0)
  34.         CASE ">"
  35.             ptr% = ptr% + 1
  36.             IF ptr% > memsize% THEN
  37.                 PRINT "Memory pointer out of range"
  38.                 SLEEP
  39.                 END
  40.             END IF
  41.         CASE "<"
  42.             ptr% = ptr% - 1
  43.             IF ptr% < 0 THEN
  44.                 PRINT "Memory pointer out of range"
  45.                 SLEEP
  46.                 END
  47.             END IF
  48.         CASE "["
  49.             IF memory(ptr%) = 0 THEN
  50.                 bktCnt% = 1 'count the bracket we're on
  51.                 i% = i% + 1 'move the code pointer to the next char
  52.                 WHILE bktCnt% <> 0
  53.                     'count nested loops till we find the matching one
  54.                     IF MID$(code$, i%, 1) = "]" THEN bktCnt% = bktCnt% - 1
  55.                     IF MID$(code$, i%, 1) = "[" THEN bktCnt% = bktCnt% + 1
  56.                     i% = i% + 1 'search forward
  57.                 WEND
  58.             END IF
  59.         CASE "]"
  60.             IF memory(ptr%) <> 0 THEN
  61.                 bktCnt% = -1 'count the bracket we're on
  62.                 i% = i% - 1 'move the code pointer back a char
  63.                 WHILE bktCnt% <> 0
  64.                     'count nested loops till we find the matching one
  65.                     IF MID$(code$, i%, 1) = "]" THEN bktCnt% = bktCnt% - 1
  66.                     IF MID$(code$, i%, 1) = "[" THEN bktCnt% = bktCnt% + 1
  67.                     i% = i% - 1 'search backwards
  68.                 WEND
  69.             END IF
  70.     END SELECT
  71.  

Especially because that'll keep the result inside the ASCII realm.

BTW: I got to see how the program was going wacko by monitoring the values on screen. You'll see the print statements I left behind in the code above.
« Last Edit: September 11, 2018, 05:13:16 pm by FellippeHeitor »

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Program hangs unexpectedly with Type change
« Reply #6 on: September 11, 2018, 05:52:29 pm »
Thank you Fellippe for checking this out. Thank you for your time and clear explanation.

I don't recall ever seeing a Type used like that, very interesting! That may come in handy.

FellippeHeitor

  • Guest
Re: Program hangs unexpectedly with Type change
« Reply #7 on: September 11, 2018, 06:02:09 pm »
In QBasic you'd get an error. In QB64 we avoid the error and the value gets reset.