Announcement

Collapse
No announcement yet.

error variable non declare

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

  • 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

    Code:
    $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

  • #2
    Originally posted by steph07 View Post
    Hello,
    Code:
    $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
    The $this variable comes from the "compilation" (when scriptcase builds the php).

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

    PHP Code:
    $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...
    Best Regards

    Daniel Salcedo
    • Software & Hardware developer
    • Photography enthusiast
    • Ultimate Frisbee lover

    Comment


    • #3
      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...

      Comment

      Working...
      X