|
> Ok, i am having a problem, the thing is, my code is only going so far, and when > it hit the line marked with **** it simple doesnt test it. > Is there some limit for it ? > or have i reached some kind of variable limit ? > > the program itself is quite big, and that if, was one of the first things, and > it was working back when i coded it, i extensively tested it. > its a search form through a database. its for a real estate control program i am > coding. > > code is as follows > In reply to: > If Problema12.ListIndex 0 And Problema22.ListIndex 0 And urgencia2.ListIndex = > 0 And cmb_valor2.ListIndex = 0 Then > 'Label51.Caption = "teste" > posicao = dBase.FindText(Problema12.List(Problema12.ListIndex), inicio, 2) > If posicao = -1 Then Exit Sub > If posicao -1 Then > 'inicio2 = posicao > dBase.AbsolutePosition = posicao > achou = dBase.Field(3) > Label1.Caption = achou > Label2.Caption = Problema22.List(Problema22.ListIndex) > Label51.Caption = achou > Label52.Caption = Label2.Caption > > ***** If Label1.Caption = Label2.Caption Then > List12.AddItem posicao, 0 > dBase.AbsolutePosition = posicao > mostrartipo = dBase.Field(2) > List2.AddItem mostrartipo, 0 > mostrardorm = dBase.Field(8) > List3.AddItem mostrardorm, 0 > mostrarend = dBase.Field(0) > List4.AddItem mostrarend, 0 > mostrarvalor = dBase.Field(13) > List5.AddItem mostrarvalor, 0 > mostrarcontato = dBase.Field(11) > List6.AddItem mostrarcontato, 0 > temfoto = dBase.Field(15) > 'temfoto2 = Left(temfoto, 1) > List13.AddItem temfoto, 0 > Label52.Caption = posicao > MsgBox "não falhou" > 'If temfoto2 "" Then > ' List13.AddItem "S", 0 > ' GoTo temfoto1 > 'End If > 'List13.AddItem "N", 0 > 'temfoto1: > ***** End If > posicao = posicao + 1 > inicio = posicao > achou = " " > > End If > End If > The part between the **** is not being tested. > and i am using label51 and label52 to check, and the values DO match, and so, > the code should be doing the stuff between the **** lines. > > Any ideas ? >
I don't use VB but I would have though you need to put the code after your 'if xxxx=xxxx then' statement as a block. For instance in Delphi, which I guess is pretty similar to VB it would be : if whatever = whatever2 then do begin blahblahblah; blahblahblah; blahblahblah; blahblahblah; end else 'do fuck all'
That way, all the code between begin and end will get executed in order. I don't know what the equivelant of begin and end are in VB, maybe that is the problem.
Trust me, I'm a fucking Doctor.
Arucard
|