TinyTERM CScript User's Guide

Contents
1. Overview
2 Creating Scripts
3. Executing Scripts
4. CScript Command and Operators

1. Overview

CScript is Century Software's object-oriented, JavaScript-compatible scripting language that you can use to manipulate, customize, and automate the TinyTERM environment. Through CScript, you can provide your users with automated startup, login, logout, file transfer, and remote system access. Because CScript resembles the functionality and syntax of JavaScript, learning CScript is very easy, and you can find many JavaScript resources both in print and on the Internet.

Back to Top

 


2. Creating Scripts

You can create CScript scripts within the TinyTERM emulator or with any text editor. When creating or editing scripts within a text editor, save your script files with the .cs file extension.

  1. Choose Script Editor from the Tools menu.
  2. Click New.
  3. Enter your script in the Text box.
  4. Click Save As and save your script.

Back to Top

 


3. Executing Scripts

You can execute scripts from within the Script Editor dialog box or with the Execute Script File command on the Tools menu.

  1. Choose Script Editor from the Tools menu.
  2. Click Open, and choose the script you want to execute.
  3. Click Run.
- or -
  1. Click the Execute Script button on the ribbon bar, or choose Execute Script File from the Tools menu.
  2. From the dialog box, choose the script you want to execute and click OK.
You can also set session properties in the TinyTERM emulator's user interface to execute scripts post-application startup, post-session start, post-connect, post-login, pre-logout, pre-disconnect, pre-session close, and pre-application exit.

As well, you can launch script commands from the host TinyTERM is connected to by preceding the commands with \E&oF and following them with ^M, where \E is the escape character (ASCII 27) and ^M is the Enter character (ASCII 13). For example, if the hosts sends or displays the following:

\E&oFte.cls();te.displaynl(“OK”);^M
the TinyTERM screen will be cleared, and the letters “OK” will display in the upper left corner.

Back to Top

 


4. CScript Command and Operators

CScript supports the following list of JavaScript commands and keywords:
break
continue
else
for
function
if
return
var
while
CScript supports these additional commands that use syntax borrowed from the C language:
case
default
goto
switch
All the above commands are documented in the CScript Builtin Function Reference.

CScript supports the following operators in the following order from lowest to highest precedence:

=, +=, -=, *=, /=, %=, &=, |=, ^=, <<=, >>=, >>>= assignment
? : conditional
|| logical or
&& logical and
| boolean or
^ boolean xor
& boolean and
==, != logical compare
<, <=, >, >= logical compare
<< logical shift left
>> arithmetic (signed) shift right
>>> logical (zero-filled) shift right
+, - addition, subtraction
*, /, % multiplication, division, modulo
- unary minus
~ boolean not
! logical not
typeof return string expression type
void eval expression and return nil
new create new object
++ pre/post increment
-- pre/post decrement
[ ] property reference, vector index
. property reference

Back to Top