[comp.sys.apple] AppleWorks Spreadsheet File Values Format

jimdean@bcrka125.bnr.ca (Jim Dean 1574326) (01/13/90)

Can anybody tell me how to turn AppleWorks spreadsheet file
values into decimal numbers, using a high-level language?
  
When writing to a file, AppleWorks stores spreadsheets values 
in something called "8 bytes of binary log format"; I want to 
write a program in C to read spreadsheet files but I do not 
understand how to convert the 8-byte AppleWorks spreadsheet 
number to something that I'd recognize, like a regular 
decimal number.

Further to this problem, I wrote a spreadsheet reader in 
BASIC, and to convert the spreadsheet number to AppleSoft
BASIC, I used a machine language routine I found in Nibble.
That routine converted the "8 bytes of binary log format"
to the 5-byte storage used by AppleSoft variables, but I
do not understand what the routine was doing.  The program
worked but was slow.

Please reply by e-mail, or here if you think interest would warrant.

---------------------------------------------------------------------------
Jim Dean        |    Bell-Northern Research, Ltd    |  Ph.: (613) 763-2135
                |      P.O. Box 3511, Station C     |  Fax: (613) 763-8825
                |  Ottawa, Ontario, Canada, K1Y 4H7 |
---------------------------------------------------------------------------
BITNET/NETNORTH: jimdean@bnr.ca   
---------------------------------------------------------------------------
Any opinions expressed herein are my own and not necessarily shared by my
employer, Bell-Northern Research.
---------------------------------------------------------------------------

---------------------------------------------------------------------------
Jim Dean        |    Bell-Northern Research, Ltd    |  Ph.: (613) 763-2135
                |      P.O. Box 3511, Station C     |  Fax: (613) 763-8825
                |  Ottawa, Ontario, Canada, K1Y 4H7 |

mattd@Apple.COM (Matt Deatherage) (01/18/90)

In article <25@bcrka80.bnr.ca> jimdean@bcrka125.bnr.ca (Jim Dean 1574326) writes:
>Can anybody tell me how to turn AppleWorks spreadsheet file
>values into decimal numbers, using a high-level language?
>  
>When writing to a file, AppleWorks stores spreadsheets values 
>in something called "8 bytes of binary log format"; I want to 
>write a program in C to read spreadsheet files but I do not 
>understand how to convert the 8-byte AppleWorks spreadsheet 
>number to something that I'd recognize, like a regular 
>decimal number.
>
>Please reply by e-mail, or here if you think interest would warrant.
>
>Jim Dean        |    Bell-Northern Research, Ltd    |  Ph.: (613) 763-2135
>                |      P.O. Box 3511, Station C     |  Fax: (613) 763-8825
>                |  Ottawa, Ontario, Canada, K1Y 4H7 |

When I don't know if interest warrants, I post to the net just to be sure.  :)

AppleWorks uses SANE to do calculations, so the numbers are stored in SANE's
internal format.  This is described in academic ("boring and sleep-inducing")
detail in the Apple Numerics Manual.

Either edition will do for 8-bit SANE; only the Second Edition covers 65816
SANE (and 68881 SANE for the Mac family).


-- 
============================================================================
Matt Deatherage, Apple Computer, Inc. | "The opinions represented here are
Developer Technical Support, Apple II |  not necessarily those of Apple
Group.  Personal mail only, please.   |  Computer, Inc.  Remember that."
============================================================================