[REBOL] Re: Spreadsheet
From: agem:crosswinds at: 3-Mar-2001 23:52
>>>>>>>>>>>>>>>>>> Ursprüngliche Nachricht <<<<<<<<<<<<<<<<<<
Am 03.03.01, 22:17:47, schrieb "Andrew Martin" <[andrew--wxc--net--nz]> zum
Thema [REBOL] Spreadsheet:
> Has anyone thought of making a spreadsheet in Rebol/View or
Rebol/Link?
> I'd really like to combine the best parts of Star Office Spreadsheet,
> Microsoft Office Excel and Lotus Improv, and merge them together with
a
> generous helping of Rebol Script.
> Andrew Martin
> ICQ: 26227169 http://members.nbci.com/AndrewMartin/
> -><-
like this? (well, more a joke :)
[REBOL [title: file: %rebsheet2.r date: 6-Nov-2000/22:12:57+1:00
autor: 'volker]
formulas: none
do rebsheet: [
file: %rebsheet2.r
as-always: 640x480
list-size: 600x380
label-size: min 640x15 list-size / 5
if not formulas [formulas: array/initial [25 5] ""
formulas/1: copy/deep [
{/do[save-me] {remove "/" => autosave (lots of!)}}
"$123" "1.5 * sheet/1/2"
{(pick pick sheet y + 0 x - 2) + (pick pick sheet y + 0 x
- 1)}
"reduce[y x]"
]
]
sheet: copy/deep formulas
clear-sheet: does [foreach y sheet [forall y [change y 0]]]
save-me: does [
save/header file compose [formulas: (reduce [formulas])
do rebsheet: (reduce [rebsheet])]
compose [title: file: (file) date: (now) autor: 'volker]
]
set-text: func [face string] [face/text: string face/line-list:
none
show face]
ed-x: ed-y: 1
myst: stylize [
sheet-label: text label-size with [y: x: none action: [
poke formulas/:ed-y ed-x copy edit/text
set-text edit copy formulas/:y/:x
ed-y: y ed-x: x show sheet-list
]]
]
view layout [size as-always
styles myst
edit: area min list-size 640x1 * 1x4 * 1x15 formulas/1/1
sheet-list: list list-size 30.30.30 [
across sheet-label sheet-label sheet-label sheet-label
sheet-label
]
supply [
y: face/y: count x: face/x: index
either all [ed-x = x ed-y = y] [face/color: 0.0.255]
[face/color: 30.30.30]
if all [1 = count 1 = index] [clear-sheet]
face/text: either count > length? formulas ["-"] [
if error? try [res: do formulas/:y/:x] [res: "???"]
poke sheet/:y x :res
mold :res
]
]
]
]
]