1	SUB SMG_CHANGE_DEF_ATTR(WORD Rendition,BYTE Vir_disp_num)

	!---------------------------------------------------------------&
	!								&
	!		      SMG_CHANGE_DEF_ATTR			&
	!								&
	!		Creation Date:  3-July-1985			&
	!		Author:		Ken Messer			&
	! 		Purpose:        Change a virtual display's	&
	!				video Rendition			&
	!								&
	!		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_attr

	EXTERNAL LONG FUNCTION			SMG$Change_virtual_display

	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		&
	!								&
	!---------------------------------------------------------------&

	! Test the rendition mask and set the specified video attributes

	Video_attr = Video_attr OR SMG$M_Blink		IF Rendition AND 1
	Video_attr = Video_attr OR SMG$M_Bold		IF Rendition AND 2
	Video_attr = Video_attr OR SMG$M_Reverse	IF Rendition AND 4
	Video_attr = Video_attr OR SMG$M_Underline	IF Rendition AND 8

	Video_attr = Video_attr OR SMG$M_Blink	   	IF Rendition AND 16
	Video_attr = Video_attr OR SMG$M_Bold	   	IF Rendition AND 32
	Video_attr = Video_attr OR SMG$M_Reverse   	IF Rendition AND 64
	Video_attr = Video_attr OR SMG$M_Underline 	IF Rendition AND 128

	! Call the SMG RTL routine to change the rendition

	RS = SMG$Change_virtual_display(Display_id(Vir_disp_num),	&
		Display_rows(Vir_disp_num),Display_cols(Vir_disp_num),,	&
		Video_attr,)

	! Check for error

	IF RS AND SS$_Normal = 0   THEN
		PRINT Get_Error_Message(RS)
		STOP
	END IF

32767	SUBEXIT

	END SUB
