[Gambas-devel] FEditor.class

Nigel Gerrard nigel at ...2...
Mon Feb 17 19:09:34 CET 2003


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 ))

  iPos = Instr(sLine, " ")
  IF iPos = 0 THEN
    RETURN sLine = "END"

  IF Left$(sLine, iPos - 1) <> "END" THEN RETURN FALSE

  sLine = Mid$(sLine, iPos + 1)

  RETURN sLine = "PROCEDURE" OR sLine = "FUNCTION" OR sLine = "SUB"




More information about the Devel mailing list