Announcement

Collapse
No announcement yet.

How to change PB RTL's default behavior for VARIANT variables?

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

  • How to change PB RTL's default behavior for VARIANT variables?

    What I mean is, if an " AS" is not explicitly used when assigning a numeric value to a variant variable, the variant variable defaults to being a VT_R8 type. Most of the numeric work I do is better suited for integer types, not floating number types. So, does anybody know a way I can hook the PB RTL, so to speak, so it uses VT_I8 as its default numeric type for variants rather than using VT_R8 as its default?

    Thanks much for any assistance.

  • #2
    New feature Suggestion?
    Code:
    #VARIANT NUMERIC DEFAULT LONG|R8|SINGLE|DOUBLE|whatever
    Kind of a "DEFINT" for otherwise untyped assignment to variables of type VARIANT.

    BTW, "hooking the runtime" can do no good. All the underlying machine instructions to perform those assignments occur at compile time.

    MCM
    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      Yup, that's pretty much what I figured, from my own experimenting. Thanks for your reply.

      Comment


      • #4
        Well, you could always create a MACRO..
        Code:
        MACRO vLet (vVar, num) =  LET vVar = num AS type
        
        ...
           vLet     (vVar, 1234.56)
        Then you could change the "AS type" in the MACRO with impunity......
        Michael Mattias
        Tal Systems (retired)
        Port Washington WI USA
        [email protected]
        http://www.talsystems.com

        Comment


        • #5
          Thanks for the idea, Michael. Sorry for taking so long to reply, just got too much going on right now.

          Comment

          Working...
          X