home *** CD-ROM | disk | FTP | other *** search
-
- PROGEN71
-
- (PRO)GRAM (GEN)ERATOR FOR MICROSOFT ISAM FILES
- By:
- Raymond E Dixon
- 11660 VC Johnson Rd.
- Jacksonville, Fl 32218
- (904) 765-4048
-
- FILES created BY PROGEN71:
-
- CREATE.BAT ' compile and link the last generated program
- EDIT.BAT ' load prolib71.qlb and last generated program
-
- YOUR PROGRAM NAME.BAS 'source code error free!
-
- 'if you change your code who knows.
- 'remember PROGEN71 erases your old database if you use the same
- 'name to recreate your database because ISAM can't handle changes
- 'in type structures so if you add or delete fields ISAM can't read
- 'old file.
- 'you can create or delete key fields within your program as long
- 'as you use existing fields.
-
-
- YOUR PROGRAM NAME.FLD 'field data
- YOUR PROGRAM NAME.F1 'database field index
- YOUR PROGRAM NAME.F2 'database field index
-
- FILES used by SAMPLE ' sample program field data
-
- SAMPLE.FLD 'field data
- SAMPLE.F1 'database field index
- SAMPLE.F2 'database field index
-
- FILES included with PROGEN71
-
- PROGEN71.EXE 'the source generator with source code
- PROSCN71.EXE 'screen generator with source code
-
- PROSRC71.ZIP 'source code for progrn71 and proscrn71
-
- PROLIB71.BAT 'creates LIB and QLB fiiles with asm function
- PROLIB71.BAS 'bas function and subs needed by source
-
- PROASM71.BAT 'creates obj and lib files to link with PROLIB71
- PROASM71.ASM 'asm function and subs needed by source
-
- EDA.BAT 'loads user program and asm lib function
- EDP.BAT 'loads user program and PROLIB71.QLB with
- 'all function and subs.
-
- ---------------------------------------------------------------
- (a few words from me)
-
- This program came about when I got tired of search
- and replace every time I needed a new database for
- myself or a friend. I feel like most programmers tend
- to modify existing code rather than start from scratch
- so I decided why not let the computer do all the work
- for me. I know there are plenty of programs out there
- that will write data bases for you but most were copyrighted
- (and or) carried a lots of excess baggage that I never
- needed. PROGEN writes complete ready to run programs
- that need no editing.
-
- All the subs and function or included with the
- source code. You can edit or change any part of your
- program to suite your needs. You can use PROGEN to
- wright a program to write your on programs with, the
- bulk code that's in PROGEN71 was written with PROGEN
- it's self. Just write a module to read all common code
- in and add the new code where needed and write to file.
-
- Remember all programs created with PROGEN can be
- recreated in seconds unless deleted from database,
- progen writes all batch files needed to compile and
- link the programs written by PROGEN. Even though
- this version has some limitation such as max 10
- fields, it can write almost any database needed for
- most, you can easily add fields to the source code and
- change screens and edits to reflect the changes.
-
- The version I use allows 250 fields and 20 screens
- for data. I will release a my personel version soon if
- there's any interest from the users out there !. I may
- charge a small fee for my services to cover updates
- and shipping (unless you send me some good code.
-
- There seems to be a shortage of free code for users
- anymore so lets see if we can swap some ideas around
- like the good old days of CP/M and TRSDOS.
-
- I know it's hard to write basic subs because there are
- so mamy on the market that are (c) copyrighted !! if you
- wright more than a one line program somebody claims it
- was in their lib but I find 90% of their code in some
- book somewhere, I even found code from a popular tool.box
- in a 15 year old book a few days ago. I not sure it's
- possible to copyright a sub routine , maybe sub programs
- that do something in a special way that used a special
- interface that no one could easly come up with.
-
- Don't get me wrong I beleve everone should be able to
- protect there work with a copyright if it's a program
- that does something usefull. But if you release the code
- to the public copyrighting seems to be a little silly to
- me. If you really won't to protect your code why release
- it. Microsoft don't give out the code for QuickBasic or
- any of their programs that they won't protected.
-
-
- I would release the source for PROGEN but every one seems
- to want to make a buck now days on anything and everything
- but I may release this version later on if any one seems
- to want it . The source code generated by PROGEN is free
- to use, sell or GIVEAWAY!. Some ASM code was modified for
- QBX FAR STRING support and all code supports FAR AND NEAR
- and is not compatible with QB4.5 which. ISAM is only available
- with PDS,QBX and BC 7.0 and above.
-
- I have a PROGEN45 keyindex for QB4.5 if anyone wants it just
- write me or give me a call and I'll send it to you for the cost
- of shipping and handling plus disk. From the user's standpoint
- there's no difference. The main difference is the number of
- records (max 32k) and all the code is written in Quickbasic.
-
- PROGEN45 was used to create PROGEN71.
-
- If anyone out there makes improvements please send me a
- copy or has any suggestions let me know and I will see if I
- can improve in the meantime I just write for the fun of it
- and have for over 10 years. My first computer was a TRS80
- MODEL III which I still own and use.
-
- I use to write in FORTRAN until Quickbasic came along,
- "C" never made any sense to me, you have to tell it everything
- the computer should already know and MICROSOFT'S PDS is just
- as fast and assembly is just as easy to wright as "C" with a
- few libraries unless you intend to write for different computers.
-
- With 70 million MSDOS PC out there why.
-
- I hope this program will help you in some way!
-
- Thanks for trying PROGEN71.
-
- Raymond E Dixon
- 11660 VC Johnson Rd.
- Jacksonville, FL 32218
- (904) 765-4048
- PS. source code included.
- send me some good code. asm or bas
- ---------------------------------------------------------------
-
- There is some help for sub and function used in the
- code generated by PROGEN but most is easy to use without
- any or very little explanation. The PROASM71.ASM code is
- compatible with UIASM.ASM with my code added.
-
- ISAM manager code is all in BASIC.
-
- SUB ISM (cmd$, IndexNum, Retcode) STATIC
-
- This subprogram is designed to facilitate the quick
- look up of data in a large file through the use of keys
- in a ISAM database file. The format of the calling
- subprogram is:
-
- CREATEINDEX INDEXNUMBER,"FIELDNAME" [,"FIELDNAME2","ETC."]
-
- SETINDEX INDEXNUMBER,"FIELDNAME" ' field name must have been created
-
- DELETEINDEX INDEXNUMBER,"FIELDNAME"
-
- PROGEN creates all indexs needed.
-
- 'remember you can create and delete indexes on the fly with ISAM
- such as temporary for reports as long as the fields are predefined
- in the open database with the type statement.
-
- CMD$ = "F" Index Find First
- "L" Index Find Last
- "EQ" Index Search EXACT MATCH
- "GE" Index Search EXACT MATCH or NEXT GREATER
- "A" Index Add
- "D" Index Delete ' deletes one record not index
- "N" Index Next
- "P" Index Previous
-
- IndexNum = ISAM file number
-
- RetCode = 0 if no records exist
- 1 if at least 1 record in index
-
- CALL ISM (cmd$, IndexNum, Retcode) STATIC
-
- USE:
- KEY$ = "raymond" ' in PROGEN key$ is COMMOND SHARED for ease of use
-
- CALL "EQ",indexnumber,retcode
- if retcode = 1 then
-
- retrieve indexnumber
- lprint RecField.lastname
-
- else
-
- exit (sub) or (function) or (do) or (for) ' just don't print
-
- end if
-
- ---------------------------------------------------------------
- *** END SUB or FUNCTION ***
- ---------------------------------------------------------------
-
- SUB DialogBox (Ques$(), Before, After, LENGTH, Ffgd, Fbgd, Gfgd, Gbgd, sect, Answer$, Ek)
-
- Before - Textlines for question before input
- After - Textlines for question after input
- Length - Length of input
- Ffgd - Frame foreground
- Fbgd - Frame background
- Gfgd - General Foreground
- Gbgd - General background
- Sect - Section of the screen to display on
- 0=Top,1=Center,2=Bottom
- Answer$ - Answer string
-
- Ek - Exit Key
- 5=Return, 7=ESC
-
- SUB DialogBox (Ques$(), Before, After, LENGTH, Ffgd, Fbgd, Gfgd, Gbgd, sect, Answer$, Ek)
-
- ---------------------------------------------------------------
- *** END SUB or FUNCTION ***
- ---------------------------------------------------------------
-
- function: userNformat(number$,format$)
-
- numeric formats allow higest
- value of format position.
-
- format$ = "99999.99" decimal ( any decimal position)
- format$ = "99" numbers only < (99 max) each digit = to max value
- format$ = "19" (19) is max value
-
- to print:
-
- number$ = userNformat(number$,format$)
- print number$;
- or:
- print userNformat(number$,"9999.99");
-
- may use basic print using "####.##";VAL(number$) for decimal numbers
- and integer. decimal pos and length optional
-
-
- USE LOCATE ROW,COLUMN
-
- maybe passed by parameters if you like to add to parms
-
- column = Column pos to start printing
- Row = Row to start printing
-
- FUNCTION FEN$ (savescreen%,EFG, EBG, work$, format$, ExitCode, UPflag, PGUPflag, DNflag, PGDNflag, RETflag, TABflag, ESCflag, F10flag)
-
- ExitCode = VALUE EXIT 1 TO 7
-
- set flags to enable to exit on key
-
- UPflag = True ,exitcode = 1
- PGUPflag = True ,exitcode = 2
- DNflag = True ,exitcode = 3
- PGDNflag = True ,exitcode = 4
- RETflag = True ,exitcode = 5
- TABflag = True ,exitcode = 6
- ESCflag = True ,exitcode = 7
-
- ESC key restores field if True or False
-
- sample how to handle exitcode after input routine (see program).
-
- SELECT CASE ExitCode
-
- CASE 1 'what to do if uparrow key exit
- could be
- GOTO previous entry
-
- CASE 2 'what to do if pageup key exit
-
- CASE 3 'what to do if downarrow key exit
- could be
- GOTO next entry
- CASE 4 'what to do if pagedown key exit
-
- CASE 5 'what to do if enter key exit
- could be accept entry
- CASE 6 'what to do if tab key exit
- 'could be return to menu
-
- END SELECT
-
- ---------------------------------------------------------------
-
- ---------------------------------------------------------------
-
-
- FUNCTION FES$ (savescreen%,EFG, EBG, work$, format$, caseflag, ExitCode, UPflag, PGUPflag, DNflag, PGDNflag, RETflag, TABflag, ESCflag, F10flag)
-
- IF ANYONE MAKES ANY INPROVEMENTS I WOULD LIKE YOU TO RENAME THIS SUB
- TO A NEW NAME. AND IF YOU WOULD SEND ME A COPY.
-
- formated input routine with user format
-
- assign values before calling routine
-
- work$ ="" or string to edit
-
- numeric formats allow higest
- value of format position.
-
- format$ = "99" numbers only < (99 max) each digit = to max value
- format$ = "19" (19) is max value
- format$ = "999-99-9999" SS number
- format$ = "999-9999" 7 digit phone
- format$ = "(999) 999-9999" 10 digit phone
- format$ = "19/39/99" date format
- format$ = "########" alphanumeric set for 8 characters (maybe more or less)
- format$ = "@@@@@@@@" alpha only same as above
- format$ = "Y/N:*" force YN answer.
- format$ = "M/F:|" force MF answer.
- format$ = "~" 'force enter key for prompts or other exit key.
- format$ = may be any format you can create in a basic string
- even you can include the Prompt if you like.
-
- format$ = "Test Data: 99" 'this format will print
- Test Data: your value passed
- in the the length of 2
- Seting numbers 1 to 99.
-
- USE LOCATE ROW,COLUMN
-
- maybe passed by parameters if you like to add to parms
-
- column = Column pos to start printing
- Row = Row to start printing
-
- locate 12,24
-
- work$ = FES$ (savescreen%,EFG, EBG, work$, format$, caseflag, ExitCode, UPflag, PGUPflag, DNflag, PGDNflag, RETflag, TABflag, ESCflag, F10flag)
-
- ExitCode = VALUE EXIT 1 TO 7
-
- set flags to enable to exit on key
-
- UPflag = True ,exitcode = 1
- PGUPflag = True ,exitcode = 2
- DNflag = True ,exitcode = 3
- PGDNflag = True ,exitcode = 4
- RETflag = True ,exitcode = 5
- TABflag = True ,exitcode = 6
- ESCflag = True ,exitcode = 7
-
- ESC key restores field if True or False
-
- force case if set.
- caseflag = 0 any case
- = 1 for upper only
- = 2 for lower only
-
- savescreen = 1 background restored on exit
- savescreen = 0 no background saved
-
- FUNCTION FES$ (savescreen%,EFG, EBG, work$, format$, caseflag, ExitCode, UPflag, PGUPflag, DNflag, PGDNflag, RETflag, TABflag, ESCflag, F10flag)
-
- sample how to handle exitcode after input routine (see program).
-
- SELECT CASE ExitCode
-
- CASE 1 'what to do if uparrow key exit
- could be
- GOTO previous entry
-
- CASE 2 'what to do if pageup key exit
-
- CASE 3 'what to do if downarrow key exit
- could be
- GOTO next entry
- CASE 4 'what to do if pagedown key exit
-
- CASE 5 'what to do if enter key exit
- could be accept entry
- CASE 6 'what to do if tab key exit
- 'could be return to menu
-
-
- END SELECT
-
- ---------------------------------------------------------------
- *** END SUB or FUNCTION ***
- ---------------------------------------------------------------
-
- FUNCTION MenuWindow (ROW, col, MenuStr$, title$, MenuFore, MenuBack, Reversed)
- menuwindow saves and restores screen
-
- Title$ = "Title", maybe null ""
-
- if row <= 1 then menu is centered on screen vert
- if column <= 1 then menu is centered on screen horiz
- if col is to large to fit then is adjusted
- if row is to large to fit then is adjusted
- if row and col = 0 then menu is centered on screen
-
-
- select = MenuWindow (ROW, col, MenuStr$, title$, MenuFore, MenuBack, Reversed)
-
- Menu$ = "A - menu1\B - menu2\C - menu3\D - Menu4\"
- or:
- menu$="1 - Option\"
- menu$=menu$+"2 - Option\"
- menu$=menu$+"3 - Option\"
- menu$=menu$+"4 - Option\"
-
- first letter must be different and Caps or Num
- to allow for single key selection.
-
- MENUSEL = MenuBar(24, 3, BO$, BLACK, WHITE, RED, IRV)
- | | | | | | | |_ bar color
- | | | | | | |_ highlite color
- | | | | | |_ background color
- | | | | |_ foreground color
- | | | |_ menu string
- | | |_ start column
- | |_ row posisition
- |_ pos return value
-
- SELECT CASE menusel
-
- CASE 1 'what to do if menu number 1
-
- CASE 2 'what to do if menu number 2
-
- CASE 3 'what to do if menu number 3
-
- CASE 4 'what to do if menu number 4
-
- END SELECT
-
- ---------------------------------------------------------------
- *** END SUB or FUNCTION ***
- ---------------------------------------------------------------
-
-
- SUB Message (Text$(), lines, Border, Bf, Bb, GF, gb)
-
- Text1$ - Text to display
- lines - Text ITEMS to display
- Border - Border type
- Bf - Border foreground color
- Bb - Border backgroynd color
- Gf - Global foreground
- Gb - Global background
-
- ---------------------------------------------------------------
- *** END SUB or FUNCTION ***
- ---------------------------------------------------------------
-
-
- FUNCTION SelBox (List$(), numele, lenview, diswide, fg, bg, rev) STATIC
-
- ---------------------------------------------------------------
- *** END SUB or FUNCTION ***
- ---------------------------------------------------------------
-
- SUB AskQuestion (Text$(), numlines, Border, Bf, Bb, GF, gb, Ques$, ans$)
-
- text$(1) = "YES, go ahead and delete " + cust.Firstname
- text$(2) = "NO, I don't want to delete " + cust.Firstname
-
- Ques$ = "(Y/N)"
- answ$ = "YyNn"
-
- AskQuestion text$(), 2, 1, BLACK, WHITE, BLACK, WHITE, Ques$, answ$
-
- IF UCASE$(answ$) = "Y" THEN
- ELSE
- END IF
-
- ---------------------------------------------------------------
- *** END SUB or FUNCTION ***
- ---------------------------------------------------------------
-
- sub: message
-
- text$(1) = "There are no RECORDS"
- text$(2) = "in the database to Edit, Update!"
- text$(3) = "" 'BLANK LINE
- text$(4) = "Press any key to continue"
-
- Message text$(), 4, 3, BLACK, WHITE, BLACK, WHITE ' DIsplay Message
-
- ---------------------------------------------------------------
- *** END SUB or FUNCTION ***
- ---------------------------------------------------------------
-
- function: menubar
-
- BO$ = " Next Previous Search Edit Dial" + CHR$(255) + "phone1 Dial" + CHR$(255) + "phone2 Menu "
- BRV = MenuBar(24, 3, BO$, BLACK, WHITE, RED, IRV)
- | | | | | | | |_ bar color
- | | | | | | |_ highlite color
- | | | | | |_ background color
- | | | | |_ foreground color
- | | | |_ menu string
- | | |_ start column
- | |_ row posisition
- |_ pos return value
-
- end of menubar
-
- ---------------------------------------------------------------
- *** END SUB or FUNCTION ***
- ---------------------------------------------------------------
-
- drawbox 'a basic sub uses drawwind in asm lib
-
- SUB DrawBox (toprow, LeftCol, Width, height, FrameType, FrmFgd, FrmBgd, Fill, FillFgd, FillBgd,shadow)
-
- frametype = 0 'clears frame
- 1 'single line
- 2 'double line
- 3 '
- 4 'wide bar top and bottom ,open sides
-
- fill = 0 'draws frame only
- 1 'clear inside window
-
- shadow = 0 'no shadow
- 1 'draws shadow
-
- ---------------------------------------------------------------
- *** END SUB or FUNCTION ***
- ---------------------------------------------------------------
- code below written in asm.
-
- ;--------------------------------------------------------------
- ;
- ; prolib71.asm
- ;
- ; Copyright (C) 1989 Microsoft Corporation, All Rights Reserved
- ;
- ; GetCopyBox : Gets screen box info and places into string variable
- ; PutCopyBox : Puts screen box info from string variable onto screen
- ;
- ;DECLARE SUB getcopybox (row1%, col1%, row2%, col2%, buffer$)
- ;DECLARE SUB putcopybox (row%, col%, buffer$)
- ;DECLARE SUB attrbox (row1%, col1%, row2%, col2%, attr%)
- ;
- ; Copyright (C) 1991 Raymond E Dixon
- ; (see windemo.bas for examples)
- ; Colorwind : Changes the color attributes of all characters within a box
- ; : Fill with character within a box, space clears window
- ;
- ; PNC : print in color
- ; PNC string$,row,column,foreground,background
- ;
- ; Drawwind : draw a window with or without border and clear window
- ;
- ; Captal : converts first char to U/case and others to l/case
- ; : needed for proper name format
- ; From :"rAyMoNd e DIXON"
- ; To :"Raymond E Dixon"
- ;
- ; ClrKeyBuf : clears keyboard buffer
- ;
- ; "all sub work with far or near strings"
- ;
- ;DECLARE SUB Colorwind (row1%, col1%, row2%, col2%,char%,fillflag%, foreground%, background%)
- ;DECLARE SUB drawwind (row1%, col1%, row2%, col2%, frame%,clear%)
- ;DECLARE SUB pnc (a$, row%, col%, foreground%, background%)
- ;DECLARE SUB captal (a$) 'CONVERT FIRST LETTER TO UPPER CASE
-
- ; flag function and subs from PC mag. (not used in my programs)
-
- ;DECLARE SUB setflag(flag%) 'SET FLAG
- ;DECLARE FUNCTION getflag(flag%) 'GET STATE OF FLAG
- ;DECLARE SUB resetflag(flag%) 'RESET FLAG
- ;DECLARE SUB clearall 'CLEAR ALL FLAGS
-
-
- ;DECLARE FUNCTION CPUcheck% 1 = 8086/88, 2 = 80286, 3 = 386/486
-
- ;-----------------------------------------------------------------------------
-
-
-