Loading...

Aug 18, 2014

LUA Table/Array Maker - Save Time and Brain Cells

Download: http://jbafiles.com/free/lua-table-maker.zip

Purpose:
This program's intent is to facilitate the creation of LUA tables/arrays by removing the need to specify an integer value on each entry. Furthermore, this also facilitates updating the table by not having to adjust each entry's integer value.

In a way it reminds me of enumeration in C++ and C#.

How it Works.
Each line has a purpose.  The first line is a "separator" that will be used to surround the table.  The second line is the table/array name.  The third line is the initial integer value, which will be assigned to the first table entry.  The fourth and subsequent entries are the names of the table entries.  Multiple tables within a single file are supported, just ensure to press the Enter key twice.

Sample Input:
----------------------
animations
1
idle
walk
run

factions
0
neutral
good
bad

Sample Output:
-- ANIMATIONS
----------------------
animations = {}
animations.idle = 1
animations.walk = 2
animations.run = 3
----------------------

-- FACTIONS
----------------------
factions = {}
factions.neutral = 0
factions.good = 1
factions.bad = 2
----------------------


Program Image


Coded with the wonderful BlitzMax.

1 comment:

  1. I stumbled upon this in YouTube searches. Thanks for your hard work!

    ReplyDelete