Jump to content
emileverh

String literals more then 255 chars

Recommended Posts

1 hour ago, Kas Ob. said:

but we can control the compiler to handle the encoding as literal in the generated binary

of course we can, where is the problem?

image.thumb.png.1e2ba7bfca1aa353d4b688c3784a00a8.png

Share this post


Link to post
24 minutes ago, Attila Kovacs said:

of course we can, where is the problem?

image.thumb.png.1e2ba7bfca1aa353d4b688c3784a00a8.png

Are you low on caffeine ?

This is not the point of talk, i want what on the text to be converted at build/compile time to different codepage or encoding, like i want my constant multi line string to be an ansistring or/with specific code page no matter what the source file encoding was.

I want to ditch using resource file with resource editor to add my long multiline scripts in an exe instead without losing the visibility and readability of them due the ',+ and #13#10 on every line and without adding spaces, i want to see them in the IDE as they are.

 

Same goes for HTML code.

Share this post


Link to post
12 hours ago, Rollo62 said:

if you want "line" breaks, you should be able to define what kindof ( None, Space, CrLf, Lf, Cr, ...).

:classic_wink:

 

10 hours ago, Attila Kovacs said:

I'm laughing my pants off at your suggestion to support multiple encodings and line endings in one text file.

The line breaks in the code is always CR/LF as that is Windows standard, but you can define the line breaks that the compiler uses to make a string out of it. As string is always Unicode, there is nothing to define. Whatever you need the string for has to take care that it is converted to the correctly encoded byte sequence.

 

It seems that quite some part of this discussion is missing the target. The feature is about line breaks inside string literals, which previously could only be created by concatenating strings and line breaks. The new syntax allows an easier way to write (and paste) with the benefit of better readability.

 

And finally, if someone doesn't like it there is no obligation to use it.

Share this post


Link to post
5 minutes ago, Uwe Raabe said:

The line breaks in the code is always CR/LF as that is Windows standard, but you can define the line breaks that the compiler uses to make a string out of it. As string is always Unicode, there is nothing to define. Whatever you need the string for has to take care that it is converted to the correctly encoded byte sequence.

Aham, and whats about diffent platforms? is it possible to set up the line break with directives?

Share this post


Link to post

I will try to reveal not too much, but I expect these questions to have satisfying answers with the release.

Share this post


Link to post
On 9/21/2023 at 10:25 AM, Attila Kovacs said:

... It's already pretty strange, ...

I never said anything different, and I dislike the ugliness in the same way.

 

But you must agree, that the usefulness of such configurable addition of string structures would be a great thing.

Now you only can do this conversion part by external tools BEFORE design time and need additional correction DURING runtime, or

you convert strange structures strings DURING runtime.

 

My point is, if Embarcadero puts a lot of effort into multi-strings, then I'm asking what main purpose this should solve ?

With a little extra effort, this could be maybe usable in a lot of cases, like (JSON, HTML, XML, Python, whatsoever ).

This is intended as a brain teaser, I'm not asking for any of these additions.

 

I'm afraid, this soon will end into the same pro- and contra discussions, as for the inline variables.

 

Edited by Rollo62

Share this post


Link to post
18 minutes ago, Rollo62 said:

then I'm asking what main purpose this should solve

I know it! All the SQL queries go there. Nobody else needs this.

  • Thanks 1

Share this post


Link to post
22 minutes ago, Rollo62 said:

My point is, if Embarcadero puts a lot of effort into multi-strings, then I'm asking what main purpose this should solve ?

 

That's easy. The only reason is that they can say that finally managed to copy it from other languages. Lately that's the only driving force behind the R&D.

  • Like 1

Share this post


Link to post
13 minutes ago, Attila Kovacs said:

I know it! All the SQL queries go there. Nobody else needs this.

No, there are other kinds of strings where this could be usefull, e.g. JSON or CSV data for e.g. unit tests.

Share this post


Link to post
9 minutes ago, Lajos Juhász said:

 

That's easy. The only reason is that they can say that finally managed to copy it from other languages. Lately that's the only driving force behind the R&D.

To be honest, that is also the only driving force behind change requests (language XY has it) as well - hyperbolically speaking.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×