I'm trying to find the length of a string variable in order to evaluate how much of it I will pass to the ICM call variable. I'm using the latest CRA editor and I'm at a loss. This variable value may contain numbers and commas.
ICM has built in functions that allow enormous flexibility when working wit hstring variables.
To find the length of a variable, use the len() function. To find the length of part of a variable, you need more functions such as after(), before(), left(), right(), find(), substr()... etc.
Here is an example where I KNOW that the 10 character date is in the first 10 characters of my variable, but I don't know how many characters follow that date.
So, I use the subsring() function to return to me all of the characters after the 10 character date. Here is the standard usage of the substring function:
substr(s, i [, l])
Returns substring of s, beginning with i and continuing for l characters. The l is optional.
Here is how I would use it:
But I still don't know the lengh, su I use that within the len() function, like this:
Now I know how many characters follow the date value in my variable.
Here's another example. Lets say you have a comma in the variable, and you want to count all the characters after the comma. Use the after() function to find the first comma and count the rest of the variable length, like this:
Another example: Lets say that you know the length of half of the variable in every occurance of the variable and that length is 26. Use this:
(len(variable1) - 26).
If you provide more specifics I might be able to come up with a few more methods for finding the length of a string variable. There are more tricks in evaluating a string, such as value(), text() and if().
Here's the issue and maybe you can help:
I'm having callers enter the date. I need to prepend this date with enough zeroes to total 12 characters. There is also an * that I'm using to delineate between $ and cents.
Thanks for the help