Delphi IDE shortcut for splitting a long string - delphi

I'm using Delphi XE2. I have a really long string (580 characters) pasted into the IDE. I want to split the string so that it stays within the right margins and has the proper closing tick mark and plus sign. Is there a keyboard shortcut that will do that?
The shift + Enter shortcut allows me to do if I am typing the string but it doesn't split a string that is already on the screen.

Delphi XE2 has the ability to record Macros and play them back in your source editor. The controls are in the bottom-left, play, record, and stop.
If not already, move your string down to the next line (as in my screenshot)
Start with your cursor at the beginning of the string, after the '
Press the Record Macro button (Red circle)
Press the Right keyboard arrow key up to 2 chars before desired width
Type ' to terminate the string
Type + to continue on the next line
Press Enter to insert a line break
Type ' to begin a new string
By now you should be 1 position directly underneath where you started
Press the Stop Recording Macro button (Green square)
Press the Playback Macro button (Green triangle)
Continue pressing play until all is complete

SHIFT+ENTER only works like you want when the cursor is at the end of a line with an unclosed string literal. There is no shortcut to split a literal (with quotes and spacing) when the cursor is at the beginning or middle of it. You will have to find a third-party editor add-on that formats long string literals the way you want.

You can press "CTRL+D".... and configure it in Tools->Options->Formatter

Related

How to move cursor in Xcode smoothly?

For example like below gif
First he is type QL1("") and his cursor's position is locate after double quotes
Then how to move cursor's position between double quotes?
I know i can use arrow key,but i don't want to move my hand on keyboard
So is there have convenient way to move cursor?
Just like we can press Tab to move cursor to different parameter
You don't need to do anything. Xcode is already automatically putting that.
Just put a single double quote(")
Write whatever you want to write
Press the next arrow key (->) and the second single double quote(") will be automatically added.
Hope this helps!

Delphi XE7: disable virtual text space

is it possible to disable the annoying virtual space in editor?
If I click somewhere right on a line (behind last character) I want to get the cursor just behind the last character. Similary, if I am at the end of a line (just after the last char) and push right arrow I want to jump the next line before the first character.
Lot of thanks!

Delphi editor. Tabs instead Spaces

I use Delphi 5 and I have one interesting question...
If you press Enter key when cursor is at the string's end Delphi IDE automatically aligns cursor position at the new line to the first word at the previous line.
But space between begin of new line and cursor position will be filled with SPACE chars.
How to change this behaviour? I want some amount of TAB characters from begin of new line to the cursor position, as notepad++ do that.
Thanks
Under Environment Options → Editor:
There are some options you should check:
Use tab character. Inserts tab characters when you press TAB in the Code Editor. If not checked, pressing TAB inserts spaces. To view tab characters, select Show tab character.
Smart tab. Tabs to the first non-whitespace character in the preceding line.

Disable hotkey on vcl controls

I do have a TPageControl that I do add and remove TTabsheet's from, and in the TTabsheets there are 2 TEdit's that the user can type firstname and lastname, when they do the Tab Caption does show what they have written.
But if the user add a '&' somewhere in the TEdit (and they are allowed to do) the tab do get the char after '&' as (underlined)hotkey..
So how do I disable a hotkey on a control.
You don't need to disable keyboard access key display on the control, you just need to double the ampersand character in the tab caption to let Windows know it should be displayed as a character instead of underlining the following character.

How do you add a superscript character into a Powerbuilder textbox?

Is there any way to do this in the Powerbuilder properties window for a datawindow's textbox?
That kind of depends on how you define "textbox", but in general the only way to mix normal and superscript text is with a richtext control. In PB 11.5, you can even use richtext as a column style.
Good luck,
Terry.
Yes. For the text control, you must select a font that has superscript characters (Arial does).
Go into the Windows Character Map (usually in the start menu under Accessories->System Tools) and select your font.
Then go to the superscript character that you want to place in your text control. Click it and then click the Select button to place it down in the character map text box.
Then click the Copy button.
Now you can return to PowerBuilder and paste this value into the properties window text area.
As long as the same font is selected for the DataWindow control as was selected in the character map it should show as your superscript character.
This same techinque can be done to include any of the Wingding type characters as well.
We ended up using two separate text fields. It's a butt-ugly solution, but it works. The superscript field has a smaller font and is nudged a little higher up.
I think newer PB versions support superscripts.
Thanks for the help.
Glenn
If you go to the character map - when you select your character it will show the keys to enter this character on the bottom right of the window.
Example : in Arial font - the ® (registered) mark is Alt + 0174
To enter these, turn your numlock on, hold the alt key down, and type 0 1 7 & 4 then let up on the alt key. You have to use the number keys on the number pad to do this the ones on the top of the keyboard dont work.
You can then enter your characters directly or do something like this :
ls_key = '®'
Actually I stumbled across a simpler solution. I copied and pasted a portion of the text from a pdf into the text property of a datawindow text contol. The superscript character simply pasted in. So I'm guessing that Dougman's solution would work too.
Example:
"™Trademark used under..."
Note: I'm using PB 9.0.1
Thanks for all the help,
Glenn

Resources