What you have done is not wrong, but as you stated you were learning, a couple of things are worth mentioning which although are very minor, are worth bearing in mind when your programs start getting a bit bigger:
There's a command called Perform Checklist For Files which makes the Find First/Find Next process easier. It puts everything it finds into a list (array), has an associated function called Checklist Quantity() which tells you how many items it found, and others which tell you if the items are files or directories.
Quote: "
totalfiles=totalfiles + 1
if right$(get file name$(),3) = "wav" OR right$(get file name$(),3) = "WAV"
"
You can save your fingers a little typing with these by using
Inc totalfiles
if Upper$(right$(get file name$(),3)) = "WAV"
Finally, (ignoring the ';' typo which DB oddly lets pass) there's no need to have
play$="" : files=0 : totalfiles=0 : wavcount = 0
at the end of the program as they aren't variables that use memory which has to be freed up when you've finished with them.
TDK_Man