Home RAP
New Blog Posts: Merging Reports - Part 1 and Part 2

Adding new lines with CR/LF

edited April 2005 in RAP
Hello,
We use RB for building data files for all sorts of puposes.
Often we need to add padding lines. I haven't been able to get CRLF to
work consitently.

Our files are fixed lenght text files. So as an example, suppose the
a field within the Detail band tries to add a couple of padding lines as in:

procedure variable3oncalc(var value: variant);
var
i: integer;
begin
value:='';
for i:=1 to 5 do
begin
value:= value+ chr(10)+chr(13)+'9999999999999';
end;
end;

The above does not seem to kick ANY new lines when printed to file.
However a simple,

value:= chr(10)+chr(13)+'9999999999999';

does work - kicking a new line and putting nines on that line.

What am I missing ?

thanks,

tonyM


ps: allthough LF, then CR, seems non-standard it is the only combo
I found that would kick at all...

Comments

  • edited April 2005

    Sometimes RAP has issues parsing nested expressions. The work around is to
    use some intermediate variables (either local or global).

    I tried the following test and it worked in my testing.

    1. Declare two RAP global variables:

    CR: char;
    LF: char;

    2. In the Global OnCreate event, initialize them

    CR := chr(13);
    LF := chr(10);

    3. And then use the Report OnSaveText event

    Text := Text + CR + LF;




    --
    Nard Moseley
    Digital Metaphors Corporation
    http://www.digital-metaphors.com


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.