On 1/21/06 9:22 PM, "Brian Heibert" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am getting a NilObjectException on this line:
> Preferences.homepage.text=fileStream1.ReadLine
> Can someone tell me what I am doing wrong?
I haven't taken the time to read your code, but here's my recommendation on
how to debug it if it is failing with the above error on the above line:
#if DebugBuild then
if Preferences is nil then fail("Null Preferences")
elseif Preferences.homepage is nil then fail("Null homepage")
elseif fileStream1 is nil then fail("Null Filestream1")
end
#endif
where "fail" is a method that takes a string to print to the error log file
or in a message box and/or executes a "break" statement so the debugger
halts execution BEFORE the nilObjectException occurs.
Hope this helps.
--Ed
> Sub Open()
> Dim file As FolderItem
> file = preferencesFolder.child("SpiderWeb 2006 Preferences")
> Dim a,b,c as string
> Dim fileStream1 As TextInputStream
> //file= GetOpenFolderItem("text") //file type defined in File Type
> Sets Editor
> If file <> Nil then
> fileStream1=file.OpenAsTextFile
> Preferences.homepage.text=fileStream1.ReadLine
> Preferences.welcome.text=fileStream1.readline
> fileStream1.Close
>
> End if
>
>
> End Sub
> Here's the save code
>
> Dim file As FolderItem
> file = preferencesFolder.child("SpiderWeb 2006 Preferences")
> Dim a,b,c as string
> Dim fileStream1 As TextInputStream
> //file= GetOpenFolderItem("text") //file type defined in File Type
> Sets Editor
> If file <> Nil then
> fileStream1=file.OpenAsTextFile
> Preferences.homepage.text=fileStream1.ReadLine
> Preferences.welcome.text=fileStream1.readline
> fileStream1.Close
>
> End if
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
>
> Search the archives of this list here:
> <http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>