GetFoundText(n) fails after StrFind()

22 views
Skip to first unread message

Carlo Hogeveen

unread,
Sep 20, 2025, 3:23:09 PM (5 days ago) Sep 20
to Semware @ GoogleGroups

It surprised me that GetFoundText(tag_number) returned random content after a successful StrFind() with tags.
See the demo macro below.

Carlo


proc Main()
if StrFind('a{.}c{.}e', 'abcde', 'x')
Warn('Found "', GetFoundText(1), '" and "', GetFoundText(2), '".')
endif
PurgeMacro(CurrMacroFilename())
end Main



S.E. Mitchell

unread,
Sep 20, 2025, 8:33:10 PM (5 days ago) Sep 20
to sem...@googlegroups.com
StrFind() runs in the same context as lFind().
So what you are seeing is the same behavior you would get if you did
an lFind() and then a GetFoundText().
I think I can pretty easily change StrFind() to run in the same
context as a normal Find(), if that seems to make more sense.
Let me know what you think.
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/semware/000001dc2a63%24fa9a7e30%24efcf7a90%24%40ecarlo.nl.

Carlo Hogeveen

unread,
Sep 21, 2025, 3:29:22 AM (4 days ago) Sep 21
to sem...@googlegroups.com

Sammy,

I interpret your argument as that we cannot do a GetFoundText() after StrFind(), because StrFind() works like lFind() instead of Find().
But as the new demo macro below demonstrates, we can also successfully do a GetFoundText() after lFind().

Carlo


proc Main()

NewFile()
InsertText('abcdef')
BegFile()
if lFind('a{.}c{.}e', 'ix')
Warn('lFind() test found "', GetFoundText(1), '" and "', GetFoundText(2), '".')
endif
AbandonFile()

if StrFind('a{.}c{.}e', 'abcde', 'ix')
Warn('StrFind() test found "', GetFoundText(1), '" and "', GetFoundText(2), '".')
endif

PurgeMacro(CurrMacroFilename())
end Main



zhong zhao

unread,
Sep 21, 2025, 10:23:54 PM (4 days ago) Sep 21
to SemWare TSE Pro text editor
With the help of GetFoundText, StrFind is not mentioned.

knud van eeden

unread,
Sep 22, 2025, 5:37:32 AM (3 days ago) Sep 22
to sem...@googlegroups.com
Indeed, completely unknown (read.me, help, ...) that tags {} and GetFoundText() could be used also with StrFind().

with friendly greetings 
Knud van Eeden 



Sent from Yahoo Mail on Samsung Galaxy S24 Ultra / 1 terabyte / artificial intelligence

--

---
You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.

S.E. Mitchell

unread,
Sep 22, 2025, 6:52:21 AM (3 days ago) Sep 22
to sem...@googlegroups.com
My first reply was garbage - sorry about that.
Since strfind() works on a string, I did not think about
GetFoundText() working with the same.
So currently, GetFoundText() is not aware of strfind().
I can take a look and see if it is possible to implement that functionality.
--
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/semware/000301dc2ac9%2470fa09a0%2452ee1ce0%24%40ecarlo.nl.

S.E. Mitchell

unread,
Sep 22, 2025, 8:30:04 PM (3 days ago) Sep 22
to sem...@googlegroups.com
I have fixed this.
I'll add a check to sanity1, but it'll need plenty of testing!
--
Reply all
Reply to author
Forward
0 new messages