TMPL() Function - Fetch String Template

Syntax

TMPL(chan{,IND=index}{,ERR=lineref})

Description

The TMPL() function returns a string template describing a device or file open on a channel. The TMPL() function may also be used in conjunction with the FIN() function, which returns information about a device or file open on a channel. When the value specified in the IND= option of the TMPL() function matches the IND= value of the FIN() function, the template returned by TMPL() matches the data returned by the FIN() function. Using the TMPL() function with an IND=0 returns the template for the FIN() function with no IND=.

The optional IND=1 parameter returns a template of the Grid Information Block.

For an explanation of the values returned and their meanings, see SYSGUI_Channel-Specific_FIN()_Data.

Examples

Example 1 Terminal

The following returns the template of channel 0:

0010 REM This example returns the template of
0010:channel 0 (the terminal)
0020 DIM A$:TMPL(0,IND=0)
0030 A$=FIN(0,IND=0)
0040 PRINT FATTR(A$),'LF'
0050 PRINT "COLUMNS:",A.MAXCOLS," ROWS:",A.MAXROWS
>RUN
CUR_COL:U(1),CUR_ROW:U(1),MAXCOLS:U(1),MAXROWS:U(1),
MIN_COL:U(1),MIN_ROW:U(1),COLS:U(1),ROWS:U(1),
WINDOW:U(2),*:U(1),CUR_ATTR:C(1),CUR_COLOR:C(2),*:U(1),
DEF_ATTR:C(1),DEF_COLOR:C(2),DEVTYPE:C(1),DEVFLAGS:C(2)
,WINFLAGS:C(2),TTYFLAGS:C(2),*:C(7),DEVNAME:C(1*=0),
DEVTYPE:C(1*=0),DEVMODE:C(1*=0)
COLUMNS: 80 ROWS: 25

Example 2 Sysprint

print tmpl (1,ind=2)
fontname0:c(1*), fontname1:c(1*), fontname2:c(1*), fontname3:c(1*), fontname4:c(1*), fontname5:c(1*), fontname6:c(1*)

Example 3 SYSGUI Event Queue

The following illustrates using the data record of the SYSGUI event queue:

0010 REM This example illustrates using the data record
0010:of the SYSGUI event queue
0020 OPEN(1)"X0"
0030 DIM E$:TMPL(1)
0040 …
0100 READ RECORD(1,SIZ=LEN(E$))E$
0110 REM Next statements determine which event
0110:has happened
0120 IF E.CODE$="X" THEN END; REM close box selected
0130 IF E.CODE$="B" AND E.ID=1 THEN GOTO OK; REM push
0130:button with id 1
0140 IF E.CODE$="B" AND E.ID=2 THEN GOTO CANCEL; REM
0140:push button with id 2
0150…