Eric Hassold wrote:
> Hi
>
> Andrew Falanga wrote:
>> Why? By the time of that third output, the package require cmdline
>> hasn't been executed yet so why is it present?
>
> Because, as documented, "package names" returns not only list of the
> names of all packages in the interpreter for which a version has
> been provided (via package provide), but also those for which a package
> ifneeded script is available. Since your package is available in the
> auto_path, a "package ifneeded cmdline ...." has been issued from its
> pkgIndex.tcl. To test if a package is actually "loaded" into an
> interpreter, use "package present cmdline":
>
> if {[catch {package present cmdline} cmdver]} {
> puts "cmdline is not present"
> } else {
> puts "cmdline version $cmdver is present"
> }
>
> Eric
>
> -----
> Eric Hassold
> Evolane - http://www.evolane.com/
Thanks for the quick response. I'll make use of this package present.
I had tried using it once before (a while ago) but didn't quite get what
I wanted. However, I can't remember the circumstances at this time and
perhaps I wasn't using it correctly.
Thanks for the help.
---------------------------------------------
Andrew R. Falanga (a non-HP employee)
Hewlett-Packard Company
11311 Chinden Blvd.
Boise, Idaho
---------------------------------------------
Please note: The e-mail address is purposely
mangled. I do not wish my account at HP to
become a spam haven.
Received on Sun Apr 30 02:57:40 2006