Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 23:20 26 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 : MMB4W mystery: map.inc error - Invalid here

Author Message
LeoNicolas

Guru

Joined: 07/10/2020
Location: Canada
Posts: 479
Posted: 06:11pm 27 Dec 2023
Copy link to clipboard 
Print this post

Hello everyone

I need help to solve a mystery. I'm refactoring the Knightmare game source code, moving some functions and subs from the main source file to include files. There is one sub called replace_block that I moved to the map.inc file and is causing the game to crash with the following error:

Error in map.inc line 8: Invalid here


The game works fine if I move the function back to the main file (km.bas)

If I change the map.inc line 8, moving the variables declaration to the top of the sub, the error changes to:

Error in map.inc line 11: BLOCK_IX is not declared


I committed the code to a branch called refactoring. These changes are not in the main branch!

Here is the link for the branch: https://github.com/leonicolas/knightmare-cmm2/tree/refactoring

I much appreciate your help.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9115
Posted: 06:23pm 27 Dec 2023
Copy link to clipboard 
Print this post

You have end sub in line 5 . Suspect you mean exit sub
 
LeoNicolas

Guru

Joined: 07/10/2020
Location: Canada
Posts: 479
Posted: 06:26pm 27 Dec 2023
Copy link to clipboard 
Print this post

Thank you Peter, that solved the mystery  

Nothing is better than some friend's eyeballs to quickly find a mistake in the middle of a bunch of code.
 
Print this page


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

© JAQ Software 2024