function does not w...
 
Notifications
Clear all

function does not work

2 Posts
1 Users
0 Reactions
1,228 Views
(@bene-norbert)
Posts: 2
Member
Topic starter
 
The task would be to set the value of a variable to +1 and -1 depending on the state of a checkbox. 

I want to use the following script:


function test(){
const increment = mainInterface.getProperty("Oldal.chb1.IsChecked") ? 1 : -1; 
mainInterface.setVariable("mbus.var1",increment);
}

The function continuously returns a value of "+1" regardless of the state of the checkbox
What could be wrong?

 
Posted : 24/03/2025 2:02 p.m. CET
(@bene-norbert)
Posts: 2
Member
Topic starter
 

I solved the problem: 

let_ertek1= mainInterface.getProperty("Oldal.chb1.IsChecked");

if (let_ertek1 == "true" )
{valt1=1}
else
{valt1=-1}

 
Posted : 28/03/2025 7:48 a.m. CET