So does this mean that I can have multiple subroutines in one file called myfile.bas and just type in INCLUDE "myfile.bas" into the main file and it will work perfectly.
this is a oversimplified version of what I plan to do
--------------------------------------------------------------------
'file:myfile.bas
subroutine1:
HIGH LED1
HIGH LED3
Subroutine2:
HIGH LED2
HIGH LED3
Subroutine3:
HIGH LED1
HIGH LED2
'end of myfile.bas
--------------------------------------------------------------------
'mainfile.bas
include "modedefs.bas"
include "myfile.bas"
LED1 VAR PORTB.1
LED2 VAR PORTB.2
LED3 VAR PORTB.3
TRISB = %00000000 'making all of PortB into outputs
start :
goto Subroutine1
goto Subroutine2
goto Subroutine3
goto start
==============================================
question 1:
I am not sure if this is the correct way of calling these subroutines from (myfile.bas)... please let me know if there is a better way of performing the above operation of calling a subroutines from another file.
question2:
Another question which I think is a no brainer for most but for me i it is very hard to visualize when performing this task is ... if i compile this piece of code, will the compiler add myfile.bas and main.bas into the program memory of the PIC microcontroller or will it only include the main.bas ? lets say that I am using the 16C73B which has only 4K of space .... and myfile.bas takes up 3K while main.bas takes up 2K. does this mean that I will get an error when compiling the code.
many thanks in advance for those who read and reply to this message and to get me thinking straight on these few topics.
Bookmarks