Open aliule2020 opened 2 years ago
script:
**program first;
var i,z:Integer;
begin z:=0; for i:=1 to 4 do begin z:=z+i; end; end.**
delphi:
**this->PSScript1->Script->LoadFromFile("script.txt"); ShowMessage("OK0"); if(this->PSScript1->Compile()) { ShowMessage("OK1"); this->PSScript1->Execute(); ShowMessage("OK2"); a= VGetInt( this->PSScript1->GetVariable("z") ); ShowMessage( System::Sysutils::IntToStr(a) ); }**
You can't read a variable of a ended program. In order to debug/read variables the script needs to be paused in execution after the variable was created.
script:
**program first;
var i,z:Integer;
begin z:=0; for i:=1 to 4 do begin z:=z+i; end; end.**
delphi: