Take the Tour | Site Map


Documentation
Downloads
Scripts
Community
EUO FAQ
Search

Chapter 2. Language Reference

Table of Contents

Variables
Basics
Standard Variables
Namespace Variables and Scope
Persistent Variables
System Variables
Variable Scope
Expressions
Operators
Arithmetic Operators
Comparison Operators
Code Formatting Operators
Logical Operators
String Operators
Array Operators
Precedence and associativity
Control Structures
if
else
for
Subs
gosub
return
goto
Labels

Variables

Basics

Variables in Easy UO come in four types; Standard, Namespace, Persistent and System. The type of a variable is defined by its first character. Repectively Standard variables start with a percent sign, Namespace variables with an exclamation mark, Persistant variables with an asteriks sign and System variables with an hash sign.

Variable names follow the same rules as other labels in EasyUO. A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores.

set %var Bob
set %Var Joe
msg %var %Var ; outputs "JOE JOE"

set %4bank not_yet     ; invalid; starts with a number
set %_4bank not_yet    ; valid; starts with an underscore

Standard Variables

Standard variables in EasyUO are represented by a percent sign (%) followed by the name of the variable. The variable name is case insensitive.

Namespace Variables and Scope

Namespace variables in EasyUO are represented by an exclamation mark (!) followed by the name of the variable. Namespace variable name is case insensitive.

Namespace variables visibility is affected by the nameSpace command.

Namespace variables within a local namespace can only be accessed by the current script.

Namespace variables within a global namespace can be accessed by all scripts running in the same instance of EasyUO (not yet available).

Persistent Variables

Persistent variables in EasyUO are represented by a asteriks sign (*) followed by a number between 1 and 1000 (both inclusive).

Persistent variables are shared between all instances of EasyUO running on the computer. Persistent variables are stored in the registry under the key HKEY_CURRENT_USER\Software\EasyUO.

System Variables

System variables in EasyUO are represented by an hash sign (#) followed by a descriptive text. System variable name is case insensitive.

System variables are all described in detail in the System Variable Reference.

Variable Scope

The different variable types have different scope depending on different things. Here is an explaination of how it works:

Table 2.1. EasyUO Variables

TypeScope
StandardScope is limited to the current script running. Standard Variables are cleared when EasyUO exits.
NamespaceScope is defined by using the nameSpace command. A Local namespace is accessible to the current script running only. A Global namespace is accessible to all scripts running in the same EasyUO instance (not yet available). Namespace Variables are cleared when EasyUO exits.
PersistentScope is limited to all scripts running on the same computer. Persistent Variables are stored in the registry and not cleared when EasyUO exits.
SystemScope is typically defined by the current Ultima Online instance for the current script running. System Variables are not saved by EasyUO upon exit.
User Contributed Notes
/www/www.easyuo.com/docs/language-reference.php
Add Notes About Notes
There are no user contributed notes for this page.
Last updated: Thu, 10 Jan 2008 - 13:53:52