Subject: | |
From: | |
Reply To: | |
Date: | Fri, 6 Mar 2015 09:36:53 -0800 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Tami, I'm not following. Could you back up and describe the business
problem you need solved? I am unclear whether you are starting with a
stack of order-dependent strings, i.e.:
Fred
Amerstein
12345
Mary
Matthews
23456
Mike
Johnston
34567...
or one stack:
Fred
Amerstein
12345...
...or something else entirely.
John
On 3/6/15, 8:37 AM, "Tami Williams" <[log in to unmask]> wrote:
>FUNCTION:
>nbrList ( items ; counter ; result )
>
>CALL:
>nbrList( "firstName¶lastName¶zip" ; "" ; "" )
>
>
>I'm looking for a way (if possible) to improve it so that instead I can
>call it without the placeholders, like this:
>
>
>nbrList( "firstName¶lastName¶zip")
>
>
>and get the same result:
>
>1. firstName
>2. lastName
>3. zip
>
>
>All suggestions welcome. Thanks in advance.
>
>
>
>/*
>
>// nbrList ( items ; counter ; result )
>// Recursively loops thru the elements in a return-delimited list and
>adds the order number to each element.
>
>Sample Input:
>nbrList( "firstName¶lastName¶zip" ; "" ; "" )
>
>NOTE: Do NOT enter any values for the "counter" and "result" parameters -
>only enter empty string (""); those parameters exist solely as
>placeholders for the tail recursion.
>
>Sample Output:
>1. firstName
>2. lastName
>3. zip
>
>Description:
>This function will recursively loop thru the elements in a
>return-delimited list adding the order number to each element.
>
>Author:
>Tami Williams
>www.asktami.com
>[log in to unmask]
>
>*/
>
>
>Let ( [
>counter = Case( counter = 0 or counter = "" ; 1 ; counter ) ;
>thisItem = GetValue ( items ; 1 ) ;
>output = counter & ". " & thisItem
>] ;
>
>
>Case ( ValueCount ( items ) > 0 ;
>
>// loop thru each value in the valueList
> InputsHtml ( RightValues ( items ; ValueCount ( items ) - 1 ) ;
>counter + 1 ; result & If ( IsEmpty(result) ; "" ; "¶" ) & output
>) ;
>
>// return the result
> result
>
>)
>
>)
>
>
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>"It's better to burn out than to fade away."
>
>Tami Williams
>Creative Computing
>Let us help you make frustrating, costly, and inefficient processes more
>efficient, less costly and scalable.
>Lasso, MySQL and FileMaker specialists.
>
>Tel/Fax: 770.457.3221
>E-Mail: [log in to unmask]
>Web: http://www.asktami.com/
>LinkedIn: http://www.linkedin.com/in/asktami
>Twitter: http://twitter.com/asktami
>iChat/AIM/Skype: tamiwilliamsusa
>
>FileMaker Business Alliance Member | Lasso Professional Alliance Member |
>Certified Lasso Developer | FileMaker 11, 12 & 13 Certified Developer
>
>------
>
>If you want to receive sporadic email from Creative Computing regarding
>news at the company and announcements about upcoming Lasso webinars and
>online classes, please opt-in at http://tinyurl.com/yj7eqlg
|
|
|