Select Case - Problem
issueid=372 20-11-2012 18:55
thinBasic MVPs
Number of reported issues by ReneMiner: 83
Select Case - Problem
problem on One-Line-Cases

I currently experienced some odd behaviour of Select Case

example:
Select Case myString
    Case "black"  : newColor.R = &H0  : newColor.G = &H0  : newColor.B = &H0         
    Case "white"  : newColor.R = &HFF : newColor.G = &HFF : newColor.B = &HFF
    Case Else     : Console_WriteLine "I don't know this color"  
End Select
does not work! it recognizes the string but ignores the statements behind colon as if it was a remark. (no error)
newColor never gets set and the console_writeLine gets never proceeded. In my code it were a lot of Cases (DL-Tinker where you can type in
"color indianred" and this color gets set for use then. So there is one case for every tb-color-equate, pretty much though.)
The function was working, but when I cleaned up my code to present it and it looks nicer arranged, I put that all on one line and did not test it again.
But it did not work any more!

it works if I do it this way:

Select Case myString
    Case "black"  
       newColor.R = &H0  : newColor.G = &H0   : newColor.B = &H0         
    Case "white" 
       newColor.R = &HFF : newColor.G = &HFF : newColor.B = &HFF
    Case Else     
       Console_WriteLine "I don't know this color"  
End Select
Issue Details
Issue Number 372
Project thinBasic
Category Core engine (thinCore.dll)
Status Fixed
Priority Unknown
Affected Version 1.9.1
Fixed Version 1.9.6
Milestone (none)
Users able to reproduce bug 1
Users unable to reproduce bug 0
Assigned Users (none)
Tags (none)




08-03-2013 00:41
thinBasic author
Hi Rene,

attached to this post (bottom of page) there is a new thinCore.Dll (thinBasic Core Engine)
If you have thinBasic beta 1.9.3 installed, please substitute \thinBasic\thinCore.dll with the one attached to this post.
Hopefully I think I have solved the problem you mentioned in this bug report.

I will wait for your reply.
Thanks a lot
Eros

08-03-2013 01:05
thinBasic MVPs
I tried out and instantly replaced the .dll file - then I changed the codelines of the function which I know that it had that issue - and did run perfect. All Statements behind colon get processed.
There are 143 Case Expr : Statement :Statement : Statements (so there are 143 thinBasic color-equates) and one Case Else. I changed it all back to the state it was when the Bug occured - null problemo!

Now I don't have the "old" .dll any more to verify if it for sure... - might also have been a win XP related issue

08-03-2013 08:22
thinBasic author
Wow, with so many CASE we can think about some new thinBasic functionality.
If you send me an extract of the code I will think about it.

To install the old version of thinBasic you need to download it again and install.

Old versions of thinBasic are always available at
http://www.thinbasic.biz/projects/th...ic_1.9.3.0.zip
or
http://www.thinbasic.biz/projects/th...ic_1.9.2.0.zip
http://www.thinbasic.biz/projects/th...ic_1.9.1.0.zip
http://www.thinbasic.biz/projects/th...ic_1.8.9.0.zip
...
and so on

Ciao
Eros

08-03-2013 14:17
thinBasic MVPs
You can check the full script here: (DisplayList-Tinker)

http://www.thinbasic.com/community/s...st-Tinker-Tool

it's the Function is_a_Color() - in the download it's still Case expr, statements on multiple lines. I won't upload the file changed to the new version with one-liners since I have made some test now-
I re-installed 1.9.3.0 (have the folder still on my HD) and tried - so the Bug did NOT occur in Windows 8 (without new thinCore.dll) and I think now it might be some windows XP-issue.
Maybe this evening I can see my neighbour (which now has my old PC) and test it there.

Edit: Neighbour came back early - so already tested on my old WinXP-System which is still in the same configuration-conditions as it was when I had it: Bug is gone!

06-05-2013 10:31
Super Moderator
I can confirm the bug is gone and change the status to "Fixed".


Petr

+ Reply