adding values to hash

Author Message

Marko Žmak

Thursday 21 April 2005 11:41:57 pm

How can I add new (key,value) pairs to an existing hash?

Here's what I want to do:

- create a hash $myhash

{let myhash=hash( name, 'John')}
...

- later in the code add a pair (surname, 'Smith') to $myhash. The equivalent in PHP would be:

$myhash{'surname'} = 'Smith'

I tried doing this in many ways but it just won't work. Is there any way to do this? And I need a precise sollution for this, not any workarounds.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Marko Žmak

Saturday 23 April 2005 3:42:43 pm

Does anyone know the sollution to this problem???

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Marko Žmak

Tuesday 26 April 2005 4:48:19 pm

Still no anwser... Is there ANY sollution for this? Should I post it to another forum?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Tuesday 26 April 2005 11:15:25 pm

Hi,

Maybe this helps:
http://ez.no/community/forum/general/how_to_assign_new_values_to_keys_in_hash
http://ez.no/ez_publish/documentation/development/libraries/ez_template/operators/array_handling

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.