There's nothing wrong with your function, but it's with the way you are trying to use the value returned from the function.
Whenever you use a variable inside a function, it cannot be accessed from anywhere else in the program except from within that function.
It seems a little weird at first, but once you get used to it, it's a very nice thing to take advantage of.
To answer your question, when a value is returned from a function, you need to 'capture' it into a variable of some sort, or output it straight away.
such as;
conNum = showconnections()
print "Connection number entered:",conNum
wait key
or;
print "Connection number entered:",showconnections()
wait key
There's also another issue with what you are actually trying to do.
When you get input from the user, it will always be in a string ( which you have ), however, what you are after is an integer number... So, you need a way to convert from a string to an Integer.
To do that, you want to use the
Val() command.
Hope that helps
Jess.