Index
2010-06-15 23:51 – Vincent Teachout : I'm being lazy - any already built DTOS() <--> STOD() function for a form?
2010-06-16 08:32 – MB Software Solutions, LLC : Re: I'm being lazy - any already built DTOS() <--> STOD() function for a form?
2010-06-16 09:21 – Vincent Teachout : Re: I'm being lazy - any already built DTOS() <--> STOD() function for a form?
2010-06-16 09:35 – Stephen Russell : Re: I'm being lazy - any already built DTOS() <--> STOD() function for a form?
2010-06-16 10:06 – Vincent Teachout : Re: I'm being lazy - any already built DTOS() <--> STOD() function for a form?
2010-06-16 10:09 – Stephen Russell : Re: I'm being lazy - any already built DTOS() <--> STOD() function for a form?
2010-06-16 10:58 – Fred Taylor : Re: I'm being lazy - any already built DTOS() <--> STOD() function for a form?
2010-06-16 13:03 – Jeff Johnson : Re: I'm being lazy - any already built DTOS() <--> STOD() function for a form?
2010-06-16 13:06 – Eurico Chagas Filho : RE: I'm being lazy - any already built DTOS() <--> STOD() function for a form?
2010-06-16 13:17 – <kamcginnis@gmail.com>: Re: I'm being lazy - any already built DTOS() <--> STOD() function for a form?
Back to top
I'm being lazy - any already built DTOS() <--> STOD() function for a form?

Author: Vincent Teachout

Posted: 2010-06-15 23:51:10   Link

Just trying to avoid re-inventing the wheel.

I have a record with an 8 character length that stores dates in YYYYMMDD

format (Dtos() format) I have no say in the field definition.

In my form, I'd like the user to be able to input the date in a field

with a "D" format code.

I COULD write some init() and save() code to translate, but just

wondering if there is some magic function/field/format/picture that I

don't know about. Has to work both ways - change the incoming text

"YYYYMMDD" string to a date, and save the date back to the field as

dtos(user-date).

Don't knock yourself out - If such a beastie doesn't leap to mind, I'll

just do my work like I'm supposed to.....

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/4C184A2E.3040107@taconic.net

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2010 Vincent Teachout
Back to top
Re: I'm being lazy - any already built DTOS() <--> STOD() function for a form?

Author: MB Software Solutions, LLC

Posted: 2010-06-16 08:32:08   Link

Vincent Teachout wrote:

> Just trying to avoid re-inventing the wheel.

>

> I have a record with an 8 character length that stores dates in YYYYMMDD

> format (Dtos() format) I have no say in the field definition.

>

> In my form, I'd like the user to be able to input the date in a field

> with a "D" format code.

>

> I COULD write some init() and save() code to translate, but just

> wondering if there is some magic function/field/format/picture that I

> don't know about. Has to work both ways - change the incoming text

> "YYYYMMDD" string to a date, and save the date back to the field as

> dtos(user-date).

>

> Don't knock yourself out - If such a beastie doesn't leap to mind, I'll

> just do my work like I'm supposed to.....

Just a thought -- I'd create a container class that has the DATE and

CHARACTER types, showing the one and storing the value in the other as

appropriate.

Make sense?

--

Mike Babcock, MCP

MB Software Solutions, LLC

President, Chief Software Architect

http://mbsoftwaresolutions.com

http://fabmate.com

http://twitter.com/mbabcock16

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/4C18C448.8080302@mbsoftwaresolutions.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2010 MB Software Solutions, LLC
Back to top
Re: I'm being lazy - any already built DTOS() <--> STOD() function for a form?

Author: Vincent Teachout

Posted: 2010-06-16 09:21:29   Link

MB Software Solutions, LLC wrote:

> Just a thought -- I'd create a container class that has the DATE and

> CHARACTER types, showing the one and storing the value in the other as

> appropriate.

Oh yeah, that's probably along the lines of what I'll do. Was just

