
-----------------------------------
D4rkM4g3
Thu May 18, 2006 10:06 pm

Font with Variable
-----------------------------------
I have to create a digital clock for a class. I've got it all working, with a counter counting up the seconds and so forth (that's how we have to do it =\) . The problem is we're supposed to have the time output in a bigger font. I know how to create font and change them, but turing won't let me put a variable into it...


Font.Draw (txtStr : string, x, y, fontID, Color : int)


Rather than having a text string, I want to be able to put my counter variable in there... Any ideas?

-----------------------------------
TheOneTrueGod
Fri May 19, 2006 6:39 am


-----------------------------------
well, your trying to put an integer parameter where theres a string parameter.  You'll need to convert your input with:

intstr(number)

If you want to have more than one word (say, for example, to input ":" as well), you'll need to concatenate strings using the "+" operator.

-----------------------------------
D4rkM4g3
Fri May 19, 2006 6:59 am


-----------------------------------
intstr(number) won't let me use a variable either...what I'd need to do is have it be:


instr(seconds,6,2)

but that doesn't do it either

-----------------------------------
HellblazerX
Fri May 19, 2006 10:24 am


-----------------------------------
Well, of course that won't work.  First of all, you spelt it wrong.  It's "intstr", not "instr".  Secondly,  intstr only takes in one parameter, you're putting three.  If you going to do it like that, then you could do it like this:

 intstr (seconds) + ",6,2"

-----------------------------------
D4rkM4g3
Fri May 19, 2006 4:13 pm


-----------------------------------
Typo, calm down. The help file in turing said it has three:

intstr ( i : int [ , width : int [ , base : int ] ] ) : string


Anyway, I got it working.
