
-----------------------------------
ZeroPaladn
Wed Jan 18, 2006 11:31 am

Font.Draw Problem
-----------------------------------
When i got to draw the text, i get an error message.

heres the code, you can try it out.


proc scoreread
    open : fNum, "maps/highscores.txt", get
    for r : 1 .. 10
        get : fNum, highscore (r)
        get : fNum, highscorename (r)
    end for
end scoreread

proc highscoreview
    loop
        exit when scorecheck = false
        scoreread
        cls
        colourback (brightblue)
        Font.Draw ("HIGH SCORES!", 200, maxy - 50, font, black)
        for e : 1 .. 10
            Font.Draw (intstr (e) + ".  " + highscore (e) + "   " + highscorename (e), 100, maxy - 100 - (e * 30), font, black)
        end for
        scorecheck := false
        View.Update
        delay (5000)
    end loop
end highscoreview


thanks alot guys.

-----------------------------------
Tony
Wed Jan 18, 2006 11:36 am


-----------------------------------
I don't have Turing on my Mac. By now you should know to specify what the error is :wink:

-----------------------------------
ZeroPaladn
Wed Jan 18, 2006 11:51 am


-----------------------------------
:oops: sorry.

Operands of " + " must be both interger or real, compatible sets, or both.

there we go.

-----------------------------------
codemage
Wed Jan 18, 2006 12:07 pm


-----------------------------------
Odd.
I can't spot anything at a cursory glance.

Can you try casting your expression into a temporary string variable and then give that variable (instead of the expression) to Font.Draw?

-----------------------------------
ZeroPaladn
Wed Jan 18, 2006 12:12 pm


-----------------------------------
i get the same error using this code...


var scoretext : array 1 .. 10 of string
for i : 1 .. 10
scoretext (i) := highscore (i) + "   " + highscorename (i)
end for


-----------------------------------
ZeroPaladn
Wed Jan 18, 2006 12:15 pm


-----------------------------------
sorry for double post, but i figured out the problem!!!

original code

Font.Draw (intstr (e) + ".  " + highscore (e) + "   " + highscorename (e), 100, maxy - 100 - (e * 30), font, black)


highscore is an INTERGER! you cant Font.Draw with those!

revised code

Font.Draw (intstr (e) + ".  " + intstr (highscore (e)) + "   " + highscorename (e), 100, maxy - 100 - (e * 30), font, black)


sorry for both the caps and the double post.
