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

 
Output of file : ADDFIELD.PRG contained in archive : TN8911.ZIP
Listing 1 AddField.PRG

* Program...: AddField.PRG
* Date......: 9/5/89
* Author....: Mina Nichols
* Notes.....: Adds a new field to the database.

SET STATUS OFF
CLEAR
TEXT
This procedure will add a new check box field to the database, then
prompt you for a keyword. Next, the session notes for all patients
will be searched for occurrences of the keyword and an "x" placed in
new field for each patient whose session notes contain the keyword.
ENDTEXT

m_Choice = SPACE(1)
@ 20,20 SAY "Would you like to continue (Y/N)? " GET m_Choice
READ

@ 20,1 CLEAR
IF m_Choice $"Nn"
RETURN
ENDIF

m_Field_Name = SPACE(10)
@ 10,15 SAY "What shall we call this new field?" get m_Field_Name
READ

@ 10,1 CLEAR
@ 20,10 SAY ;
"OK... Patients is being copied to Pbackup.DBF"
SELECT Patient
COPY TO Pbackup
ERASE Pstru.DBF
COPY TO Pstru STRUCTURE EXTENDED

@ 20,1 CLEAR @ 20,10 SAY;
" ... appending new field to the structure... "
USE Pstru
APPEND BLANK
REPLACE Field_Name WITH m_Field_Name, Field_Len WITH 1, Field_Type WITH "C". ;
Field_Dec WITH 0, Field_Idx WITH "N"

ERASE Patient.DBF
CREATE Patient FROM Pstru

@ 20,1 CLEAR
@ 20,10 SAY ;
" ... copying old data to new database structure... "
APPEND FROM Pbackup

@ 20,1 CLEAR
@ 20,10 SAY "Patient.DBF now contains a field called ";
+ TRIM(m_Field_Name) + "."

DO KeyWord
RETURN
*EOP: AddField

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