View Single Post
  #1 (permalink)  
Old November 13th, 2007, 05:13 PM
thedreameater thedreameater is offline
Registered User
 
Join Date: Nov 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default lua - HELP, PLEASE!

This is a general programming question.

I am using an editor called wxluaeditor, writing code, and trying to run it...but nothing works.

How does one script something then test it? What program would you use to do that in Lua?

The code is very simple (from a website somewhere)

function mySqr(x) -- Define a Function
     return x*x; -- ';' is optional
end

print("Square Calculator")

print("Enter a number :")
n = io.read("*number")
print(mySqr(n))

but after it prints Enter a Number, it doesnt go any further. I tried saving it and opening it from the desktop (with lua's console), but it crashes after I put a number in.

PLEASE, SOMEONE, ANYONE, HELP!

thanks.


Reply With Quote