Heathbo Posted May 1, 2006 Share Posted May 1, 2006 I have this script that I built in FM Dev 6. This script is put on a calculation field that is a container. Case( PatternCount( SortField, "LastName¶" ), GetRepetition( SortPicture, If( MiddleWords( SortDirection, PatternCount( Left( SortField, Position( SortField, "LastName", 1, 1 ) ), "¶" ) + 1, 1 ) = "Ascending", 1, 2 ) ) ) Basically what I need is, If SortField = LastName then If the SortDirection = "Ascending" then put in the 2nd picture from the SortPicture container. If the SortDirection = "Descending" then put in the 1st picture from the SortPicture container. The default picture has to be the 3rd picture from the SortPicture container. Link to comment Share on other sites More sharing options...
T-Square Posted May 2, 2006 Share Posted May 2, 2006 Not certain of your syntax overall, but I'd do it like this in pseudo-code: If (PatternCount(SortField, "LastName¶" ); If (SortDirection = Ascending; Pic2; Pic1); Pic3 ); I think it's simpler. David Link to comment Share on other sites More sharing options...
sbg2 Posted May 2, 2006 Share Posted May 2, 2006 Case( Sortfield = LastName and SortDirection = "Ascending"; Pic2; Sortfield = LastName and SortDirection = "Descending"; Pic1; Pic3) Link to comment Share on other sites More sharing options...
Søren Dyhr Posted May 2, 2006 Share Posted May 2, 2006 But it should be GetRepetition ( Pics ; Case( Sortfield = LastName and SortDirection = "Ascending"; 2; Sortfield = LastName and SortDirection = "Descending"; 1; 3)) With the pre fm7 syntax... Because it can't be stressed strongly enough, this is where repeating fields really come in handy and is a "legitimate" use of this field type - Since this is far from 1NF violations. --sd Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 6568 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