home *** CD-ROM | disk | FTP | other *** search
/ UnrealScript Game Programming All in One / UnrealScriptGameProgrammingAllInOne.iso / UGPAIOListings / UGPAIOListingsCh11 / CH11LIST / Classes / CH11_01LIST.uc next >
Encoding:
Text File  |  2006-01-31  |  950 b   |  37 lines

  1. // %PARAMETERS = "CH11LIST C:\UT2004"
  2. //Identifies the package
  3. //CH11_01LIST.uc
  4.  
  5. class CH11_01LIST extends Commandlet;
  6.  
  7. function int Main(string Args)
  8. {
  9.   //#1
  10.   local int iFirstNum,
  11.             iSecondNum,
  12.             iThirdNum,
  13.             iReturnedNum;
  14.  
  15.    iFirstNum = 18;
  16.    iSecondNum  = 25;
  17.    iThirdNum   = 35;
  18.    iReturnedNum  = 0;
  19.  
  20.   log("*************");
  21.   log("CH111_01LIST Integer functions" $ chr(13) $ "");
  22.   log(chr(13));
  23.  
  24.   //#2
  25.   log("The numbers compared are " @ iFirstNum @ "and" @ iSecondNum);
  26.   //#3 Minimum
  27.     iReturnedNum = min(iFirstNum, iSecondNum);
  28.   log("The smallest of the two:" @ iReturnedNum );
  29.   //#4 Maximum
  30.   iReturnedNum = max(iFirstNum, iSecondNum);
  31.   log("The largest of the two:" @ iReturnedNum );
  32.   //#5 Relative to a range
  33.   iReturnedNum = clamp (iThirdNum, iFirstNum, iSecondNum);
  34.   log("The range number closest to " @ iThirdNum  @ " is " @ iReturnedNum );
  35.   return 0;
  36. }
  37.