*step*) + 1 The only negative

*step*value allowed is -1, and the search

*string*must be 1 character long in this case. In other words, a negative

*step*is not allowed with any

*substring*greater than 1 character.

Return Data Type: | UNSIGNED |

**Clarion Win32 examples:**

! find the colon character searching from Right to Left using step of -1 ! the 4th parameter is our start position, which must be the last character of the clipped string s = '123:567:9' i = INSTRING(':',s,-1,LEN(CLIP(s))) !! i will be equal to 8 ! find the colon character searching from Left to Right using step of 1 s = '123:567:9' i = INSTRING(':',s,1,1) !! i will be equal to 4 ! find the string '567' searching from Left to Right using step of 1 s = '123:567:9' i = INSTRING('567',s,1,1) !! i will be equal to 5 ! if the search string is not found the return value is 0 s = '123:567:9' i = INSTRING('X',s,1,1) !! i will be equal to 0 ! Search in reverse for the last backslash ExePath=COMMAND('0') BS=INSTRING('\',ExePath,-1,SIZE(ExePath)) ExePath=SUB(ExePath,1,BS-1) ! If Step parameters is not specified it is the Len of the SubString X= instring('**', '1234 **Yes') ! X = 0 because Step is 2 (the length of '**') and the ** is in position 6

**Clarion# example:**In Clarion#, following the standard for all .Net languages

**the first character position in any string is Zero**(not 1 as it is in Clarion Win32)

! find the colon character searching from Right to Left using step of -1 s = '123:567:9' i = INSTRING(':',s,-1,LEN(CLIP(s))) !! i will be equal to 7 ! find the colon character searching from Left to Right using step of 1 s = '123:567:9' i = INSTRING(':',s,1,0) !! i will be equal to 3 ! find the string '567' searching from Left to Right using step of 1 s = '123:567:9' i = INSTRING('567',s,1,0) !! i will be equal to 4 ! if the search string is not found the return value is -1 s = '123:567:9' i = INSTRING('X',s,1,1) !! i will be equal to -1

**See Also:**STRPOS SUB STRING CSTRING PSTRING String Slicing INLIST