![]() |
[Beginner Q] How to use subs/functions from external file? - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: Chatting and Socializing (https://qb64phoenix.com/forum/forumdisplay.php?fid=11) +--- Forum: General Discussion (https://qb64phoenix.com/forum/forumdisplay.php?fid=2) +--- Thread: [Beginner Q] How to use subs/functions from external file? (/showthread.php?tid=3436) Pages:
1
2
|
RE: [Beginner Q] How to use subs/functions from external file? - TempodiBasic - 02-06-2025 I think that each coding language has its tipical way to organize the code. I remember the Pascal language with the definition of procedures and of functions before to use them. And the following issue of declaration solved by FORWARD keyword that let use a procedure/function waiting for its definition in the following code. ![]() while in QuickBasic it uses a pre-declaration of subroutine /function that provides the model of the subroutine/function at the top of the code, while at the bottom of the code we can find the code of subroutine / function ![]() C and C++ seem to be more flexible but I found examples in which the function are written at the top of the code like in Pascal CPP fibonacci and c fibonacci PowerBasic has this structure PowerBasic Fibonacci and likely Freebasic FreeBasic Fibonacci while Liberty Basic is like QB64 with routines at the bottom Liberty Basic Fibonacci. Changing the way to code the subroutines changes the structure of program and also the way to think when the coder plans the final program. What kind of advantages can bring coding anywhere a subroutine towards the style of QB64 at bottom or Pascal style at the top? |