hexagon logo

Serialized folder creation for results

I picked up a nice little nugget of a tool today from a programmer friend of mine for making a new folder for results or whatever one could want.

The below code makes a .bat file that PC-DMIS reads back in as an external command and executes. This is cooler than the other side of the pillow...

Just thought I would share this with you guys...


$$ NO,
             
             
            ======================================================================================================================================================
            SERIALIZED FOLDER CREATION
             
             
            ASSIGN/VFLDRNAME=VPART + "_" + VDESCRIPTION + "_" + VSERIALNUMBER + "_" + VDATE + "\\"
            ASSIGN/VPARTPATH="D:\\CMM_PROGRAMS\\" + VPART + "_" + VDESCRIPTION + "_" + VPROGRAMID + "\\"
            ASSIGN/VRESULTSFLDR=VPARTPATH + "RESULTS\\"
            ASSIGN/VSRLFLDR=VRESULTSFLDR + VFLDRNAME
V_FLDRBAT  =FILE/EXISTS,D:\CMM_PROGRAMS\PC-DMIS_SUPPORT_FILES\SCRIPTS\FOLDER.BAT
            IF_GOTO/V_FLDRBAT=="TRUE",GOTO = L_FLDRCONTINUE
FPTR       =FILE/OPEN,"D:\\CMM_PROGRAMS\\PC-DMIS_SUPPORT_FILES\\SCRIPTS\\FOLDER.BAT",WRITE
            FILE/WRITELINE,FPTR,"MKDIR" + VSRLFLDR
            FILE/CLOSE,FPTR,KEEP
            EXTERNALCOMMAND/NO_DISPLAY, NO_WAIT ; D:\CMM_PROGRAMS\PC-DMIS_SUPPORT_FILES\SCRIPTS\FOLDER.BAT
L_FLDRCONTINUE=LABEL/


PS I feel kinda slow for not thinking of this myself.Rolling eyes