Re: is a date

2017-10-20 Thread Bob Sneidar via use-livecode
> put char 3 of the short system dateformat into tDelimiter > > else > > put char 3 of the short dateformat into tDelimiter > > end if > > if tDelimiter is in pDate and pDate is a date then return true > > return false > > end IsDate > > trevix

Re: is a date

2017-10-20 Thread trevix via use-livecode
How about this: function IsDate pDate, pSysDate if pSysDate then put char 3 of the short system dateformat into tDelimiter else put char 3 of the short dateformat into tDelimiter end if if tDelimiter is in pDate and pDate is a date then return true return false end IsDate trevix

Re: is a date

2017-10-16 Thread Mike Kerner via use-livecode
at 10:14 , Andrew Bell via use-livecode < >> use-livecode@lists.runrev.com> wrote: >> > >> >> From: Bob Sneidar >> >> To: How to use LiveCode >> >> Subject: Re: is a date >> >> Message-ID: <6eb529a3-5d21-4186-bd90-641746e96...@iot

Re: is a date

2017-10-16 Thread Mike Kerner via use-livecode
ng sql date. > > Bob S > > > > On Oct 16, 2017, at 10:14 , Andrew Bell via use-livecode < > use-livecode@lists.runrev.com> wrote: > > > >> From: Bob Sneidar > >> To: How to use LiveCode > >> Subject: Re: is a date > >> Message-

Re: is a date

2017-10-16 Thread Bob Sneidar via use-livecode
t; To: How to use LiveCode >> Subject: Re: is a date >> Message-ID: <6eb529a3-5d21-4186-bd90-641746e96...@iotecdigital.com> >> Content-Type: text/plain; charset="us-ascii" >> >> This probably matters to no one at all, but SQL does not store dates with

Re: is a date

2017-10-16 Thread Andrew Bell via use-livecode
From: Bob Sneidar To: How to use LiveCode Subject: Re: is a date Message-ID: <6eb529a3-5d21-4186-bd90-641746e96...@iotecdigital.com> Content-Type: text/plain; charset="us-ascii" This probably matters to no one at all, but SQL does not store dates with forward slashes. SQL

Re: is a date

2017-10-16 Thread Roger Eller via use-livecode
Again, I would prefer a simple one-liner built-in function. What if instead of "is a date" returning true or false, it instead returned some expected outputs like "short, long, internet, seconds, ect.". Something short and sweet. ~Roger On Mon, Oct 16, 2017 at 12:56 PM,

Re: is a date

2017-10-16 Thread Bob Sneidar via use-livecode
This probably matters to no one at all, but SQL does not store dates with forward slashes. SQL datetime formats look like this: -dd-mm hh:mm:ss Bob S ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe,

Re: is a date

2017-10-16 Thread Bob Sneidar via use-livecode
return theDate end formatDate Bob S > On Oct 16, 2017, at 09:47 , Bob Sneidar wrote: > > Old trick I learned in Foxpro. Convert something then convert it back and see > if it is identical. > > put 20 into tDate > put tDate into tOldDate > convert tDate to da

Re: is a date

2017-10-16 Thread Bob Sneidar via use-livecode
Old trick I learned in Foxpro. Convert something then convert it back and see if it is identical. put 20 into tDate put tDate into tOldDate convert tDate to dateitems convert tDate to short date return ((tDate is a date) and (tDate is tOldDate)) Bob S

Re: is a date

2017-10-16 Thread Roger Eller via use-livecode
Exactly! I was elated to find the built-in "is a date" check, because I really wanted to NOT have to roll my own. I was THRILLED that our lovely English-like syntax was working FOR me. And then an integer was accepted as a legit date. I didn't like that at all. Why can't t

Re: is a date

2017-10-16 Thread hh via use-livecode
> JLG wrote ... > The one exception may be that any _integer_ is considered a date. > To get around that we could just check that there are 3 items > delimited by slashes before testing for "is a date". I write "is a /real/ date" into my notes whenever a meeting i

AW: is a date

2017-10-16 Thread Tiemo Hollmann TB via use-livecode
-Ursprüngliche Nachricht- Von: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] Im Auftrag von J. Landman Gay via use-livecode Gesendet: Sonntag, 15. Oktober 2017 22:38 An: How to use LiveCode Cc: J. Landman Gay Betreff: Re: is a date >> To get around that we coul

Re: is a date

2017-10-15 Thread Jim Lambert via use-livecode
Roger wrote: > > put "11/20/2017" is a date > returns true > ---- > put "10" is a date > returns true > > put "raccoon" is a date > returns false > > > WHY is "10" seen as a date? Because it is legitimately a

Re: is a date

