'////////////////////////////////////////////////////////////////////////////// '// This program converts the C header files into hypertext format // '// The conversion is done from and to RAM: one directory at a time. So // '// you will have to run this about 15 times. The original ram: files // '// will be overwritten so there won't be two sets of files after the // '// conversion. Note that the fileselector at the start is to obtain // '// the correct drawer, however you must supply a filename from within // '// the drawer as well otherwise I will get an empty string! // '// Please try to do it right first time 'cause there's no error handling // '// built into this program. // '// The finished file on a normal text editor should look like:- '// '// @database '// @Index "Lib_Index/Main" '// @node Main "filename.h" '// '// <----file body goes here '// '// @endnode Main '// '////////////////////////////////////////////////////////////////////////////// ' Global PATH2$ Dir$="Ram Disk:" PATH$=Fsel$("Ram Disk:",""," Choose any file from ","the correct DRAWER!!") CHAR=Instr(PATH$,"/",1) PATH2$=Left$(PATH$,CHAR-1) FILE$=Dir First$(PATH2$) CHAR=Instr(FILE$," ",2) FILE$=Mid$(FILE$,2,CHAR-2) Proc CONVERT[FILE$] For I=1 To 50 FILE$=Dir Next$ Exit If FILE$="" CHAR=Instr(FILE$," ",2) FILE$=Mid$(FILE$,2,CHAR-2) Proc CONVERT[FILE$] Next I Print "All Done" End ' ' Procedure CONVERT[FILE$] H1$="@database"+Chr$(10) : H2$="@Index "+Chr$(34)+"Lib_Index/Main"+Chr$(34)+Chr$(10) : H3$="@node Main "+Chr$(34)+FILE$+Chr$(34)+Chr$(10) HEADER$=H1$+H2$+H3$ FOOTER$="@endnode Main"+Chr$(10) Open In 1,PATH2$+"/"+FILE$ L=Lof(1) Close 1 Reserve As Work 7,L+100 Copy Varptr(HEADER$),Varptr(HEADER$)+Len(HEADER$) To Start(7) Bload PATH2$+"/"+FILE$,Start(7)+Len(HEADER$) Copy Varptr(FOOTER$),Varptr(FOOTER$)+Len(FOOTER$) To Start(7)+Len(HEADER$)+L Bsave PATH2$+"/"+FILE$,Start(7) To Start(7)+Len(HEADER$)+L+Len(FOOTER$) Erase 7 End Proc