crash my application

fifiddu70

Well-Known Member
Licensed User
Longtime User
How do I prevent the program give me error when it cannot find the audio files in the directory?

B4X:
Sub VR_Result (Success As Boolean, Texts As List)
    
   If Success = True Then
   lbl2.Text  = Texts.Get(0)
   MP.Initialize 
   MP.Load(File.DirAssets,lbl2.Text & ".wav")
   MP.Play
    Else 
   Msgbox("NO FILE SOUCH","WARNING !!")
   
   End If
End Sub
 

fifiddu70

Well-Known Member
Licensed User
Longtime User
yesssssss, ok


B4X:
Sub VR_Result (Success As Boolean, Texts As List)
    
   If Success = True Then
   lbl2.Text  = Texts.Get(0)
   If File.Exists(File.DirAssets, lbl2.Text & ".wav") = True Then
   MP.Initialize 
   MP.Load(File.DirAssets,lbl2.Text & ".wav")
   MP.Play
    Else 
   Msgbox("FRASE NON PRESENTE NEL DATABASE","AVVISO !!")
   End If
   End If
End Sub

thanks for your help
 
Upvote 0
Top