[Gambas-user] Feature Request

Ian ian.roper at ...1974...
Sat Feb 7 12:33:42 CET 2015


IIF - I should have know there would be something.

now if the wiki had a search function........


Ian.

On 07/02/15 14:15, Fabien Bodard wrote:
> :-P
>
> You need to read the wki help language pages at least !
>
> 2015-02-07 7:09 GMT+01:00 T Lee Davidson <t.lee.davidson at ...626...>:
>> Hey Ian,
>>
>> Unless I'm missing something, you're talking about an Inline IF. And, there
>> already is one.
>>
>> http://gambaswiki.org/wiki/lang/iif
>>
>> Print IIf(True, "Yes", "No") ' -> Yes
>> Print IIf(False, "Yes", "No") ' -> No
>>
>>
>> Lee
>> __________
>>
>> On 02/06/2015 08:51 PM, Ian wrote:
>>> 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 at lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>>
>> ------------------------------------------------------------------------------
>> 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 at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
>





More information about the User mailing list