[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Null value into an integer variable
[Thread Prev] | [Thread Next]
- Subject: Re: Null value into an integer variable
- From: Gianluigi <gradobag@xxxxxxxxxxx>
- Date: Fri, 19 Apr 2024 12:26:10 +0200
- To: user@xxxxxxxxxxxxxxxxxxxxxx
Il 19/04/24 10:55, Mayost Sharon ha scritto:
Hello Public Sub Main() Dim sVar As String Dim iVar As Integer sVar = "gb" iVar = 3 sVar = Null iVar = Null End When I put an Null value into a variable of type string I don't get an error and the variable gets a value of "" But when I put an Null value into a variable of integer type it gives an error Is this normal? Thank you
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
Re: Null value into an integer variable | BB <adamnt42@xxxxxxxxx> |
GRIDVIEW color and size | "Mayost Sharon" <sharon@xxxxxxxxx> |
Re: GRIDVIEW color and size | T Lee Davidson <t.lee.davidson@xxxxxxxxx> |
Re: GRIDVIEW color and size | T Lee Davidson <t.lee.davidson@xxxxxxxxx> |
Re: GRIDVIEW color and size | "Mayost Sharon" <sharon@xxxxxxxxx> |
Re: GRIDVIEW color and size | T Lee Davidson <t.lee.davidson@xxxxxxxxx> |
Null value into an integer variable | "Mayost Sharon" <sharon@xxxxxxxxx> |