mIRC Homepage
Posted By: whatsthedillio im stuck here pls help?!? - 18/09/04 04:34 PM
hey,
what i need to do is be able to use an $input when my dialog doesnt find the script i search for
i made a dialog to search for .mrc files:
it displays the results in a list box
and if it doesnt display ny results i want an input box to
pop up and say search found nothing!
i use a timer to check if there is no text in the list box
but i dont know how

like
itried:
on *:DIALOG:bla:SCLICK:10: {
timer 1 3 //check
search commands here
}

then:
alias check {
if ($did(dialog,19) == $null) {
if $input(Search Found Nothing,o,OK) {
halt
}
}
}

i used a couple of other identifiers but they didnt seem to work either!!

second question i wanted to ask aswell:-
i have used the $input for quite a lot of things
and it works well when the ok button is pressed but
when i just click the cross
it carrys on with the rest of the script

please help me out with this

thanks alot
smile
Posted By: FiberOPtics Re: im stuck here pls help?!? - 19/09/04 12:29 PM
Hi,

regarding the issue where you want to check if you got results or not, simply do something like:

var %a = $findfile(c:\mirc,*.mrc,0,did -a name id $1-)
if !%a { echo -a No matches }

Where name identifies the dialog and id is the id number of the control you want to modify. Btw the folder is just an example. Change the echo part with an $input dialog code.

Can't help you with the second thing, I've never used the $input dialog, and I'm lazy to try out right now, hehe grin

Greets

Edited text
Posted By: whatsthedillio Re: im stuck here pls help?!? - 19/09/04 12:38 PM
hey,
thanks alot for the advice,
but i really need to know how i can tell if theres any text written
in the list box and if there isnt i want my input to pop up

so when i set the timer for an alias
the alias will
check if there any text at all written in
the list box dialog id "19"
and if there is text it wont do anything
but if theres no text it will popup

but at now it seems to just popup eveytime

even if there is text in the list box

any ideas

thanks alot smile
Posted By: FiberOPtics Re: im stuck here pls help?!? - 19/09/04 12:49 PM
The way I made it, doesn't require for you to use a timer.

var %a = $findfile(...,0,...) will fill the variable a with the number of matches of findfile, which are written to the listbox with did -a name id $1-

if !%a { echo -a No matches } will only be triggered if %a is 0, which means $findfile didn't find anythign, which means nothing was written.

You don't need a timer to check if there's text written, because we already know it thanks to the value of %a. All you have to do is put some code in:

if !%a { your code to let person know that no matches were found }

That's it.

Greets

Edit: As for your second question. Maybe I don't get it right, but why don't you simply put "halt" after the input dialog when no matches were found. Fex:

if !%a { .echo -q $input(No scripts found,io) | halt }
Posted By: whatsthedillio Re: im stuck here pls help?!? - 19/09/04 01:44 PM
yes but my script is kind of really long and
it does multiple things

that was just an example from my script wink
thats why i have to do it with the text in the list
i tried a lot of other different ways

so could you help with that?
i tried if $did(dialodname,id).text {
but that didnt work?

and thanks alot for all your help
smile
Posted By: FiberOPtics Re: im stuck here pls help?!? - 19/09/04 01:57 PM
It's impossible for me to help further without seeing the code.

If you don't want to expose it to the outside world, then just pm it to me :tongue:
Just know that using a timer for what you want to do is a no-go.

Greets
Posted By: whatsthedillio Re: im stuck here pls help?!? - 19/09/04 02:27 PM
lol,
my bad
your code works great for it
i didnt think it would work like that

thanks a bunch man
really helped me out
thanks
laugh
Posted By: FiberOPtics Re: im stuck here pls help?!? - 19/09/04 04:13 PM
Good that you got it working!

Greets
© mIRC Discussion Forums