[Gambas-user] CONTRIB: Modified Find for editor with List

ron ronstk at ...239...
Fri Mar 26 22:52:53 CET 2004


On Friday 26 March 2004 21:29, Fabien Bodard wrote:
> i've corrected the ocur bugs....
>
> now you can have to identical key...
>
> my correction is between <fabien> tags
>
> Fabien


First the mistake I had,
  WHILE iPos<> 0 ' iPos is base 1, iLine is base 0 !
 
    sNode=hForm.path
    sLeaf = hForm.name & ".class|" & CStr(iLine) & "|" & CStr(iPos-1)
    sLeaf = sFile & "|" & CStr(iLine) & "|" & CStr(iPos-1)
.................
    ' find next in line
    iPos = SearchString(sLine,iPos + Len($sFind))
  WEND
 
In the first sLeaf it could not handle the .module files.
In the list you could click on a .module line but did not work.
I had to comment it or better remove it.
The second is the good one.

Your idea was already in the code.
It prevents this also but I have comment it out.
Reason I did got the error with it to.
Remove of the remarks was already OK.
It does the same, the count increment always so it is unique.

But what me irritates is that it occurs any way.

This doing looks to me as hidding a bug instead preventing of it.
The current used construction for sLeaf should be unique.

Search for the next position " AS Integer" can not be same position
in the same line because after add to the list there is a search starting
at a new position. It returns iPos=0 or a new iPos
I can only suggest and do by setting iPos for the search as in

    ' find next in line
   iPos=iPos + Len($sFind) 	
    iPos = SearchString(sLine,iPos)
  WEND

This way I'm almost sure it is and never can be the same.

There is however something else I discovered later
If you mark two lines for search or partial but with a new line in it
it shows only the first in the combobox and the part after the newline is 
gone.
The search use the combobox.text witch can have a newline in it.
This must be verified. Maybe Benoit knows something about this.

Last note:
I did use IF $iSearch <>/= SEARCH_PROC THEN 
and it must be IF $iSearch <>/= SEARCH_PROJECT THEN 
The meaning was not all expanded if scan accros the project but I did use the 
wrong one. :(

Thanks for the try
Ron




More information about the User mailing list