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
Tcl Library
Call a tps with arguments from within a tps
Jerry Tilsley
Is it possible to make a call to another tps procedure (and pass arguments to it) from within a tps procedure?
Find more posts tagged with
Clovertech
Comments
Max Drown
It certainly is!
Jim Kosloskey
Here are the ways of which I am aware:
Most common:
Assume 2 procs proc1 (the invoking proc) and proc2 (the invoked proc).
Assume arg1 and arg2 are the arguments from proc1 that proc 2 wants.
In proc1 (assume proc 2 does not return anything):
set arg1 "1st arg"
set arg2 "2nd arg"
proc2 $arg1 $arg2
Proc 2 starts:
proc proc2 {my_arg1 my_arg2} {......}
In proc 1 (assume proc 2 does return something):
set arg1 "1st arg"
set arg2 "2nd arg"
set stuff [proc2 $arg1 $arg2]
Less common:
In proc1:
set arg1 "1st arg"
set arg2 "2nd arg"
proc2
In Proc2:
upvar $arg1 my_arg1
upvar $arg2 my_arg2
Also:
In proc1:
global arg1
global arg2
set arg1 "1st arg"
set arg2 "2nd arg"
proc2
In proc2:
global arg1
global arg2
There is also a differnt way if using namespaces/packages but I assume you do not want to go there right now.
All of the above have some rules associated with them.
Jerry Tilsley
Thanks!
I was sure it could be done. I have created a package before and used it with the package require command, but I was just wanting to use one proc and wanted to make sure I was thinking on the correct lines.
Again, thanks for the assistance.
Jerry