Hi

Im a newbie at most of this stuff, though just looking I can see maybe one problem at least,,

I dont see how switch statement would be any better..
Does the code halt after it has found 1 open port..?
And is it really necessary (unless of course your making it for somone else)..to have the Port type output in text ?,,after all ports are just numbers (an array maybe).

Anyway not knowing a whole lot about it at the moment,,but thanks for posting a bit of newbie code up,,,I like that stuff because I can understand it to a point .

Cheers