version 8.00.0047 expecting '('

Sorry for my english.

I’ve updated to versi?n 8.00.0047 and I get de next message executing a Control module (control_generar):

Parse error: syntax error, unexpected ‘$this’ (T_VARIABLE), expecting ‘(’ in C:\Program Files (x86)\NetMake\v8\wwwroot\scriptcase\app\doceo\control_generar\control_generar_apl.php on line 1328

I reviewed de code of control_generar_apl.php on line 1328:

1320| $msg = “”;
1321| while(!$this->rs->EOF) {
1322| $msg = $msg.’<br>’.$this->rs->fields[0];
1323| $this->rs->MoveNext();
1324| }
1325| $this->rs->Close();
1326|
1327| if$this->SC_function_0($msg <> “”) {
1328|
1329| if (!isset($this->Campos_Mens_erro)){$this->Campos_Mens_erro = “”;}
1330| if (!empty($this->Campos_Mens_erro)){$this->Campos_Mens_erro .= “<br>”;}$this->Campos_Mens_erro .= "Hay asignaturas sin profesor asignado: ".$msg;
1331| if (‘submit_form’ == $this->NM_ajax_opcao || ‘event_’ == substr($this->NM_ajax_opcao, 0, 6))
1332| {
1333| $sErrorIndex = (‘submit_form’ == $this->NM_ajax_opcao) ? ‘geral_control_generar’ : substr(substr($this->NM_ajax_opcao, 0, strrpos($this->NM_ajax_opcao, ‘_’)), 6);
1334| $this->NM_ajax_info[‘errList’][$sErrorIndex][] = "Hay asignaturas sin profesor asignado: ".$msg;
1335| }
1336| ;
1337| }

This is a generated code from this one in a onValidate Event:

$sql = “select concat(nom_corto, ’ - ', asignatura)
from asignaturas natural left join asignaturas_profesores
where id_profesor is null”;
sc_select(rs, $sql);

$msg = “”;
while(!$rs->EOF) {
$msg = $msg.’<br>’.$rs->fields[0];
$rs->MoveNext();
}
$rs->Close();

if ($msg <> “”) {
sc_error_message("Hay asignaturas sin profesor asignado: ".$msg);
}

That was working fine until the upgrade. Please can you resolve it?.

Thanks.

the problem is a $this->SC_function_0

The problem is a “$this->SC_function_0” added to some “if”, “for” and tabs, with wrong syntax.

Search in your event by:

$msg = $msg.’<br>’.$rs->fields[0];

after 5 lines you see a error “if”… you forget “(” between “if” and function.

I think that the code in the event is ok. The “if” have a correct syntax:

if ($msg <> “”) {
sc_error_message("Hay asignaturas sin profesor asignado: ".$msg);
}

The problem is that the code generator is including a “$this->SC_function_0” in some sentences (otre if’s, for’s, and tabs),
for example, in the line 1327 of control_generar\control_generar_apl.php:

1327| if$this->SC_function_0($msg <> “”) {

Try using single quotes in your original text and see if that changes…

good morning,

This application was imported of other scriptcase?
check if have some PHP method without name in side menu Programming > PHP Method


Best Regard
Netmake team

Thanks Artur. I delete the extra PHP Method, error from import application. Now it is working.

🚀 Scriptcase 9.12 is now available! Check out the new features here 👉🚀 Next Monday (02/24), Scriptcase 9.12 will be released! Check out the new features before anyone else 👉