
-----------------------------------
BryX
Fri Sep 19, 2003 6:54 pm

Font.Draw and variables...
-----------------------------------
is it possible to use variables in using Font.Draw, example below, ebcause what i've done so far here i can't get to work :? 


var name:string
var FontID : int := Font.New ("Arial:12:bold")
Font.Draw ("Please Enter your name...", 0, maxy-20, FontID, green)
locate (3,1)
get name
put "Thanks"
delay (500)
cls
Font.Draw ("Shall we begin " ,name, "?", maxx div 2, maxy div 2 , FontID, green)


-----------------------------------
Tony
Fri Sep 19, 2003 7:02 pm


-----------------------------------
you cant use maxx div 2 as an integer value. Any div operation results in a double (real) value. You'd have to round it

round(maxx div 2)


-----------------------------------
Mazer
Fri Sep 19, 2003 7:26 pm


-----------------------------------
you cant use maxx div 2 as an integer value. Any div operation results in a double (real) value. You'd have to round it

round(maxx div 2)


wha??! :eh: 
using div will divide and truncate. therefore integer div integer will give yet another integer; no rounding necessary!

-----------------------------------
Tony
Fri Sep 19, 2003 7:30 pm


-----------------------------------

wha??! :eh: 
using div will divide and truncate. therefore integer div integer will give yet another integer; no rounding necessary!

ops, my bad... didnt use Turing in a long while..

anyways, in the line "Shall we begin " ,name, "?",

it doesnt work the same way was put does. See those commas? It actually things that the variable name is the next argument for the function, so it gets confused. You should use + sign instead to add strings together.


"Shall we begin " + name + "?"


-----------------------------------
BryX
Fri Sep 19, 2003 7:30 pm


-----------------------------------
thx alot man
