Solved

Handling large strings in the editor of the IDE.

Posted on 1999-01-22
3
175 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 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…

736 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