[Gambas-user] Maybe a bug with val functiun
Benoit Minisini
gambas at ...1...
Tue Nov 11 14:33:49 CET 2003
Le Mardi 11 Novembre 2003 00:44, ron a écrit :
> > > May be if you try RETURN (Cstr("")) instead of RETURN ("")
> > >
> > > I found a same problem when i fill a array with "" (emty strings)
> > > arr=3D["","","",""] 'all entries are 'Null'
> > > must corected to
> > > arr=3D[Cstr(""),"","",""] all entries are now gb.String (v0.65)
> > >
> > > Gambas sees a variable preset with "" as Null in relational compares as
> > >
> > > anemtystring=3D""
> > > IF anemptystring =3D "" THEN
> > > print "this is empty"
> > > ELSE
> > > print "this is NULL"
> > > ENDIF
> >
> > In Gambas, NULL and "" must be exactly the same thing. If you can make
> > a=20 difference, THIS is a bug !
>
> I think this is the case and so it's true but there can be an exception.
>
> > I will check all comparison functions so that they behave as I wanted !
> >
> > Regards,
> >
> > =2D-=20
> > Benoit Minisini
> > mailto:gambas at ...1...
>
> Hi Benoit,
> It is a mess with those html/=3D stuff.
>
> I need a array preset with "" like arr=["","","",""] and this was not
> posible. The array arr is a String[] and will add later to a Variant[]
> array.
>
> As in the help about arrays you say the first element determines the type
> of the following entries.
> In the case of the first element was a "" wich is equal as Null my array
> was all with Null. I asume all entries are then gb.Null
> Changing the first element to use CStr("") resolves the problem and all
> elements in the array are default type of gb.String with a content of Null.
> In the program there are string operations with these cells and they didn't
> accept it at the time i used 0.63 and giving me typecast errors.
>
Hi, Ron.
I'm sorry, this is a stupid bug in the Array() or [...] function. Doing [""]
will create a unusable array instead of creating a String array ! I will
correct it in the next version...
Regards,
--
Benoit Minisini
mailto:gambas at ...1...
More information about the User
mailing list