home *** CD-ROM | disk | FTP | other *** search
- // %PARAMETERS = "CH11LIST C:\UT2004"
- //Identifies the package
- //CH11_01LIST.uc
-
- class CH11_01LIST extends Commandlet;
-
- function int Main(string Args)
- {
- //#1
- local int iFirstNum,
- iSecondNum,
- iThirdNum,
- iReturnedNum;
-
- iFirstNum = 18;
- iSecondNum = 25;
- iThirdNum = 35;
- iReturnedNum = 0;
-
- log("*************");
- log("CH111_01LIST Integer functions" $ chr(13) $ "");
- log(chr(13));
-
- //#2
- log("The numbers compared are " @ iFirstNum @ "and" @ iSecondNum);
- //#3 Minimum
- iReturnedNum = min(iFirstNum, iSecondNum);
- log("The smallest of the two:" @ iReturnedNum );
- //#4 Maximum
- iReturnedNum = max(iFirstNum, iSecondNum);
- log("The largest of the two:" @ iReturnedNum );
- //#5 Relative to a range
- iReturnedNum = clamp (iThirdNum, iFirstNum, iSecondNum);
- log("The range number closest to " @ iThirdNum @ " is " @ iReturnedNum );
- return 0;
- }
-