p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Other Programming Languages (http://p2p.wrox.com/forumdisplay.php?f=209)
-   -   lua - HELP, PLEASE! (http://p2p.wrox.com/showthread.php?t=63737)

thedreameater November 13th, 2007 05:13 PM

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.
[xx(]


dparsons November 13th, 2007 05:20 PM

This isn't a general programming question, it is directly related to Lua.

The only Lua forum on this site is the one related to the book that Wrox publishes but you might find some help there: http://p2p.wrox.com/forum.asp?FORUM_ID=300

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========


All times are GMT -4. The time now is 07:22 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.