hexagon logo

help, auto save .prg after run, in a specific location variable.

I have been looking through all the past topics about this. but I am having trouble getting them working. I tried copy and pasting a few of them. and saving them as a .bas file and running the script. but i cant get one to work for me.


i currently already have a script that auto creates a folder from an operator input and saves the cmm report in that folder.

so ideally i want to follow that same train of thought and save a .prg & .cad in that same folder already created.


please advice.

Parents
  • As I have noted in other posts, the "\" is a special character inside strings and needs to be doubled.
    (And as I have also noted, it is special in the forum software... sigh!)

    Your
    strPath = "Q:\Quality\In Process Inspection Plans\PartNo.StringValue\CMM REPORTS\"

    needs to be changed to at least
    strPath = "Q:\Quality\In Process Inspection Plans\PartNo.StringValue\CMM REPORTS\\"

    but it might be even better to change them all:
    strPath = "Q:\\Quality\\In Process Inspection Plans\\PartNo.StringValue\\CMM REPORTS\\"


    \" is read by PC-DMIS to mean "insert a quotation mark in the string"
    \\ means "insert one \ in the string"
Reply
  • As I have noted in other posts, the "\" is a special character inside strings and needs to be doubled.
    (And as I have also noted, it is special in the forum software... sigh!)

    Your
    strPath = "Q:\Quality\In Process Inspection Plans\PartNo.StringValue\CMM REPORTS\"

    needs to be changed to at least
    strPath = "Q:\Quality\In Process Inspection Plans\PartNo.StringValue\CMM REPORTS\\"

    but it might be even better to change them all:
    strPath = "Q:\\Quality\\In Process Inspection Plans\\PartNo.StringValue\\CMM REPORTS\\"


    \" is read by PC-DMIS to mean "insert a quotation mark in the string"
    \\ means "insert one \ in the string"
Children
No Data