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

 
Output of file : DTFDEMO.PRG contained in archive : DTF102.ZIP
/*

Dynamic Text Files (DTF) Demonstration Program

Program : DEMODTF.PRG
Author : Mark Lussier
Copyright : (c) 1991 Timothy W. Cook
All Rights Reserved

Compile : Compile with /n

*/

#include "inkey.ch"

#include "setcurs.ch"


Function Main()
Local getlist := {}, Oldcolor, X
Setcursor( 0 )
Clea
oldcolor := SETCOLOR( "B/BG" )
@ 09,0 SAY replicate('Í',80)+" "
@ 10,0 SAY space(11)+"Dynamic Text Files (DTF) is Being Distributed as SHAREWARE"+space(11)
@ 11,0 SAY space(80)
@ 12,0 SAY " You are herby provided a license to evaluate DTF for a period of Thirty Days. "
@ 13,0 SAY space(6)+"At the end of this Thirty Day trial period you must register DTF or"+space(7)
@ 14,0 SAY space(29)+"discontinue using it."+space(30)
@ 15,0 SAY replicate('Í',80)
For X := 10000 to 40000
Next X
Setcolor( Oldcolor )
OldColor := SetColor()
CLS
Title()
Setcolor( Oldcolor )
OldColor := SetColor()
InfoTxt()
Setcolor( Oldcolor )
OldColor := SetColor()
Scroll( 3, 0, 24, 79, 0 )
DemoTxt()
Setcolor( Oldcolor )
OldColor := SetColor()
Scroll( 3, 0, 24, 79, 0 )
DTFdemo()
CLS
Setcolor( Oldcolor )
Center( 0,"Thank you for evaluating Dynamic Text Files (DTF)" )
Setcursor( 1 )
@ 02,00 SAY ''
Return( Nil )


Static Function Title()
SETCOLOR( "+W/BG" )
@ 0,0 SAY space(13) + "Dynamic Text Files (DTF) v1.02 Demonstration Program " + Space( 13 )
SETCOLOR( "+N/BG" )
@ 1,0 SAY space(10)+"Copyright (c) 1991 by Timothy W. Cook - All Rights Reserved"+space(11)
Return( NIL )


Static Function InfoTxt()
Local key
clear typeahead
Setcursor( 0 )
SETCOLOR( "W+/N" )
@ 03,00 SAY "Dynamic Text Files are intended as a replacement for the hard to handle, and"
@ 04,00 SAY "bloated .DBT files Clipper(tm) creates when you are using Memo fields. The"
@ 05,00 SAY "biggest advantage DTF's have over DBT's is that they ONLY consume the ammount"
@ 06,00 SAY "of diskspace necessary for the text and a SMALL pointer area."
@ 08,00 SAY "DTF is NOT intended for use in applications where several hundred large Memo"
@ 09,00 SAY "fields are required. There are several commercial libraries that are designed"
@ 10,00 SAY "to handle those requirements much more efficiently yet with a greatly increased"
@ 11,00 SAY "cost. In most applications we have found that only a portion of the records need"
@ 12,00 SAY "more than a few lines of notes/text and this is where DTF comes in very handily."
@ 14,00 SAY "Another of DTF's greatest advantages is its cost factor. Currently there are 2"
@ 15,00 SAY "versions, DTF ( $19.95 USD ) and DTF Pro ( $49.95 USD ). Here are just a few of"
@ 16,00 SAY "the highlights of the 2 versions"
@ 18,00 SAY replicate('Ä',6)+" "+replicate('Ä',28)+" "+replicate('Ä',13)
SETCOLOR( "+GR/N" )
@ 03,00 SAY "Dynamic Text Files"
@ 05,18 SAY "DTF's"
@ 08,00 SAY "DTF"
@ 12,54 SAY "DTF"
@ 14,11 SAY "DTF's"
@ 15,10 SAY "DTF"
@ 15,33 SAY "DTF Pro"
SETCOLOR( "+G/N" )
@ 15,16 SAY "$19.95 USD"
@ 15,43 SAY "$49.95 USD"
SETCOLOR( "+R/N" )
@ 18,06 SAY " Registered DTF "
@ 18,50 SAY " DTF Profesional "
SETCOLOR( "+G/N" )
@ 19,00 SAY "o"
@ 19,45 SAY "o"
@ 20,00 SAY "o"
@ 20,45 SAY "o"
@ 21,00 SAY "o"
@ 21,45 SAY "o"
@ 22,00 SAY "o"
@ 22,45 SAY "o"
SETCOLOR( "+BG/N" )
@ 19,02 SAY "Over 50% smaller that .DBT files"+space(7)
@ 19,47 SAY "All of DTF's Features PLUS "
@ 20,02 SAY "Faster access to you data!"+space(13)
@ 20,47 SAY "Convert .DBT's to .DTF's"+space(9)
@ 21,02 SAY "DTF files are Packable!"+space(16)
@ 21,47 SAY "DTF Pro is Network Aware"+space(9)
@ 22,02 SAY "Seemless integration with existing code"
@ 22,47 SAY "Multiple DTF's entries per Record"
SETCOLOR( "+W/BR" )
@ 24,0 SAY space(27)+"Press ANY key to continue"+space(28)
key := Inkey( 0 )
Setcursor( 1 )
Return( NIL )


