This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

arrays

Old posts that have not been replied to for several years.
Locked
S
Snapple
Voice
Posts: 38
Joined: Fri Jul 18, 2003 4:41 pm
Location: Israel
Contact:

arrays

Post by Snapple »

I try to make an array, the array name is in english,
the array item is a channel in hebrew...
for some reason when I try to reach the var in that array item
it get nothing, it says it not exist

is there a problem with arrays items and languages?>

arrayname($hebchan) something-english-or-hebrew
Snapple
There are 10 kind of people here, the one's who know binary code and the one's who don't.
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Have you inserted the something-english-or-hebrew in " like "something-english-or-hebrew"? And how exactly do you call that array?
Once the game is over, the king and the pawn go back in the same box.
S
Snapple
Voice
Posts: 38
Joined: Fri Jul 18, 2003 4:41 pm
Location: Israel
Contact:

hmm

Post by Snapple »

hmm... the var is something info by two possibilties:
adding with a command, when the egg get a command
if the array in the item is empty it uses
lappend opes($chan) "something"
if it's not empty:
set opes($chan) [linsert $opes($chan) end "something else"]

the second possibility is when the egg load it takes the info from a file db
which contains like the following:
set opes(#Help) {
"something"
"something else..."
}
In english channel names it works great, in hebrew chan names not.
Snapple
There are 10 kind of people here, the one's who know binary code and the one's who don't.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

One possability is to use a english value for the array item.

Somthing like

Code: Select all

set item [md5 [string tolower $channel]]
set array($item) $value
S
Snapple
Voice
Posts: 38
Joined: Fri Jul 18, 2003 4:41 pm
Location: Israel
Contact:

hmm

Post by Snapple »

thanks but
someone have other idea's please?
Snapple
There are 10 kind of people here, the one's who know binary code and the one's who don't.
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Re: hmm

Post by user »

Snapple wrote:thanks but
someone have other idea's please?
You don't seem capable of trying out the solutions suggested to you, so why bother asking? This is the 3rd time you start a thread about this subject and I already gave you a working solution in the previous thread. (if you'd care to try it).

It seems like the problem occur when reading the hebrew variable names from the file, so the problem must be caused by using the wrong encoding when reading the file.

And btw: you can use 'lappend' no matter what...'linsert' is slower and using it like you do makes no sense.
S
Snapple
Voice
Posts: 38
Joined: Fri Jul 18, 2003 4:41 pm
Location: Israel
Contact:

hmm...

Post by Snapple »

I tried both of them
your idea didn't work at all...
and the md5 is "working" but when I try to get the var, it says blank (not NULL)
Snapple
There are 10 kind of people here, the one's who know binary code and the one's who don't.
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Re: hmm...

Post by user »

Snapple wrote:the md5 is "working" but when I try to get the var, it says blank (not NULL)
Huh? "" or the word "blank"?

[encoding convertfrom [encoding system] $channel] should be == the channel name read from the file. This converted channel name should appear correctly in data sent to irc/files, but not in dcc chat (iirc).

Since reading the file using the right encoding seems impossible, this ugly hack might be your only choice :/
S
Snapple
Voice
Posts: 38
Joined: Fri Jul 18, 2003 4:41 pm
Location: Israel
Contact:

hmm

Post by Snapple »

the md5 leaves ""

and the encoding do not return the chan name =\

is there a command like md5 just for ascii?
Snapple
There are 10 kind of people here, the one's who know binary code and the one's who don't.
Locked