water cooler :: Lua FLTK
For the last couple of days I've been studying the documents from
http://lua-fltk.sourceforge.net/
http://www.lua.org/
http://www.fltk.org/
I've been learning a lot, but some things I assume would be simple don't seem to be covered, or are implemented differently between Lua and Lua-FLTK. One example is writing to a file. According to the Lua documentation, you can use io.output() and io.open() to specify an output file, but neither seem to work in Flua. I was able to work around this by using execute() with Bash/echo to write a file, but it seems like I shouldn't have to do this.
I've also seen in flua example files the use of methods and objects not mentioned in the flua docs.
Does anyone know if there is more thorough documentation available which covers Lua-FLTK? I find it frustrating to spend most of my time testing Lua code in Flua just to see whether or not that particular code is supported, and then often discoving that some of it is supported in Flua, but with a different syntax than what is used in Lua.
Thanks for any help.
I don't know anything about either, but these guys may shed some light on the situation:
http://lua-users.org/
http://lua-users.org/wiki/ForTutorial
http://www.lua.org/pil/21.1.html
I think the link for flua docs has been posted. Plus there are alot of gui samples there. flua is based on lua v4.0.1 and I found this quick reference helpful when using the lua only portion of the language.
http://www.zpeng.com/jenet/doc/lua_quick_ref4.pdf
I found the string library and the input/output library the most helpful.
There are alot of differences from v4.0.1 to v5.x.x.
lua is a very small easy to learn language and has very fast execution speed for a scripting language.
There are several samples of if already in DSL that I have written, also TOMSRTBT disk has more samples which are the same lua4 version. TOMS' site has a user contrib section where others have written lua4 programs.
But like any language, you need to keep using it, otherwise you soon forget.
I like the clean syntax of the language. There will be more lua and flua coming in future versions of DSL.
So try the quick reference, and then use google to search for more samples, just be sure it is lua v4.0.1
Thanks people.
The version may be a big part of my trouble. I've been playing around with Lua 5, and using documentation from that version.
The example Flua files have helped me the most so far, particularly with syntax. I began by seeing a lot of great features in the documents, and when I tried to use those features all I'd get were errors. It seems that the Flua docs asume you already have a good understanding of Lua syntax. At this point it's a bit confusing to understand why sometimes you'd use "box=", for example, when at other times you'd use "boxtype=".
The more I work with it, however, the more I enjoy it. When I remember how it was when I first started doing Flash script, and then Bash script, i was stumbling with a lot of things that now are as simple as tying shoes...so that gives me hope =o)
Maybe eventually I'll even be doing real programming in C++, although so far I've been enjoying the fact that scripting allows you to accomplish tasks using no more than human-readable text files.
Robert, the link above (to the quick reference for lua) doesn't leed me anywhere. Do you happen to have a copy somewhere, cause I would love to learn more about lua.
-r
Next Page...
original here.