ASCIIIO class problem

I have a problem with asciiIO file it’s declared in my class as follows: AsciiIo aSCIIFile; then, I have a method, that deletes the file after it has been read. //THIS LINE RAISES ERROR!!! aSCIIFile.finalize(); if (box::yesNo("Óäàëèòü ôàéë "+filename, 2)) { WinAPI::deleteFile(filename); } This is Axapta 3.0 SP3 - I get an error, because the method finalize() is declared as protected and cannot be called from a non-successor. How can I come around this? I need to finalize the object in order to delete it. In Axapta 2.5 SP4 the same code doesn’t raise an error

Hi, I also had similar problems before. You need to create a new class to extend AsciiIo (e.g. MyAsciiIo). Then you can do 2 things: create a custom public method (e.g. MyFinalize()) that will call the original: this.finalize(); or, just override the finalize() and declare public instead of protected. This should work.

Thanks, that’s exactly how I solved it. :slight_smile: