Page 1 of 1
Default value when reading field
Posted: Sun 05 Aug 2012 09:44
by oz8hp
Is there any way to have a read operation that fails to return a default value?
If I read a field and for some reason this fails I would like to have the option to return a default value like when readin from an INI file (ReadString(Section, 'Key', 'Default');
I could of course build my own unit for this, but if there was a built in way that was not needed.
Re: Default value when reading field
Posted: Mon 06 Aug 2012 12:59
by AndreyZ
Hello,
Please specify in details the functionality you need. What do you mean by the read operation, fetching data from the server? Please provide some examples of the needed functionality.
Re: Default value when reading field
Posted: Sun 19 Aug 2012 08:48
by oz8hp
I have made a sample unit for my own use and I would be happy to show it to you, but I can't find a way to attach it to a message here in the forum.
Re: Default value when reading field
Posted: Mon 20 Aug 2012 07:20
by AndreyZ
You can send your sample to andreyz*devart*com .
Re: Default value when reading field
Posted: Mon 20 Aug 2012 17:43
by oz8hp
It is in the mail
Re: Default value when reading field
Posted: Tue 21 Aug 2012 09:50
by AndreyZ
I have examined your unit. You can achieve the functionality you want by executing a query (to system tables, etc.) to a server, that returns the default value for the specified field. After this, you can pass the returned value to your read functions.
Re: Default value when reading field
Posted: Tue 21 Aug 2012 18:33
by oz8hp
OK - I will have to investigate a bit to figure out how this can be done