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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:34:38+00:00 2026-06-06T12:34:38+00:00

I have created a class called Class1, and in another module, I want to

  • 0

I have created a class called Class1,
and in another module, I want to use the class like this:

Dim budgeunit As Class1

Sub Creattree()
    Dim lvl1p, lvl1m, lvl1dm As Class1

    Set lvl1p = New Class1
    lvl1p.setName ("pear")
    Set lvl1m = New Class1
    lvl1m.setName ("Mango")

    Set budgeunit = New Class1

    budgeunit.addtochildren (lvl1p), budgeunit.addtochildren(lvl1m)
End Sub

But when I compile it, it highlight the budgeunit.addtochildren(lvl1m)
and said Byref argument mismatch.
I have declare all arguments, I do not know why this happens.
The class code:

Dim Children() As Class1
Dim Parent() As Class1
Public level As Integer
Public name As String
Function setName(nm As String)
    name = nm
End Function

Function addtochildren(node As Class1)
    num = Children.Count
    ReDim Children(num + 1) As String
    Children(num) = node
    node.addParent (Me)
End Function
  • 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-06T12:34:39+00:00Added an answer on June 6, 2026 at 12:34 pm

    Stefan’s answer is correct, but there are other problems as well.

    What’s this supposed to mean?

    budgeunit.addtochildren (lvl1p), budgeunit.addtochildren(lvl1m)
    

    You can’t separate two statements with a comma like that. Do you mean this?

    budgeunit.addtochildren lvl1p
    budgeunit.addtochildren lvl1m
    

    Also you should revise your use of Functions, and probably replace them with Subs. You’re not expecting any output from them, so…

    Another thing is your use of parentheses. Arguments to subs (and functions with no return value expected) should not be surrounded by parentheses; in some cases having parentheses will make things go wrong. (With some qualification if you use the Call notation, which you do not.)

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

Sidebar

Related Questions

I have created a class library called AddServiceLibrary in which I have a method
I have created my own button class called custom_btn. I created it on the
I have a peculiar problem. I created a normal Objective C class called SampleTable.
I have an entity called File, I created a partial class with a property
I would like to create a thread pool. I have a class called ServerThread.cpp,
I have created a class called SimpleCanvas which extends the JPanel class, and I
So I have created a List of a Custom Class called FinalPixel , and
I have one class called dog and another class called cat. Dog has an
So I have this problem in PHP, I have a class called unit that
I have a Module in VB.NET called Math.vb and in that module, I created

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.