home *** CD-ROM | disk | FTP | other *** search
/ Colossal Cookbook / ColossalCookbook.cdr / cc / cc_to_qb / cc_to_qb.bas next >
BASIC Source File  |  1991-03-14  |  3KB  |  107 lines

  1. 10 REM PROGRAM NAME IS CC-TO-QB.BAS
  2. 20 REM Written by John P. Nicholson of 1:308/10
  3. 30 REM This basic program has no warranties an is guaranteed to do nothing
  4. 40 REM more than take up disk space on your system.  The code is placed in
  5. 50 REM the public domain and you can do with it as you see fit.  Please
  6. 60 REM keep the documentation with this program if you plan to share it with
  7. 70 REM others.  The intended purpose of this program is to CONVERT COMPUCHEF
  8. 80 REM formated recipes to QUIKBOOK formatted recipes.
  9. 90 REM Version 1.2 - Dated 16 March 1991 (Please read the documentation)
  10. 100 REM
  11. 110 DIM Q$(200)
  12. 120 MM1$="    ***********"
  13. 130 MM2$="    ***** "
  14. 140 MM3$="    Categories: "
  15. 150 MM4$="    *** Recipe Via Compu-Chef"
  16. 160 QB1$="-Begin Recipe Export- QuikBook version 0.96 Beta A"
  17. 170 QB2$="Title: "
  18. 180 QB3$="Keywords: "
  19. 190 QB4$="-End Recipe Export-"
  20. 200 Q=0
  21. 210 H=0
  22. 220 L=0
  23. 230 S=0
  24. 240 FIN$="COMPCHEF"
  25. 250 REM "This is where we open 2 files for I/O"
  26. 260 OPEN FIN$ FOR INPUT AS 1
  27. 270 OPEN "CC-QBOUT" FOR OUTPUT AS 2 LEN=79
  28. 280 LINE INPUT#1, AA$
  29. 290 L=L+1
  30. 300 IF EOF(1) THEN 750
  31. 310 IF LEFT$(AA$,15) = MM1$ THEN GOTO 360
  32. 320 IF LEFT$(AA$,10) = MM2$ THEN GOTO 430
  33. 330 IF LEFT$(AA$,16) = MM3$ THEN GOTO 530
  34. 340 IF LEFT$(AA$,29) = MM4$ THEN GOTO 600 ELSE GOTO 660
  35. 350 PRINT "ERROR IN LINE";L;"of input file."
  36. 360 IF H=1 THEN GOTO 280
  37. 370 Q=Q+1
  38. 380 Q$(Q)=QB1$
  39. 390 H=1
  40. 400 Q=Q+1
  41. 410 Q$(Q)=" "
  42. 420 GOTO 280
  43. 430 Q=Q+1
  44. 440 F=LEN(AA$)-16
  45. 450 BB$=MID$(AA$,11,F)
  46. 460 AA$=QB2$+BB$
  47. 470 Q$(Q)=AA$
  48. 480 LINE INPUT#1, AA$
  49. 490 L=L+1
  50. 500 LINE INPUT#1,AA$
  51. 510 L=L+1
  52. 520 GOTO 280
  53. 530 Q=Q+1
  54. 540 E=LEN(AA$)
  55. 550 BB$=MID$(AA$,17,E)
  56. 560 E=LEN(BB$)
  57. 570 GOSUB 780
  58. 580 Q$(Q)=AA$
  59. 590 GOTO 280
  60. 600 Q=Q+1
  61. 610 Q$(Q)=" "
  62. 620 Q=Q+1
  63. 630 Q$(Q)=QB4$
  64. 640 H=0
  65. 650 GOTO 690
  66. 660 Q=Q+1
  67. 670 Q$(Q)=AA$
  68. 680 GOTO 280
  69. 690 FOR M = 1 TO Q
  70. 700   PRINT#2, Q$(M)
  71. 710 NEXT M
  72. 720 Q=0
  73. 730 PRINT L
  74. 740 GOTO 280
  75. 750 PRINT "E.O.F. at Line ";L
  76. 760 CLOSE
  77. 770 END
  78. 780 X = 1
  79. 790 IF E >= 17 THEN GOTO 830
  80. 800   CC$=BB$
  81. 810 AA$=QB3$+CC$
  82. 820 RETURN
  83. 830 IF E >= 33 THEN GOTO 920
  84. 840 FOR S = 1 TO E
  85. 850   IF MID$(BB$,S,1) <> " " THEN GOTO 880
  86. 860   A = S-1
  87. 870   GOTO 890
  88. 880 NEXT S
  89. 890 DD$ = MID$(BB$,1,A)+", "+MID$(BB$,17,E)
  90. 900 AA$=QB3$+DD$
  91. 910 RETURN
  92. 920 FOR S = 1 TO E
  93. 930   IF MID$(BB$,S,1) <> " " THEN GOTO 960
  94. 940   A = S-1
  95. 950   GOTO 970
  96. 960 NEXT S
  97. 970 TT$ = MID$(BB$,1,A)+", "+MID$(BB$,17,E)
  98. 980 F = LEN(TT$)
  99. 990 FOR S = A+3 TO F
  100. 1000   IF MID$(TT$,S,1) <> " " THEN GOTO 1030
  101. 1010   B = S-1
  102. 1020   GOTO 1040
  103. 1030 NEXT S
  104. 1040 EE$ = MID$(TT$,1,B)+", "+MID$(BB$,33,E)
  105. 1050 AA$=QB3$+EE$
  106. 1060 RETURN
  107.