How to pass any kind of a operator in a variable and later use that variable in a if condition

So i was wondering if we can pass a operator in a variable just as a string or something and then use that variable to do different kind of condition

i know it doesn’t make any sense but i just wanted to try something for fun

for eg :- variable “opt” which holds value of “<” and there are two int variables that holds two different amount one is less then another

now in a if condition how can i just add thes three varibale

if(num1 opt num2)

Hi @indiedev91 ,

I believe we will not be able to convert a String value to an operator.

But for your case, if you do know the different types of operator that we could get in the Process or as request. Then we could use a Switch Activity to map the operator to the proper case and then Execute the Operation/Create the Logic within that specific case.

Example Skeleton below :
image

@indiedev91 You can use This in assign activity as opt = chr(60)
but it does not work as condition

sorry i forget to mention is that the catch is we dont have to use any switch case

as mentioned by @supermanPunch we cannot bypass the compiler and its compilation step.

Have a look here:

And also here:

as maybe the offered eval() functionality can be used / integrated

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.