Free 14-Day Evaluations    
Product Downloads    

Sign in     


DESKTOP MOBILE DOWNLOAD PURCHASE SUPPORT INFO COMPANY
 Home  >>  Support  >>  Knowledge Base

Archive for the 'Scripting' Category

The SETKEY Command

Tuesday, April 10th, 2007

The SETKEY command redefines a key on the keyboard. The key then sends a different character of string of characters when pressed. SETKEY can also be used to cause a key to run a TinyTERM script or call one of TinyTERM’s internal functions.

The syntax for SETKEY is:

setkey keyname value

The keyname may be any of the following:

  • F1 – F12 (Function keys 1 – 12)
  • AF1 – AF12 (Alt-Function keys: hold the Alt key and hit F1 – F12)
  • SF1 – SF12 (Shift-Function keys)
  • CF1 – CF12 (Ctrl-Function keys)
  • CSF1 – CSF12 (Ctrl-Shift-Function keys)
  • “a” – “z” (Lower-case letters a-z, must be in quotation marks)
  • “A” – “Z” (Capital letters A-Z)
  • “^a” – “^z” (Ctrl- keys a-z)
  • AltA – AltZ (Alt keys a-z, Windows may override)
  • “0” – “9” (Top row number keys)
  • kp0 – kp9, kp+, … (keypad number and symbol keys, NumLock must be on)
  • c-kp0 – c-kp9, … (Ctrl-keypad number and symbol keys)
  • “#”, “$”, … (Any symbol)
  • up, home, end, … (Named keys)
  • c-up, c-right, … (Named Ctrl-keys)

Only the letter keys are case-sensitive. The other keys can be typed upper- or lower-case for the SETKEY command.

The value may be one of the following:

  • A single character or string of characters in quotation marks. This may include:
    • a special string character
    • \x42 – a hex value preceded by \x
    • \072 – an octal value preceded by \
    • ^M – a control character
    • or any other valid TERM string sequence
  • the name of a pre-defined TERM function key such as PRINT or BREAK
  • “@@command” – A valid TERM Script Language command

Examples

  • setkey f1 “MyLoginName”
    causes the F1 key to send MyLoginName down the comm line.
  • setkey “b” “MyPassword”
    causes the lower-case b key to send MyPassword down the comm line.
  • setkey kp* abort
    causes the keypad * key to send the standard abort, usually ^C.
  • setkey pgup “@@cls”
    causes the PageUp key to run TERM’s cls (clear screen) command.
  • setkey SF1 “@@do myfile”
    causes the Shift-F1 key to run the TERM script myfile.cmd.
  • setkey F11 “@@do wtermus@w_file_quit
    causes the F11 key to run the w_file_quit procedure within the TERM script wtermus.cmd.

Error 1204 Command File Aborted

Monday, April 9th, 2007

Multiple file transfers in a TERM for UNIX script can cause error 1204. It usually happens after using the OK button to acknowledge that a file has been sent. The OK button sends a ^C, causing a script abort.

The workaround is to turn off the transfer status window before the transfer. The command to do that is:

set xferstat off

It can be put in the script anywhere, as long as it executes before any file transfers.

Dialog Box Stops File Transfer Script

Monday, April 9th, 2007

Using a TinyTERM script to execute a file transfer, the transfer status dialog box may come up. Depending on how your script is written, this may pause or stop script execution entirely.

To prevent the dialog box from coming up, you can disable it with a script command. The TERM Script Language command is:

set xferstat off

For CScript, use the command:

FTSetXferStat(0);

Enter the appropriate command anywhere in the script before the file transfer starts.

Print Screen with a Key

Thursday, April 5th, 2007

You may want to print the TERM or TinyTERM screen without going to the menus. In that case, you can remap a key to perform this function.

In TERM for UNIX, the F6 key is mapped to print by default. To change this, use the SETKEY script command. For example, to map printing to Shift-F6 instead, the command is:

SETKEY SF6 PRINT

In TinyTERM for DOS the Alt-P key prints the screen by default. To change this, type Alt-S for the Setup menu, then select Keyboard. Change the Print Screen line to the desired key.

There is no default key mapped to print screen in TERM for DOS. To change that, type Alt-K to get the keyboard settings. Change the Print Screen line there to the desired key.

TERM and TinyTERM for Windows require more steps:

  1. Open the keyboard editor.
  2. Click the Chart Open button.
  3. Click the F button in the upper right.
  4. Click and drag the word PRINT from the chart to the key you want to use; i.e., F8.
  5. Click the Chart Close button.
  6. Click the Set button.
  7. Click OK.
  8. Click the “Save As” button to give the new keyboard scheme a name. You can use an existing scheme name to replace it if you desire. But if you replace the “Default” scheme, there’s no way to restore it to its previous settings.
  9. Click on Apply and OK.

Disabling the Context Menu

Thursday, March 29th, 2007

TinyTERM version 4 has a pop-up context menu which can be accessed by right-clicking the session button. If you need the Session Bar so you can switch between sessions, but do not want the context menu available, it can be disabled.

Go to TinyTERM’s Session menu and select the Script Editor. Enter the following commands:

iIdPopMenu = 101;
CSESS[dSESSBUTT].contextmenuid = iIdPopMenu;
entryTE_EMouseDown(oParent,oTE,nCode,nButton,nFlags,x,y){}

Save the script with whatever name you choose, such as nomenu.cs.

Next, go to the Edit menu and select Session Properties. Set the “Post session start” radio button, then click the Browse button. Select the script you just created and click Open. OK everything and save the settings.

The next time you start TinyTERM, the session buttons will still be available. But the context menu won’t.

Turning Off Beeps

Thursday, March 29th, 2007

Neither TinyTERM nor TERM includes a switch for silencing beeps sent by the host. However, you can do this through the included script languages. In TERM Script Language, the command is:

TRANS INPUT “\007” “”

As you can see, this takes the ASCII 7 character — ^G or the bell sound — and turns it into nothing. Unfortunately, there is no equivalent CScript command.

Method Called with Invalid Object Instance

Thursday, March 29th, 2007

This error may list any number of CScript methods. It generally means that a command tried to execute before the TE or FT control it references has actually loaded.

It’s most common when a script is run as an application startup script. To bypass the error, configure TinyTERM to run the script at post-session start instead.

File Names Limited to 14 Characters

Thursday, March 29th, 2007

Some versions of TERM for UNIX, particularly prior to version 6.2.5b, can only read and write file names up to 14 characters long. This affects scripts, file transfer, log files, etc. The solution is to upgrade your version of TERM.

At this writing, TERM for AIX still exhibits the problem. The most current versions of TERM for all other operating systems do not have this restriction.

CR 70

Keyboard Macro Recorder

Tuesday, March 27th, 2007

All versions of TERM have the capability to record a user’s keystrokes and the host system’s responses. It’s accessed through the TERM Script Language command LEARN:

LEARN START filename
LEARN STOP

Replace filename with the name of the TSL command file you want to create.

In TERM for Windows, a “Learn mode” or “Macro recorder” option is also available from the Tools menu. It will request a file name in a Windows dialog, and otherwise functions the same way as the LEARN command.

Most versions of TinyTERM do not have such capability, as it requires a script language. However, TinyTERM versions 4.30 and above do have a macro recorder on the Tools menu. It behaves as the LEARN command in earlier versions, but creates a CScript file instead of TSL.

Switching Sessions with a Keystroke

Monday, March 26th, 2007

TERM and TinyTERM for Windows allow multiple sessions to be opened in a single window. You can switch through these sessions in order with the NEXTSESS keyboard function.

To access that function, open the keyboard mapper. Click the “Chart Open” button to bring up the key chart. On the right of the chart, click the “F” button for a list of functions. Using your mouse, drag the NEXTSESS function from the chart and drop it on the key you’ve chosen.

Click “Chart Close” to close the chart, then click OK to close the keyboard mapper. Click Save As to give the new keyboard scheme a name. OK everything and save the settings. From that point on, when you have the correct keyboard scheme chosen, you can cycle through the open sessions in a TinyTERM or TERM window by pressing the chosen key.

  Copyright © 2024 Century Software, Inc. All Rights Reserved999 TERMS OF USE PRIVACY POLICY EULA