Call a foreign-language function: Difference between revisions

Content added Content deleted
m (→‎{{header|REXX}}: changed whitespace and used a template for the output section.)
Line 2,226: Line 2,226:
=={{header|REXX}}==
=={{header|REXX}}==
The use of the   '''address'''   statement isn't normally required, but it's shown here as an illustrative example.
The use of the   '''address'''   statement isn't normally required, but it's shown here as an illustrative example.
<lang rexx>/*REXX program calls (invoke) a "foreign" (non-REXX) language routine/program.*/
<lang rexx>/*REXX program calls (invoke) a "foreign" (non-REXX) language routine/program. */


cmd = "MODE" /*define the command that is to be used*/
cmd = "MODE" /*define the command that is to be used*/
opts= 'CON: CP /status' /*define the options to be used for cmd*/
opts= 'CON: CP /status' /*define the options to be used for cmd*/


address 'SYSTEM' cmd opts /*invoke a cmd via the SYSTEM interface*/
address 'SYSTEM' cmd opts /*invoke a cmd via the SYSTEM interface*/


/*stick a fork in it, we're all done. */</lang>
/*stick a fork in it, we're all done. */</lang>
'''output''' &nbsp; when executing under a Microsoft Windows system in the USA:
{{out|output|text=&nbsp; when executing under a Microsoft Windows system in the USA:}}
<pre>
<pre>
Status for device CON:
Status for device CON: