Outstreams

martensensmartensens Member Posts: 7
edited 2005-01-10 in Navision Attain
Hello,

I want to append some information from recordset to an existing ACII-file.
To test it I used some dummy text. WRITEMODE is true.
But it doesn't function. The message I get is that there is no permission to write on this file.
The drive, directory and file are in r/w/update-modus for anyone.

Below I will show my wirtten code:

QUOTE:

i_:=1;
IF "$datei".OPEN('e:\testFile.dat') THEN BEGIN
"$datei".CLOSE;
END ELSE BEGIN
"$datei".CREATE('e:\testFile.dat');
"$datei".CLOSE;
END;

"$datei".OPEN('e:\testFile.dat');
"$datei".CREATEOUTSTREAM("#zeileSchreiben");
REPEAT "#zeileSchreiben".WRITETEXT(FORMAT(i_)+';'+FORMAT('TEST')+';');
"#zeileSchreiben".WRITETEXT();
i_+=1;
UNTIL i_>5;
"$datei".CLOSE;
MESSAGE('well done');

UNQUOTE

Is there any idea ? Thank's in advance.

Greetings
steve

Comments

  • kinekine Member Posts: 12,562
    Try to set position to the end of file
    File.SEEK(File.LEN);
    
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • martensensmartensens Member Posts: 7
    Thank you kine,

    This was my thought, too. But the result is unfortunately the same.

    Regards Steve
  • martensensmartensens Member Posts: 7
    Thank you. I still use a dataport to solve the problem.

    Regards
    Steve
Sign In or Register to comment.