Return to the RPG Tips
Moving a Character Field
http://www.as400network.com/nwn/story.cfm?ID=10484
Sometimes you must move a long character field to another field that's not as long. But when doing so, how do you check whether any of the data in the long field will be truncated? You can check this using the following command:
FieldA 30/A FieldB 20/A C If %len( %trimR( FieldA )) > %len( FieldB ) C * Signal error C Else C Eval FieldB = FieldA C EndIfIf you ever change the length of either FieldA or FieldB, you simply recompile your program, and the code will still work.
-- Jan Jorgensen, Programmer, Electrolux Nyborg A/S
[report a broken link by clicking here]