Author Topic: SHELL observation  (Read 2875 times)

0 Members and 1 Guest are viewing this topic.

Offline Timbergetter

  • Newbie
  • Posts: 6
    • View Profile
SHELL observation
« on: October 10, 2020, 06:49:25 pm »
If I run the following 5 commands I get a directory list on the output screen as expected:
Code: QB64: [Select]
  1.    OPEN "runme.bat" FOR OUTPUT AS #1
  2.    PRINT #1, "dir"
  3.    PRINT #1, "pause"
  4.    CLOSE
  5.    SHELL "runme"

However if I run:

Code: QB64: [Select]
  1.    SHELL “dir”

by itself I see the directory listing for a few milliseconds and then a blank output screen.

In QuickBasic 4.5 the SHELL “dir” command does produce a directory listing to the output screen and it remains there.

I am keen to know how to interpret what I am seeing here.
« Last Edit: October 13, 2020, 06:40:13 pm by Timbergetter »

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: SHELL observation
« Reply #1 on: October 10, 2020, 09:08:14 pm »
Code: QB64: [Select]
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline Timbergetter

  • Newbie
  • Posts: 6
    • View Profile
Re: SHELL observation
« Reply #2 on: October 10, 2020, 10:25:25 pm »
Thank you Pete, that’s great feedback.  I see now the added flexibility of the console commands.  So am I right in thinking that shelling to an internal dos command (dir) activates the console but then issues a  _CONSOLE OFF by default?  Whereas shelling to a dos batch command activates the console and leaves  _CONSOLE ON by default.

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: SHELL observation
« Reply #3 on: October 10, 2020, 11:53:33 pm »
You may be right
I may be crazy...

Code: QB64: [Select]

Using START will leave the console open when the QB64 window, hidden with _SCREENHIDE, closes.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline krovit

  • Forum Regular
  • Posts: 179
    • View Profile
Re: SHELL observation
« Reply #4 on: October 12, 2020, 02:43:32 am »
What timing!
I had just now the same problem...

At QB, it seems to me that the management of the SHELL was different. Maybe it was simpler and more direct.

Nothing is easy, especially when it appears simple (and nothing could be as dangerous as trying to do good to others)