RE: [U2] Changed BASIC varname1,-1

2006-07-21 Thread David A. Green
Easier to read, but ABSOLUTLEY the slowest method, ok for small arrays that
get assembled or disassembled once during execution, but if you are in a
loop or if your arrays can be big use -1 and REMOVE.

David A. Green
DAG Consulting

 I always use   A.VAR :=
 @AM[1,NOT(NOT(A.VAR))]:NEW.DATA
 It is much more reliable and much quicker than -1

This is probably for people who want the position of
the item in the list to be significant. (The empty
values being wanted)  I find the code is easier on the
eyes to do:

NB +=1
A.VARNB = NEW.DATA



__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Changed BASIC varname1,-1

2006-07-20 Thread Jacques G.
 I always use   A.VAR :=
 @AM[1,NOT(NOT(A.VAR))]:NEW.DATA
 It is much more reliable and much quicker than -1

This is probably for people who want the position of
the item in the list to be significant. (The empty
values being wanted)  I find the code is easier on the
eyes to do:

NB +=1
A.VARNB = NEW.DATA



__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Changed BASIC varname1,-1

2006-07-19 Thread Allen E. Elwood
Reviving an old thread.

I was emailing a friend about this and he came up with a unique suggestion
that is a direct replacement for the -1 but actually works as desired.
And I've wiped out the original post, so I'm not sure who originated it.
But if you're still out there and still looking for an easier route, this
may do it for you.

I got bit by the -1 bug today in mvBase and already had it changed to a
direct assignment when Trey sent this to me.  So if you're using mvBase,
beware the -1 'bug' lives there as well.  fwiw...


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 19, 2006 13:53
To: Allen E. Elwood


I always use   A.VAR := @AM[1,NOT(NOT(A.VAR))]:NEW.DATA
It is much more reliable and much quicker than -1

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Allen E. Elwood
Sent: Tuesday, May 23, 2006 10:44
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Changed BASIC varname1,-1


Oh yeah, sure.  I agree.  Using LOCATE or FOR/NEXT is my preferred method,
but the -1 does come in handy in some cases, and actually was the main
point of the original posting (see bottom in case you weren't following this
thread)
snip

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Kevin King
Sent: Tuesday, May 23, 2006 10:09
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Changed BASIC varname1,-1


If you want them to stay in sync, keep a pointer variable and update
each multivalue in tandem using the variable (which points to the mv
position) rather than use -1.  Personally, I think -1 is fine if
there's only one array; if there are multiple to keep in tandem -1 is
a yellow flag, fraught with all sorts of impending data corruption.


-Kevin
[EMAIL PROTECTED]
http://www.PrecisOnline.com

-Original Message-

snip
Previously, code of A1,-1 = B, when B was blank made no change to
A.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Changed BASIC varname1,-1

2006-07-19 Thread Allen E. Elwood
Well, you know they say one man's bug is another man's feature (or Woman)!

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Kate Stanton
Sent: Wednesday, July 19, 2006 14:59
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] Changed BASIC varname1,-1


This is not a bug - it is a feature that has been available for over 20
years that I know about.

A-1 = B does not change A if B is blank.  Means there are no blank items
in A.  Useful!

- Original Message -
From: Allen E. Elwood [EMAIL PROTECTED]
To: u2-users@listserver.u2ug.org
Sent: Thursday, July 20, 2006 9:16 AM
Subject: RE: [U2] Changed BASIC varname1,-1


 Reviving an old thread.

 I was emailing a friend about this and he came up with a unique suggestion
 that is a direct replacement for the -1 but actually works as desired.
 And I've wiped out the original post, so I'm not sure who originated it.
 But if you're still out there and still looking for an easier route, this
 may do it for you.

 I got bit by the -1 bug today in mvBase and already had it changed to a
 direct assignment when Trey sent this to me.  So if you're using mvBase,
 beware the -1 'bug' lives there as well.  fwiw...


 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 19, 2006 13:53
 To: Allen E. Elwood


 I always use   A.VAR := @AM[1,NOT(NOT(A.VAR))]:NEW.DATA
 It is much more reliable and much quicker than -1

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of Allen E. Elwood
 Sent: Tuesday, May 23, 2006 10:44
 To: u2-users@listserver.u2ug.org
 Subject: RE: [U2] Changed BASIC varname1,-1


 Oh yeah, sure.  I agree.  Using LOCATE or FOR/NEXT is my preferred method,
 but the -1 does come in handy in some cases, and actually was the main
 point of the original posting (see bottom in case you weren't following
 this
 thread)
 snip

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of Kevin King
 Sent: Tuesday, May 23, 2006 10:09
 To: u2-users@listserver.u2ug.org
 Subject: RE: [U2] Changed BASIC varname1,-1


 If you want them to stay in sync, keep a pointer variable and update
 each multivalue in tandem using the variable (which points to the mv
 position) rather than use -1.  Personally, I think -1 is fine if
 there's only one array; if there are multiple to keep in tandem -1 is
 a yellow flag, fraught with all sorts of impending data corruption.


 -Kevin
 [EMAIL PROTECTED]
 http://www.PrecisOnline.com

 -Original Message-

 snip
