[Info-vax] Basic again

Arne Vajhøj arne at vajhoej.dk
Mon Mar 11 09:44:15 EDT 2024


On 3/11/2024 9:13 AM, Simon Clubley wrote:
> On 2024-03-10, Arne Vajhøj <arne at 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




More information about the Info-vax mailing list