Contents |
1. Overview |
2. Properties |
3. Functions |
4.Events |
5. TN3270 and TN5250 Controls |
TE functionality includes terminal emulation, communications relating to terminal emulation, host mode (server), and all properties and functions relating to the above capabilities. The TE control does not include any file-transfer components.
The following CScript demonstrates some of the TE Obect's features and how to use them. This script asks the user for the host name that the user wants to connect to, sets the necessary properties for a default Telnet connection, and connects to the host the user entered.
// get hostname from the user// set TE properties and connect
te.Node = node; | // Sets node = "Hostname" |
te.NetPort = 23; | // Default Telnet Port |
te.ConnectionType = 0; | // Telnet connection |
te.Emulation = 5; | // Set emulation type to SCOANSI |
te.AutoLogin = 0; | // Turns autologin off |
te.Connect(); | // Connects to host |
Back to Top |
Object properties act as variables. To set the value of a property, use the format te.Property = argument. For example:
te.Emulation = 0;
To get the value of a property, use the property as the argument of an assignment or wherever you need the property's value. For example:
var sNode = te.Node;
Each TE object includes the following properties
Property Name
Data Type
Description
AddCR
Boolean
Add CR to end of line.
Default = FALSE
AddLF
Boolean
Add LF to end of line.
Default = FALSE
AutoConnect
Boolean
Connect on session open.
Default = FALSE
AutoLogin
Boolean
Login after connect.
Default = FALSE
BackspaceIsDelete
Boolean
Default = TRUE
Baud
Integer
Asynch communication baud rate.
Default = 9600
Blockmode
Boolean
Default = FALSE
CanAbort
Boolean
Allow ^C interruption for some functions.
Default = FALSE
CaptureDevice
String
Device or file for data capture.
Default = capt#.fil
CaptureFlush
Boolean
Close capture file at end of data.
Default = FALSE
CaptureMode
Integer
0 ASCII (default)
1 BINARY
2 CONTROL
3 MNEMONIC
CaptureOn
Boolean
Data capture setting.
Default = FALSE
CaptureOverwrite
Boolean
Overwrite existing capture file.
Default = FALSE (append)
CaptureType
Integer
0 PRINT MANAGER
1 DEVICE
2 FILE (default)
3 SPOOL
CharSet
Integer
0 American (Default)
1 British
2 Dutch
3 Finnish
4 French
5 Canadian
6 German
7 Italian
8 Danish
9 Norwegian
10 Portugese
11 Spanish
12 Swedish
13 Swiss
ChiseledLineDraw
Boolean
Use thin graphical line draw. Supersedes SolidLineDraw.
Default = FALSE
ChiseledSelection
Boolean
Indented text selection.
Default = FALSE
CommLink
String
Name of COMM object to load.
Default = COMM.COM
ComPort
Integer
Sets the COM port used for asynchronous communications by number.
ConnectionType
Integer
0 Telnet (Default)
1 Rlogin
2 Asynchronous
3 TAPI
CursorType
Integer
0 Blinking Block (Default)
1 Solid Block
2 Blinking Line
3 Solid Line
DestructiveBackspace
Boolean
Backspace blanks out Characters.
Default = FALSE
DisconnectOnExit
Boolean
Default = TRUE
DropDTROnExit
Boolean
Default = TRUE
DuplexMode
Integer
0 Full (Default)
1 Half
2 Mnemonic
3 Control
Emulation
Integer
Note that the value you use to set the emulation mode
and the value you get when you get the emulation do not
correspond.
Set Value
Get Value
UNIX Modes
0 ADM1
1 ANSI
2 AT386
3 IBM 3101
4 PCTERM
5 SCOANSI (Default)
6 TTY
7 TV912
8 TV925
9 TV950
10 VT100
11 VT102
12 VT220
13 VT220-7
14 VT320
15 VT320-7
16 WYSE50
17 WYSE60
18 WYSE60-25
19 IBM 3151
20 IBM 3151-25
21 IBM3179-2
22 IBM3477-FT
TN3270 Modes
23 IBM3278-2
24 IBM3278-3
25 IBM3278-4
26 IBM3278-5
UNIX Modes
0
1 VT320
2 VT320-7
3 VT220
4 VT220-7
5 VT100/VT102
6
7 ANSI
8 AT386
9 SCOANSI
10 WYSE60
11 WYSE60-25
12 PCTERM
13 TV950
14 WYSE50
15 TV925
16 TV912
17 ADM1
18 IBM 3101
19 IBM 3151
20 IBM 3151-25
21 TTY
21 IBM3179-2
22 IBM3477-FT
23 IBM3278-2
24 IBM3278-3
25 IBM3278-4
26 IBM3278-5
ESCPassThru
Boolean
Telnet ESC pass-through.
Default = FALSE
Fingerprint
String
Current SSH fingerprint.
HasSSH
Boolean
True if current session is SSH. Read-only.
IgnoreHostColor
Boolean
Disables processing of sequences sent from host.
Default = FALSE
IgnorePrintStop
Boolean
Pause printing until PrintStopFlags condition is met.
Default = FALSE
IsConnected
Boolean
TRUE if a connection is active. Read-only.
JumpScroll
Integer
Number of lines to jump scroll. Set to 0 (default) to turn off
KeyMacroPse
Boolean
Pause the Keyboard Macro Recorder.
Default = FALSE
LastError
Integer
Number of the last error. Read-only.
LDelay
Integer
Milliseconds of pause after a linefeed.
Default = 0
LoginString
String
String that controls auto login
LogoffString
String
String that controls auto logout.
MaskParity
Boolean
Enables stripping of the high bit from incoming data.
Default = FALSE
NetPort
Integer
Sets the TCP/IP port for Rlogin, Telnet or SSH connections.
Defaults
Telnet 23
Rlogin 513
SSH 22
Node
String
Specifies hostname, IP address, or phone number for Telnet, Rlogin, or TAPI connections
NoScroll
Boolean
Controls scrolling.
Default = FALSE
NumColumns
Integer
1-132. Default = 80
NumLines
Integer
1-66. Default = 25
NumLockON
Boolean
Default = FALSE
Pages
Integer
Number of screen pages, 1-6.
Default = 6
Parity
Integer
Asynch parity
0 None (Default)
1 Odd
2 Even
3 Mark
4 Space
Password
String
Password for auto-login
PrinterColumns
Integer
Number of columns on a printed page.
Default = 0 (auto set)
PrinterFile
String
File or device for printing.
PrinterFlags
Integer
For printing to file.
0 Append (default)
1 Overwrite
PrinterFlush
Boolean
Flush print buffer at end of job.
Default = FALSE
PrinterLines
Integer
Number of lines on a printed page.
Default = 0 (auto set)
PrinterMode
Integer
Determines printer setup
17 Print to file
18 Direct to device
19 Ignore print requests
20 To Windows printer
Add 32 to the number above to bypass the Windows printer driver. (Only affects setting 20.) Add 128 to add a form feed to the end of the print job. (Does not affect settings 17 or 19.)
PrinterPause
Integer
Number of seconds with no new data to wait before printing.
Default = 5
PrintStopFlags
Integer
1 Print on key press
2 Print on timeout
ProxyHostID
String
Hostname or IP address of the proxy server.
ProxyPassword
String
Password for a proxy connection.
ProxyPort
Integer
TCP/IP port number for a proxy connection.
Proxytn_gw_nav
Boolean
Sets tn_gw_nav for proxy connections.
Default = FALSE
ProxyType
Integer
0 None
1 Generic
2 SOCKS 4
3 SOCKS 5, no authentication
4 SOCKS 5, username & password
ProxyUserID
String
Username for a proxy connection.
RTS
Boolean
RTS/CTS flow control.Default = FALSE
ScrollBack
Integer
Number of lines to store in the scrollback buffer.
Default = 999
ScrollBar
Boolean
Enables scrollbar.
Default = FALSE
ShowTelnet
Boolean
Show telnet negotiation.
Default = FALSE
SolidLineDraw
Boolean
Use thick graphical line draw. Superseded by ChiseledLineDraw.
Default = FALSE
SSHCompressionLevel
Integer
A number from 0 (none) to 9 (highest, default)
SSHCypherType
Integer
0 None
1 DES
2 3DES (default)
3Blowfish
StopBits
Integer
Stop bits for asynch communication.
Default = 1
TabEx
Boolean
Expand tabs.
Default = TRUE
TDelay
Integer
Milliseconds of pause after a tab character.
Default = 0
TermID
String
VT ID of Terminal
TurnCharacter
Integer
ASCII value of IBM turnaround character.
Default = 13
UseAlt
Boolean
Enables handling of ALT keys in emulators.
Default = FALSE
UserName
String
User name for auto-login
ViewLogin
Boolean
View auto-login process.
Default = FALSE
WaitForCall
Boolean
Waits for an incoming call on the modem.
Default = FALSE
WindowsLookandFeel
Boolean
Enables Windows Look and Feel mode, a combination of ChiseledSelection and ChiseledLineDraw.
Default = FALSE
WordLength
Integer
Asynch communication word length.
Default = 8
WrapLines
Boolean
Wrap long lines.
Default = TRUE
WRU
String
String sent after WRUChar is received.
WRUChar
Integer
ASCII value of character to request WRU string.
Default = 5
XonCom
Boolean
XON/XOFF flow control.
Default = FALSE
Back to Top
TE objects are accessed in scripting with the format te.ObjectName(parameters). For example, to clear the screen, the command is:
te.cls();
Integer AddFont
AddFont(sFontName,sCodePage,iFontIndex)
Add a font to the font list in the TE control. sCodePage is limited to the short name of the code page. The code page file is now hardcoded to be tcs.dat. iFontIndex runs from 0-(MAXFONTS-1), where MAXFONTS is currently set to 4, and is a compile-time #define. Passing -1 to iFontIndex will load the font in the next available slot. Returns -1 on failure, and the index where the font was loaded on success
Void Break
Break()
Send a Break signal to the host.
Void CancelDialog
CancelDialog()
Cancel a currently running dialog string.
Boolean Capture
Capture(nType,sFile)
Starts data capture of type nType (as CaptureType above) to file or device sFile. Returns 0 on successful capture start.
String Chrdy
Chrdy()
Returns the character pressed at the keyboard as a string, without waiting. If no key was hit, returns a zero-length string.
String Chrin
Chrin()
Waits for a character to be pressed at the keyboard and returns it as a string
Integer Cls
Cls()
This function will clear the terminal emulator screen, as well as the scrollback buffer. Always returns 0.
String ComIn
ComIn()
Looks for a character to be received at the communications line and returns it as a string. If no character is received, returns a zero-length string
Boolean ComSt
ComSt()
Returns true if a character is received at the communications line
Integer Connect
Connect()
Attempts to make a connection to a remote server, using the parameters set earlier. If this method succeeds (indicated by the return code) an EConnect (for a successful connection) or an EDisconnect (for a failed connection) event will eventually be fired. The success of this function merely indicates that a connection is in progress, not that we are actually connected with the remote server. For instance, a TELNET connection to a remote machine will returnimmediately (assuming that all the parameters are set correctly), but the connection is not actually established until the EConnect is received. On failure of the connection, EDisconnect will be fired. Returns 0 for success, non-zero for various failure modes, depending upon the type of failed connection
Void CopySelection
CopySelection(x,y,w,h)
Copy a portion of the emulator screen to the clipboard in text format. The top left corner of the emulator is x=1 and y=1. If all parameters are 0, copies the currently selected portion of the emulator screen to the clipboard. If all parameters are -1, the entire emulator screen will be copied
String Cread
Cread(iTimeout,iChars,bOption)
Reads characters from the communications line into a string variable. Writes to the variable after nChars characters are received, or after nTimeout seconds have passed. If nTimeout is 0, it will not time out.
Option
Integer CreadInt
Boolean DeleteFont
Boolean Disconnect
Void Display
Void DisplayNL
Integer DoDialog
Void Flush
Integer GetBGColor
Attribute
Color
Integer GetFGColor
Color
String GetFont
Integer GetRGBEntry
String GetSelection
Integer GetTextAttribute
Characteristic
Boolean IsClipboardEmpty
Integer KeyIn
Void KeyMacroEnd
String KeyMacroRec
Boolean LoadKeyboard
Void MouseFunction
Button
Function
Void Paste
Void PrintScreen
Void PrintSetup
String Read
Void Redraw
Void RevDim
Integer SetAltCP
Boolean SetBackgroundImage
iMethod
Void SetBGColor
Boolean SetDECMNCP
Boolean SetDECSGCP
Void SetDTRExit
Boolean SetEmInCP
Boolean SetEmOutCP
Void SetFGColor
Boolean SetFontCP
Boolean SetKbdCP
Void SetKey
Void SetRGBEntry
Void SetTextAttribute
Boolean SetVT100SGCP
Boolean StopPrint
Void Terminal Terminal(sString)
Void Trans
Integer Wait
Multiple match strings may be specified by separating them with the characters “^S|^S”. If this is done, the return value will be the zero-based position of the matched string. For example,
will return 0 if “word” is received, and 1 if “client” is received.
Integer Xmit
Back to Top |
Click()
This event fires when a click is performed in the control.
DblClick()
This event fires when a double click is performed in the control.
EBinaryMode()
This event fires when the emulator is set to binary mode.
ECapsLockOff()
This event fires when Caps Lock is turned off.
ECapsLockOn()
This event fires when Caps Lock is turned on.
ECapture(bON,iCaptureType,sDevice)
This event fires when a capture operation starts or stops. bON is TRUE when capture is being turned on, FALSE when it is being turned off. iCaptureType is the type of capture that is currently configured. sDevice is the device that is being used for capture.
EConnect()
This event fires when a connection has occurred successfully.
EDisconnect()
This event fires when a connection has terminated (either through user action or a remote disconnection; i.e., when a socket is disconnected). This event also fires when an attempted connection fails. You will not receive this event if a given TE control is destroyed before the connection is terminated.
EExit()
This event fires when the user has pressed ALT-F4. This can only happen when the UseAlt property is set to FALSE. This can be used by the application to shut down.
ELoginStart()
This event fires just before a login or logout scheme is performed.
ELoginStop()
This event fires just after a login or logout scheme has been performed.
ENextSession()
This event fires when the user has indicated (via a keystroke) that they want to advance to the next session. The actual switching of sessions must be handled by the application.
ENumLockOff()
This event fires when Num Lock is turned off.
ENumLockOn()
This event fires when Num Lock is turned on.
EPrint(bON)
The event fires when printing commences or stops. bON is set to TRUE when printing starts, and FALSE when printing ends.
MouseDown(iButton,iShift,x,y)
This event fires when a mouse button is depressed in the control. iButton is the number of the mouse button that is depressed. The left button is 1, the right button is 2, and the middle button is 4. iShift is the status of the shifting keys at the time of the keypress. iShift is a bit field with the least-significant bits corresponding to the SHIFT key (bit 0), the CTRL key (bit 1), and the ALT key (bit 2 ). These bits correspond to the values 1, 2, and 4, respectively. iShift indicates the state of these keys. Some, all, or none of the bits can be set, indicating that some, all, or none of the keys are pressed. For example, if both CTRL and ALT were pressed, the value of iShift would be 6. x and y are the x and y positions of the mouse cursor, relative to the upper left hand corner of the control.
MouseUp(iButton,iShift,x,y)
This event fires when a mouse button is released in the control. The arguments are identical to those for MouseDown.
Back to Top |