{{tag>category:"OpenInsight 32-Bit" author:"Don Muskopf" author:"Donald Bakke"}}
[[https://www.revelation.com/the-works|Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community]]
==== Using SELECTION property (OpenInsight 32-Bit) ====
=== At 03 JAN 2005 05:46:57PM Don Muskopf wrote: ===
I am trying to use a stored procedure to select all the text in an EDITLINE control on the GOTFOCUS event. If I run the event handler below, it works correctly. All text is hi-lighted.
Declare Function Set_Property
AllText=1:@fm:65534
RtnSelection=Set_Property(ctrlEntId, "SELECTION", AllText)
RETURN 0
However, if I run the following stored procedure, either as an Event or as a Quickevent, it does NOT work correctly. No text is hi-lighted.
Declare Function Set_Property
ControlName=Get_Property(@window, "FOCUS")
AllText=1:@fm:65534
RtnSelection=Set_Property (@window : '.ControlName', "SELECTION", AllText)
RETURN 0
RtnSelection returns null. ControlName is returned correctly.
Does anyone know how to do this in a stored procedure?
Thanks.
----
=== At 03 JAN 2005 06:40PM Donald Bakke wrote: ===
Don,
The problem is in your code. First, you are using @Window before the ControlName variable which is redundant since ControlName will already contain the fully qualified control entity ID (i.e. Window.Control). Your other problem is that you have quotes around the ControlName variable so it will be treated as a literal. Here is the modified code that should work:
Declare Function Set_Property
ControlName=Get_Property(@window, "FOCUS")
AllText=1:@fm:65534
RtnSelection=Set_Property (ControlName, "SELECTION", AllText)
RETURN 0
dbakke@srpcs.com
[url=http://www.srpcs.com]SRP Computer Solutions, Inc.[/url]
[img]http://www.srpcs.com/srpicon1.gif[/img]
----
=== At 03 JAN 2005 08:18PM Don Muskopf wrote: ===
Thanks, Don. It works fine now.
[[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=WORKS_READ&SUMMARY=1&KEY=5D2E3305BB17917A85256F7E007D25E9|View this thread on the Works forum...]]