BasicMicroUK - Forums

www.basicmicro.co.uk
It is currently Wed Apr 25, 2018 3:40 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Compiler error 102
PostPosted: Wed Dec 25, 2013 4:27 pm 
Offline
New User

Joined: Wed Dec 25, 2013 4:02 pm
Posts: 2
Merry Christmass,

I made atempt to search the forum for this
Im using Pro 28-m
In the main code file Im trying to gosub a subroutine which is located in external file.

Built error is

Error: FILE c:\\work\code\pulsout_and_pwm.bas(LINE 1) : [TOKEN ARM_TRANSITION_LEVEL] : Compiler error 102

Q. Ideas to what that error means and what im doing wrong?


Top
 Profile  
 
 Post subject: Re: Compiler error 102
PostPosted: Thu Dec 26, 2013 4:26 pm 
Offline
Master

Joined: Sun Jan 03, 2010 4:01 pm
Posts: 134
Location: Eau Claire, WI
Greetings,

While I have not attempted calling a GOSUB for code that exists in another file the command the C:\\ looks odd; did you try C:\ instead?

I believe there is some example code in one of the appendixes of the manual. Oddly I was going to figure out how to accomplish the same task this week as I'm writing code for a "library" for the 4D Systems LCD Display.

Let me know what you find out...if I find anything out I'll be sure to post back here too.

Thanks-Brian


Top
 Profile  
 
 Post subject: Re: Compiler error 102
PostPosted: Thu Dec 26, 2013 4:31 pm 
Offline
Master

Joined: Tue Nov 21, 2006 5:34 pm
Posts: 662
Brian beat me to it.

I was also going to mention that the c:\\ looks odd. Was not sure if it was a typo, or an issue with the error message.

I have called functions in other files. But how are the two files related?
Do you have a project where both files are part of it?

Or do you have your program file include the other?
#include "other_file.bas"

Kurt


Top
 Profile  
 
 Post subject: Re: Compiler error 102
PostPosted: Sat Dec 28, 2013 12:35 pm 
Offline
New User

Joined: Wed Dec 25, 2013 4:02 pm
Posts: 2
I think it's a typo. I probably removed the insignificant directory information.
I have library of six files each of different names with extension .bas
I have included them with previously mentioned #include compiler directives in the main file as instructed in the manual.

Solution
My solution to the problem was to add new empty line before label of the subroutine in the other file.

Hypothesis
The explanation is that compiler was coping line on line when pasting the parts from other files to the one in main file.

New found problem
Regarding different compiler error
The order of #includes located at the end of the main file code which are effectively labeled subroutines is important. Sometimes it won't compile properly. Any ideas to why?


Top
 Profile  
 
 Post subject: Re: Compiler error 102
PostPosted: Sat Dec 28, 2013 3:55 pm 
Offline
Master

Joined: Tue Nov 21, 2006 5:34 pm
Posts: 662
Not sure, I have not used the #include in a long time.

I instead use projects, and include all of the files I need in the project.

But sometimes order does mater. That is, you can have code that calls a function that has not yet been defined, but you can not reference a variable that has not been defined yet. So if one file has variables defined that another one uses, then it needs to be included before.

But I am guessing as I am not sure what error message you are receiving.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO