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

Username:   Password: 
 RegisterRegister   
 how to clear variables when using again
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
dani190




PostPosted: Thu Dec 15, 2005 8:16 pm   Post subject: how to clear variables when using again

hey guys im making a program which has to be copied once but i need to use the same variables, is there a way to clear there values and use again or do i half to change all of the variables all together and re declare in new part ?
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Thu Dec 15, 2005 8:29 pm   Post subject: (No subject)

Check out the Turing Oddities contest in the [Contest] section if you want to set a variable back to having no value.

You should probably ignore the above comment, as it is pretty difficult. You should probably just set it back to 0, or a null string, etc.
Geminias




PostPosted: Thu Dec 15, 2005 10:35 pm   Post subject: (No subject)

dani, you can reuse variables without setting them back to null.

For instance, if i have a variable called variable and i use it in one context that manipulates it to the value 5, i can then ignore this value if i want to set it to another value. By declaring a variables value like this:

variable := value

you make that variable equal to that value. Unless you did something stupid like try to make it a value of the wrong type.
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  [ 3 Posts ]
Jump to:   


Style:  
Search: