Please enable JavaScript to view this site.

thinBasic Help Manual

* * HELP & MANUAL PREMIUM PACK 4 DEMO VERSION * *

This documentation was styled with a demo skin from the Premium Pack 4 add-on for Help & Manual. The contents of the skin are encrypted and not configurable. You can only publish HM projects with this skin. You cannot edit it or change it.

This version is copyright and may only be used for local testing purposes. It may not be distributed.

Please purchase the full version of the Premium Pack to get the configurable skins and remove this notice. The package will also include the Toolbox configuration utility for Premium Pack skins.

 

Description

 

Process pending window or dialog messages for MODELESS dialogs.

If there are no pending messages, DIALOG DOEVENTS pauses execution of the current thread for msSleep milliseconds time.

 

Syntax

 

DIALOG DOEVENTS [msSleep] [TO Counter]

 

Returns

 

None

 

Parameters

 

Name

Type

Optional

Meaning

msSleep

Number

No

Number of milliseconds current thread will be paused.

If not specified, 1 millisecond will be assumed.

Counter

Variable

Yes

A numeric variable that will receive the number of active dialogs

 

Remarks

 

DIALOG DOEVENTS is usually used to create a "message pump" for modeless dialogs.

 

If the optional TO clause is included, the number of active dialogs is returned in the Counter variable, once all of the pending messages have been processed.

 

Restrictions

 

The DIALOG DOEVENTS loop must run for the duration of the modeless dialog(s), or they will not respond correctly.

 

See also

 

Examples

 

'----------------------------------------------------

'---Single modeless dialog message pump example.

'---(Assume dialog already created with DIALOG NEW ...)

'----------------------------------------------------

  DIALOG SHOW MODELESS hDlg Call DlgCallback

  Do

    DIALOG DOEVENTS 0 To Count&

  Loop While Count&

  ' Application code continues here...

'----------------------------------------------------

 

 

'----------------------------------------------------

'---Multiple modeless dialog message pump example.

'---In some applications, the number of modeless dialogs can vary,

'---we want to break the message loop when the 'main' dialog is closed.

'---(Assume dialogs already created with DIALOG NEW ...)

  DIALOG SHOW MODELESS hMainDlg Call DlgCallback

  DIALOG SHOW MODELESS hChildDlg1

  DIALOG SHOW MODELESS hChildDlg2

  ...

  Do

    DIALOG DOEVENTS

    DIALOG Get SIZE hMainDlg To x, x

  Loop While x       '---When x = 0, dialog has ended

  ' Application code continues here...

'----------------------------------------------------

 

 

Created with Help+Manual 8 and styled with Premium Pack Version 4 © by EC Software