Заранее прошу прощения за мою тупость, вот код, который я вставил, согласно вашим высказываниям:
SeedRnd(MilliSecs())
Function UpdateMusic(channel)
If ChannelPlaying (channel) = 0 channel=SelectRandMusic("music")
Return channel
End Function
Function SelectRandMusic(DIR$)
Local counter%=0
Local channel%=0
Local dir_h%=ReadDir(DIR$)
While True
file$=NextFile$(dir_h)
If Upper$(Right(file$,3))="MP3"
counter=counter+1
EndIf
If file$="" Exit
Wend
CloseDir dir_h
Print "files="+counter
Local iR%=Rand(1,counter%)
If Not counter Return False
counter=0
dir_h%=ReadDir(DIR$)
While True
file$=NextFile$(dir_h)
If Upper$(Right(file$,3))="MP3"
counter=counter+1
If counter%=iR
Print "select - "+IR+" = "+file$
channel=PlayMusic(DIR$+"\"+file$)
Exit
EndIf
EndIf
Wend
Return channel
End Function
channel=UpdateMusic(channel)
Объясните, не как не пойму
