Shell

maikeljmaikelj Member Posts: 50
edited 2002-11-17 in Navision Financials
Hi everybody,

I'm having a problem with the function SHELL.

First I tried to rename "test1.txt" into "test2.txt".
This was correct.

But when I tried to rename the file "test 1.txt" into "text 2.txt", it did not work. And I think the spatial is the cause of this.

So my question is: How can I rename the file?

With kind regards,

Maikel

Comments

  • dimsmdimsm Member Posts: 2
    there's a special function for that named rename
    i do not speak of the key renaming function, but of the rename(oldfilename,newfilename);

    i tested that function with spaces (e.g. "rename('c:\tmp\b 1.txt','c:\tmp\b 2.txt');") and it works great under NA3.10, and NF2.6b
    you may find it pressing F5, anf "F" key, afterwards.

    good luck
  • maikeljmaikelj Member Posts: 50
    Thanks for the tip.
    It works great.
    I only had my eye on the SHELL function.

    Maikel
  • Christian_BuehlChristian_Buehl Member Posts: 145
    The reason for the non workin shell-function is that
    shell('rename test 1.txt test 2.txt');
    will be interpreted from the shell as copy with 4 arguments. (Try to do this in a dos-box - you will see the same effect)

    To use correct with shell you have to set the filenames in brackets:
    tr[1] := 34;  // set " into textvariable tr
    file1 := tr + 'test 1.txt' + tr;
    file2 := tr + 'test 2.txt' + tr;
    shell('copy',file1,file2);
    
Sign In or Register to comment.