|
-
Jan 6th, 2000, 06:20 AM
#1
Thread Starter
Junior Member
i have a question about something, i would think would be easy. for a while now i have been making invisible labels to store values, there has to be an easier way. How do i make a value that can be used by any function?
-
Jan 6th, 2000, 06:25 AM
#2
Addicted Member
RoundCow, (as opposed to square cow l guess)
Declare a Global variable in a module calling right at the start of the project
e.g
basStart
Option Explicit
Global sCompanyName as String
Sub Main()
sCompanyName = "Acme Plumbing"
This will make the variable sCompanyName visible to all forms, modules, classes etc in your project. 
-
Jan 6th, 2000, 06:26 AM
#3
Lively Member
You can declare either global variables or constants.
If you want them available to all forms/modules in your project, put this in any module.
Public Const Constant_Name = 1
Global Variable_Name As String
Declare them at the top of a form to make them global in that form alone.
-
Jan 6th, 2000, 06:40 AM
#4
Thread Starter
Junior Member
i put
Option Explicit
global scanstatus as String
in the declarations, and it didn't work... does it have to be in a bas?
-
Jan 6th, 2000, 06:42 AM
#5
Thread Starter
Junior Member
coo, i did it in a module and it worked fine. thanks guys.
-
Jan 6th, 2000, 07:30 AM
#6
Hyperactive Member
whats the diff between Public and Global?
cos variables declared with Public in a module are also visible throughtout the project.
------------------
cintel rules 
www.cintelsoftware.co.uk
-
Jan 6th, 2000, 04:37 PM
#7
Frenzied Member
Global is an outdated (vb3?)keyword but does the same as Public
-
Jan 6th, 2000, 08:32 PM
#8
Hyperactive Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|