Lua FLTK


Forum: water cooler
Topic: Lua FLTK
started by: mikshaw

Posted by mikshaw on Jan. 29 2005,20:19
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.

Posted by cbagger01 on Jan. 29 2005,21:04
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 >

Posted by roberts on Jan. 30 2005,07:03
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

Posted by mikshaw on Jan. 30 2005,16:09
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.

Posted by reidar on Mar. 09 2005,15:22
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

Posted by roberts on Mar. 09 2005,21:07
reidar, the fltk lua docs are here: < http://lua-fltk.sourceforge.net/ >

It is a shame that the quick-ref url is no longer there.
I will email you the pdf that I have. Note that this has nothing to do with fltk or anything GUI. It covers the base lua 4 version.

DSL as of 1.0rc1 now has twenty lua programs.

Posted by reidar on Mar. 10 2005,11:32
Thanks Robert! (I received your pdf-file by the way.)

On my office computer I have Debian (sarge), and I thought I might work on the lua programs (like your wordviewer) there, but I couldn't make it work. Which packages do I need to install?

-r

Posted by reidar on Mar. 10 2005,11:38
Sorry that I don't think a little bit before I ask! I checked out the site you referred to above, went to the download section and it even had a binary file ready for all (most) linuxes, no need to compile or do anything. Now it works, and I will continue exploring this new and wonderful programming language on all my computers! If I arrive at any interesting results, they will be posted here of course :-)

-r

Posted by WoofyDugfock on Mar. 11 2005,15:26
Quote (reidar @ Mar. 09 2005,10:22)
Robert, the link above (to the quick reference for lua) doesn't leed me anywhere.

I fossicked around on the site hosting Robert's dead link: I think the new link for the lua quick-ref docs there is:
< http://www.zpeng.com/jenet/Articles/Section1/Article2.html >

Posted by mikshaw on Mar. 11 2005,20:53
Thanks....that's got the official manual as well, which I didn't have =o)
Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.