[code]sendText:=STANDARD.CONCAT('a',';');//<-- Why does this not working?[/code]
it will not working for me. But if I use
sendText:='a;'.
It works perfect. Why? It is the same if I set the code as
sendText:=SQL_Array_Text[i];
I get garbarge values too. Why?
PROGRAMSparaDataTillSQLVAR    xFileStdInit:    BOOL:=FALSE;    uiFileStdState:   UINT:=0;    sFileName:     CAA.FILENAME;    hFile:       CAA.HANDLE;    szFileSize1:    CAA.SIZE:=0;    szFileSize2:    CAA.SIZE:=0;    filop:       FILE.Open;    filwr:       FILE.Write;    filrd:       FILE.Read;    filcl:       FILE.Close;    filsp:       FILE.SetPos;    Date_and_time_format:DATE_AND_TIME;    datumNamn:STRING;    SQL_Array_Text:ARRAY[0..1024]OFSTRING;    //Räknare    i:INT;  //Textensomskallskickas  sendText:STRING;END_VARIFNOTxFileStdInitTHEN  filop(xExecute:=FALSE);  filcl(xExecute:=FALSE);  filwr(xExecute:=FALSE);  //filrd(xExecute:=FALSE);  xFileStdInit:=TRUE;  uiFileStdState:=0;    //Skapafilnamn  datumNamn:=DT_TO_STRING(Date_and_time_format);  datumNamn:=STANDARD.REPLACE(datumNamn,'_',1,17);//Härtarvibort:  datumNamn:=STANDARD.REPLACE(datumNamn,'CC',1,20);//Sammahärockså.  sFileName:=Standard.CONCAT('\FlashDrive\Project\Project Files\Reports\FTP_Get\',datumNamn);  sFileName:=Standard.CONCAT(sFileName,'.csv');//<--ChangefileNamehereifyouwanttotry    //Skapaenlångarraymedvärdensomskallloggas  SQL_Array_Text[0]:=GVL.Ordernummer;  SQL_Array_Text[1]:=GVL.VentilNamn;  SQL_Array_Text[2]:=GVL.SerieNummer;  SQL_Array_Text[3]:=GVL.VentilPort;  SQL_Array_Text[4]:=INT_TO_STRING(GVL.TestNummer);  SQL_Array_Text[5]:=GVL.FlodesInstallning;  SQL_Array_Text[6]:=GVL.TryckInstallning;  SQL_Array_Text[7]:=GVL.LastInstallning;  SQL_Array_Text[8]:=GVL.Operator;  SQL_Array_Text[9]:=INT_TO_STRING(GVL.MaxFlode);  SQL_Array_Text[10]:=GVL.VentilTyp;  SQL_Array_Text[11]:=BOOL_TO_STRING(GVL.Externt_Lackage);  SQL_Array_Text[12]:=BOOL_TO_STRING(GVL.Hysterestest);  SQL_Array_Text[13]:=LREAL_TO_STRING(GVL.Hysteresvarde);  SQL_Array_Text[14]:=BOOL_TO_STRING(GVL.Shuntslidkarvning);  SQL_Array_Text[15]:=REAL_TO_STRING(GVL.Shuntslidkarvningvarde);  SQL_Array_Text[16]:=BOOL_TO_STRING(GVL.Backventillackage);  SQL_Array_Text[17]:=REAL_TO_STRING(GVL.Backventillackagevarde);  SQL_Array_Text[18]:=BOOL_TO_STRING(GVL.Slidlackage);  SQL_Array_Text[19]:=REAL_TO_STRING(GVL.Slidlackagevarde);  SQL_Array_Text[20]:=BOOL_TO_STRING(GVL.Shuntlackage);  SQL_Array_Text[21]:=REAL_TO_STRING(GVL.ShuntlackageVarde);    //      ELSE  CASEuiFileStdStateOF    0:(*createanewfile*)      filop.sFileName:=sFileName;      filop.eFileMode:=FILE.MODE.MRDWR;      filop.xExclusive:=TRUE;      filop(xExecute:=TRUE);      IFfilop.xDoneTHEN        hFile:=filop.hFile;        uiFileStdState:=1;      END_IF      IFfilop.xErrorTHEN        (*errorhandling*)        ;      END_IF    1:(*writetextinthefile*)      filwr.hFile:=hFile;      filwr.pBuffer:=ADR('#,');      szFileSize1:=SIZEOF('#,');      filwr.szSize:=szFileSize1;      filwr.udiTimeOut:=100000;  (*100msTimeout*)      filwr(xExecute:=TRUE);      IFfilwr.xDoneTHEN        uiFileStdState:=4;      END_IF      IFfilwr.xErrorTHEN        (*errorhandling*)        ;      END_IF    4:(*closefile -TestFile.txt*)      filcl.hFile:=hFile;      filcl(xExecute:=TRUE);      IFfilcl.xDoneTHEN        uiFileStdState:=5;        filop(xExecute:=FALSE);        filcl(xExecute:=FALSE);        filwr(xExecute:=FALSE);      END_IF      IFfilcl.xErrorTHEN        (*errorhandling*)        ;      END_IF    5:(*Open-Appendmode*)      filop.sFileName:=sFileName;      filop.eFileMode:=FILE.MODE.MAPPD;      filop.xExclusive:=TRUE;      filop(xExecute:=TRUE);      IFfilop.xDoneTHEN        hFile:=filop.hFile;        uiFileStdState:=6;      END_IF      IFfilop.xErrorTHEN        (*errorhandling*)        ;      END_IF    6:(*writetextinthefile*)      filwr.hFile:=hFile;      sendText:=STANDARD.CONCAT('a',';');//<--Whydoesthisnotworking?      filwr.pBuffer:=ADR(sendText);      szFileSize1:=SIZEOF(sendText);      filwr.szSize:=szFileSize1;      filwr.udiTimeOut:=100000;  (*100msTimeout*)      filwr(xExecute:=TRUE);      IFfilwr.xDoneTHEN        IF(i<20)THEN          i:=i+1;        ELSE          uiFileStdState:=8;        END_IF        filwr(xExecute:=FALSE);      END_IF      IFfilwr.xErrorTHEN        (*errorhandling*)        ;      END_IF          8:(*closefile -TestFile.txt*)      filcl.hFile:=hFile;      filcl(xExecute:=TRUE);      IFfilcl.xDoneTHEN        filop(xExecute:=FALSE);        filcl(xExecute:=FALSE);        filwr(xExecute:=FALSE);        uiFileStdState:=9;        //i:=0;      END_IF      IFfilcl.xErrorTHEN        (*errorhandling*)        ;      END_IF    9:(*Nothing*)      ;        END_CASEEND_IF
Hi!
I am trying to write "a;" to a csv file, but the results is the picture below.
I think this is a bug. I have posted my code here. If you want to try this code. You can replace this code line
Whith your file location.
If I use this code
it will not working for me. But if I use
It works perfect. Why? It is the same if I set the code as
I get garbarge values too. Why?
Related
Talk.ru: 1
Talk.ru: 11
Talk.ru: 2
Talk.ru: 3
Talk.ru: 5
Talk.ru: 7
Talk.ru: 8
Hello!
I found the solution to this problem!
Insted of
Use
Moderator need to report this so the online help shows correct example.
Use
Moderator need to report this so the online help shows correct example.
hi
i add
sFileStringtmp:=CONCAT(sFileTestString,';');
sFileStringtmp:=CONCAT(sFileStringtmp,'$p');
but in my file data are written on a row no line feed
1.11; 0.0; 2.2;
i want :
1.11;
0.0;
2.2;
Try $N