Skip to content

Commit 3340ed2

Browse files
Add tips and tricks section
1 parent b93b112 commit 3340ed2

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

tools/h2paswizard/README.MD

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,43 @@ Otherwise the settings file is not recognized.
3333

3434
*Important:* The results are not perfect, they must always be revised.
3535

36+
## Tips and Tricks
3637

38+
### Lazarus: Use block selection for comments
3739

40+
Often in C there are comments after each of several lines of code. E. g. for
41+
every entry of an enum there is an explaining comment. If you use H2Paswizard it
42+
will copy all the comments above the actual translated enum entries.
43+
44+
```
45+
typedef enum
46+
{
47+
SDL_JOYSTICK_POWER_EMPTY, /* <= 5% */
48+
SDL_JOYSTICK_POWER_LOW, /* <= 20% */
49+
SDL_JOYSTICK_POWER_MEDIUM, /* <= 70% */
50+
SDL_JOYSTICK_POWER_FULL, /* <= 100% */
51+
} SDL_JoystickPowerLevel;
52+
```
53+
54+
will end up as something similar to
55+
56+
```
57+
const
58+
{* <= 5% *}
59+
{* <= 20% *}
60+
{* <= 70% *}
61+
{* <= 100% *}
62+
SDL_JOYSTICK_POWER_EMPTY = 0;
63+
SDL_JOYSTICK_POWER_LOW = 1;
64+
SDL_JOYSTICK_POWER_MEDIUM = 2;
65+
SDL_JOYSTICK_POWER_FULL = 3;
66+
```
67+
68+
A simple select, cut and paste of the comment block will not work here. If you
69+
paste it, it will shift all code lines below downwards. Use the block selection
70+
by selecting the comment block holding `Shift` + `Alt` + arrow keys and cut it.
71+
If you paste the comments now, they will not shift the code lines and all
72+
comments are right in place.
3873

3974

4075

0 commit comments

Comments
 (0)