Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

.PostEvent function

573 views
Skip to first unread message

O. Steine

unread,
Nov 28, 2008, 7:20:59 AM11/28/08
to
I've tried to use the .PostEvent function as described in the PowerBuilder
Help files (PB 11).

Even though the function seems to work as intended, I do have a problem
passing values in the Message object.

- - - start of code - - - - - -
//datawindow A : Event
STRING ls_text
LONG ll_id

ls_text = 'This is a string'
ll_id = 0

parent.postevent('ue_sendit', ll_id, ls_text)
- - - - - end of code - - - -
/////////////////////////////////////////////////////
- - - start of code - - - - - -
//userobject which owns the datawindow : UserEvent
LONG ll_id
STRING ls_text
ll_id = Message.WordParm
ls_text = String(Message.LongParm, "address")
- - - - - end of code - - - -

When I enter the last event, the values from the Message object is
ll_id = 1000
ls_text = A lot of rubbish

If I debug the application I jump right from the first event to the next, so
it doesn't seem like anything is changing my Message Object .. but what else
could it be?

Mr O.


O. Steine

unread,
Nov 28, 2008, 7:21:47 AM11/28/08
to
Is there another way of calling events/functions and passing argument (or
even objects?)

"O. Steine" <ost...@gmail.com> skrev i melding
news:492fe22b@forums-1-dub...

O. Steine

unread,
Nov 28, 2008, 8:14:06 AM11/28/08
to
I'm not quite sure WHY, but it seems that the Message object is not set when
calling the UserEvent (which is on the userobject that holds the
datawindow).

So I created a userevent with arguments to pass the information...

When using the MessageObject while passing the information further on to the
window.... the MessageObject contained the expected values.

I've solved my issues, but I would like to know why the message object not
is set, .. if someone would like to enlighten me :)


"O. Steine" <ost...@gmail.com> skrev i melding

news:492fe25b$1@forums-1-dub...

Bruce Armstrong [TeamSybase]

unread,
Nov 28, 2008, 9:20:46 AM11/28/08
to

Since you're using 11, you can just declare the arguments you want as
part of the event signature. Then just post or directly call the
event and pass the arguments there

this.event post eventname ( arg1, arg2, arg3, arg4, etc. )

Chris Pollach

unread,
Nov 28, 2008, 9:22:34 AM11/28/08
to
O;

You can not depend on the information in the MO when you use a POST as
other events may still fire and change / reset the MO contents. If you use a
Trigger, OpenwithParm, OpenUserObjectWithParm, etc then the MO contents can
be trusted.

FWIW: If you have to POST, then you should use the new syntax and pass
your own structure , variables or UO reference. For example:
parent.post event ue_sendit (ll_id, ls_text)

HTH

--
Regards ... Chris
ISUG - NA RUG Director
http://chrispollach.pbdjmagazine.com


"O. Steine" <ost...@gmail.com> wrote in message
news:492fee9e@forums-1-dub...

0 new messages