@BatVink and TDK
Yes, I agree, there are some very iffy programing practices in this code. However:
global ch$ as string
fred=1
george= d(fred)
wait key
end
function d(name)
if name=1
gosub sun:print "ch$= ",ch$
rem this returns "" as ch$
endif
endfunction 0
sun:
ch$="sdf":print "ch$ in the subroutine is ",ch$
return
This does work, and no return stacks are compromised.
@ jayell leedham
Listen to these guys. They know what they are talking about.
This is the better option:
fred=1
george= d(fred)
wait key
end
function d(name)
if name=1
c$=sun(1):print "c$= ",c$
rem this returns "" as ch$
endif
endfunction 0
function sun(c)
if c=1
ch$="sdf":print "ch$ in the sun function is ",ch$
else
ch$="no go":print "cannot get here without a change"
endif
endfunction ch$
Whatever...