home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2001 December
/
Chip_2001-12_cd1.bin
/
zkuste
/
delphi
/
kompon
/
d23456
/
CAJSCRTP.ZIP
/
faq.txt
next >
Wrap
Text File
|
2001-05-14
|
1KB
|
28 lines
Q: Why doesn't the uses work how it should work.
A: When calling OnUses the ScriptEngine.OnUses is called. SYSTEM uses is always
called, even with no OnUses. You can add variables, types, classes or functions
there or your could attach a script to it.
Q: How can I add a variable to the variable list:
A: The prefered way to do it is in the OnUses function:
function MyOnUses(id: Pointer; Sender: TIfPasScript; Name: string): TIfPasScriptError
begin
if Name='SYSTEM' then begin
Sender.AddVariable('Edit1Text', 'String', False)^.CV_Str := Edit1.Text;
RegisterStdLib(Sender); // This function adds the standard libraries.
MyOnUses := ENoError;
end else
MyOnUses := EUnknownIdentifier;
end;
After the TIfPasScript.Create, you do: script.OnUses := MyOnUses;
Q: How can I read the value of a variable:
A: First call GetVariable('VarName'), if the result of
that function is nil, the variable does not exist. Else if it does
exist, the function returns returns an PIFVariant.
Q: Can you help me with ....? Are you going to add .....?
A: I prefer you place this question on our newsserver:
news://www.carlo-kok.com
if the news server does not work, please report it to me.