Difference between revisions of "Set"

From Hercules Wiki
Jump to: navigation, search
(Created page with "As of {{rev|15982}} the usage of set has become obsolete and is no longer a requirement. == Syntax == * set <variable>,<expression>; * set(<variable>,<expression>...")
 
m (Applied "obsolete" template.)
 
Line 1: Line 1:
As of {{rev|15982}} the usage of [[set]] has become obsolete and is no longer a requirement.
+
{{obsolete
 +
|type=Script Command
 +
|when=r15982}}
  
 
== Syntax ==
 
== Syntax ==

Latest revision as of 16:56, 6 November 2013

This Script Command became obsolete as of r15982. This page remains intact for legacy purposes.

Syntax

  • set <variable>,<expression>;
  • set(<variable>,<expression>)
  • <variable> = <expression>;

Description

This command will set a variable to the value that the expression results in.

This is the most basic script command and is used a lot whenever you try to do anything more advanced than just printing text into a message box.

Returns the variable reference (since trunk r12870).

Examples

set .@x,100;  // will make .@x equal 100.

set .@x,1+5/8+9;  // will compute 1+5/8+9 (which is, surprisingly, 10 - remember, all numbers are integer in this language) and make .@x equal it.

or

.@x = 100;  // will make .@x equal 100.

.@x = 1+5/8+9;  // will compute 1+5/8+9 (which is, surprisingly, 10 - remember, all numbers are integer in this language) and make .@x equal it.

For more information read: r15982: Script Engine Update