next up previous contents index
Next: Change position Up: Functions Previous: Functions

About position

 

current_position

   int current_position()

Returns the current position in the current window. When you are at the beginning of the buffer currentposition returns 0.

end_of_file

  int end_of_file();

Returns the end of file position, thus the number of characters in the buffer. For an empty file endoffile returns 0.

at_end_of_file

  int at_end_of_file();

Returns 1 if you are at the end of the current buffer, else returns 0. Its definition is equivalent to:
tabular1980

current_line

   int current_line();

Returns the current line number. Lines are terminated by a newline character. Here is an example of this function use:
tabular1989

beginning_of_line

  int beginning_of_line();

Returns the position of the beginning of the current line, therefore the current position at the beginning of the buffer or when the previous character is a newline.

end_of_line

  int end_of_line()

Returns the position of the end of the current line, therefore the current position if the current character is newline, else the position of the next newline if it exists, else the end of file position (See also markposition() §7.3.7 page gif).



Lionel Fournigault
Wed Apr 30 10:44:37 MET DST 1997