× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Thanks Scott, I will try this out.

-----Original Message-----
From: Scott Klement [mailto:klemscot@klements.com]
Sent: Tuesday, May 21, 2002 5:13 PM
To: Midrange - RPG (E-mail)
Subject: Re: Address fields



On Tue, 21 May 2002, Wills, Mike N. (TC) wrote:
>
> I am creating a PO and need the users would like me to scrunch the address
> together. I am not sure how to best do this. There is to 7 lines for the
> address most of the time it will only be 4.
>

I generally do it like this:

     H DFTACTGRP(*NO)

     D AddText         PR
     D   AddrLine                    50A   const

     D dsAddr          DS
     D   Addr                        50A   dim(7) overlay(dsAddr:1)
     D   PrtLine1                    50A   overlay(dsAddr:1)
     D   PrtLine2                    50A   overlay(dsAddr:51)
     D   PrtLine3                    50A   overlay(dsAddr:101)
     D   PrtLine4                    50A   overlay(dsAddr:151)
     D   PrtLine5                    50A   overlay(dsAddr:201)
     D   PrtLine6                    50A   overlay(dsAddr:251)
     D   PrtLine7                    50A   overlay(dsAddr:301)

     D CustName        S             50A
     D CustName2       S             50A
     D CustAddr        S             50A
     D CustAddr2       S             50A
     D CustAddr3       S             50A
     D CustCity        S             50A
     D CustCountry     S             50A
     D pause           S              1A

     c                   eval      CustName    = 'Mike Wills'
     c                   eval      CustName2   = *blanks
     c                   eval      CustAddr    = '123 Wills St'
     c                   eval      CustAddr2   = *blanks
     c                   eval      CustAddr3   = *blanks
     c                   eval      CustCity    = 'Somewhere, MN 56000'
     c                   eval      CustCountry = *blanks

     c                   callp     AddText(CustName)
     c                   callp     AddText(CustName2)
     c                   callp     AddText(CustAddr)
     c                   callp     AddText(CustAddr2)
     c                   callp     AddText(CustAddr3)
     c                   callp     AddText(CustCity)
     c                   callp     AddText(CustCountry)

     c     PrtLine1      dsply
     c     PrtLine2      dsply
     c     PrtLine3      dsply
     c     PrtLine4      dsply
     c     PrtLine5      dsply
     c     PrtLine6      dsply
     c     PrtLine7      dsply                   pause

     c                   eval      *inlr = *on

     P AddText         B
     D AddText         PI
     D   AddrLine                    50A   const
     D NumLines        S             10I 0 static
     c                   if        AddrLine <> *blanks
     c                   eval      NumLines = NumLines + 1
     c                   eval      Addr(NumLines) = AddrLine
     c                   endif
     P                 E

_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.