mIRC Home    About    Download    Register    News    Help

Print Thread
#141193 06/02/06 10:50 AM
Joined: May 2005
Posts: 35
N
nutt3 Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: May 2005
Posts: 35
I would like to replace the end of some line before i save them in a logfile. They end on x Snowman x

and i would like to replace that word 'Snowman' with 'Snowqueen'
There are more places in the line with the word Snowman, but i only wanna change the last one....

btw, its snowing here smile

#141194 06/02/06 08:53 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
assuming the line is in var %text

if ($pos(%text,Snowman,$pos(%text,Snowman,0))) { var %text = $+($left(%text,$calc($v1 - 1)),Snowqueen,$mid(%text,$calc($v1 + 7)) }

mirc 6.16 required, replace $v1 with $ifmatch foir previous versions

#141195 07/02/06 09:43 AM
Joined: May 2005
Posts: 35
N
nutt3 Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: May 2005
Posts: 35
Thx for replying. smile

Maybe im in to deep here soo dont worry but getting this error: * Invalid format: $+ (line 124, snowman.ini)

#141196 07/02/06 09:45 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
sorry my error i missed a closing )

if ($pos(%text,Snowman,$pos(%text,Snowman,0))) { var %text = $+($left(%text,$calc($v1 - 1)),Snowqueen,$mid(%text,$calc($v1 + 7))) }


Link Copied to Clipboard