🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #1273

Re: Novice Question

#1273
From: rsilverman
Date: Sat, 28 Oct 1989 14:39
23 lines
874 bytes
In article <7834@cg-atla.UUCP>, kincaid@cg-atla.UUCP (Tom Kincaid ) writes:

> Is there a way to:  
> 
> 		-Check to see if V1 is defined 
> 
> 		-if it is defined, do nothing.
> 
> 		-if it is not defined, then define it.
> 
> 
> 		Thanks,
> 				Tom

Tom,
	The "known" operator tries to look up its operand in the context of the
dictionary stack, and returns true or false accordingly.  Thus:

/V1 known not { /V1 null def } if

will do what you want (replace "null" with whatever you want).

						Richard Silverman
Technical Details
Message-ID: <2884@eagle.wesleyan.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!samsung!brutus.cs.uiuc.edu!psuvax1!rutgers!cmcl2!yale!eagle!rsilverman
References: <7834@cg-atla.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!samsung!brutus.cs.uiuc.edu!psuvax1!rutgers!cmcl2!yale!eagle!rsilverman
From: rsilverman@eagle.wesleyan.edu
Newsgroups: comp.lang.postscript
Subject: Re: Novice Question
Message-ID: <2884@eagle.wesleyan.edu>
Date: 28 Oct 89 14:39:31 GMT
References: <7834@cg-atla.UUCP>
Distribution: comp
Lines: 23