private command gotcha

Bob Sneidar bobsneidar at iotecdigital.com
Fri Sep 8 11:24:48 EDT 2017


> On Sep 8, 2017, at 08:04 , Bob Sneidar via use-livecode <use-livecode at 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. 



More information about the use-livecode mailing list