ListRange

Version 2

     

    Custom Function

     

    Compatibility
    Creator
    Mac OS X, Windows
    Duane Weller
    FMP 8.5, 9, 10, 11
    Web: Yes
    File Type: None
    Server: Yes
    FileSize: 0 kilobytes
    http://

    Description

    Creates a value list of a Field beginning with StartRecord to EndRecord.

     


    Code

    // -------------------------------------------------------

    // Title: ListRange

    // Purpose: Creates a value list of Field beginning with StartRecord to EndRecord.

    // Version Required: 8.5v1

    // Custom Functions Required: ListRange (recursive)

    // Updated On: 7/2/2007 by Duane Weller

    // -------------------------------------------------------

     

    // Syntax: ListRange ( field, startRecord, endRecord)

     

    // Parameters

    // field - A field you wish to create a value list of.

    // startRecord - The Record you wish to start on.

    // endRecord - The Record you wish to end on.

     

    // This function will create a global variable called $$CF_ListRange_Value

     

    Let ( [

    currRecord = startRecord ;

    maxRecord = If ( endRecord > Get ( FoundCount ) ; Get ( FoundCount ) ; endRecord ) ;

     

    // Get a value from a record

    theValue = GetNthRecord ( field ; currRecord ) ;

     

    // Are we finished yet?

    theEnd = Case ( theValue = "?" ; 1 ; currRecord ≥ maxRecord ; 1 ; 0 ) ;

     

    // Capture the value into a global variable to pass

    $$CF_ListRange_Value = theValue & "¶" & $$CF_ListRange_Value ;

    theValue = $$CF_ListRange_Value ;

     

    // Clear the global if finished

    $$CF_ListRange_Value = If ( theEnd = 1 ; "" ; $$CF_ListRange_Value );

     

    // Go to the next record

    currRecord = currRecord + 1

     

    ] ;

     

    If ( theEnd = 1 ; theValue ; ListRange ( field ; currRecord ; maxRecord ) )

     

    )

     

    Sample Input

    Sample Output
    ListRange(MyField)


    Developer's Notes

     

     


    FileMaker Inc. provides this content on an “As Is” basis, without any warranty, and subject to the terms of the FileMaker Technical Network Agreement. FileMaker makes no representations and is not liable for any content or related information. You may use the content as part of your own solutions and for your customers, but you may not otherwise publicly distribute any content that you did not submit. ©2009-2011 FileMaker, Inc. All Rights Reserved. FileMaker is a trademark of FileMaker, Inc. registered in the U.S. and other countries.