10 '******************** BASIC DATA GENERATOR ******************** 20 ' Version 1.1 30 '* Copyright (c) 1984 by Robert L. Wersan, all rights reserved 31 ' Permission hereby granted for noncommercial copying for personal use. 32 ' This program must not be sold by itself or as part of a software package 33 ' without express permission. 40 ' New York, NY 10027 50 ' (212) 865-3187 60 '************************************************************** 70 ' This program produces a sequential data file with as many records 80 ' as desired. The data is taken randomly from lists of names, addresses, 90 ' companies cities, states, and so on. Numerical data is created 100 ' by random number generations. Any resemblence to actual people, 110 ' companies, etc. is a matter of random coincidence. 120 ' The program's purpose is generate dummy data for testing programs like 130 ' Dbase II (a registered trade mark of Ashton-Tate) without need for 140 ' actually keying in thousands of lines of data. 141 ' Many thanks to Ross Greenberg who helped nurture this program in its 142 ' embryonic stages. He is not responsible for its defects, however. 150 ' 160 ' *********** Following is a list of the fields, lengths, types ********* 170 ' 180 ' FIELD TYPE LENGTH DECIMAL PLACES 190 ' 200 ' First name Character 15 210 ' Last name Character 15 220 ' Title Character 30 230 ' Company name Character 30 240 ' Address 1 Character 30 250 ' Address 2 Character 30 260 ' City Character 13 270 ' State Character 2 280 ' Zip code Character 5 290 ' Sales Last Month Numeric 7 2 300 ' Sale Yr-to-date Numeric 8 2 310 ' 320 ' 330 ' 340 ' ******************************************************************** 350 ' Fields are comma delimited. To enter data in a dBase II file, 360 ' create a ' .DBF ' file with dBase II with the proper field lengths, 370 ' and make sure that the file you create with Generate has the 380 ' extension ' .TXT '. To put the data you generated into the 390 ' .DBF file use the following commands: 400 ' 410 ' USE [.dbf filename] 420 ' APPEND FROM [Generated filename.txt] DELIMITED 430 ' 440 ' If all works, you should get messages showing how many 450 ' records are being appended to the .dbf file. 460 ' 470 ' ********************************************************************* 480 ' 490 ' Try modifying Generate to make user-selectable field lengths or name 500 ' choices. Good luck. 510 ' 520 ' ********************************************************************* 530 REM -- CLS$ IS CLEAR SCREEN COMMAND. CHANGE IT TO SUIT YOUR TERMINAL 535 CLS$=CHR$(26) ' USE CHR$(12) FOR IBM-PC 537 ' **************************************************************** 540 DIM FIRST$(20), LAST$(20), TITLE$(20) 550 DIM COMPANY$(20), ADR1$(20), ADR2$(20), CITY$(20), STATE$(20) 560 DIM LAST1$(20), LAST2$(20), CMP1$(20), CMP2$(20), CMP3$(20) 570 DIM ADR3$(20) 580 PRINT CLS$:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT 590 PRINT "SELECT the name of the data file you wish to create." 600 PRINT "Use standard file naming rules." 610 PRINT "Use .TXT extension if you wish to append data to a dBaseII file." 620 PRINT:INPUT "ENTER the file name here ---------> ",F$ 630 PRINT CLS$:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT 640 INPUT "How many records would you like to produce? ",Z 650 PRINT CLS$:PRINT: PRINT: PRINT :PRINT :PRINT :PRINT:PRINT:PRINT:PRINT 660 PRINT "Do you want to see the records you create on screen?" 670 PRINT "Enter Y for Yes." : PRINT 680 INPUT "Any other entry will not produce a display. ----> ",RESP$ 690 PRINT CLS$ 700 OPEN "O",#1,F$ 710 FIRST$(0)="Stephen" 720 FIRST$(1)="Elmer" 730 FIRST$(2)="Eugene" 740 FIRST$(3)="Bruce" 750 FIRST$(4)="Russell" 760 FIRST$(5)="George" 770 FIRST$(6)="Joseph" 780 FIRST$(7)="Ross" 790 FIRST$(8)="Nancy" 800 FIRST$(9)="Peggy Sue" 810 FIRST$(10)="Mary Lou" 820 FIRST$(11)="Louis" 830 FIRST$(12)="Juliette" 840 FIRST$(13)="Louisa" 850 FIRST$(14)="Hector" 860 FIRST$(15)="Francis X." 870 FIRST$(16)="Charles" 880 FIRST$(17)="Timothy" 890 FIRST$(18)="Groucho" 900 FIRST$(19)="Adam" 910 REM Following are the first halves of the last names 920 LAST1$(0)="Galanter" 930 LAST1$(1)="Raisch" 940 LAST1$(2)="Gold" 950 LAST1$(3)="Silver" 960 LAST1$(4)="Guilden" 970 LAST1$(5)="Rosen" 980 LAST1$(6)="Storm" 990 LAST1$(7)="Macken" 1000 LAST1$(8)="Chicken" 1010 LAST1$(9)="Quacken" 1020 LAST1$(10)="Twelve" 1030 LAST1$(11)="Green" 1040 LAST1$(12)="Roover" 1050 LAST1$(13)="Winter" 1060 LAST1$(14)="Sommer" 1070 LAST1$(15)="Spring" 1080 LAST1$(16)="Corn" 1090 LAST1$(17)="Mason" 1100 LAST1$(18)="Steel" 1110 LAST1$(19)="Franken" 1120 REM Follwing are the last halves of the last names 1130 LAST2$(0)="burger" 1140 LAST2$(1)=" " 1150 LAST2$(2)="stein" 1160 LAST2$(3)="smith" 1170 LAST2$(4)="worthy" 1180 LAST2$(5)="owsky" 1190 LAST2$(6)="stover" 1200 LAST2$(7)="ington" 1210 LAST2$(8)="love" 1220 LAST2$(9)="croft" 1230 LAST2$(10)="marsh" 1240 LAST2$(11)="haven" 1250 LAST2$(12)="martin" 1260 LAST2$(13)="bush" 1270 LAST2$(14)="power" 1280 LAST2$(15)="berg" 1290 LAST2$(16)="tower" 1300 LAST2$(17)="crantz" 1310 LAST2$(18)="ly" 1320 LAST2$(19)="son" 1330 REM FOLLOWING ARE THE TITLES 1340 TITLE$(0)="President" 1350 TITLE$(1)="Resident Sage" 1360 TITLE$(2)="Janitor" 1370 TITLE$(3)="Assistant General Submanager" 1380 TITLE$(4)="Secretary" 1390 TITLE$(5)="Dog Catcher" 1400 TITLE$(6)="Big Shot" 1410 TITLE$(7)="Generalissimo-in-charge" 1420 TITLE$(8)="Field Marshall" 1430 TITLE$(9)="Librarian" 1440 TITLE$(10)="Secretary-General" 1450 TITLE$(11)="District Relief Supervisor" 1460 TITLE$(12)="Gauleiter" 1470 TITLE$(13)="Superintendent" 1480 TITLE$(14)="Overlord" 1490 TITLE$(14)="Cookie Cutter" 1500 TITLE$(15)="Chief Cook & Bottle Washer" 1510 TITLE$(16)="Trainer" 1520 TITLE$(17)="Publisher" 1530 TITLE$(18)="Editor-in-Chief" 1540 TITLE$(19)="Office Boy" 1550 REM There are three parts to the company names 1560 CMP1$(0)="System " 1570 CMP1$(1)="Data " 1580 CMP1$(2)="Computer " 1590 CMP1$(3)="Power " 1600 CMP1$(4)="Commodity " 1610 CMP1$(5)="Western " 1620 CMP1$(6)="Amalgamated " 1630 CMP1$(7)="Concatenated " 1640 CMP1$(8)="Nationwide " 1650 CMP1$(9)="Worldwide " 1660 CMP1$(10)="Pangalactic " 1670 CMP1$(11)="Galactic " 1680 CMP1$(12)="Intergalactic " 1690 CMP1$(13)="Transpolar " 1700 CMP1$(14)="Humongous " 1710 CMP1$(15)="Molecular " 1720 CMP1$(16)="Advisory " 1730 CMP1$(17)="Tertiary " 1740 CMP1$(18)="Gradient " 1750 CMP1$(19)="Divisional " 1760 CMP2$(0)="Design " 1770 CMP2$(1)="Network " 1780 CMP2$(2)="Matrix " 1790 CMP2$(3)="Oribital " 1800 CMP2$(4)="Channel " 1810 CMP2$(5)="Vector " 1820 CMP2$(6)="Scalar " 1830 CMP2$(7)="Polar " 1840 CMP2$(8)="Aids " 1850 CMP2$(9)="Micro " 1860 CMP2$(10)="News " 1870 CMP2$(11)="Data " 1880 CMP2$(12)="Tech " 1890 CMP2$(13)="Video " 1900 CMP2$(14)="Audio " 1910 CMP2$(15)="Radio " 1920 CMP2$(16)="Sound " 1930 CMP2$(17)="Ports " 1940 CMP2$(18)="Sports " 1950 CMP2$(19)="Interlock " 1960 CMP3$(0)="Inc." 1970 CMP3$(1)="Co." 1980 CMP3$(2)="Corp." 1990 CMP3$(3)="Assoc." 2000 CMP3$(4)="Group" 2010 CMP3$(5)="Ptrshp." 2020 CMP3$(6)="Orgn." 2030 CMP3$(7)="P & L" 2040 CMP3$(8)="Ltd." 2050 CMP3$(9)="Pty." 2060 CMP3$(10)="House" 2070 CMP3$(11)="School" 2080 CMP3$(12)="H.S." 2090 CMP3$(13)="Univ." 2100 CMP3$(14)="Mfg." 2110 CMP3$(15)="Sales" 2120 CMP3$(16)="GMBH" 2130 CMP3$(17)="Farben" 2140 CMP3$(18)="S.A." 2150 CMP3$(19)="Inc." 2160 ADR1$(0)="Maple " 2170 ADR1$(1)="Main " 2180 ADR1$(2)="South 9th " 2190 ADR1$(3)="West Water " 2200 ADR1$(4)="Twelfth " 2210 ADR1$(5)="Overton " 2220 ADR1$(6)="Madison " 2230 ADR1$(7)="Vesey " 2240 ADR1$(8)="Wimpole " 2250 ADR1$(9)="Downing " 2260 ADR1$(10)="Broadway " 2270 ADR1$(11)="Penn " 2280 ADR1$(12)="High " 2290 ADR1$(13)="Caxton " 2300 ADR1$(14)="Mill " 2310 ADR1$(15)="Taylor " 2320 ADR1$(16)="Hilltop " 2330 ADR1$(17)="Alton " 2340 ADR1$(18)="Flattop " 2350 ADR1$(19)="Exeter " 2360 ADR2$(0)="Street" 2370 ADR2$(1)="Road" 2380 ADR2$(2)="Court" 2390 ADR2$(3)="Circle" 2400 ADR2$(4)="Avenue" 2410 ADR2$(5)="Lane" 2420 ADR2$(6)="Square" 2430 ADR2$(7)="Crescent" 2440 ADR2$(8)="Highway" 2450 ADR2$(9)="Boulevard" 2460 ADR2$(10)="Grove" 2470 ADR2$(12)="Street" 2480 ADR2$(11)="Alley" 2490 ADR2$(13)="Way" 2500 ADR2$(14)="Level" 2510 ADR2$(15)="Canal" 2520 ADR2$(16)="Egress" 2530 ADR2$(17)="Trail" 2540 ADR2$(18)="Cove" 2550 ADR2$(19)="Towpath" 2560 ADR3$(0)="Suite " 2570 ADR3$(1)="P.O. Box " 2580 ADR3$(2)="Room " 2590 ADR3$(3)="Apt. " 2600 ADR3$(4)="R.F.D. " 2610 ADR3$(5)="Box " 2620 ADR3$(6)="Route " 2630 ADR3$(7)="Drawer " 2640 ADR3$(8)="Desk " 2650 ADR3$(9)="Branch " 2660 ADR3$(10)="Corridor " 2670 ADR3$(11)="Room " 2680 ADR3$(12)="Block " 2690 ADR3$(13)="Pouch " 2700 ADR3$(14)="Suite " 2710 ADR3$(15)="Cottage " 2720 ADR3$(16)="Box " 2730 ADR3$(17)="Flat " 2740 ADR3$(18)="Floor " 2750 ADR3$(19)="Level " 2760 CITY$(0)="New York" 2770 CITY$(1)="Cincinatti" 2780 CITY$(2)="St. Louis" 2790 CITY$(3)="London" 2800 CITY$(4)="Dover" 2810 CITY$(5)="Washington" 2820 CITY$(6)="Santa Clara" 2830 CITY$(7)="Santa Cruz" 2840 CITY$(8)="Santa Barbara" 2850 CITY$(9)="Santa Rosa" 2860 CITY$(10)="Howden" 2870 CITY$(11)="Miles" 2880 CITY$(12)="Wayne" 2890 CITY$(13)="Wells" 2900 CITY$(14)="Toledo" 2910 CITY$(15)="Union City" 2920 CITY$(16)="Pulver" 2930 CITY$(17)="Pullman" 2940 CITY$(18)="Chatham" 2950 CITY$(19)="Hillsdale" 2960 STATE$(0)="NY" 2970 STATE$(1)="NJ" 2980 STATE$(2)="OR" 2990 STATE$(3)="PA" 3000 STATE$(4)="MO" 3010 STATE$(5)="MD" 3020 STATE$(6)="WA" 3030 STATE$(7)="OH" 3040 STATE$(8)="FL" 3050 STATE$(9)="LA" 3060 STATE$(10)="GA" 3070 STATE$(11)="TX" 3080 STATE$(12)="KS" 3090 STATE$(13)="MN" 3100 STATE$(14)="WI" 3110 STATE$(15)="VT" 3120 STATE$(16)="CT" 3130 STATE$(17)="CA" 3140 STATE$(18)="MA" 3150 STATE$(19)="IL" 3160 FOR J=1 TO Z 3170 REM ***** FOLLOWING STATEMENTS ACCESS OTRONA CLOCK FOR RANDOMIZATION ***** 3180 REM PRINT CHR$(27);">" 3190 REM SEC$ = INKEY$ 3200 REM TSEC$= INKEY$ 3210 REM MIN$ = INKEY$ 3220 REM ROOT$ = SEC$+TSEC$+MIN$ 3230 REM Y=VAL(ROOT$) 3240 REM P=Y^2 3250 REM P$=STR$(P) 3260 REM Q$=MID$(P$,3,3) 3270 REM Q=VAL(Q$) 3280 REM ******** END OF ROPED-OFF OTRONA AREA ********************* 3290 ' 3300 REM NEXT 3 LINES MUST BE REMOVED OR REM'D IF IMPLEMENTING OTRONA ROUTINE 3310 PROD = ASC(F$)*10 3320 PROD = PROD^2 + SQR(J) 3330 Q = PROD/100 + J 3340 REM ABOVE 3 LINES USE ASCII DEC VALUE OF 1st FILENAME CHAR + COUNTER VALUE 3350 ' FOR RANDOM SEED 3360 ' 3370 RANDOMIZE (Q) 3380 ' REMOVE OR REM ABOVE RANDOMIZE STATEMENT IF NEED BE FOR CONSITANT RUNS 3390 DEF FNR(Q)=INT(RND(Q)*20) 3400 DEF FNA(Q)=INT(RND(Q)*10) 3410 DEF FNR$(Q)=CHR$(FNA(Q)+48)+CHR$(FNA(Q)+48)+CHR$(FNA(Q)+48) 3420 FIRST%=FNR(Q) 3430 LAST1%=FNR(Q) 3440 LAST2%=FNR(Q) 3450 TITLE%=FNR(Q) 3460 CITY%=FNR(Q) 3470 STATE%=FNR(Q) 3480 FIRST$=FIRST$(FIRST%) 3490 LAST$=LAST1$(LAST1%)+LAST2$(LAST2%) 3500 TITLE$=TITLE$(TITLE%) 3510 COMPANY$=CMP1$(FNR(Q))+CMP2$(FNR(Q))+CMP3$(FNR(Q)) 3520 ADR1$=FNR$(Q)+" "+ADR1$(FNR(Q))+ADR2$(FNR(Q)) 3530 ADR2$=ADR3$(FNR(Q))+FNR$(Q) 3540 CITY$=CITY$(CITY%) 3550 STATE$=STATE$(STATE%) 3560 ZIP$ =FNR$(Q)+CHR$(FNA(Q)+48)+CHR$(FNA(Q)+48) 3570 LM#=(RND(Q))*10000# 3580 YTD#=(RND(Q))*100000# 3590 IF YTD#