Announcement

Collapse
No announcement yet.

main() in comments bug

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • main() in comments bug

    I'm not sure if I've reported this before but it caught me out today when I was doing some EFS stuff. Perhaps someone else that is familiar with this can expand on this.

    If you have "main()" (without the quotes) in a comment in the top of the EFS file it causes errors elsewhere in the EFS.

    Here is an example:
    PHP Code:
    /*

    put text here and then the main() word

    */

    function preMain() {
        
    _init true;
        var 
    x=0;
        
    aFPArray[x] = new FunctionParameter"p1"FunctionParameter.STRING);
        
    withaFPArray[x++] ) {
            
    addOption("PS_SOLID");
            
    addOption("PS_DOT");
            
    addOption("PS_DASH");
            
    addOption("PS_DASHDOT");
            
    addOption("PS_DASHDOTDOT");
            
    setDefault"PS_DASH" );
        }
    }

    var 
    aFPArray = new Array();
    var 
    _init;

    function 
    main(p1) {
        if(
    _init) {
            
    setDefaultBarStyle(eval(p1), 0);
            
    _init false;
        }

        return;

    Take out the comments at the top and the function doesn't generate an error.

    The problem is "main()" - if it's up against the left margin then it seems okay but anywhere else it causes a problem.

    Insights welcome...
    4
    Yes it does
    75.00%
    3
    No it doesn't
    25.00%
    1
    I'm not going to try
    0.00%
    0
    Standing on the shoulders of giants.

  • #2
    Hi wildfiction,

    I believe that will get you every time. Check out some links that may provide some additional insight.

    Comment


    • #3
      Many thanks for the reply and the links Steve - I see that it is a well documented bug in the forums but not the help files.

      I use CVS to maintain my EFS files and use the $Revision$ tag to stick my comments in the headers when I make changes and sometime I will put in a comment like:

      "... in the main() part of the EFS..."

      and I do this after I've finished testing the EFS and check it into CVS. So the process of checking the EFS into CVS adds the comment to the EFS file and introduces the bug.

      Not something that you would expect to happen.

      I suppose that the solution would be to write a macro of something in CVS that would parse your comment and warn you if you'd entered "main()" in your comments.

      Speaking of that... are there any other known character combinations in the comments that will cause problems or is that the only one?

      Thanks as always for all your help.
      Standing on the shoulders of giants.

      Comment


      • #4
        You are most welcome, the way I have handled this issue in the past is to either not use the parenthesis or puposefully mispelling main, e.g. Main, mane, etc. As far as using CVS, I cannot provide anything substantive there...

        As far as any others, none come to mind.

        Comment

        Working...
        X