BASIC

Author Topic: Foldable types in IDE  (Read 2207 times)

Offline fuzzy70

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 828
  • Look left, Look right, LOOK OUT!!
    • View Profile
Foldable types in IDE
« on: 2011-Nov-22 »
Some of my types are getting rather large thanks to adding functions in them etc. Once I have the type all working as it should I am stuck with a big lump of code at the top which basically gets in the way  :D .

Would sticking them in a SUB at the end of my code & doing a GOSUB setuptypes type of thing work?. If so would help in the short term but if they was foldable that would be better  =D

Lee
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)

Offline Slydog

  • Prof. Inline
  • *****
  • Posts: 930
  • KodeSource
    • View Profile
    • KodeSource
Re: Foldable types in IDE
« Reply #1 on: 2011-Nov-22 »
I haven't tried, but I don't think TYPEs can be inside a sub.  I could be wrong.
I agree, TYPEs should be foldable. 
At least the functions inside the TYPEs are foldable.

Is all your code in one file?
If so, I would put related TYPES and functions into their own files.
I have 15 separate library files that keep my library code out of my main game logic (eg: File, Camera, Vector, etc.)
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

Offline Falstaff

  • Mr. Polyvector
  • ***
  • Posts: 148
    • View Profile
Re: Foldable types in IDE
« Reply #2 on: 2011-Nov-22 »
If so, I would put related TYPES and functions into their own files.
Bingo. Works well for me. I still have a few simple types at the top of my main source, but as soon as I start adding functions, I toss it into it's own file. Keeps things organized.

Offline fuzzy70

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 828
  • Look left, Look right, LOOK OUT!!
    • View Profile
Re: Foldable types in IDE
« Reply #3 on: 2011-Nov-22 »
The "Generic" types I make that can be used in other programs end up in a library of include files that I am slowly building up. The others are normally specific to the project in hand & they are the ones I was talking about, my fault for not stating that  :whip:

Lee
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)

Offline Slydog

  • Prof. Inline
  • *****
  • Posts: 930
  • KodeSource
    • View Profile
    • KodeSource
Re: Foldable types in IDE
« Reply #4 on: 2011-Nov-22 »
Well, you could still put the game specific types into their own file(s), separate from your game logic.
And break down your game code by function, and split into multiple files too.  (Initialize, Menus, Input, etc).
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

Offline fuzzy70

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 828
  • Look left, Look right, LOOK OUT!!
    • View Profile
Re: Foldable types in IDE
« Reply #5 on: 2011-Nov-22 »
Good idea, never thought of that as normally use separate files for library's I have made. Still would be a handy feature to have though I think, especially while the type is still in the main file till I am 100% it can be broken out into another file.

Lee
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)