About IfEx command - Forum

Forum Navigation
You need to log in to create posts and topics.

About IfEx command

Thanks in advance.

I´m using a conditional sentence in order to select some/different values

If "[Activ]" "=" "1"
   SetVar "[METs]" "0.9"
EndIf
..
If "[Activ]" ">=" "2"
   SetVar "[METs]" "1"
EndIf
..
IfEx "[Activ]>=4 OR [Activ]<=6"
   SetVar "[METs]" "1.8"
EndIf

Thank you in advance for your help.
I have placed a list of options and depending on them the number is set in the variable [Activ]. Several activities have the same factor [METs]. For options 1 and 2 the command operates normally, but it also enters when [Activ] has values between 4 and 6 even though option 1 is selected. What am I missing or doing wrong? Thanks for any help.

 

Gracias de antemano por su ayuda.
He colocado una lista de opciones y dependiendo de ellas se establece en número en la variable [Activ]. Varias actividades tienen un mismo factor [METs]. Para las opciones 1 y 2 el comando opera normalmente, pero también entra cuando [Activ] tiene valores entre 4 y 6 aunque se haya seleccionado la opción 1. ¿Qué estoy pasando por alto o haciendo mal? Gracias por cualquier ayuda.

@carlost esto no es correcto porque cualquier número es mayor o igual a cuatro o menor o igual a seis:

IfEx "[Activ]>=4 OR [Activ]<=6"
   SetVar "[METs]" "1.8"
EndIf

Debería cumplir ambas condiciones al mismo tiempo, no una u otra:

IfEx "[Activ]>=4 AND [Activ]<=6"
   SetVar "[METs]" "1.8"
EndIf

Saludos!

danito has reacted to this post.
danito