[Gambas-user] Line Column

Rob sourceforge-raindog2 at ...94...
Thu Sep 9 00:52:05 CEST 2004


On Wednesday 08 September 2004 18:36, Rob wrote:
> Er, I had just dashed off an example, but pressing F2 by
> accident on a blank line in the editor just now caused the IDE
> to crash! Damn!

Here is the workaround again.  That "crash the IDE by pressing f2 
on a blank line" thing is repeatable for me btw.

PUBLIC SUB TextArea1_MouseUp()

  DIM row AS Integer
  DIM col AS Integer
  DIM tmp AS String
  DIM tmpa AS String[]
  
  IF LAST.wrap THEN
    Message.Info("This doesn't work if word wrap is on!")
    RETURN
  ENDIF
  
  IF LAST.pos <= 1 THEN
    message.Info("1,1")
    RETURN
  ELSE
    tmp = Left(LAST.text,LAST.pos) & " "
    tmpa = Split(tmp, "\n")
    row = tmpa.Count
    col = Len(tmpa[tmpa.Count - 1])
    Message.Info(row & "," & col)
  ENDIF
      
END


Rob





More information about the User mailing list