escape sequences, cursor positioning

  • Follow


hi everybody,
it might be interesting for you to read my previous topic:
http://groups.google.com/group/comp.os.vms/browse_thread/thread/37b3e5cca7467772#

in the meantime i managed to get a copy of vt100 user guide and i've
read the programmers part very carefully, because i want to code
something in DCL using ASCII escape sequences.
i've found out that some escape seqences work very well and other
don't work and now i'm trying to find some help here.

$ ty specfont.com
$!------------------------------------------------------------------------------
$!                                                   PLAYING WITH ESC
SEQUENCES
$!------------------------------------------------------------------------------
$!
$ esc[0,7] = 27
$ say = "write sys$output"
$ say esc+ "(0"
$ say " ssssssssss"
$ say esc+ "(A"
$ say esc+ "[3A"
$ read sys$command input1/prompt=" "

this works fine ^^

but when i modify the "$ say " ssssssssss" line and add a additional
escape seqence, it won't work.

$ ty specfontv2.com
$!------------------------------------------------------------------------------
$!                                                   PLAYING WITH ESC
SEQUENCES
$!------------------------------------------------------------------------------
$!
$ esc[0,7] = 27
$ say = "write sys$output"
$ say esc+ "(0"
$!
$! modified line below, added some spaces in front of the first s
$ say "   ssssssssss"
$!
$ say esc+ "(A"
$ say esc+ "[3A"
$!
$! additional escape sequence below, want the cursor so move right
(this won't work)
$ say esc+ "[2C"
$!
$ read sys$command input1/prompt=" "

okay, that's my first problem.

besides i don't want the underscores/special characters to get
overwritten when i start typing.
is there any easy solution for this?

kind regards
0
Reply acid.friend (10) 1/11/2009 8:49:54 AM

In article
<83408f4a-040e-4f8d-a146-4ff534e6ad2e@b38g2000prf.googlegroups.com>,
acid.friend@yahoo.de writes: 

> hi everybody,
> it might be interesting for you to read my previous topic:
> http://groups.google.com/group/comp.os.vms/browse_thread/thread/37b3e5cca7467772#
> 
> in the meantime i managed to get a copy of vt100 user guide and i've
> read the programmers part very carefully, because i want to code
> something in DCL using ASCII escape sequences.
> i've found out that some escape seqences work very well and other
> don't work and now i'm trying to find some help here.

On a real VT100 they should all work.  If they don't work for you, then 
your emulation is not perfect.

0
Reply helbig (4870) 1/11/2009 11:21:54 AM


On Jan 11, 3:49=A0am, acid.fri...@yahoo.de wrote:
> hi everybody,
> it might be interesting for you to read my previous topic:http://groups.g=
oogle.com/group/comp.os.vms/browse_thread/thread/37b3e...
:
> i've found out that some escape seqences work very well and other
> don't work and now i'm trying to find some help here.

I hope that your working attitude is that beginners do not find
massive problems such as non-working escape secquences, all they find
is areas they do not understand well enough.

Possible cause of trouble here: DCL terminates each write with a
<CR><LF>
Possible solution here: put the positioning escape sequence in the
PROMPT.
Hint, instead of the classic "''symbol'" try &symbol.

For example:

$ x =3D esc + "[2C" + esc + "[4m"
$!
$ read sys$command input1/prompt=3D&x
$ say esc+ "[m"

When in doubt, switch the terminal to "DISPLAY CONTROL" (or somehting
along those lines) in its setup screen(s).

Enjoy,
Hein


0
Reply heinvandenheuvel2 (577) 1/11/2009 1:11:17 PM

On Jan 11, 12:49=A0am, acid.fri...@yahoo.de wrote:
> hi everybody,
> it might be interesting for you to read my previous topic:http://groups.g=
oogle.com/group/comp.os.vms/browse_thread/thread/37b3e...
>
> in the meantime i managed to get a copy of vt100 user guide and i've
> read the programmers part very carefully, because i want to code
> something in DCL using ASCII escape sequences.
> i've found out that some escape seqences work very well and other
> don't work and now i'm trying to find some help here.
>
> $ ty specfont.com
> $!-----------------------------------------------------------------------=
-------
> $! =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 PLAYING WITH ESC
> SEQUENCES
> $!-----------------------------------------------------------------------=
-------
> $!
> $ esc[0,7] =3D 27
> $ say =3D "write sys$output"
> $ say esc+ "(0"
> $ say " ssssssssss"
> $ say esc+ "(A"
> $ say esc+ "[3A"
> $ read sys$command input1/prompt=3D" "
>
> this works fine ^^
>
> but when i modify the "$ say " ssssssssss" line and add a additional
> escape seqence, it won't work.
>
> $ ty specfontv2.com
> $!-----------------------------------------------------------------------=
-------
> $! =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 PLAYING WITH ESC
> SEQUENCES
> $!-----------------------------------------------------------------------=
-------
> $!
> $ esc[0,7] =3D 27
> $ say =3D "write sys$output"
> $ say esc+ "(0"
> $!
> $! modified line below, added some spaces in front of the first s
> $ say " =A0 ssssssssss"
> $!
> $ say esc+ "(A"
> $ say esc+ "[3A"
> $!
> $! additional escape sequence below, want the cursor so move right
> (this won't work)
> $ say esc+ "[2C"
> $!
> $ read sys$command input1/prompt=3D" "
>
> okay, that's my first problem.
>
> besides i don't want the underscores/special characters to get
> overwritten when i start typing.
> is there any easy solution for this?
>
> kind regards

Yes, this was done many moons ago when there wasn't any method
available to do it. I still use it today from time to time. There are
some start up command lines in "VAX/VMS Writing real Programs in DCL."
on page 76-81. Set your terminal to be 80 by 24 or 132 by 40. You must
turn off or set the last two lines on the screen to the scrolling
region. Next setup some subroutines for your repetative calls like
clear line or clear screen or move up or move down, or move left or
move right, and etc. You need to set your origin to be 0,0 on the
screen and move there. Now you should be set up to do what you would
like to do.

Use a variable to hold your question, for instance: line_out =3D "Please
enter your name: "
Next you get the length of the line by f$length(line_out). Please
notice I left a space at the end of the question in the line_out
variable.
Therefore, I would do the following and remembering that I am at the
origin of 0,0:

line_out =3D "Please enter your name: "
lo_len =3D f$length (line-out)
Write sys$output line_out
call move (0,lo_len)
Read sys$command input1

Or

line_out =3D "Please enter your name: "
Read sys$command /prompt=3Dline_out input1

$ Move:
$ Subroutine
$     x =3D 'p1'
$     y =3D 'p2'
$     esc[0,8] =3D %x1B
$     csi =3D esc + "["
$     xy =3D  csi + x + ";" + y + "H"
$     Write sys$output xy
$     exit
$ endsubroutine

With the call move routine you can move anywhere on the screen.
Line 23 and 24 were used for the error statements being displayed.
After the "Enter" key or "Return" key was depressed you would call the
move return to go back to the line where the line occurred and have it
clear the entry and wait for the correct response to occur.

I hope this helps!

Regards,
Daryl Jones


0
Reply daryljones (22) 1/11/2009 1:33:14 PM

acid.friend@yahoo.de wrote:
> hi everybody,
> it might be interesting for you to read my previous topic:
> http://groups.google.com/group/comp.os.vms/browse_thread/thread/37b3e5cca7467772#
> 
> in the meantime i managed to get a copy of vt100 user guide and i've
> read the programmers part very carefully, because i want to code
> something in DCL using ASCII escape sequences.
> i've found out that some escape seqences work very well and other
> don't work and now i'm trying to find some help here.
> 
> $ ty specfont.com
> $!------------------------------------------------------------------------------
> $!                                                   PLAYING WITH ESC
> SEQUENCES
> $!------------------------------------------------------------------------------
> $!
> $ esc[0,7] = 27
> $ say = "write sys$output"
> $ say esc+ "(0"
> $ say " ssssssssss"
> $ say esc+ "(A"
> $ say esc+ "[3A"
> $ read sys$command input1/prompt=" "
> 
> this works fine ^^
> 
> but when i modify the "$ say " ssssssssss" line and add a additional
> escape seqence, it won't work.
> 
> $ ty specfontv2.com
> $!------------------------------------------------------------------------------
> $!                                                   PLAYING WITH ESC
> SEQUENCES
> $!------------------------------------------------------------------------------
> $!
> $ esc[0,7] = 27
> $ say = "write sys$output"
> $ say esc+ "(0"
> $!
> $! modified line below, added some spaces in front of the first s
> $ say "   ssssssssss"
> $!
> $ say esc+ "(A"
> $ say esc+ "[3A"
> $!
> $! additional escape sequence below, want the cursor so move right
> (this won't work)
> $ say esc+ "[2C"
> $!
> $ read sys$command input1/prompt=" "
> 
> okay, that's my first problem.
> 
> besides i don't want the underscores/special characters to get
> overwritten when i start typing.
> is there any easy solution for this?
> 

If you have underscores, or ANY other printing character in any given 
character cell, you cannot have another occupying the same cell!!!!

Some video terminals; e.g. VT100 series, VT200 series, etc, will display 
underscored characters but these are NOT a character PLUS an
underscore.  Just think of an underscored character as a whole NEW 
character or a new font.

I don't believe it's possible and even if it can be done, I doubt if the 
result could possibly be worth the effort required.

0
Reply rgilbert88 (4359) 1/11/2009 2:21:36 PM

On Jan 11, 8:11 am, Hein RMS van den Heuvel
<heinvandenheu...@gmail.com> wrote:
> On Jan 11, 3:49 am, acid.fri...@yahoo.de wrote:
>
> > hi everybody,
> > it might be interesting for you to read my previous topic:http://groups.google.com/group/comp.os.vms/browse_thread/thread/37b3e...
> :
> > i've found out that some escape seqences work very well and other
> > don't work and now i'm trying to find some help here.
>
> I hope that your working attitude is that beginners do not find
> massive problems such as non-working escape secquences, all they find
> is areas they do not understand well enough.
>
> Possible cause of trouble here: DCL terminates each write with a
> <CR><LF>
> Possible solution here: put the positioning escape sequence in the
> PROMPT.
> Hint, instead of the classic "''symbol'" try &symbol.
>
> For example:
>
> $ x = esc + "[2C" + esc + "[4m"
> $!
> $ read sys$command input1/prompt=&x
> $ say esc+ "[m"
>
> When in doubt, switch the terminal to "DISPLAY CONTROL" (or somehting
> along those lines) in its setup screen(s).
>
> Enjoy,
> Hein

wonderful! it works.
now i can give my fancy full scope.
0
Reply acid.friend (10) 1/11/2009 3:03:03 PM

Richard B. Gilbert wrote:

> I don't believe it's possible and even if it can be done, I doubt if the 
> result could possibly be worth the effort required.
> 


Say the field is 30 characters long. You set character attribute to
underscore, then write 30 spaces, then send an escape sequence to go
back 30 spaces. This is your prompt.  After the prompt completes you
press return, you first send an escape sequence to turn off the
underscore attribute.

This is not perfect though. If you do a delete-character while editing,
the underscored field becomes 29 bytes long.


So this is an approximation of what would be done by FMS for instance.
0
Reply jfmezei.spamnot (8811) 1/11/2009 3:08:18 PM

JF Mezei wrote:
> 
> Richard B. Gilbert wrote:
> 
> > I don't believe it's possible and even if it can be done, I doubt if the
> > result could possibly be worth the effort required.
> >
> 
> Say the field is 30 characters long. You set character attribute to
> underscore, then write 30 spaces, then send an escape sequence to go
> back 30 spaces. This is your prompt.  After the prompt completes you
> press return, you first send an escape sequence to turn off the
> underscore attribute.
> 
> This is not perfect though. If you do a delete-character while editing,
> the underscored field becomes 29 bytes long.
> 
> So this is an approximation of what would be done by FMS for instance.

Following up on the suggestion to set the terminal (program) to display
control characters rather than interpret them, I find myself
wondering...

1. Set the video attributes for an area of the display to underscore
whatever characters are there. (Begin underscore, send spaces, end
underscore.)

2. Use escape sequences to position the cursor into that area as part of
a /PROMPT string.

Will characters typed there be underscored?

Been a while since I played with that sort of stuff, but I seem to
recall All-In-One doing some of that via FMS.

So, JF - you still use A1 right? If you bring up such a form, then
switch your terminal (program) to display controls rather than interpret
them, what do you see? Do you see just the characters echoed, or are
they surrounded by the begin/end underscore sequences, respectively?

D.J.D.
0
Reply djesys.no (1536) 1/11/2009 4:53:01 PM

correct!
finally everything works incl. "remaining" underscores...

$ esc[0,7] = 27
$ x = esc + "[4m  " + esc + "[2D"
$ read sys$command input1/prompt= &x
$ write sys$output esc+ "[m"


JF Mezei wrote:
> Richard B. Gilbert wrote:
>
> > I don't believe it's possible and even if it can be done, I doubt if the
> > result could possibly be worth the effort required.
> >
>
>
> Say the field is 30 characters long. You set character attribute to
> underscore, then write 30 spaces, then send an escape sequence to go
> back 30 spaces. This is your prompt.  After the prompt completes you
> press return, you first send an escape sequence to turn off the
> underscore attribute.
0
Reply acid.friend (10) 1/11/2009 6:10:02 PM

David J Dachtera wrote:

> So, JF - you still use A1 right? If you bring up such a form, then
> switch your terminal (program) to display controls rather than interpret
> them, what do you see? 

Damned you with your challenges !

DECTERM doesn't do display control characters. And couldn'T find my
hardware jumper between 2 serial ports, so had to build a new one that
connects 2 serial ports together. I have a data logger.

OK, first one:

This is a field that is 9999.99  right aligned, it is bold and reverse
video.


L: what I typed.  R: what the computer sent to terminal.

Here is the sequence:
I typed 5 in previous field. First R: shows the echo of the 5, followed
by cursor positioning to the next field (autoskip).

You can see that for each character, it moves cursor to line 8 column
34, and writes the actual full field. In the first case, 2 blanks
followed by 1.00 and then moves cursor to position over the "1". (first
digit before the decimal) I then enter the 2 and it redraws the field.
However, it doesn't reset the display attributes.


R:57:01:35-   8 5�[8;37H
                31533334
                5BB8B378

L:57:04:17-   1 1
                3
                1

R:57:04:24-  20 �[8;34H  1.00�[8;37H
                15333342232331533334
                BB8B348001E00BB8B378

L:57:04:54-   1 2
                3
                2

R:57:04:61-  20 �[8;34H 12.00�[8;37H
                15333342332331533334
                BB8B348012E00BB8B378

L:57:06:40-   1 .
                2
                E

R:57:06:47-   7 �[8;38H
                1533334
                BB8B388

L:57:07:02-   1 3
                3
                3

R:57:07:09-  27 �[8;34H 12.30�[8;38H�[8;39H
                153333423323315333341533334
                BB8B348012E30BB8B388BB8B398

L:57:07:85-   1 4
                3
                4

R:57:07:94-  35 �[8;34H 12.34�[8;39H�[8;40H�[10;37H
                15333342332331533334153333415333334
                BB8B348012E34BB8B398BB8B408BB10B378

L:57:09:91-   3 �[B
                154
                BB2

The final line is my using the arrow key to move to next field.


Now, looking at the original screen display for something at line 8
column 34:

�[8;32H�[;1;7m  �[8;34H  0.00�[9;2H etc

So, it moves to column 32, sets attribute to bold (1) and reverse video
(8) writes 2 spaces, then moves to 8;34, and writes the field contents
(2 spaces followed by 0.00 and then moves on to the next field.

So it appears that during entry, you can rewrite the contents at that
location of the screen and the video attributes are preserved.




Moving to a text field now: (reverse video, bold).

It positions the cursor, and sets the video attributes:

�[19H�[;1;7m

And then echoes the text characters that I type without escape sequences.

When I press the DELETE key, it sends a x08 followed by a space followed
by a 0x08. (x08 is a backspace, <ctrl-H>


HOWEVER:

If, on a text field, I press the left arrow, ( CSI D), it goes into a
mode where for each key I press, it redraws the entire field., but
doesn't set video attributes.

Same for when I switch to character insert mode. It redraws the whole
field for every character I type.





0
Reply jfmezei.spamnot (8811) 1/11/2009 8:41:13 PM

JF Mezei wrote:

> DECTERM doesn't do display control characters. [...]

   I believe that mine do.  I've just been using
EDIT /TPU to look at a log file from  a
"SET HOST 0 /LOG" command, and I see a
whole collection of cute little [C/R] and [N/L]
characters on my screen.
0
Reply sms.antinode (932) 1/12/2009 9:06:04 AM

SMS wrote:
> JF Mezei wrote:
> 
>> DECTERM doesn't do display control characters. [...]
> 
>    I believe that mine do.  I've just been using
> EDIT /TPU to look at a log file from  a
> "SET HOST 0 /LOG" command, and I see a
> whole collection of cute little [C/R] and [N/L]
> characters on my screen.

Aren't they displayed by TPU, not by the DECTerm ?
That is, when they are sent to DECTerm, they are not
control characters but the actual characters "C", "/",
"R" and "N", "/", "L".
0
Reply jan-erik.soderholm (2469) 1/12/2009 12:50:09 PM

Jan-Erik S=F6derholm wrote:
> SMS wrote:
> > JF Mezei wrote:
> >
> >> DECTERM doesn't do display control characters. [...]
> >
> >    I believe that mine do.  I've just been using
> > EDIT /TPU to look at a log file from  a
> > "SET HOST 0 /LOG" command, and I see a
> > whole collection of cute little [C/R] and [N/L]
> > characters on my screen.
>
> Aren't they displayed by TPU, not by the DECTerm ?
> That is, when they are sent to DECTerm, they are not
> control characters but the actual characters "C", "/",
> "R" and "N", "/", "L".

   No, I mean single-cell characters which look roughly like:

      +--+      +--+
      |C |      |N |
      | R|      | L|
      +--+      +--+

   As for who's displaying them, well, TPU/EVE is telling the DECterm
what to do, and the DECterm is doing it.  According to my handy "VT
220
Programmer Pocket Guide", these are in the DEC Special Graphics
character set (with all the L- and T-shapes in different orientations,
and the horizontal lines at five different heights, and the rest of
the
fun stuff).  Anyone doing serious VT100 graphics needs to know about
these (and the SO (%x0E) and SI (%x0F) characters to switch back and
forth between G0 and G1).  (It's all in the book, and I haven't really
cared since about 1985.  And thanks for reminding me.)

--------------------------------------------------------

   Steven M. Schweda               sms@antinode-info
   382 South Warwick Street        (+1) 651-699-9818
   Saint Paul  MN  55105-2547
0
Reply sms.antinode (932) 1/12/2009 1:21:05 PM

SMS wrote:
> Jan-Erik S�derholm wrote:
>> SMS wrote:
>>> JF Mezei wrote:
>>>
>>>> DECTERM doesn't do display control characters. [...]
>>>    I believe that mine do.  I've just been using
>>> EDIT /TPU to look at a log file from  a
>>> "SET HOST 0 /LOG" command, and I see a
>>> whole collection of cute little [C/R] and [N/L]
>>> characters on my screen.
>> Aren't they displayed by TPU, not by the DECTerm ?
>> That is, when they are sent to DECTerm, they are not
>> control characters but the actual characters "C", "/",
>> "R" and "N", "/", "L".
> 
>    No, I mean single-cell characters which look roughly like:
> 
>       +--+      +--+
>       |C |      |N |
>       | R|      | L|
>       +--+      +--+
> 
>    As for who's displaying them, well, TPU/EVE is telling the DECterm
> what to do, and the DECterm is doing it.  According to my handy "VT
> 220
> Programmer Pocket Guide", these are in the DEC Special Graphics
> character set

Right then, then they are still not "controll characters".
It's still something TPU is sending to be displayed, not
true CR and LF characters...

What JF was talking about was when the term-emulator
displays "C/R" (or similar text) instead of actualy
performing the "carriage return" or "line feed" operation.

Jan-Erik.


  (with all the L- and T-shapes in different orientations,
> and the horizontal lines at five different heights, and the rest of
> the
> fun stuff).  Anyone doing serious VT100 graphics needs to know about
> these (and the SO (%x0E) and SI (%x0F) characters to switch back and
> forth between G0 and G1).  (It's all in the book, and I haven't really
> cared since about 1985.  And thanks for reminding me.)
> 
> --------------------------------------------------------
> 
>    Steven M. Schweda               sms@antinode-info
>    382 South Warwick Street        (+1) 651-699-9818
>    Saint Paul  MN  55105-2547
0
Reply jan-erik.soderholm (2469) 1/12/2009 1:26:30 PM

Jan-Erik S�derholm wrote:
> SMS wrote:
>> Jan-Erik S�derholm wrote:
>>> SMS wrote:
>>>> JF Mezei wrote:
>>>>
>>>>> DECTERM doesn't do display control characters. [...]
>>>>    I believe that mine do.  I've just been using
>>>> EDIT /TPU to look at a log file from  a
>>>> "SET HOST 0 /LOG" command, and I see a
>>>> whole collection of cute little [C/R] and [N/L]
>>>> characters on my screen.
>>> Aren't they displayed by TPU, not by the DECTerm ?
>>> That is, when they are sent to DECTerm, they are not
>>> control characters but the actual characters "C", "/",
>>> "R" and "N", "/", "L".
>>
>>    No, I mean single-cell characters which look roughly like:
>>
>>       +--+      +--+
>>       |C |      |N |
>>       | R|      | L|
>>       +--+      +--+
>>
>>    As for who's displaying them, well, TPU/EVE is telling the DECterm
>> what to do, and the DECterm is doing it.  According to my handy "VT
>> 220
>> Programmer Pocket Guide", these are in the DEC Special Graphics
>> character set
> 
> Right then, then they are still not "controll characters".
> It's still something TPU is sending to be displayed, not
> true CR and LF characters...
> 
> What JF was talking about was when the term-emulator
> displays "C/R" (or similar text) instead of actualy
> performing the "carriage return" or "line feed" operation.
> 
> Jan-Erik.
> 
> 
>  (with all the L- and T-shapes in different orientations,
>> and the horizontal lines at five different heights, and the rest of
>> the
>> fun stuff).  Anyone doing serious VT100 graphics needs to know about
>> these (and the SO (%x0E) and SI (%x0F) characters to switch back and
>> forth between G0 and G1).  (It's all in the book, and I haven't really
>> cared since about 1985.  And thanks for reminding me.)
>>
>> --------------------------------------------------------
>>
>>    Steven M. Schweda               sms@antinode-info
>>    382 South Warwick Street        (+1) 651-699-9818
>>    Saint Paul  MN  55105-2547

The cr lf characters are displayed when they are outside the standard crlf sequence.
0
Reply sol (252) 1/12/2009 4:30:06 PM

JF Mezei skrev:
> David J Dachtera wrote:
> Now, looking at the original screen display for something at line 8
> column 34:
> 
> �[8;32H�[;1;7m  �[8;34H  0.00�[9;2H etc
> 
> So, it moves to column 32, sets attribute to bold (1) and reverse video
> (8) writes 2 spaces, then moves to 8;34, and writes the field contents
> (2 spaces followed by 0.00 and then moves on to the next field.
> 
> So it appears that during entry, you can rewrite the contents at that
> location of the screen and the video attributes are preserved.

Bzzt. No.
Apart from the fact that the display driver seems a bit stupid (why do a cursor 
movement to exactly the place you're already at?), what you need to remember is 
that when you set attributes, they remain active until changed. Moving the 
cursor around won't change that.
So the above sequence will move to (8,32), turn off all attributes, turn on 
bold(1) and reverse(7), write two spaces with these attributes, move the cursor 
to (8,34) (where it is already at after the previous two spaces), write "  0.00" 
still with the same attributes previously set, and then move on to (9,2), and so 
on...

And why I say turn off all attibutes - please note the sequence. It is:
<CSI>;1;7m

The initial ; means that you have a (silent) zero first of all. More explicitly, 
it would be written:
<CSI>0;1;7m

(And I use <CSI> here, since that's the correct name of the sequence. And it can 
be sent either as "<ESC>[" or as "<CSI>". The latter is an 8-bit code with the 
octal value of 233. The latter will only work if your terminal actually 
understands 8-bit control codes.)

	Johnny

-- 
Johnny Billquist                  || "I'm on a bus
                                   ||  on a psychedelic trip
email: bqt@softjar.se             ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol
0
Reply bqt (124) 1/12/2009 11:00:45 PM

sol gongola skrev:
> Jan-Erik S�derholm wrote:
>> SMS wrote:
>>> Jan-Erik S�derholm wrote:
>>>> SMS wrote:
>>>>> JF Mezei wrote:
>>>>>
>>>>>> DECTERM doesn't do display control characters. [...]
>>>>>    I believe that mine do.  I've just been using
>>>>> EDIT /TPU to look at a log file from  a
>>>>> "SET HOST 0 /LOG" command, and I see a
>>>>> whole collection of cute little [C/R] and [N/L]
>>>>> characters on my screen.
>>>> Aren't they displayed by TPU, not by the DECTerm ?
>>>> That is, when they are sent to DECTerm, they are not
>>>> control characters but the actual characters "C", "/",
>>>> "R" and "N", "/", "L".
>>>    No, I mean single-cell characters which look roughly like:
>>>
>>>       +--+      +--+
>>>       |C |      |N |
>>>       | R|      | L|
>>>       +--+      +--+
>>>
>>>    As for who's displaying them, well, TPU/EVE is telling the DECterm
>>> what to do, and the DECterm is doing it.  According to my handy "VT
>>> 220
>>> Programmer Pocket Guide", these are in the DEC Special Graphics
>>> character set
>> Right then, then they are still not "controll characters".
>> It's still something TPU is sending to be displayed, not
>> true CR and LF characters...
>>
>> What JF was talking about was when the term-emulator
>> displays "C/R" (or similar text) instead of actualy
>> performing the "carriage return" or "line feed" operation.
>>
>> Jan-Erik.
>>
>>
>>  (with all the L- and T-shapes in different orientations,
>>> and the horizontal lines at five different heights, and the rest of
>>> the
>>> fun stuff).  Anyone doing serious VT100 graphics needs to know about
>>> these (and the SO (%x0E) and SI (%x0F) characters to switch back and
>>> forth between G0 and G1).  (It's all in the book, and I haven't really
>>> cared since about 1985.  And thanks for reminding me.)
>>>
>>> --------------------------------------------------------
>>>
>>>    Steven M. Schweda               sms@antinode-info
>>>    382 South Warwick Street        (+1) 651-699-9818
>>>    Saint Paul  MN  55105-2547
> 
> The cr lf characters are displayed when they are outside the standard crlf sequence.

No. The C/R and L/F characters are displayed when you select the DEC technical 
character set (and that involves more than just using the SI and SO codes), or 
when you set the terminal to display control characters. In the latter case, CR 
and LF are displayed, but they are also among the few characters that the 
terminal also still interprets and executes.

Sending a CR without an LF or vice verse is definitely not uncommon or strange, 
and it would be very weird and bad if they were displayed just because they 
didn't come in pairs.

	Johnny

-- 
Johnny Billquist                  || "I'm on a bus
                                   ||  on a psychedelic trip
email: bqt@softjar.se             ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol
0
Reply bqt (124) 1/12/2009 11:03:58 PM

Johnny Billquist wrote:

> No. The C/R and L/F characters are displayed when you select the DEC technical 
> character set (and that involves more than just using the SI and SO codes), or 
> when you set the terminal to display control characters. In the latter case, CR 
> and LF are displayed, but they are also among the few characters that the 
> terminal also still interprets and executes.

Real VT terminals have a setup options to display control characters
instead of process them.

DECterm does not have such an option.

I tried a SET HOST/LOG <decnet> to log the session to file, but it
appears that CTERM does some local editing and doesn't log some of the
editing (like backspace). So I had to use a serial port loop and an old
program of mine to log the transmissions.
0
Reply jfmezei.spamnot (8811) 1/13/2009 8:12:09 AM

On Jan 11, 3:49=A0am, acid.fri...@yahoo.de wrote:
> hi everybody,
> it might be interesting for you to read my previous topic:http://groups.g=
oogle.com/group/comp.os.vms/browse_thread/thread/37b3e...
>
> in the meantime i managed to get a copy of vt100 user guide and i've
> read the programmers part very carefully, because i want to code
> something in DCL using ASCII escape sequences.
> i've found out that some escape seqences work very well and other
> don't work and now i'm trying to find some help here.
>
> $ ty specfont.com
> $!-----------------------------------------------------------------------=
-------
> $! =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 PLAYING WITH ESC
> SEQUENCES
> $!-----------------------------------------------------------------------=
-------
> $!
> $ esc[0,7] =3D 27
> $ say =3D "write sys$output"
> $ say esc+ "(0"
> $ say " ssssssssss"
> $ say esc+ "(A"
> $ say esc+ "[3A"
> $ read sys$command input1/prompt=3D" "
>
> this works fine ^^
>
> but when i modify the "$ say " ssssssssss" line and add a additional
> escape seqence, it won't work.
>
> $ ty specfontv2.com
> $!-----------------------------------------------------------------------=
-------
> $! =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 PLAYING WITH ESC
> SEQUENCES
> $!-----------------------------------------------------------------------=
-------
> $!
> $ esc[0,7] =3D 27
> $ say =3D "write sys$output"
> $ say esc+ "(0"
> $!
> $! modified line below, added some spaces in front of the first s
> $ say " =A0 ssssssssss"
> $!
> $ say esc+ "(A"
> $ say esc+ "[3A"
> $!
> $! additional escape sequence below, want the cursor so move right
> (this won't work)
> $ say esc+ "[2C"
> $!
> $ read sys$command input1/prompt=3D" "
>
> okay, that's my first problem.
>
> besides i don't want the underscores/special characters to get
> overwritten when i start typing.
> is there any easy solution for this?
>
> kind regards

Maybe this is something I haven't seen before but, shouldn't the "7"
be an "8" as in:
$ esc[0,8]=3D27
I thought "8" meant byte but maybe its just my ignorance showing
though.

With respect to VT control codes, I have been doing this with hardware
terminals and/or emulators since 1987 (from DCL but mostly from BASIC)
and have used a declaration file similar to this one.

http://www3.sympatico.ca/n.rieck/demo_vms/device_controls.zip

Neil Rieck
Kitchener/Waterloo/Cambridge,
Ontario, Canada.
http://www3.sympatico.ca/n.rieck/links/openvms_demos.html
0
Reply n.rieck (1972) 1/14/2009 11:31:41 AM

Neil Rieck wrote:

> Maybe this is something I haven't seen before but, shouldn't the "7"
> be an "8" as in:
> $ esc[0,8]=27
> I thought "8" meant byte but maybe its just my ignorance showing
> though.

The first value is the starting bit-position and
the second is number of bits set. So [0,7] = 27
sets the first 7 bits (prob OK for those countries
using only 7-bit ASCII) leaving the 8'th bit "0".
OK for "esc" and other 7-bit characters, but not
for charachters higher up in the ASCII table.

In the case above even "$ esc[0,5]=27" will
actualy work since the value 27 (decimal) will
only change the lower 5 bits. Not recomended, since
you it will be unpredictible if the symbol "esc"
happens to have some other value before, the bits
6, 7 and 8 are unchanged by the operation...

Jan-Erik.
0
Reply jan-erik.soderholm (2469) 1/14/2009 11:51:20 AM

On Jan 11, 3:49=A0am, acid.fri...@yahoo.de wrote:
> hi everybody,

This thread reminded me of a program I did a long time ago while
teaching an in-house course in DCL programming;

$ create tictactoe.com
$ DECK
$!
$ esc[0,8]=3D=3D27
$ set term/nowrap
$!
$ start_col =3D 27
$ start_row =3D 7
$! A =3D +1, B =3D +3, C =3D +5
$! 1 =3D +3, 2 =3D +9, 3 =3D +15
$!
$ gosub draw_grid
$ gosub init_variables
$ gosub get_players
$ gosub play_game
$ gosub display_winner
$!
$ exit
$draw_grid:
$ call display -'start_row -'start_col "''esc'[J"
$ title_row =3D -'start_row + 2
$ title_col =3D -start_col + 11
$ call display 'title_row 'title_col "''esc#3DCL Tic Tac Toe"
$ title_row =3D -'start_row + 3
$ call display 'title_row 'title_col "''esc#4DCL Tic Tac Toe"
$ call display -1 3 "1     2     3"
$ call display 0 0 "''esc'(0lqqqqqwqqqqqwqqqqqk"
$ call display 1 -2 "A x     x     x     x"
$ call display 2 0 "tqqqqqnqqqqqnqqqqqu"
$ call display 3 -2 "B x     x     x     x"
$ call display 4 0 "tqqqqqnqqqqqnqqqqqu"
$ call display 5 -2 "C x     x     x     x"
$ call display 6 0 "mqqqqqvqqqqqvqqqqqj''esc'(B"
$
$!
$return
$!
$display: subroutine
$ disp_row =3D start_row + 'p1
$ disp_col =3D start_col + 'p2
$ line =3D "''esc'[''disp_row';''disp_col'H''p3'"
$ read sys$command inline /prompt=3D"''line'" /time=3D0/error=3Dnext
$next:
$endsubroutine
$!
$init_variables:
$!
$ have_winner =3D 0
$!
$ A1 =3D 0
$ A2 =3D 0
$ A3 =3D 0
$ B1 =3D 0
$ B2 =3D 0
$ B3 =3D 0
$ C1 =3D 0
$ C2 =3D 0
$ C3 =3D 0
$!
$ return
$!
$get_players:
$!
$ call display 10 -'start_col "Enter the first player's name:
''esc'[4m                    "
$ call display 10 32-'start_col ""
$ read sys$command player1 /prompt=3D""
$!
$ Write sys$output "''esc'[0m''player1' will be using X"
$!
$ call display 12 -'start_col "Enter the second player's name
[COMPUTER]: ''esc'[4m                      "
$ call display 12 44-'start_col ""
$ read sys$command player2 /prompt=3D""
$!
$ if player2 .eqs. "" then player2 =3D "Computer"
$!
$ write sys$output "''esc'[0m''Player2' will be using O"
$!
$return
$!
$play_game:
$!
$ gosub get_player1
$ gosub check_for_winner
$ if have_winner .gt. 0 then return
$ gosub get_player2
$ gosub check_for_winner
$ if have_winner .gt. 0 then return
$!
$ goto play_game
$return  ! never executed, but for looks
$!
$get_player1:
$ player =3D "''Player1'"
$ Letter =3D "X"
$ Value =3D 1
$ gosub Play
$return
$!
$get_player2:
$ player =3D "''Player2'"
$ Letter =3D "O"
$ Value =3D 2
$ if player2 .eqs. "Computer"
$       then
$               gosub check_for_move
$               gosub place_mark
$       else
$               gosub Play
$       endif
$!
$return
$!
$play:
$!
$ Call Display 10 -'Start_col "''esc'[J''esc'#6''Player': ''LETTER'"
$ Call Display 11 -'Start_col "''esc'#6''Enter your position using
RowColumn: "
$ read sys$command position /prompt=3D""
$ position =3D "''f$edit(position,"Upcase")'"
$ if -
      position .nes. "A1" .and. position .nes. "A2" .and.
position .nes. "A3" -
..and. position .nes. "B1" .and. position .nes. "B2" .and.
position .nes. "B3" -
..and. position .nes. "C1" .and. position .nes. "C2" .and.
position .nes. "C3"
$       Then
$               call display 12 -'Start_col -
        "Invalid Response, enter A1, A2, A3, B1, B2, B3, C1 ,C2 or
C3."
$               wait 00:00:02
$               call display 12 -'Start_col "''esc'[J"
$               goto play
$       endif
$!
$ if 'position .ne. 0
$       Then
$               call display 12 -'Start_col -
        "That position is already taken."
$               wait 00:00:02
$               call display 12 -'Start_col "''esc'[J"
$               goto play
$       endif
$!
$ gosub place_mark
$!
$ return
$!
$place_mark:
$!
$ 'position =3D 'Value
$ row =3D (f$cvui(0,8,f$extract(0,1,position)) -64) * 2 - 1
$ col =3D f$integer(f$extract(1,1,position)) * 3 + -
                (f$integer(f$extract(1,1,position)) - 1) * 3
$ call display 'row 'col "''Letter'"
$!
$return
$!
$check_for_move:
$!
$ have_play =3D 0
$!
$ testpos =3D "A1"
$ gosub testpos
$ if have_play .gt. 0 then return
$!
$ testpos =3D "A2"
$ gosub testpos
$ if have_play .gt. 0 then return
$!
$ testpos =3D "A3"
$ gosub testpos
$ if have_play .gt. 0 then return
$!
$ testpos =3D "B1"
$ gosub testpos
$ if have_play .gt. 0 then return
$!
$ testpos =3D "B2"
$ gosub testpos
$ if have_play .gt. 0 then return
$!
$ testpos =3D "B3"
$ gosub testpos
$ if have_play .gt. 0 then return
$!
$ testpos =3D "C1"
$ gosub testpos
$ if have_play .gt. 0 then return
$!
$ testpos =3D "C2"
$ gosub testpos
$ if have_play .gt. 0 then return
$!
$ testpos =3D "C3"
$ gosub testpos
$ if have_play .gt. 0 then return
$!
$find_random:
$ random =3D f$cvtime("",,"HUNDREDTH") / 10
$ position =3D "''f$element(random,"-","A1-A2-A3-B1-B2-B3-C1-C2-C3-
B2")'"
$ if 'position .ne. 0 then goto find_random
$!
$return
$!
$testpos:
$!
$ if 'testpos .eq. 0
$       then
$               'testpos =3D value
$               gosub check_for_winner
$               if have_winner .gt. 0
$                       then
$                               have_play =3D 1
$                       else
$                               'testpos =3D value - 1
$                               gosub check_for_winner
$                               if have_winner .gt. 0
$                                       then
$                                               'testpos =3D value
$                                               have_play =3D 1
$                                       else
$                                               'testpos =3D 0
$                                       endif
$                       endif
$               position =3D testpos
$       endif
$!
$return
$check_for_winner:
$!
$ winner =3D ""
$ HA =3D 0
$ HB =3D 0
$ HC =3D 0
$!
$ V1 =3D 0
$ V2 =3D 0
$ V3 =3D 0
$!
$ DA =3D 0
$ DC =3D 0
$!
$ tie_game =3D 0
$!
$ if a1 .eq. a2 .and. a2 .eq. a3 .and. a1 .ne. 0
$       then
$               HA =3D 1
$               Winner =3D Player'a1
$       endif
$ if b1 .eq. b2 .and. b2 .eq. b3 .and. b1 .ne. 0
$       then
$               HB =3D 1
$               Winner =3D Player'b1
$       endif
$ if c1 .eq. c2 .and. c2 .eq. c3 .and. c1 .ne. 0
$       then
$               HC =3D 1
$               Winner =3D Player'c1
$       endif
$!
$ if a1 .eq. b1 .and. b1 .eq. c1 .and. a1 .ne. 0
$       then
$               V1 =3D 1
$               Winner =3D Player'a1
$       endif
$ if a2 .eq. b2 .and. b2 .eq. c2 .and. a2 .ne. 0
$       then
$               V2 =3D 1
$               Winner =3D Player'a2
$       endif
$ if a3 .eq. b3 .and. b3 .eq. c3 .and. a3 .ne. 0
$       then
$               V3 =3D 1
$               Winner =3D Player'a3
$       endif
$!
$ if a1 .eq. b2 .and. b2 .eq. c3 .and. a1 .ne. 0
$       then
$               DA =3D 1
$               Winner =3D Player'a1
$       endif
$ if c1 .eq. b2 .and. b2 .eq. a3 .and. c1 .ne. 0
$       then
$               DC =3D 1
$               Winner =3D Player'c1
$       endif
$!
$ if  Winner .eqs. "" .and. -
              a1 .ne. 0 .and. a2 .ne. 0 .and. a3 .ne. 0 -
        .and. b1 .ne. 0 .and. b2 .ne. 0 .and. b3 .ne. 0 -
        .and. c1 .ne. 0 .and. c2 .ne. 0 .and. c3 .ne. 0 -
        then tie_game =3D 1
$!
$ have_winner =3D HA + HB + HC + V1 + V2 + V3 + DA + DC + Tie_game
$
$return
$!
$display_winner:
$!
$ if tie_game .eq. 1
$       then
$               call display 10 -'Start_col "''esc'[J''esc'#3  TIE
GAME"
$               call display 11 -'Start_col "''esc'#4  TIE GAME"
$       else
$               call display 10 -'Start_col "''esc'[J''esc'#3
''Winner' Won!!!"
$               call display 11 -'Start_col "''esc'#4  ''Winner
Won!!!"
$       endif
$!
$ EOD


0
Reply Peter 1/14/2009 5:34:36 PM

Peter Weaver wrote:
> On Jan 11, 3:49 am, acid.fri...@yahoo.de wrote:
>> hi everybody,
> 
> This thread reminded me of a program I did a long time ago while
> teaching an in-house course in DCL programming;
> 
> $ create tictactoe.com
....
....

He he, it works. :-)
(Using an XP900, VMS 8.2 and Reflection 14.0)
0
Reply jan-erik.soderholm (2469) 1/14/2009 5:44:39 PM

"Peter Weaver" <info-vax@weaverconsulting.ca> wrote in message 
news:31e77a33-f1e4-4ea3-92de-93a6e873f346@u14g2000yqg.googlegroups.com...
On Jan 11, 3:49 am, acid.fri...@yahoo.de wrote:
> hi everybody,

>> This thread reminded me of a program I did a long time ago while
>> teaching an in-house course in DCL programming;


This is fun !
:-)
Syltrem


0
Reply syltremzulu (577) 1/14/2009 9:11:10 PM

22 Replies
45 Views

(page loaded in 0.24 seconds)


Reply: