4D was expecting a text expression.
$Pos:=Position("?ws4d_nav=true";$1)