display an array in a label

   1111   2   1
User Avatar
Member
66 posts
Joined: March 2016
Offline
Hello everybody

I have an array attribute on detail, and I would like to show the value in a HDA UI in label parameter.
I am using this expression:

`detail("./", "list",0)`

but what I get is only the first element of the array, not the full list of elements.

It seems I am doing something wrong, what is the correct way to do it?

Thanks
Edited by Gerardo Castellanos - June 21, 2024 05:24:48

Attachments:
array.jpg (70.2 KB)

Gerardo Castellanos
www.gerardocastellanos.com
User Avatar
Member
34 posts
Joined: July 2022
Offline
float list = {11.23,96.305,8.6984,7.438,4940.3};

string s = "{ ";
for(int i=0;i<len(list);i++)
{
s += sprintf("%g",list);
if(i < len(list)-1)
s += ", ";
}
s += " }";

s@label = s;

----------------------

`details('./','label')`

Attachments:
PixPin_2024-06-21_19-18-08.png (340.6 KB)

User Avatar
Member
66 posts
Joined: March 2016
Offline
ohh I see @juejuezi, you convert the array into a string.... thanks for the idea!
Gerardo Castellanos
www.gerardocastellanos.com
  • Quick Links