mIRC Home    About    Download    Register    News    Help

Print Thread
#112507 24/02/05 03:20 PM
Joined: Feb 2005
Posts: 1
_
_CPP_ Offline OP
Mostly harmless
OP Offline
Mostly harmless
_
Joined: Feb 2005
Posts: 1
hi,

i have an edit on a dialog, it contains the text "asdf", if i type:

//echo -a $did(login_dlg, 4) it returns "asdf"

if i type:

//echo -a $did(login_dlg, 4).len it returns 0

shouldnt it be 4 ?!

#112508 24/02/05 03:41 PM
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
try //echo -a length: $did(login_dlg, 4).len it returns 0

if the first character is a digit it will echo in that colour
so /echo -a 2 will be blue and so on.


$maybe
#112509 24/02/05 03:44 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
No it shouldn't. .len doesn't work with edit you'd need to use $len($did(login_dlg, 4)).

.len works with the list control.

$did($dname,$did,<line number>).len.

#112510 25/02/05 01:35 AM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
The .len prop requires the 'line number' field.
  • //echo -a $did(login_dlg,4,1).len

#112511 25/02/05 09:36 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Ohh, it does work with edit then.

From the help file

len returns length of line or length of Nth line

I thought it meant *only* list entry.

My bad. blush

#112512 25/02/05 11:09 AM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Which is kinda odd, since $did(name,id).len works for other controls, like text and buttons, and returns the same as $did(name,id,1).len. I would expect it to work without a line number in single-line editboxes (or even in multi-line ones, where N would default to 1).


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#112513 25/02/05 12:32 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Indeed, it is odd the way it works for edit controls.
Even more, with a single line edit control line numbers 1-2147483647 work :tongue:


Link Copied to Clipboard