This was a surprise to me...
foo w
:Select w
:Case 0
⎕CMD'notepad.exe' ''
∘ ⍝ Stop after 2-element
:Case 1
⎕CMD'notepad.exe'
∘ ⍝ Stop after 1-element
:EndSelect
Doesn't seem to be documented. Wondering whether it's a bug or a feature. APL/W-64 12.1 Windows 7.
Apologies for timewasting if it is well-recognised behaviour.
A Welcome Surprise with ⎕CMD
- Dick Bowman
- Posts: 235
- Joined: Thu Jun 18, 2009 4:55 pm
- Contact:
A Welcome Surprise with ⎕CMD
Visit http://apl.dickbowman.com to read more from Dick Bowman
Re: A Welcome Surprise with ⎕CMD
I have no idea what "element" means; certainly not the options, because than 2 would be either 0 or 1 and 1 might actually be 1 - or 2.
I also wonder what exactly you are surprised about...
I also wonder what exactly you are surprised about...
Re: A Welcome Surprise with ⎕CMD
foo 0 runs ⎕cmd with two elements and control passes back to APL immediately leaving notepad running concurrently.
foo 1 runs ⎕cmd with one element and waits for notepad to complete.
Yes, it is documented, or at least I knew about it so I must have gained that knowledge from somewhere.
Ah here we are:
Lang Ref - System functions - System Operations - Windows Command
Executing a windows Command (simple string)
Executing a Windows Program (two strings)
foo 1 runs ⎕cmd with one element and waits for notepad to complete.
Yes, it is documented, or at least I knew about it so I must have gained that knowledge from somewhere.
Ah here we are:
Lang Ref - System functions - System Operations - Windows Command
Executing a windows Command (simple string)
Executing a Windows Program (two strings)