## Is there a way to get code to disappear and function

Please discuss general Delphi programming topics here.

### Is there a way to get code to disappear and function

I have all this code that I really can't put in a function and has to be in the main. Is there a way I can clear all this out so that it will performs, but I don't see it?

Thank you,
Christine
Christine123
Junior Member

Posts: 25
Joined: May 28th, 2007, 10:28 pm

Everything is possible, you just have to get the way... besides we don't know what we're dealing with, so first please, enlighten us.
Thou shalt write the code, not connect the bricks.
Johnny_Bit
VIP Member

Posts: 455
Joined: June 15th, 2003, 9:56 am

thank you for the reply johnny. Here's what I mean.

This is an example of the code I have
Code: Select all
begin  x := x + 1; y := y + 2; z := sqr(x + y);writeln(z);end;

This is what I want my code to look like. Where the [ ]'s are just an indication that some code is there. I know in a unit you can minimize the interface section, where one way you see a whole bunch of code and the other way you just see a small box. When you click inside the box then you can see the code contained within. I hope that is clear

Code: Select all
begin[    ]writeln(z);end;
Christine123
Junior Member

Posts: 25
Joined: May 28th, 2007, 10:28 pm

You mean code-folding.
Some advanced editors support this.
I am not sure if one of the later delphi edition does it.
Hans-Peter
HPW
Moderator

Posts: 236
Joined: February 25th, 2006, 10:19 am
Location: Germany

so probably delphi 2006 professional won't have it
Christine123
Junior Member

Posts: 25
Joined: May 28th, 2007, 10:28 pm