home *** CD-ROM | disk | FTP | other *** search
- // %PARAMETERS = "CH14LIST C:\UT2004"
- //Identifies the package
-
- //CH14_04LIST.uc
-
- class CH14_04LIST extends Commandlet;
- function int Main(string Args){
- //while loops
-
- //#1
- local Array<string> rgGemCategories;
- local string szGemCategories, szHead;
- local int iLIMIT, iCtr , iHW;
-
- szHead = "";
- iHW = 55;
- iCtr = 0;
-
- //Set up a list of items, colon delimited
- //to allow for white spaces
-
- szGemCategories = "Alexandrite:Chrysoberyl:Cymophane:Chrysoberyl" $
- ":Red Spinel:Spinel:Blue Spinel:Spinel" $
- ":Pink Topaz:Topaz:Blue Topaz:Topaz" $
- ":Emerald:Beryl:Aquamarine:Beryl";
- iLIMIT = split(szGemCategories, ":" , rgGemCategories);
-
- //#2
- //Make a line
- iCtr = iHW;
- while(iCtr > 0){
- //Concatenate characters into a line
- szHead $= Chr(178);
- iCtr--;
- }//end while
-
-
- Log(" " $ Chr(10) @ "CH14_04LIST" @ Chr(10));
-
- //#3
- //Display the items in the list
- Log(" Number of items: " @ (iLIMIT/2) @ Chr(10) );
- Log(" " $szHead $ Chr(10));
-
- iCtr = 0;
- while(iCtr < iLIMIT){
- //Display n and n+1 with each iteration
- Log( " " $ rgGemCategories[iCtr] $ Chr(9) $ Chr(9)
- $ rgGemCategories[iCtr + 1]);
- //Increment by to so skip alternates
- iCtr += 2;
- }//end while
- return 0;
- }
-
-
-
-