home *** CD-ROM | disk | FTP | other *** search
/ Share Gallery 1 / share_gal_1.zip / share_gal_1 / LA / LA015.ZIP / DG_DOC.TXT < prev    next >
Text File  |  1985-08-15  |  21KB  |  508 lines

  1.                      dGENERATE Documentation
  2.  
  3.                    (Version 1.0: August, 1985)
  4.                     (Revised August 15, 1985)
  5.  
  6.    Copyright 1985, Tom Rettig Associates, All Rights Reserved
  7.   9300 Wilshire Boulevard, Suite 470, Beverly Hills, CA  90212
  8.     (213)272-3784 -- Source: BCR480 -- CompuServe: 75066,352
  9.  
  10.  
  11. dGENERATE is a dBASE III screen and code generator written 
  12. entirely in dBASE III.  The generated code is intended to assist 
  13. rather than replace the application programmer.
  14.  
  15. dGENERATE produces simple, easy to understand algorithms because 
  16. every programmer's needs are different, and there is no single 
  17. algorithm that will work for everyone.  One of dGENERATE's main 
  18. features is that it is written in dBASE III and can be easily 
  19. modified to generate any algorithm you like.
  20.  
  21. Due to the variety of algorithms required for applications 
  22. development, we prefer to maintain a library of routines and 
  23. incorporate the generated code with the appropriate routine for 
  24. each application.
  25.  
  26.  
  27. RIGHTS:
  28.  
  29. You are encouraged to freely distribute copies of dGENERATE to 
  30. anyone you choose, as long as you do not charge for it and the 
  31. original copyright notice and registration information remain 
  32. intact in both the code and documentation.
  33.  
  34. You own the generated code just as if you wrote it yourself; use 
  35. it however you like.  You have the right to use portions of 
  36. dGENERATE's source code, either modified or unmodified, in any 
  37. original application of your own that does not directly compete 
  38. with dGENERATE.  We disclaim all liability and make no guarantee.
  39.  
  40. You are invited to become a registered dGENERATE by sending 
  41. fifteen dollars to us at the above address for which we will send 
  42. you a disk containing the latest version of all the files listed 
  43. below.  Registration also entitles you to full technical support 
  44. by telephone, mail, CompuServe, and the Source.  Only if we have 
  45. you on file can we notify you of updates, bug-fixes, and new 
  46. dBASE-related software.
  47.  
  48. Registration supports the development and marketing of 
  49. inexpensive software via the "shareware" concept.  Your 
  50. registration makes an important contribution!
  51.  
  52. We feel that dGENERATE belongs to the entire dBASE community, and 
  53. your feedback is highly valued.  If there is anything you think 
  54. should be changed or added to the next version, please write us 
  55. with your comments.  
  56.  
  57. The dGENERATE files are:
  58.  
  59.           Source code: dg_main.prg (7K) and dg_proc.prg (55K)
  60.                          Executes under dBASE III,
  61.                          any version greater than 1.1
  62.       RunTime+ linked: dg.prg (30K)
  63.                          Executes under dBASE III, 
  64.                          any version greater than 1.1 or dBRUN
  65.      Clipper compiled: dg.exe (160K)
  66.                          Executes under MS- or PC-DOS,
  67.                          version 2.0 or higher
  68.                        dg_clip.prg (55K) is the compilable 
  69.                          source code for the Clipper version
  70.              Database: dg.dbf
  71.                          One field 'dg_text', character 254 bytes
  72.         Documentation: dg_doc.txt (20K)
  73.          Announcement: about_us.txt (1K)
  74.  
  75.  
  76. INSTALLATION:
  77.  
  78. "Install" simply means to copy the appropriate files onto your 
  79. working disk.  You only need to install the file or files that 
  80. you will use.  If you want to run source code, install both the 
  81. main and procedure files.  If you want to run the linked file, 
  82. only install dg.prg.  If you do not have a copy of dBASE III 
  83. later than version 1.1, install only dg.exe.  All versions of 
  84. dGENERATE use the dg.dbf system database file.  Once you have 
  85. printed a copy of this documentation file, you do not need it on 
  86. your disk.
  87.  
  88. Hard Disk:
  89.  
  90. This is the easiest way to use dGENERATE.  Set your operating 
  91. system "path" to the directory where dBASE III is installed (see 
  92. your operating system manual).  Now you can call dBASE from 
  93. anywhere.  Once in dBASE III, SET PATH TO the directory where 
  94. dGENERATE is installed.  Now you can use dGENERATE from anywhere 
  95. that you can call dBASE.  The files created by dGENERATE are 
  96. always in the local directory.
  97.  
  98. The editor (word processing software) you specify during <S>etup 
  99. must be accessible from the current directory from which you 
  100. entered dBASE III.  Your editor must be able to find its overlay
  101. files when called from this directory.  If it works from the 
  102. operating system prompt where you enter dBASE, it should work in 
  103. dGENERATE.
  104.  
  105. Floppy Disk:
  106.  
  107. One method is to place a copy of both dGENERATE and your editor 
  108. on a separate disk which is placed in drive B and used as your 
  109. development disk during the application's implementation.
  110.  
  111. The other method is to create a new dBASE III System Disk Two.  
  112. If enough of the optional files are removed from System Disk Two, 
  113. both your editor and dGENERATE can be placed on it in drive A.
  114.  
  115. In either of these floppy schemes, both the DOS file 
  116. "Command.com" and the dBASE III overlay file "Dbase.ovl" must be 
  117. on the disk in drive A.  Your editor's overlay files must be on 
  118. the drive where your editor knows to look for them.
  119.  
  120. If your system has very little memory, you may get an 
  121. "Insufficient Memory" error message from dBASE when it tries to 
  122. RUN your editor.  To correct this, you can add more memory to 
  123. your system or use the compiled version of dGENERATE which 
  124. requires much less memory than the versions that run under dBASE.
  125.  
  126.  
  127. SETUP:
  128.  
  129. There are thirteen sets of parameters that can be changed in the 
  130. setup module by selecting number six <S>etup on the main menu.
  131.  
  132.      1.  Characters that denote SAYs and GETs in a screen-form
  133.                Default: SAY '}', GET '{'
  134.      2.  Character that denotes memory variable in a screen-form
  135.                Default: '~' (the tilde)
  136.      3.  Size of screen-form in rows and columns
  137.                Default: 24 rows, 80 columns
  138.      4.  Relative or literal addressing in @ coordinates
  139.                Default: Literal
  140.      5.  Add the ruler line in screen-form or omit
  141.                Default: Add
  142.      6.  Set delimiters on or off
  143.                Default: Off
  144.      7.  Fill new screen form with blanks or omit
  145.                Default: Omit
  146.      8.  Display help screens or omit
  147.                Default: Display
  148.      9.  File extensions created by dGENERATE
  149.                Default: Screen-form '.dgS' (Screen-form file),
  150.                         generated code '.dgP' (Program file),
  151.                         generated memvars '.dgM' (Memvar file)
  152.     10.  Ruler line characters
  153.                Default: Column zero '0', 
  154.                         every ten columns thereafter '123456789.'
  155.     11.  Delimiter characters
  156.                Default: Left ':', right ':'
  157.     12.  Marquee line character (ASCII value)
  158.                Default: 61      ('=')
  159.     13.  Filename of editor used to draw screen-forms
  160.                Default: none (uses MODIFY COMMAND)
  161.  
  162.           dGENERATE relies on the word processing software you 
  163.           assign for all editing tasks.  If you have assigned an 
  164.           editor in <S>etup, dGENERATE will RUN it for all 
  165.           <E>diting operations.  If not, dGENERATE will call 
  166.           MODIFY COMMAND which will run either the built-in dBASE 
  167.           III word processor or the editor that has been assigned 
  168.           to WP in Config.db.  Because the built-in dBASE III 
  169.           word processor wraps all lines at the 67th column and 
  170.           provides no way to disable this feature, it is most 
  171.           inconvenient for drawing screen-forms.  The use of a 
  172.           more versatile editor is highly recommended.
  173.  
  174.           To use a memory-resident editor such as the one in 
  175.           SideKick, assign "INMEMORY" during <S>etup.  This will 
  176.           prevent the automatic <E>dit after <C>reate.  While at 
  177.           dGENERATE's main menu, call your editor the way you 
  178.           usually do instead of using the <E>dit procedure.  Then 
  179.           save the file, exit the editor, and select <G>enerate 
  180.           to write the code.
  181.  
  182. The "parameters line" is made up of these values and can be saved 
  183. in the system database file.   Part of the parameters line is 
  184. stored in each newly created screen-form file to tell dGENERATE 
  185. what parameters to use in generating code from each screen-form.
  186.  
  187. Change parameters in <S>etup before <C>reating new screen-forms.
  188.  
  189. Change parameters in existing screen-forms by <E>diting the
  190. parameters line in the screen-form itself.
  191.  
  192.  
  193. OPERATION:
  194.  
  195. dGENERATE performs five distinct operations, each of which can be 
  196. called from the main menu.
  197.  
  198.      1.   <C>reate a new screen-form
  199.      2.   <E>dit an existing screen-form
  200.      3.   <G>enerate code from a screen-form
  201.      4.   <D>O (execute) a command file
  202.      5.   Generate <M>emory variable code from a database file
  203.  
  204. Some operations are called automatically from other operations.  
  205. For example, if you create a new screen-form, you are 
  206. automatically placed in it for editing.  Code is automatically 
  207. generated after editing a screen-form, and newly generated 
  208. command files are automatically executed.
  209.  
  210. General:
  211.  
  212. If you are running dGENERATE under regular dBASE III, pressing 
  213. the Escape key will SUSPEND dGENERATE and place you in the 
  214. interactive mode of dBASE III.  Type RESUME to return to 
  215. dGENERATE.  This is useful when you want to create a database 
  216. file or test an expression without exiting and rebooting 
  217. dGENERATE.  If you SUSPEND while in dGENERATE's main menu, you 
  218. must press a key after RESUMing in order to redisplay the menu.
  219.  
  220. dGENERATE uses only one work area, the current one when dGENERATE 
  221. is entered.  However, because the RUN command is used for 
  222. editing, we recommend that you close all open files before 
  223. executing dGENERATE to avoid the possibility of corrupting them.
  224.  
  225. dGENERATE creates temporary files during code generation, but 
  226. erases them when finished or if aborted properly.  These are not 
  227. big, using one 255 byte record for each line in a screen-form, 
  228. but there must be room on the default disk for this file and its 
  229. index file (around 10K).  The first release of dGENERATE does not 
  230. check for adequate diskspace before creating its temporary files.
  231.  
  232. dGENERATE variables all begin with 'dg_' or 'dl_' to avoid 
  233. confusion with other variables on which you might use dGENERATE.  
  234. Avoid naming memvars or fields beginning with 'dg_' or 'dl_' to 
  235. prevent any conflict with dGENERATE.
  236.  
  237. dGENERATE uses the following names for procedures.  An attempt to 
  238. <D>o a command file of the same name will have unpredictable 
  239. results.  Avoid the use of these names for screen-forms: abort, 
  240. alt_file, config, crea_new, doer, editor, file_msg, fileprmt, 
  241. generate, gen_entr, gen_menu, gen_rprt, helper, hlp_crea, 
  242. hlp_doer, hlp_edit, hlp_gene, hlp_mgen, hlp_setu, hlp_togl, 
  243. key_time, line_inc, marquee, mem_gen, pars_lit, pars_var, setup, 
  244. set_if1, set_if2, set_if3, wait_msg, and write.
  245.  
  246. There is a "time-out" feature in dGENERATE.  If you leave 
  247. dGENERATE inactive for three minutes while in the main menu, it 
  248. will clear the screen body and prompt you to press any key to 
  249. re-activate.  If you are in a sub-menu, it will return to the 
  250. main menu.
  251.  
  252. Option 1: <C>reate a new screen-form
  253.  
  254. dGENERATE places several items in a new screen form to set it up 
  255. for your use.  To understand these, we must first define the 
  256. parts of a screen-form.  Every screen-form has three parts, the 
  257. header, the body, and the footer.  The body is where you draw 
  258. your screen or form.  The header contains the ruler line, and the 
  259. footer contains the variable definitions, code generating 
  260. options, and parameters line.
  261.  
  262. If the ruler-line flag is on, dGENERATE places a ruler on the 
  263. first line in the screen-form to assist you in measuring columns 
  264. and placing data.  If the blank-fill flag is on, dGENERATE fills 
  265. the body of the screen-form with blank spaces.  If you reply that 
  266. you want to add memvars from a database file when prompted, 
  267. dGENERATE places the appropriate names in the definition table in 
  268. the footer.
  269.  
  270. Option 2: <E>dit a screen-form (or any text) file
  271.  
  272. If you have specified the form width (columns) in <S>etup, the 
  273. ruler line will be that exact width.  Because it is the first
  274. line in the file, most editors will be positioned to it upon 
  275. entering.  Many editors allow you to set the working margins from
  276. any line on which the cursor appears.  In WordStar, for example, 
  277. you can set your working margins to the proper screen-form width 
  278. by pressing Ctrl-OF (^OF) when the cursor is on the ruler line.
  279.  
  280. You draw your screen-form by writing all literal prompts 
  281. precisely where you want them to appear.  Variables to be 
  282. displayed with either a SAY or a GET are identified by the SAY or 
  283. GET symbol immediately followed by a single character "definition 
  284. symbol" of your choice.  For example:
  285.  
  286.         Name: }a
  287.      Address: {b
  288.         City: {c
  289.  
  290. The GET and SAY symbols '{' and '}' cannot be used for anything 
  291. else.  If you need to use them in the screen-form for something 
  292. else, change the symbols first in <S>etup.  The definition 
  293. symbols 'a', 'b', and 'c' are defined in the definitions table 
  294. below the screen body:
  295.  
  296.      dgDEFINE
  297.      a Name
  298.      b Address
  299.      c City
  300.  
  301. If you want to have a better idea of what your screen or form 
  302. will look like while you are drawing it, you can follow the 
  303. definition symbol with any combination of characters.  All 
  304. characters immediately following a definition symbol are ignored 
  305. until a space is encountered.  For example:
  306.  
  307.         Name: }Full_name_goes_here--------------
  308.      Address: {9300_Wilshire_Boulevard,Suite_470
  309.         City: {*--------------------|  State:}S
  310.  
  311. Memvars may be specified in the definitions table to take the 
  312. place of field names:
  313.  
  314.      dgDEFINE
  315.      F m_name ~ Name
  316.      9 m_address ~ Address
  317.      * m_city ~ City
  318.      S m_state ~ State
  319.  
  320. The definitions table may simply contain expressions instead of 
  321. variables unless a GET is being used on that symbol:
  322.  
  323.      dgDEFINE
  324.      T TIME()
  325.      D DATE()
  326.      & SPACE(20)
  327.  
  328. PICTURE and FUNCTION phrases may be added and there are no 
  329. restrictions about spacing other than beginning with the 
  330. definition symbol in the first column and placing all definitions 
  331. in the "definition table."  The definition table begins with the 
  332. word 'dgDEFINE' on a line in the first column.  The next line is 
  333. an example syntax of a definition.  All definitions are placed 
  334. one per line immediately following the definition table's example 
  335. syntax:
  336.  
  337.      dgDEFINE -- Example syntax follows
  338.      <definition symbol> [<memvar> ~] <expression> [PICTURE <phrase>]
  339.      1 "All definitions go here"
  340.      2 m_var ~ "and here" PICTURE "AAAXAAAA"
  341.      3 "and so on..." FUNCTION "!"
  342.      a "Note that lowercase and"
  343.      A "uppercase are different symbols."
  344.  
  345. If you answered that you want memvars added from a database file 
  346. during the <C>reate a screen-form process, the definition table 
  347. will look like this:
  348.  
  349.      dgDEFINE
  350.        m_name ~ Name
  351.        m_address ~ Address
  352.        m_city ~ City
  353.  
  354. You simply add the definition symbol that you use in the screen 
  355. body to the first column of each definition.  You can also add 
  356. PICTURE or FUNCTION clauses and && comments if desired:
  357.  
  358.      dgDEFINE
  359.      1 m_name ~ Name  FUNCTION "!"  && uppercase key expression
  360.      2 m_address ~ Address
  361.      3 m_city ~ City
  362.  
  363. All definitions must fit on one line, and cannot be continued 
  364. with a semicolon.  Leave a blank line after your definitions are 
  365. completed.
  366.  
  367. dGENERATE options are dgFILE, dgENTRY, dgMENU, and dgREPORT.  
  368. Options can be declared anywhere in a screen-form as long as they 
  369. begin a line in the first column.  Only one dgFILE may be 
  370. declared in each screen-form.  If more than one is declared, only 
  371. the first will be used.  Only one of the dgENTRY, dgMENU, or 
  372. dgREPORT options may be declared.  If more are declared, only the 
  373. first in this order of precedence will be used: dgENTRY, dgMENU, 
  374. dgREPORT.
  375.  
  376.      dgFILE <database filename> 
  377.           Writes the code for opening and closing a database file.
  378.      dgENTRY
  379.           Writes the algorithm for data entry or edit.
  380.      dgMENU
  381.           Writes the algorithm for menu driven user selections.
  382.           Uses INKEY() algorithm, and you specify the characters 
  383.           for each CASE statement on a separate line below the 
  384.           dgMENU declaration.
  385.      dgREPORT
  386.           Writes the algorithm for printed reports.
  387.           Requires use of a database file (can use dgFILE).
  388.  
  389. dgFILE takes only the filename, not the DBF extension:
  390.      dgFILE Names
  391.  
  392. dgMENU requires allowable characters for each CASE be listed 
  393. without delimiters on a new line directly below the dgMENU 
  394. declaration.  Each line represents the keys that may be pressed 
  395. to select one option from the menu:
  396.      dgMENU
  397.      Aa1
  398.      Bb2
  399.      Cc3
  400.      Qq
  401.  
  402. dgREPORT writes code that uses the printer.  Be sure your printer 
  403. is on line when using this option or executing the generated 
  404. code.  Maximum form size is 254 columns by 999 rows.  GETs are 
  405. automatically converted to SAYs so that you can re-use screen-
  406. forms originally drawn for data entry.
  407.  
  408. Option 3: <G>enerate code from screen-form
  409.  
  410. Sit back and relax while dGENERATE does the work.  Part of the 
  411. code written is to initialize a variable called 'undefined' with 
  412. three asterisks.  This prevents a generated program from crashing 
  413. when a memvar initialization is overlooked.
  414.  
  415. If the relative addressing flag is on, dGENERATE will write the 
  416. @ coordinates using the ROW() function.  PROW() is used if it is 
  417. declared as a report with dgREPORT.  Only ROW() and PROW() are 
  418. generated as functions, and literal addresses are used in place 
  419. of COL() and PCOL() regardless of the flag status.
  420.  
  421. Option 4: <D>o a command file
  422.  
  423. "***" appearing in your screen or form means that a variable has 
  424. not been properly defined or initialized.
  425.  
  426. When DOing a newly generated command file, dGENERATE displays the
  427. screen and then does an invisible WAIT before returning to the 
  428. Main Menu.  This is necessary in order to see the results of your 
  429. screen-form, but provides no prompt to press a key unless you 
  430. have included one in your screen.  Remember to press a key to 
  431. return to the menu after you have seen your generated screen 
  432. displayed.
  433.  
  434. If a DO file crashes, select SUSPEND, then type RETURN and 
  435. RESUME.  This will place you back in dGENERATE's Main Menu.
  436.  
  437. This option is not available in the compiled version of dGENERATE 
  438. because the generated dBASE code needs a dBASE interpreter to 
  439. run, or it must be compiled first.  The compiled dGENERATE offers 
  440. access to DOS in this place where the generated code can be 
  441. compiled or the dBASE interpreter can be called.  None of this is 
  442. automated because the code is likely to be incorporated with 
  443. other code before compiling is desirable.
  444.  
  445. Option 5: <M>ake memvars from fields
  446.  
  447. Just give dGENERATE the name of a database file, and it will
  448. create memvar names from the field names and write initialization
  449. and REPLACE commands.
  450.  
  451. Two kinds of initialization statements are generated.  One from 
  452. the field names:
  453.  
  454.      m_name     = Name
  455.      m_start_da = Start_date
  456.      m_amount   = Amount
  457.  
  458. The other from expressions:
  459.  
  460.      m_name     = SPACE( 35)
  461.      m_start_da = CTOD("  /  /  ")
  462.      m_amount   = 0000.00
  463.  
  464. The REPLACE statements:
  465.  
  466.      REPLACE Name       WITH m_name 
  467.      REPLACE Start_date WITH m_start_da
  468.      REPLACE Amount     WITH m_amount
  469.  
  470. This code is not intended to run as it stands.  It is meant to be
  471. incorporated into the code that you write for each application.
  472.  
  473. Note that the memory variable names only use the first eight
  474. characters of the field names.  When CREATing your database 
  475. files, keep significant letters within the first eight letters:
  476.  
  477.      'Fieldname1' and 'Fieldname2' both generate 'm_fieldnam'
  478.      'Field_1' and 'Field_2' generate 'm_field_1' and 'm_field_2'
  479.  
  480.  
  481. TECHNICAL SUPPORT:
  482.  
  483. Electronic mail on CompuServe or the Source is the best way.  
  484. Regular postal mail is good if your needs are not immediate.  We 
  485. also offer support by telephone, but cannot guarantee that a 
  486. technical person will be available when you call.  However, a 
  487. programmer will return your call the same or following working 
  488. day.  All long distance support calls are returned COLLECT in 
  489. order to keep the price of dGENERATE as low as possible.  
  490. Remember, we only charge fifteen dollars.
  491.  
  492. Please do NOT call Ashton-Tate or Nantucket for dGENERATE 
  493. support.  They are very busy supporting their own products.
  494.  
  495.  
  496. TRADEMARKS:
  497.  
  498.           Ashton-Tate:  dBASE, dBASE III, RunTime+
  499.               Borland:  SideKick
  500.                   IBM:  PC-DOS
  501.              MicroPro:  WordStar
  502.             Microsoft:  MS-DOS
  503.             Nantucket:  Clipper
  504. Tom Rettig Associates:  dGENERATE
  505.  
  506.  
  507.               *** EOF: dGENERATE Documentation ***
  508.