Jump to content
Macro Express Forums

Arrays Using Run Macro In Variable


Lucas
 Share

Recommended Posts

Welcome to the forum Lucas!

 

Macro Express does not support variable arrays. The Run Macro in Variable command is used to run macro string(s) placed into it, which is usually only done if you are generating dynamic macros.

Link to comment
Share on other sites

  • 2 months later...

Hi,

 

I am also interested in using arrays in ME. I note Floyd has written about “RuninMacro” for this, and now .vbs script for sorting arrays. I am finding it difficult to set up simple arrays so far.

Joe also comments on

There are no arrays in Macro Express, but a linear sequence of variable numbers can be stepped through like an array. The following code stuffs string variables T1 through T99 with values from the Registry.

The multiple choice menu attached really only needs to use cases "C" and "D" in the macro to use your own arrays.

Has anyone a simpler way?

 

Array name stored in %ArrayCurrent% as environment variable.

Array item (eg) 10 can be retreived from environment variable named from

"%ArrayCurrent%(10)" (using modify string command)

 

I am not sure of capacity, but have run the example in case "A" with 10,000 small strings; it could be adapted for integers, etc. Clearly not the speed required in the other examples in this thread? - but avoids the more complex "RunInMacro"?

 

The macro really only needs cases "C" and "D" to run,; have others developed anything simpler?

 

Best, Randall

     Case: C
     // Set Array String Number to %T2%
     Variable Set Integer %N1% from Prompt
     Variable Modify Integer: Convert %N1% to text string %T2%
     Variable Modify String: Trim %T2%
     Variable Set String %T10% from Environment Variable
     // Set Array String %T3% to Env Variable "%ArrayCurrent%(%T2%)"
     Variable Set String %T3% from Prompt
     Variable Modify String: Save %T3% to Environment Variable
     Variable Set String %T20% from Environment Variable
     Text Box Display: 
    End Case
    Case: D
     // Set New Array Name to Environment Variable "ArrayCurrent"
     Variable Set String %T1% from Prompt
     Variable Modify String: Save %T1% to Environment Variable
    End Case

ArraySetter.mxe

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...