Previously, code of A1,-1 = B, when B was blank made no change to
 A.
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Changed BASIC varname1,-1

2006-07-19 Thread Ray Wurlod
$OPTIONS EXTRA.DELIM as needed (UniVerse at least)
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Changed BASIC varname1,-1

2006-05-24 Thread Kate Stanton
IIRC, INFORMATION was the same as PICK used to be: varname1,-1 = x when x 
was blank did not add a value mark, whatever the contents of varname.  If 
INFORMATION now does as you say, then some time in the last 20+ years it 
changed.


My problem is that it has changed!

- Original Message - 
From: Anthony Youngman [EMAIL PROTECTED]

To: u2-users@listserver.u2ug.org
Cc: Kate Stanton [EMAIL PROTECTED]
Sent: Wednesday, May 24, 2006 10:19 PM
Subject: RE: [U2] Changed BASIC varname1,-1


Nobody seems to have mentioned the logic ...

Again, I can't speak for Pick behaviour, but in INFORMATION and its
derivatives

-1 puts the new data in a new (sub)field at the end. If it's adding to
an empty string it assumes there is no existing field and puts the new
data in (sub)field 1. Of course, if the new data is the empty string ...
you can guess what happens.

So if I start with an empty string and append a bunch of empty strings
using -1, I will end up with the empty string. But if I have ANYthing in
that string to start with, adding an empty string will result in a new
delimiter and empty string being appended.

X = @VM
X1,-1 = 

now gives me X equal to @VM:@VM

But
X = 
X1,-1 = 

leaves me with X still equal to 

Cheers,
Wol

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Kate Stanton
Sent: 23 May 2006 23:26
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] Changed BASIC varname1,-1

Thanks Ray.

We have (stupidly, it seems) relied on the -1 behaviour, using it when I

want to add a subfield if there is data, but not to add a blank
subfield.

I shall report this as a bug, but if the change in behaviour of user
number
is any guide, I don't expect much response. (sigh!)

Cheers,  Kate

- Original Message - 
From: Ray Wurlod [EMAIL PROTECTED]

To: u2-users@listserver.u2ug.org
Sent: Tuesday, May 23, 2006 6:51 PM
Subject: Re: [U2] Changed BASIC varname1,-1



It's been around for a long time, which is why $OPTIONS EXTRA.DELIM
exists.  I don't often work in Pick flavor, so can't speak

authoritatively

as to what proper default behaviour ought to be.  But what you

describe

is, was, and should be the default behaviour in the non-Pick flavors.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

*  *

This transmission is intended for the named recipient only. It may contain 
private and confidential information. If this has come to you in error you 
must not act on anything disclosed in it, nor must you copy it, modify it, 
disseminate it in any way, or show it to anyone. Please e-mail the sender to 
inform us of the transmission error or telephone ECA International 
immediately and delete the e-mail from your information system.


Telephone numbers for ECA International offices are: Sydney +61 (0)2 8272 
5300, Hong Kong + 852 2121 2388, London +44 (0)20 7351 5000 and New York +1 
212 582 2333.


*  * 
---

u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Changed BASIC varname1,-1

2006-05-23 Thread Ray Wurlod
It's been around for a long time, which is why $OPTIONS EXTRA.DELIM exists.  I 
don't often work in Pick flavor, so can't speak authoritatively as to what 
proper default behaviour ought to be.  But what you describe is, was, and 
should be the default behaviour in the non-Pick flavors.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Changed BASIC varname1,-1

2006-05-23 Thread Bruce Nichol

Goo'day, Kate,

At 17:56 23/05/06 +1200, you wrote:


