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.

Featured Replies

When a text field is populated with ???

"AABGAANAAAAJAAAAAAA"

And I run a count of occurences of "AA", the Patterncount returns 6, while I expected it to return 12.

What I'm trying is use a script that will go to at the last position of a "AA", actually it's right part, then go down by one.

So I expected the script to run as such (bolded is where I want the script to go)

Step 1 : 1- AABGAANAAAAJAAAAAAA

Step 2 : 1- AABGAANAAAAJAAAAAA A

Step 3 : 1- AABGAANAAAAJAAAAAAA

Step 4 : 1- AABGAANAAAAJAAAAAAA

Step 5 : 1- AABGAANAAAAJAAAAAAA

Step 6 : 1- AABGAANAAAAJAAAAAAA

Step 7 : 1- AABGAANAAAAJAAAAAAA

Step 8 : 1- AABGAANAAAAJAAAAAAA

Step 9 : 1- AABGAANAAAAJAAAAAAA

Step 10 : 1- AABGAANAAAAJAAAAAAA

Step 11 : 1- AABGAANAAAAJAAAAAAA

This is used to check and parse what's enclosed "1-" and an "AA"

I resigned and created a Loop which :

- starts from Position of last occurence + (Lenght (textToCheck) -1)

- Goes down one position using a counter

- A SetField[parsed, Case(Middle(text,counter-1,Lenght (textToCheck)) = textToCheck, "someparsing","")

There must be another easy way, isn't it ?

Ugo try

Position(textStr, "AA", 64000 , -1 ) to gain offset of last"AA" in textStr

Dj

Edited: Well actual calculation should be:

Middle(textStr, calc+2+(Left(Middle(textStr, calc+2 , 64000 ), 1) ="A") , 64000 )

Dj

  • Author

Hmmm...

What calc2 stands for ?

Here's the calc I'm currently using to get the string from start to the Right part of the last occurrence of the "separator" ???

Middle(textstring,StartPos,Position(textstring,gSep,1,Patterncount(textstring,gsep))+Length(gsep))

Where StartPos could be 1 or any calculated position from another global text field input

gsep is the delimiter ("AA" here)

So I wanted to add a counter and have the calc turned to :

Middle(textstring,StartPos,Position(textstring,gSep,1,Patterncount(textstring,gsep))+Length(gsep)-gCounter)

If the first calc is 'somehow' working, this later doesn't work as with g_counter = 1, the extracted string is :

"AABGAANAAAAJAAAAA" while I expected it to be

"AABGAANAAAAJAAAAAA"

Note that I'm not looking to go down by a simple position-1. I would like the position to move from 1 occurrence.

Example :

If the text string was "AABGAANAAAAJAA", the result should be for gsep = "AA":

g_counter = 0 --> "AABGAANAAAAJAA"

g_counter = 1 --> "AABGAANAAAA"

g_counter = 2--> "AABGAANAAA"

g_counter = 3--> "AABGAANAA"

g_counter = 4--> "AABGAA"

g_counter = 5--> "AA"

g_counter = 6--> " "

...

The result my calc is giving so far is

g_counter = 0 --> "AABGAANAAAAJAA"

g_counter = 1 --> "AABGAANAAAAJ"

g_counter = 2--> "AABGAANAAA"

g_counter = 3--> "AABGAAN"

g_counter = 4--> "AAB"

g_counter = 5--> "AA"

g_counter = 6--> "AAB" !!!!

Is that clear ? Is it what your calc is doing ?

Thanks Dj.

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.