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

Tabularizing printed output from database 'blocks'

 [1/3] from: johnfdutcher:ya:hoo at: 29-Jun-2003 16:36


Hi, Does anyone have a neat way to display (print) the returned values from a series of datafile 'blocks' when the values inside the blocks vary in size (string size).....something like the 'tabling' action often done in HTML when displaying the output of a request for data from a database. I loop thru with the 'pick' command and print individual items, but of course they don't 'line up' vertically in a neat way as the spacing between the horizontal elements is defaulted. Thanks. John Dutcher

 [2/3] from: greggirwin::mindspring::com at: 29-Jun-2003 23:24


Hi John, JD> Does anyone have a neat way to display (print) the JD> returned values from a series of datafile 'blocks' JD> when the values inside the blocks vary in size (string JD> size)... LIST-DIR shows one way you can do it (it's a mezzanine so you can use SOURCE on it). There are probably a number of ways you could tackle this, so more details would be helpful. Do you just want to print to the console, or maybe also write to a file, etc. How is the data formatted: just one long block of items or "rows" of items. All strings or mixed datatypes? -- Gregg

 [3/3] from: g:santilli:tiscalinet:it at: 30-Jun-2003 12:32


Hi John, On Monday, June 30, 2003, 1:36:34 AM, you wrote: JD> Does anyone have a neat way to display (print) the JD> returned values from a series of datafile 'blocks' JD> when the values inside the blocks vary in size (string JD> size)..... Nenad's mysql-protocol.r comes with mysql-client.r that emulates MySQL's command line client. Using it, you get a print out like: mysql> select * from vendite limit 5 +------+-------------+------------+--------------+-------+-------+---------------+ | ID | Data | codCliente | Destinazione | Colli | stato | NumPreventivo | +------+-------------+------------+--------------+-------+-------+---------------+ | 1474 | 16-Apr-2003 | 8 | NULL | 0 | Evasa | 153 | | 1473 | 16-Apr-2003 | 39 | Idem | 1 | Evasa | 152 | | 1472 | 16-Apr-2003 | 16 | Idem | 4 | Evasa | NULL | | 1471 | 16-Apr-2003 | 44 | Idem | 3 | Evasa | NULL | | 1470 | 16-Apr-2003 | 18 | Idem | 4 | Evasa | NULL | +------+-------------+------------+--------------+-------+-------+---------------+ 5 row(s) in set If this is what you want, you might want to borrow the code from mysql-client.r. Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r