delfile command , possible replacements

SOLVED

I found this great little command, delfile, for deleting files programaticaly from the X3 folders.

I am in V12 Patch 20.

I can run the command in the calculator and it works.

When i tried to compile it using Eclipse... the source will not compile because it is " Unknown Instruction; Illegal character."   I tried from process editor... same thing.

So how can a command work in the calculator, but not be recognized by the runtime to be compiled?  Was it deprecated?

Alternatively...  what are people using as a replacement since this command doesn't work?

Test Case - place a file in your TRT directory,   TEST.txt for instance, then run Delfile(filpath("TRT","TEST","txt",0))  in the calculator.

thank you

Parents
  • +1
    verified answer

    OK, apparently since DELFILE returns a value, that value needs to be placed in a variable.    The test in the calculator likely works because it is returning a value in the calculator.  The same code in source fails because it does not have anywhere to return the value to.

    So putting in a local variable to capture the value (whether you use it or not)  resolves the issue.

    Ex:  YI = Delfile(.......)

Reply
  • +1
    verified answer

    OK, apparently since DELFILE returns a value, that value needs to be placed in a variable.    The test in the calculator likely works because it is returning a value in the calculator.  The same code in source fails because it does not have anywhere to return the value to.

    So putting in a local variable to capture the value (whether you use it or not)  resolves the issue.

    Ex:  YI = Delfile(.......)

Children