Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!



Share:
Notifications
Clear all

[Solved] Lazarus - Add discription in "Hint" window in code to procedures and variables

1 Posts
1 Users
0 Reactions
1,595 Views
 Hans
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2859
Topic starter  

Lazarus comes with a nice feature: Hover (in code) over a function, procedure or variable, and it will show you some details like parameters and where it's declaration can be found in code.

You can however add COMMENTS to this ... some examples:

Variables:

var
MyVariable : integer; // This variable is used for my project // Test variable - This works for TestVariable as well TestVariable : string;

Constants:

const
   // MediaTypes (covers both constants)
   MovieMedia = 1;
   TVShowMedia = 2; myDummy = 0; // This works as well
  // For one only
   TestConst : array[1..3] of integer;

(with simple constants the first comment will be displayed on both variables - with complex constants this works only for the following constant)

Functions and procedures in the implementation section:

// This function returns TRUE or FALSE
function TForm1.MyFunction(MyParameter:string):Boolean;
// This function takes MyParameter and does something with it
procedure TForm1.MyProcedure(MyParameter:string);

In the interface section:

function MyFunction(MyParameter:string):Boolean;  // This function returns TRUE or FALSE
procedure MyProcedure(MyParameter:string); // This procedure takes MyParameter and does something with it

Now when you hover over for example MyFunction() somewhere in your code, the hint window will say something like (the 3rd line is your comment):

function  MyFunction(MyParameter:string):Boolean;
/where/the/sourcefile/is/file.pas
This function returns TRUE or FALSE

   
ReplyQuote
Share: