[Info-vax] DEC BASIC: How to read a sequential
Jeffrey H. Coffield
jeffrey at digitalsynergyinc.com
Sat Apr 14 10:18:29 EDT 2012
On 04/13/2012 02:01 PM, Johnny Billquist wrote:
> 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
>
Looking at some code I see that we used "input line" instead of "linput"
and you are right for the "linput". There is no need for the "edit".
Jeff
More information about the Info-vax
mailing list