mIRC Home    About    Download    Register    News    Help

Print Thread
space in hash #235305 08/12/11 12:48 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Can i add space in hashlist? if yes, how cos it will not add it if i use:

hadd nick,test this is a test

nick will be replaced with a nickname or host, i using , for $gettok(nick,1,44) so it will be added directly after nick (without space)..


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Re: space in hash [Re: sparta] #235307 08/12/11 02:54 PM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
You didn't say which area of the hash table you want to add the space. The item or data?

Re: space in hash [Re: Tomao] #235308 08/12/11 04:15 PM
Joined: Jul 2006
Posts: 3,574
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,574
This is irrelevant, adding a space to the item would tell the command what is the item and the data, if he really wants a space in an item, he needs to use binary variable

Last edited by Wims; 08/12/11 04:58 PM.

Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: space in hash [Re: Wims] #235309 08/12/11 04:53 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
Not entirely. If he wants a space in data, it works just fine and he might just need some help with how that works. The example given appears to be missing a space after the item name unless that was intentional, so it could just be that he has his syntax messed up. So the question is valid. If he wants a space in the item, that is actually possible. One of the regulars here showed a way to do that, but I forget who that was or how it was done. It isn't really meant to have spaces, however.

To the OP:
1) Data can have spaces. /hadd tablename itemname this is my data
2) Item names aren't meant to have spaces and although it can be done, it's not as straightforward. It's far easier to replace spaces with another character that won't be in the item name (usually something like _ works well). So...

Code:
  var %itemname = my item
  hadd tablename $replace(%itemname,$chr(32),_) some kind of data


The item name will then be: my_item

Then, when you access your data, if you need to display the item name, just do a reverse of the replace... $replace(%itemname,_,$chr(32)) .


Invision Support
#Invision on irc.irchighway.net
Re: space in hash [Re: Riamus2] #235310 08/12/11 05:04 PM
Joined: Jul 2006
Posts: 3,574
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,574
I edited the post, didn't mean to talk about "data"
Not sure what is your source of information but you always come up with strange informations, I think you rather meant to say that using spaces in general in mIRC's command is not really allowed by design, but you cannot say "item name are not meant to have spaces"


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: space in hash [Re: Wims] #235311 08/12/11 05:52 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
Item names are not designed to handle spaces without doing something out of the ordinary. Is that better? You cannot do /hadd table "item name" some data, you cannot do /hadd table item name some data. Therefore, stating that it's not designed/meant/whatever to handle spaces is accurate. I already said that it was possible, but possible doesn't mean it was designed to do so. And by extension, if it wasn't designed to have spaces, then it also wasn't meant to. If Khaled meant to have item names with spaces, he'd have either made the standard syntax handle them (maybe using $hadd() instead of /hadd) or he would have provided information in the help file explaining an alternate method. Since neither is true, he wasn't intending (meaning) to have items with spaces. Can it be done? Yes. Is it done using the standard syntax? No. Is it as straightforward? No. Is there anything in the help file that gives any explanation whatsoever about how to do it? If there is, I've never seen it.

There is no benefit to arguing over semantics. It should be perfectly clear what I meant regardless if you don't like the word choice. Finishing the sentence you quoted and noting what I had already said in that post clarifies it ... it's possible, but the /hadd command was not specifically meant/designed to handle it. Whether or not that is because of spaces in the rest of mIRC doesn't matter. It still isn't designed to handle them at this location and therefore what I said was valid.

Last edited by Riamus2; 08/12/11 06:01 PM.

Invision Support
#Invision on irc.irchighway.net
Re: space in hash [Re: Riamus2] #235313 08/12/11 09:26 PM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
I think there is a linguistic culture shock between United States and France. :P lol excuse me for being off-topic.

Re: space in hash [Re: Riamus2] #235319 09/12/11 01:25 AM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Thnx, didnt think about $replace(), got it to work fine with it smile


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }