Run as a daemon or service: Difference between revisions
Content added Content deleted
m (→{{header|FreeBASIC}}: added google translate of the comments) |
m (→{{header|BASIC}}: whitespace tidy) |
||
Line 11: | Line 11: | ||
==={{header|FreeBASIC}}=== |
==={{header|FreeBASIC}}=== |
||
{{trans|QB64}} |
{{trans|QB64}} |
||
<lang freebasic> |
<lang freebasic>ScreenLock() |
||
ScreenLock() |
|||
Open "c:\Users\Default\Documents\myDaemon.log" For Append As #1 |
Open "c:\Users\Default\Documents\myDaemon.log" For Append As #1 |
||
'Open "myDaemon.log" For Append As #1 'Ruta de archivo relativa para la salida |
'Open "myDaemon.log" For Append As #1 'Ruta de archivo relativa para la salida // Relative file path for the output |
||
'Relative file path for the output |
|||
For i As Byte = 1 To 5 'Entonces esto no se ejecuta ad infinitum |
For i As Byte = 1 To 5 'Entonces esto no se ejecuta ad infinitum // So this is not executed ad infinitum |
||
'So this is not executed ad infinitum |
|||
Print #1, Time + " - Running" 'Imprime en el archivo previamente abierto la hora actual del sistema (hh:mm:ss) y una nota |
Print #1, Time + " - Running" 'Imprime en el archivo previamente abierto la hora actual del sistema (hh:mm:ss) y una nota |
||
'Prints in the previously opened file the current system time (hh: mm: ss) and a note |
'Prints in the previously opened file the current system time (hh: mm: ss) and a note |
||
Sleep 1000 'Espera 1 segundo |
Sleep 1000 'Espera 1 segundo // Wait 1 second |
||
'Wait 1 second |
|||
Next i |
Next i |
||
Close #1 'Cierra el archivo previamente abierto para escritura |
Close #1 'Cierra el archivo previamente abierto para escritura // Close the file previously open for writing |
||
'Close the file previously open for writing |
|||
ScreenUnlock() |
ScreenUnlock() |
||
End |
End</lang> |
||
</lang> |
|||
==={{header|QB64}}=== |
==={{header|QB64}}=== |
||
Line 46: | Line 40: | ||
Next i% |
Next i% |
||
Close #1 'Closes the file previously opened for writing |
Close #1 'Closes the file previously opened for writing |
||
System |
System</lang> |
||
</lang> |
|||
{{out}} |
{{out}} |
||
<pre>09:02:23 - Running |
<pre>09:02:23 - Running |