Author Topic: Slick-C Divide by zero error  (Read 9182 times)

Scott277

  • Community Member
  • Posts: 17
  • Hero Points: 0
Slick-C Divide by zero error
« on: November 13, 2007, 04:05:33 AM »
Greetings,

New to the editor and forums.  When using VS Edit (current version), VI emulation mode, I'm getting the following error.  It's relatively easy to reproduce.  Simply open a new line (o), tab over one tab position, type some text, hit ESCAPE.  With the cursor sitting on the line you just added, open a line below (o) and VS auto-tabs you over one tab to the position of the line above.  Now, simply hit backspace to try to back up to the start of the line.  That's when I get the error I'm pasting below.

Anything I'm doing wrong?  I'm happy to entertain the possibility of PEBCAK with SlickEdit although I've been a VI user for decades.



 Slick-C STACK TRACE ******************************
 Created on 11/12/2007 at 22:58:25 (62 ms)
 SlickEdit Version 12.0.3.0 Copyright 1988-2007 SlickEdit Inc.
 Edit module and type "st -f <offset>" to get the
 run-time error position

 error code=-3017
 Divide by zero

stdcmds.ex 12771 wordwrap_rubout(1)   p_window_id: 122   p_object: OI_FORM   p_name:
stdcmds.ex 12252 rubout(1)   p_window_id: 122   p_object: OI_FORM   p_name:
stdcmds.ex 12280 linewrap_rubout()   p_window_id: 122   p_object: OI_FORM   p_name:
vicmode.ex 26318 vi_backspace()   p_window_id: 122   p_object: OI_FORM   p_name:

Ryan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 986
  • Hero Points: 77
Re: Slick-C Divide by zero error
« Reply #1 on: November 13, 2007, 03:11:51 PM »
The division by 0 is coming from the code where wordwrap_rubout is trying to figure out how much whitespace to delete.  Looks like your p_SyntaxIndent property must be set to 0, which only happens in a couple of cases if the options for the extension you are editing are malformed. 

What kind of file are you editing?  With this type of file open, can you take a screenshot of your extension setup options at Tools > Options > File Extension Setup?  Attach it to your post and I'll have a look.  In the mean time, if you want a semi-workaround to stop this from happening, uncheck "Backspace at beginning of line un-indents" under File Extension Setup.

- Ryan

Scott277

  • Community Member
  • Posts: 17
  • Hero Points: 0
Re: Slick-C Divide by zero error
« Reply #2 on: November 13, 2007, 03:41:26 PM »
I'm editing a PHP file.  I've changed the PHP extension so that it does not refer to the HTML extension since I never embed HTML in PHP code.  Here are the screen shots you requested:









Ryan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 986
  • Hero Points: 77
Re: Slick-C Divide by zero error
« Reply #3 on: November 13, 2007, 04:33:46 PM »
Thanks for the screenshots.  The attached stdcmds.e should solve your problem...let me know.  To apply, just backup your current version of that module, save the attached version, and load via Macro > Load Module.

We are still looking into what is happening to your extension options when you unreferred php.

- Ryan

Scott277

  • Community Member
  • Posts: 17
  • Hero Points: 0
Re: Slick-C Divide by zero error
« Reply #4 on: November 13, 2007, 09:06:26 PM »
Thank you, that appears to have resolved the backspace issue.  However, SlickEdit is now launching a sub-window every time I open a file from the command line (:e filename.php) that is named "vsapi.dll" and contains the following text:

30  p_index=2657
31  syntax_index=4
32  p_index=2597
33  syntax_index=3
...

Is this window pop due to the changes just made?  Or something else that I've inadvertently turned on by mistake?

Again, your assistance is appreciated.

Ryan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 986
  • Hero Points: 77
Re: Slick-C Divide by zero error
« Reply #5 on: November 13, 2007, 09:10:22 PM »
Woops :-[ !  I left in two debug statements...my bad.  Reload this version.

- Ryan

Scott277

  • Community Member
  • Posts: 17
  • Hero Points: 0
Re: Slick-C Divide by zero error
« Reply #6 on: November 13, 2007, 11:19:08 PM »
Thank you, that resolved the pop-up window.  Much appreciated.  Cheers.

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Slick-C Divide by zero error
« Reply #7 on: December 18, 2007, 10:21:47 PM »
FYI: This fix didn't make it into hotfix r27. So it might stack-dump again if (p_)SyntaxIndent == 0 for any reason.
HS2

Ryan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 986
  • Hero Points: 77
Re: Slick-C Divide by zero error
« Reply #8 on: December 18, 2007, 10:38:47 PM »
I think at the time (this was a while ago) we wanted to do more testing to make sure this was the correct fix.  That's why it was never added to the cumulative hotfix.  I'll update it now, and it'll be on the website as soon as support gets around to it  :o.

- Ryan