Mike: Success. Lifesaver. Thank you very much.
Your code also generalizes easily for use in WHILE loops and CURSORs
(which is where I'm at):
All the best,
------ Original Message ------
From "baue...@gmail.com" <bauer...@gmail.com>
To "RBASE-L" <rbase-l@googlegroups.com>
Date 1/22/2024 7:22:52 AM
Subject [RBASE-L] - Re: Mailing Address Line Feed Fail
I use stored procedure to build address of varying lines:
[Begin SP]
*(sp_Addr mod 011505 mbyerley)
*(Use only 2 Ret VarNames vRetText and vRetInt)
*(Input Params should be of: pt1,pt2, for text pi1,pi2 for Int)
CLEAR VAR MICRORIM_RETURN, stp_return
SET VAR pt1 TEXT
SET VAR vcr = ((CHAR(13)) + (CHAR(10)))
SELECT mainname, address1, address2, city, statename, zipcode, zipplus
+
INTO vspmainname IND vspin0, vrettextess1 IND vspin0, vrettextess2 IND
vspin0, +
vspcity IND vspin0, vspstatename IND vspin0,vspzipcode IND vspin0, +
vspzipplus IND vspin0 +
FROM vwcontacts WHERE (cid = .pt1)
IF SQLCODE = 0 THEN
SET VAR vrettext = .vspmainname
IF vrettextess1 <> NULL OR (SLEN((STRIM(.vrettextess1)))) > 0 THEN
SET VAR vrettext = (.vrettext + .vcr + .vrettextess1)
ENDIF
IF vrettextess2 <> NULL OR (SLEN((STRIM(.vrettextess2)))) > 0 THEN
SET VAR vrettext = (.vrettext + .vcr + .vrettextess2)
ENDIF
IF vspcity <> NULL OR (SLEN((STRIM(.vspcity)))) > 0 THEN
SET VAR vrettext = (.vrettext + .vcr + .vspcity)
ENDIF
IF vspstatename <> NULL OR (SLEN((STRIM(.vspstatename)))) > 0 THEN
SET VAR vrettext = (.vrettext + ' ' + .vspstatename)
ENDIF
IF vspzipcode <> NULL OR (SLEN((STRIM(.vspzipcode)))) > 0 THEN
SET VAR vrettext = (.vrettext + ' ' + .vspzipcode)
ENDIF
IF vspzipplus <> NULL OR (SLEN((STRIM(.vspzipplus)))) > 0 THEN
SET VAR vrettext = (.vrettext + '-' + .vspzipplus)
ENDIF
ELSE
SET VAR vrettext = 'No Address Entry'
ENDIF
Clear Var pt1
CLEAR VAR vspin0,vspcity,vspstatename,vrettextess1,vrettextess2, +
vspmainname,vspzipcode,vspzipplus
RETURN .vrettext
[End SP]
On Sunday, January 21, 2024 at 8:31:31 PM UTC-5 Bruce Chitiea wrote:
All:
I need to concatenate mailing addresses with variable line counts, for
envelope printing. For example:
Addressee
StreetAddress
CityStateZip
or:
Addressee
Department
Corporation
StreetAddress
CityStateZip
A Report Variable is placed within the Page Header of a table-bound
Report to serve as the printing breakpoint.
Simplified to focus just on line feeding[1] (ignoring the IFNULLing
required for variable line counts), the variable:
( Addressee + (CHAR(013)) + Department + (CHAR(013)) + Corporation +
(CHAR(013)) + StreetAddress + (CHAR(013)) + CityStateZip )
... produces this string, exactly where the address should be, one per
envelope:
AddresseeStreetAddressCityStateZip
or:
AddresseeDepartmentCorporationStreetAddressCityStateZip
Thoughts? And thanks.
Bruce A. Chitiea
SafeSectors, Inc.
1142 S Diamond Bar Blvd # 442
Diamond Bar CA 91765-2203
rby...@safesectors.com
(909) 238-9012 <tel:(909)%20238-9012> m
[1] This has also been attempted with (CHAR(013)) + (CHAR(010)) . No
change.
--
For group guidelines, visit
http://www.rbase.com/support/usersgroup_guidelines.php
---
You received this message because you are subscribed to the Google
Groups "RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to rbase-l+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/rbase-l/0f9bf06b-5b19-496e-be55-9f5ec4692979n%40googlegroups.com
<https://groups.google.com/d/msgid/rbase-l/0f9bf06b-5b19-496e-be55-9f5ec4692979n%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
For group guidelines, visit
http://www.rbase.com/support/usersgroup_guidelines.php
---
You received this message because you are subscribed to the Google Groups "RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to rbase-l+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/rbase-l/emde3d2261-e458-4c8b-8ffc-b84bbbef4bd3%40daaf866b.com.