Solved

Delphi 5 - TString

Posted on 2001-07-19
4
710 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

747 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

14 Experts available now in Live!

Get 1:1 Help Now