Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. My VB6 sucks - what is this? Array("hello")

My VB6 sucks - what is this? Array("hello")

Scheduled Pinned Locked Moved Visual Basic
questioncomdata-structureshelp
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gvanto
    wrote on last edited by
    #1

    My VB really sucks, after googling, I still can't find what Array("UserCode") is in the following line:

    vUsers = m_ObjUser.Retrieve(Array("UserCode"), -1)

    Help much appreciated thanks!

    Find Your Dream Job in Australia, Free! http://www.WebCV.com.au

    J L D 3 Replies Last reply
    0
    • G gvanto

      My VB really sucks, after googling, I still can't find what Array("UserCode") is in the following line:

      vUsers = m_ObjUser.Retrieve(Array("UserCode"), -1)

      Help much appreciated thanks!

      Find Your Dream Job in Australia, Free! http://www.WebCV.com.au

      J Offline
      J Offline
      Johan Hakkesteegt
      wrote on last edited by
      #2

      From you personal comment I glean that this is legacy code, so I won't ask why you're messing about with VB6 still. Without seeing all the relevant code, my guess is that this line breaks down as follows: vUsers is a string that should hold a user's name ? m_ObjUser is a custom object or class, that holds methods to get data about a user ? .Retrieve(TheUserCode, SomeIntegerDeterminingSomething) is a method that gets the user's name based on his code ? Array("UserCode") is an array that has a named index ("UserCode") which holds and returns the user's code. Although it seems a bit strange that that syntax would return anything. You could just put MsgBox(Array("UserCode")) just before the line you posted, and see what it says. The user code can end up in this array in any of a million ways. In other words just use the search function of your editor, and find out when / where this Array("UserCode") is created and/or gets populated.

      My advice is free, and you may get what you paid for.

      1 Reply Last reply
      0
      • G gvanto

        My VB really sucks, after googling, I still can't find what Array("UserCode") is in the following line:

        vUsers = m_ObjUser.Retrieve(Array("UserCode"), -1)

        Help much appreciated thanks!

        Find Your Dream Job in Australia, Free! http://www.WebCV.com.au

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        This does not seem to be VB6 array syntax. 'Array' must be a user defined function that takes in a string as paramter and returns something (which is used by m_ObjUser.Retrieve). Hint: Right click on 'Array' and select 'Definition' from the context menu to see what it means.

        1 Reply Last reply
        0
        • G gvanto

          My VB really sucks, after googling, I still can't find what Array("UserCode") is in the following line:

          vUsers = m_ObjUser.Retrieve(Array("UserCode"), -1)

          Help much appreciated thanks!

          Find Your Dream Job in Australia, Free! http://www.WebCV.com.au

          D Offline
          D Offline
          Dave Doknjas
          wrote on last edited by
          #4

          'Array' is a global method in VB6 which takes a parameter array and returns an array of 'Variant'. You can replace it by: New Object() {"hello"} or even better: New String() {"hello"}

          David Anton Convert between VB, C#, C++, & Java http://www.tangiblesoftwaresolutions.com

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups