Guidance Forums / Reginald Rexx / GuiFile

Search 搜索
Home Home

Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. GuiFile
Posted by: Phil_Owen 2010-11-05 17:33:46
When running the following simple script: (Stripped out for testing purposes)

 LIBRARY rexxgui

FN. = ""

error = Guifile('FN','MULTIPLE|EXISTING','My title','All files (*.*) | *.*' )
   if error \= "" then say "Error in Guifile"
say FN.1
Say  FN.0


The variables FN.0 & FN.1 contain nulls after selecting a number of files. But i can see variables FN.131080 etc. being created by GuiFile. This is in the results box but disappears as soon as the function completes - not easy to see. Any idea what I'm doing wrong?


Posted by: Phil_Owen 2010-11-06 02:00:24
Further tests show stem tail 131072 holds the total number of entries (instead of .0) and sucessive stems hold the file names. One other quirk to this saga is that if I select more than 18 files from the list GuiFile raises CANCEL even though I pressed the OPEN button. Anyone got any suggestions?
Posted by: PeterJ 2010-11-06 06:48:13
Phil, it seems you are right, I have the same behaviour. The count is hold in 131072, the entries in 131073 , etc.
Even the cancel condition occurs as you described, but not with 18 entries, I think with more than 32 (but I didn't check the exact number).
Posted by: Jeff Glatt 2010-11-07 19:40:10
Try the latest Reginald update.
Posted by: Phil_Owen 2010-11-07 22:27:41
Jeff the latest update fixes the errant tail numbering but the function still returns CANCEL if over 18 files are selected.
Posted by: Jeff Glatt 2010-11-08 04:12:11
I believe the CANCEL behavior is due to a filename size issue. As you select files, their names are all added to the "Name" edit box. Just like any other Edit box, there is a limit to how long this total text may be. If you attempt to exceed the limit, the file dialog's apparent behavior is to do something that causes GuiFile to return a CANCEL. GuiFile's limit is about 256 characters. If you're selecting a lot of files (in one directory), probably the better way to do it is to create your own list of files with a MATCHNAME loop, adding each filename to your own multiple select listbox via GuiSendMsg "ADDSTRING". Or you can use GuiSendMsg "DIR". Consult the "List box" reference page.
Posted by: Phil_Owen 2010-11-08 16:24:33

Many thanks Jeff. Perhaps the above explanation/caveat could be added to the GuiFile documentation when you have time (I appreciate you're a very busy guy).

Phil Owen.
Message8. Multiple select with large amount of files
Posted by: PeterJ 2010-11-09 03:32:57

maybe you want to try the attached solution. Just check out TestSelectFiles.rex in the attached zip file-
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
© Sun 2017-11-19  Guidance Laboratory Inc. Hits:0