[V4MD] pointer at the same table by binary_link

info at vallemediatime.com info at vallemediatime.com
Tue Sep 13 20:35:15 CDT 2005


Hi Ruslan,
I've change myCode with your usefull suggestion, now I use:

on addLink (linkName, T1, T2)
link = gDb.link(linkName)
a = gDB.table(T1).RecID
b = value(member("T2_ID").text)
link.linkRecords(a, b)
end if
end

on getLinkCount (linkName, T1, T2)
link = gDb.table(T2).link(1)
recCount = gDb.table(T1).PhysicalRecordCount
counter = 0
repeat with i = 1 to recCount
count = link.countLinked(i, gDB.table(T1), gDB.table(T2))
counter = counter + count
end repeat
member("dLinkCount").text = string(counter)
end

I hope that this is better :-)

But my problem remain, when I addLink to T1<>T2 all works, when addLink
T3<>T2 I have the right value from line
link.linkRecords(a, b)
but if I call getLinkCount  I get always count  = 0
Do you see some mistake?
Thanks
Paolo


----- Original Message -----
From: "Ruslan Zasukhin" <sunshine at public.kherson.ua>
To: <valentina-beta at lists.macserve.net>
Sent: Tuesday, September 13, 2005 11:28 AM
Subject: Re: [V4MD] pointer at the same table by binary_link


> On 9/13/05 12:45 AM, "info at vallemediatime.com" <info at vallemediatime.com>
> wrote:
>
> >> 1) this is hard function by theory.
> >>   for big tables it can be long.
> >>   why you need at all to count this ???
> >
> > I don't have big tables, I want give this info to final user every time
he
> > create a new link
>
> In any case it is not correct place to call counting from AddLink handler.
> Call it from other place.
>
>
> >> 2)
> >>> repeat with i = 1 to recCount
> >>> count = link.countLinked(i,  gTab_A, gTab_B)
> >> This is wrong code.
> >
> > Ok, but in your example "Link_Binart_Records" I read and learn:
> > count = link.countLinked(i, person, phones)
> > wrong code? wrong example?
>
>      count = link.countLinked(i, person, phones)
>
> This line itself is correct.
>
> Mistake in your code is that you need loop TO table.PhysicalRecordCount.
>
> Do you say that our example use Table.RecordCount ???
> Then this is also mistake.
>
>
> >> 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
> > Ok I can try it
>
>
>
>
> >> * We can ask link itself about this in ZERO time ...
> >>     just never think somebody need this
> > I don't understand
>
> I mean that V4MD API (and other) do not have such function now.
>
> It seems you need something as
>
>     Vlink.getTotalLinksCount
>
> Well, why not. I think this function can be fast and not hard todo.
>
> Add it into Mantis as request please.
>
>
> --
> 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]
>
>
> _______________________________________________
> Valentina-beta mailing list
> Valentina-beta at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina-beta
>
>
>
> --
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.10.21/96 - Release Date: 10/09/2005
>
>



More information about the Valentina-beta mailing list