OoO En cette  fin de matinée radieuse du dimanche  20 février 2011, vers
11:40, Daniel Cartron <[email protected]> disait :

> Bonjour tous,
> Je veux faire un tableau à plusieurs dimensions mais je me demande si ma 
> conception n'est pas erronnée,

> montableau = new Array();
> montableau['CODE1'] = new Array();
> montableaube['CODE1'][0]['TRUC'] = 'A';
> montableaube['CODE1'][1]['TRUC'] = 'B';
> montableaube['CODE1'][2]['TRUC'] = 'C';
> montableaube['CODE1'][3]['TRUC'] = 'D';
> montableaube['CODE1'][0]['MACHIN'] = 'E';
> montableaube['CODE1'][1]['MACHIN'] = 'F';
> montableaube['CODE1'][2]['MACHIN'] = 'G';
> montableaube['CODE1'][3]['MACHIN'] = 'H';

var montableau = { code1: 
                { 0:
                     truc: 'a',
                     machin: 'e' },
                { 1:
                     truc: 'b',
                     machin: 'f' }
                 }

Et tu peux aussi utiliser des notations plus simple comme :
montableau.code1[0].truc
-- 
printk("Illegal format on cdrom.  Pester manufacturer.\n"); 
        2.2.16 /usr/src/linux/fs/isofs/inode.c
_________________________________
Linux mailing list
[email protected]
http://lists.parinux.org/mailman/listinfo/linux

Répondre à