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
Solved

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

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

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

808 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