Jump to content
Macro Express Forums

Dynamic Arrays


Recommended Posts

Does anyone know if it is possible to define the amount of elements in an array which can be used to set the number of array elements? I know that I can use the %T% variables etc. but I would like to define them first.

What I am trying to do is take a screenshot of a Reflection console in order to extract field values. I would save these to a variable first and save this to a file. Text process the file to extract the number of lines on the screen and use this value to define the number of elements required in the array. The problem is, MEP doesn't seem to allow you to use a variable in the Variable Properties dialog box. I know I could probably get away with the built-in arrays, but I thought it would be neater my way.

 

Any suggestion?

 

Alan Monaghan

Kirkcaldy

Scotland

Link to comment
Share on other sites

In MEP you must define all your variables in advance under the "Variables" tab. Here you can define a variable like %Stuff% with any number of elements and you use these like %Stuff[1382]%. You must define the number of elements in the array at the time of writing and you can not make them variable. IE can not change at run time.

Link to comment
Share on other sites

In MEP you must define all your variables in advance under the "Variables" tab. Here you can define a variable like %Stuff% with any number of elements and you use these like %Stuff[1382]%. You must define the number of elements in the array at the time of writing and you can not make them variable. IE can not change at run time.

But what you can do is estimate how big your array is going to need to be, and then establish it larger than you expect to need, and then you should be fine.

 

And by way of clarifying, you can use integer variables to manipulate the array within the macro itself. eg: %Stuff[%Integer[1]%]%

 

If Integer[1] = 25, then this will establish or call variable %Stuff[25]%

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...
×
×
  • Create New...