home *** CD-ROM | disk | FTP | other *** search
- // %PARAMETERS = "CH14LIST C:\UT2004"
- //Identifies the package
- //CH14_03LIST.uc
-
- class CH14_03LIST extends Commandlet;
-
- function int Main(string Args){
- //#1
- local Array<string> rgMinerals;
- local string szMinerals;
- local int iLIMIT, iCtr;
- iCtr = 0;
- szMinerals = "Covelite Galena Stibinite " $
- "Molybdenite Graphite Pyrolusite Basalt";
- iLIMIT = Split(szMinerals, Chr(32) , rgMinerals);
-
- Log(Chr(10) @ "CH14_03LIST" @ Chr(10));
-
- //#2
- Log(" List 1 Use of 'break' to stop at 2:" );
-
- // Use of break
- for(iCtr = iLIMIT-1; iCtr >= 0 ; --iCtr){
- Log(" " $iCtr $ ". " $ rgMinerals[iCtr] );
- if(iCtr == 3){
- break;
- }
- }
-
- //#3
- Log(" List 2 Use of 'continue' to skip to: " );
- for(iCtr = iLIMIT-1; iCtr >= 0 ; --iCtr){
-
- if(iCtr == 2 || iCtr == 4){
- continue;
- }
- Log(" " $iCtr $ ". " $ rgMinerals[iCtr] );
- }
-
-
- //#4 No braces -- Troublesome form
- Log(" List 3 No braces:" );
- for(iCtr = iLIMIT-4; iCtr >= 0 ; --iCtr)
- Log(" " $iCtr $ ". " $ rgMinerals[iCtr] );
-
- return 0;
- }
-
-