example of bplus it seems that both are the same but just write the total on the sub you have to add an extra variable while the function needs to call it as the function
example of bplus it seems that both are the same but just write the total on the sub you have to add an extra variable while the function needs to call it as the function
The only way you can pass values by the parameters is if the variable types match. Don’t rely upon it, unless you specifically code for it.Code: QB64: [Select]
add 3, 4, total% add 3, 4, total! add 3, 4, total& add 3, 4, total# num3 = num1 + num2
Note2: Also be aware that FUNCTIONS can pass values via the parameter, as long as the variable types match, as well.
SUBs and FUNCTIONs are very similar, a FUNCTION does save on one variable if you need something output from the function and it is not an array nor a UDT then a FUNCTION can return your number of string, otherwise I'd use a SUB.
So in the specific case I used, the function would be better. one less variable.
@SMcNeill
Steve, fine demo! I have found very interesting the output!
I have forgotten thatCode: QB64: [Select]is thisCode: QB64: [Select]thanks for reminder.