Thursday, July 9, 2015

Remember Visicalc?

What if Software Arts had patented Visicalc, Visiword, and etc?  Would office365 and Libreoffice never have existed?   Picture is actual VC.com running in the dosbox emulator.



Per www.archive.org

VisiCalc was the first spreadsheet computer program, originally released for the Apple II. It is often considered the application that turned the microcomputer from a hobby for computer enthusiasts into a serious business tool. VisiCalc sold over 700,000 copies in six years.

Conceived by Dan Bricklin, refined by Bob Frankston, developed by their company Software Arts, and distributed by Personal Software in 1979 (later named VisiCorp) for the Apple II computer, it propelled the Apple from being a hobbyist's toy to a useful tool for business, two years before the introduction of the IBM PC.

VisiCalc was, in part, inspired by earlier "row and column" spreadsheet programs in widespread use on systems of several national timesharing companies. Notable among these products were Business Planning Language (BPL) from International Timesharing Corporation (ITS) and Foresight, from Foresight Systems. Dan Bricklin writes, "[W]ith the years of experience we had at the time we created VisiCalc, we were familiar with many row/column financial programs. In fact, Bob had worked since the 1960s at Interactive Data Corporation, a major timesharing utility that was used for some of them and I was exposed to some at Harvard Business School in one of the classes." However, these earlier timesharing spreadsheet programs were not completely interactive, nor did they run on personal computers.

According to Bricklin, he was watching a professor at Harvard Business School create a financial model on a blackboard. When the professor found an error or wanted to change a parameter, he had to erase and rewrite a number of sequential entries in the table. Bricklin realized that he could replicate the process on a computer using an "electronic spreadsheet" to view results of underlying formulae. The development of Visicalc took two months of work by Frankston and Bricklin during the winter of 1978–79.
Some references:

http://macgui.com/downloads/?file_id=24477
http://www.benlo.com/visicalc/visicalc2.html
http://www.bricklin.com/history/vcexecutable.htm

Of course many companies have copied it. Some people have developed and programmed their own spreadsheets.  An electronic spreadsheet is sort of a calculator and an accountants worksheet all built into one. Here is the original code that I found for an old cpm operating system (control process for microcomputers) written for the zbasic language interpreter.  Eventually converted it to qbasic and freebasic,


Original command set:

 ' lizzycalc version -1
'
' updated March 1995  for qbasic.
' last update: January 1996
'
' commands      : description
'---------------:-----------------------------------------------
' "/'/^text     : enter text in a current cell (left/right/middle just)
' =expression   : enter number or formula in a current cell
' \text         : repeat text up to cell width
' |fun          : static special functions i. e. time, date, file
'               : smv, or smh
' @func         : real-time special functions of above
' c             : change column width
' d             : numeric data file of certain cells
' f             : do file operations (load/save/new)
' h or ?        : show this help screen
' i             : insert row or column
' j             : toggle form feed after print flag
' p             : output results to file or printer without the border
' q             : quit
' r             : replicate a single cell multiple times
' s             : output data to file or printer"
' u             : toggle update screen flag
' arrow keys    : move cursor in indicated direction
' expressions   : numeric constant or cell id in form <col letter><row#>
'                 above items separated by operators +,-,*,^,|, or /
'                 evaluation is from left to right without operator
'                 preference.  expressions are evaluated on enter and
'                 on the u command.
 https://computothought.files.wordpress.com/2009/10/ss.png

Original code I typed and then added a bit.

