palmtree with sun behind it CONTACT US
Phone: (412) 835-9417
Email: sales@vss3.com

TIP # 17 - Right Justify - Zero Fill

I often have sent this edit to people to solve the problem with zero fill/right justify.

filePro has an edit called "rj0" it will do the following:

I will simulate the data between quotes to help you visualize position.

"1     " - I type the data like this and press ENTER - the edit will change it to "        1"

"     1" - I type the data like this and press ENTER - the edit will change it to "00001"


Now since I use this in a data entry mode to right justify and zero pad, it was not helpful to make the edit process twice to get results. So I developed the following edit. This will work the first time.

rj1 \ N | <"0">

rj2 \ N N | <0> rj1

rj3 \ N N N | <0> rj2

rj4 \ N N N N | <0> rj3

rj5 \ N N N N N | <0> rj4

rj6 \ N N N N N N | <0> rj5

rj7 \ N N N N N N N | <0> rj6

rj8 \ N N N N N N N N | <0> rj7

rj9 \ N N N N N N N N N | <0> rj8

rj10 \ N N N N N N N N N N | <0> rj9

rj11 \ N N N N N N N N N N N | <0> rj10

Add the lines to your edit table. Then use the correct edit for the length of the field.

For example, if the field length is 5 use the edit called rj5.

Add more lines in the same pattern if you need a longer field.


Written by Nancy Palmquist

Copyright, 1998 by Virtual Software Systems.  All rights reserved.

Contact Us by: Email to Virtual Software Systems or Phone: (412) 835-9417