Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
need help converting old style def fn functions
#9
(07-14-2022, 07:12 PM)madscijr Wrote: I think this may have been created waaay back in the day, maybe in GW-BASIC or BASIC A?
The "DEF FN" assumes *all* variables are global, that's why it was eventually replaced with SUB/FUNCTION in M$QB. "DEF FN" has no way to declare a variable local, and not even to set its type. That's why when converting one of those to "FUNCTION" the programmer has to watch out for variables that weren't listed as parameters to the function. Also couldn't create a string function with "DEF FN".

Try compiling your code (which looks less than the spaghetti shown above) with "OPTION _EXPLICIT" at the top.
Reply


Messages In This Thread
RE: need help converting old style def fn functions - by mnrvovrfc - 07-23-2022, 07:27 AM



Users browsing this thread: 1 Guest(s)