|
Forum Index : Microcontroller and PC projects : Error in line 11: A sub/fun has the same name: FUNC_B
| Author | Message | ||||
| LeoNicolas Guru Joined: 07/10/2020 Location: CanadaPosts: 536 |
What am I doing wrong? MMBasic for Windows, version 5.07.03b9 func_a(0) function func_a(t) ? "func_a(" + str$(t) + ")" func_b(10) if t=0 then func_a=func_a(1) end function function func_b(v) ? "func_b()" func_b=v ' <===== Line 11 end function |
||||
| Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 8298 |
Isn't it seeing func_b as a variable in that line? It's already used the name func_b() as a function. Can you do that? Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
| LeoNicolas Guru Joined: 07/10/2020 Location: CanadaPosts: 536 |
Hum, option explicit has fixed the issue |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10624 |
You have a function called recursively which MMbasic can't do. The MM2 fails on this as well albeit with a different error |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |