Variables if condition

Problem: Hi,
I have a variable called ‘color’ say value for it is ‘green’.
I want another variable ‘number’ for which I need to set value depending on the value of color variable. example: if color = green, number = 10, else number = 8.

How to set it up globally? I couldn’t find it in manual and I don’t have programming background. Tried advanced actions but couldn’t succeed.

ActivePresenter Version: 8

OS: Required. Win10

Hi Shripad,

You can assign the variable as a property of prez object so it can be accessed globally.

prez.color = ‘green’;

Regards,

It seems that you’re talking about normal variable in ActivePresenter. If yes, please take a look at this tutorial to learn how to use variables:

Regards,

Hi Nam,

Hope you all are fine and taking necessary care in this situation.

Thanks for both the emails. Went through the tutorial as well. My need is little deeper than what tutorial covers probably.

Actually color green was just an example. We have 2 software products with just a name difference. Functionality remains same though versions are different for both the products.

Let’s say ‘prodname’ variable is defined with two product names ex: India and Vietnam. India versions are 12.2, 12.1, 11.2 etc. and Vietnam versions are 7.8, 7.6, 6.9 etc.

If I want to take html output of product name India, the version figures will show series of 12 or 11. If taking output of Vietnam, the version figures will show series of 7 or 6. In this case consider for one version that is 12.2 and 7.8.

Condition 1 – If, prodname = India, I want certain text boxes show text/number as 12.2.

Condition 2 – If, prodname = Vietnam (or not equal to India), I want those text boxes to show text/number as 7.8.

These are just different versions of the product. When product name changes, version needs to be updated. I suppose I need to use ‘If’ condition somewhere but unable to do it.

Please let me know if you need more information.

Thanks,

Shri

Hi,

You should use two variables ‘prodName’ and ‘prodNumber’ to keep the Product Name and Product Version. Then you can initialize the product name in project load event and adjust the product number corresponding product name.

Each time you want to change the product, just change product name in project load event and re-export the project.

You can see more details in this sample:
VariableSample.approj (212 KB)

Regards,

Hi Nam,

This is good, thanks!

Is it possible to change the images also, like for prodname India, images are different and for prodname Vietnam, images are different.

May be a provision to store two sets of images in different folders, and depending on the prodname, I can select the folder manually before generating html5 output.

Hi Shri,

Yes, you should use Image states to do that. Please take a look at this tutorial: https://atomisystems.com/tutorials/ap7/working-object-states/

Regards,