Modulinos: Difference between revisions

→‎{{header|REXX}}: updated the program's boxed comment to reflect that any program utilization the "command interface" can also seem like the program was invoked via the command line (interface).
(Added Sidef)
(→‎{{header|REXX}}: updated the program's boxed comment to reflect that any program utilization the "command interface" can also seem like the program was invoked via the command line (interface).)
Line 1,323:
 
=={{header|REXX}}==
<lang rexx>/*REXX program detects whether or not it is a "scripted main" program. */
parse source . howInvoked . @fn /*askquery REXX how wethis pgm got invoked. */
if howInvoked \== "COMMAND" then exit 0 /*if not a COMMAND, just exit.*/
 
say 'This program ('@fn") was invoked as a: " howInvoked
/* ╔════════════════════════════════════════════════════════════╗
║ At this point, we know that this program was invoked via ║
║ the "command line" and not via another program. ║
╚════════════════════════════════════════════════════════════╝ */
 
if howInvoked\=='COMMAND' then do
say 'and away we go ···'</lang>
say 'This program ('@fn") wasn't invoked via a command."
Note: &nbsp; Actually another program can invoke the above (ma.rex) as a command:
exit 12
<lang rexx>'rexx ma'</lang>
end
 
/*╔════════════════════════════════════════════════════════════════════════════════╗
║ At this point, we know that this program was invoked via the "command line"
or a program using the "command lineinterface" and not via another program.
╚════════════════════════════════════════════════════════════════════════════════╝*/
 
/*────────────────────────────── The main code follows here ... ────────────────────────*/
say
say '(from' @fn"): and away we go ···'"</lang> <br><br>
 
=={{header|Ring}}==