CONJURE CREATIVE CHEMICAL COMPUTATIONS.
HOC EST OPUS
(Say it fast.) - It's Latin and means :THIS IS THE TASK !
Write unique procedures to calculate with numbers or words.
- Learn the fundamentals of computer programming in any language.
Develop your ability to evaluate and display numerical data.
- Appreciate the power of rapid repetitive decision processing.
- Learn to COUNT on your fingers - up to 1000!!
- Learn to CODE in binary - up to 127!!
POP NOT OOPs: Procedural (not Object) Oriented Programs
- GWBASIC (Gone with the Windows Best And Simplest Instruction Code)
Logical Control thru Flow-charting
Algorithms to Evaluate Statistics, Sort Lists, Parse Chemical Formulas
Techniques to Graph in any coordinate system
Methods to Store, Manipulate and Present Data of all kinds
One of the Plots from H Orbital Overlap Program: HOVERLAP.BAS

This program is the most advanced in the course. You may download a copy for personal perusal. There are no implied warranties.
We face a newer age of Computer Illiteracy in which the programs are so sophisticated
and, where applicable, the computations are made without the user's faintest clue of what
assumptions and approximations go into them. THE RULE OUGHT TO BE: IF YOU
CANNOT IN PRINCIPLE WRITE IT; YOU SHOULD NOT IN PRACTICE RUN IT.
You can get by in life by using other people's applications:but it is infinitely
more fulfilling to be CREATIVE and develop your own unique ones.
RETURN TO THE EBONY DUNGEON
(BASIC Especially Simplified Edition)
- A BASIC program is a list of numbered lines of instructions which manipulates data in order to achieve some desired result.
- The instructions are classified as either Commands, Statements or Functions.
- It takes instructions to make and use a program.
- Commands manipulate program files and occur mostly as EDIT instructions. They are used mostly in IMMEDIATE mode (i.e. without line numbers and executed as soon as the 'ENTER' key is pressed) but under certain situations may be used in a program list (file).
- Statements manipulate data in order to make decisions and thus occur mostly in PROGRAM mode as instructions in the program listing. Practically all the DISPLAY and BRANCH instructions are statements.
- Data which do not change, i.e. are constant, may be employed in the list as their numerical values, e.g. 2, 3.1415, etc.
- Data which may change as they are manipulated, i.e. are variable, must be assigned names: e.g. volume, vol, v, v2, etc. The variable name is always used in the program instructions, e.g. LET VOL= 3.1415*R^2*HT will have the numerical value for a cylinder having a radius value stored under the name R and a height stored under the name HT and computed by the indicated product stored under the name VOL.
- In addition to the usual arithmetic operations (+, -, *, /, and ^) there are additional instructions which OPERATE.
- A particularly important set of operations are the DISPLAY instructions. Note that the instruction PRINT VOL would not print the letters V-O-L but the number whose name is VOL.
- Functions are essentially built-in subroutines which perform data conversions or computations. OPERATE instructions are mostly either statements or functions.
- The most significant factor which distinguishes a computer program from a calculator sequence is that the program can make decisions about the state of the data it is manipulating and alter its order of instuctions by using BRANCH instructions.
INSTRUCTIONS:
- The most striking factor is the speed with which a seemingly endless list of tedious manipulations is accomplished.
SAMPLE PROGRAM: 100 REM Calculate Cylinder Volume CYLVOL.BAS
110 INPUT "Radius, Height";R,HT
120 VOL=3.1415*R^2*HT
130 PRINT "Volume";VOL,"Height";HT,"Radius";R
- Two additional sets of instructions perform Math and String Functions.
- These are the functions which operate on either a numeric variable, the usual math functions, or a literal variable, i.e. a string of alphanumeric characters, called string functions.
- Literal variables are distinguished from numeric variable by the $(read 'STring' not dollar) character appended to their name.
- A literal variable is identified by placing inside double quotes, e.g. X$="VTECHEM", the 'null string' (literal equivalent to a numeric zero) is a pair of double quotes, e.g. INKEY$="".
- These functions all require an operand enclosed in parentheses following the instruction on which to operate. The operand may be an expression, variable or a constant.
FUNCTIONS:
Return to List
GLOSSARY OF BASIC INSTRUCTIONS
- ABS (opr) FUNCTION
Returns the absolute value of the operand.
Return
- ASC(var$) FUNCTION
Returns the ASCII code of the first character of the literal variable.
Return
- ATN (opr) FUNCTION
Returns the arctangent, angle in radians, of the operand.
Return
- CALL Offset(var1,var2) STATEMENT
Calls a machine language subroutine that begins at value of Offset to SEGment Address and passes values of a list of variables to the called routine.
Return
- CHR$ (n) FUNCTION
Returns the character whose numeric code (0<n<255) is the operand.
Return
- CIRCLE (x,y),r,col,[brad,erad,asp] STATEMENT
Draws a circle or arc with center at value of x and value of y with value of radius=r.
Return
- CLEAR COMMAND
Clears all memory used for data by nulling all variables but without erasing current program.
Return
- CLS STATEMENT
Clears(erases) the video screen and homes the cursor.
Return
- CLOSE STATEMENT
Closes all open files and devices.
Return
- CONT COMMAND
Continues program execution after a STOP command.
Return
- COS (opr) FUNCTION
Returns the cosine of the operand angle given in radians.
Return
- DEFtype b-e STATEMENTS
Declares variable by the first letter of the variable name as type:INT[eger], SING[le precision), STR[ing], D[ou]BL[e precision].
Return
- DEF SEG = addr STATEMENT
Defines the base segment address for the 64 Kbyte memory block accessible by BASIC. If no address supplied then default segment address will be assigned.
Return
- DATA list STATEMENT
Stores a lists of values to be accessed by a READ statement.
Return
- DATE$ STATEMENT/VARIABLE
Assigns/evaluates the date string "MMDDYY[YY]" held in memory.
Return
- DEF fn name(p,...,q) STATEMENT
Defines a user function name = expression employing variable(s) p,...,q as parameters.
Return
- DELETE bnum-enum COMMAND
Deletes inclusive range of numbered lines in range.
Return
- DIM var1(n1),vara(n2,n3) STATEMENT
Specifies dimension of subscripts (maximum number) for variable lists and arrays.
Return
- END STATEMENT
Ends program execution, closes all files, and returns to IMMEDIATE mode.
Return
- EOF FUNCTION
Checks for an end-of-file condition when reading from a sequential file.
Return
- EXP (opr) FUNCTION
Returns the value of the natural antilogarithm (power of e) of the operand.
Return
- FILES ["filespec"] COMMAND
Displays names of all files (or those specified by DOS filespec).
Return
- FIX (opr) FUNCTION
Returns the integer part of the operand.
Return
- FOR var=b TO e [STEP d] ...NEXT var STATEMENT
Repeats all commands up to NEXT linenumber over range of variable.
Return
- GOSUB ln STATEMENT
Branches to a subroutine at linenumber ln, expects to RETURN to statement following command.
Return
- GOTO ln STATEMENT
Unconditionally transfer program chain of execution to specified linenumber ln.
Return
- IF var1 rel var2 THEN ln1 [ELSE ln2] STATEMENT
Evaluates logical relation between variables (>, =, <, =>, <=, ><) and branches to linenumber following THEN or proceed to following line unless redirected to linenumber following ELSE.
Return
- var$=INKEY$ VARIABLE
Reads one character from the keyboard and assigns to literal variable.
Return
- var = INP (addr) FUNCTION
Assigns one byte value from input port having 10-bit device code address to specified variable.
Return
- INT (opr) FUNCTION
Returns the (algebraic) largest integer value of the operand.
Return
- INPUT var FUNCTION
Assigns value entered from keyboard preceding an ENTER key to specified variable.
Return
- INPUT #buf, var(s) STATEMENT
Reads data from a sequential file buffer and assigns in order read to variable list.
Return
- INSTR (X$,Y$) FUNCTION
Returns the integer position number of the first occurrence of the string X$ in the string Y$.
Return
- KILL "filespec" COMMAND
Deletes filename.ext from DOS specified disk directory.
Return
- LEFT$ (var$,n) FUNCTION
Returns the string of the first (leftend) n characters of literal variable.
Return
- LEN (var$) FUNCTION
Returns the integer number of characters in the literal variable.
Return
- [LET] var = expression STATEMENT
Assigns the value of expression to the variable named. Command word is unnecessary.
Return
- LINE (x1,y1)-(x2,y2) [,C,B F] STATEMENT
Draws a line or box (B)and fills in (F) with color number C between points x1,y1 and x2,y2 at opposite or diagonal corners.
Return
- LIST [ln1 - ln2] COMMAND
Lists all or part of a program to video screen.
Return
- LLIST [ln1 - ln2] COMMAND
Lists all or part of a program to the printer.
Return
- LOAD "filespec" COMMAND
Loads a program from the current or a specified disk.
Return
- LOCATE r#,c# STATEMENT
Positions the cursor at a specified screen row(1-25) and column(1-80).
Return
- LOG (opr) FUNCTION
Returns the natural logarithm of the operand.
Return
- LPRINT "text"var1,var2 STATEMENT
Directs output of text in quotes and values of listed variables to the printer:'semi-colon' prevents new line, 'comma' tabulates by 15 spaces.
Return
- LPRINT USING "#string" STATEMENT
Same as LPRINT except a quoted number format string limits printed values: e.g. USING "##.##"
Return
- MERGE "filespec" COMMAND
Combines an ASCII text formatted filespec program with current program with overwriting of common linenumbers.
Return
- MID$ (var$,p,n) FUNCTION
Returns a string of n characters beginning with at the position p of the literal variable.
Return
- NEW COMMAND
Deletes current program and erases all variables.
Return
- ON var GOSUB ln1,ln2,...,lnn STATEMENT
Branches to the subroutine of linenumber in list position equal to integer value of variable.
Return
- ON var GOTO ln1,ln2,...,lnn STATEMENT
Unconditional branch to the linenumber in list position equal to value of variable.
Return
- OPEN "mode(O,A,I)",#num,"filespec" STATEMENT
Creates a buffer space identified by # to allow output(new)/append(old)/input to a specified disk file.
Return
- OUT (addr, var) STATEMENT
Sends a one byte variable value to output port having 10-bit devide code address.
Return
- POKE addr, var STATEMENT
Writes a one byte variable value to 16 bit memory address offset from the current segment address.
Return
- var = PEEK (addr) FUNCTION
Assigns a one byte value read from 16 bit memory address offset from segment to the variable specified.
Return
- PRINT "text"var1,var2 STATEMENT
Directs output of text in quotes and values of listed variables to the screen:'semi-colon' prevents new line, 'comma' tabulates by 15 spaces.
Return
- PRINT USING "#string" STATEMENT
Same as PRINT except a quoted number format string limits printed values: e.g. USING "##.##"
Return
- PRINT #buf, var(s) STATEMENT
Writes data to a sequential file buffer in order read from variable list.
Return
- PSET (x,y),col STATEMENT
Plots a colored point at the specified coordinates (0<x<640,350>y>0 in SCREEN 9).
Return
- READ var(s) STATEMENT
Reads successive values from DATA statements and assigns to specified variables.
Return
- REM STATEMENT
Denotes non-executable documentary remarks in a program listing.
Return
- RENUM newln,[oldln,] int COMMAND
Renumbers program lines starting at old ln using new ln with specified interval and emends internal line number references in program.
Return
- RESTORE [ln] STATEMENT
Reinitializes to DATA statement at first available program line number or specified line number.
Return
- RETURN STATEMENT
Redirects program from a subroutine back to the command following the executed GOSUB.
Return
- RIGHT$ (var$,n) FUNCTION
Returns the string of the last (rightend) n characters of the literal variable.
Return
- RUN [ln] COMMAND
Initiates program execution at first or specified line number.
Return
- SAVE "filespec"[,A] COMMAND
Writes the program listing to the current or specified disk in compressed format unless specified ASCII text format as a file name given in filespec with extension .BAS unless otherwise specified.
Return
- SCREEN num STATEMENT
Sets the screen mode for text and/or graphics according to mode number.
Return
- SGN (opr) FUNCTION
Returns the unit sign (+1 or -1) of the operand (or 0 if zero).
Return
- SPACE$ (n) FUNCTION
Returns of string of n blank spaces.
Return
- SIN (opr) FUNCTION
Returns the sine of the operand angle given in radians.
Return
- SQR (opr) FUNCTION
Returns the square root of the operand.
Return
- STOP STATEMENT
Ends program execution and returns to IMMEDIATE mode.
Return
- STR$ (var) FUNCTION
Returns the literal string of a decimal numeric variable.
Return
- STRING$ (n,m) FUNCTION
Returns a string of n characters of code m.
Return
- SYSTEM COMMAND
Exits BASIC and returns to DOS.
Return
- TAB (num) FUNCTION
Advances the print position to specified column position (1-80).
Return
- TAN (opr) FUNCTION
Returns the tangent of the operand angle given in radians.
Return
- TIME$ STATEMENT/VARIABLE
Assigns/evaluates the clock string "HH:MM:SS"
Return
- var = TIMER FUNCTION
Assigns the seconds value (within 0.05 sec) of counter since either midnight or reset to specified variable.
Return
- VAL (var$) FUNCTION
Returns the numeric value of the literal variable.
Return
- WHILE var rel val ...WEND STATEMENT
Repeats all commands in succession up to WEND until relation is no longer true.
Return
- WRITE #buf, var(s) STATEMENT
Writes the values of the variable list to the specified sequential file buffer.
Return
Additional INTERFACING Commands:
- DEF SEG = addr STATEMENT
Defines the base segment address for the 64 Kbyte memory block accessible by BASIC. If no address supplied then default segment address will be assigned.
Return
- var = INP (addr) FUNCTION
Assigns one byte value from input port having 10-bit device code address to specified variable.
Return
- OUT (addr, var) STATEMENT
Sends a one byte variable value to output port having 10-bit devide code address.
Return
- POKE addr, var STATEMENT
Writes a one byte variable value to 16 bit memory address offset from the current segment address.
Return
- var = PEEK (addr) FUNCTION
Assigns a one byte value read from 16 bit memory address offset from segment to the variable specified.
Return
- var = TIMER FUNCTION
Assigns the seconds value (within 0.05 sec) of counter since either midnight or reset to specified variable.
- "We wrote the programs in BASIC. Yes, we did! We can already hear people complaining because they would never consider touching this outdated, inefficient, and unstructured language which is known to prevent writing good programs. So why did we chose it? First of all, BASIC is a language which should easily be available to all programmers. It comes built-in or free with many computers...Furthermore, we believe that BASIC - or what we used of it - is so simple that even someone not familiar with programming should be able to understand what the programs are doing. Thus, it takes only a small effort to get ready to play with the programs and perhaps try out modifications. Finally, for all you lovers of more aesthetic computer languages, it should be no problem to translate these programs to you favorite dialect and type it on the fly into the machine."
Fractals for the Classroom by Peitgen, Jurgens and Saupe, Springer-Verlag, 1994
- "A spreadsheet is typically a poor choice for problems that can be solved with a FOR...NEXT kind of structure. It takes longer to create all the cells in the spreadsheet than to write a BASIC or Pascal program to solve such a problem."
from "Solving Problems with Math Tools" by J. R. Hines, Engineering Tools, Feb. 1988
- "This book uses BASIC exclusively, and perhaps deserves some explanation. BASIC has an odious reputation among computer experts, often because they are familiar only with mainframe BASIC; partly it is pure snobbery. Microcomputer BASIC has many fine features and is, in some respects, superior to the 'better' languages. It is a powerful language for scientific computations..."
Physical Chemistry on a Microcomputer by J. H. Noggle, Little, Brown & Co., 1985
- EDITOR'S NOTE: The italics in the above quotes are mine! Pef
Return to List