My editor is crashing every time I stick a quote on any line above a lengthy variable...
Here's how I'm recreating this:
Launch PrimalScript 2012 (6.5.153)
Create a new PowerShell script
Add a couple blank lines, then a long string variable:
$somevar="Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
Then go to any line ABOVE that line, and type a double quote (")
PrimalScript immediately crashes:
"Sapien PrimalScript 2012 has stopped working. A problem caused the program to stop working correctly. Please close the program."
I am running this on Windows 7, all the latest SPs and patches.
Also note, I have tried this with real-time syntax checking both enabled and disabled; same results both ways.
Thoughts?
Thank you,
Aaron
PrimalScript crashes on long strings in PowerShell
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION 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.
DO NOT POST LICENSE NUMBERS, ACTIVATION 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.
- Alexander Riedel
- Posts: 8479
- Last visit: Thu Mar 28, 2024 9:29 am
- Been upvoted: 37 times
Re: PrimalScript crashes on long strings in PowerShell
Can you define how long "long" is? My guess is that a character limit in the parser is exceeded somewhere and to make this get fixed faster we'd like to know how long your variable is.
Best would be to attach the actual file or email it (zipped) to support@sapien.com.
Best would be to attach the actual file or email it (zipped) to support@sapien.com.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: PrimalScript crashes on long strings in PowerShell
If you use the exact variable I posted above (copy/paste?), and if the problem isn't for some reason local just to me, then you'll see it. The one above happens to be a string of 276 characters.Alexander Riedel wrote:Can you define how long "long" is? My guess is that a character limit in the parser is exceeded somewhere and to make this get fixed faster we'd like to know how long your variable is.
Re: PrimalScript crashes on long strings in PowerShell
Playing some more, I can also come up with this:
"long" appears to mean a string of >127 continuous characters on a single line.
I can create a variable with value of 127 continuous characters (no spaces) just fine. Add one character or more, still no spaces, and it breaks when I start typing a quote anywhere earlier in the script. My guess is that this happens as PrimalScript tries to go and contextually recolor everything.
Break the value with a line return, each line being less than 128 continuous characters, and it's fine (this won't meet my needs, unfortunately).
i.e.:
$myvar="<128 or more continuous characters>" #boom
$myvar="<60 continuous characters>
<100 continuous characters>
<75 continuous characters>
<anything less than 128 continuous characters>" #no boom
Or type something like (including the unclosed double quote):
---------------------------
"
$myvar="<75 continuous characters><space><75 more continuous characters>"
---------------------------
And then remove the space: boom
Interestingly enough, this even happens in a "here-string" - which I would think should be impervious to this behavior (though, in my opinion ((mean no offense here, just stating my experience)) PrimalScript has always had a problem of handling here-strings poorly when it comes to trying to figure out what text should be what color during and after the here-string.)
And finally, I just tried this at home (also Win7, latest & greatest) using a trial copy of the exact same version of PrimalScript, with the same results.
Hope this additional info helps.
"long" appears to mean a string of >127 continuous characters on a single line.
I can create a variable with value of 127 continuous characters (no spaces) just fine. Add one character or more, still no spaces, and it breaks when I start typing a quote anywhere earlier in the script. My guess is that this happens as PrimalScript tries to go and contextually recolor everything.
Break the value with a line return, each line being less than 128 continuous characters, and it's fine (this won't meet my needs, unfortunately).
i.e.:
$myvar="<128 or more continuous characters>" #boom
$myvar="<60 continuous characters>
<100 continuous characters>
<75 continuous characters>
<anything less than 128 continuous characters>" #no boom
Or type something like (including the unclosed double quote):
---------------------------
"
$myvar="<75 continuous characters><space><75 more continuous characters>"
---------------------------
And then remove the space: boom
Interestingly enough, this even happens in a "here-string" - which I would think should be impervious to this behavior (though, in my opinion ((mean no offense here, just stating my experience)) PrimalScript has always had a problem of handling here-strings poorly when it comes to trying to figure out what text should be what color during and after the here-string.)
And finally, I just tried this at home (also Win7, latest & greatest) using a trial copy of the exact same version of PrimalScript, with the same results.
Hope this additional info helps.
Re: PrimalScript crashes on long strings in PowerShell
Dang it. One last post for the night. Promise, it's my last.
If I turn off "Display Syntax Coloring" the whole problem goes away. But then living in a black-and-white scripting world is... well... reminiscent of times long, long ago.
If I turn off "Display Syntax Coloring" the whole problem goes away. But then living in a black-and-white scripting world is... well... reminiscent of times long, long ago.
- Alexander Riedel
- Posts: 8479
- Last visit: Thu Mar 28, 2024 9:29 am
- Been upvoted: 37 times
Re: PrimalScript crashes on long strings in PowerShell
I'll see what I can find out. There is a service build scheduled for this weekend anyway, I will make sure this makes it in.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: PrimalScript crashes on long strings in PowerShell
Thank you. Looking forward to it.Alexander Riedel wrote:I'll see what I can find out. There is a service build scheduled for this weekend anyway, I will make sure this makes it in.
Re: PrimalScript crashes on long strings in PowerShell
6.5.156 fixes this. My thanks for the quick response.
- Alexander Riedel
- Posts: 8479
- Last visit: Thu Mar 28, 2024 9:29 am
- Been upvoted: 37 times
Re: PrimalScript crashes on long strings in PowerShell
We aim to please
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.