doedit

Brian K. White bw.aljex at gmail.com
Tue Jul 16 15:29:24 PDT 2019


<ken>What happened when you tried it?</ken>

If the original supplied date from the 8 char MDY/ is recognized as 
valid by the MDY/ edit (IE, if MDY/ does allow hyphens, which detail I 
don't know off-hand but I'll take your word), then it will write the 
equivalent date into any other built-in date edit format, so for MDY, 
they will simply be stripped, same as slashes. MM*DD*YY will become MMDDYY.

Then, when the 6,MDY value is put back into the 8,MDY/ value, it will 
get slashes not hyphens.

So his example first strips both slashes and hyphens and anything else 
that MDY/ accepts as input, then generates a new MDY/ value, which only 
inserts slashes.

Basically the built-in edits for dates and times are kind of special in 
that they aren't merely strings conforming to a pattern like most edits. 
The date is actually parsed into an internal representation as a date, 
which can then be written back out into any other date format, 
regardless which of the several date formats it was originally supplied 
as. Once a date or time field is read in, it's no longer simply the 
string "12:23:45" internally, it's a time, and that time can then be 
written back out in any other time format.

Because of this, I'm not sure if it's really necessary to strip the 
hyphens and slashes by putting into an intermediate 6 char MDY and back 
out to a new MDY/. But it might be that fp goes out of it's way to 
remember and re-produce hyphens if they were there on input and the 
output is the same kind of edit, even if it will NOT use hyphens when 
generating a new value. So, maybe going to MDY then back to MDY/ is 
needed, maybe not. But it doesn't hurt and maybe it is needed to force 
the conversion. Easy enough to just test it even with a little @key with 
a input_popup and msgbox.

-- 
bkw

On 7/16/19 5:53 PM, Bruce Easton via Filepro-list wrote:
> Richard - please look again at the sample code I supplied.  Look at 
> the assignment and the length and edit of "da".   What happens to the 
> hyphens when filepro automatically converts it to a 6,mdy date field?
>
> Bruce
>
>
> -----   Richard replied with  ----
>
> Bruce,
>
> The field is already a date field. filePro except the hyphen (dash) 
> with the date edit.
>
> I may have to use either xlate() or replace() to fix these field 
> values. I may need to insure that no hyphens are used in date fields 
> even though the edit(from filePro) allow it.
> I may have to write my own date edit to correct this issue but that 
> seems to be a waste of time.  Just be simpler to manually correct the 
> few records that have hyphens.
>
> Thanks for responding.
>
> It looks like version 1 of FP web is not where it should be.
>
> Richard
>
>> -----Original Message-----
>> From: Filepro-list [mailto:filepro-list-
>> bounces+rkreiss=verizon.net at lists.celestial.com] On Behalf Of Bruce 
>> Easton via
>> Filepro-list
>> Sent: Tuesday, July 16, 2019 4:12 PM
>> To:filepro-list at lists.celestial.com
>> Subject: Re: doedit
>>
>> It probably could be done with edits, but why not just use date 
>> fields to make the
>> data uniform:
>>
>> Then: da(6,mdy)=8; 8=da
>>
>> (assuming that field 8 is declared as 8,mdy/)
>>
>>
>>
>> On 7/16/19 2:58 PM, Richard Kreiss via Filepro-list wrote:
>>> In a date field (8,mdy/) a few entries use a - rather than a slash 
>>> i.e. 04-18-18
>> rather then 04/18/18.  As filePro excepts the dash- in the date 
>> field, will doedit
>> change the - to a slash /?
>>> If so, how would one write the program line?  The date field is 
>>> field 8 in the
>> file.  As there are only a few (14) out of 839 records, I could 
>> either write a
>> process to update just those records or add the doedit to a lookup 
>> which uses
>> this field.
>>> Lookup filed is kah(8) which sets dummy field ds. Ds=kah(8).
>>>
>>>
>>> -------------- next part -------------- A non-text attachment was
>>> scrubbed...
>>> Name: winmail.dat
>>> Type: application/ms-tnef
>>> Size: 11891 bytes
>>> Desc: not available
>>> URL:
>>> <http://mailman.celestial.com/pipermail/filepro-list/attachments/20190
>>> 716/fc227612/attachment.bin>
>>> _______________________________________________
>>> Filepro-list mailing list
>>> Filepro-list at lists.celestial.com
>>> Subscribe/Unsubscribe/Subscription Changes
>>> http://mailman.celestial.com/mailman/listinfo/filepro-list
>>>
>>
>> ---
>> This email has been checked for viruses by Avast antivirus software.
>> https://www.avast.com/antivirus
>>
>> _______________________________________________
>> Filepro-list mailing list
>> Filepro-list at lists.celestial.com
>> Subscribe/Unsubscribe/Subscription Changes
>> http://mailman.celestial.com/mailman/listinfo/filepro-list
>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> Subscribe/Unsubscribe/Subscription Changes
> http://mailman.celestial.com/mailman/listinfo/filepro-list



More information about the Filepro-list mailing list