I have been working on this recently and tried the links in this and other questions, but in the end settled for using Chrome. It was easier, quicker and less moving parts as Chrome was already on the servers.
S s1=$ZF(-100,"/LOGCMD /NOQUOTE /STDOUT+=e:\logs\H2POUT.log /STDERR+=e:\logs\H2Perr.log",strExePath,"--headless --disable-gpu --print-to-pdf-no-header --print-to-pdf="""_strPDFPath_""" """_strHTMLPath_"""") // For some weird reason this flags as an error when it completes, no idea why, but its not valid.
//w "S1: "_s1,!!
//I $$$ISERR(s1) Q $SYSTEM.Status.GetErrorText(s1)
I ##class(%File).Exists(strPDFPath)
{ Q "1*"_strPDFPath }
ELSE
{ Q "0*Error Occurred" }
Thanks Timo
The codebase of this system is over 30 years old. They came up with suffixing as their solution and its used in a lot of places. As much as I can see prefixing as a better solution overall, there is no way to make that happen. So I'm stuck battling with what I've got. I've a few ideas now on where / how to approach a new search function for this class of data set, but no shining silver bullet.
Plus one for the LFS approach, (I wrote this before noticing it was in Eduard's more complete solution.
If you don't need to keep the spaces, because they're the delimiter, I find that $LFS works as a quick and dirty. It depends what you want the punctuation for. You can put spaces back in when do something with the list if you need them.