home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / sourcecode / procedures / scrolly1.amos / scrolly1.amosSourceCode < prev   
AMOS Source Code  |  1993-03-07  |  2KB  |  64 lines

  1. '
  2. 'If you move this prog off the ta disk remove the line below or  
  3. 'change it to the name of the new disk.
  4. '
  5. Dir$="Totally_amos_may_92:source_progs/scrolly"
  6. '
  7. Rem
  8. Rem ** A SCROLLY (C) 1991 DAVID BOUCHER ** 
  9. Rem
  10. Rem read the scrolly message and examine the code to see how it works...   
  11. Rem  
  12. Global MESSAGE$,SCR,SR,DEL,POS,CHAR$,RODENT
  13. Procedure SETUP_SCREEN
  14.    Screen Open 0,400,30,4,Lowres
  15.    Screen Display 0,100,180,400,29
  16.    Flash Off 
  17.    Cls 0
  18.    Hide 
  19.    Get Icon Palette 
  20.    No Icon Mask 
  21. End Proc
  22. Procedure SETUP_SCROLL
  23.    Shared SCR,SR,DEL,POS,CHAR$
  24.    MESSAGE$=Upper$(MESSAGE$)
  25.    Reserve As Work 15,Len(MESSAGE$)+1
  26.    A=Start(15)
  27.    For P=0 To Len(MESSAGE$)
  28.       Poke A+P,Asc(Mid$(MESSAGE$,P+1,1))
  29.    Next 
  30.    Poke A+P+1,0
  31.    POS=0
  32.    SCR=0
  33.    SR=4
  34.    DEL=26/SR
  35.    CHAR$="1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ!?.@- "
  36. End Proc
  37. Procedure SCR
  38.    Shared SCR,SR,DEL,POS,CHAR$
  39.    If SCR=DEL
  40.       N=Peek(Start(15)+POS)
  41.       If N=0 : POS=0 : N=Peek(Start(15)) : End If 
  42.       V=Instr(CHAR$,Chr$(N))
  43.       TEMP=Screen
  44.       Screen 0
  45.       Paste Icon 370,1,V
  46.       Screen TEMP
  47.       SCR=0
  48.       Inc POS
  49.    End If 
  50.    Screen Copy 0,SR,0,400,29 To 0,0,0
  51.    Inc SCR
  52. End Proc
  53. MESSAGE$="hello and welcome to yet another boring scrolly brought to you  @ 1991 david boucher. "
  54. MESSAGE$=MESSAGE$+"this was done by drawing a font in dpaint and cutting individual letters into an icon bank. "
  55. MESSAGE$=MESSAGE$+"the program stores the message in a bank and reads it out charecter by charecter looking up the appropriate icon in a table "
  56. MESSAGE$=MESSAGE$+"and pasting it down to the right of the visable screen area. the message is then software scrolled until another charecter is needed and the process then repeats. "
  57. MESSAGE$=MESSAGE$+"feel free to examine the code and use it in your own program as long as you credit me david boucher..................TTFN bouch..............."+Space$(20)
  58. SETUP_SCREEN
  59. SETUP_SCROLL
  60. Do 
  61.    SCR
  62.    Exit If Mouse Click=1
  63.    Wait Vbl 
  64. Loop