Free 14-Day Evaluations    
Product Downloads    

Sign in     


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

List Script Causes TinyTERM to Crash

The following CScript causes TinyTERM to crash about 20 seconds after it completes. The script simply draws a window, then allows the user to pick a phone number from a list provided by a plain text data file. It then displays the selected phone number in the TinyTERM window:

// initialize variables

var numsites = 5; // change this value for the actual number of sites in the file
var site = dimstr(numsites);
var phonenum = dimstr(numsites);
var listfile = "QLClist.txt"; // change for actual list file
var tempstr,counter;
var chosen = -1;
var tempInt;

// read phone numbers from list file

fopen(1,listfile,"RA");
counter = 0;
while (counter < numsites)
{
tempstr = freadln(1,-1);
site[counter] = field(tempstr,1,_asc("="));
phonenum[counter] = field(tempstr,2,_asc("="));
counter++;
}

fclose(1);

// create listbox window

tsl_dlgopen( 76, -1, -1, 240, 320, 0, 0, 200, "Dialing List", "");
tsl_atobjinit();
counter = 0;
while (counter < numsites)
{
tsl_atobjaddlist(site[counter]);
counter++;
}
tsl_atobjdone(111,9,5,5,250,200,(0)|16385,"","",0,0,-1,"chosen", "");
tsl_atobjinit();
tsl_atobjdone(101,13,260,5,0,0,(258)|16384,"&Dial","",4,412,-1,"", "");
tsl_atobjinit();
tsl_atobjdone(102,13,260,35,0,0,(258)|16384,"Cancel","", 8,27,-1,"", "");
tsl_at_read( 0, "", 13);
tsl_wclose( 76);

tempInt = _asc(chosen) - _asc("0");
te.display(site[tempInt] + "\r\n");
te.display(phonenum[tempInt] + "\r\n");

return(0);

The bug is in the tsl_atobjinit(); command. It’s fixed in TinyTERM 4.53.

CR 772

Comments are closed.

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