delete TP program by karel

  • Hello,


    I have created a sub routine in karel to copy TP programs and it works but i would like to delete them when i do not use them.


    I have used the instruction:

    DELETE_FILE('MD:\'+st_prog_to_delete+'.TP', TRUE, i_Status)

    but it doesn't work. I have the following error:

    INTP-322 invalid arg val for builtin


    does anybody know how to proceed ?


    really thanks.

  • Place your Ad here!
  • I've been using DELETE_FILE('MD:prog_name.TP', FALSE, status) without any issues. Differences are:

    • I don't have a backslash after 'MD:' (which is weird that it works because the backslash is definitely needed when loading from UD1 or UT1)
    • I have the 'nowait' flag set to FALSE, but I doubt that this would make a difference
    • I don't have any string manipulations in the function call. Maybe it's worth trying to write 'MD:\'+st_prog_to_delete+'.TP' into a string variable and then using the string variable as an argument

    Using the suggestion above of the CLEAR function is probably easier, but just thought I'd provide some information on my (successful) usage of your function.

  • really thanks for both of you for your quick answer.

    I have used the clear method, it works perfectly i have just filtered the error 16011.


    CLOSE_TPE(open_id,i_Status)

    IF i_Status<>0 THEN POST_ERR(i_Status,'',0,2);ENDIF

    --delete pasted file

    CLEAR(st_to_prog,i_Status)

    --Erreur VARS-011 No data defined for program = 16011

    IF (i_Status<>0) AND (i_Status<>16011) THEN POST_ERR(i_Status,'',0,0);ENDIF


    I have never succeed to use the DELETE_FILE method.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now

Advertising from our partners