No I didn't. I can see that we have a terminology problem here and that you're not understanding what I wrote, which is a bit surprising given your extensive background in older languages. I did not say I couldn't think of a reason to have forward references. Forward references are generally required for all but the simplest of programs. I said there's no reason for FB to support forward references without first declaring a function prototype.Flyzone wrote:You can't? You just mentioned two of them. There are others ...apparently Quick Basic had no issue with forward referencing a function without any sort of advanced declaration. FB does not allow that, nor can I think of a good reason to allow that.
A bit of an odd statement given that C is nearly 50 years old (astounding to realize, really). But yes, on the mainframe other languages dominated for years before that. I'd love to hear from you the languages you used before so maybe we can identify some common frames of reference.Never programmed in C; never will. You are obviously much younger and the 6 or so languages I have programmed in predate you but the technology has changed considerably and after many years of non-participation I am toying with FB keeping one foot in the past on placing another in today's tech. I hope they don't try to make FB a C lookalike-workalike. I actually heard John Kemeny (originator of Basic) speak and he'd be horrified. However, I like what they've done with FB so far.
As to what BASIC has become, Niklaus Wirth would very much approve of BASIC becoming more formal and structured. Yes FB has turned out nicely. The ability to interoperate with libraries written in C, and to make FB capable of emulating C calling conventions and C data types and structures, makes FB very powerful on modern operating systems.
DLLs are shared libraries and are by definition "relocatable." FB can create DLLs (which can be used by any other language also). See the wiki pages for more information on make and using shared libraries with FB. See https://www.freebasic.net/wiki/ProPgSharedLibraries, or more generally, https://www.freebasic.net/wiki/CatPgProgrammerThanks for the info on libs. I'll try them out even though a source include would be easiest but I'd like to recreate what we used to call relocatable modules/libraries just to see how same/different they might be. Some things haven't changed at all.
The header/implementation paradigm is not just limited to DLLs. You can use it to good effect within a single program. For example you could have one .bas file that defines a number of utility functions you use throughout your program. A .bi file gives the sub and function prototypes and any user-defined types associated with that utility .bas file. Then in each of your .bas modules you can include the .bi file and use those functions. When linking the final executable, just link in all the .o files from the individual .bas files. Seems like most FB programmers are unaware of this style of code organization and modularization, which is a pity because it can dramatically decrease compile times. This is equivalent to what you call "source include."