Solved

Handling large strings in the editor of the IDE.

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

828 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