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 : call FLASH CHAIN n allways return error message
Author | Message | ||||
StefanDraeger Newbie Joined: 31/03/2023 Location: GermanyPosts: 3 |
Hello, I like to chain two programs in my PicoMite. The first one is only a = 1 b = 2 PRINT a + b The second one is c = 5 d = 7 PRINT a + b + c + d Now I've read at the documentation the command FLASH CHAIN 1 would run the first code and with FLASH RUN 2 I can run the second code. But i allways get an error. https://i.imgur.com/EHBi9dA.png https://i.imgur.com/reE2Yrx.png What did I do wrong? Thanks |
||||
Turbo46 Guru Joined: 24/12/2017 Location: AustraliaPosts: 1611 |
The error message is telling you: "Invalid at command prompt" It should be the last line of your program. Bill Keep safe. Live long and prosper. |
||||
StefanDraeger Newbie Joined: 31/03/2023 Location: GermanyPosts: 3 |
Okay, now I've got solve it by my selfe. Sorry. The solution is to run flash chain at the end of the first program. Like: a = 1 b = 2 PRINT a + b flash chain 2 |
||||
StefanDraeger Newbie Joined: 31/03/2023 Location: GermanyPosts: 3 |
Thanks thats right! |
||||
CaptainBoing Guru Joined: 07/09/2016 Location: United KingdomPosts: 2080 |
don't get hung up on where the CHAIN command goes- it doesn't have to be at the end, it could be the result of an IF for example. It can be anywhere in your program and it means "abandon what you are running right now, load this other program and continue" but the point is; if you aren't running a program, there is nothing to abandon - sooooo it can only be used as part of a program which makes it "Invalid at command prompt" (because if you are at the command prompt, there is no program running) Edited 2023-04-01 20:24 by CaptainBoing |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 6812 |
There's a slight gotcha with CHAIN that can catch people out. It's not like a GOSUB or CALL, it behaves like RUN but doesn't clear the variables. The CHAINed program always begins running with the first line of the program. Likewise, if you CHAIN back to the original program tht will also run from it's first statement, not from the one after the original CHAIN command. It's just something to be aware of. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
Print this page |