mIRC Home    About    Download    Register    News    Help

Print Thread
#125297 16/07/05 06:09 PM
Joined: Jul 2005
Posts: 2
W
Walrus Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
W
Joined: Jul 2005
Posts: 2
I've not used mIRC for a while, however I'm wanting to write a script as an example of using a DDE server for someone.

I've got this so far:-

Code:
alias MyAliasName{
  var %ddeservername = MyDDEServerName

  if ($isdde(%ddeservername) == $true)  {
    var %ipl = $dde(%ddeservername,info,"%ipl%")
    /echo %ipl
    	  if (%ipl == 5) {
               echo Yup
         }
         else {
      	       echo Nope
         }
  }
  else {
    echo DDE server not running
  }
halt
}
 


The erroneous '/echo %ipl' is so I can see what's happening, with any luck.

Bottom line, %ipl is never 5, but the code always responds with 'Yup'. I've obviously missed something fundamental about mIRC scripting, it's not something I really want to add to my resume, so any help would be much appreciated.

Another quick Q... is there a way of declaring and initialising a string without mIRC trying to parse it? i.e. %mystring = "$dde(%ddeservername,info,"%ipl%")"

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
(1) You need to go into your code and remove the TAB character on this line "if (%ipl == 5) {" its confused mirc, its seeing it like this <TAB><SPACE>if (%ipl == 5) { and it looks through your alias's and find non by the name $chr(9) so goes, well it must be a server command so ill send it to the server, now onto the next line of code , oh look echo Yup, better do that now!
I alos get in my status window a line looking like
[] Unknown command [] is a small black square

You may have other tabs in there i didnt check.


(2) //set %mystring = $!dde(%ddeservername,info,"%ipl%")
the ! stops the evaluation of the $dde command, everything following it doesnt get evaluated because its joined (no spaces) to the $!dde

Joined: Jul 2005
Posts: 2
W
Walrus Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
W
Joined: Jul 2005
Posts: 2
Thanks for the response, I 'cleansed' my source of nasty tabs etc, and bobs yer uncle, everything fired up nicely, ty. I've never met such a fussy parser.

As for the strings, I've still not got my head round a number of aspects, such as dealing with special chars, the strange behaviour of "quoted" and non-quoted strings... um the quotes are printed! But nevermind, I've managed to cobble together an example (my original objective), which experts like yourself will be able to improve on.

I've no intention of attempting to learn anymore mIRC scripting from what I've seen so far. I admire your patience!


Link Copied to Clipboard