Visualizzazione dei risultati da 1 a 5 su 5

Discussione: if e else if

  1. #1

    if e else if

    sto facendo un ciclo su una tabella di questo tipo:

    if tabella.EOF or tabella.BOF then
    tit = ("")
    img = ("1.gif")
    ID = ("0")

    else if tabella("campo") = 0 then

    titpag = ("titolo")
    img = ("2.gif")

    else if tabella("campo") = 1 then
    tit = ("testo")
    img = ("cesto.gif")
    end if
    end if
    end if



    ----------------------------------
    non mi da errore ma quando entra nel terzo caso non visualizza l'immagine ... ho provato a vedere i percorsi etc... ma a me sembra tutto ok

    qualcuno vede qualche errore
    (il campo che controllo nel secondo e terzo caso è un campo si/no)

  2. #2
    Prova a debuggare il ciclo con queste response in grassetto:

    codice:
    if tabella.EOF or tabella.BOF then 
       tit = ("") 
       img = ("1.gif") 
       ID = ("0") 
       response.write(tabella("campo") & "
    ")     
    else if tabella("campo") = 0 then 
            titpag = ("titolo") 
            img = ("2.gif") 
            response.write("Sto stampando 2.gif 
    ")    
         else if tabella("campo") = 1 then 
                 tit = ("testo") 
                 img = ("cesto.gif") 
                 response.write("Sto stampando cesto.gif 
    ")                 
              end if 
         end if 
    end if
    Provare paura per un qualcosa che ti possa capitare nel futuro non ti evita quell'evento,ti fa soltanto vivere un presente sbagliato!

  3. #3
    Utente di HTML.it L'avatar di albis
    Registrato dal
    May 2002
    Messaggi
    912
    codice:
    if tabella.EOF or tabella.BOF then
    	tit = ("")
    	img = ("1.gif")
    	ID = ("0")
    elseif tabella("campo") = true then
    
    	titpag = ("titolo")
    	img = ("2.gif")
    elseif tabella("campo") = false then
    	tit = ("testo")
    	img = ("cesto.gif")
    end if
    Forza la magica ROMA

  4. #4

  5. #5
    Utente di HTML.it L'avatar di albis
    Registrato dal
    May 2002
    Messaggi
    912
    di nulla
    X maximum

    Prrrrroooooooottttt








    Forza la magica ROMA

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 © 2026 vBulletin Solutions, Inc. All rights reserved.