Modulinos: Difference between revisions

m
→‎{{header|REXX}}: changed/added comments, changed a variable name.
m (Fix naming convention to be more standard, avoid java's jconsole, simplify code)
m (→‎{{header|REXX}}: changed/added comments, changed a variable name.)
Line 1,347:
 
=={{header|REXX}}==
<lang rexx>/*REXX program to detectdetects whether or not it is a "scripted main" program. */
parse source . howInvoked . /*ask REXX how we got invoked.*/
if howInvoked \== "COMMAND" then exit 0 /*if not a COMMAND, just exit.*/
 
/* ╔════════════════════════════════════════════════════════════╗
parse upper source . howInvoke .
At this point, we know that this program was invoked via
if howInvoke \== 'COMMAND' then do
the "command line" and not via another program. /* maybe say something here? */
╚════════════════════════════════════════════════════════════╝ */
return ''
 
end
say 'and away we go ...···'</lang>
/* ┌────────────────────────────────────────────────┐
Note: &nbsp; Actually another program can invoke the above (ma.rex) as a command:
│ At this point, we know that this program was │
<lang rexx>'rexx ma'</lang>
│ invoked via the "command line" and not via │
│ another program. │
└────────────────────────────────────────────────┘ */
say 'and away we go ...'</lang>
Note:
Actually another program can invoke the above (ma.rex) as a command:
<lang>'rexx ma'</lang>
 
=={{header|Ruby}}==