Z
ZippyV
Hello everybody,
I've made a simple class that reads an xml-file with some methods to delete
a row, add a row and to get the amount of lines in the dataset:
public class bugreports
private dsbugreport as new dataset
public sub new()
dsbugreport.readxmlscheme(...)
dsbugreport.readxml(...)
end sub
public sub insertreport()
...
dsbugreport.tables(0).rows.add(...)
end sub
public function viewreports()
return dsbugreport
end function
protected overrides sub finalize()
dsbugreport.writexml(...)
end sub
end public class
My problem is that I need to call the finalize sub when I want it (most of
the times at the end of the sub that called my class) and not the garbage
collection. I tried setting the 'bugreports = nothing' but that didn't call
the finalize sub.
The only solution I can think of is putting the 'dsbugreport.writexml(...)'
line in every sub/function where I change something in the dataset, but is
this the best method?
I've made a simple class that reads an xml-file with some methods to delete
a row, add a row and to get the amount of lines in the dataset:
public class bugreports
private dsbugreport as new dataset
public sub new()
dsbugreport.readxmlscheme(...)
dsbugreport.readxml(...)
end sub
public sub insertreport()
...
dsbugreport.tables(0).rows.add(...)
end sub
public function viewreports()
return dsbugreport
end function
protected overrides sub finalize()
dsbugreport.writexml(...)
end sub
end public class
My problem is that I need to call the finalize sub when I want it (most of
the times at the end of the sub that called my class) and not the garbage
collection. I tried setting the 'bugreports = nothing' but that didn't call
the finalize sub.
The only solution I can think of is putting the 'dsbugreport.writexml(...)'
line in every sub/function where I change something in the dataset, but is
this the best method?