PlanetSquires Forums

Support Forums => WinFBE - Code Editor and Visual Designer => Topic started by: jermy on November 04, 2019, 01:34:08 PM

Title: WinFBE Good Practices
Post by: jermy on November 04, 2019, 01:34:08 PM
I wonder which file types belong to WinFBE under Header, Module, and Normal
Is there some guidelines for that, or doesn't it matter?
Title: Re: WinFBE Good Practices
Post by: SeaVipe on November 04, 2019, 02:27:28 PM
Hi Jermy, my version of "Good Practices" is .bas for the Main, Module and Normal files, .bi for header files and .inc for form files.
I designate forms and modules as Normal, the main file as Main and the .bi files as Header.
I don't think there are any hard and fast rules but so far the above works for me and in some of the code snippets throughout this forum I have seen similar designations.
Perhaps at some point something slightly more strict may be imposed on file types and designations if deemed necessary.
Title: Re: WinFBE Good Practices
Post by: Paul Squires on November 04, 2019, 03:09:29 PM
My practice is somewhat similar to Clive's:

Header:  *.bi

Module: *.bas (except for the main .bas file that I obviously put under the Main branch). Any file in the Module branch gets compiled separately to an object file (*.o) and then is linked to the main EXE. This is similar to the old school C approach and is intended to speed up compilation and provide greater modularization of your code. Personally, with the extremely fast computers these days, I have no need for this type of programming style. I put all my code in the main .bas file via a series of #Include that include the Normal *.inc files. I know that Jose Roca uses this approach as well. It is the approach that all of us previous PowerBasic users use.

Normal: *.inc (I use .inc because I find that using .bas is confusing because then I never can tell if the .bas file is a Main, Module, or Normal).


When I create Form files using the built-in visual designer, I always save them as *.inc and put them in the Normal branch.



Title: Re: WinFBE Good Practices
Post by: jermy on November 06, 2019, 04:19:28 PM
ok that is clear,


Normal: *.inc (I use .inc because I find that using .bas is confusing because then I never can tell if the .bas file is a Main, Module, or Normal).


Under Normal i can't include *.bas files, it gives errors with functions and subs

how can Include * .bas file ?, it works the same as *.bi and *.inc file?. (as a couple?.)

thx for help

Title: Re: WinFBE Good Practices
Post by: raymw on November 06, 2019, 06:31:01 PM
I would guess you need to put declares in the main file, make sure shared variables are not duplicated, or are shared where necessary. Generally the compiler will give a clue.
Title: Re: WinFBE Good Practices
Post by: SeaVipe on November 07, 2019, 12:34:29 PM
Hi Jermy, Try this:
In the Project Explorer, Right-Click your .bas file name and select "Normal".
Title: Re: WinFBE Good Practices
Post by: SeaVipe on November 07, 2019, 12:39:07 PM
Here is a screenshot of a .bas file in the Project Explorer as "Normal". (Ignore the typos!)
Title: Re: WinFBE Good Practices
Post by: jermy on November 07, 2019, 02:46:05 PM
thanks for the answer,

what is Module intended for?
Title: Re: WinFBE Good Practices
Post by: SeaVipe on November 07, 2019, 02:51:27 PM
Hi Jermy, check out this post by Paul for the best answer to your question. https://www.planetsquires.com/protect/forum/index.php?topic=4343.msg33539#msg33539 (https://www.planetsquires.com/protect/forum/index.php?topic=4343.msg33539#msg33539)
Title: Re: WinFBE Good Practices
Post by: jermy on November 07, 2019, 03:41:58 PM
okay clear.

That was quite confusing, with visual basic 6 you place * .bas files under Module.

thx for help