mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2015
Posts: 148
Dazuz Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Dec 2015
Posts: 148
Never mind, everything seems to be working as intended. I'm just going nuts.



Click to reveal.. (Old post)

You seem to be able to add any length of binary variable to a hash table item with "/hadd -b <hash table> <item> <binary variable>" command, and you can set the data from the hash table item to another binary variable with "$hget(<hash table>,<item>,<binary variable>)". In previous versions it would only set the first 4150 characters to the item.

Here's an example:
Code:
alias binaryhashtest {
  bread versions.txt 0 $file(versions.txt).size &input
  echo -at * Read $bvar(&input,0) characters to &input
  hfree -w test
  hmake test
  hadd -b test item &input
  echo -at * item appears to be $len($hget(test,item)) characters long
  echo -at * Got $hget(test,item,&output) characters from item and set it to &output
  hfree -w test
  editbox -a Echoing &output binary variable's content (Press CTRL+Break to stop)
  var %x = 1
  while ($bfind(&output,%x,$crlf).text) { echo -at * $bvar(&output,%x,$calc($v1 -%x)).text | var %x = $v1 + 4 }
  editbox -a
}


I find this "bug" to be absolutely fantastic change, but I assume it's not meant to work like this. At least I couldn't find anything about it from the change log.



EDIT:
Just to give you an example what the script prints out:
Quote:
21:51:30 * Read 621448 characters to &input
21:51:30 * item appears to be 4150 characters long
21:51:30 * Got 621448 characters from item and set it to &output
21:51:30 * 01/08/2016 - mIRC v7.46
21:51:30 * Changes:
21:51:30 * Updated to OpenSSL 1.0.2h library.
21:51:30 * Fixed /timer -h high resolution timer which was being limited to the
21:51:30 * same rate as the -m millisecond timer.
21:51:30 * Added $samepath(path1,path2) identifier that returns $true/$false
21:51:30 * if paths refer to the same file/dir. It resolves relative paths and
21:51:30 * converts long/short filenames.
21:51:30 * Added /copy -f switch to flush copy to disk immediately.
21:51:30 * Added /rename -f switch to flush rename to disk immediately and -o

and so on


Last edited by Dazuz; 01/08/16 07:26 PM.
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Probably related to this fix https://forums.mirc.com/ubbthreads.php/topics/257736/Silent_truncation_with_non-asc#Post257736Wait what you are reporting isn't a bug, it's normal, it's a feature that you can add unlimited data to an item using binary variable


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2015
Posts: 148
Dazuz Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Dec 2015
Posts: 148
Did some tests with older mIRC versions and they worked just like 7.46.

There's a chance I'm going nuts, for about a week I've been playing with a script that took advantage of the fact that it only set 4150 characters. The script started bugging out when I switched from 7.45 to 7.46.

In any case, this is fantastic.

Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
Bvars from hashtables have always worked as they currently do -- all data from the hashtable item is added to the bvar regardless of length -- but I seem to recall there being an issue where, when outputting data from a bvar, instead of raising a line-to-long error the text was truncated.

I can't remember if it was related to /var, /echo, or some other output command but will look to see if I can find the report and documentation of the subsequent fix.


I am SReject
My Stuff
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Well, when not adding a binvar, you're limited to 4150 characters (for the whole command + parameters).
What's the script which started bugging out in 7.46?


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2015
Posts: 148
Dazuz Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Dec 2015
Posts: 148
The part that started bugging out is long gone now, but it was just a "/hadd -b table item &binvar" and "$hget(table,item,&anotherbinvar)".

It would repeat those commands a few times, while keeping an eye on the &anotherbinvar. After I switched to 7.46, &anotherbinvar would get longer and longer until the script finished. It relied on that 4150 cap, which made me thought something changed in 7.46. I've tried to replicate the 7.45 results, but it's not happening.

There's a chance I'm just going senile and imagining things.


Link Copied to Clipboard