Results 1 to 5 of 5

Thread: [RESOLVED] Trouble with VB6: What is the issue here?

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2007
    Posts
    3

    Resolved [RESOLVED] Trouble with VB6: What is the issue here?

    Hey everyone. I'm using Visual Basic 6, and trying to use a library for a specific control application. The function that I'm attempting to access has this syntax:

    Code:
    Syntax:	cpObject.SetElement index, elementValue
    and the code I'm using is

    Code:
    cp.SetElement(1, txtValue.Text)

    The error I'm receiving is "Expected: =" on that line.

    I was under the impression that this SetElement function is not a value-returning function, since all it is doing is setting the element of an array. What is the issue here? Let me know if you need more information, and thanks.

  2. #2
    Hyperactive Member half flung pie's Avatar
    Join Date
    Jun 2005
    Location
    South Carolina, USA
    Posts
    317

    Re: Trouble with VB6: What is the issue here?

    VB is expecting
    Code:
    Something = cp.SetElement(1, txtValue.Text)
    I think what you are wanting to do is have no returned value, therefore use
    Code:
    cp.SetElement 1, txtValue.Text
    Notice the lack of parenthesis.

    Base 2
    Fcnncu"Nqxgu"Lguug##

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2007
    Posts
    3

    Re: Trouble with VB6: What is the issue here?

    How disgustingly simple and annoying. Thanks for the help!! I'll probably be back around over the next few days, I hardly ever work with VB, I'm more of a C++ person =\

    Thanks again.

  4. #4
    Hyperactive Member half flung pie's Avatar
    Join Date
    Jun 2005
    Location
    South Carolina, USA
    Posts
    317

    Re: Trouble with VB6: What is the issue here?

    Don't forget to mark this thread "Resolved". (Click the Thread Tools button above your first post)

    Base 2
    Fcnncu"Nqxgu"Lguug##

  5. #5

    Thread Starter
    New Member
    Join Date
    May 2007
    Posts
    3

    Re: [RESOLVED] Trouble with VB6: What is the issue here?

    Done, and thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width