My skills are limited and my brain is not flexible enough.
There are deficiencies in the algorithm.
The function mentioned by the poster has been implemented and I have been studying it for a while.
However, all line breaks must be removed. If there is no problem with browsing, it may be aesthetically defective.
This is still a logical algorithm problem, so I won’t think about it too deeply.
When I saw your question, I actually wanted to try to see if I could achieve this function. . Also the first time to try. Haha
Now that I have tried it, let me give it a try by the way.
Attached is the code for reference:
. Version 2
. Support library eAPI
. Support library spec
. Assembly window assembly 1
. Assembly variable A, integer type
.Subroutine_Button 1_is clicked
.The row where the local variable cursor is located, integer type
.The total number of rows of local variables, integer type
.Local Variable FG, text type, , "0"
. Local variable text length, integer type
Edit box 1. content = sub-text replacement (edit box 1. content, #newline symbol, "", , , true)
FG = Split text (edit box 1. content, #newline character, )
Edit box 1. Get focus ()
Simulate keys (# lower cursor key, , )
Edit box 1. Number of selected characters = 0
Total number of lines = Edit box 1. Send message (186, 0, 0)
The line where the cursor is = Edit box 1. Send information (201, A, 0)
Text length = Edit box 1. Send information (193, Edit box 1 .Send information (187, cursor line, 0), 0)
Processing event ()
Debug output (edit box 1. Starting selection position)
Edit box 1. Starting selection position = A
Edit box 1. Number of selected characters = Text length
A = A + Edit box 1. Number of selected characters
.Subroutine_Edit box 1_The left mouse button is pressed, logical type
.Parameter horizontal position, integer type
.Parameter vertical position, integer Type
. Parameter function key status, integer type
A = 0
Can any expert solve the problem of line wrapping, because automatic line wrapping is set in the edit box? The text length after
When it exceeds the width of the edit box, it will automatically start a new line, but no line breaks will be added, and there are artificial line breaks in the text
So when editing Box 1. The judgment on the statement of starting selection position is in trouble.
It’s too late to talk about this. Ha
Just to add, the poster can just change it to his own corresponding control. A button and an edit box.
But the code must be written. Don't forget that the edit box is left clicked with A = 0. Don't pull it down
This code still has some shortcomings
Go to sleep. . . . . . .
Hey poster. Have you ever tried beating me for so long?
Group A: Atletico Madrid, Juventus, Olympiacos, Malmo
Group B: Real Madrid, Basel, Liverpool, Ludo Gorec.
Group C: Benfica, Dzenit, Leverkuse