StopAction
procedure StopAction;
Example
procedure ScriptEvent(var Value: variant);
begin
if not IsValid(Value) then
begin
Log.Add('Action cancelled because the value is invalid');
StopAction;
Exit;
end;
end;
Usage
StopAction cancels every view in the current map and marks the enclosing flow log cancelled after the script returns.
Additional Technical Info
StopAction is an alternative public name for StopExecution. The method simply calls StopExecution, which cancels every view and field in the current map when applicable and sets Log.IsCancelled to True.
The call does not terminate the current PascalScript routine. The example uses Exit deliberately and is fictional and source-reviewed only.
Implementation
procedure TvxScripter.StopAction;
begin
StopExecution;
end;
Consequently, its exact scope is inherited:
- in either a field or view map, the containing map cancels every view and field and clears each view's
Reprocessflag; - outside those contexts, no map flag changes; and
- in every context, the enclosing log is marked cancelled.
Operational behaviour
The flow executor notices the log cancellation cooperatively after the current action item. The map loops notice their map-wide cancellation flags at their own checkpoints. A later action configured to ignore cancellation can clear the log flag and continue the action list.
StopAction does not set failure status, write a reason to the log, unwind the script, roll back a transaction or reverse external side effects. Successful work can still follow the normal commit and file-finalisation path. Log a useful reason before calling it and use Exit when later statements in the same script must be skipped.
Name compatibility
The name suggests action scope but does not introduce any additional action-level mechanism beyond StopExecution. StopFlow is registered directly to this method pointer and is another exact alias at runtime.
Related entries
StopExecutionis the direct implementation.StopFlowis registered to the same native method.CancelExecutionchanges map state without cancelling the enclosing log.