This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
kore's profile picture

true not true?

Started by kore, 11 February 2013 - 06:59 AM
kore #1
Posted 11 February 2013 - 07:59 AM
Title: true not true?
I have a program that uses touch monitors and has user input and when i check if the user and pass is valid it returns true but when i put
if isValid then
do stuff
end
it registers isValid as false even though I have the prev. line saying that it is true(term.write(isValid))
Dlcruz129 #2
Posted 11 February 2013 - 04:33 PM
Let us see your code.
Mads #3
Posted 12 February 2013 - 08:01 AM
Are you sure it is not "true", as in a string?
Lyqyd #4
Posted 12 February 2013 - 09:02 AM
Are you sure it is not "true", as in a string?

Even if this were the case, it would work, since he's saying he's using `if isValid then`, not `if isValid == true then`. I suspect a typo in isValid resulting in checking a nil value, or some sort of scoping issue. Obviously, without code, I can't be sure.