This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Timestamp Storenote

Old posts that have not been replied to for several years.
Locked
E
Ectropian

Timestamp Storenote

Post by Ectropian »

I've tried some variations, but i'm still new to TCL. I need to timestamp storenote and can't seem to get it right.

Code: Select all

storenote $hand $notehand [strftime %d-%m-%Y@%H:%M] $notemsg 0
Any suggestions?
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Re: Timestamp Storenote

Post by user »

Ectropian wrote:Any suggestions?
Read about the storenote command in doc/tcl-commands.doc, then decide what argument you want the timestamp to be part of and include it in that argument :P
Have you ever read "The Manual"?
E
Ectropian

ok..

Post by Ectropian »

ok, I'm going to put it into the (msg) arg, but no matter where I put it I get this error:

Code: Select all

Tcl error [pub_sendnote]: wrong # args: should be "lrange list first last"
actual arg is:

Code: Select all

 set notemsg [join [split [lrange $rest 1 [strftime %d-%m-%Y@%H:%M] end ]]]
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Re: ok..

Post by user »

Ectropian wrote:

Code: Select all

 set notemsg [join [split [lrange $rest 1 [strftime %d-%m-%Y@%H:%M] end ]]]
lrange is for extracting a range of elements from a list. I think you mean linsert or lreplace, but first you need to make sure you're working with a valid list - which means you probably need to split that string of yours, do the list operation, then join the result. But if you want the timestamp to be the first word of the string you can skip all that and...

Code: Select all

set notemsg "[strftime %d-%m-%Y@%H:%M] $rest"
Have you ever read "The Manual"?
E
Ectropian

Finally

Post by Ectropian »

Finally got the format i was looking for, accept i'm geetting double or something.

Code: Select all

set notemsg "[strftime %a%t%b%t%d%t%t%T%t%Z]- $rest"
Yeilds

Code: Select all

Note 2 From <from>: Wed Feb 18 03:09:13 EST - <from> <msg>
Where the <From> is echo'd twice for some reason...
Locked