error variable non declare

Hello,

please help, im trying to configure an event OnAplicationInit to calculate the days between two dates. I have already done this in the past.

But now scriptcase send me this error message

Parse error: syntax error, unexpected ‘$this’ (T_VARIABLE)

I really dont understand what this means, the code i used is this

$current_date = date('Y-m-d')
{Dias} = sc_date_dif({doc_mejora.fecha},  'aaaa-mm-dd', $current_date ,'aaaa-mm-dd')

so, i never declare $this

please help me

[QUOTE=steph07;38529]Hello,

$current_date = date('Y-m-d')
{Dias} = sc_date_dif({doc_mejora.fecha},  'aaaa-mm-dd', $current_date ,'aaaa-mm-dd')

so, i never declare $this
[/QUOTE]

The $this variable comes from the “compilation” (when scriptcase builds the php).

Are you sure you wrote the “;” at the end of each line?

$current_date = date('Y-m-d');
{Dias} = sc_date_dif({doc_mejora.fecha},  'aaaa-mm-dd', $current_date ,'aaaa-mm-dd');

Where does the variable (actually, this seems to be a field) “{doc_mejora.fecha}” comes from? Did you named it with a dot??? I feel like this name is not valid as it might be interpreted as a class type assignment, but if you copy pasted the code that worked before, then maybe there was an update…

Normally you get an error with a line number. Look at the generated source code at the given line number (actually look one line before it since the error is usually there).
This should show you where it is.
THe errors scriptcase gives when running can be quickly determined by checking the error line.
Remember you can also set all kinds of debugging and tracing on…