Forum Discussion

seafalcon's avatar
seafalcon
Contributor
15 years ago

About the brackets usage.

As I know, bracket[] is used for methods, and () is used for parameters.
so does that mean the this statement is wrong?


var p, w;

p = Sys["Process"]("My_NET_App");

w = p["WinFormsObject"]["MainForm"]; // Obtains MainForm




I found it in the TC manual booklet.


3 Replies

  • pabramowitsch's avatar
    pabramowitsch
    Occasional Contributor
    Am a novice userand have some questions relating to window object references.. 



    1.  Is there a white paper or help topic that gives a complete description of the object reference syntax:  brackets, parentheses and how they map to functions, function parameters, properties, property values and controls.   



    2.  Is it legitimate to concatenate references together as in:



    var p = ["xxx"]["yyy"]("zzz");

    waitSubChild(p)



    function waitSubChild(p)

    {

         var q;

         q = Aliases["mmm"][nnn] + p;

         Sys["Process"]("WINWORD")["WaitChild"](q, -1, 30000)

    }



    3.  Is there a wildcard symbol one can use in a window reference to indicate that one doesn't know how deep the heirarchy is.  E.g.

    Sys["Process"]("WINWORD")["**"]["WinFormsObject"]("WAPDockableWindowDetailCaption", "Elements")["Visible"]











  • Hi,



    1


    See the "Writing C# Scripts" help topic. If you need general information on syntax, see MSDN on JScript.



    2


    No, you need to obtain objects one by one.



    3


    You can use Name Mapping's Extended Find to do this (see the "Using Extended Search Criteria for Mapped Object Identification" help topic).