05-21-2025, 01:33 AM
(05-21-2025, 12:39 AM)bplus Wrote: Functions can be used inside functions so you can do multiple functions in a single line of code.
A sub has to be run and the results run some place else.
Look at all the built in functions we use in the QB64 language, for instance LEN(myString$) or Mid$.
You can do this:
Function LastLetter$(mystring$)
LastLetter$ = Mid$(mystring$, Len(mystring$), 1)
End Function
Now LastLetter$ might be used in another function or sub or by main code.
I can see we may use several arguments in a Function, but does a function always only return one value?
With a Sub I can change several variables at the same time.
Of all the places on Earth, and all the planets in the Universe, I'd rather live here (Perth, Western Australia.) 
Please visit my Website at: http://oldendayskids.blogspot.com/

Please visit my Website at: http://oldendayskids.blogspot.com/