Static Function DemoTxt()
Local key
SETCOLOR( "W+/N" )
@ 03,00 SAY replicate('Ä',6)+space(20)+replicate('Ä',54)
@ 05,20 SAY "- Create a new Dynamic Text File"
@ 06,20 SAY "- Returns the text from the current record"
@ 07,20 SAY "- Replaces the records current DTF entry"
@ 08,20 SAY "- Unmarks the .DBF & .DTF record for deletion"
@ 09,20 SAY "- Marks the .DBF & .DTF record for Deletion"
@ 10,20 SAY "- Add a record to .DBF and .DTF"
@ 11,20 SAY "- Remove text from .DTF records marked for Deletion"
@ 12,20 SAY "- Completly kill a .DBT file"
@ 14,00 SAY replicate('Ä',6)+space(22)+replicate('Ä',52)
@ 23,00 SAY replicate('Ä',80)
SETCOLOR( "+R/N" )
@ 03,07 SAY "Function Reference"
SETCOLOR( "+GR/N" )
@ 05,07 SAY "F_INIT()"
@ 06,07 SAY "F_READ()"
@ 07,07 SAY "F_REPLACE()"
@ 08,07 SAY "F_RECALL()"
@ 09,07 SAY "F_DELETE()"
@ 10,07 SAY "F_APPEND()"
@ 11,07 SAY "F_CLEAN()"
@ 12,07 SAY "F_ZAP()"
SETCOLOR( "+BG/N" )
@ 05,20 SAY "-"
@ 06,20 SAY "-"
@ 07,20 SAY "-"
@ 08,20 SAY "-"
@ 09,20 SAY "-"
@ 10,20 SAY "-"
@ 11,20 SAY "-"
@ 12,20 SAY "-"
SETCOLOR( "+R/N" )
@ 14,07 SAY "Sample Code Fragment"
SETCOLOR( "+GR/N" )
@ 16,00 SAY "// Edit .DTF Data"
@ 18,00 SAY "// Replace a .DTF Record with new Data "
@ 20,00 SAY "// Pack a .DTF File "
SETCOLOR( "+BG/N" )
@ 17,3 SAY 'cText := MEMOEDIT( F_READ(), 8, 20, 20, 75, .T., "MY_UDF" )'
@ 19,3 SAY "F_REPLACE( 'DEMO', cText ) "
@ 21,3 SAY "F_CLEAN( 'DEMO' )"
SETCOLOR( "+W/BR" )
@ 24,0 SAY space(27)+"Press ANY key to continue"+space(28)
key := INKEY(0)
Return( NIL )


