*info:
INFO:

The pseudo-device INFO: allows an input stream  to  be created from a string
with values of various parameters substituted  for escape sequences  in  the
string.  Opening "INFO:string" yields an input stream which will deliver the
characters of  "string"  followed  by  ENDSTREAMCH.  Escape sequences in the
string  are  all  character  pairs  introduced  by  '%'.  The  substitutions
available are as for the JOBMSG command:

     Escape Sequence    Expands Into                   Example Expansion
     ---------------    ------------                   -----------------
           %%           <percent>                      %
           %C           <reverse connection name>      RevCon-TITAN.VDU/7
           %D           <the date>                     25-Nov-81
           %I           <current task number>          8
           %K           <the machine kind>             LSI4
           %L           <name of loading machine>      TITAN.VDU/7
           %M           <the machine name>             ALPHA
           %P           <the user's PUID>              FF02B7A4415C1C3F
           %T           <the time>                     15:41:33
           %S           <the system type>              FM-Tripos
           %U           <the user's initials>          CGG
           %V           <terminal (Vdu) type>          Cifer2632
           %W           <the week day>                 Wednesday

The special escape sequence "%="  has no expansion.   Any occurrences of %T,
%W, %D or %U  occurring after "%="  are forced to be re-evaluated,  however.
Escape sequences other than those given above will have an undefined effect.

Examples:

TYPE INFO:%T
TYPE "INFO:This is %M in use by %U"
APPEND "INFO:program used bu %U at %T*N" TO logfile CHARS

A particular use is for including strings  in  BCPL  programs at the time of
compilation. For example:

LET start() BE
    $(
    LET compdat = GET "info:*"This version compiled at %t on %d by %u**N*""
      :::::
    writes(compdat)
      :::::
    $)

Note that in this example there are two levels of string interpretation: one
when the stream name for GET is processed, and a second when the output from
the  GET  stream  is  compiled.  BCPL  string  escapes  are  used  to  delay
interpretation. Note in particular the difference between '**N' and '*N'.

Another application of INFO:, for users with the recommended load-file directory
names 68000-OBJ, LSI4-OBJ etc., is the following useful syntactic device which
can be used in command sequences, in preference to the use of IF MCTYPE ...

        C "INFO:%K-OBJ.command args"

If the command is the last in the sequence T "INFO: ... " can be used.


