Delphi plugin for pasting text constants in source code? - delphi

Inserting (pasting from clipboard) of text constants in the Delphi code editor requires some manual "postprocessing" ...
split up long text into multiple lines (and insert the string concatenation symbol)
escape quotes (replace single quotes with double quotes)
enclose the string with quotes
keep original white space (leading blanks, line feeds)
Is there a IDE plugin available which helps to reduce these manual steps?

try this expert (sorry for russian, there is a gif that shows what it can do)

Related

How to use chr() function with unicode symbols?

I know that if I want to add an ASCII character in a string like a black space, for example, all I need to do is to add with a call to CHAR(32) and the space will be added to the string.
But what if I want to put the infinite symbol ∞ (U+221E) how should I do it?
If I paste it into a literal string like 'infinite is ∞' then Delphi wants to change the file to UTF8.
Char is a data type, so Char() is a typecast, not a function. Chr() is a function.
In D2009+, you can use either:
Char($221E) or Char(8734) (in earlier versions, use WideChar() instead)
Chr($221E) or Chr(8734)
#$221E or #8734 character constants
TCharacter.ConvertFromUtf32()
TCharHelper.ConvertFromUtf32()
'∞'. There is nothing wrong with using this in code and letting the IDE decide how to save it. This is actually the preferred solution. The only time you would need to avoid this is if you are using other tools to process your source files and they don't support UTF-8 files.

margin characters in string with interpolation

Inside a string literal, the margin character (a single quote) indicates that the initial part of the line, before the margin character, should be ignored.
Is there a complementary "right-margin" character, that indicates that everything after it on the same line should be ignored?
(I realized that this would be useful when writing somewhat lengthy code inside interpolated expressions in a string. In order to make that code more readable, I would like to split it over multiple lines, but the newlines introduced that way should not be part of the string literal. And putting the newlines inside the <...> looks ugly.)
Rascal only supports ignoring left-margin characters before the single quote (') in interpolated strings. Your suggestion for also ignoring right-margin characters is interesting but currently not supported.
Since layout inside interpolations <...> is ignored you can (and have to) place all your additional layout there.

French text in vb script

HI I need to include a french text in vb script with special characters - REJETÉE.
When I add text, it appears as REJETÉE. How do I include the following?
I can use either : É or É. but it shows exceptions.
Visual basic in itself does only support ASCII characters. The 'É' is an ANSI character, thus unsupported.If you are writing to a text file, you may want to print the direct ANSI value of the character. If you now use a text editor that uses ANSI encoding, you will see the 'É' correctly.
Also, maybe the following will work as a debug output, you will have to try thou:
Debug.Print chr$(200)
You should get the 'È' character when writing the value 200. As I said, i don't know if this works in the debug printer, but when writing to text files it will work.

Yaml gotcha's, are there any issues with storing certain types of characters in Yaml?

I'm very new to yaml, and I just want to know what I can and can't store character wise in yaml?
What are the escape characters for double quotes etc?
Can I span multiple lines?
Basically, you can store everything. Quotes aren't an issue, you can type text out without quotes (and for non-printable characters that you can't incorporate casually, there are the usual escape sequences). That means purely numerical text is considered a number, though - but then again, you can add quotes or an explicit type annotation (and I assume most libraries do that when necessary), e.g. !!str 100. Also, if you want to include the comment sign (#), you have to add quotes.
Another issue is that some strings may look like more complex YAML (e.g. certain uses of exclamation signs look like casts and certain uses of colons look like singleton associative tables). You can avoid these by using "multi-line" strings that just consist of a single line. Multi-line strings exist and come in two flavors, preserving linebreaks (--- |) and ignoring newlines except for blank lines (--- >, much like markdown).

What kind of char is this and how do I convert it to a text?

What kind of char is this and how do I convert it to a text in c#/vb.net?
I opened a .dat file in notepad, took a screenshot and attached it here.
Your screenshot looks like the digits "0003" in box. This is a common way to display characters for which a glyph isn't available.
U+0003 is the "END OF TEXT" control character. It's unlikely to occur within a text file, but a ".dat" file might be a mixture of text and binary data.
You'll need to use a hex editor to find the exact ASCII code (assuming the file is ASCII, which seems to be an entirely incorrect assumption) that the file contains. It's safe to say that whatever byte sequence is contained in the file is not a printable character in whatever encoding the editor used to open the file, and that is why it used that graphic in place of the actual character.

Resources