+ Reply to Thread
Results 1 to 3 of 3

Determining Arrays and Errors

  1. #1
    Registered User
    Join Date
    03-31-2009
    Location
    Auburn Alabama
    MS-Off Ver
    Microsoft Office Excel 2007 (Windows)
    Posts
    99

    Determining Arrays and Errors

    Hello,
    My question is: What's the proper way to determine if a variable holds an array?

    I have a function that returns either an empty variable or an array.

    If the function does not return to my variable an array, and I treat the variable as an array, then it obviously throws an error.

    So my question is, is there a way to determine if a variable is an array without throwing an error?

    If not, is there a way to code an if/then statement to see if an error is thrown, maybe something like below?

    Please Login or Register  to view this content.
    Or do i have to just assume the variable is an array and use the "On Error" statement every time?

    If there is no way getting around using the "On Error" statement, what's the proper way to set this particular scenario up. I try to use as little GoTo statements in my code as possible because I feel they junk it up. Is that a foolish concern?

    The thing is, I'm trying to learn to code as cleanly as possible. But this scenario always leads me to some ugly solution.

    Thanks for any and all help!
    Last edited by CrazyFileMaker; 05-11-2010 at 04:27 AM.

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Determining Arrays and Errors

    Hey CrazyFileMaker

    Please Login or Register  to view this content.
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Registered User
    Join Date
    03-31-2009
    Location
    Auburn Alabama
    MS-Off Ver
    Microsoft Office Excel 2007 (Windows)
    Posts
    99

    Re: Determining Arrays and Errors

    pike,

    That's exactly what I needed to know!

    Thanks!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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