home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / utils / m&more.zip / SAMPLES.DOC < prev    next >
Text File  |  1990-08-08  |  7KB  |  228 lines

  1.                   WELCOME TO JCK ENTERPRISES'S          (VER0790)
  2.                  MEMOS&MORE, THE FILE COMPANION
  3.  
  4. SAMPLE PROGRAMS =================================================
  5.  
  6. In most cases, application programs commonly used today allow the
  7. passing of a filename through the command line for automatic
  8. loading.  The following examples are provided as guides for
  9. loading files into programs which do not accept filenames as
  10. command line parameters.  Once the process is defined the
  11. launching of the file from the command line becomes transparent.
  12.  
  13.          Examples are provided for:
  14.  
  15.             1) Lotus 1-2-3
  16.             2) DBase III Plus
  17.             3) AutoCad
  18.  
  19. The techniques presented in the examples are fairly straight
  20. forward and can be modified as required.  In addition, when
  21. MEMOS&MORE, THE FILE COMPANION launches a file it writes the file
  22. name information on the file EXITFILE.&MR in the Memos&More home
  23. directory as text.  It has three lines which offers info on the
  24. launched file name in the following ways:
  25.  
  26.                  1) Path only;
  27.                  2) Filename & Extension only
  28.                  3) Path, FileName & Extension
  29.  
  30. This file could be accessed by the application program or by some
  31. other means for processing.
  32.  
  33. Example 1:  Lotus Spreadsheets ==================================
  34.  
  35. Lotus 1-2-3 provides a means of taking control upon loading
  36. through the use of the \0 macro found in a spreadsheet.  This is
  37. invoked after the file is loaded.  Lotus 1-2-3 also automatically
  38. loads a default filename(AUTO123.WK1), if it exists.  These
  39. features have been combined in the following batch file.
  40.  
  41. Note: This example assumes the following:
  42.   o LOTUS 1-2-3 resides on the D:\LOTUS subdirectory
  43.   o the file AUTO123.MAC resides on the D:\LOTUS subdirectory
  44.   o first parameter( %1 ) is the Lotus worksheet you wish to load
  45.   o you are running MS-DOS 3.30 or higher.
  46.   o You also have the Allways Lotus Add-In package
  47.  
  48. Sample Call from the Command Line:   C:\ >LOTUS work1.wk1
  49.  
  50. FILE: LOTUS.BAT
  51.  
  52. @echo off
  53.   .
  54.   .
  55.   .                Fill in your stuff here ....
  56.   .
  57.   .
  58. set prog=123
  59. set oldpath=%path%
  60. set path=d:\lotus;d:\lotus\allways;%path%
  61. : ALLWAYS CHECK ......
  62. if not exist allways.adn  set noall=true
  63. if "%noall%" == "true"  copy d:\lotus\allways.adn allways.adn > nul
  64. : CHECK IF A PARAMETER IS PASSED IN .... ASSUMED A *.WK1 File ...
  65. IF "%1" == "" GOTO :SKIP
  66.     ECHO %1 > 123FIL.TXT
  67.     COPY D:\LOTUS\AUTO123.MAC AUTO123.WK1 > NUL
  68. :SKIP
  69. d:\lotus\%prog%
  70. : CLEANUP ALLWAYS STUFF ...
  71. if "%noall%" == "true"  del allways.adn
  72. : CLEANUP THE PARAMETER STUFF ...
  73. IF "%1" == "" GOTO :SKIP2
  74.     DEL 123FIL.TXT > NUL
  75.     DEL AUTO123.WK1 > NUL
  76. :SKIP2
  77. : CLEAN UP THE ENVIRONMENT VARIABLES ...
  78. set path=%oldpath%
  79. set oldpath=
  80. set noall=
  81. set prog=
  82.   .
  83.   .
  84.   .                Fill in your stuff here ....
  85.   .
  86.   .
  87. :END
  88.  
  89. The AUTO123.MAC file is a spreadsheet with the following Macro:
  90.  
  91.       I            J            K            L            M
  92.  1   \0       {WINDOWSOFF}
  93.  2            {OPEN "123FIL.TXT",R}
  94.  3            {READLN J10}
  95.  4            {CLOSE}
  96.  5            {RECALC J7..J7}
  97.  6            /fr{ESC}{ESC}
  98.  7                         { J7 Contains: @TRIM(@S(J10..J10)) }
  99.  8            ~
  100.  9
  101. 10                         { J10 Gets the file name to load ... }
  102.  
  103.  
  104. EXAMPLE 2: DBASE III Plus Data Base =============================
  105.  
  106. DBASE III Plus provides a means of loading a .PRG program file
  107. from the command line.  The file DBLOAD.PRG is a short DBase
  108. program which loads the desired database filename.  The file
  109. DBLOAD.DBF is a short database consisting of only one character
  110. field(FNAME) of width 80(Use DBASE to look at the file
  111. DBLOAD.DBF).  The DBLOAD.PRG program uses the DBLOAD.DBF to read
  112. the file DBFIL.TXT(created in the batch file) into the FNAME
  113. field and then uses the database specified in FNAME.
  114.  
  115. Note: This example assumes the following:
  116.   o DBASE resides on the D:\DBASE subdirectory
  117.   o the DBLOAD.DBF & DBLOAD.PRG files also reside on D:\DBASE
  118.   o first parameter( %1 ) is the DBase III Plus file when the
  119.     second parameter ( %2 ) is specified. Other wise %1 is
  120.     considered a .PRG file
  121.   o you are running MS-DOS 3.30 or higher.
  122.  
  123. Sample Call from the Command Line:   C:\ >DBASE mydbf.dbf x
  124.  
  125. FILE: DBASE.BAT
  126.  
  127. @echo off
  128.   .
  129.   .
  130.   .                Fill in your stuff here ....
  131.   .
  132.   .
  133. d:
  134. cd \dbase
  135. : CHECK IF A SECOND PARAMETER IS PASSED IN .... THEN %1 IS A *.DBF ...
  136. IF "%2" == "" GOTO :PRG
  137.     ECHO %1 > DBFIL.TXT
  138.     SET PRG=DBLOAD
  139.     GOTO :DBASE
  140. :PRG
  141.     SET PRG=%1
  142. :DBASE
  143. d:\dbase\dbase %prg%
  144. : CLEANUP THE PARAMETER STUFF ...
  145. IF "%2" == "" GOTO :SKIPIT
  146.     DEL DBFIL.TXT > NUL
  147. :SKIPIT
  148. cd\
  149.   .
  150.   .
  151.   .                Fill in your stuff here ....
  152.   .
  153.   .
  154. :END
  155.  
  156. The DBASE III Plus program follows:
  157.  
  158. FILE: DBLOAD.PRG
  159.  
  160. set delete on
  161. use C:\DBASE\DBLOAD.DBF
  162. delete all
  163. pack
  164. go top
  165. append from C:\DBASE\DBFIL.TXT type delimited
  166. goto 1
  167. s = Trim(FNAME)
  168. use &s
  169.  
  170.  
  171. EXAMPLE 3: AutoCad Drawing Files ================================
  172.  
  173. AutoCad provides a means to change the default file name at
  174. startup and the capability to start executing a script file from
  175. the command line.  These features have been combined in the
  176. following example.
  177.  
  178. Note: This example assumes the following:
  179.   o AutoCad resides on the C:\ACAD subdirectory
  180.   o the ACADLD.SCR file also resides on C:\ACAD
  181.   o first parameter( %1 ) is the AutoCad .DWG file you wish to
  182.     load
  183.   o you are running MS-DOS 3.30 or higher.
  184.   o you are using AutoCad version 10.
  185.  
  186. Sample Call from the Command Line:   C:\ >ACAD mydwg.dwg f
  187.  
  188. FILE: ACAD.BAT
  189.  
  190. @echo off
  191.   .
  192.   .
  193.   .                Fill in your stuff here ....
  194.   .
  195.   .
  196. IF "%1" == "" GOTO :NOFILE
  197.     acad %1 acadld.scr
  198.     GOTO :NOFILE
  199. :NOFILE
  200.     acad
  201. :SKIP
  202.   .
  203.   .
  204.   .                Fill in your stuff here ....
  205.   .
  206.   .
  207. :END
  208.  
  209. The ACADLD.SCR script follows:
  210.  
  211. FILE: ACADLD.SCR
  212.  
  213. This text file contains only two (2) lines.  The first one with
  214. only option 2 invoked from the ACAD Main Menu.  The second line
  215. which is blank tells ACAD to use the default filename which was
  216. passed in on the command line .
  217.  
  218.  line 1: 2
  219.  line 2:
  220.  
  221. ACKNOWLEDGEMENTS ================================================
  222.  
  223.   o Lotus, 1-2-3 and Allways are registered trademarks of Lotus
  224.     Development Corp.
  225.   o DBase III is a registered trademark of Aston-Tate Corp.
  226.   o AutoCad is a registered trademark of AutoDesk, Inc.
  227.   o MS-DOS is a registered trademark of MicroSoft Corp.
  228.