3 Replies Latest reply on Nov 28, 2008 7:17 AM by Newsgroup_User

    Writing strings

    hinett12
      I have made a guestbook with an add, view and clear button. It also have a text field called feedback above the input box

      this is the add button lingo script:

      on mouseUp me
      --check to see if there is anything to put in the pref file
      if member("display").text = "" then
      member("feedback").text = "Please enter a comment"
      else
      --set a variable to the value of the text in the member display
      i = member("display").text
      --put that string into the pref file
      setPref "cygnus.txt", i
      --clear the display field
      member("display").text = ""
      --Tell the user what is going on
      member("feedback").text = "Your entry has been added to the Guestbook"
      end if

      end

      however every time i add something it just overwrites whats already there. I would like it to write it on a new line or below the last post. Can anyone help?
        • 1. Re: Writing strings
          Level 7
          Use getPref to retrieve what is already there, add the new data to the end,
          then use setPref to save it all.

          Andrew


          • 2. Re: Writing strings
            hinett12 Level 1
            I have done this. now when the guestbook loads it shows the entries that have been put in however I want the screen to be blank then after they put an entry in they can then view them all in a view button
            • 3. Re: Writing strings
              Level 7
              hinett12 wrote:
              > I have done this. now when the guestbook loads it shows the entries
              > that have been put in however I want the screen to be blank then
              > after they put an entry in they can then view them all in a view
              > button

              So don't show the user the data before you want them to see it...

              You are aware that getPref/setPref only work with the local machine and
              don't save anything on the server, aren't you?

              Andrew