Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: make-doc-pro: how to handle tables?

From: cybarite:sympatico:ca at: 22-Sep-2001 7:14

Robert, \my $0.02 I like the REBOL approach for "tables" table: [ [r1c1 r1c2 r1c3] [r2c1 r2c2 r2c3] [r3c1 r3c2 r3c3] ] which is just a REBOL definition that allows access to the cells: table/1/3 table/3/1 If it was just one row then it would be table: [c1 c2 c3] With this approach, the table can be manipulated by REBOL for doing things like pivot which might be a "reverse" which handles all rows. The reason for using a REBOL format is that I want to be able to generate a document that uses data that is in the REBOL script or accessible via the REBOL script such as extracts from internet sites. i.e it is not just text. You might be doing this in make-doc-pro but I didn't think so from what I read. i.e. I want the option to make a cell's value to be executable REBOL code. And I wanted it evaluated at document generation time. Then this would be a table to me: table: [ ["The time is" (form now)] ["The extract is" (copy/part read 10)] ["The extract file was updated at" (modified? %\c\extract.r)] ] And I could display this in an html table by linking the data definition part of above to some presentation specification. So this is like the data part of the SUPPLY approach used in VID. And it looks like the spreadsheet that Carl did. In a make-doc version, I would then want to: a. define a table with a do block as was done in vid layout ===ISO Currency Codes do [iso-codes: [ "USD" "US Dollars" "GBP" "Great Britain Pounds" ] ] b. use the table in the make-doc text portion by referencing the REBOL name of the block. c. if the data was not re-usable then defining it inline using the block structure makes sense. \table ["USD" "US Dollars" "GBP" "Great Britain Pounds" ] presentation-style-definition /table I think the data definition part of it is the easier part. That "presentation-style-definition" is the hard part. /my $0.02