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
Cloverleaf
how do I pass args
Gene Millard
I have never passed args in tcl before.
I would like to be able to do that.
proc tpsTestProc {a {b 7} {c -2} } {
expr $a / $b + $c
}
I am using the example from a tcl book. It is passing args 6 and 3.
Shows the answer should be 0.
I am trying to use the testing tool in cloverleaf.
I get this error
0:TEST] Tcl error:
msgId = message0
proc = 'tpsTestProc'
args = '6 3'
result = 'wrong # args: should be "tpsTestProc a ?b? ?c?"'
errorInfo: '
wrong # args: should be "tpsTestProc a ?b? ?c?"
while executing
"tpsTestProc {MSGID message0} {CONTEXT sms_ib_data} {ARGS {6 3}} {MODE run} {VERSION 3.0}"'
What is the proper way to enter the args in the Args box?
I just put
6 3
Is there more that needs to be added to the code?
Find more posts tagged with
Clovertech
Comments
Jim Kosloskey
ARGS is a keyed list so you need to do something like this:
keylget args ARGS
Then $args will contain your arguments. Then you can use list commands to extract the actual values).
I use arguments a lot in my procs and I prefer keyed list arguments versus positional arguments (like lists).
So the ARGS Keyed list might look like this {ARGS {{ARG1 data} {ARG2 data} …}}.
and I would use keylget arg1 ARGS.ARG1.
That allows me to have the arguments keyword based.
Gene Millard
So my proc line should look like this?
proc tpsTestProc {ARGS {{ARG1} {ARG2} args} {
david_barr
No, it should look like this:
proc tpsTestProc { args } {
The easiest way to get started is to use the script editor in the IDE, start a new script, right click and insert a TPS proc from the template.
Gene Millard
I have it working now.
Thank you for your time.