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
Cloverleaf
Need to work with a list like it's a string
Vince Angulo
It's been a while since I've had to do something like this, and it's just not jelling -- I'm sure I'm making a basic, "it's a list thing" mistake.
Here's what I need to do: take a free-text phrase that may contain spaces, force it toupper (not a problem), then truncate it to 12 characters. For example,
Input: <Something like this>
Output: <SOMETHING LI>
Just can't remember how to have Tcl consider xlateInVals as a string, not a list without getting an XPM Tcl Error.
Can anyone get me on the right track? Or can this be elegantly done in a translate at all, or do I need to brute force it in a proc?
Thanks in advance!!!!
Find more posts tagged with
Clovertech
Comments
Keith McLeod
You might try something like this:
set xlateOutVals [list [string range [string toupper $xlateInVals] 0 11]]
example:
hcitcl>set xlateInVals
Something Like This
hcitcl>set xlateOutVals [list [string range [string toupper $xlateInVals] 0 11]]
{SOMETHING LI}
hcitcl>
Vince Angulo
Thanks Keith!!!
I'll try that -- it's looks awfully familiar, and as usual, I was making this way too hard in my head....
Vince Angulo
Much closer thanks to Keith!
I don't get the error, but
set xlateOutVals [list [string range [string toupper $xlateInVals] 0 11]]
returns the leading brace as part of the string range result:
|{SOMETHING L|
System
Originally posted by Mary Kobis
replace $xlateInVals with [lindex $xlateInVals 0]. I have found the { disappears when you do this, even though there is only 1 value.
Vince Angulo
That did it Mary!!
Thanks