Hi Rich,

thanks a lot for replying! it helped me a lot.

unfortunately i have come across two new problems.
sorry if i am bothering everyone with this!

the game is supposed to include a highscore as well.
i'll just paste the code here to make it easier because i
can't explain thing very good.

Movie Script:

on startMovie
gHighscore = new(xtra"fileio")
gHighscore.createFile(the moviePath & gTrenner & "highscore.dat")
gHighscore.openFile(the moviePath & gTrenner & "highscore.dat",0)

voidcheck = gHSInhalt.voidP

if voidcheck = 1 then

gHSInhalt = [[#score"5000",#name"Charlotte
Sometimes"],[#score"4000",#name"Charlotte
Sometimes"],[#score"3000",#name"Charlotte
Sometimes"],[#score"2000",#name"Charlotte
Sometimes"],[#score"1000",#name"Charlotte
Sometimes"],[#score"500",#name"Charlotte
Sometimes"],[#score"400",#name"Charlotte
Sometimes"],[#score"300",#name"Charlotte
Sometimes"],[#score"200",#name"Charlotte
Sometimes"],[#score"100",#name"Charlotte Sometimes"]]
gHighscore.setposition(0)
gHighscore.writestring(string(gHSInhalt))

end if


--------------------------
This handler is called when 10 questions have been answered:

on highscore

  put gQuizpunkte into field "quizpunkte"
  gHSInhalt.add([#score:string(gQuizpunkte),#name:"Not entered"])
  gHSInhalt.sort()

  o = 0
  repeat with i = 10 down to 1
    o = o + 1
    namefield = "name" & o
    scorefield = "score" & o
    put gHSInhalt[i][#name] into field namefield
    put gHSInhalt[i][#score] into field scorefield
  end repeat

end

------------------------

for some reason the user's name and score isn't just being written once in
gHSInhalt, but several times on a random basis it seems.

is there a way for me to fix this without having to think of a new
possibility?
i've been sitting at this for the last 12 hours and i can't think straight
anymore ...

my second problem is, that after the list was sorted, the highscores are
being displayed
from smallest to biggest number. so if one would get enough points to be #1
it won't
be shown at all which seems to be grotesque :)

again, thanks for your help!

take care,

Sandro


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to