Before I solve your problem for you by writing the correct code (as you always need), would you explain the following:

What is the object you name "preferences"? It can't be a window as you state it's called "Viewer".

Are "homepage" and "welcome" EditFields or StaticTexts?

Why are you closing the object "preferences"?

Suggestion: Use f (or something else) instead of 'file' as the name of the folderitem to avoid confusion between folderitem and file or folder.

On 25-Jan-06, at 7:08 PM, Brian Heibert wrote:

Hi,

I have this in my program's main window called viewer:

  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
    preferences.close
  else
    dim t1 as textoutputstream
    file = PreferencesFolder.child("SpiderWeb 2006 Preferences")
    if file<> nil then
      Dim fileStream As TextOutputStream
      //file= GetSaveFolderItem("application/text","My Info")
      t1=file.CreateTextFile

      t1.WriteLine preferences.homepage.text
      t1.WriteLine preferences.welcome.text
      t1.Close
      preferences.close
    end if
    preferences.close

  end if

 and this 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

 But I still get a NilObjectException on these  lines:
t1 = t.readline
t2 = t.readline

Can someone help me I can't figure out what is wrong
Terry told me it sounded like the folderitem I am trying to open does not exist
_______________________________________________
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