[Simh] Gah! ascii don't work??!

From: Paul Koning <pkoning_at_equallogic.com>
Date: Sun Oct 17 16:34:06 2004

>>>>> "Ron" == Ron Hudson <ron.hudson_at_sbcglobal.net> writes:

 Ron> On Oct 17, 2004, at 12:32 PM, Kevin Handy wrote:

>> Ron Hudson wrote:
>>
>>> simh running rsts
>>>
>>> print chr$(27);"[2J"
>>>
>> Try
>>
>> print chr$(27+128);"[2J"
>>
>> RSTS plays odd games with the escape character (prints it as a
>> dollar sign most of the time), and setting the parity bit helps.
>> There are various "open" modes, and terminal settings that will
>> bypass this, but this is easier.
>>
>>> prints
>>>

 Ron> Ready

 Ron> 10 print chr$(27+128);"[2J" run NEW 12:25 PM 17-Oct-84 ?[2J

 Ron> Ready

 Ron> -------------- nope, that don't do it either. It's the same
 Ron> output on the terminal too. What about +256? are they 8 bit
 Ron> chars? hmm no that would just be 27 again... chr$ does a MODULO
 Ron> right?

Yes.

Adding 128 should have worked. Normal coding convention is to specify
integers (i.e., 27%+128%) but the fact you used float shouldn't matter
here.

chr$(27%+128%) will, I believe, actually output a 155 code, not a 27.
On a 7-bit device that's ok, but on a terminal that support 8 bits,
it's not.

Try this (working from memory):
    print record 1%, chr$(27%)+"[2J";

Note two points: (a) "record 1%" means binary ("raw") output, and (b)
string concatenation, rather than multiple arguments separated by ";"
so the whole chunk goes out under the influence of that "raw output"
modifier.

          paul
Received on Sun Oct 17 2004 - 16:34:06 BST

This archive was generated by hypermail 2.3.0 : Fri Oct 10 2014 - 23:37:22 BST