hexagon logo

Create folder script

It used to be here.
Parents
  • I'm still getting the Type Mismatch error.

    Here's my code, maybe I'm missing something:

    ASSIGN/OOT=GETPROGRAMINFO("NUMOOT")
                ASSIGN/TIME=GETPROGRAMINFO("TIME")
    J1         =COMMENT/INPUT,YES,FULL SCREEN=NO,
                'Job Number:'
                ASSIGN/JOB=J1.INPUT
                IF/OOT==0
    CS1          =SCRIPT/FILENAME= C:\USERS\CJACQUAY\DESKTOP\MAKEFOLDER3.BAS
                  FUNCTION/Main,SHOW=YES,,
                  STARTSCRIPT/
                  ENDSCRIPT/
                  PRINT/REPORT,EXEC MODE=END,$
                    TO_FILE=ON,APPEND="Z:\Everyone\ChadJ\2014programs\\"+J1.INPUT+"\JOB# "+J1.INPUT+" TIME "+TIME.PDF,AUTO OPEN REPORT=OFF,$
                    TO_PRINTER=OFF,COPIES=1,$
                    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
                    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
                    TO_EXCEL_OUTPUT=OFF,
                    PREVIOUS_RUNS=DELETE_INSTANCES
                END_IF/
    


    Sub Main()
    
    Set joname=PCDPartProgram.GetVariableValue("JOB")
    
    Fname         = sampname.Stringvalue & " " &  opname.Stringvalue & " "  
    strDirectory  = PCDPartProgram.Path & "\" & "Job Log"
    strFileName = joname.StringValue
    strPath         = strDirectory & "/" & strFileName & ".txt"
    
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    
    If objFSO.FileExists(strPath) Then
      Set objFile   = objFSO.OpenTextFile(strPath)
    Else
      Set objFile   = objFSO.CreateTextFile(strPath)
        Set objFile = objFSO.OpenTextFile(strPath)
    End If
    
    End Sub
    


    I know there's still some work to be done after Line 3 but that's where my error is currently.
Reply
  • I'm still getting the Type Mismatch error.

    Here's my code, maybe I'm missing something:

    ASSIGN/OOT=GETPROGRAMINFO("NUMOOT")
                ASSIGN/TIME=GETPROGRAMINFO("TIME")
    J1         =COMMENT/INPUT,YES,FULL SCREEN=NO,
                'Job Number:'
                ASSIGN/JOB=J1.INPUT
                IF/OOT==0
    CS1          =SCRIPT/FILENAME= C:\USERS\CJACQUAY\DESKTOP\MAKEFOLDER3.BAS
                  FUNCTION/Main,SHOW=YES,,
                  STARTSCRIPT/
                  ENDSCRIPT/
                  PRINT/REPORT,EXEC MODE=END,$
                    TO_FILE=ON,APPEND="Z:\Everyone\ChadJ\2014programs\\"+J1.INPUT+"\JOB# "+J1.INPUT+" TIME "+TIME.PDF,AUTO OPEN REPORT=OFF,$
                    TO_PRINTER=OFF,COPIES=1,$
                    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
                    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
                    TO_EXCEL_OUTPUT=OFF,
                    PREVIOUS_RUNS=DELETE_INSTANCES
                END_IF/
    


    Sub Main()
    
    Set joname=PCDPartProgram.GetVariableValue("JOB")
    
    Fname         = sampname.Stringvalue & " " &  opname.Stringvalue & " "  
    strDirectory  = PCDPartProgram.Path & "\" & "Job Log"
    strFileName = joname.StringValue
    strPath         = strDirectory & "/" & strFileName & ".txt"
    
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    
    If objFSO.FileExists(strPath) Then
      Set objFile   = objFSO.OpenTextFile(strPath)
    Else
      Set objFile   = objFSO.CreateTextFile(strPath)
        Set objFile = objFSO.OpenTextFile(strPath)
    End If
    
    End Sub
    


    I know there's still some work to be done after Line 3 but that's where my error is currently.
Children
No Data