I have a method in a class I am writing that uses TBank and CreateBankStream to save data:
I have a few questions on my methodology here:
1. Do I need to destroy the TBank object or will the GC get it? There is no CloseBank() command so I assume that it will be deleted once it goes out of scope at the end of the method.
2. Is there a better way to get a string or equivalent pointer from a bank or stream than "Str = ReadString(Stream, StreamSize(Stream))"? This is passed into a DLL call to store it in the database.
Method SaveToDB(db:Int) Local Bank:TBank Local Stream:TStream Local Str:String Bank = CreateBank(256) Stream = CreateBankStream(Bank) ' WriteInt, WriteString, etc used to write data to the Stream SeekStream(Stream, 0) Str = ReadString(Stream, StreamSize(Stream)) ' Str is stored to the DB here CloseStream(Stream) EndMethod
I have a few questions on my methodology here:
1. Do I need to destroy the TBank object or will the GC get it? There is no CloseBank() command so I assume that it will be deleted once it goes out of scope at the end of the method.
2. Is there a better way to get a string or equivalent pointer from a bank or stream than "Str = ReadString(Stream, StreamSize(Stream))"? This is passed into a DLL call to store it in the database.