home *** CD-ROM | disk | FTP | other *** search
/ UnrealScript Game Programming All in One / UnrealScriptGameProgrammingAllInOne.iso / UGPAIOListings / UGPAIOListingsCh14 / CH14LIST / Classes / CH14_01LIST.uc next >
Encoding:
Text File  |  2006-02-07  |  872 b   |  37 lines

  1. // %PARAMETERS = "CH14LIST C:\UT2004"
  2. //Identifies the package
  3. //CH14_01LIST.uc
  4.  
  5. class CH14_01LIST extends Commandlet;
  6. function int Main(string Args){
  7. //#1
  8. local Array<string> rgMinerals;
  9. local string szMinerals;
  10. local int iLIMIT, iCtr;
  11.  
  12. iCtr = 0;
  13. szMinerals = "Covelite Galena Stibinite " $
  14.              "Molybdenite Graphite Pyrolusite Basalt";
  15. iLIMIT =  Split(szMinerals, Chr(32) , rgMinerals);
  16.  
  17. Log(Chr(10) @ "CH14_01LIST" @ Chr(10));
  18. Log("  Number of items: " @ iLIMIT);
  19.  
  20.  //#2
  21.  Log("  List 1 (iCtr++):");
  22.    //Postfix increment
  23.    //control, limit, count
  24.    for(iCtr = 0; iCtr < iLIMIT ; iCtr++){
  25.       Log("    "  $iCtr $ ". "  $ rgMinerals[iCtr] );
  26.    }
  27.  
  28.  //#3
  29.  Log("  List 2 (++iCtr):" );
  30.    //Prefix increment
  31.    for(iCtr = 0; iCtr < iLIMIT ; ++iCtr){
  32.       Log("    "  $iCtr $ ". "  $ rgMinerals[iCtr] );
  33.    }
  34.  
  35.   return 0;
  36. }
  37.