Previously, code of A1,-1 = B, when B was blank made no change to A.
Now a value mark is added.  If the last char is a value mark, it doesn't add
another one.
I consider this a bug, as it changes old behaviour.
Does anyone but me think this is a problem?


Just quickly... IIRC, somebody mentioned a UV OPTION to give you either 
which way... Last week or so. Sorry, but check the archives


And some people say various LOCATEs are a problem but I find this 
inserting a null to be a bigger bugger



Using Universe 10.1.18 PICK flavour on Windows.

Kate Stanton
Walstan Systems Ltd
4 Kelmarna Ave, Herne Bay, Auckland, New Zealand
Phone +64 9 360 5310
Fax +64 9 376 0750
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/



--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.1.392 / Virus Database: 268.7.0/345 - Release Date: 22/05/06


Regards,

Bruce Nichol
Talon Computer Services
ALBURYNSW 2640
Australia

http://www.taloncs.com.au

Tel: +61 (0)411149636
Fax: +61 (0)260232119

If it ain't broke, fix it till it is! 



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.392 / Virus Database: 268.7.0/345 - Release Date: 22/05/06
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Changed BASIC varname1,-1

2006-05-23 Thread Allen E. Elwood
Hi Guys,

Wellfwiw...I consider this correct.

If I have multiple variable dataset that I'm creating I want them to stay in
synch even if one of them is blank.

i.e.

ITEM.SHIPPED1,-1  = REC1
QTY.SHIPPED1,-1   = REC2
HANDLING.CODE1,-1 = REC3

Lets say that there was no special handling code on the third iteration.
Now my forth iteration DOES have a special handling code, but now it would
appear as if it belonged to the third, not the forth item.

I would have to
ITEM.SHIPPED1,-1  = REC1
QTY.SHIPPED1,-1   = REC2
IF REC3 =  THEN
  HANDLING.CODE1,-1 := REC3
END ELSE
  HANDLING.CODE1,-1 = REC3
END

Which adds a lot of bulk to the code, especially if I have a lot of
variables to build.

Oh Well, you know that they say...One man's bug is another man's feature!

(Or woman!)


Allen E. Elwood
www.tortillafc.com

Quality Code Since 1978

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Bruce Nichol
Sent: Tuesday, May 23, 2006 00:02
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] Changed BASIC varname1,-1


Goo'day, Kate,

At 17:56 23/05/06 +1200, you wrote:

Previously, code of A1,-1 = B, when B was blank made no change to A.
Now a value mark is added.  If the last char is a value mark, it doesn't
add
another one.
I consider this a bug, as it changes old behaviour.
Does anyone but me think this is a problem?

Just quickly... IIRC, somebody mentioned a UV OPTION to give you either
which way... Last week or so. Sorry, but check the archives

And some people say various LOCATEs are a problem but I find this
inserting a null to be a bigger bugger

Using Universe 10.1.18 PICK flavour on Windows.

Kate Stanton
Walstan Systems Ltd
4 Kelmarna Ave, Herne Bay, Auckland, New Zealand
Phone +64 9 360 5310
Fax +64 9 376 0750
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/



--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.1.392 / Virus Database: 268.7.0/345 - Release Date: 22/05/06

Regards,

Bruce Nichol
Talon Computer Services
ALBURYNSW 2640
Australia

http://www.taloncs.com.au

Tel: +61 (0)411149636
Fax: +61 (0)260232119

If it ain't broke, fix it till it is!


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.392 / Virus Database: 268.7.0/345 - Release Date: 22/05/06
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Changed BASIC varname1,-1

2006-05-23 Thread Allen E. Elwood
Oops, should have been 

  HANDLING.CODE1,-1 := @VM

Gosh, a bug in an example, how embarrassing ;-)
-Original Message-
snip
I would have to
ITEM.SHIPPED1,-1  = REC1
QTY.SHIPPED1,-1   = REC2
IF REC3 =  THEN
  HANDLING.CODE1,-1 := REC3
END ELSE
  HANDLING.CODE1,-1 = REC3
END
snip
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Changed BASIC varname1,-1

2006-05-23 Thread Kevin King
If you want them to stay in sync, keep a pointer variable and update
each multivalue in tandem using the variable (which points to the mv
position) rather than use -1.  Personally, I think -1 is fine if
there's only one array; if there are multiple to keep in tandem -1 is
a yellow flag, fraught with all sorts of impending data corruption. 


