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 : Error in line 11: A sub/fun has the same name: FUNC_B
Author | Message | ||||
LeoNicolas Guru Joined: 07/10/2020 Location: CanadaPosts: 444 |
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: 5710 |
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: 444 |
Hum, option explicit has fixed the issue |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8573 |
You have a function called recursively which MMbasic can't do. The MM2 fails on this as well albeit with a different error |
||||
Print this page |