Recent

Author Topic: [Solved]about VariantToBCD handling Null values  (Read 750 times)

gucao

  • New Member
  • *
  • Posts: 37
[Solved]about VariantToBCD handling Null values
« on: April 18, 2022, 12:39:48 pm »
Are varEmpty and varNull equivalent?
Can the return value be set to 0 when vtype=1?
Will there be additional side effects?
Do I need to open a bug with this?

« Last Edit: April 19, 2022, 03:50:24 pm by gucao »
Please give me more patience with my poor English

PascalDragon

  • Hero Member
  • *****
  • Posts: 6189
  • Compiler Developer
Re: about VariantToBCD handling Null values
« Reply #1 on: April 18, 2022, 01:03:46 pm »
Are varEmpty and varNull equivalent?

No, varEmpty and varNull are not equivalent. varEmpty is a Variant that is initialized, but has no value assigned. A variant with varNull is a Variant that is explicitely Null.

Can the return value be set to 0 when vtype=1?
Will there be additional side effects?
Do I need to open a bug with this?

It indeed seems like an oversight that varNull isn't handled in VariantToBCD so you should indeed open a bug report. Best provide an example that shows that VariantToBCD doesn't work correctly when you pass in a Variant that is Null.

gucao

  • New Member
  • *
  • Posts: 37
Re: about VariantToBCD handling Null values
« Reply #2 on: April 18, 2022, 01:23:45 pm »
No, varEmpty and varNull are not equivalent. varEmpty is a Variant that is initialized, but has no value assigned. A variant with varNull is a Variant that is explicitely Null.

It indeed seems like an oversight that varNull isn't handled in VariantToBCD so you should indeed open a bug report. Best provide an example that shows that VariantToBCD doesn't work correctly when you pass in a Variant that is Null.
Thank you for analyzing your knowledge ,I will open a bug report and upload a demo.
Please give me more patience with my poor English

gucao

  • New Member
  • *
  • Posts: 37
« Last Edit: April 19, 2022, 03:51:59 pm by gucao »
Please give me more patience with my poor English

 

TinyPortal © 2005-2018