new

From Kolmafia
Revision as of 17:17, 16 July 2010 by imported>PhilmASTErpLus (Whoops, didn't know it accepted parameters. Shouldn't have looked at it while sleepy. Fixed.)
Jump to navigation Jump to search

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. If no parameter is given, each field is 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");


Formatting Needed