> On Sep 8, 2017, at 08:04 , Bob Sneidar via use-livecode > <use-livecode@lists.runrev.com> wrote: > > Looks like others have answered your question in my stead. :-) I will give > you a good use case. <snip>
I will add this too. It would be great if a behavior had access to the local script's constants as well. This is how I make the scripts generic and universal in scope. I have the header of the script look something like this: constant cTableName = "service" constant cDGName = "dgService" constant cPriKey = "serviceid" constant cFocusField = "fldServiceDate" constant cAltTable1 = "customers" constant cAltKey1 = "custid" constant cAltTable2 = "sites" constant cAltKey2 = "siteid" If a behavior had access to these then a statement like the following would work: put aAlt1Record [cAltKey1] into tPriKeyValue1 put "SELECT * FROM " & cTableName into tQuery if tPriKeyValue1 is not empty then put "WHERE " & cAltKey1 & " = " & tPriKeyValue1 after tQuery etc. _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode