Displaying a table

Sarah Reichelt sarahr at genesearch.com.au
Sun Jan 13 19:25:01 EST 2002


> Since Rev doesn't have a table object (like OMO did...a GREAT feature I'd
> recommend for Rev), how are people dealing with the display of tabular data?
> I know I can use a proportional font like Courier, but I'm hoping there's a
> better solution. I also played around a bit with tabstops, but that only
> gives left alignment within each tab stop.
> 
> Richard Miller
> 
I have been trying to do this too and I would love to see a table object
appear in Revolution.

Meanwhile, here's what I came up with, which isn't great but it works.
- use the tabStops of the field & turn on the vertical grid.
- for entries that might be too long to fit, make a hidden field that is the
same size as the relevant column and has the same text settings. Before
putting the text in the column use a function that does something like this:

on checkSize theString
    put theString into fld "Format Check"
    repeat while the formattedWidth of fld "Format Check" > the width of fld
"Format Check"
        delete last char of theString
    end repeat
    
    return theString
end checkSize

- for numeric columns which you want right-aligned, use the format function:

    put format("%6.2", theNum) into item y of line x fld "Table"
This converts the numbers to a string, but pads them out so they appear
right justified. Check the format function for more details on how to
specify different formats.

Cheers,
Sarah





More information about the use-livecode mailing list