Jump to content
yuwen

questions on Basic Flist operation

Recommended Posts

Hi,

I am trying to create an Flist containing Fdouble values, and would like to use the .sort() class function to sort the values within the list. However, when i do that, i got an error,  *** ERROR Command Control : failure [invalid expression "|04_partision|clean_partision_gen1:Wing_x_loc_array.maxElement()": Cannot execute non-const command on const object]

May i know what does it mean by a non-const command and const object ? Thank you.

Yuwen

Share this post


Link to post
Share on other sites

Hi Yuwen,

it usually means that you try to modify an object that you are not allowed to (in order to prevent recursion). If you just need the max value, you could (inside a feature) use a doubleSeries like this:

FDoubleSeries values([1,2,3,4,5,4,3,2,1])
FDouble maxVal(values.getMax())

Cheers,
Heinrich

Share this post


Link to post
Share on other sites

Hi Heinrich,

Thanks for the reply. How about if i want to sort an array in an ascending order ? One of the reason I want to use FList is because it seems to be the only type that has a built-in sorting feature, but apparently it has the same recursion issue.  Is there any other object that allows me to return an sorted array from an input Fdouble/Finteger array ?  Thank you.

Yuwen

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...