[comp.lang.postscript] Help need in PS programming

srin@barley.ecn.purdue.edu (Raghavan Srinivasan) (04/11/91)

I just started to learn PS programming. I have following questions to be
answered. I would appreciate any info in this regard.

1. like in 'C', is there any way where a subroutine can return a string or int. If yes, any example please.

2. How to send say the first item of the stack in the form of an array to another routine?

3. How the arrays are stored in a stack? 


Thanks.

Please send your suggestions to me directly.



--
Raghavan Srinivasan  
Agricultural Engineering, Purdue University, W. Lafayette IN 47907
Internet: srin@ecn.purdue.edu  uucp: uunet!ecn.purdue.edu!srin

jms@tardis.Tymnet.COM (Joe Smith) (04/15/91)

In article <1991Apr11.041929.16118@noose.ecn.purdue.edu> srin@barley.ecn.purdue.edu (Raghavan Srinivasan) writes:
>I just started to learn PS programming. I have following questions to be
>answered. I would appreciate any info in this regard.
>1. like in 'C', is there any way where a subroutine can return a string or int. If yes, any example please.
>2. How to send say the first item of the stack in the form of an array to another routine?
>3. How the arrays are stored in a stack? 

The answers to all your questions are in the Red Book:
	PostScript Language Reference Manual
	Adobe Systems Incorporated
	Addison Wesley
	ISBN 0-201-10174-2
	ISBN 0-201-10169-6

1. A routine can return ANYTHING on the stack.  This can be any of:
   array, boolean, dict, file, font, integer, mark, name, null, operator,
   packedarray, real, save, string.  See the 'type' operator.
2. Check '[' and ']' on how to build an array.
3. Arrays are stored as arrays.
-- 
Joe Smith (408)922-6220 | SMTP: jms@tardis.tymnet.com or jms@gemini.tymnet.com
BT Tymnet Tech Services | UUCP: ...!{ames,pyramid}!oliveb!tymix!tardis!jms
PO Box 49019, MS-C51    | BIX: smithjoe | CA license plate: "POPJ P," (PDP-10)
San Jose, CA 95161-9019 | humorous dislaimer: "My Amiga 3000 speaks for me."