ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Queue, stack, list and array functions / Queue, stack and list functions
  • Operating mode for a multithread management
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Removes an element from the queue. The element is removed from the queue and returned in the specified variable.
Example
MyQueue is Queue of int
 
// Enqueues the values 1, 2 and 3
Enqueue(MyQueue, 1)
Enqueue(MyQueue, 2)
Enqueue(MyQueue, 3)
 
// Display the trace: 1, 2, 3
x is int
WHILE Dequeue(MyQueue, x)
Trace(x)
END
Syntax

Retrieving the element at the beginning of the queue Hide the details

<Result> = Dequeue(<Queue> [, <Element>])
<Result>: Boolean
  • True if the element was removed from the queue,
  • False if the queue is empty.
<Queue>: Queue
Name of the Queue variable to be used.
<Element>: Type of elements handled by the queue, optional parameter
Name of the variable in which the value of the removed element is returned. If this parameter is not specified, the element is removed but its value is not retrieved.

Retrieving the element at the beginning of the queue (multithread syntax) Hide the details

<Result> = Dequeue(<Queue> [, <Element> [, <Options> [, <Timeout>]]])
<Result>: Boolean
  • True if the element was removed from the queue,
  • False if the timeout is exceeded (<Timeout> parameter) or if AdditionCompleted becomes True.
<Queue>: Queue
Name of the Queue variable to be used.
<Element>: Type of elements handled by the queue, optional parameter
Name of the variable in which the value of the removed element is returned. If this parameter is not specified, the element is removed but its value is not retrieved.
<Options>: Optional Integer constant
Queue options:
WaitIfEmptyWaits for an element to be added to the queue by another thread.
<Timeout>: Optional integer or optional Duration
Maximum timeout expressed in hundredths of a second. This parameter can correspond to:
  • an integer corresponding to the number of hundredths of a second,
  • a Duration variable,
  • the duration in a readable format (e.g., 1 s or 10 ms).
This parameter corresponds to the Infinite constant by default (no maximum timeout).
Remarks

Operating mode for a multithread management

If an element is in the queue, it is removed from the queue and returned by the <Element> parameter by reference.
If the queue is empty, Dequeue waits for an element to be added to the queue. The maximum timeout can be specified by the <Timeout> parameter.
The function returns True if an element has been removed from the queue. Otherwise, it returns False if the timeout has been reached or if the AdditionCompleted property is set to True.
NbPendingThread returns the number of pending threads.
The assignment of AdditionCompleted to True provokes the end of the timeout for all the pending threads. In this case, Dequeue returns False.
Component: wd290vm.dll
Minimum version required
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help