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 01-27-2016, 10:19 AM
HippyCraig HippyCraig is offline
Registered User
 
Join Date: 07-27-2006
Location: Philly
Posts: 211
Writing macro to file without evaluation

I have a macro and I set the option "Don't expand Macros or scripts..." Its actually the contents of a file I want to write out, I was using the File Write action and at the time its writing it starts to evaluate the macro, how can I prevent that.
Reply With Quote
  #2  
Old 01-27-2016, 10:36 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
You can't prevent expansion of macros/scripts within a Write File action. Either escape the file contents when storing in the macro (you can use the Read File action or vbld_GetFileContents script function) or use a Run Script action to write the raw macro value (you can use the FileSystemObject).
Reply With Quote
  #3  
Old 01-27-2016, 10:39 AM
HippyCraig HippyCraig is offline
Registered User
 
Join Date: 07-27-2006
Location: Philly
Posts: 211
how do I write out a macro in a script so its not evaluated? Is there a speciific function to write this marco and not evaluate it?
Reply With Quote
  #4  
Old 01-27-2016, 08:02 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Just use the macro's Value property. See the attached sample and log.
Attached Files
File Type: zip write_macro.zip (1.1 KB, 2672 views)
Reply With Quote
  #5  
Old 01-28-2016, 08:57 AM
HippyCraig HippyCraig is offline
Registered User
 
Join Date: 07-27-2006
Location: Philly
Posts: 211
So I guess my concern was around vbld_AllMacros()("ABC").Value, isn't there a function that will write out a macro value with out evaluation of the macro.
Reply With Quote
  #6  
Old 01-28-2016, 09:17 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
The Value property is the raw macro value. Within a step field, any script or macro references in the text will automatically be expanded. In script code, you can use Step.ExpProperty, vbld_StepProp, or Application.ExpandMacrosAndScript to expand any macros or script in the value.
Reply With Quote
Reply


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 06:14 PM.


Copyright © 1999-2023 Kinook Software, Inc.