Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Loop through dictionary in Logramm

In the past couple of days I've been trying Logramm and find it rather easy.

However, I can't wrap my head around dictionaries and how to create a loop.

I have created a test dictionary :

member = [ 
     .id                : 0,
     .username          : "derek.almond",
     .email             : "[email protected]",
     .registrationDate  : "09/12/2014",
     .privileges        : 1
];

I then tried looping through it like this :

@ info -> member: out info;

But all it prints out is a list of the keys (id,username and so on).

How can I get the objects as well?

like image 680
Derek Almond Avatar asked Mar 19 '23 11:03

Derek Almond


1 Answers

I usually do it the key,value way.

Here's the code as it should look like:

member = 
[ 
     .id                : 0,
     .username          : "derek.almond",
     .email             : "[email protected]",
     .registrationDate  : "09/12/2014",
     .privileges        : 1
];

@ key,value -> member: 
{
   out "{:key} = {:value}";
}
like image 96
John McArthur Avatar answered Apr 01 '23 20:04

John McArthur