Android Question Error in Select format

Discussion in 'Android Questions' started by ivavilagu, Feb 6, 2015.

  1. ivavilagu

    ivavilagu Member Licensed User

    I don´t know the cause but I have an error during compilation in line Select KeyCode

    "Error description: ',' expected"

    Code:
    Sub Activity_KeyPress (KeyCode As Int) As Boolean
        
    Select KeyCode
            
    Case KeyCodes.KEYCODE_BACK
                
    Select intNUM_PANTALLA
                    
    Case 0
                        
    'Se pulsa atrás en la pantalla 'principal'
                        If (intBackButtonCounter = 0Then
                            
    ToastMessageShow("Pulse de nuevo para salir",False)
                              intBackButtonCounter = 
    1
                               timeBACK.Initialize(
    "timeBACK",3000)
                               timeBACK.Enabled = 
    True
                               
    Return True
                        
    Else
                              
    Activity.Finish
                        
    End If
                    
    Case 1
                        pantalla_principal                                          
    'Se pulsa atrás en la pantalla 'referencia'
                        Return True
                    
    Case 2
                        
    'Se pulsa atrás en la pantalla de datos de referencia
                        CallSubDelayed(Me, "pantalla_referencia")                  'Se hace esta llamada para que ejecute el sub después de hacer el return true
                        Return True                                                 'para que el programa no aborte
                    Case 3
                        
    'Se pulsa atrás en la pantalla 'estudio de tiempos'
                        TIEMPO_PARCIAL.Enabled = False                               'Paramos los relojes de la pantalla 'estudio tiempos'
                        TIEMPO_TOTAL.Enabled = False
                        
    If (SDPanel.GetSlidingInProgress = TrueThen             'Comprobamos si los paneles se están deslizando. En caso afirmativo
                            Return True                                              'evitamos salir de la pantalla para que no se cuelgue el programa
                        Else
                            pantalla_principal
                            
    Return True
                        
    End If
                
    End Select
            
    Case KeyCodes.KEYCODE_VOLUME_DOWN Then                                    'Ha pulsado la tecla de bajar volumen en la pantalla 'estudio'
                If (intNUM_PANTALLA = 3 AND TIEMPO_PARCIAL.IsInitialized) Then        'Pasamos a tomar el tiempo sin actividad
                    agregar_crono(0)                                                
                    siguiente_movimiento
                    
    Return True
                
    End If
            
    Case KeyCodes.KEYCODE_VOLUME_UP Then                                       'Ha pulsado la tecla de subir volumen en la pantalla 'estudio'
                If (intNUM_PANTALLA = 3 AND TIEMPO_PARCIAL.IsInitialized) Then        'Pasamos de tomar el crono en ese tiempo
                    siguiente_movimiento
                    
    Return True
                
    End If
        
    End Select
    End Sub
     
  2. RandomCoder

    RandomCoder Well-Known Member Licensed User

    Try removing the Then statement is the last two Case lines.

    Code:
    CaseKeyCodes.KEYCODE_VOLUME_DOWN Then
     
    CaseKeyCodes.KEYCODE_VOLUME_UP 
    Then
     
    lemonisdead likes this.
  3. sorex

    sorex Expert Licensed User

    there are a few CASE ... THEN in the last part, THEN is not needed.
     
    lemonisdead likes this.
  4. ivavilagu

    ivavilagu Member Licensed User

    Ups, I didn´t see that mistake. Thanks!!!!
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice