Typed variables: enumerations?

Discussion in 'Basic4ppc Wishlist' started by mjcoon, Apr 25, 2009.

  1. mjcoon

    mjcoon Well-Known Member Licensed User

    Hi all; back in May 2008 Erel said in response to a discussion about variants (held in string form) versus typed (integer) variables:

    "The next major update will allow declaring regular variables in a specific type (local and global)."

    But I don't see any mention of typing against the 6.80 Beta enhancements.

    On the other hand I imagine that a new method of variable handling might be quite an extensive change...

    When thinking about my use of a variable (in my mind an integer) to hold one of three values (-1; 0; +1) I wondered if it would be just as efficient at run time to use three string values which could be more descriptive of the three meanings. Which is to say, really, what I should be using is an enumeration.

    A similar concept is the state variable which has named bits within a bit pattern. This is just an efficient boolean array that can be manipulated neatly because it is stored in a compact contiguous portion of memory.

    Any chance of importing any of these foreign concepts?

    Cheers, Mike.
  2. Erel

    Erel Administrator Staff Member Licensed User

    This feature is not included in V6.80. It will be implemented in a future version.
    Currently only arrays can be declared with a specific type.

    On some cases you can use a Hashtable instead of a Select or If .. Else If statements.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice