Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"USES" any guides available?

Status
Not open for further replies.

guava65

Programmer
Jul 20, 2001
238
US
I find that when I use a component that I have not used before, or code that I have not used before, I often run into problems because I don't have the right items listed in the 'USES' clause.
[highlight]
Is there a book or on-line guide that specifies which components and/or commands required items to be listed in the 'USES' clause?
[/highlight]



Aloha,
cg
 
Hi,
Usually when you save the code by pressing Ctrl+S within Delphi IDE, Delphi will automatically add the appropiate unit(s) into your unit's uses clauses. If you're using Delphi VCL that comes with Delphi (not third party VCL), hust press F1 for help in the component type. The help will display the unit of the component contained.. In some third party VCL, I've been experience the same too.. Is that answer your question?..

thanks,
Indra Gunawan
 
This is good advice.

I had believed that Delphi would automatically include the uses clause but discovered that some functions required me to add uses clauses manually. for example, some database functions and even the printer dialog box did not automatically add the use "printers" or use "DB" when I compiled.

thanks for the advice.


Aloha,
cg
 
To find out what files I need to add in a situation like this, I go to the Help and look up the function/method/etc. It will show which unit the function is in so that I can add it manually.

-D
 
If you need to know where "ThisSeldomUsedFunction" is defined, simply search the Delphi sources directory for "function ThisSeldomUsedFunction" with a grep-like utility.

Very usefull to find out if a particular API function is defined somewhere in Delphi, as API functions are not included in the Delphi help.

HTH.
buho (A).


 
Much thanks to everyone!

I appreciate the exchange [thumbsup2]


Aloha,
cg
 
I have found that any Date manipulation functions require "dateutils" but the IDE does not automatically add the dateutils unit to the USES clause. Whenever I use a new function, I check the help file to see what unit the function is contained in, then cross check to see that the unit is in the uses clause. If it is not, it must be added manually
 
Having done this at least a dozen times (I hate to be extravagant and say hundreds...) I agree with Buho...

(and also TGF grep ... or should that be TSF (Sun)...?)

Tell me though, why it is that the imported/adopted functions/procedures from C++ have the "abominal" C++ format, and DON'T list the unit from which it is defined....

Better yet, why is it that the C++ product help cannot be reformatted to the Delphi help format.... AREN'T WE PAYING ENOUGH AS IT IS??????


Is Borland THAT insensitive????

Seems so to me....


JGS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top