Author |
Message
|
raghubegur |
Posted: Mon Apr 12, 2004 6:40 am Post subject: Comparison with ' ' (SPACE) |
|
|
Apprentice
Joined: 15 Jul 2002 Posts: 45
|
Hi,
We have a CWF Input MRM where some of the fields get spaces as their values from the input message.
To test if a particular field is filled with spaces, we used to do the TRIM and see if the result is NULL. That worked as expected.
But this also worked :
IF "InputBody"."MessageType1"."Field_x = ' '
then Field_x is filled with spaces irrespective of the length of the Field_x.
Can some one explain how this comparison with ' ' works ?
How is the comparison with fields greater than length 1 succeeding ? _________________ Cheers
Raghu |
|
Back to top |
|
 |
Missam |
Posted: Mon Apr 12, 2004 10:39 am Post subject: |
|
|
Chevalier
Joined: 16 Oct 2003 Posts: 424
|
May be the logical thinking of bunch of spaces alone is no way different than a single space leads to design the MRM like that.
I found the same thing as you when i'm working with TDS fixed length.
But the diiference is mine have a output MRM(TDS) format data.
i had a fixed length element of lets say 10.when i issue a statement like this
SET OutputRoot.MRM.Message.Field1 = ' ';
the output represents that the entire field length of 10 spaces.
because i want my work done by this.i didn't thought of digging into that. |
|
Back to top |
|
 |
kimbert |
Posted: Tue Apr 13, 2004 1:11 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
In CWF and TDS, trimming is applied to input fields based on two properties:
CWF : String Justification and Padding Character
TDS : Justification and Padding Character
So your input fields may be getting trimmed automatically before they are put into the message tree. Check your CWF settings to see whether this is the case.
For TDS, the default padding character is SPACE, so that explains why Sam has seen his strings being trimmed automatically. |
|
Back to top |
|
 |
wooda |
Posted: Tue Apr 13, 2004 1:46 am Post subject: |
|
|
 Master
Joined: 21 Nov 2003 Posts: 265 Location: UK
|
As kimbert said.
Only one correction.
Unlikme CWF, in TDS trimming does NOT happen automaticaly.
Trimming only occurs if the message set level TDS property
'Trim Fixed Len String' is not set to 'No Trim'.
The default value is 'No Trim'
And only one of the possible values will cause padding characters to be trimmed. 'Trim Padding chars'.
Other settings allow leading and/or trailing whitespace to be trimmed regardless of padding character. |
|
Back to top |
|
 |
raghubegur |
Posted: Tue Apr 13, 2004 10:54 am Post subject: |
|
|
Apprentice
Joined: 15 Jul 2002 Posts: 45
|
Thanks for the information.
If the input field is coming as spaces, the default trimming and padding make it equal to a ' '(single space).
Now if I move this value into an output field with length > 1 and "no padding", I should expect CWF errors.
I am away from my control center. I cannot test this today. _________________ Cheers
Raghu |
|
Back to top |
|
 |
|