Can't see space char in text file..

tiagofrancistiagofrancis Member Posts: 48
I´m exporting some data to a text file, when the variable is empty or not max string length, i have to fill the variable with the space char..
The problem is that i've already did this with padstr but nothing apperared..

Comments

  • tinoruijstinoruijs Member Posts: 1,226
    Can you post the code you used?

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • XypherXypher Member Posts: 297
    In what way are you exporting the data?

    I would use FORMAT instead of PADSTR...
    DatVar := FORMAT(DatVar,MAXSTRLEN(DatVar),'<Text><Filler Character,0>');
    
  • tiagofrancistiagofrancis Member Posts: 48
    IF g_recCustomer.GET(Table91110.Empresa) THEN
    IF (g_recCustomer."Empresa Financiadora" = TRUE) THEN
    IF (g_recCustomer."Grupo TAP" = TRUE)
    THEN BEGIN

    g_EmployeeNo := Table91110."Num. Empregado";
    g_KeyString := "Num. Empregado"+"Grau de Parentesco"+"Num seq parentesco";
    g_CodUCS := Table91110."Cód. Cliente";
    FillChar;
    g_fileFicheiro1.WRITE(g_EmployeeNo+g_KeyString+g_CodUCS);

    END;


    FillChar() ---> Function
    BlankSpace := ' ';

    IF g_EmployeeNo = '' THEN
    g_EmployeeNo := PADSTR(g_EmployeeNo,MAXSTRLEN(g_EmployeeNo),BlankSpace);

    IF g_KeyString = '' THEN
    g_KeyString := PADSTR(g_KeyString,MAXSTRLEN(g_KeyString),BlankSpace);

    IF g_CodUCS = '' THEN
    g_CodUCS := PADSTR(g_CodUCS,MAXSTRLEN(g_CodUCS),BlankSpace);
  • tiagofrancistiagofrancis Member Posts: 48
    Im exporting it with a report.
  • XypherXypher Member Posts: 297
    What are you trying to achieve by putting in the buffer of blank spaces?
  • tiagofrancistiagofrancis Member Posts: 48
    NewString := PADSTR(String, Length [, FillCharacter])

    i'm trying to put the spcace char in all "positions" of the empty variable
    so i wont lose the position of the pointer in the text file.
    e.g.

    11111 22222 333333
    11111 _____ 333333

    the underscore should be the space char that happends if the variable is empty. ](*,)
  • AlbertvhAlbertvh Member Posts: 516
    Hi

    you should have

    BlankSpace := ' ';
    instead of
    BlankSpace := ' ';



    Albert

    Edit sorry the space character doesn't show in between the ''
  • BrijeshKarnatakBrijeshKarnatak Member Posts: 26
    Any one resolved this.please let me know.
    Thanks & Regards
    Brijesh Karnatak
  • rhpntrhpnt Member Posts: 688
    Im exporting it with a report.

    If you would have used a dataport as supposed to by design you wouldn't have this issue.
  • vaprogvaprog Member Posts: 1,139
    In FillChar function please remove the IF statments or change them to IF STRLEN(...) <> MAXSTRLEN(...) THEN
Sign In or Register to comment.