Adding Byte values inside a ARRAY

For general Flowcode discussion that does not belong in the other sections.
Post Reply
dvcam99
Posts: 89
http://meble-kuchenne.info.pl
Joined: Fri Dec 04, 2020 11:03 am
Has thanked: 6 times
Been thanked: 12 times

Adding Byte values inside a ARRAY

Post by dvcam99 »

Hello together,

may someone can help me.

I would like to sum all byte values inside a string or byte array.

Ok I can do this byte to byte.

Example Byte String/ARRAY: Test_byte[5]

sum_byte_int = Test_byte[0] + Test_byte[1] + Test_byte[2]......and so on!!

But I´m looking for a more elegant way to do it.


BR

Dirk
Happy FC9, FC-8 and FC-6 professional user ;)

stefan.erni
Valued Contributor
Posts: 738
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 170 times

Re: Adding Byte values inside a ARRAY

Post by stefan.erni »

Hi Dirk

What about this way?

And make sure that the sum is not greater than the maximum value of an integer


regards

Stefan

Len_2021-12-09_12-04-37.png
Len_2021-12-09_12-04-37.png (34.73 KiB) Viewed 1319 times

dvcam99
Posts: 89
Joined: Fri Dec 04, 2020 11:03 am
Has thanked: 6 times
Been thanked: 12 times

Re: Adding Byte values inside a ARRAY

Post by dvcam99 »

Super Stefan!!

Works great!!

Many Thnaks
Dirk
Happy FC9, FC-8 and FC-6 professional user ;)

Post Reply