Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-23-2005, 10:27 PM
bdsst7 bdsst7 is online now
Registered User
 
Join Date: 03-23-2005
Posts: 5
Jscript examples

Anyone have examples on how to manipulate macros using jscript? I have tried using the application object without success. As I have found, jscript examples are hard to come by in vbp.

Thanks
Reply With Quote
  #2  
Old 03-23-2005, 10:48 PM
pjaquiery pjaquiery is online now
Registered User
 
Join Date: 01-19-2003
Location: Dunedin, New Zealand
Posts: 114
I use JScript all the time.

// Add a temporary macro
Application.Macros (0).Add ("EmailSuccess", success);

// Return the contents of a macro as a string
function GetStr (macroName)
{
var macro = Application.FindMacro (macroName);
if (macro == null)
return "";

return Application.ExpandMacros (macro);
}


// Load temporary macros from a file
var filename = "all.macros";
Application.Macros(0).Load (filename, false);

// Remove a temporary macro
Application.Macros (0).Remove ("ArchiveTimeStamp");

// Copy last step status to temporary macros
function SaveLast ()
{
tempMacros = Application.Macros (0);
sysMacros = Application.Macros (3);
tempMacros.Add ("SavedResult", sysMacros.item ("LASTSTEP_STATUS").value);
tempMacros.Add ("SavedOutput", sysMacros.item ("LASTSTEP_OUTPUT").value);
}
Reply With Quote
  #3  
Old 03-23-2005, 10:50 PM
kevina kevina is online now
Registered User
 
Join Date: 03-26-2003
Posts: 825
A good place to look for jscript examples is the system script provided with Visual Build Professional itself (all the same script functions, etc that are provided in vbscript are also available as jscript). Several methods add or use macro values, such as: vbld_AddDelimValue, vbld_NextDelimValue, etc.

Just go to the script editor and change the language to jscript and look at the script under the System tab. You can also compare against vbscript (or PerlScript) by changing the language back and forth...
Reply With Quote
  #4  
Old 03-23-2005, 10:52 PM
bdsst7 bdsst7 is online now
Registered User
 
Join Date: 03-23-2005
Posts: 5
Thanks for all the information. I appreciate it very much.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 05:45 PM.


Copyright © 1999-2023 Kinook Software, Inc.