Moreover it seems that you can read variables from main module into DEF Fn
run this code in Qbasic
DEF FnQbasicVariableScope(z%)
c = 1
FnQbasicVariableScope= 1+ z%
PRINT a%, b%, c
END DEF
a% = 10
b% = FnQbasicVariableScope (20)
PRINT a%,b%,c
END
and you'll get this result
10 0 1
10 21 1
so DEF_FN can read directly variables in main module and main module can read directly variables in DEF_FN:
it seems more a GOSUB than a separated function.
With the addition of the bug that lets declare a variable in DEFFN by DIM before to declare the same variable by assignment statement into main module.
Now we can begin to understand why Galleon doesn't like to support DEF FN in QB64 and also why the same developers of QB and Qbasic warning to modify variable of main from DEF_FN or make operations or graphic work .