cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Code blindness

Raiko
17-Peridot

Code blindness

Hello folks,

I have a problem with an algorythm that refuses to do as I wish - maybe it's a case of code blindness from staring to long at the screen.

I tried to write an algorythm that takes a given value from a matrix and subtracts all other values (with the exception of its own value) in this matrix from it.
I don't understand what's wrong. So if anybody has an idea how to change my code...

Thanks a lot in advance

Raiko
3 REPLIES 3

Remove all the 'return L' statements - they are causing your calculation to exit prematurely.

stv
TomGutman
1-Visitor
(To:Raiko)

Your problem is the return statement. Return causes a return from the entire expression, not just the innermost program bar. So you never get past the first value of i, as you execute a return and terminate the calculation of the entire region.
__________________
� � � � Tom Gutman
Raiko
17-Peridot
(To:TomGutman)

Hello Tom

thanks a ton for your hint - it works!

Raiko
Announcements

Top Tags