home *** CD-ROM | disk | FTP | other *** search
/ Outlet 77 / outlet-77.mgt / APPINFO.T < prev    next >
Text File  |  2021-04-18  |  16KB  |  1 lines

  1. Writing Applications                                                                                                            The first thing that has to                                     happen is that you have an idea.                                When this happens, program as                                   usual, but avoid the following                                  variables,size of array follows:                                                                                                m$(3,65,13)                                                     z$(12)                                                          l(31)                                                           p (16,2)                                                        z(30,7)                                                         f$(3,65)                                                        t$(10,3)                                                        s$(2,11,2)                                                      d(9)                                                            r(4,2)                                                          drv                                                             f                                                               fil                                                             bot                                                             top                                                             error                                                           store                                                           recall                                                          udglb                                                           udghb                                                           screen                                                          delete                                                          show                                                            app                                                             oloa                                                            win                                                             g$                                                              s                                                               t                                                               s1                                                              t1                                                              w1                                                              sel                                                             opt                                                             addr                                                                                                                                                                                            You can use any other variables                                 at will, and some of those                                      listed above can be used, but to                                be on the safe side it is better                                that they aren't.                                                                                                               Your program shouldn't be too                                   long, about 4.5k is the MAXIMUM                                 size which can be used, about                                   2k (including storage areas)                                    would be the best size.                                                                                                         Obviously the smaller the                                       application the more can be in                                  memory at any one time, however,                                I have prevented the computer                                   from loading an application if                                  the available memory is smaller                                 than 1500 bytes.                                                                                                                Up to 8 applications could                                      (theoretically) be in memory,                                   however 2 is probably the                                       maximum practical.                                                                                                              Ok, so you have written you                                     program, what next?                                                                                                             Firstly renumber your program                                   (so that means you can't use                                    calculated GOTO's/GOSUB's) to                                   any of these start lines:                                                                                                       1500,1550,1600,1650,1700,1750,                                  1800,1850                                                                                                                       these correspond to                                             app(lication) numbers.                                                                                                          Then design an icon (2 chars                                    deep by 3 chars wide) and place                                 it anywhere in memory (I prefer                                 to keep them close to the other                                 icons in memory (about 52736                                    onwards)).  Save your icon as                                   "what_ever_the_application_is to                                be_called + .RES"                                                                                                               Then on line 624+app_number                                     PRINT in the input area your                                    icon (remember to switch udg                                    banks). It doesn't matter where                                 it is printed in the input area,                                but it is best to stick to the                                  following x coordinates:                                                                                                        App_number   X-coord                                               1           0                                                   2           4                                                   3           8                                                   4          12                                                   5          16                                                   6          20                                                   7          24                                                   8          28                                                                                                                Now, on line 390+app_number                                     enter:                                                                                                                          IF t>=[x-coord) AND                                             t=<[x-coord+3] THEN LET app=o1:                                 LET n=[start line of app]: LET                                  i$="[Name of Application]": LET                                 a$="[Information about the                                      application, up to 80 chars,                                    right margin set at 20]"                                                                                                        There is one more thing that has                                to be done, set up a DATA                                       statement telling the computer                                  which lines have to be deleted                                  when the application is removed.                                                                                                On the first line of your                                       application (before any other                                   data statements in your                                         application). Put the start of                                  finish of any lines loaded in                                   with the application.                                                                                                           If you had used app_number 1,                                   and had followed the numbering                                  policy I have, given your data                                  statement would read                                                                                                            DATA 391,391,625,625,1500,1548                                                                                                  Note that the last number is                                    1548 and NOT 1549 this is                                       because on line 1549 in this                                    example must read:                                                                                                              1549 DATA 10000,0                                                                                                               This signifies the end of the                                   deleting data, this line is then                                deleted itself.                                                                                                                                                                                 Routines to Help you Program                                                                                                    I have included in the program a                                number of useful routines. They                                 are usually called via variable                                 to save memory:                                                                                                                 Line      Function                                                                                                              800       Menu routine                                                                                                                    Entry conditions:                                               x,y  coords of top                                                   right corner                                               le   length of menu                                                  bar                                                        opt  number of options                                                                                                          Exit conditions:                                                sel  option selected                                                                                                  store     stores screen in                                                memory                                                                                                                recall    recalls screen from                                             memory                                                                                                                error     Error/message window                                                                                                            Entry condition:                                                i$   message, max                                                    length=60 chars                                            right margin=20 chars                                                                                                           Exit conditions:                                                                                                                err=0  cancel selected                                          err=2  retry selected                                                                                                 910       will load a file                                                                                                                Entry condition:                                                                                                                g$    16 char filename                                                                                                g$ takes the form of:                                                                                                           g$(1)=file type: chr$ 3 = font                                                   chr$ 4 = basic                                                  chr$ 7 = tool                                                   chr$ 8 =screen$                                                 chr$ 9 = game                                                   chr$10 = app                                                                                                   These are the loadable file                                     types, there are others. GAME                                   files and TOOL files are BASIC                                  programs.                                                                                                                                                                                       g$(2 to 3) = user area                                                                                                          g$(4 to 5) = drive including                                                 colon                                                                                                              g$(6 to 13)= file name                                                                                                          g$(14 to 16)=file type                                                                                                                                                                                                                                          930      Check a +3 DOS filename                                         from an user input for                                          invalid characters                                                                                                              Entry conditions:                                               a$  filename                                                    err = 1 if filename OK                                          err = 0 or                                                      err = 2 if filename bad                                                                                                950      Input text, this is                                             only really suitable                                            for filenames.                                                                                                                  Entry conditions:                                               x,y  coords of input                                                                                                            Exit conditions:                                                a$   text, max length                                                is 7 chars                                                                                                                                                                        If you wish to use to pointer in                                a routine then call with USR                                    49152, the x coord is in 49531                                  and the y coord is in 49532                                                                                                     Best of luck with your                                          applications writing                                                                                                                           - Dominic Morris                                                  6 June 1992