n9mfk9 Posted November 22, 2006 Share Posted November 22, 2006 (edited) i am stuck i get an error with else or or ifelse expandcollapse popup;$Group1 = GUICtrlCreateGroup("", 16, 128, 177, 49) ;$Label1 = GUICtrlCreateLabel("", 24, 144, 163, 25) ;GUICtrlCreateGroup("", -99, -99, 1, 1) ;GUICtrlSetData( $Label1, $readout) $a="" $Card1= " Playback: "&RegRead("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Playback") $card2= " Record: "&RegRead("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Record") $readout= $card1&@CR &$card2 #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form=c:\documents and settings\beau thompson\my documents\agui.kxf $agui_1 = GUICreate("audio slect", 366, 264, 294, 269) $Button1 = GUICtrlCreateButton("IMIC", 24, 16, 57, 25, 0) $Button2 = GUICtrlCreateButton("AC97", 96, 16, 57, 25, BitOR($BS_CENTER,$WS_GROUP)) $Button3 = GUICtrlCreateButton("IMIC/AC97", 23, 45, 57, 25, 0) $Button4 = GUICtrlCreateButton("A97/IMIC", 95, 45, 57, 25, BitOR($BS_CENTER,$WS_GROUP)) $Button5 = GUICtrlCreateButton("INPUT", 24, 72, 57, 25, 0) $Button6 = GUICtrlCreateButton("OUTPUT", 96, 72, 57, 25, BitOR($BS_CENTER,$WS_GROUP)) $Button7 = GUICtrlCreateButton("AButton1", 23, 100, 57, 25, 0) $Button8 = GUICtrlCreateButton("AButton1", 95, 100, 57, 25, BitOR($BS_CENTER,$WS_GROUP)) $Group1 = GUICtrlCreateGroup("", 16, 128, 177, 49) $Label1 = GUICtrlCreateLabel("", 24, 144, 163, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlSetData( $Label1, $readout) $Input1 = GUICtrlCreateInput("AInput1", 16, 200, 41, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit $Card1= " Playback: "&RegRead("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Playback") $card2= " Record: "&RegRead("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Record") $readout= $card1&@CR &$card2 Case $Button1 $Playback = "iMic USB audio system" $Record = "iMic USB audio system" RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Playback", "REG_SZ",$Playback) RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Record", "REG_SZ",$Record) $Card1= " Playback: "&RegRead("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Playback") $card2= " Record: "&RegRead("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Record") $readout= $card1&@CR &$card2 GUICtrlSetData( $Label1, $readout) ;$Label1 = GUICtrlCreateLabel($readout, 24, 144, 163, 25) Case $Button2 $Playback = "Realtek AC97 Audio" $Record= "Realtek AC97 Audio" RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Playback", "REG_SZ",$Playback) RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Record", "REG_SZ",$Record) $Card1= " Playback: "&RegRead("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Playback") $card2= " Record: "&RegRead("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Record") $readout= $card1&@CR &$card2 GUICtrlSetData( $Label1, $readout) Case $Button3 $Playback = "iMic USB audio system" $Record = "Realtek AC97 Audio" RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Playback", "REG_SZ",$Playback) RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Record", "REG_SZ",$Record) $Card1= " Playback: "&RegRead("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Playback") $card2= " Record: "&RegRead("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Record") $readout= $card1&@CR &$card2 GUICtrlSetData( $Label1, $readout) Case $Button4 $Playback = "Realtek AC97 Audio" $Record = "iMic USB audio system" RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Playback", "REG_SZ",$Playback) RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Record", "REG_SZ",$Record) $Card1= " Playback: "&RegRead("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Playback") $card2= " Record: "&RegRead("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Record") $readout= $card1&@CR &$card2 GUICtrlSetData( $Label1, $readout) Case $Button5 Run("C:\WINDOWS\system32\sndvol32.exe") Case $Button6 Run("C:\WINDOWS\system32\sndvol32.exe -R") Case $Button7 test() Case $Button8 EndSwitch WEnd Func test() If StringInStr ($card1,"Realtek AC97 Audio")Then $a = "1:2:3" i am get an error Elseif StringInStr ($card1,"iMic USB audio system")Then $a= "3:3::3" MsgBox(0,"",$a) Return EndIf EndIf EndFunc thanks beau Edited November 22, 2006 by n9mfk9 Link to comment Share on other sites More sharing options...
Developers Jos Posted November 22, 2006 Developers Share Posted November 22, 2006 syntax is: If ... then ; do this ElseIf .... then ; do this else ; do this endif SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now