func init // add using module sys.add_use('System.Text') // use external class sys.UseClass("INIFile") // initialize instance sys.add_object(this.codename, 'IniFile') // initialize properties if(not isdef("Encoding")) blk_init.println(this.codename, '.FileEncoding = ', sys.get_undef_manager("Encoding"), ';') end if(linked("Result") and linked("doReadKey")) sys.add_var('val', 2) end end func make_read(data) return(this.codename + '.ReadValue(' + d("FileName") + ', ' + d("Section") + ', ' + d("Key") + (linked("Value") ? (', ' + d("Value")) : '') + ')') end func doReadKey(data) if(linked("Result")) blk.println(this.val, ' = ', make_read(data), ';') event("onResult", this.val) else event("onResult", make_read(data)) end end func doWriteKey(filename, section, key, value) blk.println(this.codename, '.WriteValue(', d("FileName"), ', ', d("Section"), ', ', d("Key"), ', ', d("Value"), ');') end func doReadSections(filename) event("onReadSections", this.codename + '.ReadSections(' + d("FileName") + ')') end func doReadKeys(filename, section) event("onReadKeys", this.codename + '.ReadKeys(' + d("FileName") + ', ' + d("Section") + ')') end func doDeleteKey(filename, section, key) blk.println(this.codename, '.RemoveKey(', d("FileName"), ', ', d("Section"), ', ', d("Key"), ');') end func doEraseSection(filename, section) blk.println(this.codename, '.RemoveSection(', d("FileName"), ', ', d("Section"), ');') end func doClearAll // TODO end func Result if(linked("doReadKey")) return(this.val) else return(make_read()) end end