home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 636.lha / AppliGen_v1.0 / AppliGen.doc.pp / AppliGen.doc
Encoding:
Text File  |  1992-05-21  |  16.6 KB  |  386 lines

  1.                 Superbase 3.02 - Application Generator v1.0
  2.  
  3.                                INTRODUCTION
  4.  
  5. During my  economics study,  I had to learn how to use dBase III+. During those
  6. lessons  the  teacher  proudly  showed  the  application  generator  for dBase.
  7. Although dBase  is a  ridiculous package, compared to Superbase, at that time I
  8. did not  have an  application generator  for Superbase!  Having the application
  9. generator in mind, I remembered packages like PowerWindows for the Amiga, and I
  10. decided to write an application generator for Superbase.
  11.  
  12. At the time I started developing  this program,  I used  an Amiga  500, an 20MB
  13. A590, one  and a  half megabytes of memory, and a 1084s. Not really a setup for
  14. using huge systems like SBpro4. That  is why  I decided  to use  Superbase III,
  15. even while  I had  Superbase 4.  By now  I bought an A500+ with enough harddisk
  16. space and memory to run SBpro4. Still, I have that 1084s, and I just cannot see
  17. the cursor in SBpro4's editor! So, still SBpro3. As usual with PD software like
  18. this, if I find out that people actually  use my  program, I'll  try to  make a
  19. version for Superbase IV.
  20.  
  21. Enjoy!
  22.                                                                           -Ivo
  23.                                 TO CONTACT
  24.  
  25. use E-Mail or: Ivo Kroone
  26.                Drieboomlaan 223
  27.                1624 BH   Hoorn
  28.                The Netherlands
  29.                (Europe)
  30.         phone: HOLLAND-02290-10170
  31.  
  32.                        FILES INCLUDED WITH APPLIGEN:
  33.  
  34. It  is  advised  to  have  the  AppliGen in the working directory of Superbase.
  35. Superbase III has still got major problems switching directories, so it is best
  36. to put all files in the same directory. AppliGen uses:
  37.  
  38. AppliGen.sbp ; The program
  39. AppliGen.sbv ; AppliGen's form-file
  40. AppliGen.doc ; This text file
  41. UserMenus.sbd; The structure-file of your future data-file
  42. UserMenus.131; The index of your future data-file
  43. UserMenus.sbf; Your future data-file
  44.  
  45. besides these  file you'll need Superbase III. I used version 3.02, so I'm sure
  46. that one will not show any problems (not even using Kick 2.04).
  47.  
  48. At  the  moment  you  start  Superbase,  it  will  search  for  a  file  called
  49. "Start.sbp",  if   found  it   will  be   loaded  and   started.  So,  renaming
  50. "AppliGen.sbp" to "Start.sbp" will  auto-start the  program. Otherwise AppliGen
  51. should be  started by selecting "run" from the "program"-menu (the right most).
  52. AppliGen will load the other files it needs by itself.
  53.  
  54.  
  55. On starting AppliGen, you will first be confronted with a title-bar telling you
  56. to wait  for a while. On an A3000 this 'while' is so short that one cannot even
  57. read it. On a standard Amiga it should take about a second  and a  half for the
  58. system to initialize (building menu's, reading some data for internal use).
  59.  
  60. When no  application is loaded, most menus will be ghosted. The first thing you
  61. should do I create a new application, or open one.
  62.  
  63. When the main-menu is present, you  can select  an item,  or you  can edit your
  64. user-menus. Just by clicking in the screen, the cursor will pop-up in the upper
  65. left corner, and you can start editing. Use the [STOP] button in  the VCR panel
  66. below to  stop editing ([CTRL] + [C] will have the same effect). On editing the
  67. following key-combinations can be used:
  68.  
  69.  [Shift] + [arrow-key], all the way LEFT or RIGHT
  70.  
  71.  [CTRL] + [X], clear the current field
  72.  
  73.  [return], next field
  74.  
  75.  [CTRL] + [return], return to the previous field
  76.  
  77.  The field above the horizontal line, are the names of your menus. You have five
  78. menus available,  each menu  can hold  up to 12 items (the limit of 12 items is
  79. Superbase's limit, the 5 menus are my  limit).  Next  to  every  item,  you can
  80. enter a  single character  to be used as an Amiga-key short-cut. This character
  81. will be printed in upper case italics. The name of the menu will be  printed in
  82. a bold  type face.  If you  are out  of space for the menu-name, the field will
  83. scroll so you can edit more text.  Each  item  can  hold  up  to  23 characters
  84. (Superbase's limit).
  85.  
  86.                               New application
  87.  
  88.  This option  clears all  user-menus, so  you can  start defining your own menu-
  89. structure. The system will ask for a project-name first. This  is the  name the
  90. system will  use to  SAVE the  project, also  this name  will be  stated in the
  91. REMarks in your source code.
  92.  
  93. As I used the program for some try-outs, I found out that part of the structure
  94. is frequently  the same.  Every good  program has  a "Project" menu on the left
  95. with options like "Save", "Save as", "Open", etc. This is why AppliGen will ask
  96. you  "Pre-enter  a  standard-menu?".  This  will  add  the standard menus, like
  97. Commodore suggests in the official "Amiga Intuition Reference Manual". Although
  98. that's a  KickStart 1.2  book, the global structure should still be the same as
  99. in 2.04. For your information, the standard menu looks like:
  100.  
  101.  Project
  102.  
  103.  New       N
  104.  Open      O
  105.  Save      S
  106.  Save as
  107.  Print
  108.  Print as
  109.  Quit      Q
  110.  
  111.  Edit
  112.  Undo  U
  113.  Cut   X
  114.  Copy  C
  115.  Paste P
  116.  Erase E
  117.  
  118. Not all Amiga-key short cuts are official, some have been copied from  TxEd and
  119. CygnusEd.  After  you've  entered  the  project  name, and perhaps included the
  120. standard menus, AppliGen will return to  the  main  menu.  Now  you  can select
  121. another menu-item,  or alter  the menus (by simply clicking in the edit window,
  122. and type your text).
  123.  
  124.                               Open user menus
  125.  
  126. Saved menus are all stored in just one Superbase file (UserMenus.sbf). With the
  127. open function  one can  load a  menu-structure in  memory. In  an attempt to be
  128. smart, the load-option automatically loads the only existing  structure-file if
  129. there's only one available. So it is likely that you won't see a request asking
  130. you to pick a menu, if there's only one possibility.
  131.  
  132.                              Write user menus
  133.  
  134. To store your menus on disk. If you  managed, somehow,  not to  enter a project
  135. name, you will be prompted to enter one. The version-number of the project will
  136. be increased by one, and the date will be replaced by the current date.
  137.  
  138.                              Delete user menus
  139.  
  140. To remove a user-menu. The standard  pick-a-menu request  will pop-up, allowing
  141. you to  select a  menu. The  usual "Are you sure?"-alike request will ask for a
  142. confirmation. If confirmed the menu will be deleted.  Although the "Reorganize"
  143. option will  really delete the data (according to the Superbase manual), as far
  144. as I know it is not possible  within  Superbase  to  recover  a  record,  so be
  145. careful!
  146.  
  147.                             Info on user menus
  148.  
  149. This shows  some information  on the  current user-menu. On second thought this
  150. option really came in handy on writing AppliGen (so I  could check  if indexes,
  151. files and other peripherals were really attached). The information screen looks
  152. like this (pressing any key, or the left mouse-button will  return to  the main
  153. menu):
  154.  
  155.  Project : ProjectName, version version
  156.  Date    : Date
  157.  Author  : Author
  158.  
  159.  (if present:)
  160.  Form  : Form file-name.sbv
  161.  Keys  : F-Key file-name.sbk
  162.  Query : SB-Query file-name.sbq
  163.  
  164.  "No menu-reader will be added" or "Menu-reader will be added"
  165.  "Credits will not be added" or "Credits will be added"
  166.  "No error-handler will be added" or "Error-handler will be added"
  167.  
  168.  Files and indexes to be opened:
  169.  (note that  up to  ten files  and indexes  can be opened, and will be mentioned
  170.  here, sequentially)
  171.  
  172.  FILE: filename.sbf, INDEX: field-name of the index
  173.  Subroutines to be included: (up to ten sub-routines)
  174.  filename of the subroutine (plain ASCII file)
  175.  
  176.                              Save appli SBpro3
  177.  
  178. The main event. This creates a source file for Superbase III. Depending  on all
  179. kinds of preferences, this will include sub-routines, REMarks, etc.
  180.  
  181. To speed  up creating  (and to make writing of the create-routine a lot easier)
  182. your user-menus will first  be checked.  The syntax-checked  does the following
  183. (ANY  error  will  result  in  a  message telling what's the matter. No further
  184. creating will be done):
  185.  
  186. 1. Stores your application on disk. Sorry if you  think this  makes things less
  187.    comfortable. But  creating a temporary backup would've made thing needlessly
  188.    complicated.
  189. 2. Checks if menu-name 1 and menu-item 1 have some contents. If not  it assumes
  190.    you did not make any menus.
  191. 3. Checks the Amiga-key short cuts. A key should appear once. One short-cut for
  192.    more than  one  item  would  not  make  any  sense  (although  Superbase and
  193.    Intuition accept  it both). Thanks to Raymond for helping me getting a smart
  194.    a FAST way of checking this!
  195. 4. Checks for the existence of all included sub-routines.
  196. 5. Checks for the existence of all included .sbf and .sbd files.
  197.  
  198. If your application is valid you will be asked for  a file-name.  AppliGen will
  199. append  ".sbp"  to  the  filename,  if necessary. During the creation some text
  200. might be stripped from spaces, as program labels and such thing may not contain
  201. spaces.  The  application  will  now  actually  be  build.  AppliGen  does  the
  202. following, considering all possible includes have  been selected  (if not, some
  203. will  not  appear  in  your  source)  (Boolean  like  ON/OFF statements will be
  204. mentioned with ON/OFF):
  205.  
  206.  1. REM ProjectName, version 0.version
  207.     REM Date  : ProjectDate
  208.     REM Author: Author (if allowed)
  209.  2. ON ERROR GOTO ErrorHandler
  210.  3. Start:
  211.     SET HEADING "Initializing, please wait ..."
  212.  4. SET BUFFERS Buffers
  213.     BREAK ON/OFF
  214.     DEBUG ON/OFF
  215.     SET EDIT ON/OFF
  216.     SET PAGING ON/OFF
  217.     PANEL ON/OFF 
  218.  5. OPEN FILE "SBpro-file" 0 to 9, INDEX "SBpro-index" 0 to 9
  219.  6. OPEN FORM "FileName"
  220.     LOAD KEY "FileName"
  221.     LOAD QUERY "FileName"
  222.  7. MENU CLEAR
  223.  8. MENU X,0,1,MenuName-X
  224.     MENU X,Y,Z,MenuItem-X-Y
  225.     (note that an item with three leading "-"s will be  ghosted (the  ugly Kick
  226.     2.04 "~"s have not been adapted yet)
  227.  9. SET HEADING "ProjectName   CurrentYear by Author"
  228. 10. REM Menu reader (uses a% for menu, b% for item)
  229.    MainMenu:
  230.     MENU ON a%,b%:WAIT MENU
  231.     IF a%=1 t/m 5 THEN ON b% GOTO MenuName 1 t/m 12
  232. 11. (creation  of  program  labels,  each  label  consists  of  the name of the
  233.     corresponding menu plus the number of the item. Ghosted items  will not get
  234.     a label or REMark)
  235. 12. REM *** menu + item-number *** (with each label)
  236. 13. SET HEADING Item (with each label)
  237. 14. ErrorHandler:
  238.     REM Error handler
  239.     IF ERRNO = 11 THEN GOTO MainMenu
  240.     CLS :DISPLAY BF ON "An error has occurred:"
  241.     DISPLAY :DISPLAY "Error #";
  242.     LTRIM$ ( STR$ ( ERRNO ,"999."));
  243.     ? " (that is: "ERR$ ( ERRNO ))
  244.     WAIT KEY OR MOUSE :RUN
  245. 15. REM ***************************************************************** 
  246.     REM ***                      THE SUBROUTINES                      *** 
  247.     REM *****************************************************************
  248. 16. (include zero to ten subroutines)
  249.  
  250. On syntax  checking the  application has  been stored, so exiting is permitted.
  251. Eagerly awaiting the creation, I included an option  to run  the application at
  252. once. In that case AppliGen will close all files, input/output channels and its
  253. form. The menu title will be  re-controlled by  Superbase, and  the application
  254. will be started.
  255.  
  256.                              Save appli SBpro4
  257.  
  258. Currently disabled. No need to fool-around until it isn't ghosted anymore, it's
  259. always disabled, in AppliGen 1.0.
  260.  
  261.                                  About ...
  262.  
  263. Shows a little request, informing you about my Internet address (which is a very
  264. unreliable site, I regard it as a send-only account).
  265.  
  266.                                    Quit
  267.  
  268. Returns to AmigaDOS. First pops-up a required "Are you sure?" request.
  269.  
  270.                           Show application ASCII
  271.  
  272. Much like generating an  SBpro3 source  for real.  The major  difference is the
  273. fact the  all output  is redirected to the screen. In this way you can see what
  274. an AppliGen generated source looks like  (also  very  handy  while  writing the
  275. package).
  276.  
  277.                            Clear all user menus
  278.  
  279. "Are you  sure?", if  so all  user-menus will be blanked. The author's name and
  280. the project name will remain the same.
  281.  
  282.                            Show Intuition menus
  283.  
  284. Shows the user-menus as real Intuition menus. Should come in handy, to see what
  285. your work  really looks like. Just like the routine which creates the source, a
  286. leading triple "-" will be ghosted. 
  287.  
  288. Note that rendering the menus takes a while (that is: on a  standard A500+). To
  289. wake you  up, a  request appears telling you the work has been done. This is an
  290. auto self-removing request, so even if the "OK"  gadget has  not been  used, it
  291. will vanish  in about  3 seconds. Selecting any item, will instruct AppliGen to
  292. return to the main-menu.
  293.  
  294.                            Capitalize menu-items
  295.  
  296. Your average useless chit-chat menu-bar filing option. To  capitalize all menu-
  297. names and  items, in  the stupid (one of the few stupid things about Superbase)
  298. Superbase way. This routine uses the FCASE$ option, meaning that only the first
  299. character will  be upper-case, all others will be lower-case (even if they were
  300. upper-case  before).  There's  no  "Are  you  sure?"-request,  so  proceed with
  301. caution!
  302.  
  303.                              Check application
  304.  
  305. This  performs  a  syntax  check,  the  same  as  in  "Create  application  for
  306. Superbase III" and "View application as ASCII text". Might  be useful  to check
  307. your work.  This option  will also draw a conclusion, it will inform you if the
  308. application is valid, or not.
  309.  
  310.                            Open SBpro 3.02 file
  311.  
  312. "3.02" shouldn't really be that precise, just as long as it is  a file accepted
  313. by Superbase  III. AppliGen  allows you to open up to ten files (just a limit I
  314. thought that would be enough, no limit of Superbase for that matter).
  315.  
  316. As this version of AppliGen uses SBpro III, the files must all  be in  the same
  317. directory. AppliGen will check for reoccurrences of the file you tried to open,
  318. if found the selected file will not be included again.
  319.  
  320. As Superbase III uses at least one index per file,  it was  possible to include
  321. an index  selection with the OPEN FILE selection. After selecting a file, thing
  322. file will be opened, and you will be asked to pick an  index. This  will be the
  323. file's default index in your application.
  324.  
  325.                            Open dBase III+ file
  326.  
  327. Yet another  ghosted item.  Who wants to use dBase anyway? It's great SBpro has
  328. the possibility to use dBase files, but who  wants to?  dBase is  a real MS/dos
  329. like package; developed by some all-I-know-is-IBM suckers who kept on improving
  330. the package without thinking about the real world. Just forget it, or to put it
  331. less friendly "dBase sucks!".
  332.  
  333.                          Open form / keys / query
  334.  
  335. All alike.  You can  include one  form, key and query per application. AppliGen
  336. will  present  a  request  containing  all  forms/keys/queries  in  the current
  337. directory. Select one, and it will be included.
  338.  
  339.                               Add menu-reader
  340.  
  341. This is  a toggle  menu. Perhaps  a standard Intuition check-mark would've been
  342. better. This will decide to include a small  DML routine  which read  the menu.
  343. It's MY  reader, Precision  software's own menu-reader (from the examples disk)
  344. is different.
  345.  
  346.                                 Add credits
  347.  
  348. Lets you decide wether to include credits in the source, or not.  Credits could
  349. look like this:
  350.  
  351. REM MusicDatabase, version 0.3
  352. REM Date  : March 3, 1992
  353. REM Author: Ivo Kroone
  354.  
  355. the CREDIT is the author's name.
  356.  
  357.                              Add error-handler
  358.  
  359. Includes a  standard error  handler, or  not. The  error-handler returns to the
  360. main-menu on error 11 ([STOP] from the VCR panel, or  [CTRL] +  [C]). Otherwise
  361. the number  and description  of the  error will  be displayed. After pressing a
  362. mouse button, or any key, the program will be started again (RUN).
  363.  
  364.                          Subroutines add / delete
  365.  
  366. Subroutines must be plain ASCII files. In case one forgot, an DML source can be
  367. saved  as  ASCII  using  'SAVE  "filename",TEXT'.  Up to ten subroutines can be
  368. included in the application.  AppliGen will  check for  duplicate routines, and
  369. remove one  of both.  A subroutine  can be  included by picking a file from the
  370. request. AppliGen  does not  check, anywhere,  if the  file is  really an ASCII
  371. file. SBpro  however, might crash on running the application if a subroutine is
  372. a binary.
  373.  
  374. Deleting a subroutine requires  some disk  activity. Anyone  using a diskdrive,
  375. has been  warned! A  request will  show, containing  the names  of all included
  376. subroutines. A selected routine (double-click or click-[OK]) will be deleted at
  377. once, no warning!
  378.  
  379.                                 Preferences
  380.  
  381. A bunch of toggle menus, using check-marks. Please use the SBpro manual to find
  382. out the meaning of each command (if unknown).
  383.  
  384. The "SET BUFFERS" is not a toggle menu.  The "Enter number of cache  buffers to
  385. use:" wishes a number between 1 and 99. The default buffer is 99.
  386.