mIRC Home    About    Download    Register    News    Help

Page 1 of 2 1 2 >
Topic Options
#131771 - 04/10/05 03:17 PM $fline - case sensitive ??
WarlockW Offline
Vogon poet

Registered: 21/01/04
Posts: 133

$fline - case sensitive ??

or am i nuts ?

anyway to make it NOT-case sensitive ??

Thanks ..

Top
#131772 - 04/10/05 03:42 PM Re: $fline - case sensitive ??
Om3n Offline
Fjord artisan

Registered: 06/07/03
Posts: 655
It doesn't seem to be case sensitive to me. Remember you have to take into concideration the spacing and control codes.

/window @test
/aline @test test motd
/aline @test motd test
//echo $fline(@test,*MOTD*,0) returns 2 (total number of matching lines)
//echo $fline(@test,*motd*,0) returns 2 (total number of matching lines)

If you want case sensitive search you could use a regular expression.
_________________________
"Allen is having a small problem and needs help adjusting his attitude" - Flutterby

Top
#131773 - 04/10/05 04:15 PM Re: $fline - case sensitive ??
FiberOPtics Offline
Hoopy frood

Registered: 05/02/04
Posts: 2019
Loc: Leuven, Belgium
$fline is not case sensitive, unless you specify 2 or 3 as fourth parameter, which indicates that the matchstring is a regex pattern, which is indeed case sensitive.
_________________________
Gone.

Top
#131774 - 04/10/05 06:34 PM Re: $fline - case sensitive ??
WarlockW Offline
Vogon poet

Registered: 21/01/04
Posts: 133
i am using it to find a line in acustom window and
diplay the text ..

set %findtxt $fline(@text,%text-to-find,1-100,2)
^^ this works how ever its case sensitve

i have tried many different combinations..
set %findtxt $fline(@text,%text-to-find,1-100,0)
set %findtxt $fline(@text,%text-to-find,1-100,1)
set %findtxt $fline(@text,%text-to-find,1-100,2)
set %findtxt $fline(@text,%text-to-find,1-100,3)
^^ none work

I need to find the text i a custom window window is set at:
window -alkCs @text


Any thoughts ?

Top
#131775 - 04/10/05 07:20 PM Re: $fline - case sensitive ??
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
As mentioned, 2 and 3 are going to be case sensitive because they are regex. 1 should probably work, but why not just try without the fourth parameter? 0 isn't listed as a possible parameter, though I haven't tried it to see if it would do anything.

You should try manually doing it from the command line...

//echo -a $fline(@text,%text-to-find,1-100,1)
//echo -a $fline(@text,%text-to-find,1-100)

Make sure you set %text-to-find to something first and then see if you get any output from a valid search.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#131776 - 04/10/05 07:32 PM Re: $fline - case sensitive ??
WarlockW Offline
Vogon poet

Registered: 21/01/04
Posts: 133
yea sorry ..

i did try ..

//echo -a $fline(@text,%text-to-find,1-100)
also .. didnt get a result at all ;(

Hmmm i agree it should work ..
but doesnt seem to ..

Could it be the typ of window i am using ?

thanks for the help ..


Edited by WarlockW (04/10/05 07:33 PM)

Top
#131777 - 04/10/05 07:53 PM Re: $fline - case sensitive ??
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
Well, here's my test:

Creating test window:
/window -alkCs @test
/aline @test this is a test
/aline @test this is another test
/aline @test I am testing again
/aline @test Are you testing?
/aline @test THIS IS A TEST
/set %text-to-find this is a test

Testing:
//echo -a $fline(@test,%text-to-find,0)
2

That's the correct results for total matches. From testing it, I find that you cannot use a range with $fline. 1-100 will not work. Here's a simple loop to get them:

Code:
var %c = 1
var %i = $fline(@test,%text-to-find,0)
while (%c <= %i) {
  echo -a Line # $+ $fline(@test,%text-to-find,%c) $+ : $line(@test,$fline(@test,%text-to-find,%c))
  inc %c
}


That should echo your results for you and will not be case sensitive.

REMINDER: Without using *'s, this will search only for exact matches. If %text-to-find is "this", it will not find any matches. If you want to use partial searches, you have two choices...

1) In all your $fline sections, replace %text-to-find with * $+ %text-to-find $+ *

