Qbasicnews.com
October 19, 2021, 08:06:12 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Modul to Modul subrutine results  (Read 2730 times)
A.Sadjadian
New Member

Posts: 18


« on: November 15, 2003, 04:22:48 AM »

I have just broken a long prog. into 2 modules with a Globals.bi part for the declarations etc. Now variables read in a subroutin in one module is not known in the subroutins in the second module??

A.Sadjadian
Logged
Smoke_Rune
New Member

Posts: 1


« Reply #1 on: November 15, 2003, 12:04:30 PM »

I tried a program that relies on using seperate .bas files once, the thing I did was save everything on a file and have the new program read that file right at the start....

I also think there is a way to attach files to your .bas program, those files should show up on the F2 screen (the one that shows all the subs) and should be listed as followed.

FILENAME.BAS
- SUB1
- SUB2
... etc.

Anyway, i'm not sure if they share global variables or not still.  I think you have to use the merge feature or something to get the files to merge with it.

Also, maybe if you use the #INCLUDE feature with the added file it could work :/
Logged

- Smoke_Rune
Rhiannon
Been there, done that
*****
Posts: 1031



WWW
« Reply #2 on: November 15, 2003, 12:52:02 PM »

What you need is to use COMMON SHARED to make variables global throughout your project. They should be at the top of each module and in the same order for each one. Look it up in the qb help file. Smiley
Logged

igitalblackie.com - Done! Smiley Ask about our hosting Wink

-Goddess of the of the No More Religion Threads movement Smiley
oracle
*/-\*
*****
Posts: 3652



WWW
« Reply #3 on: November 16, 2003, 10:54:39 PM »

There's a tutorial on it in the FAQ.
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!