Einzelnen Beitrag anzeigen

Benutzerbild von Piro
Piro

Registriert seit: 14. Jul 2003
Ort: Flintbek
810 Beiträge
 
Delphi XE2 Professional
 
#8

Re: VBS (For Each xxx in xxxx) -> Delphi

  Alt 25. Nov 2006, 10:30
Ich bin jetzt einen kleinen Schritt weiter. Es lag nicht unbedingt an der For-Schleife. Davor war auch schon ein Fehler.

Delphi-Quellcode:
procedure vbscript;
var
  sActionName : string;
  oCPAppletMgr, oClientActions, oClientAction : Variant;
  i: Integer;
begin
 sActionName := 'Hardware Inventory Collection Cycle';
 oCPAppletMgr := CreateOleObject('CPApplet.CPAppletMgr');
 oClientActions := oCPAppletMgr.GetClientActions;

 ShowMessage(IntToStr(oClientActions.Count)); //Liefert 8

 for i:=0 to oClientActions.Count do
   If oClientAction = sActionName Then // Hier ist noch ein Fehler : oCLientAction ist leer
        oClientAction.PerformAction;
end;
Wie kann ich jetzt oClientAction die Elemente von oClientActions zuordnen? Array?
  Mit Zitat antworten Zitat