New topic: Setting path for GetFolderItem and Text writing
<http://forums.realsoftware.com/viewtopic.php?t=29733> Page 1 of 1 [ 2 posts ] Previous topic | Next topic Author Message McDian Post subject: Setting path for GetFolderItem and Text writingPosted: Tue Aug 25, 2009 2:01 pm Joined: Fri Sep 14, 2007 5:00 pm Posts: 218 Okay I give up... I am trying to set specific paths for specific files and am not having any success. In debug mode I get Nil values for dbFile. Code:Dim dbFile As FolderItem Dim txtOut As TextOutputStream Dim stRteName As String = "Rte " + recSetRte.Field("rteNum").StringValue + " reads" Dim stImport As String // Used to build records for txtOut, code eliminated from example. dbFile= GetFolderItem("/").Parent.Child("/UCSC/Z_Microsoft/Work_Drive/Docs/Sensus/SensusImport").Child(stRteName) If(dbFile) <> Nil Then txtOut = dbFileCreateTextFile txtOut.Write ConvertEncoding(stImport, Encodings.UTF8) txtOut.Close End If I keep reading that absolutes paths are bad but I have three instances where I need them for specific tasks. I am essentially using the application on Linux to write data files to a Windows box I have mapped to my Linux system (see path...) across campus. I need to be able to write these files directly without having to copy them from my machine to the remote machine like I am now. Problem is the examples I have found for .Parent.Child do not seem to be working as I intend them. When I run in debug mode the value of dbFile after it's supposed to load is Nil. What am I doing wrong? Top Steve Garman Post subject: Re: Setting path for GetFolderItem and Text writingPosted: Tue Aug 25, 2009 2:04 pm Joined: Fri Sep 30, 2005 3:53 pm Posts: 2937 Location: England What do you expect Code:GetFolderItem("/").Parentto evaluate to? _________________ Steve Garman Using REALbasic 2008r2 Professional on Windows Vista Ultimate and REALbasic 2009r3 Professional on Linux Ubuntu 9.04 Desktop Occasional blog 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]
