[Gambas-user] Completion report

Ron Onstenk ronstk at ...239...
Mon Jul 31 01:21:31 CEST 2006


On Sunday 30 July 2006 22:20, Benoit Minisini wrote:
> On Saturday 29 July 2006 18:11, Ron Onstenk wrote:
> > About the completion I did try a quick simple test.
> > It did work correct ATM.
> > Will find out later when working on project again.
> >
> > One point, I see some names (user variable) in upper and lower case
> > because the are somewhere entered that way.
> >
> > I assume once in the global section at start of the file
> > and once for the declaration in the Function/Sub.
> > I'm thinking on different colour or bold if inside the function/sub.
> >
> > Using colour may be the better to signal the difference between
> > inside the Sub, Class-Module, Form and Component objects.
> > Of course when it is possible.
> >
> > Groetjes,
> >
> > Ron
> >
> 
> Sorry, I don't really understand what you mean. What do you want to 
> distinguish in the completion list exactly?
> 

The kind of the items in the list, as class, module, variable or control name
and possible where as global in file or the function/sub routine.

-----------------------------
module: XYZ
public vMod as variant

-----------------------------
class: itwo
public cDat as date
public iTwO as integer
-----------------------------
Class: KLM
public iGlobal as integer
public cdat as string
public itwo as string

public SUB DoShow()
  dim iSub as integer
  dim iTwo as integer
  ItWotextBox1.value=itw____Completion opens

-----------------------------

When completion opens in SUB DoShow i see:
 iGlobal ' in this file header (KLM)
 iSub    ' in this file in this sub (KLM)
 iTwo    ' in this file in this sub (KLM)
 itwo    ' where does this live? (itwo)
 iTwO    ' outside this file (itwo)
 ItWoBox ' in red means a contol name
 cDat    ' outside this file (itwo)
 cdat    ' in this file (KLM)
 vMod    ' outside this file and in a class (XYZ)

OK, in fact I see in above list only the 4 items start with itw (mixed case) 
but where and what is it?

  1) in the file/sub-routine as variable ?
  2) is the name of other class ?
  3) is something else, a control name ?

This makes me to assume there is difference for the 3 itwo but what??

If you say 'itwo' is a keyword to select and no difference to select
one of them, because pressing a '.' or '[' or '(' or ' ' after it 
shows something more, the next keyword if that exists, it make no sense to
me to see all variations of itwo in mixed case if they are in the code.

if not completionlist.exist(keyword,gb.text) then 'case insensitive
  completionlist.Add(keyword)
else 
  ' no add to list while it is already
end if

Colorize and bold can help to select the correct one for 
variable, class name or module name but.....

Shit, color/bold can't be done in the control used for the list.
Maybe a space and between () or [] some reference
 itwo (L) ' local var in sub/func
 iTwO (G) ' global var in file
 ItWo (R) ' routine in file
 itwO (M) ' external modulename
 iTWO (C) ' external classname
 iTWo (F) ' control on form

I prefer 
  [L] itwo
  [F] iTWO 
and sorted by that reference.

Just a idea after seen many dubbles names in the completion list and
knowing they are different things in my project.


Ron





More information about the User mailing list