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

 
Output of file : HFORM.PRG contained in archive : OOPEXM.ZIP
**
** PROGRAM TITLE : HFORM
**
** WRITTEN BY : Paul Long
**
** WRITTEN FOR : Copyright (C) 1992 All rights reserved. XL Systems, Inc.
**
** PROGRAM INTENT: Functions for converting forms data to GHOST data
** and adds it to a DBF.
**
** NOTE: This file uses a hybrid approach It uses "traditional,"
** non-OOP programming, but organizing the code along OOP
** lines, e.g., one source file per "class."
**
#include "inkey.ch"

memvar cLastName, cFirstName, cMiddleInitial, cAcctNo, cExamNo, cPIC, cSSN, ;
dDOB, adDOS

static nFormEntries, lFormFound


*******************************************************
*
* FormNew
*
*******************************************************
* Construct Form object mainly by constructing DOSFile object.
*
function FormNew(cFileName)

// Initialize variables to a known state
public cLastName := "", cFirstName := "", cMiddleInitial := "", ;
cAcctNo := "", cExamNo := "", cPIC := "", cSSN := "", ;
dDOB := ctod(" / / "), adDOS := {}
nFormEntries := 0
FormFound(.t.)

return DOSFileNew(cFileName)


*******************************************************
*
* FormDestruct
*
*******************************************************
* Destruct form object by destructing input file
*
function FormDestruct(nHandle)

DOSFileDestruct(nHandle)

return nil


*******************************************************
*
* FormAdd2DBF
*
*******************************************************
* Convert forms data to GHOST data and add to DBF
*
function FormAdd2DBF(nHandle, cDBF)

if file(cDBF + ".dbf") // Make sure output .DBF exists
use (cDBF) exclusive new
if neterr()
?? "*** ERROR *** " + cDBF + ".dbf cannot be opened"
else
do while FormSkip(nHandle) // Read each form
// Write data for this form
FormWrite(cDBF)
?? ++nFormEntries, cLastName, chr(K_RETURN) // Tell user progess
enddo
(cDBF)->(dbclosearea())
endif
else
?? "*** ERROR *** " + cDBF + ".dbf file is missing"
endif

return nil


*******************************************************
*
* FormEntries
*
*******************************************************
* Return number of entries in last-converted form
*
function FormEntries

return nFormEntries


*******************************************************
*
* FormWrite
*
*******************************************************
* Write service information from the current form.
*
function FormWrite(cDBF)

// Add n records to DBF
aeval(adDOS, { | dDOS | ;
(cDBF)->(dbappend()), ;
(cDBF)->acctno := cAcctNo, ;
(cDBF)->examno := cExamNo, ;
(cDBF)->svcdate := dDOS, ;
(cDBF)->ssn := cSSN, ;
(cDBF)->pic := cPIC, ;
(cDBF)->firstname := cFirstName, ;
(cDBF)->midinitial := cMiddleInitial, ;
(cDBF)->lastname := cLastName, ;
(cDBF)->birthdate := dDOB ;
})

return nil


*******************************************************
*
* FormFound
*
*******************************************************
* Return whether last search succeeded.
*
function FormFound(lWhetherFound)

if lWhetherFound != nil
lFormFound := lWhetherFound
endif

return lFormFound


  3 Responses to “Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : OOPEXM.ZIP
Filename : HFORM.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/