|
-
Jan 6th, 2008, 11:03 AM
#1
Thread Starter
New Member
6.0 Global Help
Hey I'm using Visual Basic 6.0 and I have a Module to declare my global variables using the code: Public blnLeaderboard As Boolean
It seems that none of my globals are being made for some reason because when I try to make an exe program it says this Object Required. Then highlights the "blnLeaderboard ="
This is the full part of my setting if something is wrong: Set blnLeaderboard = True
Please help.
-
Jan 6th, 2008, 11:36 AM
#2
Hyperactive Member
Re: 6.0 Global Help
this is wrong...
Code:
Set blnLeaderboard = True
Set is used for Objects, you should use the Let keyword instead.
Code:
Let blnLeaderboard = True
and by the way Let is optional...the following is equivalent
Code:
blnLeaderboard = True
-
Jan 6th, 2008, 11:37 AM
#3
Re: 6.0 Global Help
If it is not an object, then dont use Set. just blnLeaderBoard=true
-
Jan 6th, 2008, 11:38 AM
#4
Re: 6.0 Global Help
Welcome to the forujms. Two things
1. At the top of each code page (form, module, class, etc), add the words OPTION EXPLICIT. This will help catch easy/common errors in coding.
2. Booleans, Longs, Dates, and many other variable types are not objects. Use Set for objects else do not: bInLeaderboard=True, not Set.
-
Jan 6th, 2008, 11:38 AM
#5
Frenzied Member
Re: 6.0 Global Help
You don't need to use "Set".
This should work.
Public blnLeaderBoard As Boolean
Have that at the top of a FORM's code.
4 Responses as I was typing
-
Jan 6th, 2008, 02:27 PM
#6
Re: 6.0 Global Help
I you use the "Tools > Add Procedure..." menu item it will insert a template of properties for you if you select "property" and give it a name and scope. No way to write incorrect code that way. Simple too.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
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
|