textbox appendtext hang following a clear

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
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
Posts: 76
Joined: Tue Jul 10, 2012 10:37 am

textbox appendtext hang following a clear

Post by owinsloe » Wed Aug 21, 2019 2:37 pm

Product: PowerShell Studio 2019 (64 Bit)
Build: v5.6.167
OS: Windows 10 Enterprise (64 Bit)
Build: v10.0.18362.0

Hi, something very interesting. This is reproducible and quite odd. On a form I have a start button that does some processing and logs progress out to a multiline readonly textbox. This is pretty basic stuff that I have used a number of times. However, during coding I mistakenly added this >$Text += "`n`r"<. Note the newline sequence is back-to-front.

So during the textbox update this sequence appeared to be discarded and the textbox was successfully updated as a result of the subsequent

So, even with the addition of the erroneous >$Text += "`n`r"< things appeared to work correctly.

However, as the function of this little app is multi-run for different samples, there is a CLEAR button that clears the textbox via the textbox.clear() method.

The clear worked but any attempt to perform further updates to the textbox hung the app, which required it to be killed. I tried using both the text = and appendtext = with the same result.

Removing >$Text += "`n`r"< corrected things.

I dont think a hang situation should occur due to data content.


function Log ($Text)
$Text += "`n`r"
$TimeStamp = get-date -format "MMM dd, HH:mm:ss "


User avatar
Site Admin
Posts: 162
Joined: Thu Jun 01, 2017 7:20 am

Re: textbox appendtext hang following a clear

Post by brittneyr » Wed Aug 21, 2019 3:46 pm

There is indeed something strange happening here. I was able to reproduce your issue in PowerShell Studio and in the ISE after exporting my test psf to a ps1. I'll investigate further and let you know what I find.
Brittney Ryn
SAPIEN Technologies, Inc.