Problem with Instr()

BlitzMax Forums/BlitzMax Beginners Area/Problem with Instr()

daqx(Posted 2005) [#1]
Hi,

I have to search for the " sign.

I used Instr like this:

Instr(a,""")

I was sure I'd become an error, but I don't know how to handle this.

Thanks.


FlameDuck(Posted 2005) [#2]
Instr (a,Chr(34))



daqx(Posted 2005) [#3]
Thank you!

badger


Perturbatio(Posted 2005) [#4]
or use ~q


FlameDuck(Posted 2005) [#5]
or use ~q
Speaking of which, what on earth is wrong with using traditional \" escape sequences?!?

I mean is there actually a rationale as to why BRL went out of their way to make it different than every other programming language in the world ever?

*sigh* I'll be using Chr(). It's oldskool!


marksibly(Posted 2005) [#6]
Thanks to MS, '\' is actually a pretty common character in strings, and I didn't want to deal with the inevitable 'why doesn't "c:\myfile" work' complaints!

Also, I personally don't like the \" sequence - it's too hard to spot against the 'real' delimiter, eg: "\"\"" vs "~q~q", I prefer the second.


Perturbatio(Posted 2005) [#7]
I like the BMax escape sequences as well actually, for exactly the same reason as Mark posted. So thank you Mark :)