ContextStack.Pop 方法
定义
从堆栈中移除当前对象并返回其值。Removes the current object off of the stack, returning its value.
public:
System::Object ^ Pop();
public object Pop ();
member this.Pop : unit -> obj
Public Function Pop () As Object
返回
已从堆栈中移除的对象;如果堆栈中没有对象,则返回 null。The object removed from the stack; null if no objects are on the stack.
示例
下面的代码示例演示如何从中删除值 ContextStack 。The following code example demonstrates removing a value from a ContextStack.
// Pop each item off the stack.
Object^ item = nullptr;
while ( (item = stack->Pop()) != 0 )
Console::WriteLine( "Value popped from stack: {0}", item );
// Pop each item off the stack.
object item = null;
while( (item = stack.Pop()) != null )
Console.WriteLine( "Value popped from stack: "+item.ToString() );
' Pop each item off the stack.
Dim item As Object = stack.Pop()
While item IsNot Nothing
Console.WriteLine(("Value popped from stack: " + item.ToString()))
item = stack.Pop()
End While