Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2016-11

Variants - Auto-convert nulls

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

African Wild Dog

Hello,

I need the variant type converting automatically null values to the default value of the target type (e.g False for Booleans, 0 for Integers/Floats).
I know that i can achieve this by setting the variable NullStrictConvert (unit Variants) to False. However, this is a global setting and therefore is not safe using such method.

What would be the best way to solve my problem?

Best regards