»
 

Go Back   ResellerRatings Store Ratings > ResellerRatings Forums > Tech Support

Reply
 
LinkBack Thread Tools Display Modes
Old 09-06-2003, 08:20 PM   #1 (permalink)
Registered User
 
Join Date: Jan 2003
Location: Orange, Mass.
Posts: 490
Blazer06 is on a distinguished road
Send a message via AIM to Blazer06
Any way to share all varibles in basic?

I want to share all varibles with all sub routines in basic, without typeing them out on every sub...

I tried the common shared {varibles}, but it didnt work


Blaze

Blazer06 is offline   Reply With Quote
Old 09-08-2003, 12:41 PM   #2 (permalink)
Registered User
 
Join Date: Oct 2001
Location: TOO close to Wash DC
Posts: 7,956
vass0922 is on a distinguished road
Hmmm not sure if they have them, but generally most languages do...

Look for 'Global Variables' for qbasic on google... see if you can pull something up

VB its easily done.. usually you just put their declarations above the first function call


believe this is an example
http://pw1.netcom.com/~hjsmith/BBall/BBallQ.html
__________________
<< Insert exceedingly large and overly verbose message of how 1337 you are here including full specs of every vehicle you've ever driven and PC you've owned >>
vass0922 is offline   Reply With Quote
Old 09-10-2003, 07:54 AM   #3 (permalink)
Registered User
 
Join Date: Oct 2001
Location: New Hampshire, USA
Posts: 604
ctaylor is on a distinguished road
Try going to the general declarations at the top of your module. You can define valiables there and use them throughout all subs on the same module.

Stylistically, I have never considered using variables not defined within the module using them because I feel it would make things too difficult to follow.

This being the case I have never contemplated whether it is possible to define variables once in the project and continue using those variable declarations between modules.
ctaylor is offline   Reply With Quote
Old 09-10-2003, 08:48 AM   #4 (permalink)
Registered User
 
omalleytrading's Avatar
 
Join Date: Apr 2003
Location: Albany, NY
Posts: 425
omalleytrading is on a distinguished road
Within the same module, you can define a variable at the very top of your code, and it will be available to any Sub or Function in that module.

They cannot be accessed outside of that module, however. (I don't believe... )
omalleytrading is offline   Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Most Active Discussions

Recent Discussions

All times are GMT -6. The time now is 10:48 PM.