One easy way I sometimes use is to just concatenate a field mark along with
the new value and then remove the first field mark at the end... eg.
 
A = ""    
LOOP
   INPUT B
   A := @FM:B
UNTIL condition
REPEAT
A = A[2,LEN(A)-1]
 
AdrianW

-----Original Message-----
From: Marco Manyevere [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 3 February 2004 15:00
To: U2 Users Discussion List
Subject: Re: VARIABLE<-1> = '' Inconsistent behaviour


OK the documentation for REPLACE says something about inserting empty
strings. For information flavour it does say the @FM will be added for empty
strings without making a distinction between adding to an empty or non empty
array.
 
If this is a feature then it implies major code revisions for me whereever I
use the <-1> construct. What would be the shortest/smartest way of adding
strings including non significant nulls? I hate to do:
 
A = ''
....
....
INPUT B;  * May be empty
IF LEN(B) THEN
   A<-1> = B
END ELSE
   IF LEN(A) THEN
      A<-1> = B
   END ELSE
      A = @FM
   END
END

I have also tested
 
A<1> = ''
A<2> = ''
A<3> = 3
A<4> = ''
A<5> = 5
 
and it inserts the @FM as expected but this involves maintaining a counter
for the dynamic array.

Louis Windsor <[EMAIL PROTECTED]> wrote:

I think this is a "feature".
 
Universe does NOT insert non-significant nulls.  In other words your first
two 
(A<-1> = '') do not do anything!  It is consistent in its' behaviour as you
can
count on it to do the above.  It has done this as long as I remember.
 
I found this out through bitter experience.
 
Louis
 

----- Original Message ----- 
From: Marco  <mailto:[EMAIL PROTECTED]> Manyevere 
To: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>  
Sent: Tuesday, February 03, 2004 12:55 PM
Subject: VARIABLE<-1> = '' Inconsistent behaviour

Hi All,
 
Consider the program:
 
A = ''
A<-1> = ''
A<-1> = ''
A<-1> = 3
A<-1> = ''
A<-1> = 4
PRINT A<3>
 
I expect it output '3' but it outputs '4'. Whats the explanation? I'm on UV
9.6 [NT] running information flavour.
 
Regards,
Marco
 



   _____  

BT Yahoo! Broadband - Free modem offer, sign
<http://uk.rd.yahoo.com/evt=21064/*http://btyahoo.yahoo.co.uk> up online
today and save 80 



   _____  




_______________________________________________
u2-users mailing list
[EMAIL PROTECTED]
http://www.oliver.com/mailman/listinfo/u2-users


_______________________________________________
u2-users mailing list
[EMAIL PROTECTED]
http://www.oliver.com/mailman/listinfo/u2-users




   _____  

 
<http://uk.rd.yahoo.com/mail/tagline_messenger/*http://uk.messenger.yahoo.co
m> Yahoo! Messenger - Communicate instantly..."Ping" your friends today!
<http://uk.rd.yahoo.com/mail/tagline_messenger/*http://uk.messenger.yahoo.co
m/download/index.html> Download Messenger Now

Disclaimer.  This e-mail is private and confidential. If you are not the
intended recipient, please advise us by return e-mail immediately, and
delete the e-mail and any attachments without using or disclosing the
contents in any way. The views expressed in this e-mail are those of the
author, and do not represent those of this company unless this is clearly
indicated. You should scan this e-mail and any attachments for viruses. This
company accepts no liability for any direct or indirect damage or loss
resulting from the use of any attachments to this e-mail.
_______________________________________________
u2-users mailing list
[EMAIL PROTECTED]
http://www.oliver.com/mailman/listinfo/u2-users

Reply via email to