gooshie commented on a Page, mIRC /hswap  -  Feb 13, 2017

I like the way it's written except I'd test that
the item ends up where it should instead of:

if (%item_to != %item_from) {
        hdel %table_to %item_to
        hdel %table_from %item_from

I'd also want a verbose option; something along the lines of:
Foo was moved from TableFoo to TableBar which now reads: Yada Yada Yada...
Bar was moved from TableBar to TableFoo which now reads: Blah Blah Blah...
(I'd truncate the actual data to a reasonable length to keep it in one line.)

Arigateaux  -  Feb 13, 2017

So the idea behind %item_to != %item_from is to solve a problem with /hswap test_a test_b val1 val1 working the same as /hswap test_a test_b val1

I will also add a verbose mode with the -s switch that is used for the other hash functions.

gooshie  -  Feb 13, 2017

Well, it's up to you, but your conditional test
before deletion is an ambiguous pseudo test.
I wouldn't consider it good coding practice.

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.