I don't need to test my programs. I have an error-correcting modem.

HelloWorldCommandlet

From Unreal Wiki, The Unreal Engine Documentation Site
Revision as of 05:35, 11 January 2010 by Wormbo (Talk | contribs) (an example commandlet)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Object >> Commandlet >> HelloWorldCommandlet

Contents

This class in other games:
RTNP, U1, UT, U2XMP, U2, UE2Runtime

A simple example commandlet.

You can run it with the following command:

ucc package.HelloWorld [intparm=number] [strparm=string]

Use ucc help package.HelloWorld to display the help text.

Source code

class HelloWorldCommandlet extends Commandlet;
 
var int intparm;
var string strparm;
 
function int Main(string Parms)
{
  log("Hello, world!");
  if (Parms != "")
    log("Command line parameters=" $ Parms);
  if (intparm != 0)
    log("You specified intparm=" $ intparm);
  if (strparm != "")
    log("You specified strparm=" $ strparm);
  return 0;
}
 
defaultproperties
{
     HelpCmd="HelloWorld"
     HelpOneLiner="Sample"
     HelpUsage="HelloWorld"
     HelpParm(0)="IntParm"
     HelpParm(1)="StrParm"
     HelpDesc(0)="An integer parameter"
     HelpDesc(1)="A string parameter"
}