REXX Tips & Tricks:General
This section contains general information about this document.
History
This document is based on REXX Tips & Tricks by Bernd Schemmer version 3.60 (June 2004)
Sources
All Tips & Tricks mentioned in this document without an accompanying note about citing the source (see Credits) are results of my development of REXX programs.
I tested nearly all source code included in this document while developing my REXX programs.
I've used the following OS/2 versions for the tests:
OS/2 2.1 + ServicePack (German) OS/2 2.11 (German) OS/2 2.99 WARP BETA II (US) OS/2 WARP Version 3.0 (German). OS/2 WARP Version 3.0 Fullpack (US) OS/2 WARP Version 3.0 Fullpack (German) OS/2 WARP Connect (US, w/ & w/o Fixpacks) OS/2 WARP Connect (German, w/ & w/o Fixpacks) OS/2 WARP Server (Beta September 1995, US) OS/2 WARP Version 9.99 Merlin Beta June 96 OS/2 WARP Version 4 (US w/ & w/o Fixpacks) OS/2 WARP Version 4.5 CP2 (US w/ & w/o Fixpacks)
Used Material
Used Material
I've used material from the following individuals in this document:
- Detlev Ahlgrimm - MATCH function in REXX
- Peter Bunney - Change the WPS archive flag
- B.E. Chi - Math. functions
- Ian Collier - Shellsort routine - 2 -
- Albert Crosby - CMDLINE.CMD
- Phil Dumitru - Object IDs of Network applications
- Rony Flatscher - Another sort routine
- Richard K. Goran - Source code, hints and a more
- Georg Haschek - Get the desktop directory, Get a list of all printers
- Ned Konz - Set or get the WPS lockup password
- Jamie Hoglund - Get the current cursor position
- Bruce E. Högman - Get the current boot drive
- Ross Patterson - SOUNDEX routine(s)
- Steve Pitts - Shellsort routine - 1 -, Unpack packed data
- Andreas Pohlmann - Flexible Quick sort
- Yuri Pogrebnyak - base64 decoder, base64 encoder, and the base64 decoder routine in Template for an installation program
- Bob Price - SQRT routine
- Bernie Schneider - sprintf routine for REXX
- Dirk Terrell - Heapsort routine
- Ruediger Wilke - Fast Quick sort
- John Wunderlin - Read a file using CharIn()
Hints and Bug Reports
This section contains a list of all users who send me new material for RXT&T, hints, and bug reports regarding RXT&T.
Boess, Tilmann (see EMail Addresses) bug report about The DETACH command Berghaus, Robert (see EMail Addresses) Correction forConvert values from/to INTEL format and Delete a directory(-tree) Boll, Dave (see EMail Addresses) Additional information about his REXX packages Daney, Charles (see EMail Addresses) Bug report Danvers, Robert (see EMail Addresses) A lot of corrections for spelling errors Davis, Thos (see EMail Addresses) Additional information about using DrDialog with Object-Oriented REXX Duerbusch, Tom Bug in the section Closing files Eymont, Voytek (see EMail Addresses) Bug reports and new information Geus, Marcus De (see EMail Addresses) information about his web page Goran, Dick (see EMail Addresses) Various bug reports Groves Jr., Don E. (see EMail Addresses) bug report Hadam, Martin (see EMail Addresses) New Information for RXT&T. Hanoian, Martin S. (see EMail Addresses) Information about the OS/2 Shareware BBS and bug reports Heidelbach, Oliver (see EMail Addresses) Convert ASCII 850 string into/from ISO 8859-1 (1004) string, Count lines in a file quickly - 2 - Hessling, Mark (see EMail Addresses) Some corrections and additional information about his REXX packages Hicks, Dave (see EMail Addresses) see the forewords for version 1.70, version 2.00, and version 2.80 Langanke, Christian (see EMail Addresses) The keyword ICONRESOURCE Lemon, Barry (see EMail Addresses) Additional information for Parameter eaten by the CMD.EXE Levine, Steven (see EMail Addresses) New infos for PMDll and a new text for the readme file Mahoney, Robert (see EMail Addresses) Additional information about his REXX packages Maerkisch, Bastian (see EMail Addresses) VX/REXX Buglist Mediavilla, David Some bug corrections Michelinakis, Dimitris 'sehh' (see EMail Addresses) Some bug corrections Platschek, Michael (see EMail Addresses) The function SysDestroyObject, Check if a program is running (using RXU.DLL) Plungjan, Michel (see EMail Addresses) Writing OS independent programs and bug reports Pollak, Michael (see EMail Addresses) Information about GNU Regina - REXX for DOS Pool, Arthur (see EMail Addresses) the section Investigate the overheads of function calls, and various corrections for the sort algorithms and other sections Putman, Harold (see EMail Addresses) correction for the section Internet -- WWW, Using REXX queues for global variables Romain, Petges (see EMail Addresses) Using REXX queues to simulate a semaphore Rosenau, Herbert (see EMail Addresses) Bug reports for RXT&T Salak, Juraj (see EMail Addresses) bug report for Get a name for a temporary file Seitz, John (see EMail Addresses) SysCls Semo, Mario (see EMail Addresses) Bug reports for Object REXX (OS/2 & NT version) Schneller, Erik (see EMail Addresses) Check if ANSI is active - 2 - Schwarz, Armin (see EMail Addresses) Information about using SHUTDWN.EXE Sperper, Wolfram (see EMail Addresses) Get the object ID for an object handle Staedtler, Klaus (see EMail Addresses) various hints Ulrich, Ralf (see EMail Addresses) Hint for MATCH function in REXX, Sample code for parameter parsing, and other information
Icons Used in REXX Tips & Tricks
The following icons are used throughout REXX Tips & Tricks for special purposes. Double-click each icon when you come to it. When activated by the double click, the icon tells RXT&T to do one of the following:
start the OS/2 system editor (the E editor) displaying the file whose filename appears to the left of the icon
open the codemenu (i.e., the small window containing the five icons -- E editor, cmd.exe shell window, REXXTRY program, and launch REXX program in PMREXX)
execute imbedded REXX statements using REXXTRY
execute imbedded REXX statements using PMREXX with the parameter /Q.
http://www.ibm.com Open the web site left from the icon in a browser. This icon calls the program rxttwww.cmd with the approbiate parameters. Please note that the program rxttwww.cmd must be available through the path. An example for rxttwww.cmd is here
ftp://ftp.ibm.com Open the ftp site left from the icon in a browser. This icon calls the program rxttwww.cmd with the approbiate parameters. Please note that the program rxttwww.cmd must be available through the path. An example for rxttwww.cmd is here
comp.lang.rexx Open the newsgroup in a newsgroup reader. This icon calls the program rxttwww.cmd with the approbiate parameters. Please note that the program rxttwww.cmd must be available through the path. An example for rxttwww.cmd is here
Bernd.Schemmer@gmx.de Open a mail program with the mail address left from the icon. This icon calls the program rxttwww.cmd with the approbiate parameters. Please note that the program rxttwww.cmd must be available through the path. An example for rxttwww.cmd is here
Hyperlinks to other INF files are marked with a leading <-�. For example, the link �<- DATE points to the description of the REXX function date() in the REXX Online documentation.
Sample rxttwww.cmd
/* -------------------------------------------------------------------------- See Icons Used in REXX Tips & Tricks for a description of this program. The sample cmd uses NETSCDDE.EXE from the XWorkplace package. see Using the samples for how to extract this code. -------------------------------------------------------------------------- */ /* Dispatcher for calling internet programs from within REXX Tips & Tricks */ /* */ /* Usage: */ /* */ /* rxttwww is called by VIEW.EXE with the following parameters: */ /* */ /* http www_address */ /* news newsgroup */ /* ftp ftp_address */ /* mail mailAddress */ /* cis CISAddress */ /* fido FidoAddress */ /* */ /* Examples: */ /* */ /* rxttwww http www.ibm.com */ /* rxttwww news comp.lang.rexx */ /* rxttwww ftp ftp.ibm.com */ /* rxttwww mail Bernd.Schemmer@gmx.de */ /* rxttwww cis 100104,613 */ /* */ /* */ /* Note: */ /* */ /* */ /* This sample file uses the program NETSCDDE.EXE from the XWorkplace */ /* package. */ /* */ parse arg action iAdress progDesc = 'rxttwww - Dispatcher for REXX Tips & Tricks' select when action = 'http' then do /* called to show a web site */ /* ------------------------- */ /* call Netscape using NETSCDDE.EXE from the */ /* XWorkplace package */ '@netscdde.exe -Xn http://' || iAdress end /* when */ when action = 'ftp' then do /* called to show a ftp site */ /* ------------------------- */ /* call Netscape using NETSCDDE.EXE from the */ /* XWorkplace package */ '@netscdde.exe -Xn ftp://' || iAdress end /* when */ when action = 'news' then do /* called to show a newsgroup */ /* -------------------------- */ /* call Netscape using NETSCDDE.EXE from the */ /* XWorkplace package */ '@netscdde.exe -Xn news://' || iAdress end /* when */ when action = 'mail' then do /* called to write an email to an internet address */ /* ----------------------------------------------- */ /* call Netscape using NETSCDDE.EXE from the */ /* XWorkplace package */ '@netscdde.exe -Xn mailto:' || iAdress end /* when */ when action = 'cis' then do /* called to write an email to a CIS address */ /* ----------------------------------------- */ /* convert the CIS address to an internet address */ parse var iAdress part1 ',' part2 iAdress = strip( part1 ) || '.' || strip( part2 ) || '@compuserve.com' /* call Netscape using NETSCDDE.EXE from the */ /* XWorkplace package */ '@netscdde.exe -Xn mailto:' || iAdress end /* when */ when action = 'fido' then do /* called to write an email to a FIDO address */ /* ------------------------------------------ */ say progDesc say say 'Error: I do not know how to handle FIDO addresses!' say say 'Press ENTER to exit' parse pull end /* when */ otherwise do /* called with a unknown keyword */ /* ----------------------------- */ say progDesc say say 'Error: Invalid arguments: "' || action iAdress || '"' say say 'Press ENTER to exit' parse pull end /* otherwise */ end /* select */ '@exit'