New: Difference between revisions
Jump to navigation
Jump to search
imported>Heeheehee Crappy page, I know, but I'm a bit preoccupied. |
imported>Bale mNo edit summary |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
Syntax: new ''record'' ( param, ... ); | Syntax: new ''record'' ( param, ... ); | ||
: ''record'' is the record to use. | : ''record'' is the record to use. | ||
Returns an instance of the given record, filling each field of the record with the given parameters. Each unspecified field is then filled with the default value of that type. For the default values of various types, see [[Data Types]]. | |||
For instance: | For instance: | ||
Line 25: | Line 27: | ||
Furthermore, | |||
<div style="margin-bottom: 1em; border: dashed 1px green; padding: 1em; margin:0px 20px;"><syntaxhighlight> | |||
record strint{ | |||
string a; | |||
int b; | |||
}; | |||
strint test = new strint("hello"); | |||
</syntaxhighlight></div> | |||
will create a record as follows: | |||
test.a => "hello" | |||
test.b => 0 | |||
{{Format}} | {{Format}} | ||
[[Category: | [[Category:Scripting]] |
Latest revision as of 09:03, 17 July 2010
Syntax: new record ( param, ... );
- record is the record to use.
Returns an instance of the given record, filling each field of the record with the given parameters. Each unspecified field is then filled with the default value of that type. For the default values of various types, see Data Types.
For instance:
record dblstr{
string a;
string b;
};
dblstr test;
test.a = "hello";
test.b = "world";
is functionally identical to
record dblstr{
string a;
string b;
};
dblstr test = new dblstr("hello","world");
Furthermore,
record strint{
string a;
int b;
};
strint test = new strint("hello");
will create a record as follows:
test.a => "hello" test.b => 0
Formatting Needed