Re: Text processing on VMS

Liste des GroupesRevenir à co vms 
Sujet : Re: Text processing on VMS
De : arne (at) *nospam* vajhoej.dk (Arne Vajhøj)
Groupes : comp.os.vms
Date : 14. Oct 2024, 14:56:04
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vej7tk$17h7i$1@dont-email.me>
References : 1 2 3 4 5 6
User-Agent : Mozilla Thunderbird
On 10/14/2024 8:30 AM, Simon Clubley wrote:
On 2024-10-13, Arne Vajhøj <arne@vajhoej.dk> wrote:
On 10/13/2024 3:26 PM, Arne Vajhøj wrote:
On 10/13/2024 2:57 PM, Dave Froble wrote:
Using SEARCH and then a simple Basic program is not that much work.
>
For example:
>
SEARCH File1.txt "some text" /output=File2.txt
>
1    On Error Goto 90
>
10    Open "file2" For Input as File 1%
      Open "File2" For Output as File 2%
>
20    Linput #1%, Z$
      Print #2%, Mid(Z$,?,?)
      Goto 20
>
90    GoTo 99 If ERR=11
      On Error GoTo 0
>
99    End
>
Simple
No having to know whatever is your favorite utility
I seriously doubt there would be much fewer characters
>
No, I didn't try it ...
>
I have confidence in your VMS Basic skills.
>
But I am curious about how you iterate over the file.
>
Are there any benefits from this way compared to:
>
handler eof_handler
end handler
when error use eof_handler
      while 1 = 1
          get #1
          ! do whatever
      next
end when
>
 That's how a Pascal programmer would write it. David however clearly
prefers Dartmouth Basic. :-)
 BTW, I think your approach is a lot more readable than David's style. :-)
But I have not come up with that construct. I must have gotten
it from somewhere. Just not sure where.
BTW, I think it would be nice if the compiler wizard added
either:
while not eof #1
     get #1
     ' do whatever
next
or:
while true
     get #1, eof=100
     ' do whatever
next
100:
Arne

Date Sujet#  Auteur
13 Oct 24 * Text processing on VMS17David Meyer
13 Oct 24 +* Re: Text processing on VMS2Chris Townley
14 Oct 24 i`- Re: Text processing on VMS1David Meyer
13 Oct 24 +- Re: Text processing on VMS1Craig A. Berry
13 Oct 24 +* Re: Text processing on VMS12Arne Vajhøj
13 Oct 24 i`* Re: Text processing on VMS11Dave Froble
13 Oct 24 i `* Re: Text processing on VMS10Arne Vajhøj
13 Oct 24 i  +* Re: Text processing on VMS5Craig A. Berry
14 Oct 24 i  i`* Re: Text processing on VMS4Arne Vajhøj
14 Oct 24 i  i +- Re: Text processing on VMS1Arne Vajhøj
14 Oct 24 i  i +- Re: Text processing on VMS1Arne Vajhøj
14 Oct 24 i  i `- Re: Text processing on VMS1Arne Vajhøj
14 Oct 24 i  `* Re: Text processing on VMS4Arne Vajhøj
14 Oct 24 i   +* Re: Text processing on VMS2Simon Clubley
14 Oct 24 i   i`- Re: Text processing on VMS1Arne Vajhøj
14 Oct 24 i   `- Re: Text processing on VMS1Dave Froble
13 Oct 24 `- Re: Text processing on VMS1Stephen Hoffman

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal