BBS: Inland Empire Archive Date: 07-19-92 (19:49) Number: 30 From: JEAN CREPEAU Refer#: NONE To: JOHN GALLAS Recvd: NO Subj: Modules!! Conf: (2) Quik_Bas
In a message to ALL, JOHN GALLAS wrote: JG=> Could someone PLEASE explain exactly how seperate modules work? I'm trying to break up my program into 2 modules, so that it will be in the right size for the compiler, but it isn't working.. Can I call subroutines from the 1st module from within a sub from the 2nd? And how do I have variables that will work in both modules and in both modules's subroutines? I've found that DIM SHARED doesn't work across different modules.. Can somebody help me?? 1. You may put your root program (the one outside all the subs/functions) in only one .BAS file 2. All the subs/functions that SHARE variables must be in the same .BAS file. 3. For a module, to know what are the external (other modules) subs and functions, you must include a DECLARE SUB/FUNCTION at the beginning of your program, before any executable statement. 4. You compile each module (.BAS file) separately with BC. No special option is needed. 5. You link each object file together with a '+' sign on the LINK command line. Ex: LINK PROGMAIN+PROG1+PROG2; [Enter]. You should put the module that contains the root program first. Jean --- * Origin: INTERACESS Montreal (QC) Canada (514) 528-1415 (1:167/280)
Books at Amazon:
Back to BASIC: The History, Corruption, and Future of the Language
Hackers: Heroes of the Computer Revolution (including Tiny BASIC)
Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution
The Advent of the Algorithm: The Idea that Rules the World
Moths in the Machine: The Power and Perils of Programming
Mastering Visual Basic .NET