Help with program function calls

the comparison of the var 'thing' and 'X' should result in a true result but for some reason it appears that program flow just jumps straight over the IF statement as if it was not even there.

No it doesn't. In your program thing will never equal 'X' or any single character.

Look carefully at the output from my code in reply #8

In processCmd thing is : 
>>X
<<

The delimiters >> and << are there to show you where thing starts and ends when it is printed.
Why is the << on a new line ? The program does not output a newline so where did it come from I wonder ?

Need a bigger clue, then print the length of the thing variable in the function. How many characters is it ? How many characters are there in 'X' ?