On Thu, Jul 26, 2012 at 10:28 AM, Cook, Brian - AIT <
brian.j.c...@transamerica.com> wrote:

> I am looking for anyone that might have some oorexx code that shows using
the FileNameDialog routine and provides the selected results to an object
such as an array or set.
>

Hi Brian,

Here is an example.  It defines the separator character that separates
multiple selected files as the ^ character.  It then uses the makeArray()
method of the .String class to break the string up into an array of items
at the ^ character.

I broke up some of the long lines using the '-' continuation character so
that the code below shouldn't have line wraps in it:


    ooRexxHome = value("REXX_HOME", , 'ENVIRONMENT' )

    if ooRexxHome~length == 0 then do
        path = 'C:\Program Files\ooRexx\'
    end
    else do
        path = ooRexxHome || '\'
    end

    delim = '0'x
    filemask = 'Class Files (*.cls)'delim || -
               '*.cls'delim               || -
               'All Files (*.*)'delim     || -
               '*.*'delim

    sepChar = '^'
    title = 'FileNameDialog Example'
    ret = FileNameDialog(path, , filemask,   -
          'LOAD', title, , 'MULTI', sepChar)

    if ret == 0 then do
        say "Canceled"
    end
    else do
        files = ret~makeArray(sepChar)
        say 'Files located in directory:' files[1]
        say '  Selected files:'
        do i = 2 to files~items
            say '   ' files[i]
        end
    end

::requires "ooDialog.cls"

If you have any more questions, just ask.

--
Mark Miesfeld
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users

Reply via email to