Concerning $sSelectedPath, you could declare it Local if you place your Main loop in a function, for example with the canvas below, which assigns the variable in _BrowseForFolder() and _EnterSetName() , then returns its value from both functions to Main() . Now you can pass the variable as a parameter in functions _DeleteTextListing() and _SelectWavData()
Main()
; -----------------------------------------------
Func Main
Local $sSelectedPath = "", $sMasterEdlFile = ""
Local $hGUI, $_sCol3Row3, $_sCol3Row4, $_sCol3Row5, $_sCol3Row6, $_sCol3Row9
$hGUI = GUICreate(...)
$_sCol3Row3 = GUICtrlCreateButton(...)
$_sCol3Row4 = GUICtrlCreateButton(...)
$_sCol3Row5 = GUICtrlCreateButton(...)
$_sCol3Row6 = GUICtrlCreateButton(...)
$_sCol3Row9 = GUICtrlCreateButton(...)
GUISetState(@SW_SHOW, $hGUI)
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
Case $_sCol3Row3
$sSelectedPath = _BrowseForFolder()
Case $_sCol3Row4
$sSelectedPath = _EnterSetName()
Case $_sCol3Row5
_DeleteTextListing($sSelectedPath)
Case $_sCol3Row6
_SelectWavData($sSelectedPath)
Case $_sCol3Row9
_ExitMe()
EndSwitch
WEnd
EndFunc
; -----------------------------------------------
Func _BrowseForFolder()
Local $sSelectedPath = FileSelectFolder(...)
...
Return $sSelectedPath
EndFunc
; -----------------------------------------------
Func _EnterSetName()
Local $sSelectedPath = InputBox(...)
...
Return $sSelectedPath
EndFunc
; -----------------------------------------------
Func _DeleteTextListing($sSelectedPath)
...
EndFunc
; -----------------------------------------------
Func _SelectWavData($sSelectedPath)
...
Return
; -----------------------------------------------
Func _ExitMe()
Exit
EndFunc
; -----------------------------------------------
Of course you'll have to check, at a moment or another, if $sSelectedPath is valid (e.g if it's not empty) for example in main loop (but not really user friendly) :
Case $_sCol3Row5
If $sSelectedPath Then _DeleteTextListing($sSelectedPath)
Or you can check if $sSelectedPath is valid from within the functions _DeleteTextListing() and _SelectWavData() and warn the user that $sSelectedPath has not been set yet.
Another way could be to disable/enable both buttons $_sCol3Row5 (_DeleteTextListing) and $_sCol3Row6 (_SelectWavData) depending on the value of $sSelectedPath in functions _BrowseForFolder() and _EnterSetName() =>
* Disable the buttons if $sSelectedPath is empty
* Enable them if $sSelectedPath is valid
These are just quick ideas, untested, but well... you got the idea.