Solved

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

Posted on 2006-10-24
3
446 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
  • 2
3 Comments
 
LVL 10

Expert Comment

by:wildzero
Comment Utility
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
Comment Utility
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
Comment Utility
Many thanks wildzero.

Your help is greatly appreciated.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now