I am pretty green wrt to oorexx and its capabilities, so this may be
obvious - how can I include a file (member, source, whatever you call it)
into an oorexx program?
i want to use the RxFtp class/methods to do a tailored ftp but I want to
keep the variables like userid, password, host name, directory to pull
from, etc. out of my main program and just INCLUDE a file with a set of
variables that hold all these values.
something like, e.g.
/* oorexx */
include ftpvars_file;
-- create ftp instance
ftpgeto = .rxftp~new() -- create new rexx ftp instance
-- etc...
Exit
where ftpvars_file would just be a bunch of variable assignments:
FtpHostNm = ftp.server.com
FtpUserNm = myuserid
FtpPasswd = mypass
etc.
I could pass the ftp variables file name as an argument and then open, read
and interpret all of the lines, but surely there is a more elegant way. ??
suggestions?
---
i found the Properties class but couldn't get it to work for this, but
maybe i don't understand how to implement it (or - more probably - it is
not meant for this...):
/* ---------- Main Logic -------------------------------------------- */
parse arg FtppropsFilenm . -- file name with the set of ftp
variables
If FtppropsFilenm = '' Then -- name of file with variables coded
not passed
Exit
Ftpprops = .properties~load(FtppropsFilenm)
say FtpHstNm
Exit
and when i run it:
$ ftpget.rex filename
FTPHSTNM
rather than the value of FtpHstNm from the file filename
TIA,
pg
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users