|
Joined: Jan 2003
Posts: 52
Babel fish
|
OP
Babel fish
Joined: Jan 2003
Posts: 52 |
Say this is the contents of file.txt:
Item Data Item2 Data Item3 Data
-- then /hload it //echo -a $hget(table,Item) it will not echo "data" unless you do //echo -a $hget(table,1) because of the space before "Data" this happens.
(Solution: Remove space) Just reporting it. No reply needed.
|
|
|
|
Joined: Jan 2003
Posts: 52
Babel fish
|
OP
Babel fish
Joined: Jan 2003
Posts: 52 |
When I posted, it stripped the space.. There should be a space right before "Data" on all those lines.
|
|
|
|
Joined: Dec 2002
Posts: 5,420
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 5,420 |
It seems to work fine for me here, with or without spaces infront of the data lines.
|
|
|
|
Joined: Jan 2003
Posts: 52
Babel fish
|
OP
Babel fish
Joined: Jan 2003
Posts: 52 |
I'll do a few more tests so it can be recreated more easily
|
|
|
|
Joined: Jan 2003
Posts: 52
Babel fish
|
OP
Babel fish
Joined: Jan 2003
Posts: 52 |
Found it. Here it is definitly space is denoted by "_" Item_ Data Item2_ Data
hload that //echo -a $hget(table,item) shows: nothing //echo -a $hget(table,item_) shows: nothing //echo -a $hget(table,item $+ $chr(32) $+ ) shows: Data
This may or may not be a bug You decide
|
|
|
|
Joined: Dec 2002
Posts: 2,962
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,962 |
I wouldn't call that a bug as such, it's just the way mIRC works (ignoring leading/trailing whitespace).
Spelling mistakes, grammatical errors, and stupid comments are intentional.
|
|
|
|
Joined: Jan 2003
Posts: 52
Babel fish
|
OP
Babel fish
Joined: Jan 2003
Posts: 52 |
but that is just it, its loading the whitespace from the file, which doesnt seem natual to mIRC
|
|
|
|
Joined: Dec 2002
Posts: 2,962
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,962 |
Well the whitespace is ignored in code (presumably) because it allows the scripter to format it a little more clearly to increase readability. However /hload is only meant to take text from a file which was previously written to using /hsave, so it makes sense that mIRC be stricter in it's interpretation of text.
The only way I'd see this as a true bug was if the space wasn't in the item name when it was saved but is when it is loaded. Which you might've been saying all along and I misunderstood.
Spelling mistakes, grammatical errors, and stupid comments are intentional.
|
|
|
|
Joined: Jan 2003
Posts: 52
Babel fish
|
OP
Babel fish
Joined: Jan 2003
Posts: 52 |
I generated the file and had something along the lines of /write file.txt item $lf data I changed to item $+ $lf $+ data but I still felt the need to report it
well it takes the space after Item but it doesnt take the space before Data so if Item_ can be referenced with $+ $chr(32) $+ shouldn't _Data be loaded as _Data and not Data?
Understand or should I rephrase all that?
|
|
|
|
Joined: Dec 2002
Posts: 191
Vogon poet
|
Vogon poet
Joined: Dec 2002
Posts: 191 |
whats wrong with using /hsave to generate the file.
|
|
|
|
Joined: Jan 2003
Posts: 52
Babel fish
|
OP
Babel fish
Joined: Jan 2003
Posts: 52 |
Nothing, but I didnt generated it from a hash table. Its a /help script I made, generated from first doing /filter on all my .mrc files and finding ALIAS and then finding ";text" in the alias, and then generates a file to /hload It hloads it because, I keep the original file in alphabetical order for a certain purpose.
|
|
|
|
|