• Welcome to PlanetSquires Forums.
 

WinFBE Good Practices

Started by jermy, November 04, 2019, 01:34:08 PM

Previous topic - Next topic

jermy

I wonder which file types belong to WinFBE under Header, Module, and Normal
Is there some guidelines for that, or doesn't it matter?

SeaVipe

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.
Clive Richey

Paul Squires

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.



Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

jermy

#3
ok that is clear,

Quote from: Paul Squires on November 04, 2019, 03:09:29 PM

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


raymw

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.

SeaVipe

Hi Jermy, Try this:
In the Project Explorer, Right-Click your .bas file name and select "Normal".
Clive Richey

SeaVipe

#6
Here is a screenshot of a .bas file in the Project Explorer as "Normal". (Ignore the typos!)
Clive Richey

jermy

thanks for the answer,

what is Module intended for?

SeaVipe

Clive Richey

jermy

okay clear.

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

thx for help