Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 07:40 29 Nov 2024 Privacy Policy
Jump to

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: Germany
Posts: 3
Posted: 09:45am 01 Apr 2023
Copy link to clipboard 
Print this post

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: Australia
Posts: 1611
Posted: 09:53am 01 Apr 2023
Copy link to clipboard 
Print this post

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: Germany
Posts: 3
Posted: 09:56am 01 Apr 2023
Copy link to clipboard 
Print this post

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: Germany
Posts: 3
Posted: 09:56am 01 Apr 2023
Copy link to clipboard 
Print this post

  Turbo46 said  The error message is telling you:
"Invalid at command prompt"

It should be the last line of your program.

Bill


Thanks thats right!
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2080
Posted: 10:17am 01 Apr 2023
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 6812
Posted: 11:04am 01 Apr 2023
Copy link to clipboard 
Print this post

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


To reply to this topic, you need to log in.

© JAQ Software 2024