home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 December / simtel1292_SIMTEL_1292_Walnut_Creek.iso / msdos / dbase / techs.arc / TECH17.ARC / ATSAY.PRG next >
Text File  |  1985-11-02  |  2KB  |  68 lines

  1. * PROCEDURE  Atsay
  2. * Author...: Tom Rettig
  3. * Date ....: November 1, 1985
  4. * Version..: dBASE III, The Developer's Release
  5. * Note(s)..: Procedure for sending formatted output to an
  6. *            ALTERNATE file.
  7. *
  8. PARAMETERS at_row, at_col, exp, pic
  9. *
  10. * ---Trap "out of range" errors.
  11. IF at_row > max_row .OR. at_col > max_col
  12.    * ---Message goes to screen only.
  13.    SET ALTERNATE OFF
  14.    IF at_row > max_row
  15.       ? "Row is out of range -->", at_row
  16.    ENDIF
  17.    IF at_col > max_col
  18.       ? "Column is out of range -->", at_col
  19.    ENDIF
  20.    SET ALTERNATE ON
  21.    RETURN
  22. ENDIF
  23. *
  24. SET CONSOLE OFF
  25. *
  26. * ---Branch if current row is less than previous row.
  27. IF at_row < prev_row
  28.    *
  29.    * ---Do a formfeed in the file.
  30.    at_count = 0
  31.    DO WHILE at_count < ( max_row - prev_row )
  32.       ?
  33.       at_count = at_count+1
  34.    ENDDO
  35.    *
  36.    prev_row = 0
  37. ENDIF
  38. *
  39. * ---Skip to current row.
  40. at_count = 0
  41. DO WHILE at_count < ( at_row - prev_row )
  42.    ?
  43.    at_count = at_count+1
  44. ENDDO
  45. *
  46. * ---Branch if current column is less than previous column.
  47. IF at_col < prev_col
  48.    * ---Do a linefeed in the file.
  49.    ?
  50. ENDIF
  51. *
  52. * ---Skip to current column.
  53. ?? SPACE( at_col )
  54. *
  55. * ---Output the expression in the format of the PICTURE.
  56. ?? TRANSFORM( exp, pic )
  57. * ---Version 1.0 and 1.1 users remove the TRANSFORM() function.
  58. *
  59. * ---Save current row and column.
  60. prev_row = at_row
  61. prev_col = at_col + LEN( TRANSFORM( exp, pic ) )
  62. * ---Version 1.0 and 1.1 users remove the TRANSFORM() function.
  63. *
  64. SET CONSOLE ON
  65. RETURN
  66. *
  67. * EOP Atsay.PRG 
  68.