Static Function DTFdemo()
Local getlist := {}, cText := "", nKey
set(_SET_SCOREBOARD,.F.)
dbusearea( .T., , "PHONE" )
F_Init()

SETCOLOR( "+N/W" )
@ 03,00 SAY replicate( 'Í', 80 )
@ 05,00 SAY replicate( 'Í', 80 )
SETCOLOR( "N/W" )
@ 04,00 SAY " The following is a very basic example of a simple Data Entry with notes "
SETCOLOR( "W+/N" )
@ 11,00 SAY replicate('Ä',33)+"´ Notes Ã"+replicate('Ä',37)
@ 21,00 SAY replicate('Ä',79)
SETCOLOR( "+GR/B" )
@ 11,34 SAY " Notes "

do while lastkey() # K_F10
SETCOLOR( "BR+/N" )
@ 02,56 SAY "Free Memory : " + ltrim( str( memory(1),3,0 ) ) + "k bytes"
SETCOLOR( "+BG/N, W+/R" )
@ 07,17 SAY "First Name : " get PHONE->fname
@ 08,18 SAY "Last Name : " get PHONE->lname
@ 09,14 SAY " Phone Number : " get PHONE->p_num
NoKeys()
setcursor( SC_NORMAL )
Read
setcursor( SC_NONE )
ShowKeys()
nKey := inkey(0)
NoKeys()
do case
case nKey == K_ALT_N
setcursor( SC_NORMAL )
@ 20,00 SAY padc("Press CTRL-W to Save Changes, ESC to Abort.",80)
Setcolor( "GR+/N, GR+/N" )
cText := memoedit(F_Read(), 12,0,19,79)
setcursor( SC_NONE )
ShowKeys()
F_Replace(,cText)
case nKey == K_F2
F_Delete()
case nKey == K_F3
F_Recall()
case nKey == K_F4
F_Append()
case nKey == K_F5
F_Clean()
case nKey == K_PGUP
@ 12,0 clear to 19,79
dbskip(-1)
case nKey == K_PGDN
@ 12,0 clear to 19,79
dbskip(1)
case nKey == K_CTRL_PGUP
@ 12,0 clear to 19,79
dbgotop()
case nKey == K_CTRL_PGDN
@ 12,0 clear to 19,79
dbgobottom()
case nKey == K_DEL
set(_SET_DELETED, if( set(_SET_DELETED), .F., .T.) )
endcase
enddo
dbcloseall()
Return( NIL )

Static Function Center( nLine, cString )
@ nLine, ( ( 80 - Len( cString ) ) / 2 ) SAY cString
Return( NIL )

Static Function ShowKeys()

SETCOLOR( "+W/N" )
@ 22,05 SAY "- - - - -"
@ 23,07 SAY "- - - - -"
SETCOLOR( "+G/N" )
@ 20,00 SAY padc("Press ALT-N to edit notes.",80)
@ 22,00 SAY "PGUP "
@ 22,13 SAY "PGDN "
@ 22,30 SAY "CTRL PGUP"
@ 22,47 SAY "CTRL PGDN "
@ 22,67 SAY "DEL"
@ 23,04 SAY "F2"
@ 23,18 SAY "F3"
@ 23,32 SAY "F4"
@ 23,50 SAY "F5"
@ 23,66 SAY "F10"
SETCOLOR( "+B/N" )
@ 22,07 SAY "Next"
@ 22,20 SAY "Previous"
@ 22,42 SAY "Top"
@ 22,59 SAY "Bottom"
@ 22,73 SAY "Set Del"
@ 23,09 SAY "Delete"
@ 23,23 SAY "Recall"
@ 23,37 SAY "Add Record"
@ 23,55 SAY "Clean Up"
@ 23,72 SAY "Quit"
return(nil)

Static Function NoKeys()
@ 20,00 SAY space(80)
@ 22,0 clear to 23,80
return(nil)

//EOF:DTFDEMO.PRG


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