Postscript Operators 'b'



begin dict begin

- pushes dict on the dictionary stack, making it the current dictionary and installing it as the first of the dictionaries consulted during implicit name lookup and by def, load, store, and where.

ERRORS: dictstackoverflow, invalidaccess, stackunderflow, typecheck

SEE ALSO: end, countdictstack, dictstack

Troubleshooting index Postscript Index


bind proc bind proc
replaces executable operator names in proc by their values. For each element of proc that is an executable name, bind looks up the name in the context of the current dictionary stack as if by load. If the name is found and its value is an operator object, bind replaces the name by the operator in proc. If the name is not found or its value is not an operator, bind does not make a change.

For each procedure object in proc, bind applies itself recursively to that procedure, makes the procedure read-only, and stores it back into proc. The bind operator applies to both arrays and packed arrays, but it treats their access attributes differently. It will ignore a read-only array; that is, it will neither bind elements of the array nor examine nested procedures. On the other hand, bind will operate on a packed array (which is always read-only), disregarding its access attribute.
No error occurs in either case.

The effect of bind is that all operator names in proc and in procedures nested in proc to any depth become "tightly bound" to the operators themselves. During subsequent execution of proc, the interpreter encounters the operators themselves rather than the names of operators.

ERRORS: typecheck

SEE ALSO: load

Troubleshooting index Postscript Index


bitshift int1 shift bitshift int2

shifts the binary representation of int1 left by shift bits and returns the result. Bits shifted out are lost; bits shifted in are zero. If shift is negative, then a right shift by -shift bits is performed. This produces an arithmetically correct result only for positive values of int1. Both int1 and shift must be integers.

EXAMPLE:
7 3 bitshift -> 56
142 -3 bitshift -> 17

ERRORS: stackunderflow, typecheck

SEE ALSO: and, or, xor, not

Troubleshooting index Postscript Index


bytesavailable file bytesavailable int

returns the number of bytes that are immediately available for reading from file without waiting.
The result is -1 if end-of-file has been encountered or if the number of bytes available cannot be determined for other reasons.

ERRORS: ioerror, stackunderflow, typecheck

SEE ALSO: read, readhexstring, readline, readstring

Troubleshooting index Postscript Index


Original file name: PSL2b