home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: InfoMgt
/
InfoMgt.zip
/
random31.zip
/
Upgrade.cmd
< prev
Wrap
OS/2 REXX Batch file
|
2000-05-24
|
1KB
|
51 lines
/*
Upgrade.cmd
Randomizer v3.1 by Don Eitner, 2000
Upgrades your existing Randomizer v2.2 datafiles to v3.0 format.
This code is neither supported nor under warranty. Feel free to
examine and modify this script for your own purposes. See the
included readme.txt for additional information.
*/
call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs
fields = linein('RandomField.dat',,1)
x1 = lastpos(' ', fields) /* That's ASCII code Alt-255 */
do while x1 <> '0'
data2 = substr(fields, x1+1)
data1 = substr(fields, 1, x1-1)
fields = data1||''||data2
x1 = lastpos(' ', fields) /* ASCII Alt-255 again */
end
count = words(fields)
do num = 1 to count
item.num = linein('RandomData.dat',,1)
x1 = lastpos(' ', item.num) /* That's ASCII code Alt-255 */
do while x1 <> '0'
data2 = substr(item.num, x1+1)
data1 = substr(item.num, 1, x1-1)
item.num = data1||''||data2
x1 = lastpos(' ', item.num) /* ASCII Alt-255 again */
end
end
call lineout('RandomField.dat')
call lineout('RandomData.dat')
rc = SysFileDelete('RandomField.dat')
rc = SysFileDelete('RandomData.dat')
call lineout 'RandomData.dat', fields
do num = 1 to count
call lineout 'RandomData.dat', item.num
end
call lineout('RandomData.dat')
exit