![]() |
Forum Index : Microcontroller and PC projects : Old Bug or New?
Author | Message | ||||
vegipete![]() Guru ![]() Joined: 29/01/2013 Location: CanadaPosts: 1132 |
I'm trying to pass a single bracket as a string to a function and am getting an error: (This is running on an 'MX470.) > LIST
If TEST("(") Then Print "Bracket" Else Print "Something else" EndIf End Function TEST(S$) As INTEGER If S$ = "(" Then TEST = 1 Else TEST = 0 EndIf End Function > RUN [1] If TEST("(") Then Error: Expected closing bracket > ? MM.VER 4.07 > Is this fixed in newer versions of the MM firmware? Or am I doing something rather wrong? Note: if I change the "(" to a different character, such as "A", the program runs as expected. Thanks. Visit Vegipete's *Mite Library for cool programs. |
||||
vegipete![]() Guru ![]() Joined: 29/01/2013 Location: CanadaPosts: 1132 |
I see that ")" doesn't work either. Visit Vegipete's *Mite Library for cool programs. |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2442 |
just tested your code using an MX170 running the latest 5.0 firmware and the observed behaviour is present. some interesting variants: [2] If TEST("tan(45") Then Error: Expected closing bracket but 'If TEST("tan(45)") Then' produces the output 'Something else' cheers, rob :-) |
||||
ajkw Senior Member ![]() Joined: 29/06/2011 Location: AustraliaPosts: 290 |
This seems to work ok. MM170 Ver 5 Cheers, Anthony a$ = "(" If TEST(a$) Then Print "Bracket" Else Print "Something else" EndIf End Function TEST(S$) As INTEGER If S$ = "(" Then TEST = 1 Else TEST = 0 EndIf End Function |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
ouch, that looks like a parser problem in the interpreter. Microblocks. Build with logic. |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3292 |
Yes, that does look like a bug and I can guess what is causing it. I will investigate and report back. Geoff Geoff Graham - http://geoffg.net |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3292 |
It is a bug and it will be fixed in the next release (due in mid January). Geoff Geoff Graham - http://geoffg.net |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |