mIRC Home    About    Download    Register    News    Help

Print Thread
#113416 04/03/05 08:12 PM
Joined: Jun 2004
Posts: 291
W
Fjord artisan
OP Offline
Fjord artisan
W
Joined: Jun 2004
Posts: 291
hey, i need help! laugh
not really with $read but with the text $read holds

i am using $read while looping through a file and if certain words apeer in the file (there will be about 5 in each line)
like
{\bla} < in that form
but there are more brackets for the other codes >_<
i need it to input each time this certain part is in a line

and if there are more than one i need it to input each time after

hope you understand

smile

thanks cya

#113417 04/03/05 08:24 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
lol, come again in plain english this time please?

I dont know what you mean by you want it to input ?

If you want to replace {\bla} with someother text just use $replacex(%text,{\bla},some other text)
If you need to do something else for each occurance of it in a string then
var %i = $pos(%text,{\bla},0)
while (%i) {
; your code here , $pos(%text,{\bla},%i) well be the location of an occurance of {\bla} in the string, as %i counts down its doing the last occurance first
dec %i
}

#113418 04/03/05 09:01 PM
Joined: Jun 2004
Posts: 291
W
Fjord artisan
OP Offline
Fjord artisan
W
Joined: Jun 2004
Posts: 291
lol >_<
im no good at explaining but here i go...

i want it like you said here
$pos(%text,{\bla},%i)
but {\bla would have a number after it then the end }
the numbers are different everytime so
i really need to add a wildcard part in thier for the number

any ideas

and thanks alot for the reply
^_^

#113419 04/03/05 09:42 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
$pos() looks for whatever string you put there. so just use {\bla, without the trailing }, as the string to find.
//var %text = word {\bla1} crud {\bla8},%i = 1 | while $pos(%text,{\bla,%i) { echo -a $mid(%text,$calc($v1 +5),1) | inc %i }

In $calc($v1 +5) the 5 is "{\bla" being 5 chars to grab the next char.

#113420 04/03/05 09:47 PM
Joined: Jun 2004
Posts: 291
W
Fjord artisan
OP Offline
Fjord artisan
W
Joined: Jun 2004
Posts: 291
ahh ^^ nice
thankyou smile


Link Copied to Clipboard