New topic: 

GetFolderItem Confusion

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

         Page 1 of 1
   [ 3 posts ]                 Previous topic | Next topic          Author  
Message        JohnV          Post subject: GetFolderItem ConfusionPosted: Mon 
Jan 14, 2013 4:49 pm                         
Joined: Sun Jan 28, 2007 2:38 pm
Posts: 146                I need to call a directory and take out a template 
file called "myTemplate.txt".

We manipulate the template using RS. To keep things simple we have created a 
Property of type FolderItem in the App class called "MyTemplatesDirectory"


We call 
MyTemplatesDirectory= App.ExecutableFile.Parent

#If DebugBuild Then
  // Debug path to the templates
#EndIf


All is nice until we try to call the template as follows:

dim TheTemplateToUse as FolderItem
TheTemplateToUse=GetFolderItem(App.MyTemplatesDirectory.child("myTemplate.txt"))
  
  
We get Parameters not compatible with this function.

What is the proper syntax?   
                             Top                JohnV          Post subject: 
Re: GetFolderItem ConfusionPosted: Mon Jan 14, 2013 4:55 pm                     
    
Joined: Sun Jan 28, 2007 2:38 pm
Posts: 146                Figured it out...



TheTemplateToUse=GetFolderItem(App.MyTemplatesDirectory.child("myTemplate.txt"))

should be

TheTemplateToUse=GetFolderItem(App.MyTemplatesDirectory.child("myTemplate.txt").absolutepath)
   
                             Top                kermit          Post subject: 
Re: GetFolderItem ConfusionPosted: Mon Jan 14, 2013 4:57 pm                     
    
Joined: Mon May 30, 2011 12:56 am
Posts: 590                Or simpler:

TheTemplateToUse=App.MyTemplatesDirectory.child("myTemplate.txt")   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 3 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