Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

QB45: Correct Method of CHAINING @ Compile

QB45: Correct Method of CHAINING @ Compile

QB45: Correct Method of CHAINING @ Compile

Hi All. Thanks in advance for looking at this thread.

Have a program (BBS Door Game, actually) that CHAINS off to another .BAS file if a certain condition is met (if the program is run on the first of the month). This was required due to memory limitations on BC.EXE at compile time. The second BAS file is contained within the main BAS file as a MODULE (Load File... in the IDE).

Within the IDE, this method works:

IF firstofmonth, then CHAIN "MAINT.BAS"

Maint.BAS runs through some stuff, then contains:

RUN MC.EXE at the end to re-start the original EXE.

This works in the IDE without issue or error.

Upon compile time, BC compiles both, and LINK joins the two sources as a single EXE. Exactly what I'm looking for.

At runtime of the compiled program, a 'file not found' error is produced. I've recompiled with logging, and verified it's my chain command that is failing. Makes sense.

I found some posts that suggested removing the .BAS from the CHAIN command, gave that a whirl. Same. Tried with .EXE in the extension. Same. I don't believe I can CALL my module; I can only CALL SUB or CALL FUNCTION.

Looking at some other program's source code, I see where each individual file contained is different parts of the program; Main module in one .BAS file, SUBS in another .BAS file, Functions in another .BAS file. Then they get compiled together at compile time. Perhaps I'm just going about my CHAINing theory all wrong.

Any tips or ideas?

Thanks very much!

RE: QB45: Correct Method of CHAINING @ Compile

Posting this here in case I need to find it 25 years from now...

"Module" (Load File) acts as an extension to your main module for compilation purposes. So, it's just a tack-on to what you've already defined. For me, instead of CHAINing the Module, the Module contains only a SUB which contains the code of the original CHAINed program. The SUB is then CALLed from the main module, as if it were part of the main module already, but is compiled separately and then linked when creating the EXE.

Now I just need to update my code in the {MODULE:SUB} to utilize functions of the main module.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close