many thanks for the relpy i wil try this tomorrow evening and let you know, programmers in garage, as the only computer with a serial port lives in the garage :lol:

so basically if i use the connditions for z, they need to be inside the count code. took me hours to work out the if/then so it would compile without error

again many thanks