#37 Properties Class Demo

3.2.0
closed
None
5
2012-08-14
2007-10-01
Lee Peedin
No

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)

Discussion

  • Mark Miesfeld

    Mark Miesfeld - 2007-10-08

    Logged In: YES
    user_id=191588
    Originator: NO

    Lee,

    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.

     
  • Lee Peedin

    Lee Peedin - 2007-10-08

    Logged In: YES
    user_id=1223125
    Originator: YES

    Mark,
    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.

    Lee

     
  • Mark Miesfeld

    Mark Miesfeld - 2007-10-08

    Logged In: YES
    user_id=191588
    Originator: NO

    Lee,

    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
    end
    else do
    ... do unix stuff, or set a flag .local~isWindows == .false
    end

    (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.

     
  • Lee Peedin

    Lee Peedin - 2007-10-12
     
  • Lee Peedin

    Lee Peedin - 2007-10-12

    Logged In: YES
    user_id=1223125
    Originator: YES

    Update version of demo file attached. This is version 2 which should now be cross platform.

    Lee
    File Added: properties_class_demo.rex

     
  • Mark Miesfeld

    Mark Miesfeld - 2007-10-13

    Logged In: YES
    user_id=191588
    Originator: NO

    Committed revision 952.

    I add this example program to the samples included with the distribution. Thanks Lee.

     


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks