|
| [WD19] Selecting all text with ..Cursor and ..CursorEnd. |
| Iniciado por guest, 13,abr. 2015 18:59 - 4 respuestas |
| |
| | | |
|
| |
| Publicado el 13,abril 2015 - 18:59 |
I have a procedure that handles an error when necessary. It runs the trtEnter process of a comboBox. The code runs and I attempt to select all using this code:
SetFocus(MySelf) LOOP_TransportationParameters.EDT_DestinationAddress..Cursor = 1 LOOP_TransportationParameters.EDT_DestinationAddress..CursorEnd = Length(EDT_DestinationAddress) + 1 RETURN However it doesn't work although it works fine on other forms. I can even add the above code to a test button, and it will work to select all. Is this a bug? Does it have something to do with being inside a looper? SetFocus works regardless, but ..Cursor and ..CursorEnd only work on the test button. |
| |
| |
| | | |
|
| | |
| |
| Publicado el 13,abril 2015 - 19:36 |
Hi Curtis,
I think you must address the line number, like LOOP_TransportationParameters[__line_number__].EDT_DestinationAddress
Best regards, Alexandre Leclerc |
| |
| |
| | | |
|
| | |
| |
| Publicado el 13,abril 2015 - 19:50 |
| Unfortunately that causes an error. And that code works if I just place it on a text button. |
| |
| |
| | | |
|
| | |
| |
| Publicado el 13,abril 2015 - 20:22 |
Hi Curtis,
the principle of loopers is to ALWAYS use attributes and NEVER address directly the controls.
So your code LOOP_TransportationParameters.EDT_DestinationAddress..CursorEnd should NOT work...
Normally, you would have to create two attributes, one for the cursor property and the other for the cursorend property, IF these are available in a looper (I've never checked)
If not, you can try creating an attribute on the EDT_De... field itself and see if ..CurosrEnd is available on it, but I doubt it.
Best regards |
| |
| |
| | | |
|
| | |
| |
| Publicado el 13,abril 2015 - 21:02 |
Hi Curtis,
What is your error message? Also I'm not sure SetFocus would work in that case. Also, you for Length() you must use the ..Value property in that case or use the corresponding attribute.
This is an official way to access controls in a looper to interact with them and their properties. See this page: <a class="ExternalLink" rel="nofollow" target="_blank" href="http://doc.windev.com/en-US/?1013284">http://doc.windev.com/en-US/…</a>
It depends what you want to do. In some cases you must use attributes, in other cases you can use direct access (usually for properties).
Best regards, Alexandre Leclerc |
| |
| |
| | | |
|
| | | | |
| | |
|