Newbies Deprive Posted June 30, 2008 Newbies Posted June 30, 2008 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
Sunshein Posted June 30, 2008 Posted June 30, 2008 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"
Sunshein Posted June 30, 2008 Posted June 30, 2008 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
comment Posted June 30, 2008 Posted June 30, 2008 Doesn't this "reverse" process accomplish the same result? What is the reverse of "swap"?
Sunshein Posted June 30, 2008 Posted June 30, 2008 The script steps I posted, I believe, answer the original question, although it seems like I am missing something. Please explain.
comment Posted June 30, 2008 Posted June 30, 2008 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.
Sunshein Posted June 30, 2008 Posted June 30, 2008 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.
comment Posted June 30, 2008 Posted June 30, 2008 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.
Recommended Posts
This topic is 6050 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now