Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 12

Discussione: case

  1. #1
    Utente di HTML.it
    Registrato dal
    Feb 2003
    Messaggi
    409

    case

    <%

    dim lingua_1, lingua_2, lingua

    lingua_1 = Request.ServerVariables("HTTP_ACCEPT_LANGUAGE")

    lingua_1 = Split(lingua_1, ";")

    lingua_2 = Split(lingua_1(0), ",")

    lingua = Split(lingua_2(0), "-")


    select case UCASE(lingua(0))

    case "IT"
    frase = "Buon Natale e felice anno nuovo"

    case "FR"
    frase = "Joyeux noël et bonne année"

    case "ES"
    frase = "Feliz navidad y próspero año nuevo"

    case "PT"
    frase = "Feliz Natal e próspero ano novo"

    case "DE"
    frase = "Frohe Weihnachten und ein gutes neues Jahr"

    case else
    frase = "Merry Christmas and a happy New Year"

    end select

    Response.write "

    " & frase & "!</p>"

    %>


    Dentro a case posso mettere un if ... then ..... else ... end if

    e piu' di uno?

  2. #2
    Utente di HTML.it L'avatar di 99eros9
    Registrato dal
    Jan 2003
    Messaggi
    2,637
    puoi mettere tutto ciò che vuoi.
    Tala är silver men tiga är guld!
    Pubblica il tuo curriculum
    Segnala il tuo sito
    Ancl

  3. #3
    Si.
    Provare paura per un qualcosa che ti possa capitare nel futuro non ti evita quell'evento,ti fa soltanto vivere un presente sbagliato!

  4. #4
    Utente di HTML.it
    Registrato dal
    Feb 2003
    Messaggi
    409
    Grazie ma non funziona, cmq riprovo

  5. #5
    Utente di HTML.it L'avatar di buji
    Registrato dal
    Nov 2002
    Messaggi
    178
    Posta il codice
    Buji

  6. #6
    Utente di HTML.it
    Registrato dal
    Feb 2003
    Messaggi
    409
    function campi(VLang,name)
    Select Case name
    Case "Nome e Cognome"
    if VLang="IT" then campi="Nome e Cognome" else campi="Name and surname"
    Case "Telefono"
    if VLang="IT" then campi="Telefono" else campi="Phone"
    Case "Fax"
    campi="Fax"
    Case else
    campi=""
    End Select
    end function

    e se è così?

  7. #7
    codice:
    function campi(VLang,name) 
    Select Case name 
      Case "Nome e Cognome" 
         if VLang="IT" then 
            campi="Nome e Cognome" 
         else 
            campi="Name and surname" 
         end if 
      Case "Telefono" 
         if VLang="IT" then 
            campi="Telefono" 
         else 
            campi="Phone" 
         end if 
      Case "Fax" 
         campi="Fax" 
      Case else 
         campi="" 
    End Select 
    end function
    Così!!!
    Provare paura per un qualcosa che ti possa capitare nel futuro non ti evita quell'evento,ti fa soltanto vivere un presente sbagliato!

  8. #8
    Utente di HTML.it
    Registrato dal
    Feb 2003
    Messaggi
    409
    e se ho anche altre lingue?

  9. #9
    Utente di HTML.it L'avatar di buji
    Registrato dal
    Nov 2002
    Messaggi
    178
    Fai un altro select case annidato per le lingue opure if elseif
    Buji

  10. #10
    Utente di HTML.it
    Registrato dal
    Feb 2003
    Messaggi
    409
    non funziona....
    credo dia noia function

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.