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
TheGuardian001
Posted: 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.)
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?
Posted: 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
Posted: Thu Sep 23, 2010 9:25 am Post subject: RE:Frequently Asked Questions (And Answers!)
Thank you!
jesse kazomi
Posted: Tue Jun 17, 2014 4:38 pm Post subject: Re: Frequently Asked Questions (And Answers!)