|
Post by drwhen on Mar 6, 2006 9:49:37 GMT -5
Hi,
I am trying to separate out some code into modules or files to keep things a bit more organized. I am a little confused on how to do so in LBW as it differs a bit from C. It seems that for some reason the label in the included module is not visible to the first module even though as far as LB is concerned they get combined. On that note, have you folks considered a true project approach where files are actually linked like C type developments?
file one: **************************************** 'include editing_window.bas ' ' ' goto [label1] ' label to is in included file ****************************************
file two ( named editing_window.bas) **************************************** ' ' ' [label1] ' code ****************************************
|
|
|
Post by Alyce Watson on Mar 7, 2006 8:29:01 GMT -5
It seems that for some reason the label in the included module is not visible to the first module even though as far as LB is concerned they get combined. When you choose to RUN the file, the included files are added and the whole thing is written to disk as a temporary file, then LB is called to run it. LBW does not check included files to find branch labels. Is that what you mean? You can choose to save the project to disk, and it will be saved with all included files appended to the end. Then, all branch labels are visible, either in LBW or in LB itself. I don't know if Carl plans to add this capability to Liberty BASIC. You can certainly add it to the wishlist board at libertybasic.conforums.com/This is a question/wish that comes up fairly regularly. Also, check out the preprocesser article by Rich Ries: babek.info/libertybasicfiles/lbnews/nl141/preprocessorpart1.htmbabek.info/libertybasicfiles/lbnews/nl141/preprocessorpart2.htm
|
|
|
Post by drwhen on Mar 9, 2006 12:14:36 GMT -5
Hi,
I am a little dense so forgive me if I am a little confused. I assume the "include" directive is there to allow the breaking up of largish files into smaller, more readable modules or perhaps stand alone modules that do not need to be recreated with every new program that needs them.
If the included file cannot see a label in the first file, aren't we just as well off to not bother with smaller files and just stick to big ones - or pasting all the small files together manually, then compiling/tokenizing them so that the labels are visible for jumping to? Am I missing what the include statement is actually affording?
Thanks!!
Bob
|
|
|
Post by drwhen on Mar 9, 2006 12:36:46 GMT -5
Hi yet again,
Well yes, I AM dense and found the answer and what I was doing wrong pertaining to branch labels not being visible outside of subroutines. Sorry!!!
Bob
|
|