Home      Ask a Question      My Stuff      Help   
  
Scripting - Search By Left, Middle, or Right
Using the below scripts one can now search and script off of portions of an entry at a job code prompt (x,y,z). The different portions are described as Left, Right, and Mid.

"Left" searches from the left to right of your entry to a defined (in the script) amount of digits or placements including the first left most digit.

"Right" searches from the right to left of your entry to a defined (in the script) amount of digits or placements including the first right most digit.

"Mid" would allow you to choose the starting placement or digit using a numbering system from the placement or digit you specify (in the script) to a defined (in the script) amount of digits or placements including your defined digit or placement.

The best way would be through an example. Say there is an entry at the x prompt of "ABCDEFG"

If you were searching from the left it would be:

A = 1
B = 2
C = 3
D = 4
E = 5
F = 6
G = 7

Some script examples of "Left" (Remember that x is referencing whatever value is in x or for our example "ABCDEFG") and the number represents the amount of placements from the left you want to include in your search including the leading placement or digit which is "A" in our example:

Left(x,1) = "A"
Left(x,4) = "ABCD"

From the Right:

A = 7
B = 6
C = 5
D = 4
E = 3
F = 2
G = 1

Here are some examples for "Right" (remember that x is referencing whatever value is in x or for our example "ABCDEFG") and the number represents the amount of placements from the right you want to include in your search including the leading right placement or digit which is "G" in our example:

Right(x,1) = "G"
Right(x,4) = "DEFG"

From Mid point it would be from the point you designated then the amount of digits/placements you wanted to go out to left to right and the best way to demonstrate this again is by examples:

Mid(x,5,1) = "E"

Explaining the above script and using an x prompt entry of "ABCDEFG" "5" would be "E" and going one placement to the right (including the "E") it would be "E".

Mid(x,5,3) = "EFG"

Another example above and using an x prompt entry of "ABCDEFG" "5" would be "E" and going 3 placements to the right (including the "E") it would be "EFG".

Mid(x,2,1) = "B"

Our last example above and using an x prompt entry of "ABCDEFG" "2" would be "B" and going one placement to the right (including the "B") it would be "B".

ID
444
Category
Training
  FAQ's
Date Created
10/7/2009 2:02:48 PM
Date Updated
9/22/2011 3:05:47 PM
Back to Search Results