Warning: Operator '==' cannot be applied to operands of type 'int[]' and 'int' Cant get it to work

Hi All

I need some help here please.

Got script that works in dynamo 2.0.3 but wont work in dynamo 2.1.0

Getting this error

"Warning: Operator ‘==’ cannot be applied to operands of type ‘int[]’ and ‘int’"

I have attached screen shot for reference.

Thanks in advance

Regards

use brackets in each sub if statement

A1 == 0 ? ( … ) : ( …)

1 Like

Thanks for your time
But still got same error

A1 == 0 ? ("A"+a+","):A1==1 ? ("B"+a+",") : A1==2 ? ("C"+a+",") : A1==3 ? ("D"+a+",") : A1==4 ? ("E"+a+",") :(A1==270);

try this

A1 == 0 ? ("A"+a+","):(A1==1 ? "B"+a+"," : (A1==2 ? "C"+a+"," :( A1==3 ? "D"+a+"," : (A1==4 ? "E"+a+"," :270))));

brackets in each if statements condition, the last section is a value so it should be 270 only not A1 == 270

1 Like

Thanks again.

Now all lines returns 270

that is because A1 values is in sublist, use Flatten node after List.AllIndicesOf node

1 Like

maybe you can try flattening your list first, i believe is your list structure that is causing the issue

1 Like

Problem is that i have 200 lists with tottal off 600 items if i flatten i get 600 new list.

I need to keep structure same otherwise my data gets all over the place.

I just dont understand why same script works in dynamo 2.0.3 fine but wont work in 2.1
Regards

Likely some degree of luck around the empty lists. Try using an == node to make leveraging lacing and list levels possible, That may or may not work based on the location of the empty list. If so building the data structure as a set of dictionaries, or switching to an imperative function to run the whole test set will be your best bet.