Hello, This is the help file I currently pass out to people trying out spread.exe. I wrote it to save on my poor fingers (as well as my shoulders from hunching over the keyboard..I hate college furniture). SPREAD.EXE and (if you want it) the source code are all available now by Anonymous FTP from tua.st.hmc.edu. SPREAD.EXE is a demonstration project, designed to implement an idea I had several years ago. I was working with some nasty formulas in Lotus 1,2,3G (and don't get me started on that crap that passes for a spreadsheet) and I wanted a simple and intuitive way to edit formulas. I was tired of spending time trying to track down parentheses errors, counting parentheses, etc. Even the Excel trick of highlighting matching parens isn't quite good enough. You see, formulas are hierarchies, not strings. Sure you can represent them as strings, and most people do, but it is as unnatural as representing 3-D arrays as linear streams of data. So I had this brilliant idea of a sequence of fly-out menus, each one containing the "function" and its parameters. If a parameter could be further broken down, you could fly-out its menu and edit it. I recognized early on that intelligent and intuitive key-mappings would be necessary. I also hit upon a solution to the problems posed by the binary infix operators (+, -, *, /, >, =, <, etc.). Recently I was talking with a Paradox developer about random Paradox stuff and this subject came up. He suggested I attempt a demonstration program (for I had early on recognized the folly of trying to explain this to people who just couldn't see it). I wasn't sure I had the CS maturity to handle it, but I dove in. Luckily I had recently studied parsers or I would have gone insane trying to write one. I managed to write a somewhat braindead parser for Excel formula syntax. I coded it in VB (ugh) because I needed something I could do the menus in. Second problem. VB's menus ain't exactly flexible. What is more, trying to implement linked lists (which is really how formulas should be represented) in VB is an excercise in futility. So I decided to write a somewhat intelligent form that would operate as one level of the menu. By using Set Child = New Form1 judiciously, along with putting most of the code in a module, I was able to get this to work. It is slow and ugly, mostly because the formulas get parsed more times than I care to count. But it appears to work, and I'd really like to a) get opinions on the concept (try to see beyond my implementation, I really have no clue what I'm doing) and b) spread the word. I don't care if I make a penny of this (although some recognition would be nice, and if Lotus wants to pick up my student loans, I wouldn't complain:). What I really care about is finding this toy everywhere. 2 years down the line I want this puppy in every C++ IDE I use, in every development environment I touch, in every spreadsheet I interact with. I don't think it will replace the string method, but I want the option. Enough with the "I was dead broke and then I mailed off this chain letter" stuff. On to a quick guide to the interface (mostly 'cause it is so random right now I don't want people giving up in disgust). Start the program up. It pops up a default formula (I don't have an OLE/DDE hooks into Excel or anything like that yet. Sorry.) You will see a "formula bar". This is supposed to represent the normal formula bar in a spreadsheet. If you double click on the text area, it turns to white and you can edit it. Hit return to commit your changes, Escape to cancel. If you click on the button marked X that is to the right, it exits. If you click on the button marked * to the left, you enter the land of hierarchical menus. The very top menu item is the function name or the binary infix operator in question. The menu items below the horizontal bar are the parameters this function should be passed. Double click on one or hit F2. Edit it. Hit return to commit, escape to cancel. If you entered a valid formula, it will accept the changes. Otherwise it will pop up an error message (hopefully:). The grammar is still very rudimentary (it's reproduced at the end of this document for those of you who care). Any one or two character combination of {<,>,=} gets treated as a valid operator. And so on and so on, but I think it is good enough to get a feel. If you use the right arrow key, you will look at your child. Left arrow key, parent. If you are in a infix operator list (i.e. + or -, * or /) try clicking on the list item to the left. Note that multiply/divide levels don't have an operator for the first item in the list. You can also hit the appropriate character instead of clicking. Try out insert and delete. Just select an element (parameter) and try inserting an element or deleting one. Notice that when you are down to one element in a multiply/add/comparison level, it removes the level. You should be able to edit function names and comparison operators with a double click. Click and drag on that area and you should be able to move the menus around (very handy when you run out of space to the right). Also, try using Ctrl with the up and down keys when in a list. Kind of handy. If you use Ctrl-Left Arrow you will "wrap" your current menu's formula with either an operator (+,-,/,*,<,etc.) and a second parameter or else pass it as the first argument to a function of your choosing. Ctrl-Right Arrow will "wrap" the currently selected parameter (as opposed to the whole menu). Things I still need to add: More error checking and more robust code. I need to run over my parentheses/prescedence handling logic with a fine-tooth comb, but I think I've figured out the proper metaphors, both from the user's perspective and from the internal perspective. I would also, sooner or later, get in touch with a DDE/OLE expert who can tell me how to easily hook this into Excel (I could do it with OLE Automation and Excel 5, but I infinitely prefer Excel 4 and I'm not going to spend a lot of time linking it to something I refuse to use). Like I've said, it obviously needs work. What I'm really curious is your thoughts on the concept. Do you think, properly implemented, that this would be useful to anyone besides me? If so, what should I do to bring this to the attention of the powers that be (if I have to, I will go to Microsloth, but I'd prefer to hit up others first). Like I said, in exchange for some measure of "creative control" and recognition, I'm perfectly willing to pretty much give this away. Software patents are a load of crap and they piss me off. I want to see this idea in use, not make money. Other Directions There are two main concepts that are part of the idea and that aren't implemented here. The first is assistance. I want this hooked up to a database that, with the flick of a switch, puts some short notes on the left hand side so I can remember what the parameters to a given function are. It would be nice if I could tell whether they were required or optional. It should automagically create the spaces when I first enter a new function. I also want type checking, all that jazz. Second idea: I want a debug mode. In that mode, you would see what the given sub-tree evaluates to next to the parameter. I think this would be invaluable for debugging complex formulas. Also, an intelligent copy and paste should be implemented, perhaps click and drag to move stuff around, etc. This is just the skeleton of the idea. And, for those who care, here's the grammar. I realize it's probably not pristine and proper, but hey, it works (sort of:). Grammar: Expression : E Add/Sub : A Mult/Div : M Power : W Tea : T (it's not a malt (mult, get it:)) Function : F LegalValue : blah List of Params : L The start element is E. E -> A | A {>,=,<} A | A {>,=,<} {>,=,<} A A -> M | A {+,-} M M -> W | M {*,/} W W -> T | W ^ T T -> ( E ) | " " | F F -> blah | blah ( L ) L -> | E | L , | L , E blah -> - | The legal chars are A-Z, a-z, 0-9. Notice that spaces are only legal between "'s. I take them out of all expressions before testing them.