tukith Posted May 28, 2008 at 04:58 AM Report Share #187963 Posted May 28, 2008 at 04:58 AM galera, eu fiz 2 variaveis dim parte2 as string dim parte3 as string sem elas o programa n funcionava, eu fiz elas e funcionou, é um programa de IMC (índice de massa corporal) até testei o resultado em sites e deu certo, mas aparece um erro depois que eu aperto calcular, eh o seguinte erro: Run-time error '5': Invalid procedure call or argument como arrumo isso? valeu galera Link to comment Share on other sites More sharing options...
anolsi Posted May 28, 2008 at 12:22 PM Report Share #187996 Posted May 28, 2008 at 12:22 PM Tens que ser mais especifico, posta aqui o código onde te dá erro. "Nós somos o que fazemos repetidamente, a excelência não é um feito, e sim, um hábito."Não respondo a questões por PM que possam ser colocadas no fórum! Link to comment Share on other sites More sharing options...
asworm Posted May 28, 2008 at 12:54 PM Report Share #188002 Posted May 28, 2008 at 12:54 PM Tens de perceber que essa mensagem não nos diz muito... essa mensagem pode ocorrer em muitas situações... posta o codigo, ou entao o programa... mas o melhor seria o codigo... cumps Got it? Link to comment Share on other sites More sharing options...
asworm Posted May 28, 2008 at 01:40 PM Report Share #188016 Posted May 28, 2008 at 01:40 PM Dim parte2 As String Dim parte3 As String Private Sub Command1_Click() If Val(resultado.Text) = Val(peso.Text) / (altura.Text) Then resultado.Text = "15, Abaixo do Peso I." Else resultado.Text = "15 a 18.5, Abaixo do Peso" End If If parte2 Then resultado.Text = "18.6 a 24.9, Peso Normal." Else resultado.Text = "25 a 29.9, Acima do Peso." End If If parte3 Then resultado.Text = "30 a 39.9, Obesidade I." Else resultado.Text = "40 ou mais, Obesidade II." End If End Sub Private Sub sair_Click() End End Sub Private Sub sobre_Click() Load Form2 Unload Me Form2.Show End Sub Got it? Link to comment Share on other sites More sharing options...
asworm Posted May 28, 2008 at 01:47 PM Report Share #188019 Posted May 28, 2008 at 01:47 PM primeiro nao percisas das variaveis que tens... "parte2 e parte3" segundo estas a meter ao contrario, ou seja tens de meter o indice na condicao, ou seja, If peso.Text / altura.Text < 15 Then resultado.Text = " Abaixo do Peso I." Elseif peso.Text / altura.Text <18.5 then resultado.Text = " Abaixo do Peso" Elseif peso.Text / altura.Text <24.9 then resultado.Text = " Peso Normal." Elseif peso.Text / altura.Text <29.9 then resultado.Text = " Acima do Peso." Elseif peso.Text / altura.Text <39.9 then resultado.Text = "30 a 39.9, Obesidade I." Elseif peso.Text / altura.Text >40 then resultado.Text = " Obesidade II." End If supono que tenhas uma text box "resultado", "altura" e "peso" Got it? Link to comment Share on other sites More sharing options...
tukith Posted May 28, 2008 at 02:00 PM Author Report Share #188030 Posted May 28, 2008 at 02:00 PM sim tenho, claro o meu código tava funcionando, só dava aquele erro no final, como arrumo aquilo? o codigo que vc me passou não está funcionando /Tukith Link to comment Share on other sites More sharing options...
asworm Posted May 28, 2008 at 02:03 PM Report Share #188031 Posted May 28, 2008 at 02:03 PM experimenta agora Got it? Link to comment Share on other sites More sharing options...
tukith Posted May 28, 2008 at 02:05 PM Author Report Share #188033 Posted May 28, 2008 at 02:05 PM hã eu coloquei assim no txtbox peso: 20 altura: 1,70 resultado = obesidade II agora : peso: 80 altura: 1,20 resultado: Abaixo do Peso I. está trocando 0o Link to comment Share on other sites More sharing options...
asworm Posted May 28, 2008 at 02:16 PM Report Share #188052 Posted May 28, 2008 at 02:16 PM acho que era o igual Got it? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now