Find out if the search string occurs in a Memo field.
Sound simple, is magic! This function will simply return the position in a memo of the first occurrence of a given search string.
The position information might not be so useful, but the fact that it is there is! This is in essence freetext search and you can use it to find out which record contain a certain text in a memo.
We use this in this help and we use it on our web to search articles etc.
MEMO FIELD
The memo field to search for a string in.
TEXT VALUE
The value to search for in the memo.
Example 1
for NewsArticles with MemoFind(ArticleBody,data-entry searchfield)>0 ;
list records
...
This DQL will return all articles that contain the value we search for!
Cool?
Example 2
You don't need any more do you? You got it!
Such a simple function, but already such an important function.
This is the missing freetext search in DataEase.
As you know, you cannot search Memo fields in DataEase up and including 7.2, but then again Memo is just a Memo...for notes. Nobody want to search them anyway?
In 8, we see that almost 90% of the data in an application is now stored in Memos, simply because you can now save document sized objects, where you before was limited to 256 bytes in "useful" fields.
We quickly realised that we needed to be able to search across memo fields too.
The reason traditional DataEase search doesn't work in Memos, is because of the architecture. A traditional DataEase database is structured, when memos is stored outside the structure. To change the traditional functions to take Memo into account, would slow down the traditional functionality, when at the same time it wouldn't really be a good idea.
In 8 we rather add functions that change functionality, so this is what we did here too. We added MemoFind().
int MemoFind(MemoToSearch,Search)
We successfully use this in With statements in DQL, and in filters...works brill, and is the corner stone of search on this website, both in News and Help and...
Enjoy thinking different!
Product: Dataease [{8}]FIVE. Written by DataEase 29/12/11 at 10:42:42