or

2) When setting your %text-to-search, use wildcards in it...

Example:

/set %text-to-search this*
or
/set %text-to-search *this*


Edited by Riamus2 (04/10/05 07:57 PM)
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#131778 - 04/10/05 08:11 PM Re: $fline - case sensitive ??
WarlockW Offline
Vogon poet

Registered: 21/01/04
Posts: 133
omg .. i am soo dumb ..
i am sorry ...

I think i didnt make myself clear!
I am trying to search for a line with it being the ONLY line
with the text in it .. all lines are different!

so .. if i search for: test
i need it to give me the line number of the line with text < in it .. now remember all lines are different so only ONE line has the word: text

I need the line number so i can use :
set %linetxt $line(@text,%linenumber)
echo %linetxt

Or am i useing the totaly wrong way to do this lol

Does that make any secence ? lol

Top
#131779 - 04/10/05 08:22 PM Re: $fline - case sensitive ??
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
If you want exact matches and you'll only ever have one match, then this should work:
Code:
echo -a Line # $+ $fline(@test,%text-to-find,1) $+ : $line(@test,$fline(@test,%text-to-find,1))

If you want them in variables:
Code:
set %linenumber $fline(@test,%text-to-find,1)
set %linetext $line(@test,%linenumber)


Note that if you didn't set %linenumber, you'd need to replace %linenumber in the %linetext section with the code from %linenumber.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#131780 - 04/10/05 08:36 PM Re: $fline - case sensitive ??
WarlockW Offline
Vogon poet

Registered: 21/01/04
Posts: 133
well .. i dono whats wrong ..

dont work for me ..
the only way i can make it work is to use :

set %findtxt $fline(@text,%text-to-find,1-100,2)
echo %findtxt

this works .. but is case sensitve ..
I know .. but true ..

maybe i will have to save it to a txt file and do a search from there ..

Anyway .. I really thank you for your help!
you have been great putting up with me smile

Top
#131781 - 04/10/05 08:46 PM Re: $fline - case sensitive ??
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
What mIRC version are you using? Perhaps it has been changed at some point.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#131782 - 04/10/05 08:50 PM Re: $fline - case sensitive ??
WarlockW Offline
Vogon poet

Registered: 21/01/04
Posts: 133
6.16

newest i think ..

did you try my exsample ?
set %findtxt $fline(@text,%text-to-find,1-100,2)
it also seems if i dont use the 1-100 part
it also doent work :P

do you get what i get ? Just wondering ?


Edited by WarlockW (04/10/05 08:54 PM)

Top
#131783 - 04/10/05 09:08 PM Re: $fline - case sensitive ??
Om3n Offline
Fjord artisan

Registered: 06/07/03
Posts: 655
You are using ranges in the 3rd parimater again. 1-100 is not valid, just use the number 1 and it will return the first exact match. Also, you are specifying the number 2 as the 4th parimater, this means it does a regular expression search. Is the contents of %text-to-find a regular expression? There is a very big difference between a wildcard search and a regular expression.

If the contents of %text-to-find is plain text or wildcard text, just use "$fline(@text,%text-to-find,1)", without the invalid range, and without the 4th parimater. If the contents of the variable is a regular expression, then use "$fline(@text,%text-to-find,1,2)" and make sure that your regular expression syntax is correct.
_________________________
"Allen is having a small problem and needs help adjusting his attitude" - Flutterby

Top
#131784 - 04/10/05 09:11 PM Re: $fline - case sensitive ??
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
Your example WILL be case sensitive as you're using "2" which is regex and is case sensitive.


