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

Username:   Password: 
 RegisterRegister   
 Turing "Arugment is the wrong type" Error Problem
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
WhooliMooli




PostPosted: Sat Jan 18, 2014 12:48 pm   Post subject: Turing "Arugment is the wrong type" Error Problem

What is it you are trying to achieve?
<Replace all the <> with your answers/code and remove the <>>
I am trying to make it so when the user enters there name, when the screen clears and writes these names it will actually work instead of give me an error.

What is the problem you are having?



Describe what you have tried to solve this problem
<I've tried changing the variables, however I cannot get anything to work>


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)

var scorefont : int := Font.New ("Agency FB:45")
var p1name, p2name : string

Font.Draw (": ", p1name, 100, 500, scorefont, yellow)
Font.Draw (": ", p2name, 524, 374, scorefont, yellow)>


Please specify what version of Turing you are using
<4.1.1>
Sponsor
Sponsor
Sponsor
sponsor
Raknarg




PostPosted: Sat Jan 18, 2014 2:57 pm   Post subject: RE:Turing "Arugment is the wrong type" Error Problem

If I remember correctly, Font.Draw only takes in five parameters: A string, two ints, a font and a colour. You have six parameters there.
WhooliMooli




PostPosted: Sat Jan 18, 2014 3:12 pm   Post subject: Re: Turing "Arugment is the wrong type" Error Problem

Is there anyway I can fix this? Like use a new command which can hold that many parameters?
Raknarg




PostPosted: Sat Jan 18, 2014 3:46 pm   Post subject: RE:Turing "Arugment is the wrong type" Error Problem

No. You have to just use the parameters it gives you.

": ", p1name

What is that supposed to do? Do you want it to put them together? Remember that in a function (like Font.Draw) when you use a comma, it means you're moving on to the next parameter. If you want to put them together, use + instead
WhooliMooli




PostPosted: Sat Jan 18, 2014 5:20 pm   Post subject: Re: Turing "Arugment is the wrong type" Error Problem

so like this?

Font.Draw (": " + p1name, 100, 500, scorefont, yellow)
Raknarg




PostPosted: Sat Jan 18, 2014 5:35 pm   Post subject: RE:Turing "Arugment is the wrong type" Error Problem

Yup, that would work. But remember that in your code, p1name doesn't have any value, so you would still get an error.
WhooliMooli




PostPosted: Sat Jan 18, 2014 6:24 pm   Post subject: Re: Turing "Arugment is the wrong type" Error Problem

YAY! I fixed it, thanks A TON!!
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  [ 7 Posts ]
Jump to:   


Style:  
Search: