home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / 451-475 / apd472 / word_wrap_demo.amos / word_wrap_demo.amosSourceCode
AMOS Source Code  |  1993-03-13  |  615b  |  22 lines

  1. 'Screen Open 0,640,200,16,Hires
  2. Flash Off : Curs Off 
  3.  
  4. A$=A$+"The Frogfish is found to be so diverse in it's appearance that trying to "
  5. A$=A$+"distinguish between different species is quite complicated."
  6.  
  7. WRAP[A$,39]
  8.  
  9. Procedure WRAP[A$,SW]
  10.    Rem A$ containts the string and SW is the number of characters including 0 
  11.    Repeat 
  12.       WORD$=""
  13.       Repeat 
  14.          Inc P1
  15.          L$=Mid$(A$,P1,1)
  16.          WORD$=WORD$+L$
  17.       Until L$=" "
  18.       If Left$(WORD$,1)=" " and X Curs=(0) Then WORD$=Right$(WORD$,Len(WORD$)-1)
  19.       If X Curs+Len(WORD$)>SW Then Print 
  20.       Print WORD$;
  21.    Until P1=Len(A$)
  22. End Proc