December 2, 200916 yr 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
December 2, 200916 yr Would a simple statement like this work? No recursion required from what I can see. Substitute(originalText; "test2::"; "")
December 2, 200916 yr Author 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 December 2, 200916 yr by Guest
December 2, 200916 yr 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 ) ) ) )
Create an account or sign in to comment