View Full Version : Using %EDITW()
Guest.Visitor
03-12-2002, 11:29 AM
Check out the ILE RPG Reference manual. %EDITW() is working as designed, unfortunately. To get the left sign, explicitly catenate a minus sign to the string if the number is negative. Edit words don't support leading signs. A '-' at the left of an edit word is treated as a constant character, which is not included in the result if it's to the left of the left-most digit in the result. Coding '%-' for the status of an edit word will blank out the '%' for positive values. That's the way edit words work.
bibarnes@yahoo.com
03-12-2002, 12:49 PM
Thanks for the info. I understand about the minus sign, but I can't seem to get the % sign to print on any of the values regardless of sign.
B.Morris
03-12-2002, 12:51 PM
An alternative to Hans' suggestion is to use %EDITC or %CHAR and concatenate the '%'. eval printval = %editc(value : 'P') + '%' or evalr printval = %char(value) + '%'
Guest.Visitor
03-13-2002, 04:55 AM
The '%' character should always print out fine if it is in the "expansion" part of the edit word. That is, the area to the right of the "status" or sign part of the edit word. But I like Barbara's suggestion of <code>%CHAR(num)+'%'</code> much better.
bibarnes@yahoo.com
03-13-2002, 04:55 AM
I know I'm doing something wrong but can't figure out what. I am trying to place a numeric amount in an alpha print field. The numeric field is 5/2 and shows a percentage of change. The character field is 8 long in an external print file. What I want to print is -100.00%. My edit word is '- 0. %'. What prints is 100.00. If I change the minus sign to the right side it prints, but the percent symbol never prints. What am I doing wrong? TIA Bill Barnes
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.