Uploaded image for project: 'CloverDX'
  1. CloverDX
  2. CLO-18045

Type casting functions

    XMLWordPrintable

Details

    • Story
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • rel-5-6-0
    • Engine
    • Security Level: Users (General product issues)
    • 8
    • UNDECIDED
    • Green Sprint 107, Green Sprint 108

    Description

      Introduce new functions:

      • function string getType(variable) - returns string representation of variable type. e.g. “string” if variable is of type string
        variant myvariant = “ABC”;
        string variant_type = getType(myvariant); // variant_type will contain “string"
        
      • function <type> cast( variant_variable, <variable type literal>, <..optional element type literal..>) - performs “cast” of variant variable to specified type. Performs check whether specified variant variable actually contains data/value of that type. Due to extra complexity it does not check “element type” of list or map - i.e. if specified cast(variantvar, list, string) then it checks only that variantvar contains list without examining whether list contains items of type string.
        variant myvariant = “ABC”;
        string mystring = cast(myvariant,string);
        myvariant = 10;
        int myinteger = cast(myvariant,integer);
        date mydate = cast(myvariant,date); //will cause error as myvariant currently contains data/value of type integer
        myvariant = [1,2,3];
        integer[] myintlist = cast(myvariant,list,integer);
        

      Attachments

        Issue Links

          Activity

            People

              krivanekm Milan Krivanek
              krivanekm Milan Krivanek
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 days, 5 hours
                  3d 5h