Posted: Fri Sep 19, 2003 6:54 pm Post subject: 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
code:
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)
Sponsor Sponsor
Tony
Posted: Fri Sep 19, 2003 7:02 pm Post subject: (No subject)
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
Posted: Fri Sep 19, 2003 7:26 pm Post subject: (No subject)
tony wrote:
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
code:
round(maxx div 2)
wha??!
using div will divide and truncate. therefore integer div integer will give yet another integer; no rounding necessary!
Tony
Posted: Fri Sep 19, 2003 7:30 pm Post subject: (No subject)
Mazer wrote:
wha??!
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
Quote:
"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.