Last edited by Randy Walker on Thu Aug 28, 2025 5:07 am, edited 1 time in total.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Nothing is faster, more stable, or easier to maintain than code that doesn’t exist.
idle wrote: Wed Aug 27, 2025 5:35 am
maybe just search for #LF$+"word"
not all files will have #CRLF$
tried that and still no joy. I inspected the file using hex editor and definitely see 0d 0a 57 6f 72 64 so the #CRLF$ should be proper.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Nothing is faster, more stable, or easier to maintain than code that doesn’t exist.
Whenever im not sure what kind of new line is used (LF, CR, CRLF...) I replace all LF with CR and then all CRCR repeatedly with CR. Now I can search for CR+string (given that empty lines don't play a role).
I compared a file read and a string.
Both len() and stringbytelength() included the #CRLF$ pairs in the result.
Findstring gives the correct answer including the #CRLF$
idle wrote: Wed Aug 27, 2025 7:17 am
What happens if you Debug the search string
Does FindString need a flag to skip #crlf$
Sorry I'm away from the computer
When I "debug search" I get a line feed followed by the next line beginning with "Word".
0 ;Top line in debug window
;Blank line
Word ;Bottom line
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Nothing is faster, more stable, or easier to maintain than code that doesn’t exist.
TassyJim wrote: Wed Aug 27, 2025 8:08 am
It works for me. PB6.21
Jim
Ok, I guess (like always) I should have mentioned I was using PB6.20
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Nothing is faster, more stable, or easier to maintain than code that doesn’t exist.
Little John wrote: Wed Aug 27, 2025 9:28 am
FindString() treats the characters CR and LF in the same way as most other characters, e.g. ‘a’ or ‘b’.
Ok but, I still get zero when I reduce down to search.s = #CRLF$
(again, I am using PB6.20)
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Nothing is faster, more stable, or easier to maintain than code that doesn’t exist.
TassyJim wrote: Wed Aug 27, 2025 8:08 am
It works for me. PB6.21
Jim
I uninstalled 6.20, installed 6.21 and now seems to be working OK
Thanks Jim
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Nothing is faster, more stable, or easier to maintain than code that doesn’t exist.