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

(question)while statements

Started by dan14941, 18 January 2013 - 08:09 PM
dan14941 #1
Posted 18 January 2013 - 09:09 PM
I know how to make a while statement = something but instead of "==" to make is equal as "something" how do i make it not equal a"something"
while (is equal as)
while x == "example" do
while (isnt equal as)
while x ?? "example" do
What goes in the "??" to make it not equal as
Luanub #2
Posted 18 January 2013 - 09:15 PM
Not equal in Lua is ~=

while x ~= "example" do
dan14941 #3
Posted 18 January 2013 - 09:19 PM
Not equal in Lua is ~=

while x ~= "example" do
Thanx allot but sometimes it gives me errors
Luanub #4
Posted 18 January 2013 - 09:24 PM
What type of errors? Can you post the errors and the code you are using?
dan14941 #5
Posted 18 January 2013 - 09:55 PM
Error: unrecognized symbol
Luanub #6
Posted 18 January 2013 - 09:57 PM
Can you post the code? If you don't want to post it here you can pm it me and i'll see if I can't help. ~= should work I've never had a problem with it.