Wrox Programmer Forums
|
Other Programming Languages If you have a coding issue to discuss about another language that really isn't provided for in any other forum here (not ASP.NET C#, C++, VB, PHP, JavaScript, Python, Java, Perl, Applescript, XML or any of the other forum topics we have), post it here. Enough discussion on a language we don't have covered could prompt a new forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Other Programming Languages section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old November 13th, 2007, 05:13 PM
Registered User
 
Join Date: Nov 2007
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
  #2 (permalink)  
Old November 13th, 2007, 05:20 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

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
================================================== =========
Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
Lua build Triezen BOOK Beginning Lua Programming ISBN: 978-0-470-06917-2 0 January 2nd, 2008 06:08 AM
Lua install and Luaedit ashzr BOOK Beginning Lua Programming ISBN: 978-0-470-06917-2 0 November 19th, 2007 10:00 AM
Lua error messages trav BOOK Beginning Lua Programming ISBN: 978-0-470-06917-2 1 June 3rd, 2007 01:21 PM
dummy lua install Brad C BOOK Beginning Lua Programming ISBN: 978-0-470-06917-2 2 March 28th, 2007 11:36 AM
Beginning LUA trav BOOK Beginning Lua Programming ISBN: 978-0-470-06917-2 11 February 20th, 2007 07:47 AM





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