[V4MD] pointer at the same table by binary_link

Ruslan Zasukhin sunshine at public.kherson.ua
Tue Sep 13 00:15:43 CDT 2005


On 9/12/05 11:03 PM, "info at vallemediatime.com" <info at vallemediatime.com>
wrote:

>> What exactly problem is ?
> 
> Difficult to tell you Ruslan,
> e.g. look at this simple script,
> I've checked all the variables and these are good,
> but when I use addLink with the first gLinkName all works fine, if I change
> the
> gLinkName and other variables, the getLinkCount dont' work and nothing
> happens, because
> the line:
> count = link.countLinked(i, gTab_A, gTab_B)
> return me always 0
> 
> on addLink
> link = gDb.link(gLinkName)
> a = gDB.table(gTableName).RecID
> b = value(member("Tab_B_ID").text)
> link.linkRecords(a, b)
> getLinkCount
> end

--------------------------
> on getLinkCount
> link = gTab_B.link(1)
> recCount = gTab_B.recordCount
> counter = 0
> repeat with i = 1 to recCount
> count = link.countLinked(i,  gTab_A, gTab_B)
> counter = counter + count
> end repeat
> member("dLinkCount").text = string(counter)
> end

About getLinkCount()

1) this is hard function by theory.
  for big tables it can be long.
  why you need at all to count this ???

2) 

> repeat with i = 1 to recCount
> count = link.countLinked(i,  gTab_A, gTab_B)

This is wrong code.

You can have recCount = 10, but Table have 100 physical record for example.
Rest 90 -- are deleted.
 
So your code will iterate only first 10 physical recIDs.

You need do loop to Table.physicalRecordCount


Again, why you need this ????

* We can ask link itself about this in ZERO time ...
    just never think somebody need this

-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina-beta mailing list