func init // adds using namespace sys.add_use('myTests') sys.add_use('System.Collections.Generic') sys.add_use('System.Drawing') sys.add_use('System.IO') // Use external class sys.UseClass("TestTypedFields") // initialize instance sys.add_var(this.name, 'TypedFields') // Type 1 blk_init.println(this.codename, ' = new TypedFields(', d("Type1", 1, 321), ');') blk_init.println(this.codename, ' = new TypedFields(', sys.get_typed_field(123, 'Type1', 1), ');') // Type 2 blk_init.println(this.codename, ' = new TypedFields(', d("Type2", 2, "text"), ');') blk_init.println(this.codename, ' = new TypedFields(', sys.get_typed_field("TEXT", 'Type2', 2), ');') // Type 3 blk_init.println(this.codename, ' = new TypedFields(', d("Type3", 3, 'null'), ');') blk_init.println(this.codename, ' = new TypedFields(', sys.get_typed_field('null', 'Type3', 3), ');') // Type 4 blk_init.println(this.codename, ' = new TypedFields(', d("Type4", 4, 0), ');') blk_init.println(this.codename, ' = new TypedFields(', sys.get_typed_field(0, 'Type4', 4), ');') // Type 5 > arr = d("Type5", 5, '') blk_init.println(this.codename, ' = new TypedFields(new List(new string[] { ', arr.join(', '), ' }));') blk_init.println(this.codename, ' = new TypedFields(', sys.get_typed_field('new List()', 'Type5', 5), ');') // Type 6 blk_init.println(this.codename, ' = new TypedFields(', sys.get_typed_field('this.Icon', 'Type6', 6), ');') // Type 7 blk_init.println(this.codename, ' = new TypedFields(', d("Type7", 7, 'Double.MaxValue'), ');') blk_init.println(this.codename, ' = new TypedFields(', sys.get_typed_field('Double.MaxValue', 'Type7', 7), ');') // Type 8 blk_init.println(this.codename, ' = new TypedFields(', sys.get_typed_field('this.Foreground', 'Type8', 8), ');') // Type 10 blk_init.println(this.codename, ' = new TypedFields(', sys.get_typed_field('new MemoryStream()', 'Type10', 10), ');') // Type 11 blk_init.println(this.codename, ' = new TypedFields(', sys.get_typed_field('new Bitmap(1, 1)', 'Type11', 11), ');') // Type 13 blk_init.println(this.codename, ' = new TypedFields(', sys.get_typed_field('new int[] {}', 'Type13_int', 13, 1), ');') blk_init.println(this.codename, ' = new TypedFields(', sys.get_typed_field('new string[] {}', 'Type13_str', 13, 2), ');') blk_init.println(this.codename, ' = new TypedFields(', sys.get_typed_field('new double[] {}', 'Type13_real', 13, 7), ');') // Type 14 blk_init.println(this.codename, ' = new TypedFields(', sys.get_typed_field('Status.Idle', 'Type14', 14, 'Status'), ');') // Type 20 blk_init.println(this.codename, ' = new TypedFields(', d("Type20", 20, 'this'), ');') blk_init.println(this.codename, ' = new TypedFields(', sys.get_typed_field('this', 'Type20', 20), ');') // Type 104 blk_init.println(this.codename, ' = new TypedFields(', d("Type104", 104, 'false'), ');') blk_init.println(this.codename, ' = new TypedFields(', sys.get_typed_field('false', 'Type104', 104), ');') // Type 105 blk_init.println(this.codename, ' = new TypedFields(', d("Type105", 105, 'Int64.MaxValue'), ');') blk_init.println(this.codename, ' = new TypedFields(', sys.get_typed_field('Int64.MaxValue', 'Type105', 105), ');') // Type 106 blk_init.println(this.codename, ' = new TypedFields(', d("Type106_literal", 106, ''), ');') blk_init.println(this.codename, ' = new TypedFields(', sys.get_typed_field('$', 'Type106_literal', 106), ');') blk_init.println(this.codename, ' = new TypedFields(', d("Type106_hex", 106, ''), ');') blk_init.println(this.codename, ' = new TypedFields(', sys.get_typed_field('$', 'Type106_hex', 106), ');') blk_init.println(this.codename, ' = new TypedFields(', d("Type106_unicode", 106, ''), ');') blk_init.println(this.codename, ' = new TypedFields(', sys.get_typed_field('$', 'Type106_unicode', 106), ');') // Type 107 blk_init.println(this.codename, ' = new TypedFields(', d("Type107", 107, 'Single.MaxValue'), ');') blk_init.println(this.codename, ' = new TypedFields(', sys.get_typed_field('Single.MaxValue', 'Type107', 107), ');') // Type 108 blk_init.println(this.codename, ' = new TypedFields(', d("Type108", 108, 'Decimal.MaxValue'), ');') blk_init.println(this.codename, ' = new TypedFields(', sys.get_typed_field('Decimal.MaxValue', 'Type108', 108), ');') // initialize properties sys.set_typed_field(1, 'Type1') sys.set_typed_field(2, 'Type2') sys.set_typed_field(3, 'Type3') sys.set_typed_field(4, 'Type4') sys.set_typed_field(5, 'Type5') sys.set_typed_field(6, 'Type6') sys.set_typed_field(7, 'Type7') sys.set_typed_field(8, 'Type8') sys.set_typed_field(10, 'Type10') sys.set_typed_field(11, 'Type11') sys.set_typed_field(13, 'Type13_int') sys.set_typed_field(13, 'Type13_str') sys.set_typed_field(13, 'Type13_real') sys.set_typed_field(14, 'Type14', '', 'Status') sys.set_typed_field(20, 'Type20') sys.set_typed_field(104, 'Type104') sys.set_typed_field(105, 'Type105') sys.set_typed_field(106, 'Type106', 'Type106_literal') sys.set_typed_field(106, 'Type106', 'Type106_hex') sys.set_typed_field(106, 'Type106', 'Type106_unicode') sys.set_typed_field(107, 'Type107') sys.set_typed_field(108, 'Type108') end func doConstructor(data) // Type 1 blk.println(this.codename, ' = new TypedFields(', d("Type1", 1, data), ');') blk.println(this.codename, ' = new TypedFields(', sys.get_typed_field(data, 'Type1', 1), ');') sys.set_typed_field(1, 'Type1', '', '', blk) end func doTest(data) blk.println(this.codename, '.Type1 = ', d("Type1"), ';') blk.println(this.codename, '.Type2 = ', d("Type2"), ';') blk.println(this.codename, '.Type7 = ', d("Type7", 7), ';') blk.println(this.codename, '.Type104 = ', d("Type104", 104), ';') blk.println(this.codename, '.Type105 = ', d("Type105", 105), ';') blk.println(this.codename, '.Type106 = ', d("Type106_literal", 106), ';') blk.println(this.codename, '.Type107 = ', d("Type107", 107), ';') blk.println(this.codename, '.Type108 = ', d("Type108", 108), ';') end