Weird string comparison problem...
Mark Schonewille
m.schonewille at economy-x-talk.com
Tue Nov 27 16:42:59 EST 2012
Paul,
Because in the last line you're writing tExpectedSouceName instead of tExpectedSourceName. An "r" is missing.
--
Best regards,
Mark Schonewille
Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553
Use Color Converter to convert CMYK, RGB, RAL, XYZ, H.Lab and other colour spaces. http://www.color-converter.com
We have time for new software development projects. Contact me for a quote.
On 27 nov 2012, at 21:07, Paul Dupuis wrote:
> Using LC 5.0.2, I have a really weird string comparison error occurring.
>
> The following code:
> put length(tActualSourceName),length(tExpectedSourceName)&cr after msg
> repeat with i=1 to the number of characters in tActualSourceName
> if char i of tActualSourceName is not char i of
> tExpectedSourceName then
> put i,char i of tActualSourceName,"<>",char i of
> tExpectedSourceName&cr after msg
> else
> put i,char i of tActualSourceName,"==",char i of
> tExpectedSourceName&cr after msg
> end if
> end repeat
> put (tActualSourceName = tExpectedSouceName) after msg
>
> Produces the following message window output:
> 13,13
> 1,l,==,l
> 2,a,==,a
> 3,t,==,t
> 4,i,==,i
> 5,n,==,n
> 6,t,==,t
> 7,e,==,e
> 8,x,==,x
> 9,t,==,t
> 10,.,==,.
> 11,r,==,r
> 12,t,==,t
> 13,f,==,f
> false
>
> So, if the strings are the same length and every character tests equal,
> then how come the strings do not equal one another??? Anybody have any
> idea???
> And, yes, I did try "is" insread of "=" and "<>" instead of "is not" and
> since the operators should be interchangeable, it made no difference.
More information about the use-livecode
mailing list