mIRC Home    About    Download    Register    News    Help

Print Thread
#3467 25/12/02 08:34 PM
Joined: Dec 2002
Posts: 3
S
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Dec 2002
Posts: 3
Well, looks like mIRC doesn't like to delete multiple followed par lines on a dialog id.
Code:
dialog bX {
  title "bX"
  size -1 -1 30 145
  option dbu
  list 1, 5 5 20 145
}
alias bX+ {
  dialog -m bX bX
  var %bX = 1
  while (%bX <= 20) {
    did -a bX 1 %bX
    inc %bX
  }
}
alias bX++ {
  var %bX = 5
  while (%bX <= 15) {
    did -d bX 1 %bX
    inc %bX
  }
}

Supposedly, mIRC should delete 10 lines (from the 5th to the 15th line) but, actually, mIRC just deletes a half of it. As I said in the beginning and, as you can notice after executing those commands, mIRC only deletes impar lines. In this example, mIRC deletes lines 5, 7, 9, 11, 13 and 15 and leaves lines 6, 8, 10, 12 and 14. Even so, and as far as I know, this only happens for multiple followed lines.

That's all, keep it simple.

#3468 25/12/02 08:53 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Ok, the list looks like this:
A
B
C
D
E
F
G
H

Lets say I use your script starting with %bX set at 1, and set it to keep going until %bX <= 4

Delete line 1 and the list looks like this:
B
C
D
E
F
G
Delete line 2 and the list looks like this:
B
D
E
F
G
Delete line 3 and the list looks like this:
B
D
F
G
Delete line 4 and the list looks like this:
B
D
F

It isn't a bug..it's perfectly logical.

#3469 25/12/02 09:05 PM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
Quite correct, Collective. The solution is simple, though: delete the lines in reverse order or keep deleting the same line number.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
#3470 25/12/02 09:12 PM
Joined: Dec 2002
Posts: 5
I
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
I
Joined: Dec 2002
Posts: 5
I don't think what your talking about can be considered a bug.. What happens when you remove a line from a dialog it shifts all the remaining ids after it to a value 1 less. Kind of hard to explain.. Like in your script, lets say you added 15 numerical lines of text to the dialog (id1 being the number 1, id2 being 2, id3 being 3 and so on) . In your script you delete id5 then increase the variable.. This removes the number 5 (id5) and sets the number 6 to id5, 7 to id6, 8 to id7 and so on. On the second pass of the loop you delete id6 which contains the number 7 and then increase the variable again which creates -> id5 is still 6, id6 is now 8, id7 is now 9 and so on. On the next pass you removed the next id (id7) which contains the number 9.

I hope I explained that.. what you want to do in your script is for 15 loops you want to remove whatever is contained in id5..

Code:
alias bX++ {
  var %bX = 5
  while (%bX &lt;= 15) {
    echo -a deleting %bX / text of %bX is $did(bX,1,%bX)
    did -d bX 1 5
    inc %bX
    echo -a bX is now %bX
  }
}


that would remove numbers 5 - 15


EDIT: ok, got explained already as I was posting this.. doh.. Well anyone try out the $width bug report I posted and see if you get a similiar error? would be helpful to make sure it's just not my problem...

Last edited by immortalnut; 25/12/02 09:17 PM.
#3471 25/12/02 09:36 PM
Joined: Dec 2002
Posts: 3
S
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Dec 2002
Posts: 3
Hehe, in fact it's logical when thinking that mIRC auto-updates the list right before re-performing the command(s) on the while loop. It's really logical, but my point of view when posting was another one. You're right even so smile. Not everything that seems to be logical at first finishes being it wink. Peace.


Link Copied to Clipboard