Facility Control

 View Only
  • 1.  Clearing out an array.

    Posted 06-09-2016 17:56
    I have a "Load" button that reads an xml file into two parameters (int and string arrays) that are used to make a table (another parameter). Is there a simple (visual logic) way to clear out the arrays before adding all the new items read from the file? I don't mind scripting manually, but visual logic is pretty sweet, but can't be used after you edit the script manually.


  • 2.  RE: Clearing out an array.

    Posted 06-09-2016 18:21

    It would appear that there is not yet a Visual Logic block for this.

    The ogScript is pretty simple:

    params.setAllValues(OID, [""]); (for a string parameter);
    params.setAllValues(OID, [0]); (for a numeric parameter);

    If you want to still make this available in Visual Logic, you can do put an <api/> tag at the top of your file and write a simple function in it:

    <api>
    function clearParameter(oid)
    {
    params.setAllValues(oid, [""]);
    }
    </api>

    You should then see "clearParameter" appear in Visual Logic under "API Functions" on the right side.


    #DashBoard


  • 3.  RE: Clearing out an array.

    Posted 06-09-2016 18:57
    Cool! Thanks so much.
    #DashBoard