Plex 2E

 View Only
  • 1.  Meta question: how to obtain the name of the Variable, while inside a metaloop?

    Posted Feb 07, 2017 06:36 AM

    Hi All,

    In the following metaloop:

    +For Each View  DetailP

       Call a meta function

     

    Inside the meta function I'd like to obtain the name of the variable "DetailP".

    With a statement like this for example:

    +++Set Value  Field: PanelRegion, PNL region VAR

     

    Of course there are a lot of different approaches, like replacing the meta loop with a +For Variable DetailP or coding explicitly the DetailP inside the metafunction. Or also defining the Field: PanelRegion outside of the meta function. All these are fine, but for this question I would like to know if there is a meta istruction that lets me know the name of a variable even if I loop inside a +For each view <variable>.

     

    Cheers,

    Elvis



  • 2.  Re: Meta question: how to obtain the name of the Variable, while inside a metaloop?

    Posted Feb 08, 2017 04:30 AM



  • 3.  Re: Meta question: how to obtain the name of the Variable, while inside a metaloop?

    Posted Feb 08, 2017 05:21 AM

    Hi George, thanks for the reply.

    The +For Each Variable loops through all the variables and I need to know explicitly the one in which the +For Each View its looping. Every function may contains a lot of variables and some of them may have the same view, therefore neither the view name can be used to identify the variable name. 

     

    Elvis



  • 4.  Re: Meta question: how to obtain the name of the Variable, while inside a metaloop?

    Posted Feb 08, 2017 07:44 AM

    ah sorry my mistake. There is not a way outside of the ways you mentioned



  • 5.  Re: Meta question: how to obtain the name of the Variable, while inside a metaloop?

    Posted Feb 08, 2017 11:38 AM

    I was pretty sure there weren't any, but you never know. Occasionally meta code holds for you surprises and fun.



  • 6.  Re: Meta question: how to obtain the name of the Variable, while inside a metaloop?

    Posted Feb 09, 2017 07:33 AM

    Hi Elvis,

     

    Try this ...

     

    Replace Go Sub Send Message with your processing inside the +For each View.

     

    Panel - Variable

     

    Regards

    AA



  • 7.  Re: Meta question: how to obtain the name of the Variable, while inside a metaloop?

    Posted Feb 13, 2017 04:03 AM

    Hi Ahmed, thanks for the reply.
    I also thought to this solution before starting this thread but, as I said in my previous reply to George, "Every function may contains a lot of variables and some of them may have the same view, therefore neither the view name can be used to identify the variable name". So I came to the conclusion that for this solution, it should exists a command such as:
    +++Set Value Field: PanelRegion, PNL region VAR
    to use inside the metaloop to get the region in wich the +For Each View its looping.

     

    ES

     



  • 8.  Re: Meta question: how to obtain the name of the Variable, while inside a metaloop?

    Posted Feb 08, 2017 02:10 PM

    BUT what are you trying to achieve. A pattern for panels maybe?

     

    Watch out for variables holding multiple views....the model allows it but the ui will only display one of the view fields..

     

    Secondly your meta if my guess is correct could restrict on the variable group...

     

    +For Each Variable  .Panel



  • 9.  Re: Meta question: how to obtain the name of the Variable, while inside a metaloop?

    Posted Feb 13, 2017 04:30 AM

    Hi George, thanks for the suggestions.
    My question looks for a "how to" than a "best practice", which nonetheless are always welcomed. The meta function I'm writing will be a pattern. It will be called in functions created by me from scratch or may be replaced in UIStyle based functions for example. What I'm trying to achieve is to write less code, reuse it as much as I can and preserve some style in writing the code.



  • 10.  Re: Meta question: how to obtain the name of the Variable, while inside a metaloop?

    Posted Feb 13, 2017 09:32 AM

    Hi, I would like to help and your motives are commendable

     

    What pattern are your trying to create?

     

    For example some people want to create a prompt on dates on the ui and so you could explicitly call the date prompt function for every date field if focus and f4 but the meta we have outlined is a way to abstract it out.