home *** CD-ROM | disk | FTP | other *** search
/ Phoenix CD 2.0 / Phoenix_CD.cdr / 01e / let12.zip / DEMO-11.BAT < prev    next >
DOS Batch File  |  1987-09-17  |  1KB  |  36 lines

  1. echo Off
  2. If `%Name%' == `' Demo
  3. cls
  4. echo   ╔════════════════════════════════════════════════════════════════╗
  5. echo ┌─╫────────────────────────────────────────────────────────────────╫─┐
  6. echo │ ║   Accessing Databases and files: READ, TRIM, REPLACE           ║ │
  7. echo └─╫────────────────────────────────────────────────────────────────╫─┘
  8. echo   ╚════════════════════════════════════════════════════════════════╝
  9. echo  
  10. set DB-File=DATABASE.DBF
  11. echo I have included a file called %DB-File%, created by DBASE-III,
  12. echo as part of this demonstation.  In it is the following information:
  13. echo  
  14. echo   Field Name     Length
  15. echo   -------------- --------
  16. echo   (delete field)  1 char
  17. echo   First Name     10 chars
  18. echo   Last Name      12 chars
  19. echo   Street         32 chars
  20. echo   City           20 chars
  21. echo   State           2 chars
  22. echo   Zip            10 chars
  23. echo                  --------
  24. echo  For a record of 87 characters.
  25. echo  
  26. echo There are an unknown (as of yet) number of records, and we will
  27. echo presently read through this database, extracting the information
  28. echo as we go.
  29. echo   
  30. pause
  31. set Rec=0
  32. LET LastRec=(+ (asc (read DB-File 4 1)) (* (asc (read DB-File 5 1)) 256))
  33. rem the above computes the number of recs (0..65535) using lo-hi notation
  34. echo We now know that there are %LastRec% records in %DB-File%.
  35. DEMO-12
  36.