Tricky! - I've been caught out like this before. You are extracting SEARCH.VALUE from DESC.LIST as an attribute. Try extracting values instead and I suspect all will be fine.
SEARCH.VALUE = DESC.LIST<1,PLC> Cheers Trevor Ockenden Open Systems Professionals ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, April 08, 2004 12:23 AM Subject: Subroutine string manipulation not doing what expected > Given the following snippet of code: > FOR PLC = 1 TO PART.LIST.COUNT > SEARCH.VALUE = DESC.LIST<PLC> > RETURN.VALUE := SEARCH.VALUE : @VM > NEXT PLC > ROLLSTOCK=RETURN.VALUE > > I get the following output: > P337 > P RPVC 0200x20.00 TNT201 > P BOX 19:08 15:08 13:08 > BX PLAC 20:08 15:08 11:14 > > However, a simple change to the code to only add a few digits of DESC.LIST<PLC> like so: > FOR PLC = 1 TO PART.LIST.COUNT > SEARCH.VALUE = DESC.LIST<PLC> > IF SEARCH.VALUE[1,1]='*' THEN > SEARCH.VALUE = SEARCH.VALUE[4,4] > END ELSE > SEARCH.VALUE = SEARCH.VALUE[3,4] > END > RETURN.VALUE := SEARCH.VALUE : @VM > NEXT PLC > ROLLSTOCK=RETURN.VALUE > > I get the following outupt...not what I was expecting: > 37 > P > > My intention is to grab 4 characters out of DESC.LIST<PLC>, starting at character 4 if the string starts with an asterix or 3 if it doesn't. Can anyone see what I'm doing wrong here? Thanks. > -- > u2-users mailing list > [EMAIL PROTECTED] > http://www.oliver.com/mailman/listinfo/u2-users > --- Outgoing mail is certified Virus Free by AVG 6.0. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.654 / Virus Database: 419 - Release Date: 6/04/2004 -- u2-users mailing list [EMAIL PROTECTED] http://www.oliver.com/mailman/listinfo/u2-users
