Getting to the top and bottom

  • I've found a way to move to the top and bottom of the document to insert a bit of text but I'm sure there's a better way.

    Mine is

    Zitat

    while Displayer.CPMoveDownPar do Displayer.CPMoveDownPar ;
    while Displayer.CPMoveDownLine do Displayer.CPMoveDownLine;
    while Displayer.CPMoveNext do Displayer.CPMoveNext ;

    I'm betting there's a simple method hidden away somewhere that will be blindingly obvious when you point it out to me <g>

    Roy

  • Roy,

    I may not be understanding the nature of your question, but will something as straightforward as:

    Code
    Displayer.CPPosition := 0;


    and

    Code
    Displayer.CPPosition := MAXINT;


    accomplish what you need, respectively?

    Regards,
    richard diamond

  • Richard

    Unfortunately neither you nor my approach moves the cursor beyond the point at which attributes have been defined (both going to top or bottom of the document).

    Mine moves the cursor before/after the font face but not before colour or style. Yours doesn't even go that far <g>

    • Offizieller Beitrag

    Hi,

    in this code

    while Displayer.CPMoveDownPar do Displayer.CPMoveDownPar ;
    while Displayer.CPMoveDownLine do Displayer.CPMoveDownLine;
    while Displayer.CPMoveNext do Displayer.CPMoveNext ;

    the line

    while Displayer.CPMoveDownLine do Displayer.CPMoveDownLine;

    is not required since CPMoveNext does not work on a line basis.

    CPPosition := MaxInt moves the cursor to the last paragraph of the text - if that is a table it can be problematic. Better do this: CPPosition =$FFFFFF;

    Julian