Re: VB6 Scope Issues

Tech-Archive recommends: Speed Up your PC by fixing your registry



Andrew Chalk wrote:
1) What is the difference in scope of:
Public X As String
Global X As String


Anywhere where the latter is not a syntax error, there is no difference between the two.

Anywhere else (place where you can only use Public) it /is/ actually rather different
from *either* of the above.


2) What is the difference in scope of:
Private Sub S()
Sub S()

In (2): Nothing, I believe. The absence of a scope qualifier on a Sub or Function implies Private, right?

I think that's the case, but it's not something I'm likely to ever bother to test.
VB has, over the years, given me a serious distaste for defaults.


Bob
--
.



Relevant Pages

  • Re: Find correct record after user using down arrow
    ... Syntax error in string in expression ... wizard to create following code. ... Private Sub cboFind_AfterUpdate ...
    (microsoft.public.access.forms)
  • Re: Error in Code, but I Cant Find It!
    ... Syntax error in query expression ... Private Sub Form_Current ... Dim strWhere As String ... Dim strWhere2 As String ...
    (microsoft.public.access.formscoding)
  • RE: run append query from form
    ... but now I get an syntax error in the FROM clause: ... Private Sub Command1_Click ... Dim strSQL As String ... Dim tbl_new As String ...
    (microsoft.public.access.formscoding)
  • Error in Code, but I Cant Find It!
    ... Syntax error in query expression ... Private Sub Form_Current ... Dim strWhere As String ... Dim strWhere2 As String ...
    (microsoft.public.access.formscoding)
  • VB6 Scope Issues
    ... What is the difference in scope of: ... Public X As String ... Private Sub S ... Function implies Private, right? ...
    (microsoft.public.vb.syntax)