[Gambas-devel] FEditor.class

Benoît Minisini gambas at ...1...
Tue Feb 18 22:49:21 CET 2003


Le Lundi 17 Février 2003 19:09, Nigel Gerrard a écrit :
> Benoit,
>
> I see you have corrected the edtEditor_KeyPress function that was the cause
> for Charlies dammed click Messages in gambas-user.  I would however like to
> suggest something like the following code in  IsEndProc to cater for adding
> a comment after the END tag which causes the END to be missed.
> eg. END 'end of proc 1
>
> =========================================================================
> STATIC PUBLIC FUNCTION IsEndProc(sLine AS String) AS Boolean
>
>   DIM iPos AS Integer
>   DIM iCommentPos AS Integer
>
>   sLine = UCase(Trim(sLine))
>   iCommentPos = Instr(sLine,"'")
>   IF iCommentPos > 0 THEN
>      sLine = Trim(Left$(sLine, iCommentPos - 1 ))
>   ENDIF
>
>   iPos = Instr(sLine, " ")
>   IF iPos = 0 THEN
>     RETURN sLine = "END"
>   ENDIF
>
>
>   IF Left$(sLine, iPos - 1) <> "END" THEN RETURN FALSE
>
>   sLine = Mid$(sLine, iPos + 1)
>
>   RETURN sLine = "PROCEDURE" OR sLine = "FUNCTION" OR sLine = "SUB"
>
> END
>
> ===========================================================================
>=====
>
> Nigel
>
>

Thanks Nigel, I will add it !

-- 
Benoît Minisini
mailto:gambas at ...1...




More information about the Devel mailing list