Author Topic: _restore_pos2 Change/Problem  (Read 3039 times)

PiezonTM

  • Senior Community Member
  • Posts: 140
  • Hero Points: 8
_restore_pos2 Change/Problem
« on: March 24, 2016, 03:16:47 PM »
I have some scripts I've written that no longer work.  I've narrowed the problem down to some changes to _restore_pos2.  My script saves the position then restores the position at different points in the code.  However, if the restore is now made twice with the same handle it no longer works--it used to work. 

Example,
Code: [Select]
_save_pos2(functPos);
_restore_pos2(functPos);
_restore_pos2(functPos);

The Slick-C Error dialog reads:
Code: [Select]
Invalid selection handle

file=util.ex offset=3933

I can workaround the problem with an immediate save.  But I would like to know if this is an intentional change that I need to work around or is this a problem?

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2903
  • Hero Points: 153
Re: _restore_pos2 Change/Problem
« Reply #1 on: March 24, 2016, 03:18:33 PM »
_save_pos2 and _restore_pos2 use a selection, and _restore_pos2 frees the seleciton.  So you can't call _restore_pos2 twice.  Can you use save_pos and restore_pos?

PiezonTM

  • Senior Community Member
  • Posts: 140
  • Hero Points: 8
Re: _restore_pos2 Change/Problem
« Reply #2 on: March 25, 2016, 11:03:30 AM »
I wrote this script about 10 years ago and have been maintaining it through different versions of SE.  So it escapes me now why I chose _save_pos2/_restore_pos2 over the other.  I did change the code to save_pos/restore_pos and the code worked fine.  Thanks.

Out of curiosity, did something change in those functions?  This script worked fine in past version of SE using _save_pos2/_restore_pos2.

Thanks for the time.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6937
  • Hero Points: 531
Re: _restore_pos2 Change/Problem
« Reply #3 on: March 25, 2016, 11:39:46 AM »
I think it used to silently fail. Now it lets you no you goofed pretty badly.