Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Global Variables

Author
Message
Doomwad
20
Years of Service
User Offline
Joined: 29th Dec 2003
Location:
Posted: 18th Jun 2004 06:00
Okay, okay. This has got to be the simplist answer ever... but I can't figure out. Is there a way to make a non-array global variable? Every global variable I try to do is an array, and that is not neccessary for what I want to do.
MrBlack
20
Years of Service
User Offline
Joined: 17th Jun 2004
Location: Switzerland
Posted: 18th Jun 2004 06:07
Excellent... I just created an account on this forum 5 minutes ago to ask exactly the same question !

You have failed me for the last time
hyrichter
20
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 18th Jun 2004 06:15
If you're using DBC, you'll have to make an array. Just go something like this. Dim MyVar(0) and it's global. If you're using DBPro, you would type Global MyVar.

MrBlack
20
Years of Service
User Offline
Joined: 17th Jun 2004
Location: Switzerland
Posted: 18th Jun 2004 06:25
Thanx for your answer... I'm currently reading the "Beginner's guide" and it says arrays are always global. My function was not working with an array, though but declaring the var with the global keyword works perfect.

You have failed me for the last time
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 18th Jun 2004 15:16
yeah use global keyword but type the variable explicitly

Global intMyVar As Integer

as an example


* DBP_NETLIB_v1.4 - w/VARIABLE WATCHER & CONSOLE! * Click Logo
Doomwad
20
Years of Service
User Offline
Joined: 29th Dec 2003
Location:
Posted: 18th Jun 2004 20:07
Yeah thanks. that helped a lot

I'm using DB Classic.

Login to post a reply

Server time is: 2024-11-26 21:33:41
Your offset time is: 2024-11-26 21:33:41