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

Username:   Password: 
 RegisterRegister   
 font size help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
alison




PostPosted: Fri Oct 29, 2010 2:58 pm   Post subject: font size help

What is it you are trying to achieve?
I am trying to to hcange the font of a variably output to the screen using Font.Draw("output",1,1,myfont,white") as a template sort of thing


What is the problem you are having?
that template works for output text directly to the screen, but i need it to print the value of a variale instead, how do i do this?


Describe what you have tried to solve this problem
I have tried using the "\total' to escape from normal behaviour and try to print total as a varaible value and not literally print up 'total', but it did not work...not sure how i can get around using quotation marks


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
i want to print up on the screen:
YOUR CURRENT SCORE IS:(put score here)

i have used an accumulator , here is an piece of my programing to better explain



Turing:


<    total := total + 1
    Font.Draw ("Your current score is: ", 5, 10, myfont, white)>


for the next line i would like to print up the value of total beside 'your current score is:'...
any help is really appreciated. i have only been programming for about two months and only on turing, so i apologize if this is a 'noob' question...

Please specify what version of Turing you are using
turing 4.1.1
Sponsor
Sponsor
Sponsor
sponsor
TheGuardian001




PostPosted: Fri Oct 29, 2010 4:40 pm   Post subject: Re: font size help

This doesn't seem at all to be a problem with font size...

alison @ Fri Oct 29, 2010 2:58 pm wrote:

I have tried using the "\total' to escape from normal behaviour

I don't think you understand what Escape characters do... Escape characters allow you to place characters that would normally break the string inside of a string. They do not allow you to place whatever you want in a string. What you told Turing to output is:
code:

Your current score is: [tab]otal

since \t tells the computer you want a tab character. Likewise, \n will give you a new line, \" will give you a quote, etc.

What you want is:

"Your current score is: " + intstr(total)

which tells the computer that you want "Your current score is: " and then to add the variable total, as a string, to the end of that.
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  [ 2 Posts ]
Jump to:   


Style:  
Search: