PETER ZHOU
About search on string in table July 30, 2008 04:14PM |
PETER ZHOU
Re: About search on string in table July 30, 2008 04:30PM |
Quote
PETER ZHOU
n = TableSeek(Table_Candidate.CandidateName,EDT_SearchFullName,False)
will search for string starting with (generic) in "sought element"
n = TableSeek(Table_Candidate.CandidateName,EDT_SearchFullName,True)
will do exact match search in "sought element"
How about i want to do a search on string within the "sought element" ?
Regards,
PETER ZHOU
PETER ZHOU
Re: About search on string in table July 31, 2008 09:32AM |
Quote
PETER ZHOUQuote
PETER ZHOU
n = TableSeek(Table_Candidate.CandidateName,EDT_SearchFullName,False)
will search for string starting with (generic) in "sought element"
n = TableSeek(Table_Candidate.CandidateName,EDT_SearchFullName,True)
will do exact match search in "sought element"
How about i want to do a search on string within the "sought element" ?
Regards,
PETER ZHOU
Sorry...forgot abt the word "sought element"
LS
Re: About search on string in table July 31, 2008 10:47AM |
PROCEDURE SearchInColumn(sTableName is string,sColumnName is string,sFindString is string,iRowStart=1) sSearch is string = sTableName+"."+sColumnName iCnt,iTblCnt is int iTblCnt = TableCount(sTableName) //Check if iRowStart not is lower or equal than 0 and not greater than the table rowcount. //Because it will throw an exception. IF Val(iRowStart) <= 0 THEN iRowStart = 1 IF Val(iRowStart) > iTblCnt THEN RESULT -1 //Perform search FOR iCnt = iRowStart TO iTblCnt IF Position({sSearch,indControl}[iCnt],sFindString) > 0 THEN RESULT iCnt //return rownumber END //found nothing RESULT -1
Paulo Oliveira
Re: About search on string in table July 31, 2008 10:47AM |
PETER ZHOU
Re: About search on string in table August 01, 2008 02:01PM |
Quote
LSPROCEDURE SearchInColumn(sTableName is string,sColumnName is string,sFindString is string,iRowStart=1) sSearch is string = sTableName+"."+sColumnName iCnt,iTblCnt is int iTblCnt = TableCount(sTableName) //Check if iRowStart not is lower or equal than 0 and not greater than the table rowcount. //Because it will throw an exception. IF Val(iRowStart) <= 0 THEN iRowStart = 1 IF Val(iRowStart) > iTblCnt THEN RESULT -1 //Perform search FOR iCnt = iRowStart TO iTblCnt IF Position({sSearch,indControl}[iCnt],sFindString) > 0 THEN RESULT iCnt //return rownumber END //found nothing RESULT -1
Thanks!
I think it's works great...but don't know how's the speed issue when the data increases
Something like this. I haven't tested this, but it should work.
King
Re: About search on string in table August 03, 2008 10:49AM |
Ben
Re: About search on string in table August 03, 2008 03:13PM |
Leo Voet
Re: About search on string in table August 10, 2008 10:50PM |