Jump to content
Macro Express Forums

Using a variable as an array index?


Recommended Posts

Although I've studied the thread http://pgmacros.invisionzone.com/index.php...83&hl=array in which mfseeker suggested a way to achieve this, so far I've had no success. And I see nothing in Help about it.

 

Can anyone post a simple example please? I've been trying to process a set of text values with a Repeat loop, to get all the values into T[1], T[2], T[3], etc, but I'm stumped.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Here's a simple example. It will ask you for the year make and model of 3 cars and then play them back for you. Both ends use an index integer variable created from a repeat command.

 

It had been a long time since I used arrays but I was boning up on them again learning VB and I realized I was thinking of arrays like rows of data when I should have been thinking about them as columns of data. This way we can have easily accessible tabular data without having to resort to sticking it in a file and using ASCII repeat.

 

I hope this helps!

Array_Demo.mex

Link to comment
Share on other sites

Here's a simple example. It will ask you for the year make and model of 3 cars and then play them back for you. Both ends use an index integer variable created from a repeat command.

 

It had been a long time since I used arrays but I was boning up on them again learning VB and I realized I was thinking of arrays like rows of data when I should have been thinking about them as columns of data. This way we can have easily accessible tabular data without having to resort to sticking it in a file and using ASCII repeat.

 

I hope this helps!

 

Sure does, thanks Cory! ;)

 

I'm pretty sure that the reason I was getting in a mess was that I was using N and T in commands like this

Variable Set String %T[%N%]% from the clipboard contents.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...