mIRC Homepage

listview experts! help me plz!

Posted By: R1pl3y

listview experts! help me plz! - 17/02/04 02:29 PM

I know I am missing some lil detail about this but I have read the help file for views.mdx & looked in these forums and tried suggestions found.

I still dont get the right data back.

Dialog id is 1
Dialog name is r1aj

Code:
 ;init
mdx SetControlMDX $dname 1 Listview single report rowselect grid sortascending > $scriptdirviews.mdx
did -i $dname 1 1 headerdims 75:1 75:2 75:3
did -i $dname 1 1 headertext Network $+ $chr(9) $+ Channel $+ $chr(9) $+ Pass

;page alias
alias r1aj.page {
  var %dname, %did
  if ($0 = 1) {
    set %dname r1aj
    set %did $1
  }
  else {
    set %dname $1
    set %did $2
  }
  did -i %dname %did 1 page $prop
  return $gettok($did(%dname, %did, 1), 3-, 32)
}

;dclick alias I made to practice returning the data
if ($devent == dclick) {
  if ($did == 1) {
    did -i $dname 1 1 page event
    echo -a $r1aj.page($did).event
  }
} 


$did(1).seltext returns the text in this format: "0 +fs 0 0 0 network +fs 0 0 0 #channel +fs 0 0 0 password"

$r1aj.page($did).event just returns the line # selected in the listview which is same as using $did(1).sel .
I didnt find anything related in these forums but did search.
Suggestion found in this thread: http://www.mircscripts.org/forums.php?cid=6&id=78650&highlight=listview#78650, $gettok($gettok($did(r1aj,1,1),2,43),5-,32) returns nothing.
Suggestion found here: http://mircscripts.org/showdoc.php?type=code&id=1875 returned "network +fs"

I just want an easy to understand explaination of how to retreive each cells data in a given line of the listview possibly with a working example.
Forgive me if I cant seem to understand the views.mdx help file. confused
Please save my dumb a$z! blush
Posted By: tidy_trax

Re: listview experts! help me plz! - 17/02/04 05:31 PM

Code:
alias get.cell {
  tokenize 32 $gettok($did($1,$2,$3).text,$4,9)
  return $ [ $+ [ $0 ] ]
}

$get.cell(dialog,id,line,cell)
Posted By: R1pl3y

Re: listview experts! help me plz! - 19/02/04 03:35 AM

Awesome tidy_trax, THX!
Works like a charm.
After I came up with:
Code:
 $replace($did(1).seltext,$chr(9) $+ $chr(43) $+ fs $+ $chr(32) $+ 0 0 0 $+ $chr(32),$chr(32),0 +fs 0 0 0 ,$null) 

hehe
For obvious reasons yours is better, and so I'll use it.
grin
Posted By: tidy_trax

Re: listview experts! help me plz! - 19/02/04 03:06 PM

the problem is, if you added "hello world!" to a cell, mine would only return "world!"
Posted By: R1pl3y

Re: listview experts! help me plz! - 19/02/04 10:22 PM

yes but in this instance it is fine as a network, channel or password would never contain spaces.
© 2020 mIRC Discussion Forums