Page 2 of 2

Re: How to Pass Pre-defined field values in EDIT

Posted: Mon Mar 29, 2010 10:12 am
by swapan
Czarny_Pijar wrote:If I can suggest for the contributors the way for solving this problem...

Suppose we've to deal with with my_base.dbf database. In my opinion the easiest way for both programmers/users is:

1) check the existence of defaults/my_base.dbf
2) if exists, read 1st record to get the default values.
I wishes to pass the default values programtically like the way we are able to pass the "field captions" through coding in EDIT. One more parameter through which we can pass such values, and if not passed then it should be handled in the same way as it is handled now by Edit/ Edit extended.

Re: How to Pass Pre-defined field values in EDIT

Posted: Mon Mar 29, 2010 10:27 am
by Czarny_Pijar
swapan wrote:I wishes to pass the default values programtically like the way we are able to pass the "field captions" through coding in EDIT.
IMHO this is the hard way, because changing the default value will force you to the recompile/reinstall process, instead of change only the value in the database.

Re: How to Pass Pre-defined field values in EDIT

Posted: Mon Mar 29, 2010 11:49 am
by gfilatov
swapan wrote: I wishes to pass the default values programtically like the way we are able to pass the "field captions" through coding in EDIT. One more parameter through which we can pass such values, and if not passed then it should be handled in the same way as it is handled now by Edit/ Edit extended.
Hello,

I've attached an updated sources and sample of command EDIT with the following changes:
- added new parameter INIT <aInitArray> to i_edit.ch
- added support for init value at adding record to h_edit.prg
- updated sample with using a new parameter (look at screenshot below)

How to usage:
- just copy these three files to corresponding folders per folder's structure of attached archive
- recompile library libedit.a by command source\edit\MakeLib.bat
- start sample by command build demo

I hope that helps :idea:

Re: How to Pass Pre-defined field values in EDIT

Posted: Mon Mar 29, 2010 12:12 pm
by Czarny_Pijar
Many thanks - dziękuję - Велика подяка за зусиль до цієї справи. ;)

Though somewhat pity the things are going this way... One objection I've posted befere, yet another:
Suppose you've created the application for many of your clients, and they have the different defaults. Now you should keep the different copy of the program for every of your client... Headache guaranteed. :?
There's the bright side too: you have to keep contact with your clients and bill them periodically :twisted:

Re: How to Pass Pre-defined field values in EDIT

Posted: Mon Jul 12, 2010 12:35 am
by cdsaenz
If you want to pass some default hardcoded values I think what you should use is the VALUE property of textboxes for example.

But as Czarny_Pijar indicated, it is not very tidy. I would try something like reading the values on form startup, from an INI File.