dbTalk Databases Forums  

Basic index & count behavior

comp.databases.pick comp.databases.pick


Discuss Basic index & count behavior in the comp.databases.pick forum.



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

Default Basic index & count behavior - 10-16-2010 , 12:29 PM






Hi,
Here is a simple test that shows different behavior in Universe vs
jBase. I would like to know what is the behavior on other systems
PICK, Cache, Revelation etc.
Which behavior do you think makes more sense ?
A = 'ABABA'
B = 'ABA'
CRT A,B
FOR I = 1 TO 5
POS = INDEX(A,B,I)
WHILE POS
CRT I:' POS=':POS
NEXT I
CRT 'CNT=':COUNT(A,B)

Universe:
ABABA ABA
1 POS=1
CNT=1

jBase:
ABABA ABA
1 POS=1
2 POS=3
CNT=2

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

Default Re: Basic index & count behavior - 10-16-2010 , 01:40 PM






<lucian_pata (AT) yahoo (DOT) com> wrote

Quote:
Hi,
Here is a simple test that shows different behavior in Universe vs
jBase. I would like to know what is the behavior on other systems
PICK, Cache, Revelation etc.
Which behavior do you think makes more sense ?
A = 'ABABA'
B = 'ABA'
CRT A,B
FOR I = 1 TO 5
POS = INDEX(A,B,I)
WHILE POS
CRT I:' POS=':POS
NEXT I
CRT 'CNT=':COUNT(A,B)

Universe:
ABABA ABA
1 POS=1
CNT=1

jBase:
ABABA ABA
1 POS=1
2 POS=3
CNT=2
The first case, as it counts only distinct occurrences of 'ABA'
in 'ABABA' whereas the second case also counts the overlapping
(non-distinct) occurrence.

My uniData gives the second case; perhaps due to a UDT setting?

--
frosty

Reply With Quote
  #3  
Old   
Martin Phillips
 
Posts: n/a

Default Re: Basic index & count behavior - 10-18-2010 , 03:51 AM



Hi all,

Unidata is documented as saying the in BasicTypes P and M, it allows
overlapping substrings. The D3 documentation doesn't mention it but I
assume that Unidata behaves as it does in these modes for
compatibility.

UniVerse has a compiler option to turn on/off overlapping substrings.

QM does not allow overlapping substrings. If someone needed it, I'm
sure we could make it an option.

Historically, Prime Information and PI/open dod no tallow overlapping
substrings.

Don't know about the rest.


Martin Phillips, Ladybridge Systems

Reply With Quote
  #4  
Old   
Rob Allen
 
Posts: n/a

Default Re: Basic index & count behavior - 10-18-2010 , 02:16 PM



Reality counts the overlapping substrings; the output is the same as
the jBase example.

Our ancient version of Reality doesn't support the WHILE clause in a
FOR/NEXT loop, so I had to modify the program slightly.


Rob Allen
ADP

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.