-Kevin
[EMAIL PROTECTED]
http://www.PrecisOnline.com

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Allen E.
Elwood
Sent: Tuesday, May 23, 2006 10:16 AM
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Changed BASIC varname1,-1

Hi Guys,

Wellfwiw...I consider this correct.

If I have multiple variable dataset that I'm creating I want them to
stay in synch even if one of them is blank.

i.e.

ITEM.SHIPPED1,-1  = REC1
QTY.SHIPPED1,-1   = REC2
HANDLING.CODE1,-1 = REC3

Lets say that there was no special handling code on the third
iteration.
Now my forth iteration DOES have a special handling code, but now it
would appear as if it belonged to the third, not the forth item.

I would have to
ITEM.SHIPPED1,-1  = REC1
QTY.SHIPPED1,-1   = REC2
IF REC3 =  THEN
  HANDLING.CODE1,-1 := REC3
END ELSE
  HANDLING.CODE1,-1 = REC3
END

Which adds a lot of bulk to the code, especially if I have a lot of
variables to build.

Oh Well, you know that they say...One man's bug is another man's
feature!

(Or woman!)


Allen E. Elwood
www.tortillafc.com

Quality Code Since 1978

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Bruce Nichol
Sent: Tuesday, May 23, 2006 00:02
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] Changed BASIC varname1,-1


Goo'day, Kate,

At 17:56 23/05/06 +1200, you wrote:

Previously, code of A1,-1 = B, when B was blank made no change to
A.
Now a value mark is added.  If the last char is a value mark, it 
doesn't
add
another one.
I consider this a bug, as it changes old behaviour.
Does anyone but me think this is a problem?

Just quickly... IIRC, somebody mentioned a UV OPTION to give you
either which way... Last week or so. Sorry, but check the
archives

And some people say various LOCATEs are a problem but I find this
inserting a null to be a bigger bugger

Using Universe 10.1.18 PICK flavour on Windows.

Kate Stanton
Walstan Systems Ltd
4 Kelmarna Ave, Herne Bay, Auckland, New Zealand Phone +64 9 360 5310

Fax +64 9 376 0750
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/



--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.1.392 / Virus Database: 268.7.0/345 - Release Date:
22/05/06

Regards,

Bruce Nichol
Talon Computer Services
ALBURYNSW 2640
Australia

http://www.taloncs.com.au

Tel: +61 (0)411149636
Fax: +61 (0)260232119

If it ain't broke, fix it till it is!


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.392 / Virus Database: 268.7.0/345 - Release Date:
22/05/06
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Changed BASIC varname1,-1

2006-05-23 Thread GarryS
Someone once told me not to use 1,-1 just because of this problem but to
use a counter var.
K += 1
   MV 1,K  = datawhat

I have not tested this, but looks like you have the scenario to validate
this.

