Checking Memberlist for Item based on Text

SyntaxEditor for Windows Forms Forum

Posted 19 years ago by Boyd - Sr. Software Developer, Patterson Consulting, LLC
Is there an easy way to determine if an item is already in the IntelliPromptMemberList based purely on the text that is displayed?

Here's the background. I'm trying to build a list of members for a VBScript editor. I start with global scope and work in towards the most local scope. For instance... I add global variables, then I add script variables, then I add function variables. The trick is that a function variable of the same name should hide any variables in a wider scope (like a global or script variable). The IntelliPromptMemberListItem that would be added for each of these entries is entirely difference except for the Text property.

The 'Contains' method takes an IntelliPromptMemberListItem object. Since these two objects are different, I wouldn't expect it to find a match based on text alone since icon and description would be different.

Is there an efficient way to check if a member item with the same text already exists? My first thought would be to enumerate each one and do a string comparison on the name to look for a match. My second thought would be to build a hash table of IntelliPromptMemberListItem objects where the Text is the key. When the hash table is complete, I could use the 'AddRange' method to get the values from the hash table into the MemberList.

Just thought I'd bounce this idea off of anyone who might have faced and tackled a similar situation.

Comments (2)

Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
We don't have a built in hash for the text but what you came up with as far as the hashtable sounds like the best thing for you to do.

Actipro Software Support

Posted 19 years ago by Boyd - Sr. Software Developer, Patterson Consulting, LLC
It never hurts to ask. <IMG SRC="smile.gif" border="0"> Thanks for the feedback. I think I'll run the hash table approach.
The latest build of this product (v24.1.0) was released 4 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.