Solved

Delphi 5 - TString

Posted on 2001-07-19
4
713 Views
Last Modified: 2011-10-03
In my Delphi 5 App, I have 2 Controls a Ttable and a TQuery.

I need to retreive the value stored also in Ttable.Filter and in Tquery.Sql properties.

I know both properties store Tstring type data.

Now, the problem is that both properties have assigned strings that contain hard-return (return carriage + line feed). I need to remove those 'characters' from the the Tstring in order to display the values in one single long line (label).

I would appreciate it very much if somebody could give me a hand with this one ASAP.

Milton.
0
Comment
Question by:miltonrodrigueza
  • 2
4 Comments
 
LVL 13

Expert Comment

by:Epsylon
ID: 6299445
TTable.Filter is not a stringlist.

To remove the CrLf:

Label1.Caption := StringReplace(TQuery.sqlListBox1.Items.Text, #13#10, ' ', [rfReplaceAll]);
0
 
LVL 13

Accepted Solution

by:
Epsylon earned 75 total points
ID: 6299451
Oops, something went wrong with copy/paste  :o)

Label1.Caption := StringReplace(Query1.SQL.Text, #13#10, ' ', [rfReplaceAll]);
0
 
LVL 1

Expert Comment

by:alx512
ID: 6301109
Why you want to display SQL text in TEdit?
Use TMemo component for this purpose.

Memo1.Lines.Assign(Query1.SQL);
0
 

Author Comment

by:miltonrodrigueza
ID: 6301314
Epsylon,

Hereby I am accepting your answer since it did work properly and indeed it does what I need it to do.

You very well deserve the 75 points. Thanks a lot,

Milton
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

770 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