Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Action Properties and Methods

 

The Action object is passed into Script Events.  The methods and properties available on the Action object are as follows:

 

Procedure/Methods

...

Method Call

Functions

 

Properties

 

 

 

Detailed information on the procedures, functions and properties:

 

...

ExampleDescription
procedure SetLogTitle(value As String)
Action.SetLogTitle("Building...");
Allows you to set the title of the FinalBuilder log.

 

procedure SendLogMessage(MessageText As String)
Action.SendLogMessage("Built!");
Sends a message to the output window.
Note
Will also trigger the OnStatusMessage event (except when called from within the OnStatusMessge event!

 

...

procedure Echo(MessageText As String)
Action.Echo("Built!");
Same as SendLogMessage (see above).

...

procedure SendProgress(Value As String, progress As Integer)
Action.SendProgress("Help Built.", 60);
Sends a progress message to the Run Status window.  This enables the action to report it's progress as it's executing.

...

Progress is a percentage and should therefore range between 0 and 100.

...

Properties

Method CallExampleDescription
function ExpandExpression(expr As String) As String
var exePath = Action.ExpandExpression("%ProjectDir%\\MyExecutable.exe");
This expands the string passed in by substituting FinalBuilder variables when %<variable>% is encountered.

 

function ChildActions(index As Integer) As OleVariant

Allows access to child actions, index is zero based.  Use ChildActionCount property to get a count of the child actions.

 

Example : Turn off debug info on all child Delphi compiler actions... (in this example IncludeDebugInfo is a FinalBuilder variable) add this code to the BeforeAction event handler of the parent action (an action group for example).

 

dim child

dim count

dim i

 

count = Action.ChildActionCount - 1

 

for i = 0 to count

...

var child = Action.ChildActions(1);

or

for (var i = 0; i < Action.ChildActionCount - 1; i++){ 
    var child = Action.ChildActions(i)

...

 ifnot (child is nothing) then

  if child.ActionName = "Compile Delphi Win32 Project" then

     child.CompilerOpt.DebugInfo = IncludeDebugInfo

  end if

 end if

next

 

 

 

 

...

;  
    if (child != null){  
        if (child.ActionName === "Compile Delphi Win32 Project"){
            child.CompilerOpt.DebugInfo = IncludeDebugInfo;
        }
    }
}

Allows access to child actions, index is zero based.  Use ChildActionCount property to get a count of the child actions.

In the second example the script turns off debug info on all child Delphi compiler actions. Add this code to the BeforeAction event handler of the parent action typically a group action.

function Parent As OleVariant
var parent = Action.Parent();
Returns the Parent action of the current action.  This will return null for root level actions.

...

Functions

Method CallExampleDescription
property

...

ActionComment As Stringvar curActionComment = Action.ActionComment;Provides access to the action comment.

...

property

...

ActionLogTitle As StringAction.LogTitle  = "Full Build - VB6"Allows you to change the title of the action's entry in the output window. This has no effect if set from the AfterAction event (since the log entry has already been made.)

eg.

Action.LogTitle  = "Full Build - VB6"

Action.SendLogMessage("File deleted")

 

property: ActionName As String

property ActionName As Stringvar curActionName = Action.Name;Provides access to the Action's name

...

property

...

ChildActionCount As Integervar curChildCount = Action.ChildCount;Returns the number of Child Actions the action has.

 

property

...

Description As Stringvar description = Action.Description;Provides access to the Action's description

...

property

...

IgnoreFailure As BooleanAction.IgnoreFailure = true;Provides access to the Action's IgnoreFailure flag

 

property

...

LogToVariable As StringAction.LogToVariable = "ActionLog";Provides access to the Action's LogToVariable flag

...

property

...

PauseInterval As CardinalAction.PauseInterval = 100;Provides access to the Action's PauseInterval property

 

property

...

SuppressStatusMessages As BooleanAction.SuppressStatusMessages = false;Provides access to the Action's SuppressStatusMessages property