Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7792377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:09:54+00:00 2026-06-01T22:09:54+00:00

I am looking at VB6 code and I see a statement as follows –

  • 0

I am looking at VB6 code and I see a statement as follows –

       Public Sub CheckXYZ(abc As Integer)

       If abc <> pqr Then SetVars abc

And when I click on go to definition on SetVars, I am taken to the following definition-

      Private Sub SetVars(i As Integer)

I am new to VB. Is this something that is common in VB, to allow function calls without the paranthesis?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T22:09:56+00:00Added an answer on June 1, 2026 at 10:09 pm

    As Ryan has pointed out, parentheses should only be used when calling a function that will return a value.

    One pitfall I would like to add is that if you actually DO use parenteses unintentionally when calling a Sub, VB6 will pass the parameter by value instead of by reference.

    When the Sub takes more than one parameter, this is not a risk, since this is an illegal syntax in VB6:

    SomeFunc (arg1, arg2)
    

    But consider this example:

    Sub AddOne(ByRef i As Integer)
      i = i + 1
    End Sub
    
    Sub Command1_Click()
      Dim i as Integer
    
      i = 1
      AddOne i    'i will be passed by reference and increased by 1
      Msgbox i    'Will print "2"
      AddOne (i)  'i will be passed by value, so the return value will be lost!!
      MsgBox i    'Will still print "2"!!
    End Sub
    

    So be aware of how you use the parentheses, a small change may have unexpected effect.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking at some legacy VB6 code (years+years old, before my time) which runs
Looking for a simple text encryption/decryption VB6 code. Ideally, the solution should accept (text,
I am looking at some old VB6 code. I am new to VB and
The company I work for is looking to finally upgrade from VB6 to .Net,
I'm looking at a piece of very old VB6, and have come across usages
I am looking into a very old ASP code after so many years. I
I am looking for a effective/efficient way in VB6 to take a byte array
Looking at the Facebook iOS app, one can see that when in the feed
Looking for the best way to do this in VB6. Typically, I would use
In vb6 you could see a textbox update immediately when the value was changed,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.