Forum Discussion

sameerjade's avatar
sameerjade
Frequent Contributor
4 years ago

Parameterizing Regions (images) under Stores in a function

Hello, I am trying to parameterize regions (images) under Stores but it seems to not work. I tried with these 2 methods, 'Region.Check' and 'Region.Compare'. Here is what I have tried:   First wor...
  • AlexKaras's avatar
    4 years ago

    Hi,

     

    It is my guess that you pass string as the value of myRegion input parameter in both cases.

    I.e. you call  ValidateRegion1() function like this:  ValidateRegion1('region1', ...)

    If my guess is correct, then you should use eval() or evaluate() function depending on what is provided by your script language:

    eval('Regions.' + myRegion + '.Check(onscreenObj, transparentParam, mouseParam, pixelTolParam, colorTolParam, maskParam)');

    and

    Regions.Compare(eval(myRegion), onscreenObj, transparentParam, mouseParam, pixelTolParam, colorTolParam, maskParam);

     

    Does this help?