Kinook Software Forum

Kinook Software Forum (https://www.kinook.com/Forum/index.php)
-   [VBP] User Tips, Tricks and Samples (https://www.kinook.com/Forum/forumdisplay.php?f=19)
-   -   Set Macro as array type (https://www.kinook.com/Forum/showthread.php?t=4711)

kodakdave 10-22-2010 10: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)
Next

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 04:26 PM.


Copyright © 1999-2023 Kinook Software, Inc.