• 0
Sign in to follow this  
mkboy

Erro Na Funcao

Question

Não funcionou:

Function MudaCor()

If (cor = "#F1F2F3") Then
MudaCor = "#E8EAEC"
Else
MudaCor ="#F1F2F3"
End If

End Function
while not rs_02.eof 


  Call MudaCor

        .write("<tr bgcolor= "& MudaCor & " >")
Mudei o cor para muda cor e continuou igual
Function MudaCor()

If (MudaCor = "#F1F2F3") Then
MudaCor = "#E8EAEC"
Else
MudaCor ="#F1F2F3"
End If

End Function

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

porque você não tenta:

Function MudaCor(cor)

If (cor = "#F1F2F3") Then
MudaCor = "#E8EAEC"
Else
MudaCor ="#F1F2F3"
End If

End Function
response.write MudaCor("#F1F2F3")

Share this post


Link to post
Share on other sites
  • 0

não foi!

Assim funciona:

  	If (cor = "#F1F2F3") Then
    cor = "#E8EAEC"
  	Else
    cor = "#F1F2F3"
  	End If

        .write("<tr bgcolor= "& cor & " class=""padrão"" height=""20"">") 

Mas se tentar colocar na funcao não funciona +

Share this post


Link to post
Share on other sites
  • 0

Caramba, criei 3 topicos iguais, acho que voi minha net que vascilou, hehehe

Moderador, pode deletar o resto que é tudo igual, vixi!

Share this post


Link to post
Share on other sites
  • 0

tenta isso

sub Troca()
   If cor = "#F1F2F3" Then
      cor = "#E8EAEC"
   Else
      cor ="#F1F2F3"
   End If
End Sub
while not rs_02.eof 

    troca()

        response.write("<tr bgcolor= "& cor & " >")

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this