home *** CD-ROM | disk | FTP | other *** search
- // %PARAMETERS = "CH13LIST C:\UT2004"
- //Identifies the package
- //CH13_04LIST.uc
- //-
- class CH13_04LIST extends Commandlet;
- function int Main(string Args){
- //#1
- local int iLines;
- local string szLines, szSource;
- local array<string> ArrayForMan;
-
- iLines = 0;
- szLines $= Chr(10);
-
- //#2
- szSource =
- " Amos Bronson Alcott 1799-1888"
- $ Chr(10) $ Chr(10)
- $" Man " $ Chr(10);
- szLines =
- " He omnipresent is," $ Chr(10) $
- " All round himself he lies," $ Chr(10) $
- " Osiris spread abroad," $ Chr(10) $
- " Upstarting in all eyes:" $ Chr(10) $
- " Nature has globed thought," $ Chr(10) $
- " Without him she were not," $ Chr(10) $
- " Cosmos from Chaos were not spoken," $ Chr(10) $
- " And God bereft of visible token.";
-
- //#3
- log(Chr(10));
- iLines = Split(szLines, Chr(10) , ArrayForMan);
-
- //#4 Program flow drives incremental operator
- // and lines are retrieved
- Log(szSource);
- iLines = 0;
- Log(ArrayForMan[iLines]); Log(ArrayForMan[++iLines]);
- Log(ArrayForMan[++iLines]); Log(ArrayForMan[++iLines]);
- Log(ArrayForMan[++iLines]); Log(ArrayForMan[++iLines]);
- Log(ArrayForMan[++iLines]); Log(ArrayForMan[++iLines]);
- return 0;
- }
-