REM ********************************************************
Title: Re: include directive
Post by: bplus on October 20, 2020, 06:11:05 pm
Quote
thats an idea thanks it will only be used once so that will work
Yeah I am thinking only code you might want to use in different app to put that in .BI's and .BM's
Code unique to app should just be used in the app maybe as SUB to get it out of way or unclutter main module.
Title: Re: include directive
Post by: Richard Frost on October 21, 2020, 01:15:50 am
I have never used INCLUDE because I have enough trouble keeping track of the data files my programs require. To split up source code is, methinks, only for way advanced coders.
Title: Re: include directive
Post by: TempodiBasic on October 21, 2020, 04:30:19 pm
Hi badger
I think that the fantastic suggestions of Bplus and RichardFrost are the real solution of your issue!
Nevertheless standing on your original code and on the will to use a GOSUB and a included file... your first mistake is the line 8 of the main program
you have eaten $ at the beginning of (mistyping) $include'namefile' after this correction now if you double click on this line of code in QB64 IDE you get a second window that show you the included file. BUT if you compile this code you get ERROR return without GOSUB.... so you must run the RETURN instruction into the included file at line 35 of it only after a call to it... to do this you must follow my example using an IF THEN with a flag activated each time you call GOSUB to that label... this feedback is just to show the logic that you have used behind the construction of your program with GOSUB and $include:' '.
At the place of doing all these workaround you can use a closed block of code like SUB/END SUB or FUNCTION / END FUNCTION, more flexible and powered by local variables.
Good Coding
Title: Re: include directive
Post by: badger on October 22, 2020, 06:31:23 pm
TempodiBasic
Thanks for your input. I figured out that i left out the $ symbol. I also needed to use a .bm file instead it would have worked i think. I have an logic error i am tracking down i need to setup what i call a flag veriable to direct the software to ware it needs to go. I have not been feeling well due to arthritis and the weather ugg i hate multiple long rainy days it hurts and my mind turns to mush due to the fact i get really tired and sleepy all day.
i will be back in the sadle i hope tomorrow LOL
Just want to take a minute to say Thanks for all your and every ones help. Your grasp on the qb64 environment is amazing as well as your grasp on programming abilities in general.