Zero Filled Integers

Tyler tyler.style at gmail.com
Tue Feb 27 07:48:33 PST 2007


If I only need them for a quick export or somesuch, I'm rather fond of
the following:

::qq=(REPEAT("0",((FIELDLEN(file,"1"))-(DLEN(""{file(1){""))))){file(1)

(qq isn't explicitly defined)

Doesn't require a special edit, or for you to know the length of the
edit.  Could easily turn it into a subroutine if you assign the field#
and field value to variables instead of directly referencing them, and
didn't explicitly define the variable holding the field value:

::bb=file(1)
::aa(4,.0)=(FIELDLEN(file,"1"))
::gosub zeroPad
::msgbox ""{qq{''"
::end
zeroPad::qq=(REPEAT("0",(aa-(DLEN(""{bb{""))))){bb
::return

> Date: Mon, 26 Feb 2007 23:28:57 -0500
> From: "J. Ryan Kelley" <ryan.kelley at trinitytransport.com>
> Subject: Zero Filled Integers
> To: fplist2 <filepro-list at seaslug.org>
> Message-ID: <45E3B389.8000602 at trinitytransport.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Is there an edit type to create zero filled integers?  I have an EDI
> transaction that requires that certain integer fields are zero filled.
> eg the value '600' in a 6 digit field would need to be passed as '0006000'.
>
> Filepro 5.0.13R4 on Solaris
>
> --
> J. Ryan Kelley
> Business Technology
> Trinity Transport, Inc.
> (302)253-3900 ext. 3844
>
> http://www.trinitytransport.com
>
>
>


More information about the Filepro-list mailing list