473,651 Members | 2,917 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Strange wxChoice.FindSt ring 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(choi ce, thestring):
for i in range(choice.Ge tCount()):
txta = choiceDevice.Ge tString(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 1071

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4029
by: ' | last post by:
I want to get the selection of several wxChoice boxes. But i do not want to have to catch the events for all the boxes I should be able to access the current selection outside of an event,but i am not seeing how to do this. This is a hack of the wxpython choice demo to demonstrate my question #--------- comment marks are for indention #import wx
17
3110
by: amber | last post by:
Hello. Can someone tell me what I may be doing wrong here? I'm using the code (lboxRP is a listbox): Dim newRPindex As Integer newRPindex = Me.lboxRP.FindString(RP) Me.lboxRP.SetSelected(newRPindex, True) When the last line executes, I get an error message:
1
2767
by: Marcin Floryan | last post by:
Hello! I have recently come across two very nice methods in ListBox control: ..FindString and .FindStringExact it is very usefull for me, and I would like to use it in some other situations. Where could I find an implementation of thiese methods or other similar solutions. I would like to use such methods without ListBox - only with a simple
2
2066
by: Jorge | last post by:
Hello I have a little problem i have a checkedlistbox with several repeated items. The code below only selects the first ocurrence While reader.Read For i = 0 To Me.CheckedListBox1.Items.Count - 1 Me.CheckedListBox1.SetItemChecked (Me.CheckedListBox1.FindString(reader.GetString(0)), True)
4
1194
by: J L | last post by:
I am trying to use the following code to auto fill a combo box (credit and thanks to Code Project and Daryl) Public Sub AutoFillCombo(ByVal theCombo As ComboBox, ByVal theKey As Keys) Dim sTypedText As String Dim iFoundIndex As Integer Dim oFoundItem As Object Dim sFoundText As String
6
2259
by: Joseph Geretz | last post by:
Writing an Outlook AddIn with C#. For the user interface within Outlook I'm adding matching pairs of Toolbar buttons and Menu items. All of the buttons and menu items are wired up to send events to the same method (aka delegate?). I use the Tag property within this method to determine what user action is taking place. Very simple: When adding toolbar button: tbButton.Click += new...
0
8357
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8277
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8803
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8700
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8465
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8581
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6158
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5612
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4144
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.