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 10 years and 4 months 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.
I am currently experiencing issues after doing incremental upgrades to newer version of Sapien. I feel this issues sneaked in since 3.1.26 or earlier..
Problem: Command lines are recognized, just not parsed.When I open a PowerShell prompt and specify my project file, it sees the PARAM array in the project. However, the command lines arguments are somehow ignored. Within the Sapien Studio editor, it does successfully parse my arguments/command lines. Just not at the console level. I then backtracked to an older exported script to verify if the command lines still work, and it does. So I reconstructed the older exported script and then exported it as a new name. Needless to state, the newly exported script from the old gives the same result/issue of not parsing the command lines in the console. When running the old exported script as is, it still does. A file compassion reveals subtle changes in the new and old export.
I'm not clear as to what is not working correctly, but if you want to pass parameters into a project script you must place a parameter block at the top of the startup.pfs file. The $CommandLine in the Main function is use for a packaged exe.
PowerShell Code
Double-click the code block to select all.
#Define a Param block to use custom parameters in the project
Param ($CustomParameter) #<--- Place custom parameter here
function Main {
Param ([String]$Commandline)
#Note: This function starts the application
#Note: $Commandline contains the complete argument string passed to the packager
#Note: To get the script directory in the Packager use: Split-Path $hostinvocation.MyCommand.path
#Note: To get the console output in the Packager (Windows Mode) use: $ConsoleOutput (Type: System.Collections.ArrayList)
#TODO: Initialize and add Function calls to forms
if((Call-MainForm_pff) -eq "OK")
{
}
$global:ExitCode = 0 #Set the exit code for the Packager
}
The begin Invoke portion appears when you have the "Export form scripts in New Runspace" checked. You can uncheck it in Options->Designer->Export.
This topic is 10 years and 4 months 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.