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

Username:   Password: 
 RegisterRegister   
 How do i make a string variable more than 2 words?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Mr.White




PostPosted: Tue Mar 29, 2011 3:42 pm   Post subject: How do i make a string variable more than 2 words?

What is it you are trying to achieve?
I want to make a variable that the user can enter two words and i counts as i variable. Is that possible


What is the problem you are having?
It only saves 1 word per variable



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


Turing:


var animal1,animal2,animal3,animal4,animal5 : string

put "Enter your first favourite animal."
get animal1
put "Enter your second favourite animal."
get animal2
put "Enter your third favourite animal."
get animal3
put "Enter your fourth favourite animal."
get animal4
put "Enter your fifth favourite animal."
get animal5
cls
locate (12,27)
put "Your favourite animals are:"
colour (blue)
locate (13,38)
put animal1
delay (1000)
locate (13,38)
put animal2
delay (1000)
locate (13,38)
put animal3
delay (1000)
locate (13,38)
put animal4
delay (1000)
locate (13,38)
put animal5
delay (1000)





Please specify what version of Turing you are using
<Answer Here>
Sponsor
Sponsor
Sponsor
sponsor
Mr.White




PostPosted: Tue Mar 29, 2011 3:43 pm   Post subject: RE:How do i make a string variable more than 2 words?

sorry, i forgot to put im using turing 4.1.1
Raknarg




PostPosted: Tue Mar 29, 2011 4:18 pm   Post subject: RE:How do i make a string variable more than 2 words?

just use :

get animal : *

that gets everything put down until the user presses enter.
SNIPERDUDE




PostPosted: Tue Mar 29, 2011 11:54 pm   Post subject: Re: RE:How do i make a string variable more than 2 words?

Mr.White @ March 29th 2011, 3:43 pm wrote:
sorry, i forgot to put im using turing 4.1.1

And because you will likely ask later, there's a problem with 4.1.1 in that programs won't properly compile (make executables). Will give you a bad header error when trying to run them. 4.1 has all the same features, so there's no real difference other than that when downgrading.
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  [ 4 Posts ]
Jump to:   


Style:  
Search: