mIRC Home    About    Download    Register    News    Help

Print Thread
#198444 28/04/08 07:09 PM
Joined: Apr 2004
Posts: 759
M
Hoopy frood
OP Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
It be nice to be able to call methods on objects returned by $comval as shredplayer once requested already

Another suggestion i would love to see added is being able to specify variable names for references to non object properties (particulary usefull for long strings) and being able to pass these reference as parameters into another com call.

Much like how you can dispatch an object and pass along that object to another comcall already.

I would really love to see this added Khaled or hear your thoughts on this.

Thanks in advance.


$maybe
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Quote:
Another suggestion i would love to see added is being able to specify variable names for references to non object properties (particulary usefull for long strings) and being able to pass these reference as parameters into another com call.


Isn't this already provided by the "bstr* varname" syntax?


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
argv0 #198448 28/04/08 08:39 PM
Joined: Apr 2004
Posts: 759
M
Hoopy frood
OP Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
no that only allows you to retrieve what you passed as argument for some odd reason.

Code:
alias download {
  clear
  .comopen xml msxml2.xmlhttp
  var %x $com(xml,open,1,bstr,get,bstr,http://www.mirc.com,bool,-1) $&
    $com(xml,send,1) $com(xml,responseText,3,bstr* txt,hello)
  echo -a argv[0]: $com(xml,txt)
  comopen ado adodb.stream
  echo -a Mode: $com(ado,Mode,4,int,3)
  echo -a Type: $com(ado,Type,4,int,2)
  echo -a Open: $com(ado,Open,3)
  echo -a WriteText: $com(ado,WriteText,3,bstr*,txt)
  echo -a Save: $com(ado,SaveToFile,3,bstr,C:\test.txt,int,2)
  echo -a Close: $com(ado,Close,3) - $com(xml,txt)
  cc
  run C:\test.txt
}
alias cc {
  if ($com(xml)) comclose xml
  if ($com(txt)) comclose txt
  if ($com(ado)) comclose ado
}

I dont see much use for $com(xml,txt) personally.

what you would expect here is to be able to use $com(xml,responseText,3,bstr* txt)
$com(ado,WriteText,3,bstr*,txt)
much like the syntax for dispatch however since mIRC cannot make a distinction between txt the string and txt the object a new keyword might be appropiate
$com(ado,WriteText,3,var txt)
where var is most likely not a good name but you catch my drift.






$maybe
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Agreed, this feature would be much more useful than what "bstr* varname" currently seems to do.

["bstr* varname" could be useful with COM methods that accept a reference to a string. Presumably, the method could make that reference point to a newly created (by that method) string or to the same string, after modifying it. This new/modified string would then be accessible with $com(name,varname). I haven't seen any COM method that works like that, so this is all pure speculation.]


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com

Link Copied to Clipboard