mIRC Home    About    Download    Register    News    Help

Print Thread
#97901 18/09/04 04:34 PM
Joined: Jun 2004
Posts: 291
W
Fjord artisan
OP Offline
Fjord artisan
W
Joined: Jun 2004
Posts: 291
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

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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

Last edited by FiberOPtics; 19/09/04 12:37 PM.

Gone.
Joined: Jun 2004
Posts: 291
W
Fjord artisan
OP Offline
Fjord artisan
W
Joined: Jun 2004
Posts: 291
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

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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 }

Last edited by FiberOPtics; 19/09/04 01:08 PM.

Gone.
Joined: Jun 2004
Posts: 291
W
Fjord artisan
OP Offline
Fjord artisan
W
Joined: Jun 2004
Posts: 291
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

Last edited by whatsthedillio; 19/09/04 01:57 PM.
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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

Last edited by FiberOPtics; 19/09/04 01:58 PM.

Gone.
Joined: Jun 2004
Posts: 291
W
Fjord artisan
OP Offline
Fjord artisan
W
Joined: Jun 2004
Posts: 291
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

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Good that you got it working!

Greets


Gone.

Link Copied to Clipboard