1 SUB SMG_CLOSE(BYTE Clear_screen_flag) !---------------------------------------------------------------& ! & ! SMG_CLOSE & ! & ! Creation Date: 3-July-1985 & ! Author: Ken Messer & ! Purpose: Delete the pasteboard, virtual & ! keyboard, and all virtual & ! displays & ! & ! Modification history & ! & ! Date Description of change(s) & ! & !---------------------------------------------------------------& ! & ! Copyright (c) 1985 - Ken Messer, Allied Electronics, Inc., & ! 401 E. 8th St., Ft. Worth, TX 76102 & ! & ! This software may be copied and distributed freely to anyone & ! for non-commerical use provided that this copyright notice is & ! included. & !---------------------------------------------------------------& OPTION TYPE = INTEGER, SIZE = INTEGER LONG %include "SMG$LIBRARY:SMG.DFN" DECLARE BYTE CONSTANT True = -1, & False = 0 DECLARE LONG RS EXTERNAL LONG FUNCTION SMG$Delete_pasteboard, & SMG$Delete_virtual_display, & SMG$Delete_virtual_keyboard EXTERNAL LONG CONSTANT SS$_Normal EXTERNAL STRING FUNCTION Get_Error_Message(LONG) !---------------------------------------------------------------& ! & ! M a i n P r o g r a m L o g i c & ! & !---------------------------------------------------------------& ! Delete the pasteboard(s) - force screen clear if desired 100 FOR I = 0 TO (Number_pasteboards - 1) SELECT Clear_screen_flag CASE False RS = SMG$Delete_pasteboard(Pasteboard_id(I),0) CASE ELSE RS = SMG$Delete_pasteboard(Pasteboard_id(I),1) END SELECT IF RS AND SS$_Normal = 0 THEN PRINT Get_Error_Message(RS) STOP END IF NEXT I ! Delete the error message virtual display 200 RS = SMG$Delete_virtual_display(Err_display_id) IF RS AND SS$_Normal = 0 THEN PRINT Get_Error_Message(RS) STOP END IF ! Delete all other virtual displays 300 FOR I = 0 TO (Number_virtual_displays - 1) RS = SMG$Delete_virtual_display(Display_id(I)) IF RS AND SS$_Normal = 0 THEN PRINT Get_Error_Message(RS) STOP END IF NEXT I ! Delete the virtual keyboard(s) - there will always be the ! same number of keyboards as pasteboards 400 FOR I = 0 TO (Number_pasteboards - 1) RS = SMG$Delete_virtual_keyboard(Keyboard_id(I)) IF RS AND SS$_Normal = 0 THEN PRINT Get_Error_Message(RS) STOP END IF NEXT I 32767 SUBEXIT END SUB