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

Re: Null value into an integer variable


On Fri, 19 Apr 2024 at 09:55, Mayost Sharon <sharon@xxxxxxxxx> wrote:

> 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

Although a String is a "Datatype" not an "Object or Array" according to
TypeOf() it is really an array.

Arrays can be set to Null , native datatypes like Integer, Float, etc cannot

If that makes sense

BruceS

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>