infor.com
concierge
infor u
developer portal
documentation central
customer center
Posts
Categories
Groups
ERPs
CSD
FSM/HRT
LN
M3
Syteline/ CSI
Hubs
Developer
Healthcare
Hospitality
Public Sector
Onboarding
Release Center
CloudSuites
Aerospace & Defense (LN)
Automotive (LN)
Chemicals (M3)
Corporate (FSM/HRT)
Distribution (Sx.e/CSD)
Distribution Enterprise (M3)
Engineering & Construction (LN)
Fashion (M3)
Food & Beverage (M3)
Healthcare (FSM/HRT)
Industrial (Syteline/CSI)
Industrial Enterprise (LN)
Manufacturing (M3)
Public Sector (FSM/HRT)
Solutions
Supply Chain Management (SCM)
Human Capital Management (HCM)
Events
Groups
User Groups
Your Groups
About
Email Community Support
Infor News
Migrated Forums
Home
Clovertech
Clovertech Archive
Read Only Archives
Cloverleaf
General
TCL Packages
System
Originally posted by James Sedlmeyer
I want to create a tcl package of common ODBC tcl code that I can access from another tcl proc. Can anyone out there point me in the right direction?
Find more posts tagged with
Clovertech
Comments
System
Originally posted by Nate Kruse
Are you looking for pointers on how to create a package or looking for ideas on what ODBC tcl scripts to include?
System
Originally posted by James Sedlmeyer
I'm looking for pointers on creating the packages.
Thanks
System
Originally posted by Nate Kruse
Here is an example for the format of a package:
package provide shmc_email [lindex {Revision: 1.0 } 1]
namespace eval shmc_email {
namespace export email
proc email {aEmail aSubject aMessage} {
....
}
}
Here is how to use/call the package from another tcl script:
package require shmc_email
if [catch {shmc_email::email $email $subject $message} err] {
echo "Error Calling SHMC_Email --$err"
}
You will need to add the package file to the ../../integrator/tclprocs/lib directory.
Also, add a line to the pkgIndex.tcl file so the system knows about the package:
package ifneeded shmc_email 1.0 [list source [file join $dir shmc_email.tcl]]
I hope this helps. It's been a few months since I've done one and while mine works, it may not be the exact way others do it.
Nate.
Russ Ross
To keep packages from being blown away here at MD Ancerson Cancer Center when doing a cloverleaf upgrade, we created a mda_global site and create the following directory to house our packages
$HCIROOT/mda_global/tclprocs/packages
then we create the following link as follows
ln -sf $HCIROOT/mda_global/tclprocs/packages packages
By the way, the pkg_mkIndex is a hcitcl command and not a standalone script like mktclindex so to run in our case we do the following:
hcitcl -c "pkg_mkIndex -verbose -- $HCIROOT/tclprocs/packages"
which will create a file called
pkgIndex.tcl
Also a nice thing about packages is that you can associate a version with each package which will allow you to access an old version if specified; otherwise, you get the most recent version.
System
Originally posted by James Sedlmeyer
Thanks for everyones help. Much appreciated.