So what do I do about this?

Begin forwarded message:

From: Brian Heibert <[EMAIL PROTECTED]>
Date: January 25, 2006 8:52:22 PM EST
To: Getting Started <[email protected]>
Subject: Re: Help! Can't figure this out nilObjectException in preferences code
Reply-To: Getting Started <[email protected]>

ok so here is my code that writes a preference file it is in the Save button in my preferences window:

  dim file as folderitem
  dim t as textoutputstream
  file = PreferencesFolder.child("SpiderWeb 2006 Preferences")
  if file<> nil then
    Dim fileStream As TextOutputStream
    //file= GetSaveFolderItem("application/text","My Info")
    t=file.CreateTextFile

    t.WriteLine homepage.text
    t.WriteLine welcome.text
    t.Close
  end if

Here is the open code to open the preferences file that is in my main window
  dim file as folderitem
  dim t as textinputstream
  file = preferencesfolder.child("SpiderWeb 2006 Preferences")
  if file<> nil then
  t=file.OpenAsTextFile
  'preferences.homepage.text= t.readline
  'preferences.welcome.text = t.readline
  t.close
  end if

which I get a nilobjectexception on t.Close

On Jan 25, 2006, at 7:04 PM, Terry Ford wrote:


On 25-Jan-06, at 2:22 PM, Brian Heibert wrote:

I am trying to read my preference file


dim file as folderitem
dim t as textinputstream
file = PreferencesFolder.child("SpiderWeb 2006 Preferences")
if file<> nil then
t=file.OpenAsTextFile
preferences.homepage.text = t.readline
preferences.welcome.text = t.readline
t.close
end if

I am getting a NilObjectException on:
preferences.homepage.text = t.readline
preferences.welcome.text = t.readline

This usually means that the folderitem you are attempting to open does not exist.

Terry

_______________________________________________
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>

_______________________________________________
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>

Reply via email to