Page 1 of 1

There must be an easier way.....

Posted: Wed 08 Jun 2011 07:08
by oz8hp
For now I use
if not srcHams.DataSet.FieldByName('fldMail').IsNull then
Settings.RegMail := srcHams.DataSet.FieldByName('fldMail').Value
else
Settings.RegMail := '';
to check if a field has a value - this was a quick and dirty way of getting on with the job at the time. But there must be an easier way that I just haven't found in the manual :D

Posted: Wed 08 Jun 2011 07:57
by AndreyZ
Hello,

You can use the following code:

Code: Select all

Settings.RegMail := srcHams.DataSet.FieldByName('fldMail').AsString;
If there is no value in the fldMail field, the AsString property will return an empty string.

Posted: Wed 08 Jun 2011 08:02
by oz8hp
Thanks (as I sad - there must be an easier way :) )