Modulinos: Difference between revisions
Content added Content deleted
(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: | Line 1,323: | ||
=={{header|REXX}}== |
=={{header|REXX}}== |
||
<lang rexx>/*REXX program detects 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 |
parse source . howInvoked @fn /*query REXX how this pgm got invoked. */ |
||
if howInvoked \== "COMMAND" then exit 0 /*if not a COMMAND, just exit.*/ |
|||
say 'This program ('@fn") was invoked as a: " howInvoked |
|||
/* ╔════════════════════════════════════════════════════════════╗ |
|||
⚫ | |||
⚫ | |||
╚════════════════════════════════════════════════════════════╝ */ |
|||
if howInvoked\=='COMMAND' then do |
|||
⚫ | |||
say 'This program ('@fn") wasn't invoked via a command." |
|||
Note: Actually another program can invoke the above (ma.rex) as a command: |
|||
exit 12 |
|||
<lang rexx>'rexx ma'</lang> |
|||
end |
|||
/*╔════════════════════════════════════════════════════════════════════════════════╗ |
|||
⚫ | |||
⚫ | |||
╚════════════════════════════════════════════════════════════════════════════════╝*/ |
|||
/*────────────────────────────── The main code follows here ... ────────────────────────*/ |
|||
say |
|||
⚫ | |||
=={{header|Ring}}== |
=={{header|Ring}}== |