Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : FOX2NG.ZIP
Filename : FOX2NG.PRG
Output of file : FOX2NG.PRG contained in archive : FOX2NG.ZIP
* Copyright Tom Stearns, Solutions for Business Computing, 1991
* all rights reserved
*
* This procedure was developed to convert the Foxhelp files which come
* with Foxpro to Norton Guide Format. To use this you must have the
* Norton Guides engine (NG.exe), the compiler (NGC.exe) and the linker
* (NGML.exe).
*
* To run; simply put this program in the same directory as your foxhelp.*
* files (or change the USE line). Run this program, it will create the
* menu link file (foxpro) and the data file (foxpro.dat). Then run NGC
* FOXPRO.DAT. This will create a file foxpro.ngo. Then run NGML
* FOXPRO. This will create the foxpro.ng file that the Guides actually
* use. Delete the intermediate files (Foxpro,.ngo,.dat) and move the
* foxpro.ng file to the directory where NG.exe is located.
*
* This program (cvtfxhlp) takes about 15 minutes to run on my 33 MHz 386
* so it is not fast, but it is, so far as I can see, thorough. It will
* display for you the current function/command being processed as well
* as how many lines are in it. You'll need about 4 Mb free disk space
* to complete this process.
*
* * DISCLAIMER: This procedure works with my foxhelp file date 8-15-90
* It should work OK with others, the only changes likely to be
* necessary will be to the routine PRO_NAME which converts some of
* Fox's "See also" notations to the correct entry so that NG can find
* them, with it's !seealso option. The original "See also" is kept in
* the help entry the change is made only on the NG !seealso part.
*
* LEGAL MUMBO JUMBO: You may use these procedures for their intended
* purpose. You are free to use any ideas you get here without
* permission or compensation. I expect no payment for this little
* ditty, you are free to use as you will except that you may not
* include it in anything else without my express permission.
*
* NEW DEVELOPMENT: I just DL'd a demo of a product called Easy Help. It
* uses NG databases as is but has several neat features: 1) If you have
* EMS it uses 1K of conventional ram. 2) Sticky screens (the help screen
* stays visible for a while after you leave the help system, so you
* don't have to remember all that you looked up). 3) Cut and Paste from
* the help system to your editor. It looks really good, the demo is
* good for 20 minutes each time you load it, and is available from
* CLMFORUM Lib 5 EHELP.ZIP. They offer a discount to registered NG users
* Check it out. I have run into one bug with my editor (Sage Professional
* Editor) and EH. It is minor and I hope they will have it fixed soon.
* RCS DATA:
* $Date$
* $Revision$
* $Log$
*
set scoreboard off
set status off
set confirm on
set bell off
set talk off
set exact off
set safety off
set deleted on
set exclusive on
set reprocess to automatic
set path to data
set memowidth to 76
**
** draw a title box
**
clear
s1 = "Convert Fox Help Files to Norton Guides Format"
comp_name = "Copyright 1991, Tom Stearns"
store max(len(s1),len(comp_name)) to m_len
@2,0 say space(40-(len(s1)/2)) + s1
@3,0 say space(40-(len(comp_name)/2)) + comp_name
@1,40-(m_len/2)-2 to 4,40-(m_len/2)+m_len+1 double
**
** create the menu file for NG
**
ng = fcreate("foxpro")
if ng = 0
do err_mess with "Unable to open Norton menu file"
quit
endif
**
** now put the required NG stuff in the file, you may want to change
** the FoxPro 1.02 to reflect the correct version, so far as I know
** this should work with 1.00 - 1.02, hopefully even 2.00
**
=fputs(ng,"!name: FoxPro 1.02")
=fputs(ng," ")
=fputs(ng," foxpro.ngo")
=fputs(ng," ")
=fclose(ng)
**
** now create the data file
**
ng = fcreate("foxpro.dat")
if ng = 0
do err_mess with "Unable to open Norton data file"
quit
endif
use foxhelp
store reccount() to rc
do while ! eof()
lline2 = ''
ccnt = 0 && char counter, long desc's can be no longer than 12K
@10,10 say "Now Processing: " + topic
@11,10 say "Number " + str(recno(),4) + " of " + str(rc,4)
=fputs(ng,"!short: "+topic)
nl = memlines(details)
@12,10 say "Lines: " + str(nl,4)
for cnt = 1 to nl
line = mline(details,cnt)
ccnt = ccnt + len(line)
if ccnt > 11900 && you can only have 12000 chars in a single topic
**
** create a new topic
**
=fputs(ng,' ^B***** Continued *****^B')
=fputs(ng,' ')
=fputs(ng,"!short: "+trim(topic)+" cont'd")
ccnt = len(line)
endif
=fputs(ng,line)
if (nl - cnt) < 5 && we're near the end, look for See also:
if line = "See also:"
lline = alltrim(substr(line,10)) && trim off Fox's See also:
if right(lline,1) = ','
**
** there is more than one line of See also, get the next memo
** line, write it to our help file then append it to lline
** so that we can get all the see also entries
**
cnt = cnt + 1
line = mline(details,cnt)
ccnt = ccnt + len(line)
=fputs(ng,line)
lline = lline+alltrim(line)
endif
**
** take this one See also entry at a time, verify that the See
** also is proper using the pro_name function, then put it in "'s.
** technically this is not required for single word entries like
** SYS, but is for multi-word entries like MODIFY MEMO so we'll do
** it for all entries to be sure
**
mcnt = 1 && beginning substring position
acnt = 1 && counts occurrences, look for the nth ,
&& lcnt is the position of the nth ,
do while .t.
lcnt = at(',',lline,acnt)
if lcnt = 0 && this is the last one
tline = alltrim(substr(lline,mcnt))
lline2 = lline2 + ' "'+pro_name(tline)+'"'
exit
else
tline = alltrim(substr(lline,mcnt,lcnt-mcnt))
lline2 = lline2 + ' "'+pro_name(tline)+'"'
mcnt = lcnt +1
acnt = acnt + 1
endif
enddo
endif
endif
endfor
if ! empty(lline2)
=fputs(ng,"!seealso: "+lline2)
endif
=fputs(ng," ")
skip
enddo
=fclose(ng)
quit
********************
Procedure err_mess
********************
parameters message
* figure left and right positions
le = 38 - ((len(message + ", press any key to continue")) / 2)
ri = 42 + ((len(message + ", press any key to continue")) / 2)
define window err_mess from 11,le to 13,ri title " Note " panel shadow
activate window err_mess
@0,1 say message + ", Press any key to continue"
wait ''
deactivate window err_mess
return
********************
Procedure pro_name
********************
**
** Fox is not consistent in listing See also's so that they refer to a
** previous category, this will fix all known inconsistencies in my file
**
** EG: "See also: SYS(12)" when there is no SYS(12) help just a SYS()
**
** If you are going to have a problem with this it will happen when you
** run NGC, NGC will report:
** Warning: can't find the see-also reference "blah blah"
** You'll then have to correct this here with a:
** CASE name = "blah blah"
** return "blah-blah"
**
**
parameters name
do case
case substr(name,1,3) == "SYS"
return "SYS()"
case name = "CREATE/MODIFY MEMO"
return 'CREATE MEMO" "MODIFY MEMO'
case name = "CREATE/MODIFY LABEL"
return 'CREATE LABEL" "MODIFY LABEL'
case name = "CREATE/MODIFY REPORT"
return 'CREATE REPORT" "MODIFY REPORT'
case name = "MODIFY COMMAND"
return "MODIFY COMMAND/FILE"
case name = "?/??"
return '? | ??'
case name = "SET SCHEME"
return 'SET COLOR OF SCHEME'
case substr(name,1,3) = "UDF"
return 'USER-DEFINED'
case substr(name,1,5) = "CLEAR"
return 'CLEAR'
case name = "?/??"
return '? | ??'
case substr(name,1,7) = "RELEASE"
return 'RELEASE'
case substr(name,1,4) = "LIST"
return 'LIST'
case substr(name,1,11) = "PARAMETER()"
return 'PARAMETERS()'
case substr(name,1,9) = "PARAMETER"
return 'PARAMETERS'
case name = "PAD"
return 'PAD()'
case name = "DIR"
return 'DIRECTORY'
case name = "LASTKEY"
return 'LASTKEY()'
case name = "@ ... SAY"
return '@ ... SAY/GET'
case name = "@ ...SAY"
return '@ ... SAY/GET'
case name = "PLAY MACROS"
return 'PLAY MACRO'
case substr(name,1,5) = "CLOSE"
return 'CLOSE'
case name = "DISPLAY/LIST STATUS"
return 'DISPLAY STATUS" "LIST'
case name = "WCOL()"
return 'WCOLS()'
case name = "WROW()"
return 'WROWS()'
case name = "PAYMENT"
return 'PAYMENT()'
otherwise
return name
endcase
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/