Please enable JavaScript to view this site.

A-Shell Development History

Navigation: Version 4.6, builds 699-791

762 — 28 January 2001

Scroll Prev Top Next More

1. Add XCALL B64ENC,IFILE,OCH,STATUS to convert specifed filespec IFILE to base64 encoded format, writing the results to the open file channel OCH, and returning # of bytes written in STATUS ( switch. This change also modifies slightly the jobname selection scheme. Previously it would base the generated job name on the job number, thus if two jobs were in use, the next PolyShell job name would be PSHAC. Under the new scheme, the first available name (starting with PSHAA) is used, without regard to the job number.

 

5. APPEND.LIT 2.1(105) supports longer source filespecs (increased from 30 to 80 bytes) so that it can better handle arbitrary native OS filespecs. It also now supports quoted filespecs. Thus you could now do something like:

 

 APPEND A.HTM=A.HTM,"/usr/internet/ns_httpd/httpd-80/htdocs/b.html"

 

6. VUE.LIT 2.0(109) now understands quoted native filespecs. Previously it didn't complain about them but may still have thought it found switches (e.g. /T, /R, /W, etc.) within the filespecs.

 

7. VUE 3.2(241) (the internal VUE function accessed by VUE.LIT) is now smarter about recognizing switches, making it possible to vue native filespecs that contain embedded dashes.

 

8. (UNIX) The internal sleep function (used by SLEEP.SBR) has been rewritten to work more reliably and efficiently with intervals less than 1 second. Previously, it was sometimes either being short-circuited by other signal events, and/or it was consuming too much CPU time. Note that one side effect of this change is that the screen buffer will be automatically flushed by a sleep operation no more than once per second, possibly leading to slightly jerky lifesign updates. Previously every sleep, no matter how short, was flushing the screen buffer, which was a large waste of resources when the sleep interval was very small. Note that you can always force your own screen update with PRINT TAB(-1,254).

 

9. GET.SBR has been enhanced to support a timeout option.

 

Usage:

 

XCALL GET,CHBUF {,CHAN,BYTES'REQUESTED,BYTES'RECEIVED,TIMEOUT }

 

Where:

 

CHBUF is a string variable to receive the byte(s). Note that no  trailing null is added to the string, so you may want to  clear it before the XCALL.

 

CHAN (optional, numeric) specifies a file channel that is open for  sequential input. If zero or not specified, input will be  from the keyboard device (stdin under Unix).

 

BYTES'REQUESTED (optional, numeric) specifies the number of bytes  to input. If not specified, default is 1. You can specify  0 if using the TIMEOUT feature, if you just want to know if  a character is available without inputting it.

 

BYTES'RECEIVED (optional, numeric) will receive the number of  bytes that were actually input (and returned in CHRBUF.)  Normally this will be equal to BYTES'REQUESTED, except  in one of the following cases:

 

A) If BYTES'REQUESTED was 0, then BYTES'RECEIVED will be  1 if there is one or more characters available to input,  else 0 (to indicate no characters available.)

 

B) If we hit the end of the input file, or the TIMEOUT  period expires before reading the number of  requested bytes, then BYTES'RECEIVED will be less  than BYTES'REQUESTED.

 

C) If an I/O error occurs, or if a TIMEOUT period is specified  and no characters are input because the file was already at  the end-of-file mark, BYTES'RECEIVED will be set to -1.  (This distinguishes the case of end-of-file from timeout.)

 

TIMEOUT (optional, numeric) can be set to the number of milliseconds  to wait for input before aborting. If set to 0 or not  specified, then there will be no timeout. Note that the  actual elapsed time before timeout may be substantially more  than the specified timeout period. This is both because  of CPU time dedicated to other processes, and because the  the gross timeout period is actually divided into slices  equal to the number of characters to be input, which each  slice being used up only if no characters are available.  For example, if you have a 5000 ms (5 second) TIMEOUT and  are requesting 5 characters, you will actually get 5 1-second  time out periods, and each period is only used up if no  characters arrive during that period. If exactly 1 character  arrived every 0.75 seconds, you would still have all 5  1-second time out periods left after 4 characters had been  received. This scheme may seem a bit strange, but turns  out to be a reasonable compromise between the two extreme  approaches of treating the timeout period as an absolute  maximum or of resetting it entirely after each character.

 

NOTES ON INPUTTING FROM A SERIAL DEVICE:

 

To input from a serial device under Unix or Linux, open it as an input file, e.g.:

 

 OPEN #9, "/dev/cua0", input

 

Then pass the file channel to XCALL GET just like a "normal" file.

 

Beware, however, that under Unix and its variants, such serial ports will by default be in line input mode. Thus, you may be asking for only 2 characters, but you wouldn't actually "see" them until a line end character (LF) was sent. To avoid this annoyance and get the characters immediately as they are transmitted, use XCALL HOSTEX and the stty command to turn off "icanon" mode, for example:

 

 xcall HOSTEX,"stty -icanon < /dev/cua0"

 

(Do this AFTER opening the device as a file.)

 

You may also want to turn off or change several other stty settings at the same time, such as disabling XON/XOFF handling or setting the baud rate. Consult the man page for stty for more details on the settings available. You may have to use chmod 666 on the /dev/xxxxxxx device file (/dev/cua0 in the example above) to allow a non-root user to open the device as a file.

 

OTHER NOTES: If inputting from the console (CHAN = 0 or not passed) then NOECHO mode will be set automatically (and will be left that way on exit.)

 

Function key translations are not processed. If you want function translations, use one of the other character input routines, such as GETX.SBR or ACCEPT.SBR, which offer this option. 10. Add XCALL DELCHR,CHRLST,STRING Removes all characters that appear in the string CHRLST from STRING.

 

11. KILL.LIT 2.2(117) now supports the option to kill by PID as well as jobname. It also fixes a bug in the handling of the /Y switch.

 

12. INFLD.SBR TYPE i now overrides "prehistoric mode", stifling the output output of 3 trailing blanks. This fixes a problem with XCALL MESAG causing a scroll (now that INFLD is used to handle that prompt so that print screen can be used there.)