Jump to content
Sign in to follow this  
n9mfk9

else ifelse?

Recommended Posts

n9mfk9

i am stuck i get an error with else or or ifelse

;$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 by n9mfk9

Share this post


Link to post
Share on other sites
Jos

syntax is:

If ...  then
   ; do this
ElseIf ....  then
   ; do this
else
   ; do this
endif

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.