On Fri, Jul 27, 2012 at 7:38 AM, Cook, Brian - AIT <
brian.j.c...@transamerica.com> wrote:
> Thank you very much for the example you posted. In my testing of your
> code, I found one issue. When I select more than 1 file, it works great,
> however if I only select 1 file, then the separator character is not placed
> between the path and file name, making the do loop at the end not to say
> the files that were selected. Is this a bug with the FileNameDialog
> routine?
>
No, it is a bug in my, rather hasty, example.
If there is only 1 file selected, then FileNameDialog puts the complete
file name in the returned string. If there is more than 1 file selected,
FileNameDialog puts the path to the files first, then a separator, then
each file name separated by the separator.
My example code just needs to change to this:
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)
*if files~items == 1 then do
say "File selected:" files[1]
end
* *else do*
say 'Files located in directory:' files[1]
say ' Selected files:'
do i = 2 to files~items
say ' ' files[i]
end
*end*
end
The above should work correctly for whatever the user does when selecting
files.
--
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