Posted: Fri Feb 23, 2007 8:33 am Post subject: Padding Problem
Centurion
Joined: 21 Jul 2005 Posts: 115
Hi I have a Messages A and B ( Both Fixed Length), The following are the structures.
Message A has fields
field1 - length 4 data type String left padding zero
field2 - length 4 data type String left padding zero
Message B has field
field3 Length 8 data type String.
I want to populate the field3 in Message B with the values of field1 and field2
when i send the field1 with data 01(With 2 spaces) and field2 with data 02 (With 2 spaces) and populate the field3 it shows as below
01 02
Its not padding with zeros...
Can anybody tell me how to pad with zeros.
Regards
Nik
- Set the message set property 'Tim Fixed Length String' to 'Trim both'. That will get the leading spaces removed.
- Model your fields as xsd:integer instead of xsd:string. They will be successfully parsed as '1' and '2' in the message tree ( now that the spaces have been removed).
- Split your 8-character output field into two integer fields with length 4.
The end result should be '00010002' in the output bitstream.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum