home *** CD-ROM | disk | FTP | other *** search
/ UnrealScript Game Programming All in One / UnrealScriptGameProgrammingAllInOne.iso / UGPAIOListings / UGPAIOListingsCh09 / CH09LIST / Classes / CH09_03LIST.uc < prev    next >
Encoding:
Text File  |  2006-01-28  |  1.5 KB  |  58 lines

  1.   // %PARAMETERS = "CH09LIST C:\UT2004"
  2.   //Identifies the package
  3.   //CH09_03LIST.uc
  4.  
  5.   class CH09_03LIST extends Commandlet;
  6.  
  7.     function int main(string args){
  8.  
  9.     // #1
  10.     // Declaration of integer identifiers
  11.     // The scope is local
  12.     //The byte data type
  13.     local byte bFlagA;
  14.     local byte bFlagB;
  15.     //the bool data type
  16.     local bool fFlagD;
  17.     local bool fFlagE;
  18.     //Foating decimal values
  19.     local float rNumberA;
  20.     local float rNumberB;
  21.     local float rNumberC;
  22.  
  23.     // #2
  24.     //Definition or initialization of the
  25.     //identifiers
  26.     //Assignment of values
  27.     bFlagA = 255;
  28.     bFlagB = 256;    //converted to a zero - out of range
  29.     //bFlagC = -33;  //leads to an error to assign a negative
  30.                      //a byte
  31.     fFlagD = false;  //assign "false" to a bool
  32.     fFlagE = true;   //assign "true" to a bool
  33.  
  34.     rNumberA = 345.7865432;
  35.     rNumberB  = 345.78;
  36.     rNumberC = 1000000.0;
  37.  
  38.     // #3
  39.     // Alter and display values
  40.     log("CH09_03LIST");
  41.     log("==========byte Data Type============"); 
  42.     log ("bFlagA (byte): " $ bFlagA);
  43.     log ("bFlagA (byte): " $ bFlagB);
  44.     log("==========bool Data Type============");
  45.     log ("bFlagD (bool): " $ fFlagD);
  46.     log ("bFlagE (bool): " $ fFlagE);
  47.     //intDateOfRev = 1821;
  48.     log("==========float Data Type============");
  49.     log ( "rNumberA (float): " $ rNumberA );
  50.     log ( "rNumberB (float): " $ rNumberB );
  51.     log ( "rNumberC (float): " $ rNumberC );
  52.     return 0;
  53.   }
  54.  
  55.  
  56.   
  57.   
  58.