mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2003
Posts: 50
D
Babel fish
OP Offline
Babel fish
D
Joined: Aug 2003
Posts: 50
I need to paste in a dialog window a little list like this:

Code:
Item 1 = dog
Item 2 = cat
Item 3 = mouse
Item 4 = cow


Then I would use the "echo" command only with the second line.
I tried this solutions:

Code:
on 1:dialog:xdialog:edit:*:{ set %xcontent $did(1).text }
on 1:dialog:xdialog:sclick:100:{  
%test1 = $gettok(%xcontent,2,$cr)
%test2 = $gettok(%xcontent,2,$lf)
%test3 = $gettok(%xcontent,2,$crlf)
/echo -a /msg %test1 %test2 %test3 
}


But none of the test# variable works.
Any ideas?

I found this old topic but $lf doesn't seem to work

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
You have to specify the ascii value of the character being used to separate the various tokens (items). You can't use the actual character.

Eg: $gettok(%xcontent,2,.) is incorrect
but using the ascii value of the . character, which is 46, you can use $gettok(%xcontent,2,46) which is correct.

The items you're using are difficult to obtain ascii values for, but I happen to know that $cr is character 13 and $lf is character 10

All this aside, the text in %xcontent will only contain up to the $cr, $lf, or $crlf
Technically it is possible to contain those characters in the variable without it ending the contents of the variable, but this is fairly advanced, and I suspect that you aren't doing that.

If ID 1 is a list, then you can get the second item in the list by using $did(1,2) in an ON DIALOG event.

Setting %xcontent to $did(1).text will only fill the variable with the first item in the list.

This is the limit of what I'm safe in stating, without seeing more of your code.

I suggest that you carefully read the section on dialogs in the help file.

Joined: Aug 2003
Posts: 50
D
Babel fish
OP Offline
Babel fish
D
Joined: Aug 2003
Posts: 50
I tried with the number value too but it didn't work for the reason that you have exlplained.
After a while I found the solution looking trought the help file and the right way is to use $did(1,N).text as you wrote.
This is the code:

Code:
on 1:dialog:xdialog:edit:*:{ set %xcontent $did(1).text }
on 1:dialog:xdialog:sclick:100:{  
%secondline = $did(1,2).text
/echo -a /msg %secondline
}


Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Have you checked out $didtok ?


Link Copied to Clipboard