there should be END here

BeliasBelias Member Posts: 2,998
hi everyone...i'm in trouble...i got compilation error "there should be END here"
and it is in 1800 lines of code...I was wondering if there is a tool that analyze the "if then else end" structure...but i don't know what to search in google...
anyone have an idea?
thanks in advance
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog

Comments

  • DenSterDenSter Member Posts: 8,305
    You're not looking for an IF statement necessarily, you are looking for a BEGIN that doesn't have a matching END.

    The best method of doing this is to backtrack what you were doing right before it went wrong. The code compiles, you make a change, then the code doesn't compile. 10 to 1 that you just put something in there that caused it. There's no need to examine all of the code, just the area that you were working in. If you've aligned the code properly it should not be too much of a problem to find the right BEGIN to put your END in.
  • BeliasBelias Member Posts: 2,998
    DenSter wrote:
    You're not looking for an IF statement necessarily, you are looking for a BEGIN that doesn't have a matching END.

    The best method of doing this is to backtrack what you were doing right before it went wrong. The code compiles, you make a change, then the code doesn't compile. 10 to 1 that you just put something in there that caused it. There's no need to examine all of the code, just the area that you were working in. If you've aligned the code properly it should not be too much of a problem to find the right BEGIN to put your END in.

    yes, it is surely my fault...but the problem is that I modified at least 100 separated lines/groups of lines of code...also, I was doing an upgrade and I didn't really care about the code i was copy/pasting...so.. :(
    isn't there a tool? [-o< [-o<
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • DenSterDenSter Member Posts: 8,305
    I don't know of any tool that can check this. I don't mean to say you're not doing a good job, because you probably are, and you are obviously working hard to get it right, but you should have been more careful about BEGIN and END. I've done quite a bit of code merging, and I've been in your position many times. Instead of spending a long time trying to figure out where it went wrong, I would start the particular object from scratch. Maybe take smaller steps, save and compile the object often, import it and see where it still works. That way you can see which part of the code causes the problem.

    Hopefully you've learned from it that you should care about all the code you are copy/pasting. I use a text compare tool, that is much more efficient at finding the code differences, and that way you also catch hidden triggers and properties that are hard to find in the object designer.

    You'll get it sooner or later :mrgreen: just keep working away at it.
  • BeliasBelias Member Posts: 2,998
    I AM using a merging tool...i'm not so crazy :)...and with some cross compare i find the "END;" \:D/ \:D/
    i only miss one line over 1830 (in the same function, code of CU 80).

    with "i don't care about the code", i mean that i can't imagine the repercussions (is it english?) that a line of code can have on the other lines...if i do so, it will be an endless work, isn't it? :mrgreen:
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • DenSterDenSter Member Posts: 8,305
    Awesome, good work =D>

    You're right, you have to kind of "not care", but you must get those BEGIN and END statements right, because they can cause havoc if you don't. This is another reason by the way that I always use BEGIN and END, even in one line IF statements. It makes it much easier to identify where the code is supposed to go.
  • BeliasBelias Member Posts: 2,998
    DenSter wrote:
    Awesome, good work =D>

    You're right, you have to kind of "not care", but you must get those BEGIN and END statements right, because they can cause havoc if you don't. This is another reason by the way that I always use BEGIN and END, even in one line IF statements. It makes it much easier to identify where the code is supposed to go.

    thanks! and you're right! and it's easier to debug...how many times i set e breakpoint and it was shifted because of a simple if statement!
    but we can't ask ms to do the same :-$

    there are many other things that make upgrade life easyer, e.g. don't put new variables between the std ones...and many others...we should open a topic about this!
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
Sign In or Register to comment.