[lazarus] Updates

Mattias Gaertner nc-gaertnma at netcologne.de
Sat Nov 30 06:48:58 EST 2002

Hi all,

There is a new code completion feature: Local variable completion.

Probably everyone knows the boring ritual: You need a dummy variable for a
loop variable or a temporary string, etc. Under c you can just write 'int i'
at any place in the code, but pascal is a cleaner language and so you must
move the cursor to the start of the procedure, add a 'var i:integer', and
move back to the code, where you were actually working. 
Now, the IDE can do this for you:

For example:

procedure DoSomething;
  for i:=0 to Count-1 do ;

Move the cursor to the 'i' identifier and invoke the code completion
(default is Shift+Ctrl+C).
The code completion looks for <identifier>:=<expression>, then test if the
identifier already exists and if not, the code will be changed to:

procedure DoSomething;
  i: Integer;
  for i:=0 to Count-1 do ;

You can do this for most assignments. For instance:
  s:='Hi'; // string
  c:='a';  // char
  e:=3.3;  // extended
  f:=ord(clRed); // Integer

It will not work for Low(), High() or constructors and probably a few other
constructions. This is not implemented yet.

A you can see, this completion is ambigious. A constant number like 3 can be
assigned to many types. What options should be added, so that users can set
their favourite types for constants?

Other updates:

- Modified source editors are now marked with a '*' in the pagename
- OI now shows 'X items selected' during multiselection
- find expression type of @String[] constructions
- fixed vertical cursor movement when lines contain tab chars
- TStatusbar now uses InvalidateRect
- new function: InvalidateFrame. This works like InvalidateRect, 
  but invalidates only a rectangle without the content.


More information about the Lazarus mailing list