Startup script not working when tab is not open

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 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.
This topic is 1 year and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
B Daring
Posts: 90
Last visit: Mon Feb 05, 2024 3:00 pm
Answers: 2
Has voted: 1 time

Startup script not working when tab is not open

Post by B Daring »

Product: PowerShell Studio 2023 (64 Bit)
Build: v5.8.217
OS: Windows 10 Pro (64 Bit)
Build: v10.0.19045.0

So little hard to explain on this one. Created a new project and you have all three Global, start and mainform in tabs open and ready. All I do is add

Code: Select all

Param (
	[Parameter(Mandatory = $false, Position = 1)]
	[string]$Param1
	
)
to startup. Then "Write-Host "Param1= "$Param1" in globals and run it as an Windows Application in deploy settings, so I can see the variable print out. Works just fine. Now close the startup tab and recompile. The variable is not populated at this point. So shouldn't startup.pss be included regardless if the tab is open or not?
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 3:14 pm
Answers: 39
Been upvoted: 30 times

Re: Startup script not working when tab is not open

Post by brittneyr »

If you export your project (Deploy->Export), do you see the code from Startup.pss in the exported PS1 file?
Brittney
SAPIEN Technologies, Inc.
User avatar
B Daring
Posts: 90
Last visit: Mon Feb 05, 2024 3:00 pm
Answers: 2
Has voted: 1 time

Re: Startup script not working when tab is not open

Post by B Daring »

When the tab is open yes, code is there. When tab is closed, code is not there. But I still see "#region Source: Startup.pss" in the exported file. The code block is not there however
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 3:14 pm
Answers: 39
Been upvoted: 30 times

Re: Startup script not working when tab is not open

Post by brittneyr »

Do you not see the main function or the call to your MainForm:
SPS_StartupRegionExport-08.png
SPS_StartupRegionExport-08.png (63.42 KiB) Viewed 9454 times
Brittney
SAPIEN Technologies, Inc.
User avatar
B Daring
Posts: 90
Last visit: Mon Feb 05, 2024 3:00 pm
Answers: 2
Has voted: 1 time

Re: Startup script not working when tab is not open

Post by B Daring »

Yes, I see all that, but the my code block is not there
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 3:14 pm
Answers: 39
Been upvoted: 30 times

Re: Startup script not working when tab is not open

Post by brittneyr »

Can you upload your project or a sample project demonstrating the behavior here:
https://www.sapien.com/support/upload
Brittney
SAPIEN Technologies, Inc.
User avatar
B Daring
Posts: 90
Last visit: Mon Feb 05, 2024 3:00 pm
Answers: 2
Has voted: 1 time

Re: Startup script not working when tab is not open

Post by B Daring »

File has been uploaded. I tried to show screenshots but when I tried to attach to this post I got a HTTP error and they never would attach.
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 3:14 pm
Answers: 39
Been upvoted: 30 times

Re: Startup script not working when tab is not open

Post by brittneyr »

We are looking into this and will get back to you soon.
Brittney
SAPIEN Technologies, Inc.
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 3:14 pm
Answers: 39
Been upvoted: 30 times

Re: Startup script not working when tab is not open

Post by brittneyr »

Please try the latest build 5.8.218 and let me know if you are still experiencing this behavior.
Brittney
SAPIEN Technologies, Inc.
User avatar
B Daring
Posts: 90
Last visit: Mon Feb 05, 2024 3:00 pm
Answers: 2
Has voted: 1 time

Re: Startup script not working when tab is not open

Post by B Daring »

Thanks Brittneyr,

I have confirmed, this behavior has been fixed. I appreciate it
This topic is 1 year and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.