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 11 APR 2010 10:05:36PM Joh Hartog wrote:

Hi there,

I have a bit of code that needs to do one extra thing. The code is below. Besides opening another window, this click event (of a button) also needs to write to another prompt in the same table. I've put what I need in between the code.

Declare subroutine set_property, char

Declare function get_property

Declare subroutine START_WINDOW

text=get_property(CtrlEntId,"TEXT")

length=len(text)

letter=textlength,-1 /*gets the last character of text on button (the letter)*/

wholevalue=@id:letter


At this point the variable 'wholevalue' should be written to a prompt called Image_ID in the same table, before carrying out the Start_Window command. I know this needs to be done with the Get_property and Set_property commands, but cannot make it work.


If Len(wholevalue) then

Start_Window('PAC_IMAGE_DISPLAY',@window,wholevalue)

end

RETURN 0


At 11 APR 2010 11:19PM David Goddard wrote:

G'day Joh,

Does this do what you require

void=set_property(@window:".IMAGE_ID","DEFPROP",wholevalue)

regards

Dave G


At 12 APR 2010 12:20AM Colin Rule wrote:

Your call for the Start window

 Start_Window('PAC_IMAGE_DISPLAY',@window,wholevalue)

Is passing the variable to the form.

From this I expect you want the form to pick this up.

If so, in the create event of the form, you can pick up the variable PARAM1 and deal with it.

If this create event calls a procedure, you need to put the string '@PARAM1' as this example, in single quotes to be able to pass it and pick it up.

If I have misunderstood, a little more explanation of the aims would help.

Colin


At 12 APR 2010 09:46AM Joh Hartog wrote:

Hi David,

No, that line has no effect. The window opens as normal and the wholevalue variable does become the ID of the other table, but the value of the variable 'wholevalue'(ie. 12654a - made up of the id of the record I'm working on + an appended letter) is not written to the IMAGE_ID prompt in the current row. Any other ideas?

Cheers

Joh


At 12 APR 2010 09:51AM Joh Hartog wrote:

Hi Colin,

Yes the Start_window is passing the variable to the form, that bit works fine. But I also want that variable written to a prompt in the current record I am working on. This should/can happen before the window is opened and is a separate action. Does that make sense? David Goddard suggests:

void=set_property(@window:".IMAGE_ID","DEFPROP",wholevalue)

but that doesn't yet do the trick. Any suggestions?

Cheers

Joh


At 12 APR 2010 10:29AM Sean FitzSimons wrote:

Joh,

At what point in time do you send the WRITE event to the existing window. Is it prior to or after the call to Start_Window(). It may be the sequence of events that need review.

Sean


At 12 APR 2010 06:33PM Joh Hartog wrote:

Sorry David. I made a small error. This line of code works perfectly. Thanks a lot.

Cheers

Joh


At 12 APR 2010 06:34PM Joh Hartog wrote:

Thanks Sean. I made it work okay after correcting a small error.

Cheers

Joh


At 12 APR 2010 06:35PM Joh Hartog wrote:

Hi Colin,

Got it all to work now. Thanks for your input.

Cheers

Joh

View this thread on the Works forum...

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