PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Operating mode for a multithread management
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Pops an element from a stack. The element found at the top of stack is deleted and returned in the specified variable.
Versions 18 and later
Universal Windows 10 App This function is now available in Windows Store apps mode.
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 18
Universal Windows 10 App This function is now available in Windows Store apps mode.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Universal Windows 10 App This function is now available in Windows Store apps mode.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 21 and later
Apple Watch This function is now available in Apple Watch mode.
Android This function is now available for the Android applications.
Android Widget This function is now available in Android Widget mode.
Java This function is now available for the Java applications.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Apple Watch This function is now available in Apple Watch mode.
Android This function is now available for the Android applications.
Android Widget This function is now available in Android Widget mode.
Java This function is now available for the Java applications.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Apple Watch This function is now available in Apple Watch mode.
Android This function is now available for the Android applications.
Android Widget This function is now available in Android Widget mode.
Java This function is now available for the Java applications.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
MyStack is Stack of int

// Push the values 1, 2 and 3
Push(MyStack, 1)
Push(MyStack, 2)
Push(MyStack, 3)

// Display the trace: 3, 2, 1
x is int
WHILE Pop(MyStack, x) = True
Trace(x)
END
Syntax

Retrieving the element at the top of stack Hide the details

<Result> = Pop(<Stack Name> [, <Element>])
<Result>: Boolean
  • True if the element was dequeued,
  • False if the stack is empty.
<Stack Name>: Stack
Name of Stack variable to use.
<Element>: Type of elements handled by the stack, optional parameter
Name of variable into which the value of the popped element is returned. If this parameter is not specified, the element is popped but its value is not retrieved.

Retrieving the element at the top of stack (multithread syntax) Hide the details

<Result> = Pop(<Stack Name> [, <Element> [, <Options> [, <Time-out>]]])
<Result>: Boolean
  • True if the element was dequeued,
  • False if the time-out is exceeded (<Time-out> parameter) or if ..AdditionCompleted becomes True.
<Stack Name>: Stack
Name of Stack variable to use.
<Element>: Type of elements handled by the stack, optional parameter
Name of variable into which the value of the popped element is returned. If this parameter is not specified, the element is popped but its value is not retrieved.
<Options>: Optional Integer constant
Option for stack management:
WaitIfEmptyWaits for an element to be added into the stack by another thread.
<Time-out>: Optional integer
Maximum time-out 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,
  • Versions 23 and later
    the direct indication of duration (1 s or 10 ms for example).
    New in version 23
    the direct indication of duration (1 s or 10 ms for example).
    the direct indication of duration (1 s or 10 ms for example).
This parameter corresponds to the Infinite constant by default (no maximum time-out).
Remarks

Operating mode for a multithread management

If the stack is empty, Pop waits for an element to be added into the stack. The maximum time-out can be specified by the <Time-out> parameter.
The function returns True if an element was popped, False if the time-out is exceeded or if ..AdditionCompleted becomes True.
..NbPendingThread returns the number of pending threads.
The assignment of ..AdditionCompleted to True provokes the end of the time-out for all the pending threads. In this case, Pop returns False.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230vm.dll
Windows Mobile wp230vm.dll
Java wd230java.jar
Linux wd230vm.so
Android wd230android.jar
Minimum required version
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment