home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
rexxlb.zip
/
SAMPLES
/
SAMPLES.DOC
< prev
next >
Wrap
Text File
|
1994-09-01
|
7KB
|
167 lines
REXXLIB for OS/2 - SAMPLES.DOC
September 1, 1994
Here is a brief description of the sample REXX programs included in this
directory. Most of these programs, such as TREED2, ENVED, and TRAVERSE,
can be of immediate practical use. A few such as MENUS, are included as
examples of coding techniques.
Try using the RXGREP.CMD program if you want to find which of these
examples illustrate the use of any given REXXLIB function.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ATTENTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Before you can run any REXX programs that use REXXLIB, you must register
the functions with the operating system. The following statements placed
in a REXX program will do this:
call rxfuncadd 'rexxlibregister', 'rexxlib', 'rexxlibregister'
call rexxlibregister
call rxfuncadd 'w_register', 'rxwin30', 'rxwindow'
call w_register
Examples that use RXWINDOW do this registration themselves. However, the
examples do NOT make calls to register REXXLIB functions. Instead of
placing these statements in every program that uses REXXLIB, we
recommend that you execute these from a REXX program that is run only
once when the system is loaded. The easiest way to do this is with a
STARTUP.CMD file. If you do not already have one, simply place the above
lines in a file called STARTUP.CMD. Provide a REXX comment (/* ... */)
as the first line of the file. And place the file in a directory listed
in your path. STARTUP.CMD will then run every time the system is loaded,
and all of the REXXLIB functions will be registered.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*** ANOTE.CMD
ANOTE annotates a disk file using extended attributes. It calls a text
editor in order to allow creation of notes that can be attached to a
file. The information is stored in the extended attributes of the file.
If annotations already exist, they are displayed in the editor.
*** ASC2PS.CMD
ASC2PS prints an ASCII file on a Postscript printer.
*** ASCII.CMD
ASCII displays a chart of ASCII characters.
*** BLAST.CMD
BLAST deletes all files in a given directory and all its subdirectories,
and deletes then deletes the directory and its subdirectories. It is
capable of handling hidden, system, and read-only files.
*** CMPDIR.CMD
CMPDIR compares the date & time of all files in one directory to that of
corresponding files in another directory, and shows which files have
earlier, later, or identical dates. The first argument may also include
a file name with wildcards.
*** COPYEX.CMD
COPYEX copies a group of files except for specified extensions. The
extensions to be excluded are read from the keyboard.
*** DELCH.CMD
DELCH computes the CRCs of two files that are being compared. The first
file is deleted if the CRCs match.
*** EALIST.CMD
EALIST displays all the extended attribute information for a specified
file.
*** ENVED.CMD
ENVED lets you edit your DOS environment variables. It displays the
current contents of the environment variables, lets you make changes,
and then updates your DOS environment. ENVED uses the RXWINDOW function
package.
*** FINDEA.CMD
FINDEA traverses a tree of directories, starting at specified directory,
searching for all files that have extended attributes.
*** FL.CMD
FL is a command shell that makes extensive use of RXWINDOW. It allows
for listing files according to a number of selection criteria and
selectively performing commands on a single file or group of files.
It is a good illustration of a fairly large REXX application that
involves user interface and keyboard handling.
*** LSDIR.CMD
LSDIR shows directory structure, with file counts and space totals. It
lists all subdirectories in a tree, together with the number of files
each contains and the amount of disk space consumed by the files. If the
directory has subdirectories, the cumulative totals for files and space
in all subdirectories is also shown.
*** MENUS.CMD
MENUS is an example of the use of the RXWINDOW function package to
display and allow selection from dropdown menus.
*** PS4UP.CMD
PS4UP prints an ASCII file on a Postscript printer with 4 pages per
sheet of paper.
*** RXGREP.CMD
RXGREP provides recursive file search using regular expressions. It
searches a specified directory and all subdirectories for files which
contain strings that match a regular expression pattern.
*** SAMPLFLD.CMD
SAMPLFLD illustrates the usage of the W_GET and W_READ functions and
creation of entry fields using RXWINDOW, including the ability to change
field attributes and make protected and masked fields. See ENVED.CMD for
a more useful example that uses entry fields.
*** SERVER.CMD
SERVER is a sample named pipe server using REXXLIB functions. It simply
echoes whatever message is sent to it.
*** SWLIST.CMD
SWLIST demonstrates the use of the DOSSWITCHLIST function to obtain
information about active sessions. Titles, process ids, session ids,
window handles, and program types are listed for each active session.
*** SYNCH.CMD
SYNCH gets two directory trees in synch. It compares two directories, an
"old" version and a "new" version. All files that are newer in the new
directory are copied to the old directory, as are files that don't exist
in the old directory. All files in the old directory that do not exist
in the new directory are deleted. If a file in the old directory is
newer than the file of the same name in the new directory, a
synchronization error is detected, and no changes are made. The result
is that unless there is an error, the two directories have the same
contents. SYNCH loops recursively through all subdirectories of the old
directory.
*** TRAVERSE.CMD
Traverses a directory tree, starting at the current directory, issuing
a specified command in each directory. For example,
traverse erase *.bak
will erase all .BAK files in the current directory and all of its
subdirectories.
*** TREED.CMD
Diagrams the tree structure of a disk with subdirectories. By default it
starts at the root directory of the current drive, but you can specify
the directory to start with as a parameter.
*** TREED2.CMD
This is a more sophisticated version of TREED.CMD. It uses the RXWINDOW
function package to display the tree structure in a window, and lets you
change directories and move around in the directory structure. By
default it starts at the root directory of the current drive, but you
can specify the directory to start with as a parameter.
*** TRYRXWIN.CMD
TRYRXWIN lets you interactively experiment with the functions in the
RXWINDOW package. It prompts you for the functions and parameters you
want to try, and then calls the specified functions. When TRYRXWIN is
invoked, it displays instructions on how to use it.
*** UPDIR.CMD
UPDIR updates a target directory from a given source directory. All
files in the target directory are compared to files of the same name
in the source directory. If they are older, they are replaced by the
newer file from the source directory. No other changes are made.