• Best of luck to the class of 2024 for their HSC exams. You got this!
    Let us know your thoughts on the HSC exams here
  • YOU can help the next generation of students in the community!
    Share your trial papers and notes on our Notes & Resources page
MedVision ad

Visual Basics Assistance Topic (1 Viewer)

allGenreGamer

Member
Joined
Nov 26, 2003
Messages
111
I'm a beginner at programming and just finished learnin VB in order to complete my major project. This topic is for those who needs assistance in VB, here they can post their questions an obtain advice from the good programmers out there.
And I have a question now - how do you declare public variables? I've always declared variables in "Private Sub"... thanks.
 

sunny

meh.
Joined
Jul 7, 2002
Messages
5,350
Gender
Male
HSC
2002
Declare them outside of any procedures, either in form code or module code.

The variables can be scoped so that they are only visible within the module. Declare it as private in the module's declarations section .

A variable declared as public in the module declarations section will be visible to the entire project.

Use global variables sparingly!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top