Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : CMM2 V5.05.06exp: Huge performance improvement - please test
Page 8 of 8 | |||||
Author | Message | ||||
MauroXavier Guru Joined: 06/03/2016 Location: BrazilPosts: 303 |
I used strings in the SELECT CASE with no problem in the last firmware. But in the case, when I removed BLIT commands on the evaluation, no more system fault. |
||||
Womble Senior Member Joined: 09/07/2020 Location: United KingdomPosts: 267 |
Peters fix solved my problem. This is my amended "Test" Bug_In_Select.zip program which does what I expected ' ' Reply from Peter ... known MMBasic problem ' The workaround is to copy the array value into a temporary variable and test that ' FOR mC% = 1 to 2*WIDTH%+1 wt$ = MID$(m$(mR%), mC%, 1) SELECT CASE wt$ CASE "@" COLOUR RGB(RED) CASE "X" COLOUR RGB(GREEN) CASE "#" COLOUR RGB(BROWN) CASE ELSE COLOUR RGB(WHITE) END SELECT PRINT wt$; @ywofingers ... your solution is much more elegant than mine @Peter ... that was my understanding from reading the manual. My reading led me to believe it should have worked, but it didn't, I expected the SELECT CASE to evaluate the contents of the referenced array element and evaluate that against the CASE values. I'm very rusty with BASIC hence my inefficient code and overabundant comments ... its a learning exercise Many Thanks everyone for your help. Womble |
||||
Page 8 of 8 |
Print this page |