Recent

Author Topic: [SOLVED] Referencing A Procedure In A Specific Unit  (Read 742 times)

Bazzao

  • Full Member
  • ***
  • Posts: 178
  • Pies are squared.
[SOLVED] Referencing A Procedure In A Specific Unit
« on: September 01, 2020, 11:28:52 pm »
In testing code, I was using the default Beep, however when I added the Windows unit to the Uses clause, I immediately got syntax errors, because the overriding Windows Beep requires 2 parameters. Ok so I added those, but for information is there a way I can reference and use the default Beep with some sort of qualifier?
« Last Edit: September 01, 2020, 11:57:29 pm by Bazzao »
Bazza

Lazarus 2.0.10; FPC 3.2.0; SVN Revision 63526; x86_64-win64-win32/win64
Windows 10.

jamie

  • Hero Member
  • *****
  • Posts: 7708
Re: Referencing A Procedure In A Specific Unit
« Reply #1 on: September 01, 2020, 11:32:32 pm »
Its the order in which you include the unit,,

Place the Windows unit at the start of the USES list and it will be the last one the compiler see's

UNits are searched at the end of the list first and back to the start of the list in the USES clause.

OR, you could directly unit code it.

SysUtils.Beep;

The only true wisdom is knowing you know nothing

Bazzao

  • Full Member
  • ***
  • Posts: 178
  • Pies are squared.
Re: Referencing A Procedure In A Specific Unit
« Reply #2 on: September 01, 2020, 11:45:48 pm »
Its the order in which you include the unit,,

Place the Windows unit at the start of the USES list and it will be the last one the compiler see's

UNits are searched at the end of the list first and back to the start of the list in the USES clause.

OR, you could directly unit code it.

SysUtils.Beep;

Well the "SysUtils." reference worked.

Just for future reference, the Windows reference was in the IMPLEMENTATION section, so that is searched first.

Thanks for your quick response jamie.

Bazza

Lazarus 2.0.10; FPC 3.2.0; SVN Revision 63526; x86_64-win64-win32/win64
Windows 10.

 

TinyPortal © 2005-2018