Page 1 of 1

Finding [#13][#10]

PostPosted: Tue Apr 28, 2015 1:17 pm
by dpayer
Why doesn't this code work to find the location of a carriage return/line feed?

Code: Select all
SetVar "[mystring]" "xxxyyyzzz[#13][#10]test"
SearchStr "[mystring]" "[#13][#10]" "[found1310]" ""
alertbox "test" "found 1310 at position [found1310]"


This will always indicate zero in the popup, meaning it doesn't find [#13][#10'] (CRLF) in the string.

David P.

Re: Finding [#13][#10]

PostPosted: Tue Apr 28, 2015 2:44 pm
by HPW
Hello,

Seems you did not use the wizard:

Code: Select all
SetVar "[mystring]" "xxxyyyzzz[#13][#10]test"
SearchStr "[#13][#10]" "[mystring]" "[found1310]" ""
alertbox "test" "found 1310 at position [found1310]"

;-)

Regards

Re: Finding [#13][#10]

PostPosted: Tue Apr 28, 2015 2:49 pm
by Gaev
David P:

Try ...
Code: Select all
SearchStr "[#13][#10]" "[mystring]" "[found1310]" ""

Re: Finding [#13][#10]

PostPosted: Wed Apr 29, 2015 6:29 am
by dpayer
Hahahahahaha.

You are both right. Just when you think you know your syntax and don't need the wizards, you are made humble by the most simple thing.

Thank you.

Re: Finding [#13][#10]

PostPosted: Wed Apr 29, 2015 8:03 am
by Wrangler
Actually, searchstr input is backward as compared to other wizards. I've made this mistake myself several times, forgetting about that. It's Dave, testing us to see if we're on the ball. :)

Re: Finding [#13][#10]

PostPosted: Thu Apr 30, 2015 5:44 am
by Odd
8)