2017-10-15 Thread Mike Kerner via use-livecode
-livecode < > use-livecode@lists.runrev.com> wrote: > > Or x is a date and x is not an integer ? >> >> -- Alex. >> >> >> On 15/10/2017 21:37, J. Landman Gay via use-livecode wrote: >> >>> You know, after all the dicussion here, I

Re: is a date

2017-10-15 Thread J. Landman Gay via use-livecode
Yeah. Unless you require a year or something, that'd work. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com On October 15, 2017 4:23:20 PM Alex Tweedly via use-livecode wrote: Or   x is a date and x i

Re: is a date

2017-10-15 Thread Alex Tweedly via use-livecode
Or   x is a date and x is not an integer  ? -- Alex. On 15/10/2017 21:37, J. Landman Gay via use-livecode wrote: You know, after all the dicussion here, I'm not sure any of the options are better than "x is a date". The one exception may be that any integer is considered

Re: is a date

2017-10-15 Thread J. Landman Gay via use-livecode
You know, after all the dicussion here, I'm not sure any of the options are better than "x is a date". The one exception may be that any integer is considered a date. To get around that we could just check that there are 3 items delimited by slashes before testing

Re: is a date

2017-10-15 Thread Yves COPPE via use-livecode
n 10/15/17 5:10 AM, Yves COPPE via use-livecode wrote: >>> I hope this works for any date format >> ... >>> >>> if >>> matchtext(textToSearch,"(\d{1,2})/(\d{1,2})/(\d{2,4})",theDay,TheMonth,TheYear) >>> is true then >> Yes, it see

Re: is a date

2017-10-15 Thread J. Landman Gay via use-livecode
ot;,theDay,TheMonth,TheYear) is true then Yes, it seems to work with any numeric date now. It *does* think 99/99/00 is a date, though. Ah. I didn't test that. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hy

Re: is a date

2017-10-15 Thread Mark Wieder via use-livecode
k with any numeric date now. It *does* think 99/99/00 is a date, though. -- Mark Wieder ahsoftw...@gmail.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription p

Re: is a date

2017-10-15 Thread J. Landman Gay via use-livecode
On 10/15/17 5:10 AM, Yves COPPE via use-livecode wrote: I hope this works for any date format ... if matchtext(textToSearch,"(\d{1,2})/(\d{1,2})/(\d{2,4})",theDay,TheMonth,TheYear) is true then Yes, it seems to work with any numeric date now. I also like Ken Ray's solution which lets the

Re: is a date

2017-10-15 Thread Yves COPPE via use-livecode
Hi, I hope this works for any date format on mouseUp ask "Give a date" if it is empty then exit to top answer IsDate(it) end mouseUp function IsDate textToSearch local theDay, TheMonth, TheYear put empty into tresult if matchtext(textToSearch,"(\d{1,2})/(\d{1,2})/(\d{2,4})",theDay,TheM

Re: is a date

2017-10-14 Thread Michael Doub via use-livecode
What about this from the Master Library from Ken Ray? function isDate pWhat    /* isDate Date    Syntax:    isDate (pWhat)    Examples:    isDate("10/10/2001")    Description:    Determines if the container passed to it in contains a valid date.    Returns true or false.    Source:    Ken Ra

Re: is a date

2017-10-14 Thread J. Landman Gay via use-livecode
On 10/14/17 2:14 PM, Yves COPPE via use-livecode wrote: Try this function CheckDate pDateToCheck return matchText(pDateToCheck,"([1-9]|[12][0-9]|3[01])/(0[1-9]|1[0-2])/([0-9][0-9][0-9][0-9])") end CheckDate Promising, but fails with dates like "1/1/19". -- Jacqueline Landman Gay |

Re: is a date

2017-10-14 Thread Yves COPPE via use-livecode
;s what I suspected. So to build a slightly better trap, I am doing > this: > > if tDate is a date and length(tDate) > 5 and tDate contains "/" then > put "true" > else > put "false" > end if > > I am sure there is probably a standard

Re: is a date

2017-10-14 Thread Roger Eller via use-livecode
That's what I suspected. So to build a slightly better trap, I am doing this: if tDate is a date and length(tDate) > 5 and tDate contains "/" then put "true" else put "false" end if I am sure there is probably a standard way to catch all possibl

Re: is a date

2017-10-14 Thread Klaus major-k via use-livecode
Hi Roger, > Am 14.10.2017 um 18:30 schrieb Roger Eller via use-livecode > : > > put "11/20/2017" is a date > returns true > > put "10" is a date > returns true > > put "raccoon" is a date > returns false > > &

is a date

2017-10-14 Thread Roger Eller via use-livecode
put "11/20/2017" is a date returns true put "10" is a date returns true ---- put "raccoon" is a date returns false WHY is "10" seen as a date? ~Roger ___ use-livecode mailing list use-livecode@l