Introduction
Who This Book Is For
REXX Background
Hardware And Software
Writing The Book
Conventions
Ideas
The Lawyer Said...
Summary
Chapter 1 Getting Started
Before You Can Use REXX
On-Line Information
OS/2 Enhanced Editor
It's ASCII
Starting The Enhanced Editor
Basic Editing
Intermediate Editing
Advanced Editing
Keeping It Simple
Executing A REXX Program
Creating A Subdirectory And
Modifying Your Path
Using A Command Line
Using An Icon
More On Icons
Icon Editor
Installing An Icon
Have A Disk File Ready
Create A New Icon
Paste An Existing Icon
Drop-And-Drag An Icon
Summary
Chapter 2 Language Overview
Components Of A REXX Program
Token
Reserved Word
Clauses
Statement
File
More On Clauses
Statement Tokenization
It Runs Faster The Second Time!
Summary
Chapter 3 Writing Simple Programs
Variables And Branching
Logic Testing And Looping
Subroutines
Summary
Chapter 4 Interactive REXX
REXXTRY.CMD
PMREXX.EXE
Summary
Chapter 5 Introduction To Variables
Creating Variables
Assigning Values To Variables
Assigning Hexadecimal Values
To Variables
Assigning Binary Values To
Variables
Getting Information From The Command Line
Take Information From Another Variable
Ask The User For Data
Getting Multiple Characters
From The User
Getting A Single Character
From The User
Perform A Mathematical Calculation
Perform A String Manipulation
Variable Arrays
Summary
Chapter 6 Communicating With The User
Basic Communication
Advanced Communications
Positioning The Cursor
Pausing A Program
Clearing The Screen
Non-Visual Communication
Summary
Chapter 7 Including Non-REXX Commands
Running Batch Commands In REXX
CALL Batch Subcommand
CHOICE Batch Subcommand
ECHO Batch Subcommand
Errorlevel
FOR Batch Subcommand
GOTO Batch Subcommand
IF Batch Subcommand
PAUSE Batch Subcommand
REM Batch Subcommand
SHIFT Batch Subcommand
Running External Programs
Summary
Chapter 8 Working With Strings
Variable Typing
String Definition
String Concatenation
Additional String Power With Functions
Summary
Chapter 9 Working With Numbers
Display Rounding
Precision
Exponential Notation
Whole Numbers
Mathematical Operations
Mathematical Precedence
Fuzzyness
Errors
Additional Mathematical Power With Functions
Internal Mathematical-Related
Functions
Summary
Chapter 10 Logic Testing And Looping
IF
Logical Statements
Another Look At IF Statement
Multiple Instructions
Multiple IF-Tests
Multiple IF Statements Using
SELECT Statement
Looping
DO/END Block
Looping A Fixed Number Of
Times
Counting The Loops
Leaving The Loop Early
Leaving The Loop Early: A
Brute Force Way
Looping Forever
Loop Until Some Condition Is
Met
Altering The Loop Counter
Nesting DO Loops
More On Altering The Loop
Summary
Chapter 11 Built-In Functions
Presentation Of Syntax
Application Programming Interfaces Functions
RxFuncAdd
RxFuncDrop
RxFuncQuery
RxQuery
Function Search Order
Bitwise Functions
BitAnd
BitOr
BitXOr
Error-Handling
Condition
ErrorText
SourceLine
Trace
File Management
CharIn
Chars
CharOut
LineIn
LineOut
Lines
Stream
Format Conversion Functions
B2X
C2D
C2X
D2C
D2X
X2B
X2C
X2D
Mathematical
Abs
Max
Min
Digits
Form
Format
Fuzz
Random
Sign
Trunc
Miscellaneous
Address
Beep
Date
DataType
Queued
Symbol
Time
Value
XRange
String Functions
Abbrev
Arg
Center Or Centre
Compare
Copies
DelStr
DelWord
Insert
LastPos
Left
Length
Overlay
Pos
Right
Space
Strip
SubStr
SubWord
Translate
Verify
Word
WordIndex
WordLength
WordPos
Words
Summary
Chapter 12 External Functions
Function Review
Application Programming Interfaces Functions Review
RxFuncAdd
RxFuncDrop
RxFuncQuery
SysDropFuncs
Function Search Order
Controling The Screen
RxMessageBox
SysCls
SysCurPos
SysTextScreenRead
SysTextScreenSize
Dealing With Objects
SysCreateObject
SysDeregisterObjectClass
SysDestroyObject
SysQueryClassList
SysRegisterObjectClass
SysSetObjectData
Disk And File Management
SysDriveInfo
SysDriveMap
SysFileDelete
SysFileTree
SysFileSearch
SysMkDir
SysRmDir
SysSearchPath
SysTempFileName
Extended Attributes
SysGetEA
SysPutEA
Miscellaneous Functions
SysGetKey
SysGetMessage
SysIni
SysOS2Ver
SysSetIcon
SysSleep
SysWaitNamedPipe
Summary
Chapter 13 Keyword Instructions
ADDRESS
ARG
CALL
Arguments Used With CALL
Instruction
Calling Functions
Executing Internal And
External Routines
Error-Handling
Search Order
DO
DROP
EXIT
IF
INTERPRET
ITERATE
LEAVE
NOP
NUMERIC
OPTIONS
PARSE
Parsing Template
PROCEDURE
PULL
PUSH
QUEUE
RETURN
SAY
SELECT
SIGNAL
TRACE
Summary
Chapter 14 Internal Subroutines
Types Of Subroutines
Introduction To Internal Subroutines
A Simple Example
Improving This Simple Example
Adding A Second Subroutine To
The Example
Internal Subroutine Advantages
Goto With SIGNAL
Leaving The Subroutine
Summary Of Internal Subroutine Rules
Saved Information
A More Realistic Example
More On Variable Management In Internal Subroutines
Using Local Variables
Mixing Local And Global
Variables
Local And Global Variables In
Nested Subroutines
Transferring Data Without
Global Variables
Summary
Chapter 15 External Functions
Advantages Of External Subroutines
Accessibility
Cohesion
When Is An External Subroutine
Desirable
Anatomy Of An External Subroutine
Getting The Inputs
Calling The External
Subroutine
Returning A Value
Summary
Chapter 16 Using The External Data Queue
Three Demonstrations
GETDATA.CMD And SENDATA.CMD
GETDATA.CMD Then SENDATA.CMD
SENDATA2.CMD
Understanding External Data Queues
Managing The External Data Queue
Creating A New Queue
Making A Queue Active
Putting Data Into A Queue
Putting Data Into A Queue From
The Command Line
Getting Data From A Queue
Finding The Active Queue
Deleting A Queue
Avoiding Conflicts
Summary
Chapter 17 Exception Handling
What Is Exception Handling?
Do You Always Need Exception Handling?
Types Of Exceptions
Types Of Exception Handling
Adding Exception Handling To A Program
Enabling/Disabling Exception
Handling
Defining Exception Handling
Three Examples
Selecting Between Type I And
II Exception Handlers
Information Available To Exception Handler
Summary
Chapter 18 Debugging
Introduction To Debugging
Passive Tracing
Interactive Tracing
Summary
Chapter 19 Glossary
© 2002 by Ronny Richardson, All Rights Reserved