PrimalScript 2019 crashing when I open a specific script

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
RalphBley
Posts: 7
Joined: Sun Nov 30, 2008 9:54 pm

PrimalScript 2019 crashing when I open a specific script

Post by RalphBley » Thu Oct 03, 2019 8:10 am

I am trying to open a script file that I have edited in PrimalScript for years. It is just a collection of snippets - it doesn't actually do anything by itself. Now, every time I open the file PrimalScript crashes. I tried opening the file in a text editor and copy/pasting sections in and it starts crashing. I cannot see anything that looks odd. I can paste the first 312 lines in fine, but when I paste line 313 which is "Stopped wsearch Windows Search" without the quotes, it crashes. There are no special characters - the whitespace is spaces and I have even re-typed the line. It is also not specific to that line of text - I can paste in other chunks of code and it will also crash.

I am running version 7.6.133.0, 64-bit on Windows 10 64-bit.

I have attached a file containing the first 360 or so lines of code. If I just open that file, PrimalScript crashes.

Any help would be greatly appreciated.
Attachments
PrimalScript.ps1
(13.66 KiB) Downloaded 17 times

User avatar
mxtrinidad
Site Admin
Posts: 367
Joined: Sun Mar 03, 2013 12:42 pm

Re: PrimalScript 2019 crashing when I open a specific script

Post by mxtrinidad » Thu Oct 03, 2019 8:15 am

Thanks for providing the script! We are currently investigating the issue you are experiencing and we'll get back to you soon.

User avatar
Alexander Riedel
Posts: 7118
Joined: Tue May 29, 2007 4:43 pm

Re: PrimalScript 2019 crashing when I open a specific script

Post by Alexander Riedel » Thu Oct 03, 2019 8:47 am

Obviously it should not crash, and that will be fixed right away.

But the script is not really a functioning script, it contains pieces of output like:
  1. [DBG]: PS C:\>>> list
  2.  
  3.  
  4.  
  5. 1: #requires -version 2.0
  6.  
  7. 2:
  8.  
  9. 3: Write-Host "I am starting" -ForegroundColor Green
  10.  
  11. 4:* $r = Read-Host "What is the radius maximum value?"
  12.  
  13. 5: $pi = [math]::pi
  14.  
  15. 6: $result=$pi*($r*$r)
  16.  
  17. 7: Write $result
  18.  
  19. 8: Write-Host "I am ending" -ForegroundColor Green
  20.  
  21. 9:
  22.  
  23.  
  24.  
  25. [DBG]: PS C:\>>> c
  26.  
  27. 174531.179870181
  28.  
  29. I am ending
  30.  
  31.  
  32.  
  33. PS C:\> c:\scripts\fixme.ps1
  34.  
  35. I am starting
  36.  
  37. What is the radius maximum value?: 5
  38.  
  39. Hit Variable breakpoint on 'C:\scripts\fixme.ps1:$r' (Write access)
  40.  
  41.  
  42.  
  43. fixme.ps1:4 [int]$r = Read-Host "What is the radius maximum value?"
  44.  
  45. [DBG]: PS C:\>>> s
  46.  
  47. fixme.ps1:5 $pi = [math]::pi
  48.  
  49. [DBG]: PS C:\>>> s
  50.  
  51. fixme.ps1:6 $result = $pi*($r*$r)
  52.  
  53. [DBG]: PS C:\>>> $pi
  54.  
  55. 3.14159265358979
  56.  
  57. [DBG]: PS C:\>>> $r
  58.  
  59. 5
  60.  
  61. [DBG]: PS C:\>>> $r.gettype()
  62.  
  63.  
  64.  
  65. IsPublic  IsSerial  Name      BaseType
  66.  
  67. --------  --------  ----      --------
  68.  
  69. True      True      Int32     System.ValueType
  70.  
  71.  
  72.  
  73. [DBG]: PS C:\>>> c
  74.  
  75. 78.5398163397448
  76.  
  77. I am ending
which causes the syntax checker to just go boom because it becomes overwhelmed with the number of error messages.
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
RalphBley
Posts: 7
Joined: Sun Nov 30, 2008 9:54 pm

Re: PrimalScript 2019 crashing when I open a specific script

Post by RalphBley » Thu Oct 03, 2019 8:51 am

No, it's not a functioning script. It's a bunch of snippets of code - more like a cheat sheet, including the output of commands.

But that would explain why it crashes when just insert some plain text - it's still trying to interpret it as PS code and generates more errors, overwhelming it.

User avatar
Alexander Riedel
Posts: 7118
Joined: Tue May 29, 2007 4:43 pm

Re: PrimalScript 2019 crashing when I open a specific script

Post by Alexander Riedel » Thu Oct 03, 2019 8:55 am

Ah, I understand. Well, the crash will be fixed. You can disable syntax checking and it will prevent the crash until the fix is out.
Alexander Riedel
SAPIEN Technologies, Inc.