Recent

Author Topic: Associating a hint/comment with a unit name  (Read 258 times)

MarkMLl

  • Hero Member
  • *****
  • Posts: 1803
Associating a hint/comment with a unit name
« on: November 01, 2020, 12:38:24 pm »
If I have something like this in the interface part of a unit

Code: [Select]
(* Return either a static or a dynamic representation of the ALSA interface
  library (libasound.so or similar).
*)
function Asound(): TAsound;

then subsequently, if the pointer hovers over that identifier, the comment is displayed as a hint.

If I have this at the start of a unit

Code: [Select]
// unit NEEDED FOR HINT TO WORK
(* Return either a static or a dynamic representation of the ALSA interface
  library (libasound.so or similar).
*)
unit
  Asound;

then hovering over the identifier displays the comment as a hint.

If I remove that first comment line, it no longer works.

Is this intentional? Is there a "correct" way to do this?

I'm merging some old code into the current flurry of activity relating to ALSA, which exploits the fact that referring to a unit and referring to an instance of a class are syntactically similar.

MarkMLl


Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

 

TinyPortal © 2005-2018