[Gambas-user] Does Gambas have an 'InRange()' function?

Fabien Bodard gambas.fr at ...626...
Mon Oct 12 22:09:51 CEST 2015


2015-10-12 18:39 GMT+02:00 Moviga Technologies <moviga at ...3488...>:
>
>
> Does Gambas have a built in "InRange" function like this:
>
> Boolean = InRange(Value, From, To)
>
> If not, could we have one? Perhaps like this:
>
> Public Function InRange(Value As Integer, {From} As Integer, {To} As
> Integer) As Boolean
>
>   If Value >= {From} And If Value <= {To} Then Return True
>   Return False
>
> End
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user


Well no but this is a school case that add an argument to my query for
a macro declaration for gambas.


nevertheless you can do


Result = Value>=From and Value <= To

Which is no so long to write.


-- 
Fabien Bodard




More information about the User mailing list