User Tools

Site Tools


setline_position_to_specific_line_.htm
Navigation:  ABC Library Reference > ASCIIViewerClass > AsciiViewerClass Methods >====== SetLine (position to specific line) C6H0009.jpg ====== Previous pageReturn to chapter overviewNext page

SetLine( line number ), PROTECTED, VIRTUAL

blk2blue.jpg

SetLine Positions the ASCIIViewerClass object to a specific line.
line number An integer constant, variable, EQUATE or expresssion that contains the offset or position of the line of text to position to.

The SetLine method positions the ASCIIViewerClass object to a specific line within the browsed file.

Implementation:

The AskGotoLine method, the ASCIIFileClass.SetPercentile method, and the ASCIISearchClass.Ask method all use the SetLine method to position to the required text line.

Example:

MyViewerClass.AskGotoLine PROCEDURE

LineNo  LONG,STATIC

OKGo    BOOL(False)

GotoDialog WINDOW('Goto'),AT(,,96,38),GRAY,DOUBLE

      SPIN(@n_5),AT(36,4,56,13),USE(LineNo),RANGE(1,99999)

      PROMPT('&Line No:'),AT(4,9,32,10),USE(?Prompt1)

      BUTTON('&Go'),AT(8,22,40,14),USE(?GoButton)

      BUTTON('&Cancel'),AT(52,22,40,14),USE(?CancelButton)

    END

 CODE

 OPEN(GotoDialog)

 ACCEPT

   CASE EVENT()

   OF EVENT:Accepted

     CASE ACCEPTED()

     OF ?GoButton

       OKGo=True

       POST(EVENT:CloseWindow)

     OF ?CancelButton

       POST(EVENT:CloseWindow)

     END

   END

 END

 CLOSE(GotoDialog)

 IF OKGo THEN SELF.SetLine(LineNo).

See Also:     AskGoToLine, ASCIIFileClass.SetPercentile, ASCIISearchClass.Ask

setline_position_to_specific_line_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1