home *** CD-ROM | disk | FTP | other *** search
- // %PARAMETERS = "CH14LIST C:\UT2004"
- //Identifies the package
- //CH14_05LIST.uc
-
- class CH14_05LIST extends Commandlet;
- function int Main(string Args){
- //do while loops
- //#1
- local Array<string> rgQuartzValues;
- local string szQuartzValues, szHead;
- local int iLIMIT, iCtr, iHW;
-
- szHead = "";
- iHW = 55;
- iCtr = 0;
-
- //Set up a list of items, colon delimited
- //to allow for white spaces
-
- szQuartzValues = "Amethyst:Modest:Citrine:High"$
- ":Rose :High :Colorless:Low"$
- ":Cat's-eye:Low:Chalcedony:High"$
- ":Adventurine:Modest";
-
- iLIMIT = Split(szQuartzValues, ":" , rgQuartzValues);
-
- //#2
- //Make a line
- do{
- //Concatenate characters into a line
- szHead $= Chr(178);
- iCtr++;
- }until(iCtr > iHW);
-
-
- Log(" " $ Chr(10) @ "CH14_05LIST" @ Chr(10));
-
- //#3
- //Display the items in the list
- Log(" Number of items: " @ (iLIMIT/2) @ Chr(10) );
- Log(" " $szHead $ Chr(10));
-
- iCtr = 0;
- do{
- //Display n and n+1 with each iteration
- Log( " " $ rgQuartzValues[iCtr] $ Chr(9) $ Chr(9)
- $ rgQuartzValues[iCtr + 1]);
- //Increment by to so skip alternates
- iCtr += 2;
- }until(iCtr > iLIMIT/2);
- return 0;
- }
-
-
-