modify const value

hanhan
edited October 2004 in FastScript
It seems like I have an odd request. I do not want some of my variables to be changed in the script. Let say I have a variable called second. Since it is system variable, I do not want the use to change the value. But I want to change it from my code. I know I can use functions for this purpose, but it is not good solution.
What I have found is :

fsScript2->Clear();
fsScript2->AddConst("denec","integer",kkk++);
fsScript2->Parent =fsGlobalUnit();
fsScript1->Parent =fsScript2;// fsGlobalUnit();
fsScript1->Lines = Memo->Lines;
fsScript1->SyntaxType = LangCB->Items->Strings[LangCB->ItemIndex];
if(fsScript1->Compile()==false)
{
ShowMessage(fsScript1->ErrorMsg);
}




and call the script like:
fsScript2->Clear();
fsScript2->AddConst("denec","integer",kkk++);
fsScript2->Parent =fsGlobalUnit();
fsScript1->Execute();

I think What I do is dangerous, but it works. Any better idea? Since I still have not purchased the code, may be I can add new methods to perform my needs?

Regards,

HAN

Leave a Comment