mIRC Home    About    Download    Register    News    Help

Print Thread
#11616 16/02/03 10:46 PM
Joined: Jan 2003
Posts: 52
L
Babel fish
OP Offline
Babel fish
L
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.

#11617 19/02/03 03:01 PM
Joined: Jan 2003
Posts: 52
L
Babel fish
OP Offline
Babel fish
L
Joined: Jan 2003
Posts: 52
When I posted, it stripped the space..
There should be a space right before "Data" on all those lines.

#11618 19/02/03 11:10 PM
Joined: Dec 2002
Posts: 5,420
Hoopy frood
Offline
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.

#11619 19/02/03 11:11 PM
Joined: Jan 2003
Posts: 52
L
Babel fish
OP Offline
Babel fish
L
Joined: Jan 2003
Posts: 52
I'll do a few more tests so it can be recreated more easily

#11620 19/02/03 11:15 PM
Joined: Jan 2003
Posts: 52
L
Babel fish
OP Offline
Babel fish
L
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

#11621 20/02/03 12:17 AM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
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.
#11622 20/02/03 12:18 AM
Joined: Jan 2003
Posts: 52
L
Babel fish
OP Offline
Babel fish
L
Joined: Jan 2003
Posts: 52
but that is just it, its loading the whitespace from the file, which doesnt seem natual to mIRC

#11623 20/02/03 12:23 AM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
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.
#11624 20/02/03 12:33 AM
Joined: Jan 2003
Posts: 52
L
Babel fish
OP Offline
Babel fish
L
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?

#11625 20/02/03 09:38 AM
Joined: Dec 2002
Posts: 191
N
Vogon poet
Offline
Vogon poet
N
Joined: Dec 2002
Posts: 191
whats wrong with using /hsave to generate the file.

#11626 20/02/03 07:52 PM
Joined: Jan 2003
Posts: 52
L
Babel fish
OP Offline
Babel fish
L
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 smile
It hloads it because, I keep the original file in alphabetical order for a certain purpose.


Link Copied to Clipboard