Solved

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

Posted on 2006-10-24
3
458 Views
Last Modified: 2010-04-05
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
Comment
Question by:rincewind666
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 10

Expert Comment

by:wildzero
ID: 17798722
If memo1.lines.count > 0 then
  If memo1.lines[0] := '' then
    memo1.lines.delete(0);

I think thats it.
0
 
LVL 10

Accepted Solution

by:
wildzero earned 250 total points
ID: 17798738
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
 

Author Comment

by:rincewind666
ID: 17799289
Many thanks wildzero.

Your help is greatly appreciated.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question