Unexpected If-Then Behavior in an Export Loop

Have a look there ...
Export, $Puts() is executed always
You have to modify the $if statements, because $put/$puts does not work within $if expression.

DD.20140823.0835.CEST