Subject |
Re: Forms Processing Text Box buffer to Data Fields |
From |
Mervyn Bick <invalid@invalid.invalid> |
Date |
Sat, 13 Sep 2014 11:03:52 +0200 |
Newsgroups |
dbase.getting-started |
On Sat, 13 Sep 2014 01:44:08 +0200, Robert Hughes <Hughes@infoconn.com>
wrote:
> Mervyn,
>
> Thank you so much for the response. I am starting to dig in a bit. The
> code examples are starting to make sense. You are very perceptive. I
> think in a procedural context. OPP is foreign to me. I started
> programming in the 1970's. Thanks for the code. One quick question. Is
> there a Date Entry Field formatting event handling section in the Forms
> Processor, ie. Key field kicked to uppercase. In dBase II I think the
> GET WAS formatted with "!!!!!!!" for uppercase.
>
> Thanks, I love dBase.
> Robert Hughes
If the function property of an entryfield object is set to "!" this will
convert all characters to upper case but will allow digits to be input as
well. Setting the function property to "A!" forces characters to
uppercase and rejects digits.
An entryfield object has a "function" and a "picture" property. The two
are normally (but not always) used together. Set the function to "D" and
the picture to match the date format on the computer eg "99/99/9999" for
the American data format. This does, however, have it's problems. I have
the date format set to yyyy/mm/dd and running a program where the picture
doesn't match the set date format will cause the entered date to be
corrupted.
Instead of setting the picture and function properties it is better, in
the constructor code, to set the entryfield's value property to { } (curly
brackets) which is an empty date. This will allow the entry of a date in
the appropriate format. Even this has it's problems though. <g> This
value cannot be set by using the Inspector so it must be done from within
the sourcecode editor. The next time the form is opened in the form
designer the form designer will stream out { / / } or { / / }
depending on the date format set for the computer which takes one back to
square one.
The form designer is VERY fussy about what can be placed in an object's
constructor code and it will change, or even discard, anything it doesn't
like. The way round this problem is not to set the date format (or
anything else the designer may object to) in the constructor code at all
but to rather use the object's onOpen event handler. If, in the
entryfield object's onOpen event handler, the value is set to {} the
entryfield will display the appropriate skeleton for date no matter what
the computer's date format is set to.
In the child_edit.wfm code I posted no formatting is set for the date
entryfield (entryfield4) as the entry field is datalinked to a date field
in the table which automatically sets the appropriate skeleton. On your
computer it may display mm/dd/yyyy or dd/mm/yyyyy and on my computer it
displays yyyy/mm/dd.
Mervyn.
|
|