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

Type casting functions

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: rel-5-6-0
    • Component/s: Engine
    • Security Level: Users (General product issues)
    • Story Points:
      8
    • QA Testing:
      UNDECIDED
    • Epic Link:
    • Sprint:
      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

              Assignee:
              krivanekm Milan Krivanek
              Reporter:
              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