New topic: 

Loading folder of pictures into array

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

         Page 1 of 1
   [ 4 posts ]                 Previous topic | Next topic          Author  
Message        obt          Post subject: Loading folder of pictures into 
arrayPosted: Sun Apr 14, 2013 9:33 am                         
Joined: Tue Jun 13, 2006 10:32 am
Posts: 43                I have a folder of jpeg pictures which I wish to load 
into a global array.  I have tried the following, but it does not seem to work:

  
 Dim f As FolderItem
Dim count As Integer
dim p As picture

f = SpecialFolder.preferences.child("JigPictures")  //-- folder of jpeg pictures
count  = f.Count
if f <> nil then
  For i As Integer = 1 to count
  gPicFile(i) = Picture.Open (f)
  next
else
  msgBox "No file of that name"
  return
end if


I am no expert and apologise for what must seem an elementary question.  Would 
appreciate an answer!

owen   
                             Top                DaveS          Post subject: 
Re: Loading folder of pictures into arrayPosted: Sun Apr 14, 2013 11:10 am      
                           
Joined: Sun Aug 05, 2007 10:46 am
Posts: 4753
Location: San Diego, CA                Dim f As FolderItem
Dim count As Integer
dim p As picture

f = SpecialFolder.preferences.child("JigPictures")  //-- folder of jpeg pictures
count  = f.Count
if f <> nil then
  For i As Integer = 1 to count
  p = Picture.Open (f)
  gPicFile.append p
  next
else
  msgBox "No file of that name"
  return
end if


Assumes that gPicFile is GLOBAL and defined like this

DIM gPicFile(-1) as picture      
_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not  interested in any solutions that involve custom Plug-ins of 
any kind  
                             Top                obt          Post subject: Re: 
Loading folder of pictures into arrayPosted: Mon Apr 15, 2013 9:58 am           
              
Joined: Tue Jun 13, 2006 10:32 am
Posts: 43                Thanks Dave for your prompt reply; I have tried it but 
it still does not load the pics.  
The code runs but the debugger shows gPicFile(1 to 10) as nil.  I'm baffled.   
                             Top                DaveS          Post subject: 
Re: Loading folder of pictures into arrayPosted: Mon Apr 15, 2013 10:01 am      
                           
Joined: Sun Aug 05, 2007 10:46 am
Posts: 4753
Location: San Diego, CA                p = Picture.Open (f.trueitem(i))      
_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not  interested in any solutions that involve custom Plug-ins of 
any kind  
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 4 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