dbTalk Databases Forums  

D3 v Universe <-1> with null

comp.databases.pick comp.databases.pick


Discuss D3 v Universe <-1> with null in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default D3 v Universe <-1> with null - 05-17-2006 , 11:29 PM






Watch out for this discrepancy between Universe and D3
Universe does not insert null using the -1 in a replace.

Given the following program

AM=CHAR(254)
VM=CHAR(253)
A=1:VM:2:VM:3:VM:VM:5:VM:6:VM:VM:VM:9
A:=AM:'A':VM:'B':VM:'C':VM:VM:'E':VM:'F':VM:VM:VM: 'I'
A:=AM:'A1':VM:'B2':VM:'C3':VM:VM:'E5':VM:'F6':VM:V M:VM:'I9'
X=''
C=DCOUNT(A<1>,VM)
FOR J=1 TO C
FOR I=1 TO 3
X<I,-1>=A<I,J>
NEXT I
NEXT J
FOR J=1 TO C
CRT J:
FOR I=1 TO 3
CRT ' ':X<I,J>:
NEXT I
CRT
NEXT J

On D3 the output is
1 1 A A1
2 2 B B2
3 3 C C3
4
5 5 E E5
6 6 F F6
7
8
9 9 I I9

But on Universe it is
1 1 A A1
2 2 B B2
3 3 C C3
4 5 E E5
5 6 F F6
6 9 I I9
7
8
9

Ouch! That one caused me some bother.

Jeremy Thomson


Reply With Quote
  #2  
Old   
Mark Brown
 
Posts: n/a

Default Re: D3 v Universe <-1> with null - 05-18-2006 , 01:32 AM






This is one of those "bugs" that's been around since < R83 that we all
laughed about when they said, "that's not a bug, that's a feature" or when
we said we didn't want to change it because it would "break" otherwise
working code.

Logically does this make sense: Add nothing to the end of nothing to get
something this neither nothing (null) nor anything at all (it's a lone
attribute mark).

Something in the back of your head says, "Nothing plus nothing equals
nothing". But somehow the working public has decided that adding a null to
the end of a dynamic array somehow should make the array "different".

THIS is why there are different flavors.

Mark Brown



<panzerboy (AT) gmail (DOT) com> wrote

Quote:
Watch out for this discrepancy between Universe and D3
Universe does not insert null using the -1 in a replace.

Given the following program

AM=CHAR(254)
VM=CHAR(253)
A=1:VM:2:VM:3:VM:VM:5:VM:6:VM:VM:VM:9
A:=AM:'A':VM:'B':VM:'C':VM:VM:'E':VM:'F':VM:VM:VM: 'I'
A:=AM:'A1':VM:'B2':VM:'C3':VM:VM:'E5':VM:'F6':VM:V M:VM:'I9'
X=''
C=DCOUNT(A<1>,VM)
FOR J=1 TO C
FOR I=1 TO 3
X<I,-1>=A<I,J
NEXT I
NEXT J
FOR J=1 TO C
CRT J:
FOR I=1 TO 3
CRT ' ':X<I,J>:
NEXT I
CRT
NEXT J

On D3 the output is
1 1 A A1
2 2 B B2
3 3 C C3
4
5 5 E E5
6 6 F F6
7
8
9 9 I I9

But on Universe it is
1 1 A A1
2 2 B B2
3 3 C C3
4 5 E E5
5 6 F F6
6 9 I I9
7
8
9

Ouch! That one caused me some bother.

Jeremy Thomson




Reply With Quote
  #3  
Old   
AT
 
Posts: n/a

Default Re: D3 v Universe <-1> with null - 05-18-2006 , 01:50 AM



$OPTION EXTRA.DELIM solves that problem for you.

If you wish to compile your code in PICK FLAVOUR either modify the
BASIC VOC entry with the PICK.FORMAT or add the $OPTION PICK to the
code.


Reply With Quote
  #4  
Old   
Tony Gravagno
 
Posts: n/a

Default Re: D3 v Universe <-1> with null - 05-18-2006 , 08:02 AM



I have many applications for this and definitely see it as a feature.
I had no idea about the Universe behavior so this thread has been
helpful.

T

"Mark Brown" wrote:

