Re: Compare numeric strings with leading zeros

2015-09-03 Thread Thierry Douez
> What’s wrong with simply: > > function stringsAreEqual p1, p2 >return (p1 & "z") = (p2 & "z") > end stringsAreEqual > > As Terry Judd and Mark Wieder suggested yesterday? Mmm, nothing. Different ways, different experiences ... :) Regards, Thierry _

Re: Compare numeric strings with leading zeros

2015-09-03 Thread Jerry Jensen
hh, > > Well, nothing very dangerous here :) > >>> if matchText( userTyping, myVeryStrongPassword) then ... > > This was a direct answer to this thread: > > "compare numeric strings with leading zeros" ! > > >> I would caution against

Re: Compare numeric strings with leading zeros

2015-09-03 Thread Thierry Douez
> >> Ok, now I'm waiting for what I've missed... > > Your revised example was missing a "^" at the beginning and a "$" at the end. > >put "^\Q^5$\E$" into myVeryStrongPassword > > Lyn > Good catch :) Regards, Thierry ___ use-livecode mailing list

Re: Compare numeric strings with leading zeros

2015-09-03 Thread Lyn Teyla
Thierry Douez wrote: > put "\Q^5$\E" into myVeryStrongPassword > if matchText( userTyping, myVeryStrongPassword ) then ... Here is indeed an example of the danger involved with the use of regular expressions. It can be easy to miss things at times, which is why I simply cautioned against u

Re: Compare numeric strings with leading zeros

2015-09-03 Thread Thierry Douez
Hi, > Ah, Well, nothing very dangerous here :) >> if matchText( userTyping, myVeryStrongPassword) then ... This was a direct answer to this thread: "compare numeric strings with leading zeros" ! > I would caution against using matchText for this

RE: Compare numeric strings with leading zeros

2015-09-03 Thread Ralph DiMola
Services rdim...@evergreeninfo.net -Original Message- From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of Lyn Teyla Sent: Thursday, September 03, 2015 4:35 PM To: How to use LiveCode Subject: Re: Compare numeric strings with leading zeros Thierry Douez wrote

Re: Compare numeric strings with leading zeros

2015-09-03 Thread Lyn Teyla
Thierry Douez wrote: > on mouseUp > local userTyping = 5 > local myVeryStrongPassword = "005" > if matchText( userTyping, myVeryStrongPassword) then > answer "Great!" > else > answer "Too bad :( try again.." > put "005" into userTyping > if matchText( userTyping, myVery

RE: Compare numeric strings with leading zeros

2015-09-03 Thread Ralph DiMola
-Original Message- From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of J. Landman Gay Sent: Thursday, September 03, 2015 3:20 PM To: How to use LiveCode Subject: Re: Compare numeric strings with leading zeros On 9/3/2015 2:28 AM, Thierry Douez wrote: > You

Re: Compare numeric strings with leading zeros

2015-09-03 Thread J. Landman Gay
On 9/3/2015 2:28 AM, Thierry Douez wrote: You can use build-in functions which manipulate strings. Please, try this one: on mouseUp local userTyping = 5 local myVeryStrongPassword = "005" if matchText( userTyping, myVeryStrongPassword) then answer "Great!" else ans

RE: Compare numeric strings with leading zeros

2015-09-03 Thread FlexibleLearning.com
Or even just EMPTY converts to a string... return num1 & ""=num2 & "" Hugh Senior FLCo > From: "Ralph DiMola" > > Feeling pretty clueless here but... > > I need ("5" = "005") to be false. This is for password validation. > > Ralph DiMola ___

RE: Compare numeric strings with leading zeros

2015-09-03 Thread FlexibleLearning.com
I would simply force a string comparison... return num1 & space=num2 & space Hugh Senior FLCo > From: "Ralph DiMola" > > Feeling pretty clueless here but... > > I need ("5" = "005") to be false. This is for password validation. > > Ralph DiMola _

Re: Compare numeric strings with leading zeros

2015-09-03 Thread Thierry Douez
You can use build-in functions which manipulate strings. Please, try this one: on mouseUp local userTyping = 5 local myVeryStrongPassword = "005" if matchText( userTyping, myVeryStrongPassword) then answer "Great!" else answer "Too bad :( try again.." put "005" into

Re: Compare numeric strings with leading zeros

2015-09-02 Thread J. Landman Gay
On 9/2/2015 11:49 PM, Ralph DiMola wrote: I would have thought 5=005 would evaluate as true and "5"="005" would evaluate as false. LC will read "5" as a number because it will interpret what is inside the quotes rather than see the whole thing as a string. You have to add the quotes to the st

Re: Compare numeric strings with leading zeros

2015-09-02 Thread Mark Wieder
On 09/02/2015 09:49 PM, Ralph DiMola wrote: I would have thought 5=005 would evaluate as true and "5"="005" would evaluate as false. In any other language that would work. Unfortunately in LC everything's stringish. -- Mark Wieder ahsoftw...@gmail.com __

Re: Compare numeric strings with leading zeros

2015-09-02 Thread Ralph DiMola
an Gay" Date:09/03/2015 00:42 (GMT-05:00) To: How to use LiveCode Subject: Re: Compare numeric strings with leading zeros On 9/2/2015 11:16 PM, Ralph DiMola wrote: > I was hoping that there was a way to coerce "005" into a string of 3 chars. Adding specific quotes aroun

Re: Compare numeric strings with leading zeros

2015-09-02 Thread J. Landman Gay
On 9/2/2015 11:16 PM, Ralph DiMola wrote: I was hoping that there was a way to coerce "005" into a string of 3 chars. Adding specific quotes around it does that. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com

Re: Compare numeric strings with leading zeros

2015-09-02 Thread Ralph DiMola
lph DiMola IT Director Evergreen Information Services rdim...@evergreeninfo.net Office: 518-636-3998 ex:11 Cell: 518-636-3998 Original message From: Colin Holgate Date:09/02/2015 23:49 (GMT-05:00) To: How to use LiveCode Subject: Re: Compare numeric strings with leading

Re: Compare numeric strings with leading zeros

2015-09-02 Thread dunbarx
mentioned above, all your needs. But it will work with similar numbers that only differ by the number of leading zeros. Craig Newman -Original Message- From: Ralph DiMola To: 'How to use LiveCode' Sent: Wed, Sep 2, 2015 10:32 pm Subject: Compare numeric strings with lea

Re: Compare numeric strings with leading zeros

2015-09-02 Thread Colin Holgate
Is there ever a case where this would return true?: put "005" into a put "5" into b answer a = b and length(a) = length(b) ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subsc

Re: Compare numeric strings with leading zeros

2015-09-02 Thread J. Landman Gay
Ralph DiMola wrote: Feeling pretty clueless here but... I need ("5" = "005") to be false. This is for password validation. I could swear this used to work using some tricky combination of < and >. Anyway, the trick is to make them compare as strings. Forcing quotation marks seems to work:

Re: Compare numeric strings with leading zeros

2015-09-02 Thread Mark Wieder
On 09/02/2015 07:40 PM, Terry Judd wrote: Can you add a non-numeric character in front of each before you do the comparison? +like. I usually add an 'x' prefix. -- Mark Wieder ahsoftw...@gmail.com ___ use-livecode mailing list use-livecode@lists.r

Re: Compare numeric strings with leading zeros

2015-09-02 Thread dunbarx
mentioned above, all your needs. But it will work with similar numbers that only differ by the number of leading zeros. Craig Newman -Original Message- From: Ralph DiMola To: 'How to use LiveCode' Sent: Wed, Sep 2, 2015 10:32 pm Subject: Compare numeric strings with lea

Re: Compare numeric strings with leading zeros

2015-09-02 Thread Peter Bogdanoff
How about comparing as an array? >From the LC Dictionary definition for “is": When comparing arrays, the = operator first checks if the number of elements in each array is the same, if not the two arrays are different. If the arrays have the same number of elements, they are equal if each eleme

Re: Compare numeric strings with leading zeros

2015-09-02 Thread Mike Bonner
Could to a slightly more complex check.. First check if the length is the same, then do the comparison. (could even check length, then do a char by char comparison) On Wed, Sep 2, 2015 at 8:40 PM, Terry Judd wrote: > Can you add a non-numeric character in front of each before you do the > compa

Re: Compare numeric strings with leading zeros

2015-09-02 Thread Terry Judd
Can you add a non-numeric character in front of each before you do the comparison? Terry... On 3/09/2015 12:33 pm, "use-livecode on behalf of Ralph DiMola" wrote: >Feeling pretty clueless here but... > >I need ("5" = "005") to be false. This is for password validation. > >Ralph DiMola >IT Direc

Re: Compare numeric strings with leading zeros

2015-09-02 Thread Scott Rossi
wholeMatches? Regards, Scott Rossi Creative Director Tactile Media UX/UI Design > On Sep 2, 2015, at 7:33 PM, Ralph DiMola wrote: > > Feeling pretty clueless here but... > > I need ("5" = "005") to be false. This is for password validation. > > Ralph DiMola > IT Director > Evergreen Informat

Compare numeric strings with leading zeros

2015-09-02 Thread Ralph DiMola
Feeling pretty clueless here but... I need ("5" = "005") to be false. This is for password validation. Ralph DiMola IT Director Evergreen Information Services rdim...@evergreeninfo.net ___ use-livecode mailing list use-livecode@lists.runrev.com Pleas