Aveva cant see a method returning an c# string []array from .dll

 
  • Hi!

    I'm having problem with Aveva not recognizing a method from c# dll that returns a string array. (public method string[] nameArr())
    When i try to access it, it cant be found. and if I "q var" methods of the .dll it is not shown there, but if I change it to string it can be seen.
    Am I doing something wrong or does aveva not recognize returning arrays?

    Thanks for any help! =)
  • Hi Metzger !

    You need to use Hashtable (which contains a key-value pair of double-string in your case) to returns a PML Array from a PMLNetCallable method.
    The key starts at 1 (corresponding to the first index of the PML Array).
    Example to convert your string[] to this kind of Hashtable:

    string[] resultValues = new string[] { "A", "B", "C" };
    Hashtable output = new Hashtable();
    foreach(string resultValue in resultValues)
    {[INDENT]output.Add((double)(output.Count + 1), resultValue);[/INDENT]
    }

    return output;


    You have here the list of .Net types accepted by PML here, at the middle of the page:
    https://help.aveva.com/AVEVA_Everything3D/3.1/wwhelp/wwhimpl/js/html/wwhelp.htm#href=NCUG/NCUG5.07.3.html