Wish [B4X] Multiple Conditional Symbols

hatzisn

Expert
Licensed User
Longtime User
Some times it is needed to use multiple Conditional Symbols. For example if you have two conditional Symbols (lets say PaidNoAds and WithAds) and you have to add SimpleMediaManager which requires its own Conditional Symbols according to what you will use it for. Then what do you do? You have to use the coditional symbols of SMM and also in the same time one of the above. If you do this then the execution passes from both IFs if you choose SMM_ZOOM:

B4X:
#if PayNoAds OR SMM_ZOOM
    'DO SOMETHING
#end if

#if WithAds OR SMM_ZOOM
    'DO SOMETHING
#end if

I know that it is possible to replace conditional symbols with variables checking to know which condition is valid but I still think it is a nice thing to have.
 

aeric

Expert
Licensed User
Longtime User
If I understand correctly.

1779359014164.png
1779358984897.png
1779359601658.png


B4X:
#if PayNoAds
    LoadPremiumFeature
#end if

#if WithAds
    LoadLimitedFeature
#end if

#if SMM_ZOOM
    EnableSmmZoom
#End If

Optionally, there is a "Default" configuration with empty Conditional Symbols where all the 3 scenarios will not be met.
 

hatzisn

Expert
Licensed User
Longtime User
Thanks, I was not aware that you can choose more than one conditional symbols in a configuration. I will try it a.s.a.p.
 

hatzisn

Expert
Licensed User
Longtime User
Thank you @aeric. It worked.
 
Top