home *** CD-ROM | disk | FTP | other *** search
/ Media Share 13 / mediashare_13.zip / mediashare_13 / ZIPPED / NETWORK / GP25.ZIP / MAKEHELP.PRG < prev    next >
Text File  |  1993-07-04  |  3KB  |  99 lines

  1. *  The purpose of this program is to create a FoxPro compatible
  2. *  help file for the GPLIB.DOC.
  3. *
  4. *  To create a FoxPro Help file, from the command window type
  5. *    DO MAKEHELP
  6. *
  7. *  This will create the FoxPro help database.  At any time in the future,
  8. *  when you need this help file, you can access it by issuing the command
  9. *  SET HELP TO GPHELP.
  10. *
  11. *  To set the help file back to the standard FoxPro Help file issue
  12. *  the command SET HELP TO.
  13. #define CR_LF chr(13)+chr(10)
  14. close all
  15. clear
  16. if set('TALK') = 'ON'
  17.     set talk off
  18.     LastTalk = 'ON'
  19. else
  20.     LastTalk = 'OFF'
  21. endif
  22. define window Intro from 3, 5 to 19, 75 system color scheme 5 title " GPLIB MakeHelp System " shadow footer " ESC to abort "
  23. activate window Intro
  24. text
  25.  
  26.   MakeHelp has the capability to translate "See Also" to a text
  27.   string that you specify.  If you are using a non-English
  28.   language version of FoxPro you can enter the text that
  29.   corresponds to See Also for your version of FoxPro.  Making
  30.   this translation will enable the See Also function of the
  31.   FoxPro Help system to operate with the GPLIB Help file.
  32. endtext
  33. Foreign = .f.
  34. TransString = space(20)
  35. @10, 2 say 'Are you using a non-English version of FoxPro? ' get Foreign picture "Y"
  36. @12, 2 say 'Enter your language equivalent of See Also ' get TransString when Foreign
  37. read
  38. deactivate window Intro
  39. release window Intro
  40. if lastkey() = 27
  41.     return
  42. endif
  43. TransString = alltrim(transString)
  44. set help to (sys(2004)+'FOXHELP')
  45. create table GPHELP ( topic C(30), Details M(8), class C(20))
  46. File_Handle = fopen("GPLIB.DOC")
  47. if File_Handle < 0
  48.     wait window "Error Opening GPLIB.DOC"
  49.     return
  50. endif
  51. TotalSize = fseek(file_handle, 0, 2)
  52. MTopic = ""
  53. MemField = ""
  54. = fseek(file_handle, 0, 0)
  55. do while .not. feof(file_handle)
  56.     CurrentLine = fgets(File_Handle, 2048)
  57.     if empty(MTopic) .and. .not. isalpha(CurrentLine)
  58.         loop
  59.     endif
  60.     if empty(MTopic) .and. isalpha(CurrentLine)
  61.         MTopic = left(CurrentLine, at(")", CurrentLine))
  62.         MCLass = "Function"
  63.         if empty(MTopic)
  64.             MTopic = CurrentLine
  65.             MClass = "General"
  66.         endif
  67.     endif
  68.     if CurrentLine = chr(12)
  69.         CurrentPos = fseek(file_handle, 0, 1)
  70.         wait window 'MakeHelp conversion ' + ltrim(str((CurrentPos / TotalSize) * 100)) + '% done.' nowait
  71.         append blank
  72.         if MClass = "General"
  73.             replace topic with " " + mtopic
  74.         else
  75.             replace topic with MTopic
  76.         endif
  77.         TopicLine = ;
  78.                 "╓─────────────────────────────────╖" + CR_LF + ;
  79.                 "║"    + padc(MTopic, 33) +       "║" + CR_LF + ;
  80.                 "╙─────────────────────────────────╜" + CR_LF + CR_LF
  81.         replace class with MClass
  82.         if Foreign
  83.             replace details with TopicLine + strtran(MemField, 'See Also', TransString)
  84.         else
  85.             replace details with TopicLine + MemField
  86.         endif
  87.         MTopic = ""
  88.         MemField = ""
  89.     else
  90.         MemField = MemField + CurrentLine + CR_LF
  91.     endif
  92. enddo
  93. = fclose(File_Handle)
  94. wait window "MakeHelp conversion complete." timeout 2
  95. use
  96. set help to GPHELP
  97. set talk &LastTalk
  98. help
  99.