Author Topic: Editor Request - Code Folding  (Read 3772 times)

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2668
    • View Profile
Editor Request - Code Folding
« on: 2006-Apr-19 »
Not an essential but my favourite feature of the Delphi IDE is Code Folding. This is the ablility to 'fold' a block of code into a code folded marker '...'

For example :-

Code: (glbasic) [Select]
[-]FUNCTION PSprite: id, tile, width, height, x, y
LOCAL sx, sy, tx, ty, dx, dy
LOCAL p2x, p2y
LOCAL cols, c
    GETSPRITESIZE id, sx, sy
    cols = INTEGER(sx / width)
    tx = MOD(tile, cols) * width
    ty = INTEGER(tile/cols) * height
    c=RGB(255,255,255)

    width=width-1
    height=height-1
    STARTPOLY id
        POLYVECTOR x,      y       ,tx      ,ty       ,c
        POLYVECTOR x,      y+height,tx      ,ty+height,c
        POLYVECTOR x+width,y+height,tx+width,ty+height,c
        POLYVECTOR x+width,y       ,tx+width,ty       ,c
    ENDPOLY
ENDFUNCTION
Becomes...

Code: (glbasic) [Select]
[+]FUNCTION PSprite: id, tile, width, height, x, y ...Browsing and arranging your code is a much easier afair.

As I said, not essential but I would love to see it in the editor. :)
Cheers,

Ian.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration.”
(E. W. Dijkstra)

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10739
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Editor Request - Code Folding
« Reply #1 on: 2006-Apr-19 »
That's a lot of work and I personally do not use it ;) That's why there is a jump-bar on the right side, yo you have all the functions without additional text in between. I think I'll better use my time for other things, sorry. :)

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2668
    • View Profile
Editor Request - Code Folding
« Reply #2 on: 2006-Apr-19 »
No problem Gernot, I understand :),

How is the compiler/debugger set for an external editor. Could I control the compiler/debugger from command line? Can I intercept errors/warrnings/messages?
Cheers,

Ian.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration.”
(E. W. Dijkstra)

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10739
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Editor Request - Code Folding
« Reply #3 on: 2006-Apr-19 »
Oh. You'd better leave that. It's not designed this way and it would cause lots of trouble. Is this feature so important?

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2668
    • View Profile
Editor Request - Code Folding
« Reply #4 on: 2006-Apr-20 »
No its not that important Gernot. I wrote a small Blitzbasic IDE a while back using Delphi, I thought it could be easy to modify it for GLB.
Cheers,

Ian.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration.”
(E. W. Dijkstra)

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10739
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Editor Request - Code Folding
« Reply #5 on: 2006-Apr-28 »
The new update offers the possibility to remove jump marks from the list simply by writing an '@' infront of it. Get it and see if it helps you. V: 3.118

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2668
    • View Profile
Editor Request - Code Folding
« Reply #6 on: 2006-May-01 »
A nice addition,

thank you Gernot.

Ian
Cheers,

Ian.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration.”
(E. W. Dijkstra)