1 Reply Latest reply on Aug 18, 2007 5:17 PM by James Newton, ACP

    File Input Output

    jackowacko9
      Hi,
      I'm trying to create a file(preferably text file) that stores UserName, Password, Score.
      The User Name and Password are taken from textBoxes and then a button is pressed to create user.

      Here is my code for Creating a User

      global gName
      global gPassword

      on mouseUp me

      gName = member("textInputUserName").text
      gPassword = member("textInputPassword").text

      objFileio = new xtra("fileio")

      if (gName <> VOID AND gPassword <> VOID) then
      objFileio.createFile("C:\Documents and Settings\Jack\My Documents\UserDetails.txt")
      objFileio.writeString(gName)
      objFileio.writeReturn()
      objFileio.writeString(gPassword)
      end if
      end

      Then for the log on button when a user is created

      global gName
      global gPassword

      on mouseUp me

      set gName = member("textInputUserName")
      set gPassword = member("textInputPassword")

      objFileio = new xtra("fileio")
      objFileio.openFile("UserDetails.text", 0)

      savedUser = objFileio.readWord()
      savedPassword = objFileio.readWord()

      if (gName = savedUser) then
      if (gPassword = savedPassword) then
      --let user log on and somehow save scores
      end if
      end if
      end

      Can anyone see the problems?

      Thanks a lot,
      Jack