• I have several xml files to storage panoramas data. Data section in each of them looks like this:

    Code
    <thumbs ...>
            <pic name="1" .../>
            <pic name="b" .../>
            <pic name="c" .../>
            <pic name="d" .../>
            <pic name="e" .../>
        </thumbs>

    There's also one main xml file which loads data files by loadpano(xmfile,null,IGNOREKEEP).

    What's the problem?

    When I load data file with 3 items, 3 thums are ceated. When I go back to main xml file and load data file with 5 items: 5 thumbs are ceated. But when I go back again to main xml file and load data file with 3 items; 5 thumbs are created. So it seems to be one global array in memory, and even you load data section with 3 items, previous data section with more items is remembered and displayed (I mean data sections are merged).

    Question (perhaps for Klaus)

    Is there any way to initialize new loaded data section and prevent merging old and new thumb objects? I tried some ideas (eg. make something like reset in main xml file by set(thumbs.pic.count,0) or set(thumbs.pic.count,1) but this change is treated globally (all loaded data sections have length of 0 or 1.

  • Thanks Sacha but it will not work.

    I think you don't understand the problem. When I write "data object" I don't mean <data ... />. I mean any xml node that could be used to store any data. I use eg. <thumb ... /> so I could use set(thumbs.count,0) but it still doesn't work. I tried to use set(thumbs.pic.count,0) and it works, but when i load another data section, thumbs array has no items.

  • Oh right, I had this same problem and there was a thread about it 3? months ago.

    Anyway, here's what I'm doing and if you can find it I think Klaus suggested another method..
    Basically, the array is getting destroyed, but the plugins you created with it are left behind, so you need to destroy those as well. This code is for different thumbs so adjust to your setup.

    Code
    for(set(i,0), i LT thumbnails[thumbs1].thumb.count, inc(i), 
    		txtadd(r_name,'thumbs1_thumb_',get(i));
    		txtadd(f_name,'thumbs1_frame_',get(i));
    		removeplugin(get(r_name));
    		removeplugin(get(f_name));
    	);			
    	set(thumbnails.count, 0);

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!