User Tools

Site Tools


kill_shut_down_the_asciifileclass_object_.htm
Navigation:  ABC Library Reference > ASCIIFileClass > AsciiFileClass Methods >====== Kill (shut down the ASCIIFileClass object) C6H0009.jpg ====== Previous pageReturn to chapter overviewNext page

Kill

blk2blue.jpg

The Kill method frees any memory allocated during the life of the object and performs any other required termination code.

Example:

Filename    STRING(255),THREAD             !declare filename variable

FileActive  BYTE                           !declare success/fail switch

AsciiFile   FILE,DRIVER('ASCII'),NAME(Filename),PRE(A1)

RECORD       RECORD,PRE()

Line          STRING(255)

            END

           END

CODE                                      !init ASCIIFileClass object with:

FileActive=ASCIIFile.Init(AsciiFile, |    ! file label

             A1:Line,                |    ! file field to display

             Filename,               |    ! NAME attribute variable

             GlobalErrors)                ! ErrorClass object

IF ~FileActive THEN RETURN.               !If init failed, don't proceed

ACCEPT                                    !If init succeeded, proceed

 IF EVENT() = EVENT:CloseWindow

  IF FileActive THEN ASCIIFile.Kill.      !If init succeeded, shut down

 END

 !program code

END

kill_shut_down_the_asciifileclass_object_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1