Local Printing with GoToMyPc and a 2nd question on Inputting Dates
Richard Kreiss
rkreiss at verizon.net
Tue Aug 24 13:17:32 PDT 2010
> -----Original Message-----
> From: filepro-list-bounces+rkreiss=verizon.net at lists.celestial.com [mailto:filepro-list-
> bounces+rkreiss=verizon.net at lists.celestial.com] On Behalf Of Kenneth Brody
> Sent: Tuesday, August 24, 2010 3:41 PM
> To: George Simon
> Cc: filepro-list at lists.celestial.com
> Subject: Re: Local Printing with GoToMyPc and a 2nd question on Inputing Dates
>
> On 8/24/2010 3:11 PM, George Simon wrote:
> > Perhaps this will suffice.
> >
> > Get the location of the date field on the screen, let's say it is 4,7
> > Then add this code to @wef
> >
> > @wef1 ◄ If: 1 ne ""
> > Then: end
> > 4 ------- - - - - - -
> > ◄ If:
> > Then: yr(4,.0)=mid(@t4,"7","4")
> > 5 ------- - - - - - -
> > ◄ If:
> > Then: show("4","11") yr
> > 6 ------- - - - - - -
> > ◄ If:
> > Then: end
>
> Wouldn't you be better off with:
>
> 1 = " " & yr
>
> instead of your SHOW?
>
> And, if you're going that far, why not just pre-fill the field with today's
> date in its entirety?
>
> [...]
> >> Also, I have a field mdyy/ in a standing file. During input
> >> I'd like to enter just the mmdd and have fp fill in the
> >> current year. Currently I use an INPUT command over the
> >> actual field, and have processing determine the current year
> >> and add the yyyy to the input variable, then make the real
> >> field equal to the variable. Is there a simpler way to do this?
> [...]
>
> --
> Kenneth Brody
Another solution might be 2 dummy fields one 5 character and the other 4. You could create and edit to automatically fill in a leading zero on put in a slash in the third position.
Then combine the 2 fields into a date field. It the values are wrong, you'll get an error message. Or, mid(ff,1,2) and test if the value is greater than 12 or less than 1. The next test would be the day value and the range of values would depend on the month as well as the year entered. Need to see if this is a leap year and 02/29/yr is a viable date.
Seems easier to let filePro carry the load in testing for a viable date.
Another thought which would take a bit more programming, 2 arrays and a year field.
Dim month(12);dim days(31);yr(4,.0)
Get the year first unless the date to enter is always in the current year. Now this may present a problem in December as one nears the new year and the date could fall in January.
Yr can be set to default to the current year if mothering is entered.
Pre fill the month array with the numeric month value. If the day array based on if the year is a leap year and the number of days in the month. If the month is 02, then test for a leap year.
Once the month and day have been selected, concatenate the year.
Another solution is to purchase Laura Brody's calendar program and pop up a calendar when entering the date field. Select the date, no fuss. You can put up between 1 and 3 months at a time.
Richard Kreiss
GCC Consulting
rkreiss at gccconsulting.net
More information about the Filepro-list
mailing list