home *** CD-ROM | disk | FTP | other *** search
/ UnrealScript Game Programming All in One / UnrealScriptGameProgrammingAllInOne.iso / UGPAIOListings / UGPAIOListingsCh10 / CH10LIST / Classes / CH10_03LIST.uc < prev    next >
Encoding:
Text File  |  2006-03-06  |  889 b   |  40 lines

  1. // %PARAMETERS = "CH10LIST C:\UT2004"
  2. //Identifies the package
  3. //CH10_03LIST.uc
  4.  
  5. class CH10_03LIST extends Commandlet;
  6. function int Main(string Args)
  7. {
  8.   //#1
  9.   local int iIntA, iIntB, iIntC, iIntD;
  10.   iIntA = 5;
  11.   iIntB = 5;
  12.   iIntC = 4;
  13.   iIntD = 4;
  14.  
  15.   log("*************");
  16.  
  17.   log(chr(13));
  18.   log(chr(13));
  19.   log("CH10_03LIST Boolean operations" $ chr(13) $ "");
  20.   log(chr(13));
  21.  
  22.   //#2  Test using AND
  23.   if(iIntA >= iIntD && iIntA == iIntB){
  24.       log("1. 5 is greater or equal to 4 and 5 is equal to 5 : true.");
  25.   }
  26.  
  27.   //#3 Test using OR
  28.   if(iIntA >= iIntD || iIntC == iIntB){
  29.       log("2. 5 is greater than or equal to 4 or 4 is equal to 5 :  true.");
  30.   }
  31.  
  32.   //#4 Test using exclusive OR
  33.   if(iIntA >= iIntD ^^ iIntB == iIntC){
  34.       log("3. 5 is greater than 4 Xor 5 is equal to 4 : exclusively true.");
  35.   }
  36.   
  37.   log(chr(13));
  38.   return 0;
  39. }
  40.