Page 1 of 1

scrolling field list

Posted: Sat Mar 14, 2009 2:25 am
by smash
i am trying to work out how to use a scrolling field list
i have 2 types of questions (as usual)
1)
i have 2 scrolling lists one has a list of things, and i want to press a button that (what ever is highligted) will transfer to the othe scroll list field

2)
i have 4 scroll list fields, and i want to press a button, and what ever is highlighted in all 4 scroll lists is transfered to another field.

i have tried many many scripts, but just cant seem to find the right combination to do number 1 question.

cheers

Posted: Sat Mar 14, 2009 7:27 am
by Janschenkel
For your first question, this should get you started.

Code: Select all

on mouseUp
  -- fetch the linenumber of the hilited lines of the source field
  put the hilitedLines of field "Source" into tHilitedLines
  repeat for each item tHilitedine in tHilitedLines
    -- append it to our result list
    put line tHilitedLine of field "Source" & return after tResult
  end repeat
  -- get rid o the trailing 'return' character before updating the target field
  delete char -1 of tResult
  put tResult into field "Target"
end mouseUp
Which should give you a pretty clear idea of what to do when you have 4 source fields :-)

HTH,

Jan Schenkel.

Posted: Sat Mar 14, 2009 7:36 am
by smash
wow janschenkel

once again i was no where near, even remotely close :oops:

thank you, i am going to try it out now

thank you

Posted: Sat Mar 14, 2009 7:49 am
by smash
hi jan,
it is saying char 1 is wrong with this line
put line tHilitedLine of field "ScrollingBreed" & return after tResult
??? it looks good to me ???

Posted: Sat Mar 14, 2009 7:55 am
by smash
its ok jan, i found the problem
repeat for each item tHilitedine in tHilitedLines
i added a L to tHilitedine = tHilitedLines
AND IT WORKED FINE

thank you