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
tcl sort
System
Originally posted by Paul Sullivan
Hopefully a simple tcl question. We have up to seven alpha characters stored in a single variable. We need to sort the variable A-Z to limit the choices that are in a table. My tcl is weak.
Find more posts tagged with
Clovertech
Comments
Keith McLeod
Can you elaborate with an example?
jcobane1
Paul,
I'm not sure I fully understand your question, but I will assume that you have a variable (myvar) whose value is "A D B F C E". If so, you could simply make it a list and then sort the list; i.e.
set mylist [split $myvar]
set myvar [lsort $mylist]
Hope this helps.
Jim Cobane
Henry Ford Health
Max Drown
Yup, the tcl lsort command is what you need.
http://www.tcl.tk/man/tcl8.4/TclCmd/lsort.htm
On Unix or Linux, you can also use the system sort command by calling it with the tcl exec command.
set var1 [exec sort $fileName]
Read the sort man pages for all of the options.
Charlie Bursell
Of course before you use lsort your variable must be turned into a list.
Try this .. not pretty but works
set X CBFADE
set Y [join [lsort [split $X ""]] ""]
=> ABCDEF
System
Originally posted by Paul Sullivan
Appreciate the replies and I will practice with this bit of tcl, but I did not really think my issue through well enough. Turns out there may be 1000+ combinations to choose from. Not something I wish to maintain a table for. I went the hard code route and is running OK.