Solved

Handling large strings in the editor of the IDE.

Posted on 1999-01-22
3
172 Views
Last Modified: 2010-04-06
Hi experts,

is it possible to split very long lines of code within the editor of my IDE ?

To write down a string like


 s := 'This is a sample string which should be examined by the experts in order to demonstrate which result I want if I split a string.';

does not improve the readability of of sources.

But when I split this string into 2 lines, Delphi complains about an unterminated string which can't be compiled.

In Visual Basic you can solve this by adding an underscore at the end of a line:

s := 'This is a sample string which should be examined by_      the experts in order to demonstrate which_
     result I want if I split a string.';

Is there an equivalent in Delphi for doing this?

With kind regards

Mathes
0
Comment
Question by:mathes
3 Comments
 
LVL 20

Accepted Solution

by:
Madshi earned 10 total points
ID: 1362923
Hi Mathes,

of course, just write
  s1:='This is a sample string which should be examined by '+
      'the experts in order to demonstrate which '+
      'result I want if I split a string.';
If you want to have hard line breaks in the text, use this:
  s1:='This is a sample string which should be examined by '+#$D#$A+
      'the experts in order to demonstrate which '+#$D#$A+
      'result I want if I split a string.';

Regards, Madshi.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1362924
madshi is right :-)

meikl
0
 

Author Comment

by:mathes
ID: 1362925
Thank you, this is exactly what I was looking for.

With kind regards

Mathes
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

815 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

8 Experts available now in Live!

Get 1:1 Help Now