Scripting: static collection 2004-03-10 - By Christian Rittener
Back Thanks Bradley. That's what I was suspecting. I did a few things in C just as OOP was becoming all the rage, so I understand pointers etc. Didn't read about them in Jscript anywhere online, though. Are there books about data structures etc. in Jscript?
Christian Rittener
Bradley Gabe wrote: > Some basics on OOP. You'll need to get a firm grip on the difference > between assigning pointers to objects, creating objects, running > object > methods, and getting/setting object properties. > > ch_coll = new ActiveXObject( "XSI.Collection" ); // Creates a new XSI > Collection obj pointed to by ch_coll. ch_sel = selection ; // Points > var ch_sel to already existing Selection object. > ch_coll = ch_sel ; // Points var ch_coll to same thing ch_sel is > pointing to, selection. > > // What you've done is create an object, then lose it by reassigning > its > pointer to something else. > > > ch_coll = new ActiveXObject("XSI.Collection"); // Create a new XSI > Collection obj > ch_coll.AddItems(selection); // Populate the new collection with > items > from selection object. > > // Once the AddItems() method is run, your ch_coll is set and won't do > anything until you add or remove items. > >> Hello, >> >> I'm trying to go all OOP, so please be indulgent. >> >> In Jscript, I'm trying to use ExtractFromComponents while looping >> through aselection of geometries and then looping through their >> respective clusters. As soon as a new object is created, it becomes >> selected, screwing up my outer loop. How do get the selection >> collection to remain fixed to what it is at the beginning of the >> script? I tried copying Selection into a new collection, with >> >> ch_coll = new ActiveXObject( "XSI.Collection" ) ; >> ch_sel = selection ; >> ch_coll = ch_sel ; >> >> and looping through the second collection, but the same thing >> happens... ??? >> >> Christian Rittener >> >> --- >> Unsubscribe? Mail Majordomo@(protected) with the following text in >> body: unsubscribe xsi
--- Unsubscribe? Mail Majordomo@(protected) with the following text in body: unsubscribe xsi
|
|