Thank you!! One more question…
ONALARM “envio”, “GOTO envio_LABEL”
envio_label:
If (envio@= 1) THEN
IsFile% = FS "touch", "/usr/fileToSend.txt"
PRINT IsFile%
// returns -1 if "fileToSend" exists
// returns 1 if "fileToSend" doesnt exist and creates it as a file
IF (IsFile% = 1) THEN
OPEN "file:/usr/fileToSend.txt" FOR TEXT APPEND AS 1
PUT 1, " Se realiza un histórico de los distintos valores tomados por las variables cada vez que se presiona el botón de envío" + CHR$(13) + CHR$(10)
PUT 1, " MIESA " + ";" + " 2019 " + ";" + " Flexy 205 : eWON " + CHR$(13) + CHR$(10)
PUT 1, Time$ + ";" + " Variable suma " + ";" + STR$ suma@ + ";" + " Variable resta " + ";" + STR$ resta@ + ";" + CHR$(13) + CHR$(10)
REM PUT 1, Time$ + ";" + "Variable resta" + ";" + STR$ resta@ + ";" + CHR$(13) + CHR$(10)
CLOSE 1
ENDIF
ELSE
OPEN "file:/usr/fileToSend.txt" FOR TEXT APPEND AS 1
PUT 1, Time$ + ";" + " Variable suma " + ";" + STR$ suma@ + ";" + " Variable resta " + ";" + STR$ resta@ + ";" + CHR$(13) + CHR$(10)
REM PUT 1, Time$ + ";" + "Variable resta" + ";" + STR$ resta@ + ";" + CHR$(13) + CHR$(10)
CLOSE 1
ENDIF
PRINT "Archivo creado"
SENDMAIL "anacollada@opendeusto.es", "", "Archivo","&[$dtUF$uf/usr/fileToSend.txt$fnArchivo.txt]"
ENDIF
END
Rem — eWON user (end)
End
Rem — eWON end section: Init Section
I have this program to send an email when an alarm(envio) is happend.
But I have an error:
variable not found(16) 15: IsFile% = FS “touch”, “/usr/fileToSend.txt”
Do you find the error?