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
  1. Home
  2. General Programming
  3. Visual Basic
  4. Passing MultiDimensional Array as a paramenters in Functions

Passing MultiDimensional Array as a paramenters in Functions

Scheduled Pinned Locked Moved Visual Basic
tutorialdata-structures
3 Posts 2 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.
  • H Offline
    H Offline
    hsprasain
    wrote on last edited by
    #1

    Hey: I want to pass two dimensional array in my function and return one dimensional array. My function will take two parameters: 1. two dimensional array 2. Row number. Once I call this function, it should return me one dimensional array i.e the row. For example, Dim data(2,2) as Double Dim row as integer Dim tempRow(2) as Double row=0 tempRow=returnRow(data,row) When I called this function, it should return me the first row since row is 0 Can you please me how to pass the multidimensional array and return one-dimensional array back. hsprasain

    T 1 Reply Last reply
    0
    • H hsprasain

      Hey: I want to pass two dimensional array in my function and return one dimensional array. My function will take two parameters: 1. two dimensional array 2. Row number. Once I call this function, it should return me one dimensional array i.e the row. For example, Dim data(2,2) as Double Dim row as integer Dim tempRow(2) as Double row=0 tempRow=returnRow(data,row) When I called this function, it should return me the first row since row is 0 Can you please me how to pass the multidimensional array and return one-dimensional array back. hsprasain

      T Offline
      T Offline
      TwoFaced
      wrote on last edited by
      #2

      You can accept a multidimensional array like this.

      Private Function GetRow(ByVal data(,) As Double, ByVal row As Integer) As Double()
      
      End Function
      

      The function also returns a 1-dimensnial array. All the function needs now is to get the values from the array and return them as 1-dimensional array.

      H 1 Reply Last reply
      0
      • T TwoFaced

        You can accept a multidimensional array like this.

        Private Function GetRow(ByVal data(,) As Double, ByVal row As Integer) As Double()
        
        End Function
        

        The function also returns a 1-dimensnial array. All the function needs now is to get the values from the array and return them as 1-dimensional array.

        H Offline
        H Offline
        hsprasain
        wrote on last edited by
        #3

        Thanks!!

        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