Previous Topic: SRVOPS()

Next Topic: SUBMIT()

STACKINF()

Use the STACKINF() function to return and modify information about the current contents and status of a stack.

Syntax

The STACKINF() function has this syntax:

Form 1:

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

Form 2:

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

Form 3:

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

Arguments

The STACKINF() function takes these arguments:

value

Requested information (or error text).

return

Specify one of these values:

QSTACK

Returns the current NEWSTACK number. This is 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. This is 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

Stack's current size limit 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

Stack's current size limit 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 may be contained in the stack. Including kbytes sets the amount.

kbytes

Maximum storage that may be occupied by the stack. 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

The stack is private.

PUBLIC

The stack is fully accessible for external operations.

QUEUE

The stack can have data queued to it externally. This is a subset of WRITE.

READ

The stack can be read externally.

RQUEUE

The stack can be read from and queued to by external functions.

WRITE

The stack can be written to externally. This also implies QUEUE.

ACCESS

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

Return Codes

The STACKINF() function produces these 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 */