New topic: 

Loading Multiple Folderitems

<http://forums.realsoftware.com/viewtopic.php?t=46052>

         Page 1 of 1
   [ 2 posts ]                 Previous topic | Next topic          Author  
Message        DanSandbergUCONN          Post subject: Loading Multiple 
FolderitemsPosted: Mon Nov 26, 2012 7:12 pm                         
Joined: Fri Dec 21, 2007 9:50 am
Posts: 189                Hello All - 

I'm working on a program that will do some fancy math on a number of .csv 
files. The interface is set up such that the user adds the files to be analyzed 
to a FolderItem array via a pushbutton. So in the action event of the 
pushbutton:
dim f as folderitem
f=GetOpenFolderItem("")
Files.append f

Now, the program works fine but when I'm loading many files it can be 
frustrating to load the files one at a time. I know how to select an entire 
folder via:
f=SelectFolder("")But I've noticed in some applications that if I hold down the 
shift key I can select multiple files if they are in sequence and load them all 
at once. I do not know if this feature is available in RB or how I'd feed the 
result appropriately into a FolderItem variable.

Anyone have any ideas?   
                             Top                charonn0          Post subject: 
Re: Loading Multiple FolderitemsPosted: Mon Nov 26, 2012 8:41 pm                
                 
Joined: Mon Apr 02, 2007 2:08 am
Posts: 1021
Location: San Francisco, CA, USA                Use OpenDialog with Multiselect 
set to true. Once the user selects their file(s), you can iterate over the 
selected FolderItems with  OpenDialog.Item(X). 

e.g.:
'Set up the opendialog
Dim filedlg As New OpenDialog
filedlg.MultiSelect = True
filedlg.InitialDirectory = SpecialFolder.Desktop
filedlg.ActionButtonCaption = "Select File(s)"
filedlg.CancelButtonCaption = "Abort Selection"
filedlg.Title="Select One Or More Files"

Dim tmp As FolderItem = filedlg.ShowModal 'Show the dialog window
If tmp <> Nil Then
  For i As Integer = 0 To filedlg.Count - 1 'loop over the selected FolderItems
  Files.append filedlg.Item(i)
  Next
End If
      
_________________
Boredom Software  
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 2 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to