Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

At Function

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
At Function does not working properly, some time it locates the value from memo field and some time it does not. The syntex is:

find_str = 'Srl_No'
if at(find_str,MemoFieldName) > 0
? Recn(),Code
endi

Please help me

Thanks in advance
Ahsan Rana
 
Ahsan,
If the memo field you are searching is over 64k in size, it may not work, since that is the largest string that can be "Created" by VFP. So, check you Memo lengths. If that is the case, you may need to break them down, or use some other function to do your search.

Best Regards,
Scott

Please let me know if this has helped [hammer]
 
No, only below fifty charactors in one record and at present records are still below one hundred and these (record) may be in thousands when it run after development.

Regds:
Ahsan Rana
 
Have you tried the $ (contained in)?

find_str = 'Srl_No'
if find_str $ MemoFieldName
? Recn(),Code
endi

 
Remember that AT() is case sensitive. Use ATC() if capitalization may change. Dave Dardinger
 
The following line of command working well but only on one record where as in my table records should be in thousands. when I add do whil ! eof() loop then it seraches throught out the table. But problem is here how it searches thousands records just like seek command. I affraid that as and when data increases, search from memo field should be slow amd slow. Could you have any idea to solve this problem. Please guide.

if find_str $ MemoFieldName
? Recn(),Code
endi

Thanks in advance
Ahsan Rana
 
Ahsan,
Well, without knowing exactly what you have, I would "assume" that you have some record "Set" that you want to search, not the whole table. So, what I would reccommend (and I have done this with great success on tables with over 6million records...) is the following:

Locate the "Key" value you want. Again, I assume you are searching for some child record against some parent table, so try the following strategy:

lcValue = <PARENT.KEY>
*
SELECT <Child>
SET ORDER TO TAG <some key to parent>

SEEK <ParentValue>

IF FOUND()
DO WHILE <CHILD.VALUE> = <PARENT.KEY>
IF FindStr $ MemoFieldName
? Recn(),Code
ENDIF
SKIP
ENDDO
ENDIF

Where Child is the CHILD table, Parent is the Parent table, and Key (which may be a compound expression on both sides) is the value you are &quot;Searching&quot; for, and &quot;Comparing&quot; to to ensure you have limited your Set. (You can just as easily use a SCAN... ENDSCAN in place of my DO loop, but I like the readability of DO WHILE... some may disagree with me on this...)
Then, as soon as your &quot;CHILD CRITERIA&quot; is exhausted, the loop stops. Assuming you will probably not have more than even a few thousand child matches, this will go VERY fast.

Hope this helps....


Best Regards,
Scott

Please let me know if this has helped [hammer]
 
Ashan,
If you are going to search on any word (or words) in a memo field, it's often better to parse the memo field and pick out &quot;key&quot; words and put them in a separate file, and then do your searches on it. PhdBase is a third party product that does this &quot;automatically&quot; for you. For more information go to
Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top