home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / progmisc / pbc22b.zip / PBC$BAS.ZIP / STRSQU2.BAS < prev    next >
BASIC Source File  |  1993-01-01  |  2KB  |  44 lines

  1. '   +----------------------------------------------------------------------+
  2. '   |                                                                      |
  3. '   |        PBClone  Copyright (c) 1990-1993  Thomas G. Hanlin III        |
  4. '   |                                                                      |
  5. '   +----------------------------------------------------------------------+
  6.  
  7. SUB StrSqu2 (St$, Result$)
  8.    s$ = St$
  9.    x$ = "  e  tth as heint erd re s oorann  i, r outeonro wy too leisndat"
  10.    x$ = x$ + "es c--edarentise fngitf st bme.  mveofalhanent ras draria dell p"
  11.    x$ = x$ + "coetl hig ilutlaeabeusmapeam ewi llo n htromowh elchpr: ecaysiio"
  12.    x$ = x$ + "uryo yaclica :foeefidiThrsic umono S..sskeu ot Icegerrtactly== T"
  13.    code% = 128
  14.    DO
  15.       a$ = LEFT$(x$, 2)
  16.       DO
  17.          i% = INSTR(s$, a$)
  18.          IF i% THEN s$ = LEFT$(s$, i% - 1) + CHR$(code%) + MID$(s$, i% + 2)
  19.       LOOP WHILE i%
  20.       x$ = MID$(x$, 3)
  21.       code% = code% + 1
  22.    LOOP WHILE LEN(x$)
  23.    IF LEN(Result$) THEN MID$(Result$, 1) = s$
  24. END SUB
  25.  
  26. SUB StrSquLen2 (St$, ResultLen%)
  27.    s$ = St$
  28.    x$ = "  e  tth as heint erd re s oorann  i, r outeonro wy too leisndat"
  29.    x$ = x$ + "es c--edarentise fngitf st bme.  mveofalhanent ras draria dell p"
  30.    x$ = x$ + "coetl hig ilutlaeabeusmapeam ewi llo n htromowh elchpr: ecaysiio"
  31.    x$ = x$ + "uryo yaclica :foeefidiThrsic umono S..sskeu ot Icegerrtactly== T"
  32.    code% = 128
  33.    DO
  34.       a$ = LEFT$(x$, 2)
  35.       DO
  36.          i% = INSTR(s$, a$)
  37.          IF i% THEN s$ = LEFT$(s$, i% - 1) + CHR$(code%) + MID$(s$, i% + 2)
  38.       LOOP WHILE i%
  39.       x$ = MID$(x$, 3)
  40.       code% = code% + 1
  41.    LOOP WHILE LEN(x$)
  42.    ResultLen% = LEN(s$)
  43. END SUB
  44.