Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Shell issues
#5
Shell by itself hangs because it waits for a exit code to continue and return back to your program.  Of course, if you just shell to nothing, there's nothing to return an exit code, and thus it just enters an endless loop waiting for an exit code that will never come.

See this little code snippet for an example:
Code: (Select All)
$Console:Only
Do
    count = count + 1
    Print count
    If count Mod 10 = 0 Then Shell "cmd"
Loop

Run that, it'll print 1 to 10 on the console.   
Then it'll wait for you to type something into the command line.  
Type "EXIT" so the shell ends.  
It'll then continue and print 11 to 20 on the console.
Where it'll then wait for the "EXIT" to be typed to end your use of the command line.

SHELL waits for whatever it shells to to end before it returns control back to QB64.  So a blank SHELL with nothing inside it can't send a termination code, so it's just going to wait forever and ever and ever....



COMSPEC$ doesn't need to be used.  Just SHELL "CMD" as I did above.  It really is that simple.
Reply


Messages In This Thread
Shell issues - by eoredson - 05-05-2025, 03:03 AM
RE: Shell issues - by SMcNeill - 05-05-2025, 04:43 AM
RE: Shell issues - by eoredson - 05-07-2025, 12:26 AM
RE: Shell issues - by ahenry3068 - 05-07-2025, 03:56 AM
RE: Shell issues - by SMcNeill - 05-07-2025, 04:34 AM
RE: Shell issues - by eoredson - 05-07-2025, 04:39 AM
RE: Shell issues - by hsiangch_ong - 05-07-2025, 08:26 AM
RE: Shell issues - by eoredson - 8 hours ago



Users browsing this thread: 1 Guest(s)