Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Font with Variable
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
D4rkM4g3




PostPosted: Thu May 18, 2006 10:06 pm   Post subject: 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...

code:

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?
Sponsor
Sponsor
Sponsor
sponsor
TheOneTrueGod




PostPosted: Fri May 19, 2006 6:39 am   Post subject: (No subject)

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




PostPosted: Fri May 19, 2006 6:59 am   Post subject: (No subject)

intstr(number) won't let me use a variable either...what I'd need to do is have it be:

code:

instr(seconds,6,2)

but that doesn't do it either
HellblazerX




PostPosted: Fri May 19, 2006 10:24 am   Post subject: (No subject)

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:

code:
intstr (seconds) + ",6,2"
D4rkM4g3




PostPosted: Fri May 19, 2006 4:13 pm   Post subject: (No subject)

Typo, calm down. The help file in turing said it has three:

code:
intstr ( i : int [ , width : int [ , base : int ] ] ) : string


Anyway, I got it working.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: