| **Navigation:**  [[abc library reference.htm|ABC Library Reference]] > ASCIIFileClass > AsciiFileClass Methods >====== GetLine (return line of text) {{c6h0009.jpg|C6H0009.jpg}} ====== | [[getlastlineno return last line number .htm|{{btn_prev_n.gif|Previous page}}]][[abc library reference.htm|{{btn_home_n.gif|Return to chapter overview}}]][[getpercentile convert file position to percentage asciifileclass .htm|{{btn_next_n.gif|Next page}}]] | | || **GetLine( **//line number //**), PROC** {{blk2blue.jpg|blk2blue.jpg}} | **GetLine** | Returns a line of text. | | //line number// | An integer constant, variable, EQUATE or expression that contains the offset or position of the line of text to return. | The **GetLine **method returns the line of text specified by //line number//. **Implementation:** The GetLine method gets a line at position //line number //from the ASCII file, extending the index queue if needed. If the index queue already contains the requested //line number// then the file is read using the existing offset, otherwise the index is extended. If the requested //line number //does not exist in the file, the text line is cleared and ERRORCODE() set. **Return Data Type:     **STRING **Example:** **MyViewer.DisplayPage PROCEDURE(LONG LineNo)** **LineOffset USHORT,AUTO** ** CODE** ** IF LineNo > 0                              !line specified?** **  SELF.ListBoxItems=SELF.ListBox{PROP:Items} !note size of list box** **  FREE(SELF.DisplayQueue)                    !free the display queue** **  SELF.GetLine(LineNo+SELF.ListBoxItems-1)   !index to end of page** **  LOOP LineOffset=0 TO SELF.ListBoxItems-1   !for each listbox line** **  !read ASCII file record:** **   SELF.DisplayQueue.Line=SELF.GetLine(LineNo+LineOffset)** **   IF ERRORCODE()                            !on end of file** **    BREAK                                    !stop reading** **   END** **   ADD(SELF.DisplayQueue)                    !add to display queue** **  END** **  SELF.TopLine=LineNo                        !note 1st line displayed** **  DISPLAY(SELF.ListBox)                      !redraw the list box** ** END** **See Also:     **[[getline return line of text .htm|GetLine]]