Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion shfill: /ShadingType 2, computed parameters
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
jdaw1  
View profile  
 More options Mar 9 2010, 6:01 pm
Newsgroups: comp.lang.postscript
From: jdaw1 <jdawise...@gmail.com>
Date: Tue, 9 Mar 2010 15:01:14 -0800 (PST)
Local: Tues, Mar 9 2010 6:01 pm
Subject: Re: shfill: /ShadingType 2, computed parameters
I have a Concatenate function. But how do I convert numbers on the
stack, like 0.3284, to an appropriate strong format?

/ConcatenateOverflowErrorsSuppressed false def
/Concatenate
{
        2 copy type exch type
        2 copy /stringtype ne exch /stringtype ne or
        {
                2 copy /arraytype eq exch /arraytype eq 4 2 roll /packedarraytype eq
exch /packedarraytype eq
                3 -1 roll or 3 1 roll or and not
                {
                        (Error: Concatenate, types either unsuitable or non-matching)
OutputToLog == == stop
                } {false} ifelse  % not both arrays
        } {pop pop true} ifelse  % either not a string
        3 1 roll  2 copy  length exch length add dup 65535 le
        {
                4 -1 roll {string} {array} ifelse dup dup
                0  5 index putinterval
                4 -1 roll length 4 -1 roll putinterval
        }
        {
                % bool A B joint-size
                pop  3 -1 roll
                {
                        1 index length 65535 ge
                        {
                                pop
                                ConcatenateOverflowErrorsSuppressed not
                                {
                                        (Error: Concatenate, first string of maximal size. Suppressing
reporting of further such errors.) OutputToLog
                                        /ConcatenateOverflowErrorsSuppressed true store
                                } if  % ConcatenateOverflowErrorsSuppressed not
                        }
                        {
                                ConcatenateOverflowErrorsSuppressed not
                                {
                                        (Error: Concatenate -- truncation, as objects jointly too long.
Suppressing reporting of further such errors.) OutputToLog
                                        /ConcatenateOverflowErrorsSuppressed true store
                                } if  % ConcatenateOverflowErrorsSuppressed not
                                65535 string dup dup  % A B string string string
                                0  5 index  putinterval  % A B string string
                                4 -1 roll length dup 65535 exch sub  % B string string |A| 65535-|
A|
                                5 -1 roll 0 3 -1 roll getinterval  % string string |A| B'
                                dup length 0 gt {putinterval} {pop pop} ifelse  % string
                        } ifelse  % First object maximal length
                        dup 65532 (...) putinterval
                }
                {
                        ConcatenateOverflowErrorsSuppressed not
                        {
                                (Error: Concatenate, objects jointly too large, returning only
first object. Suppressing reporting of further such errors.)
OutputToLog
                                /ConcatenateOverflowErrorsSuppressed true store
                        } if  % ConcatenateOverflowErrorsSuppressed not
                        pop
                } ifelse  % string
        } ifelse  % fits within architectural limits

} bind def  % /Concatenate


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.