AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

VBS (For Each xxx in xxxx) -> Delphi

Ein Thema von Piro · begonnen am 24. Nov 2006 · letzter Beitrag vom 25. Nov 2006
 
Benutzerbild von Piro
Piro

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

VBS (For Each xxx in xxxx) -> Delphi

  Alt 24. Nov 2006, 21:07
Hi Leute,

ich hoffe einer kann mir den Code von VBS in Delphi übersetzen. Habe schon etwas übersetzt. Ich komme bloss mit der For Each xxx in xxxx nicht weiter. Was muss ich da nehmen.

Code:
' Original VBS Code

sActionName="Hardware Inventory Collection Cycle"

Dim oCPAppletMgr
Set oCPAppletMgr = CreateObject("CPApplet.CPAppletMgr")

Dim oClientActions
Set oClientActions = oCPAppletMgr.GetClientActions()

Dim oClientAction
For Each oClientAction In oClientActions
     If oClientAction.Name = sActionName Then
        oClientAction.PerformAction
     End If
Next
Mein Delphi Code
Delphi-Quellcode:
procedure vbscript;
var
  sActionName : string;
  oCPAppletMgr, oClientActions, oClientAction : Variant;
begin
 sActionName := 'Hardware Inventory Collection Cycle';

 oCPAppletMgr := CreateOleObject('CPApplet.CPAppletMgr');
 oClientActions := oCPAppletMgr.GetClientActions();

 for oClientAction in oClientActions do
 begin
   If oClientAction.Name = sActionName Then
        oClientAction.PerformAction;
 end;
end;
Denn letzten Teil mit der For-Schleife bekomme ich leider nicht hin. Wäre voll gut wenn mir einer helfen könnte.

Gruß, Sven
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:05 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz