IDE versus MSG Box - Field Tabstops

Geoff Canyon gcanyon at gmail.com
Wed Aug 14 19:33:15 EDT 2013


On Wed, Aug 14, 2013 at 5:46 PM, Richard Gaskin
<ambassador at fourthworld.com>wrote:

> You really expected the value coming back to be different from what you
> set it to?
>

Yep -- I've known this is how tabstops work longer than I can remember, and
I use this feature all the time. The docs even mention this, although they
are a little misleading. They say:

If a tab stop is less than the previous tab stop, the distance is measured
relative to the previous tab stop. For example, if the tabStops is set to
"20,100,30", tab stops are placed at 20, 100, and 130 pixels from the left
margin.

That should of course say, "If a tab stop is less than the absolute
position of the previous tab stop..." For example, if the tabstops were set
to 100,30,50, the third tab stop would be relative, despite 50 being
greater than 30.


>
> If you set the text of a field to "Hello", do you expect getting the text
> from the field to yield "World"? ;)
>

Not unless the field's name is Eliza!


>
> It seems the engine is being very graceful in allowing both relative and
> absolute values as input for the tabStops, but ultimately the values that
> get stored are the absolute ones.
>

Agreed.


>
> If that weren't the case it would mean that Mark Waddingham wasted his
> time adding the tabWidth property, and I don't think I've ever seen Mark
> willfully waste his time.
>

Waste is a strong word to use, but this seems like a convenience more than
a feature.


>
> Now I'm wondering what the engine does with values in which each column is
> larger than the last.  That is, if you set the tabstops to this:
>
> 100,150,200
>
> ...do you get this back:
>
> 100,250,450
>
> ..or:
>
> 100,150,200
>

100,150,200, as I described earlier. Relative only kicks in when a value is
less than the absolute position of the preceding tab stop.



More information about the use-livecode mailing list