Author Topic: DEF FNname (GWBASIC-style functions)  (Read 5430 times)


  • Hero Member
  • *****
  • Posts: 3552
  • what the h3ll did i name that code?
    • stuff at dkm
    • Email
Re: DEF FNname (GWBASIC-style functions)
« Reply #60 on: October 10, 2012, 12:07:52 PM »
_$DEFFN enabling the classic DEF FN mode... but only when needed.

WTF was I insulting?  If you want insulting then WTF would your new keyword do but break compatibility even worse.

The only thing I would like to see, IF Galleon EVER decides to add it, is that QB64 allow FN names that are NOT found after the DEF keywords. Then even if you NEVER use DEF FN, it won't bother the Hell out of everybody else!

The SIMPLEST solution right now is to just change it to a REAL FUNCTION and toss it at the end of your code. If you can't do that much work then you are lazy. No doubt about that.
i really agree with clippy. functions are easy to code and give your program a more modular look. i  say that from the point of experience. i have RARELY ever used def fn except when i first learned basic. it was never implemented in the dec corporation's flavor of basic and i believe only added as a shortcut when disk space and memory were at a premium. so generally, my vote is no for def fn. development time is better used for other things than def fn in my opinion.


  • Full Member
  • ***
  • Posts: 249
    • Email
Re: DEF FNname (GWBASIC-style functions)
« Reply #61 on: April 10, 2013, 01:55:03 AM »
I have a few dozen ond GW basic programs that used DEF FNx as a means of condensing space and memory when these items were at a premium. When I first needed to use Qb64  to run my programs on a 64 bit system I came up with this "deficiency". Of course none of these programs would run with Qb64 but an examination of the functions showed that most of them could be fixed with a simple variable and an operator and the rest with a sub routine

This was easily done with a batch replace command in most cases. I modified all my source code and everything now works in Qb64 but also still works in GWBasic and Qbasic as well. I don't see any urgency to provide this command in Qb64. In fact there are quite a few commands that don't work universally but there are work arounds for everything I have found and these work arounds are all compatable with all systems.