CWOODS 0 Posted January 13, 2010 Report Share Posted January 13, 2010 Hi, can anybody tell me if it is possible to have the choose by position change to a different position each time it occurs in a loop and if so how it is done? I am trying to make a facebook friend adder, many thanks in advance, Cheryl Quote Link to post Share on other sites
Guest Jim Posted January 13, 2010 Report Share Posted January 13, 2010 Hi, can anybody tell me if it is possible to have the choose by position change to a different position each time it occurs in a loop and if so how it is done? I am trying to make a facebook friend adder, many thanks in advance, Cheryl Yes. You should be able to use a variable or other node as the position, not only a hard-coded number. I just tested the following code snippet and it worked just fine. Quote Link to post Share on other sites
CWOODS 0 Posted January 13, 2010 Author Report Share Posted January 13, 2010 Thank you for your time Jim, much appreciated, unfortunately I dont understand what any of it means, my ignorance is astounding but I am very grateful that you tried to help me, Cheryl. Quote Link to post Share on other sites
Guest Jim Posted January 13, 2010 Report Share Posted January 13, 2010 here's some comments for that code snippet to explain what I did a little better:set // this initializes the #i variable to zero #i 0 / loop | |+ 10 // loop ten times | |+ inc // increment #i. this adds +1 to #i | #i | |+ choose by position // choose the #i'th <p> tag | P // so, if #i = 1, get the 1st p tag | #i // if #i = 2, get the 2nd, and so on... | |+ change chosen attribute // this just changes the text of each <p> tag | innertext // to 'lol #i' just so I could test that it was | lol {1} // in fact choosing them properly. you can do | #i // whatever chosen commands you want to do | \ end of loop Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.