Thanks everyone for your help. The handler finally works! Final version below ... with my commentary. Cheers, John
on InsertMembers repeat with nMem = 1 to 5 -- repeat loop set up & nMem=1 initialised mTextMember = new ( #text, castlib("Internal" )) -- Variable mTextMember assigned to next available free (Internal) cast member mTextMember.text = "This is member number" && nMem.string -- Contents of textMember are assigned to cast member mTextMember.name = "cast member"&&nMem -- Cast member is named end repeat END InsertMembers ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, December 06, 2002 10:00 AM Subject: Re: <lingo-l> New learner: how do write a handler that inserts text memebers in the cast? > swap the string function around as below. the string function which turns a variable into a string is a standalone function and should not have been part of the object nMem: > > on InsertMembers > repeat with nMem = 1 to 5 > mTextMember = new ( #text, castlib("Internal" )) > mTextMember.text = "This is member number" && string(nMem) > mTextmember.name="cast member"&&nMem > end repeat > END InsertMembers > > more importantly though, do you understand what this handler is doing and how it is doing it. If you are trying to learn lingo at the same time it is kind of important that you see what each component does. > > hth > > Fraser > > > [To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!] > [To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]