About Store Forum Documentation Contact



Post Reply 
Problem with container.has / container.include
Author Message
mih Offline
Member

Post: #1
Problem with container.has / container.include
Hi, I have a problem with those two functions.
The code looks like that :
Code:
Memb<Str> skel_points;
Skeleton car_skel;

.....

skel_points.clear();

for(int i=0; i<car_skel.points(); i++)
{
    skel_points.include(Str(car_skel.point(i).name));
}

cmbx_front_light_points->setData(skel_points);
cmbx_back_light_points->setData(skel_points);
What I'm trying to achive is that, if there are couple points with the same name in the skeleton, I want to have only one element in the ComboBox.
In the result of the above code, there are two elements with the same name in the Combo. What is the problem ?

P.S It event adds couple elements if I wrote it like that: skel_points.include("ddd");
there are two "ddd" elements in the ComboBox then.
06-15-2010 11:20 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Problem with container.has / container.include
include operates on == operator, while for strings you need to use Equal (just do this manually instead of calling 'include')
06-15-2010 12:14 PM
Find all posts by this user Quote this message in a reply
mih Offline
Member

Post: #3
RE: Problem with container.has / container.include
thanks wink
06-15-2010 12:32 PM
Find all posts by this user Quote this message in a reply
Post Reply