alex_zueiv

Position(;;Length();-1) hangs FMP on large texts

Discussion created by alex_zueiv on Sep 14, 2017
Latest reply on Sep 20, 2017 by TSGal

Product and version

FMP 15 and 16 (latest updates)

 

 

OS and version

Both Mac and Win

 

 

Description

Working with large blocks of text I've found out that the normal way to search for the last occurrence of a string in a text just hangs FMP. I've created test file to figure out what is going on. It looks like there is some memory leaks in the function Position(;;Length();-1).

 

It works well with texts up to 255.999KB in size. Starting from 256KB the function takes abnormal amount of time to calculate.

 

TestPosition.png

 

Also, as you can see at the top of the screenshot, working on texts of the same size (191.526KB) the single call to the function takes 5 times longer in the second record. Probably because the search string located a bit farther (from the end) there. And while at 255.999KB the functions works well in CF, it fails on the direct single call.

 

 

How to replicate

Try the attached TestPosition.fmp12 file.

 

 

Workaround

Use Position(;;1;PatternCount()).

Attachments

Outcomes