mIRC Home    About    Download    Register    News    Help

Print Thread
#141917 14/02/06 03:48 AM
Joined: May 2005
Posts: 449
Fjord artisan
OP Offline
Fjord artisan
Joined: May 2005
Posts: 449
This is just a small issue, and no big deal if it can't be changed, but I wanted to know why it leaves the first space empty in a listbox when I use this code, and how to change it if possible.
Code:
on *:dialog:mail:init:*:{
  /timer -om 0 50 /.SIGNAL -n TIME -o 0 1 TIME
  var %x = 1
  while (%x <= $lines(address.txt)) {
    did -a mail 24 $gettok($read(address.txt,%x),1,44) $gettok($read(address.txt,%x),2,44)
    inc %x
  }
}

#141918 14/02/06 03:54 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
It leaves the first one empty, because the $read command (as you have it) presumes that the first line of the text file is a number that equals the number of lines in the file.
Code:
 on *:dialog:mail:init:*:{
  /timer -om 0 50 /.SIGNAL -n TIME -o 0 1 TIME
  var %x = 1
  while (%x <= $lines(address.txt)) {
    did -a mail 24 $gettok($read(address.txt,nt,%x),1-2,44) 
    inc %x
  }
}

 

#141919 14/02/06 04:24 AM
Joined: May 2005
Posts: 449
Fjord artisan
OP Offline
Fjord artisan
Joined: May 2005
Posts: 449
Thank you for your help. It's still leaving it blank though. I had a fix using tests to check if the first line is blank and then using:
Code:
did -d mail 24 1

Is that the best solution?

#141920 14/02/06 04:53 AM
Joined: May 2005
Posts: 449
Fjord artisan
OP Offline
Fjord artisan
Joined: May 2005
Posts: 449
I figured it out...sort of. I had a few options set for the listbox in the dialog table. I wasn't sure what they did, so I took out sort and size. I now just have vsbar, which is all I need.

#141921 14/02/06 05:40 AM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
The size option forces the listbox to use the size you specified instead of it being resized to accomodate items and the sort option sorts items added to the list alphabetically.

#141922 14/02/06 02:08 PM
Joined: May 2005
Posts: 449
Fjord artisan
OP Offline
Fjord artisan
Joined: May 2005
Posts: 449
Can you change the text in a listbox to make it bold or in color? As for the other problem. I must have hit return when using the text file. There was a blank line. Thanks.

#141923 14/02/06 04:04 PM
Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
Colors and text maniuplation such a bold underline and italics can not be done with plain mirc dialogs. However there are several dialog enhancement dll's that can pretty things up and offer other dialog controls that mirc doesn't. Look for DCX or MDX.


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
#141924 14/02/06 05:12 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Just to add to that before he decides to look too far into it, DCX (MDX doesn't support colouring at all) supports a single colour per line and if you choose to add a bold/underlined item the whole item is bold/underlined, you cannot use BURK codes in items. Also, you cannot use colours in DCX listboxes, you have to use the more complex listview control.


Link Copied to Clipboard