home *** CD-ROM | disk | FTP | other *** search
/ UnrealScript Game Programming All in One / UnrealScriptGameProgrammingAllInOne.iso / UGPAIOListings / UGPAIOListingsCh10 / CH10LIST / Classes / CH10_01LIST.uc next >
Encoding:
Text File  |  2006-01-31  |  1.9 KB  |  52 lines

  1. // %PARAMETERS = "CH10LIST C:\UT2004"
  2. //Identifies the package
  3. //CH10_01LIST.uc
  4.  
  5. class CH10_01LIST extends Commandlet;
  6. function int Main(string Args)
  7. {
  8.   //#1
  9.   local int iIntegerNum;
  10.   local byte bByteNum;
  11.   local float rRealNum;
  12.  
  13.   iIntegerNum = 18;
  14.   bByteNum  = 25;
  15.   rRealNum   = 35.15;
  16.  
  17.   log("*************");
  18.   log("CH10_01LIST Increment and Assignment operations" $ chr(13) $ "");
  19.   log(chr(13));
  20.   //#2 simple integers and bytes, but not floats
  21.   log("Use of ++ and --  with integer: " @ iIntegerNum++
  22.                                          @ iIntegerNum++  @ iIntegerNum++
  23.                                          @ iIntegerNum--
  24.                                          @ iIntegerNum--  @ iIntegerNum--);
  25.  
  26.   log("Use of ++ and -- with byte: " @ bByteNum++ @ bByteNum++
  27.                                      @ iIntegerNum--  @ iIntegerNum--);
  28.  
  29.   //Not permitted
  30.   log("Use of ++ and -- with byte float not allowed!");
  31.   //log("Use of + to increment real: " @ rRealNum++);
  32.  
  33.   //#3 integers and bytes, and floats
  34.   log("Use of += and -= with integer: " @ iIntegerNum += 2 @ iIntegerNum += 2
  35.                                         @ iIntegerNum += 2 @ iIntegerNum += 2
  36.                                         @ iIntegerNum -= 2 @ iIntegerNum -= 2
  37.                                         @ iIntegerNum -= 2 @ iIntegerNum -= 2);
  38.  
  39.   log("Use of += and -= with byte: " @ bByteNum += 2 @ bByteNum += 2
  40.                                      @ bByteNum += 2 @ bByteNum += 2
  41.                                      @ bByteNum -= 2 @ bByteNum -= 2
  42.                                      @ bByteNum -= 2 @ bByteNum -= 2);
  43.  
  44.   log("Use of += and -= with float: " @ rRealNum += 2 @ rRealNum += 2
  45.                                       @ rRealNum += 2 @ rRealNum += 2);
  46.  
  47.   log("Use of += and -= with float: " @ rRealNum -= 2 @ rRealNum -= 2
  48.                                       @ rRealNum -= 2 @ rRealNum -= 2);
  49.   return 0;
  50. }
  51.  
  52.