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.

finding repetition in Custom Functions

Featured Replies

Hello everyone;

I am noticing many similar traits with custom functions and scripts.

Can someone please attach any / links to perhaps studied algorithms based on recursion,search,etc

Or is this something one learns with time.

@Comment has some amazing techniques that seem so "Technical" and not just out of the blue, makes me believe he has a degree in computer science ! : )

Let me go on...

Some functions usually save positions where you are located, for example , starting text, or 2nd value in a list,etc

Finds the end value and then grabs all the data in between to do some stuff with.


Let([

Vn = ValueCount(Tips::gLibrary);

P1 = Position(¶ & Tips::gLibrary; ¶ & ID & " "; 1; 1);

P2 = P1 + 1 + Length(ID);

P3 = Position(¶ & Tips::gLibrary & ¶; ¶; P2; 1);

T1 = Middle(Tips::gLibrary; P2; P3 - P2 - 1);

T2 = If(p1 > 0; Substitute(T1; ["°"; "\\\""]; ["‡"; "\¶"]; ["·"; " "]))];

Evaluate(T2)

)

In this code, is one example.

THe cF is GetTips(ID)

* i understand what the 1st 2 runs are doing, then i am lost completely. Plain english. There are no comments so hard for me to get why Ray Cologon is doing what he is doing here.

  • P2 = P1 + 1 + Length(ID);
    P3 = Position(¶ & Tips::gLibrary & ¶; ¶; P2; 1);
    T1 = Middle(Tips::gLibrary; P2; P3 - P2 - 1);
    T2 = If(p1 > 0; Substitute(T1; ["°"; "\\\""]; ["‡"; "\¶"]; ["·"; " "]))];
    Evaluate(T2)

thanks

-ian

  • Author

So , i have learned that this is a convoluted way they used to grab the middle data, now we use GetValue ( DATA; Nbr )

If you want to see what this does, copy the code in data viewer'


Let([

//Instead of ID - put in your own # such as 1, 2 , 10,etc

Vn = ValueCount(BaseTable:FirstName);

P1 = Position(¶ & BaseTable:FirstName; ¶ & 1 & " "; 1; 1);

P2 = P1 + 1 + Length(ID); //use Length( 4)

P3 = Position(¶ & BaseTable::FirstName & ¶; ¶; P2; 1);

T1 = Middle(BaseTable::FirstName; P2; P3 - P2 - 1);

T2 = If(p1 > 0; Substitute(T1; ["°"; """]; ["‡"; "¶"]; ["·"; " "]))

];

//Here you can place the Vars; P1 & P2 & P3 & T1 to see what the value is in the dataviewer

T1

)

Hope this helps someone out there

*Thanks Fitch for the help on this one...

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.