I'm sorry, I forgot to insert a smiley after the ...I think this is a "feature"...  :-)
It is not a feature, it is a "feature".
 
It is strange that this is just coming up now as it has been a problem for many
many years.  I NEVER use a VAR<-1>=ANOTHER.VAR if there is a
possibility that ANOTHER.VAR is NULL.  Always maintain a counter and
increment it.
 
X+=1; A<X>=ANOTHER.VAR
 
Louis
----- Original Message -----
Sent: Tuesday, February 03, 2004 3:00 PM
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 -----
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 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


Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now


_______________________________________________
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

Reply via email to