Posted: 14th Nov 2011 1:13
What's the point?
You have to declare the #include "myfuncs.agc" at the top of your main source (why?) else you get errors referencing the functions within. No matter that the function was at the bottom of your main source file - if you #include it there, it doesn't get recognised.

Of course, then any compile error after that is offset by the amount of lines in your include file, so you may as well not bother as line xxx isn't the actual error, it's line xxx-(lines in include file)
Posted: 14th Nov 2011 6:32
all includes get appended at the bottom of the source file!

If you want something earlier so use an gosub that can even be used before the include command.
Posted: 14th Nov 2011 8:02
ou have to declare the #include "myfuncs.agc" at the top of your main source (why?) else you get errors referencing the functions within. No matter that the function was at the bottom of your main source file - if you #include it there, it doesn't get recognised.

Seems pretty logical to me, using include at the top makes it easier to check if you've missed something.

Of course, then any compile error after that is offset by the amount of lines in your include file, so you may as well not bother as line xxx isn't the actual error, it's line xxx-(lines in include file)

The compiler does tell you which file the error is in as well, you'll get used to it. It's pretty easy once you understand it.
Posted: 14th Nov 2011 13:35
Hi,

calling a function that it is inside a second source file can be done everywhere throughout main.agc, as long as you use the include at the top of main.agc.

Not sure if I followed what kind of errors you're getting... Maybe if you show a example?

Cheers
Posted: 15th Nov 2011 0:42
@baxslash:
Not much use when I get "error at line 2100" and I have to subtract the amount of lines in myfuncs.agc (maybe some other files too)
It's not actually at line 2100 because of the concatenation.

@Cliff:
If the includes get appended at the bottom of the main source file, then why can't I #include them there then?
Posted: 15th Nov 2011 9:24
t's not actually at line 2100 because of the concatenation.

That's odd, mine tells me the right line number and which included file it's in... I'll send a screenshot:
Posted: 15th Nov 2011 19:14
Hi nz0,

now I've got what you mean. I can tell you that the line number is still a mystery to me. Sometimes I get the error at the right line, sometimes, it is completely off. I'll pay more attention to that and see if I can see a pattern. But I agree, this needs improvement.

Cheers