[code]
1000 '
1010 ' lizzycalc .01
1020 '
1030 ' for zbasic but could be converted to other basics
1040 ' updated march 1993 by computoman
1050 '
1060 ' commands:
1070 ' "text" : enter text in a current cell
1080 ' =expression : enter number or formula in a current cell
1090 ' cxxx : evaluate expressions and update screen
1100 ' arrow keys : move cursor in indicated direction
1110 '
1120 ' expressions:
1130 ' numeric constant or cell id in form <col>
1140 ' above items separated by operators +,-,*, or /
1150 ' evaluation is from left to right without operator preference
1160 ' expressions are evaluated on entery and on the "C" command.
1170 '
1180 '
1190 DEFINT I,N,W,X,Y : KEY OFF
1200 SCRDEPTH = 20
1210 SCRWIDTH = 80
1220 COLWIDTH = 10
1230 MAXCOL=INT(SCRWIDTH/(COLWIDTH + 1))
1240 MAXROWS = SCRDEPTH
1250 DIM D(MAXCOL,MAXROWS)
1260 DIM D$(MAXCOL,MAXROWS)
1270 NUMOPS = 5
1280 DIM O$(NUMOPS)
1290 O$(1) = "=" : O$(2) = "+" : O$(3) = "-" : O$(4) = "*" : O$(5) = "/"
1300 '
1310 '************* init ************
1320 FOR X = 1 TO MAXCOL
1330 D$(X,0) = SPACE$(COLWIDTH - 1) + CHR$(X+ASC("A")-1)
1340 NEXT X
1350 FOR Y =1 TO MAXROWS
1360 D$(0,Y) = SPACE$(COLWIDTH-2)+RIGHT$(STR$(Y),2)
1370 NEXT Y
1380 GOSUB 1610
1390 CRSX = 1 : CRSY = 1 : GOSUB 1890
1400 COLOR 0,7 : LOCATE YLOC,XLOC : PRINT SPACE$(COLWIDTH); : COLOR 7,0
1410 '
1420 ' command loop
1430 '
1440 WHILE 0&lt;1
1450 LOCATE 23,1 : PRINT SPACE$(79);: IN$=&quot;&quot; : IK = 0
1460 LOCATE 23,1 : PRINT&quot;CMD: &quot;;
1470 WHILE IK 13
1480 I$= INKEY$ : IF I$ = "" THEN 1480
1490 IK = ASC(I$)
1500 IF LEN(I$) = 2 THEN GOSUB 9000: GOSUB 2100:GOSUB 1720 ELSE IF IK = 8 THEN GOSUB 1940 ELSE IF IK 13 THEN PRINT I$;: IN$ = IN$ + I$
1510 WEND
1520 C$ = LEFT$(IN$,1)
1530 LOCATE 24,1 : PRINT SPACE$(79);
1540 LOCATE 24,1 : PRINT IN$;
1550 IF C$ = CHR$(34) THEN GOSUB 1990 ELSE IF C$="=" THEN GOSUB 2050 ELSE IF C$="C" THEN GOSUB 2740 ELSE IF C$ = "F" THEN GOSUB 4000 ELSE ER$ = "BAD INPUT: "+IN$: GOSUB 2660
1560 WEND
1570 '
1580 '
1590 '
1600 ' sub to print screen
1610 CLS : DD = 0 : TEMPY = CRSY : TEMPX = CRSX
1620 LOCATE 25,31: PRINT "LIZZYCALC .01" : LOCATE 1,1
1630 FOR CRSY = 0 TO MAXROWS
1640 FOR CRSX = 0 TO MAXCOL
1650 GOSUB 2100 : PRINT V$;
1660 NEXT CRSX
1670 NEXT CRSY
1680 CRSX = TEMPX : CRSY = TEMPY
1690 RETURN
1700 '
1710 'sub to move cursor
1720 ON IK-71 GOSUB 1850,0,0,1790,0,1810,0,0,1830
1730 LOCATE YLOC,XLOC : PRINT V$;
1740 LOCATE 24,1 : PRINT SPACE$(79);
1750 LOCATE 24,1 : PRINT D$(CRSX,CRSY);
1760 GOSUB 2890
1770 LOCATE 23,LEN(IN$)+5
1780 RETURN
1790 ' move left
1800 IF CRSX &gt; 1 THEN CRSX = CRSX - 1 : RETURN ELSE RETURN
1810 'move right
1820 IF CRSX &lt; MAXCOL THEN CRSX = CRSX + 1 : RETURN ELSE RETURN
1830 ' move down
1840 IF CRSY 1 THEN CRSY = CRSY -1 : RETURN ELSE RETURN
1870 '
1880 ' sub to compute screen postion
1890 XLOC = (COLWIDTH * CRSX)+1
1900 YLOC = CRSY + 1
1910 RETURN
1920 '
1930 ' sub to process backspace on command line
1940 NEWLEN = LEN(IN$)-1
1950 IF NEWLEN &gt;=0 THEN PRINT CHR$(8);: IN$ = LEFT$(IN$,NEWLEN)
1960 RETURN
1970 '
1980 ' sub to formulate input
1990 D(CRSX,CRSY)=0:TEXTLEN=LEN(IN$)-1:IF TEXTLEN&lt;1 THEN TEXTLEN=1
2000 IF RIGHT$(IN$,1)=CHR$(34) THEN TEXTLEN = TEXTLEN-1
2010 D$(CRSX,CRSY) = LEFT$(MID$(IN$,2,TEXTLEN),COLWIDTH)
2015 GOSUB 2890
2020 RETURN
2030 '
2040 'sub to formula input
2050 V$ = IN$ : GOSUB 2140
2060 IF ERRFLAG = 0 THEN D$(CRSX,CRSY) = IN$
2065 GOSUB 2890
2070 RETURN
2080 '
2090 'SUB TO PREPARE OUTPUT
2100 IF LEFT$(D$(CRSX,CRSY),1)=&quot;=&quot; THEN V$=RIGHT$(SPACE$(COLWIDTH)+STR$(D(CRSX,CRSY)),COLWIDTH) ELSE V$=LEFT$(D$(CRSX,CRSY)+SPACE$(COLWIDTH),COLWIDTH)
2110 RETURN
2120 '
2130 ' SUB TO EVALUATE EXPRESSION
2140 ERRFLAG = 0 : VI$ = V$
2150 WHILE V$""
2160 GOSUB 2310
2170 IF ERRFLAG 0 THEN ER$="BAD OPERATOR IN:"+VI$: GOSUB 2660 : RETURN
2180 GOSUB 2400
2190 IF ERRFLAG 0 THEN ER$="BAD FORMULA:"+VI$: GOSUB 2660: RETURN
2200 ON OPCODE GOSUB 2240,2250,2260,2270,2280
2210 WEND
2220 D(CRSX,CRSY) = VL
2230 RETURN
2240 VL = V : RETURN
2250 VL = VL + V : RETURN
2260 VL = VL - V : RETURN
2270 VL = VL * V : RETURN
2280 VL = VL / V : RETURN
2290 '
2300 ' SUB TO DECODE OPERATOR
2310 OP$ = LEFT$(V$,1)
2320 OPCODE = 0
2330 FOR I = 1 TO NUMOPS
2340 IF OP$=O$(I) THEN OPCODE = I : I = NUMOPS:V$=MID$(V$,2)
2350 NEXT I
2360 IF OPCODE = 0 THEN ERRFLAG = 1
2370 RETURN
2380 '
2390 'SUB TO DECODE OPERAND
2400 V = VAL(V$) : C$=LEFT$(V$,1) : ERRFLAG = 0 : T = 0
2410 IF V = 0 AND C$"0" THEN GOSUB 2530 ELSE GOSUB 2450
2420 RETURN
2430 '
2440 'SUB TO PROCESS AS A CONSTANT
2450 IX=1:IF C$="-" THEN C$="0"
2460 WHILE (C$&gt;="0" AND C$ 32 THEN C = C - 32
2540 IF C MAXCOL THEN ERRFLAG = 1 : RETURN
2550 XC=C : C = 0
2560 WHILE V$"" AND C&gt;=0 AND C&lt;=9
2570 V$=MID$(V$,2)
2580 IF V$"" THEN C=ASC(V$)-ASC("0") : IF C&gt;=0 AND C MAXROWS THEN ERRFLAG = 1 : RETURN
2610 YC = T
2620 V = D(XC,YC)
2630 RETURN
2640 '
2650 ' SUB TO GENERATE GENERAL ERROR REPORT
2660 LOCATE 24,1 : PRINT ER$+" ";
2670 BEEP
2680 WHILE INKEY$="" : WEND
2690 LOCATE 24,1 : PRINT SPACE$(79);
2700 LOCATE 24,1 : PRINT D$(CRSX,CRSY);
2710 RETURN
2720 '
2730 ' sub to update formula values
2740 LOCATE 24,1 : PRINT SPACE$(79);
2750 LOCATE 24,1 : PRINT"Caculating!";
2760 TEMPY=CRSY: TEMPX = CRSX
2770 FOR CRSY = 1 TO MAXROWS
2780 FOR CRSX = 1 TO MAXCOL
2790 IF LEFT$(D$(CRSX,CRSY),1)="=" THEN V$=D$(CRSX,CRSY): GOSUB 2140 : GOSUB 1890 : LOCATE YLOC,XLOC: GOSUB 2100: PRINT V$;
2800 NEXT CRSX
2810 NEXT CRSY
2820 CRSX = TEMPX : CRSY = TEMPY : GOSUB 1890
2830 GOSUB 2890
2840 LOCATE 24,1 : PRINT STRING$(79," ");
2850 LOCATE 24,1 : PRINT D$(CRSX,CRSY);
2860 RETURN
2870 '
2880 ' sub to show current cell value
2890 GOSUB 1890 : GOSUB 2100 : COLOR 0,7
2900 LOCATE YLOC,XLOC: PRINT V$;: COLOR 7,0
2910 RETURN
4000 '--
4001 ' (F)ile routine
4002 '--
4010 LOCATE 23,1 : PRINT SPACE$(79);
4020 LOCATE 23,1 : INPUT"Enter (L)oad or (S)ave data: ",QQ$
4030 LOCATE 24,1 : PRINT SPACE$(79);
4040 LOCATE 24,1 : INPUT"Enter file name: ",DATUM$
4050 WHILE QQ$="L"
4060 OPEN DATUM$ FOR INPUT AS #1
4070 FOR AY = 1 TO MAXROWS
4080 FOR AX = 1 TO MAXCOL
4090 INPUT#1,D(AX,AY),D$(AX,AY)
4100 NEXT AX
4110 NEXT AY
4120 CLOSE#1
4140 QQ$=""
4150 WEND
5050 WHILE QQ$="S"
5060 OPEN DATUM$ FOR OUTPUT AS #1
5070 FOR AY = 1 TO MAXROWS
5080 FOR AX = 1 TO MAXCOL
5090 PRINT#1,D(AX,AY),D$(AX,AY)
5100 NEXT AX
5110 NEXT AY
5120 CLOSE#1
5140 QQ$=""
5150 WEND
9000 '
9010 ' fix i$
9020 IK = ASC(RIGHT$(I$,1))
9030 RETURN
[/code]

No comments:

Post a Comment