----- Original Message ----- 
From: Lee
To: [EMAIL PROTECTED]
Sent: Monday, April 26, 2004 7:26 PM
Subject: MSScriptControl & ActivePython


Hi,

I'm adding Python and PerlScript support to my Delphi application and am
having trouble with retreiving the names of the functions/pocedures in a
chunk of code. The following code works perfectly for VBScript and
Javascript but it gives an OleException whan accessing the Count property of
the Procedures object with Python and PerlScripts:

    with ScriptObject.ActiveXScriptControl.Modules['Global'] do begin
        for Loop := 1 to Procedures.Count do begin // ***EOLEException ON
THIS LINE***
            if (Procedures[Loop].HasReturnValue) and not
(Procedures[Loop].Name[Length(Procedures[Loop].Name)] = '_') then begin
                StringList.Add(Procedures[Loop].Name);
            end;
        end;
    end;

The ActiveXScriptControl object is a standard MS Script Control object.

Does anyone know what the problem might be? Perhaps the 'Global' module does
not exist for Perl/Python scripts? If this is the case, what should be used
here instead?
----------------------------------------
iirc, you can either add a module or use "__main__".

_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Other options: http://listserv.ActiveState.com/mailman/listinfo/ActivePython

Reply via email to