hoping it was already done. :-)

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/4C18CFD9.2090606@taconic.net

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2010 Vincent Teachout
Back to top
Re: I'm being lazy - any already built DTOS() <--> STOD() function for a form?

Author: Stephen Russell

Posted: 2010-06-16 09:35:14   Link

On Wed, Jun 16, 2010 at 8:21 AM, Vincent Teachout <teachv@taconic.net> wrote:

> MB Software Solutions, LLC wrote:

>

>

>> Just a thought -- I'd create a container class that has the DATE and

>> CHARACTER types, showing the one and storing the value in the other as

>> appropriate.

>

>

> Oh yeah, that's probably along the lines of what I'll do.  Was just

> hoping it was already done.  :-)

--------------

I just had to play that game DTOS and STOD.

Are you going to always get 8 digits in YYYY MM DD format? Or could

they be a real PITA and present

2010111 and you have no idea if it is 1 Nov. or 11 Jan.

--

Stephen Russell

Sr. Production Systems Programmer

CIMSgts

901.246-0159 cell

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/AANLkTikeLnELXCl_lOwKlvNO8G-eUA3c8OiqcWA7yZoO@mail.gmail.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2010 Stephen Russell
Back to top
Re: I'm being lazy - any already built DTOS() <--> STOD() function for a form?

Author: Vincent Teachout

Posted: 2010-06-16 10:06:38   Link

Stephen Russell wrote:

>

> I just had to play that game DTOS and STOD.

>

> Are you going to always get 8 digits in YYYY MM DD format? Or could

> they be a real PITA and present

> 2010111 and you have no idea if it is 1 Nov. or 11 Jan.

Nope - always in YYYMMDD format - it's for the new Govt. CMS files for

Medicare. Very strict layout.

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/4C18DA6E.9090706@taconic.net

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2010 Vincent Teachout
Back to top
Re: I'm being lazy - any already built DTOS() <--> STOD() function for a form?

Author: Stephen Russell

Posted: 2010-06-16 10:09:00   Link

On Wed, Jun 16, 2010 at 9:06 AM, Vincent Teachout <teachv@taconic.net> wrote:

> Stephen Russell wrote:

>>

>> I just had to play that game DTOS and STOD.

>>

>> Are you going to always get 8 digits in YYYY MM DD format?  Or could

>> they be a real PITA and present

>> 2010111  and you have no idea if it is 1 Nov. or 11 Jan.

>

> Nope - always in YYYMMDD format - it's for the new Govt. CMS files for

> Medicare.  Very strict layout.

---------------

Lucky you!

I just did a substring of the value for Year, Month and Day and

reassembled it with "/" marks.

at clients site not here. Sorry

HTH

--

Stephen Russell

Sr. Production Systems Programmer

CIMSgts

901.246-0159 cell

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/AANLkTin23-GgDvv-JlgHFMgplZuyQ3xEqVomKal9j75d@mail.gmail.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2010 Stephen Russell
Back to top
Re: I'm being lazy - any already built DTOS() <--> STOD() function for a form?

Author: Fred Taylor

Posted: 2010-06-16 10:58:56   Link

?EVALUATE("+{^"+TRANSFORM("20100616","@R 9999/99/99")+"}")

Fred

On Wed, Jun 16, 2010 at 7:06 AM, Vincent Teachout <teachv@taconic.net>wrote:

> Stephen Russell wrote:

> >

> > I just had to play that game DTOS and STOD.

> >

> > Are you going to always get 8 digits in YYYY MM DD format? Or could

> > they be a real PITA and present

> > 2010111 and you have no idea if it is 1 Nov. or 11 Jan.

>

> Nope - always in YYYMMDD format - it's for the new Govt. CMS files for

> Medicare. Very strict layout.

>

>

>

