Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
encrypted file
#7
yes.

Code:
Copy      Help
;/
function ~s [flags] [$logfile] ;;flags: 1 date/time

;Writes s to the end of the log file.
;s - string or number to write.
;logfile - file name. Default: _logfile (global variable, read more in QM help).
;If file size exceeds _logfilesize (global variable, default is 50 KB), removes first half (oldest data).


;EXAMPLES
;LogFile "string"


;int a=10
;LogFile a 1



if(!len(logfile)) logfile=_logfile
File f.Open(logfile "a+")

int i=f.FileLen
if(!_logfilesize) _logfilesize=1000*1024
if(i>_logfilesize)
,f.SetPos(_logfilesize/2)
,f.ReadToStr(_s)
,f.Close
,f.Open(logfile "w")
,i=findc(_s 10)+1
,f.Write(_s+i _s.len-i)

if(flags&1) s-_s.time("%c[]")
f.WriteLine(s)

err+ end ES_FAILED
An old blog on QM coding and automation.

The Macro Hook


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)