Attached in a demonstration program that covers the implementation/use of the properties class included with ooRexx 3.1.2
The example program properties_class_demo.rex is my original work. Lee Peedin
(lee AT safedatausa DOT com)
Logged In: YES
Thanks for the demo. The demo is sort of Windows specific. But the properties class will work on any OS ooRexx runs on. (In the demo, because of the Windows path.)
It would be nice if you added some logic to at the start of the program to test if the OS was Windows. If Windows have the default path be what you have, if not Windows have the default path be a unix-like path.
The unix-like path would be /opt/oorexx to match what you did for Windows. The demo should be able to run on Windows and Linux. I'll test it on Linux if you don't have a Linux system. If it runs on Linux, it should work on other unix-like systems.
You seem to have CSS turned off.
Please don't fill out this field.
Logged In: YES
I didn't even consider the fact that this demo should be cross-platform (shame on me).
So a couple of questions:
1) What is the commonly accepted routine in ooRexx to determine the OS?
2) Shouldn't the unix-like path be /opt/oorexx/? (note trailing slash)
3) What about the hash-bang line - if I add the hash-bang with my Windows editor the eol will be CRLF (Windows)? If I recall correctly, the hash-bang should end with just a LF for it to be recognized as such.
1.) A common way to determine the OS is:
parse upper source os .
if os~abbrev("WIN") then do
... do windows stuff, or set a flag .local~isWindows == .true
... do unix stuff, or set a flag .local~isWindows == .false
(Might have to check with Rainer about the Mac. I think if you run from the command line it is just unix-like.)
2.) Yeah /opt/oorexx/ I just meant it to be hint, I wasn't guaranteing accuracy. <grin>
3.) Just go ahead and add the hash bang. Subversion will take care of the line ends.
Update version of demo file attached. This is version 2 which should now be cross platform.
File Added: properties_class_demo.rex
Committed revision 952.
I add this example program to the samples included with the distribution. Thanks Lee.
Sign up for the SourceForge newsletter: