[Info-vax] Basic again

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


On 3/11/2024 2:04 PM, Craig A. Berry wrote:
> 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>

I have read it, but I got the impression that it was intended
for this:

$ type pw.bas
program pw

print "A",
print "B",
print "C"

end program
$ bas pw
$ link pw
$ run pw
A             B             C
$ type pw.pas
program pw(input,output);

begin
    write('A');
    write('B');
    writeln('C');
end.
$ pas pw
$ link pw
$ run pw
ABC
$ type pw.for
       program pw
       write(*,'(1x,A,$)') 'A'
       write(*,'(1h+,A,$)') 'B'
       write(*,'(1h+,A)') 'C'
       end
$ for pw
$ link pw
$ run pw
ABC

Arne






More information about the Info-vax mailing list