02-11-2025 11:46 AM
Subject says it all really. I'd like Join Numbers to be scalable, but it isn't. So, What's the easiest way to do this?
Solved! Go to Solution.
02-11-2025 12:12 PM
02-11-2025 12:15 PM
I was so close. Your method doesn't have the coercion dot! Thanks!
02-11-2025 12:25 PM
@rds2112 wrote:
I was so close. Your method doesn't have the coercion dot! Thanks!
I assume you just connected your High to the top hi input. It is just coercing the value to a U32. The upper bits of that should all be zeros if you are using a U16, so it should not matter in this case. If you are in a tight loop, the coerce maybe faster.
02-11-2025 12:30 PM
I was getting a lot of zeros where I didn't want them. Your method makes more sense for parsing while displayed in binary.
02-11-2025 07:54 PM - edited 02-11-2025 08:19 PM
@rds2112 wrote:
Subject says it all really. I'd like Join Numbers to be scalable, but it isn't. So, What's the easiest way to do this?
How should it be made scalable? there is no 24bit or 84bit integer type, for example.
You already got a good solution but for more complicated problems, e.g. parsing a 1D U8 array of [R,G,B,R,G,B,R,G,B] to a U32 array of [RGB, RGB, RGB] etc. is often needed.
An alternative is the good old typecast, of course. Becomes more practical if you want to join 8 U8 values into a U64, for example. Using a fallen Christmas tree of "join numbers" will get tedious!
(Just make sure to pad correctly if the input is short.)
Also be aware of the desired byte order of the result.