[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: Wrap functionality question
- Subject: Re: Wrap functionality question
- From: Francois Béliveau <sabrosafb@HOTMAIL.COM>
- Date: Fri, 23 Aug 2002 14:52:27 +0000
Hi,
What you should do is calculate the lines your remark will take in it's
wrap. Let's say the remark is 200 char long. Knowing the line is 100 char
long, just do the calculation:
round(length of the remark / 100) * 10 = Number of line you should add to
your begin_remark variable. You round it because if you get something like
250/100= 2.5, you actually have to jump 3 lines. Use the length() function
to get the length of the remark field. Your code should look like this:
begin-procedure remarks
let #begin_remarks = 390
begin-select
a.remarks &remarks
print &remarks (#begin_remarks, 25) wrap 100 4 line-height=10
let #linesToJump = round(length(&remarks) / 100) * 10
let #begin_remarks = #begin_remarks + #linesToJump
from mf_pr a
where a.uidy = $input_uidy
end-select
end-procedure
Pay attention to the round() function, can't remember if it's round() or
rnd(). Well, this should work. Give some news!
>From: Poonam Auluck <poonam.auluck@AMS.COM>
>Reply-To: sqr-users@list.iex.net
>To: SQR-USERS@list.iex.net
>Subject: Wrap functionality question
>Date: Mon, 22 Jul 2002 17:19:35 -0400
>
>HI All -
>
>I'm new to SQR and new to this group..this is a great site...I've already
>answered so many of my questions by searching the archives!!
>Hopefully, my question will be easy for some of you.
>
>I have one field called remarks, which is 255 characters. I'm unsure of
>how many spaces user will fill in. There are three rows that I am pulling
>from my DB that I want to combine all the remarks together.
>
>My code looks something along these lines....
>
>begin-procedure remarks
>let #begin_remarks = 390
>begin-select
>a.remarks &remarks
> print &remarks (#begin_remarks, 25) wrap 100 4 line-height=10
> let #begin_remarks = #begin_remarks + 10
>from mf_pr a
>where a.uidy = $input_uidy
>end-select
>end-procedure
>
>I identified #begin_remarks = 390 in the beginning because I want to have
>all the remarks from the three rows printed out together. If I hardcoded
>it in my select statement, I would have the three remarks printed out on
>top of each other. That's why I put the let #begin_remarks =
>#begin_remarks + 10 statement, so that for each record it picks up, the
>remarks will begin printing on the next line. I had to put the wrap
>statement in because of the 255 characters. My space alloted for the
>remarks section doesn't have enough to fit 255 in one line.
>
>The problem is that it will print out the remarks fine for the first
>record, but then it will overlap the beginning of the second remark onto
>the wrapped text from the previous record. Does that make sense?? I guess
>I'm wondering how to incorporate adding the lines wrapped so that it will
>advance nicely on the report.
>
>Any suggestions?? Any help is apprecited :o)
>
>Thanks,
>Poonam Auluck
_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail.
http://www.hotmail.com