entry ; COMMENT .SEC(DARRAY.SAI - histogram display from array) .index(DARRAY.SAI - histogram display from array) .; Begin Internal Integer Procedure DARRAY( Reference Integer Array Arrayed; Integer index0,index1; Real start,finish; string flags ); Begin "DARRAY" Require "sys:disprm.sai" source!file ; Require "DEFINE.REQ" source!file ; Require "FORT.REQ" source!file ; Require "CVT.REQ" source!file ; comment quick display of preload!with stored in an 'Arrayed' of given 'size'.; comment 'start' is the x coordinate assigned to 'Arrayed(index0)'.; comment 'finish' is the x coordinate assigned to 'Arrayed(index1)'.; comment 'DARRAY' returns the approximate number of vectors used.; comment up to 5 flags may be used at once, stored as characters; comment in 'flags'.; comment flags are:; comment w use last window; comment t no tic marks; comment s skip points to speed output; comment x-axis is labeled starting with 'start'.; comment 'DARRAY' cannot be used in overlay programming.; string astring; Integer size; Integer iskip,ilast,vectors,alast; Integer amax,amin,i,a,starto,fino,beginning,cmax,yint,jstart, jEnd,j; label label150,label132,label133,label220,label651; comment user's coordinate system.; Real Array plotpr[1:23]; Real left,right,bottom,top,chrhgt; Real dx,fi,y; Real intrvl; comment window used by 'DARRAY':; Internal Real dleft,dright,dbot,dtop; Boolean Realv; COMMENT .next page .SS(Procedure FLAGED) .index(Procedure FLAGED) .; Boolean Procedure FLAGED( string x ); Begin "FLAGED" Integer i; For i_ 1 step 1 until length(flags) do if equ(x,flags[i For 1]) then return(true); return(false); End "FLAGED"; comment End declarations; comment save previous plotting window; denq(plotpr[1]); left_plotpr[20]; right_plotpr[21]; bottom_plotpr[22]; top_plotpr[23]; chrhgt_plotpr[9]; comment set display mode allowing characters to be seen which are; comment outside of the window:; dtscal(-1.); comment obtain flags; comment flags implemented:; comment w use previous window; comment t do not draw tic marks; size_index1-index0+1; if size<1 then Begin "error" outstr("bad indices: (" & cvs(index0) & "," & cvs(index1) & ") passed to DARRAY" & crlf); return(0); End "error"; comment find extreme values; if not (FLAGED("w")) then Begin "finding extreme values" amax_minInteger; amin_maxInteger; For i_ index0 step 1 until index1 do Begin "loop 40" a_Arrayed[i]; if aamax then amax_a; End "loop 40"; starto_start; fino_finish; if (amin40 then yint_yint*10 else else yint_yint/10; jstart_amin/yint; jEnd_amax/yint; For j_ jstart step 1 until jEnd do Begin "loop 650" y_yint*j; dmove(start,y); dtext(CVT(y)); End "loop 650"; comment restore user coordinate system and character scaling; label220: if ( not FLAGED("w")) then dwind(left,right,bottom,top); dtscal(chrhgt); return(vectors); End "DARRAY"; End;