Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
compare 2 strings
#1
i created a ICsv object and have a multi line string from a clipboard that i want to remove duplicates. When i compare the strongs by len they match, vusally they match, bring in Excel they math BUT dont match in my QM macro... also if i copy the string into a seperate macro, they still dont match.... If i copy the 1st line and duplicate it, it still wont match!!

is there an issue with the ICsv & strings or getting string the clipboard?  even if you copy the text from my posting it still wont match... what am i doing wrong??
Code:
Copy      Help
str a= "The ITypeLib interface provides access to information about the type description in a type library."
str b= "The ITypeLib interface provides access to information about the type description in a type library."
str c= "The ITypeLib interface provides access to information about the type description in a type library."

out a=b
out a=a
#2
out a=b is not the way to compare strings
  best way is to use function
Code:
Copy      Help
StrCompare
 
Code:
Copy      Help
out StrCompare(a b)

for more info read here 
https://www.quickmacros.com/help/User/ID...StrCompare
or search the forum for StrCompare
#3
To compare str strings can be used a=b. out should be 1 if equal, else 0. But not lpstr strings.
#4
thanks. please copy my code above into your QM and try to do the string compare. either way it outputs 0, menaing none are equal even though they are the same

i am using the string from clipboard and placing it into a grid.... it constantly returns 0.  please read my first post
#5
Code:
Copy      Help
str a= "The ITypeLib interface provides access to information about the type description in a type library."
str b= "The ITypeLib interface provides access to information about the type description in a type library."
str c= "The ITypeLib interface provides access to information about the type description in a type library."

out a=b
out a=a
out StrCompare(a b)

output:
1
1
0


Forum Jump:


Users browsing this thread: 1 Guest(s)