[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference iosg::all-in-1_v30

Title:*OLD* ALL-IN-1 (tm) Support Conference
Notice:Closed - See Note 4331.l to move to IOSG::ALL-IN-1
Moderator:IOSG::PYE
Created:Thu Jan 30 1992
Last Modified:Tue Jan 23 1996
Last Successful Update:Fri Jun 06 1997
Number of topics:4343
Total number of notes:18308

1238.0. "MERGE_LINE and special characters" by UTRTSC::BOSMAN (They sold you the view from a hill) Thu Aug 13 1992 13:54

    Hi,

    Customer is using WPS-PLUS boilerplates. He wants to include TCS and
    TDE characters with the MERGE_LINE function:
    
    <&OA MERGE_LINE -�->  �The vertical bar, retrieved via cut&paste in the TDE.
    <&OA MERGE_LINE -�->  �The vertical bar, retrieved via F11 * (F11=Tech.Set).

    The output is:
    --                     No bar at all.
    -&-                    Instead of the bar the & sign.

    So, obviously MERGE_LINE doesn't handle 'special' characters to well. Is
    this expected behaviour, a known bug or something else. And is there a
    way to use MERGE_LINE in a way so that one is able to include special
    characters (other than the MERGE_LINE <&INCLUDE t.t> stuff) ??
    
    Thanks for your help,
    Sjaak.
T.RTitleUserPersonal
Name
DateLines
1238.1How to get vertical lines.SCOTTC::MARSHALLPearl-white, but slightly shop-soiledThu Aug 13 1992 18:0817
I don't know of an easy way to do this.  The problem is that the vertical bar
character isn't a single character value.  You'd need to store a terminal
escape sequence that selects the graphic character set, draws the bar, then
resets the ordinary ASCII set.

A suitable escape sequence is: ESC ) 0 SO x SI

Where ESC is ASCII code 27, SO is ASCII code 14 and SI is ASCII code 15.
'x' is the character code that maps to a vertical bar in the graphics character
set.  Note the third character is zero, not the letter O.

Note this only works on VT terminals, and won't work on printers.  If you    |
need it to work on printers, or non-VT terminals, you're stuck with the      |
ASCII | character, which gives acceptable, if not perfect, vertical lines,   |
as shown to the right of this paragraph!                                     |

Scott
1238.3Wait a minute ... UTRTSC::BOSMANThey sold you the view from a hillFri Aug 14 1992 10:5916
    � The problem is that the vertical bar character isn't a single
    � character value.
    
    Wait a minute ... there's still one question coming to my mind:
    
    Why does MERGE_LINE ignore 'multiple' characters? I mean: they're *in*
    the WPS file holding the boilerplate. Aren't they *just* characters,
    interpreted by the VT. MERGE_LINE should read <ESC> and write it out to
    the outputfile. So, the MERGE_LINE function does something to these
    characters (ignore them?). I'm afraid I don't fully understand this one.
    
    Is there something else to explain about this one? Maybe from a
    MERGE_LINE developer?
    
    Thanks,
    Sjaak.
1238.4More infoSCOTTC::MARSHALLPearl-white, but slightly shop-soiledFri Aug 14 1992 12:3266
Hi,

>> Why does MERGE_LINE ignore 'multiple' characters? I mean: they're *in*
>> the WPS file holding the boilerplate. Aren't they *just* characters

Yes, they're just characters.  However, I wouldn't assume that .WPL files
store them in the same way as the VT escape sequence.  Also, I'm not sure that
doing a cut-n-paste between a TDE and an ordinary editor window would "pick up"
all the necessary information.  My point is, I'm not convinced the correct
sequence was ever given to MERGE_LINE.

The following (primitive) code will get the vertical bar sequence into an
ALL-IN-1 symbol, just so you can experiment:

$ esc[0,7] == 27
$ so[0,7] == 14
$ si[0,7] == 15
$ get mysym = esc + ")0" + so + "x" + si + "x"
$ allin1

(then on an ALL-IN-1 menu)

<get #x = cli$mysym
<get oa$display = #x

which will display the vertical bar, followed by 'x'.  Note you have to have an
"ordinary" character after the SI, or ALL-IN-1 symbol processing cuts it off
the end of the string (sigh...).

>> MERGE_LINE should read <ESC> and write it out to the outputfile.

In a perfect world, yes, but:

>> So, the MERGE_LINE function does something to these characters (ignore them?)

Almost; the following:

<OA$MRG_TTOUT
<GET OA$FUNCTION = "MERGE_LINE " #x

displays ")0|x".  Note the "|" is the correct vetical bar, I'm just simulating
it here for simplicity.  So MERGE_LINE processes the SO and SI, but ignores the
ESC.  The only reason the bar prints is that the character set designation
performed by "ESC )0" is still valid from before (read a VT manual for more
info on this).

However, if you now do:

<get #y = "x" #x

So that there is an "ordinary" character before the ESC, then do

<GET OA$FUNCTION = "MERGE_LINE " #y

the display will show "x|x", which is correct, and what you want (as long as
you have ordinary charactes either side of it).  So all you need to do is find
a suitable way to get the correct sequence to the MERGE_LINE command (if my
primitive test example isn't good enough!).  Before anyone syggests it, FN$CHAR
doesn't work.  I tried it.

Note you can optimise this a bit: you only need "ESC )0" once, at the beginning.
After that you just need the "SO x SI" to print a bar.

Your only problem now is, this still won't work with printers...

Scott