MR2/ICE #10183
-----------------------------------------------------------
/*=== ReadFile2Stem(FileName, Stem): Read file into stem variable ===*/
ReadFile2Stem:
if arg() \= 2 | \ arg(1, 'E') | \ arg(2, 'E') then do
say 'ReadFile2Stem: expected 2 arguments'
signal Error
end
if stream(arg(1), 'C', 'QUERY EXISTS') = '' then do
return 'ReadFile2Stem:' arg(1) 'does not exist.'
end
rf2sPath = arg(1)
call stream rf2sPath, 'C', 'OPEN READ'
rf2sStem = arg(2)
rf2sLine = 0
drop szCondition
do while lines(rf2sPath) \= 0
rf2sLine = rf2sLine + 1
call on NOTREADY name CatchError /* Avoid death on missing NL */
sz = linein(rf2sPath)
signal on NOTREADY name Error
interpret rf2sStem'.'rf2sLine' = sz'
if symbol('szCondition') = 'VAR' then
leave /* Last line missing NL */
end
interpret rf2sStem'.0 = 'rf2sLine
call stream rf2sPath, 'C', 'CLOSE'
drop rf2sPath rf2sStem rf2sLine szCondition
return '' /* Say no errors */
/* end ReadFile2Stem */
=====================================================
To unsubscribe from this list, send an email message
to "steward@scoug.com". In the body of the message,
put the command "unsubscribe scoug-programming".
For problems, contact the list owner at
"rollin@scoug.com".
=====================================================
<< Previous Message <<
>> Next Message >>
Return to [ 15 |
November |
1998 ]
The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA
Copyright 2001 the Southern California OS/2 User Group. ALL RIGHTS
RESERVED.
SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group.
OS/2, Workplace Shell, and IBM are registered trademarks of International
Business Machines Corporation.
All other trademarks remain the property of their respective owners.