Foldable types in IDE

Previous topic - Next topic

fuzzy70

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)

Slydog

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]

Falstaff

Quote from: Slydog 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.

fuzzy70

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)

Slydog

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]

fuzzy70

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)