Param Naming - Object by Reference Best Practices
Sannyasin Brahmanathaswami
brahma at hindu.org
Wed May 31 17:06:25 EDT 2017
The more libs/behaviors we use the more we are passing params that reference objects
This fails
put "graphic portal-title-bkgnd" into pObject
setGradient pObject
command setGradient pObject
local tNewGradientArray
# be careful when cutting and paste to and from email
# tabs may get replace by spaces:
put "from 208,-201|mirror false|quality good|ramp 0.13000,255,255,255,0" &\
return into tNewGradientArray
put "0.62001,60,11,9,212|repeat 1|to 208,-304|type linear|via 536,-201|wrap true" \
after tNewGradientArray
split tNewGradientArray by "|" and tab
set the fillGradient of pObject to tNewGradientArray #breaks with error here…
end setGradient
but this works
put "graphic portalTitleBkgnd" into pObject
Why? and what is best practice where one needs to refer to objects
via a parameter
via Send
Vis Dispatch
etc. my code tends to waffle all over the place with methods for doing this.
One does not expect this to be improperly evaluated
put "graphic portal-title-bkgnd" into pObject
What do you do? And why?
BR
More information about the use-livecode
mailing list