Free 14-Day Evaluations    
Product Downloads    

Sign in     


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

Archive for the 'CScript' Category

DDE and Script Commands in TinyTERM 4

Friday, March 16th, 2007

TinyTERM version 4 includes a DDE server and client, documented in the Programmer’s Reference Manual. The server is configured and enabled through CScript commands.

It’s possible using the DDE server to send script commands to TinyTERM from another application. However, it only accepts TERM Script Language commands in that manner, which are not documented in the Programmer’s Reference Manual. PDF documentation for TSL can be downloaded from this link.

That documentation also applies to TinyTERM Application Developer 3.3. That version of TinyTERM uses TSL exclusively, not CScript, so the notes above do not apply.

CR 499

Converting old TinyTERM Configuration Files

Wednesday, March 14th, 2007

TinyTERM versions prior to 3.0 and TERM versions prior to 7.0 store connection information in files with the .con extension. TinyTERM 3 and TERM 7 use the .tap extension, and TinyTERM version 4 uses the .tpx extension. Century Software, Inc., provided utilities to convert between the various formats, so you don’t have to set the connections up all over again.

For updating .con files to .tap files, TinyTERM 3 and TERM 7 include a convtap.exe program. To use it, run it at a command prompt, using the name of the .con file as an argument. For example, to convert the file sample.con to sample.tap, the command would be:

convtap.exe sample.con

To convert a .tap file to a .tpx file, use the script TAPtoTPX.cs included in TinyTERM 4. (You can also download a copy.) See the file C:\Program Files\Century\TinyTERM\TAPtoTPX.wri for documentation of this script.

Both TinyTERM versions 3.x and 4.x store keyboard mappings in the file keyboard.dat. The format of the two files is nearly identical, in fact. The only difference is in the section heading. For example, a keyboard scheme named “My Keyboard” would be set apart in version 3 like so:

[My Keyboard.kbd]

In version 4, it would be set apart like so:

[My Keyboard.keyboard]

So to copy a keyboard scheme from version 3 to version 4, you can simply copy the entire section of keyboard.dat, changing .kbd to .keyboard in the process.

Wrong Number of Arguments Passed to FTRecv

Tuesday, March 13th, 2007

This error is caused by a bug in TinyTERM 4.11. The only solution is to use a different version of TinyTERM.

Copy the TinyTERM Screen in One Keystroke

Tuesday, March 13th, 2007

Using the included CScript language and the keyboard mapper, you can configure a key in TinyTERM 4.02 or higher to copy the entire screen to the clipboard. Earlier versions of TERM or TinyTERM for Windows do not have this capability. And there’s no default clipboard in DOS or UNIX.

Open the Session Properties and go to the Keyboard tab. Click Edit to bring up the keyboard map.

In the map, click the key you want to use. You can click Ctrl, Alt or Shift first, or even Ctrl+ Shift, if you prefer.

Change the Action field to COMMAND. In the Value field enter this string:

te.CopySelection(-1,-1,-1,-1);

Click Set, then close the keyboard map. Click the Save As button to give the new keyboard scheme a name, then OK and save everything. The next time you hit that key, the entire screen will be copied to the Windows clipboard.

Switching Number of Columns on a Keystroke

Thursday, March 8th, 2007

You may need to change the number of columns displayed in TinyTERM manually during an active session. Rather than changing the Session Properties every time, TinyTERM version 4 can do this with a single keystroke.

Open the Session Properties and go to the Keyboard tab. Click the Edit button to bring up the keyboard map. In the map, click on the key you want to use. Change the Action field to COMMAND. In the Value field, type this as one long string:

if(teobj.NumColumns==80) {teobj.NumColumns=132; eobj.redraw();} else {teobj.NumColumns=80; teobj.redraw();}

Click the Set button, then close the keyboard map. On the Keyboard tab, click the Save As button to give the new keyboard scheme a name. OK everything and save the session. Hitting the selected key will switch the number of columns displayed between 80 and 132 columns on the fly.

Users Close TinyTERM Before Logging Out

Wednesday, March 7th, 2007

Sometimes users will close TinyTERM when they’re done, instead of properly logging out of the host first. This can use up concurrent server licenses, or even corrupt the host database. For TinyTERM version 4.10 or higher, you can prevent this.

In the TinyTERM directory, you’ll find a sample script named outfirst.cs. It will work for network or modem connections, but not direct serial connections. RS232 connections actually connect only to the serial port in the PC, which then gets information from the line connecting it to the host. Logging out of the host does not end a serial connection the way it does over a network or modem.

