File code is not working...

  • Thread starter Thread starter someone38764
  • Start date Start date
S

someone38764

' below is a record structure in a module named Globals

Public Structure TUserStats
Public BestCompleted As Integer
Public BestAverage As Single
Public BestPercentage As String
End Structure

Public UserStats as TUserStats

Globals.UserStats.BestPercentage = "100 percent "
Globals.UserStats.BestCompleted = 99
Globals.UserStats.BestAverage = 0.8

FileOpen(1, "TESTFILE.data", OpenMode.Binary)
FilePut(1, Globals.UserStats.BestPercentage)
FilePut(1, Globals.UserStats.BestCompleted)
FilePut(1, Globals.UserStats.BestAverage)
FileClose(1)

' the only thing that can be read from the file is the
' string "BestPercentage"
' why can't I read the numbers? I'm getting gibberish
' instead of the correct numbers
 
didn't test it but try this


FilePut(1, Globals.UserStats.BestPercentage)
FilePut(1, cstr(Globals.UserStats.BestCompleted))
FilePut(1, cstr(Globals.UserStats.BestAverage))
 
Dominique said:
didn't test it but try this


FilePut(1, Globals.UserStats.BestPercentage)
FilePut(1, cstr(Globals.UserStats.BestCompleted))
FilePut(1, cstr(Globals.UserStats.BestAverage))

It doesn't work.
 
Dominique said:
didn't test it but try this
FilePut(1, Globals.UserStats.BestPercentage)
FilePut(1, cstr(Globals.UserStats.BestCompleted))
FilePut(1, cstr(Globals.UserStats.BestAverage))

I found it. I needed:
FilePut(1, Globals.UserStats)
 
Back
Top