[Info-vax] DEC BASIC: How to read a sequential

Johnny Billquist bqt at softjar.se
Fri Apr 13 17:01:12 EDT 2012


On 2012-04-13 15:52, Jeffrey H. Coffield wrote:
>
>
> On 04/13/2012 05:58 AM, Syltrem wrote:
>> "StGallen"<sengupta.suhas at gmail.com> wrote in message
>> news:9a02fdaf-52ae-42aa-8838-277af4bb5f7e at to5g2000pbc.googlegroups.com...
>>> All,
>>> DEC Basic 1.3. VMS 7.3.2
>>>
>>> I need to open a sequential file with variable record length. How can
>>> I do this, especially since I cannot define the size of the STRINGS in
>>> the MAP file?
>>>
>>> Also if I open the file without a MAP file, how do I read the records
>>> from the file?
>>>
>>> Any help deeply appreciated.
>>>
>>> Many thanks!
>>
>> I didn`t do BASIC in quite some time, but the answer is probably along
>> these
>> lines :
>>
>> Declare string myrec
>>
>> Open Filename for Input as File #1,&
>> Organization Undefined, Recordtype Any,&
>> Access Read, Allow Modify
>>
>> Linput #1, myrec
>>
>> HTH
>>
>> Syltrem
>>
>>
>
> Syltrem's solution is what we usually use, but we generally would add :
>
> myrec = edit$(myrec, 4%)
>
> to strip off the training carriage return.

That should not be neccesary, as that is a feature of LINPUT - the 
trailing CR+LF are already stripped off.

	Johnny

-- 
Johnny Billquist                  || "I'm on a bus
                                   ||  on a psychedelic trip
email: bqt at softjar.se             ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol



More information about the Info-vax mailing list