! ! C R E A T E _ D E B U G _ W I N D O W . B A S ! ! ! Martin D. Lucas ! Allied Electronics, Inc. ! 7410 Pebble Drive ! Fort Worth, TX 76118 ! (817) 595-3500 ! ! This program creates a DECterm window using the existing display ! as defined by the logical name DECW$DISPLAY. The DECW$Debug_Display ! logical name will also be created. This program uses tips and ! techniques from various other programs found on DECUS tapes and ! on DSNLINK. ! ! See DEBUG_DISPLAY.COM - The terminal device created here must be ! allocated for use by debug or it will VANISH the first time it is ! used! ! ! Requirements: ! ! Files: DEBUG_DECTERM.DAT PROGRAM Create_Debug_DECterm OPTION TYPE = EXPLICIT, & SIZE = (REAL DOUBLE, INTEGER LONG), & CONSTANT TYPE = INTEGER %INCLUDE "$LNMDEF" %FROM %LIBRARY "SYS$LIBRARY:BASIC$STARLET" MAP (Device_Attributes) & STRING Device_Name = 50, & WORD Name_Length, & STRING File_Location=255, & LONG File_Loc_Len, & STRING Setup_File=60, & STRING Custom_String=80 DECLARE STRING Terminal_Name DECLARE LONG Return_Status, & Status_Flag DECLARE STRING Username, & Terminal_Number, & Hex_PID DECLARE WORD Group_Number, & Member_Number EXTERNAL LONG FUNCTION Decw$Term_Port EXTERNAL LONG FUNCTION Sys$Crelnm EXTERNAL LONG FUNCTION Sys$Trnlnm RECORD Itembuf GROUP Item(1) VARIANT CASE WORD Buffer_length WORD Item_code LONG Buffer_address LONG Return_length_address CASE LONG List_terminator END VARIANT END GROUP Item END RECORD ItemBUF DECLARE ItemBUF Itemlist ! Begin the main program ! Translate the logical name to find the location of the resource files Itemlist::Item(0)::Buffer_length = 255 Itemlist::Item(0)::Item_code = LNM$_String Itemlist::Item(0)::Buffer_address = LOC(File_Location) Itemlist::Item(0)::Return_length_address = LOC(File_Loc_Len) Itemlist::Item(1)::List_terminator = 0 Return_Status = SYS$TRNLNM(,"LNM$JOB","DECW$USER_DEFAULTS",,ItemList) ! If the name was not translated, then use a default location IF (Return_Status AND 1%) = 0% THEN File_Location = "Sys$Login" END IF ! Build the filename for the customization file Setup_File = EDIT$(File_Location + "DECW_Debug_Decterm.dat",140) ! Create a Decterm terminal window, passing the name of a setup file Return_Status = Decw$Term_Port(,trm$(Setup_File),Custom_String,Device_Name,Name_Length) IF (Return_Status AND 1%) = 0% THEN Call Lib$Stop(Return_Status BY VALUE) END IF ! Create a logical name to point to contain the terminal device name Itemlist::Item(0)::Buffer_length = 50 Itemlist::Item(0)::Item_code = LNM$_String Itemlist::Item(0)::Buffer_address = LOC(Device_Name) Itemlist::Item(0)::Return_length_address = LOC(Name_Length) Itemlist::Item(1)::List_terminator = 0 Return_Status = SYS$CreLNM(,"LNM$JOB","DECW$DEBUG_DISPLAY",,ItemList) IF (Return_Status AND 1%) = 0% THEN Call Lib$Stop(Return_Status BY VALUE) END IF END