Scripting:Flotten benennen

Aus STNE-Wiki

(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
K (Skriptcode)
(Skriptcode)
Zeile 12: Zeile 12:
  'name4'
  'name4'
  }
  }
-
  i=0
+
  VAR i AS integer = 0
  VAR Flotte AS new CMyFlotte( idDerFlotte );
  VAR Flotte AS new CMyFlotte( idDerFlotte );
-
  VAR Schiffe AS CShipList = Flotte.Ships
+
  VAR Ship as CMyShip
-
  VAR ShipEnum AS IEnumerator = Schiffe.GetEnumerator();
+
  FOR ( EACH Ship IN Flotte.Ships )
-
WHILE (ShipEnum.MoveNext())  
+
  {  
  {  
-
    var Ship as CMyShip = ShipEnum.Current
 
     Ship.Name = <nowiki>''</nowiki> & names[i]
     Ship.Name = <nowiki>''</nowiki> & names[i]
-
     i=i+1
+
     i = i + 1
  }
  }

Version vom 4. September 2006, 12:39 Uhr

fertige Scripte | Anleitungen und FAQ | Überblick über die Scripting-Sektion | Hilfen zum Arbeiten im Wiki


Flotten-Benennung

Skriptcode

VAR i AS integer
VAR names[] AS String = {
'name1',
'name2',
'name3',
'name4'
}
VAR i AS integer = 0
VAR Flotte AS new CMyFlotte( idDerFlotte );
VAR Ship as CMyShip
FOR ( EACH Ship IN Flotte.Ships )
{ 
   Ship.Name = '' & names[i]
   i = i + 1
}

Bemerkungen

Persönliche Werkzeuge