Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 490
  • Last Modified:

Delete first line of memo if it is blank (250 points)?

This may be simple but it's been a hard day!

If the first line of a memo is blank, how do I delete it?

I am using Delphi 6. Many thanks for your help.
0
rincewind666
Asked:
rincewind666
  • 2
1 Solution
 
wildzeroCommented:
If memo1.lines.count > 0 then
  If memo1.lines[0] := '' then
    memo1.lines.delete(0);

I think thats it.
0
 
wildzeroCommented:
Even
If memo1.lines.count > 0 then
  If trim(memo1.lines[0]) = '' then
    memo1.lines.delete(0);

would be better just incase someone has put a space in that first line.

oh yea and it's = not := on the second line :P
0
 
rincewind666Author Commented:
Many thanks wildzero.

Your help is greatly appreciated.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now