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
":ct" operand in If compare
System
Originally posted by Bob Schmid
Can someone show me the syntax of using the string ct operator within a xlate if statement?...for example..I want to check a field for all numerics
Thanks
Find more posts tagged with
Clovertech
Comments
Tom Rioux
Hi Robert,
We have used the string "ct" before but not as you requested. We have used it to check to see if a string contains a literal such as "INT". Here is the example:
0(0).PV1.#2.[0] eq =R && 0(0).PV1.#10.[0] ct =INT
I'm not sure if the "ct" string command can be used in the way you want. What we have done here is taken the inbound value and run it through a pre-proc to check to see if the field is numeric. If so, then perform some function. In our case, we set it to a variable called
@isnumeric
to be used later in the xlate.
Hope this helps...
Tom Rioux
System
Originally posted by Bob Schmid
Thomas...
at first blush...Im not sure I see the difference in your example between eq and ct.
:?:
Thanks,
Bob
System
Originally posted by Bob Schmid
Coffee required in order to rightly interpret! :shock:
Thanks Jim for your email...that's what we ended up doing! ...used a pre-proc in the translate and stinrg is digit check
but...now I know about ct-Contains too!
Tom Rioux
It would be nice if all solutions were submitted through Cloverltech instead of private emails. That way, everyone can share in the benefits of knowing all possible solutions.
At least...that is what one Clovertecher told me a while back!
Thanks...
System
Originally posted by Troy Morton
Is the 'ct' operator something that was added after 5.4? I tried to use it and got an error when I tried to compile my Xlate.
Troy
Max Drown
Why send the solution in an email? Post it here so others with the same issue can search and find a resolution to the same issue.
Max Drown
The "ct" operator means "contains". The operator will search the field for the given string.
If "hello, world!" contains "hello" then it will return true.
Make sense?
Max Drown
In your example above, you could also use a tcl fragment instead of a pre-proc.
Tom Rioux
One caveat concerning the use of the "digit" class with the "string is" command. If you have a negative value such as -1, then the "string is digit" command will return false. It would probably best suit your purposes to use "string is integer".
Example:
hcitcl>set a -1
-1
hcitcl>string is digit $a
0
hcitcl>string is integer $a
1
hcitcl>
This bit me once already.
Thanks....
Tom Rioux
Charlie Bursell
One other caveat to be aware Tom.
If you do not use the -strict flag, the empty string will always return true.
string is digit -strict $a
Tom Rioux
Thanks for the tip Charlie....I was not aware of that flag
System
Originally posted by Troy Morton
In what version of Cloverleaf does the "ct" operator become available?
It doesn't appear to be in Cloverleaf 5.4.
Thanks,
Troy
System
Originally posted by Tom Arrowsmith
I also have 5.4.1 and was unable to use ct
I am assuming it is not part of 5.4
any thoughts?
Tom
Jim Kosloskey
I think that is first available in 5.6.