[Ry...] Posted June 30 Share Posted June 30 I am currently trying to build a program for our cmm to be used as a quarterly verification. One of the things I want to do is if it determined that cert needs to be updated you can edit the PARA file mid run. I can get note pad to open, but I cant get the file to open. Here is what I have so far. // cert file and directory Certdata=getActualInspectionDir()+"\PCM\0154-16 Cert.PARA" //text editor texteditor="notepad.exe" // inquire next steps if cert is out of date u=0 update=0 cert_update=Certdata+texteditor if q==1 then u=confirm("The Calibration Date for the artifact has passed"+cr()+"Do you wish to continue run?") update=confirm("Do you wish to update the cert data now?") endif if update==true then systemCallWithWait(cert_update) endif q is set to 1 in steps in the code earlier on if the date is found to be past. For the system call I am mimicking code that a former programmer set up, but I cant seem to find what step I am missing. Thanks for the Help Link to comment Share on other sites More sharing options...
[Mi...] Posted June 30 Share Posted June 30 Hello! Try Certdata="C:\Temp\test.txt" texteditor="notepad" //texteditor="notepad++" systemCallWithWait("cmd.exe /c start " + texteditor + " " + Certdata) Link to comment Share on other sites More sharing options...
[Ma...] Posted July 1 Share Posted July 1 Try this one: // cert file and directory Certdata=getActualInspectionDir()+"\PCM\0154-16 Cert.PARA" //text editor texteditor="notepad.exe " // inquire next steps if cert is out of date u=0 update=0 cert_update=texteditor + Certdata if q==1 then u=confirm("The Calibration Date for the artifact has passed"+cr()+"Do you wish to continue run?") update=confirm("Do you wish to update the cert data now?") endif if update==true then systemCallWithWait(cert_update) endif Link to comment Share on other sites More sharing options...
[Ry...] Posted July 1 Author Share Posted July 1 Please sign in to view this quote. This worked Thank you for the help. on a side note do you know if there is a way to do this with out going through the command line? Link to comment Share on other sites More sharing options...
[Ry...] Posted July 1 Author Share Posted July 1 Please sign in to view this quote. This is what I tried originally, as it mimics the first program the best, but it just seems to skip past this line when ever I run it Link to comment Share on other sites More sharing options...
[Ma...] Posted July 2 Share Posted July 2 Please sign in to view this quote. Test this simple code if it works for you. filePath = "C:\Link\To\Your\File.para" textEditor = "notepad.exe " fileEdit = texteditor + filePath systemCallWithWait(fileEdit) Link to comment Share on other sites More sharing options...
[Ry...] Posted July 2 Author Share Posted July 2 Please sign in to view this quote. I tried it and got the same affect. I tried it with both the system call with wait and system call just skips over both. But it will open up a blank note pad file just fine 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