?
Solved

Handling large strings in the editor of the IDE.

Posted on 1999-01-22
3
Medium Priority
?
177 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
[X]
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
3 Comments
 
LVL 20

Accepted Solution

by:
Madshi earned 40 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month11 days, 16 hours left to enroll

752 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