469,282 Members | 1,732 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

Strange wxChoice.FindString behavior

Hello everybody,

I had this problem using the FindString funcion of a wxChoice object
on wxPython:
* I have Windows 98
* I read a text file edited on a Japanese computer, but only uses
'english' characters.
* From the file I loaded some strings in some wxChoice object.
* Later when I wanted to find an string using 'FindString' I never
got a match, even when I say my string, I printed both strings and
look same!, same lenght, same internal coding, so the only way to find
my string is by using:

## my own Find string function, choice is a wxChoice object
def FindString(choice, thestring):
for i in range(choice.GetCount()):
txta = choiceDevice.GetString(i)
if len(txta) != len(thestring):
continue
if map(ord, txta) != map(ord, thestring):
continue
return i #we have a match
return -1 #not found

So this is my best solution to something I think should not happen.
Any comments?.

Rene
Jul 18 '05 #1
0 969

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

17 posts views Thread by amber | last post: by
1 post views Thread by Marcin Floryan | last post: by
2 posts views Thread by Jorge | last post: by
4 posts views Thread by J L | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.