.
.   
NEdit.org
   .

Home
 - News - Download - Documentation - Search - FTP     
.
.
  

Save current position

[Back]

 

These macros save/load the current cursor position in a bookmark file. Current position of file XXXX is stored in file $HOME/.nedit-XXXX.

Save current position

cpos = $cursor
tmpstr = shell_command("echo $HOME", "")
$HOME = substring(tmpstr, 0, length(tmpstr) - 1)
fname = $HOME"/.nedit-" $file_name
if (write_file(cpos, fname) == 0)
   dialog("Can't save bookmark!", "OK")
Load formerly saved position
cpos = $cursor
tmpstr = shell_command("echo $HOME", "")
$HOME = substring(tmpstr, 0, length(tmpstr) - 1)
fname = $HOME"/.nedit-" $file_name
cpos=read_file(fname)
if ($read_status == 0)
   dialog("Can't load bookmark!", "OK")
else set_cursor_pos(cpos)
Delete bookmark file
tmpstr = shell_command("echo $HOME", "")
$HOME = substring(tmpstr, 0, length(tmpstr) - 1)
fname = $HOME"/.nedit-" $file_name
cmdreturn=shell_command("rm " fname, "")
dialog(cmdreturn, "OK")
[Back]

. Released on  Wed, 21 Nov 2001  by C. Denat  

  
Visit our sponsor
Check Metrolink

© NEdit.org
1999-2001
All rights reserved


.