Program name: Difference between revisions

Content added Content deleted
(Add NetRexx implementation)
(→‎{{header|REXX}}: added another version that shows various types of invocations and REXX interpreters. -- ~~~~)
Line 1,165: Line 1,165:
b=COMMAND
b=COMMAND
c=RANG1 SYS00056 N561985.PRIV.CLIST ? TSO ISPF ?
c=RANG1 SYS00056 N561985.PRIV.CLIST ? TSO ISPF ?
</pre>

===version with various types of invokes===
Used under Windows/XP and Windows 7 with the following REXXes:
* R4 REXX
* REGINA REXX
* Personal REXX
* ROO REXX
<lang rexx>/*REXX pgm displays the name (& possible path) of the REXX program name.*/
parse version _version
parse source _system _howInvoked _path

say right(_version '◄──►' space(arg(1) arg(2)), 79, '─') /*show title.*/
say " REXX's name of system being used:" _system
say ' how the REXX program was invoked:' _howInvoked
say ' name of the REXX program and path:' _path

if arg()>1 then return 0 /*don't let this program recurse.*/
/*Mama said that cursing is a sin*/
/*invoke ourself with a 2nd arg.*/
call prog_nam , 'subroutine' /*call ourself as a subroutine. */
zz = prog_nam( , 'function') /* " " " " function. */
/*stick a fork in it, we're done.*/</lang>
'''output''' when using '''R4 REXX''' with the input of: <tt> command </tt>
<pre style="overflow:scroll">
───────────────────────────────────────────REXX-r4 4.00 3 Jul 2012 ◄──► command
REXX's name of system being used: Win32
how the REXX program was invoked: COMMAND
name of the REXX program and path: D:\PROG_NAM.REX * * PROG_NAM
────────────────────────────────────────REXX-r4 4.00 3 Jul 2012 ◄──► subroutine
REXX's name of system being used: Win32
how the REXX program was invoked: SUBROUTINE
name of the REXX program and path: D:\PROG_NAM.REX * * PROG_NAM
──────────────────────────────────────────REXX-r4 4.00 3 Jul 2012 ◄──► function
REXX's name of system being used: Win32
how the REXX program was invoked: FUNCTION
name of the REXX program and path: D:\PROG_NAM.REX * * PROG_NAM
</pre>
'''output''' when using '''REGINA REXX''' with the input of: <tt> command </tt>
<pre style="overflow:scroll">
──────────────────────────────REXX-Regina_3.7(MT) 5.00 14 Oct 2012 ◄──► command
REXX's name of system being used: WIN32
how the REXX program was invoked: COMMAND
name of the REXX program and path: D:\prog_nam.rex
───────────────────────────REXX-Regina_3.7(MT) 5.00 14 Oct 2012 ◄──► subroutine
REXX's name of system being used: WIN32
how the REXX program was invoked: SUBROUTINE
name of the REXX program and path: D:\PROG_NAM.rex
─────────────────────────────REXX-Regina_3.7(MT) 5.00 14 Oct 2012 ◄──► function
REXX's name of system being used: WIN32
how the REXX program was invoked: FUNCTION
name of the REXX program and path: D:\PROG_NAM.rex
</pre>
'''output''' when using '''Personal REXX''' with the input of: <tt> command </tt>
<pre style="overflow:scroll">
────────────────────────────────────REXX/Personal 4.00 21 Mar 1992 ◄──► command
REXX's name of system being used: PCDOS
how the REXX program was invoked: COMMAND
name of the REXX program and path: D:\PROG_NAM.REX
─────────────────────────────────REXX/Personal 4.00 21 Mar 1992 ◄──► subroutine
REXX's name of system being used: PCDOS
how the REXX program was invoked: SUBROUTINE
name of the REXX program and path: D:\PROG_NAM.REX
───────────────────────────────────REXX/Personal 4.00 21 Mar 1992 ◄──► function
REXX's name of system being used: PCDOS
how the REXX program was invoked: FUNCTION
name of the REXX program and path: D:\PROG_NAM.REX
</pre>
'''output''' when using '''ROO REXX''' with the input of: <tt> command </tt>
<pre style="overflow:scroll">
─────────────────────────────────────────REXX-roo 4.00 28 Jan 2007 ◄──► command
REXX's name of system being used: Win32
how the REXX program was invoked: COMMAND
name of the REXX program and path: D:\PROG_NAM.REX * * PROG_NAM
──────────────────────────────────────REXX-roo 4.00 28 Jan 2007 ◄──► subroutine
REXX's name of system being used: Win32
how the REXX program was invoked: SUBROUTINE
name of the REXX program and path: D:\PROG_NAM.REX * * PROG_NAM
────────────────────────────────────────REXX-roo 4.00 28 Jan 2007 ◄──► function
REXX's name of system being used: Win32
how the REXX program was invoked: FUNCTION
name of the REXX program and path: D:\PROG_NAM.REX * * PROG_NAM
</pre>
</pre>