Languages

Menu
Sites
Language
edje_cc script not clean?

I am trying to write a simple edc script in the edc editor (enventor). The following seems ok:

         script
         {
            public message(Msg_Type:type, id, ...)
            {
            }
         }

But with this:

         script
         {
            public message(Msg_Type:type, id, ...)
            {
               static Float:hh;
            }
         }

I get the message: edje_cc: Critical. Compiling script code not clean.  This is straight from one of the example progjects.

Am I missing something here?

TIA

ken

 

View Selected Answer

Responses

5 Replies
K Johnson

Declare float variable before as the code below:

 script
 {
    static Float:hh;
    public message(Msg_Type:type, id, ...)
    {
       
    }
 }

 

bac

After playing around with various formatting, I discovered that the edc compiler is very picky about what code gets placed where. Sometimes, it's not really intuitive.

Thanks for the response.

 

 

K Johnson

If my previous response helped, you may select it as an answer to help other developers facing similar issue.

Mark as answer
Robert Kaiser

Hi,

I made the experience that a script is considered as "not clean" when you declare a varialbe, but never use it.

I can see you declared this little one:

static Float:hh

but thats about it. Insert a random

if(hh <= 0){
}

or something like that behind it and it ususllay becomes happy. That's quite the annoying behaviour if one is used to declaring all variables before forumating the code logik...

 

But you should get used to "not clean", because its the favourite Error Message of Edje Scripting. Good luck finding the cause of it inside 2000 lines of code :)

bac

Too strange.

 

The following fails:

      script
      {
         public message(Msg_Type:type, id, ...)
         {
            static Float:hh;
            static Float:mm;
            static Float:ss;
         
            hh = getarg(2);
            mm = getarg(3);
            ss = getarg(4);
         }
      }

But wait ...

      script
      {
         public message(Msg_Type:type, id, ...)
         {
            static Float:hh;
            static Float:mm;
            static Float:ss;
            if (hh <= 0 || mm <= 0 || ss <= 0){}
            hh = getarg(2);
            mm = getarg(3);
            ss = getarg(4);
         }
      }

This works. huh?

 

I'm not (planning on) writing 2000 lines of code. Just a small script based on some of the example projects. This is really [ fill in your own euphamism ]!

ken