[Gambas-user] Editor Control Insert function problem

Alex Schaller gambas at ...1077...
Thu Sep 1 02:26:23 CEST 2005


Hello Benoit!

 > >Hello!
 >>
 > >I was trying to us the insert function to put some text in the editor
 > >control:
 >>
 > >Editor1.Insert("Hello", 1, 1)
 >>
 >> and I get the Too many Arguments error.
 >
 
 >  You have to do move the cursor before:
 
 >  Editor1.Goto(1, 1)
 >  Editor1.Insert("Hello")

Thanks for the tip! Works great!!
 
 >> Also, the old Editor control had a pos function which would position the
 >> cursor at a specific character in the document (very helpfull in my
 >> project). 
 
 >  The Editor characters are now referenced by line and row everywhere. You 
 >  should not have to use an absolute position. What are you doing exactly?
 
I am working on an IDE for a microcontroller. 
After entering, the code gets passed to an object file which converts it into 
binary data for the controller. If there is an error in the code the object 
file returns the error start as an absolute position e.g. character 112.
The pos function was perfect for that. 

 >> I am sure I can recreate the functionality of the pos function 
 
 >  I'm not sure :-) As code can be highlighted *and* rewritten (not in custom 
 >  mode at the moment), an absolute position can lose its meaning without any 
 >  warning...
 
 >> but if you plan on providing it again I will wait.
 >>
 >> B.t.w I figured out the custom highlighting feature of the new editor
 >> control and it rocks.
 >>
 >> GREAT JOB Benoit !!!!!!
 
 > Thanks :-)

You are most welcome !!!!!!
 
 > -- 
 > Benoit Minisini
 > mailto:gambas at ...362...

Servus,

    Alex




More information about the User mailing list