Previous Topic: SRVOPS()Next Topic: SUBMIT()


STACKINF()

This function returns and modifies information about the current contents and status of a stack.

Syntax

Form 1:

value = STACKINF(return,[stack],[owner])

Form 2:

curvalue = STACKINF(MAXBYTE,[stack],[owner],[kbytes])

Form 3:

acctype = STACKINF(ACCESS,[stack],[owner])

Parameters

value

Requested information (or error text).

return

Specify one of these values:

QSTACK

Returns the current NEWSTACK number. The number of times that the NEWSTACK
command has been issued against this stack less the number of times the DELSTACK command was issued.

QBUF

Returns the current buffer number. The number of times that the MAKEBUF command has been issued against this stack less the number of times the DROPBUF command was issued.

QELEM

Returns the number of stack records in the current buffer, as determined by the MAKEBUF command.

QUEUED

Returns the total elements on the stack. This option functions exactly like the QUEUED() function.

STACKS

Returns a string consisting of all currently existing stack numbers. The numbers are blank-delimited, and are listed in ascending order.

stack

Number of the stack to be referenced.

Default: If stack is omitted and a local stack is referenced, the current stack (as set by SWAPSTAK()). If stack is omitted and an external stack is referenced, the value set by the owning IMOD task using the PUBSTACK(DEFAULT) function.

owner

The current size limit for stack in k-bytes. If kbytes is omitted, curvalue returns the current setting. If kbytes is specified, curvalue equals kbytes. To convert curvalue to bytes, multiply by 1024.

curvalue

The current size limit for stack in k-bytes. If kbytes is omitted, curvalue returns the current setting. If kbytes is specified, curvalue equals kbytes. To convert curvalue to bytes, multiply by 1024.

MAXBYTE

Returns or sets the maximum amount of data that can be contained in the stack. Including kbytes sets the amount.

kbytes

Maximum storage that the stack can occupy. This value is specified in k-bytes and is multiplied by 1024 to obtain the actual storage limit.

acctype

One of these values is returned:

PRIVATE

Stack is private.

PUBLIC

Stack is fully accessible for external operations.

QUEUE

Stack can have data queued to it externally. A subset of WRITE.

READ

Stack can be read externally.

RQUEUE

Stack can be read from and queued to by external functions.

WRITE

Stack can be written to externally. This also implies QUEUE.

ACCESS

Returns the access status, as set by PUBSTACK().

Return Codes

101 - 104

ARG n MISSING OR INVALID

125

SPECIFIED IMOD NOT FOUND

126

STACK NOT SPECIFIED AND NO DEFAULT

127

REQUESTED STACK DOES NOT EXIST

Example

recs = stackinf('queued')          /* Determine total stack
                                      records */
status = stackinf('access',,123)   /* Determine public status of
                                      default stack owned by IMOD
                                      123 */
list = stackinf('stacks')          /* Obtain list of all active
                                      stacks */
list = stackinf('stacks',,123)     /* Obtain list of all active
                                      stacks belonging to IMOD
                                      123 */