[excessive quoting removed by server]

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/AANLkTikuajUYfUUinqCc82z-hefmUk5L81CjB6Li72ag@mail.gmail.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2010 Fred Taylor
Back to top
Re: I'm being lazy - any already built DTOS() <--> STOD() function for a form?

Author: Jeff Johnson

Posted: 2010-06-16 13:03:40   Link

I placed the expression below in a procedure and call it stod(). I've

been doing it since FPD 2.0. It was Fred that gave me the idea. I keep

stod() lower case so I know it is not a VFP command.

Fred Taylor wrote:

> ?EVALUATE("+{^"+TRANSFORM("20100616","@R 9999/99/99")+"}")

>

> Fred

>

>

> On Wed, Jun 16, 2010 at 7:06 AM, Vincent Teachout <teachv@taconic.net>wrote:

>

>

>> Stephen Russell wrote:

>>

>>> I just had to play that game DTOS and STOD.

>>>

>>> Are you going to always get 8 digits in YYYY MM DD format? Or could

>>> they be a real PITA and present

>>> 2010111 and you have no idea if it is 1 Nov. or 11 Jan.

>>>

>> Nope - always in YYYMMDD format - it's for the new Govt. CMS files for

>> Medicare. Very strict layout.

>>

>>

>>

>>

--

Jeff

---------------

Jeff Johnson

jeff@san-dc.com

(623) 582-0323

www.san-dc.com

--- StripMime Report -- processed MIME parts ---

multipart/alternative

text/plain (text body -- kept)

text/html

---

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/4C1903EC.9030709@san-dc.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2010 Jeff Johnson
Back to top
RE: I'm being lazy - any already built DTOS() <--> STOD() function for a form?

Author: Eurico Chagas Filho

Posted: 2010-06-16 13:06:59   Link

Hi

Create a date variable, thisform.dDate.

Create a textbox, InputMask 99/99/99, control source thisform.dDate.

In the WHEN method convert the string to thisform.dDate, reverse the code

below.

In the VALID, cDate = RIGHT(STR(YEAR(thisform.dDate),4),2)+[/]+

PADL(MONTH(thisform.dDate),2,[0])+[/]+PADL(DAY(thisform.dDate),2,[0])

HTH, E.

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/2D89EAE168CC41B8ACA42FB34BEDEB29@NotebookHP

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2010 Eurico Chagas Filho
Back to top
Re: I'm being lazy - any already built DTOS() <--> STOD() function for a form?

Author: <kamcginnis@gmail.com>

Posted: 2010-06-16 13:17:00   Link

Fred's is what we use: (I am pretty sure we got this on this list years ago.)

FUNCTION StoD

LPARAMETERS tcDateInDtoSFormat

SET CENTURY on

RETURN EVALUATE("+{^"+TRANSFORM(tcDateInDtoSFormat,"@R 9999/99/99")+"}")

----- Original Message -----

From: "Fred Taylor" <fbtaylor@gmail.com>

To: "ProFox Email List" <profox@leafe.com>

Sent: Wednesday, June 16, 2010 7:58 AM

Subject: Re: I'm being lazy - any already built DTOS() <--> STOD() function for a form?

?EVALUATE("+{^"+TRANSFORM("20100616","@R 9999/99/99")+"}")

Fred

On Wed, Jun 16, 2010 at 7:06 AM, Vincent Teachout <teachv@taconic.net>wrote:

> Stephen Russell wrote:

> >

> > I just had to play that game DTOS and STOD.

> >

> > Are you going to always get 8 digits in YYYY MM DD format? Or could

> > they be a real PITA and present

> > 2010111 and you have no idea if it is 1 Nov. or 11 Jan.

>

> Nope - always in YYYMMDD format - it's for the new Govt. CMS files for

> Medicare. Very strict layout.

>

>

>

[excessive quoting removed by server]

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/0a8d01cb0d77$bc2d8440$7a00a8c0@w2k3s02

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2010 <kamcginnis@gmail.com>