Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 12th, 2006, 07:19 PM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 101
Thanks: 0
Thanked 1 Time in 1 Post
Default What value type is Global in Visual Basic?

What value type is Global in Visual Basic?

If I have something defined like this:

Code:
Global ErrorStatus&
And I have know what data type this is. I have heard that the compiler sets the data type based on how it is used. Well, suppose I have this problem where I have to know what the default type it is because I am sending it to a C++ DLL. What type should I expect?

 
Old May 1st, 2006, 03:51 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Global itself is not a datatype, but a scoping mechanism. It can be used in .bas modules, and means the same thing as Public in that context - it is a throwback to earlier versions of VB and still remains to maintain compatibility, as far as I know.

However, what IS typing that variable is the ampersand "&". This is a short cut known as a type-declaration character, and the ampersand is typing the ErrorStatus variable as a long.

Woody Z http://www.learntoprogramnow.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Basic monika.vasvani VB Databases Basics 5 June 16th, 2014 10:01 AM
FTP in Visual Studio 2005 Pro (Visual Basic) shoopes VB How-To 1 June 29th, 2006 02:08 PM
Could not load type 'DotNetSpider.ShopCart.Global' shupiR .NET Framework 1.x 0 January 2nd, 2006 06:52 AM
ado type library in global.asa -Dman100- Classic ASP Professional 4 August 6th, 2004 09:45 PM
Visual Basic 6.0 Danielvb VB How-To 1 June 9th, 2003 04:30 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.