Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5481 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi Everyone! I am new to recursive functions and need some help

I am setting a global field using the function (field names) in a file called "test" that has a relationship to another file called "test2"

It generates something that looks like this into the global field based on the fields on the layout

field1

field2

field3

field4

test2::first_name

test2::last_name

test2::zip_code

field 1, 2, 3 and 4 are on the layout and are part of the test database and test2::first_name, test2::last_name and test2::zip_code are related fields on the same layout

I need to strip away the test2:}:( from the global field so I am left with

field1

field2

field3

field4

first_name

last_name

zip_code

I need this to work in a recursive function as opposed to using a script to loop thru the global.

It's a little tricky! Can anyone help

Thanks in advance

Stu

Posted (edited)

thanks for the quick reply.. I explained my problem in a simplified form. Yes the substitute function will work but this has to work across many layouts with many different realationships on those layouts.

so on 1 layout it might be

field1

field2

field3

field4

test2::first_name

test2::last_name

test2::zip_code

and on another it might be

field1

field2

field3

field4

test3::first_name

agents::last_name

billing::zip_code

Their are just to many combination for me to use the substitute function on. thats why im looking for a recursive function.. Thanks again

Edited by Guest
Posted

Try something like this (untested)}:(

MyFunction ( listOfFields ) =

Let ( [

field = GetValue ( listOfFields ; 1 ) ;

countFields = ValueCount ( listOfFields )

] ;

RightValues ( Substitute ( field ; "::" ; ¶ ) ; 1 )

&

Case (

countFields > 1 ;

MyFunction ( RightValues ( listOfFields ; countFields - 1 ) )

)

)

This topic is 5481 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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