-------------------------------------------------------------------------- F i l e I n f o r m a t i o n * DESCRIPTION Letter explaining DECODE.PAS. Requires: Turbo Pascal 2.0, 3.0. Author: Rick Solomon. Version T1.0 * ASSOCIATED FILES DECODE.PAS DECODE88.PAS DECODE.TXT ========================================================================== } Rick Solomon SOLORCAM6K/I000547 Exhibition Place Toronto, Ontario Canada M6K 3C3 416-593-7551 I know that the rules state that entries must be complete programs, but a complete program can't be written to use the two versions of the function I've written until some very specific information about the application in which one of them is to be used is established. FUNCTION DECODE is used in Turbo programs which read files created by BASIC programs and rewrite them in TurboPascal format. Integers can be read as is, and strings can be read easily, provided we re- member to read the BASIC string as an ARRAY [1..N] OF CHAR before converting it to STRING [N]. Real numbers are a problem, however. As explained in the source code, they have to be read as an ARRAY [1..4] OF BYTE and converted to REAL by using DECODE. The routines themselves are quite simple, but it took me a long time to figure them out. You wouldn't believe the number of 'experts' around Toronto who didn't have any idea on how to do this task. Listing DECODE.PAS is the general form of the function and will work with any version of TurboPascal; DECODE88.PAS will not work with TURBO-87 or TURBOBCD.