Software: Apache/2.0.54 (Unix) mod_perl/1.99_09 Perl/v5.8.0 mod_ssl/2.0.54 OpenSSL/0.9.7l DAV/2 FrontPage/5.0.2.2635 PHP/4.4.0 mod_gzip/2.0.26.1a uname -a: Linux snow.he.net 4.4.276-v2-mono-1 #1 SMP Wed Jul 21 11:21:17 PDT 2021 i686 uid=99(nobody) gid=98(nobody) groups=98(nobody) Safe-mode: OFF (not secure) /usr/doc/slang-1.4.5/html/ drwxr-xr-x | |
| Viewing file: Select action/file-type: 6. Variables
A variable must be declared before it can be used, otherwise an
undefined name error will be generated. A variable is declared
using the
declares three variables, x, y, and z. This
is an example of a variable declaration statement, and like all
statements, it must end in a semi-colon.
Variables declared this way are untyped and inherit a type upon assignment. The actual type checking is performed at run-time. For example,
results in x being set successively to a string, a float, an
integer, and to a complex number (0+2i). Any attempt to use
a variable before it has acquired a type will result in an
uninitialized variable error.
It is legal to put executable code in a variable declaration list. That is,
are legal variable declarations. This also provides a convenient way
of initializing a variable.
Variables are classified as either global or local. A
variable declared inside a function is said to be local and has no
meaning outside the function. A variable is said to be global if
it was declared outside a function. Global variables are further
classified as being The following global variables are predefined by the language and are mainly used as convenience variables:
An intrinsic variable is another type of global variable.
Such variables have a definite type which cannot be altered.
Variables of this type may also be defined to be read-only, or
constant variables. An example of an intrinsic variable is
Next Previous Contents |
:: Command execute :: | |
--[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0078 ]-- |