2017-02-12 76 views
1

在Linux下,我正在編寫一個Ghostscript程序來讀取一個相當長的(1320行)經度和緯度座標數據文件(一個安裝了Gnuplot的文件)最終繪製一張地圖。我寫了各種測試文件,最新的是讀取數據並使用show和showpage顯示每行,以檢查讀取的行是否與輸入文件匹配。我想在每個showpage之後暫停程序的執行,直到按下一個鍵。請,我該怎麼做?在Ghostscript中我怎樣才能暫停輸出到屏幕

這是我的鍵盤輸入測試程序。我希望它可能需要顯著的變化:

%! 
% Testing Keyboard input 
% 
% Depictions of the stack have top on the right 
% 
/Courier findfont 16 scalefont setfont 

% string needs a size and leaves the created string on the stack. 
/s 15 string def % longer string stores /00 in extra places in outfile .. 
/lcount 0 def  
/vpos 750 def /nl 0 def 
/newline {72 vpos moveto /vpos vpos 12 sub def} def 

/inputfile (/dev/tty) (r) file def 
%/inputfile (/home/Harry/Mercator/world.dat) (r) file def 

/getdataline dataline into s ++> true, or false at end of file 
{ /lcount 1 lcount add def 
    inputfile s readline % was readstring 
} def 

{ 0 1 14 { s exch 0 put }for % clears string s to nulls 
    getdataline 
    {newline s show} % got a line 
    {exit} % end of file 
    ifelse 
    showpage 
% ******* I want to pause here ******* 
} loop 

inputfile closefile 

回答

0

我錯過了回答我的鼻子前右,藏在我的編輯窗口後面的終端窗口。在編程執行中,每個showpage後面的消息>>showpage, press <return> to continue<<出現在終端窗口中,正是我想要的。