1 SUB SMG_CLEAR(LONG Entity,LONG Portion,LONG Vir_disp_num) !---------------------------------------------------------------& ! & ! SMG_CLEAR & ! & ! Creation Date: 3-July-1985 & ! Author: Ken Messer & ! Purpose: Clear all or a portion of a & ! virtual display & ! & ! 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 LONG Return_status, & Cur_row, & Cur_col EXTERNAL LONG CONSTANT SS$_Normal EXTERNAL LONG FUNCTION SMG$Erase_line, & SMG$Erase_display, & SMG$Return_cursor_pos EXTERNAL STRING FUNCTION Get_Error_Message(LONG) !---------------------------------------------------------------& ! & ! M a i n P r o g r a m L o g i c & ! & !---------------------------------------------------------------& ! Find the current cursor position so we know where we are Return_status = SMG$Return_cursor_pos(Display_id(Vir_disp_num), & Cur_row,Cur_col) ! Check for error IF Return_status AND SS$_Normal = 0 THEN PRINT Get_Error_Message(Return_status) STOP END IF ! Now see what the user wants to do SELECT Entity CASE 0 ! clear the screen SELECT Portion CASE 0 ! cursor to end of screen Return_status = SMG$Erase_display(Display_id(Vir_disp_num), & Cur_row,Cur_col,,) CASE 1 ! cursor to beginning of screen Return_status = SMG$Erase_display(Display_id(Vir_disp_num), & 1,1,Cur_row,Cur_col) CASE 2 ! entire screen Return_status = SMG$Erase_display(Display_id(Vir_disp_num),,,,) CASE ELSE GOTO Done END SELECT CASE 1 ! clear the line SELECT portion CASE 0 ! cursor to end of line Return_status = SMG$Erase_line(Display_id(Vir_disp_num),,) CASE 1 ! cursor to beginning of line Return_status = SMG$Erase_display(Display_id(Vir_disp_num), & Cur_row,1,Cur_row,Cur_col) CASE 2 ! entire line Return_status = SMG$Erase_line(Display_id(Vir_disp_num),Cur_row,1) CASE ELSE GOTO Done END SELECT END SELECT ! Check for error IF Return_status AND SS$_Normal = 0 THEN PRINT Get_Error_Message(Return_status) STOP END IF Done: SUBEXIT END SUB