Garry Smith
Dir. Info Systems 
Charles McMurray Company
V# 559-292-5782   F# 559-346-6169



 -Original Message-
 From: Allen E. Elwood [SMTP:[EMAIL PROTECTED]
 Sent: Tuesday, May 23, 2006 9:16 AM
 To:   u2-users@listserver.u2ug.org
 Subject:  RE: [U2] Changed  BASIC varname1,-1
 
 Hi Guys,
 
 Wellfwiw...I consider this correct.
 
 If I have multiple variable dataset that I'm creating I want them to stay
 in
 synch even if one of them is blank.
 
 i.e.
 
 ITEM.SHIPPED1,-1  = REC1
 QTY.SHIPPED1,-1   = REC2
 HANDLING.CODE1,-1 = REC3
 
 Lets say that there was no special handling code on the third iteration.
 Now my forth iteration DOES have a special handling code, but now it would
 appear as if it belonged to the third, not the forth item.
 
 I would have to
 ITEM.SHIPPED1,-1  = REC1
 QTY.SHIPPED1,-1   = REC2
 IF REC3 =  THEN
   HANDLING.CODE1,-1 := REC3
 END ELSE
   HANDLING.CODE1,-1 = REC3
 END
 
 Which adds a lot of bulk to the code, especially if I have a lot of
 variables to build.
 
 Oh Well, you know that they say...One man's bug is another man's
 feature!
 
 (Or woman!)
 
 
 Allen E. Elwood
 www.tortillafc.com
 
 Quality Code Since 1978
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of Bruce Nichol
 Sent: Tuesday, May 23, 2006 00:02
 To: u2-users@listserver.u2ug.org
 Subject: Re: [U2] Changed BASIC varname1,-1
 
 
 Goo'day, Kate,
 
 At 17:56 23/05/06 +1200, you wrote:
 
 Previously, code of A1,-1 = B, when B was blank made no change to A.
 Now a value mark is added.  If the last char is a value mark, it doesn't
 add
 another one.
 I consider this a bug, as it changes old behaviour.
 Does anyone but me think this is a problem?
 
 Just quickly... IIRC, somebody mentioned a UV OPTION to give you either
 which way... Last week or so. Sorry, but check the archives
 
 And some people say various LOCATEs are a problem but I find this
 inserting a null to be a bigger bugger
 
 Using Universe 10.1.18 PICK flavour on Windows.
 
 Kate Stanton
 Walstan Systems Ltd
 4 Kelmarna Ave, Herne Bay, Auckland, New Zealand
 Phone +64 9 360 5310
 Fax +64 9 376 0750
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
 
 
 
 --
 No virus found in this incoming message.
 Checked by AVG Anti-Virus.
 Version: 7.1.392 / Virus Database: 268.7.0/345 - Release Date: 22/05/06
 
 Regards,
 
 Bruce Nichol
 Talon Computer Services
 ALBURYNSW 2640
 Australia
 
 http://www.taloncs.com.au
 
 Tel: +61 (0)411149636
 Fax: +61 (0)260232119
 
 If it ain't broke, fix it till it is!
 
 
 --
 No virus found in this outgoing message.
 Checked by AVG Anti-Virus.
 Version: 7.1.392 / Virus Database: 268.7.0/345 - Release Date: 22/05/06
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Changed BASIC varname1,-1

2006-05-23 Thread George Gallen
I use the pointer method when I can, hopefully one of the attributes will
  always be non-null, otherwise you waste an attribute. But it beats when
  you discover after many additions that your data is useless (hate when
  that happens)

George

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of Kevin King
 Sent: Tuesday, May 23, 2006 1:09 PM
 To: u2-users@listserver.u2ug.org
 Subject: RE: [U2] Changed BASIC varname1,-1
 
 
 If you want them to stay in sync, keep a pointer variable and update
 each multivalue in tandem using the variable (which points to the mv
 position) rather than use -1.  Personally, I think -1 is fine if
 there's only one array; if there are multiple to keep in tandem -1 is
 a yellow flag, fraught with all sorts of impending data corruption. 
 
 
 -Kevin
 [EMAIL PROTECTED]
 http://www.PrecisOnline.com
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Changed BASIC varname1,-1

2006-05-23 Thread Allen E. Elwood
Oh yeah, sure.  I agree.  Using LOCATE or FOR/NEXT is my preferred method,
but the -1 does come in handy in some cases, and actually was the main
point of the original posting (see bottom in case you weren't following this
thread)

I recently had to keep datasets aligned coming in from two different
sources, one sub-multivalue, the other just multivalued, so they had to have
separate FOR/NEXT LOCATE routines with the SMV loop nested in the MV loops
subroutine.  Oh, yeah, this was *fun*...heh...(mvBASE code)

The output is eventually to be used to adjust inventory at the LOT/PART
level if shipping does not match allocation.

BUILD.PART.LOT.ARRAY:
  *
  * Build array of SHIPPED LOTS/PARTS and their quantities from incoming
*SMV* format
  SVM.COUNT = DCOUNT(ORD.REC116,J,@SM)
  FOR PL.I = 1 TO SVM.COUNT
LINE.SHP = SHIP1,J,PL.I
PART.LOT = ORD.REC116,J,PL.I:'*':ORD.REC117,J,PL.I
LOCATE PART.LOT IN BOTH.PARTLOTS SETTING LP.INDEX THEN
  SHIPPED.QTYSLP.INDEX += LINE.SHP
END ELSE
  BOTH.PARTLOTS = INSERT(BOTH.PARTLOTS, LP.INDEX, 1, 1, PART.LOT)
  SHIPPED.QTYS  = INSERT(SHIPPED.QTYS,  LP.INDEX, 1, 1, LINE.SHP)
  ORDERED.QTYS  = INSERT(ORDERED.QTYS,  LP.INDEX, 1, 1, 0)
END
  NEXT PL.I
  *
  * Build array of ORDERED LOTS/PARTS and their quantities
  IF ORD.REC11,J   THEN ; *If Ordered part number exists THEN
PART.LOT = PART.NBR:'*':LOT.NBR
LOCATE PART.LOT IN BOTH.PARTLOTS SETTING LP.INDEX THEN
  IF BOTH.PARTLOTSLP.INDEX = PART.LOT THEN
ORDERED.QTYSLP.INDEX += LINE.ORD
  END ELSE
BOTH.PARTLOTS = INSERT(BOTH.PARTLOTS, LP.INDEX, 1, 1, PART.LOT)
SHIPPED.QTYS  = INSERT(SHIPPED.QTYS,  LP.INDEX, 1, 1, '0')
ORDERED.QTYS  = INSERT(ORDERED.QTYS,  LP.INDEX, 1, 1, LINE.ORD)
  END
END ELSE
  BOTH.PARTLOTS = INSERT(BOTH.PARTLOTS, LP.INDEX, 1, 1, PART.LOT)
  SHIPPED.QTYS  = INSERT(SHIPPED.QTYS,  LP.INDEX, 1, 1, '0')
  ORDERED.QTYS  = INSERT(ORDERED.QTYS,  LP.INDEX, 1, 1, LINE.ORD)
END
  END
  RETURN

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Kevin King
Sent: Tuesday, May 23, 2006 10:09
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Changed BASIC varname1,-1


If you want them to stay in sync, keep a pointer variable and update
each multivalue in tandem using the variable (which points to the mv
position) rather than use -1.  Personally, I think -1 is fine if
there's only one array; if there are multiple to keep in tandem -1 is
a yellow flag, fraught with all sorts of impending data corruption.


-Kevin
[EMAIL PROTECTED]
http://www.PrecisOnline.com

-Original Message-

snip
Previously, code of A1,-1 = B, when B was blank made no change to
A.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Changed BASIC varname1,-1

2006-05-23 Thread Ron Hutchings
How could shipping ever not match allocation?  Will wonders never cease?  
LOL


Original Message Follows
From: Allen E. Elwood [EMAIL PROTECTED]
Reply-To: u2-users@listserver.u2ug.org
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Changed  BASIC varname1,-1
Date: Tue, 23 May 2006 10:44:08 -0700


snip
The output is eventually to be used to adjust inventory at the LOT/PART
level if shipping does not match allocation.
snip

---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Changed BASIC varname1,-1

2006-05-23 Thread Kate Stanton

Is was not a bug, it was a feature!

We use it to add a subfield if there is data, but not to add blank 
subfields.  Great!


New behaviour is not as if $OPTIONS EXTRA.DELIM is set (thanks Ray), as it 
only adds one extra delim.  Still not suitable when keeping several items in 
synch.



Someone once told me not to use 1,-1 just because of this problem but to
use a counter var.
   K += 1
  MV 1,K  = datawhat

I have not tested this, but looks like you have the scenario to validate
this.

Garry Smith
Dir. Info Systems
Charles McMurray Company
V# 559-292-5782   F# 559-346-6169



Wellfwiw...I consider this correct.

If I have multiple variable dataset that I'm creating I want them to stay 
in

synch even if one of them is blank.

i.e.

ITEM.SHIPPED1,-1  = REC1
QTY.SHIPPED1,-1   = REC2
HANDLING.CODE1,-1 = REC3

Lets say that there was no special handling code on the third iteration.
Now my forth iteration DOES have a special handling code, but now it 
would

appear as if it belonged to the third, not the forth item.

I would have to
ITEM.SHIPPED1,-1  = REC1
QTY.SHIPPED1,-1   = REC2
IF REC3 =  THEN
  HANDLING.CODE1,-1 := REC3
END ELSE
  HANDLING.CODE1,-1 = REC3
END

Which adds a lot of bulk to the code, especially if I have a lot of
variables to build.

Oh Well, you know that they say...One man's bug is another man's
feature!

(Or woman!)


Allen E. Elwood
www.tortillafc.com

Quality Code Since 1978



Goo'day, Kate,

Just quickly... IIRC, somebody mentioned a UV OPTION to give you either
which way... Last week or so. Sorry, but check the archives

And some people say various LOCATEs are a problem but I find this
inserting a null to be a bigger bugger

Regards,

Bruce Nichol
Talon Computer Services
ALBURYNSW 2640
Australia

http://www.taloncs.com.au

Tel: +61 (0)411149636
Fax: +61 (0)260232119

If it ain't broke, fix it till it is! 

---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/