[Info-vax] Basic again
Dave Froble
davef at tsoft-inc.com
Mon Mar 11 16:57:41 EDT 2024
On 3/11/2024 9:44 AM, Arne Vajhøj wrote:
> 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
>
I'm pretty sure it is the PRINT statement. I'm guessing it thinks it know
better than you.
:-)
I write that because if you omit both the PRINT and the terminal driver, by
printing to a file, you will see the file has exactly what you intended.
--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: davef at tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486
More information about the Info-vax
mailing list