home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 December / Chip_2001-12_cd1.bin / zkuste / delphi / kompon / d23456 / CAJSCRTP.ZIP / faq.txt next >
Text File  |  2001-05-14  |  1KB  |  28 lines

  1. Q: Why doesn't the uses work how it should work.
  2. A: When calling OnUses the ScriptEngine.OnUses is called. SYSTEM uses is always 
  3.    called, even with no OnUses. You can add variables, types, classes or functions 
  4.    there or your could attach a script to it.   
  5.  
  6. Q: How can I add a variable to the variable list:
  7. A: The prefered way to do it is in the OnUses function:
  8.   function MyOnUses(id: Pointer; Sender: TIfPasScript; Name: string): TIfPasScriptError
  9.   begin
  10.     if Name='SYSTEM' then begin
  11.       Sender.AddVariable('Edit1Text', 'String', False)^.CV_Str := Edit1.Text;
  12.       RegisterStdLib(Sender); // This function adds the standard libraries.
  13.       MyOnUses := ENoError;
  14.     end else 
  15.       MyOnUses := EUnknownIdentifier;
  16.   end;
  17.   After the TIfPasScript.Create, you do: script.OnUses := MyOnUses;
  18.  
  19. Q: How can I read the value of a variable:
  20. A: First call GetVariable('VarName'), if the result of
  21.   that function is nil, the variable does not exist. Else if it does
  22.   exist, the function returns returns an PIFVariant.
  23.  
  24. Q: Can you help me with ....? Are you going to add .....?
  25. A: I prefer you place this question on our newsserver:
  26.   news://www.carlo-kok.com
  27.   if the news server does not work, please report it to me.
  28.