A Welcome Surprise with ⎕CMD

General APL language issues

A Welcome Surprise with ⎕CMD

Postby Dick Bowman on Tue Jul 13, 2010 4:24 pm

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.
Visit http://apl.dickbowman.com to read more from Dick Bowman
User avatar
Dick Bowman
 
Posts: 235
Joined: Thu Jun 18, 2009 4:55 pm

Re: A Welcome Surprise with ⎕CMD

Postby kai on Tue Jul 13, 2010 4:50 pm

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...
User avatar
kai
 
Posts: 115
Joined: Thu Jun 18, 2009 5:10 pm
Location: Stevenage, UK

Re: A Welcome Surprise with ⎕CMD

Postby Phil Last on Wed Jul 14, 2010 6:29 am

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)
User avatar
Phil Last
 
Posts: 557
Joined: Thu Jun 18, 2009 6:29 pm


Return to Language

Who is online

Users browsing this forum: No registered users and 1 guest