Hi,
I always have this online manual open when I am coding Lua:
https://www.lua.org/manual/5.2/Unlike a lot of computer languages Lua has only one data structure, the table.
Section 6.5 covers some of the table manipulation functions but note the syntax:
table.function(). Does that look familiar? Have a look at the maths functions that come with Lua. Again look at the syntax:
maths.cos(x) for instance, or another example is the string functions like: string.find(x.....) for instance.
In short all the maths functions are member functions of the table 'math' and the string functions are all member functions
of the table 'string'
So what is the "mc." designation? Is there a list of these somewhere that I can find that maps the I/O and other signals I can read?
the answer is that mc. stands for the table
mach
core. So ALL the API functions ( API.chm in the Mach4 Docs folder)
are all member functions of the table 'mc'
You will encounter others like wx. The 'wx' table is a table of wxWidgets functions which does a lot of the graphical heavy
lifting in Machs screen. Another you may see from time to time is scr. The 'scr' table has functions for populating Machs
screen with data and manipulating it.
So despite Lua having only one data structure it is in fact extremely versatile. In fact a simple single variable, like
MyNumber in Lua, is in fact a table, its just a table of one object, ie your number.
So Mach is a whole bunch of tables, in the case of the mc. table it has many hundreds of objects like functions,
mcSignalGetHandle() is an example of one, but also data objects like mc.OSIG_OUTPUT1 and hundreds more right down
to tables with a single data object like MyNumber as I have given above.
This is on the one hand an extremely simple arrangement and at the same time extremely crafty.
Lua has surprised and delighted me after what might have been called a 'difficult beginning', I hope your experience has
a positive outcome also.
Craig