Syntax
PosIns( cString, cInsert, [nPos] ) --> cResultArguments
cString
cInsert
nPos
Example
PROCEDURE Main()
LOCAL cDate := "20261102"
Check( 'PosIns( "abcdefgh", "123", 2 ) ', PosIns( "abcdefgh", "123", 2 ), "a123bcdefgh" )
Check( 'PosIns( "abcdefgh", "123", 8 ) ', PosIns( "abcdefgh", "123", 8 ), "abcdefg123h" )
Check( 'PosIns( "abcdefgh", "123", 10 ) ', PosIns( "abcdefgh", "123", 10 ), "abcdefgh" )
Check( 'PosIns( PosIns( cDate, "-", 7 ), "-", 5 ) ', PosIns( PosIns( cDate, "-", 7 ), "-", 5 ), "2026-11-02" )
RETURN
STATIC PROCEDURE Check( cTitle, xResult, xExpected )
QOut( cTitle + IIF( xResult == xExpected, "OK", "ERROR" ) )
RETURNOutput
PosIns( "abcdefgh", "123", 2 ) OK
PosIns( "abcdefgh", "123", 8 ) OK
PosIns( "abcdefgh", "123", 10 ) OK
PosIns( PosIns( cDate, "-", 7 ), "-", 5 ) OK