Quote:
This is one of those "bugs" that's been around since < R83 that we all
laughed about when they said, "that's not a bug, that's a feature" or when
we said we didn't want to change it because it would "break" otherwise
working code.

Logically does this make sense: Add nothing to the end of nothing to get
something this neither nothing (null) nor anything at all (it's a lone
attribute mark).

Something in the back of your head says, "Nothing plus nothing equals
nothing". But somehow the working public has decided that adding a null to
the end of a dynamic array somehow should make the array "different".

THIS is why there are different flavors.

Mark Brown



panzerboy (AT) gmail (DOT) com> wrote in message
news:1147926562.891502.132520 (AT) j73g2000cwa (DOT) googlegroups.com...
Watch out for this discrepancy between Universe and D3
Universe does not insert null using the -1 in a replace.

Given the following program

AM=CHAR(254)
VM=CHAR(253)
A=1:VM:2:VM:3:VM:VM:5:VM:6:VM:VM:VM:9
A:=AM:'A':VM:'B':VM:'C':VM:VM:'E':VM:'F':VM:VM:VM: 'I'
A:=AM:'A1':VM:'B2':VM:'C3':VM:VM:'E5':VM:'F6':VM:V M:VM:'I9'
X=''
C=DCOUNT(A<1>,VM)
FOR J=1 TO C
FOR I=1 TO 3
X<I,-1>=A<I,J
NEXT I
NEXT J
FOR J=1 TO C
CRT J:
FOR I=1 TO 3
CRT ' ':X<I,J>:
NEXT I
CRT
NEXT J

On D3 the output is
1 1 A A1
2 2 B B2
3 3 C C3
4
5 5 E E5
6 6 F F6
7
8
9 9 I I9

But on Universe it is
1 1 A A1
2 2 B B2
3 3 C C3
4 5 E E5
5 6 F F6
6 9 I I9
7
8
9

Ouch! That one caused me some bother.

Jeremy Thomson




Reply With Quote
  #5  
Old   
Ed Sheehan
 
Posts: n/a

Default Re: D3 v Universe <-1> with null - 05-18-2006 , 09:20 AM



For those of us who must program on multiple platforms, the obvious solution
is to _always_ find a way to produce a real number for the append. It will
never become an issue that way. And don't depend on any given platform to
forever "default" to allowing/disallowing any "assumed" behavior. If it's
not explicitly documented, it may come and go with any point release. And
even if it _is_ documented, I have found that it's always safer to code as
conservatively as possible, both for readability, and for bug/feature-change
avoidance.

Ed

<panzerboy (AT) gmail (DOT) com> wrote

Quote:
Watch out for this discrepancy between Universe and D3
Universe does not insert null using the -1 in a replace.

Given the following program

AM=CHAR(254)
VM=CHAR(253)
A=1:VM:2:VM:3:VM:VM:5:VM:6:VM:VM:VM:9
A:=AM:'A':VM:'B':VM:'C':VM:VM:'E':VM:'F':VM:VM:VM: 'I'
A:=AM:'A1':VM:'B2':VM:'C3':VM:VM:'E5':VM:'F6':VM:V M:VM:'I9'
X=''
C=DCOUNT(A<1>,VM)
FOR J=1 TO C
FOR I=1 TO 3
X<I,-1>=A<I,J
NEXT I
NEXT J
FOR J=1 TO C
CRT J:
FOR I=1 TO 3
CRT ' ':X<I,J>:
NEXT I
CRT
NEXT J

On D3 the output is
1 1 A A1
2 2 B B2
3 3 C C3
4
5 5 E E5
6 6 F F6
7
8
9 9 I I9

But on Universe it is
1 1 A A1
2 2 B B2
3 3 C C3
4 5 E E5
5 6 F F6
6 9 I I9
7
8
9

Ouch! That one caused me some bother.

Jeremy Thomson




Reply With Quote
  #6  
Old   
AT
 
Posts: n/a

Default Re: D3 v Universe <-1> with null - 05-18-2006 , 11:18 PM



What a bunch of topposters people are here :-)
Oh well, when in Rome...
I agree with Ed. Back when I did a lot of cross platform work I would
never use the <-1>.
Having spent 13 years in one environment I've gotten out of the habit.
Still theres these new fangled $OPTIONS compiler directives these days.
I've set up an include file "compileroptions.inc" on the D3 and
Universe machines.
The D3 machine has nothing but a comment in it.
The Universe one has
$OPTIONS EXTRA.DELIM
$OPTIONS R83.LOCATE

Now I can have the same program code on the different machines & they
do the same thing. Coo-ol.
Back in 'the days' used have a locate subroutine that had the proper
format for Altos, GA, Universe, Reality. 75% or it was commented out
lines of the locate format for the other machines. :-)

Ed Sheehan wrote:
Quote:
For those of us who must program on multiple platforms, the obvious solution
is to _always_ find a way to produce a real number for the append. It will
never become an issue that way. And don't depend on any given platform to
forever "default" to allowing/disallowing any "assumed" behavior. If it's
not explicitly documented, it may come and go with any point release. And
even if it _is_ documented, I have found that it's always safer to code as
conservatively as possible, both for readability, and for bug/feature-change
avoidance.

Ed
My first top posted reply, I feel kinda... dirty.

Jeremy Thomson



Reply With Quote
  #7  
Old   
murthi
 
Posts: n/a

Default Re: D3 v Universe <-1> with null - 05-19-2006 , 07:25 AM



<panzerboy (AT) gmail (DOT) com> wrote

Quote:
What a bunch of topposters people are here :-)
Oh well, when in Rome...
I agree with Ed. Back when I did a lot of cross platform work I would
never use the <-1>.
Having spent 13 years in one environment I've gotten out of the habit.
Still theres these new fangled $OPTIONS compiler directives these days.
I've set up an include file "compileroptions.inc" on the D3 and
Universe machines.
The D3 machine has nothing but a comment in it.
The Universe one has
$OPTIONS EXTRA.DELIM
$OPTIONS R83.LOCATE

Now I can have the same program code on the different machines & they
do the same thing. Coo-ol.
Back in 'the days' used have a locate subroutine that had the proper
format for Altos, GA, Universe, Reality. 75% or it was commented out
lines of the locate format for the other machines. :-)

Ed Sheehan wrote:
For those of us who must program on multiple platforms, the obvious
solution
is to _always_ find a way to produce a real number for the append. It
will
never become an issue that way. And don't depend on any given platform to
forever "default" to allowing/disallowing any "assumed" behavior. If it's
not explicitly documented, it may come and go with any point release. And
even if it _is_ documented, I have found that it's always safer to code
as
conservatively as possible, both for readability, and for
bug/feature-change
avoidance.

Ed

My first top posted reply, I feel kinda... dirty.

Jeremy Thomson









Quote:
bunch of irrelevant stuff....








Quote:
bunch of irrelevant stuff....








Quote:
bunch of irrelevant stuff....








Quote:
bunch of irrelevant stuff....








buch of irrelevant stuff....









buch of irrelevant stuff....









Quote:
bunch of irrelevant stuff....








Quote:
bunch of irrelevant stuff....








Quote:
bunch of irrelevant stuff....


Thank God and welcome to the club. Now don't you think this bottom post is a
waste of time and effort?
Chandru Murthi




Reply With Quote
  #8  
Old   
frosty
 
Posts: n/a

Default [META] Top/Bottom Posting (was: D3 v Universe <-1> with null) - 05-23-2006 , 01:53 PM



murthi wrote:
[snip]
Quote:
Thank God and welcome to the club. Now don't you think this bottom post is
a waste of time and effort?
Chandru Murthi
Did you mean to write "this botton posting?"

I would wholeheartedly agree with what you
wrote! =`:^°

--
frosty




Reply With Quote
  #9  
Old   
murthi
 
Posts: n/a

Default Re: D3 v Universe <-1> with null - 06-29-2006 , 11:58 AM



Took you over a month to scroll down, did it ?

Chandru

"Tom Rauschenbach" <tomsusenet (AT) tomsdomain (DOT) org> wrote

Quote:
On Fri, 19 May 2006 12:25:40 +0000, murthi wrote:

panzerboy (AT) gmail (DOT) com> wrote in message
news:1148012279.954923.249890 (AT) j55g2000cwa (DOT) googlegroups.com...
What a bunch of topposters people are here :-)
Oh well, when in Rome...
I agree with Ed. Back when I did a lot of cross platform work I would
never use the <-1>.
Having spent 13 years in one environment I've gotten out of the habit.
Still theres these new fangled $OPTIONS compiler directives these days.
I've set up an include file "compileroptions.inc" on the D3 and
Universe machines.
The D3 machine has nothing but a comment in it.
The Universe one has
$OPTIONS EXTRA.DELIM
$OPTIONS R83.LOCATE

Now I can have the same program code on the different machines & they
do the same thing. Coo-ol.
Back in 'the days' used have a locate subroutine that had the proper
format for Altos, GA, Universe, Reality. 75% or it was commented out
lines of the locate format for the other machines. :-)

Ed Sheehan wrote:
For those of us who must program on multiple platforms, the obvious
solution
is to _always_ find a way to produce a real number for the append. It
will
never become an issue that way. And don't depend on any given platform
to
forever "default" to allowing/disallowing any "assumed" behavior. If
it's
not explicitly documented, it may come and go with any point release.
And
even if it _is_ documented, I have found that it's always safer to code
as
conservatively as possible, both for readability, and for
bug/feature-change
avoidance.

Ed

My first top posted reply, I feel kinda... dirty.

Jeremy Thomson










bunch of irrelevant stuff....









bunch of irrelevant stuff....









bunch of irrelevant stuff....









bunch of irrelevant stuff....









buch of irrelevant stuff....









buch of irrelevant stuff....









bunch of irrelevant stuff....









bunch of irrelevant stuff....









bunch of irrelevant stuff....



Thank God and welcome to the club. Now don't you think this bottom post
is a
waste of time and effort?
Chandru Murthi



Nope.







Reply With Quote
  #10  
Old   
Jeffrey Kaufman
 
Posts: n/a

Default Re: D3 v Universe <-1> with null - 06-29-2006 , 12:13 PM



LOL. Good one.

"murthi" <c_xyz_murthi (AT) seeing_xyz_green (DOT) net> wrote

Quote:
Took you over a month to scroll down, did it ?

Chandru

"Tom Rauschenbach" <tomsusenet (AT) tomsdomain (DOT) org> wrote in message
newsan.2006.06.29.16.46.30.944035 (AT) tomsdomain (DOT) org...
On Fri, 19 May 2006 12:25:40 +0000, murthi wrote:

panzerboy (AT) gmail (DOT) com> wrote in message
news:1148012279.954923.249890 (AT) j55g2000cwa (DOT) googlegroups.com...
What a bunch of topposters people are here :-)
Oh well, when in Rome...
I agree with Ed. Back when I did a lot of cross platform work I would
never use the <-1>.
Having spent 13 years in one environment I've gotten out of the habit.
Still theres these new fangled $OPTIONS compiler directives these
days.
I've set up an include file "compileroptions.inc" on the D3 and
Universe machines.
The D3 machine has nothing but a comment in it.
The Universe one has
$OPTIONS EXTRA.DELIM
$OPTIONS R83.LOCATE

Now I can have the same program code on the different machines & they
do the same thing. Coo-ol.
Back in 'the days' used have a locate subroutine that had the proper
format for Altos, GA, Universe, Reality. 75% or it was commented out
lines of the locate format for the other machines. :-)

Ed Sheehan wrote:
For those of us who must program on multiple platforms, the obvious
solution
is to _always_ find a way to produce a real number for the append. It
will
never become an issue that way. And don't depend on any given
platform
to
forever "default" to allowing/disallowing any "assumed" behavior. If
it's
not explicitly documented, it may come and go with any point release.
And
even if it _is_ documented, I have found that it's always safer to
code
as
conservatively as possible, both for readability, and for
bug/feature-change
avoidance.

Ed

My first top posted reply, I feel kinda... dirty.

Jeremy Thomson










bunch of irrelevant stuff....









bunch of irrelevant stuff....









bunch of irrelevant stuff....









bunch of irrelevant stuff....









buch of irrelevant stuff....









buch of irrelevant stuff....









bunch of irrelevant stuff....









bunch of irrelevant stuff....









bunch of irrelevant stuff....



Thank God and welcome to the club. Now don't you think this bottom post
is a
waste of time and effort?
Chandru Murthi



Nope.









Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.