|
#1
|
|||
|
|||
Accessing macro array elements
Hi all
So I have a step which reads a file using a regex and matches 4 groups. I have the option "Store matching groups in array" And the macro it is going in is named DATABASE If I log %DATABASE% to the output then I get 4 lines containing the information. I need to be able to access each element individually so that I can run a command line putting the right elements in the right places.... How do I do this, I can't find anything on accessing a macro array in the help.... Thanks |
#2
|
|||
|
|||
See the attached sample for how to access via a Loop action or Run Script action.
|
#3
|
|||
|
|||
Thanks..
So no way to do %macro[1]% or something? I'm already in a loop so would now have nested loop and another 4 macros.... I'm almost thinking of having 4 different steps each matching one of the four groups I currently have. Would look less messy. |
#4
|
|||
|
|||
Define a project or global script function like so:
Code:
Function ArrayElem(name, index) a = vbld_TempMacro(name) ArrayElem = a(index) End Function Builder.LogMessage ArrayElem("DATABASE", 0) or like this in a field: [ArrayElem("DATABASE", 0)] http://www.kinook.com/VisBuildPro/Ma...ripteditor.htm http://www.kinook.com/VisBuildPro/Ma...xpressions.htm |
Thread Tools | |
Display Modes | Rate This Thread |
|
|