home *** CD-ROM | disk | FTP | other *** search
/ Game Level Design / GLDesign.bin / Software / UnrealEngine2Runtime / UE2Runtime-22262001_Demo.exe / Core / Classes / SimpleCommandlet.uc < prev    next >
Text File  |  2003-08-27  |  981b  |  44 lines

  1. class SimpleCommandlet extends Commandlet;
  2.  
  3. var int intparm;
  4.  
  5. function int TestFunction()
  6. {
  7.     return 666;
  8. }
  9.  
  10. function int Main( string Parms )
  11. {
  12.     local int temp;
  13.     local float floattemp;
  14.     local string textstring;
  15.     local string otherstring;
  16.  
  17.     log("Simple commandlet says hi.");
  18.     log("Testing function calling.");
  19.     temp = TestFunction();
  20.     log("Function call returned" @ temp);
  21.     log("Testing cast to int.");
  22.     floattemp = 3.0;
  23.     temp = int(floattemp);
  24.     log("Temp is cast from "$floattemp$" to "$temp);
  25.     log("Testing min()");
  26.     temp = Min(32, TestFunction());
  27.     log("Temp is min(32, 666): "$Temp);
  28.     textstring = "wookie";
  29.     log("3 is a "$Left(textstring, 3));
  30.     otherstring = "skywalker";
  31.     otherstring = Mid( otherstring, InStr( otherstring, "a" ) );
  32.     log("otherstring:" @ otherstring);
  33.     return 0;
  34. }
  35.  
  36. defaultproperties
  37. {
  38.     HelpCmd="Simple"
  39.     HelpOneLiner="Simple test commandlet"
  40.     HelpUsage="Simple (no parameters)"
  41.     HelpWebLink=""
  42.     LogToStdout=true
  43. }
  44.