v14i061: Chemtab 1.2 (1 of 3)

root at ames.arc.nasa.gov root at ames.arc.nasa.gov
Thu Aug 30 08:40:12 AEST 1990


Posting-number: Volume 14, Issue 61
Submitted-by: root at ames.arc.nasa.gov@lsrhs.UUCP (Mr System)
Archive-name: chemtab-1.2/part01

This is Chemtab Version 1.2.  Major fixes have been implemented to this
version.  This is the whole thing.. all the sources.. be sure to read
README.FIRST FIRST.  It will tell you what to do.  If you have any problems
please contact me at xait.xerox.com!lsrhs!pulsar, or starting September 5th,
try me at ultb.isc.rit.edu!jek5036 (Rochester I.T.).

---- Cut Here and unpack ----
#!/bin/sh
# shar:	Shell Archiver  (v1.22)
#
# This is part 1 of a multipart archive                                    
# do not concatenate these parts, unpack them in order with /bin/sh        
#
#	Run the following text with /bin/sh to create:
#	  Makefile
#	  Manual.User
#	  README
#	  README.FIRST
#	  VERSION
#	  cleanup.c
#	  dogph.c
#	  element.c
#	  esort.c
#	  looke.c
#	  main.c
#	  ptabl.c
#	  schar.c
#	  scrmisc.c
#	  vdata.c
#	  element.h
#	  graph.h
#	  tune.h
#	  undefs.h
#	  variables.h
#	  windows.h
#	  elist
#	  pertab
#
if test -r s2_seq_.tmp
then echo "Must unpack archives in sequence!"
     next=`cat s2_seq_.tmp`; echo "Please unpack part $next next"
     exit 1; fi
