+ Reply to Thread
Results 1 to 5 of 5

Function Call question

  1. #1
    Registered User
    Join Date
    03-20-2013
    Location
    Saskatoon,SK,Canada
    MS-Off Ver
    Excel 2007
    Posts
    5

    Function Call question

    Hi there,

    i'm supposed to write a fuction which takes two arguments array and size of array and retur true or false. i already implemented my function and everything but i have no idea how to test it. i mean How do i test my fuction in immediate window in Excel.

    my fuction look like this: Function isUnique(myArray() as integer, mySize as integer) as Boolean

    So how do i test it in immediate window.

    Thanks

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Function Call question

    Use the Debug.Print method. Something like this...

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    03-20-2013
    Location
    Saskatoon,SK,Canada
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Function Call question

    debug.print doesn't work for me. I know how to call it in immediate window this is the example here"

    Please Login or Register  to view this content.
    BUt
    i wanna call it like this
    Please Login or Register  to view this content.
    where 3 is mySize and numbers in {} are array elements but it is not working.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Function Call question

    Type myArray as variant
    Function isUnique(myArray As Variant, mySize As Integer) As Boolean

    Then call it like this
    ?isUnique(array(1,2,4), 3)

  5. #5
    Registered User
    Join Date
    03-20-2013
    Location
    Saskatoon,SK,Canada
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Function Call question

    is there any other way we can call this function in "immediate Window" like

    Please Login or Register  to view this content.
    and still don't have to change function prototye to Variant.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1