-- NB: this is an algorithm, not a legal Lingo statement!
tableEntry (row, column) -> listItem (column + row * rowWidth)As a more general solution, a table of arbitrary size can be created as a list of lists:
-- parent script "table object"
property table
on birth me
set table = []
return me
end birth
on setValue me, row, column, val
-- allow for zero indices
set row = row + 1
set column = column + 1
-- check to see if we've already created the appropriate row
-- and if not, do so
set thisRow = 0
if count(table >= row) then put getAt(table, row) into thisRow
if not listP(thisRow) then
set thisRow = []
setAt table, row, thisRow
end if
-- set our new value at the column position setAt thisRow, column, val
end setValue
on getValue me, row, column
-- allow for zero indices
set row = row + 1
set column = column + 1
-- check to see if the row is defined
if count(table >= row) then
put getAt(table, row) into thisRow
if listP(thisRow) then
-- check to see it the column is defined -- and if so, return it
if count(thisRow >= column) then
return getAt(thisRow, column)
end if
end if
end if
-- otherwise, return an empty value, which we'll
-- default to 0, because that's the default list item value too return 0
end getValue
-- again, you could add other table operations here
-- note that unlike the stack, this table will only ever get bigger,
-- never smaller...
I'll leave it to you to devise a table of arbitrary size including indices
less than zero...