home *** CD-ROM | disk | FTP | other *** search
/ UnrealScript Game Programming All in One / UnrealScriptGameProgrammingAllInOne.iso / UGPAIOListings / UGPAIOListingsCh10 / CH10LIST / Classes / CH10_04LIST.uc < prev    next >
Encoding:
Text File  |  2006-01-31  |  770 b   |  36 lines

  1. // %PARAMETERS = "CH10LIST C:\UT2004"
  2. //Identifies the package
  3. //CH10_04LIST.uc
  4.  
  5. class CH10_04LIST extends Commandlet;
  6.  
  7. function int Main(string Args)
  8. {
  9.   //#1
  10.   local int iIntA, iIntB, iResult;
  11.  
  12.   iIntA = 8;
  13.   iIntB  = 0;
  14.   iResult = 0;
  15.  
  16.   log("*************");
  17.   log("CH10_04LIST Bitwise opereators" $ chr(13) $ "");
  18.   log(chr(13));
  19.  
  20.  
  21.   //Initial value 00000000 00000000 00000000 00001000
  22.   log("The value is " @ iIntA);
  23.   iResult = iIntA << 4;
  24.  
  25.   //Value shifted 00000000 00000000 00000000 10000000
  26.   log("The value shifted << by 4 is " @ iResult);
  27.  
  28.   log("The value is " @ iResult);
  29.   iIntB = iResult >> 4;
  30.   
  31.   //And shifted back 00000000 00000000 00000000 00001000
  32.   log("The value shifted >> by 4 is " @ iIntB);
  33.  
  34.    return 0;
  35. }
  36.