[Cl...] Posted October 11, 2018 Share Posted October 11, 2018 This for Roberto Flores, unless someone else with specific PCM knowledge can jump in and answer this. Roberto, you assisted me with some PCM code a while back that would capture only specific characteristic's to output to a .txt file. That works great, one problem though. If a part fails the operators re-run it. Usually the second run it's good, and the generated report does not overwrite the first one that failed. I want the report to overwrite the first one. How do I do that? Here's the code I'm using: PCM.txt Link to comment Share on other sites More sharing options...
[Er...] Posted October 11, 2018 Share Posted October 11, 2018 Place this after you have defined the variable "dirPath", but before you write to the file. if fileExists(dirPath) == true deleteFile(dirPath) endif Link to comment Share on other sites More sharing options...
[Cl...] Posted October 11, 2018 Author Share Posted October 11, 2018 Thank you Eric. Link to comment Share on other sites More sharing options...
[Cl...] Posted October 11, 2018 Author Share Posted October 11, 2018 Is this correct Eric? Link to comment Share on other sites More sharing options...
[Er...] Posted October 11, 2018 Share Posted October 11, 2018 Yepp Link to comment Share on other sites More sharing options...
[Cl...] Posted October 11, 2018 Author Share Posted October 11, 2018 Thanks again Eric. This worked well, and really helped us out 🙂 Link to comment Share on other sites More sharing options...
[Er...] Posted October 11, 2018 Share Posted October 11, 2018 It's amazing what you can achive now days, with a smart phone in a restroom you can solve issues on the other side of the globe. 🤠 Link to comment Share on other sites More sharing options...
[Ro...] Posted October 12, 2018 Share Posted October 12, 2018 The best problems are the ones that fix themselves 🙂 Thanks eric, as usual your fix was easier than mine I put a "deleteFile" in front of my directory path, but it does the same thing as your If statement.forum1.JPG Link to comment Share on other sites More sharing options...
[Er...] Posted October 12, 2018 Share Posted October 12, 2018 Not sure I understand why mine is easier than yours. In my eyes yours is easier, since it's only one line. Only difference is that I use the variable of the full path and file. You build the string again. How ever, yours will raise an exception and send to transcript if the file doesn't exist. Doesn't effect anything and work as a charm here. But in many other languages it will fail, or make weird thing. Kind of like this joke: Please sign in to view this quote. Guess I'm damaged after all programming I've done.. 🙂 Link to comment Share on other sites More sharing options...
[Ro...] Posted October 15, 2018 Share Posted October 15, 2018 It seems like it would raise an exception, but it never has. Ive had programs err out over much less Link to comment Share on other sites More sharing options...
[Er...] Posted October 17, 2018 Share Posted October 17, 2018 Fu#k me side ways, it doesnt raise an exception. There's an internal check within the syntax if the file exists or not. It's like some one actually put some tought in to that one 🙂 (Usually you dont see the transicript window unless you run calypso in development mode, or turn it on by force.) Link to comment Share on other sites More sharing options...
[To...] Posted October 17, 2018 Share Posted October 17, 2018 Please sign in to view this quote. There are 10 kinds of people who understand binary. Ones that do and others that don't. Link to comment Share on other sites More sharing options...
[Er...] Posted October 17, 2018 Share Posted October 17, 2018 The corniest of them all, head it from a it-guy at work the other day whole a bullied jim whole he set up a network with the new dura max. (Actually took me a whole to figure it out) Please sign in to view this quote. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in