Yeah but you've done the same thing in this example - you haven't defined all the variables that function LoadNoe uses (outside of filename$) as globals!
ie.
Txs, Tys and Tzs are not declared global.
Neither are xp,yp and zp.
Neither is LD or Tmap$ or Tname$
Your global statement at the top that you've commented out contains Tername$ and Termap$ as globals but the function refers to them as Tname$ and Tmap$.
Attention to detail man!
This needs to go at the top:
Global Tname$, Tmap$, Txs, Tys, Tzs,xp,yp,zp,Ld
Go though your other functions, cut and paste all the vars you use in a function into a global statement - that way you can't mess it up with typos / memory probs :)
If you haven't got a real handle on whats going on this is the deal - any vars you declare in your main program (that's everything outside of functions) without the global command cannot be seen inside of a function.
ie.
a=10
d=SOME_FUNCTION()
end
function SOME_FUNCTION()
print a
end function
This will print "0" because it can't see the variable a
but if you change a=10 to Global a=10 then all functions can access / change the value of a comprende?
Did someone just say Option Explicit? :)
-R
ie.
Txs, Tys and Tzs are not declared global.
Neither are xp,yp and zp.
Neither is LD or Tmap$ or Tname$
Your global statement at the top that you've commented out contains Tername$ and Termap$ as globals but the function refers to them as Tname$ and Tmap$.
Attention to detail man!
This needs to go at the top:
Global Tname$, Tmap$, Txs, Tys, Tzs,xp,yp,zp,Ld
Go though your other functions, cut and paste all the vars you use in a function into a global statement - that way you can't mess it up with typos / memory probs :)
If you haven't got a real handle on whats going on this is the deal - any vars you declare in your main program (that's everything outside of functions) without the global command cannot be seen inside of a function.
ie.
a=10
d=SOME_FUNCTION()
end
function SOME_FUNCTION()
print a
end function
This will print "0" because it can't see the variable a
but if you change a=10 to Global a=10 then all functions can access / change the value of a comprende?
Did someone just say Option Explicit? :)
-R