mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 23
R
R1pl3y Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: Dec 2002
Posts: 23
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


R¹¶¬³¥
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Code:
alias get.cell {
  tokenize 32 $gettok($did($1,$2,$3).text,$4,9)
  return $ [ $+ [ $0 ] ]
}

$get.cell(dialog,id,line,cell)

Last edited by tidy_trax; 17/02/04 05:46 PM.

New username: hixxy
Joined: Dec 2002
Posts: 23
R
R1pl3y Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: Dec 2002
Posts: 23
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


R¹¶¬³¥
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
the problem is, if you added "hello world!" to a cell, mine would only return "world!"


New username: hixxy
Joined: Dec 2002
Posts: 23
R
R1pl3y Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: Dec 2002
Posts: 23
yes but in this instance it is fine as a network, channel or password would never contain spaces.


R¹¶¬³¥

Link Copied to Clipboard