Kinook Software Forums

Kinook Software Forums (
-   [VBP] User Tips, Tricks and Samples (
-   -   Set Macro as array type (

kodakdave 10-22-2010 11:15 AM

Set Macro as array type
I had asked Support for a way to set a macro as an array type, the way "Read File" can. Such that one can later process that macro in vbscript and apply such functions as UBound to it.

Their quick and correct answer, that I had been unable to find on the forum, was:

//You can't do that with the Set Macro action, but you can use the Run Script action and the object model to do it:

RunScript action containing:
vbld_TempMacros.Add "ARRAY", Array("hello", "goodbye", "test")

Then, as verification, another
RunScript action containing:
arr = vbld_AllMacros()("ARRAY")
For i = 0 To UBound(arr)
Builder.LogMessage "Value " & i & " = " & arr(i)

If this is already mentioned somewhere in the forum, I apologize. If not, then I wanted others to benefit from the tip as well.

All times are GMT -5. The time now is 09:36 AM.

Copyright 1999-2022 Kinook Software, Inc.