Gah - a solution with more questions. – EntropicLqd
Difference between revisions of "HelloWorldCommandlet"
From Unreal Wiki, The Unreal Engine Documentation Site
(an example commandlet) |
m (removed "Commandlets" category) |
||
(One intermediate revision by the same user not shown) | |||
Line 30: | Line 30: | ||
defaultproperties | defaultproperties | ||
{ | { | ||
− | + | HelpCmd="HelloWorld" // not for UE3 | |
− | + | HelpOneLiner="Sample" // not for UE3 | |
− | + | HelpDescription="Hello World example" // only for UE3 | |
− | + | HelpUsage="HelloWorld" | |
− | + | HelpWebLink="http://wiki.beyondunreal.com/HelloWorldCommandlet" | |
− | + | HelpParm(0)="IntParm" | |
− | + | HelpParm(1)="StrParm" | |
+ | HelpDesc(0)="An integer parameter" | ||
+ | HelpDesc(1)="A string parameter" | ||
} | } | ||
</uscript> | </uscript> | ||
− | [[Category: | + | [[Category:Programming tutorials]] |
Latest revision as of 15:06, 17 March 2010
Object >> Commandlet >> HelloWorldCommandlet |
Contents
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[edit]
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" // not for UE3 HelpOneLiner="Sample" // not for UE3 HelpDescription="Hello World example" // only for UE3 HelpUsage="HelloWorld" HelpWebLink="http://wiki.beyondunreal.com/HelloWorldCommandlet" HelpParm(0)="IntParm" HelpParm(1)="StrParm" HelpDesc(0)="An integer parameter" HelpDesc(1)="A string parameter" }