REXX Tips & Tricks:Miscellaneous: Difference between revisions
mNo edit summary |
|||
Line 16: | Line 16: | ||
All parameters, except ''rexxprogram'', are optional. | All parameters, except ''rexxprogram'', are optional. | ||
Using PMREXX with the parameter /Q is useful for simple programs which only need to show a PM messagebox (using RxMessageBox). For an example see [[Saving the Desktop (3.0)]] | Using PMREXX with the parameter /Q is useful for simple programs which only need to show a PM messagebox (using RxMessageBox). For an example see [[REXX Tips & Tricks:Change_the_WPS_with_REXX#Save_the_Desktop|Saving the Desktop (3.0)]] | ||
(see [[REXX Tips & Tricks:General hints for REXX#Run a REXX program under a specific environment|Run a REXX program under a specific environment]] on how to force a program to run under PMREXX) | (see [[REXX Tips & Tricks:General hints for REXX#Run a REXX program under a specific environment|Run a REXX program under a specific environment]] on how to force a program to run under PMREXX) |
Revision as of 04:32, 16 December 2019
This section contains some further useful information.
Using PMREXX
The syntax for PMREXX is:
>>──PMREXX───┬────┬──┬─────────────┬─┬───────────┬─>< ├─/Q─┤ └─rexxprogram─┘ └─parameter─┘ └─/T─┘
Where:
- /Q
- Close PMREXX after the REXX program ends (no "The program has ended" message box)
- /T
- Start PMREXX in trace mode
- rexxprogram
- Name of the rexx program
- parameter
- Parameter for the REXX program
All parameters, except rexxprogram, are optional.
Using PMREXX with the parameter /Q is useful for simple programs which only need to show a PM messagebox (using RxMessageBox). For an example see Saving the Desktop (3.0)
(see Run a REXX program under a specific environment on how to force a program to run under PMREXX)
Please note that you cannot use OS/2 commands that change the environment in a REXX program running under PMREXX. You have to use a similar REXX function for that purpose (e.g. directory() instead of CD, VALUE() instead of SET, etc.).
Warning: The default address environment for a REXX program started via PMREXX in WARP 3 is PMREXX; the default environment in WARP 4 is CMD. Therefore, you cannot distinguish between the environments using ADDRESS() in WARP 4!
- Note
- see also PMPopup/2 if you only want to use simple dialog boxes in REXX programs.
The RXQUEUE filter
ANSI ESC Sequences
"Compiling" REXX programs
Prevent REXX from creating a token image
Set the read-only attribute of REXX cmds for which the REXX interpreter should not create a token image (or copy them to a read-only disk or to a filesystem not supporting Extended Attributes).
"Undocumented" REXX functions
The following REXX functions to work with DBCS mixed Strings are only documented in the IBM: OS/2 2.0 Procedures Language/2 Reference Manual and in the Object-Oriented REXX online documentation:
- DBADJUST
- DBBRACKET
- DBCENTER
- DBLEFT
- DBRIGHT
- DBRLEFT
- DBRRIGHT
- DBTODBCS
- DBTOSBCS
- DBUNBRACKET
- DBVALIDATE
- DBWIDTH
Well, for the "normal" REXX programmer only two of these functions are interesting (The functions also work with SBCS strings):
Name DBRLEFT( string, n {,option} ) Function Delete n chars beginning with the first char Example DBRLEFT( "ABCDEFG", 2 ) gives "CDEFG" Note The parameter option is only needed for DBCS strings) For SBCS strings you should not use this parameter.
Name DBRRIGHT( string, n {,option} ) Function Delete n chars beginning with the last char Example DBRRIGHT( "ABCDEFG", 3 ) gives "ABCD" Note The parameter option is only needed for DBCS strings) For SBCS strings you should not use this parameter.