Category : BASIC Source Code
Archive   : LZHBAS.ZIP
Filename : LZHDEMO.BAS
'**** for file compression. The LZHBAS.C source is a public-domain version
'**** of LHarc. This source information provided by Gerry Hull, Greenfield, NH
'**** USA. (603) 672-3000
DEFINT A-Z
DECLARE FUNCTION LZH% CDECL ALIAS "_LZH" (BYVAL DOPTR%, BYVAL INFILEPTR%, BYVAL OUTFILEPTR%)
'The following is required for the BASIC environment to manage memory-management
'calls from the C procedure
DIM Mallocbuf%(0 TO 8192)
COMMON SHARED /NMALLOC/ Mallocbuf%()
INPUT "encode/decode:"; A$
A$ = A$ + CHR$(0) 'make all strings "C" strings by adding null
INPUT "Input file:"; B$
INPUT "Output File:"; C$
B$ = B$ + CHR$(0)
C$ = C$ + CHR$(0)
Z = LZH(SADD(A$), SADD(B$), SADD(C$)) 'SADD works with near/far strings & returns near address
PRINT "Return code is "; Z
'*** Return code on encode = -1 if failed or amount of compression in percent
'*** on decode = >0 if ok or -1 if failed.
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/