Help get this topic noticed by sharing it on Twitter, Facebook, or email.

Global Functions Files

It would be nice to be able to have function files that could be globally called from every page/panel/drawer of a handset, to avoid code duplication..

I have a piece of code that Generate $title$ to always display what Activity and Zone I am currently controling.. It would be nice to not to have to duplicate that code in every Panel/Page/Entrence.

There could be a list of file (similar to the list of entrence) and from any code we could just call those individual piece of code from any Macro anywhere in the handset
5 people like
this idea
+1
Reply
  • This idea has been posted elsewhere concerning storing variables, macros and functions on a different server. This is not something we are currently working on but other users have accomplished similar methods using Eventghost.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited indifferent, undecided, unconcerned kidding, amused, unsure, silly sad, anxious, confused, frustrated

  • 1
    Actually I was more thinking at a sort of Library of Macro inside iRule to keep macro I want to re-use, manipulating Variables and Object in iRule.. Not sending external IR or whatever.. A Macro of code Just like in a Entrence or a Button but that would be called from a button and re-used in multiples buttons that I could call whenever needed.. I think you maybe pointed a way to do this by putting all my functions into un-used entrence and calling them as needed.. would still be nice to save Macro Code 'somewhere' and call it..

    Is it possible to create macro in Invisible Button just as place holder and then call the code from another button ?.. :)

    Probably not right now but it would be a nice direction to evolve iRule functionality :)
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited indifferent, undecided, unconcerned kidding, amused, unsure, silly sad, anxious, confused, frustrated

  • 2
    GLOBAL MACROS, that's what you want.

    I and many others have been asking for this since, well, forever. It is such an important aspect of any programming system. Philips Prontos always had it. They obviously understood their importance, right from the outset.

    IRule need to get their head around the fact that they are developing a true programming environment and move on from its hobbyist origins.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited indifferent, undecided, unconcerned kidding, amused, unsure, silly sad, anxious, confused, frustrated

  • 2
    To add to my last post, I understand that introducing 'global macros' is not necessarily a trivial task. But the same functionality can be accomplished with something that I believe would be fairly simple to implement and is the way the Pronto functioned. That is to have a 'Call macro' command.

    Links now have their own command and so can be placed anywhere in a macro. We just need the addition of this new 'Call macro' command that will run the specified macro. Ideally, an option that controls whether to return to the current macro or not (GoSub or GoTo), but I can live without that, whichever is the fixed modus operandi.

    How hard can it be to add such a new command, but it would open up a wealth of new possibilities for how we construct our iRule systems . A Panel could be created just for Pages with plain buttons that simply contain 'macros' to be called from elsewhere.

    So, one new command - 'Call Macro'. Please.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited indifferent, undecided, unconcerned kidding, amused, unsure, silly sad, anxious, confused, frustrated

  • I totally agree..

    Macro could almost be stored in the already existing 'Entrence' object.. we would just need a 'Call ExternalEntrenceMacro' code, that would allow us to call entrence from another panel (just like link let us call page from another panel) and then we could create a panel with no pages just bunch of entrence that we could call from other macro.. :)
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited indifferent, undecided, unconcerned kidding, amused, unsure, silly sad, anxious, confused, frustrated

  • 1
    Yes indeed Daniel. What a difference it would make.

    However, the concept of Global Macros should not be forgotten. Really, a new 'Call Macro' command should be able to call a macro in a different handset. A little more complex to include I guess, so let's put that on the back burner for now and concentrate on just being able to call another macro in the same handset. That would be much simpler and therefore quicker to introduce. And let's face it. We want it now :-)
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited indifferent, undecided, unconcerned kidding, amused, unsure, silly sad, anxious, confused, frustrated

  • You are speaking right out of my heart. The concept of Global Macros is essential! It would make life so much easier. It is really annoying if you have complex macros tha appear on many pages and you want to change a thing, that you have to do that in every instance that macro appears, especially with the limitation of the builder that you cannot insert a command anywhere in the macro but only at the end and then have to push it upwards line by line.

    An iRule handset is by now, in my opinion, except the lack of hard buttons, equal, in some points even better then a pronto remote, but the programming environment is generations behind. The two points above are only two of the bigger restrictions.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited indifferent, undecided, unconcerned kidding, amused, unsure, silly sad, anxious, confused, frustrated

  • 1
    Actually there are 2 facets to this. Call Macro command and also the ability to store Global macros. They are not the same thing. Be good to have both, but the ability to call another macro is the crucial one we all are crying out for and happily that would be the easiest to introduce.

    I have a BIG problem with conditionals. Since they cannot be nested, it is really hard to develop any form of complex test logic and the result will always include far more processing and hence take longer to execute. A 'Call Macro' command could avoid this as the different layers of the conditional logic can be moved into different macros and hence become nested.

    So much is interconnected and being able to call another macro would really help development of iRule systems. REALLY HELP. I cannot stress too highly how much we need this.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited indifferent, undecided, unconcerned kidding, amused, unsure, silly sad, anxious, confused, frustrated

  • >> I have a piece of code that Generate $title$ to always display what Activity and Zone I am currently controling <<

    You can do that with no code at all -- just name each page with that information. You can also add Zone names in a Drawer used for that Zone.





  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited indifferent, undecided, unconcerned kidding, amused, unsure, silly sad, anxious, confused, frustrated

  • I am sharing page for muliple activity (example: TvCable1 and TvCable2 share the same PageTvCable).
    Also I dont have different Drawers for zone, all my action are the same so it's all the same button that point to different device depending on the zone, so same drawer :)


    My $Title$ are a concatenation with condition to display the Current Activity, the CurrentZone and the Current User (from a Feedback) I need to call those feedback, can't just put it directly in the page title..
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited indifferent, undecided, unconcerned kidding, amused, unsure, silly sad, anxious, confused, frustrated