Hello,
I've been programming REXX scripts under OS/2 for quite a while, and recently I decided it would be nice to have them handy to run under Windows as well, so I decided to try again...
Regina chokes on this sample because it complains about line #3 ('@Echo Off'), and after that (if I comment it out) seems to choke again in the line where I indirectly drop some variables, saying that I probably have an incomplete 'do' statement. It does so under OS/2 AND Windows. On Windows, Reginald chokes in the same places.
The code in question looks perfectly normal to me and runs perfectly in OS/2's classic REXX.
Could you please have a look at it and tell me if I have developed bad REXX coding habbits, and/or what's wrong anyway?
Many thanks,
Alfredo Fernández.
/* */
'@Echo Off'
if RxFuncQuery('SysLoadFuncs')>0 then do
call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs
end
parse source HostOS CallType ThisFile
select
when HostOS = 'OS/2' then
dir_sep = '\'
when HostOS = 'WIN32' then
dir_sep = '\'
otherwise
dir_sep = '/'
end
say HostOS dir_sep
attrlist.0 = 5
do i=1 to 5
attrlist.i = 'somename somevalue'
end
do x=1 to attrlist.0
if pos(' ',attrlist.x) > 0 then do
parse var attrlist.x attrname attrvalue
drop value(attrname)
call value attrname,attrvalue
end
else
attrname = attrlist.x
end
exit
I've been programming REXX scripts under OS/2 for quite a while, and recently I decided it would be nice to have them handy to run under Windows as well, so I decided to try again...
Regina chokes on this sample because it complains about line #3 ('@Echo Off'), and after that (if I comment it out) seems to choke again in the line where I indirectly drop some variables, saying that I probably have an incomplete 'do' statement. It does so under OS/2 AND Windows. On Windows, Reginald chokes in the same places.
The code in question looks perfectly normal to me and runs perfectly in OS/2's classic REXX.
Could you please have a look at it and tell me if I have developed bad REXX coding habbits, and/or what's wrong anyway?
Many thanks,
Alfredo Fernández.
/* */
'@Echo Off'
if RxFuncQuery('SysLoadFuncs')>0 then do
call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs
end
parse source HostOS CallType ThisFile
select
when HostOS = 'OS/2' then
dir_sep = '\'
when HostOS = 'WIN32' then
dir_sep = '\'
otherwise
dir_sep = '/'
end
say HostOS dir_sep
attrlist.0 = 5
do i=1 to 5
attrlist.i = 'somename somevalue'
end
do x=1 to attrlist.0
if pos(' ',attrlist.x) > 0 then do
parse var attrlist.x attrname attrvalue
drop value(attrname)
call value attrname,attrvalue
end
else
attrname = attrlist.x
end
exit