Page 1 of 1

A Welcome Surprise with ⎕CMD

Posted: Tue Jul 13, 2010 4:24 pm
by Dick Bowman
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.

Re: A Welcome Surprise with ⎕CMD

Posted: Tue Jul 13, 2010 4:50 pm
by kai
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...

Re: A Welcome Surprise with ⎕CMD

Posted: Wed Jul 14, 2010 6:29 am
by Phil Last
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)