Modulinos: Difference between revisions

Content added Content deleted
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: Line 1,347:


=={{header|REXX}}==
=={{header|REXX}}==
<lang rexx>/*REXX program to detect whether or not it is a "scripted main" program.*/
<lang rexx>/*REXX program detects 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
/* maybe say something here? */
the "command line" and not via another program.
╚════════════════════════════════════════════════════════════╝ */
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}}==
=={{header|Ruby}}==