Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : DBF2CH.ZIP
Filename : DBF2CH.PRG

 
Output of file : DBF2CH.PRG contained in archive : DBF2CH.ZIP
/*
*
* File......: DBF2CH.PRG
* Author....: Steve Kolterman
* CIS ID....: 76320,37
* Date......: November 5, 1993
*
* See the README.1ST file in DBF2CH.ZIP for restrictions on redistribution.
*
*/

#include "dbf2ch.ch"

FUNCTION MakeChFile( cDbff,cChname,cAlias,cUscore )
LOCAL aFnarray,cScr,cPath,nCurs,aCurs,lUScore,nErrcume

nCurs:= SetCursor(SC_NONE)
aCurs:= {row(),col()}
IIF(cUscore==NIL,cUscore:= "",)
cScr:= SaveScreen(0,0,maxrow(),maxcol())
nErrcume:= 0

IF cDbff <> NIL .AND. FILE( DBF_NAME )
lUscore:= ( (cAlias<>NIL .and. "/NU" $Upper(cAlias)) .or. ;
"/NU" $Upper(cUscore) )
cAlias:= IIF(cChname<>NIL .and. "/" $cChname,Upper(cChname),;
IIF(cAlias<>NIL,Upper(cAlias),cAlias))
aFnarray:= DIRECTORY( IIF(WILDCARD,cDbff,DBF_NAME) )
cChname:= IIF((cChname<>NIL .and. "/"$ cChname) .or. aFnarray==NIL .OR. ;
LEN(aFnarray) > 1, NIL, cChname )
IF !Empty(aFnarray)
cPath:= IIF("\" $cDbff .OR. ":\" $cDbff,LEFT(cDbff,RAT("\",cDbff)),;
IIF(":" $cDbff,LEFT(cDbff,RAT(":",cDbff)),""))
Aeval( aFnarray, {|e,n| WriteCh( cPath,aFnarray[n][F_NAME],cChname,;
cAlias,lUscore,@nErrcume )})
ENDIF
IIF( nErrCume > 0, Alert(".CH File Creation Errors",{"Quit"}), )
SetPos( aCurs[1],aCurs[2] ); SetCursor(nCurs)
RestScreen( 0,0,maxrow(),maxcol(),cScr )
ELSE; Signature()
ENDIF
RETURN ( nErrCume )

***************************************************************************
STATIC FUNCTION WriteCh( cPath,cDbffile,cChname,cAlias,lUscore,nErrcume )
LOCAL nH,aStruct

IF ( nH:= FCREATE( IIF(cChname==NIL,CH_NAME,cChname+".CH"))) > 0
USE (cPath+cDbffile) SHARED NEW
aStruct:= dbStruct()
FWRITE( nH,HEADLINE+TYPELINE )
Aeval( Array(Fcount()), {|e,n| FWRITE( nH,BUFFER ) } )
FWRITE( nH,FOOTLINE+CREDIT+COPYRITE )
CLOSE (cPath+cDbffile)
ELSE
nErrcume++
ENDIF

FCLOSE( nH )
RETURN ( nH )

STATIC FUNCTION Signature()
Outstd(CRLF+"DBF2CH v1.0"+CRLF)
Outstd("Author: Steve Kolterman CIS: 76320,37"+CRLF+CRLF)
OutStd("Syntax: DBF2CH [<.CH filename>] [] [/NU]"+CRLF)
Outstd("Option: /nu no underscore appended to prefix."+CRLF)
RETURN NIL


  3 Responses to “Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : DBF2CH.ZIP
Filename : DBF2CH.PRG

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. 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/