View Full Version : Scripting Reference Question
11-11-2003, 12:12 PM
Just FYI, the only thing I know about scripting is what I learned in this document.
In the example on page 34 of the "Scripting Reference", why do j & k represent the table index & value? Are these universal variables? I could find no other mention of this in the document.
11-11-2003, 12:29 PM
Those are the variables that were chosen for that example. The for loop that they use enumerates a table and the "j" and "k" variables were used just for that example. The syntax is
for index, value in table do
operate on index and value
Code from scripting guide
-- display a message for every table item
for j,k in mytable do
Dialog.Message("Table Item", j .. "=" .. k);
for the variable index they used "j" and for the variable at value, they used "k". They could have just as easily done this
for index, value in mytable do
Dialog.Message("Table Item", index .. "=" .. value);
11-11-2003, 01:09 PM
Now I understand. I guess I just needed a little more explanation.
Having completed the "Getting Started " Tutorial and the "Scripting Reference" I just wish to say that you guys have done a great job on AMS5. It will add functionality to my projects that I never dreamed I'd be able to provide.
I've ordered my upgrade and can't wait for the 14th.
Powered by vBulletin™ Version 4.0.6 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.