[SPAM] - Removing Leading Zeroes - Sender is forged (SPF Fail)
Pickering, John (NORBORD)
John.Pickering at norbord.com
Wed Apr 16 09:52:35 CDT 2008
I can't think of a "good method" (meaning "elegant") that works across
all three components. If this is Quick then I'd use a FOR loop and
examine the first character, dropping a single leading zero each time
through the loop. If this is Qtp then I'd use a TEMP item and a series
of 8 ITEM statements, all the same, dropping a single leading zero in
each one. If this is Quiz then I'd use a series of defines to drop a
single leading zero in each one.
The Quiz answer has the advantage of working in all three components.
; consider your item is called XXX, char*8
Define d-xxx-1 char*8 = XXX[2:7] if "0" = XXX[1:1] else XXX
Define d-xxx-2 char*8 = d-xxx-1[2:7] if "0" = d-xxx-1[1:1] else d-xxx-1
Define d-xxx-3 char*8 = d-xxx-2[2:7] if "0" = d-xxx-2[1:1] else d-xxx-2
Define d-xxx-4 char*8 = d-xxx-3[2:7] if "0" = d-xxx-3[1:1] else d-xxx-3
Define d-xxx-5 char*8 = d-xxx-4[2:7] if "0" = d-xxx-4[1:1] else d-xxx-4
Define d-xxx-6 char*8 = d-xxx-5[2:7] if "0" = d-xxx-5[1:1] else d-xxx-5
Define d-xxx-7 char*8 = d-xxx-6[2:7] if "0" = d-xxx-6[1:1] else d-xxx-6
Define d-xxx-8 char*8 = d-xxx-7[2:7] if "0" = d-xxx-7[1:1] else d-xxx-7
Ugly - but it works!
Regards,
JWP
________________________________
From: powerh-l-bounces+john.pickering=norbord.com at lists.sowder.com
[mailto:powerh-l-bounces+john.pickering=norbord.com at lists.sowder.com] On
Behalf Of Rohde, Dirk
Sent: Tuesday, April 15, 2008 7:09 PM
To: PowerHouse Listserver
Subject: [SPAM] - Removing Leading Zeroes - Sender is forged (SPF Fail)
Does anybody have a good method for removing leading zeroes from an
eight character field, given that the value is not necessarily numeric?
Although we have the zerofill function to add leading zeroes, there does
not seem to be a function to remove them.
Dirk Rohde
VantagePoint Systems, Inc
T: 604-678-0336 or 604-685-4209 x 239
F: 604-685-4186
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.sowder.com/pipermail/powerh-l/attachments/20080416/6f124df2/attachment.htm
More information about the powerh-l
mailing list