On Sun, 08 Feb 2015, adamn...@gmail.com 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
#!/usr/bin/gbs3
Public Sub Main()
Select Args.Count
Case Eval("Args.Count ^ x", ["x": Args.Count])
Print "Args.Count = 1"
End Select
End
------------------------------------------------------------------------------
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