********************************************************* * ANIMATE.CMD 4/11/83 ********************************************************* * * by Michael Cohn * (301) 987-5914 * or * BHEC RCPM (eves/wknds) * (301) 661-4447 * * * This is a routine to animate a character string * across any line of a screen using dBase II. * It may be useful during a sign-on routine * displaying the copyright, or some such... * * This module can be run as a stand-alone demo * as is. Just type DO ANIMATE * * To call this routine from another * dBase II command file, delete the first * "accept" statement, and the first "input" * statement in this file. * * Then add these lines to your main .cmd file: * * store "WHATEVER CHR STRING, ETC." to x * store 12 to mline * (or whatever line * * number you want * * the animation to * * appear on) * do animate * * * * This program currently animates from the right side * of the screen, revealing the character string from * the end, toward the beginning. I think this holds * interest. If you don't, then it is a simple matter * to make it reveal the animated line from the right * in standard fashion. * ***************************************************************** * * === CAN SOMEONE ANSWER ME THIS??? === * ***************************************************************** * * In this program you will note the use of the unusual * convention: * do etc. * @ mline-1,0 * ? $(x,mstart) * enddo * * I would much prefer to use: * * store 0 to mcol * do etc. * @ mline,mcol say $(x,mstart,mlen) * store mcol + 1 to mcol * enddo * * The above does not work, while the seemingly * identical code below does work! * * store 0 to mcol * do etc. * @ mline,mcol * ? str(x,mstart,mlen) * enddo * * If anyone knows why, I'd appreciate the info... * ************************************************************ erase set talk off accept "What character string do you want to animate? " to x erase input "Which line (1-23) do you want to animate on?" to mline erase store len(x) to mlen store mlen to mstart do while mstart > 0 @ mline-1,0 ? $(x,mstart) store mstart - 1 to mstart enddo store " " to mspace store 1 to mcount do while mcount < 80 if mcount > 80-mlen store mlen-1 to mlen endif @ mline-1,0 ? mspace + $(x,1,mlen) store mspace + " " to mspace store mcount + 1 to mcount enddo erase return