Indigo Rose Software
  #1  
Old 11-11-2003
Jim Smiley Jim Smiley is offline
Indigo Rose Customer
 
Join Date: Nov 2001
Location: Portland, OR USA
Posts: 35
Grin Scripting Reference Question

Hi all;

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.


Regards;

Jim Smiley
Reply With Quote
  #2  
Old 11-11-2003
TJ_Tigger's Avatar
TJ_Tigger TJ_Tigger is offline
Indigo Rose Customer
 
Join Date: Sep 2002
Location: Sol 3
Posts: 3,188
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
end

Code from scripting guide
-- display a message for every table item
for j,k in mytable do
Dialog.Message("Table Item", j .. "=" .. k);
end

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);
end

HTH
Reply With Quote
  #3  
Old 11-11-2003
Jim Smiley Jim Smiley is offline
Indigo Rose Customer
 
Join Date: Nov 2001
Location: Portland, OR USA
Posts: 35
Lightbulb

Thanks Tigger;

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.

Regards;

Jim Smiley
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -6. The time now is 04:31 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software