Use these with the test I did from above. You should get 3 as the output. If it's case sensitive, you should get 4 as the output.
//set %text-to-find this is a test
//set %findtxt $fline(@text,%text-to-find,1)
//echo -a %findtxt

This works just fine and searches without case sensitivity. You never have to change any part of the $fline in my example there.

Try typing the entire test I displayed above. Then, use this example. Note that you have to change both to use @test or both to use @text and both are used in this thread.

What do you get when doing this echo?


Edited by Riamus2 (04/10/05 09:14 PM)
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#131785 - 04/10/05 10:41 PM Re: $fline - case sensitive ??
WarlockW Offline
Vogon poet

Registered: 21/01/04
Posts: 133
ok guys .. i know you think i am nuts ...

but i have tryied 1000 times and it does not work here ..

in your exsample Riamus2

i get nothing .. if i use :
/echo $me $fline(@text,%text-to-find,1)

If I use this it works but ..
/echo $me $fline(@text,%text-to-find,1,2)
then its case sensitive
reply = 57
I asume that means line 57

I know this may not make sence but true ;(
has to be the type of window ? or because i am dumb ? lol

Top
#131786 - 04/10/05 11:04 PM Re: $fline - case sensitive ??
MikeChat Offline
Hoopy frood

Registered: 12/12/02
Posts: 1245
Loc: California, doooood
you mentioned a few times in your posts you think it might be the switches you have on the window (you called it window type) it might be, but you have not shown us the /window command that you use

post that line so we can take a look and see what in there might be conflicting.

Top
#131787 - 04/10/05 11:18 PM Re: $fline - case sensitive ??
WarlockW Offline
Vogon poet

Registered: 21/01/04
Posts: 133
window -alkCs @text

is what i used .. from what i can tell .. been awile
is there a way to get the windows parms?

but i amd 90% sure thats was what i used ..

this is kinda fustrating be cause i need to have controls
if this that happens ect.

if i save the window text to a txt file
and if i use the filter / play command to search
( btw works )

i cant get the controls i need .. i think anyway ..
cause i am not great at this stuff .. but know enough to be
dangerus lol

anyway thanks again ..

Top
#131788 - 04/10/05 11:46 PM Re: $fline - case sensitive ??
MikeChat Offline
Hoopy frood

Registered: 12/12/02
Posts: 1245
Loc: California, doooood
ok
despite what the help file says my results were:

/window -alkCs @text
//loadbuf @text $sfile(*.log)

//echo -a $line(@text,$fline(@text,stock*,1,2),1) $fline(@text,stock*,1)
no line number

//echo -a $line(@text,$fline(@text,stock*,1,2),1) $fline(@text,stock*,1,1)
no line number

//echo -a $line(@text,$fline(@text,stock*,1,2),1) $fline(@text,stock*,1,2)
returns "27"

//echo -a $line(@text,$fline(@text,stock*,1,2),1) $fline(@text,stock*,1,3)
returns "27"

/me shrugs

Top
#131789 - 04/10/05 11:52 PM Re: $fline - case sensitive ??
WarlockW Offline
Vogon poet

Registered: 21/01/04
Posts: 133
weird huh ?

anyway thanks ..

its easy to see how this stuff can drive people to drink !

in your test i see you didnt try a cap letter
this also screws things up lol

Top
#131790 - 05/10/05 02:00 PM Re: $fline - case sensitive ??
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
MikeChat: He did show his /window switches. If you look above at my test, I used the exact same switches without any problem.

WarlockW: Try my test exactly as I typed it before. Use my examples for text to add into the window. Don't use your own. See what results you get.

Also, please paste your entire code that you are using. Include your code for making the window, adding lines to it, and trying to use $fline on it. Make sure you let us know what the lines you are adding are and what your %text-to-find variable is set to. If it is not working, it's some error in your code or else some other script causing a conflict.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
Page 1 of 2 1 2 >