Shell "dir" -- I expected something, but .. - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10) +---- Thread: Shell "dir" -- I expected something, but .. (/showthread.php?tid=315) |
Shell "dir" -- I expected something, but .. - dcromley - 05-03-2022 I expect to be humbled by this thread, but I expected something from the "dir" but get only "A" and "B". Where is the output going? Code: (Select All) Print "A" RE: Shell "dir" -- I expected something, but .. - SMcNeill - 05-03-2022 To the console, where SHELL directs it to. Try: SHELL "dir>temp.txt" Then you can OPEN "temp.txt" FOR INPUT AS #1 and read the contents of the file into your program. RE: Shell "dir" -- I expected something, but .. - dcromley - 05-03-2022 Notice that it is in the middle of the night here (Wyoming). I was thinking about this -- I MAY have thought of your ">" answer. Quote:dcromley: Where is the output going? What console? A better question is, what happens to that console? Does it exist and then disappear? (yes) How can I make it wait? I googled "dos multi statement" and was led to https://stackoverflow.com/questions/8055371/. "&" What is the DOS "wait" command? More searching. "pause" So, a program of interest is: Code: (Select All) Print "A" This shows my program console AND the SHELL console. Hitting "any key" (twice?) in the SHELL window ends that process and "returns" back to the QB64 window to print the "B". The bottom line is that your ">" suggestion is the way to get SHELL output. Thanks. RE: Shell "dir" -- I expected something, but .. - SMcNeill - 05-03-2022 Normally a little console program like this simply opens and closes so fast that we never see it. If you want to view the console in QB64, try it like this: Code: (Select All) $Console RE: Shell "dir" -- I expected something, but .. - dcromley - 05-03-2022 |