80 lines
2.2 KiB
Plaintext
80 lines
2.2 KiB
Plaintext
|
********************************************************************************
|
||
|
*
|
||
|
* Support of PR1ME INFORMATION verb - DELAY
|
||
|
*
|
||
|
* Module %M% Version %I% Date %H%
|
||
|
*
|
||
|
* (c) Copyright 1998 Ardent Software Inc. - All Rights Reserved
|
||
|
* This is unpublished proprietary source code of Ardent Software Inc.
|
||
|
* The copyright notice above does not evidence any actual or intended
|
||
|
* publication of such source code.
|
||
|
*
|
||
|
*******************************************************************************
|
||
|
*
|
||
|
* Maintenence log - insert most recent change descriptions at top
|
||
|
*
|
||
|
* Date.... GTAR# WHO Description.........................................
|
||
|
* 10/14/98 23801 SAP Change copyrights.
|
||
|
* 07/25/88 - - Maintenence log purged at 5.2.1, see release 5.1.10.
|
||
|
*
|
||
|
*******************************************************************************
|
||
|
|
||
|
$OPTIONS DEFAULT
|
||
|
|
||
|
* Get paramaters from input line
|
||
|
delay1 = field(@sentence," ",2)
|
||
|
delay2 = field(@sentence," ",3)
|
||
|
delay3 = field(@sentence," ",4)
|
||
|
|
||
|
if (delay1 # "" and not(num(delay1))) or (delay2 # "" and not(num(delay2))) or (delay3 # "" and not(num(delay3))) then
|
||
|
@SYSTEM.RETURN.CODE = -1
|
||
|
stop "Invalid token on command line."
|
||
|
end
|
||
|
|
||
|
delay1 = iconv(delay1, "mo")
|
||
|
delay2 = iconv(delay2, "mo")
|
||
|
delay3 = iconv(delay3, "mo")
|
||
|
|
||
|
* Supply defaults
|
||
|
if delay1 = "" or delay1 = 0 then delay1 = 6
|
||
|
if delay2 = "" or delay2 = 0 then delay2 = 12
|
||
|
if delay3 = "" or delay3 = 0 then delay3 = 72
|
||
|
|
||
|
* Compute average delay based on line length
|
||
|
begin case
|
||
|
case delay3 > 72
|
||
|
delay = (delay1+delay2+delay2)/3
|
||
|
case delay3 = 72
|
||
|
delay = (delay1+delay2)/2
|
||
|
case delay3 < 72
|
||
|
delay = (delay1+delay1+delay2)/3
|
||
|
end case
|
||
|
|
||
|
* Adjust for 300 baud (30 cps)
|
||
|
delay = delay/30
|
||
|
|
||
|
* Compute LFdelay factor
|
||
|
begin case
|
||
|
case delay >= .46
|
||
|
lfdelay = 8
|
||
|
case delay >= .38
|
||
|
lfdelay = 7
|
||
|
case delay >= .30
|
||
|
lfdelay = 6
|
||
|
case delay >= .26
|
||
|
lfdelay = 5
|
||
|
case delay >= .18
|
||
|
lfdelay = 4
|
||
|
case delay >= .16
|
||
|
lfdelay = 3
|
||
|
case delay >= .10
|
||
|
lfdelay = 2
|
||
|
case delay >= .08
|
||
|
lfdelay = 1
|
||
|
case 1
|
||
|
lfdelay = 0
|
||
|
end case
|
||
|
|
||
|
* Execute the command to change delay
|
||
|
execute "PTERM LFDELAY ":lfdelay returning @SYSTEM.RETURN.CODE
|