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   
Text File  |  2003-07-09  |  5KB  |  137 lines

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. //                             A  C  S  N
  4. //
  5. // +---------------  Alaska Certified Solutions Network  -------------------+
  6. // |                                                                        |
  7. // |        This file is proved and certified by Alaska Software            |
  8. // |                                                                        |
  9. // |                   No: <Certification number>                           |
  10. // |                          109xxx-01-0010                                |
  11. // |                                                                        |
  12. // |   For more information about ACSN read the appropriate announcement    |
  13. // |      or scan for ACSN in the Alaska Support-LIBs on CompuServe or      |
  14. // |                   at WWW.ALASKA-SOFTWARE.COM                           |
  15. // |                                                                        |
  16. // +------------------------------------------------------------------------+
  17. //
  18. // FILE NAME
  19. //
  20. //    TEST.PRG
  21. //
  22. // AUTHOR
  23. //
  24. //    (c) Copyright 1998, Frank Grossheinrich
  25. //
  26. //    ALL RIGHTS RESERVED
  27. //
  28. //    This file is the property of AUTHOR. It participates in the
  29. //    Alaska Certified Solutions Network program. Permission to use,
  30. //    copy, modify, and distribute this software for any purpose and
  31. //    without fee is hereby granted, provided that the above copyright
  32. //    notice appear in all copies and that the name of the author or
  33. //    Alaska Software not be used in advertising or publicity pertaining
  34. //    to distribution of the software without specific, written prior
  35. //    permission.
  36. //
  37. // WARRANTY
  38. //
  39. //    THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
  40. //    AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
  41. //    INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
  42. //    FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL THE AUTHOR
  43. //    OR ALASKA SOFTWARE BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
  44. //    SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
  45. //    INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT AND LOSS OF USE.
  46. //
  47. // DESCRIPTION
  48. //
  49. //    This file just demonstrates how to use the SDF.PRG and SDF.CH.
  50. //     For comparing the results the file can also be compiled with Cli**er.
  51. //
  52. /////////////////////////////////////////////////////////////////////////////
  53.  
  54.  
  55. #ifdef __XPP__
  56.    #include "sdf.ch"
  57. #endif
  58.  
  59. PROC Main()
  60.    LOCAL x, nSeconds
  61.    LOCAL aStruct := {{ "Name", "C", 20, 0},              ;
  62.                      { "Birth", "D", 8, 0},              ;
  63.                      { "Age", "N", 8, 2},                ;
  64.                      { "married", "L", 1, 0},            ;
  65.                      { "Note", "M", 10, 0}               ;
  66.                      }
  67.    ? "create TEST table"
  68.    dbCreate( "Test", aStruct)
  69.    USE Test EXCLUSIVE NEW
  70.  
  71.    ? "add 10 records"
  72.    FOR x := 1 TO 10
  73.       dbAppend()
  74.       REPLACE Name WITH Replicate( CHR( ( x % 26 ) + 64), 30  )
  75.       REPLACE Birth WITH Date() + x
  76.       REPLACE Age WITH ( x * 7) % 40
  77.       REPLACE married WITH (( x % 2) == 1)
  78.       REPLACE Note WITH "This is not #" + STR( x)
  79.    NEXT
  80.    dbGoto( 3)
  81.    dbDelete()
  82.    dbGoTop()
  83.  
  84.    ? "start counting time ..."
  85.    nSeconds := Seconds()
  86.    ? "COPY TO myDBF"
  87.    COPY TO myDBF
  88.  
  89.    ? "COPY TO Normal SDF"
  90.    COPY TO Normal SDF
  91.  
  92.    ? "COPY FIELDS Birth, Age, Name TO FiSDF.FG SDF"
  93.    COPY FIELDS Birth, Age, Name TO FiSDF.FG SDF
  94.  
  95.    ? "COPY TO DelNorm DELIMITED"
  96.    COPY TO DelNorm DELIMITED
  97.  
  98.    ? "COPY FIELDS Birth, Age, Name TO DelField DELIMITED"
  99.    COPY FIELDS Birth, Age, Name TO DelField DELIMITED
  100.  
  101.    ? "COPY TO DelBlank DELIMITED WITH Blank"
  102.    COPY TO DelBlank DELIMITED WITH Blank
  103.  
  104.    ? 'COPY TO DelDiff DELIMITED WITH ";"'
  105.    COPY TO DelDiff DELIMITED WITH ";"
  106.  
  107.    ? "APPEND FROM DelNorm DELIMITED"
  108.    APPEND FROM DelNorm DELIMITED
  109.  
  110.    ? "APPEND FROM DelField DELIMITED"
  111.    APPEND FROM DelField DELIMITED
  112.  
  113.    ? "APPEND FROM DelBlank DELIMITED"
  114.    APPEND FROM DelBlank DELIMITED
  115.  
  116.    ? "APPEND FROM DelDiff DELIMITED"
  117.    APPEND FROM DelDiff DELIMITED
  118.  
  119.    ? 'APPEND FROM DelDiff DELIMITED WITH ";"'
  120.    APPEND FROM DelDiff DELIMITED WITH ";"
  121.  
  122.    ? "APPEND FROM DelField FIELDS Birth, Age, Name DELIMITED"
  123.    APPEND FROM DelField FIELDS Birth, Age, Name DELIMITED
  124.  
  125.    ? "APPEND FROM Normal SDF"
  126.    APPEND FROM Normal SDF
  127.  
  128.    ? "APPEND FROM FiSDF.FG FIELDS Birth, Age, Name SDF"
  129.    APPEND FROM FiSDF.FG FIELDS Birth, Age, Name SDF
  130.  
  131.    ? "APPEND FROM DelNorm SDF"
  132.    APPEND FROM DelNorm SDF
  133.  
  134.    ? "time used : ", Seconds() - nSeconds
  135.  
  136.    CLOSE ALL
  137. RETURN