The only thing with this answer is that Asii mentioned adding integer to integer. If Num2 is greater than 10, you wouldn’t get a proper result; which is why I turned them into strings and added them. ;)
Title: Re: assign 2 integers variable value to 1 integer variable value? like 3 and 5 to 35
Post by: TerryRitchie on February 11, 2020, 09:41:34 pm
Yep, I see what you mean. I provided an example of how to use power of 10 to achieve an answer for the specific scenario he gave.
With my example his numbers would always need to be 0 through 9.
Title: Re: assign 2 integers variable value to 1 integer variable value? like 3 and 5 to 35
Post by: Asil on February 12, 2020, 04:34:04 am
i did in this way it works atm. i got 2 string together and convert to int with Val function... NumberCombined = VAL(MID$(t$, 1, 1) + MID$(t$, 2, 1))
Title: Re: assign 2 integers variable value to 1 integer variable value? like 3 and 5 to 35
Post by: Petr on February 12, 2020, 04:09:21 pm
Hi.
This is my solution for INTEGERS. At first I was sad that QB64 does not have a function that returns the length of a number (number of digits) without conversion to a string, but then I sat down a little in the chair and realized that it could simply be written as a custom function. This, as it is, works for integers, if the function were to return the length, including the places to the right of the decimal point, it would have to be modified. About how do it for decimals, I'm now thinking. But, this is really interest thing.