I will have a look ...
i have some strange bug...
Edit: seems I found a reason, Type_Exists does not return true for standard types?
old content moved to thinBasic support-area .
I use this for something else now:
assume
uses "console" Type t_Type abcd As Function efgh As Function End Type Function t_Type.abcd() As String End Function Function t_Type.efgh() As Long End Function Dim foo As t_Type PrintL "Test 1 " & $CRLF ' no printout to await but surprise... If foo.abcd() = "String" Then PrintL "foo.abcd returns string" If foo.abcd() = "Long" Then PrintL "foo.abcd returns long" If foo.efgh() = "String" Then PrintL "foo.efgh returns string" If foo.efgh() = "Long" Then PrintL "foo.efgh returns long" PrintL $CRLF & "Test 2 " & $CRLF Select Case foo.abcd() Case "String" PrintL "foo.abcd contains string" Case "Long" PrintL "foo.abcd contains long" End Select Select Case foo.efgh() Case "String" PrintL "foo.efgh contains string" Case "Long" PrintL "foo.efgh contains long" End Select WaitKey
what's going on here?
Last edited by ReneMiner; 11-10-2014 at 18:17.
I think there are missing some Forum-sections as beta-testing and support
I will have a look ...
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
I think the logical testing is not aware of the possibility to have TYPE Functions as initial parameters and understand if it is a string or numeric logical test comparison.
So the logical test will always result to true.
Thanks for finding it. I will work on it asap.
Eros
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
just to hold the thought, chatbox is sometimes unreliable...
Were it an idea to have type-functions that return string (or udts) the function-names mandatory need to end with $ ?
I think there are missing some Forum-sections as beta-testing and support
Confirm. Will try to think something different.
Thanks for trying to help but that is not the problem.
I know what kind of data a function method does.
My problem is how to return that data when it is a string and the expression is numeric.
"IF [String] = [String] THEN ..." is in reality a logical test that should return a numerical value while inside there are strings.
I perfectly know how to solve it but it is actually inside a very complex part of thinBasic Core engine. I need a little more time to solve it.
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
i'm certain you'll find a way but it's probably a matter of insufficient time to do it ...
but what have you done with Type_Exists - didn't that work before? I thought so but i'm not sure any more...
I think there are missing some Forum-sections as beta-testing and support
I think I've solved this problem but ... found another weird one.
When a TYPE function is used into a
it is executed twice.SELECT CASE udt.function() ...
This because SELECT CASE need to know what kind of data it is examining (numeric or string) making an ahead evaluation and the function used to do that is also executing the function.
I need to separate the two phases.
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
sounds if everything were under control - i don't want to post loads of examples but i think
If- conditions are somewhat similar to While/Until i guess
What about Iif/Iif$ ? shall i try out?
I think there are missing some Forum-sections as beta-testing and support
I should have fixed these problems.
In few hours I will post an updated thinCore.dll
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Here a thinCore.dll
Hope it works fine for the above 2 problems:
- IF with TYPE Functions
- SELECT CASE ... using TYPE Functions
If OK, I will publish 1.9.14 and start working on next requests.
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Bookmarks