home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.alaska-software.com
/
2014.06.ftp.alaska-software.com.tar
/
ftp.alaska-software.com
/
acsn
/
SDFDEL.ZIP
/
TEST.PRG
< prev
Wrap
Text File
|
2003-07-09
|
5KB
|
137 lines
/////////////////////////////////////////////////////////////////////////////
//
// A C S N
//
// +--------------- Alaska Certified Solutions Network -------------------+
// | |
// | This file is proved and certified by Alaska Software |
// | |
// | No: <Certification number> |
// | 109xxx-01-0010 |
// | |
// | For more information about ACSN read the appropriate announcement |
// | or scan for ACSN in the Alaska Support-LIBs on CompuServe or |
// | at WWW.ALASKA-SOFTWARE.COM |
// | |
// +------------------------------------------------------------------------+
//
// FILE NAME
//
// TEST.PRG
//
// AUTHOR
//
// (c) Copyright 1998, Frank Grossheinrich
//
// ALL RIGHTS RESERVED
//
// This file is the property of AUTHOR. It participates in the
// Alaska Certified Solutions Network program. Permission to use,
// copy, modify, and distribute this software for any purpose and
// without fee is hereby granted, provided that the above copyright
// notice appear in all copies and that the name of the author or
// Alaska Software not be used in advertising or publicity pertaining
// to distribution of the software without specific, written prior
// permission.
//
// WARRANTY
//
// THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
// AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
// INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
// FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL THE AUTHOR
// OR ALASKA SOFTWARE BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
// SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
// INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT AND LOSS OF USE.
//
// DESCRIPTION
//
// This file just demonstrates how to use the SDF.PRG and SDF.CH.
// For comparing the results the file can also be compiled with Cli**er.
//
/////////////////////////////////////////////////////////////////////////////
#ifdef __XPP__
#include "sdf.ch"
#endif
PROC Main()
LOCAL x, nSeconds
LOCAL aStruct := {{ "Name", "C", 20, 0}, ;
{ "Birth", "D", 8, 0}, ;
{ "Age", "N", 8, 2}, ;
{ "married", "L", 1, 0}, ;
{ "Note", "M", 10, 0} ;
}
? "create TEST table"
dbCreate( "Test", aStruct)
USE Test EXCLUSIVE NEW
? "add 10 records"
FOR x := 1 TO 10
dbAppend()
REPLACE Name WITH Replicate( CHR( ( x % 26 ) + 64), 30 )
REPLACE Birth WITH Date() + x
REPLACE Age WITH ( x * 7) % 40
REPLACE married WITH (( x % 2) == 1)
REPLACE Note WITH "This is not #" + STR( x)
NEXT
dbGoto( 3)
dbDelete()
dbGoTop()
? "start counting time ..."
nSeconds := Seconds()
? "COPY TO myDBF"
COPY TO myDBF
? "COPY TO Normal SDF"
COPY TO Normal SDF
? "COPY FIELDS Birth, Age, Name TO FiSDF.FG SDF"
COPY FIELDS Birth, Age, Name TO FiSDF.FG SDF
? "COPY TO DelNorm DELIMITED"
COPY TO DelNorm DELIMITED
? "COPY FIELDS Birth, Age, Name TO DelField DELIMITED"
COPY FIELDS Birth, Age, Name TO DelField DELIMITED
? "COPY TO DelBlank DELIMITED WITH Blank"
COPY TO DelBlank DELIMITED WITH Blank
? 'COPY TO DelDiff DELIMITED WITH ";"'
COPY TO DelDiff DELIMITED WITH ";"
? "APPEND FROM DelNorm DELIMITED"
APPEND FROM DelNorm DELIMITED
? "APPEND FROM DelField DELIMITED"
APPEND FROM DelField DELIMITED
? "APPEND FROM DelBlank DELIMITED"
APPEND FROM DelBlank DELIMITED
? "APPEND FROM DelDiff DELIMITED"
APPEND FROM DelDiff DELIMITED
? 'APPEND FROM DelDiff DELIMITED WITH ";"'
APPEND FROM DelDiff DELIMITED WITH ";"
? "APPEND FROM DelField FIELDS Birth, Age, Name DELIMITED"
APPEND FROM DelField FIELDS Birth, Age, Name DELIMITED
? "APPEND FROM Normal SDF"
APPEND FROM Normal SDF
? "APPEND FROM FiSDF.FG FIELDS Birth, Age, Name SDF"
APPEND FROM FiSDF.FG FIELDS Birth, Age, Name SDF
? "APPEND FROM DelNorm SDF"
APPEND FROM DelNorm SDF
? "time used : ", Seconds() - nSeconds
CLOSE ALL
RETURN