echo "x - extracting Makefile (Text)"
sed 's/^X//' << 'SHAR_EOF' > Makefile &&
XCC            = gcc
XCFLAGS        = -O -W -ansi -fstrength-reduce -fforce-mem -fcombine-regs
XDEST	      = /u/chemtab
XEXTHDRS	      = /usr/include/curses.h \
X		/usr/include/math.h \
X		/usr/include/sgtty.h \
X		/usr/include/signal.h \
X		/usr/include/stdio.h \
X		/usr/include/sys/ioctl.h \
X		/usr/include/sys/ttychars.h \
X		/usr/include/sys/ttydev.h \
X		/usr/include/sys/ttyio.h \
X		/usr/include/time.h
XHDRS	      = element.h \
X		graph.h \
X		tune.h \
X		undefs.h \
X		variables.h \
X		windows.h
XLDFLAGS	      = -O
XLIBS	      = -lcurses -ltermcap
XLINKER	      = gcc
XMAKEFILE      = Makefile
XOBJS	      = cleanup.o \
X		dogph.o \
X		element.o \
X		esort.o \
X		looke.o \
X		main.o \
X		ptabl.o \
X		schar.o \
X		scrmisc.o \
X		vdata.o
XPRINT	      = lpr
XPROGRAM	      = chemtab
XSRCS	      = cleanup.c \
X		dogph.c \
X		element.c \
X		esort.c \
X		looke.c \
X		main.c \
X		ptabl.c \
X		schar.c \
X		scrmisc.c \
X		vdata.c
X
Xall:		$(PROGRAM)
X
X$(PROGRAM):     $(OBJS)
X		@echo -n "Loading $(PROGRAM) ... "
X		@$(LINKER) $(LDFLAGS) $(OBJS) -o $(PROGRAM) $(LIBS)
X		@echo "done"
X
Xclean:;		@rm -f $(OBJS)
X
Xdepend:;	@mkmf -f $(MAKEFILE) PROGRAM=$(PROGRAM) DEST=$(DEST)
X
Xindex:;		@ctags -wx $(HDRS) $(SRCS)
X
Xinstall:	$(PROGRAM)
X		@echo Installing $(PROGRAM) in $(DEST)
X		@install -o root -g wheel -m 4755 $(PROGRAM) $(DEST)
X
Xprint:;		@$(PRINT) $(HDRS) $(SRCS)
X
Xprogram:        $(PROGRAM)
X
Xtags:           $(HDRS) $(SRCS); @ctags $(HDRS) $(SRCS)
X
Xupdate:		$(DEST)/$(PROGRAM)
X
X$(DEST)/$(PROGRAM): $(SRCS) $(LIBS) $(HDRS) $(EXTHDRS)
X		@make -f $(MAKEFILE) DEST=$(DEST) 
X###
Xcleanup.o: /usr/include/curses.h /usr/include/stdio.h /usr/include/sgtty.h \
X	/usr/include/sys/ioctl.h /usr/sys/h/ttychars.h /usr/sys/h/ttydev.h \
X	/usr/sys/h/ttyio.h /usr/sys/h/sgtty.h /usr/include/sys/ttychars.h \
X	/usr/include/sys/ttydev.h /usr/include/sys/ttyio.h windows.h \
X	variables.h tune.h
Xdogph.o: /usr/include/curses.h /usr/include/stdio.h /usr/include/sgtty.h \
X	/usr/include/sys/ioctl.h /usr/sys/h/ttychars.h /usr/sys/h/ttydev.h \
X	/usr/sys/h/ttyio.h /usr/sys/h/sgtty.h /usr/include/sys/ttychars.h \
X	/usr/include/sys/ttydev.h /usr/include/sys/ttyio.h windows.h \
X	/usr/include/math.h tune.h variables.h element.h graph.h undefs.h
Xelement.o: variables.h /usr/include/stdio.h tune.h element.h
Xesort.o: element.h tune.h undefs.h variables.h /usr/include/stdio.h \
X	/usr/include/curses.h /usr/include/sgtty.h /usr/include/sys/ioctl.h \
X	/usr/sys/h/ttychars.h /usr/sys/h/ttydev.h /usr/sys/h/ttyio.h \
X	/usr/sys/h/sgtty.h /usr/include/sys/ttychars.h \
X	/usr/include/sys/ttydev.h /usr/include/sys/ttyio.h windows.h
Xlooke.o: /usr/include/curses.h /usr/include/stdio.h /usr/include/sgtty.h \
X	/usr/include/sys/ioctl.h /usr/sys/h/ttychars.h /usr/sys/h/ttydev.h \
X	/usr/sys/h/ttyio.h /usr/sys/h/sgtty.h /usr/include/sys/ttychars.h \
X	/usr/include/sys/ttydev.h /usr/include/sys/ttyio.h element.h tune.h \
X	variables.h windows.h undefs.h
Xmain.o: /usr/include/stdio.h /usr/include/curses.h /usr/include/sgtty.h \
X	/usr/include/sys/ioctl.h /usr/sys/h/ttychars.h /usr/sys/h/ttydev.h \
X	/usr/sys/h/ttyio.h /usr/sys/h/sgtty.h /usr/include/sys/ttychars.h \
X	/usr/include/sys/ttydev.h /usr/include/sys/ttyio.h \
X	/usr/include/time.h /usr/include/signal.h variables.h tune.h \
X	windows.h
Xptabl.o: /usr/include/curses.h /usr/include/stdio.h /usr/include/sgtty.h \
X	/usr/include/sys/ioctl.h /usr/sys/h/ttychars.h /usr/sys/h/ttydev.h \
X	/usr/sys/h/ttyio.h /usr/sys/h/sgtty.h /usr/include/sys/ttychars.h \
X	/usr/include/sys/ttydev.h /usr/include/sys/ttyio.h windows.h \
X	variables.h tune.h element.h
Xschar.o: /usr/include/stdio.h /usr/include/curses.h /usr/include/sgtty.h \
X	/usr/include/sys/ioctl.h /usr/sys/h/ttychars.h /usr/sys/h/ttydev.h \
X	/usr/sys/h/ttyio.h /usr/sys/h/sgtty.h /usr/include/sys/ttychars.h \
X	/usr/include/sys/ttydev.h /usr/include/sys/ttyio.h element.h tune.h \
X	variables.h windows.h
Xscrmisc.o: /usr/include/curses.h /usr/include/stdio.h /usr/include/sgtty.h \
X	/usr/include/sys/ioctl.h /usr/sys/h/ttychars.h /usr/sys/h/ttydev.h \
X	/usr/sys/h/ttyio.h /usr/sys/h/sgtty.h /usr/include/sys/ttychars.h \
X	/usr/include/sys/ttydev.h /usr/include/sys/ttyio.h variables.h tune.h \
X	windows.h
Xvdata.o: /usr/include/stdio.h /usr/include/curses.h /usr/include/sgtty.h \
X	/usr/include/sys/ioctl.h /usr/sys/h/ttychars.h /usr/sys/h/ttydev.h \
X	/usr/sys/h/ttyio.h /usr/sys/h/sgtty.h /usr/include/sys/ttychars.h \
X	/usr/include/sys/ttydev.h /usr/include/sys/ttyio.h variables.h tune.h \
X	element.h windows.h undefs.h
SHAR_EOF
chmod 0644 Makefile || echo "restore of Makefile fails"
set `wc -c Makefile`;Sum=$1
if test "$Sum" != "4446"
then echo original size 4446, current size $Sum;fi
echo "x - extracting Manual.User (Text)"
sed 's/^X//' << 'SHAR_EOF' > Manual.User &&
X
X
X		  Chemtab Teacher's User Manual Version 1.2
X			 Effective August 4th, 1990
X-------------------------------------------------------------------------------
X
X	Chemtab is set up to be easy to use.  The ease is first seen by how
Xeasy it is to start the program.  To start, sit down at a terminal.  You
Xshould see an information message followed by the prompt ``login: ''.
XAt this prompt, type 'chemtab', hit RETURN, and you may begin to use Chemtab.
XAfter you read the title page, hit SPACE BAR.
X	The program will ask you if you want extra explanations (seen on the
Xbottom line of the screen).  This question asks you if you would like the
Xprogram to put information after every question it asks you about what you
Xshould type.  Answer by typing 'y' or 'n'.
X	After answering, the program will them ask you if you want a printed
Xtranscript of your session.  Simply put, if you answer yes, the program will
Xsave every graph, list, and chart you produce using it.  If you answer yes,
Xthen you must type in your last	name so that when you pick up the printout,
Xit will have your name on it and you know which is yours.  If you answer
Xyes, after every graph, chart or list you produce the program will ask you
Xif you would like to add it to the transcript.  If you accidentally hit the
Xwrong key and got the wrong graph, you can type 'n' when it asks you this
Xquestion.
X	Now you are ready to begin using the real fun part of the program.
XBefore you, you should see the MAIN MENU.  To choose which part of the
Xprogram you would like to use, type in the number corresponding to the
Xchoice on the screen.  The first choice is "Look at a single element" or
Xsomething to that effect.  If you type '1', you will see another screen.
XIt will ask you to choose which element to look at by Atomic Number, Symbol,
Xor Name.  Choose which one you want by typing in the number next to the
Xchoice and answer the question the program asks you.  Then, the program will
Xdisplay everything it knows about the element.  Follow the directions at the
Xbottom of the screen to get back to the MAIN MENU.
X	At the MAIN MENU, at the top of the screen, you will see a line
Xsimilar to this:
X		'Selection Characteristics: (max of 3)'
XThe space below this line will tell you if you have set any selections for
Xthe computer to look through the list of elements for.  As you can see, you
Xmay have up to three.  To make/change one, select mnu number '2'.
XThe screen will change and give you a list of characteristics.  Say, for
Xexample, you wanted to look for every element with an atomic mass under 40.
XYou would choose Atomic Mass by typing in the number next to it, and hit
XRETURN.  Then the program would ask you if you want to make Atomic Mass
XEqual to, Greater Than, Less Than, or Close To.  You would choose Less than
Xby hitting the number next to it.  Then, the program will say:
X
X'You would like to look for elements with an Atomic Mass Less Than:'
X
X'What Value? '
X
Xso you type in the value 40 and hit RETURN.  Now you will be at the
Xcharacteristics page and the selection you just made will be at the top of
Xthe screen.  If you wanted to erase what you just did, follow the same
Xinstructions as above a second time.  The program will ask you if you want
Xto change the current selection of Atomic Mass.  Type 'y' to change it.
XNow, instead of choosing 'Less Than', you would choose, 'Exit [will erase
Xcharacteristic]'.  The selection will disappear.  If you want to erase all
Xof them at once, type '15' and RETURN at the characteristics screen.  Menu
Xoption 15 is 'Erase all Characteristics'.  Type y to confirm that you want
Xto do this.
X
X
X
X
X
X
X	If you wanted to view all the elements with an Atomic Mass between 25 and
X40, you would follow the above steps.  Then you would type in the number for
XAtomic Mass again.  The program will ask you if you wish to change the
Xcurrent selection of Atomic Mass.  Type 'n'.  Then it will ask you if you
Xwant to make a second characteristic of the same type.  Type 'y'.  The
Xselect Greater Than and type in 25.  Now, the top of the screen will say
Xthat you are looking for elements with an Atomic Mass Greater Than 25 AND
XLess Than 40.  You are ready to move on the the next step.  Choose number 14
Xto return to the main menu.  As you return to the main menu, the elements
Xthat you are looking for are found and stored in the computer's memory for
Xyou.
X	At the MAIN MENU, if you would like to list the elements you just
Xstored in menory, type '3'.  If you would like to see where those elements
Xare on the periodic table of the elements, hit '4'.  If you would like to
Xgraph, type '5'.  To quit, type '6'.
X	Graphing was the hardest part of the program and also the most
Xpleasing to finish.  You can graph any characteristic of an element against
Xanother with this program.  This allows the you to see a pattern in the
Xelements.  Say, for example, you wanted to see the pattern of
Xelectronegativity in the first 40 elements.  If you have selected certain
Xelements, the program will ask you if you want to use those elements, OR if
Xyou want to see all the elements.  Type 'a' for the first, or 'b' for the
Xsecond.  You should type 'b' now.  The program will now ask you to choose
Xwhat to graph with.  Type the letter corresponding to Atomic Number.
XNear the bottom of the screen, the computer will tell you it wants to know
Xwhat range to use.  If you wanted to see ALL of the elements, you would hit
XRETURN here.. but we only want to see 1 through 40, so type '1' and RETURN.
XThen type '40' and RETURN.  Now you choose what to graph against.  Choose
Xthe letter for electronegativity.  Now, the computer will make a graph for
Xyou.  See the patterns?
X	You could do this another way.  Use the selection options (main menu
Xcommand '2') to store in memory all elements with an atomic number less than
X40.  Then choose '5' for graphing at the main menu.  Choose 'a' to use the
Xstored elements.  Choose Atomic Number, and hit RETURN for Minimum value
X(this means you will use every element) Then choose electronegativity.  The
Xprogram will only print out the elements it has stored in memory.  There you
Xhave it!
X	A new feature was added in the last minute of production.  You may
Xmake a characteristic which is not Equal, Greater or Less Than.  The new one
Xis 'Close To'.  See appendix A for a list of values.  What 'Close To' will do
Xis select elements within a boundary preset by myself, the author, of plus
Xof minus that amount to what you type.  For example, electronegativity has a
X'Close To' value of 0.20.  This means if you chose Close To 1.5, any element
Xwith an electronegativity from (1.5 - 0.20) - (1.5 + 0.20) or 1.3 to 1.7 will
Xbe stored in memory.
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
XChemtab Appendix A - List of Close To Values:
X
XAtomic Number - 5	Atomic Mass - 10	Family - 1
X
XRow	      - 1	Valence El. - 1		Melt Temp - 100 Degrees
X
XBoil Temp     - 100 Dg	Ionization Energy - 25	Year of Discovery - 25 years
X
XSpecific Heat - .05	Density	    - .2	Electroneg. - 0.2
X
XAtomic Radius - .05 Ang.
X
SHAR_EOF
chmod 0755 Manual.User || echo "restore of Manual.User fails"
set `wc -c Manual.User`;Sum=$1
if test "$Sum" != "6992"
then echo original size 6992, current size $Sum;fi
echo "x - extracting README (Text)"
sed 's/^X//' << 'SHAR_EOF' > README &&
XChemTab - A Periodic Table (of the elements) Database
X
XChemtab was written at Lincoln-Sudbury Regional High School during the 1989
Xto 1990 school year.  The student, Jim King, our graduating high-hopes
Xprogrammer will be attending Rochecter Institute of Technology during the
Xnext five school years studying Computer Science (Networking).
X
XChemtab was designed in conjunction with the faculty in the science
Xdepartment at the Lincoln-Sudbury Regional High School.  The database does a
Xvariety of functions:
X
X	1) Graph elemental data (x vs y)
X	2) Select a set of elements from given parameters
X	3) Look at a certain element and display all known information
X	   (at least, all input data) on the element.
X
XAll elemental information in this program has been extracted from the
Xfollowing source:
X	CRC Handbook of Chemistry & Physics, 63rd edition, 1982-1983
X
Xo All whole numbers, if rounded, are rounded on the premise that:
X  .01 to .49 considered rounded down
X  .50 to .99 considered rounded up
X
Xo Ionization Energy found in the following manner: (to compromise the
X  chemistry courses at L-S)
X	All figures based on the table of "IONIZATION POTENTIALS", pages
X	E-64 and E-65, column I, then multiplied by 23.  Rounded.
X
XChemtab; written in C (1990) by Jim King (pulsar at lsrhs)
SHAR_EOF
chmod 0755 README || echo "restore of README fails"
set `wc -c README`;Sum=$1
if test "$Sum" != "1275"
then echo original size 1275, current size $Sum;fi
echo "x - extracting README.FIRST (Text)"
sed 's/^X//' << 'SHAR_EOF' > README.FIRST &&
XJim King - August 1990
X
XHow to setup Chemtab to work at your site..
X
XWARNING: Chemtab has only been tested under Ultrix 3.1 on a VAX 11/780.
X	 Chemtab will probably only work for BSD equivalent systems..
X	 Please send any fixes to me.. anyone who would spend time learning
X	  the internals and adding a few '#ifdef SYSV' would hold my utmost
X	  appreciation! (pulsar at lsrhs!xait.Xerox.COM)
X
X(1) Change the Makefile to suit your site.  Currently, the makefile will
X    compile with gcc, with the -g option for debugging.
X(2) Change tune.h (only what needs to be changed, for now.. pathnames etc..)
X(3) Change the directions on how to get to you printer at the end of cleanup.c
X(4) make
X
XThat SHOULD be the extent of it.. but don't quote me on that.  I am the
Xauthor, and I am not held responsible for any damage the program might cause,
Xhowever it's not programmed to do any damage whatsoever.
X
XRead the manual pages in the directory Mans before you do anything else,
Xplease.  I realize that the directions are sketchy, but I am a programmer,
Xnot a documenter (or a commenter for that matter).. thanks! - Jim
XYou can read Manual.User for a step-by-step instruction on version 1.2.
SHAR_EOF
chmod 0644 README.FIRST || echo "restore of README.FIRST fails"
set `wc -c README.FIRST`;Sum=$1
if test "$Sum" != "1179"
then echo original size 1179, current size $Sum;fi
echo "x - extracting VERSION (Text)"
sed 's/^X//' << 'SHAR_EOF' > VERSION &&
XCurrently, you have Chemtab Version 1.2, Patchlevel 0.
SHAR_EOF
chmod 0755 VERSION || echo "restore of VERSION fails"
set `wc -c VERSION`;Sum=$1
if test "$Sum" != "55"
then echo original size 55, current size $Sum;fi
echo "x - extracting cleanup.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > cleanup.c &&
X/*
X * chemtab - a periodic table data base (C) 1990 Jim King (pulsar at lsrhs)
X *
X * cleanup.c	Cleanup (exit) routine
X */
X
X#include <curses.h>
X#include <stdio.h>
X#include "windows.h"
X#include "variables.h"
X#include "tune.h"
X
X/*
X * cleanup() - no input
X *
X * purpose:  Handle any quit or ^C signal nicely.
X */
X
Xcleanup()
X{
X	char	c, unm[80];			/* input */
X	if (trans) {				/* transcript flag */
X		mvwaddstr(btm, 0, 0, "Would you like your transcript printed out? ");
X		wrefresh(btm);
X		noecho();
X		crmode();
X		c = getchar();
X		if (c == 'n') {
X			wclear(btm);
X			wrefresh(btm);
X		} else {			/* else print it out */
X			wprintw(btm, "yes");
X			wrefresh(btm);
X			fclose(fp);
X			sprintf(str, "%s %d.chemtab", PRINTER, getpid());
X			system(str);
X			wclear(btm);
X			wrefresh(btm);
X		}
X	}
X	fclose(fp);				/* close things up */
X	clear(); refresh();
X	echo();
X	nocrmode();
X	endwin();				/* turn off curses */
X	if (trans) {
X		printf("A copy of your transcript can be found in the file %d.chemtab\n", getpid());
X		printf("\nYou can pick up your printout at the printer to the left of\n");
X		printf("The White-Board, labelled Happy.  Look for your last name in >><<'s on\n");
X		printf("the top line of each printout.  Good luck with Chemistry.\n");
X	}
X	fflush(stdout);				/* just make sure.. */
X	exit(1);				/* quit nicely */
X}
SHAR_EOF
chmod 0755 cleanup.c || echo "restore of cleanup.c fails"
set `wc -c cleanup.c`;Sum=$1
if test "$Sum" != "1309"
then echo original size 1309, current size $Sum;fi
echo "x - extracting dogph.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > dogph.c &&
X/*
X * chemtab - a periodic table data base (C) 1990 Jim King (pulsar at lsrhs)
X *
X * dogph.c	Contains graphing procedures
X */
X
X#include <curses.h>
X#include "windows.h"
X#include <stdio.h>
X#include <math.h>
X#include "tune.h"
X#include "variables.h"
X#include "element.h"
X#include "graph.h"
X
X/*
X * numr(ch)
X *	input:	ch - char - input to determine output
X *	output:	return() - int
X *
X * purpose:	to print the top line of the graph, x vs. y, we need
X *		the array number of the chosen function, array gname[]
X *		found in graph.h.. octal move wouldn't work.
X */
Xnumr(ch)
Xchar	ch;
X{
X	switch(ch) {
X		case 'a':	return(1);
X		case 'b':	return(2);
X		case 'c':	return(3);
X		case 'd':	return(4);
X		case 'e':	return(5);
X		case 'f':	return(6);
X		case 'g':	return(7);
X		case 'h':	return(8);
X		case 'i':	return(9);
X		case 'j':	return(10);
X		default:	return(0);
X	}
X}
X
Xfixup(win)
XWINDOW	*win;
X{
X	wmove(win, 0, 0);
X	wmove(btm, 0, 0);
X	wmove(win, 0, 0);
X	move(0, 0);
X	refresh();
X	wrefresh(win);
X	wrefresh(btm);
X}
X
X/*
X * dogph() - no input
X *
X * purpose:	This is the main graphing routine.
X */
Xdogph()
X{
X	char	c, str[80];
X	int	which = 2;
X	for (i = 0; i < 70; i++)		/* clear the x axis points */
X		xaxis[i] = 0;
X	for (i = 0; i < 21; i++)		/* clear the y axis points */
X		yaxis[i] = 0;
X	wclear(graph); wrefresh(graph); clear(); refresh();
X	if (gtot != 0) {
X		mvwaddstr(mn, 0, 0, "Would you like to use:");
X		mvwaddstr(mn, 2, 10, "a] Elements you have already selected OR");
X		mvwaddstr(mn, 3, 10, "b] All of the elements");
X		wmove(mn, 5, 0); wclrtoeol(mn); wrefresh(mn);
Xthrd:		mvwaddstr(mn, 5, 0, "To graph with? ");
X		wrefresh(mn);
X		noecho(); crmode();
X		c = wgetch(mn);
X		if (c == 'a')	which = 1;
X		else if (c == 'b')	which = 2;
X		else {
X			mvwaddstr(mn, 5, 0, "To graph with?   (choose 'a' or 'b')");
X			goto thrd;
X		}
X		wclear(mn);
X	}
X	mvwaddstr(mn, 0, 0, "a] Atomic Number");
X	mvwaddstr(mn, 1, 0, "b] Atomic Mass");
X	mvwaddstr(mn, 2, 0, "c] Melting Temp.");
X	mvwaddstr(mn, 3, 0, "d] Boiling Temp.");
X	mvwaddstr(mn, 4, 0, "e] Ionization Energy");
X	mvwaddstr(mn, 5, 0, "f] Electronegativity");
X	wrefresh(mn);
X	wmove(mn, 6, 0);
X	wclrtoeol(mn);
X	mvwaddstr(mn, 6, 0, "g] Specific Heat");
X	wrefresh(mn);
X	mvwaddstr(mn, 7, 0, "h] Density");
X	mvwaddstr(mn, 8, 0, "i] Atomic Radius");
X	mvwaddstr(mn, 9, 0, "j] Discovery Year");
X	mvwaddstr(mn, 10, 0, "Graphing by this, across the X axis.");
X	mvwaddstr(mn, 12, 0, "*** Due to lack of information at this time, graphs beyond");
X	mvwaddstr(mn, 13, 0, "*** Atomic number 86 may be misleading.  The program is designed");
X	mvwaddstr(mn, 14, 0, "*** to compensate, but nothing is perfect.");
Xfirst:	mvwaddstr(mn, 11, 0, "Your choice: ");
X	wrefresh(mn);				/* collect their choices */
X	crmode();
X	noecho();
X	c1 = getchar();	/* X axis chc */
X	if (c1 < 'a' || c1 > 'j')
X		goto first;
X	for (i = 12; i < 15; i++) {
X		wmove(mn, i, 0); wclrtoeol(mn);
X	}
X
X	for (i = 0; i <= MAXLM; i++) {
X		switch(c1) {
X			case 'a': x = e[i].anum; break;
X			case 'b': x = e[i].amass; break;
X			case 'c': x = e[i].melt; if (x == MEL) continue; break;
X			case 'd': x = e[i].boil; if (x == BOI) continue; break;
X			case 'e': x = e[i].fio; if (x == FIO) continue; break;
X			case 'f': x = e[i].eneg; if (x == ENG) continue; break;
X			case 'g': x = e[i].spht; if (x == SPHT) continue; break;
X			case 'h': x = e[i].dens; if (x == DENS) continue; break;
X			case 'i': x = e[i].arad; if (x == ARD) continue; break;
X			case 'j': x = e[i].year; if (x == YEA) continue; break;
X		}
X		if (i == 1)
X			xmax = xmin = x;
X		else {
X			if (x > xmax) xmax = x;
X			if (x < xmin) xmin = x;
X		}	
X	}
X
X	mvwaddstr(mn, 10, 0, "If you would rather use the maximum and minimum values of");
X	mvwaddstr(mn, 11, 0, "all the elements, hit RETURN once.");
X	wmove(mn, 12, 0); wprintw(mn, "All the element's values: Minimum %f, Maximum %f", xmin, xmax);
X	mvwaddstr(mn, 13, 0, "What range, X Minimum? ");
X	wrefresh(mn);
X	echo(); nocrmode();
X	gets(str);
X	if (!strlen(str)) {
X		xmin = -999;
X		goto nt;
X	}
X	xmin = atof(str);
X	fixup(mn);
X	mvwaddstr(mn, 13, 0, "What range, X Maximum?                ");
X	mvwaddstr(mn, 13, 0, "What range, X Maximum? ");
X	wrefresh(mn);
X	scanf("%f", &xmax);
X	fixup(mn);
X	getchar();	/* scanf does not eat the \n */
X	
Xnt:	wmove(mn, 10, 0); wclrtoeol(mn); wmove(mn, 11, 0); wclrtoeol(mn);
X	mvwaddstr(mn, 10, 0, "Graphing by this, down the Y axis.   ");
Xscnd:	wmove(mn, 12, 0); wclrtoeol(mn); wmove(mn, 13, 0); wclrtoeol(mn);
X	mvwaddstr(mn, 11, 0, "Your choice: ");
X	wrefresh(mn);
X	noecho(); crmode();
X	c2 = wgetch(mn); /* Y axis chc */
X	if (c2 < 'a' || c2 > 'j')
X		goto scnd;
X	noecho();
X
X	wclear(mn); wrefresh(mn);
X
X	/* Here we find the x axis max and min values */
X
X	if (xmin != -999)
X		goto ystuff;
X
X	for (i = 1; i <= MAXLM; i++) {
X		switch(c1) {
X			case 'a': x = e[i].anum; break;
X			case 'b': x = e[i].amass; break;
X			case 'c': x = e[i].melt; if (x == MEL) continue; break;
X			case 'd': x = e[i].boil; if (x == BOI) continue; break;
X			case 'e': x = e[i].fio; if (x == FIO) continue; break;
X			case 'f': x = e[i].eneg; if (x == ENG) continue; break;
X			case 'g': x = e[i].spht; if (x == SPHT) continue; break;
X			case 'h': x = e[i].dens; if (x == DENS) continue; break;
X			case 'i': x = e[i].arad; if (x == ARD) continue; break;
X			case 'j': x = e[i].year; if (x == YEA) continue; break;
X		}
X		if (i == 1)
X			xmax = xmin = x;
X		else {
X			if (x > xmax) xmax = x;
X			if (x < xmin) xmin = x;
X		}
X	}
X	/* Here we find the y axis min and max values */
X
Xystuff:	if (which == 2) {
X		for (i = 1; i < MAXLM; i++) {
X			switch(c2) {
X				case 'a': x = e[i].anum; break;
X				case 'b': x = e[i].amass; break;
X				case 'c': x = e[i].melt; if (x == MEL) continue; break;
X				case 'd': x = e[i].boil; if (x == BOI) continue; break;
X				case 'e': x = e[i].fio; if (x == FIO) continue; break;
X				case 'f': x = e[i].eneg; if (x == ENG) continue; break;
X				case 'g': x = e[i].spht; if (x == SPHT) continue; break;
X				case 'h': x = e[i].dens; if (x == DENS) continue; break;
X				case 'i': x = e[i].arad; if (x == ARD) continue; break;
X				case 'j': x = e[i].year; if (x == YEA) continue; break;
X			}
X			if (i == 1)
X				ymax = ymin = x;
X			else {
X				if (x > ymax) ymax = x;
X				if (x < ymin) ymin = x;
X			}
X		}
X	} else {
X		for (i = 0; i <= gtot; i++) {
X			switch(c2) {
X				case 'a': x = e[sub1[i]].anum; break;
X				case 'b': x = e[sub1[i]].amass; break;
X				case 'c': x = e[sub1[i]].melt; if (x == MEL) continue; break;
X				case 'd': x = e[sub1[i]].boil; if (x == BOI) continue; break;
X				case 'e': x = e[sub1[i]].fio; if (x == FIO) continue; break;
X				case 'f': x = e[sub1[i]].eneg; if (x == ENG) continue; break;
X				case 'g': x = e[sub1[i]].spht; if (x == SPHT) continue; break;
X				case 'h': x = e[sub1[i]].dens; if (x == DENS) continue; break;
X				case 'i': x = e[sub1[i]].arad; if (x == ARD) continue; break;
X				case 'j': x = e[sub1[i]].year; if (x == YEA) continue; break;
X			}
X			if (i == 1)
X				ymax = ymin = x;
X			else {
X				if (x > ymax) ymax = x;
X				if (x < ymin) ymin = x;
X			}
X		}
X	}
X
X	/* Now we have min & maxs we have to put a number in
X	   each slot on both axes using a scale */
X
X	scale = (xmax - xmin) / 69; /* 69 is # of slots in X axis */
X
X	xaxis[1] = xmin;
X	for (i = 2; i < 70; i++)
X		xaxis[i] = xaxis[i-1] + scale;
X
X	scale = (ymax - ymin) / 20; /* 20 is # of slots in Y axis */
X
X	yaxis[20] = ymin;
X	for (i = 19; i > 1; i--)
X		yaxis[i] = yaxis[i+1] + scale;
X
X	sprintf(str, "%s (x-axis) vs. %s (y-axis)", gname[numr(c1)], gname[numr(c2)]);
X	mvwaddstr(graph, 0, (40 - (strlen(str) / 2)), str);
X	wrefresh(graph);	/* That is the top graph line */
X	for (i = 20; i > 1; i--) {		/* The y axis line */
X		mvwaddstr(graph, i, 10, "|");
X		wrefresh(graph);
X	}
X	for (i = 11; i < 80; i++) {		/* The x axis line */
X		mvwaddstr(graph, 21, i, "-");
X		wrefresh(graph);
X	}
X	mvwaddstr(graph, 21, 10, "+");		/* The corner */
X	wrefresh(graph);
X	for (i = 20; i > 1; i -= 5) {		/* Y axis points */
X		if (c2 < 'f' || c2 > 'i')
X			sprintf(str, "%d ->", (int)(yaxis[i]+.5));
X		else
X			sprintf(str, "%4.2f ->", yaxis[i]);
X		mvwaddstr(graph, i, 0, str);
X	}
X	for (i = 1; i < 79; i += 10) {		/* X axis points */
X		if (c1 < 'f' || c1 > 'i')
X			sprintf(str, "^%d", (int)(xaxis[i]+.5));
X		else
X			sprintf(str, "^%4.2f", xaxis[i]);
X		mvwaddstr(graph, 22, i+10, str);
X	}
X	/* The actual find & graph */
X
X	if (which == 2) {
X		for (i = 1; i < MAXLM; i++) {
X			switch(c1) {	/* This should become a library function */
X				case 'a': x = e[i].anum; break;
X				case 'b': x = e[i].amass; break;
X				case 'c': x = e[i].melt; if (x == MEL) continue; break;
X				case 'd': x = e[i].boil; if (x == BOI) continue; break;
X				case 'e': x = e[i].fio; if (x == FIO) continue; break;
X				case 'f': x = e[i].eneg; if (x == ENG) continue; break;
X				case 'g': x = e[i].spht; if (x == SPHT) continue; break;
X				case 'h': x = e[i].dens; if (x == DENS) continue; break;
X				case 'i': x = e[i].arad; if (x == ARD) continue; break;
X				case 'j': x = e[i].year; if (x == YEA) continue; break;
X			}
X			if (x < xmin)
X				continue;
X			else if (x < xaxis[2])
X				xspot = 1;
X			else {
X				for (j = 2; j < 70; j++) {
X					if (x > xaxis[j])
X						continue;
X					else
X						break;
X				}
X				xspot = j - 1;
X				if (x > xmax)
X					continue;
X			}
X
X			/* Found where it goes on the x, now the y */
X
X			switch(c2) {
X				case 'a': x = e[i].anum; break;
X				case 'b': x = e[i].amass; break;
X				case 'c': x = e[i].melt; if (x == MEL) continue; break;
X				case 'd': x = e[i].boil; if (x == BOI) continue; break;
X				case 'e': x = e[i].fio; if (x == FIO) continue; break;
X				case 'f': x = e[i].eneg; if (x == ENG) continue; break;
X				case 'g': x = e[i].spht; if (x == SPHT) continue; break;
X				case 'h': x = e[i].dens; if (x == DENS) continue; break;
X				case 'i': x = e[i].arad; if (x == ARD) continue; break;
X				case 'j': x = e[i].year; if (x == YEA) continue; break;
X			}
X
X			if (x < yaxis[19])
X				yspot = 20;
X			else {
X				for (j = 19; j > 1; j--) {
X					if (x > yaxis[j])
X						continue;
X					else
X						break;
X				}
X				yspot = j;
X			}
X
X			/* Align and put the dot where X marks the spot */
X
X			mvwaddstr(graph, yspot, xspot+10, "o");
X			wrefresh(graph);
X		}
X	} else {
X		for (i = 1; i < gtot; i++) {
X			switch(c1) {	/* This should become a library function */
X				case 'a': x = e[sub1[i]].anum; break;
X				case 'b': x = e[sub1[i]].amass; break;
X				case 'c': x = e[sub1[i]].melt; if (x == MEL) continue; break;
X				case 'd': x = e[sub1[i]].boil; if (x == BOI) continue; break;
X				case 'e': x = e[sub1[i]].fio; if (x == FIO) continue; break;
X				case 'f': x = e[sub1[i]].eneg; if (x == ENG) continue; break;
X				case 'g': x = e[sub1[i]].spht; if (x == SPHT) continue; break;
X				case 'h': x = e[sub1[i]].dens; if (x == DENS) continue; break;
X				case 'i': x = e[sub1[i]].arad; if (x == ARD) continue; break;
X				case 'j': x = e[sub1[i]].year; if (x == YEA) continue; break;
X			}
X			if (x < xmin)
X				continue;
X			else if (x < xaxis[2])
X				xspot = 1;
X			else {
X				for (j = 2; j < 70; j++) {
X					if (x > xaxis[j])
X						continue;
X					else
X						break;
X				}
X				xspot = j - 1;
X				if (x > xmax)
X					continue;
X			}
X
X			/* Found where it goes on the x, now the y */
X
X			switch(c2) {
X				case 'a': x = e[sub1[i]].anum; break;
X				case 'b': x = e[sub1[i]].amass; break;
X				case 'c': x = e[sub1[i]].melt; if (x == MEL) continue; break;
X				case 'd': x = e[sub1[i]].boil; if (x == BOI) continue; break;
X				case 'e': x = e[sub1[i]].fio; if (x == FIO) continue; break;
X				case 'f': x = e[sub1[i]].eneg; if (x == ENG) continue; break;
X				case 'g': x = e[sub1[i]].spht; if (x == SPHT) continue; break;
X				case 'h': x = e[sub1[i]].dens; if (x == DENS) continue; break;
X				case 'i': x = e[sub1[i]].arad; if (x == ARD) continue; break;
X				case 'j': x = e[sub1[i]].year; if (x == YEA) continue; break;
X			}
X
X			if (x < yaxis[19])
X				yspot = 20;
X			else {
X				for (j = 19; j > 1; j--) {
X					if (x > yaxis[j])
X						continue;
X					else
X						break;
X				}
X				yspot = j;
X			}
X
X			/* Align and put the dot where X marks the spot */
X
X			mvwaddstr(graph, yspot, xspot+10, "o");
X			wrefresh(graph);
X		}
X	}
X	/* fu is a goto for elements with an undefined var */
X
X	capture(graph, 1, 0);
X	spc();		/* Space to continue? */
X	wclear(graph);
X	wrefresh(graph);
X}
SHAR_EOF
chmod 0644 dogph.c || echo "restore of dogph.c fails"
set `wc -c dogph.c`;Sum=$1
if test "$Sum" != "12164"
then echo original size 12164, current size $Sum;fi
echo "x - extracting element.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > element.c &&
X/*
X * chemtab - a periodic table data base (C) 1990 Jim King (pulsar at lsrhs)
X *
X * element.c	Reads in the file from the #define PERTABLE (which is the
X *		data file) and sorts into the structure l1 (e).
X */
X
X#include "variables.h"
X#include "element.h"
X#include "tune.h"
X#include <stdio.h>
X
X/*
X * readelem() - no input
X *
X * purpose:	Take a line from PERTABLE (tune.h) and put it in structure
X *		e[] which is defined as the element table used throughout
X *		the program.  This was designed so the operator could easily
X *		change an element or add one without changing anything but
X *		tune.h
X */
Xreadelem()
X{
X	char	inp[160];			/* input line */
X	FILE	*fptr;				/* File pointer for PERTABLE */
X
X	if ((fptr = fopen(PERTABLE, "r")) == NULL) { /* Open it please */
X		bot("Cannot open element data file");
X		sleep(3);
X		cleanup();
X	}
X
X	fgets(inp, 160, fptr);			/* Read in comment line */
X	fgets(inp, 160, fptr);			/* Eat the spacer */
X
X	for (i = 1; i < MAXLM+1; i++) {		/* Munch that damn line!! */
X		if (fscanf(fptr, "%s%s%d%d%d%d%d%d%d%d%d%f%f%f%f\n",
X		       e[i].name, e[i].sym, &e[i].anum, &e[i].amass, &e[i].fam,
X		       &e[i].row, &e[i].val, &e[i].melt, &e[i].boil,
X		       &e[i].fio, &e[i].year, &e[i].eneg, &e[i].spht,
X		       &e[i].dens, &e[i].arad) == EOF)
X		       	break;
X	}
X	fclose(fptr);				/* Be nice and neat */
X}
SHAR_EOF
chmod 0755 element.c || echo "restore of element.c fails"
set `wc -c element.c`;Sum=$1
if test "$Sum" != "1329"
then echo original size 1329, current size $Sum;fi
echo "x - extracting esort.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > esort.c &&
X
X/*
X * chemtab - a periodic table data base (C) 1990 Jim King (pulsar at lsrhs)
X *
X * esort.c	Takes the changed values to look for and sifts to sub1[]
X */
X
X#include "element.h"
X#include "undefs.h"
X#include "variables.h"
X#include "tune.h"
X#include <curses.h>
X#include "windows.h"
X
Xint	sift[3][MAXLM],	/* Enough spaces to carry all the elements through
X			   the sifting process 3 times. */
X	sftc[3];	/* number telling the amount of elements in sift[x] */
Xint	tmp[MAXLM],	/* A place to put compared elements from 1&2 & 2&3 */
X	tc;		/* The temp[x] counter */
X
X/*
X * esort() - no input
X *
X * purpose:	Take the selecting characteristics from dosort[x] which are
X *		defined in schar() and sift the elements through them, then
X *		see what's left and store it away.
X */
Xesort()
X{
X	x = 0.0;			/* floating integer for cmp */
X
X	if (dosort[0].wch == 0)			/* No chars to sort */
X		return(1);
X
X	tc = gtot = 0;				/* Reset counter */
X	for (i = 0; i < MAXLM; i++) {
X		sub1[i] = 0;			/* Clear the olds */
X		sift[0][i] = sift[1][i] = sift[2][i] = 0;
X		sftc[0] = sftc[1] = sftc[2] = 0;
X		tmp[i] = 0;
X	}
X	for (i = 0; i < 3; i++) {
X		if (dosort[i].wch != 0) {	/* Sort on this */
X			for (k = 1; k < MAXLM; k++) {
X				switch(dosort[i].wch) {
X					case 1: x = e[k].anum;  break;
X					case 2: x = e[k].amass; break;
X					case 3: x = e[k].fam;   break;
X					case 4: x = e[k].row;   break;
X					case 5: x = e[k].val;   break;
X					case 6: x = e[k].melt;  break;
X					case 7: x = e[k].boil; 	break;
X					case 8: x = e[k].fio;   break;
X					case 9: x = e[k].year;  break;
X					case 10: x = e[k].eneg; break;
X					case 11: x = e[k].spht; break;
X					case 12: x = e[k].dens;	break;
X					case 13: x = e[k].arad; break;
X					default:                break;
X				}
X				if ((x > dosort[i].amt && dosort[i].sgn == GREATER) ||
X				    (x < dosort[i].amt && dosort[i].sgn == LESS) ||
X				    (x == dosort[i].amt && dosort[i].sgn == EQUAL) ||
X				    (x >= dosort[i].amt - close[dosort[i].wch] && x <= dosort[i].amt + close[dosort[i].wch] && dosort[i].sgn == CLOSE)) {
X					if (!((dosort[i].wch == 5 && x == VAL) ||
X					    (dosort[i].wch == 6 && x == MEL) ||
X					    (dosort[i].wch == 7 && x == BOI) ||
X					    (dosort[i].wch == 8 && x == FIO) ||
X					    (dosort[i].wch == 10 && x == ENG) ||
X					    (dosort[i].wch == 11 && x == SPHT) ||
X					    (dosort[i].wch == 12 && x == DENS) ||
X					    (dosort[i].wch == 13 && x == ARD))) {
X						sftc[i]++;
X						sift[i][sftc[i]] = k;
X					    }
X				}
X			}
X		}
X	}
X					/* Now sift each to other */
X					/* Compare 1 and 2 into tmp[] */
X	if (dosort[1].wch == 0) {	/* Only 1 sort */
X		for (i = 1; i < MAXLM; i++) /* Copy sift[0] into sub1 */
X			sub1[i] = sift[0][i];
X		goto end;
X	}
X	for (j = 1; j < MAXLM; j++) {	/* Compare sift[1] and sift[0] */
X		if (sift[0][j] != 0) {	/* If something to compare */
X			for (k = 1; k < MAXLM; k++) {
X				if (sift[0][j] == sift[1][k]) {
X					tc++;	/* Match */
X					tmp[tc] = sift[0][j];
X				}
X			}
X		}
X	}
X	if (dosort[2].wch == 0) {	/* Only 2 sorts */
X		for (i = 1; i < MAXLM; i++) /* Copy tmp into sub1 */
X			sub1[i] = tmp[i];
X		goto end;
X	}
X					/* Now sift tmp[] with sift[2] */
X	for (i = 1; i < MAXLM; i++) {
X		if (tmp[i] != 0) {
X			for (j = 1; j < MAXLM; j++) {
X				if (tmp[i] == sift[2][j]) {
X					++gtot;
X					sub1[gtot] = tmp[i]; /* Match */
X				}
X			}
X		}
X	}
X	goto rend;
Xend:	for (i = 1; i < MAXLM; i++) {
X		if (sub1[i] != 0)
X			gtot++;
X	}
Xrend:	/* This is the end! */
X	tc = 0;
X	return(0);
X}
SHAR_EOF
chmod 0755 esort.c || echo "restore of esort.c fails"
set `wc -c esort.c`;Sum=$1
if test "$Sum" != "3438"
then echo original size 3438, current size $Sum;fi
echo "x - extracting looke.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > looke.c &&
X/*
X * chemtab - a periodic table data base (C) 1990 Jim King pulsar at lsrhs
X *
X * looke.c - look for an element, then print known stats
X */
X
X#include <curses.h>
X#include <stdio.h>
X#include "element.h"
X#include "variables.h"
X#include "tune.h"
X#include "windows.h"
X#include "undefs.h"
X
X/*
X * disp(l)
X *	input:	l - int - referring to atomic number of elem. to display
X *	output: curses only
X *
X * purpose:	separate the displaying from the rest of the subroutine
X */
Xdisp(l)
Xint	l;
X{
X	wclear(graph);
X	wmove(graph, 0, 0); wprintw(graph, "Atomic Name: %s", e[l].name);
X	wmove(graph, 1, 0); wprintw(graph, "Atomic Symbol: %s", e[l].sym);
X	wmove(graph, 2, 0); wprintw(graph, "Atomic Number: %d", e[l].anum);
X	wmove(graph, 3, 0); wprintw(graph, "Atomic Mass: %d", e[l].amass);
X
X	if (e[l].melt == MEL)
X		mvwaddstr(graph, 5, 0, "Melting Temp: NOT AVAILABLE");
X	else {
X		wmove(graph, 5, 0); wprintw(graph, "Melting Temp: %d Celcius", e[l].melt);
X	}
X	if (e[l].boil == BOI)
X		mvwaddstr(graph, 5, 40, "Boiling Temp: NOT AVAILABLE");
X	else {
X		wmove(graph, 5, 40); wprintw(graph, "Boiling Temp: %d Celcius", e[l].boil);
X	}
X	if (e[l].spht == SPHT)
X		mvwaddstr(graph, 7, 0, "Specific Heat: NOT AVAILABLE");
X	else {
X		wmove(graph, 7, 0); wprintw(graph, "Specific Heat: %1.2f", e[l].spht);
X	}
X	if (e[l].dens == DENS)
X		mvwaddstr(graph, 8, 0, "Density: NOT AVAILABLE");
X	else {
X		wmove(graph, 8, 0); wprintw(graph, "Density: %2.2f", e[l].dens);
X	}
X	if (e[l].arad == ARD)
X		mvwaddstr(graph, 9, 0, "Atomic Radius: NOT AVAILABLE");
X	else {
X		wmove(graph, 9, 0); wprintw(graph, "Atomic Radius: %1.2f Angstroms", e[l].arad);
X	}
X	if (e[l].eneg == ENG)
X		mvwaddstr(graph, 11, 0, "Electronegativity: NOT AVAILABLE");
X	else {
X		wmove(graph, 11, 0); wprintw(graph, "Electronegativity: %1.1f", e[l].eneg);
X	}
X	if (e[l].year == YEA)
X		mvwaddstr(graph, 12, 0, "Discovery Year: ANCIENT, B.C.");
X	else {
X		wmove(graph, 12, 0); wprintw(graph, "Discovery Year: %d A.D.", e[l].year);
X	}
X	wrefresh(graph);
X	capture(graph, 0, 0);
X	spc();	/* space to continue? */
X}
X	
Xlooke()
X{
X	char	*strn,				/* Random input string */
X		srch[80],			/* String comparison */
X		c = '5';			/* choice input */
X	noecho(); crmode();
X	wclear(mn); wrefresh(mn);
X	wclear(srt); wrefresh(srt);
X	clear(); refresh();
X
X	mvwaddstr(mn, 0, 0, "Look for element by:");
X	mvwaddstr(mn, 2, 0, "1] Atomic Name");
X	mvwaddstr(mn, 3, 0, "2] Atomic Number");
X	mvwaddstr(mn, 4, 0, "3] Atomic Symbol");
X	mvwaddstr(mn, 5, 0, "4] Return to Main Menu");
X	if (hlp)
X		mvwaddstr(mn, 7, 16, "(type in number of choice, do not hit return)");
X	mvwaddstr(mn, 7, 0, "Your Choice? ");
X	wrefresh(mn);
X	noecho();
X	crmode();
X	while (c < '1' || c > '4')
X		c = wgetch(mn);
X
X	if (c == '4') {
X		wprintw(mn, "Return to Main Menu.");
X		wrefresh(mn);
X		sleep(1);
X		return(0);
X	}
X	
X	if (c == '1') {		/* look by name */
X		wprintw(mn, "Look by Name (all lowercase please)");
X		wclrtoeol(mn);
X		if (hlp)
X			mvwaddstr(mn, 9, 33, "(type in name of element, then hit return)");
X		mvwaddstr(mn, 9, 0, "Name of Element: ");
X		wrefresh(mn);
X		echo();
X		nocrmode();
X		gets(srch);
X	}
X
X	if (c == '2') {		/* look by number */
X		wprintw(mn, "Look by Number (1 - %d please)", MAXLM-1);
X		wclrtoeol(mn);
X		if (hlp)
X			mvwaddstr(mn, 9, 21, "(type in atomic number, then hit return)");
X		mvwaddstr(mn, 9, 0, "Atomic Number: ");
X		wrefresh(mn);
X		echo();
X		nocrmode();
X		gets(srch);
X	}
X
X	if (c == '3') {		/* look by symbol */
X		wprintw(mn, "Look by Symbol");
X		wclrtoeol(mn);
X		if (hlp)
X			mvwaddstr(mn, 9, 20, "(type in atomic symbol, then hit return)");
X		mvwaddstr(mn, 9, 0, "Atomic Symbol: ");
SHAR_EOF
echo "End of part 1"
echo "File looke.c is continued in part 2"
echo "2" > s2_seq_.tmp
exit 0



More information about the Comp.sources.misc mailing list