[V4MD] pointer at the same table by binary_link

Ruslan Zasukhin sunshine at public.kherson.ua
Wed Sep 14 09:34:53 CDT 2005


On 9/13/05 9:35 PM, "info at vallemediatime.com" <info at vallemediatime.com>
wrote:

Hi Paolo,

> 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)
     I think here better to use .link(linkName)
    
    because tomorrow you can add more links, and your code
    suddenly will start work wrong

> 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 :-)

Yes, btw, I know Lingo allow do some classes?

May be even better use classes :-))

 
> 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)

    what means here "right value" ?

> but if I call getLinkCount  I get always count  = 0
> Do you see some mistake?

Have you check after this your db using e.g. Vstudio ?
Are records linked ?

May be send us simple project which do this ?

BY THE WAY!  
    
    Note that in first function you use Link( name )
    but in second link( 1 ).

    May be you already have come into this trap,
    and you use wrong link in fact in second case!!!

-- 
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