Announcement

Collapse
No announcement yet.

Array Bounds

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #21
    Originally posted by Cliff Nichols View Post

    Hmmmm....that makes me wonder?? If you can get the attributes of an array, can you get the attributes of a variable to see if it were declared as long, or as string???
    You can get some information by using LEN(). If it's 20 long, it's a string. If it's 4, it could be a LONG.
    Code:
    #COMPILE EXE
    #DIM ALL
    
    FUNCTION PBMAIN () AS LONG
    
        LOCAL s AS STRING, l AS QUAD, e AS EXT
        s = "12345678901234567890"
        ? STR$(LEN(l))
        ? STR$(LEN(s))
        ? STR$(LEN(e))
    
    END FUNCTION

    Comment


    • #22
      No, but if you are curious about what type of data has been passed to your function, you can pass it as a one element array and use array techniques.

      Code:
         REDIM  Z(0) AS whatver_type_is_convenient_right_now 
         Z(0)  =  the value 
         CALL    MyFunctionWhichHandlesAnArrayofAnyType (Z())
      MCM
      Michael Mattias
      Tal Systems (retired)
      Port Washington WI USA
      [email protected]
      http://www.talsystems.com

      Comment

      Working...
      X