Page 1 of 1

Interchange the line

Posted: Mon May 23, 2016 6:49 am
by kevin007
Hi All,

How to interchange the line. I have a text field when I give the input like "1-3" then first and third line should interchange.

Thanks
kevin

Re: Interchange the line

Posted: Mon May 23, 2016 10:06 am
by Klaus
Hi Kevin,

OK, now you know how to "display second value in a variable ", so you can:
...
## Put lines to interchange into variables:
put line 1 of fld "interchange" into tLine1
put line 3 of fld "intercahnge" into tLine2

## And now simply "swap" the lines in the field:
put tLine2 into line 1 of fld "interchange"
put tLine1 into line 3 of fld "interchange"
...
Is that what you mean?


Best

Klaus

Re: Interchange the line

Posted: Wed May 25, 2016 10:07 am
by kevin007
@Klaus

many thanks for your help :D

Re: Interchange the line

Posted: Wed May 25, 2016 12:18 pm
by dunbarx
Kevin

Klaus would feel gratified if you would write a handler that does what you asked:

Code: Select all

switchLines line1,line2
Why is this not particularly suited to a function?

Craig Newman.

Re: Interchange the line

Posted: Wed May 25, 2016 12:26 pm
by Klaus
Would I? :shock:

Re: Interchange the line

Posted: Wed May 25, 2016 3:47 pm
by dunbarx
Klaus.

I was being presumptuous.

Craig.

Re: Interchange the line

Posted: Wed May 25, 2016 4:29 pm
by Klaus
dunbarx wrote:Klaus.

I was being presumptuous.

Craig.
Thou shalt be forgiven! 8)