Solved

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

Posted on 2006-10-24
3
451 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
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Making delphi communicate with a c# service 16 103
Delphi...Split view - idea? 1 68
How to build JSON File in Delphi 6 3 32
Installshield for Embarcadero EX 10.1 Berlin 4 40
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 my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

776 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