|
before someone trash on VB.
Well, yes, the code is a mess. But i was doing it for a friend in a rush, and i was getting paid for it, to deliver it on time. Which, btw, i did, ka-fucking-ching! $$!!
But yeah Snow, i agree with you. And i will probably re-write this, now that i have no deadline.
My question was : "why does this if statement ever return true, when i am pretty sure its true", hell i even did this :
label1.caption = "1" label2.caption = "2" if label1.caption = label2.caption then msgbox "it works!" end if
and it didnīt return me true.
But i fugured why. I took one If out of the chain, and it work.
The second if statement condition (the one that wasnīt necessary) was the key to get it to work, i simple ended it before checking label1 and label2 and it works. I tried to delete it, but then label1 and label2 returned to their never checking condition. So i guess it was somewhat necessary.
Now, VB is understimated. You can do a lot with VB. Its not the best language, true, but at least, i donīt have to type 400 fucking lines to get a fucking simple window drawn in my screen. (Visual C++ ? beh) I havenīt tried .Net stuff properly to say anything, because i donīt own it, and i didnīt feel like downloading all that stuff to do simple codes.
Delphi, on the other hand, seems to be the shit. However, i donīt have time to learn it. Or i am too stupid for it, which is a possibility. Which might be the problem with me learning C and its variants too.
Anyway, VB is not the root of all evil, like some people make it. Its a simple tool, for coding simple programs to do stuff. The kids that try to code a fucking operating system in VB are the stupid ones. Or the ones who thinks they can write a full 3D clone of Quake or whatever is the FPS of the moment using only VB. But i am aware of its limitations. And for a simple dbase application, VB works, and very well, may i add.
But yeah.. what you said. hehe.
> The problem is that you're using an old and shitty language. Just remember that > you brought this thrashing upon yourself... > > Good god man, you mix your DB code with your form code? Separate that shiznit! > Have you heard of separating your application into logical layers? Business > objects? And give your goddam form objects meaningful names! If I had even an > incling of what relationship Problema12, Problema22, List(2,5,13), etc had then > maybe it would make this easier to read. And this condition, > > If posicao = -1 Then Exit Sub > If posicao -1 Then > > If the first "If" statement isn't true then the second "If" statement has to be > true! You don't need the second condition at all. And despite my cuntings I've > taken the time to cut up the code and try to figure out what's going on. The > question you have is "why doesn't this if statement ever return true?" We have > no way of ever knowing. Label1.Caption comes from achou which is > dBase.Field(3), whatever that is. Label2.Caption comes from a list which we > have no idea what's in it. > > Let me ask a simple question. Have you looked at this in the debugger and if > you have what are the values of Label1.Caption and Label2.Caption when it hits > this condition? > > > > pixel-eight.com >
|