June 30, 200817 yr Newbies How would I do this? if field c is "Yes" then transfer value of field a to field b if field c is "No" then transfer value of field b to field a any help is greatly appreciated
June 30, 200817 yr A simple way would be: If(C="Yes") Set Variable ($D;Value:$D=: Set Field(B;A) Set Field(A;$D) End If And the reverse for "No"
June 30, 200817 yr OK, 'comment', maybe the word "reverse" was not the right choice, but in helping a beginning I will gladly post the alternative answer choice so no thinking is necessary. If(C="No") Set Variable ($D;Value:$D=A) Set Field(A;: Set Field(B;$D) End If
June 30, 200817 yr Doesn't this "reverse" process accomplish the same result? What is the reverse of "swap"?
June 30, 200817 yr The script steps I posted, I believe, answer the original question, although it seems like I am missing something. Please explain.
June 30, 200817 yr The original question is not clear to me. If I read it literally, it says: If [ C = "Yes" ] Set Field [ B ; A ] Else Set Field [ A ; B ] End If But the title of the thread says "swap". A swap is what both your scripts do - and they both do the same thing, except in different order. So the value of C is simply ignored.
June 30, 200817 yr You're right. Only one swap is needed. If C="No" then it should do nothing. Although in your example, doesn't the result of C="Yes" leave the values for A and B both equal to A, and the original value of B is lost. Thus it is not a "swap" but maybe just a replacement of value.
June 30, 200817 yr Yes, my script does literally what the original post says should be done, therefore one of the two values is lost in the process. I suspect the real answer here lies in a calculation field = Case ( C = "Yes ; A : B ) but as I said, I do not really understand the question.
Create an account or sign in to comment