[Gambas-user] InStr and gb.Case

Emil Lenngren emil.lenngren at ...626...
Mon Apr 16 18:54:46 CEST 2012


If InStr was a normal function written in Gambas, InStr(sTmp, "test",,
gb.IgnoreCase) should work. But the native functions don't really follow
any rules :)
In the interpreter: The parameters are passed without any checks for data
types or number of parameters. Such things are handled by the functions
themselves.
In the compiler: Native functions are not handled the same way as user
functions. Each native function simply have a min-parameters and a
max-parameters value. No type-checking is done either. That's why many
native functions accept any data type (no Variants here) and do different
things depending on that, for example TypeOf and Str$.

2012/4/16 Benoît Minisini <gambas at ...1...>

> Le 16/04/2012 18:30, Jussi Lahtinen a écrit :
> > http://gambasdoc.org/help/lang/instr?v3
> >
> > With this:
> > If InStr(sTmp, "test",, gb.Case) = 0 Then
> >
> > I get error " Unexpected ','. ", argument is optional so I don't expect
> > this.
> >
> >
> > With this:
> > If InStr(sTmp, "test", 0, gb.Case) = 0 Then
> >
> > I get error " Unknown symbol 'Case' in class 'gb'. ", it doesn't seem to
> > exist in Gambas 3, but how I then do case-insensitive comparison?
> >
> >
> > Jussi
>
> Documentation fixed in the wiki! :-)
>
> --
> Benoît Minisini
>
>
> ------------------------------------------------------------------------------
> For Developers, A Lot Can Happen In A Second.
> Boundary is the first to Know...and Tell You.
> Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
> http://p.sf.net/sfu/Boundary-d2dvs2
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



More information about the User mailing list