Would it be possible to have a Gambas function to return a string based 
on a Boolean value.
IFF may not be the best naming convention for the keyword but was all I 
could think of.

Public Function IFF(InBool As Boolean, InStrTrue As String, InStrFalse 
As String) As String

    If Inbool Then
       Return InStrTrue
    Else
       Return InStrFalse
    Endif

End

Use example:
BoolValue = True
Txt_AmIHappy.Text = IFF(BoolValue,"Yes- Im Using Gambas","No-I have to 
use VB")

Of course this can be done with an If-Else or Select-Case but its a 
little more elegant.


Cheers,
Ian.




------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to