Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[HELP VB 2008]GLOBAL VARIABLES

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
ssaccount
Master Cheater
Reputation: 0

Joined: 29 Aug 2007
Posts: 391
Location: Finland

PostPosted: Thu Mar 20, 2008 5:29 pm    Post subject: [HELP VB 2008]GLOBAL VARIABLES Reply with quote

How can i use global Variables so i can use them in different forms?
_________________
Programming in C++
(Or at least trying to Very Happy)
Back to top
View user's profile Send private message
Heartless
I post too much
Reputation: 0

Joined: 03 Dec 2006
Posts: 2436

PostPosted: Thu Mar 20, 2008 6:09 pm    Post subject: Reply with quote

Code:
Option Explicit
Dim GlobalVariable


Is this what you want?

_________________
What dosen't kill you, usually does the second time.
Back to top
View user's profile Send private message
Pseudo Xero
I post too much
Reputation: 0

Joined: 16 Feb 2007
Posts: 2607

PostPosted: Thu Mar 20, 2008 7:02 pm    Post subject: Re: [HELP VB 2008]GLOBAL VARIABLES Reply with quote

ssaccount wrote:
How can i use global Variables so i can use them in different forms?

Code:
Public <stringname> As String

_________________
haxory' wrote:
can't VB do anything??
windows is programmed using VB right? correct me if im wrong.

so all things in windows you have like the start menu is a windows form too.
Back to top
View user's profile Send private message
Heartless
I post too much
Reputation: 0

Joined: 03 Dec 2006
Posts: 2436

PostPosted: Thu Mar 20, 2008 8:07 pm    Post subject: Reply with quote

Oh, I get the question now.

Add a module to your project and put this in

Code:
Option Explicit
Public StringNameHere as string

_________________
What dosen't kill you, usually does the second time.
Back to top
View user's profile Send private message
Pseudo Xero
I post too much
Reputation: 0

Joined: 16 Feb 2007
Posts: 2607

PostPosted: Thu Mar 20, 2008 8:08 pm    Post subject: Reply with quote

HornyAZNBoy wrote:
Oh, I get the question now.

Add a module to your project and put this in

Code:
Option Explicit
Public StringNameHere as string

You don't have to put it in a module, and option explicit isn't required. Razz

_________________
haxory' wrote:
can't VB do anything??
windows is programmed using VB right? correct me if im wrong.

so all things in windows you have like the start menu is a windows form too.
Back to top
View user's profile Send private message
ssaccount
Master Cheater
Reputation: 0

Joined: 29 Aug 2007
Posts: 391
Location: Finland

PostPosted: Fri Mar 21, 2008 5:34 am    Post subject: Reply with quote

ok thx dudes
_________________
Programming in C++
(Or at least trying to Very Happy)
Back to top
View user's profile Send private message
Heartless
I post too much
Reputation: 0

Joined: 03 Dec 2006
Posts: 2436

PostPosted: Fri Mar 21, 2008 9:42 am    Post subject: Reply with quote

I never learn VB.NET, only VB6. I still think VB6 is better.
_________________
What dosen't kill you, usually does the second time.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Fri Mar 21, 2008 9:02 pm    Post subject: Reply with quote

To make something "global" you can also use the 'Friend' type. And this would go inside a module, which is how globals should be used anyway. Create a new module then use something, say for a string, like this:

Code:
Friend gsMyString as String = Nothing


Reference:
http://en.allexperts.com/q/Visual-Basic-1048/vb-net-global-variables.htm

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites