DelphiFAQ Home Search:

Using code completion for assignments

 

commentsThis article has not been rated yet. After reading, feel free to leave comments and rate it.

Code Completion is not only good for macros, it can prompt you with a listbox of possible arguments for an assignment statement. To see Code Completion in action, have this piece of code in your OnCreate event handler:

After typing the ":=", press [Ctrl][space]. In a moment, you'll see a list of several the variables, methods, and objects that are in scope, and potentially valid assignments.

Since the left side of the assignment (Caption) is a string, you will see temp1 and temp3, but not temp2.

Some of the choices will have an ellipsis (...) after them, indicating an object or record that contains compatible methods or fields for the assignment.

var
  temp1 : string;
  temp2 : integer;
  temp3 : string;
begin
  Form1.Caption :=  

Comments:

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: