Palmeira Posted November 1, 2007 at 05:12 PM Report Share #144518 Posted November 1, 2007 at 05:12 PM boas estou com um problema no seguinte código : Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Dim linha, nfich, res As String nfich = TextBox1.Text + ".txt" FileOpen(1, nfich, OpenMode.Input) res = "" Do While Not EOF(1) linha = LineInput(1) res = res & vbCrLf & linha Loop TextBox2.Text = res FileClose(1) textbox3.Text = contapal(TextBox2.Text) End Sub este código é o que chama a função contapal() [que deve estar incorrecto, mas pronto.] Agora, a função propriamente dita : Module funcoes Function contapal(ByVal x As String) As Integer Dim l, i As Integer Dim esp As Integer l = Len(x) : esp = 0 For i = 0 To l If Mid(x, i, 1) = " " Then esp += 1 Next Return esp + 1 End Function End Module em anexo envio o programa completo para verem como está organizado/estruturado. Desde já obrigado, Palmeira Twitter devART FaceBook Link to comment Share on other sites More sharing options...
Revolt Posted November 1, 2007 at 09:52 PM Report Share #144556 Posted November 1, 2007 at 09:52 PM numa passagem rápida não detecto nenhum erro de maior. Qual é que é o problema mesmo? Revolt Website Antigo Nick: Pauzinhos Link to comment Share on other sites More sharing options...
Ivo Pereira Posted November 1, 2007 at 10:27 PM Report Share #144561 Posted November 1, 2007 at 10:27 PM Sim, podias ter especificado qual é o problema... não somos bruxos ? 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