changing the ZP value dynamically

hi there,
i wonder if someone can help please.
i’d like to know if it is possible to change the ZP (zero print) value on a MAP dynamically.
i have a map with a numeric field on it and i have ZP=off for this field.
this map is used to insert a new record and also to update an existing one.
if i’m inserting a record, i’d like zp=off because i don’t want to display a screen with a zero on the numeric field since the record doesn’t exist yet.
however, this field is not mandatory: the user may leave it as zero and proceed the writing of the record.
now, if i’m updating an existing record whose numeric field was left 0 during its insertion, i’d like zp=on for i want the 0 displayed on the screen.
thanks for any help.

Not possible, I’m afraid, when you look at a map source you will see something like this

FORMAT PS=026 LS=132 ZP=OFF SG=OFF KD=OFF IP=OFF                        
* MAP2: MAP PROFILES *****************************        410***********
* .TTAAAMMOO   D I D I N D I D I        ?_)^&:+(                       *
* 026131        N0NNUCN             X        01 SYSPROF NL             *
INPUT          (     IP=OFF                                           /*
 002T #ZPP  (AD=MDLT ZP=ON ) /*.99U006 N06.0           .

So there is a FORMAT ZP= generated based on the map profile,
plus ZP overrides based on field attributes, but none of them is
dynamically modifiable.

So you’ll probably have to duplicate the map and trigger one or the other
based on if it is a new record or not.

thank you a lot.

In our shop, we never use numeric input fields on a map. Input is always through an alpha field so that the program can control the auditing and the message that is returned to the user. Using an alpha on your map will give you the flexibility that you are looking for.

We have the same standard in our shop as Jerome mentioned. This extends also to fields that are date, time or logical as well as numerics. We believed end-users should see a more friendly message instead of NATxxxx messages. You just have to remember to assign your variables before the map and your database fields after (after passing REINPUT validation).

hey guys,
it’s been a while since i last coded a natural application and i’m surprised how it is easy to forget things.
as suggested, i used alpha fields and the ‘‘move edited’’ statement and things worked fine.
thanks a lot for the tips!

Usually I’ll code a combination of IS and VAL rather than a MOVE EDITED.

IF   #ALPHA IS (N5.2)
 AND #ALPHA <> ' '


But I have to admit: A dynamic ZP would be very helpful - e.g. for output-protected-fields.