CAPL associative array with message type

1k Views Asked by At

I'm trying to make CAPL associative array which could hold e.g. 10 most recent CAN messages for each ID like below:

message[10] messages[long]

Is there possibility to make associative array in CAPL, where key would be some integral type value, and value would be array of messages?

2

There are 2 best solutions below

0
Shyam On BEST ANSWER

The data type message is an object. Since only "simple data types" are possible, you cannot declare a message variable with associative fields.

2
gedomagno On

According to https://blog.csdn.net/qq_34414530/article/details/126055577 the data types of key and value can be: long, int64, float, double, enumeration types and char[]. In that case you can not declare an associative array with key of data type message.