How to convert an integer value to boolean in delphi

Able Alias picture Able Alias · Oct 5, 2011 · Viewed 14k times · Source

I have a database field value, which is an integer like 0 and 1. Is it possible to convert this integer values to Boolean while loading the data in to a DB Grid. I'm expecting without condition checking, like direct typecasting.

Thanks

Answer

kludg picture kludg · Oct 5, 2011

I guess that you want to show a database field in DBGrid as a CheckBox. If so, read article by Zarko Gajic. It is about Boolean fields, but you can easily modify the code for your needs.