FUNCTIONS CORE

CharOdd()

Extract the characters at odd positions from a string

Syntax

Signature
CharOdd( cString ) --> cResult

Arguments

cString

Example

CharOdd.prg
PROCEDURE Main()

   Check( 'CharOdd( "a1b2c3" ) ', CharOdd( "a1b2c3" ), "abc" )
   Check( 'CharOdd( "x" )      ', CharOdd( "x" ), "x" )

RETURN

STATIC PROCEDURE Check( cTitle, xResult, xExpected )

   QOut( cTitle + IIF( xResult == xExpected, "OK", "ERROR" ) )

RETURN

Output

CharOdd( "a1b2c3" ) OK
CharOdd( "x" )      OK