Plua

From Wikipedia, the free encyclopedia

Plua is a port of Lua 4.0 (plus a small IDE) for the Palm Computing platform. Lua is a programming language designed at TeCGraf, the Computer Graphics Technology Group of PUC-Rio, Brazil.

The latest version of Plua is 1.1.

[edit] Language resources

Plua has some especial functions to support the Palm plataform, including:

  • FORMS*: buttons, checkboxes, etc.
  • GRAPHICS: lines, circles, etc.
  • DATABASES
  • COMMUNICATION
  • and many others!
*You define the form (the position of the components) directly on your Palm - doesn't need an external resource compiler.

[edit] Sample Code

The compiler and interpreter (you choose the way to work) is ~150KB big, and the compiled helloworldApp.prc is about ~2KB.

The classic hello world program can be written as follows:

-- HelloWorld.lua
ptitle("Hello World")
print "Hello, world!"
pevent()

Save this text in a memo pad and click on "run".

Quick explanation:

-- HelloWorld.lua
ptitle("Hello World")

Defines the title of the Palm Application.

print("Hello, world!")

Prints the message "Hello, world!" in a character-based style.

pevent()

Reads a Palm "event", like a button-press, a screen-touch, etc. You just have to position (X,Y) the button and write a handler for the click event.

[edit] External links