@PhilOfPerth the way you are using Subs in place of functions makes clear how functions are so much easier to use and understand. First of all you don't have to rely on special shared variables
Replace Sub One, Two and Three in your example with 2 Functions Twice&(Number&) and StrAdd$(s1$, s2$)
and do it for allot more variables without Shared variables!
For example do this with Subs:
Replace Sub One, Two and Three in your example with 2 Functions Twice&(Number&) and StrAdd$(s1$, s2$)
and do it for allot more variables without Shared variables!
For example do this with Subs:
Code: (Select All)
Print "For numbers 1 to 10, show number and Twice it:"
For i = 1 To 10
Print i; "-"; Twice&(i); " ";
Next
Print: Print
Print "For letters a - z show the letter and 2 random letters with it"
For i = 1 To 26
Print Chr$(i + 96); "-"; StrAdd$(Chr$(i + 96), StrAdd$(RndLetter$, RndLetter$)); " ";
Next
Print
Function Twice& (Number&)
Twice& = Number& * 2
End Function
Function StrAdd$ (s1$, s2$)
StrAdd$ = s1$ + s2$
End Function
Function RndLetter$ ()
RndLetter$ = Chr$(Int(Rnd * 26) + 97)
End Function
b = b + ...