Subject | RE: [IBO] Ability to run a script "step by step" |
---|---|
Author | Dmitriy A. Beloshistov |
Post date | 2006-10-20T08:47:59Z |
Hello,Martijn!
var FAbortScriptFlag:boolean=False; // global unit or class variable
//-------------
Procedure MyForm.ExecuteScriptByStep;
Begin
MyScript.OnStatement:=OnScriptStatement;
MyScript.Execute;
End;
//-------------
Procedure MyForm.OnScriptStatement(Sender: TIB_Script; var Statement:
String; var SkipIt: Boolean);
Begin
if FAbortScriptFlag then SkipIt:=True
else case MessageBox(Application.Handle,PChar('Execute
this:'+Statement),'Confirmation',MB_YESNOCANCEL) of
IDYES :SkipIt:=False; // continue execute
IDNO :SkipIt:=True; // skip statement but continue
execute script
IDCANCEL:begin
SkipIt:=True; //
skip statement
FAbortScriptFlag:=True; // skip all
below statement too (auto skip all statements in script later)
{
these you can use
TIB_Script.AbortExecuting() method too
}
end;
end;
End;
WBR,Dmitry Beloshistov AKA [-=BDS=-]
>Right ;-)It`s really easy ;)
>I'll have a go -- let me see what would be the easiest way...
var FAbortScriptFlag:boolean=False; // global unit or class variable
//-------------
Procedure MyForm.ExecuteScriptByStep;
Begin
MyScript.OnStatement:=OnScriptStatement;
MyScript.Execute;
End;
//-------------
Procedure MyForm.OnScriptStatement(Sender: TIB_Script; var Statement:
String; var SkipIt: Boolean);
Begin
if FAbortScriptFlag then SkipIt:=True
else case MessageBox(Application.Handle,PChar('Execute
this:'+Statement),'Confirmation',MB_YESNOCANCEL) of
IDYES :SkipIt:=False; // continue execute
IDNO :SkipIt:=True; // skip statement but continue
execute script
IDCANCEL:begin
SkipIt:=True; //
skip statement
FAbortScriptFlag:=True; // skip all
below statement too (auto skip all statements in script later)
{
these you can use
TIB_Script.AbortExecuting() method too
}
end;
end;
End;
WBR,Dmitry Beloshistov AKA [-=BDS=-]