home *** CD-ROM | disk | FTP | other *** search
/ UnrealScript Game Programming All in One / UnrealScriptGameProgrammingAllInOne.iso / UGPAIOListings / UGPAIOListingsCh13 / CH13LIST / Classes / CH13_04LIST.uc < prev    next >
Encoding:
Text File  |  2006-02-06  |  1.2 KB  |  44 lines

  1. // %PARAMETERS = "CH13LIST C:\UT2004"
  2. //Identifies the package
  3. //CH13_04LIST.uc
  4. //-
  5. class CH13_04LIST extends Commandlet;
  6. function int Main(string Args){
  7.   //#1
  8.   local int iLines;
  9.   local string szLines, szSource;
  10.   local array<string> ArrayForMan;
  11.  
  12.   iLines = 0;
  13.   szLines $= Chr(10);
  14.  
  15.   //#2
  16.   szSource =
  17.   "   Amos Bronson Alcott  1799-1888"
  18.       $ Chr(10) $  Chr(10)
  19.       $"            Man     " $  Chr(10);
  20.   szLines =
  21.   "   He omnipresent is," $ Chr(10) $
  22.   "   All round himself he lies," $ Chr(10) $
  23.   "   Osiris spread abroad," $ Chr(10) $
  24.   "   Upstarting in all eyes:" $ Chr(10) $
  25.   "   Nature has globed thought," $ Chr(10) $
  26.   "   Without him she were not," $ Chr(10) $
  27.   "   Cosmos from Chaos were not spoken," $ Chr(10) $
  28.   "   And God bereft of visible token.";
  29.  
  30.   //#3
  31.   log(Chr(10));
  32.   iLines = Split(szLines, Chr(10) , ArrayForMan);
  33.  
  34.   //#4 Program flow drives incremental operator
  35.   //   and lines are retrieved
  36.   Log(szSource);
  37.   iLines = 0;
  38.   Log(ArrayForMan[iLines]);    Log(ArrayForMan[++iLines]);
  39.   Log(ArrayForMan[++iLines]);  Log(ArrayForMan[++iLines]);
  40.   Log(ArrayForMan[++iLines]);  Log(ArrayForMan[++iLines]);
  41.   Log(ArrayForMan[++iLines]);  Log(ArrayForMan[++iLines]);
  42.   return 0;
  43. }
  44.