home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / mlv003.zip / mlv.cmd next >
OS/2 REXX Batch file  |  1993-09-13  |  7KB  |  232 lines

  1. /*                               MLV
  2.                         (Multiple List Viewer)
  3.                                  v0.3
  4.                            By Bill Esposito
  5.                           The Cereal Port BBS
  6.                                1:132/152
  7.                              (603)899-3335
  8.  
  9.                             Magic name 'MLV'
  10.                            for latest version
  11.  
  12. ***********************************************************************
  13. DISCLAIMER:  This software is provided "AS IS" without any warranty of
  14. any kind, either expressed or implied.  USE IT AT YOUR OWN RISK.
  15.  
  16. Copyright 1993 by Bill Esposito.  This program is FREEWARE, just let me
  17. know how you like it.
  18. ***********************************************************************
  19.                                            
  20. The Multiple List Viewer was written specifically to interface with the national
  21. USBBS list published by Darwin, or any 80 column ASCII text file.
  22.  
  23. Put MLV.CMD in your Max directory, and put the text files anywhere you want
  24. them, just be sure to define them below.
  25.  
  26. Modify your Max Menu.ctl file as follows:
  27.  
  28.      Xtern_Run Maxpipe.exe_%P_MLV.CMD   normal  "Text Database"
  29.  
  30. Your users will be presented with up to five (5) selections.  They may either
  31. perform a text search, or display the entire file.
  32.  
  33. To configure MLV, you must define some variables, and comment/uncomment some
  34. lines.
  35.  
  36. In order to comment out (REM) a line in REXX, you must precede the line with the 
  37. characters:  /*
  38. You must also CLOSE the remark with these characters:  */
  39. example:
  40.  
  41. /*   This is a REXX Remark  */
  42.  
  43. Read through the program and follow the instructions.
  44.  
  45. */
  46. l=1
  47. y=1
  48. /*  YOU CAN DEFINE UP TO 5 TEXT FILES FOR YOUR DATABASE                     */
  49.  
  50. file1='g:\max\mlv\sample.lst'       /* enter the full drive, path and filename                                    
  51.                                         of the 1st selection */                                       
  52. file2='drive:\path\filename.ext'    /* enter the full drive, path and filename
  53.                                        of the 2nd selection */                 
  54. file3='drive:\path\filename.ext'    /* enter the full drive, path and filename
  55.                                         of the 3rd selection */
  56. file4='drive:\path\filename.ext'     /* enter the full drive, path and filename
  57.                                         of the 4th selection */
  58. file5='drive:\path\filename.ext'     /* enter the full drive, path and filename
  59.                                         of the 5th selection */
  60.  
  61.  
  62. '@echo off'
  63. call RxFuncAdd 'SysloadFuncs','RexxUtil','Sysloadfuncs'
  64. call sysloadfuncs
  65.  
  66. menu:
  67. /* ansi on */
  68. cls
  69. noclr:
  70. say ''
  71. say '                   Multiple List Viewer'
  72. say '                          v0.3'
  73. say '                     by Bill Esposito'
  74. say
  75. say '                 '
  76. say ''
  77.  
  78. /*  YOU SHOULD NOW DEFINE THE TITLES OF YOUR SELECTIONS.  MAKE SURE THAT THE
  79.     SELECTION NUMBERS CORRESPOND TO THE TEXT FILE NUMBERS DEFINED ABOVE      */
  80.  
  81. say '              1.  Darwin USBBS List'
  82. say
  83. /* say '              2.  BLANK  '*/ 
  84. /* say                            */
  85. /* say '              3.  BLANK  '*/  
  86. /* say                            */
  87. /* say '              4.  BLANK  '*/ 
  88. /* say                            */
  89. /* say '              5.  BLANK  '*/ 
  90. /* say                            */
  91. say '              Q.  Quit back to BBS'
  92. pull todo
  93. if todo=Q then exit
  94. /*  NEXT, GO TO THE END OF THE FILE AND DEFINE THE HEADERS                */
  95. if todo=1 then filesch=file1
  96. if todo=2 then filesch=file2
  97. if todo=3 then filesch=file3
  98. if todo=4 then filesch=file4
  99. if todo=5 then filesch=file5
  100.  
  101. if todo=1 then call find
  102. if todo=2 then call find
  103. if todo=3 then call find
  104. if todo=4 then call find
  105. if todo=5 then call find
  106. call menu
  107. /* find */
  108. find:
  109. count=0
  110. i=0
  111. cls
  112. say ''
  113. say '                   Multiple List Viewer'
  114. say '                          v0.3'
  115. say '                     by Bill Esposito'
  116. say
  117. say '                 '
  118. say ''
  119. say
  120. say'                 1. Search for text'
  121. say
  122. say'                 2. Display the entire file '
  123. pull sd
  124. if sd=2 then call read
  125. if sd=1 then call search
  126. call menu
  127. search:
  128. say
  129. say 'What do you want to search for? (any text or numbers, no wildcards)'
  130. say '                                (ex. "NH" "603" "Esposito" "Espo" "Cereal")'
  131. say
  132. pull what
  133. if what='' then call menu
  134. call sysfilesearch what, filesch, 'file.'
  135. if todo=1 then call head1
  136. if todo=2 then call head2
  137. if todo=3 then call head3
  138. if todo=4 then call head4
  139. if todo=5 then call head5
  140. return: 
  141. do i=1 to file.0
  142. say file.i
  143. count = count + 1
  144. if count=20 then call more1
  145. end
  146. say 'Press <enter> to continue'
  147. pull enter
  148. call menu
  149. /* Read */
  150. read: 
  151. x=1
  152. loop:
  153. y='1'
  154.  
  155. newq = rxqueue('create')
  156. oq = rxqueue('set',newq)
  157. l=l+y
  158. ok=stream(filesch,'c','open')
  159. linein(filesch,1,0)
  160. loop2:
  161. do until x > 23
  162. say ''linein(filesch)''
  163. if lines(filesch)=''0'' then say 'Press the <ENTER> key to continue'
  164. if lines(filesch)=''0'' then pull enter
  165. if lines(filesch)=''0'' then call qdel
  166. x=x+y
  167. end
  168. more:
  169.   x=1
  170.    say 'more? (Y,n)'
  171.     pull yn
  172.     if yn='N' then call qdel
  173.      else
  174. call loop2
  175. call qdel
  176. qdel:
  177. call rxqueue 'delete',newq
  178. call rxqueue 'set',oq 
  179. ok=stream(filesch,'c','close')
  180. call menu
  181. more1:
  182. say 'more? (Y,n)'
  183. pull yn
  184. if yn='N' then call menu
  185. if todo=1 then call head1
  186. if todo=2 then call head2
  187. if todo=3 then call head3
  188. if todo=4 then call head4
  189. if todo=5 then call head5
  190. return
  191. /*     HEADER SECTION - The header will be displayed at the beginning of each
  192. 23 line screen.  If you do not want a header, just comment out the two (2)
  193. 'SAY' lines as shown for HEAD2: below.  You need only define/comment out the
  194. header for the selections you've defined.  In otherwords, if you have only
  195. three (3) of the five (5) selections enabled, then HEAD4 and HEAD5 need not
  196. be touched.                                                                 */
  197.  
  198.  
  199. head1:
  200. say 'PHONE        STATE  CITY      SYSOP          T/S      |    NAME, FEATURES'
  201. say '-------------------------------------------------------------------------'  
  202. count = 0
  203. return
  204.  
  205. head2:
  206. /* say ''  Comment out the 2 'say' lines if you don't want a header displayed */
  207. /* say '' */ 
  208. count = 0
  209. return
  210.  
  211. head3:
  212. say 'Put your header title on this line for the 3rd selection                 '
  213. say '-------------------------------------------------------------------------'  
  214. count = 0
  215. return
  216.  
  217. head4:
  218. say 'Put your header title on this line for the 4th selection                 '
  219. say '-------------------------------------------------------------------------'  
  220. count = 0
  221. return
  222.  
  223. head5:
  224. say 'Put your header title on this line for the 5th selection                 '
  225. say '-------------------------------------------------------------------------'  
  226. count = 0
  227. return
  228. /* History
  229. .2  Fixed Header Display problem
  230. .3  Fixed 'Bad Arithmatic' error
  231. */
  232.