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

Username:   Password: 
 RegisterRegister   
 Frequently Asked Questions (And Answers!)
Index -> Programming, Turing -> Turing Help
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Srlancelot39




PostPosted: Tue Sep 21, 2010 10:34 pm   Post subject: RE:Frequently Asked Questions (And Answers!)

New question lol....
****how do you set a variable of type 'array char of boolean' to null?*****
i'm using Input.KeyDown and whenever I press a key, it reads it infinite times until it crashes...Input.Flush isn't doing anything.
Sponsor
Sponsor
Sponsor
sponsor
TheGuardian001




PostPosted: Wed Sep 22, 2010 8:02 am   Post subject: Re: Frequently Asked Questions (And Answers!)

These questions are not exactly frequently asked, and would probably be better left for an actual thread.

In this case, you're probably using it wrong, as Input.Keydown cannot crash the program no matter how many times you use it, or how quickly you use it.

Either way, you never want to set a variable to NULL (it isn't actually possible in turing anyway) as this would crash your program the second you tried to read it.)
Srlancelot39




PostPosted: Wed Sep 22, 2010 11:20 pm   Post subject: Re: RE:Frequently Asked Questions (And Answers!)

Srlancelot39 @ Tue Sep 21, 2010 10:34 pm wrote:
New question lol....
****how do you set a variable of type 'array char of boolean' to null?*****
i'm using Input.KeyDown and whenever I press a key, it reads it infinite times until it crashes...Input.Flush isn't doing anything.

by that i meant, despite the fact that i'm using Input.Flush, it crashes with a string overload. and isnt word := "" setting the variable to null?
Srlancelot39




PostPosted: Wed Sep 22, 2010 11:22 pm   Post subject: RE:Frequently Asked Questions (And Answers!)

it's fixed now anyway so nvm =P
TheGuardian001




PostPosted: Thu Sep 23, 2010 8:02 am   Post subject: Re: RE:Frequently Asked Questions (And Answers!)

Srlancelot39 @ Wed Sep 22, 2010 11:20 pm wrote:

and isnt word := "" setting the variable to null?

No, that's setting a variable to an empty string. Null means not having any stored value at all. "" is the string equivilant of 0.
We use 0 (or "") to represent no value, but it's not the same thing as not having a value. Just like in math,
code:

0+1 = 1
NUMBER + 1 = ???????

we use the placeholder 0 (or "", in strings) to say yes, this does have a value, but its value is nothing.

The only way to have a NULL in turing is to create a variable without giving it a value. From the first time you assign a value to it (even if the value is nothing, as with "" or 0) it is never going to be NULL again.
Srlancelot39




PostPosted: Thu Sep 23, 2010 9:25 am   Post subject: RE:Frequently Asked Questions (And Answers!)

Thank you!
jesse kazomi




PostPosted: Tue Jun 17, 2014 4:38 pm   Post subject: Re: Frequently Asked Questions (And Answers!)

This is very interesting bery interesting lol
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 2 of 2  [ 22 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: