[Info-vax] Basic again

Arne Vajhøj arne at vajhoej.dk
Sun Mar 10 22:34:48 EDT 2024


On 3/10/2024 9:53 PM, Dave Froble wrote:
> 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.

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

Arne





More information about the Info-vax mailing list