PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: WinFBE Good Practices  (Read 1347 times)

jermy

  • Junior Member
  • **
  • Posts: 60
WinFBE Good Practices
« 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?
Logged

SeaVipe

  • Senior Member
  • ***
  • Posts: 369
  • Windows 10
Re: WinFBE Good Practices
« Reply #1 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.
Logged
Clive Richey
*“You Either Have To Be Part Of The Solution, Or You’re Going To Be Part The Problem.” Eldridge Cleaver.
#StaySafe, Always  Keep A Safe #SocialDistance, #WashYourHands Often and please, #StayHome!

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 9313
  • Windows 10
    • PlanetSquires Software
Re: WinFBE Good Practices
« Reply #2 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.



Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

jermy

  • Junior Member
  • **
  • Posts: 60
Re: WinFBE Good Practices
« Reply #3 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

« Last Edit: November 06, 2019, 04:30:01 PM by jermy »
Logged

raymw

  • Senior Member
  • ***
  • Posts: 409
Re: WinFBE Good Practices
« Reply #4 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.
Logged

SeaVipe

  • Senior Member
  • ***
  • Posts: 369
  • Windows 10
Re: WinFBE Good Practices
« Reply #5 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".
Logged
Clive Richey
*“You Either Have To Be Part Of The Solution, Or You’re Going To Be Part The Problem.” Eldridge Cleaver.
#StaySafe, Always  Keep A Safe #SocialDistance, #WashYourHands Often and please, #StayHome!

SeaVipe

  • Senior Member
  • ***
  • Posts: 369
  • Windows 10
Re: WinFBE Good Practices
« Reply #6 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!)
« Last Edit: November 07, 2019, 12:40:55 PM by SeaVipe »
Logged
Clive Richey
*“You Either Have To Be Part Of The Solution, Or You’re Going To Be Part The Problem.” Eldridge Cleaver.
#StaySafe, Always  Keep A Safe #SocialDistance, #WashYourHands Often and please, #StayHome!

jermy

  • Junior Member
  • **
  • Posts: 60
Re: WinFBE Good Practices
« Reply #7 on: November 07, 2019, 02:46:05 PM »

thanks for the answer,

what is Module intended for?
Logged

SeaVipe

  • Senior Member
  • ***
  • Posts: 369
  • Windows 10
Re: WinFBE Good Practices
« Reply #8 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
Logged
Clive Richey
*“You Either Have To Be Part Of The Solution, Or You’re Going To Be Part The Problem.” Eldridge Cleaver.
#StaySafe, Always  Keep A Safe #SocialDistance, #WashYourHands Often and please, #StayHome!

jermy

  • Junior Member
  • **
  • Posts: 60
Re: WinFBE Good Practices
« Reply #9 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
Logged