from the first post...j=j-1 -- because the whole '0' thing about being the first instance in a stack / array, etc., whereas '0' or Zero is a number!
but...Lua does not recognize the first key indexed as '0' but '1'.
So what? What does this mean to you? Well....if you are running a loop, you can start with i =1 and Lua will return the first instance. C++ and other languages like to start with '0'...just keep that in the back of your head when doing counters, loops, iterations, etc.
again, so what? tables, man...tables indexing and pulling values like in milliseconds with Mach4 being off by '1'unit is not good. It is NOT mach4's fault but the macro programmer's fault (or micro programmer,lol!, it may be our own fault if we just copy and paste and not logically understand the sequence of events. BECAUSE we are manipulating one programming language as function calls and variable pointers to another (Lua -> Gcode...or C++ to machine code, or Lua -> C+++ -> machine code -> bits bytes and lions and tigers and bears oh my! barf.) Let me break it down...what's our standard? how about 0.0001? Now you see how much '1' unit, key or value, or instance can affect the outcome of your efforts and not achieve your desired endstate? not to mention the cost of time an money through trial and error...(but it can be fun, trial and error that is. I think that's called experience (not necessarily old age, ha!)))(I don't know how many parenthesis's I just used here?.?.?.)
idk, this is kinda fun. I actually get to program a sequence and watch physical objects move in space and time....oh wait, that's robotics...haha! yep. ok, one too many drinks for me tonite!
-josh