[PB] How does one trigger a custom event with parameters?

Source: Internet
Author: User
Tags argumentlist

When using code to trigger an event, you can use the triggerevent ()/Postevent () function ()

When a custom event with parameters is triggered, it is best to do the following:

Syntax:

Objectname. {trigger | post} {static | dynamic} EVENT EventName ({argumentlist })

Where:

Objectname is the object name of the event object.

You can select either Trigger or Post. The default value is Trigger. trigger indicates that the specified event is executed immediately, and then the code after the statement is executed. Post indicates that the event is placed in the event queue of the object, and then the code after the statement is executed, it is determined by the operating system when the event processing program of the event is executed.

Only one Static/Dynamic can be selected. The default value is Static. static indicates that the specified event must exist during compilation, and the system checks the return value type. Dynamic indicates that the specified event does not exist during compilation. The system checks the return value type until the application is running.

EVENT is a keyword, indicating that EventName is an EVENT name, not a function.

Argumentlist is an event parameter list. Multiple parameters are separated by commas.

In the preceding syntax format, the order of {Trigger | Post}, {Static | Dynamic}, and EVENT can be rotated randomly. Braces indicate that this component can be omitted.

Example: w_main.trigger event ue_dellimit (0)

The preceding statement triggers the Custom Event ue_dellimit of the w_main window object. The event parameter is 0, and the keyword Static/Dynamic is omitted. The default value is Static.

Triggerevent/Postevent can also be used, but for different purposes, Triggerevent/Postevent can be included in the parameter, but the parameter is saved to WordParm/LongParm in the Message of the global object.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.