Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Private, Static, Dim, Public....When do I use each one
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
vg19




PostPosted: Fri Feb 06, 2004 10:49 pm   Post subject: Private, Static, Dim, Public....When do I use each one

hey,

Im confused on the declarations of variables. When would I use dim, private, static, public etc. Any websites would be great

thnx
Sponsor
Sponsor
Sponsor
sponsor
Paul




PostPosted: Sat Feb 07, 2004 12:50 am   Post subject: (No subject)

I dunno any VB, but I did a little research to try and help you. This site might help you:
http://www.red-hotpokers.co.uk/vbvariables02.htm
This has a list of variables and what they're used for I think...
hope this helps you Very Happy
Tony




PostPosted: Sat Feb 07, 2004 2:39 pm   Post subject: (No subject)

if you're new to VB, just go with dim, you'll do fine Smile
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Maverick




PostPosted: Sat Feb 07, 2004 2:46 pm   Post subject: (No subject)

Ya with simpler progs all you need is Dim. Later on you will need to use the others.
Tony




PostPosted: Sat Feb 07, 2004 2:50 pm   Post subject: (No subject)

well Confused Just if you're going for efficiency or what not. Such as static will just save you memory and public/private sets level of access to that variable from other functions.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
vg19




PostPosted: Sat Feb 07, 2004 2:50 pm   Post subject: (No subject)

Not really new to VB. Did a gr10 course before. In the gr11, Im required to know all of these.
Maverick




PostPosted: Sat Feb 07, 2004 2:51 pm   Post subject: (No subject)

and?
jonos




PostPosted: Sat Feb 07, 2004 2:52 pm   Post subject: (No subject)

if im making a program, and i don't really know which one to use i just guess and hope it works...
Sponsor
Sponsor
Sponsor
sponsor
Maverick




PostPosted: Sat Feb 07, 2004 2:53 pm   Post subject: (No subject)

What kinda program you making? I probably have some code around if u need sum help.
Tony




PostPosted: Sat Feb 07, 2004 2:55 pm   Post subject: (No subject)

alright then...

dim is the basic declaration of the variable. You dont really have to declear variables in VB, IDE does that for you. But if you want to declear it, that's the method of choice.

static is a constant. You assign it a value at declaraction and cannon change it later. An example would be something like value of pi.

public/private is a variable modifier that sets its access level. Basically if the variable is private then it can be accessed from within the function it was decleared in. If it's public, then you can access that variable from other functions.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 10 Posts ]
Jump to:   


Style:  
Search: