You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Saturday, April 7th 2012, 9:58pm

count action?

How can I count how many I have AddItem within this action?

if(i LT ????.additem.count,



plugin[combobox].removeall();
additem('get(texto_menu_001)', action(moveto1); );
additem('get(texto_menu_002)', action(moveto2); );
....


thank you

This post has been edited 1 times, last edit by "Weslley" (Apr 7th 2012, 10:31pm)


2

Thursday, April 19th 2012, 1:42pm

Hi,

you really want to count the 'additem' calls inside an action or do you just want to know how many items are there?

the number of items can be get by plugin[comboboxpluginname].item.count,

but if you want to analyze the action code itself, it would be necessary to parse the "action[name].content" by the indexoftxt action and count the 'additem' occurrences, e.g.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
set(done,false);
set(pos,0);
set(additem_count,0);
copy(txt, action[name].conten);
loop(done==false, 
  indexoftxt(p, get(txt), 'additem', get(pos));
  if(p GE 0,
     add(pos,p,1);
     inc(additem_count);
  ,
     set(done,true);
  );
);
trace('additem occurrence count = ', additem_count);


best regards,
Klaus