%push() Function

Top  Previous  Next

CScript supports stack functionality by means of push() and pop() functions

%push() function inserts a new value to the stack and makes it the current value.

Syntax:

@push(stack-name, expression)

 

stack-name

The name of the stack

expression

The expression whose evaluated result to be inserted to the stack.

 

Examples:

%push(X,'AA')

%push(X,'BB')

%vof(X)       %// Returned value : 'CC'

%pop(X)

%vof(X)       %// Returned value : 'BB'

%pop(X)

%vof(X)       %// Returned value : ''

 

Please note that the current value of the stack is accessed by the %vof() function. CScript does not provide a peek() function.

 

See %pop() function.