Link to home
Start Free TrialLog in
Avatar of jbeh
jbeh

asked on

Memos and things

I have a case statement to deal with printing reports - This bit is fine.

I want to describe the report to users and I am using a Tmemo to do this.

So I have something like


radiogroup1.index of

0: begin
Fillthememocase0;
othercode;
end;
1: begin
fillthememocase1;
othercode;
end;
2: begin
fillthememocase2;
othercode;
end;
3: begin
fillthememocase3;
othercode;
end;
end;

etc,etc,etc,


I can clearly fillthememo by using memo1.lines.add('bumph');


I feel sure that there must be a tidier way.

Can I please have some thoughts on tidying this up.

This isn't a question of not being able to cope - This is a question of readability of code;

TVMIA

Regards John

ASKER CERTIFIED SOLUTION
Avatar of Stuart_Johnson
Stuart_Johnson

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kretzschmar
whats wrong with this,
it seems ok to me,
specially that you've also
othercode in each case

more readability you can get with comment-lines,
where you could describe what this case do

meikl ;-)
Avatar of jbeh
jbeh

ASKER

Looks good to me -

All this means is that I can now shuffle acres of commentary somewhere else so that I can still read my case statement sensibly -

Thanks