My lack of skills in VMS Basic are back to haunt me.
$ type z.pas
program z(input,output);
begin
writeln('XXX');
writeln('YYY' + chr(13) + chr(10));
writeln('ZZZ');
end.
$ pas z
$ link z
$ r z
XXX
YYY
ZZZ
$ type z.bas
program z
print "XXX"
print "YYY" + chr$(13) + chr$(10)
print "ZZZ"
end program
$ bas z
$ link z
$ run z
XXX
YYY
ZZZ
Why are there no empty line between YYY and ZZZ in the Basic
example??
(VMS Basic 1.8 on VMS Alpha)
Arne
<ZZ><>
On 3/10/2024 9:04 PM, Arne Vajhøj wrote:
My lack of skills in VMS Basic are back to haunt me.
$ type z.pas
program z(input,output);
begin
  writeln('XXX');
  writeln('YYY' + chr(13) + chr(10));
  writeln('ZZZ');
end.
$ pas z
$ link z
$ r z
XXX
YYY
ZZZ
$ type z.bas
program z
print "XXX"
print "YYY" + chr$(13) + chr$(10)
print "ZZZ"
end program
$ bas z
$ link z
$ run z
XXX
YYY
ZZZ
Why are there no empty line between YYY and ZZZ in the Basic
example??
(VMS Basic 1.8 on VMS Alpha)
Interesting behavior ...
Funny things happen when CR and LF are embedded in text on a display.
:-)
In your example, the CR can return the cursor to column 1, but it
appears the LF doesn't give you the extra blank line. I can only guess
that the print statement might not add a second LF. A bit strange.
Why are there no empty line between YYY and ZZZ in the Basic example??
The mystery evolves:
$ type z2.bas
program z2
print "XXX"
print "YYY" + chr$(13) + chr$(10) + chr$(10)
print "ZZZ"
end program
$ bas z2
$ link z2
$ run z2
XXX
YYY
ZZZ
1 LF => no blank line
2 LF => two blank lines
On 2024-03-10, Arne Vajhøj <arne@vajhoej.dk> wrote:
The mystery evolves:
$ type z2.bas
program z2
print "XXX"
print "YYY" + chr$(13) + chr$(10) + chr$(10)
print "ZZZ"
end program
$ bas z2
$ link z2
$ run z2
XXX
YYY
ZZZ
1 LF => no blank line
2 LF => two blank lines
Your basic assumptions may be wrong (or they be right). Run the following command procedure and note where the cursor stops during the 5 second pause.
$ type arne.com
$ write sys$output "Line 1"
$ wait 0:00:05
$ write sys$output "Line 2"
$ @arne
Line 1
Line 2
Now turn that into a Basic program. During the 5 second pause, does the cursor stop at the beginning of the first line or does it stop on the
line _below_ the first line ?
If it's the latter, carry on as I have no useful suggestions.
If it's the former, rewrite your tests as LF + text + CR, instead of
text + CR + LF. That makes your testing compatible with the way VMS
outputs lines of text by default. What I don't know is if VMS Basic
uses that same model.
Simon.
On Sun, 10 Mar 2024 21:04:15 -0400, Arne Vajhøj wrote:
Why are there no empty line between YYY and ZZZ in the Basic example??
Because two different language implementation teams came to two different decisions about how to map character streams onto VMS’ insistence that files be made out of records.
On 3/11/2024 1:28 AM, Lawrence D'Oliveiro wrote:
On Sun, 10 Mar 2024 21:04:15 -0400, Arne Vajhøj wrote:
Why are there no empty line between YYY and ZZZ in the Basic example??
Because two different language implementation teams came to two different
decisions about how to map character streams onto VMS’ insistence that
files be made out of records.
I see VMS Basic IO as record oriented and not stream oriented.
And I was not expecting any "mapping". I was expecting
PRINT to format an internal buffer with the data provided
and call SYS$PUT without any attempts to modify the data
provided.
The reality is observable different.
Surely BASIC has its own formatting. Why manually put in control
characters to confuse it?
print "XXX"
print "YYY"
print ""
print "ZZZ"
will simply give:
XXX
YYY
ZZZ
if that is what you want
On 3/11/2024 9:20 AM, Chris Townley wrote:
Surely BASIC has its own formatting. Why manually put in control
characters to confuse it?
print "XXX"
print "YYY"
print ""
print "ZZZ"
will simply give:
XXX
YYY
ZZZ
if that is what you want
The real context is a CGI script under Apache doing a
redirect.
On 2024-03-10, Arne Vajhøj <arne@vajhoej.dk> wrote:
The mystery evolves:
$ type z2.bas
program z2
print "XXX"
print "YYY" + chr$(13) + chr$(10) + chr$(10)
print "ZZZ"
end program
$ bas z2
$ link z2
$ run z2
XXX
YYY
ZZZ
1 LF => no blank line
2 LF => two blank lines
Your basic assumptions may be wrong (or they be right). Run the following command procedure and note where the cursor stops during the 5 second pause.
$ type arne.com
$ write sys$output "Line 1"
$ wait 0:00:05
$ write sys$output "Line 2"
$ @arne
Line 1
Line 2
Now turn that into a Basic program. During the 5 second pause, does the cursor stop at the beginning of the first line or does it stop on the
line _below_ the first line ?
If it's the latter, carry on as I have no useful suggestions.
If it's the former, rewrite your tests as LF + text + CR, instead of
text + CR + LF. That makes your testing compatible with the way VMS
outputs lines of text by default. What I don't know is if VMS Basic
uses that same model.
On 2024-03-11, Arne Vajhøj <arne@vajhoej.dk> wrote:
On 3/11/2024 9:20 AM, Chris Townley wrote:
Surely BASIC has its own formatting. Why manually put in control
characters to confuse it?
print "XXX"
print "YYY"
print ""
print "ZZZ"
will simply give:
XXX
YYY
ZZZ
if that is what you want
The real context is a CGI script under Apache doing a
redirect.
You didn't mention that bit Arne. :-(
The implication from your posting was that this is an interactive
session problem. This matters because the terminal driver does a
lot of output processing on the data it is asked to display.
Now I know this, try putting your output + CR + LF into a string
and then output the string only in the print statement.
This may or may not make a difference depending on what the Basic
RTL does with the string.
I think what he wants is an explanation of why the behavior is
different than on any other machine. :-)
Yes, I tried it with other versions of basic and Pascal and got
the behavior Arne was looking for. Sadly, at t he moment I don't
have a VMS system running to play with it there.
My lack of skills in VMS Basic are back to haunt me.
$ type z.pas
program z(input,output);
begin
  writeln('XXX');
  writeln('YYY' + chr(13) + chr(10));
  writeln('ZZZ');
end.
$ pas z
$ link z
$ r z
XXX
YYY
ZZZ
$ type z.bas
program z
print "XXX"
print "YYY" + chr$(13) + chr$(10)
print "ZZZ"
end program
$ bas z
$ link z
$ run z
XXX
YYY
ZZZ
Why are there no empty line between YYY and ZZZ in the Basic
example??
(VMS Basic 1.8 on VMS Alpha)
On 3/10/24 8:04 PM, Arne Vajhøj wrote:
My lack of skills in VMS Basic are back to haunt me.
$ type z.bas
program z
print "XXX"
print "YYY" + chr$(13) + chr$(10)
print "ZZZ"
end program
$ bas z
$ link z
$ run z
XXX
YYY
ZZZ
Why are there no empty line between YYY and ZZZ in the Basic
example??
(VMS Basic 1.8 on VMS Alpha)
I don't know the answer to your question, but the docs mention a lot of special behavior in special circumstances, e.g., "When printing to a terminal-format file, VSI BASIC does not write out the record until a
PRINT statement without trailing punctuation executes."Â Maybe the CRLF
are considered trailing punctuation? Or maybe one of the other special
rules is in effect. PRINT docs start at p. 201 here:
<https://docs.vmssoftware.com/docs/vsi-basic-for-openvms-reference-manual.pdf>
On Mon, 2024-03-11 at 09:34 -0400, bill wrote:
I think what he wants is an explanation of why the behavior is
different than on any other machine. :-)
Yes, I tried it with other versions of basic and Pascal and got
the behavior Arne was looking for. Sadly, at t he moment I don't
have a VMS system running to play with it there.
CGI is Unix and really wants LF+CR but VMS strips away one of these characters so it never looks like a LF+CR sequence at the other end.
All that's needed is for him to output as raw rather than "cooked".
On 3/11/2024 9:13 AM, Simon Clubley wrote:
On 2024-03-10, Arne Vajhøj <arne@vajhoej.dk> wrote:
The mystery evolves:
$ type z2.bas
program z2
print "XXX"
print "YYY" + chr$(13) + chr$(10) + chr$(10)
print "ZZZ"
end program
$ bas z2
$ link z2
$ run z2
XXX
YYY
ZZZ
1 LF => no blank line
2 LF => two blank lines
Your basic assumptions may be wrong (or they be right). Run the following
command procedure and note where the cursor stops during the 5 second pause. >>
$ type arne.com
$ write sys$output "Line 1"
$ wait 0:00:05
$ write sys$output "Line 2"
$ @arne
Line 1
Line 2
Now turn that into a Basic program. During the 5 second pause, does the
cursor stop at the beginning of the first line or does it stop on the
line _below_ the first line ?
If it's the latter, carry on as I have no useful suggestions.
If it's the former, rewrite your tests as LF + text + CR, instead of
text + CR + LF. That makes your testing compatible with the way VMS
outputs lines of text by default. What I don't know is if VMS Basic
uses that same model.
$ type zhack.bas
program z
print "XXX"
print "YYY" + chr$(13)
print chr$(10) + "ZZZ"
end program
$ bas zhack
$ link zhack
$ run zhack
XXX
YYY
ZZZ
And maybe I can use that as workaround.
But I would still like to know why a trailing CR LF get
stripped away.
I really don't like the idea of RTL stripping any
of "my data" away.
Arne
In article <usn0gu$3kkpg$1@dont-email.me>,
Arne Vajhøj <arne@vajhoej.dk> wrote:
On 3/11/2024 1:28 AM, Lawrence D'Oliveiro wrote:
On Sun, 10 Mar 2024 21:04:15 -0400, Arne Vajhøj wrote:
Why are there no empty line between YYY and ZZZ in the Basic example??
Because two different language implementation teams came to two different >>> decisions about how to map character streams onto VMS’ insistence that
files be made out of records.
I see VMS Basic IO as record oriented and not stream oriented.
And I was not expecting any "mapping". I was expecting
PRINT to format an internal buffer with the data provided
and call SYS$PUT without any attempts to modify the data
provided.
The reality is observable different.
Please don't feed the troll.
- Dan C.
The reality is observable different.
The real context is a CGI script under Apache doing a redirect.
On Mon, 11 Mar 2024 09:30:54 -0400, Arne Vajhøj wrote:
The real context is a CGI script under Apache doing a redirect.
Really, using CGI? Particularly on an OS where process creation is
expensive?
The story about web applications start with CGI.
On 3/11/2024 9:22 AM, Dan Cross wrote:
In article <usn0gu$3kkpg$1@dont-email.me>,
Arne Vajhøj <arne@vajhoej.dk> wrote:
On 3/11/2024 1:28 AM, Lawrence D'Oliveiro wrote:
On Sun, 10 Mar 2024 21:04:15 -0400, Arne Vajhøj wrote:
Why are there no empty line between YYY and ZZZ in the Basic example?? >>>>Because two different language implementation teams came to two different >>>> decisions about how to map character streams onto VMS’ insistence that
files be made out of records.
I see VMS Basic IO as record oriented and not stream oriented.
And I was not expecting any "mapping". I was expecting
PRINT to format an internal buffer with the data provided
and call SYS$PUT without any attempts to modify the data
provided.
The reality is observable different.
Please don't feed the troll.
- Dan C.
:-)
Well, this time, I think the troll is correct ...
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 430 |
Nodes: | 16 (2 / 14) |
Uptime: | 146:07:18 |
Calls: | 9,065 |
Calls today: | 2 |
Files: | 13,402 |
Messages: | 6,019,403 |