To use outfirst.cs, open TinyTERM on the user’s PC. Go to the Edit menu and select Preferences. Next to the Application startup script line you’ll see a Browse button. Click on that and use the resulting Windows Find dialog to locate the outfirst.cs script. Select that script and click the Open button to make it the application startup script.

This will take you back to the Preferences dialog. Click the Apply and OK buttons. Go to TinyTERM’s File menu and select Save Session. The next time TinyTERM is started, a warning message will pop up whenever a user tries to close TinyTERM before logging out. TinyTERM will stay open and connected when the error is closed.

For screen-by-screen help with this configuration, please view our screencast on this topic.

There is one way around the outfirst.cs. If you shut down Windows, it bypasses the shutdown blocks running in TinyTERM.

CR 554

Sending a BREAK Signal by a Keystroke

Wednesday, February 28th, 2007

Using the keyboard mapping function, you can configure a key to send a BREAK signal. By default, this is mapped to ^B in TERM for DOS or UNIX. You can change that with the SETKEY script command. For example, to set F10 as the BREAK key, the command is:

setkey f10 break

In TinyTERM for Windows, open the keyboard mapper and click the Chart button to open the TCS Chart. Click the F button there to bring up the function list. With the mouse pointer drag the word BREAK from the chart and drop it on the key you want to use.

Some releases of TinyTERM 4.x ignore the BREAK command from the chart. When this happens, click on the key in the keyboard mapper you want to use. Change the Action drop-down to COMMAND. In the Value field, type:

te.break();

Click the Set button to finalize the mapping.

CR 415

Let the UNIX Application Change the Title Bar

Monday, February 26th, 2007

You may want your UNIX application to change the TinyTERM window title. For example, you may want the title bar to show the application module when a user changes screens.

You can do this in TinyTERM 4.02 or higher by sending a CScript command from the UNIX application. The sequence:

<ESC>&oFSetPropNow(158,”Module”);AppRedraw();^M

will do what you need. Taken piece by piece, the string

<ESC>&oF

tells TinyTERM that what follows are CScript commands. <ESC> should be replaced with the Escape character, ASCII value 27.

^M

signals the end of the CScript commands. Similar to <ESC>, ^M should be replaced with the Ctrl-M character, ASCII value 13.

SetPropNow(158,”Module”);

sets the Windows title bar remark. “Module” can be replaced with any quoted string.

AppRedraw();

redraws the TinyTERM window. This forces the title bar to refresh.

Other CScript commands can be run from the host system in the same manner. For a full list of CScript commands, refer to the documentation included with TinyTERM.

CR 17

Saving the Lines and Columns for Printing

Friday, February 23rd, 2007

When printing from TinyTERM 4.02 or higher to a Windows printer, you may need to save the settings for lines and columns so it will print correctly. On some versions, every time you exit TinyTERM it loses those settings.

To save those settings, place the attached script into your .tpx file with these steps:

  1. Copy this script to the C:\Program Files\Century\TinyTERM directory.
  2. Open the Session Properties and go to the Session tab.
  3. Click the “Post Session Start” radio button.
  4. Click the Browse button
  5. Locate and select the st.cs script
  6. Click OK and close the Session Properties.
  7. From TinyTERM’s File menu select Printer Setup.
  8. Configure printing to the desired Windows printer.
  9. Click the Setup button to get the Page Setup dialog.
  10. Set the lines and columns.
  11. OK all settings, then save the .tpx file and exit TinyTERM.
  12. Restart TinyTERM.

It should have the lines and columns settings saved. You may need to set them one more time, now that the script is running.

Lines and Columns options were permanently added to the Page Setup dialog in TinyTERM 4.30. From that version on, the st.cs script is never necessary.

CR 400

Restrict TinyTERM to a Single Open Session

Friday, February 23rd, 2007

TinyTERM can open up to nine sessions in a single window. However, through the included CScript language you can limit TinyTERM 4.05 or higher to one session. The script available for download here does just that. Every time a new session is opened, it checks to see if it’s the first one. If not, it immediately closes the session.

To use the script, go to TinyTERM’s Tools menu and select Script Editor. Enter the above script commands. (The comment lines set off with // are not necessary.) Click the Save button and give the script a name, such as “onesess.cs”, then close the Script Editor.

Next, go to TinyTERM’s Edit menu and select Preferences. Next to the “Application startup script” line, click the Browse button. Select the onesess.cs script and click OK. Save all settings. The next time you start TinyTERM, the script will run automatically.

This script will not work if TinyTERM is opened inside a Web browser. The browser takes over some of the functions outfirst.cs needs to catch a disconnect or session close.

There is no equivalent script that will prevent TinyTERM from being opened multiple times.

CR 566, multiple TinyTERM instances

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