[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Null value into an integer variable


On 19/4/24 7:56 pm, Gianluigi wrote:
Maybe something like this will be enough for you (*)? As long as this
isn't heresy...

Regards
Gianluigi

(*)
Public Sub Main()

  Dim vIntero As Variant

  vIntero = 450000
  Print IntValue(vIntero)
  vIntero = 2200000000
  Print IntValue(vIntero)
  vIntero = -2200000000
  Print IntValue(vIntero)
  vIntero = "PIPPO"
  Print IntValue(vIntero)

End

Private Sub IntValue(value As Variant) As Variant

  If value <= 2147483647 And If value >= -2147483648 Then Return value
  Return Null
Catch
  Return Null

End

That's good but it doesn't address the original problem. Integers cannot be null, when sometimes it is true. You are addressing the display problem but not the actual value problem of "why cant I set an integer variable to null?"

As I said I have yet to find an answer to this.

b


Follow-Ups:
Re: Null value into an integer variableBenoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
References:
GRIDVIEW color and size"Mayost Sharon" <sharon@xxxxxxxxx>
Re: GRIDVIEW color and sizeT Lee Davidson <t.lee.davidson@xxxxxxxxx>
Re: GRIDVIEW color and sizeT Lee Davidson <t.lee.davidson@xxxxxxxxx>
Re: GRIDVIEW color and size"Mayost Sharon" <sharon@xxxxxxxxx>
Re: GRIDVIEW color and sizeT Lee Davidson <t.lee.davidson@xxxxxxxxx>
Null value into an integer variable"Mayost Sharon" <sharon@xxxxxxxxx>
Re: Null value into an integer variableGianluigi <gradobag@xxxxxxxxxxx>