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.
Default value when reading field
-
AndreyZ
Re: Default value when reading field
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.
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
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
It is in the mail
-
AndreyZ
Re: Default value when reading field
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
OK - I will have to investigate a bit to figure out how this can be done