How to swap text from 2 text fields
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
How to swap text from 2 text fields
Hi,
I have to text fields containg names.
What i want to do is selecting two names in the different text fields and than swap those names.
Kind regards Ivo
I have to text fields containg names.
What i want to do is selecting two names in the different text fields and than swap those names.
Kind regards Ivo
Re: How to swap text from 2 text fields
Hi Ivaho,
Something like that ?
Kind regards
Jean-marc
Something like that ?
Code: Select all
on swapLines
put the hilitedlines of fld 1 into tHi1
put the hilitedlines of fld 2 into tHi2
if tHi1 = empty or tHi2 = empty then exit swapLines
put line tHi1 of fld 1 into tCont1
put line tHi2 of fld 2 into tCont2
put tCont1 into line tHi2 of fld 2
put tCont2 into line tHi1 of fld 1
end swapLines
Jean-marc
https://alternatic.ch
Re: How to swap text from 2 text fields
thanks for your help
Re: How to swap text from 2 text fields
Hi Ivo,
hint: Jean-Marcs solution will only work with LIST fields!
Best
Klaus
hint: Jean-Marcs solution will only work with LIST fields!
Best
Klaus
Re: How to swap text from 2 text fields
Hi Klaus,
Selecting two chunks in two different fields is possible ?
Best
Jean-Marc
Selecting two chunks in two different fields is possible ?

Best
Jean-Marc
https://alternatic.ch
Re: How to swap text from 2 text fields
Hi Jean-Marc,
yes, I tested this and was also surprised
The trick is to uncheck "traversal on" for the fields, but then you cannot write into the fields, so it is in fact useless
However you can put text into these fields by script and THEN you can have a selection in each field by doucleclicking words.
So this is of doubtful use...
Best
Klaus
yes, I tested this and was also surprised

The trick is to uncheck "traversal on" for the fields, but then you cannot write into the fields, so it is in fact useless

However you can put text into these fields by script and THEN you can have a selection in each field by doucleclicking words.
So this is of doubtful use...
Best
Klaus