Aller au contenu

Photo

My first multi-event script - variable defined without type


  • Veuillez vous connecter pour répondre
29 réponses à ce sujet

#26
MerAnne

MerAnne
  • Members
  • 1 157 messages
Did you test to see if it is the line causing the problem? Humor an old lady - try it.

#27
BlackSheep42

BlackSheep42
  • Members
  • 26 messages
Certainly.

Changing the 'else' statement to 'else if' failed to compile, with the error "invalid expression".
Changing it to 'case' (as in satans_karma's script) failed to compile, with the error "Jumping over declaration statements case disallowed".
Deleting the 'else' altogether failed to compile, with a repeat of the error on the previous page.

I have therefore restored the script to its original form as it came in the template, with an 'else' statement before 'EVENT_TYPE_GET_PLOT'. This failed to compile, with the error 'No semicolon after expression' (full details on the previous page).

Modifié par BlackSheep42, 15 août 2012 - 04:22 .


#28
MerAnne

MerAnne
  • Members
  • 1 157 messages
check your syntax for the else if statement - I don't have the toolset in front of me so it may be 'if else' or 'else if'. I've programmed in too many languages to remember DAO toolset syntax specifically. And did you just try removing the colon ":" after EVENT_TYPE_GET_PLOT? Because that is what is probably causing the ';' problem.

And when none of that works. Welcome to the sometimes frustrating world of programming.

#29
Karma

Karma
  • Members
  • 391 messages

BlackSheep42 wrote...

Thanks to satans_karma for your downloadable modules.

I think you're giving me credit where no credit is due. I believe Sunjammer is the one who posted the downloadable modules.


As to the current scripting problem, try getting rid of the EVENT_TYPE_GET_PLOT: before the //. The plot template comments it out. Maybe they do that because it doesn't work [right]? Just use...
__________________________________________________________
     else // EVENT_TYPE_GET_PLOT -> defined conditions only
     {
        switch(nFlag)
        {
            case BLAH_BLAH_BLAH:
            {
           
             }
         }
    }
__________________________________________________________

...instead.

I don't see any other glaring errors... except maybe that last break. Does that go with something?

FYI - I've gotten "semicolon" errors for other syntax errors than just missing semi-colons; I've seen it for missing/misplaced/extra parentheses, colons, braces, and commas. That error can be misleading, so don't limit your search for just semi-colons. In some cases, the actual error may even be in a line above the line it specifies.

Modifié par satans_karma, 15 août 2012 - 08:46 .


#30
BlackSheep42

BlackSheep42
  • Members
  • 26 messages
Bingo. :) I'll remember that in future when I'm dealing with defined flags. Thanks again, folks!