⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 node100.html

📁 htmdoc for html coding
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2 Final//FR"><!-- Converted with LaTeX2HTML 95.1 (Fri Jan 20 1995) --><!-- by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds --><!-- Modified Simulog 03/97 --><HTML><HEAD><TITLE>7.8 Implementation aids</TITLE><LINK REL=STYLESHEET TYPE="text/css"	HREF="./Modulef.css" TITLE="Modulef CSS"><meta name="description" value="7.8 Implementation aids"><meta name="keywords" value="Guide6"><meta name="resource-type" value="document"><meta name="distribution" value="global"></HEAD><BODY BGCOLOR="#FFFFFF"><P> <IMG SRC="../icons/smallmod.gif" WIDTH=211 HEIGHT=50 ALIGN=BOTTOM	ALT="Modulef"><A NAME=tex2html1643 HREF="node99.html"><IMG BORDER=0 ALIGN=BOTTOM SRC="../icons/previous_motif.gif"	ALT="previous"></A><A NAME=tex2html1649 HREF="node92.html"><IMG BORDER=0 ALIGN=BOTTOM SRC="../icons/up_motif.gif"	ALT="up"></A><A NAME=tex2html1651 HREF="node101.html"><IMG BORDER=0 ALIGN=BOTTOM SRC="../icons/next_motif.gif"	ALT="next"></A><A NAME=tex2html1653 HREF="node2.html"><IMG BORDER=0 ALIGN=BOTTOM SRC="../icons/contents_motif.gif"	ALT="contents"></A><A HREF="../Guide6-18/node100.html"><IMG BORDER=0 SRC="../icons/zoom18.gif" ALIGN=BOTTOM	ALT="[BIG]"></A><A HREF="../Guide6-14/node100.html"><IMG BORDER=0 SRC="../icons/zoom14.gif" ALIGN=BOTTOM	ALT="[Normal]"></A><A HREF="../Guide6-10/node100.html"><IMG BORDER=0 SRC="../icons/zoom10.gif" ALIGN=BOTTOM	ALT="[small]"></A><BR><B> Next: </B> <A NAME=tex2html1652 HREF="node101.html">7.9 Unclassed</A><B>Up: </B> <A NAME=tex2html1650 HREF="node92.html">7 Internal programs</A><B> Prev: </B> <A NAME=tex2html1644 HREF="node99.html">7.7 Sorting and dichotomy</A><B><A HREF="node2.html"	>Contents</A></B><HR SIZE=3 WIDTH="75&#37;"><H1><A NAME=SECTION05780000000000000000>7.8 Implementation aids</A></H1><P><P><P>A certain number of routines were written to facilitate the implementation of the  drivers:<P><UL><LI><P><PRE>      SUBROUTINE GETUNF(UNIT, NAME, EXTEND)      INTEGER UNIT      CHARACTER NAME*(*)      CHARACTER EXTEND*4</PRE><P>returns  a free logical unit in UNIT <A NAME=3467>&#160;</A> to perform an  OPEN.If name NAME exists already, an extension for NAME is found in EXTEND, if not EXTEND = '    '. NAME must be less than  64 characters.<P><LI><P><PRE>      SUBROUTINE RCHARS(TXT, STRING, L)      CHARACTER*(*) STRING, TXT      INTEGER L</PRE><P>prints string TXT concatenated with  STRING(1:L),   and then <A NAME=3468>&#160;</A> edits STRING: <BR><P>Input:   TXT*(*), STRING(1:L) (L<b>&gt;</b> 0)   <BR><P>Output:  L   and     STRING(1:L) <BR><P><LI><P><PRE>      SUBROUTINE RINTG(TXT, VAL, VMIN, VMAX)      CHARACTER*(*) TXT      INTEGER VAL, VMIN, VMAX</PRE><P>prints string TXT and  inputs VAL lying between <A NAME=3469>&#160;</A> VMIN and VMAX: <BR><P>Input:      TXT*(*), VMIN, VMAX  <BR><P>Output:      VAL   <BR><P><LI><P><PRE>      SUBROUTINE RREAL(TXT, VAL, VMIN, VMAX)      REAL VAL, VMIN, VMAX      CHARACTER*(*) TXT</PRE><P>prints string TXT and inputs VAL lying between<A NAME=3470>&#160;</A> VMIN and VMAX: <BR><P>Input:      TXT*(*), VMIN, VMAX  <BR><P>Output:      VAL   <BR><P><LI><P><PRE>      SUBROUTINE WCHARI(I, TXT)      INTEGER I      CHARACTER*(*) TXT</PRE><P>prints I and then <A NAME=3471>&#160;</A> string TXT.<P><LI><P><PRE>      SUBROUTINE WCHARS(TXT)      CHARACTER*(*) TXT</PRE><P>prints string<A NAME=3472>&#160;</A>  TXT. <BR><P><LI><P><PRE>      INTEGER FUNCTION LONGG(STRING)      CHARACTER *(*) STRING</PRE><P>deletes the blanks<A NAME=3473>&#160;</A> to the left and right and frame the string on the left. <BR><P>Input:       STRING: the string under consideration <BR><P>Output:      STRING: the string framed on the left and without blanks , and    <BR> LONGG the number of characters in  STRING on exit.        <BR><P><LI><P><PRE>      SUBROUTINE ENCOD(VAL,EPPS,TXT,LTXT)      REAL VAL      REAL EPPS      CHARACTER*(*) TXT      INTEGER LTXT</PRE><P>Input:  <BR><P>  VAL:    value to encode, and <BR>   EPPS:  relative  epsilon to determine if <A NAME=3475>&#160;</A> VAL is integer or real <BR><P>Output:<BR><P>   TXT: the coding of  VAL in characters, and <BR>    LTXT: the number of characters in TXT. <BR><P><LI><P><PRE>      REAL FUNCTION DECOD(STRING)      CHARACTER*(*) STRING</PRE><P> Input:   STRING: the string to decode <BR><P> Output:  DECODE the value of the string <BR><P><LI><P><PRE>      SUBROUTINE PPAUSE</PRE><P>simulates a pause<A NAME=3476>&#160;</A>.<P><LI><P><PRE>      INTEGER FUNCTION ZCENTR(CARAC, X, Y, TAILLE, DRWLIN)      CHARACTER*1 CARAC      REAL X, Y, TAILLE      EXTERNAL DRWLIN</PRE><P>plots a generic centered character. It is used when the  terminal <A NAME=3477>&#160;</A> does not know how to plot a  centered character.This function can be used in a F3D driver or in a user program.  <BR><P> Plot character  CARAC of size TAILLE at position  X, Y, where:   <BR><P>    X, Y:  position of text in cm;<P>    TAILLE: size of characters in cm;<P>    DRWLIN:  function to plot a line between two points whose coordinates are in cm, e.g.         DRWLIN(X1, Y1, X2, Y2);<P>    CARAC: the character to plot. The following characters are centered       <PRE>           . + * x X o O 0 ~ ^ |</PRE><P> The function returns the value 1 if it succeeded in plotting the character. It returns the value 0 is it could not plot it.    <BR><P><LI><P><PRE>      SUBROUTINE ZCOLOR(ROUGE, VERT, BLEU, NBCOLO)      INTEGER NBCOLO      REAL ROUGE(0:NBCOLO-1), VERT(0:NBCOLO-1), BLEU(0:NBCOLO-1)</PRE><P>This subroutine enables<A NAME=3478>&#160;</A> lazy people to initialize a color table. Note the color 0 is black... However, dynamic people  can do better for their particular terminal. This function can be used in a F3D driver or in a user program.   <BR><P>On entry:  NBCOLO: the number of colors     <BR><P>On exit:   ROUGE, VERT, BLEU: the color table  (the colors are  0...1) <BR><P><LI><P><PRE>      SUBROUTINE SPINTC(HHMIN,HHMAX,NNCDEB,NNCFIN)      REAL HHMIN,HHMAX      INTEGER NNCDEB,NNCFIN</PRE><P>spins through the color table between <A NAME=3479>&#160;</A> hues HHMIN and HHMAX       ( HHMIN and HHMAX =  0...1 ).  The part of the color table which is modified lies between the indices  NNCDEB and NNCFIN.<P><LI><P><PRE>      INTEGER FUNCTION ZFNDTC(RC, VC, BC, R, V, B, NBCOLO)      REAL RC, VC, BC      INTEGER NBCOLO      REAL R(0:NBCOLO-1), V(0:NBCOLO-1), B(0:NBCOLO-1)</PRE><P>Generic  subroutine<A NAME=3480>&#160;</A>, to search for the color closest to the color table. It can serve as a model.This function can be used in a F3D driver or in a user program.It returns the index, in the color table, of the color closest to RC, VC, BC. <BR><P>     R, V, B: color table<P>     NBCOLO: number of colors in the table<P>     All the colors  lie between  0. and 1.   <BR><P><LI><P><PRE>       SUBROUTINE ZGNUM(T1, T2, T3, IT1, IT2, IT3, STRING, ZGTXYC,                         MOUSE, N)       CHARACTER*(*) STRING       REAL T1(*), T2(*), T3(*)       INTEGER IT1(*), IT2(*), IT3(*)       INTEGER N       EXTERNAL ZGTXYC</PRE><P>Generic  GETNUM. This subroutine enables lazy people to <A NAME=3481>&#160;</A> obtain the function easily. However, dynamic people can do better for their particular terminal.This function can be used in a F3D driver or in a user program.   <BR><P>On entry: <BR><P>   T1(1): the abscissa of the beginning of the text to be printed in cm;<P>   T2(1): the ordinate of the beginning of the text to be printed in cm;<P>   STRING(1:IT1(1)): the text to be printed;<P>   IT1(1): the number of characters in the text to be printed;<P>   IT2(1): the type of number to by input (0 integer, 1 real, 2 boolean);<P>   IT2(2): the constraint where:<P>            0: no constraint, or<P>            1, min and max constraint for the numbers;<P>    The constraints are stored in:<P>         IT3(1) = min, IT3(2) = max for integer number;<P>         T3(1) = min, T3(2) = max for real numbers. <BR><P>The external subroutine, ZGTXYC, has the following form:<P><PRE>       SUBROUTINE ZGTXYC(X, Y, C, MOUSE, N)      REAL X, Y  { IN C.M. }      INTEGER N      CHARACTER*1 C,MOUSE(N)</PRE><P>On exit, according to the type, we have:     <BR><P>   IT3(3): the integer  or boolean number  (0=true, 1=false);<P>   T3(3): the real number.  <BR><P>If the  user types (return), the variables are not modified on exit. <BR><P><LI><P><PRE>       SUBROUTINE ZGTEXT(T1, T2, T3, IT1, IT2, IT3, STRING, ZGTXYC,                          MOUSE, N)       CHARACTER*(*) STRING       REAL T1(*), T2(*), T3(*)       INTEGER IT1(*), IT2(*), IT3(*)       INTEGER N       CHARACTER*1 MOUSE(N)       EXTERNAL ZGTXYC</PRE><P>Generic  GETEXT. This subroutine enables lazy people<A NAME=3482>&#160;</A> to obtain the function easily. However, dynamical people can do better for theirparticular terminal.This function can be used in a F3D driver or in a user program. <BR><P>On entry: <BR><P>   T1(1): the abscissa of the beginning of the text to be printed, in cm;<P>   T2(1): the ordinate of the beginning of the text to be printed, in cm;<P>   STRING(1:IT1(1)): the non-editable text to be printed;<P>   IT1(1): the number of characters in the text (not editable) to be printed;<P>   IT2(1): the maximum number of characters to be input;<P>   IT3(1): the number of characters in the initial editable text;<P>   STRING(IT1(1)+1:IT1(1)+IT3(1)): the initial editable text. <BR><P>Subroutine ZGTXYC has the following form:<P><PRE>      SUBROUTINE ZGTXYC(X, Y, C, MOUSE, N)      REAL X, Y      INTEGER N      CHARACTER*1 C,MOUSE(N)</PRE><P>On exit: <BR><P>   T3(1), T3(2): the abscissa and ordinate of the end of the text entered;<P>   IT3(1) the number of characters entered;<P>   STRING(IT1(1)+1:IT1(1)+IT3(1)): the text entered.    <BR><P><LI><P><PRE>       SUBROUTINE ZSTROK(T1, T2, T3, IT1, IT2, ZGTXYC, MOUSE, N)       INTEGER IT1(*), IT2(*)       REAL T1(*), T2(*), T3(*)       INTEGER N       CHARACTER*1 MOUSE(N)       EXTERNAL ZGTXYC</PRE><P>Generic  STROKE. This subroutine enables <A NAME=3483>&#160;</A>  lazy people  to obtain the functioneasily. However, dynamic people can do better for their particular terminal.This function can be used in a F3D driver or in a user program. <BR><P>On entry: <BR><P>   IT1(1): the maximum number of points to input;<P>   IT1(2): the constraint, where:<P>       IT1(2) = 0: no constraints, and<P>       IT1(2) = 1: two successive points on the curve input are separated by a minimum                    of T3(1) cm. and a maximum of T3(2) cm.       <BR><P>Subroutine ZGTXYC has the following form:<P><PRE>     SUBROUTINE  ZGTXYC(X, Y, C, MOUSE, N)     REAL X, Y  EN C.M.     INTEGER N     CHARACTER*1 C,MOUSE(N)</PRE><P>On exit: <BR><P>   IT2(1): the number of points actually input;<P>   T1: the  array of x in  cm;<P>               T2: the array of y in cm.       <BR><P><LI><P><PRE>      SUBROUTINE ZTXT(TXT, N, X, Y, SENS, CTX, CTY, TAILLE, DRAWTX)      CHARACTER*(*) TXT      INTEGER N      REAL X, Y, SENS, CTX, CTY, TAILLE      EXTERNAL DRAWTX</PRE><P>plots a generic text by <b> hardware</b>. This subroutine is aimed at thosewhose terminal <A NAME=3485>&#160;</A> does not know how to plot text obliquely, or how to decentralize the text.Note, the characters stay vertical, which makes the text almost illegible for certain angles...This function can be used in a F3D driver orin a user program.       <BR><P>Plot text TXT, of N characters, size TAILLE, direction SENS and centered at CTX, CTY, at X, Y, where: <BR><P>     X, Y: the position of the text in cm;<P>     SENS: the direction of the plot as a fractions of PI/2;<P>     TAILLE: the size of the characters in cm;<P>     CTX, CTY: the centering. <BR><P>     DRAWTX is a subroutine which plots a character of size TAILLE at a  given position  (in cm.). It hasthe form:<P><PRE>       SUBROUTINE DRAWTX(CARAC, X, Y)        CHARACTER*1 CARAC      REAL X, Y</PRE><P><LI><P><PRE>      SUBROUTINE ZSFTXT(TXT, N, X, Y, SENS, CTX, CTY, TAILLE)      CHARACTER*(*) TXT      INTEGER N      REAL X, Y, SENS, CTX, CTY, TAILLE</PRE><P>plots a generic text by <b> software</b>. This subroutine is aimed at thosewhose terminal <A NAME=3487>&#160;</A> does not know how to plot text obliquely, or how to decentralize the text.This function can be used in a F3D driver or in a user program. <BR><P>Plot text TXT, of N characters, size TAILLE, direction SENS and centered at CTX, CTY, at X, Y, where: <BR><P>     X, Y: the position of the text in cm;<P>     SENS: the direction of the plot as a fractions of PI/2;<P>     TAILLE: the size of the characters in cm;<P>     CTX, CTY: the centering. <BR><P><LI><P><PRE>      SUBROUTINE ZIVRVB(RIN,VIN,BIN,ROUT,VOUT,BOUT)      REAL RIN,VIN,BIN,ROUT,VOUT,BOUT</PRE><P>computes the inverse color<A NAME=3488>&#160;</A> of RIN, VIN, BIN  (red, green, blue) and outputs it in  ROUT, VOUT, BOUT.The inverse color is the one which  contrasts the most with color input.<P><LI><P><PRE>      SUBROUTINE ZIVHSL(HIN,SIN,LIN,HOUT,SOUT,LOUT)      REAL HIN,SIN,LIN,HOUT,SOUT,LOUT</PRE><P>computes the inverse color  <A NAME=3489>&#160;</A> of HIN, SIN, LIN  (hue, saturation, light) and outputs it in HOUT, SOUT, LOUT. The inverse color is the one which  contrasts the most with color input.<P><LI><P><PRE>      SUBROUTINE ZIVCOL(COLIN,COLOUT)      INTEGER COLIN,COLOUT</PRE><P>computes  the inverse color<A NAME=3490>&#160;</A> of the color with COLIN and outputs its number in COLOUT.<P></UL><P><P><P><HR SIZE=3 WIDTH="75&#37;"><IMG SRC="../icons/smallmod.gif" WIDTH=211 HEIGHT=50 ALIGN=BOTTOM	ALT="Modulef"><A NAME=tex2html1643 HREF="node99.html"><IMG BORDER=0 ALIGN=BOTTOM SRC="../icons/previous_motif.gif"	ALT="previous"></A><A NAME=tex2html1649 HREF="node92.html"><IMG BORDER=0 ALIGN=BOTTOM SRC="../icons/up_motif.gif"	ALT="up"></A><A NAME=tex2html1651 HREF="node101.html"><IMG BORDER=0 ALIGN=BOTTOM SRC="../icons/next_motif.gif"	ALT="next"></A><A NAME=tex2html1653 HREF="node2.html"><IMG BORDER=0 ALIGN=BOTTOM SRC="../icons/contents_motif.gif"	ALT="contents"></A><A HREF="../Guide6-18/node100.html"><IMG BORDER=0 SRC="../icons/zoom18.gif" ALIGN=BOTTOM	ALT="[BIG]"></A><A HREF="../Guide6-14/node100.html"><IMG BORDER=0 SRC="../icons/zoom14.gif" ALIGN=BOTTOM	ALT="[Normal]"></A><A HREF="../Guide6-10/node100.html"><IMG BORDER=0 SRC="../icons/zoom10.gif" ALIGN=BOTTOM	ALT="[small]"></A><BR><B> Next: </B> <A NAME=tex2html1652 HREF="node101.html">7.9 Unclassed</A><B>Up: </B> <A NAME=tex2html1650 HREF="node92.html">7 Internal programs</A><B> Prev: </B> <A NAME=tex2html1644 HREF="node99.html">7.7 Sorting and dichotomy</A><B><A HREF="node2.html"	>Contents</A></B><BR> <HR><P><ADDRESS></ADDRESS></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -