🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

8 total messages Started by Dale R. Worley Tue, 08 Sep 1992 18:58
Religious question -- negative arguments for S
#1
Author: Dale R. Worley
Date: Tue, 08 Sep 1992 18:58
10 lines
881 bytes
If one searches backwards (using a negative argument to S), is the
point left at the beginning of the string (so that -Sstring$ when
executed repeatedly finds successive occurrences backwards), or is the
point left at the end of the string (as when S searches forward)?

Dale

Dale Worley		Dept. of Math., MIT		drw@math.mit.edu
--
Measure with a micrometer.  Mark with chalk.  Cut with an axe.
Re: Religious question -- negative arguments for S
#2
Author: 24337-mcburnett
Date: Tue, 08 Sep 1992 20:51
33 lines
1688 bytes
In article <DRW.92Sep8135859@nevanlinna.mit.edu> drw@nevanlinna.mit.edu
   (Dale R. Worley) writes:
>If one searches backwards (using a negative argument to S), is the
>point left at the beginning of the string (so that -Sstring$ when
>executed repeatedly finds successive occurrences backwards), or is the
>point left at the end of the string (as when S searches forward)?
>
>Dale
>
>Dale Worley		Dept. of Math., MIT		drw@math.mit.edu
>--
>Measure with a micrometer.  Mark with chalk.  Cut with an axe.

According to my digital TECO pocket guide (C)1978
"Searches:
Searches that fail leave the pointer at position 0
Successful searches leave pointer after text found

nStext$:  Searches for the nth occurrence of the specified
text (following the pointer), but does not go beyond the end of the
current text buffer.  

-nStext$  Same as nStext$ but the search proceeds backwards  
"

As that is not very helpful... I remember using the -nStext$ command and,
as I remember it, the pointer is put at the beginning of the search string.
Certainly successive -S commands would find previous versions of the
string.

-Roe
Roe D McBurnett III Bellcore (908)699-2273 rdm2@chaucer.cc.bellcore.com
#insert <std.disclamer>
Re: Religious question -- negative arguments for S
#3
Author: Paul Koning
Date: Tue, 08 Sep 1992 21:10
24 lines
1586 bytes
In article <DRW.92Sep8135859@nevanlinna.mit.edu>, drw@nevanlinna.mit.edu (Dale R. Worley) writes:
|>If one searches backwards (using a negative argument to S), is the
|>point left at the beginning of the string (so that -Sstring$ when
|>executed repeatedly finds successive occurrences backwards), or is the
|>point left at the end of the string (as when S searches forward)?
|>
|>Dale
|>
|>Dale Worley		Dept. of Math., MIT		drw@math.mit.edu
|>--
|>Measure with a micrometer.  Mark with chalk.  Cut with an axe.

That's not a religious question..  The answer is "the latter".
The only difference between forward and backward search is the direction
"dot" is moved in between successive compares of the target string
against the buffer contents.  Note, for example, that -S will find the
string that begins at "dot" (since that is the first string compared).
Similarly, -::S and ::S are equivalent.

Now if you want to rephrase that as a religious question, you might ask
"how SHOULD it work".   :-)

	paul
Re: Religious question -- negative arguments for S
#4
Author: Tarl Neustaedter
Date: Tue, 08 Sep 1992 23:18
13 lines
1085 bytes
In article <1992Sep8.205137.1229@porthos.cc.bellcore.com>, rdm2@donner.uucp (24337-mcburnett) writes:
> According to my digital TECO pocket guide (C)1978
> "Searches:
> Searches that fail leave the pointer at position 0
> Successful searches leave pointer after text found

It varied by version. The primitive ones did exactly that - the more
advanced (human engineered :-) versions put the pointer where you would
want it.
-- 
         Tarl Neustaedter	tarl@sw.stratus.com
         Marlboro, Mass.	Stratus Computer
Disclaimer: My employer is not responsible for my opinions.
Re: Religious question -- negative arguments for S
#5
Author: Mark C. Henderson
Date: Wed, 09 Sep 1992 00:46
15 lines
878 bytes
In article <DRW.92Sep8135859@nevanlinna.mit.edu> drw@nevanlinna.mit.edu (Dale R. Worley) writes:
>If one searches backwards (using a negative argument to S), is the
>point left at the beginning of the string (so that -Sstring$ when
>executed repeatedly finds successive occurrences backwards), or is the
>point left at the end of the string (as when S searches forward)?
>
>Dale
>
>Dale Worley		Dept. of Math., MIT		drw@math.mit.edu
>--
>Measure with a micrometer.  Mark with chalk.  Cut with an axe.

At the end of the string.

Mark
Re: Religious question -- negative arguments for S
#6
Author: David Morrison
Date: Wed, 09 Sep 1992 02:40
13 lines
1275 bytes
In article <DRW.92Sep8135859@nevanlinna.mit.edu>, drw@nevanlinna.mit.edu (Dale R. Worley) writes:
> If one searches backwards (using a negative argument to S), is the
> point left at the beginning of the string (so that -Sstring$ when
> executed repeatedly finds successive occurrences backwards), or is the
> point left at the end of the string (as when S searches forward)?

In the absence of any modifying characteristics, the pointer is left at the 
end of the string always.  A subsequent -s...$ will find the same string 
again.  You have to do -2s$ or ^S-1r-s$ to find the next previous occurrence.
-- 
David Morrison, Manager, Networks and Comms, Uni of Newcastle, Australia
sysnet@cc.newcastle.edu.au or (VAX PSI) psi%0505249626002::sysnet
Phone: +61 49 215397	Fax: +61 49 216910
Re: Religious question -- negative arguments for S
#7
Author: Marcy Thompson
Date: Wed, 09 Sep 1992 04:23
25 lines
1454 bytes
In article <DRW.92Sep8135859@nevanlinna.mit.edu> Dale R. Worley writes:

>If one searches backwards (using a negative argument to S), is the
>point left at the beginning of the string (so that -Sstring$ when
>executed repeatedly finds successive occurrences backwards), or is the
>point left at the end of the string (as when S searches forward)?

Quoting the PDP-11 TECO User's Guide, February 1980, referring
to TECO-11 V36:

  -nStext$   Identical to "nStext$" except that the search proceeds
             in the reverse direction. If the string is not found, the
             pointer is positioned immediately before the first character
             in the buffer and an error message is printed. If the pointer
             is positioned at the beginning of or within an occurrence of
             the desired string, that occurrence is considered to be the 
             first one found. Upon successful completion, the pointer is
             positioned after the last character in the string found.

I think the last sentence says it all.

Regards,

Marcy
 
Re: Religious question -- negative arguments for S
#8
Author: Bob Pasker
Date: Wed, 09 Sep 1992 05:33
8 lines
570 bytes
forw what it's worth: i'm just glad to see some postings here!

(and hi kpt, if you're there)

-- 
--- bob pasker
---- rbp@netcom.com
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads