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.

eZ debug

Timing: Jan 20 2025 23:45:35
Script start
Timing: Jan 20 2025 23:45:35
Module start 'layout'
Timing: Jan 20 2025 23:45:35
Module start 'content'
Timing: Jan 20 2025 23:45:35
Module end 'content'
Timing: Jan 20 2025 23:45:35
Script end

Main resources:

Total runtime0.0159 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 590.0078151.2109
Module start 'layout' 0.00590.0029 741.218836.6484
Module start 'content' 0.00880.0057 777.867294.2500
Module end 'content' 0.01450.0014 872.117233.9922
Script end 0.0159  906.1094 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002515.6652140.0002
Check MTime0.00127.6191140.0001
Mysql Total
Database connection0.00116.861110.0011
Mysqli_queries0.003018.836630.0010
Looping result0.00000.092910.0000
Template Total0.00106.210.0010
Template load0.00084.838710.0008
Template processing0.00021.325810.0002
Override
Cache load0.00053.373610.0005
General
dbfile0.00031.745280.0000
String conversion0.00000.038940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs