Ravi,

I can't tell how the handler is called or when the question num is 
incremented. 

To keep your answer direct, I'll assume that each line in the answers 
field contains all answers for each question, that gQuestionNum is 
assigned elsewhere, and that your destination field is related to the 
question.
 
All you really need to do is add the RETURN constant after each answer. 
Below, I've added two niceties. First, I've stored the old itemDelimiter 
("," by default) and restored it after every switch, in case you ever 
need to use the default behavior eslewhere. This prevents the need to 
switch it again later back to the comma. This is not needed to answer 
your question. Secondly, I've only put a RETURN after the answer if it's 
NOT the last answer in the field. This prevents an extra return from 
being added to the end of the field.

Also, don't forget that your item delimiter doesn't include spaces. If 
your answers are "answer1;answer2;answer3;answer4" you'll be fine. But, 
if they're "answer1; answer2; answer3; answer4", you will have a space as 
the first character for answers 2-4.

I hope you can adapt this to your needs.

on showAnswer
  oldDelim = the itemDelimiter
  the itemDelimiter = ";"
  text = member("answers").text.line[gQuestionNum]
  repeat with x = 1 to text.item.count
    if x = text.item.count then
      member("testField").text = member("testField").text & text.item[x]
    else
      member("testField").text = member("testField").text & text.item[x] 
& RETURN
    end if
  end repeat
  the itemDelimiter = oldDelim
  gQuestionNum = gQuestionNum + 1
end 

Rich Shupe

[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/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!]

Reply via email to