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

Username:   Password: 
 RegisterRegister   
 Placing variables in Font.Draw command
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
strike_hawk89




PostPosted: Wed Jun 01, 2005 7:36 pm   Post subject: Placing variables in Font.Draw command

hi, i was just wondering if this was possible and how i am able to do it. I wanted it so that it would display the user's name but in a different text. I tried it a couple of times but had no success. i tried:
code:
Font.Draw ("blah, blah, blah, ", username, ".", 200, 200, font7, brightblue)
Sponsor
Sponsor
Sponsor
sponsor
jamonathin




PostPosted: Wed Jun 01, 2005 7:42 pm   Post subject: (No subject)

Close, only instead of ' , ' use ' + '.

code:
Font.Draw ("blah, blah, blah, "+ username+ ".", 200, 200, font7, brightblue)


That is assuming username is a string, if its an int juss use intstr (usernumber)
strike_hawk89




PostPosted: Wed Jun 01, 2005 8:04 pm   Post subject: (No subject)

thx alot man, really needed that.... Very Happy Very Happy Very Happy

no wait that didnt work, error message
Operands of 'prefix +' must be integer or real[/quote]
jamonathin




PostPosted: Wed Jun 01, 2005 8:24 pm   Post subject: (No subject)

You sure? Chek your typing, because this seems to work fine.
code:
var font : int := Font.New ("Arial:20")
var username : string := "jamonathin"
Font.Draw ("Username: " + username + ".", 20, 100, font, black)
strike_hawk89




PostPosted: Wed Jun 01, 2005 9:00 pm   Post subject: (No subject)

ya, it looks like i typed something wrong. sry bout that. Embarassed works fine now. Thanks again. Very Happy
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: