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

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

SRP Computer Solutions, Inc.


At 03 JAN 2005 08:18PM Don Muskopf wrote:

Thanks, Don. It works fine now.

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/5d2e3305bb17917a85256f7e007d25e9.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1