InStream.READTEXT show me the wrong data

BraxBrax Member Posts: 4
edited 2017-01-05 in NAV Three Tier
Hello everyone,

I'm new on Dynamics NAV.
Currently, i'm working with NAV 2013 R2.
I have some synchronize problem, I explain :

I want to open a .txt file and read it. But when I read this file, it show me the wrong text.
Yesterday my text was "mon texte" and I updated it manually to "HELLO WORLD", but my code show me "mon texte".

You can see the result on attachment file.

Thanks a lot in advance for your answers.
l_Filename := 'C:\temp\fichier.txt';
l_File.TEXTMODE(TRUE);
IF NOT FILE.EXISTS(l_Filename) THEN
BEGIN
  MESSAGE('NOT FOUND');
END
ELSE
BEGIN
  l_File.OPEN(l_Filename);
  l_File.CREATEINSTREAM(MyInStream);
  MyInStream.READTEXT(l_Texte,100);
  MESSAGE(l_Texte);
  l_File.CLOSE;
END;

Answers

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Are you working on single machine with servicetier and client or servicetier is installed in some other server?
  • IbbermandIbbermand Member Posts: 1
    Is your file on the server where the Service Tier is running, C:\Temp\ is on This server and when Message "Not Found" not are shown it means it find a file and with the text "mon texte"
  • BraxBrax Member Posts: 4
    Are you working on single machine with servicetier and client or servicetier is installed in some other server?

    I work in remote desktop connection of a server which have the client and devlopment app installed but the sql is on an other server
  • BraxBrax Member Posts: 4
    edited 2017-01-05
    Ibbermand wrote: »
    Is your file on the server where the Service Tier is running, C:\Temp\ is on This server and when Message "Not Found" not are shown it means it find a file and with the text "mon texte"

    The file in C:\temp and the service tier are on the same server. When the service tier is running, my file in C:\temp is not open. Yes I'm agree with you but when I check my folder C:\temp there is only one file fichier.txt and when I open it, the text is not "mon texte" but "HELLO WORLD".

    Moreover, when I create manually a new txt file, and then I run my code, it don't find it. I think it's not synchronized. I have to wait few hours to see it.
  • krikikriki Member, Moderator Posts: 9,110
    [Topic moved from 'NAV/Navision Classic Client' forum to 'NAV Three Tier' forum]

    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.