Assigning a variable dynamically -------------------------------- It's actually possible to assign a variable from a procedure by doing something like PROCvar_Assign("greeting$", "hello"). The trick is in judicious use of the EVAL and RETURN statements. DEFPROCvar_Assign(Var$,Val$) IF RIGHT$(Var$,1)="$":A%=EVAL("FNvar_S("+Var$+","+Val$+")"):ENDPROC IF RIGHT$(Var$,1)="%":A%=EVAL("FNvar_I("+Var$+","+Val$+")"):ENDPROC IF RIGHT$(Var$,1)="&":A%=EVAL("FNvar_B("+Var$+","+Val$+")"):ENDPROC IF RIGHT$(Var$,1)="#":A%=EVAL("FNvar_F("+Var$+","+Val$+")"):ENDPROC A%=EVAL("FNvar_R("+Var$+","+Val$+")"):ENDPROC ENDPROC : DEFFNvar_S(RETURN a$,b$):a$=b$:=0 DEFFNvar_I(RETURN a%,b%):a%=b%:=0 DEFFNvar_B(RETURN a&,b&):a&=b&:=0 DEFFNvar_F(RETURN a#,b#):a#=b#:=0 DEFFNvar_R(RETURN a, b ):a =b :=0 : Naturally, this depends on the BASIC implementing (RETURN) parameters. See: * mdfs.net/blib/Variable * mdfs.net/blib/Docs/Variable.txt