1 SUB SMG_ERRMSG(STRING Error_message,BYTE Video_attr) !---------------------------------------------------------------& ! & ! SMG_ERRMSG & ! & ! Creation Date: 3-July-1985 & ! Author: Ken Messer & ! Purpose: Display an error message on & ! its own one line virtual & ! display pasted on pasteboard & ! row 24. & ! & ! 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 RS, & Video_attributes EXTERNAL LONG FUNCTION SMG$Put_chars, & SMG$Paste_virtual_display, & SMG$Unpaste_virtual_display, & SMG$Ring_Bell EXTERNAL LONG CONSTANT SS$_Normal, & SMG$M_Blink, & SMG$M_Bold, & SMG$M_Reverse, & SMG$M_Underline EXTERNAL STRING FUNCTION Get_Error_Message(LONG) !---------------------------------------------------------------& ! & ! M a i n P r o g r a m L o g i c & ! & !---------------------------------------------------------------& ! If the error message is a "?", use default message Error_message = "Invalid entry - try again" IF Error_message = "?" ! Test the attributes mask and set the appropriate ones Video_attributes = 0 Video_attributes = Video_attributes OR SMG$M_Blink & IF Video_attr AND 1 Video_attributes = Video_attributes OR SMG$M_Bold & IF Video_attr AND 2 Video_attributes = Video_attributes OR SMG$M_Reverse & IF Video_attr AND 4 Video_attributes = Video_attributes OR SMG$M_Underline & IF Video_attr AND 8 ! Display the error message ! If it's null, don't bother - user justs wants to ring the bell 100 RS = SMG$Put_chars(Err_display_id,Error_message,1,1,-1, & Video_attributes,,) & UNLESS Error_message = "" IF RS AND SS$_Normal = 0 THEN PRINT Get_Error_Message(RS) STOP END IF ! Paste the error message display to pasteboard line 24 200 RS = SMG$Paste_virtual_display(Err_display_id,Current_pasteboard_id,24,1) IF RS AND SS$_Normal = 0 THEN PRINT Get_Error_Message(RS) STOP END IF ! Ring the bell for added effect CALL SMG$Ring_Bell(Err_display_id,1) ! Sleep for three seconds (unless the error message was null), then ! unpaste the error message display SLEEP 3 UNLESS Error_message = "" 300 RS = SMG$Unpaste_virtual_display(Err_display_id,Current_pasteboard_id) IF RS AND SS$_Normal = 0 THEN PRINT Get_Error_Message(RS) STOP END IF 32767 SUBEXIT END SUB