| **Navigation:**  [[abc library reference.htm|ABC Library Reference]] > ASCIIViewerClass > AsciiViewerClass Methods >====== Kill (shut down the ASCIIViewerClass object) {{c6h0009.jpg|C6H0009.jpg}} ====== | [[init initialize the asciiviewerclass object .htm|{{btn_prev_n.gif|Previous page}}]][[abc library reference.htm|{{btn_home_n.gif|Return to chapter overview}}]][[pagedown scroll down one page .htm|{{btn_next_n.gif|Next page}}]] | | || **Kill** {{blk2blue.jpg|blk2blue.jpg}} The **Kill **method frees any memory allocated during the life of the object and performs any other required termination code. **Example:** ** PROGRAM** ** MAP** ** END** ** INCLUDE('ABASCII.INC')                !declare ASCIIViewer Class** **ViewWindow WINDOW('View an ASCII File'),AT(3,7,296,136),SYSTEM,GRAY** **       LIST,AT(5,5,285,110),USE(?AsciiBox),IMM** **       BUTTON('&Print'),AT(5,120),USE(?Print)** **       BUTTON('&Search'),AT(45,120),USE(?Search)** **       BUTTON('&Close'),AT(255,120),USE(?Close)** **      END** **GlobalErrors ErrorClass                !declare GlobalErrors object** **Viewer AsciiViewerClass,THREAD         !declare Viewer object** **ViewerActive BYTE(False),THREAD        !Viewer initialized flag** **Filename   STRING(255),THREAD          !FileName variable** **AsciiFile FILE,DRIVER('ASCII'),NAME(Filename),PRE(A1),THREAD** **RECORD     RECORD,PRE()** **Line        STRING(255)** **           END** **          END** ** CODE** ** GlobalErrors.Init                   !initialize GlobalErrors object** ** OPEN(ViewWindow)                    !open the window** ** !Initialize Viewer with: ** ** ViewerActive=Viewer.Init( AsciiFile,|     ! file label,** **              A1:line,               |     ! file field to display** **              Filename,              |     ! variable file NAME attribute** **              ?AsciiBox,             |     ! LIST control number** **              GlobalErrors,          |     ! ErrorClass object** **              EnableSearch+EnablePrint)  ! features to implement flag** ** IF ~ViewerActive THEN RETURN.             !if init unsuccessful, don't** **  ! call other Viewer methods** ** ACCEPT                                    !If init succeeded, proceed** **  IF EVENT() = EVENT:CloseWindow** **   IF ViewerActive THEN Viewer.Kill.       !If init succeeded, shut down** **  END** **  !program code** ** END**