> 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
_
What’s wrong with simply:
function stringsAreEqual p1, p2
return (p1 & "z") = (p2 & "z")
end stringsAreEqual
As Terry Judd and Mark Wieder suggested yesterday?
.Jerry
> On Sep 3, 2015, at 8:56 PM, Thierry Douez wrote:
>
> Hi,
>
>> Ah,
>
> Well, nothing very dangerous here :)
>
>
>
>> 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
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
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 purpose,
> because the seco
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
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
-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
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
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
___
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
_
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
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
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
__
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
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
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
Hi.
Not sure what test values fit your needs, but does this help?
function noZeros arg1.arg2
if the length of arg1 <> the length of arg2 and arg1 = arg2 then return
"false" else return "true"
end noZero
This sidesteps several issues, but may not address, as I mentioned above, all
your n
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
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:
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
Hi.
Not sure what test values fit your needs, but does this help?
function noZeros arg1.arg2
if the length of arg1 <> the length of arg2 and arg1 = arg2 then return
"false" else return "true"
end noZero
This sidesteps several issues, but may not address, as I mentioned above, all
your ne
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
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
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
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
26 matches
Mail list logo