Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

arbitrary sort respecting sort script

Featured Replies

I need to sort a table's records, and number them based on the sort. But the user needs to be able to arbitrarily change the sort as well.

I have a field for the sorting before a user changes things, called calc.Sort, and a field for the sort numbers called actual.Sort.

When records are added to this list, they are not given an actual.Sort number. So, if I have a record set like:

RecordNumber actual calc

1                    def

2            1      abc

3            2      ghi


I want my function to change it to this:


RecordNumber actual calc

1            1      abc

2            2      def

3            3      ghi




I've got a good script, that would work but for one critical error... I make a comparison like "thisRecord::calc.Sort > recordToSort::calc.Sort".  The comparison operators in FM7 are not overloaded for text, so I get this result:


RecordNumber actual calc

1            1      abc

2            2      ghi

3            3      def

Is there any way to do an alphabetical comparison in script? Otherwise, I have to create a temporary table to store the calc.Sort values and effect the comparison by RecordNumber. frown.gif

  • Author

Nevermind, stupid user error! the operator does work with text. I wasn't using RightWords properly with my script. blush.gif

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.