Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-02-2015, 06:45 PM
mevans mevans is offline
Registered User
 
Join Date: 04-21-2015
Posts: 32
Evaluating a macro name with a macro in it

Suppose I define a macro like this:
%PHASE%-ReturnErrorCheck

I can successfully assign a value to this macro. It works as expected; however, I'm trying to figure out the notation to get the value out of %PHASE%-ReturnErrorCheck. I've tried various things like:
%%PHASE%-ReturnErrorCheck%
[%PHASE%-ReturnErrorCheck]
%[%PHASE%-ReturnErrorCheck]%

But they don't work.

I found one way to get the value out of it:
[Application.Macros(vbldMacroAll).Item("%PHASE%-ReturnErrorCheck")]

That works, but I'm not too fond of it. I supposed I could wrap it up in a subroutine to make it look nicer. It just seems there ought to be another way to get the value out.
Reply With Quote
  #2  
Old 06-02-2015, 08:05 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Yep, or

[vbld_AllMacros.Item("%PHASE%-ReturnErrorCheck").Value]

Or create a project or global script function like this:

Code:
Function GetMacro(name)
  GetMacro = vbld_AllMacros.Item(name).Value
End Function
and call like this:

[GetMacro("%PHASE%-ReturnErrorCheck")]
Reply With Quote
Reply

Tags
macros


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 02:15 AM.


Copyright © 1999-2023 Kinook Software, Inc.