[Gambas-user] Quickie on SELECT
Tobias Boege
taboege at ...626...
Sun Feb 8 15:16:32 CET 2015
On Sun, 08 Feb 2015, adamnt42 at ...626... wrote:
>
> Does anyone know if you can use an EVAL in a CASE selector?
> e.g. SELECT hSomething
> ...
> CASE EVAL(hSomething.SomeArray.Exisits(hSomething.Value))
> ...
>
This only makes sense if the Exisits method returns a string, or am I
getting your idea wrong here?
> (I am just being too lazy to try it)
>
Haven't seen this much laziness in a while :-)
$ ./select-case-eval.gbs3
Args.Count = 1
$ ./select-case-eval.gbs3 arg
$
Apparently it works (and why wouldn't it, since Case hObject.Symbol is
possible and in a Symbol_Read() you can do anything).
Regards,
Tobi
--
"There's an old saying: Don't change anything... ever!" -- Mr. Monk
-------------- next part --------------
#!/usr/bin/gbs3
Public Sub Main()
Select Args.Count
Case Eval("Args.Count ^ x", ["x": Args.Count])
Print "Args.Count = 1"
End Select
End
More information about the User
mailing list