Solved

Handling large strings in the editor of the IDE.

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

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

13 Experts available now in Live!

Get 1:1 Help Now