Jump 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.

ValuesGreaterThan ( listvalues ; reference )

Featured Replies

Name & Parameters: [color:red][big] ValuesGreaterThan ( listvalues ; reference ) [/big]

Description: Returns all values in a list that are greater than the reference parameter.

Originally written by Jeremy Bante, OshVay Systems, Inc., but was lost, so I rewrote it. Also changed parameter name to listvalues to avoid new reserved word list

Used by QuickSort( list ), also originally written by Jeremy

Sample Input:

Results:

Recursive: yes

Formula:

/*

ValuesGreaterThan ( listvalues; reference )

  Returns all values in list that are greater than the reference parameter

Theo Gantos - TEKA, Inc. - www.tekainc.com

Originally written by Jeremy Bante, OshVay Systems, Inc., but was lost, so I rewrote it

Also changed parameter name to listvalues to avoid new reserved word list

Used by QuickSort( list ), also originally written by Jeremy

*/



Let (

      listLength = ValueCount( listvalues);

      Case (

               // if the first element is greater than the reference...

               LeftValues ( listvalues; 1 ) > reference ;

               // return the first element

               LeftValues( listvalues; 1)

               )

      &

      Case (

               // if list is not trivial [there's more than one element]

               listLength > 1;

              // return all other elements greater than reference

              ValuesGreaterThan (

                                            RightValues( listvalues; listLength - 1);

                                            reference

                                            )

               )

       )  // end Let



 

Required Functions:

Author(s)??? teka

Date: 01/28/07

Credits: Jeremy Bante

Disclaimer:

FM Forums does not endorse or warrantee these files are fit for any particular purpose. Do not post or distribute files without written approval from the copyright owner. All files are deemed public domain unless otherwise indictated. Please backup every file that you intend to modify.

  • 4 weeks later...

The above produces unwanted trailing returns. Here is my suggested mod:

/*

Modified by Bruce Robertson to eliminate trailing returns

ValuesGreaterThan( listvalues; reference)

Theo Gantos - TEKA, Inc. - www.tekainc.com

Returns all values in list that are greater than the reference parameter

Originally written by Jeremy Bante, OshVay Systems, Inc., but was lost, so I rewrote it

Original function used the parameter List, which is now a reserved word, changed to listvalues.

Used by QuickSort(listvalues), also written by Jeremy

*/

Let(

listLength = ValueCount( listvalues );

//if the first element is greater than the reference...

//return the first element

//if list is not trivial [there's more than one element]

//return all other elements greater than reference

Case(

listLength = 1 and GetValue( listvalues; 1) > reference;

GetValue( listvalues; 1);

listLength > 1;

Case( GetValue( listvalues; 1) > reference; LeftValues( listvalues; 1) )

&

ValuesGreaterThan( RightValues( listvalues; listLength - 1); reference)

)

) //end Let()

Create an account or sign in to comment

Important Information

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

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.