home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / dbaseii / animate2.cmd < prev    next >
Encoding:
Text File  |  1994-07-13  |  2.9 KB  |  113 lines

  1. * animate2.cmd
  2.  
  3. IF F
  4.  
  5. Bill Weinman, 10 May 1983
  6.  
  7. In answer to Michael Cohn's Animate.cmd
  8.  
  9. It would appear that the problem you were running into was 
  10. dBASE's steadfast refusal to evaluate an expression as an 
  11. argument to @ SAY.  Really you can only have a variable or a 
  12. literal as an argument to @ SAY.
  13.  
  14. The routine that I am presenting here has only been tested under 
  15. dBASE II version 2.4 (yet to be released by Ashton-Tate).
  16.  
  17. Copyright (c) 1983, by:  Bill Weinman, PO Box 60807, Los Angeles, 
  18. CA  90060 pursuant to the following paragraph:
  19.  
  20. Reserving the right to sell these routines myself in any form 
  21. that I wish, I hereby donate this file in it's origional form as 
  22. of 10 May 1983 to the public domain.  You may do with it as you 
  23. wish.
  24.  
  25. TIP:  Try turning of the terminal's cursor! ( ?? chr(27)+'.0' for 
  26. the Televideo 950 and ?? chr(27)+'.2' to turn it back on ).
  27.  
  28.                 10 May 1983
  29.  
  30.                 Bill E. Weinman
  31.                 Business Computer Services
  32.                 P O Box 60807
  33.                 Los Angeles, CA 90060
  34.  
  35. ENDIF F
  36.  
  37. *****************************************************************
  38. * initialization section
  39. set talk off
  40. set colon off
  41.  
  42. erase
  43.  
  44. store '                    ' to string
  45. store 0 to col
  46. store 0 to colfin
  47. store 0 to row
  48.  
  49. @ 10,10 say 'Enter the string to be animated: ' get string
  50. @ 11,10 say '   Enter the column to start in: ' get col pict '##'
  51. @ 12,10 say '  Enter the column to finish in: ' get colfin pict '##'
  52. @ 13,10 say '   Enter the line to animate on: ' get row pict '##'
  53. read
  54. clear gets
  55.  
  56. erase
  57.  
  58. store col+1 to initcol
  59. store trim(string) to string
  60. store len(string) to length
  61.  
  62. * the "if not firsttime" within the "do while not done" loop 
  63. * is to force dbase to read the entire routine into memory 
  64. * before executing it.  this eliminates any disk bound delays 
  65. * in the middle of animation.
  66. store t to firsttime
  67. store f to done
  68. do while .not. done
  69.     if .not. firsttime
  70.         * the animation starts here
  71.         do while (initcol-col) # length
  72.             * first, evaluate the sub-string
  73.             store $(string,1,initcol-col) to partial
  74.             @ row,col say partial
  75.             store col-1 to col
  76.         enddo
  77.     
  78.         do while col > colfin
  79.             @ row,col say string+' '
  80.             store col-1 to col
  81.         enddo
  82.  
  83.         * a little flash
  84.  
  85.         store col+1 to col
  86.         store 0 to wait
  87.         * low is a logical switch used to control the 
  88.         * alternation of the flash (only for terminals
  89.         * that support rev video or dual intensity)
  90.         store t to low
  91.         do while wait < 10
  92.             if .not. low
  93.                 set inte off
  94.                 @ row,col say string
  95.                 store t to low
  96.             else
  97.                 set inte on
  98.                 @ row,col say string
  99.                 store f to low
  100.             endif
  101.             store wait+1 to wait
  102.         enddo
  103.  
  104.     store t to done
  105.     endif firsttime
  106. store f to firsttime
  107. enddo
  108.  
  109. * rele firsttime, done, row, col, wait, string, partial, length, low
  110. set inte on
  111.  
  112. return
  113.