Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Memo Box equals Null

Status
Not open for further replies.

gforrest

Programmer
Apr 26, 2000
39
CA
Hi,

Quick question. I'm want to know if a memo box is empty (i.e. equals a null value) I tried using:

if EdtLgMb.Lines = '' then

but I get a error telling me that Strings and TStrings are incompatible.

How do I get around this?

Thanks.
 
Try:

edtLgMb.Lines.Count = 0

For more information, carefully review the description of the Lines property in the Help file. It should contain a link to the class in question.

Remember: Lines is tStrings descendent, which means that it's really an array of string pointers. As such, to access the specific lines in a memo, the index is zero based, e.g. Line 1 is Lines[ 0 ].

Also, keep in mind that this only tells you if there aren't any lines; if the memo contains a blank line, you'll get a 1 from from this.

Hope this helps...

-- Lance
 
All memos have a text property. Use it.

if Trim(Memo1.Text)='' then ShowMessage('Memo is Empty');
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top