mIRC Homepage
Posted By: silent How to read Binary variables? - 21/06/05 10:40 PM
Hi,

ive wrote a DLL for mirc, the problem is, it returns a long string, so that i have to use a binvar. But how do i do it?

The string looks like this:

string1;string2;string3...and so on.

so theyr seperated by ";".

How can i loop the string until theres no ";" anymore with a binvar?

i want to have it like this:

Code:
&binvar = $dll(my.dll, proc, params)
while ($pos(&binvar, ;) != 0) { 
  echo -a $read(&binvar, 1, Pos(&binvar, ;)-1)
  delete &binvar 1 $pos(&binvar, ;)
} 


In words i want this:

- Get the long string from the DLL
- Loop it until theres no ";" anymore
--- echo string until ";" -1
--- delete string until ";"

How do i do that?
Posted By: tidy_trax Re: How to read Binary variables? - 21/06/05 11:05 PM
First of all, the method you're using won't even work (as /bset also has a string limit, so you couldn't set the variable in the first place)
You'll have to have your dll write to a file and then have mIRC /bread that into a binary variable. Finally, you can use /breplace to change the ; to another character.
Posted By: silent Re: How to read Binary variables? - 21/06/05 11:10 PM
hi tidy_trax,

much thanks for your post.

hmmm, is there really no other way than create a file? frown
Posted By: Sat Re: How to read Binary variables? - 21/06/05 11:14 PM
Or, get the string in pieces from the DLL instead, i.e. $dll(mydll,getstring,1) would return string1, $dll(mydll,getstring,2) would return string2 etcetera.. that should make processing of the pieces in the script trivial at least, as you wouldn't need binvars at all anymore. You'd have to split up the string in your DLL code (and store it between DLL calls) though.
Posted By: silent Re: How to read Binary variables? - 22/06/05 10:53 AM
ty smile
© mIRC Discussion Forums