Jump to content
Sign in to follow this  
froufrou

Exit my function and continue the While Loop

Recommended Posts

froufrou

Here's a piece of code,if more is needed just tell me.

This function is called from a button press.What i can't seem to figure out is ,if the the user doesn't pick any files or just closes the FileOpenDialog. How do I just leave my function and continue the while loop.

Sorry for the noobness :)

Func Open()
    GUICtrlSetColor($button, 0xC10002)
    $media2 = FileOpenDialog("Get Some Music", $ini6, "All Formats (*.aac;*.ac3;*.ape;*.flac;*.mpc;*.ofr;*.ogg;*.ra;*.wv;*.mp3;*.3gp;*.m4a;*.mp2;*.mp4;*.wma;*.wav;*

.aif;*.fla;*.oga;*.adx;*.mac;*.mp+;*.mpp;*.ofs;*.spx;*.tta;*.cda;*.mid;*.midi;*.rmi;*.kar))
;==============Leave from here somehow 
    $S1 = StringInStr($media2, "\", 0, -1)
    $l1 = StringLen($media2)
    $R1 = StringTrimRight($media2, ($l1 - ($S1 - 1)))
    $R2 = StringTrimLeft($media2, $S1)
    IniWrite($ini, "1", "8", $R1)

Share this post


Link to post
Share on other sites
froufrou

Sorry :)

I just split the big function to 2 and it fixed me right up. :)

Func Open()
    GUICtrlSetColor($button, 0xC10002)
    $media2 = FileOpenDialog("Get Some Music", $ini6, "All Formats (*.aac;*.ac3;*.ape;*.flac;*.mpc;*.ofr;*.ogg;*.ra;*.wv;*.mp3;*.3gp;*.m4a;*.mp2;*.mp4;*.wma;*.wav;*

.aif;*.fla;*.oga;*.adx;*.mac;*.mp+;*.mpp;*.ofs;*.spx;*.tta;*.cda;*.mid;*.midi;*.rmi;*.kar))
If @error Then
    GUICtrlSetColor($button, 0x0258C1)
Else
    playnewfile()
    EndIf
EndFunc  ;==>Open

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×