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 8986869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:39:14+00:00 2026-06-15T21:39:14+00:00

I am not much familiar with Visual Basic 6.0 and am not having a

  • 0

I am not much familiar with Visual Basic 6.0 and am not having a VB compiler installed, but I was looking at some VB code for some debugging and saw this:

Private Function IsFieldDeleted(oLayoutField As Object)
    Dim oColl As Collection
    Set oColl = GetFieldIdsForField(oLayoutField)

    IsFieldDeleted = (oColl.Count = 0)

    Set oColl = Nothing
End Function

In other functions I see they define the return type with an “As” for example “As Boolean” but this one does not have an “As” 😀 and then how they have used it is like this:

  If Not IsFieldDeleted(oRptField.GetUCMRLayoutField) Then
      Call oCollection.Add(oRptField, oRptField.ObjectKeyString)
      Call AddToNewLineSeperatedString(sCaseFldDescMsg, oFld.FieldDescription)
  End If

How is this working? Is it just like rewriting it and saying that the function returns an integer and compare the return type to be either 0 or 1? Or are there some other hidden tips in there?

  • 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-15T21:39:15+00:00Added an answer on June 15, 2026 at 9:39 pm

    When no type is specified, in VB.NET it assumes Object for the return type. In VB6, it assumes Variant. In VB.NET you can make things much more obvious by turning Option Strict On, but I don’t believe that option was available in VB6.

    The value that is returned, in reality, is still typed as a Boolean, but you are viewing the returned value as a Variant. So, to do it “properly”, you really ought to cast the return value like this:

    If Not CBool(IsFieldDeleted(oRptField.GetUCMRLayoutField)) Then
       ....
    End If
    

    Calling CBool casts the value to a Boolean instead of a Variant. This is unnecessary, though, since VB will use late-binding to determine the type of the return value is a boolean.

    The best thing to do in this case is to change the function to As Boolean. Doing so will not break any existing code since that’s all it ever returned anyway. However, if it’s a public member in a DLL, that would break compatibility.

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

Sidebar

Related Questions

I am not much experienced in boost::asio . I've some pretty basic questions. Do
I am not much familiar with developing application using cocoa on mac. Can some
I am not too much onto data mining but I require some ideas on
I am not much familiar with Java Quartz, we just used a test job
I have not used jquery much yet and not very familiar with it. Trying
not much of a programming question, but development related still, I'm starting Android development
Not much to say about this question...
Not much code since I'm a bit at a loss on how to start.
I'm not much of a programmer but I want to integrate http://storify.com/ into my
This is driving me crazy and has resulted in lost work (not much, at

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.