Writing a correct function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • cmdolcet69

    Writing a correct function

    How can i write a correct function: If i write a function as this:

    Public Function BatterList (ByRef port as integer) as ImageList

    Dim image1 as image

    return image1

    end function

  • =?Utf-8?B?VGVycnk=?=

    #2
    RE: Writing a correct function

    Not really sure what your question is, but I think
    dim image1 as image
    should be
    dim image1 as New image
    --
    Terry


    "cmdolcet69 " wrote:
    How can i write a correct function: If i write a function as this:
    >
    Public Function BatterList (ByRef port as integer) as ImageList
    >
    Dim image1 as image
    >
    return image1
    >
    end function
    >
    >

    Comment

    • Armin Zingler

      #3
      Re: Writing a correct function

      "cmdolcet69 " <colin_dolcetti @hotmail.comsch rieb
      How can i write a correct function: If i write a function as this:
      >
      Public Function BatterList (ByRef port as integer) as ImageList
      >
      Dim image1 as image
      >
      return image1
      >
      end function




      Armin

      Comment

      • kimiraikkonen

        #4
        Re: Writing a correct function

        On Mar 6, 8:59 pm, cmdolcet69 <colin_dolce... @hotmail.comwro te:
        How can i write a correct function: If i write a function as this:
        >
        Public Function BatterList (ByRef port as integer) as ImageList
        >
        Dim image1 as image
        >
        return image1
        >
        end function
        However in your function, "port" argument is missing and remains
        unused. Also be sure that you really need "ByRef" instead of "ByVal".

        Comment

        Working...