binary compression

 BBS: Inland Empire Archive
Date: 02-26-93 (19:38)             Number: 225
From: KEN WITHEROW                 Refer#: NONE
  To: ALL                           Recvd: NO  
Subj: binary compression             Conf: (2) Quik_Bas
' Written by Ken Witherow
' Released into the public domain
' This is a little program that I had to write for my high-school programming
' class today.  It's pretty basic (no pun intended), it can
be modified for your
' needs though.  I'd appreciate any input that you can give me on it.
' This simply converts a binary string (1111000001 for instance) and will
' convert it to a form of 140511 instead.
PRINT "Give me a binary string you wish to compress:"
LINE INPUT tocomp$
l = LEN(tocomp$)
l = l + 2
counter = counter + 1
IF MID$(tocomp$, counter, 1) = MID$(tocomp$, counter + 1, 1) THEN this = this
       + 1 ELSE GOSUB printit:
LOOP UNTIL counter = l

this = this + 1
PRINT MID$(tocomp$, counter, 1); LTRIM$(STR$(this));
this = 0

... Basic Programmers Never Die! They just GOSUB w/o RETURN
--- Blue Wave/Max v2.11 [NR]
 * Origin: Desert Heat BBS (1:2613/105.0)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET