Telnet Connect User's Guide

APPENDIX C

Telnet Display Attributes

The Screen.getAttribute() method will return one of the values shown below, representing the current attribute state of the onscreen character at the given location.

Number

Attribute

0

normal display

1

bold on

2

faint

3

standout

4

underline (mono only)

5

blink on

7

reverse video on

8

nondisplayed (invisible)

30

black foreground

31

red foreground

32

green foreground

33

yellow foreground

34

blue foreground

35

magenta foreground

36

cyan foreground

37

white foreground

40

black background

41

red background

42

green background

43

yellow background

44

blue background

45

magenta background

46

cyan background

47

white background

Viewing All Character Attributes at Once

Using the Screen.getAttribute() method, you can easily write a function that captures all attributes (at all screen locations) at once. The following ECMAScript function, for example, can be used at design time to display screen attributes in an alert dialog.

  function showAttributes( myScreen )
  {
  	      var attribs = new String(); // create empty string
  
       // Iterate over all rows and columns:
       for (var i = 1; i <= myScreen.getRowCount(); i++, attribs += "\n")
            for (var k = 1; k <= myScreen.getColumnCount(); k++)
                 attribs += myScreen.getAttribute(i,k);
       // display the results:
       alert( attribs );
  }

The following illustrations show a Telnet screen and the result of applying the showAttributes() function to the screen:

leo

leoAtts



Copyright © 2004 Novell, Inc. All rights reserved. Copyright © 1997, 1998, 1999, 2000, 2001, 2002, 2003 SilverStream Software, LLC. All rights reserved.  more ...