ADC Home > Reference Library > Technical Notes > Legacy Documents > Mac OS 9 & Earlier >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

TextEdit EOL Ambiguity

CONTENTS

TESetSelect may be used to position the insertion point at the end of a line. There is an ambiguity, though; should the insertion point appear at the end of the preceding line or the start of the following one? It is possible to determine what will happen, as you are about to see.

[Mon 01 1988]






Introduction

There is an internal flag used by TextEdit to determine where the insertion point at the end of a line appears. This flag is part of the clikStuff field in the TERec. It is there mainly for the use of TEClick, but it is also used by TESetSelect (although it defaults to the right side of the previous line).

The following code can be used to force the insertion point to appear at the left of the following line when it is positioned at the end of a line.

In MPW Pascal:

    TEDeactivate(tH);
    tH^^.clikStuff := 255;            {position caret on left}
    TESetSelect(eolcharpos, eolcharpos, tH);    {ambiguous point}

In MPW C:

    TEDeactivate(tH);
    (**tH).clikStuff = 255;            /*position caret on left*/
    TESetSelect(eolcharpos, eolcharpos, tH);    /*ambiguous point*/

If you want to ensure that the caret is on the right side (to which it normally defaults) then substitute a zero for the 255.

Back to top

References

Inside Macintosh, Volume V, Compatibility Guidelines

M.OV.GestaltSysenvirons

Back to top

Downloadables

Acrobat gif

Acrobat version of this Note (40K).

Download



Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.