TSE: StrReplace(): Usage of {} and |

10 views
Skip to first unread message

knud van eeden

unread,
Feb 9, 2026, 7:28:00 PM (10 days ago) Feb 9
to SemWare TSE Pro Text Editor
Hello,

Tested in TSE for Microsoft Windows 4.50.19

PROC Main()
 STRING fileNameS[255] = "25 April 2026"
 //
 fileNameS = StrReplace( "{Apr}|{April}", fileNameS, "4", "iwx" )
 Warn( fileNameS ) // gives still "25 April 2026"
 //
 fileNameS = StrReplace( "{April}", fileNameS, "4", "iwx" )
 Warn( fileNameS ) // gives "25 4 2026"
 //
 fileNameS = StrReplace( "April", fileNameS, "4", "iwx" )
 Warn( fileNameS ) // gives "25 4 2026"
 //
END

1. The first StrReplace() does not take place as it is not found and it returns still April and not 4.

2. Same search using LFind() works as expected and e.g. 'Apr' is found in the line using {Apr}|{April} and "iwx".

3. So can one not use curly brackets and or | out of the box?

Thanks
with friendly greetings
Knud van Eeden



zhong zhao

unread,
Feb 9, 2026, 8:30:27 PM (10 days ago) Feb 9
to SemWare TSE Pro text editor
PROC Main()
 STRING fileNameS[255] = "25 April 2026"
 //
 fileNameS = StrReplace( "{April}|{Apr}", fileNameS, "4", "iwx" )
 Warn( fileNameS ) // gives still "25 4 2026"

 //
 fileNameS = StrReplace( "{April}", fileNameS, "4", "iwx" )
 Warn( fileNameS ) // gives "25 4 2026"
 //
 fileNameS = StrReplace( "April", fileNameS, "4", "iwx" )
 Warn( fileNameS ) // gives "25 4 2026"
 //
END

Knud van Eeden

unread,
Feb 9, 2026, 9:01:12 PM (10 days ago) Feb 9
to sem...@googlegroups.com
Very interesting.

So if you write the shorter name first, it is seen as part of the larger word, so not a word, so no hit.

with friendly greetings
Knud van Eeden
--

---
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/9d87a24f-e44f-4292-b455-45377f3383d9n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages