Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I log the time?
#1
There's probably a simple fix to this. I'm attempting to set up a script that logs the time when I do a certain event. When I tried this code:

Code:
Copy      Help
File f.Open("$my qm$\TestingChannelChanging.csv" "a")
fprintf f "[][]BEGINNING NEW MACRO[]"
fprintf f "time,channel#[]"

for i 0 c
,DATE now.getclock
,;get time part
,int days=now.date;; now.date-days
,out now
,fprintf f now
,fprintf f ",i[]"

I get an Error in TestingBabyChannelChanging: expected string expression tip: to cast type, use operator +.

if I switch the code to

Code:
Copy      Help
,fprintf f +now
,fprintf f ",i[]"

I get Error in TestingBabyChannelChanging: type mismatch.

So I guess my question is, how do I print the time object to this file? I don't really understand the casting operator, which is probably the problem. Thanks in advanceBig Grin
#2
str s
s=now
fprintf f s

or

str s
s.time("%x")
fprintf f s
#3
duh. I knew it would be simple. :oops:

Thanks!


Forum Jump:


Users browsing this thread: 1 Guest(s)