Command-line arguments: Difference between revisions
Content added Content deleted
m (→{{header|Phix}}: added p2js output) |
|||
Line 1,825: | Line 1,825: | ||
=={{header|Phix}}== |
=={{header|Phix}}== |
||
<!--<lang Phix>--> |
<!--<lang Phix>(phixonline)--> |
||
<span style="color: #008080;">with</span> <span style="color: #008080;">javascript_semantics</span> |
|||
<span style="color: #008080;">constant</span> <span style="color: #000000;">cmd</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">command_line</span><span style="color: #0000FF;">()</span> |
<span style="color: #008080;">constant</span> <span style="color: #000000;">cmd</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">command_line</span><span style="color: #0000FF;">()</span> |
||
<span style="color: #0000FF;">?</span><span style="color: #000000;">cmd</span> |
<span style="color: #0000FF;">?</span><span style="color: #000000;">cmd</span> |
||
Line 1,843: | Line 1,844: | ||
When compiled, the first two elements are instead {executable,executable}, so the parameters (if any) are consistently the 3rd element onwards. |
When compiled, the first two elements are instead {executable,executable}, so the parameters (if any) are consistently the 3rd element onwards. |
||
{{out}} |
{{out}} |
||
desktop/Phix (Windows, Linux would be fairly similar but obviously with different paths): |
|||
<pre> |
<pre> |
||
C:\Program Files (x86)\Phix>p testcl -c "alpha beta" -h "gamma" |
C:\Program Files (x86)\Phix>p testcl -c "alpha beta" -h "gamma" |
||
Line 1,869: | Line 1,871: | ||
#6 : gamma |
#6 : gamma |
||
C:\Program Files (x86)\Phix> |
C:\Program Files (x86)\Phix> |
||
</pre> |
|||
pwa/p2js: No apologies from me for the gibberish in user agent strings these days, most of which I've manually trimmed away/replaced with "..)...".<br> |
|||
There isn't really a command line, and in fact command_line() within a browser always returns a result of exactly length 2. |
|||
<pre> |
|||
{"Mozilla/5.0 (Windows NT 10.0; WOW64..)...","file:///C:/Program%20Files%20(x86)/Phix/pwa/test.htm"} |
|||
Interpreted (using Mozilla/5.0 (Windows NT 10.0; WOW64..)...) source name: file:///C:/Program%20Files%20(x86)/Phix/pwa/test.htm |
|||
</pre> |
</pre> |
||