Three very simple questions

Mark Wieder ahsoftware at sonic.net
Sun Apr 26 15:23:58 EDT 2020


On 4/26/20 12:09 PM, Sannyasin Brahmanathaswami via use-livecode wrote:
> "globals are evil"
> 
> But we use  one array
> 
> Global gConfigA
> 
> and we stuff it with all manner of "things" including another arrays
> 
> it turns about to quite useful

Yes, I do what you and Jacque do as a workaround, of course. I recently 
implemented a feature management infrastructure the same way, given the 
lack of globally available constants.

on preOpenStack
global g<app>Features
put "feature1,feature2,feature3" into g<app>Features
end preOpenStack

...some other stack

global g<app>features
if "feature2" is among the items of g<app>features then
...

on closeStackRequest
delete variable g<app>Features
end closestackRequest

great for A/B testing, rolling out new features without messing with 
existing code, being able to roll back unwanted or not-working features 
after beta testing... and would be so much cleaner if we didn't have to 
resort to global variables and remember to put a reference to them in 
each place they're referenced...

-- 
  Mark Wieder
  ahsoftware at gmail.com




More information about the use-livecode mailing list