home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mega Top 1
/
os2_top1.zip
/
os2_top1
/
APPS
/
PROG
/
REXX
/
REXXTRA
/
RXEXTRAS.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-10-02
|
4KB
|
180 lines
/* RxExtras - test for all functions in RxExtras.DLL */
Address CMD
/* rcy = RxFuncDrop('RxExtra') */
If RxFuncQuery('RxExtra') <> 0 Then
rcy = RxFuncAdd('RxExtra', 'RxExtras', 'RxExtra')
Call RxExtra "Drop" /* Drop everything */
rcy = RxFuncAdd('RxExtra', 'RxExtras', 'RxExtra')
Say 'Using version 'RxExtra("Load")' of RxExtras'
Say
Say "Testing RxBootDrive and RxRead..."
Call RxRead 'stem.', RxBootDrive()":"'\CONFIG.SYS'
Say "Your Config.Sys file should now appear"
"@PAUSE"
Do i = 1 to stem.0
Say stem.i
end /* do */
"@PAUSE"
Say
Say "Testing RxBootDrive by itself"
Say 'Your bootdrive is 'RxBootDrive()":"
"@PAUSE"
temp.0 = 5
temp.1 = "This is a test file"
temp.2 = "With this ring, I thee bed"
temp.3 = "The worlds smallest handcuff"
temp.4 = "How to win fiends and affluent people"
temp.5 = "### The last line ###"
Say
Say "Testing RxWrite by writing 5 lines to \TEMP.DAT"
Call RxWrite "temp.", "\temp.dat"
Say "Here is \TEMP.DAT"
"@type \temp.dat | more"
"@PAUSE"
"@DEL \temp.dat"
Say
Say "Testing RxVolumeLabel"
Say "Label of C is "RxVolumeLabel("C")
"@PAUSE"
Say
Drop stem.
Drop temp.
temp.1 = 1
temp.testing = "Testing is on"
temp.2 = 3
temp.testing.1 = "Life be in it"
Say "Testing RxVarDump - dumping all 'local' variables"
Call RxVarDump 'vars.'
Do i = 1 to vars.0
Say 'Variable Name:"'vars.i.name'" has the value: "'vars.i.value'"'
End
Drop vars.
"@PAUSE"
Say
Say "Testing RxStemCopy"
Say "Copy all variables from temp. to temp2."
Say "See RxVarDump above for temp. variables"
Call RxStemCopy "temp.", "temp2."
Say "Now we have..."
Call RxVarDump 'vars.'
Do i = 1 to vars.0
Say 'Variable Name:"'vars.i.name'" has the value: "'vars.i.value'"'
End
Drop vars.
"@PAUSE"
Say
Say "Testing RxSort"
temp.0 = 16
temp.1 = "This is a list"
temp.2 = "a List should be sorted"
temp.3 = "upper and Lowercase"
temp.4 = "$trange"
temp.5 = "#unny"
temp.6 = "@nd unusual"
temp.7 = "12345"
temp.8 = "123456"
temp.9 = "One isthe 9"
temp.10 = "Ten green bottles 10"
temp.11 = "Legs 11"
temp.12 = "And then some 12"
temp.13 = "Hollow weeing 13"
temp.14 = "Only 14"
temp.15 = "15"
temp.16 = "The last line!"
Say
Say "The unsorted list is..."
Say Copies('-', 50)
Do i = 1 to temp.0
Say temp.i
end /* do */
Say Copies('-', 50)
"@PAUSE"
Say
Say "Sorting in descending order gives..."
Call RxSort 'temp.', 'Descending'
Say Copies('-', 50)
Do i = 1 to temp.0
Say temp.i
end /* do */
Say Copies('-', 50)
"@PAUSE"
Say
Say "Sorting in ascending order gives..."
Call RxSort 'temp.', 'Asc'
Say Copies('-', 50)
Do i = 1 to temp.0
Say temp.i
end /* do */
Say Copies('-', 50)
"@PAUSE"
Say
Say "Testing RxSwitchTo"
Say "Switching to the desktop, hit Ctrl-Alt-Shift-O to see developers"
/* RxSwitchTo works by matching as much of the string as you give it
* to the first session.
* i.e. Call RxSwitchTo "System C"
* Will switch to the system clock.
*/
Call RxSwitchTo "OS"
If POS("Switch", result) <> 0 Then Do /* probably 2.1 */
Call RxSwitchTo "Desktop"
End
"@PAUSE"
Say
Say "Testing RxQuerySwitchListo"
Say "The programs running should now appear."
Call RxQuerySwitchList "temp."
Do i = 1 to temp.0
Say temp.i
End /* do */
"@PAUSE"
Say
Say "Testing RxQueryDriveType for Drive C:"
Say RxQueryDriveType("C:")
"@PAUSE"
BD = RxBootDrive()
PathToSearch = BD":\OS2;"BD":\OS2\INSTALL"
Say
Say "Testing RxSearchPath looking for DATABASE.TXT in \OS2 and \OS2\INSTALL"
Say RxSearchPath(PathToSearch, 'DATABASE.TXT')
"@PAUSE"
Say
Say "Testing Global variables"
Call RxSetGlobal "SETTINGS.TX1", "This is shared memory!"
Say "The text 'This is shared memory!' should now appear..."
Say RxGetGlobal('settings.tx1')
"@PAUSE"
Say
Say "Testing RxLineCount"
LC = RxLineCount(RxBootDrive()':\config.sys')
Say 'There are 'LC' lines in the your CONFIG.SYS file'
"@PAUSE"
Say
Say "Testing RxGetEXEName"
Say "The command line for this program was '"RxGetEXEName()"'"
"@PAUSE"
Say "All testing is now over..."
"@PAUSE"
Call RxExtra "Drop"